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

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 (386) hide show
  1. package/lib/cjs/builder/PlatformBuilder.js +286 -0
  2. package/lib/cjs/builder/PlatformBuilder.js.map +1 -0
  3. package/lib/cjs/builder/PlatformControllerBuilder.js +82 -0
  4. package/lib/cjs/builder/PlatformControllerBuilder.js.map +1 -0
  5. package/lib/cjs/config/interfaces/ConverterSettings.js +3 -0
  6. package/lib/cjs/config/interfaces/ConverterSettings.js.map +1 -0
  7. package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js +3 -0
  8. package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js.map +1 -0
  9. package/lib/cjs/config/interfaces/PlatformLoggerSettings.js +3 -0
  10. package/lib/cjs/config/interfaces/PlatformLoggerSettings.js.map +1 -0
  11. package/lib/cjs/config/interfaces/PlatformMulterSettings.js +3 -0
  12. package/lib/cjs/config/interfaces/PlatformMulterSettings.js.map +1 -0
  13. package/lib/cjs/config/interfaces/PlatformStaticsSettings.js +3 -0
  14. package/lib/cjs/config/interfaces/PlatformStaticsSettings.js.map +1 -0
  15. package/lib/cjs/config/services/PlatformConfiguration.js +181 -0
  16. package/lib/cjs/config/services/PlatformConfiguration.js.map +1 -0
  17. package/lib/cjs/constants/routerOptions.js +5 -0
  18. package/lib/cjs/constants/routerOptions.js.map +1 -0
  19. package/lib/cjs/decorators/multer/multerFileSize.js +35 -0
  20. package/lib/cjs/decorators/multer/multerFileSize.js.map +1 -0
  21. package/lib/cjs/decorators/multer/multerOptions.js +52 -0
  22. package/lib/cjs/decorators/multer/multerOptions.js.map +1 -0
  23. package/lib/cjs/decorators/multer/multipartFile.js +78 -0
  24. package/lib/cjs/decorators/multer/multipartFile.js.map +1 -0
  25. package/lib/cjs/decorators/params/error.js +20 -0
  26. package/lib/cjs/decorators/params/error.js.map +1 -0
  27. package/lib/cjs/decorators/params/next.js +21 -0
  28. package/lib/cjs/decorators/params/next.js.map +1 -0
  29. package/lib/cjs/decorators/params/request.js +39 -0
  30. package/lib/cjs/decorators/params/request.js.map +1 -0
  31. package/lib/cjs/decorators/params/response.js +33 -0
  32. package/lib/cjs/decorators/params/response.js.map +1 -0
  33. package/lib/cjs/domain/AnyToPromiseWithCtx.js +27 -0
  34. package/lib/cjs/domain/AnyToPromiseWithCtx.js.map +1 -0
  35. package/lib/cjs/domain/ControllerProvider.js +51 -0
  36. package/lib/cjs/domain/ControllerProvider.js.map +1 -0
  37. package/lib/cjs/domain/EndpointMetadata.js +6 -0
  38. package/lib/cjs/domain/EndpointMetadata.js.map +1 -0
  39. package/lib/cjs/domain/HandlerMetadata.js +57 -0
  40. package/lib/cjs/domain/HandlerMetadata.js.map +1 -0
  41. package/lib/cjs/domain/PlatformContext.js +92 -0
  42. package/lib/cjs/domain/PlatformContext.js.map +1 -0
  43. package/lib/cjs/domain/PlatformRouteDetails.js +24 -0
  44. package/lib/cjs/domain/PlatformRouteDetails.js.map +1 -0
  45. package/lib/cjs/exports.js +31 -0
  46. package/lib/cjs/exports.js.map +1 -0
  47. package/lib/cjs/index.js +70 -0
  48. package/lib/cjs/index.js.map +1 -0
  49. package/lib/cjs/interfaces/AfterInit.js +3 -0
  50. package/lib/cjs/interfaces/AfterInit.js.map +1 -0
  51. package/lib/cjs/interfaces/AfterListen.js +3 -0
  52. package/lib/cjs/interfaces/AfterListen.js.map +1 -0
  53. package/lib/cjs/interfaces/AfterRoutesInit.js +3 -0
  54. package/lib/cjs/interfaces/AfterRoutesInit.js.map +1 -0
  55. package/lib/cjs/interfaces/BeforeInit.js +3 -0
  56. package/lib/cjs/interfaces/BeforeInit.js.map +1 -0
  57. package/lib/cjs/interfaces/BeforeListen.js +3 -0
  58. package/lib/cjs/interfaces/BeforeListen.js.map +1 -0
  59. package/lib/cjs/interfaces/BeforeRoutesInit.js +3 -0
  60. package/lib/cjs/interfaces/BeforeRoutesInit.js.map +1 -0
  61. package/lib/cjs/interfaces/HandlerType.js +17 -0
  62. package/lib/cjs/interfaces/HandlerType.js.map +1 -0
  63. package/lib/cjs/interfaces/IncomingEvent.js +3 -0
  64. package/lib/cjs/interfaces/IncomingEvent.js.map +1 -0
  65. package/lib/cjs/interfaces/OnReady.js +3 -0
  66. package/lib/cjs/interfaces/OnReady.js.map +1 -0
  67. package/lib/cjs/interfaces/OnRequest.js +3 -0
  68. package/lib/cjs/interfaces/OnRequest.js.map +1 -0
  69. package/lib/cjs/interfaces/OnResponse.js +3 -0
  70. package/lib/cjs/interfaces/OnResponse.js.map +1 -0
  71. package/lib/cjs/interfaces/OnRoutesInit.js +3 -0
  72. package/lib/cjs/interfaces/OnRoutesInit.js.map +1 -0
  73. package/lib/cjs/interfaces/PlatformRouteOptions.js +3 -0
  74. package/lib/cjs/interfaces/PlatformRouteOptions.js.map +1 -0
  75. package/lib/cjs/interfaces/ResponseErrorObject.js +3 -0
  76. package/lib/cjs/interfaces/ResponseErrorObject.js.map +1 -0
  77. package/lib/cjs/interfaces/Route.js +3 -0
  78. package/lib/cjs/interfaces/Route.js.map +1 -0
  79. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js +37 -0
  80. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -0
  81. package/lib/cjs/middlewares/PlatformMulterMiddleware.js +67 -0
  82. package/lib/cjs/middlewares/PlatformMulterMiddleware.js.map +1 -0
  83. package/lib/cjs/middlewares/__mock__/FakeCtrl.js +12 -0
  84. package/lib/cjs/middlewares/__mock__/FakeCtrl.js.map +1 -0
  85. package/lib/cjs/middlewares/bindEndpointMiddleware.js +13 -0
  86. package/lib/cjs/middlewares/bindEndpointMiddleware.js.map +1 -0
  87. package/lib/cjs/package.json +3 -0
  88. package/lib/cjs/services/FakeAdapter.js +55 -0
  89. package/lib/cjs/services/FakeAdapter.js.map +1 -0
  90. package/lib/cjs/services/Platform.js +128 -0
  91. package/lib/cjs/services/Platform.js.map +1 -0
  92. package/lib/cjs/services/PlatformAdapter.js +14 -0
  93. package/lib/cjs/services/PlatformAdapter.js.map +1 -0
  94. package/lib/cjs/services/PlatformApplication.js +32 -0
  95. package/lib/cjs/services/PlatformApplication.js.map +1 -0
  96. package/lib/cjs/services/PlatformHandler.js +235 -0
  97. package/lib/cjs/services/PlatformHandler.js.map +1 -0
  98. package/lib/cjs/services/PlatformMiddlewaresChain.js +75 -0
  99. package/lib/cjs/services/PlatformMiddlewaresChain.js.map +1 -0
  100. package/lib/cjs/services/PlatformRequest.js +138 -0
  101. package/lib/cjs/services/PlatformRequest.js.map +1 -0
  102. package/lib/cjs/services/PlatformResponse.js +271 -0
  103. package/lib/cjs/services/PlatformResponse.js.map +1 -0
  104. package/lib/cjs/services/PlatformRouter.js +108 -0
  105. package/lib/cjs/services/PlatformRouter.js.map +1 -0
  106. package/lib/cjs/services/PlatformTest.js +167 -0
  107. package/lib/cjs/services/PlatformTest.js.map +1 -0
  108. package/lib/cjs/utils/__mock__/Test1.js +8 -0
  109. package/lib/cjs/utils/__mock__/Test1.js.map +1 -0
  110. package/lib/cjs/utils/__mock__/Test2.js +8 -0
  111. package/lib/cjs/utils/__mock__/Test2.js.map +1 -0
  112. package/lib/cjs/utils/createContext.js +38 -0
  113. package/lib/cjs/utils/createContext.js.map +1 -0
  114. package/lib/cjs/utils/createHandlerMetadata.js +49 -0
  115. package/lib/cjs/utils/createHandlerMetadata.js.map +1 -0
  116. package/lib/cjs/utils/createHttpServer.js +29 -0
  117. package/lib/cjs/utils/createHttpServer.js.map +1 -0
  118. package/lib/cjs/utils/createHttpsServer.js +29 -0
  119. package/lib/cjs/utils/createHttpsServer.js.map +1 -0
  120. package/lib/cjs/utils/createInjector.js +46 -0
  121. package/lib/cjs/utils/createInjector.js.map +1 -0
  122. package/lib/cjs/utils/getConfiguration.js +42 -0
  123. package/lib/cjs/utils/getConfiguration.js.map +1 -0
  124. package/lib/cjs/utils/getStaticsOptions.js +21 -0
  125. package/lib/cjs/utils/getStaticsOptions.js.map +1 -0
  126. package/lib/cjs/utils/importProviders.js +29 -0
  127. package/lib/cjs/utils/importProviders.js.map +1 -0
  128. package/lib/cjs/utils/listenServer.js +21 -0
  129. package/lib/cjs/utils/listenServer.js.map +1 -0
  130. package/lib/cjs/utils/mapReturnedResponse.js +15 -0
  131. package/lib/cjs/utils/mapReturnedResponse.js.map +1 -0
  132. package/lib/cjs/utils/printRoutes.js +36 -0
  133. package/lib/cjs/utils/printRoutes.js.map +1 -0
  134. package/lib/cjs/utils/setResponseHeaders.js +35 -0
  135. package/lib/cjs/utils/setResponseHeaders.js.map +1 -0
  136. package/lib/cjs/utils/useCtxHandler.js +15 -0
  137. package/lib/cjs/utils/useCtxHandler.js.map +1 -0
  138. package/lib/esm/builder/PlatformBuilder.js +282 -0
  139. package/lib/esm/builder/PlatformBuilder.js.map +1 -0
  140. package/lib/esm/builder/PlatformControllerBuilder.js +76 -0
  141. package/lib/esm/builder/PlatformControllerBuilder.js.map +1 -0
  142. package/lib/esm/config/interfaces/ConverterSettings.js +2 -0
  143. package/lib/esm/config/interfaces/ConverterSettings.js.map +1 -0
  144. package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js +2 -0
  145. package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js.map +1 -0
  146. package/lib/esm/config/interfaces/PlatformLoggerSettings.js +2 -0
  147. package/lib/esm/config/interfaces/PlatformLoggerSettings.js.map +1 -0
  148. package/lib/esm/config/interfaces/PlatformMulterSettings.js +2 -0
  149. package/lib/esm/config/interfaces/PlatformMulterSettings.js.map +1 -0
  150. package/lib/esm/config/interfaces/PlatformStaticsSettings.js +2 -0
  151. package/lib/esm/config/interfaces/PlatformStaticsSettings.js.map +1 -0
  152. package/lib/esm/config/services/PlatformConfiguration.js +178 -0
  153. package/lib/esm/config/services/PlatformConfiguration.js.map +1 -0
  154. package/lib/esm/constants/routerOptions.js +2 -0
  155. package/lib/esm/constants/routerOptions.js.map +1 -0
  156. package/lib/esm/decorators/multer/multerFileSize.js +31 -0
  157. package/lib/esm/decorators/multer/multerFileSize.js.map +1 -0
  158. package/lib/esm/decorators/multer/multerOptions.js +48 -0
  159. package/lib/esm/decorators/multer/multerOptions.js.map +1 -0
  160. package/lib/esm/decorators/multer/multipartFile.js +74 -0
  161. package/lib/esm/decorators/multer/multipartFile.js.map +1 -0
  162. package/lib/esm/decorators/params/error.js +16 -0
  163. package/lib/esm/decorators/params/error.js.map +1 -0
  164. package/lib/esm/decorators/params/next.js +17 -0
  165. package/lib/esm/decorators/params/next.js.map +1 -0
  166. package/lib/esm/decorators/params/request.js +34 -0
  167. package/lib/esm/decorators/params/request.js.map +1 -0
  168. package/lib/esm/decorators/params/response.js +28 -0
  169. package/lib/esm/decorators/params/response.js.map +1 -0
  170. package/lib/esm/domain/AnyToPromiseWithCtx.js +23 -0
  171. package/lib/esm/domain/AnyToPromiseWithCtx.js.map +1 -0
  172. package/lib/esm/domain/ControllerProvider.js +47 -0
  173. package/lib/esm/domain/ControllerProvider.js.map +1 -0
  174. package/lib/esm/domain/EndpointMetadata.js +2 -0
  175. package/lib/esm/domain/EndpointMetadata.js.map +1 -0
  176. package/lib/esm/domain/HandlerMetadata.js +53 -0
  177. package/lib/esm/domain/HandlerMetadata.js.map +1 -0
  178. package/lib/esm/domain/PlatformContext.js +88 -0
  179. package/lib/esm/domain/PlatformContext.js.map +1 -0
  180. package/lib/esm/domain/PlatformRouteDetails.js +20 -0
  181. package/lib/esm/domain/PlatformRouteDetails.js.map +1 -0
  182. package/lib/esm/exports.js +13 -0
  183. package/lib/esm/exports.js.map +1 -0
  184. package/lib/esm/index.js +67 -0
  185. package/lib/esm/index.js.map +1 -0
  186. package/lib/esm/interfaces/AfterInit.js +2 -0
  187. package/lib/esm/interfaces/AfterInit.js.map +1 -0
  188. package/lib/esm/interfaces/AfterListen.js +2 -0
  189. package/lib/esm/interfaces/AfterListen.js.map +1 -0
  190. package/lib/esm/interfaces/AfterRoutesInit.js +2 -0
  191. package/lib/esm/interfaces/AfterRoutesInit.js.map +1 -0
  192. package/lib/esm/interfaces/BeforeInit.js +2 -0
  193. package/lib/esm/interfaces/BeforeInit.js.map +1 -0
  194. package/lib/esm/interfaces/BeforeListen.js +2 -0
  195. package/lib/esm/interfaces/BeforeListen.js.map +1 -0
  196. package/lib/esm/interfaces/BeforeRoutesInit.js +2 -0
  197. package/lib/esm/interfaces/BeforeRoutesInit.js.map +1 -0
  198. package/lib/esm/interfaces/HandlerType.js +14 -0
  199. package/lib/esm/interfaces/HandlerType.js.map +1 -0
  200. package/lib/esm/interfaces/IncomingEvent.js +2 -0
  201. package/lib/esm/interfaces/IncomingEvent.js.map +1 -0
  202. package/lib/esm/interfaces/OnReady.js +2 -0
  203. package/lib/esm/interfaces/OnReady.js.map +1 -0
  204. package/lib/esm/interfaces/OnRequest.js +2 -0
  205. package/lib/esm/interfaces/OnRequest.js.map +1 -0
  206. package/lib/esm/interfaces/OnResponse.js +2 -0
  207. package/lib/esm/interfaces/OnResponse.js.map +1 -0
  208. package/lib/esm/interfaces/OnRoutesInit.js +2 -0
  209. package/lib/esm/interfaces/OnRoutesInit.js.map +1 -0
  210. package/lib/esm/interfaces/PlatformRouteOptions.js +2 -0
  211. package/lib/esm/interfaces/PlatformRouteOptions.js.map +1 -0
  212. package/lib/esm/interfaces/ResponseErrorObject.js +2 -0
  213. package/lib/esm/interfaces/ResponseErrorObject.js.map +1 -0
  214. package/lib/esm/interfaces/Route.js +2 -0
  215. package/lib/esm/interfaces/Route.js.map +1 -0
  216. package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js +34 -0
  217. package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -0
  218. package/lib/esm/middlewares/PlatformMulterMiddleware.js +63 -0
  219. package/lib/esm/middlewares/PlatformMulterMiddleware.js.map +1 -0
  220. package/lib/esm/middlewares/__mock__/FakeCtrl.js +9 -0
  221. package/lib/esm/middlewares/__mock__/FakeCtrl.js.map +1 -0
  222. package/lib/esm/middlewares/bindEndpointMiddleware.js +9 -0
  223. package/lib/esm/middlewares/bindEndpointMiddleware.js.map +1 -0
  224. package/lib/esm/package.json +3 -0
  225. package/lib/esm/services/FakeAdapter.js +51 -0
  226. package/lib/esm/services/FakeAdapter.js.map +1 -0
  227. package/lib/esm/services/Platform.js +125 -0
  228. package/lib/esm/services/Platform.js.map +1 -0
  229. package/lib/esm/services/PlatformAdapter.js +10 -0
  230. package/lib/esm/services/PlatformAdapter.js.map +1 -0
  231. package/lib/esm/services/PlatformApplication.js +29 -0
  232. package/lib/esm/services/PlatformApplication.js.map +1 -0
  233. package/lib/esm/services/PlatformHandler.js +232 -0
  234. package/lib/esm/services/PlatformHandler.js.map +1 -0
  235. package/lib/esm/services/PlatformMiddlewaresChain.js +72 -0
  236. package/lib/esm/services/PlatformMiddlewaresChain.js.map +1 -0
  237. package/lib/esm/services/PlatformRequest.js +135 -0
  238. package/lib/esm/services/PlatformRequest.js.map +1 -0
  239. package/lib/esm/services/PlatformResponse.js +268 -0
  240. package/lib/esm/services/PlatformResponse.js.map +1 -0
  241. package/lib/esm/services/PlatformRouter.js +105 -0
  242. package/lib/esm/services/PlatformRouter.js.map +1 -0
  243. package/lib/esm/services/PlatformTest.js +162 -0
  244. package/lib/esm/services/PlatformTest.js.map +1 -0
  245. package/lib/esm/utils/__mock__/Test1.js +4 -0
  246. package/lib/esm/utils/__mock__/Test1.js.map +1 -0
  247. package/lib/esm/utils/__mock__/Test2.js +4 -0
  248. package/lib/esm/utils/__mock__/Test2.js.map +1 -0
  249. package/lib/esm/utils/createContext.js +34 -0
  250. package/lib/esm/utils/createContext.js.map +1 -0
  251. package/lib/esm/utils/createHandlerMetadata.js +45 -0
  252. package/lib/esm/utils/createHandlerMetadata.js.map +1 -0
  253. package/lib/esm/utils/createHttpServer.js +24 -0
  254. package/lib/esm/utils/createHttpServer.js.map +1 -0
  255. package/lib/esm/utils/createHttpsServer.js +24 -0
  256. package/lib/esm/utils/createHttpsServer.js.map +1 -0
  257. package/lib/esm/utils/createInjector.js +42 -0
  258. package/lib/esm/utils/createInjector.js.map +1 -0
  259. package/lib/esm/utils/getConfiguration.js +38 -0
  260. package/lib/esm/utils/getConfiguration.js.map +1 -0
  261. package/lib/esm/utils/getStaticsOptions.js +17 -0
  262. package/lib/esm/utils/getStaticsOptions.js.map +1 -0
  263. package/lib/esm/utils/importProviders.js +25 -0
  264. package/lib/esm/utils/importProviders.js.map +1 -0
  265. package/lib/esm/utils/listenServer.js +17 -0
  266. package/lib/esm/utils/listenServer.js.map +1 -0
  267. package/lib/esm/utils/mapReturnedResponse.js +11 -0
  268. package/lib/esm/utils/mapReturnedResponse.js.map +1 -0
  269. package/lib/esm/utils/printRoutes.js +32 -0
  270. package/lib/esm/utils/printRoutes.js.map +1 -0
  271. package/lib/esm/utils/setResponseHeaders.js +31 -0
  272. package/lib/esm/utils/setResponseHeaders.js.map +1 -0
  273. package/lib/esm/utils/useCtxHandler.js +11 -0
  274. package/lib/esm/utils/useCtxHandler.js.map +1 -0
  275. package/lib/{builder → types/builder}/PlatformBuilder.d.ts +28 -32
  276. package/lib/types/builder/PlatformControllerBuilder.d.ts +18 -0
  277. package/lib/{config → types/config}/interfaces/ConverterSettings.d.ts +0 -0
  278. package/lib/{config → types/config}/interfaces/EndpointDirectoriesSettings.d.ts +0 -0
  279. package/lib/{config → types/config}/interfaces/PlatformLoggerSettings.d.ts +0 -16
  280. package/lib/types/config/interfaces/PlatformMulterSettings.d.ts +14 -0
  281. package/lib/{config → types/config}/interfaces/PlatformStaticsSettings.d.ts +1 -0
  282. package/lib/{config → types/config}/services/PlatformConfiguration.d.ts +15 -12
  283. package/lib/{constants → types/constants}/routerOptions.d.ts +0 -0
  284. package/lib/{decorators → types/decorators}/multer/multerFileSize.d.ts +0 -0
  285. package/lib/{decorators → types/decorators}/multer/multerOptions.d.ts +0 -0
  286. package/lib/{decorators → types/decorators}/multer/multipartFile.d.ts +0 -0
  287. package/lib/{decorators → types/decorators}/params/error.d.ts +0 -0
  288. package/lib/{decorators → types/decorators}/params/next.d.ts +0 -0
  289. package/lib/{decorators → types/decorators}/params/request.d.ts +0 -0
  290. package/lib/{decorators → types/decorators}/params/response.d.ts +0 -0
  291. package/lib/{domain → types/domain}/AnyToPromiseWithCtx.d.ts +0 -0
  292. package/lib/types/domain/ControllerProvider.d.ts +24 -0
  293. package/lib/types/domain/EndpointMetadata.d.ts +1 -0
  294. package/lib/{domain → types/domain}/HandlerMetadata.d.ts +2 -2
  295. package/lib/{domain → types/domain}/PlatformContext.d.ts +2 -2
  296. package/lib/types/domain/PlatformRouteDetails.d.ts +22 -0
  297. package/lib/types/exports.d.ts +12 -0
  298. package/lib/types/index.d.ts +66 -0
  299. package/lib/{interfaces → types/interfaces}/AfterInit.d.ts +0 -0
  300. package/lib/{interfaces → types/interfaces}/AfterListen.d.ts +0 -0
  301. package/lib/{interfaces → types/interfaces}/AfterRoutesInit.d.ts +0 -0
  302. package/lib/{interfaces → types/interfaces}/BeforeInit.d.ts +0 -0
  303. package/lib/{interfaces → types/interfaces}/BeforeListen.d.ts +0 -0
  304. package/lib/{interfaces → types/interfaces}/BeforeRoutesInit.d.ts +0 -0
  305. package/lib/{interfaces → types/interfaces}/HandlerType.d.ts +0 -0
  306. package/lib/{interfaces → types/interfaces}/IncomingEvent.d.ts +0 -0
  307. package/lib/{interfaces → types/interfaces}/OnReady.d.ts +0 -0
  308. package/lib/{interfaces → types/interfaces}/OnRequest.d.ts +0 -0
  309. package/lib/{interfaces → types/interfaces}/OnResponse.d.ts +0 -0
  310. package/lib/{interfaces → types/interfaces}/OnRoutesInit.d.ts +0 -0
  311. package/lib/{interfaces → types/interfaces}/PlatformRouteOptions.d.ts +6 -4
  312. package/lib/{interfaces → types/interfaces}/ResponseErrorObject.d.ts +0 -0
  313. package/lib/{interfaces → types/interfaces}/Route.d.ts +0 -0
  314. package/lib/{middlewares → types/middlewares}/PlatformAcceptMimesMiddleware.d.ts +0 -0
  315. package/lib/{middlewares → types/middlewares}/PlatformMulterMiddleware.d.ts +8 -3
  316. package/lib/{middlewares/data → types/middlewares/__mock__}/FakeCtrl.d.ts +0 -0
  317. package/lib/types/middlewares/bindEndpointMiddleware.d.ts +6 -0
  318. package/lib/types/services/FakeAdapter.d.ts +30 -0
  319. package/lib/{services → types/services}/Platform.d.ts +22 -7
  320. package/lib/types/services/PlatformAdapter.d.ts +47 -0
  321. package/lib/{services → types/services}/PlatformApplication.d.ts +3 -3
  322. package/lib/{services → types/services}/PlatformHandler.d.ts +4 -9
  323. package/lib/types/services/PlatformMiddlewaresChain.d.ts +10 -0
  324. package/lib/{services → types/services}/PlatformRequest.d.ts +2 -1
  325. package/lib/{services → types/services}/PlatformResponse.d.ts +10 -10
  326. package/lib/{services → types/services}/PlatformRouter.d.ts +13 -9
  327. package/lib/{services → types/services}/PlatformTest.d.ts +6 -5
  328. package/lib/types/utils/__mock__/Test1.d.ts +3 -0
  329. package/lib/types/utils/__mock__/Test2.d.ts +3 -0
  330. package/lib/{utils → types/utils}/createContext.d.ts +0 -0
  331. package/lib/{utils → types/utils}/createHandlerMetadata.d.ts +1 -1
  332. package/lib/types/utils/createHttpServer.d.ts +4 -0
  333. package/lib/types/utils/createHttpsServer.d.ts +5 -0
  334. package/lib/types/utils/createInjector.d.ts +9 -0
  335. package/lib/types/utils/getConfiguration.d.ts +2 -0
  336. package/lib/types/utils/getStaticsOptions.d.ts +5 -0
  337. package/lib/types/utils/importProviders.d.ts +10 -0
  338. package/lib/types/utils/listenServer.d.ts +7 -0
  339. package/lib/{utils → types/utils}/mapReturnedResponse.d.ts +0 -0
  340. package/lib/{utils → types/utils}/printRoutes.d.ts +0 -0
  341. package/lib/{utils → types/utils}/setResponseHeaders.d.ts +0 -0
  342. package/lib/{utils → types/utils}/useCtxHandler.d.ts +0 -0
  343. package/package.json +47 -30
  344. package/readme.md +50 -57
  345. package/tsconfig.compile.esm.json +13 -0
  346. package/lib/PlatformModule.d.ts +0 -15
  347. package/lib/builder/PlatformControllerBuilder.d.ts +0 -19
  348. package/lib/config/index.d.ts +0 -3
  349. package/lib/config/interfaces/PlatformMulterSettings.d.ts +0 -138
  350. package/lib/config/interfaces/index.d.ts +0 -82
  351. package/lib/decorators/class/controller.d.ts +0 -43
  352. package/lib/decorators/httpServer.d.ts +0 -27
  353. package/lib/decorators/httpsServer.d.ts +0 -27
  354. package/lib/decorators/index.d.ts +0 -14
  355. package/lib/decorators/method/acceptMime.d.ts +0 -19
  356. package/lib/decorators/method/endpointFn.d.ts +0 -8
  357. package/lib/decorators/method/location.d.ts +0 -1
  358. package/lib/decorators/method/redirect.d.ts +0 -1
  359. package/lib/decorators/method/route.d.ts +0 -128
  360. package/lib/decorators/multer/index.d.ts +0 -3
  361. package/lib/domain/ControllerProvider.d.ts +0 -54
  362. package/lib/domain/EndpointMetadata.d.ts +0 -89
  363. package/lib/domain/PlatformRouteDetails.d.ts +0 -29
  364. package/lib/domain/index.d.ts +0 -6
  365. package/lib/index.d.ts +0 -21
  366. package/lib/index.js +0 -3990
  367. package/lib/index.js.map +0 -1
  368. package/lib/index.modern.js +0 -3870
  369. package/lib/index.modern.js.map +0 -1
  370. package/lib/interfaces/PathType.d.ts +0 -1
  371. package/lib/interfaces/PlatformRouterMethods.d.ts +0 -10
  372. package/lib/interfaces/index.d.ts +0 -18
  373. package/lib/middlewares/PlatformLogMiddleware.d.ts +0 -44
  374. package/lib/middlewares/bindEndpointMiddleware.d.ts +0 -5
  375. package/lib/middlewares/index.d.ts +0 -4
  376. package/lib/registries/ControllerRegistry.d.ts +0 -1
  377. package/lib/services/ConverterService.d.ts +0 -27
  378. package/lib/services/FakeRawDriver.d.ts +0 -15
  379. package/lib/services/index.d.ts +0 -8
  380. package/lib/utils/createHttpServer.d.ts +0 -3
  381. package/lib/utils/createHttpsServer.d.ts +0 -3
  382. package/lib/utils/createInjector.d.ts +0 -2
  383. package/lib/utils/createPlatformApplication.d.ts +0 -2
  384. package/lib/utils/getControllerPath.d.ts +0 -2
  385. package/lib/utils/index.d.ts +0 -8
  386. package/lib/utils/listenServer.d.ts +0 -10
