@tsed/common 6.87.1 → 6.89.0

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 (536) hide show
  1. package/lib/{PlatformModule.d.ts → cjs/PlatformModule.d.ts} +0 -0
  2. package/lib/cjs/PlatformModule.js +11 -0
  3. package/lib/cjs/PlatformModule.js.map +1 -0
  4. package/lib/{builder → cjs/builder}/PlatformBuilder.d.ts +0 -1
  5. package/lib/cjs/builder/PlatformBuilder.js +248 -0
  6. package/lib/cjs/builder/PlatformBuilder.js.map +1 -0
  7. package/lib/{builder → cjs/builder}/PlatformControllerBuilder.d.ts +0 -0
  8. package/lib/cjs/builder/PlatformControllerBuilder.js +85 -0
  9. package/lib/cjs/builder/PlatformControllerBuilder.js.map +1 -0
  10. package/lib/{config → cjs/config}/index.d.ts +0 -0
  11. package/lib/cjs/config/index.js +7 -0
  12. package/lib/cjs/config/index.js.map +1 -0
  13. package/lib/{config → cjs/config}/interfaces/ConverterSettings.d.ts +0 -0
  14. package/lib/cjs/config/interfaces/ConverterSettings.js +3 -0
  15. package/lib/cjs/config/interfaces/ConverterSettings.js.map +1 -0
  16. package/lib/{config → cjs/config}/interfaces/EndpointDirectoriesSettings.d.ts +0 -0
  17. package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js +3 -0
  18. package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js.map +1 -0
  19. package/lib/{config → cjs/config}/interfaces/PlatformLoggerSettings.d.ts +0 -0
  20. package/lib/cjs/config/interfaces/PlatformLoggerSettings.js +3 -0
  21. package/lib/cjs/config/interfaces/PlatformLoggerSettings.js.map +1 -0
  22. package/lib/{config → cjs/config}/interfaces/PlatformMulterSettings.d.ts +0 -0
  23. package/lib/cjs/config/interfaces/PlatformMulterSettings.js +3 -0
  24. package/lib/cjs/config/interfaces/PlatformMulterSettings.js.map +1 -0
  25. package/lib/{config → cjs/config}/interfaces/PlatformStaticsSettings.d.ts +0 -0
  26. package/lib/cjs/config/interfaces/PlatformStaticsSettings.js +3 -0
  27. package/lib/cjs/config/interfaces/PlatformStaticsSettings.js.map +1 -0
  28. package/lib/{config → cjs/config}/interfaces/index.d.ts +0 -0
  29. package/lib/cjs/config/interfaces/index.js +8 -0
  30. package/lib/cjs/config/interfaces/index.js.map +1 -0
  31. package/lib/{config → cjs/config}/services/PlatformConfiguration.d.ts +0 -0
  32. package/lib/cjs/config/services/PlatformConfiguration.js +195 -0
  33. package/lib/cjs/config/services/PlatformConfiguration.js.map +1 -0
  34. package/lib/{constants → cjs/constants}/routerOptions.d.ts +0 -0
  35. package/lib/cjs/constants/routerOptions.js +5 -0
  36. package/lib/cjs/constants/routerOptions.js.map +1 -0
  37. package/lib/{decorators → cjs/decorators}/httpServer.d.ts +0 -0
  38. package/lib/cjs/decorators/httpServer.js +31 -0
  39. package/lib/cjs/decorators/httpServer.js.map +1 -0
  40. package/lib/{decorators → cjs/decorators}/httpsServer.d.ts +0 -0
  41. package/lib/cjs/decorators/httpsServer.js +31 -0
  42. package/lib/cjs/decorators/httpsServer.js.map +1 -0
  43. package/lib/{decorators → cjs/decorators}/index.d.ts +1 -0
  44. package/lib/cjs/decorators/index.js +23 -0
  45. package/lib/cjs/decorators/index.js.map +1 -0
  46. package/lib/{decorators → cjs/decorators}/method/acceptMime.d.ts +0 -0
  47. package/lib/cjs/decorators/method/acceptMime.js +28 -0
  48. package/lib/cjs/decorators/method/acceptMime.js.map +1 -0
  49. package/lib/{decorators → cjs/decorators}/method/endpointFn.d.ts +0 -0
  50. package/lib/cjs/decorators/method/endpointFn.js +15 -0
  51. package/lib/cjs/decorators/method/endpointFn.js.map +1 -0
  52. package/lib/{decorators → cjs/decorators}/method/location.d.ts +0 -0
  53. package/lib/cjs/decorators/method/location.js +6 -0
  54. package/lib/cjs/decorators/method/location.js.map +1 -0
  55. package/lib/{decorators → cjs/decorators}/method/redirect.d.ts +0 -0
  56. package/lib/cjs/decorators/method/redirect.js +6 -0
  57. package/lib/cjs/decorators/method/redirect.js.map +1 -0
  58. package/lib/{decorators → cjs/decorators}/method/route.d.ts +0 -0
  59. package/lib/cjs/decorators/method/route.js +13 -0
  60. package/lib/cjs/decorators/method/route.js.map +1 -0
  61. package/lib/cjs/decorators/method/view.d.ts +25 -0
  62. package/lib/cjs/decorators/method/view.js +34 -0
  63. package/lib/cjs/decorators/method/view.js.map +1 -0
  64. package/lib/{decorators → cjs/decorators}/multer/index.d.ts +0 -0
  65. package/lib/cjs/decorators/multer/index.js +7 -0
  66. package/lib/cjs/decorators/multer/index.js.map +1 -0
  67. package/lib/{decorators → cjs/decorators}/multer/multerFileSize.d.ts +0 -0
  68. package/lib/cjs/decorators/multer/multerFileSize.js +35 -0
  69. package/lib/cjs/decorators/multer/multerFileSize.js.map +1 -0
  70. package/lib/{decorators → cjs/decorators}/multer/multerOptions.d.ts +0 -0
  71. package/lib/cjs/decorators/multer/multerOptions.js +52 -0
  72. package/lib/cjs/decorators/multer/multerOptions.js.map +1 -0
  73. package/lib/{decorators → cjs/decorators}/multer/multipartFile.d.ts +0 -0
  74. package/lib/cjs/decorators/multer/multipartFile.js +78 -0
  75. package/lib/cjs/decorators/multer/multipartFile.js.map +1 -0
  76. package/lib/{decorators → cjs/decorators}/params/endpointInfo.d.ts +0 -0
  77. package/lib/cjs/decorators/params/endpointInfo.js +21 -0
  78. package/lib/cjs/decorators/params/endpointInfo.js.map +1 -0
  79. package/lib/{decorators → cjs/decorators}/params/error.d.ts +0 -0
  80. package/lib/cjs/decorators/params/error.js +20 -0
  81. package/lib/cjs/decorators/params/error.js.map +1 -0
  82. package/lib/{decorators → cjs/decorators}/params/next.d.ts +0 -0
  83. package/lib/cjs/decorators/params/next.js +21 -0
  84. package/lib/cjs/decorators/params/next.js.map +1 -0
  85. package/lib/{decorators → cjs/decorators}/params/request.d.ts +0 -0
  86. package/lib/cjs/decorators/params/request.js +39 -0
  87. package/lib/cjs/decorators/params/request.js.map +1 -0
  88. package/lib/{decorators → cjs/decorators}/params/response.d.ts +0 -0
  89. package/lib/cjs/decorators/params/response.js +33 -0
  90. package/lib/cjs/decorators/params/response.js.map +1 -0
  91. package/lib/{decorators → cjs/decorators}/params/responseData.d.ts +0 -0
  92. package/lib/cjs/decorators/params/responseData.js +21 -0
  93. package/lib/cjs/decorators/params/responseData.js.map +1 -0
  94. package/lib/{domain → cjs/domain}/AnyToPromiseWithCtx.d.ts +0 -0
  95. package/lib/cjs/domain/AnyToPromiseWithCtx.js +35 -0
  96. package/lib/cjs/domain/AnyToPromiseWithCtx.js.map +1 -0
  97. package/lib/{domain → cjs/domain}/ControllerProvider.d.ts +0 -0
  98. package/lib/cjs/domain/ControllerProvider.js +51 -0
  99. package/lib/cjs/domain/ControllerProvider.js.map +1 -0
  100. package/lib/{domain → cjs/domain}/EndpointMetadata.d.ts +0 -0
  101. package/lib/cjs/domain/EndpointMetadata.js +111 -0
  102. package/lib/cjs/domain/EndpointMetadata.js.map +1 -0
  103. package/lib/{domain → cjs/domain}/HandlerMetadata.d.ts +0 -0
  104. package/lib/cjs/domain/HandlerMetadata.js +57 -0
  105. package/lib/cjs/domain/HandlerMetadata.js.map +1 -0
  106. package/lib/{domain → cjs/domain}/PlatformContext.d.ts +0 -0
  107. package/lib/cjs/domain/PlatformContext.js +85 -0
  108. package/lib/cjs/domain/PlatformContext.js.map +1 -0
  109. package/lib/{domain → cjs/domain}/PlatformRouteDetails.d.ts +0 -0
  110. package/lib/cjs/domain/PlatformRouteDetails.js +24 -0
  111. package/lib/cjs/domain/PlatformRouteDetails.js.map +1 -0
  112. package/lib/{domain → cjs/domain}/PropertyMetadata.d.ts +0 -0
  113. package/lib/cjs/domain/PropertyMetadata.js +28 -0
  114. package/lib/cjs/domain/PropertyMetadata.js.map +1 -0
  115. package/lib/{domain → cjs/domain}/index.d.ts +0 -0
  116. package/lib/cjs/domain/index.js +11 -0
  117. package/lib/cjs/domain/index.js.map +1 -0
  118. package/lib/{index.d.ts → cjs/index.d.ts} +0 -1
  119. package/lib/cjs/index.js +37 -0
  120. package/lib/cjs/index.js.map +1 -0
  121. package/lib/{interfaces → cjs/interfaces}/AfterInit.d.ts +0 -0
  122. package/lib/cjs/interfaces/AfterInit.js +3 -0
  123. package/lib/cjs/interfaces/AfterInit.js.map +1 -0
  124. package/lib/{interfaces → cjs/interfaces}/AfterListen.d.ts +0 -0
  125. package/lib/cjs/interfaces/AfterListen.js +3 -0
  126. package/lib/cjs/interfaces/AfterListen.js.map +1 -0
  127. package/lib/{interfaces → cjs/interfaces}/AfterRoutesInit.d.ts +0 -0
  128. package/lib/cjs/interfaces/AfterRoutesInit.js +3 -0
  129. package/lib/cjs/interfaces/AfterRoutesInit.js.map +1 -0
  130. package/lib/{interfaces → cjs/interfaces}/BeforeInit.d.ts +0 -0
  131. package/lib/cjs/interfaces/BeforeInit.js +3 -0
  132. package/lib/cjs/interfaces/BeforeInit.js.map +1 -0
  133. package/lib/{interfaces → cjs/interfaces}/BeforeListen.d.ts +0 -0
  134. package/lib/cjs/interfaces/BeforeListen.js +3 -0
  135. package/lib/cjs/interfaces/BeforeListen.js.map +1 -0
  136. package/lib/{interfaces → cjs/interfaces}/BeforeRoutesInit.d.ts +0 -0
  137. package/lib/cjs/interfaces/BeforeRoutesInit.js +3 -0
  138. package/lib/cjs/interfaces/BeforeRoutesInit.js.map +1 -0
  139. package/lib/{interfaces → cjs/interfaces}/HandlerType.d.ts +0 -0
  140. package/lib/cjs/interfaces/HandlerType.js +17 -0
  141. package/lib/cjs/interfaces/HandlerType.js.map +1 -0
  142. package/lib/{interfaces → cjs/interfaces}/IncomingEvent.d.ts +0 -0
  143. package/lib/cjs/interfaces/IncomingEvent.js +3 -0
  144. package/lib/cjs/interfaces/IncomingEvent.js.map +1 -0
  145. package/lib/{interfaces → cjs/interfaces}/OnReady.d.ts +0 -0
  146. package/lib/cjs/interfaces/OnReady.js +3 -0
  147. package/lib/cjs/interfaces/OnReady.js.map +1 -0
  148. package/lib/{interfaces → cjs/interfaces}/OnRequest.d.ts +0 -0
  149. package/lib/cjs/interfaces/OnRequest.js +3 -0
  150. package/lib/cjs/interfaces/OnRequest.js.map +1 -0
  151. package/lib/{interfaces → cjs/interfaces}/OnResponse.d.ts +0 -0
  152. package/lib/cjs/interfaces/OnResponse.js +3 -0
  153. package/lib/cjs/interfaces/OnResponse.js.map +1 -0
  154. package/lib/{interfaces → cjs/interfaces}/OnRoutesInit.d.ts +0 -0
  155. package/lib/cjs/interfaces/OnRoutesInit.js +3 -0
  156. package/lib/cjs/interfaces/OnRoutesInit.js.map +1 -0
  157. package/lib/{interfaces → cjs/interfaces}/PathType.d.ts +0 -0
  158. package/lib/cjs/interfaces/PathType.js +3 -0
  159. package/lib/cjs/interfaces/PathType.js.map +1 -0
  160. package/lib/{interfaces → cjs/interfaces}/PlatformRouteOptions.d.ts +0 -0
  161. package/lib/cjs/interfaces/PlatformRouteOptions.js +3 -0
  162. package/lib/cjs/interfaces/PlatformRouteOptions.js.map +1 -0
  163. package/lib/{interfaces → cjs/interfaces}/ResponseErrorObject.d.ts +0 -0
  164. package/lib/cjs/interfaces/ResponseErrorObject.js +3 -0
  165. package/lib/cjs/interfaces/ResponseErrorObject.js.map +1 -0
  166. package/lib/{interfaces → cjs/interfaces}/Route.d.ts +0 -0
  167. package/lib/cjs/interfaces/Route.js +3 -0
  168. package/lib/cjs/interfaces/Route.js.map +1 -0
  169. package/lib/{interfaces → cjs/interfaces}/index.d.ts +0 -0
  170. package/lib/cjs/interfaces/index.js +20 -0
  171. package/lib/cjs/interfaces/index.js.map +1 -0
  172. package/lib/{middlewares → cjs/middlewares}/AcceptMimesMiddleware.d.ts +0 -0
  173. package/lib/cjs/middlewares/AcceptMimesMiddleware.js +27 -0
  174. package/lib/cjs/middlewares/AcceptMimesMiddleware.js.map +1 -0
  175. package/lib/{middlewares → cjs/middlewares}/GlobalAcceptMimesMiddleware.d.ts +0 -0
  176. package/lib/cjs/middlewares/GlobalAcceptMimesMiddleware.js +26 -0
  177. package/lib/cjs/middlewares/GlobalAcceptMimesMiddleware.js.map +1 -0
  178. package/lib/{middlewares → cjs/middlewares}/PlatformAcceptMimesMiddleware.d.ts +0 -0
  179. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js +37 -0
  180. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -0
  181. package/lib/{middlewares → cjs/middlewares}/PlatformMulterMiddleware.d.ts +0 -0
  182. package/lib/cjs/middlewares/PlatformMulterMiddleware.js +55 -0
  183. package/lib/cjs/middlewares/PlatformMulterMiddleware.js.map +1 -0
  184. package/lib/{middlewares/data → cjs/middlewares/__mock__}/FakeCtrl.d.ts +0 -0
  185. package/lib/cjs/middlewares/__mock__/FakeCtrl.js +12 -0
  186. package/lib/cjs/middlewares/__mock__/FakeCtrl.js.map +1 -0
  187. package/lib/{middlewares → cjs/middlewares}/bindEndpointMiddleware.d.ts +0 -0
  188. package/lib/cjs/middlewares/bindEndpointMiddleware.js +13 -0
  189. package/lib/cjs/middlewares/bindEndpointMiddleware.js.map +1 -0
  190. package/lib/{middlewares → cjs/middlewares}/index.d.ts +0 -0
  191. package/lib/cjs/middlewares/index.js +9 -0
  192. package/lib/cjs/middlewares/index.js.map +1 -0
  193. package/lib/{services → cjs/services}/FakeRawDriver.d.ts +0 -0
  194. package/lib/cjs/services/FakeRawDriver.js +26 -0
  195. package/lib/cjs/services/FakeRawDriver.js.map +1 -0
  196. package/lib/{services → cjs/services}/Platform.d.ts +0 -0
  197. package/lib/cjs/services/Platform.js +107 -0
  198. package/lib/cjs/services/Platform.js.map +1 -0
  199. package/lib/{services → cjs/services}/PlatformApplication.d.ts +0 -0
  200. package/lib/cjs/services/PlatformApplication.js +34 -0
  201. package/lib/cjs/services/PlatformApplication.js.map +1 -0
  202. package/lib/{services → cjs/services}/PlatformHandler.d.ts +0 -0
  203. package/lib/cjs/services/PlatformHandler.js +235 -0
  204. package/lib/cjs/services/PlatformHandler.js.map +1 -0
  205. package/lib/{services → cjs/services}/PlatformMiddlewaresChain.d.ts +0 -0
  206. package/lib/cjs/services/PlatformMiddlewaresChain.js +34 -0
  207. package/lib/cjs/services/PlatformMiddlewaresChain.js.map +1 -0
  208. package/lib/{services → cjs/services}/PlatformRequest.d.ts +2 -1
  209. package/lib/cjs/services/PlatformRequest.js +138 -0
  210. package/lib/cjs/services/PlatformRequest.js.map +1 -0
  211. package/lib/{services → cjs/services}/PlatformResponse.d.ts +4 -4
  212. package/lib/cjs/services/PlatformResponse.js +271 -0
  213. package/lib/cjs/services/PlatformResponse.js.map +1 -0
  214. package/lib/{services → cjs/services}/PlatformRouter.d.ts +0 -0
  215. package/lib/cjs/services/PlatformRouter.js +126 -0
  216. package/lib/cjs/services/PlatformRouter.js.map +1 -0
  217. package/lib/{services → cjs/services}/PlatformTest.d.ts +1 -1
  218. package/lib/cjs/services/PlatformTest.js +172 -0
  219. package/lib/cjs/services/PlatformTest.js.map +1 -0
  220. package/lib/{services → cjs/services}/index.d.ts +0 -0
  221. package/lib/cjs/services/index.js +12 -0
  222. package/lib/cjs/services/index.js.map +1 -0
  223. package/lib/{utils → cjs/utils}/createContext.d.ts +0 -0
  224. package/lib/cjs/utils/createContext.js +38 -0
  225. package/lib/cjs/utils/createContext.js.map +1 -0
  226. package/lib/{utils → cjs/utils}/createHandlerMetadata.d.ts +0 -0
  227. package/lib/cjs/utils/createHandlerMetadata.js +49 -0
  228. package/lib/cjs/utils/createHandlerMetadata.js.map +1 -0
  229. package/lib/{utils → cjs/utils}/createHttpServer.d.ts +0 -0
  230. package/lib/cjs/utils/createHttpServer.js +35 -0
  231. package/lib/cjs/utils/createHttpServer.js.map +1 -0
  232. package/lib/{utils → cjs/utils}/createHttpsServer.d.ts +0 -0
  233. package/lib/cjs/utils/createHttpsServer.js +36 -0
  234. package/lib/cjs/utils/createHttpsServer.js.map +1 -0
  235. package/lib/cjs/utils/createInjector.d.ts +7 -0
  236. package/lib/cjs/utils/createInjector.js +42 -0
  237. package/lib/cjs/utils/createInjector.js.map +1 -0
  238. package/lib/{utils → cjs/utils}/getConfiguration.d.ts +0 -0
  239. package/lib/cjs/utils/getConfiguration.js +42 -0
  240. package/lib/cjs/utils/getConfiguration.js.map +1 -0
  241. package/lib/{utils → cjs/utils}/getStaticsOptions.d.ts +0 -0
  242. package/lib/cjs/utils/getStaticsOptions.js +21 -0
  243. package/lib/cjs/utils/getStaticsOptions.js.map +1 -0
  244. package/lib/{utils → cjs/utils}/index.d.ts +0 -1
  245. package/lib/cjs/utils/index.js +12 -0
  246. package/lib/cjs/utils/index.js.map +1 -0
  247. package/lib/{utils → cjs/utils}/listenServer.d.ts +0 -0
  248. package/lib/cjs/utils/listenServer.js +17 -0
  249. package/lib/cjs/utils/listenServer.js.map +1 -0
  250. package/lib/{utils → cjs/utils}/loadInjector.d.ts +0 -0
  251. package/lib/cjs/utils/loadInjector.js +14 -0
  252. package/lib/cjs/utils/loadInjector.js.map +1 -0
  253. package/lib/{utils → cjs/utils}/mapReturnedResponse.d.ts +0 -0
  254. package/lib/cjs/utils/mapReturnedResponse.js +15 -0
  255. package/lib/cjs/utils/mapReturnedResponse.js.map +1 -0
  256. package/lib/{utils → cjs/utils}/printRoutes.d.ts +0 -0
  257. package/lib/cjs/utils/printRoutes.js +36 -0
  258. package/lib/cjs/utils/printRoutes.js.map +1 -0
  259. package/lib/{utils → cjs/utils}/setResponseHeaders.d.ts +0 -0
  260. package/lib/cjs/utils/setResponseHeaders.js +35 -0
  261. package/lib/cjs/utils/setResponseHeaders.js.map +1 -0
  262. package/lib/{utils → cjs/utils}/useCtxHandler.d.ts +0 -0
  263. package/lib/cjs/utils/useCtxHandler.js +15 -0
  264. package/lib/cjs/utils/useCtxHandler.js.map +1 -0
  265. package/lib/esm/PlatformModule.js +7 -0
  266. package/lib/esm/PlatformModule.js.map +1 -0
  267. package/lib/esm/builder/PlatformBuilder.js +244 -0
  268. package/lib/esm/builder/PlatformBuilder.js.map +1 -0
  269. package/lib/esm/builder/PlatformControllerBuilder.js +79 -0
  270. package/lib/esm/builder/PlatformControllerBuilder.js.map +1 -0
  271. package/lib/esm/config/index.js +4 -0
  272. package/lib/esm/config/index.js.map +1 -0
  273. package/lib/esm/config/interfaces/ConverterSettings.js +2 -0
  274. package/lib/esm/config/interfaces/ConverterSettings.js.map +1 -0
  275. package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js +2 -0
  276. package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js.map +1 -0
  277. package/lib/esm/config/interfaces/PlatformLoggerSettings.js +2 -0
  278. package/lib/esm/config/interfaces/PlatformLoggerSettings.js.map +1 -0
  279. package/lib/esm/config/interfaces/PlatformMulterSettings.js +2 -0
  280. package/lib/esm/config/interfaces/PlatformMulterSettings.js.map +1 -0
  281. package/lib/esm/config/interfaces/PlatformStaticsSettings.js +2 -0
  282. package/lib/esm/config/interfaces/PlatformStaticsSettings.js.map +1 -0
  283. package/lib/esm/config/interfaces/index.js +5 -0
  284. package/lib/esm/config/interfaces/index.js.map +1 -0
  285. package/lib/esm/config/services/PlatformConfiguration.js +192 -0
  286. package/lib/esm/config/services/PlatformConfiguration.js.map +1 -0
  287. package/lib/esm/constants/routerOptions.js +2 -0
  288. package/lib/esm/constants/routerOptions.js.map +1 -0
  289. package/lib/esm/decorators/httpServer.js +27 -0
  290. package/lib/esm/decorators/httpServer.js.map +1 -0
  291. package/lib/esm/decorators/httpsServer.js +27 -0
  292. package/lib/esm/decorators/httpsServer.js.map +1 -0
  293. package/lib/esm/decorators/index.js +20 -0
  294. package/lib/esm/decorators/index.js.map +1 -0
  295. package/lib/esm/decorators/method/acceptMime.js +24 -0
  296. package/lib/esm/decorators/method/acceptMime.js.map +1 -0
  297. package/lib/esm/decorators/method/endpointFn.js +11 -0
  298. package/lib/esm/decorators/method/endpointFn.js.map +1 -0
  299. package/lib/esm/decorators/method/location.js +2 -0
  300. package/lib/esm/decorators/method/location.js.map +1 -0
  301. package/lib/esm/decorators/method/redirect.js +2 -0
  302. package/lib/esm/decorators/method/redirect.js.map +1 -0
  303. package/lib/esm/decorators/method/route.js +2 -0
  304. package/lib/esm/decorators/method/route.js.map +1 -0
  305. package/lib/esm/decorators/method/view.js +30 -0
  306. package/lib/esm/decorators/method/view.js.map +1 -0
  307. package/lib/esm/decorators/multer/index.js +4 -0
  308. package/lib/esm/decorators/multer/index.js.map +1 -0
  309. package/lib/esm/decorators/multer/multerFileSize.js +31 -0
  310. package/lib/esm/decorators/multer/multerFileSize.js.map +1 -0
  311. package/lib/esm/decorators/multer/multerOptions.js +48 -0
  312. package/lib/esm/decorators/multer/multerOptions.js.map +1 -0
  313. package/lib/esm/decorators/multer/multipartFile.js +74 -0
  314. package/lib/esm/decorators/multer/multipartFile.js.map +1 -0
  315. package/lib/esm/decorators/params/endpointInfo.js +17 -0
  316. package/lib/esm/decorators/params/endpointInfo.js.map +1 -0
  317. package/lib/esm/decorators/params/error.js +16 -0
  318. package/lib/esm/decorators/params/error.js.map +1 -0
  319. package/lib/esm/decorators/params/next.js +17 -0
  320. package/lib/esm/decorators/params/next.js.map +1 -0
  321. package/lib/esm/decorators/params/request.js +34 -0
  322. package/lib/esm/decorators/params/request.js.map +1 -0
  323. package/lib/esm/decorators/params/response.js +28 -0
  324. package/lib/esm/decorators/params/response.js.map +1 -0
  325. package/lib/esm/decorators/params/responseData.js +17 -0
  326. package/lib/esm/decorators/params/responseData.js.map +1 -0
  327. package/lib/esm/domain/AnyToPromiseWithCtx.js +31 -0
  328. package/lib/esm/domain/AnyToPromiseWithCtx.js.map +1 -0
  329. package/lib/esm/domain/ControllerProvider.js +47 -0
  330. package/lib/esm/domain/ControllerProvider.js.map +1 -0
  331. package/lib/esm/domain/EndpointMetadata.js +108 -0
  332. package/lib/esm/domain/EndpointMetadata.js.map +1 -0
  333. package/lib/esm/domain/HandlerMetadata.js +53 -0
  334. package/lib/esm/domain/HandlerMetadata.js.map +1 -0
  335. package/lib/esm/domain/PlatformContext.js +81 -0
  336. package/lib/esm/domain/PlatformContext.js.map +1 -0
  337. package/lib/esm/domain/PlatformRouteDetails.js +20 -0
  338. package/lib/esm/domain/PlatformRouteDetails.js.map +1 -0
  339. package/lib/esm/domain/PropertyMetadata.js +25 -0
  340. package/lib/esm/domain/PropertyMetadata.js.map +1 -0
  341. package/lib/esm/domain/index.js +8 -0
  342. package/lib/esm/domain/index.js.map +1 -0
  343. package/lib/esm/index.js +31 -0
  344. package/lib/esm/index.js.map +1 -0
  345. package/lib/esm/interfaces/AfterInit.js +2 -0
  346. package/lib/esm/interfaces/AfterInit.js.map +1 -0
  347. package/lib/esm/interfaces/AfterListen.js +2 -0
  348. package/lib/esm/interfaces/AfterListen.js.map +1 -0
  349. package/lib/esm/interfaces/AfterRoutesInit.js +2 -0
  350. package/lib/esm/interfaces/AfterRoutesInit.js.map +1 -0
  351. package/lib/esm/interfaces/BeforeInit.js +2 -0
  352. package/lib/esm/interfaces/BeforeInit.js.map +1 -0
  353. package/lib/esm/interfaces/BeforeListen.js +2 -0
  354. package/lib/esm/interfaces/BeforeListen.js.map +1 -0
  355. package/lib/esm/interfaces/BeforeRoutesInit.js +2 -0
  356. package/lib/esm/interfaces/BeforeRoutesInit.js.map +1 -0
  357. package/lib/esm/interfaces/HandlerType.js +14 -0
  358. package/lib/esm/interfaces/HandlerType.js.map +1 -0
  359. package/lib/esm/interfaces/IncomingEvent.js +2 -0
  360. package/lib/esm/interfaces/IncomingEvent.js.map +1 -0
  361. package/lib/esm/interfaces/OnReady.js +2 -0
  362. package/lib/esm/interfaces/OnReady.js.map +1 -0
  363. package/lib/esm/interfaces/OnRequest.js +2 -0
  364. package/lib/esm/interfaces/OnRequest.js.map +1 -0
  365. package/lib/esm/interfaces/OnResponse.js +2 -0
  366. package/lib/esm/interfaces/OnResponse.js.map +1 -0
  367. package/lib/esm/interfaces/OnRoutesInit.js +2 -0
  368. package/lib/esm/interfaces/OnRoutesInit.js.map +1 -0
  369. package/lib/esm/interfaces/PathType.js +2 -0
  370. package/lib/esm/interfaces/PathType.js.map +1 -0
  371. package/lib/esm/interfaces/PlatformRouteOptions.js +2 -0
  372. package/lib/esm/interfaces/PlatformRouteOptions.js.map +1 -0
  373. package/lib/esm/interfaces/ResponseErrorObject.js +2 -0
  374. package/lib/esm/interfaces/ResponseErrorObject.js.map +1 -0
  375. package/lib/esm/interfaces/Route.js +2 -0
  376. package/lib/esm/interfaces/Route.js.map +1 -0
  377. package/lib/esm/interfaces/index.js +17 -0
  378. package/lib/esm/interfaces/index.js.map +1 -0
  379. package/lib/esm/middlewares/AcceptMimesMiddleware.js +24 -0
  380. package/lib/esm/middlewares/AcceptMimesMiddleware.js.map +1 -0
  381. package/lib/esm/middlewares/GlobalAcceptMimesMiddleware.js +23 -0
  382. package/lib/esm/middlewares/GlobalAcceptMimesMiddleware.js.map +1 -0
  383. package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js +34 -0
  384. package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -0
  385. package/lib/esm/middlewares/PlatformMulterMiddleware.js +52 -0
  386. package/lib/esm/middlewares/PlatformMulterMiddleware.js.map +1 -0
  387. package/lib/esm/middlewares/__mock__/FakeCtrl.js +9 -0
  388. package/lib/esm/middlewares/__mock__/FakeCtrl.js.map +1 -0
  389. package/lib/esm/middlewares/bindEndpointMiddleware.js +9 -0
  390. package/lib/esm/middlewares/bindEndpointMiddleware.js.map +1 -0
  391. package/lib/esm/middlewares/index.js +6 -0
  392. package/lib/esm/middlewares/index.js.map +1 -0
  393. package/lib/esm/services/FakeRawDriver.js +22 -0
  394. package/lib/esm/services/FakeRawDriver.js.map +1 -0
  395. package/lib/esm/services/Platform.js +104 -0
  396. package/lib/esm/services/Platform.js.map +1 -0
  397. package/lib/esm/services/PlatformApplication.js +31 -0
  398. package/lib/esm/services/PlatformApplication.js.map +1 -0
  399. package/lib/esm/services/PlatformHandler.js +232 -0
  400. package/lib/esm/services/PlatformHandler.js.map +1 -0
  401. package/lib/esm/services/PlatformMiddlewaresChain.js +31 -0
  402. package/lib/esm/services/PlatformMiddlewaresChain.js.map +1 -0
  403. package/lib/esm/services/PlatformRequest.js +135 -0
  404. package/lib/esm/services/PlatformRequest.js.map +1 -0
  405. package/lib/esm/services/PlatformResponse.js +268 -0
  406. package/lib/esm/services/PlatformResponse.js.map +1 -0
  407. package/lib/esm/services/PlatformRouter.js +123 -0
  408. package/lib/esm/services/PlatformRouter.js.map +1 -0
  409. package/lib/esm/services/PlatformTest.js +168 -0
  410. package/lib/esm/services/PlatformTest.js.map +1 -0
  411. package/lib/esm/services/index.js +9 -0
  412. package/lib/esm/services/index.js.map +1 -0
  413. package/lib/esm/utils/createContext.js +34 -0
  414. package/lib/esm/utils/createContext.js.map +1 -0
  415. package/lib/esm/utils/createHandlerMetadata.js +45 -0
  416. package/lib/esm/utils/createHandlerMetadata.js.map +1 -0
  417. package/lib/esm/utils/createHttpServer.js +29 -0
  418. package/lib/esm/utils/createHttpServer.js.map +1 -0
  419. package/lib/esm/utils/createHttpsServer.js +30 -0
  420. package/lib/esm/utils/createHttpsServer.js.map +1 -0
  421. package/lib/esm/utils/createInjector.js +38 -0
  422. package/lib/esm/utils/createInjector.js.map +1 -0
  423. package/lib/esm/utils/getConfiguration.js +38 -0
  424. package/lib/esm/utils/getConfiguration.js.map +1 -0
  425. package/lib/esm/utils/getStaticsOptions.js +17 -0
  426. package/lib/esm/utils/getStaticsOptions.js.map +1 -0
  427. package/lib/esm/utils/index.js +9 -0
  428. package/lib/esm/utils/index.js.map +1 -0
  429. package/lib/esm/utils/listenServer.js +13 -0
  430. package/lib/esm/utils/listenServer.js.map +1 -0
  431. package/lib/esm/utils/loadInjector.js +10 -0
  432. package/lib/esm/utils/loadInjector.js.map +1 -0
  433. package/lib/esm/utils/mapReturnedResponse.js +11 -0
  434. package/lib/esm/utils/mapReturnedResponse.js.map +1 -0
  435. package/lib/esm/utils/printRoutes.js +32 -0
  436. package/lib/esm/utils/printRoutes.js.map +1 -0
  437. package/lib/esm/utils/setResponseHeaders.js +31 -0
  438. package/lib/esm/utils/setResponseHeaders.js.map +1 -0
  439. package/lib/esm/utils/useCtxHandler.js +11 -0
  440. package/lib/esm/utils/useCtxHandler.js.map +1 -0
  441. package/lib/types/PlatformModule.d.ts +6 -0
  442. package/lib/types/builder/PlatformBuilder.d.ts +116 -0
  443. package/lib/types/builder/PlatformControllerBuilder.d.ts +17 -0
  444. package/lib/types/config/index.d.ts +3 -0
  445. package/lib/types/config/interfaces/ConverterSettings.d.ts +6 -0
  446. package/lib/types/config/interfaces/EndpointDirectoriesSettings.d.ts +3 -0
  447. package/lib/types/config/interfaces/PlatformLoggerSettings.d.ts +44 -0
  448. package/lib/types/config/interfaces/PlatformMulterSettings.d.ts +138 -0
  449. package/lib/types/config/interfaces/PlatformStaticsSettings.d.ts +17 -0
  450. package/lib/types/config/interfaces/index.d.ts +88 -0
  451. package/lib/types/config/services/PlatformConfiguration.d.ts +85 -0
  452. package/lib/types/constants/routerOptions.d.ts +1 -0
  453. package/lib/types/decorators/httpServer.d.ts +27 -0
  454. package/lib/types/decorators/httpsServer.d.ts +27 -0
  455. package/lib/types/decorators/index.d.ts +16 -0
  456. package/lib/types/decorators/method/acceptMime.d.ts +19 -0
  457. package/lib/types/decorators/method/endpointFn.d.ts +9 -0
  458. package/lib/types/decorators/method/location.d.ts +1 -0
  459. package/lib/types/decorators/method/redirect.d.ts +1 -0
  460. package/lib/types/decorators/method/route.d.ts +1 -0
  461. package/lib/types/decorators/method/view.d.ts +25 -0
  462. package/lib/types/decorators/multer/index.d.ts +3 -0
  463. package/lib/types/decorators/multer/multerFileSize.d.ts +27 -0
  464. package/lib/types/decorators/multer/multerOptions.d.ts +41 -0
  465. package/lib/types/decorators/multer/multipartFile.d.ts +47 -0
  466. package/lib/types/decorators/params/endpointInfo.d.ts +13 -0
  467. package/lib/types/decorators/params/error.d.ts +7 -0
  468. package/lib/types/decorators/params/next.d.ts +22 -0
  469. package/lib/types/decorators/params/request.d.ts +46 -0
  470. package/lib/types/decorators/params/response.d.ts +40 -0
  471. package/lib/types/decorators/params/responseData.d.ts +9 -0
  472. package/lib/types/domain/AnyToPromiseWithCtx.d.ts +18 -0
  473. package/lib/types/domain/ControllerProvider.d.ts +24 -0
  474. package/lib/types/domain/EndpointMetadata.d.ts +76 -0
  475. package/lib/types/domain/HandlerMetadata.d.ts +32 -0
  476. package/lib/types/domain/PlatformContext.d.ts +65 -0
  477. package/lib/types/domain/PlatformRouteDetails.d.ts +23 -0
  478. package/lib/types/domain/PropertyMetadata.d.ts +17 -0
  479. package/lib/types/domain/index.d.ts +7 -0
  480. package/lib/types/index.d.ts +22 -0
  481. package/lib/types/interfaces/AfterInit.d.ts +3 -0
  482. package/lib/types/interfaces/AfterListen.d.ts +3 -0
  483. package/lib/types/interfaces/AfterRoutesInit.d.ts +3 -0
  484. package/lib/types/interfaces/BeforeInit.d.ts +3 -0
  485. package/lib/types/interfaces/BeforeListen.d.ts +3 -0
  486. package/lib/types/interfaces/BeforeRoutesInit.d.ts +3 -0
  487. package/lib/types/interfaces/HandlerType.d.ts +12 -0
  488. package/lib/types/interfaces/IncomingEvent.d.ts +6 -0
  489. package/lib/types/interfaces/OnReady.d.ts +3 -0
  490. package/lib/types/interfaces/OnRequest.d.ts +4 -0
  491. package/lib/types/interfaces/OnResponse.d.ts +4 -0
  492. package/lib/types/interfaces/OnRoutesInit.d.ts +3 -0
  493. package/lib/types/interfaces/PathType.d.ts +1 -0
  494. package/lib/types/interfaces/PlatformRouteOptions.d.ts +16 -0
  495. package/lib/types/interfaces/ResponseErrorObject.d.ts +8 -0
  496. package/lib/types/interfaces/Route.d.ts +10 -0
  497. package/lib/types/interfaces/index.d.ts +16 -0
  498. package/lib/types/middlewares/AcceptMimesMiddleware.d.ts +10 -0
  499. package/lib/types/middlewares/GlobalAcceptMimesMiddleware.d.ts +9 -0
  500. package/lib/types/middlewares/PlatformAcceptMimesMiddleware.d.ts +10 -0
  501. package/lib/types/middlewares/PlatformMulterMiddleware.d.ts +19 -0
  502. package/lib/types/middlewares/__mock__/FakeCtrl.d.ts +2 -0
  503. package/lib/types/middlewares/bindEndpointMiddleware.d.ts +5 -0
  504. package/lib/types/middlewares/index.d.ts +5 -0
  505. package/lib/types/services/FakeRawDriver.d.ts +15 -0
  506. package/lib/types/services/Platform.d.ts +37 -0
  507. package/lib/types/services/PlatformApplication.d.ts +21 -0
  508. package/lib/types/services/PlatformHandler.d.ts +80 -0
  509. package/lib/types/services/PlatformMiddlewaresChain.d.ts +6 -0
  510. package/lib/types/services/PlatformRequest.d.ts +112 -0
  511. package/lib/types/services/PlatformResponse.d.ts +161 -0
  512. package/lib/types/services/PlatformRouter.d.ts +48 -0
  513. package/lib/types/services/PlatformTest.d.ts +57 -0
  514. package/lib/types/services/index.d.ts +8 -0
  515. package/lib/types/utils/createContext.d.ts +9 -0
  516. package/lib/types/utils/createHandlerMetadata.d.ts +8 -0
  517. package/lib/types/utils/createHttpServer.d.ts +3 -0
  518. package/lib/types/utils/createHttpsServer.d.ts +3 -0
  519. package/lib/types/utils/createInjector.d.ts +7 -0
  520. package/lib/types/utils/getConfiguration.d.ts +2 -0
  521. package/lib/types/utils/getStaticsOptions.d.ts +5 -0
  522. package/lib/types/utils/index.d.ts +8 -0
  523. package/lib/types/utils/listenServer.d.ts +10 -0
  524. package/lib/types/utils/loadInjector.d.ts +6 -0
  525. package/lib/types/utils/mapReturnedResponse.d.ts +4 -0
  526. package/lib/types/utils/printRoutes.d.ts +2 -0
  527. package/lib/types/utils/setResponseHeaders.d.ts +5 -0
  528. package/lib/types/utils/useCtxHandler.d.ts +13 -0
  529. package/package.json +26 -22
  530. package/tsconfig.compile.esm.json +23 -0
  531. package/lib/index.js +0 -3603
  532. package/lib/index.js.map +0 -1
  533. package/lib/index.modern.js +0 -3410
  534. package/lib/index.modern.js.map +0 -1
  535. package/lib/utils/createInjector.d.ts +0 -2
  536. package/lib/utils/createPlatformApplication.d.ts +0 -2
