@tsed/common 8.0.0-alpha.4 → 8.0.0-alpha.6

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 (205) hide show
  1. package/lib/esm/services/PlatformTest.js.map +1 -1
  2. package/lib/types/builder/PlatformBuilder.d.ts +1 -1
  3. package/lib/types/config/services/PlatformConfiguration.d.ts +1 -1
  4. package/lib/types/domain/PlatformContext.d.ts +1 -1
  5. package/lib/types/interfaces/IncomingEvent.d.ts +1 -1
  6. package/lib/types/services/FakeResponse.d.ts +1 -1
  7. package/lib/types/services/PlatformAdapter.d.ts +1 -1
  8. package/lib/types/services/PlatformApplication.d.ts +1 -1
  9. package/lib/types/services/PlatformRequest.d.ts +1 -1
  10. package/lib/types/services/PlatformResponse.d.ts +2 -2
  11. package/lib/types/services/PlatformTest.d.ts +1 -1
  12. package/lib/types/utils/closeServer.d.ts +3 -3
  13. package/lib/types/utils/createHttpServer.d.ts +1 -1
  14. package/lib/types/utils/createHttpsServer.d.ts +1 -1
  15. package/lib/types/utils/createServer.d.ts +3 -3
  16. package/lib/types/utils/listenServer.d.ts +3 -3
  17. package/package.json +19 -20
  18. package/lib/cjs/builder/PlatformBuilder.js +0 -341
  19. package/lib/cjs/builder/PlatformBuilder.js.map +0 -1
  20. package/lib/cjs/config/interfaces/PlatformJsonMapperSettings.js +0 -3
  21. package/lib/cjs/config/interfaces/PlatformJsonMapperSettings.js.map +0 -1
  22. package/lib/cjs/config/interfaces/PlatformMulterSettings.js +0 -3
  23. package/lib/cjs/config/interfaces/PlatformMulterSettings.js.map +0 -1
  24. package/lib/cjs/config/interfaces/PlatformRouterSettings.js +0 -3
  25. package/lib/cjs/config/interfaces/PlatformRouterSettings.js.map +0 -1
  26. package/lib/cjs/config/interfaces/PlatformStaticsSettings.js +0 -3
  27. package/lib/cjs/config/interfaces/PlatformStaticsSettings.js.map +0 -1
  28. package/lib/cjs/config/services/PlatformConfiguration.js +0 -122
  29. package/lib/cjs/config/services/PlatformConfiguration.js.map +0 -1
  30. package/lib/cjs/constants/routerOptions.js +0 -5
  31. package/lib/cjs/constants/routerOptions.js.map +0 -1
  32. package/lib/cjs/decorators/PlatformProvider.js +0 -11
  33. package/lib/cjs/decorators/PlatformProvider.js.map +0 -1
  34. package/lib/cjs/decorators/multer/multerFileSize.js +0 -35
  35. package/lib/cjs/decorators/multer/multerFileSize.js.map +0 -1
  36. package/lib/cjs/decorators/multer/multerOptions.js +0 -52
  37. package/lib/cjs/decorators/multer/multerOptions.js.map +0 -1
  38. package/lib/cjs/decorators/multer/multipartFile.js +0 -78
  39. package/lib/cjs/decorators/multer/multipartFile.js.map +0 -1
  40. package/lib/cjs/decorators/params/error.js +0 -20
  41. package/lib/cjs/decorators/params/error.js.map +0 -1
  42. package/lib/cjs/decorators/params/next.js +0 -21
  43. package/lib/cjs/decorators/params/next.js.map +0 -1
  44. package/lib/cjs/decorators/params/request.js +0 -39
  45. package/lib/cjs/decorators/params/request.js.map +0 -1
  46. package/lib/cjs/decorators/params/response.js +0 -33
  47. package/lib/cjs/decorators/params/response.js.map +0 -1
  48. package/lib/cjs/domain/AnyToPromiseWithCtx.js +0 -25
  49. package/lib/cjs/domain/AnyToPromiseWithCtx.js.map +0 -1
  50. package/lib/cjs/domain/EndpointMetadata.js +0 -6
  51. package/lib/cjs/domain/EndpointMetadata.js.map +0 -1
  52. package/lib/cjs/domain/PlatformContext.js +0 -73
  53. package/lib/cjs/domain/PlatformContext.js.map +0 -1
  54. package/lib/cjs/domain/PlatformRouteDetails.js +0 -3
  55. package/lib/cjs/domain/PlatformRouteDetails.js.map +0 -1
  56. package/lib/cjs/exports.js +0 -30
  57. package/lib/cjs/exports.js.map +0 -1
  58. package/lib/cjs/index.js +0 -67
  59. package/lib/cjs/index.js.map +0 -1
  60. package/lib/cjs/interfaces/AfterInit.js +0 -3
  61. package/lib/cjs/interfaces/AfterInit.js.map +0 -1
  62. package/lib/cjs/interfaces/AfterListen.js +0 -3
  63. package/lib/cjs/interfaces/AfterListen.js.map +0 -1
  64. package/lib/cjs/interfaces/AfterRoutesInit.js +0 -3
  65. package/lib/cjs/interfaces/AfterRoutesInit.js.map +0 -1
  66. package/lib/cjs/interfaces/BeforeInit.js +0 -3
  67. package/lib/cjs/interfaces/BeforeInit.js.map +0 -1
  68. package/lib/cjs/interfaces/BeforeListen.js +0 -3
  69. package/lib/cjs/interfaces/BeforeListen.js.map +0 -1
  70. package/lib/cjs/interfaces/BeforeRoutesInit.js +0 -3
  71. package/lib/cjs/interfaces/BeforeRoutesInit.js.map +0 -1
  72. package/lib/cjs/interfaces/HandlerType.js +0 -17
  73. package/lib/cjs/interfaces/HandlerType.js.map +0 -1
  74. package/lib/cjs/interfaces/IncomingEvent.js +0 -3
  75. package/lib/cjs/interfaces/IncomingEvent.js.map +0 -1
  76. package/lib/cjs/interfaces/OnReady.js +0 -3
  77. package/lib/cjs/interfaces/OnReady.js.map +0 -1
  78. package/lib/cjs/interfaces/OnRequest.js +0 -3
  79. package/lib/cjs/interfaces/OnRequest.js.map +0 -1
  80. package/lib/cjs/interfaces/OnResponse.js +0 -3
  81. package/lib/cjs/interfaces/OnResponse.js.map +0 -1
  82. package/lib/cjs/interfaces/OnRoutesInit.js +0 -3
  83. package/lib/cjs/interfaces/OnRoutesInit.js.map +0 -1
  84. package/lib/cjs/interfaces/PlatformRouteOptions.js +0 -3
  85. package/lib/cjs/interfaces/PlatformRouteOptions.js.map +0 -1
  86. package/lib/cjs/interfaces/ResponseErrorObject.js +0 -3
  87. package/lib/cjs/interfaces/ResponseErrorObject.js.map +0 -1
  88. package/lib/cjs/interfaces/Route.js +0 -3
  89. package/lib/cjs/interfaces/Route.js.map +0 -1
  90. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js +0 -39
  91. package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js.map +0 -1
  92. package/lib/cjs/middlewares/PlatformMulterMiddleware.js +0 -70
  93. package/lib/cjs/middlewares/PlatformMulterMiddleware.js.map +0 -1
  94. package/lib/cjs/package.json +0 -3
  95. package/lib/cjs/services/FakeAdapter.js +0 -6
  96. package/lib/cjs/services/FakeAdapter.js.map +0 -1
  97. package/lib/cjs/services/FakeResponse.js +0 -59
  98. package/lib/cjs/services/FakeResponse.js.map +0 -1
  99. package/lib/cjs/services/Platform.js +0 -76
  100. package/lib/cjs/services/Platform.js.map +0 -1
  101. package/lib/cjs/services/PlatformAdapter.js +0 -82
  102. package/lib/cjs/services/PlatformAdapter.js.map +0 -1
  103. package/lib/cjs/services/PlatformApplication.js +0 -44
  104. package/lib/cjs/services/PlatformApplication.js.map +0 -1
  105. package/lib/cjs/services/PlatformHandler.js +0 -133
  106. package/lib/cjs/services/PlatformHandler.js.map +0 -1
  107. package/lib/cjs/services/PlatformMiddlewaresChain.js +0 -60
  108. package/lib/cjs/services/PlatformMiddlewaresChain.js.map +0 -1
  109. package/lib/cjs/services/PlatformRequest.js +0 -144
  110. package/lib/cjs/services/PlatformRequest.js.map +0 -1
  111. package/lib/cjs/services/PlatformResponse.js +0 -309
  112. package/lib/cjs/services/PlatformResponse.js.map +0 -1
  113. package/lib/cjs/services/PlatformTest.js +0 -142
  114. package/lib/cjs/services/PlatformTest.js.map +0 -1
  115. package/lib/cjs/utils/closeServer.js +0 -8
  116. package/lib/cjs/utils/closeServer.js.map +0 -1
  117. package/lib/cjs/utils/createContext.js +0 -49
  118. package/lib/cjs/utils/createContext.js.map +0 -1
  119. package/lib/cjs/utils/createHttpServer.js +0 -18
  120. package/lib/cjs/utils/createHttpServer.js.map +0 -1
  121. package/lib/cjs/utils/createHttpsServer.js +0 -18
  122. package/lib/cjs/utils/createHttpsServer.js.map +0 -1
  123. package/lib/cjs/utils/createInjector.js +0 -45
  124. package/lib/cjs/utils/createInjector.js.map +0 -1
  125. package/lib/cjs/utils/createServer.js +0 -33
  126. package/lib/cjs/utils/createServer.js.map +0 -1
  127. package/lib/cjs/utils/ensureContext.js +0 -16
  128. package/lib/cjs/utils/ensureContext.js.map +0 -1
  129. package/lib/cjs/utils/getConfiguration.js +0 -36
  130. package/lib/cjs/utils/getConfiguration.js.map +0 -1
  131. package/lib/cjs/utils/getStaticsOptions.js +0 -21
  132. package/lib/cjs/utils/getStaticsOptions.js.map +0 -1
  133. package/lib/cjs/utils/listenServer.js +0 -14
  134. package/lib/cjs/utils/listenServer.js.map +0 -1
  135. package/lib/cjs/utils/mapReturnedResponse.js +0 -15
  136. package/lib/cjs/utils/mapReturnedResponse.js.map +0 -1
  137. package/lib/cjs/utils/printRoutes.js +0 -38
  138. package/lib/cjs/utils/printRoutes.js.map +0 -1
  139. package/lib/cjs/utils/registerPlatformAdapter.js +0 -11
  140. package/lib/cjs/utils/registerPlatformAdapter.js.map +0 -1
  141. package/lib/cjs/utils/setResponseHeaders.js +0 -29
  142. package/lib/cjs/utils/setResponseHeaders.js.map +0 -1
  143. package/lib/esm/package.json +0 -3
  144. package/lib/types-esm/builder/PlatformBuilder.d.ts +0 -100
  145. package/lib/types-esm/config/interfaces/PlatformJsonMapperSettings.d.ts +0 -10
  146. package/lib/types-esm/config/interfaces/PlatformMulterSettings.d.ts +0 -14
  147. package/lib/types-esm/config/interfaces/PlatformRouterSettings.d.ts +0 -10
  148. package/lib/types-esm/config/interfaces/PlatformStaticsSettings.d.ts +0 -17
  149. package/lib/types-esm/config/services/PlatformConfiguration.d.ts +0 -67
  150. package/lib/types-esm/constants/routerOptions.d.ts +0 -1
  151. package/lib/types-esm/decorators/PlatformProvider.d.ts +0 -3
  152. package/lib/types-esm/decorators/multer/multerFileSize.d.ts +0 -27
  153. package/lib/types-esm/decorators/multer/multerOptions.d.ts +0 -41
  154. package/lib/types-esm/decorators/multer/multipartFile.d.ts +0 -47
  155. package/lib/types-esm/decorators/params/error.d.ts +0 -7
  156. package/lib/types-esm/decorators/params/next.d.ts +0 -22
  157. package/lib/types-esm/decorators/params/request.d.ts +0 -46
  158. package/lib/types-esm/decorators/params/response.d.ts +0 -40
  159. package/lib/types-esm/domain/AnyToPromiseWithCtx.d.ts +0 -10
  160. package/lib/types-esm/domain/EndpointMetadata.d.ts +0 -1
  161. package/lib/types-esm/domain/PlatformContext.d.ts +0 -80
  162. package/lib/types-esm/domain/PlatformRouteDetails.d.ts +0 -7
  163. package/lib/types-esm/exports.d.ts +0 -11
  164. package/lib/types-esm/index.d.ts +0 -63
  165. package/lib/types-esm/interfaces/AfterInit.d.ts +0 -3
  166. package/lib/types-esm/interfaces/AfterListen.d.ts +0 -3
  167. package/lib/types-esm/interfaces/AfterRoutesInit.d.ts +0 -3
  168. package/lib/types-esm/interfaces/BeforeInit.d.ts +0 -3
  169. package/lib/types-esm/interfaces/BeforeListen.d.ts +0 -3
  170. package/lib/types-esm/interfaces/BeforeRoutesInit.d.ts +0 -3
  171. package/lib/types-esm/interfaces/HandlerType.d.ts +0 -12
  172. package/lib/types-esm/interfaces/IncomingEvent.d.ts +0 -6
  173. package/lib/types-esm/interfaces/OnReady.d.ts +0 -3
  174. package/lib/types-esm/interfaces/OnRequest.d.ts +0 -4
  175. package/lib/types-esm/interfaces/OnResponse.d.ts +0 -4
  176. package/lib/types-esm/interfaces/OnRoutesInit.d.ts +0 -3
  177. package/lib/types-esm/interfaces/PlatformRouteOptions.d.ts +0 -15
  178. package/lib/types-esm/interfaces/ResponseErrorObject.d.ts +0 -8
  179. package/lib/types-esm/interfaces/Route.d.ts +0 -10
  180. package/lib/types-esm/middlewares/PlatformAcceptMimesMiddleware.d.ts +0 -10
  181. package/lib/types-esm/middlewares/PlatformMulterMiddleware.d.ts +0 -24
  182. package/lib/types-esm/services/FakeAdapter.d.ts +0 -1
  183. package/lib/types-esm/services/FakeResponse.d.ts +0 -22
  184. package/lib/types-esm/services/Platform.d.ts +0 -25
  185. package/lib/types-esm/services/PlatformAdapter.d.ts +0 -89
  186. package/lib/types-esm/services/PlatformApplication.d.ts +0 -29
  187. package/lib/types-esm/services/PlatformHandler.d.ts +0 -39
  188. package/lib/types-esm/services/PlatformMiddlewaresChain.d.ts +0 -17
  189. package/lib/types-esm/services/PlatformRequest.d.ts +0 -111
  190. package/lib/types-esm/services/PlatformResponse.d.ts +0 -174
  191. package/lib/types-esm/services/PlatformTest.d.ts +0 -60
  192. package/lib/types-esm/utils/closeServer.d.ts +0 -7
  193. package/lib/types-esm/utils/createContext.d.ts +0 -10
  194. package/lib/types-esm/utils/createHttpServer.d.ts +0 -4
  195. package/lib/types-esm/utils/createHttpsServer.d.ts +0 -4
  196. package/lib/types-esm/utils/createInjector.d.ts +0 -9
  197. package/lib/types-esm/utils/createServer.d.ts +0 -17
  198. package/lib/types-esm/utils/ensureContext.d.ts +0 -2
  199. package/lib/types-esm/utils/getConfiguration.d.ts +0 -2
  200. package/lib/types-esm/utils/getStaticsOptions.d.ts +0 -5
  201. package/lib/types-esm/utils/listenServer.d.ts +0 -8
  202. package/lib/types-esm/utils/mapReturnedResponse.d.ts +0 -4
  203. package/lib/types-esm/utils/printRoutes.d.ts +0 -2
  204. package/lib/types-esm/utils/registerPlatformAdapter.d.ts +0 -3
  205. package/lib/types-esm/utils/setResponseHeaders.d.ts +0 -5
