@tsed/common 8.0.0-alpha.1 → 8.0.0-alpha.11

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 (255) hide show
  1. package/lib/esm/builder/PlatformBuilder.js +0 -5
  2. package/lib/esm/builder/PlatformBuilder.js.map +1 -1
  3. package/lib/esm/config/services/PlatformConfiguration.js.map +1 -1
  4. package/lib/esm/decorators/PlatformProvider.js.map +1 -1
  5. package/lib/esm/decorators/multer/multerFileSize.js +2 -2
  6. package/lib/esm/decorators/multer/multerOptions.js +2 -1
  7. package/lib/esm/decorators/multer/multerOptions.js.map +1 -1
  8. package/lib/esm/decorators/multer/multipartFile.js +2 -2
  9. package/lib/esm/decorators/multer/multipartFile.js.map +1 -1
  10. package/lib/esm/decorators/params/request.js +1 -1
  11. package/lib/esm/decorators/params/request.js.map +1 -1
  12. package/lib/esm/decorators/params/response.js.map +1 -1
  13. package/lib/esm/domain/AnyToPromiseWithCtx.js.map +1 -1
  14. package/lib/esm/domain/PlatformContext.js.map +1 -1
  15. package/lib/esm/exports.js +3 -5
  16. package/lib/esm/exports.js.map +1 -1
  17. package/lib/esm/index.js +0 -1
  18. package/lib/esm/index.js.map +1 -1
  19. package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -1
  20. package/lib/esm/middlewares/PlatformMulterMiddleware.js.map +1 -1
  21. package/lib/esm/services/Platform.js.map +1 -1
  22. package/lib/esm/services/PlatformAdapter.js.map +1 -1
  23. package/lib/esm/services/PlatformApplication.js.map +1 -1
  24. package/lib/esm/services/PlatformHandler.js.map +1 -1
  25. package/lib/esm/services/PlatformMiddlewaresChain.js.map +1 -1
  26. package/lib/esm/services/PlatformRequest.js.map +1 -1
  27. package/lib/esm/services/PlatformResponse.js.map +1 -1
  28. package/lib/esm/services/PlatformTest.js.map +1 -1
  29. package/lib/esm/utils/createContext.js.map +1 -1
  30. package/lib/esm/utils/createHttpServer.js.map +1 -1
  31. package/lib/esm/utils/createHttpsServer.js.map +1 -1
  32. package/lib/esm/utils/createInjector.js.map +1 -1
  33. package/lib/esm/utils/createServer.js.map +1 -1
  34. package/lib/esm/utils/ensureContext.js.map +1 -1
  35. package/lib/esm/utils/getConfiguration.js.map +1 -1
  36. package/lib/esm/utils/getStaticsOptions.js.map +1 -1
  37. package/lib/esm/utils/printRoutes.js.map +1 -1
  38. package/lib/esm/utils/registerPlatformAdapter.js.map +1 -1
  39. package/lib/esm/utils/setResponseHeaders.js.map +1 -1
  40. package/lib/types/builder/PlatformBuilder.d.ts +1 -1
  41. package/lib/types/config/services/PlatformConfiguration.d.ts +1 -1
  42. package/lib/types/decorators/multer/multerFileSize.d.ts +2 -2
  43. package/lib/types/decorators/multer/multerOptions.d.ts +2 -1
  44. package/lib/types/decorators/multer/multipartFile.d.ts +2 -2
  45. package/lib/types/domain/PlatformContext.d.ts +1 -1
  46. package/lib/types/exports.d.ts +3 -5
  47. package/lib/types/index.d.ts +0 -1
  48. package/lib/types/interfaces/IncomingEvent.d.ts +1 -1
  49. package/lib/types/services/FakeResponse.d.ts +1 -1
  50. package/lib/types/services/PlatformAdapter.d.ts +1 -1
  51. package/lib/types/services/PlatformApplication.d.ts +1 -1
  52. package/lib/types/services/PlatformRequest.d.ts +1 -1
  53. package/lib/types/services/PlatformResponse.d.ts +3 -2
  54. package/lib/types/services/PlatformTest.d.ts +1 -1
  55. package/lib/types/utils/closeServer.d.ts +3 -3
  56. package/lib/types/utils/createHttpServer.d.ts +1 -1
  57. package/lib/types/utils/createHttpsServer.d.ts +1 -1
  58. package/lib/types/utils/createServer.d.ts +3 -3
  59. package/lib/types/utils/listenServer.d.ts +3 -3
  60. package/package.json +27 -28
  61. package/vitest.config.mts +4 -4
  62. package/lib/cjs/builder/PlatformBuilder.js +0 -341
  63. package/lib/cjs/builder/PlatformBuilder.js.map +0 -1
  64. package/lib/cjs/config/interfaces/PlatformJsonMapperSettings.js +0 -3
  65. package/lib/cjs/config/interfaces/PlatformJsonMapperSettings.js.map +0 -1
  66. package/lib/cjs/config/interfaces/PlatformLoggerSettings.js +0 -3
  67. package/lib/cjs/config/interfaces/PlatformLoggerSettings.js.map +0 -1
  68. package/lib/cjs/config/interfaces/PlatformMulterSettings.js +0 -3
  69. package/lib/cjs/config/interfaces/PlatformMulterSettings.js.map +0 -1
  70. package/lib/cjs/config/interfaces/PlatformRouterSettings.js +0 -3
  71. package/lib/cjs/config/interfaces/PlatformRouterSettings.js.map +0 -1
  72. package/lib/cjs/config/interfaces/PlatformStaticsSettings.js +0 -3
  73. package/lib/cjs/config/interfaces/PlatformStaticsSettings.js.map +0 -1
  74. package/lib/cjs/config/services/PlatformConfiguration.js +0 -122
  75. package/lib/cjs/config/services/PlatformConfiguration.js.map +0 -1
  76. package/lib/cjs/constants/routerOptions.js +0 -5
  77. package/lib/cjs/constants/routerOptions.js.map +0 -1
  78. package/lib/cjs/decorators/PlatformProvider.js +0 -11
  79. package/lib/cjs/decorators/PlatformProvider.js.map +0 -1
  80. package/lib/cjs/decorators/multer/multerFileSize.js +0 -35
  81. package/lib/cjs/decorators/multer/multerFileSize.js.map +0 -1
  82. package/lib/cjs/decorators/multer/multerOptions.js +0 -52
  83. package/lib/cjs/decorators/multer/multerOptions.js.map +0 -1
  84. package/lib/cjs/decorators/multer/multipartFile.js +0 -78
  85. package/lib/cjs/decorators/multer/multipartFile.js.map +0 -1
  86. package/lib/cjs/decorators/params/error.js +0 -20
  87. package/lib/cjs/decorators/params/error.js.map +0 -1
  88. package/lib/cjs/decorators/params/next.js +0 -21
  89. package/lib/cjs/decorators/params/next.js.map +0 -1
  90. package/lib/cjs/decorators/params/request.js +0 -39
  91. package/lib/cjs/decorators/params/request.js.map +0 -1
  92. package/lib/cjs/decorators/params/response.js +0 -33
  93. package/lib/cjs/decorators/params/response.js.map +0 -1
  94. package/lib/cjs/domain/AnyToPromiseWithCtx.js +0 -25
  95. package/lib/cjs/domain/AnyToPromiseWithCtx.js.map +0 -1
  96. package/lib/cjs/domain/EndpointMetadata.js +0 -6
  97. package/lib/cjs/domain/EndpointMetadata.js.map +0 -1
  98. package/lib/cjs/domain/PlatformContext.js +0 -73
  99. package/lib/cjs/domain/PlatformContext.js.map +0 -1
  100. package/lib/cjs/domain/PlatformRouteDetails.js +0 -3
  101. package/lib/cjs/domain/PlatformRouteDetails.js.map +0 -1
  102. package/lib/cjs/exports.js +0 -30
  103. package/lib/cjs/exports.js.map +0 -1
  104. package/lib/cjs/index.js +0 -68
  105. package/lib/cjs/index.js.map +0 -1
  106. package/lib/cjs/interfaces/AfterInit.js +0 -3
  107. package/lib/cjs/interfaces/AfterInit.js.map +0 -1
  108. package/lib/cjs/interfaces/AfterListen.js +0 -3
  109. package/lib/cjs/interfaces/AfterListen.js.map +0 -1
  110. package/lib/cjs/interfaces/AfterRoutesInit.js +0 -3
  111. package/lib/cjs/interfaces/AfterRoutesInit.js.map +0 -1
  112. package/lib/cjs/interfaces/BeforeInit.js +0 -3
  113. package/lib/cjs/interfaces/BeforeInit.js.map +0 -1
  114. package/lib/cjs/interfaces/BeforeListen.js +0 -3
  115. package/lib/cjs/interfaces/BeforeListen.js.map +0 -1
  116. package/lib/cjs/interfaces/BeforeRoutesInit.js +0 -3
  117. package/lib/cjs/interfaces/BeforeRoutesInit.js.map +0 -1
  118. package/lib/cjs/interfaces/HandlerType.js +0 -17
  119. package/lib/cjs/interfaces/HandlerType.js.map +0 -1
  120. package/lib/cjs/interfaces/IncomingEvent.js +0 -3
  121. package/lib/cjs/interfaces/IncomingEvent.js.map +0 -1
  122. package/lib/cjs/interfaces/OnReady.js +0 -3
  123. package/lib/cjs/interfaces/OnReady.js.map +0 -1
  124. package/lib/cjs/interfaces/OnRequest.js +0 -3
  125. package/lib/cjs/interfaces/OnRequest.js.map +0 -1
  126. package/lib/cjs/interfaces/OnResponse.js +0 -3
  127. package/lib/cjs/interfaces/OnResponse.js.map +0 -1
  128. package/lib/cjs/interfaces/OnRoutesInit.js +0 -3
  129. package/lib/cjs/interfaces/OnRoutesInit.js.map +0 -1
  130. package/lib/cjs/interfaces/PlatformRouteOptions.js +0 -3
  131. package/lib/cjs/interfaces/PlatformRouteOptions.js.map +0 -1
  132. package/lib/cjs/interfaces/ResponseErrorObject.js +0 -3
  133. package/lib/cjs/interfaces/ResponseErrorObject.js.map +0 -1
  134. package/lib/cjs/interfaces/Route.js +0 -3
  135. package/lib/cjs/interfaces/Route.js.map +0 -1
  136. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js +0 -39
  137. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js.map +0 -1
  138. package/lib/cjs/middlewares/PlatformMulterMiddleware.js +0 -70
  139. package/lib/cjs/middlewares/PlatformMulterMiddleware.js.map +0 -1
  140. package/lib/cjs/package.json +0 -3
  141. package/lib/cjs/services/FakeAdapter.js +0 -6
  142. package/lib/cjs/services/FakeAdapter.js.map +0 -1
  143. package/lib/cjs/services/FakeResponse.js +0 -59
  144. package/lib/cjs/services/FakeResponse.js.map +0 -1
  145. package/lib/cjs/services/Platform.js +0 -76
  146. package/lib/cjs/services/Platform.js.map +0 -1
  147. package/lib/cjs/services/PlatformAdapter.js +0 -82
  148. package/lib/cjs/services/PlatformAdapter.js.map +0 -1
  149. package/lib/cjs/services/PlatformApplication.js +0 -44
  150. package/lib/cjs/services/PlatformApplication.js.map +0 -1
  151. package/lib/cjs/services/PlatformHandler.js +0 -133
  152. package/lib/cjs/services/PlatformHandler.js.map +0 -1
  153. package/lib/cjs/services/PlatformMiddlewaresChain.js +0 -60
  154. package/lib/cjs/services/PlatformMiddlewaresChain.js.map +0 -1
  155. package/lib/cjs/services/PlatformRequest.js +0 -144
  156. package/lib/cjs/services/PlatformRequest.js.map +0 -1
  157. package/lib/cjs/services/PlatformResponse.js +0 -309
  158. package/lib/cjs/services/PlatformResponse.js.map +0 -1
  159. package/lib/cjs/services/PlatformTest.js +0 -142
  160. package/lib/cjs/services/PlatformTest.js.map +0 -1
  161. package/lib/cjs/utils/closeServer.js +0 -8
  162. package/lib/cjs/utils/closeServer.js.map +0 -1
  163. package/lib/cjs/utils/createContext.js +0 -49
  164. package/lib/cjs/utils/createContext.js.map +0 -1
  165. package/lib/cjs/utils/createHttpServer.js +0 -18
  166. package/lib/cjs/utils/createHttpServer.js.map +0 -1
  167. package/lib/cjs/utils/createHttpsServer.js +0 -18
  168. package/lib/cjs/utils/createHttpsServer.js.map +0 -1
  169. package/lib/cjs/utils/createInjector.js +0 -45
  170. package/lib/cjs/utils/createInjector.js.map +0 -1
  171. package/lib/cjs/utils/createServer.js +0 -33
  172. package/lib/cjs/utils/createServer.js.map +0 -1
  173. package/lib/cjs/utils/ensureContext.js +0 -16
  174. package/lib/cjs/utils/ensureContext.js.map +0 -1
  175. package/lib/cjs/utils/getConfiguration.js +0 -36
  176. package/lib/cjs/utils/getConfiguration.js.map +0 -1
  177. package/lib/cjs/utils/getStaticsOptions.js +0 -21
  178. package/lib/cjs/utils/getStaticsOptions.js.map +0 -1
  179. package/lib/cjs/utils/listenServer.js +0 -14
  180. package/lib/cjs/utils/listenServer.js.map +0 -1
  181. package/lib/cjs/utils/mapReturnedResponse.js +0 -15
  182. package/lib/cjs/utils/mapReturnedResponse.js.map +0 -1
  183. package/lib/cjs/utils/printRoutes.js +0 -38
  184. package/lib/cjs/utils/printRoutes.js.map +0 -1
  185. package/lib/cjs/utils/registerPlatformAdapter.js +0 -11
  186. package/lib/cjs/utils/registerPlatformAdapter.js.map +0 -1
  187. package/lib/cjs/utils/setResponseHeaders.js +0 -29
  188. package/lib/cjs/utils/setResponseHeaders.js.map +0 -1
  189. package/lib/esm/config/interfaces/PlatformLoggerSettings.js +0 -2
  190. package/lib/esm/config/interfaces/PlatformLoggerSettings.js.map +0 -1
  191. package/lib/esm/package.json +0 -3
  192. package/lib/types/config/interfaces/PlatformLoggerSettings.d.ts +0 -5
  193. package/lib/types-esm/builder/PlatformBuilder.d.ts +0 -100
  194. package/lib/types-esm/config/interfaces/PlatformJsonMapperSettings.d.ts +0 -10
  195. package/lib/types-esm/config/interfaces/PlatformLoggerSettings.d.ts +0 -5
  196. package/lib/types-esm/config/interfaces/PlatformMulterSettings.d.ts +0 -14
  197. package/lib/types-esm/config/interfaces/PlatformRouterSettings.d.ts +0 -10
  198. package/lib/types-esm/config/interfaces/PlatformStaticsSettings.d.ts +0 -17
  199. package/lib/types-esm/config/services/PlatformConfiguration.d.ts +0 -67
  200. package/lib/types-esm/constants/routerOptions.d.ts +0 -1
  201. package/lib/types-esm/decorators/PlatformProvider.d.ts +0 -3
  202. package/lib/types-esm/decorators/multer/multerFileSize.d.ts +0 -27
  203. package/lib/types-esm/decorators/multer/multerOptions.d.ts +0 -41
  204. package/lib/types-esm/decorators/multer/multipartFile.d.ts +0 -47
  205. package/lib/types-esm/decorators/params/error.d.ts +0 -7
  206. package/lib/types-esm/decorators/params/next.d.ts +0 -22
  207. package/lib/types-esm/decorators/params/request.d.ts +0 -46
  208. package/lib/types-esm/decorators/params/response.d.ts +0 -40
  209. package/lib/types-esm/domain/AnyToPromiseWithCtx.d.ts +0 -10
  210. package/lib/types-esm/domain/EndpointMetadata.d.ts +0 -1
  211. package/lib/types-esm/domain/PlatformContext.d.ts +0 -80
  212. package/lib/types-esm/domain/PlatformRouteDetails.d.ts +0 -7
  213. package/lib/types-esm/exports.d.ts +0 -11
  214. package/lib/types-esm/index.d.ts +0 -64
  215. package/lib/types-esm/interfaces/AfterInit.d.ts +0 -3
  216. package/lib/types-esm/interfaces/AfterListen.d.ts +0 -3
  217. package/lib/types-esm/interfaces/AfterRoutesInit.d.ts +0 -3
  218. package/lib/types-esm/interfaces/BeforeInit.d.ts +0 -3
  219. package/lib/types-esm/interfaces/BeforeListen.d.ts +0 -3
  220. package/lib/types-esm/interfaces/BeforeRoutesInit.d.ts +0 -3
  221. package/lib/types-esm/interfaces/HandlerType.d.ts +0 -12
  222. package/lib/types-esm/interfaces/IncomingEvent.d.ts +0 -6
  223. package/lib/types-esm/interfaces/OnReady.d.ts +0 -3
  224. package/lib/types-esm/interfaces/OnRequest.d.ts +0 -4
  225. package/lib/types-esm/interfaces/OnResponse.d.ts +0 -4
  226. package/lib/types-esm/interfaces/OnRoutesInit.d.ts +0 -3
  227. package/lib/types-esm/interfaces/PlatformRouteOptions.d.ts +0 -15
  228. package/lib/types-esm/interfaces/ResponseErrorObject.d.ts +0 -8
  229. package/lib/types-esm/interfaces/Route.d.ts +0 -10
  230. package/lib/types-esm/middlewares/PlatformAcceptMimesMiddleware.d.ts +0 -10
  231. package/lib/types-esm/middlewares/PlatformMulterMiddleware.d.ts +0 -24
  232. package/lib/types-esm/services/FakeAdapter.d.ts +0 -1
  233. package/lib/types-esm/services/FakeResponse.d.ts +0 -22
  234. package/lib/types-esm/services/Platform.d.ts +0 -25
  235. package/lib/types-esm/services/PlatformAdapter.d.ts +0 -89
  236. package/lib/types-esm/services/PlatformApplication.d.ts +0 -29
  237. package/lib/types-esm/services/PlatformHandler.d.ts +0 -39
  238. package/lib/types-esm/services/PlatformMiddlewaresChain.d.ts +0 -17
  239. package/lib/types-esm/services/PlatformRequest.d.ts +0 -111
  240. package/lib/types-esm/services/PlatformResponse.d.ts +0 -174
  241. package/lib/types-esm/services/PlatformTest.d.ts +0 -60
  242. package/lib/types-esm/utils/closeServer.d.ts +0 -7
  243. package/lib/types-esm/utils/createContext.d.ts +0 -10
  244. package/lib/types-esm/utils/createHttpServer.d.ts +0 -4
  245. package/lib/types-esm/utils/createHttpsServer.d.ts +0 -4
  246. package/lib/types-esm/utils/createInjector.d.ts +0 -9
  247. package/lib/types-esm/utils/createServer.d.ts +0 -17
  248. package/lib/types-esm/utils/ensureContext.d.ts +0 -2
  249. package/lib/types-esm/utils/getConfiguration.d.ts +0 -2
  250. package/lib/types-esm/utils/getStaticsOptions.d.ts +0 -5
  251. package/lib/types-esm/utils/listenServer.d.ts +0 -8
  252. package/lib/types-esm/utils/mapReturnedResponse.d.ts +0 -4
  253. package/lib/types-esm/utils/printRoutes.d.ts +0 -2
  254. package/lib/types-esm/utils/registerPlatformAdapter.d.ts +0 -3
  255. package/lib/types-esm/utils/setResponseHeaders.d.ts +0 -5