@@ -0,0 +1,44 @@
1
+ export interface PlatformLoggerSettings {
2
+ /**
3
+ * Enable debug mode. By default debug is false.
4
+ */
5
+ debug?: boolean;
6
+ /**
7
+ * Enable info mode. By default debug is false.
8
+ */
9
+ level?: "debug" | "info" | "warn" | "error" | "off";
10
+ /**
11
+ * Enable log performance tracker and disable log server.
12
+ */
13
+ perf?: boolean;
14
+ /**
15
+ * List of regexp to ignore log.
16
+ */
17
+ ignoreUrlPatterns?: string[];
18
+ /**
19
+ * The number of space characters to use as white space in JSON output. Default is 2 (0 in production).
20
+ */
21
+ jsonIndentation?: number;
22
+ /**
23
+ * A function called for each incoming request to create a request id.
24
+ * @returns {number}
25
+ */
26
+ reqIdBuilder?: (req: TsED.Request) => string;
27
+ /**
28
+ * Disable routes table displayed in the logger. By default debug is `false`.
29
+ */
30
+ disableRoutesSummary?: boolean;
31
+ /**
32
+ * Disable bootstrap log displayed in the logger. By default debug is `false`.
33
+ */
34
+ disableBootstrapLog?: boolean;
35
+ /**
36
+ * Specify log format. Example: `%[%d{[yyyy-MM-dd hh:mm:ss,SSS}] %p%] %m`. See [@tsed/logger configuration](https://tsedio.github.io/logger/).
37
+ */
38
+ format?: string;
39
+ /**
40
+ * Specify the log stack size for the context.logger. When the stack.length is reach, the logger is flushed during the request.
41
+ * Default size is set to 30.
42
+ */
43
+ maxStackSize?: number;
44
+ }
@@ -0,0 +1,138 @@
1
+ /// <reference types="node" />
2
+ import { FileFilterCallback } from "multer";
3
+ import { Readable } from "stream";
4
+ declare global {
5
+ namespace TsED {
6
+ interface MulterFile {
7
+ /** Name of the form field associated with this file. */
8
+ fieldname: string;
9
+ /** Name of the file on the uploader's computer. */
10
+ originalname: string;
11
+ /** Value of the `Content-Type` header for this file. */
12
+ mimetype: string;
13
+ /** Size of the file in bytes. */
14
+ size: number;
15
+ /**
16
+ * A readable stream of this file. Only available to the `_handleFile`
17
+ * callback for custom `StorageEngine`s.
18
+ */
19
+ stream: Readable;
20
+ /** `DiskStorage` only: Directory to which this file has been uploaded. */
21
+ destination: string;
22
+ /** `DiskStorage` only: Name of this file within `destination`. */
23
+ filename: string;
24
+ /** `DiskStorage` only: Full path to the uploaded file. */
25
+ path: string;
26
+ /** `MemoryStorage` only: A Buffer containing the entire file. */
27
+ buffer: Buffer;
28
+ }
29
+ interface MulterStorageEngine {
30
+ }
31
+ interface MulterOptions {
32
+ /**
33
+ * A `StorageEngine` responsible for processing files uploaded via Multer.
34
+ * Takes precedence over `dest`.
35
+ */
36
+ storage?: MulterStorageEngine;
37
+ /**
38
+ * The destination directory for uploaded files. If `storage` is not set
39
+ * and `dest` is, Multer will create a `DiskStorage` instance configured
40
+ * to store files at `dest` with random filenames.
41
+ *
42
+ * Ignored if `storage` is set.
43
+ */
44
+ dest?: string;
45
+ /**
46
+ * An object specifying various limits on incoming data. This object is
47
+ * passed to Busboy directly, and the details of properties can be found
48
+ * at https://github.com/mscdex/busboy#busboy-methods.
49
+ */
50
+ limits?: {
51
+ /** Maximum size of each form field name in bytes. (Default: 100) */
52
+ fieldNameSize?: number;
53
+ /** Maximum size of each form field value in bytes. (Default: 1048576) */
54
+ fieldSize?: number;
55
+ /** Maximum number of non-file form fields. (Default: Infinity) */
56
+ fields?: number;
57
+ /** Maximum size of each file in bytes. (Default: Infinity) */
58
+ fileSize?: number;
59
+ /** Maximum number of file fields. (Default: Infinity) */
60
+ files?: number;
61
+ /** Maximum number of parts (non-file fields + files). (Default: Infinity) */
62
+ parts?: number;
63
+ /** Maximum number of headers. (Default: 2000) */
64
+ headerPairs?: number;
65
+ };
66
+ /** Preserve the full path of the original filename rather than the basename. (Default: false) */
67
+ preservePath?: boolean;
68
+ /**
69
+ * Optional function to control which files are uploaded. This is called
70
+ * for every file that is processed.
71
+ *
72
+ * @param req The Express `Request` object.
73
+ * @param file Object containing information about the processed file.
74
+ * @param callback a function to control which files should be uploaded and which should be skipped.
75
+ */
76
+ fileFilter?(req: Request, file: MulterFile, callback: FileFilterCallback): void;
77
+ }
78
+ interface MulterField {
79
+ name: string;
80
+ maxCount?: number;
81
+ }
82
+ type MulterHandler = (req: any, res: any) => Promise<any>;
83
+ interface Multer {
84
+ /**
85
+ * Returns middleware that processes a single file associated with the
86
+ * given form field.
87
+ *
88
+ * The `Request` object will be populated with a `file` object containing
89
+ * information about the processed file.
90
+ *
91
+ * @param fieldName Name of the multipart form field to process.
92
+ */
93
+ single(fieldName: string): MulterHandler;
94
+ /**
95
+ * Returns middleware that processes multiple files sharing the same field
96
+ * name.
97
+ *
98
+ * The `Request` object will be populated with a `files` array containing
99
+ * an information object for each processed file.
100
+ *
101
+ * @param fieldName Shared name of the multipart form fields to process.
102
+ * @param maxCount Optional. Maximum number of files to process. (default: Infinity)
103
+ * @throws `MulterError('LIMIT_UNEXPECTED_FILE')` if more than `maxCount` files are associated with `fieldName`
104
+ */
105
+ array(fieldName: string, maxCount?: number): MulterHandler;
106
+ /**
107
+ * Returns middleware that processes multiple files associated with the
108
+ * given form fields.
109
+ *
110
+ * The `Request` object will be populated with a `files` object which
111
+ * maps each field name to an array of the associated file information
112
+ * objects.
113
+ *
114
+ * @param fields Array of `Field` objects describing multipart form fields to process.
115
+ * @throws `MulterError('LIMIT_UNEXPECTED_FILE')` if more than `maxCount` files are associated with `fieldName` for any field.
116
+ */
117
+ fields(fields: MulterField[]): MulterHandler;
118
+ /**
119
+ * Returns middleware that processes all files contained in the multipart
120
+ * request.
121
+ *
122
+ * The `Request` object will be populated with a `files` array containing
123
+ * an information object for each processed file.
124
+ */
125
+ any(): MulterHandler;
126
+ /**
127
+ * Returns middleware that accepts only non-file multipart form fields.
128
+ *
129
+ * @throws `MulterError('LIMIT_UNEXPECTED_FILE')` if any file is encountered.
130
+ */
131
+ none(): MulterHandler;
132
+ }
133
+ }
134
+ }
135
+ export declare type PlatformMulter = TsED.Multer;
136
+ export declare type PlatformMulterSettings = TsED.MulterOptions;
137
+ export declare type PlatformMulterFile = TsED.MulterFile;
138
+ export declare type PlatformMulterField = TsED.MulterField;
@@ -0,0 +1,17 @@
1
+ declare global {
2
+ namespace TsED {
3
+ interface StaticsOptions {
4
+ root: string;
5
+ hook?: "$beforeRoutesInit" | "$afterRoutesInit";
6
+ [key: string]: any;
7
+ }
8
+ }
9
+ }
10
+ export interface PlatformStaticsOptions extends TsED.StaticsOptions {
11
+ root: string;
12
+ [key: string]: any;
13
+ }
14
+ export declare type PathOrStaticsOptions = string | PlatformStaticsOptions;
15
+ export interface PlatformStaticsSettings {
16
+ [endpoint: string]: PathOrStaticsOptions | PathOrStaticsOptions[];
17
+ }
@@ -0,0 +1,88 @@
1
+ /// <reference types="node" />
2
+ import { Env } from "@tsed/core";
3
+ import Https from "https";
4
+ import { ConverterSettings } from "./ConverterSettings";
5
+ import { EndpointDirectoriesSettings } from "./EndpointDirectoriesSettings";
6
+ import { PlatformLoggerSettings } from "./PlatformLoggerSettings";
7
+ import { PlatformMulterSettings } from "./PlatformMulterSettings";
8
+ import { PlatformStaticsSettings } from "./PlatformStaticsSettings";
9
+ declare global {
10
+ namespace TsED {
11
+ interface LoggerConfiguration extends Partial<PlatformLoggerSettings> {
12
+ }
13
+ interface Configuration {
14
+ /**
15
+ * The root directory where you build run project. By default, it's equal to `process.cwd().
16
+ */
17
+ rootDir: string;
18
+ /**
19
+ * The environment profile. By default the environment profile is equals to `NODE_ENV`.
20
+ */
21
+ env: Env;
22
+ /**
23
+ * Port number for the [HTTP.Server](https://nodejs.org/api/http.html#http_class_http_server).
24
+ */
25
+ port: string | number;
26
+ /**
27
+ * Port number for the [HTTP.Server](https://nodejs.org/api/http.html#http_class_http_server).
28
+ */
29
+ httpPort: string | number | boolean;
30
+ /**
31
+ * Port number for the [HTTPs.Server](https://nodejs.org/api/https.html#https_class_https_server).
32
+ */
33
+ httpsPort: string | number | boolean;
34
+ /**
35
+ * [Https.ServerOptions](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)):
36
+ * - `key` &lt;string&gt; | &lt;string[]&gt; | [&lt;Buffer&gt;](https://nodejs.org/api/buffer.html#buffer_class_buffer) | &lt;Object[]&gt;: The private key of the server in PEM format. To support multiple keys using different algorithms an array can be provided either as a plain array of key strings or an array of objects in the format `{pem: key, passphrase: passphrase}`. This option is required for ciphers that make use of private keys.
37
+ * - `passphrase` &lt;string&gt; A string containing the passphrase for the private key or pfx.
38
+ * - `cert` &lt;string&gt; | &lt;string[]&gt; | [&lt;Buffer&gt;](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [&lt;Buffer[]&gt;](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers containing the certificate key of the server in PEM format. (Required)
39
+ * - `ca` &lt;string&gt; | &lt;string[]&gt; | [&lt;Buffer&gt;](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [&lt;Buffer[]&gt;](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers of trusted certificates in PEM format. If this is omitted several well known "root" CAs (like VeriSign) will be used. These are used to authorize connections.
40
+ */
41
+ httpsOptions: Https.ServerOptions;
42
+ /**
43
+ * Mount all controllers under a directories to an endpoint.
44
+ */
45
+ mount: EndpointDirectoriesSettings;
46
+ /**
47
+ * List of directories to scan [Services](/docs/services.md), [Middlewares](/docs/middlewares.md) or [Converters](/docs/converters.md).
48
+ */
49
+ componentsScan: (string | RegExp)[];
50
+ /**
51
+ * Disable the glob pattern. In v7 the componentsScan options will be removed in favor of external module loader.
52
+ */
53
+ disableComponentsScan: boolean;
54
+ /**
55
+ * List of glob patterns. Exclude all files which matching with this list when Server scan all components with the `mount` or `scanComponents` options.
56
+ */
57
+ exclude: string[];
58
+ /**
59
+ * Configure the mimes accepted by default by the server.
60
+ */
61
+ acceptMimes: string[];
62
+ /**
63
+ * Enable debug mode. By default debug is false.
64
+ */
65
+ debug: boolean;
66
+ /**
67
+ * Converter configuration.
68
+ */
69
+ converter: Partial<ConverterSettings>;
70
+ /**
71
+ * Logger configuration.
72
+ */
73
+ logger?: LoggerConfiguration;
74
+ /**
75
+ * Object to mount all directories under to his endpoints. See more on [Serve Static](/tutorials/serve-static-files.md).
76
+ */
77
+ statics: PlatformStaticsSettings;
78
+ /**
79
+ * Object configure Multer. See more on [Upload file](/tutorials/serve-static-files.md).
80
+ */
81
+ multer: PlatformMulterSettings;
82
+ }
83
+ }
84
+ }
85
+ export * from "./PlatformLoggerSettings";
86
+ export * from "./EndpointDirectoriesSettings";
87
+ export * from "./PlatformStaticsSettings";
88
+ export * from "./PlatformMulterSettings";
@@ -0,0 +1,85 @@
1
+ /// <reference types="node" />
2
+ import { Env } from "@tsed/core";
3
+ import { DIConfiguration } from "@tsed/di";
4
+ import Https from "https";
5
+ import { EndpointDirectoriesSettings, PlatformLoggerSettings } from "../interfaces";
6
+ import { ConverterSettings } from "../interfaces/ConverterSettings";
7
+ /**
8
+ * `PlatformConfiguration` contains all information about your Server configuration.
9
+ */
10
+ export declare class PlatformConfiguration extends DIConfiguration {
11
+ constructor();
12
+ get version(): string;
13
+ set version(v: string);
14
+ get rootDir(): string;
15
+ set rootDir(value: string);
16
+ get port(): string | number | false;
17
+ set port(value: string | number | false);
18
+ get httpsOptions(): Https.ServerOptions;
19
+ set httpsOptions(value: Https.ServerOptions);
20
+ get httpPort(): string | number | false;
21
+ set httpPort(value: string | number | false);
22
+ get httpsPort(): string | number | false;
23
+ set httpsPort(value: string | number | false);
24
+ get env(): Env;
25
+ set env(value: Env);
26
+ get mount(): EndpointDirectoriesSettings;
27
+ set mount(value: EndpointDirectoriesSettings);
28
+ get componentsScan(): string[];
29
+ set componentsScan(value: string[]);
30
+ get statics(): EndpointDirectoriesSettings;
31
+ set statics(value: EndpointDirectoriesSettings);
32
+ get acceptMimes(): string[];
33
+ set acceptMimes(value: string[]);
34
+ get debug(): boolean;
35
+ set debug(debug: boolean);
36
+ get converter(): Partial<ConverterSettings>;
37
+ set converter(options: Partial<ConverterSettings>);
38
+ get logger(): Partial<PlatformLoggerSettings>;
39
+ set logger(value: Partial<PlatformLoggerSettings>);
40
+ get exclude(): string[];
41
+ set exclude(exclude: string[]);
42
+ /**
43
+ *
44
+ * @param addressPort
45
+ * @returns {{address: string, port: number}}
46
+ */
47
+ private static buildAddressAndPort;
48
+ /**
49
+ *
50
+ * @returns {string|number}
51
+ */
52
+ getHttpPort(): {
53
+ address: string;
54
+ port: number;
55
+ };
56
+ /**
57
+ *
58
+ * @param settings
59
+ */
60
+ setHttpPort(settings: {
61
+ address: string;
62
+ port: number;
63
+ }): void;
64
+ /**
65
+ *
66
+ * @returns {string|number}
67
+ */
68
+ getHttpsPort(): {
69
+ address: string;
70
+ port: number;
71
+ };
72
+ /**
73
+ *
74
+ * @param settings
75
+ */
76
+ setHttpsPort(settings: {
77
+ address: string;
78
+ port: number;
79
+ }): void;
80
+ getBestHost(): {
81
+ address: string;
82
+ port: number;
83
+ protocol: string;
84
+ } | undefined;
85
+ }
@@ -0,0 +1 @@
1
+ export declare const ROUTER_OPTIONS: unique symbol;
@@ -0,0 +1,27 @@
1
+ /// <reference types="node" />
2
+ import { Type } from "@tsed/core";
3
+ import Http from "http";
4
+ /**
5
+ * Inject the Http.Server instance.
6
+ *
7
+ * ### Example
8
+ *
9
+ * ```typescript
10
+ * import {HttpServer, Service} from "@tsed/common";
11
+ *
12
+ * @Service()
13
+ * export default class OtherService {
14
+ * constructor(@HttpServer httpServer: HttpServer) {}
15
+ * }
16
+ * ```
17
+ *
18
+ * > Note: TypeScript transform and store `HttpServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
19
+ *
20
+ * @param {Type<any>} target
21
+ * @param {string} targetKey
22
+ * @param {TypedPropertyDescriptor<Function> | number} descriptor
23
+ * @returns {any}
24
+ * @decorator
25
+ */
26
+ export declare function HttpServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
27
+ export declare type HttpServer = Http.Server;
@@ -0,0 +1,27 @@
1
+ /// <reference types="node" />
2
+ import { Type } from "@tsed/core";
3
+ import Https from "https";
4
+ /**
5
+ * Inject the Https.Server instance.
6
+ *
7
+ * ### Example
8
+ *
9
+ * ```typescript
10
+ * import {HttpsServer, Service} from "@tsed/common";
11
+ *
12
+ * @Service()
13
+ * export default class OtherService {
14
+ * constructor(@HttpsServer httpServer: HttpServer) {}
15
+ * }
16
+ * ```
17
+ *
18
+ * > Note: TypeScript transform and store `HttpsServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
19
+ *
20
+ * @param {Type<any>} target
21
+ * @param {string} targetKey
22
+ * @param {TypedPropertyDescriptor<Function> | number} descriptor
23
+ * @returns {any}
24
+ * @decorator
25
+ */
26
+ export declare function HttpsServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
27
+ export declare type HttpsServer = Https.Server;
@@ -0,0 +1,16 @@
1
+ export * from "./httpServer";
2
+ export * from "./httpsServer";
3
+ export * from "./multer";
4
+ export * from "./method/route";
5
+ export * from "./method/acceptMime";
6
+ export * from "./method/location";
7
+ export * from "./method/redirect";
8
+ export * from "./method/endpointFn";
9
+ export * from "./method/view";
10
+ export * from "./params/responseData";
11
+ export * from "./params/response";
12
+ export * from "./params/request";
13
+ export * from "./params/next";
14
+ export * from "./params/error";
15
+ export * from "./params/endpointInfo";
16
+ export * from "../utils/mapReturnedResponse";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Set a mime list which are acceptable and checks if the specified content types are acceptable, based on the request’s Accept HTTP header field.
3
+ *
4
+ * ```typescript
5
+ * @Controller('/mypath')
6
+ * export class MyCtrl {
7
+ *
8
+ * @Get('/')
9
+ * @AcceptMime('application/json')
10
+ * public getResource(){}
11
+ * }
12
+ * ```
13
+ *
14
+ * @param mimes
15
+ * @decorator
16
+ * @operation
17
+ * @response
18
+ */
19
+ export declare function AcceptMime(...mimes: string[]): Function;
@@ -0,0 +1,9 @@
1
+ import { DecoratorParameters } from "@tsed/core";
2
+ import { EndpointMetadata } from "../../domain";
3
+ /**
4
+ *
5
+ * @param fn
6
+ * @decorator
7
+ * @deprecated Deprecated since 2021-10-05. Use JsonEntityFn instead.
8
+ */
9
+ export declare function EndpointFn(fn: (endpoint: EndpointMetadata, parameters: DecoratorParameters) => void): MethodDecorator;
@@ -0,0 +1 @@
1
+ export { Location } from "@tsed/schema";
@@ -0,0 +1 @@
1
+ export { Redirect } from "@tsed/schema";
@@ -0,0 +1 @@
1
+ export { Get, Post, Put, Patch, Delete, Head, Options, All } from "@tsed/schema";
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Use a view and sends the rendered HTML string to the client. Optional parameter:
3
+ *
4
+ * * viewOptions, an object whose properties define local variables for the view.
5
+ *
6
+ * The view argument is a string that is the file path of the view file to render.
7
+ * This can be an absolute path, or a path relative to the views setting.
8
+ * If the path does not contain a file extension, then the view engine setting determines the file extension.
9
+ * If the path does contain a file extension, then Express will load the module for the specified template engine (via require())
10
+ * and render it using the loaded module’s __express function.
11
+ *
12
+ * For more information, see [Using template engines with Express](http://expressjs.com/guide/using-template-engines.html).
13
+ *
14
+ * > NOTE: The view argument performs file system operations like reading a file from disk and evaluating Node.js modules,
15
+ * and as so for security reasons should not contain input from the end-user.
16
+ *
17
+ * @param path Relative path to the view file.
18
+ * @param options Additional options
19
+ * @decorator
20
+ * @operation
21
+ * @response
22
+ * @ignores
23
+ * @deprecated Use View decorator from @tsed/platform-views instead.
24
+ */
25
+ export declare function View(path: string, options?: Object): MethodDecorator;
@@ -0,0 +1,3 @@
1
+ export * from "./multerFileSize";
2
+ export * from "./multerOptions";
3
+ export * from "./multipartFile";
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Define file size limit.
3
+ *
4
+ * ```typescript
5
+ * import {Controller, Post} from "@tsed/common";
6
+ * import {MulterOptions, MultipartFile} from "@tsed/common";
7
+ * import {Multer} from "@types/multer";
8
+ *
9
+ * type MulterFile = Express.Multer.File;
10
+ *
11
+ * @Controller('/')
12
+ * class MyCtrl {
13
+ * @Post('/file2')
14
+ * @MulterFileSize(1024) // (Ko). Applied for all fields
15
+ * private uploadFile(@MultipartFile("file1") file: MulterFile, @MultipartFile("file2") file2: MulterFile) {
16
+ *
17
+ * }
18
+ * }
19
+ * ```
20
+ *
21
+ * > See the tutorial on the [multer configuration](/tutorials/multer.md).
22
+ * @param fileSize
23
+ * @returns {(target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor}
24
+ * @decorator
25
+ * @multer
26
+ */
27
+ export declare function MulterFileSize(fileSize: number): MethodDecorator;
@@ -0,0 +1,41 @@
1
+ import { PlatformMulterSettings } from "../../config/interfaces/PlatformMulterSettings";
2
+ /**
3
+ * Define multer option for all MultipartFile
4
+ *
5
+ * ```typescript
6
+ * import {Controller, Post, PlatformMulterFile, MultipartFile, MulterOptions} from "@tsed/common";
7
+ *
8
+ * @Controller('/')
9
+ * class MyCtrl {
10
+ * @Post('/file')
11
+ * private uploadFile(@MultipartFile("file1") file: PlatformMulterFile) {
12
+ *
13
+ * }
14
+ *
15
+ * @Post('/file')
16
+ * @MulterOptions({dest: "/other-dir"})
17
+ * private uploadFile(@MultipartFile("file1") file: PlatformMulterFile) {
18
+ *
19
+ * }
20
+ *
21
+ * @Post('/file2')
22
+ * @MulterOptions({dest: "/other-dir"})
23
+ * private uploadFile(@MultipartFile("file1") file: PlatformMulterFile, @MultipartFile("file2") file2: PlatformMulterFile) {
24
+ *
25
+ * }
26
+ *
27
+ * @Post('/files')
28
+ * private uploadFile(@MultipartFile("file1") files: PlatformMulterFile[]) {
29
+ *
30
+ * }
31
+ * }
32
+ * ```
33
+ *
34
+ * See the tutorial on the [multer configuration](/tutorials/multer.md).
35
+ *
36
+ * @param {multer.Options} options
37
+ * @returns {(target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor}
38
+ * @decorator
39
+ * @multer
40
+ */
41
+ export declare function MulterOptions(options: PlatformMulterSettings): MethodDecorator;
@@ -0,0 +1,47 @@
1
+ import { PlatformMulterFile } from "../../config/interfaces/PlatformMulterSettings";
2
+ /**
3
+ * Define a parameter as Multipart file.
4
+ *
5
+ * ```typescript
6
+ * import {Controller, Post} from "@tsed/common";
7
+ * import {MulterOptions, MultipartFile} from "@tsed/common";
8
+ * import {Multer} from "@types/multer";
9
+ *
10
+ * type MulterFile = Express.Multer.File;
11
+ *
12
+ * @Controller('/')
13
+ * class MyCtrl {
14
+ * @Post('/file')
15
+ * private uploadFile(@MultipartFile("file1") file: MulterFile) {
16
+ *
17
+ * }
18
+ *
19
+ * @Post('/file')
20
+ * @MulterOptions({dest: "/other-dir"})
21
+ * private uploadFile(@MultipartFile("file1") file: MulterFile) {
22
+ *
23
+ * }
24
+ *
25
+ * @Post('/file2')
26
+ * @MulterOptions({dest: "/other-dir"})
27
+ * private uploadFile(@MultipartFile("file1") file: MulterFile, @MultipartFile("file2") file2: MulterFile) {
28
+ *
29
+ * }
30
+ *
31
+ * @Post('/files')
32
+ * private uploadFile(@MultipartFile("file1") files: MulterFile[]) {
33
+ *
34
+ * }
35
+ * }
36
+ * ```
37
+ *
38
+ * > See the tutorial on the [multer configuration](/tutorials/multer.md).
39
+ *
40
+ * @param name
41
+ * @param maxCount
42
+ * @returns Function
43
+ * @decorator
44
+ * @input
45
+ */
46
+ export declare function MultipartFile(name: string, maxCount?: number): ParameterDecorator;
47
+ export declare type MultipartFile = PlatformMulterFile;
@@ -0,0 +1,13 @@
1
+ import { EndpointMetadata } from "../../domain/EndpointMetadata";
2
+ /**
3
+ * Get the current endpoint metadata.
4
+ * @decorator
5
+ * @operation
6
+ * @input
7
+ * @deprecated Use `@Context() $ctx: Context` then `$ctx.endpoint` instead.
8
+ */
9
+ export declare function EndpointInfo(): Function;
10
+ /**
11
+ * @deprecated
12
+ */
13
+ export declare type EndpointInfo = EndpointMetadata;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @returns {Function}
3
+ * @decorator
4
+ * @operation
5
+ * @input
6
+ */
7
+ export declare function Err(): Function;