@tsed/common 7.0.0-beta.1 → 7.0.0-beta.12

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 (298) hide show
  1. package/lib/cjs/builder/PlatformBuilder.js +48 -42
  2. package/lib/cjs/builder/PlatformBuilder.js.map +1 -1
  3. package/lib/cjs/builder/PlatformControllerBuilder.js +5 -8
  4. package/lib/cjs/builder/PlatformControllerBuilder.js.map +1 -1
  5. package/lib/cjs/config/interfaces/PlatformMulterSettings.js.map +1 -1
  6. package/lib/cjs/config/services/PlatformConfiguration.js +8 -2
  7. package/lib/cjs/config/services/PlatformConfiguration.js.map +1 -1
  8. package/lib/cjs/decorators/multer/multipartFile.js.map +1 -1
  9. package/lib/cjs/domain/EndpointMetadata.js +2 -66
  10. package/lib/cjs/domain/EndpointMetadata.js.map +1 -1
  11. package/lib/cjs/domain/PlatformContext.js.map +1 -1
  12. package/lib/cjs/domain/PlatformRouteDetails.js.map +1 -1
  13. package/lib/cjs/exports.js +31 -0
  14. package/lib/cjs/exports.js.map +1 -0
  15. package/lib/cjs/index.js +64 -30
  16. package/lib/cjs/index.js.map +1 -1
  17. package/lib/cjs/interfaces/PlatformRouteOptions.js.map +1 -1
  18. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js +8 -8
  19. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -1
  20. package/lib/cjs/middlewares/PlatformMulterMiddleware.js +25 -13
  21. package/lib/cjs/middlewares/PlatformMulterMiddleware.js.map +1 -1
  22. package/lib/cjs/middlewares/__mock__/FakeCtrl.js +1 -1
  23. package/lib/cjs/middlewares/bindEndpointMiddleware.js.map +1 -1
  24. package/lib/cjs/package.json +3 -0
  25. package/lib/cjs/services/FakeAdapter.js +55 -0
  26. package/lib/cjs/services/FakeAdapter.js.map +1 -0
  27. package/lib/cjs/services/Platform.js +30 -9
  28. package/lib/cjs/services/Platform.js.map +1 -1
  29. package/lib/cjs/services/PlatformAdapter.js +14 -0
  30. package/lib/cjs/services/PlatformAdapter.js.map +1 -0
  31. package/lib/cjs/services/PlatformApplication.js +9 -11
  32. package/lib/cjs/services/PlatformApplication.js.map +1 -1
  33. package/lib/cjs/services/PlatformHandler.js +11 -9
  34. package/lib/cjs/services/PlatformHandler.js.map +1 -1
  35. package/lib/cjs/services/PlatformMiddlewaresChain.js +56 -15
  36. package/lib/cjs/services/PlatformMiddlewaresChain.js.map +1 -1
  37. package/lib/cjs/services/PlatformRequest.js +2 -2
  38. package/lib/cjs/services/PlatformResponse.js +5 -5
  39. package/lib/cjs/services/PlatformResponse.js.map +1 -1
  40. package/lib/cjs/services/PlatformRouter.js +14 -32
  41. package/lib/cjs/services/PlatformRouter.js.map +1 -1
  42. package/lib/cjs/services/PlatformTest.js +10 -3
  43. package/lib/cjs/services/PlatformTest.js.map +1 -1
  44. package/lib/cjs/utils/__mock__/Test1.js +8 -0
  45. package/lib/cjs/utils/__mock__/Test1.js.map +1 -0
  46. package/lib/cjs/utils/__mock__/Test2.js +8 -0
  47. package/lib/cjs/utils/__mock__/Test2.js.map +1 -0
  48. package/lib/cjs/utils/__mock__/controllers/rest/TestCtrl.js +12 -0
  49. package/lib/cjs/utils/__mock__/controllers/rest/TestCtrl.js.map +1 -0
  50. package/lib/cjs/utils/__mock__/module1/Module1.js +19 -0
  51. package/lib/cjs/utils/__mock__/module1/Module1.js.map +1 -0
  52. package/lib/cjs/utils/__mock__/module1/controllers/M1Ctrl1.js +17 -0
  53. package/lib/cjs/utils/__mock__/module1/controllers/M1Ctrl1.js.map +1 -0
  54. package/lib/cjs/utils/__mock__/module1/services/M1Service.js +17 -0
  55. package/lib/cjs/utils/__mock__/module1/services/M1Service.js.map +1 -0
  56. package/lib/cjs/utils/__mock__/module1/submodule/SubModule.js +15 -0
  57. package/lib/cjs/utils/__mock__/module1/submodule/SubModule.js.map +1 -0
  58. package/lib/cjs/utils/__mock__/module1/submodule/SubService.js +12 -0
  59. package/lib/cjs/utils/__mock__/module1/submodule/SubService.js.map +1 -0
  60. package/lib/cjs/utils/__mock__/module2/Module2.js +18 -0
  61. package/lib/cjs/utils/__mock__/module2/Module2.js.map +1 -0
  62. package/lib/cjs/utils/__mock__/module2/controllers/M2Ctrl.js +12 -0
  63. package/lib/cjs/utils/__mock__/module2/controllers/M2Ctrl.js.map +1 -0
  64. package/lib/cjs/utils/createContext.js +2 -2
  65. package/lib/cjs/utils/createContext.js.map +1 -1
  66. package/lib/cjs/utils/createHandlerMetadata.js +2 -2
  67. package/lib/cjs/utils/createHandlerMetadata.js.map +1 -1
  68. package/lib/cjs/utils/createHttpServer.js +3 -8
  69. package/lib/cjs/utils/createHttpServer.js.map +1 -1
  70. package/lib/cjs/utils/createHttpsServer.js +3 -8
  71. package/lib/cjs/utils/createHttpsServer.js.map +1 -1
  72. package/lib/cjs/utils/createInjector.js +11 -3
  73. package/lib/cjs/utils/createInjector.js.map +1 -1
  74. package/lib/cjs/utils/getConfiguration.js +4 -0
  75. package/lib/cjs/utils/getConfiguration.js.map +1 -1
  76. package/lib/cjs/utils/setResponseHeaders.js.map +1 -1
  77. package/lib/esm/builder/PlatformBuilder.js +38 -32
  78. package/lib/esm/builder/PlatformBuilder.js.map +1 -1
  79. package/lib/esm/builder/PlatformControllerBuilder.js +8 -11
  80. package/lib/esm/builder/PlatformControllerBuilder.js.map +1 -1
  81. package/lib/esm/config/interfaces/PlatformMulterSettings.js.map +1 -1
  82. package/lib/esm/config/services/PlatformConfiguration.js +6 -0
  83. package/lib/esm/config/services/PlatformConfiguration.js.map +1 -1
  84. package/lib/esm/decorators/multer/multerFileSize.js +1 -1
  85. package/lib/esm/decorators/multer/multerOptions.js +1 -1
  86. package/lib/esm/decorators/multer/multipartFile.js +1 -1
  87. package/lib/esm/decorators/multer/multipartFile.js.map +1 -1
  88. package/lib/esm/domain/ControllerProvider.js +1 -1
  89. package/lib/esm/domain/EndpointMetadata.js +1 -66
  90. package/lib/esm/domain/EndpointMetadata.js.map +1 -1
  91. package/lib/esm/domain/HandlerMetadata.js +1 -1
  92. package/lib/esm/domain/PlatformContext.js +3 -3
  93. package/lib/esm/domain/PlatformContext.js.map +1 -1
  94. package/lib/esm/domain/PlatformRouteDetails.js.map +1 -1
  95. package/lib/esm/exports.js +13 -0
  96. package/lib/esm/exports.js.map +1 -0
  97. package/lib/esm/index.js +64 -27
  98. package/lib/esm/index.js.map +1 -1
  99. package/lib/esm/interfaces/PlatformRouteOptions.js.map +1 -1
  100. package/lib/esm/middlewares/PlatformMulterMiddleware.js +16 -5
  101. package/lib/esm/middlewares/PlatformMulterMiddleware.js.map +1 -1
  102. package/lib/esm/middlewares/bindEndpointMiddleware.js.map +1 -1
  103. package/lib/esm/package.json +3 -0
  104. package/lib/esm/services/FakeAdapter.js +51 -0
  105. package/lib/esm/services/FakeAdapter.js.map +1 -0
  106. package/lib/esm/services/Platform.js +31 -10
  107. package/lib/esm/services/Platform.js.map +1 -1
  108. package/lib/esm/services/PlatformAdapter.js +10 -0
  109. package/lib/esm/services/PlatformAdapter.js.map +1 -0
  110. package/lib/esm/services/PlatformApplication.js +11 -13
  111. package/lib/esm/services/PlatformApplication.js.map +1 -1
  112. package/lib/esm/services/PlatformHandler.js +13 -11
  113. package/lib/esm/services/PlatformHandler.js.map +1 -1
  114. package/lib/esm/services/PlatformMiddlewaresChain.js +61 -20
  115. package/lib/esm/services/PlatformMiddlewaresChain.js.map +1 -1
  116. package/lib/esm/services/PlatformResponse.js +1 -1
  117. package/lib/esm/services/PlatformResponse.js.map +1 -1
  118. package/lib/esm/services/PlatformRouter.js +13 -31
  119. package/lib/esm/services/PlatformRouter.js.map +1 -1
  120. package/lib/esm/services/PlatformTest.js +14 -8
  121. package/lib/esm/services/PlatformTest.js.map +1 -1
  122. package/lib/esm/utils/__mock__/Test1.js +4 -0
  123. package/lib/esm/utils/__mock__/Test1.js.map +1 -0
  124. package/lib/esm/utils/__mock__/Test2.js +4 -0
  125. package/lib/esm/utils/__mock__/Test2.js.map +1 -0
  126. package/lib/esm/utils/__mock__/controllers/rest/TestCtrl.js +9 -0
  127. package/lib/esm/utils/__mock__/controllers/rest/TestCtrl.js.map +1 -0
  128. package/lib/esm/utils/__mock__/module1/Module1.js +16 -0
  129. package/lib/esm/utils/__mock__/module1/Module1.js.map +1 -0
  130. package/lib/esm/utils/__mock__/module1/controllers/M1Ctrl1.js +14 -0
  131. package/lib/esm/utils/__mock__/module1/controllers/M1Ctrl1.js.map +1 -0
  132. package/lib/esm/utils/__mock__/module1/services/M1Service.js +14 -0
  133. package/lib/esm/utils/__mock__/module1/services/M1Service.js.map +1 -0
  134. package/lib/esm/utils/__mock__/module1/submodule/SubModule.js +12 -0
  135. package/lib/esm/utils/__mock__/module1/submodule/SubModule.js.map +1 -0
  136. package/lib/esm/utils/__mock__/module1/submodule/SubService.js +9 -0
  137. package/lib/esm/utils/__mock__/module1/submodule/SubService.js.map +1 -0
  138. package/lib/esm/utils/__mock__/module2/Module2.js +15 -0
  139. package/lib/esm/utils/__mock__/module2/Module2.js.map +1 -0
  140. package/lib/esm/utils/__mock__/module2/controllers/M2Ctrl.js +9 -0
  141. package/lib/esm/utils/__mock__/module2/controllers/M2Ctrl.js.map +1 -0
  142. package/lib/esm/utils/createContext.js +5 -5
  143. package/lib/esm/utils/createContext.js.map +1 -1
  144. package/lib/esm/utils/createHandlerMetadata.js +3 -3
  145. package/lib/esm/utils/createHandlerMetadata.js.map +1 -1
  146. package/lib/esm/utils/createHttpServer.js +3 -8
  147. package/lib/esm/utils/createHttpServer.js.map +1 -1
  148. package/lib/esm/utils/createHttpsServer.js +3 -8
  149. package/lib/esm/utils/createHttpsServer.js.map +1 -1
  150. package/lib/esm/utils/createInjector.js +18 -10
  151. package/lib/esm/utils/createInjector.js.map +1 -1
  152. package/lib/esm/utils/getConfiguration.js +4 -0
  153. package/lib/esm/utils/getConfiguration.js.map +1 -1
  154. package/lib/esm/utils/setResponseHeaders.js.map +1 -1
  155. package/lib/esm/utils/useCtxHandler.js +1 -1
  156. package/lib/types/builder/PlatformBuilder.d.ts +9 -8
  157. package/lib/types/builder/PlatformControllerBuilder.d.ts +2 -1
  158. package/lib/types/config/interfaces/PlatformMulterSettings.d.ts +6 -130
  159. package/lib/types/config/services/PlatformConfiguration.d.ts +12 -6
  160. package/lib/types/domain/EndpointMetadata.d.ts +1 -50
  161. package/lib/types/domain/PlatformContext.d.ts +1 -1
  162. package/lib/types/domain/PlatformRouteDetails.d.ts +2 -3
  163. package/lib/types/exports.d.ts +12 -0
  164. package/lib/types/index.d.ts +61 -17
  165. package/lib/types/interfaces/PlatformRouteOptions.d.ts +1 -1
  166. package/lib/types/middlewares/PlatformMulterMiddleware.d.ts +8 -3
  167. package/lib/types/middlewares/bindEndpointMiddleware.d.ts +2 -1
  168. package/lib/types/services/FakeAdapter.d.ts +30 -0
  169. package/lib/types/services/Platform.d.ts +10 -1
  170. package/lib/types/services/PlatformAdapter.d.ts +47 -0
  171. package/lib/types/services/PlatformApplication.d.ts +3 -3
  172. package/lib/types/services/PlatformHandler.d.ts +1 -1
  173. package/lib/types/services/PlatformMiddlewaresChain.d.ts +6 -2
  174. package/lib/types/services/PlatformResponse.d.ts +6 -6
  175. package/lib/types/services/PlatformRouter.d.ts +10 -7
  176. package/lib/types/services/PlatformTest.d.ts +2 -2
  177. package/lib/types/utils/__mock__/Test1.d.ts +3 -0
  178. package/lib/types/utils/__mock__/Test2.d.ts +3 -0
  179. package/lib/types/utils/__mock__/controllers/rest/TestCtrl.d.ts +2 -0
  180. package/lib/types/utils/__mock__/module1/Module1.d.ts +2 -0
  181. package/lib/types/utils/__mock__/module1/controllers/M1Ctrl1.d.ts +5 -0
  182. package/lib/types/utils/__mock__/module1/services/M1Service.d.ts +5 -0
  183. package/lib/types/utils/__mock__/module1/submodule/SubModule.d.ts +2 -0
  184. package/lib/types/utils/__mock__/module1/submodule/SubService.d.ts +2 -0
  185. package/lib/types/utils/__mock__/module2/Module2.d.ts +2 -0
  186. package/lib/types/utils/__mock__/module2/controllers/M2Ctrl.d.ts +2 -0
  187. package/lib/types/utils/createHandlerMetadata.d.ts +1 -1
  188. package/lib/types/utils/createHttpServer.d.ts +1 -1
  189. package/lib/types/utils/createHttpsServer.d.ts +2 -1
  190. package/lib/types/utils/createInjector.d.ts +5 -3
  191. package/package.json +41 -26
  192. package/readme.md +52 -58
  193. package/tsconfig.compile.esm.json +2 -12
  194. package/lib/cjs/config/index.js +0 -7
  195. package/lib/cjs/config/index.js.map +0 -1
  196. package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js +0 -3
  197. package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js.map +0 -1
  198. package/lib/cjs/config/interfaces/index.js +0 -8
  199. package/lib/cjs/config/interfaces/index.js.map +0 -1
  200. package/lib/cjs/decorators/httpServer.js +0 -32
  201. package/lib/cjs/decorators/httpServer.js.map +0 -1
  202. package/lib/cjs/decorators/httpsServer.js +0 -32
  203. package/lib/cjs/decorators/httpsServer.js.map +0 -1
  204. package/lib/cjs/decorators/index.js +0 -21
  205. package/lib/cjs/decorators/index.js.map +0 -1
  206. package/lib/cjs/decorators/method/acceptMime.js +0 -28
  207. package/lib/cjs/decorators/method/acceptMime.js.map +0 -1
  208. package/lib/cjs/decorators/method/endpointFn.js +0 -15
  209. package/lib/cjs/decorators/method/endpointFn.js.map +0 -1
  210. package/lib/cjs/decorators/method/location.js +0 -6
  211. package/lib/cjs/decorators/method/location.js.map +0 -1
  212. package/lib/cjs/decorators/method/redirect.js +0 -6
  213. package/lib/cjs/decorators/method/redirect.js.map +0 -1
  214. package/lib/cjs/decorators/method/route.js +0 -13
  215. package/lib/cjs/decorators/method/route.js.map +0 -1
  216. package/lib/cjs/decorators/method/view.js +0 -34
  217. package/lib/cjs/decorators/method/view.js.map +0 -1
  218. package/lib/cjs/decorators/multer/index.js +0 -7
  219. package/lib/cjs/decorators/multer/index.js.map +0 -1
  220. package/lib/cjs/domain/index.js +0 -10
  221. package/lib/cjs/domain/index.js.map +0 -1
  222. package/lib/cjs/interfaces/PathType.js +0 -3
  223. package/lib/cjs/interfaces/PathType.js.map +0 -1
  224. package/lib/cjs/interfaces/PlatformAdapter.js +0 -3
  225. package/lib/cjs/interfaces/PlatformAdapter.js.map +0 -1
  226. package/lib/cjs/interfaces/index.js +0 -21
  227. package/lib/cjs/interfaces/index.js.map +0 -1
  228. package/lib/cjs/middlewares/index.js +0 -7
  229. package/lib/cjs/middlewares/index.js.map +0 -1
  230. package/lib/cjs/services/FakeRawDriver.js +0 -26
  231. package/lib/cjs/services/FakeRawDriver.js.map +0 -1
  232. package/lib/cjs/services/index.js +0 -12
  233. package/lib/cjs/services/index.js.map +0 -1
  234. package/lib/cjs/utils/index.js +0 -11
  235. package/lib/cjs/utils/index.js.map +0 -1
  236. package/lib/esm/config/index.js +0 -4
  237. package/lib/esm/config/index.js.map +0 -1
  238. package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js +0 -2
  239. package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js.map +0 -1
  240. package/lib/esm/config/interfaces/index.js +0 -5
  241. package/lib/esm/config/interfaces/index.js.map +0 -1
  242. package/lib/esm/decorators/httpServer.js +0 -28
  243. package/lib/esm/decorators/httpServer.js.map +0 -1
  244. package/lib/esm/decorators/httpsServer.js +0 -28
  245. package/lib/esm/decorators/httpsServer.js.map +0 -1
  246. package/lib/esm/decorators/index.js +0 -18
  247. package/lib/esm/decorators/index.js.map +0 -1
  248. package/lib/esm/decorators/method/acceptMime.js +0 -24
  249. package/lib/esm/decorators/method/acceptMime.js.map +0 -1
  250. package/lib/esm/decorators/method/endpointFn.js +0 -11
  251. package/lib/esm/decorators/method/endpointFn.js.map +0 -1
  252. package/lib/esm/decorators/method/location.js +0 -2
  253. package/lib/esm/decorators/method/location.js.map +0 -1
  254. package/lib/esm/decorators/method/redirect.js +0 -2
  255. package/lib/esm/decorators/method/redirect.js.map +0 -1
  256. package/lib/esm/decorators/method/route.js +0 -2
  257. package/lib/esm/decorators/method/route.js.map +0 -1
  258. package/lib/esm/decorators/method/view.js +0 -30
  259. package/lib/esm/decorators/method/view.js.map +0 -1
  260. package/lib/esm/decorators/multer/index.js +0 -4
  261. package/lib/esm/decorators/multer/index.js.map +0 -1
  262. package/lib/esm/domain/index.js +0 -7
  263. package/lib/esm/domain/index.js.map +0 -1
  264. package/lib/esm/interfaces/PathType.js +0 -2
  265. package/lib/esm/interfaces/PathType.js.map +0 -1
  266. package/lib/esm/interfaces/PlatformAdapter.js +0 -2
  267. package/lib/esm/interfaces/PlatformAdapter.js.map +0 -1
  268. package/lib/esm/interfaces/index.js +0 -18
  269. package/lib/esm/interfaces/index.js.map +0 -1
  270. package/lib/esm/middlewares/index.js +0 -4
  271. package/lib/esm/middlewares/index.js.map +0 -1
  272. package/lib/esm/services/FakeRawDriver.js +0 -22
  273. package/lib/esm/services/FakeRawDriver.js.map +0 -1
  274. package/lib/esm/services/index.js +0 -9
  275. package/lib/esm/services/index.js.map +0 -1
  276. package/lib/esm/utils/index.js +0 -8
  277. package/lib/esm/utils/index.js.map +0 -1
  278. package/lib/types/config/index.d.ts +0 -3
  279. package/lib/types/config/interfaces/EndpointDirectoriesSettings.d.ts +0 -3
  280. package/lib/types/config/interfaces/index.d.ts +0 -97
  281. package/lib/types/decorators/httpServer.d.ts +0 -28
  282. package/lib/types/decorators/httpsServer.d.ts +0 -28
  283. package/lib/types/decorators/index.d.ts +0 -14
  284. package/lib/types/decorators/method/acceptMime.d.ts +0 -19
  285. package/lib/types/decorators/method/endpointFn.d.ts +0 -9
  286. package/lib/types/decorators/method/location.d.ts +0 -1
  287. package/lib/types/decorators/method/redirect.d.ts +0 -1
  288. package/lib/types/decorators/method/route.d.ts +0 -1
  289. package/lib/types/decorators/method/view.d.ts +0 -25
  290. package/lib/types/decorators/multer/index.d.ts +0 -3
  291. package/lib/types/domain/index.d.ts +0 -6
  292. package/lib/types/interfaces/PathType.d.ts +0 -1
  293. package/lib/types/interfaces/PlatformAdapter.d.ts +0 -19
  294. package/lib/types/interfaces/index.d.ts +0 -17
  295. package/lib/types/middlewares/index.d.ts +0 -3
  296. package/lib/types/services/FakeRawDriver.d.ts +0 -15
  297. package/lib/types/services/index.d.ts +0 -8
  298. package/lib/types/utils/index.d.ts +0 -7
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@tsed/common",
3
- "version": "7.0.0-beta.1",
3
+ "version": "7.0.0-beta.12",
4
4
  "description": "A TypeScript Framework on top of Express",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