@@ -1,122 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatformConfiguration = void 0;
4
- const tslib_1 = require("tslib");
5
- const core_1 = require("@tsed/core");
6
- const di_1 = require("@tsed/di");
7
- const json_mapper_1 = require("@tsed/json-mapper");
8
- const rootDir = process.cwd();
9
- /**
10
- * `PlatformConfiguration` contains all information about your Server configuration.
11
- */
12
- let PlatformConfiguration = class PlatformConfiguration extends di_1.DIConfiguration {
13
- constructor() {
14
- super({ rootDir });
15
- }
16
- get port() {
17
- return this.httpPort;
18
- }
19
- set port(value) {
20
- this.httpPort = value;
21
- }
22
- get httpsOptions() {
23
- return this.getRaw("httpsOptions");
24
- }
25
- set httpsOptions(value) {
26
- this.setRaw("httpsOptions", value);
27
- }
28
- get httpPort() {
29
- return this.getRaw("httpPort");
30
- }
31
- set httpPort(value) {
32
- this.setRaw("httpPort", value);
33
- }
34
- get httpsPort() {
35
- return this.getRaw("httpsPort");
36
- }
37
- set httpsPort(value) {
38
- this.setRaw("httpsPort", value);
39
- }
40
- get mount() {
41
- return this.get("mount");
42
- }
43
- set mount(value) {
44
- this.setRaw("mount", value);
45
- }
46
- get statics() {
47
- return this.getRaw("statics") || this.getRaw("serveStatic") || {};
48
- }
49
- set statics(value) {
50
- this.setRaw("statics", value);
51
- }
52
- get acceptMimes() {
53
- return this.getRaw("acceptMimes");
54
- }
55
- set acceptMimes(value) {
56
- this.setRaw("acceptMimes", value || []);
57
- }
58
- get jsonMapper() {
59
- return {
60
- ...json_mapper_1.JsonMapperSettings
61
- };
62
- }
63
- set jsonMapper(options) {
64
- json_mapper_1.JsonMapperSettings.strictGroups = Boolean(options.strictGroups);
65
- json_mapper_1.JsonMapperSettings.disableUnsecureConstructor = Boolean(options.disableUnsecureConstructor);
66
- json_mapper_1.JsonMapperSettings.additionalProperties = Boolean((0, core_1.isBoolean)(options.additionalProperties) ? options.additionalProperties : options.additionalProperties === "accept");
67
- }
68
- get additionalProperties() {
69
- return this.get("converter.additionalProperties") === "accept";
70
- }
71
- /**
72
- *
73
- * @returns {string|number}
74
- */
75
- getHttpPort() {
76
- return (0, core_1.getHostInfoFromPort)("http", this.getRaw("httpPort"));
77
- }
78
- /**
79
- *
80
- * @param settings
81
- */
82
- setHttpPort(settings) {
83
- this.setRaw("httpPort", `${settings.address}:${settings.port}`);
84
- }
85
- /**
86
- *
87
- * @returns {string|number}
88
- */
89
- getHttpsPort() {
90
- return (0, core_1.getHostInfoFromPort)("https", this.getRaw("httpsPort"));
91
- }
92
- /**
93
- *
94
- * @param settings
95
- */
96
- setHttpsPort(settings) {
97
- this.setRaw("httpsPort", `${settings.address}:${settings.port}`);
98
- }
99
- getBestHost() {
100
- const { httpsPort, httpPort } = this;
101
- if (httpsPort) {
102
- return this.getHttpsPort();
103
- }
104
- if (httpPort) {
105
- return this.getHttpPort();
106
- }
107
- return {
108
- toString() {
109
- return "/";
110
- }
111
- };
112
- }
113
- };
114
- PlatformConfiguration = tslib_1.__decorate([
115
- (0, di_1.Injectable)({
116
- scope: di_1.ProviderScope.SINGLETON,
117
- global: true
118
- }),
119
- tslib_1.__metadata("design:paramtypes", [])
120
- ], PlatformConfiguration);
121
- exports.PlatformConfiguration = PlatformConfiguration;
122
- //# sourceMappingURL=PlatformConfiguration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformConfiguration.js","sourceRoot":"","sources":["../../../../src/config/services/PlatformConfiguration.ts"],"names":[],"mappings":";;;;AAAA,qCAA0D;AAC1D,iCAAmF;AACnF,mDAAqD;AAIrD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAE9B;;GAEG;AAKI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,oBAAe;IACxD;QACE,KAAK,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC;IACnB,CAAC;IAED,IAAI,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ED,WAAW;QACT,MAAM,EAAC,SAAS,EAAE,QAAQ,EAAC,GAAG,IAAI,CAAC;QAEnC,IAAI,SAAS,EAAE;YACb,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;SAC5B;QAED,IAAI,QAAQ,EAAE;YACZ,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;SAC3B;QAED,OAAO;YACL,QAAQ;gBACN,OAAO,GAAG,CAAC;YACb,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAhIY,qBAAqB;IAJjC,IAAA,eAAU,EAAC;QACV,KAAK,EAAE,kBAAa,CAAC,SAAS;QAC9B,MAAM,EAAE,IAAI;KACb,CAAC;;GACW,qBAAqB,CAgIjC;AAhIY,sDAAqB"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ROUTER_OPTIONS = void 0;
4
- exports.ROUTER_OPTIONS = Symbol.for("ROUTER_OPTIONS");
5
- //# sourceMappingURL=routerOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routerOptions.js","sourceRoot":"","sources":["../../../src/constants/routerOptions.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatformProvider = void 0;
4
- const registerPlatformAdapter_js_1 = require("../utils/registerPlatformAdapter.js");
5
- function PlatformProvider() {
6
- return (klass) => {
7
- (0, registerPlatformAdapter_js_1.registerPlatformAdapter)(klass);
8
- };
9
- }
10
- exports.PlatformProvider = PlatformProvider;
11
- //# sourceMappingURL=PlatformProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformProvider.js","sourceRoot":"","sources":["../../../src/decorators/PlatformProvider.ts"],"names":[],"mappings":";;;AAEA,oFAA4E;AAE5E,SAAgB,gBAAgB;IAC9B,OAAO,CAAC,KAA4B,EAAE,EAAE;QACtC,IAAA,oDAAuB,EAAC,KAAK,CAAC,CAAC;IACjC,CAAC,CAAC;AACJ,CAAC;AAJD,4CAIC"}
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MulterFileSize = void 0;
4
- const multerOptions_js_1 = require("./multerOptions.js");
5
- /**
6
- * Define file size limit.
7
- *
8
- * ```typescript
9
- * import {Controller, Post} from "@tsed/common";
10
- * import {MulterOptions, MultipartFile} from "@tsed/common";
11
- * import {Multer} from "@types/multer";
12
- *
13
- * type MulterFile = Express.Multer.File;
14
- *
15
- * @Controller('/')
16
- * class MyCtrl {
17
- * @Post('/file2')
18
- * @MulterFileSize(1024) // (Ko). Applied for all fields
19
- * private uploadFile(@MultipartFile("file1") file: MulterFile, @MultipartFile("file2") file2: MulterFile) {
20
- *
21
- * }
22
- * }
23
- * ```
24
- *
25
- * > See the tutorial on the [multer configuration](/tutorials/multer.md).
26
- * @param fileSize
27
- * @returns {(target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor}
28
- * @decorator
29
- * @multer
30
- */
31
- function MulterFileSize(fileSize) {
32
- return (0, multerOptions_js_1.MulterOptions)({ limits: { fileSize } });
33
- }
34
- exports.MulterFileSize = MulterFileSize;
35
- //# sourceMappingURL=multerFileSize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"multerFileSize.js","sourceRoot":"","sources":["../../../../src/decorators/multer/multerFileSize.ts"],"names":[],"mappings":";;;AAAA,yDAAiD;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAgB,cAAc,CAAC,QAAgB;IAC7C,OAAO,IAAA,gCAAa,EAAC,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAC,EAAC,CAAC,CAAC;AAC7C,CAAC;AAFD,wCAEC"}
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MulterOptions = void 0;
4
- const core_1 = require("@tsed/core");
5
- const PlatformMulterMiddleware_js_1 = require("../../middlewares/PlatformMulterMiddleware.js");
6
- /**
7
- * Define multer option for all MultipartFile
8
- *
9
- * ```typescript
10
- * import {Controller, Post, PlatformMulterFile, MultipartFile, MulterOptions} from "@tsed/common";
11
- *
12
- * @Controller('/')
13
- * class MyCtrl {
14
- * @Post('/file')
15
- * private uploadFile(@MultipartFile("file1") file: PlatformMulterFile) {
16
- *
17
- * }
18
- *
19
- * @Post('/file')
20
- * @MulterOptions({dest: "/other-dir"})
21
- * private uploadFile(@MultipartFile("file1") file: PlatformMulterFile) {
22
- *
23
- * }
24
- *
25
- * @Post('/file2')
26
- * @MulterOptions({dest: "/other-dir"})
27
- * private uploadFile(@MultipartFile("file1") file: PlatformMulterFile, @MultipartFile("file2") file2: PlatformMulterFile) {
28
- *
29
- * }
30
- *
31
- * @Post('/files')
32
- * private uploadFile(@MultipartFile("file1") files: PlatformMulterFile[]) {
33
- *
34
- * }
35
- * }
36
- * ```
37
- *
38
- * See the tutorial on the [multer configuration](/tutorials/multer.md).
39
- *
40
- * @param {multer.Options} options
41
- * @returns {(target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor}
42
- * @decorator
43
- * @multer
44
- */
45
- function MulterOptions(options) {
46
- return (target, propertyKey, descriptor) => {
47
- (0, core_1.StoreMerge)(PlatformMulterMiddleware_js_1.PlatformMulterMiddleware, { options })(target, propertyKey, descriptor);
48
- return descriptor;
49
- };
50
- }
51
- exports.MulterOptions = MulterOptions;
52
- //# sourceMappingURL=multerOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"multerOptions.js","sourceRoot":"","sources":["../../../../src/decorators/multer/multerOptions.ts"],"names":[],"mappings":";;;AAAA,qCAAsC;AAEtC,+FAAuF;AAEvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,SAAgB,aAAa,CAAC,OAA+B;IAC3D,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,UAA8B,EAAE,EAAE;QAC1E,IAAA,iBAAU,EAAC,sDAAwB,EAAE,EAAC,OAAO,EAAC,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEjF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAND,sCAMC"}
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MultipartFile = void 0;
4
- const core_1 = require("@tsed/core");
5
- const platform_params_1 = require("@tsed/platform-params");
6
- const schema_1 = require("@tsed/schema");
7
- const PlatformMulterMiddleware_js_1 = require("../../middlewares/PlatformMulterMiddleware.js");
8
- function mapOptions(name, maxCount) {
9
- return {
10
- fields: [
11
- {
12
- name,
13
- maxCount
14
- }
15
- ]
16
- };
17
- }
18
- /**
19
- * Define a parameter as Multipart file.
20
- *
21
- * ```typescript
22
- * import {Controller, Post} from "@tsed/common";
23
- * import {MulterOptions, MultipartFile} from "@tsed/common";
24
- * import {Multer} from "@types/multer";
25
- *
26
- * type MulterFile = Express.Multer.File;
27
- *
28
- * @Controller('/')
29
- * class MyCtrl {
30
- * @Post('/file')
31
- * private uploadFile(@MultipartFile("file1") file: MulterFile) {
32
- *
33
- * }
34
- *
35
- * @Post('/file')
36
- * @MulterOptions({dest: "/other-dir"})
37
- * private uploadFile(@MultipartFile("file1") file: MulterFile) {
38
- *
39
- * }
40
- *
41
- * @Post('/file2')
42
- * @MulterOptions({dest: "/other-dir"})
43
- * private uploadFile(@MultipartFile("file1") file: MulterFile, @MultipartFile("file2") file2: MulterFile) {
44
- *
45
- * }
46
- *
47
- * @Post('/files')
48
- * private uploadFile(@MultipartFile("file1") files: MulterFile[]) {
49
- *
50
- * }
51
- * }
52
- * ```
53
- *
54
- * > See the tutorial on the [multer configuration](/tutorials/multer.md).
55
- *
56
- * @param name
57
- * @param maxCount
58
- * @returns Function
59
- * @decorator
60
- * @input
61
- */
62
- function MultipartFile(name, maxCount) {
63
- return (...args) => {
64
- const [target, propertyKey, index] = args;
65
- const multiple = core_1.Metadata.getParamTypes(target, propertyKey)[index] === Array;
66
- name = (typeof name === "object" ? undefined : name);
67
- const expression = [name, !multiple && "0"].filter(Boolean).join(".");
68
- const decorators = (0, core_1.useDecorators)((0, schema_1.InFile)(name), (0, core_1.useMethodDecorators)((0, core_1.StoreMerge)(PlatformMulterMiddleware_js_1.PlatformMulterMiddleware, mapOptions(name, maxCount))), (0, platform_params_1.UseParam)({
69
- paramType: platform_params_1.ParamTypes.FILES,
70
- dataPath: "$ctx.request.files",
71
- expression,
72
- useValidation: true
73
- }));
74
- decorators(...args);
75
- };
76
- }
77
- exports.MultipartFile = MultipartFile;
78
- //# sourceMappingURL=multipartFile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"multipartFile.js","sourceRoot":"","sources":["../../../../src/decorators/multer/multipartFile.ts"],"names":[],"mappings":";;;AAAA,qCAAyG;AACzG,2DAA2D;AAC3D,yCAAoC;AAEpC,+FAA2G;AAE3G,SAAS,UAAU,CAAC,IAAY,EAAE,QAA4B;IAC5D,OAAO;QACL,MAAM,EAAE;YACN;gBACE,IAAI;gBACJ,QAAQ;aACT;SACF;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,SAAgB,aAAa,CAAC,IAAY,EAAE,QAAiB;IAC3D,OAAO,CAAC,GAAG,IAAyB,EAAQ,EAAE;QAC5C,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;QAC1C,MAAM,QAAQ,GAAG,eAAQ,CAAC,aAAa,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,KAAe,CAAC,KAAK,KAAK,CAAC;QAExF,IAAI,GAAG,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAE,CAAC;QAEtD,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEtE,MAAM,UAAU,GAAG,IAAA,oBAAa,EAC9B,IAAA,eAAM,EAAC,IAAI,CAAC,EACZ,IAAA,0BAAmB,EAAC,IAAA,iBAAU,EAAC,sDAAwB,EAAE,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EACrF,IAAA,0BAAQ,EAAC;YACP,SAAS,EAAE,4BAAU,CAAC,KAAK;YAC3B,QAAQ,EAAE,oBAAoB;YAC9B,UAAU;YACV,aAAa,EAAE,IAAI;SACpB,CAAC,CACH,CAAC;QAEF,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC;AAtBD,sCAsBC"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Err = void 0;
4
- const platform_params_1 = require("@tsed/platform-params");
5
- /**
6
- * @returns {Function}
7
- * @decorator
8
- * @operation
9
- * @input
10
- */
11
- function Err() {
12
- return (0, platform_params_1.UseParam)({
13
- paramType: platform_params_1.ParamTypes.ERR,
14
- dataPath: "$ctx.error",
15
- useValidation: false,
16
- useMapper: false
17
- });
18
- }
19
- exports.Err = Err;
20
- //# sourceMappingURL=error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../src/decorators/params/error.ts"],"names":[],"mappings":";;;AAAA,2DAA2D;AAE3D;;;;;GAKG;AACH,SAAgB,GAAG;IACjB,OAAO,IAAA,0BAAQ,EAAC;QACd,SAAS,EAAE,4BAAU,CAAC,GAAG;QACzB,QAAQ,EAAE,YAAY;QACtB,aAAa,EAAE,KAAK;QACpB,SAAS,EAAE,KAAK;KACjB,CAAC,CAAC;AACL,CAAC;AAPD,kBAOC"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Next = void 0;
4
- const platform_params_1 = require("@tsed/platform-params");
5
- /**
6
- * Get the Next function (for express application and middleware).
7
- *
8
- * @decorator
9
- * @operation
10
- * @input
11
- */
12
- function Next() {
13
- return (0, platform_params_1.UseParam)({
14
- paramType: platform_params_1.ParamTypes.NEXT_FN,
15
- dataPath: "next",
16
- useMapper: false,
17
- useValidation: false
18
- });
19
- }
20
- exports.Next = Next;
21
- //# sourceMappingURL=next.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"next.js","sourceRoot":"","sources":["../../../../src/decorators/params/next.ts"],"names":[],"mappings":";;;AAAA,2DAA2D;AAE3D;;;;;;GAMG;AACH,SAAgB,IAAI;IAClB,OAAO,IAAA,0BAAQ,EAAC;QACd,SAAS,EAAE,4BAAU,CAAC,OAAO;QAC7B,QAAQ,EAAE,MAAM;QAChB,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;AACL,CAAC;AAPD,oBAOC"}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Req = exports.Request = void 0;
4
- const core_1 = require("@tsed/core");
5
- const http_1 = require("http");
6
- const platform_params_1 = require("@tsed/platform-params");
7
- function getParamType(target, propertyKey, parameterIndex) {
8
- const type = core_1.Metadata.getOwnParamTypes(target, propertyKey)[parameterIndex];
9
- if ((0, core_1.isClass)(type)) {
10
- if ((0, core_1.nameOf)(type) === "PlatformRequest") {
11
- return { paramType: platform_params_1.ParamTypes.PLATFORM_REQUEST, dataPath: "$ctx.request" };
12
- }
13
- if (type === http_1.IncomingMessage) {
14
- return { paramType: platform_params_1.ParamTypes.NODE_REQUEST, dataPath: "$ctx.request.req" };
15
- }
16
- }
17
- return { paramType: platform_params_1.ParamTypes.REQUEST, dataPath: "$ctx.request.request" };
18
- }
19
- function Request(...args) {
20
- // @ts-ignore
21
- return Req(...args);
22
- }
23
- exports.Request = Request;
24
- function Req(...args) {
25
- const { expression, useType, useMapper = false, useValidation = false } = (0, platform_params_1.mapParamsOptions)(args);
26
- return (target, propertyKey, parameterIndex) => {
27
- const { paramType, dataPath } = getParamType(target, propertyKey, parameterIndex);
28
- (0, platform_params_1.UseParam)({
29
- paramType,
30
- dataPath,
31
- expression,
32
- useType,
33
- useMapper,
34
- useValidation
35
- })(target, propertyKey, parameterIndex);
36
- };
37
- }
38
- exports.Req = Req;
39
- //# sourceMappingURL=request.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../../src/decorators/params/request.ts"],"names":[],"mappings":";;;AAAA,qCAA2D;AAC3D,+BAAqC;AACrC,2DAA2F;AAE3F,SAAS,YAAY,CAAC,MAAc,EAAE,WAAwC,EAAE,cAAsB;IACpG,MAAM,IAAI,GAAG,eAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,cAAc,CAAC,CAAC;IAE5E,IAAI,IAAA,cAAO,EAAC,IAAI,CAAC,EAAE;QACjB,IAAI,IAAA,aAAM,EAAC,IAAI,CAAC,KAAK,iBAAiB,EAAE;YACtC,OAAO,EAAC,SAAS,EAAE,4BAAU,CAAC,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAC,CAAC;SAC3E;QAED,IAAI,IAAI,KAAK,sBAAe,EAAE;YAC5B,OAAO,EAAC,SAAS,EAAE,4BAAU,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,EAAC,CAAC;SAC3E;KACF;IAED,OAAO,EAAC,SAAS,EAAE,4BAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAC,CAAC;AAC3E,CAAC;AAcD,SAAgB,OAAO,CAAC,GAAG,IAAW;IACpC,aAAa;IACb,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACtB,CAAC;AAHD,0BAGC;AAeD,SAAgB,GAAG,CAAC,GAAG,IAAW;IAChC,MAAM,EAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAG,KAAK,EAAE,aAAa,GAAG,KAAK,EAAC,GAAG,IAAA,kCAAgB,EAAC,IAAI,CAAC,CAAC;IAE/F,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,EAAE;QAC7C,MAAM,EAAC,SAAS,EAAE,QAAQ,EAAC,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;QAEhF,IAAA,0BAAQ,EAAC;YACP,SAAS;YACT,QAAQ;YACR,UAAU;YACV,OAAO;YACP,SAAS;YACT,aAAa;SACd,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;IAC1C,CAAC,CAAC;AACJ,CAAC;AAfD,kBAeC"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Res = exports.Response = void 0;
4
- const core_1 = require("@tsed/core");
5
- const platform_params_1 = require("@tsed/platform-params");
6
- const http_1 = require("http");
7
- function getParamType(target, propertyKey, parameterIndex) {
8
- const type = core_1.Metadata.getOwnParamTypes(target, propertyKey)[parameterIndex];
9
- if ((0, core_1.isClass)(type)) {
10
- if ((0, core_1.nameOf)(type) === "PlatformResponse") {
11
- return { paramType: platform_params_1.ParamTypes.PLATFORM_RESPONSE, dataPath: "$ctx.response" };
12
- }
13
- if (type === http_1.ServerResponse) {
14
- return { paramType: platform_params_1.ParamTypes.NODE_RESPONSE, dataPath: "$ctx.response.res" };
15
- }
16
- }
17
- return { paramType: platform_params_1.ParamTypes.RESPONSE, dataPath: "$ctx.response.response" };
18
- }
19
- function Response() {
20
- return Res();
21
- }
22
- exports.Response = Response;
23
- function Res() {
24
- return (target, propertyKey, parameterIndex) => {
25
- const { paramType, dataPath } = getParamType(target, propertyKey, parameterIndex);
26
- (0, platform_params_1.UseParam)({
27
- paramType,
28
- dataPath
29
- })(target, propertyKey, parameterIndex);
30
- };
31
- }
32
- exports.Res = Res;
33
- //# sourceMappingURL=response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../src/decorators/params/response.ts"],"names":[],"mappings":";;;AAAA,qCAAqD;AACrD,2DAA2D;AAC3D,+BAAoC;AAEpC,SAAS,YAAY,CAAC,MAAc,EAAE,WAAwC,EAAE,cAAsB;IACpG,MAAM,IAAI,GAAG,eAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,cAAc,CAAC,CAAC;IAE5E,IAAI,IAAA,cAAO,EAAC,IAAI,CAAC,EAAE;QACjB,IAAI,IAAA,aAAM,EAAC,IAAI,CAAC,KAAK,kBAAkB,EAAE;YACvC,OAAO,EAAC,SAAS,EAAE,4BAAU,CAAC,iBAAiB,EAAE,QAAQ,EAAE,eAAe,EAAC,CAAC;SAC7E;QAED,IAAI,IAAI,KAAK,qBAAc,EAAE;YAC3B,OAAO,EAAC,SAAS,EAAE,4BAAU,CAAC,aAAa,EAAE,QAAQ,EAAE,mBAAmB,EAAC,CAAC;SAC7E;KACF;IAED,OAAO,EAAC,SAAS,EAAE,4BAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,wBAAwB,EAAC,CAAC;AAC9E,CAAC;AAWD,SAAgB,QAAQ;IACtB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AAFD,4BAEC;AAYD,SAAgB,GAAG;IACjB,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,EAAE;QAC7C,MAAM,EAAC,SAAS,EAAE,QAAQ,EAAC,GAAG,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;QAChF,IAAA,0BAAQ,EAAC;YACP,SAAS;YACT,QAAQ;SACT,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;IAC1C,CAAC,CAAC;AACJ,CAAC;AARD,kBAQC"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AnyToPromiseWithCtx = void 0;
4
- const core_1 = require("@tsed/core");
5
- class AnyToPromiseWithCtx extends core_1.AnyToPromise {
6
- constructor($ctx) {
7
- super();
8
- this.$ctx = $ctx;
9
- }
10
- isDone() {
11
- const { $ctx } = this;
12
- return $ctx?.isDone() || super.isDone();
13
- }
14
- call(cb) {
15
- return super.call(() => cb(this));
16
- }
17
- destroy() {
18
- this.$ctx = null;
19
- }
20
- isCanceledResponse(process) {
21
- return process === this.$ctx.getResponse();
22
- }
23
- }
24
- exports.AnyToPromiseWithCtx = AnyToPromiseWithCtx;
25
- //# sourceMappingURL=AnyToPromiseWithCtx.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnyToPromiseWithCtx.js","sourceRoot":"","sources":["../../../src/domain/AnyToPromiseWithCtx.ts"],"names":[],"mappings":";;;AAAA,qCAA0D;AAG1D,MAAa,mBAAoB,SAAQ,mBAAY;IAGnD,YAAY,IAAqB;QAC/B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,MAAM;QACJ,MAAM,EAAC,IAAI,EAAC,GAAG,IAAI,CAAC;QAEpB,OAAO,IAAI,EAAE,MAAM,EAAE,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;IAC1C,CAAC;IAED,IAAI,CAAC,EAAY;QACf,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,OAAO;QACJ,IAAI,CAAC,IAAY,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED,kBAAkB,CAAC,OAAY;QAC7B,OAAO,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IAC7C,CAAC;CACF;AAzBD,kDAyBC"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EndpointMetadata = void 0;
4
- var schema_1 = require("@tsed/schema");
5
- Object.defineProperty(exports, "EndpointMetadata", { enumerable: true, get: function () { return schema_1.EndpointMetadata; } });
6
- //# sourceMappingURL=EndpointMetadata.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EndpointMetadata.js","sourceRoot":"","sources":["../../../src/domain/EndpointMetadata.ts"],"names":[],"mappings":";;;AAAA,uCAA8C;AAAtC,0GAAA,gBAAgB,OAAA"}
@@ -1,73 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatformContext = void 0;
4
- const di_1 = require("@tsed/di");
5
- const PlatformApplication_js_1 = require("../services/PlatformApplication.js");
6
- const PlatformRequest_js_1 = require("../services/PlatformRequest.js");
7
- const PlatformResponse_js_1 = require("../services/PlatformResponse.js");
8
- class PlatformContext extends di_1.DIContext {
9
- #isFinished;
10
- constructor(options) {
11
- super(options);
12
- this.PLATFORM = "WWW";
13
- this.#isFinished = false;
14
- options.endpoint && (this.endpoint = options.endpoint);
15
- this.event = options.event;
16
- this.response = new (options.ResponseKlass || PlatformResponse_js_1.PlatformResponse)(this);
17
- this.request = new (options.RequestKlass || PlatformRequest_js_1.PlatformRequest)(this);
18
- this.request.request.$ctx = this;
19
- this.request.request.id = this.id;
20
- this.response.setHeader("x-request-id", this.id);
21
- }
22
- get url() {
23
- return this.request.url;
24
- }
25
- get app() {
26
- return this.injector.get(PlatformApplication_js_1.PlatformApplication);
27
- }
28
- start() {
29
- return this.emit("$onRequest", this);
30
- }
31
- async finish() {
32
- await Promise.all([this.emit("$onResponse", this), this.destroy()]);
33
- this.#isFinished = true;
34
- }
35
- isFinished() {
36
- return this.#isFinished;
37
- }
38
- isDone() {
39
- return this.request?.isAborted() || this.response?.isDone() || this.isFinished();
40
- }
41
- /**
42
- * Return the framework request instance (Express, Koa, etc...)
43
- */
44
- getRequest() {
45
- return this.request.getRequest();
46
- }
47
- /**
48
- * Return the framework response instance (Express, Koa, etc...)
49
- */
50
- getResponse() {
51
- return this.response.getResponse();
52
- }
53
- /**
54
- * Get Node.js request
55
- */
56
- getReq() {
57
- return this.request.getReq();
58
- }
59
- /**
60
- * Get Node.js response
61
- */
62
- getRes() {
63
- return this.response.getRes();
64
- }
65
- /**
66
- * Return the original application instance.
67
- */
68
- getApp() {
69
- return this.app.getApp();
70
- }
71
- }
72
- exports.PlatformContext = PlatformContext;
73
- //# sourceMappingURL=PlatformContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformContext.js","sourceRoot":"","sources":["../../../src/domain/PlatformContext.ts"],"names":[],"mappings":";;;AAAA,iCAAqD;AAKrD,+EAAuE;AACvE,uEAA+D;AAC/D,yEAAiE;AAcjE,MAAa,eAGX,SAAQ,cAAS;IAgCjB,WAAW,CAAkB;IAE7B,YAAY,OAA+B;QACzC,KAAK,CAAC,OAAO,CAAC,CAAC;QAlCR,aAAQ,GAAW,KAAK,CAAC;QA+BlC,gBAAW,GAAY,KAAK,CAAC;QAK3B,OAAO,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;QAEvD,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,sCAAgB,CAAC,CAAC,IAAI,CAAC,CAAC;QACtE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,oCAAe,CAAC,CAAC,IAAI,CAAC,CAAC;QAEnE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;QACjC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAElC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,IAAI,GAAG;QACL,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map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformRouteDetails.js","sourceRoot":"","sources":["../../../src/domain/PlatformRouteDetails.ts"],"names":[],"mappings":""}
@@ -1,30 +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 = exports.View = exports.Redirect = exports.Location = exports.AcceptMime = exports.Logger = exports.$log = void 0;
4
- const tslib_1 = require("tslib");
5
- require("@tsed/logger");
6
- require("@tsed/logger-file");
7
- tslib_1.__exportStar(require("@tsed/di"), exports);
8
- tslib_1.__exportStar(require("@tsed/platform-params"), exports);
9
- tslib_1.__exportStar(require("@tsed/platform-exceptions"), exports);
10
- tslib_1.__exportStar(require("@tsed/platform-response-filter"), exports);
11
- tslib_1.__exportStar(require("@tsed/platform-middlewares"), exports);
12
- tslib_1.__exportStar(require("@tsed/platform-log-middleware"), exports);
13
- tslib_1.__exportStar(require("@tsed/platform-router"), exports);
14
- var logger_1 = require("@tsed/logger");
15
- Object.defineProperty(exports, "$log", { enumerable: true, get: function () { return logger_1.$log; } });
16
- Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return logger_1.Logger; } });
17
- var schema_1 = require("@tsed/schema");
18
- Object.defineProperty(exports, "AcceptMime", { enumerable: true, get: function () { return schema_1.AcceptMime; } });
19
- Object.defineProperty(exports, "Location", { enumerable: true, get: function () { return schema_1.Location; } });
20
- Object.defineProperty(exports, "Redirect", { enumerable: true, get: function () { return schema_1.Redirect; } });
21
- Object.defineProperty(exports, "View", { enumerable: true, get: function () { return schema_1.View; } });
22
- Object.defineProperty(exports, "Get", { enumerable: true, get: function () { return schema_1.Get; } });
23
- Object.defineProperty(exports, "Post", { enumerable: true, get: function () { return schema_1.Post; } });
24
- Object.defineProperty(exports, "Put", { enumerable: true, get: function () { return schema_1.Put; } });
25
- Object.defineProperty(exports, "Patch", { enumerable: true, get: function () { return schema_1.Patch; } });
26
- Object.defineProperty(exports, "Delete", { enumerable: true, get: function () { return schema_1.Delete; } });
27
- Object.defineProperty(exports, "Head", { enumerable: true, get: function () { return schema_1.Head; } });
28
- Object.defineProperty(exports, "Options", { enumerable: true, get: function () { return schema_1.Options; } });
29
- Object.defineProperty(exports, "All", { enumerable: true, get: function () { return schema_1.All; } });
30
- //# sourceMappingURL=exports.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":";;;;AAAA,wBAAsB;AACtB,6BAA2B;AAE3B,mDAAyB;AACzB,gEAAsC;AACtC,oEAA0C;AAC1C,yEAA+C;AAC/C,qEAA2C;AAC3C,wEAA8C;AAC9C,gEAAsC;AAEtC,uCAA0C;AAAlC,8FAAA,IAAI,OAAA;AAAE,gGAAA,MAAM,OAAA;AAEpB,uCAAqH;AAA7G,oGAAA,UAAU,OAAA;AAAE,kGAAA,QAAQ,OAAA;AAAE,kGAAA,QAAQ,OAAA;AAAE,8FAAA,IAAI,OAAA;AAAE,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"}