package/lib/cjs/index.js DELETED
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- /**
5
- * @file Automatically generated by @tsed/barrels.
6
- */
7
- tslib_1.__exportStar(require("./builder/PlatformBuilder.js"), exports);
8
- tslib_1.__exportStar(require("./config/interfaces/PlatformJsonMapperSettings.js"), exports);
9
- tslib_1.__exportStar(require("./config/interfaces/PlatformMulterSettings.js"), exports);
10
- tslib_1.__exportStar(require("./config/interfaces/PlatformRouterSettings.js"), exports);
11
- tslib_1.__exportStar(require("./config/interfaces/PlatformStaticsSettings.js"), exports);
12
- tslib_1.__exportStar(require("./config/services/PlatformConfiguration.js"), exports);
13
- tslib_1.__exportStar(require("./constants/routerOptions.js"), exports);
14
- tslib_1.__exportStar(require("./decorators/multer/multerFileSize.js"), exports);
15
- tslib_1.__exportStar(require("./decorators/multer/multerOptions.js"), exports);
16
- tslib_1.__exportStar(require("./decorators/multer/multipartFile.js"), exports);
17
- tslib_1.__exportStar(require("./decorators/params/error.js"), exports);
18
- tslib_1.__exportStar(require("./decorators/params/next.js"), exports);
19
- tslib_1.__exportStar(require("./decorators/params/request.js"), exports);
20
- tslib_1.__exportStar(require("./decorators/params/response.js"), exports);
21
- tslib_1.__exportStar(require("./decorators/PlatformProvider.js"), exports);
22
- tslib_1.__exportStar(require("./domain/AnyToPromiseWithCtx.js"), exports);
23
- tslib_1.__exportStar(require("./domain/EndpointMetadata.js"), exports);
24
- tslib_1.__exportStar(require("./domain/PlatformContext.js"), exports);
25
- tslib_1.__exportStar(require("./domain/PlatformRouteDetails.js"), exports);
26
- tslib_1.__exportStar(require("./exports.js"), exports);
27
- tslib_1.__exportStar(require("./interfaces/AfterInit.js"), exports);
28
- tslib_1.__exportStar(require("./interfaces/AfterListen.js"), exports);
29
- tslib_1.__exportStar(require("./interfaces/AfterRoutesInit.js"), exports);
30
- tslib_1.__exportStar(require("./interfaces/BeforeInit.js"), exports);
31
- tslib_1.__exportStar(require("./interfaces/BeforeListen.js"), exports);
32
- tslib_1.__exportStar(require("./interfaces/BeforeRoutesInit.js"), exports);
33
- tslib_1.__exportStar(require("./interfaces/HandlerType.js"), exports);
34
- tslib_1.__exportStar(require("./interfaces/IncomingEvent.js"), exports);
35
- tslib_1.__exportStar(require("./interfaces/OnReady.js"), exports);
36
- tslib_1.__exportStar(require("./interfaces/OnRequest.js"), exports);
37
- tslib_1.__exportStar(require("./interfaces/OnResponse.js"), exports);
38
- tslib_1.__exportStar(require("./interfaces/OnRoutesInit.js"), exports);
39
- tslib_1.__exportStar(require("./interfaces/PlatformRouteOptions.js"), exports);
40
- tslib_1.__exportStar(require("./interfaces/ResponseErrorObject.js"), exports);
41
- tslib_1.__exportStar(require("./interfaces/Route.js"), exports);
42
- tslib_1.__exportStar(require("./middlewares/PlatformAcceptMimesMiddleware.js"), exports);
43
- tslib_1.__exportStar(require("./middlewares/PlatformMulterMiddleware.js"), exports);
44
- tslib_1.__exportStar(require("./services/FakeAdapter.js"), exports);
45
- tslib_1.__exportStar(require("./services/FakeResponse.js"), exports);
46
- tslib_1.__exportStar(require("./services/Platform.js"), exports);
47
- tslib_1.__exportStar(require("./services/PlatformAdapter.js"), exports);
48
- tslib_1.__exportStar(require("./services/PlatformApplication.js"), exports);
49
- tslib_1.__exportStar(require("./services/PlatformHandler.js"), exports);
50
- tslib_1.__exportStar(require("./services/PlatformMiddlewaresChain.js"), exports);
51
- tslib_1.__exportStar(require("./services/PlatformRequest.js"), exports);
52
- tslib_1.__exportStar(require("./services/PlatformResponse.js"), exports);
53
- tslib_1.__exportStar(require("./services/PlatformTest.js"), exports);
54
- tslib_1.__exportStar(require("./utils/closeServer.js"), exports);
55
- tslib_1.__exportStar(require("./utils/createContext.js"), exports);
56
- tslib_1.__exportStar(require("./utils/createHttpServer.js"), exports);
57
- tslib_1.__exportStar(require("./utils/createHttpsServer.js"), exports);
58
- tslib_1.__exportStar(require("./utils/createInjector.js"), exports);
59
- tslib_1.__exportStar(require("./utils/createServer.js"), exports);
60
- tslib_1.__exportStar(require("./utils/ensureContext.js"), exports);
61
- tslib_1.__exportStar(require("./utils/getStaticsOptions.js"), exports);
62
- tslib_1.__exportStar(require("./utils/listenServer.js"), exports);
63
- tslib_1.__exportStar(require("./utils/mapReturnedResponse.js"), exports);
64
- tslib_1.__exportStar(require("./utils/printRoutes.js"), exports);
65
- tslib_1.__exportStar(require("./utils/registerPlatformAdapter.js"), exports);
66
- tslib_1.__exportStar(require("./utils/setResponseHeaders.js"), exports);
67
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,uEAA6C;AAC7C,4FAAkE;AAClE,wFAA8D;AAC9D,wFAA8D;AAC9D,yFAA+D;AAC/D,qFAA2D;AAC3D,uEAA6C;AAC7C,gFAAsD;AACtD,+EAAqD;AACrD,+EAAqD;AACrD,uEAA6C;AAC7C,sEAA4C;AAC5C,yEAA+C;AAC/C,0EAAgD;AAChD,2EAAiD;AACjD,0EAAgD;AAChD,uEAA6C;AAC7C,sEAA4C;AAC5C,2EAAiD;AACjD,uDAA6B;AAC7B,oEAA0C;AAC1C,sEAA4C;AAC5C,0EAAgD;AAChD,qEAA2C;AAC3C,uEAA6C;AAC7C,2EAAiD;AACjD,sEAA4C;AAC5C,wEAA8C;AAC9C,kEAAwC;AACxC,oEAA0C;AAC1C,qEAA2C;AAC3C,uEAA6C;AAC7C,+EAAqD;AACrD,8EAAoD;AACpD,gEAAsC;AACtC,yFAA+D;AAC/D,oFAA0D;AAC1D,oEAA0C;AAC1C,qEAA2C;AAC3C,iEAAuC;AACvC,wEAA8C;AAC9C,4EAAkD;AAClD,wEAA8C;AAC9C,iFAAuD;AACvD,wEAA8C;AAC9C,yEAA+C;AAC/C,qEAA2C;AAC3C,iEAAuC;AACvC,mEAAyC;AACzC,sEAA4C;AAC5C,uEAA6C;AAC7C,oEAA0C;AAC1C,kEAAwC;AACxC,mEAAyC;AACzC,uEAA6C;AAC7C,kEAAwC;AACxC,yEAA+C;AAC/C,iEAAuC;AACvC,6EAAmD;AACnD,wEAA8C"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=AfterInit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AfterInit.js","sourceRoot":"","sources":["../../../src/interfaces/AfterInit.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=AfterListen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AfterListen.js","sourceRoot":"","sources":["../../../src/interfaces/AfterListen.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=AfterRoutesInit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AfterRoutesInit.js","sourceRoot":"","sources":["../../../src/interfaces/AfterRoutesInit.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=BeforeInit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BeforeInit.js","sourceRoot":"","sources":["../../../src/interfaces/BeforeInit.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=BeforeListen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BeforeListen.js","sourceRoot":"","sources":["../../../src/interfaces/BeforeListen.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=BeforeRoutesInit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BeforeRoutesInit.js","sourceRoot":"","sources":["../../../src/interfaces/BeforeRoutesInit.ts"],"names":[],"mappings":""}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HandlerType = void 0;
4
- /**
5
- * @ignore
6
- */
7
- var HandlerType;
8
- (function (HandlerType) {
9
- HandlerType["CUSTOM"] = "custom";
10
- HandlerType["ENDPOINT"] = "endpoint";
11
- HandlerType["MIDDLEWARE"] = "middleware";
12
- HandlerType["ERR_MIDDLEWARE"] = "err:middleware";
13
- HandlerType["CTX_FN"] = "context";
14
- HandlerType["RAW_FN"] = "raw:middleware";
15
- HandlerType["RAW_ERR_FN"] = "raw:err:middleware";
16
- })(HandlerType = exports.HandlerType || (exports.HandlerType = {}));
17
- //# sourceMappingURL=HandlerType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HandlerType.js","sourceRoot":"","sources":["../../../src/interfaces/HandlerType.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,WAQX;AARD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IACrB,wCAAyB,CAAA;IACzB,gDAAiC,CAAA;IACjC,iCAAkB,CAAA;IAClB,wCAAyB,CAAA;IACzB,gDAAiC,CAAA;AACnC,CAAC,EARW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAQtB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IncomingEvent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IncomingEvent.js","sourceRoot":"","sources":["../../../src/interfaces/IncomingEvent.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=OnReady.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OnReady.js","sourceRoot":"","sources":["../../../src/interfaces/OnReady.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=OnRequest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OnRequest.js","sourceRoot":"","sources":["../../../src/interfaces/OnRequest.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=OnResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OnResponse.js","sourceRoot":"","sources":["../../../src/interfaces/OnResponse.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=OnRoutesInit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OnRoutesInit.js","sourceRoot":"","sources":["../../../src/interfaces/OnRoutesInit.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=PlatformRouteOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformRouteOptions.js","sourceRoot":"","sources":["../../../src/interfaces/PlatformRouteOptions.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ResponseErrorObject.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ResponseErrorObject.js","sourceRoot":"","sources":["../../../src/interfaces/ResponseErrorObject.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Route.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Route.js","sourceRoot":"","sources":["../../../src/interfaces/Route.ts"],"names":[],"mappings":""}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatformAcceptMimesMiddleware = void 0;
4
- const tslib_1 = require("tslib");
5
- const core_1 = require("@tsed/core");
6
- const di_1 = require("@tsed/di");
7
- const exceptions_1 = require("@tsed/exceptions");
8
- const platform_middlewares_1 = require("@tsed/platform-middlewares");
9
- const platform_params_1 = require("@tsed/platform-params");
10
- /**
11
- * @middleware
12
- * @platform
13
- */
14
- let PlatformAcceptMimesMiddleware = class PlatformAcceptMimesMiddleware {
15
- use(ctx) {
16
- const { endpoint, request } = ctx;
17
- const mimes = (0, core_1.uniq)((endpoint?.get("acceptMimes") || []).concat(this.acceptMimes));
18
- if (mimes.length && !request.accepts(mimes)) {
19
- throw new exceptions_1.NotAcceptable(mimes.join(", "));
20
- }
21
- }
22
- };
23
- tslib_1.__decorate([
24
- (0, di_1.Constant)("acceptMimes", []),
25
- tslib_1.__metadata("design:type", Array)
26
- ], PlatformAcceptMimesMiddleware.prototype, "acceptMimes", void 0);
27
- tslib_1.__decorate([
28
- tslib_1.__param(0, (0, platform_params_1.Context)()),
29
- tslib_1.__metadata("design:type", Function),
30
- tslib_1.__metadata("design:paramtypes", [Object]),
31
- tslib_1.__metadata("design:returntype", void 0)
32
- ], PlatformAcceptMimesMiddleware.prototype, "use", null);
33
- PlatformAcceptMimesMiddleware = tslib_1.__decorate([
34
- (0, platform_middlewares_1.Middleware)({
35
- priority: -10
36
- })
37
- ], PlatformAcceptMimesMiddleware);
38
- exports.PlatformAcceptMimesMiddleware = PlatformAcceptMimesMiddleware;
39
- //# sourceMappingURL=PlatformAcceptMimesMiddleware.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformAcceptMimesMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/PlatformAcceptMimesMiddleware.ts"],"names":[],"mappings":";;;;AAAA,qCAAgC;AAChC,iCAAkC;AAClC,iDAA+C;AAC/C,qEAAyE;AACzE,2DAA8C;AAE9C;;;GAGG;AAII,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IAIjC,GAAG,CAAY,GAAY;QAChC,MAAM,EAAC,QAAQ,EAAE,OAAO,EAAC,GAAG,GAAG,CAAC;QAChC,MAAM,KAAK,GAAG,IAAA,WAAI,EAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAElF,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC3C,MAAM,IAAI,0BAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;SAC3C;IACH,CAAC;CACF,CAAA;AAXC;IAAC,IAAA,aAAQ,EAAC,aAAa,EAAE,EAAE,CAAC;;kEACN;AAEtB;IAAY,mBAAA,IAAA,yBAAO,GAAE,CAAA;;;;wDAOpB;AAXU,6BAA6B;IAHzC,IAAA,iCAAU,EAAC;QACV,QAAQ,EAAE,CAAC,EAAE;KACd,CAAC;GACW,6BAA6B,CAYzC;AAZY,sEAA6B"}
@@ -1,70 +0,0 @@
1
- "use strict";
2
- var PlatformMulterMiddleware_1;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.PlatformMulterMiddleware = exports.MulterException = void 0;
5
- const tslib_1 = require("tslib");
6
- const di_1 = require("@tsed/di");
7
- const exceptions_1 = require("@tsed/exceptions");
8
- const platform_middlewares_1 = require("@tsed/platform-middlewares");
9
- const platform_params_1 = require("@tsed/platform-params");
10
- const PlatformContext_js_1 = require("../domain/PlatformContext.js");
11
- const PlatformApplication_js_1 = require("../services/PlatformApplication.js");
12
- class MulterException extends exceptions_1.BadRequest {
13
- constructor(er) {
14
- super(er.message);
15
- this.origin = er;
16
- this.name = er.code;
17
- }
18
- }
19
- exports.MulterException = MulterException;
20
- /**
21
- * @middleware
22
- */
23
- let PlatformMulterMiddleware = PlatformMulterMiddleware_1 = class PlatformMulterMiddleware {
24
- async use(ctx) {
25
- try {
26
- const { fields, options = {} } = ctx.endpoint.get(PlatformMulterMiddleware_1);
27
- const settings = {
28
- ...this.settings,
29
- ...options
30
- };
31
- /* istanbul ignore next */
32
- if (settings.storage) {
33
- delete settings.dest;
34
- }
35
- const middleware = this.app.multer(settings).fields(this.getFields({ fields }));
36
- return await middleware(ctx.getRequest(), ctx.getResponse());
37
- }
38
- catch (er) {
39
- if (er.code) {
40
- throw new MulterException(er);
41
- }
42
- throw er;
43
- }
44
- }
45
- getFields(conf) {
46
- return conf.fields.map(({ name, maxCount }) => ({ name, maxCount }));
47
- }
48
- };
49
- tslib_1.__decorate([
50
- (0, di_1.Value)("multer", {}) // NOTE: don't use constant to getting multer configuration. See issue #1840
51
- ,
52
- tslib_1.__metadata("design:type", Object)
53
- ], PlatformMulterMiddleware.prototype, "settings", void 0);
54
- tslib_1.__decorate([
55
- (0, di_1.Inject)(),
56
- tslib_1.__metadata("design:type", PlatformApplication_js_1.PlatformApplication)
57
- ], PlatformMulterMiddleware.prototype, "app", void 0);
58
- tslib_1.__decorate([
59
- tslib_1.__param(0, (0, platform_params_1.Context)()),
60
- tslib_1.__metadata("design:type", Function),
61
- tslib_1.__metadata("design:paramtypes", [PlatformContext_js_1.PlatformContext]),
62
- tslib_1.__metadata("design:returntype", Promise)
63
- ], PlatformMulterMiddleware.prototype, "use", null);
64
- PlatformMulterMiddleware = PlatformMulterMiddleware_1 = tslib_1.__decorate([
65
- (0, platform_middlewares_1.Middleware)({
66
- priority: 10
67
- })
68
- ], PlatformMulterMiddleware);
69
- exports.PlatformMulterMiddleware = PlatformMulterMiddleware;
70
- //# sourceMappingURL=PlatformMulterMiddleware.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformMulterMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/PlatformMulterMiddleware.ts"],"names":[],"mappings":";;;;;AAAA,iCAAuC;AACvC,iDAA4C;AAC5C,qEAAyE;AACzE,2DAA8C;AAG9C,qEAA6D;AAC7D,+EAAuE;AAMvE,MAAa,eAAgB,SAAQ,uBAAU;IAC7C,YAAY,EAAe;QACzB,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC;IACtB,CAAC;CACF;AAND,0CAMC;AAED;;GAEG;AAII,IAAM,wBAAwB,gCAA9B,MAAM,wBAAwB;IAO7B,AAAN,KAAK,CAAC,GAAG,CAAY,GAAoB;QACvC,IAAI;YACF,MAAM,EAAC,MAAM,EAAE,OAAO,GAAG,EAAE,EAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,0BAAwB,CAAC,CAAC;YAC1E,MAAM,QAAQ,GAA2B;gBACvC,GAAG,IAAI,CAAC,QAAQ;gBAChB,GAAG,OAAO;aACX,CAAC;YAEF,0BAA0B;YAC1B,IAAI,QAAQ,CAAC,OAAO,EAAE;gBACpB,OAAO,QAAQ,CAAC,IAAI,CAAC;aACtB;YAED,MAAM,UAAU,GAAQ,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAC,MAAM,EAAC,CAAC,CAAC,CAAC;YAEnF,OAAO,MAAM,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;SAC9D;QAAC,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,CAAC,IAAI,EAAE;gBACX,MAAM,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;aAC/B;YAED,MAAM,EAAE,CAAC;SACV;IACH,CAAC;IAES,SAAS,CAAC,IAAwB;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAC,EAAE,EAAE,CAAC,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAC,CAAC,CAAC,CAAC;IACnE,CAAC;CACF,CAAA;AAlCC;IAAC,IAAA,UAAK,EAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,4EAA4E;;;0DACtD;AAE3C;IAAC,IAAA,WAAM,GAAE;sCACM,4CAAmB;qDAAC;AAE7B;IAAK,mBAAA,IAAA,yBAAO,GAAE,CAAA;;6CAAM,oCAAe;;mDAuBxC;AA9BU,wBAAwB;IAHpC,IAAA,iCAAU,EAAC;QACV,QAAQ,EAAE,EAAE;KACb,CAAC;GACW,wBAAwB,CAmCpC;AAnCY,4DAAwB"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FakeAdapter = void 0;
4
- var PlatformAdapter_js_1 = require("./PlatformAdapter.js");
5
- Object.defineProperty(exports, "FakeAdapter", { enumerable: true, get: function () { return PlatformAdapter_js_1.FakeAdapter; } });
6
- //# sourceMappingURL=FakeAdapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FakeAdapter.js","sourceRoot":"","sources":["../../../src/services/FakeAdapter.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AAAzC,iHAAA,WAAW,OAAA"}
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FakeResponse = void 0;
4
- const node_events_1 = require("node:events");
5
- class FakeResponse extends node_events_1.EventEmitter {
6
- constructor(opts = {}) {
7
- super();
8
- this.headers = {};
9
- this.locals = {};
10
- this.statusCode = 200;
11
- Object.assign(this, opts);
12
- }
13
- status(code) {
14
- this.statusCode = code;
15
- return this;
16
- }
17
- contentType(content) {
18
- this.set("content-type", content);
19
- }
20
- contentLength(content) {
21
- this.set("content-length", content);
22
- }
23
- redirect(status, path) {
24
- this.statusCode = status;
25
- this.set("location", path);
26
- }
27
- location(path) {
28
- this.set("location", path);
29
- }
30
- get(key) {
31
- return this.headers[key.toLowerCase()];
32
- }
33
- getHeaders() {
34
- return this.headers;
35
- }
36
- set(key, value) {
37
- this.headers[key.toLowerCase()] = value;
38
- return this;
39
- }
40
- setHeader(key, value) {
41
- this.headers[key.toLowerCase()] = value;
42
- return this;
43
- }
44
- send(data) {
45
- this.data = data;
46
- }
47
- json(data) {
48
- this.data = data;
49
- }
50
- write(chunk) {
51
- this.emit("data", chunk);
52
- }
53
- end(data) {
54
- data !== undefined && (this.data = data);
55
- this.emit("end");
56
- }
57
- }
58
- exports.FakeResponse = FakeResponse;
59
- //# sourceMappingURL=FakeResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FakeResponse.js","sourceRoot":"","sources":["../../../src/services/FakeResponse.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,MAAa,YAAa,SAAQ,0BAAY;IAM5C,YAAY,IAAI,GAAG,EAAE;QACnB,KAAK,EAAE,CAAC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AC;IACnB,CAAC;IAED,IAAI,CAAC,IAAS;QACZ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,KAAU;QACd,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,GAAG,CAAC,IAAS;QACX,IAAI,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;QAEzC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;CACF;AArED,oCAqEC"}
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Platform = void 0;
4
- const tslib_1 = require("tslib");
5
- const di_1 = require("@tsed/di");
6
- const platform_router_1 = require("@tsed/platform-router");
7
- const PlatformApplication_js_1 = require("./PlatformApplication.js");
8
- const PlatformHandler_js_1 = require("./PlatformHandler.js");
9
- /**
10
- * `Platform` is used to provide all routes collected by annotation `@Controller`.
11
- *
12
- * @platform
13
- */
14
- let Platform = class Platform {
15
- #layers;
16
- constructor(injector, platformApplication, platformRouters) {
17
- this.injector = injector;
18
- this.platformApplication = platformApplication;
19
- this.platformRouters = platformRouters;
20
- platformRouters.prebuild();
21
- }
22
- get app() {
23
- return this.platformApplication;
24
- }
25
- addRoutes(routes) {
26
- routes.forEach((routeSettings) => {
27
- this.addRoute(routeSettings.route, routeSettings.token);
28
- });
29
- }
30
- addRoute(route, token) {
31
- const provider = this.injector.getProvider(token);
32
- if (!provider || provider.hasParent()) {
33
- return this;
34
- }
35
- const router = this.platformRouters.from(provider.token);
36
- this.app.use(route, router);
37
- return this;
38
- }
39
- getLayers() {
40
- this.#layers = this.#layers || this.platformRouters.getLayers(this.app);
41
- return this.#layers;
42
- }
43
- /**
44
- * Get all controllers mounted on the application.
45
- * @returns {RouteController[]}
46
- */
47
- getMountedControllers() {
48
- const controllers = this.getLayers().reduce((controllers, layer) => {
49
- if (layer.isProvider()) {
50
- const route = String(layer.getBasePath());
51
- const key = `${layer.provider.toString()}:${route}`;
52
- if (!controllers.has(key)) {
53
- controllers.set(key, {
54
- route,
55
- routes: new Set(),
56
- provider: layer.provider
57
- });
58
- }
59
- controllers.get(key).routes.add(String(layer.path));
60
- }
61
- return controllers;
62
- }, new Map());
63
- return [...controllers.values()];
64
- }
65
- };
66
- Platform = tslib_1.__decorate([
67
- (0, di_1.Injectable)({
68
- scope: di_1.ProviderScope.SINGLETON,
69
- imports: [PlatformHandler_js_1.PlatformHandler]
70
- }),
71
- tslib_1.__metadata("design:paramtypes", [di_1.InjectorService,
72
- PlatformApplication_js_1.PlatformApplication,
73
- platform_router_1.PlatformRouters])
74
- ], Platform);
75
- exports.Platform = Platform;
76
- //# sourceMappingURL=Platform.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Platform.js","sourceRoot":"","sources":["../../../src/services/Platform.ts"],"names":[],"mappings":";;;;AAAA,iCAAuG;AACvG,2DAAqE;AAErE,qEAA6D;AAC7D,6DAAqD;AAErD;;;;GAIG;AAKI,IAAM,QAAQ,GAAd,MAAM,QAAQ;IACnB,OAAO,CAAkB;IAEzB,YACW,QAAyB,EACzB,mBAAwC,EACxC,eAAgC;QAFhC,aAAQ,GAAR,QAAQ,CAAiB;QACzB,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,oBAAe,GAAf,eAAe,CAAiB;QAEzC,eAAe,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAEM,SAAS,CAAC,MAAe;QAC9B,MAAM,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;YAC/B,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,QAAQ,CAAC,KAAa,EAAE,KA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,CAAC;aACtD;YAED,OAAO,WAAW,CAAC;QACrB,CAAC,EAAE,IAAI,GAAG,EAA2B,CAAC,CAAC;QAEvC,OAAO,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IACnC,CAAC;CACF,CAAA;AAnEY,QAAQ;IAJpB,IAAA,eAAU,EAAC;QACV,KAAK,EAAE,kBAAa,CAAC,SAAS;QAC9B,OAAO,EAAE,CAAC,oCAAe,CAAC;KAC3B,CAAC;6CAKqB,oBAAe;QACJ,4CAAmB;QACvB,iCAAe;GANhC,QAAQ,CAmEpB;AAnEY,4BAAQ"}
@@ -1,82 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FakeAdapter = exports.PlatformAdapter = void 0;
4
- const di_1 = require("@tsed/di");
5
- const createHttpServer_js_1 = require("../utils/createHttpServer.js");
6
- const createHttpsServer_js_1 = require("../utils/createHttpsServer.js");
7
- class PlatformAdapter {
8
- constructor(injector) {
9
- this.injector = injector;
10
- }
11
- get app() {
12
- return this.injector.get("PlatformApplication");
13
- }
14
- getServers() {
15
- return [(0, createHttpServer_js_1.createHttpServer)(this.injector, this.app.callback()), (0, createHttpsServer_js_1.createHttpsServer)(this.injector, this.app.callback())].filter(Boolean);
16
- }
17
- onInit() {
18
- return Promise.resolve();
19
- }
20
- beforeLoadRoutes() {
21
- return Promise.resolve();
22
- }
23
- afterLoadRoutes() {
24
- return Promise.resolve();
25
- }
26
- }
27
- exports.PlatformAdapter = PlatformAdapter;
28
- class FakeAdapter extends PlatformAdapter {
29
- constructor() {
30
- super(...arguments);
31
- this.providers = [];
32
- }
33
- static { this.NAME = "FAKE_ADAPTER"; }
34
- static createFakeRawDriver() {
35
- // istanbul ignore next
36
- function FakeRawDriver() { }
37
- // istanbul ignore next
38
- function use() {
39
- return this;
40
- }
41
- FakeRawDriver.use = use;
42
- FakeRawDriver.all = use;
43
- FakeRawDriver.get = use;
44
- FakeRawDriver.patch = use;
45
- FakeRawDriver.post = use;
46
- FakeRawDriver.put = use;
47
- FakeRawDriver.head = use;
48
- FakeRawDriver.delete = use;
49
- FakeRawDriver.options = use;
50
- return FakeRawDriver;
51
- }
52
- createApp() {
53
- const app = FakeAdapter.createFakeRawDriver();
54
- return {
55
- app,
56
- callback() {
57
- return app;
58
- }
59
- };
60
- }
61
- multipart(options) {
62
- return {};
63
- }
64
- statics(endpoint, options) {
65
- return {};
66
- }
67
- bodyParser(type) {
68
- return () => { };
69
- }
70
- mapLayers(layers) { }
71
- mapHandler(handler) {
72
- return handler;
73
- }
74
- useContext() { }
75
- }
76
- exports.FakeAdapter = FakeAdapter;
77
- (0, di_1.registerProvider)({
78
- provide: PlatformAdapter,
79
- deps: [di_1.InjectorService],
80
- useClass: FakeAdapter
81
- });
82
- //# sourceMappingURL=PlatformAdapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformAdapter.js","sourceRoot":"","sources":["../../../src/services/PlatformAdapter.ts"],"names":[],"mappings":";;;AACA,iCAAyE;AAMzE,sEAA8D;AAC9D,wEAAgE;AAIhE,MAAsB,eAAe;IAOnC,YAAsB,QAAyB;QAAzB,aAAQ,GAAR,QAAQ,CAAiB;IAAG,CAAC;IAEnD,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAA2B,qBAAqB,CAAE,CAAC;IAC7E,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAA,sCAAgB,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAA,wCAAiB,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CACzH,OAAO,CACC,CAAC;IACb,CAAC;IAED,MAAM;QACJ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,gBAAgB;QACd,OAAO,OAAO,CAAC,OAAO,EAAE,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C;IACjB,CAAC;IAED,UAAU,KAAI,CAAC;;AAtDjB,kCAuDC;AAED,IAAA,qBAAgB,EAAC;IACf,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,CAAC,oBAAe,CAAC;IACvB,QAAQ,EAAE,WAAW;CACtB,CAAC,CAAC"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatformApplication = void 0;
4
- const tslib_1 = require("tslib");
5
- const di_1 = require("@tsed/di");
6
- const platform_router_1 = require("@tsed/platform-router");
7
- const PlatformAdapter_js_1 = require("./PlatformAdapter.js");
8
- /**
9
- * `PlatformApplication` is used to provide all routes collected by annotation `@Controller`.
10
- *
11
- * @platform
12
- */
13
- let PlatformApplication = class PlatformApplication extends platform_router_1.PlatformRouter {
14
- constructor(adapter, injector) {
15
- super(injector);
16
- this.adapter = adapter;
17
- this.injector = injector;
18
- const { app, callback } = adapter.createApp();
19
- this.rawApp = app;
20
- this.rawCallback = callback;
21
- }
22
- getApp() {
23
- return this.rawApp;
24
- }
25
- multer(options) {
26
- return this.adapter.multipart(options);
27
- }
28
- callback(req, res) {
29
- if (req && res) {
30
- return this.callback()(req, res);
31
- }
32
- return this.rawCallback();
33
- }
34
- };
35
- PlatformApplication = tslib_1.__decorate([
36
- (0, di_1.Injectable)({
37
- scope: di_1.ProviderScope.SINGLETON,
38
- alias: "PlatformApplication"
39
- }),
40
- tslib_1.__metadata("design:paramtypes", [PlatformAdapter_js_1.PlatformAdapter,
41
- di_1.InjectorService])
42
- ], PlatformApplication);
43
- exports.PlatformApplication = PlatformApplication;
44
- //# sourceMappingURL=PlatformApplication.js.map