@tsed/common 7.0.0-beta.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 (253) hide show
  1. package/lib/cjs/builder/PlatformBuilder.js +38 -27
  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 +2 -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 +66 -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 +3 -2
  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/createContext.js +2 -2
  49. package/lib/cjs/utils/createContext.js.map +1 -1
  50. package/lib/cjs/utils/createHandlerMetadata.js +2 -2
  51. package/lib/cjs/utils/createHandlerMetadata.js.map +1 -1
  52. package/lib/cjs/utils/createHttpServer.js +3 -8
  53. package/lib/cjs/utils/createHttpServer.js.map +1 -1
  54. package/lib/cjs/utils/createHttpsServer.js +3 -8
  55. package/lib/cjs/utils/createHttpsServer.js.map +1 -1
  56. package/lib/cjs/utils/createInjector.js +11 -3
  57. package/lib/cjs/utils/createInjector.js.map +1 -1
  58. package/lib/cjs/utils/importProviders.js +29 -0
  59. package/lib/cjs/utils/importProviders.js.map +1 -0
  60. package/lib/cjs/utils/setResponseHeaders.js.map +1 -1
  61. package/lib/esm/builder/PlatformBuilder.js +25 -14
  62. package/lib/esm/builder/PlatformBuilder.js.map +1 -1
  63. package/lib/esm/builder/PlatformControllerBuilder.js +8 -11
  64. package/lib/esm/builder/PlatformControllerBuilder.js.map +1 -1
  65. package/lib/esm/config/interfaces/PlatformMulterSettings.js.map +1 -1
  66. package/lib/esm/config/services/PlatformConfiguration.js.map +1 -1
  67. package/lib/esm/decorators/multer/multerFileSize.js +1 -1
  68. package/lib/esm/decorators/multer/multerOptions.js +1 -1
  69. package/lib/esm/decorators/multer/multipartFile.js +1 -1
  70. package/lib/esm/decorators/multer/multipartFile.js.map +1 -1
  71. package/lib/esm/domain/ControllerProvider.js +1 -1
  72. package/lib/esm/domain/EndpointMetadata.js +1 -66
  73. package/lib/esm/domain/EndpointMetadata.js.map +1 -1
  74. package/lib/esm/domain/HandlerMetadata.js +1 -1
  75. package/lib/esm/domain/PlatformContext.js +3 -3
  76. package/lib/esm/domain/PlatformContext.js.map +1 -1
  77. package/lib/esm/domain/PlatformRouteDetails.js.map +1 -1
  78. package/lib/esm/exports.js +13 -0
  79. package/lib/esm/exports.js.map +1 -0
  80. package/lib/esm/index.js +66 -27
  81. package/lib/esm/index.js.map +1 -1
  82. package/lib/esm/interfaces/PlatformRouteOptions.js.map +1 -1
  83. package/lib/esm/middlewares/PlatformMulterMiddleware.js +16 -5
  84. package/lib/esm/middlewares/PlatformMulterMiddleware.js.map +1 -1
  85. package/lib/esm/middlewares/bindEndpointMiddleware.js.map +1 -1
  86. package/lib/esm/package.json +3 -0
  87. package/lib/esm/services/FakeAdapter.js +51 -0
  88. package/lib/esm/services/FakeAdapter.js.map +1 -0
  89. package/lib/esm/services/Platform.js +31 -10
  90. package/lib/esm/services/Platform.js.map +1 -1
  91. package/lib/esm/services/PlatformAdapter.js +10 -0
  92. package/lib/esm/services/PlatformAdapter.js.map +1 -0
  93. package/lib/esm/services/PlatformApplication.js +11 -13
  94. package/lib/esm/services/PlatformApplication.js.map +1 -1
  95. package/lib/esm/services/PlatformHandler.js +13 -11
  96. package/lib/esm/services/PlatformHandler.js.map +1 -1
  97. package/lib/esm/services/PlatformMiddlewaresChain.js +61 -20
  98. package/lib/esm/services/PlatformMiddlewaresChain.js.map +1 -1
  99. package/lib/esm/services/PlatformResponse.js +1 -1
  100. package/lib/esm/services/PlatformResponse.js.map +1 -1
  101. package/lib/esm/services/PlatformRouter.js +13 -31
  102. package/lib/esm/services/PlatformRouter.js.map +1 -1
  103. package/lib/esm/services/PlatformTest.js +7 -7
  104. package/lib/esm/services/PlatformTest.js.map +1 -1
  105. package/lib/esm/utils/__mock__/Test1.js +4 -0
  106. package/lib/esm/utils/__mock__/Test1.js.map +1 -0
  107. package/lib/esm/utils/__mock__/Test2.js +4 -0
  108. package/lib/esm/utils/__mock__/Test2.js.map +1 -0
  109. package/lib/esm/utils/createContext.js +5 -5
  110. package/lib/esm/utils/createContext.js.map +1 -1
  111. package/lib/esm/utils/createHandlerMetadata.js +3 -3
  112. package/lib/esm/utils/createHandlerMetadata.js.map +1 -1
  113. package/lib/esm/utils/createHttpServer.js +3 -8
  114. package/lib/esm/utils/createHttpServer.js.map +1 -1
  115. package/lib/esm/utils/createHttpsServer.js +3 -8
  116. package/lib/esm/utils/createHttpsServer.js.map +1 -1
  117. package/lib/esm/utils/createInjector.js +18 -10
  118. package/lib/esm/utils/createInjector.js.map +1 -1
  119. package/lib/esm/utils/importProviders.js +25 -0
  120. package/lib/esm/utils/importProviders.js.map +1 -0
  121. package/lib/esm/utils/setResponseHeaders.js.map +1 -1
  122. package/lib/esm/utils/useCtxHandler.js +1 -1
  123. package/lib/types/builder/PlatformBuilder.d.ts +7 -6
  124. package/lib/types/builder/PlatformControllerBuilder.d.ts +2 -1
  125. package/lib/types/config/interfaces/PlatformMulterSettings.d.ts +6 -130
  126. package/lib/types/config/services/PlatformConfiguration.d.ts +2 -1
  127. package/lib/types/domain/EndpointMetadata.d.ts +1 -50
  128. package/lib/types/domain/PlatformContext.d.ts +1 -1
  129. package/lib/types/domain/PlatformRouteDetails.d.ts +2 -3
  130. package/lib/types/exports.d.ts +12 -0
  131. package/lib/types/index.d.ts +63 -17
  132. package/lib/types/interfaces/PlatformRouteOptions.d.ts +1 -1
  133. package/lib/types/middlewares/PlatformMulterMiddleware.d.ts +8 -3
  134. package/lib/types/middlewares/bindEndpointMiddleware.d.ts +2 -1
  135. package/lib/types/services/FakeAdapter.d.ts +30 -0
  136. package/lib/types/services/Platform.d.ts +10 -1
  137. package/lib/types/services/PlatformAdapter.d.ts +47 -0
  138. package/lib/types/services/PlatformApplication.d.ts +3 -3
  139. package/lib/types/services/PlatformHandler.d.ts +1 -1
  140. package/lib/types/services/PlatformMiddlewaresChain.d.ts +6 -2
  141. package/lib/types/services/PlatformResponse.d.ts +6 -6
  142. package/lib/types/services/PlatformRouter.d.ts +10 -7
  143. package/lib/types/services/PlatformTest.d.ts +2 -2
  144. package/lib/types/utils/__mock__/Test1.d.ts +3 -0
  145. package/lib/types/utils/__mock__/Test2.d.ts +3 -0
  146. package/lib/types/utils/createHandlerMetadata.d.ts +1 -1
  147. package/lib/types/utils/createHttpServer.d.ts +1 -1
  148. package/lib/types/utils/createHttpsServer.d.ts +2 -1
  149. package/lib/types/utils/createInjector.d.ts +5 -3
  150. package/lib/types/utils/importProviders.d.ts +10 -0
  151. package/package.json +38 -26
  152. package/readme.md +50 -57
  153. package/tsconfig.compile.esm.json +2 -12
  154. package/lib/cjs/config/index.js +0 -7
  155. package/lib/cjs/config/index.js.map +0 -1
  156. package/lib/cjs/config/interfaces/index.js +0 -8
  157. package/lib/cjs/config/interfaces/index.js.map +0 -1
  158. package/lib/cjs/decorators/httpServer.js +0 -32
  159. package/lib/cjs/decorators/httpServer.js.map +0 -1
  160. package/lib/cjs/decorators/httpsServer.js +0 -32
  161. package/lib/cjs/decorators/httpsServer.js.map +0 -1
  162. package/lib/cjs/decorators/index.js +0 -21
  163. package/lib/cjs/decorators/index.js.map +0 -1
  164. package/lib/cjs/decorators/method/acceptMime.js +0 -28
  165. package/lib/cjs/decorators/method/acceptMime.js.map +0 -1
  166. package/lib/cjs/decorators/method/endpointFn.js +0 -15
  167. package/lib/cjs/decorators/method/endpointFn.js.map +0 -1
  168. package/lib/cjs/decorators/method/location.js +0 -6
  169. package/lib/cjs/decorators/method/location.js.map +0 -1
  170. package/lib/cjs/decorators/method/redirect.js +0 -6
  171. package/lib/cjs/decorators/method/redirect.js.map +0 -1
  172. package/lib/cjs/decorators/method/route.js +0 -13
  173. package/lib/cjs/decorators/method/route.js.map +0 -1
  174. package/lib/cjs/decorators/method/view.js +0 -34
  175. package/lib/cjs/decorators/method/view.js.map +0 -1
  176. package/lib/cjs/decorators/multer/index.js +0 -7
  177. package/lib/cjs/decorators/multer/index.js.map +0 -1
  178. package/lib/cjs/domain/index.js +0 -10
  179. package/lib/cjs/domain/index.js.map +0 -1
  180. package/lib/cjs/interfaces/PathType.js +0 -3
  181. package/lib/cjs/interfaces/PathType.js.map +0 -1
  182. package/lib/cjs/interfaces/PlatformAdapter.js +0 -3
  183. package/lib/cjs/interfaces/PlatformAdapter.js.map +0 -1
  184. package/lib/cjs/interfaces/index.js +0 -21
  185. package/lib/cjs/interfaces/index.js.map +0 -1
  186. package/lib/cjs/middlewares/index.js +0 -7
  187. package/lib/cjs/middlewares/index.js.map +0 -1
  188. package/lib/cjs/services/FakeRawDriver.js +0 -26
  189. package/lib/cjs/services/FakeRawDriver.js.map +0 -1
  190. package/lib/cjs/services/index.js +0 -12
  191. package/lib/cjs/services/index.js.map +0 -1
  192. package/lib/cjs/utils/index.js +0 -11
  193. package/lib/cjs/utils/index.js.map +0 -1
  194. package/lib/esm/config/index.js +0 -4
  195. package/lib/esm/config/index.js.map +0 -1
  196. package/lib/esm/config/interfaces/index.js +0 -5
  197. package/lib/esm/config/interfaces/index.js.map +0 -1
  198. package/lib/esm/decorators/httpServer.js +0 -28
  199. package/lib/esm/decorators/httpServer.js.map +0 -1
  200. package/lib/esm/decorators/httpsServer.js +0 -28
  201. package/lib/esm/decorators/httpsServer.js.map +0 -1
  202. package/lib/esm/decorators/index.js +0 -18
  203. package/lib/esm/decorators/index.js.map +0 -1
  204. package/lib/esm/decorators/method/acceptMime.js +0 -24
  205. package/lib/esm/decorators/method/acceptMime.js.map +0 -1
  206. package/lib/esm/decorators/method/endpointFn.js +0 -11
  207. package/lib/esm/decorators/method/endpointFn.js.map +0 -1
  208. package/lib/esm/decorators/method/location.js +0 -2
  209. package/lib/esm/decorators/method/location.js.map +0 -1
  210. package/lib/esm/decorators/method/redirect.js +0 -2
  211. package/lib/esm/decorators/method/redirect.js.map +0 -1
  212. package/lib/esm/decorators/method/route.js +0 -2
  213. package/lib/esm/decorators/method/route.js.map +0 -1
  214. package/lib/esm/decorators/method/view.js +0 -30
  215. package/lib/esm/decorators/method/view.js.map +0 -1
  216. package/lib/esm/decorators/multer/index.js +0 -4
  217. package/lib/esm/decorators/multer/index.js.map +0 -1
  218. package/lib/esm/domain/index.js +0 -7
  219. package/lib/esm/domain/index.js.map +0 -1
  220. package/lib/esm/interfaces/PathType.js +0 -2
  221. package/lib/esm/interfaces/PathType.js.map +0 -1
  222. package/lib/esm/interfaces/PlatformAdapter.js +0 -2
  223. package/lib/esm/interfaces/PlatformAdapter.js.map +0 -1
  224. package/lib/esm/interfaces/index.js +0 -18
  225. package/lib/esm/interfaces/index.js.map +0 -1
  226. package/lib/esm/middlewares/index.js +0 -4
  227. package/lib/esm/middlewares/index.js.map +0 -1
  228. package/lib/esm/services/FakeRawDriver.js +0 -22
  229. package/lib/esm/services/FakeRawDriver.js.map +0 -1
  230. package/lib/esm/services/index.js +0 -9
  231. package/lib/esm/services/index.js.map +0 -1
  232. package/lib/esm/utils/index.js +0 -8
  233. package/lib/esm/utils/index.js.map +0 -1
  234. package/lib/types/config/index.d.ts +0 -3
  235. package/lib/types/config/interfaces/index.d.ts +0 -97
  236. package/lib/types/decorators/httpServer.d.ts +0 -28
  237. package/lib/types/decorators/httpsServer.d.ts +0 -28
  238. package/lib/types/decorators/index.d.ts +0 -14
  239. package/lib/types/decorators/method/acceptMime.d.ts +0 -19
  240. package/lib/types/decorators/method/endpointFn.d.ts +0 -9
  241. package/lib/types/decorators/method/location.d.ts +0 -1
  242. package/lib/types/decorators/method/redirect.d.ts +0 -1
  243. package/lib/types/decorators/method/route.d.ts +0 -1
  244. package/lib/types/decorators/method/view.d.ts +0 -25
  245. package/lib/types/decorators/multer/index.d.ts +0 -3
  246. package/lib/types/domain/index.d.ts +0 -6
  247. package/lib/types/interfaces/PathType.d.ts +0 -1
  248. package/lib/types/interfaces/PlatformAdapter.d.ts +0 -19
  249. package/lib/types/interfaces/index.d.ts +0 -17
  250. package/lib/types/middlewares/index.d.ts +0 -3
  251. package/lib/types/services/FakeRawDriver.d.ts +0 -15
  252. package/lib/types/services/index.d.ts +0 -8
  253. package/lib/types/utils/index.d.ts +0 -7