@@ -1,128 +0,0 @@
1
- /**
2
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
3
- *
4
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
5
- * For example, if you placed the following route at the top of all other route definitions, it would require that
6
- * all routes from that point on would require authentication, and automatically load a user.
7
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
8
- * to continue matching subsequent routes.
9
- * @param path
10
- * @param args
11
- * @returns {Function}
12
- * @decorator
13
- * @operation
14
- * @httpMethod
15
- */
16
- export declare function All(path?: string | RegExp | any, ...args: any[]): Function;
17
- /**
18
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
19
- *
20
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
21
- * For example, if you placed the following route at the top of all other route definitions, it would require that
22
- * all routes from that point on would require authentication, and automatically load a user.
23
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
24
- * to continue matching subsequent routes.
25
- * @param path
26
- * @param args
27
- * @returns {Function}
28
- * @decorator
29
- * @operation
30
- * @httpMethod
31
- */
32
- export declare function Get(path?: string | RegExp | any, ...args: any[]): Function;
33
- /**
34
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
35
- *
36
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
37
- * For example, if you placed the following route at the top of all other route definitions, it would require that
38
- * all routes from that point on would require authentication, and automatically load a user.
39
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
40
- * to continue matching subsequent routes.
41
- * @param path
42
- * @param args
43
- * @returns {Function}
44
- * @decorator
45
- * @operation
46
- * @httpMethod
47
- */
48
- export declare function Post(path?: string | RegExp | any, ...args: any[]): Function;
49
- /**
50
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
51
- *
52
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
53
- * For example, if you placed the following route at the top of all other route definitions, it would require that
54
- * all routes from that point on would require authentication, and automatically load a user.
55
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
56
- * to continue matching subsequent routes.
57
- * @param path
58
- * @param args
59
- * @returns {Function}
60
- * @decorator
61
- * @operation
62
- * @httpMethod
63
- */
64
- export declare function Put(path?: string | RegExp | any, ...args: any[]): Function;
65
- /**
66
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
67
- *
68
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
69
- * For example, if you placed the following route at the top of all other route definitions, it would require that
70
- * all routes from that point on would require authentication, and automatically load a user.
71
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
72
- * to continue matching subsequent routes.
73
- * @param path
74
- * @param args
75
- * @returns {Function}
76
- * @decorator
77
- * @operation
78
- * @httpMethod
79
- */
80
- export declare function Delete(path?: string | RegExp | any, ...args: any[]): Function;
81
- /**
82
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
83
- *
84
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
85
- * For example, if you placed the following route at the top of all other route definitions, it would require that
86
- * all routes from that point on would require authentication, and automatically load a user.
87
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
88
- * to continue matching subsequent routes.
89
- * @param path
90
- * @param args
91
- * @returns {Function}
92
- * @decorator
93
- * @operation
94
- * @httpMethod
95
- */
96
- export declare function Head(path?: string | RegExp | any, ...args: any[]): Function;
97
- /**
98
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
99
- *
100
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
101
- * For example, if you placed the following route at the top of all other route definitions, it would require that
102
- * all routes from that point on would require authentication, and automatically load a user.
103
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
104
- * to continue matching subsequent routes.
105
- * @param path
106
- * @param args
107
- * @returns {Function}
108
- * @decorator
109
- * @operation
110
- * @httpMethod
111
- */
112
- export declare function Patch(path?: string | RegExp | any, ...args: any[]): Function;
113
- /**
114
- * This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
115
- *
116
- * This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
117
- * For example, if you placed the following route at the top of all other route definitions, it would require that
118
- * all routes from that point on would require authentication, and automatically load a user.
119
- * Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
120
- * to continue matching subsequent routes.
121
- * @param path
122
- * @param args
123
- * @returns {Function}
124
- * @decorator
125
- * @operation
126
- * @httpMethod
127
- */
128
- export declare function Options(path?: string | RegExp | any, ...args: any[]): Function;
@@ -1,3 +0,0 @@
1
- export * from "./multerFileSize";
2
- export * from "./multerOptions";
3
- export * from "./multipartFile";
@@ -1,54 +0,0 @@
1
- import { Provider, TokenProvider } from "@tsed/di";
2
- import { JsonEntityStore } from "@tsed/schema";
3
- import { ControllerMiddlewares } from "../decorators/class/controller";
4
- import { PlatformRouterMethods } from "../interfaces/PlatformRouterMethods";
5
- import { EndpointMetadata } from "./EndpointMetadata";
6
- export declare class ControllerProvider<T = any> extends Provider<T> {
7
- readonly entity: JsonEntityStore;
8
- private router;
9
- constructor(provide: TokenProvider, options?: Partial<Provider>);
10
- get path(): string;
11
- set path(path: string);
12
- /**
13
- *
14
- * @returns {EndpointMetadata[]}
15
- */
16
- get endpoints(): EndpointMetadata[];
17
- get children(): TokenProvider[];
18
- /**
19
- *
20
- * @returns {ControllerProvider}
21
- */
22
- get parent(): TokenProvider | undefined;
23
- /**
24
- *
25
- */
26
- get routerOptions(): any;
27
- /**
28
- *
29
- * @param value
30
- */
31
- set routerOptions(value: any);
32
- /**
33
- *
34
- * @returns {any[]}
35
- */
36
- get middlewares(): ControllerMiddlewares;
37
- /**
38
- *
39
- * @param middlewares
40
- */
41
- set middlewares(middlewares: ControllerMiddlewares);
42
- /**
43
- *
44
- * @returns {boolean}
45
- */
46
- hasChildren(): boolean;
47
- /**
48
- *
49
- * @returns {boolean}
50
- */
51
- hasParent(): boolean;
52
- getRouter<T extends PlatformRouterMethods = any>(): T;
53
- setRouter(router: PlatformRouterMethods): this;
54
- }
@@ -1,89 +0,0 @@
1
- import { Type } from "@tsed/core";
2
- import { ParamMetadata } from "@tsed/platform-params";
3
- import { JsonEntityStore, JsonEntityStoreOptions, JsonOperation } from "@tsed/schema";
4
- export interface EndpointConstructorOptions extends JsonEntityStoreOptions {
5
- beforeMiddlewares?: Function[];
6
- middlewares?: Function[];
7
- afterMiddlewares?: Function[];
8
- }
9
- export interface EndpointViewOptions {
10
- path: string;
11
- options: any;
12
- }
13
- export interface EndpointRedirectOptions {
14
- status: number | undefined;
15
- url: string;
16
- }
17
- /**
18
- * EndpointMetadata contains metadata about a controller and his method.
19
- * Each annotation (@Get, @Body...) attached to a method are stored in a endpoint.
20
- * EndpointMetadata convert this metadata to an array which contain arguments to call an Express method.
21
- *
22
- * Example :
23
- *
24
- * @Controller("/my-path")
25
- * provide MyClass {
26
- *
27
- * @Get("/")
28
- * @Authenticated()
29
- * public myMethod(){}
30
- * }
31
- *
32
- */
33
- export declare class EndpointMetadata extends JsonEntityStore implements EndpointConstructorOptions {
34
- beforeMiddlewares: any[];
35
- middlewares: any[];
36
- afterMiddlewares: any[];
37
- statusCode: number;
38
- constructor(options: EndpointConstructorOptions);
39
- get targetName(): string;
40
- get params(): ParamMetadata[];
41
- /**
42
- * Return the JsonOperation
43
- */
44
- get operation(): JsonOperation;
45
- get operationPaths(): Map<string, import("@tsed/schema").JsonMethodPath>;
46
- get view(): EndpointViewOptions;
47
- set view(view: EndpointViewOptions);
48
- get acceptMimes(): string[];
49
- set acceptMimes(mimes: string[]);
50
- /**
51
- * Get all endpoints from a given class and his parents.
52
- * @param {Type<any>} target
53
- * @returns {EndpointMetadata[]}
54
- */
55
- static getEndpoints(target: Type<any>): EndpointMetadata[];
56
- /**
57
- * Get an endpoint.
58
- * @param target
59
- * @param propertyKey
60
- * @param descriptor
61
- */
62
- static get(target: Type<any>, propertyKey: string | symbol, descriptor?: PropertyDescriptor): EndpointMetadata;
63
- addOperationPath(method: string, path: string | RegExp, options?: any): JsonOperation;
64
- /**
65
- * Find the a value at the controller level. Let this value be extended or overridden by the endpoint itself.
66
- *
67
- * @param key
68
- * @returns {any}
69
- */
70
- get<T = any>(key: any): T;
71
- /**
72
- * Append middlewares to the beforeMiddlewares list.
73
- * @param args
74
- * @returns {EndpointMetadata}
75
- */
76
- before(args: Function[]): this;
77
- /**
78
- * Append middlewares to the afterMiddlewares list.
79
- * @param args
80
- * @returns {EndpointMetadata}
81
- */
82
- after(args: Function[]): this;
83
- /**
84
- * Store all arguments collected via Annotation.
85
- * @param args
86
- */
87
- use(args: Function[]): this;
88
- clone(): EndpointMetadata;
89
- }
@@ -1,29 +0,0 @@
1
- import { EndpointMetadata } from "./EndpointMetadata";
2
- import { ControllerProvider } from "./ControllerProvider";
3
- export interface PlatformRouterDetailsOptions {
4
- provider: ControllerProvider;
5
- endpoint: EndpointMetadata;
6
- method: string;
7
- url: string;
8
- }
9
- export declare class PlatformRouteDetails {
10
- readonly method: string;
11
- readonly url: string;
12
- readonly rawBody: boolean;
13
- readonly endpoint: EndpointMetadata;
14
- readonly provider: ControllerProvider;
15
- constructor({ provider, endpoint, method, url }: PlatformRouterDetailsOptions);
16
- get name(): string;
17
- get className(): string;
18
- get methodClassName(): string;
19
- get parameters(): import("@tsed/platform-params").ParamMetadata[];
20
- toJSON(): {
21
- method: string;
22
- name: string;
23
- url: string;
24
- className: string;
25
- methodClassName: string;
26
- parameters: import("@tsed/platform-params").ParamMetadata[];
27
- rawBody: boolean;
28
- };
29
- }
@@ -1,6 +0,0 @@
1
- export * from "./AnyToPromiseWithCtx";
2
- export * from "./PlatformContext";
3
- export * from "./PlatformRouteDetails";
4
- export * from "./ControllerProvider";
5
- export * from "./EndpointMetadata";
6
- export * from "./HandlerMetadata";
package/lib/index.d.ts DELETED
@@ -1,21 +0,0 @@
1
- export * from "@tsed/di";
2
- export * from "@tsed/platform-params";
3
- export * from "@tsed/platform-exceptions";
4
- export * from "@tsed/platform-response-filter";
5
- export * from "@tsed/platform-cache";
6
- export * from "@tsed/platform-middlewares";
7
- export * from "@tsed/platform-views";
8
- export * from "@tsed/components-scan";
9
- export { $log, Logger } from "@tsed/logger";
10
- export * from "./config";
11
- export * from "./builder/PlatformBuilder";
12
- export * from "./builder/PlatformControllerBuilder";
13
- export * from "./decorators";
14
- export * from "./constants/routerOptions";
15
- export * from "./interfaces";
16
- export * from "./middlewares";
17
- export * from "./domain";
18
- export * from "./services";
19
- export * from "./registries/ControllerRegistry";
20
- export * from "./utils";
21
- export * from "./PlatformModule";