7
7
  "main": "./lib/cjs/index.js",
8
+ "module": "./lib/esm/index.js",
8
9
  "typings": "./lib/types/index.d.ts",
9
10
  "exports": {
10
11
  "types": "./lib/types/index.d.ts",
@@ -13,9 +14,10 @@
13
14
  "default": "./lib/esm/index.js"
14
15
  },
15
16
  "scripts": {
16
- "build": "yarn run build:esm && yarn run build:cjs",
17
+ "build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
17
18
  "build:cjs": "tsc --build tsconfig.compile.json",
18
- "build:esm": "tsc --build tsconfig.compile.esm.json"
19
+ "build:esm": "tsc --build tsconfig.compile.esm.json",
20
+ "barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\" -e \"getConfiguration\""
19
21
  },
20
22
  "keywords": [
21
23
  "Express",
@@ -46,7 +48,7 @@
46
48
  "bugs": {
47
49
  "url": "https://github.com/tsedio/tsed/issues"
48
50
  },
49
- "homepage": "https://github.com/tsedio/tsed/tree/alpha/packages/platform/common",
51
+ "homepage": "https://github.com/tsedio/tsed/tree/beta/packages/platform/common",
50
52
  "repository": "https://github.com/tsedio/tsed",
51
53
  "funding": [
52
54
  {
@@ -59,29 +61,42 @@
59
61
  }
60
62
  ],
61
63
  "dependencies": {
62
- "@tsed/components-scan": "7.0.0-beta.1",
63
- "@tsed/core": "7.0.0-beta.1",
64
- "@tsed/di": "7.0.0-beta.1",
65
- "@tsed/exceptions": "7.0.0-beta.1",
66
- "@tsed/json-mapper": "7.0.0-beta.1",
67
- "@tsed/logger": "^6.0.0",
68
- "@tsed/logger-file": "^6.0.0",
69
- "@tsed/perf": "7.0.0-beta.1",
70
- "@tsed/platform-cache": "7.0.0-beta.1",
71
- "@tsed/platform-exceptions": "7.0.0-beta.1",
72
- "@tsed/platform-log-middleware": "7.0.0-beta.1",
73
- "@tsed/platform-middlewares": "7.0.0-beta.1",
74
- "@tsed/platform-params": "7.0.0-beta.1",
75
- "@tsed/platform-response-filter": "7.0.0-beta.1",
76
- "@tsed/platform-views": "7.0.0-beta.1",
77
- "@tsed/schema": "7.0.0-beta.1",
78
- "@types/json-schema": "7.0.7",
79
- "on-finished": "2.3.0",
80
- "tslib": "2.2.0",
64
+ "@tsed/components-scan": "7.0.0-beta.12",
65
+ "@tsed/core": "7.0.0-beta.12",
66
+ "@tsed/di": "7.0.0-beta.12",
67
+ "@tsed/exceptions": "7.0.0-beta.12",
68
+ "@tsed/json-mapper": "7.0.0-beta.12",
69
+ "@tsed/logger": ">=6.1.1",
70
+ "@tsed/logger-file": ">=6.1.0",
71
+ "@tsed/perf": "7.0.0-beta.12",
72
+ "@tsed/platform-cache": "7.0.0-beta.12",
73
+ "@tsed/platform-exceptions": "7.0.0-beta.12",
74
+ "@tsed/platform-log-middleware": "7.0.0-beta.12",
75
+ "@tsed/platform-middlewares": "7.0.0-beta.12",
76
+ "@tsed/platform-params": "7.0.0-beta.12",
77
+ "@tsed/platform-response-filter": "7.0.0-beta.12",
78
+ "@tsed/platform-views": "7.0.0-beta.12",
79
+ "@tsed/schema": "7.0.0-beta.12",
80
+ "@types/json-schema": "7.0.11",
81
+ "@types/on-finished": "2.3.1",
82
+ "on-finished": "2.4.1",
83
+ "tslib": "2.3.1",
81
84
  "uuid": "8.3.2"
82
85
  },
83
- "devDependencies": {
84
- "rxjs": "^6.5.2"
86
+ "peerDependencies": {
87
+ "@tsed/logger": ">=6.1.1",
88
+ "@tsed/logger-file": ">=6.1.0"
85
89
  },
86
- "peerDependencies": {}
90
+ "peerDependenciesMeta": {
91
+ "@tsed/logger": {
92
+ "optional": false
93
+ },
94
+ "@tsed/logger-file": {
95
+ "optional": false
96
+ }
97
+ },
98
+ "devDependencies": {},
99
+ "publishConfig": {
100
+ "tag": "beta"
101
+ }
87
102
  }
package/readme.md CHANGED
@@ -11,7 +11,8 @@
11
11
  [![npm version](https://badge.fury.io/js/%40tsed%2Fcommon.svg)](https://badge.fury.io/js/%40tsed%2Fcommon)
12
12
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
13
13
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
14
- [![backers](https://opencollective.com/tsed/tiers/badge.svg)](https://opencollective.com/tsed)
14
+ [![github](https://img.shields.io/static/v1?label=Github%20sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/romakita)
15
+ [![opencollective](https://img.shields.io/static/v1?label=OpenCollective%20sponsor&message=%E2%9D%A4&logo=OpenCollective&color=%23fe8e86)](https://opencollective.com/tsed)
15
16
 
16
17
  </div>
17
18
 
@@ -31,32 +32,32 @@
31
32
 
32
33
  ## What it is
33
34
 
34
- Ts.ED is a framework on top of Express that helps you to write your application in TypeScript (or in ES6). It provides a lot of decorators
35
+ Ts.ED is a framework on top of Express that helps you to write your application in TypeScript (or in ES6). It provides a lot of decorators
35
36
  to make your code more readable and less error-prone.
36
37
 
37
38
  ## Features
38
39
 
39
- * Use our CLI to create a new project https://cli.tsed.io
40
- * Support TypeORM, Mongoose, GraphQL, Socket.io, Swagger-ui, Passport.js, etc...
41
- * Define class as Controller,
42
- * Define class as Service (IoC),
43
- * Define class as Middleware and MiddlewareError,
44
- * Define class as Converter (POJ to Model and Model to POJ),
45
- * Define root path for an entire controller and versioning your Rest API,
46
- * Define as sub-route path for a method,
47
- * Define routes on GET, POST, PUT, DELETE and HEAD verbs,
48
- * Define middlewares on routes,
49
- * Define required parameters,
50
- * Inject data from query string, path parameters, entire body, cookies, session or header,
51
- * Inject Request, Response, Next object from Express request,
52
- * Template (View),
53
- * Testing.
40
+ - Use our CLI to create a new project https://cli.tsed.io
41
+ - Support TypeORM, Mongoose, GraphQL, Socket.io, Swagger-ui, Passport.js, etc...
42
+ - Define class as Controller,
43
+ - Define class as Service (IoC),
44
+ - Define class as Middleware and MiddlewareError,
45
+ - Define class as Converter (POJ to Model and Model to POJ),
46
+ - Define root path for an entire controller and versioning your Rest API,
47
+ - Define as sub-route path for a method,
48
+ - Define routes on GET, POST, PUT, DELETE and HEAD verbs,
49
+ - Define middlewares on routes,
50
+ - Define required parameters,
51
+ - Inject data from query string, path parameters, entire body, cookies, session or header,
52
+ - Inject Request, Response, Next object from Express request,
53
+ - Template (View),
54
+ - Testing.
54
55
 
55
56
  ## Documentation
56
57
 
57
58
  Documentation is available on [https://tsed.io](https://tsed.io)
58
59
 
59
- ## Getting started
60
+ ## Getting started
60
61
 
61
62
  See our [getting started here](https://tsed.io/getting-started/) to create new Ts.ED project or use
62
63
  our [CLI](https://cli.tsed.io)
@@ -65,8 +66,8 @@ our [CLI](https://cli.tsed.io)
65
66
 
66
67
  Examples are available on [https://tsed.io/tutorials/](https://tsed.io/tutorials/)
67
68
 
68
-
69
69
  ## Overview
70
+
70
71
  ### Server example
71
72
 
72
73
  Here an example to create a Server with Ts.ED:
@@ -75,37 +76,19 @@ Here an example to create a Server with Ts.ED:
75
76
  import {Configuration, Inject} from "@tsed/di";
76
77
  import {PlatformApplication} from "@tsed/common";
77
78
  import "@tsed/platform-express";
78
- import * as Path from "path";
79
-
80
- export const rootDir = Path.resolve(__dirname);
79
+ import Path from "path";
80
+ import cookieParser from "cookie-parser";
81
+ import compress from "compression";
82
+ import methodOverride from "method-override";
81
83
 
82
84
  @Configuration({
83
- rootDir,
84
- port: 3000
85
+ port: 3000,
86
+ middlewares: [cookieParser(), compress({}), methodOverride()]
85
87
  })
86
- export class Server {
87
- @Inject()
88
- app: PlatformApplication;
89
-
90
- public $beforeRoutesInit() {
91
- const cookieParser = require('cookie-parser'),
92
- bodyParser = require('body-parser'),
93
- compress = require('compression'),
94
- methodOverride = require('method-override');
95
-
96
- this.app
97
- .use(cookieParser())
98
- .use(compress({}))
99
- .use(methodOverride())
100
- .use(bodyParser.json())
101
- .use(bodyParser.urlencoded({
102
- extended: true
103
- }));
104
- }
105
- }
88
+ export class Server {}
106
89
  ```
107
90
 
108
- To run your server, you have to use Platform API to bootstrap your application with the expected
91
+ To run your server, you have to use Platform API to bootstrap your application with the expected
109
92
  platform like Express.
110
93
 
111
94
  ```typescript
@@ -137,21 +120,34 @@ This is a simple controller to expose user resource. It use decorators to build
137
120
  ```typescript
138
121
  import {Inject} from "@tsed/di";
139
122
  import {Summary} from "@tsed/swagger";
140
- import {Returns, ReturnsArray, Controller, Get, QueryParams, PathParams, Delete, Post, Required, BodyParams, Status, Put} from "@tsed/common";
123
+ import {
124
+ Returns,
125
+ ReturnsArray,
126
+ Controller,
127
+ Get,
128
+ QueryParams,
129
+ PathParams,
130
+ Delete,
131
+ Post,
132
+ Required,
133
+ BodyParams,
134
+ Status,
135
+ Put
136
+ } from "@tsed/common";
141
137
  import {BadRequest} from "@tsed/exceptions";
142
138
  import {UsersService} from "../services/UsersService";
143
- import {User} from "../models/User";
139
+ import {User} from "../models/User";
144
140
 
145
141
  @Controller("/users")
146
142
  export class UsersCtrl {
147
143
  @Inject()
148
- usersService: UsersService;
144
+ protected usersService: UsersService;
149
145
 
150
146
  @Get("/:id")
151
147
  @Summary("Get a user from his Id")
152
148
  @Returns(User)
153
149
  async getUser(@PathParams("id") id: string): Promise<User> {
154
- return this.usersService.findById(id);
150
+ return this.usersService.findById(id);
155
151
  }
156
152
 
157
153
  @Post("/")
@@ -168,41 +164,40 @@ export class UsersCtrl {
168
164
  @Returns(User)
169
165
  async putUser(@PathParams("id") id: string, @Required() @BodyParams() user: User): Promise<User> {
170
166
  if (user.id !== id) {
171
- throw new BadRequest("ID mismatch with the given payload")
167
+ throw new BadRequest("ID mismatch with the given payload");
172
168
  }
173
169
 
174
170
  return this.usersService.save(user);
175
171
  }
176
-
172
+
177
173
  @Delete("/:id")
178
174
  @Summary("Remove a user")
179
175
  @Status(204)
180
- async deleteUser(@PathParams("id") @Required() id: string ): Promise<User> {
181
- await this.usersService.delete(user);
176
+ async deleteUser(@PathParams("id") @Required() id: string): Promise<User> {
177
+ await this.usersService.delete(user);
182
178
  }
183
-
179
+
184
180
  @Get("/")
185
181
  @Summary("Get all users")
186
182
  @ReturnsArray(User)
187
- async findUser(@QueryParams("name") name: string){
183
+ async findUser(@QueryParams("name") name: string) {
188
184
  return this.usersService.find({name});
189
185
  }
190
186
  }
191
187
  ```
192
188
 
193
189
  ## Contributors
190
+
194
191
  Please read [contributing guidelines here](./CONTRIBUTING.md).
195
192
 
196
193
  <a href="https://github.com/tsedio/tsed/graphs/contributors"><img src="https://opencollective.com/tsed/contributors.svg?width=890" /></a>
197
194
 
198
-
199
195
  ## Backers
200
196
 
201
197
  Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/tsed#backer)]
202
198
 
203
199
  <a href="https://opencollective.com/tsed#backers" target="_blank"><img src="https://opencollective.com/tsed/tiers/backer.svg?width=890"></a>
204
200
 
205
-
206
201
  ## Sponsors
207
202
 
208
203
  Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/tsed#sponsor)]
@@ -220,4 +215,3 @@ The above copyright notice and this permission notice shall be included in all c
220
215
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
221
216
 
222
217
  [travis]: https://travis-ci.org/
223
-
@@ -8,16 +8,6 @@
8
8
  "declaration": true,
9
9
  "declarationDir": "./lib/types"
10
10
  },
11
- "exclude": [
12
- "node_modules",
13
- "test",
14
- "lib",
15
- "benchmark",
16
- "coverage",
17
- "spec",
18
- "**/*.benchmark.ts",
19
- "**/*.spec.ts",
20
- "keys",
21
- "jest.config.js"
22
- ]
11
+ "include": ["src"],
12
+ "exclude": ["node_modules", "test", "lib", "benchmark", "coverage", "spec", "**/*.benchmark.ts", "**/*.spec.ts", "keys", "jest.config.js"]
23
13
  }
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./interfaces"), exports);
5
- (0, tslib_1.__exportStar)(require("./services/PlatformConfiguration"), exports);
6
- (0, tslib_1.__exportStar)(require("./services/PlatformConfiguration"), exports);
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":";;;AAAA,4DAA6B;AAC7B,gFAAiD;AACjD,gFAAiD","sourcesContent":["export * from \"./interfaces\";\nexport * from \"./services/PlatformConfiguration\";\nexport * from \"./services/PlatformConfiguration\";\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=EndpointDirectoriesSettings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EndpointDirectoriesSettings.js","sourceRoot":"","sources":["../../../../src/config/interfaces/EndpointDirectoriesSettings.ts"],"names":[],"mappings":"","sourcesContent":["export interface EndpointDirectoriesSettings {\n [endpoint: string]: any | string | (any | string)[];\n}\n"]}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./PlatformLoggerSettings"), exports);
5
- (0, tslib_1.__exportStar)(require("./EndpointDirectoriesSettings"), exports);
6
- (0, tslib_1.__exportStar)(require("./PlatformStaticsSettings"), exports);
7
- (0, tslib_1.__exportStar)(require("./PlatformMulterSettings"), exports);
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/config/interfaces/index.ts"],"names":[],"mappings":";;;AA6FA,wEAAyC;AACzC,6EAA8C;AAC9C,yEAA0C;AAC1C,wEAAyC","sourcesContent":["import {Env} from \"@tsed/core\";\nimport {ConverterSettings} from \"./ConverterSettings\";\nimport {EndpointDirectoriesSettings} from \"./EndpointDirectoriesSettings\";\nimport {PlatformLoggerSettings} from \"./PlatformLoggerSettings\";\nimport {PlatformMulterSettings} from \"./PlatformMulterSettings\";\nimport {PlatformStaticsSettings} from \"./PlatformStaticsSettings\";\nimport type Http from \"http\";\nimport type Https from \"https\";\n\ndeclare global {\n namespace TsED {\n interface LoggerConfiguration extends Partial<PlatformLoggerSettings> {}\n interface Configuration {\n /**\n * The root directory where you build run project. By default, it's equal to `process.cwd().\n */\n rootDir: string;\n /**\n * The environment profile. By default the environment profile is equals to `NODE_ENV`.\n */\n env: Env;\n /**\n * Port number for the [HTTP.Server](https://nodejs.org/api/http.html#http_class_http_server).\n */\n port: string | number;\n /**\n * Port number for the [HTTP.Server](https://nodejs.org/api/http.html#http_class_http_server).\n */\n httpPort: string | number | boolean;\n /**\n * [Https.ServerOptions](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)):\n * - `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.\n * - `passphrase` &lt;string&gt; A string containing the passphrase for the private key or pfx.\n * - `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)\n * - `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.\n */\n httpOptions: Http.ServerOptions;\n /**\n * Port number for the [HTTPs.Server](https://nodejs.org/api/https.html#https_class_https_server).\n */\n httpsPort: string | number | boolean;\n /**\n * [Https.ServerOptions](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)):\n * - `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.\n * - `passphrase` &lt;string&gt; A string containing the passphrase for the private key or pfx.\n * - `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)\n * - `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.\n */\n httpsOptions: Https.ServerOptions;\n /**\n * Mount all controllers under a directories to an endpoint.\n */\n mount: EndpointDirectoriesSettings;\n /**\n * List of directories to scan [Services](/docs/services.md), [Middlewares](/docs/middlewares.md) or [Converters](/docs/converters.md).\n */\n componentsScan: (string | RegExp)[];\n /**\n * Disable the glob pattern. In v7 the componentsScan options will be removed in favor of external module loader.\n */\n disableComponentsScan: boolean;\n /**\n * List of glob patterns. Exclude all files which matching with this list when Server scan all components with the `mount` or `scanComponents` options.\n */\n exclude: string[];\n /**\n * Configure the mimes accepted by default by the server.\n */\n acceptMimes: string[];\n /**\n * Enable debug mode. By default debug is false.\n */\n debug: boolean;\n /**\n * Converter configuration.\n */\n converter: Partial<ConverterSettings>;\n /**\n * Logger configuration.\n */\n logger?: LoggerConfiguration;\n /**\n * Object to mount all directories under to his endpoints. See more on [Serve Static](/tutorials/serve-static-files.md).\n */\n statics: PlatformStaticsSettings;\n /**\n * Object configure Multer. See more on [Upload file](/tutorials/serve-static-files.md).\n */\n multer: PlatformMulterSettings;\n }\n }\n}\n\nexport * from \"./PlatformLoggerSettings\";\nexport * from \"./EndpointDirectoriesSettings\";\nexport * from \"./PlatformStaticsSettings\";\nexport * from \"./PlatformMulterSettings\";\n"]}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpServer = void 0;
4
- const di_1 = require("@tsed/di");
5
- /**
6
- * Inject the Http.Server instance.
7
- *
8
- * ### Example
9
- *
10
- * ```typescript
11
- * import {HttpServer, Service} from "@tsed/common";
12
- *
13
- * @Service()
14
- * export default class OtherService {
15
- * constructor(@HttpServer httpServer: HttpServer) {}
16
- * }
17
- * ```
18
- *
19
- * > Note: TypeScript transform and store `HttpServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
20
- *
21
- * @param {Type<any>} target
22
- * @param {string} targetKey
23
- * @param {TypedPropertyDescriptor<Function> | number} descriptor
24
- * @returns {any}
25
- * @decorator
26
- * @deprecated Use Https.Server from "http"
27
- */
28
- function HttpServer(target, targetKey, descriptor) {
29
- return (0, di_1.Inject)(HttpServer)(target, targetKey, descriptor);
30
- }
31
- exports.HttpServer = HttpServer;
32
- //# sourceMappingURL=httpServer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"httpServer.js","sourceRoot":"","sources":["../../../src/decorators/httpServer.ts"],"names":[],"mappings":";;;AACA,iCAAgC;AAGhC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,UAAU,CAAC,MAAiB,EAAE,SAAiB,EAAE,UAAsD;IACrH,OAAO,IAAA,WAAM,EAAC,UAAU,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC3D,CAAC;AAFD,gCAEC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {Inject} from \"@tsed/di\";\nimport Http from \"http\";\n\n/**\n * Inject the Http.Server instance.\n *\n * ### Example\n *\n * ```typescript\n * import {HttpServer, Service} from \"@tsed/common\";\n *\n * @Service()\n * export default class OtherService {\n * constructor(@HttpServer httpServer: HttpServer) {}\n * }\n * ```\n *\n * > Note: TypeScript transform and store `HttpServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.\n *\n * @param {Type<any>} target\n * @param {string} targetKey\n * @param {TypedPropertyDescriptor<Function> | number} descriptor\n * @returns {any}\n * @decorator\n * @deprecated Use Https.Server from \"http\"\n */\nexport function HttpServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number) {\n return Inject(HttpServer)(target, targetKey, descriptor);\n}\n\nexport type HttpServer = Http.Server;\n"]}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpsServer = void 0;
4
- const di_1 = require("@tsed/di");
5
- /**
6
- * Inject the Https.Server instance.
7
- *
8
- * ### Example
9
- *
10
- * ```typescript
11
- * import {HttpsServer, Service} from "@tsed/common";
12
- *
13
- * @Service()
14
- * export default class OtherService {
15
- * constructor(@HttpsServer httpServer: HttpServer) {}
16
- * }
17
- * ```
18
- *
19
- * > Note: TypeScript transform and store `HttpsServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
20
- *
21
- * @param {Type<any>} target
22
- * @param {string} targetKey
23
- * @param {TypedPropertyDescriptor<Function> | number} descriptor
24
- * @returns {any}
25
- * @decorator
26
- * @deprecated Use Https.Server from "https"
27
- */
28
- function HttpsServer(target, targetKey, descriptor) {
29
- return (0, di_1.Inject)(HttpsServer)(target, targetKey, descriptor);
30
- }
31
- exports.HttpsServer = HttpsServer;
32
- //# sourceMappingURL=httpsServer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"httpsServer.js","sourceRoot":"","sources":["../../../src/decorators/httpsServer.ts"],"names":[],"mappings":";;;AACA,iCAAgC;AAGhC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,WAAW,CAAC,MAAiB,EAAE,SAAiB,EAAE,UAAsD;IACtH,OAAO,IAAA,WAAM,EAAC,WAAW,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC5D,CAAC;AAFD,kCAEC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {Inject} from \"@tsed/di\";\nimport Https from \"https\";\n\n/**\n * Inject the Https.Server instance.\n *\n * ### Example\n *\n * ```typescript\n * import {HttpsServer, Service} from \"@tsed/common\";\n *\n * @Service()\n * export default class OtherService {\n * constructor(@HttpsServer httpServer: HttpServer) {}\n * }\n * ```\n *\n * > Note: TypeScript transform and store `HttpsServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.\n *\n * @param {Type<any>} target\n * @param {string} targetKey\n * @param {TypedPropertyDescriptor<Function> | number} descriptor\n * @returns {any}\n * @decorator\n * @deprecated Use Https.Server from \"https\"\n */\nexport function HttpsServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number) {\n return Inject(HttpsServer)(target, targetKey, descriptor);\n}\n\nexport type HttpsServer = Https.Server;\n"]}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./httpServer"), exports);
5
- (0, tslib_1.__exportStar)(require("./httpsServer"), exports);
6
- (0, tslib_1.__exportStar)(require("./multer"), exports);
7
- // Method
8
- (0, tslib_1.__exportStar)(require("./method/route"), exports);
9
- (0, tslib_1.__exportStar)(require("./method/acceptMime"), exports);
10
- (0, tslib_1.__exportStar)(require("./method/location"), exports);
11
- (0, tslib_1.__exportStar)(require("./method/redirect"), exports);
12
- (0, tslib_1.__exportStar)(require("./method/endpointFn"), exports);
13
- (0, tslib_1.__exportStar)(require("./method/view"), exports);
14
- // Params
15
- (0, tslib_1.__exportStar)(require("./params/response"), exports);
16
- (0, tslib_1.__exportStar)(require("./params/request"), exports);
17
- (0, tslib_1.__exportStar)(require("./params/next"), exports);
18
- (0, tslib_1.__exportStar)(require("./params/error"), exports);
19
- // utils
20
- (0, tslib_1.__exportStar)(require("../utils/mapReturnedResponse"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":";;;AAAA,4DAA6B;AAC7B,6DAA8B;AAE9B,wDAAyB;AAEzB,SAAS;AACT,8DAA+B;AAC/B,mEAAoC;AACpC,iEAAkC;AAClC,iEAAkC;AAClC,mEAAoC;AACpC,6DAA8B;AAE9B,SAAS;AACT,iEAAkC;AAClC,gEAAiC;AACjC,6DAA8B;AAC9B,8DAA+B;AAE/B,QAAQ;AACR,4EAA6C","sourcesContent":["export * from \"./httpServer\";\nexport * from \"./httpsServer\";\n\nexport * from \"./multer\";\n\n// Method\nexport * from \"./method/route\";\nexport * from \"./method/acceptMime\";\nexport * from \"./method/location\";\nexport * from \"./method/redirect\";\nexport * from \"./method/endpointFn\";\nexport * from \"./method/view\";\n\n// Params\nexport * from \"./params/response\";\nexport * from \"./params/request\";\nexport * from \"./params/next\";\nexport * from \"./params/error\";\n\n// utils\nexport * from \"../utils/mapReturnedResponse\";\n"]}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AcceptMime = void 0;
4
- const core_1 = require("@tsed/core");
5
- const schema_1 = require("@tsed/schema");
6
- /**
7
- * 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.
8
- *
9
- * ```typescript
10
- * @Controller('/mypath')
11
- * export class MyCtrl {
12
- *
13
- * @Get('/')
14
- * @AcceptMime('application/json')
15
- * public getResource(){}
16
- * }
17
- * ```
18
- *
19
- * @param mimes
20
- * @decorator
21
- * @operation
22
- * @response
23
- */
24
- function AcceptMime(...mimes) {
25
- return (0, core_1.useDecorators)((0, schema_1.Produces)(...mimes), (0, core_1.StoreSet)("acceptMimes", mimes));
26
- }
27
- exports.AcceptMime = AcceptMime;
28
- //# sourceMappingURL=acceptMime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"acceptMime.js","sourceRoot":"","sources":["../../../../src/decorators/method/acceptMime.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,yCAAsC;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,UAAU,CAAC,GAAG,KAAe;IAC3C,OAAO,IAAA,oBAAa,EAAC,IAAA,iBAAQ,EAAC,GAAG,KAAK,CAAC,EAAE,IAAA,eAAQ,EAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;AAC3E,CAAC;AAFD,gCAEC","sourcesContent":["import {StoreSet, useDecorators} from \"@tsed/core\";\nimport {Produces} from \"@tsed/schema\";\n\n/**\n * 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.\n *\n * ```typescript\n * @Controller('/mypath')\n * export class MyCtrl {\n *\n * @Get('/')\n * @AcceptMime('application/json')\n * public getResource(){}\n * }\n * ```\n *\n * @param mimes\n * @decorator\n * @operation\n * @response\n */\nexport function AcceptMime(...mimes: string[]): Function {\n return useDecorators(Produces(...mimes), StoreSet(\"acceptMimes\", mimes));\n}\n"]}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EndpointFn = void 0;
4
- const schema_1 = require("@tsed/schema");
5
- /**
6
- *
7
- * @param fn
8
- * @decorator
9
- * @deprecated Deprecated since 2021-10-05. Use JsonEntityFn instead.
10
- */
11
- function EndpointFn(fn) {
12
- return (0, schema_1.JsonEntityFn)(fn);
13
- }
14
- exports.EndpointFn = EndpointFn;
15
- //# sourceMappingURL=endpointFn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpointFn.js","sourceRoot":"","sources":["../../../../src/decorators/method/endpointFn.ts"],"names":[],"mappings":";;;AACA,yCAA0C;AAG1C;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,EAAyE;IAClG,OAAO,IAAA,qBAAY,EAAmB,EAAE,CAAQ,CAAC;AACnD,CAAC;AAFD,gCAEC","sourcesContent":["import {DecoratorParameters} from \"@tsed/core\";\nimport {JsonEntityFn} from \"@tsed/schema\";\nimport {EndpointMetadata} from \"../../domain\";\n\n/**\n *\n * @param fn\n * @decorator\n * @deprecated Deprecated since 2021-10-05. Use JsonEntityFn instead.\n */\nexport function EndpointFn(fn: (endpoint: EndpointMetadata, parameters: DecoratorParameters) => void): MethodDecorator {\n return JsonEntityFn<EndpointMetadata>(fn) as any;\n}\n"]}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Location = void 0;
4
- var schema_1 = require("@tsed/schema");
5
- Object.defineProperty(exports, "Location", { enumerable: true, get: function () { return schema_1.Location; } });
6
- //# sourceMappingURL=location.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"location.js","sourceRoot":"","sources":["../../../../src/decorators/method/location.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA9B,kGAAA,QAAQ,OAAA","sourcesContent":["export {Location} from \"@tsed/schema\";\n"]}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Redirect = void 0;
4
- var schema_1 = require("@tsed/schema");
5
- Object.defineProperty(exports, "Redirect", { enumerable: true, get: function () { return schema_1.Redirect; } });
6
- //# sourceMappingURL=redirect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redirect.js","sourceRoot":"","sources":["../../../../src/decorators/method/redirect.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA9B,kGAAA,QAAQ,OAAA","sourcesContent":["export {Redirect} from \"@tsed/schema\";\n"]}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.All = exports.Options = exports.Head = exports.Delete = exports.Patch = exports.Put = exports.Post = exports.Get = void 0;
4
- var schema_1 = require("@tsed/schema");
5
- Object.defineProperty(exports, "Get", { enumerable: true, get: function () { return schema_1.Get; } });
6
- Object.defineProperty(exports, "Post", { enumerable: true, get: function () { return schema_1.Post; } });
7
- Object.defineProperty(exports, "Put", { enumerable: true, get: function () { return schema_1.Put; } });
8
- Object.defineProperty(exports, "Patch", { enumerable: true, get: function () { return schema_1.Patch; } });
9
- Object.defineProperty(exports, "Delete", { enumerable: true, get: function () { return schema_1.Delete; } });
10
- Object.defineProperty(exports, "Head", { enumerable: true, get: function () { return schema_1.Head; } });
11
- Object.defineProperty(exports, "Options", { enumerable: true, get: function () { return schema_1.Options; } });
12
- Object.defineProperty(exports, "All", { enumerable: true, get: function () { return schema_1.All; } });
13
- //# sourceMappingURL=route.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"route.js","sourceRoot":"","sources":["../../../../src/decorators/method/route.ts"],"names":[],"mappings":";;;AAAA,uCAA+E;AAAvE,6FAAA,GAAG,OAAA;AAAE,8FAAA,IAAI,OAAA;AAAE,6FAAA,GAAG,OAAA;AAAE,+FAAA,KAAK,OAAA;AAAE,gGAAA,MAAM,OAAA;AAAE,8FAAA,IAAI,OAAA;AAAE,iGAAA,OAAO,OAAA;AAAE,6FAAA,GAAG,OAAA","sourcesContent":["export {Get, Post, Put, Patch, Delete, Head, Options, All} from \"@tsed/schema\";\n"]}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.View = void 0;
4
- const core_1 = require("@tsed/core");
5
- /**
6
- * Use a view and sends the rendered HTML string to the client. Optional parameter:
7
- *
8
- * * viewOptions, an object whose properties define local variables for the view.
9
- *
10
- * The view argument is a string that is the file path of the view file to render.
11
- * This can be an absolute path, or a path relative to the views setting.
12
- * If the path does not contain a file extension, then the view engine setting determines the file extension.
13
- * If the path does contain a file extension, then Express will load the module for the specified template engine (via require())
14
- * and render it using the loaded module’s __express function.
15
- *
16
- * For more information, see [Using template engines with Express](http://expressjs.com/guide/using-template-engines.html).
17
- *
18
- * > NOTE: The view argument performs file system operations like reading a file from disk and evaluating Node.js modules,
19
- * and as so for security reasons should not contain input from the end-user.
20
- *
21
- * @param path Relative path to the view file.
22
- * @param options Additional options
23
- * @decorator
24
- * @operation
25
- * @response
26
- * @ignores
27
- * @deprecated Use View decorator from @tsed/platform-views instead.
28
- */
29
- // istanbul ignore next
30
- function View(path, options) {
31
- return (0, core_1.StoreSet)("view", { path, options });
32
- }
33
- exports.View = View;
34
- //# sourceMappingURL=view.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../src/decorators/method/view.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,uBAAuB;AACvB,SAAgB,IAAI,CAAC,IAAY,EAAE,OAAgB;IACjD,OAAO,IAAA,eAAQ,EAAC,MAAM,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC,CAAQ,CAAC;AAClD,CAAC;AAFD,oBAEC","sourcesContent":["import {StoreSet} from \"@tsed/core\";\n\n/**\n * Use a view and sends the rendered HTML string to the client. Optional parameter:\n *\n * * viewOptions, an object whose properties define local variables for the view.\n *\n * The view argument is a string that is the file path of the view file to render.\n * This can be an absolute path, or a path relative to the views setting.\n * If the path does not contain a file extension, then the view engine setting determines the file extension.\n * If the path does contain a file extension, then Express will load the module for the specified template engine (via require())\n * and render it using the loaded module’s __express function.\n *\n * For more information, see [Using template engines with Express](http://expressjs.com/guide/using-template-engines.html).\n *\n * > NOTE: The view argument performs file system operations like reading a file from disk and evaluating Node.js modules,\n * and as so for security reasons should not contain input from the end-user.\n *\n * @param path Relative path to the view file.\n * @param options Additional options\n * @decorator\n * @operation\n * @response\n * @ignores\n * @deprecated Use View decorator from @tsed/platform-views instead.\n */\n// istanbul ignore next\nexport function View(path: string, options?: Object): MethodDecorator {\n return StoreSet(\"view\", {path, options}) as any;\n}\n"]}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./multerFileSize"), exports);
5
- (0, tslib_1.__exportStar)(require("./multerOptions"), exports);
6
- (0, tslib_1.__exportStar)(require("./multipartFile"), exports);
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/decorators/multer/index.ts"],"names":[],"mappings":";;;AAAA,gEAAiC;AACjC,+DAAgC;AAChC,+DAAgC","sourcesContent":["export * from \"./multerFileSize\";\nexport * from \"./multerOptions\";\nexport * from \"./multipartFile\";\n"]}