package/readme.md CHANGED
@@ -31,32 +31,32 @@
31
31
 
32
32
  ## What it is
33
33
 
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
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
35
  to make your code more readable and less error-prone.
36
36
 
37
37
  ## Features
38
38
 
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.
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.
54
54
 
55
55
  ## Documentation
56
56
 
57
57
  Documentation is available on [https://tsed.io](https://tsed.io)
58
58
 
59
- ## Getting started
59
+ ## Getting started
60
60
 
61
61
  See our [getting started here](https://tsed.io/getting-started/) to create new Ts.ED project or use
62
62
  our [CLI](https://cli.tsed.io)
@@ -65,8 +65,8 @@ our [CLI](https://cli.tsed.io)
65
65
 
66
66
  Examples are available on [https://tsed.io/tutorials/](https://tsed.io/tutorials/)
67
67
 
68
-
69
68
  ## Overview
69
+
70
70
  ### Server example
71
71
 
72
72
  Here an example to create a Server with Ts.ED:
@@ -75,37 +75,19 @@ Here an example to create a Server with Ts.ED:
75
75
  import {Configuration, Inject} from "@tsed/di";
76
76
  import {PlatformApplication} from "@tsed/common";
77
77
  import "@tsed/platform-express";
78
- import * as Path from "path";
79
-
80
- export const rootDir = Path.resolve(__dirname);
78
+ import Path from "path";
79
+ import cookieParser from "cookie-parser";
80
+ import compress from "compression";
81
+ import methodOverride from "method-override";
81
82
 
82
83
  @Configuration({
83
- rootDir,
84
- port: 3000
84
+ port: 3000,
85
+ middlewares: [cookieParser(), compress({}), methodOverride()]
85
86
  })
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
- }
87
+ export class Server {}
106
88
  ```
107
89
 
108
- To run your server, you have to use Platform API to bootstrap your application with the expected
90
+ To run your server, you have to use Platform API to bootstrap your application with the expected
109
91
  platform like Express.
110
92
 
111
93
  ```typescript
@@ -137,21 +119,34 @@ This is a simple controller to expose user resource. It use decorators to build
137
119
  ```typescript
138
120
  import {Inject} from "@tsed/di";
139
121
  import {Summary} from "@tsed/swagger";
140
- import {Returns, ReturnsArray, Controller, Get, QueryParams, PathParams, Delete, Post, Required, BodyParams, Status, Put} from "@tsed/common";
122
+ import {
123
+ Returns,
124
+ ReturnsArray,
125
+ Controller,
126
+ Get,
127
+ QueryParams,
128
+ PathParams,
129
+ Delete,
130
+ Post,
131
+ Required,
132
+ BodyParams,
133
+ Status,
134
+ Put
135
+ } from "@tsed/common";
141
136
  import {BadRequest} from "@tsed/exceptions";
142
137
  import {UsersService} from "../services/UsersService";
143
- import {User} from "../models/User";
138
+ import {User} from "../models/User";
144
139
 
145
140
  @Controller("/users")
146
141
  export class UsersCtrl {
147
142
  @Inject()
148
- usersService: UsersService;
143
+ protected usersService: UsersService;
149
144
 
150
145
  @Get("/:id")
151
146
  @Summary("Get a user from his Id")
152
147
  @Returns(User)
153
148
  async getUser(@PathParams("id") id: string): Promise<User> {
154
- return this.usersService.findById(id);
149
+ return this.usersService.findById(id);
155
150
  }
156
151
 
157
152
  @Post("/")
@@ -168,41 +163,40 @@ export class UsersCtrl {
168
163
  @Returns(User)
169
164
  async putUser(@PathParams("id") id: string, @Required() @BodyParams() user: User): Promise<User> {
170
165
  if (user.id !== id) {
171
- throw new BadRequest("ID mismatch with the given payload")
166
+ throw new BadRequest("ID mismatch with the given payload");
172
167
  }
173
168
 
174
169
  return this.usersService.save(user);
175
170
  }
176
-
171
+
177
172
  @Delete("/:id")
178
173
  @Summary("Remove a user")
179
174
  @Status(204)
180
- async deleteUser(@PathParams("id") @Required() id: string ): Promise<User> {
181
- await this.usersService.delete(user);
175
+ async deleteUser(@PathParams("id") @Required() id: string): Promise<User> {
176
+ await this.usersService.delete(user);
182
177
  }
183
-
178
+
184
179
  @Get("/")
185
180
  @Summary("Get all users")
186
181
  @ReturnsArray(User)
187
- async findUser(@QueryParams("name") name: string){
182
+ async findUser(@QueryParams("name") name: string) {
188
183
  return this.usersService.find({name});
189
184
  }
190
185
  }
191
186
  ```
192
187
 
193
188
  ## Contributors
189
+
194
190
  Please read [contributing guidelines here](./CONTRIBUTING.md).
195
191
 
196
192
  <a href="https://github.com/tsedio/tsed/graphs/contributors"><img src="https://opencollective.com/tsed/contributors.svg?width=890" /></a>
197
193
 
198
-
199
194
  ## Backers
200
195
 
201
196
  Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/tsed#backer)]
202
197
 
203
198
  <a href="https://opencollective.com/tsed#backers" target="_blank"><img src="https://opencollective.com/tsed/tiers/backer.svg?width=890"></a>
204
199
 
205
-
206
200
  ## Sponsors
207
201
 
208
202
  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 +214,3 @@ The above copyright notice and this permission notice shall be included in all c
220
214
  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
215
 
222
216
  [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,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"]}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./AnyToPromiseWithCtx"), exports);
5
- (0, tslib_1.__exportStar)(require("./PlatformContext"), exports);
6
- (0, tslib_1.__exportStar)(require("./PlatformRouteDetails"), exports);
7
- (0, tslib_1.__exportStar)(require("./ControllerProvider"), exports);
8
- (0, tslib_1.__exportStar)(require("./EndpointMetadata"), exports);
9
- (0, tslib_1.__exportStar)(require("./HandlerMetadata"), exports);
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/index.ts"],"names":[],"mappings":";;;AAAA,qEAAsC;AACtC,iEAAkC;AAClC,sEAAuC;AACvC,oEAAqC;AACrC,kEAAmC;AACnC,iEAAkC","sourcesContent":["export * from \"./AnyToPromiseWithCtx\";\nexport * from \"./PlatformContext\";\nexport * from \"./PlatformRouteDetails\";\nexport * from \"./ControllerProvider\";\nexport * from \"./EndpointMetadata\";\nexport * from \"./HandlerMetadata\";\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=PathType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PathType.js","sourceRoot":"","sources":["../../../src/interfaces/PathType.ts"],"names":[],"mappings":"","sourcesContent":["export type PathType = string | RegExp | (string | RegExp)[];\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=PlatformAdapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformAdapter.js","sourceRoot":"","sources":["../../../src/interfaces/PlatformAdapter.ts"],"names":[],"mappings":"","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {IProvider} from \"@tsed/di\";\n\nexport interface PlatformAdapter<App = TsED.Application, Router = TsED.Router> {\n /**\n * Load providers in top priority\n */\n readonly providers: IProvider[];\n /**\n * Called after the injector instantiation\n */\n onInit?: () => any;\n beforeLoadRoutes?: () => Promise<any>;\n afterLoadRoutes?: () => Promise<any>;\n useRouter?: () => any;\n useContext?: () => any;\n}\n\nexport interface PlatformBuilderSettings<App = TsED.Application, Router = TsED.Router> extends Partial<TsED.Configuration> {\n adapter?: Type<PlatformAdapter<App, Router>>;\n}\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("./ResponseErrorObject"), exports);
5
- (0, tslib_1.__exportStar)(require("./HandlerType"), exports);
6
- (0, tslib_1.__exportStar)(require("./PlatformRouteOptions"), exports);
7
- (0, tslib_1.__exportStar)(require("./BeforeInit"), exports);
8
- (0, tslib_1.__exportStar)(require("./AfterInit"), exports);
9
- (0, tslib_1.__exportStar)(require("./AfterRoutesInit"), exports);
10
- (0, tslib_1.__exportStar)(require("./BeforeListen"), exports);
11
- (0, tslib_1.__exportStar)(require("./AfterListen"), exports);
12
- (0, tslib_1.__exportStar)(require("./BeforeRoutesInit"), exports);
13
- (0, tslib_1.__exportStar)(require("./AfterRoutesInit"), exports);
14
- (0, tslib_1.__exportStar)(require("./OnRoutesInit"), exports);
15
- (0, tslib_1.__exportStar)(require("./OnReady"), exports);
16
- (0, tslib_1.__exportStar)(require("./OnRequest"), exports);
17
- (0, tslib_1.__exportStar)(require("./OnResponse"), exports);
18
- (0, tslib_1.__exportStar)(require("./Route"), exports);
19
- (0, tslib_1.__exportStar)(require("./IncomingEvent"), exports);
20
- (0, tslib_1.__exportStar)(require("./PlatformAdapter"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,qEAAsC;AACtC,6DAA8B;AAC9B,sEAAuC;AACvC,4DAA6B;AAC7B,2DAA4B;AAC5B,iEAAkC;AAClC,8DAA+B;AAC/B,6DAA8B;AAC9B,kEAAmC;AACnC,iEAAkC;AAClC,8DAA+B;AAC/B,yDAA0B;AAC1B,2DAA4B;AAC5B,4DAA6B;AAC7B,uDAAwB;AACxB,+DAAgC;AAChC,iEAAkC","sourcesContent":["export * from \"./ResponseErrorObject\";\nexport * from \"./HandlerType\";\nexport * from \"./PlatformRouteOptions\";\nexport * from \"./BeforeInit\";\nexport * from \"./AfterInit\";\nexport * from \"./AfterRoutesInit\";\nexport * from \"./BeforeListen\";\nexport * from \"./AfterListen\";\nexport * from \"./BeforeRoutesInit\";\nexport * from \"./AfterRoutesInit\";\nexport * from \"./OnRoutesInit\";\nexport * from \"./OnReady\";\nexport * from \"./OnRequest\";\nexport * from \"./OnResponse\";\nexport * from \"./Route\";\nexport * from \"./IncomingEvent\";\nexport * from \"./PlatformAdapter\";\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("./bindEndpointMiddleware"), exports);
5
- (0, tslib_1.__exportStar)(require("./PlatformMulterMiddleware"), exports);
6
- (0, tslib_1.__exportStar)(require("./PlatformAcceptMimesMiddleware"), exports);
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/middlewares/index.ts"],"names":[],"mappings":";;;AAAA,wEAAyC;AACzC,0EAA2C;AAC3C,+EAAgD","sourcesContent":["export * from \"./bindEndpointMiddleware\";\nexport * from \"./PlatformMulterMiddleware\";\nexport * from \"./PlatformAcceptMimesMiddleware\";\n"]}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createFakeRawDriver = void 0;
4
- /**
5
- * @ignore
6
- */
7
- const createFakeRawDriver = () => {
8
- // istanbul ignore next
9
- function FakeRawDriver() { }
10
- // istanbul ignore next
11
- function use() {
12
- return this;
13
- }
14
- FakeRawDriver.use = use;
15
- FakeRawDriver.all = use;
16
- FakeRawDriver.get = use;
17
- FakeRawDriver.patch = use;
18
- FakeRawDriver.post = use;
19
- FakeRawDriver.put = use;
20
- FakeRawDriver.head = use;
21
- FakeRawDriver.delete = use;
22
- FakeRawDriver.options = use;
23
- return FakeRawDriver;
24
- };
25
- exports.createFakeRawDriver = createFakeRawDriver;
26
- //# sourceMappingURL=FakeRawDriver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FakeRawDriver.js","sourceRoot":"","sources":["../../../src/services/FakeRawDriver.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACI,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,uBAAuB;IACvB,SAAS,aAAa,KAAI,CAAC;IAE3B,uBAAuB;IACvB,SAAS,GAAG;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;IACxB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;IACxB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;IACxB,aAAa,CAAC,KAAK,GAAG,GAAG,CAAC;IAC1B,aAAa,CAAC,IAAI,GAAG,GAAG,CAAC;IACzB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;IACxB,aAAa,CAAC,IAAI,GAAG,GAAG,CAAC;IACzB,aAAa,CAAC,MAAM,GAAG,GAAG,CAAC;IAC3B,aAAa,CAAC,OAAO,GAAG,GAAG,CAAC;IAE5B,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AApBW,QAAA,mBAAmB,uBAoB9B","sourcesContent":["/**\n * @ignore\n */\nexport const createFakeRawDriver = () => {\n // istanbul ignore next\n function FakeRawDriver() {}\n\n // istanbul ignore next\n function use() {\n return this;\n }\n\n FakeRawDriver.use = use;\n FakeRawDriver.all = use;\n FakeRawDriver.get = use;\n FakeRawDriver.patch = use;\n FakeRawDriver.post = use;\n FakeRawDriver.put = use;\n FakeRawDriver.head = use;\n FakeRawDriver.delete = use;\n FakeRawDriver.options = use;\n\n return FakeRawDriver;\n};\n"]}