@tsed/common 7.0.0-alpha.2 → 7.0.0-beta.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.
- package/lib/cjs/builder/PlatformBuilder.js +281 -0
- package/lib/cjs/builder/PlatformBuilder.js.map +1 -0
- package/lib/cjs/builder/PlatformControllerBuilder.js +82 -0
- package/lib/cjs/builder/PlatformControllerBuilder.js.map +1 -0
- package/lib/cjs/config/interfaces/ConverterSettings.js +3 -0
- package/lib/cjs/config/interfaces/ConverterSettings.js.map +1 -0
- package/lib/cjs/config/interfaces/PlatformLoggerSettings.js +3 -0
- package/lib/cjs/config/interfaces/PlatformLoggerSettings.js.map +1 -0
- package/lib/cjs/config/interfaces/PlatformMulterSettings.js +3 -0
- package/lib/cjs/config/interfaces/PlatformMulterSettings.js.map +1 -0
- package/lib/cjs/config/interfaces/PlatformStaticsSettings.js +3 -0
- package/lib/cjs/config/interfaces/PlatformStaticsSettings.js.map +1 -0
- package/lib/cjs/config/services/PlatformConfiguration.js +187 -0
- package/lib/cjs/config/services/PlatformConfiguration.js.map +1 -0
- package/lib/cjs/constants/routerOptions.js +5 -0
- package/lib/cjs/constants/routerOptions.js.map +1 -0
- package/lib/cjs/decorators/multer/multerFileSize.js +35 -0
- package/lib/cjs/decorators/multer/multerFileSize.js.map +1 -0
- package/lib/cjs/decorators/multer/multerOptions.js +52 -0
- package/lib/cjs/decorators/multer/multerOptions.js.map +1 -0
- package/lib/cjs/decorators/multer/multipartFile.js +78 -0
- package/lib/cjs/decorators/multer/multipartFile.js.map +1 -0
- package/lib/cjs/decorators/params/error.js +20 -0
- package/lib/cjs/decorators/params/error.js.map +1 -0
- package/lib/cjs/decorators/params/next.js +21 -0
- package/lib/cjs/decorators/params/next.js.map +1 -0
- package/lib/cjs/decorators/params/request.js +39 -0
- package/lib/cjs/decorators/params/request.js.map +1 -0
- package/lib/cjs/decorators/params/response.js +33 -0
- package/lib/cjs/decorators/params/response.js.map +1 -0
- package/lib/cjs/domain/AnyToPromiseWithCtx.js +27 -0
- package/lib/cjs/domain/AnyToPromiseWithCtx.js.map +1 -0
- package/lib/cjs/domain/ControllerProvider.js +51 -0
- package/lib/cjs/domain/ControllerProvider.js.map +1 -0
- package/lib/cjs/domain/EndpointMetadata.js +6 -0
- package/lib/cjs/domain/EndpointMetadata.js.map +1 -0
- package/lib/cjs/domain/HandlerMetadata.js +57 -0
- package/lib/cjs/domain/HandlerMetadata.js.map +1 -0
- package/lib/cjs/domain/PlatformContext.js +92 -0
- package/lib/cjs/domain/PlatformContext.js.map +1 -0
- package/lib/cjs/domain/PlatformRouteDetails.js +24 -0
- package/lib/cjs/domain/PlatformRouteDetails.js.map +1 -0
- package/lib/cjs/exports.js +31 -0
- package/lib/cjs/exports.js.map +1 -0
- package/lib/cjs/index.js +68 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/interfaces/AfterInit.js +3 -0
- package/lib/cjs/interfaces/AfterInit.js.map +1 -0
- package/lib/cjs/interfaces/AfterListen.js +3 -0
- package/lib/cjs/interfaces/AfterListen.js.map +1 -0
- package/lib/cjs/interfaces/AfterRoutesInit.js +3 -0
- package/lib/cjs/interfaces/AfterRoutesInit.js.map +1 -0
- package/lib/cjs/interfaces/BeforeInit.js +3 -0
- package/lib/cjs/interfaces/BeforeInit.js.map +1 -0
- package/lib/cjs/interfaces/BeforeListen.js +3 -0
- package/lib/cjs/interfaces/BeforeListen.js.map +1 -0
- package/lib/cjs/interfaces/BeforeRoutesInit.js +3 -0
- package/lib/cjs/interfaces/BeforeRoutesInit.js.map +1 -0
- package/lib/cjs/interfaces/HandlerType.js +17 -0
- package/lib/cjs/interfaces/HandlerType.js.map +1 -0
- package/lib/cjs/interfaces/IncomingEvent.js +3 -0
- package/lib/cjs/interfaces/IncomingEvent.js.map +1 -0
- package/lib/cjs/interfaces/OnReady.js +3 -0
- package/lib/cjs/interfaces/OnReady.js.map +1 -0
- package/lib/cjs/interfaces/OnRequest.js +3 -0
- package/lib/cjs/interfaces/OnRequest.js.map +1 -0
- package/lib/cjs/interfaces/OnResponse.js +3 -0
- package/lib/cjs/interfaces/OnResponse.js.map +1 -0
- package/lib/cjs/interfaces/OnRoutesInit.js +3 -0
- package/lib/cjs/interfaces/OnRoutesInit.js.map +1 -0
- package/lib/cjs/interfaces/PlatformRouteOptions.js +3 -0
- package/lib/cjs/interfaces/PlatformRouteOptions.js.map +1 -0
- package/lib/cjs/interfaces/ResponseErrorObject.js +3 -0
- package/lib/cjs/interfaces/ResponseErrorObject.js.map +1 -0
- package/lib/cjs/interfaces/Route.js +3 -0
- package/lib/cjs/interfaces/Route.js.map +1 -0
- package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js +37 -0
- package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -0
- package/lib/cjs/middlewares/PlatformMulterMiddleware.js +67 -0
- package/lib/cjs/middlewares/PlatformMulterMiddleware.js.map +1 -0
- package/lib/cjs/middlewares/__mock__/FakeCtrl.js +12 -0
- package/lib/cjs/middlewares/__mock__/FakeCtrl.js.map +1 -0
- package/lib/cjs/middlewares/bindEndpointMiddleware.js +13 -0
- package/lib/cjs/middlewares/bindEndpointMiddleware.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/services/FakeAdapter.js +55 -0
- package/lib/cjs/services/FakeAdapter.js.map +1 -0
- package/lib/cjs/services/Platform.js +128 -0
- package/lib/cjs/services/Platform.js.map +1 -0
- package/lib/cjs/services/PlatformAdapter.js +14 -0
- package/lib/cjs/services/PlatformAdapter.js.map +1 -0
- package/lib/cjs/services/PlatformApplication.js +32 -0
- package/lib/cjs/services/PlatformApplication.js.map +1 -0
- package/lib/cjs/services/PlatformHandler.js +235 -0
- package/lib/cjs/services/PlatformHandler.js.map +1 -0
- package/lib/cjs/services/PlatformMiddlewaresChain.js +75 -0
- package/lib/cjs/services/PlatformMiddlewaresChain.js.map +1 -0
- package/lib/cjs/services/PlatformRequest.js +138 -0
- package/lib/cjs/services/PlatformRequest.js.map +1 -0
- package/lib/cjs/services/PlatformResponse.js +271 -0
- package/lib/cjs/services/PlatformResponse.js.map +1 -0
- package/lib/cjs/services/PlatformRouter.js +108 -0
- package/lib/cjs/services/PlatformRouter.js.map +1 -0
- package/lib/cjs/services/PlatformTest.js +173 -0
- package/lib/cjs/services/PlatformTest.js.map +1 -0
- package/lib/cjs/utils/__mock__/Test1.js +8 -0
- package/lib/cjs/utils/__mock__/Test1.js.map +1 -0
- package/lib/cjs/utils/__mock__/Test2.js +8 -0
- package/lib/cjs/utils/__mock__/Test2.js.map +1 -0
- package/lib/cjs/utils/__mock__/controllers/rest/TestCtrl.js +12 -0
- package/lib/cjs/utils/__mock__/controllers/rest/TestCtrl.js.map +1 -0
- package/lib/cjs/utils/__mock__/module1/Module1.js +19 -0
- package/lib/cjs/utils/__mock__/module1/Module1.js.map +1 -0
- package/lib/cjs/utils/__mock__/module1/controllers/M1Ctrl1.js +17 -0
- package/lib/cjs/utils/__mock__/module1/controllers/M1Ctrl1.js.map +1 -0
- package/lib/cjs/utils/__mock__/module1/services/M1Service.js +17 -0
- package/lib/cjs/utils/__mock__/module1/services/M1Service.js.map +1 -0
- package/lib/cjs/utils/__mock__/module1/submodule/SubModule.js +15 -0
- package/lib/cjs/utils/__mock__/module1/submodule/SubModule.js.map +1 -0
- package/lib/cjs/utils/__mock__/module1/submodule/SubService.js +12 -0
- package/lib/cjs/utils/__mock__/module1/submodule/SubService.js.map +1 -0
- package/lib/cjs/utils/__mock__/module2/Module2.js +18 -0
- package/lib/cjs/utils/__mock__/module2/Module2.js.map +1 -0
- package/lib/cjs/utils/__mock__/module2/controllers/M2Ctrl.js +12 -0
- package/lib/cjs/utils/__mock__/module2/controllers/M2Ctrl.js.map +1 -0
- package/lib/cjs/utils/createContext.js +38 -0
- package/lib/cjs/utils/createContext.js.map +1 -0
- package/lib/cjs/utils/createHandlerMetadata.js +49 -0
- package/lib/cjs/utils/createHandlerMetadata.js.map +1 -0
- package/lib/cjs/utils/createHttpServer.js +29 -0
- package/lib/cjs/utils/createHttpServer.js.map +1 -0
- package/lib/cjs/utils/createHttpsServer.js +29 -0
- package/lib/cjs/utils/createHttpsServer.js.map +1 -0
- package/lib/cjs/utils/createInjector.js +46 -0
- package/lib/cjs/utils/createInjector.js.map +1 -0
- package/lib/cjs/utils/getConfiguration.js +46 -0
- package/lib/cjs/utils/getConfiguration.js.map +1 -0
- package/lib/cjs/utils/getStaticsOptions.js +21 -0
- package/lib/cjs/utils/getStaticsOptions.js.map +1 -0
- package/lib/cjs/utils/listenServer.js +21 -0
- package/lib/cjs/utils/listenServer.js.map +1 -0
- package/lib/cjs/utils/mapReturnedResponse.js +15 -0
- package/lib/cjs/utils/mapReturnedResponse.js.map +1 -0
- package/lib/cjs/utils/printRoutes.js +36 -0
- package/lib/cjs/utils/printRoutes.js.map +1 -0
- package/lib/cjs/utils/setResponseHeaders.js +35 -0
- package/lib/cjs/utils/setResponseHeaders.js.map +1 -0
- package/lib/cjs/utils/useCtxHandler.js +15 -0
- package/lib/cjs/utils/useCtxHandler.js.map +1 -0
- package/lib/esm/builder/PlatformBuilder.js +277 -0
- package/lib/esm/builder/PlatformBuilder.js.map +1 -0
- package/lib/esm/builder/PlatformControllerBuilder.js +76 -0
- package/lib/esm/builder/PlatformControllerBuilder.js.map +1 -0
- package/lib/esm/config/interfaces/ConverterSettings.js +2 -0
- package/lib/esm/config/interfaces/ConverterSettings.js.map +1 -0
- package/lib/esm/config/interfaces/PlatformLoggerSettings.js +2 -0
- package/lib/esm/config/interfaces/PlatformLoggerSettings.js.map +1 -0
- package/lib/esm/config/interfaces/PlatformMulterSettings.js +2 -0
- package/lib/esm/config/interfaces/PlatformMulterSettings.js.map +1 -0
- package/lib/esm/config/interfaces/PlatformStaticsSettings.js +2 -0
- package/lib/esm/config/interfaces/PlatformStaticsSettings.js.map +1 -0
- package/lib/esm/config/services/PlatformConfiguration.js +184 -0
- package/lib/esm/config/services/PlatformConfiguration.js.map +1 -0
- package/lib/esm/constants/routerOptions.js +2 -0
- package/lib/esm/constants/routerOptions.js.map +1 -0
- package/lib/esm/decorators/multer/multerFileSize.js +31 -0
- package/lib/esm/decorators/multer/multerFileSize.js.map +1 -0
- package/lib/esm/decorators/multer/multerOptions.js +48 -0
- package/lib/esm/decorators/multer/multerOptions.js.map +1 -0
- package/lib/esm/decorators/multer/multipartFile.js +74 -0
- package/lib/esm/decorators/multer/multipartFile.js.map +1 -0
- package/lib/esm/decorators/params/error.js +16 -0
- package/lib/esm/decorators/params/error.js.map +1 -0
- package/lib/esm/decorators/params/next.js +17 -0
- package/lib/esm/decorators/params/next.js.map +1 -0
- package/lib/esm/decorators/params/request.js +34 -0
- package/lib/esm/decorators/params/request.js.map +1 -0
- package/lib/esm/decorators/params/response.js +28 -0
- package/lib/esm/decorators/params/response.js.map +1 -0
- package/lib/esm/domain/AnyToPromiseWithCtx.js +23 -0
- package/lib/esm/domain/AnyToPromiseWithCtx.js.map +1 -0
- package/lib/esm/domain/ControllerProvider.js +47 -0
- package/lib/esm/domain/ControllerProvider.js.map +1 -0
- package/lib/esm/domain/EndpointMetadata.js +2 -0
- package/lib/esm/domain/EndpointMetadata.js.map +1 -0
- package/lib/esm/domain/HandlerMetadata.js +53 -0
- package/lib/esm/domain/HandlerMetadata.js.map +1 -0
- package/lib/esm/domain/PlatformContext.js +88 -0
- package/lib/esm/domain/PlatformContext.js.map +1 -0
- package/lib/esm/domain/PlatformRouteDetails.js +20 -0
- package/lib/esm/domain/PlatformRouteDetails.js.map +1 -0
- package/lib/esm/exports.js +13 -0
- package/lib/esm/exports.js.map +1 -0
- package/lib/esm/index.js +65 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/interfaces/AfterInit.js +2 -0
- package/lib/esm/interfaces/AfterInit.js.map +1 -0
- package/lib/esm/interfaces/AfterListen.js +2 -0
- package/lib/esm/interfaces/AfterListen.js.map +1 -0
- package/lib/esm/interfaces/AfterRoutesInit.js +2 -0
- package/lib/esm/interfaces/AfterRoutesInit.js.map +1 -0
- package/lib/esm/interfaces/BeforeInit.js +2 -0
- package/lib/esm/interfaces/BeforeInit.js.map +1 -0
- package/lib/esm/interfaces/BeforeListen.js +2 -0
- package/lib/esm/interfaces/BeforeListen.js.map +1 -0
- package/lib/esm/interfaces/BeforeRoutesInit.js +2 -0
- package/lib/esm/interfaces/BeforeRoutesInit.js.map +1 -0
- package/lib/esm/interfaces/HandlerType.js +14 -0
- package/lib/esm/interfaces/HandlerType.js.map +1 -0
- package/lib/esm/interfaces/IncomingEvent.js +2 -0
- package/lib/esm/interfaces/IncomingEvent.js.map +1 -0
- package/lib/esm/interfaces/OnReady.js +2 -0
- package/lib/esm/interfaces/OnReady.js.map +1 -0
- package/lib/esm/interfaces/OnRequest.js +2 -0
- package/lib/esm/interfaces/OnRequest.js.map +1 -0
- package/lib/esm/interfaces/OnResponse.js +2 -0
- package/lib/esm/interfaces/OnResponse.js.map +1 -0
- package/lib/esm/interfaces/OnRoutesInit.js +2 -0
- package/lib/esm/interfaces/OnRoutesInit.js.map +1 -0
- package/lib/esm/interfaces/PlatformRouteOptions.js +2 -0
- package/lib/esm/interfaces/PlatformRouteOptions.js.map +1 -0
- package/lib/esm/interfaces/ResponseErrorObject.js +2 -0
- package/lib/esm/interfaces/ResponseErrorObject.js.map +1 -0
- package/lib/esm/interfaces/Route.js +2 -0
- package/lib/esm/interfaces/Route.js.map +1 -0
- package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js +34 -0
- package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -0
- package/lib/esm/middlewares/PlatformMulterMiddleware.js +63 -0
- package/lib/esm/middlewares/PlatformMulterMiddleware.js.map +1 -0
- package/lib/esm/middlewares/__mock__/FakeCtrl.js +9 -0
- package/lib/esm/middlewares/__mock__/FakeCtrl.js.map +1 -0
- package/lib/esm/middlewares/bindEndpointMiddleware.js +9 -0
- package/lib/esm/middlewares/bindEndpointMiddleware.js.map +1 -0
- package/lib/esm/package.json +3 -0
- package/lib/esm/services/FakeAdapter.js +51 -0
- package/lib/esm/services/FakeAdapter.js.map +1 -0
- package/lib/esm/services/Platform.js +125 -0
- package/lib/esm/services/Platform.js.map +1 -0
- package/lib/esm/services/PlatformAdapter.js +10 -0
- package/lib/esm/services/PlatformAdapter.js.map +1 -0
- package/lib/esm/services/PlatformApplication.js +29 -0
- package/lib/esm/services/PlatformApplication.js.map +1 -0
- package/lib/esm/services/PlatformHandler.js +232 -0
- package/lib/esm/services/PlatformHandler.js.map +1 -0
- package/lib/esm/services/PlatformMiddlewaresChain.js +72 -0
- package/lib/esm/services/PlatformMiddlewaresChain.js.map +1 -0
- package/lib/esm/services/PlatformRequest.js +135 -0
- package/lib/esm/services/PlatformRequest.js.map +1 -0
- package/lib/esm/services/PlatformResponse.js +268 -0
- package/lib/esm/services/PlatformResponse.js.map +1 -0
- package/lib/esm/services/PlatformRouter.js +105 -0
- package/lib/esm/services/PlatformRouter.js.map +1 -0
- package/lib/esm/services/PlatformTest.js +168 -0
- package/lib/esm/services/PlatformTest.js.map +1 -0
- package/lib/esm/utils/__mock__/Test1.js +4 -0
- package/lib/esm/utils/__mock__/Test1.js.map +1 -0
- package/lib/esm/utils/__mock__/Test2.js +4 -0
- package/lib/esm/utils/__mock__/Test2.js.map +1 -0
- package/lib/esm/utils/__mock__/controllers/rest/TestCtrl.js +9 -0
- package/lib/esm/utils/__mock__/controllers/rest/TestCtrl.js.map +1 -0
- package/lib/esm/utils/__mock__/module1/Module1.js +16 -0
- package/lib/esm/utils/__mock__/module1/Module1.js.map +1 -0
- package/lib/esm/utils/__mock__/module1/controllers/M1Ctrl1.js +14 -0
- package/lib/esm/utils/__mock__/module1/controllers/M1Ctrl1.js.map +1 -0
- package/lib/esm/utils/__mock__/module1/services/M1Service.js +14 -0
- package/lib/esm/utils/__mock__/module1/services/M1Service.js.map +1 -0
- package/lib/esm/utils/__mock__/module1/submodule/SubModule.js +12 -0
- package/lib/esm/utils/__mock__/module1/submodule/SubModule.js.map +1 -0
- package/lib/esm/utils/__mock__/module1/submodule/SubService.js +9 -0
- package/lib/esm/utils/__mock__/module1/submodule/SubService.js.map +1 -0
- package/lib/esm/utils/__mock__/module2/Module2.js +15 -0
- package/lib/esm/utils/__mock__/module2/Module2.js.map +1 -0
- package/lib/esm/utils/__mock__/module2/controllers/M2Ctrl.js +9 -0
- package/lib/esm/utils/__mock__/module2/controllers/M2Ctrl.js.map +1 -0
- package/lib/esm/utils/createContext.js +34 -0
- package/lib/esm/utils/createContext.js.map +1 -0
- package/lib/esm/utils/createHandlerMetadata.js +45 -0
- package/lib/esm/utils/createHandlerMetadata.js.map +1 -0
- package/lib/esm/utils/createHttpServer.js +24 -0
- package/lib/esm/utils/createHttpServer.js.map +1 -0
- package/lib/esm/utils/createHttpsServer.js +24 -0
- package/lib/esm/utils/createHttpsServer.js.map +1 -0
- package/lib/esm/utils/createInjector.js +42 -0
- package/lib/esm/utils/createInjector.js.map +1 -0
- package/lib/esm/utils/getConfiguration.js +42 -0
- package/lib/esm/utils/getConfiguration.js.map +1 -0
- package/lib/esm/utils/getStaticsOptions.js +17 -0
- package/lib/esm/utils/getStaticsOptions.js.map +1 -0
- package/lib/esm/utils/listenServer.js +17 -0
- package/lib/esm/utils/listenServer.js.map +1 -0
- package/lib/esm/utils/mapReturnedResponse.js +11 -0
- package/lib/esm/utils/mapReturnedResponse.js.map +1 -0
- package/lib/esm/utils/printRoutes.js +32 -0
- package/lib/esm/utils/printRoutes.js.map +1 -0
- package/lib/esm/utils/setResponseHeaders.js +31 -0
- package/lib/esm/utils/setResponseHeaders.js.map +1 -0
- package/lib/esm/utils/useCtxHandler.js +11 -0
- package/lib/esm/utils/useCtxHandler.js.map +1 -0
- package/lib/{builder → types/builder}/PlatformBuilder.d.ts +30 -34
- package/lib/types/builder/PlatformControllerBuilder.d.ts +18 -0
- package/lib/{config → types/config}/interfaces/ConverterSettings.d.ts +0 -0
- package/lib/{config → types/config}/interfaces/PlatformLoggerSettings.d.ts +0 -0
- package/lib/types/config/interfaces/PlatformMulterSettings.d.ts +14 -0
- package/lib/{config → types/config}/interfaces/PlatformStaticsSettings.d.ts +1 -0
- package/lib/{config → types/config}/services/PlatformConfiguration.d.ts +24 -17
- package/lib/{constants → types/constants}/routerOptions.d.ts +0 -0
- package/lib/{decorators → types/decorators}/multer/multerFileSize.d.ts +0 -0
- package/lib/{decorators → types/decorators}/multer/multerOptions.d.ts +0 -0
- package/lib/{decorators → types/decorators}/multer/multipartFile.d.ts +0 -0
- package/lib/{decorators → types/decorators}/params/error.d.ts +0 -0
- package/lib/{decorators → types/decorators}/params/next.d.ts +0 -0
- package/lib/{decorators → types/decorators}/params/request.d.ts +0 -0
- package/lib/{decorators → types/decorators}/params/response.d.ts +0 -0
- package/lib/{domain → types/domain}/AnyToPromiseWithCtx.d.ts +0 -0
- package/lib/types/domain/ControllerProvider.d.ts +24 -0
- package/lib/types/domain/EndpointMetadata.d.ts +1 -0
- package/lib/{domain → types/domain}/HandlerMetadata.d.ts +2 -2
- package/lib/{domain → types/domain}/PlatformContext.d.ts +1 -1
- package/lib/types/domain/PlatformRouteDetails.d.ts +22 -0
- package/lib/types/exports.d.ts +12 -0
- package/lib/types/index.d.ts +64 -0
- package/lib/{interfaces → types/interfaces}/AfterInit.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/AfterListen.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/AfterRoutesInit.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/BeforeInit.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/BeforeListen.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/BeforeRoutesInit.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/HandlerType.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/IncomingEvent.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/OnReady.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/OnRequest.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/OnResponse.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/OnRoutesInit.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/PlatformRouteOptions.d.ts +5 -3
- package/lib/{interfaces → types/interfaces}/ResponseErrorObject.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/Route.d.ts +0 -0
- package/lib/{middlewares → types/middlewares}/PlatformAcceptMimesMiddleware.d.ts +0 -0
- package/lib/{middlewares → types/middlewares}/PlatformMulterMiddleware.d.ts +8 -3
- package/lib/{middlewares/data → types/middlewares/__mock__}/FakeCtrl.d.ts +0 -0
- package/lib/types/middlewares/bindEndpointMiddleware.d.ts +6 -0
- package/lib/types/services/FakeAdapter.d.ts +30 -0
- package/lib/{services → types/services}/Platform.d.ts +22 -7
- package/lib/types/services/PlatformAdapter.d.ts +47 -0
- package/lib/{services → types/services}/PlatformApplication.d.ts +3 -3
- package/lib/{services → types/services}/PlatformHandler.d.ts +1 -1
- package/lib/types/services/PlatformMiddlewaresChain.d.ts +10 -0
- package/lib/{services → types/services}/PlatformRequest.d.ts +2 -1
- package/lib/{services → types/services}/PlatformResponse.d.ts +10 -10
- package/lib/{services → types/services}/PlatformRouter.d.ts +12 -8
- package/lib/{services → types/services}/PlatformTest.d.ts +6 -5
- package/lib/types/utils/__mock__/Test1.d.ts +3 -0
- package/lib/types/utils/__mock__/Test2.d.ts +3 -0
- package/lib/types/utils/__mock__/controllers/rest/TestCtrl.d.ts +2 -0
- package/lib/types/utils/__mock__/module1/Module1.d.ts +2 -0
- package/lib/types/utils/__mock__/module1/controllers/M1Ctrl1.d.ts +5 -0
- package/lib/types/utils/__mock__/module1/services/M1Service.d.ts +5 -0
- package/lib/types/utils/__mock__/module1/submodule/SubModule.d.ts +2 -0
- package/lib/types/utils/__mock__/module1/submodule/SubService.d.ts +2 -0
- package/lib/types/utils/__mock__/module2/Module2.d.ts +2 -0
- package/lib/types/utils/__mock__/module2/controllers/M2Ctrl.d.ts +2 -0
- package/lib/{utils → types/utils}/createContext.d.ts +0 -0
- package/lib/{utils → types/utils}/createHandlerMetadata.d.ts +1 -1
- package/lib/types/utils/createHttpServer.d.ts +4 -0
- package/lib/types/utils/createHttpsServer.d.ts +5 -0
- package/lib/types/utils/createInjector.d.ts +9 -0
- package/lib/types/utils/getConfiguration.d.ts +2 -0
- package/lib/types/utils/getStaticsOptions.d.ts +5 -0
- package/lib/types/utils/listenServer.d.ts +7 -0
- package/lib/{utils → types/utils}/mapReturnedResponse.d.ts +0 -0
- package/lib/{utils → types/utils}/printRoutes.d.ts +0 -0
- package/lib/{utils → types/utils}/setResponseHeaders.d.ts +0 -0
- package/lib/{utils → types/utils}/useCtxHandler.d.ts +0 -0
- package/package.json +47 -34
- package/readme.md +50 -57
- package/tsconfig.compile.esm.json +13 -0
- package/lib/PlatformModule.d.ts +0 -15
- package/lib/builder/PlatformControllerBuilder.d.ts +0 -19
- package/lib/config/index.d.ts +0 -3
- package/lib/config/interfaces/EndpointDirectoriesSettings.d.ts +0 -3
- package/lib/config/interfaces/PlatformMulterSettings.d.ts +0 -138
- package/lib/config/interfaces/index.d.ts +0 -84
- package/lib/decorators/httpServer.d.ts +0 -27
- package/lib/decorators/httpsServer.d.ts +0 -27
- package/lib/decorators/index.d.ts +0 -13
- package/lib/decorators/method/acceptMime.d.ts +0 -19
- package/lib/decorators/method/endpointFn.d.ts +0 -8
- package/lib/decorators/method/location.d.ts +0 -1
- package/lib/decorators/method/redirect.d.ts +0 -1
- package/lib/decorators/method/route.d.ts +0 -1
- package/lib/decorators/multer/index.d.ts +0 -3
- package/lib/domain/ControllerProvider.d.ts +0 -53
- package/lib/domain/EndpointMetadata.d.ts +0 -88
- package/lib/domain/PlatformRouteDetails.d.ts +0 -29
- package/lib/domain/index.d.ts +0 -6
- package/lib/index.d.ts +0 -22
- package/lib/index.js +0 -3651
- package/lib/index.js.map +0 -1
- package/lib/index.modern.js +0 -3464
- package/lib/index.modern.js.map +0 -1
- package/lib/interfaces/PathType.d.ts +0 -1
- package/lib/interfaces/PlatformRouterMethods.d.ts +0 -10
- package/lib/interfaces/index.d.ts +0 -17
- package/lib/middlewares/bindEndpointMiddleware.d.ts +0 -5
- package/lib/middlewares/index.d.ts +0 -3
- package/lib/registries/ControllerRegistry.d.ts +0 -1
- package/lib/services/FakeRawDriver.d.ts +0 -15
- package/lib/services/index.d.ts +0 -7
- package/lib/utils/createHttpServer.d.ts +0 -3
- package/lib/utils/createHttpsServer.d.ts +0 -3
- package/lib/utils/createInjector.d.ts +0 -2
- package/lib/utils/createPlatformApplication.d.ts +0 -2
- package/lib/utils/getControllerPath.d.ts +0 -2
- package/lib/utils/index.d.ts +0 -8
- package/lib/utils/listenServer.d.ts +0 -10
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getValue } from "@tsed/core";
|
|
2
|
+
function mapOptions(options) {
|
|
3
|
+
const opts = typeof options === "string" ? { root: options } : options;
|
|
4
|
+
return {
|
|
5
|
+
...opts,
|
|
6
|
+
hook: getValue(opts, "hook", "$afterRoutesInit")
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export function getStaticsOptions(statics) {
|
|
10
|
+
return Object.entries(statics || {}).reduce((statics, [path, items]) => {
|
|
11
|
+
[].concat(items).forEach((options) => {
|
|
12
|
+
statics.push({ path, options: mapOptions(options) });
|
|
13
|
+
});
|
|
14
|
+
return statics;
|
|
15
|
+
}, []);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=getStaticsOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getStaticsOptions.js","sourceRoot":"","sources":["../../../src/utils/getStaticsOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAGpC,SAAS,UAAU,CAAC,OAAY;IAC9B,MAAM,IAAI,GAA2B,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAC7F,OAAO;QACL,GAAG,IAAI;QACP,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,kBAAkB,CAAC;KACjD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAiC;IACjE,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;QACrE,EAAE,CAAC,MAAM,CAAC,KAAY,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC1C,OAAO,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,EAAC,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC,EAAE,EAAuD,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import {getValue} from \"@tsed/core\";\nimport {PlatformStaticsOptions, PlatformStaticsSettings} from \"../config/interfaces/PlatformStaticsSettings\";\n\nfunction mapOptions(options: any): any {\n const opts: PlatformStaticsOptions = typeof options === \"string\" ? {root: options} : options;\n return {\n ...opts,\n hook: getValue(opts, \"hook\", \"$afterRoutesInit\")\n };\n}\n\nexport function getStaticsOptions(statics?: PlatformStaticsSettings): {path: string; options: PlatformStaticsOptions}[] {\n return Object.entries(statics || {}).reduce((statics, [path, items]) => {\n [].concat(items as any).forEach((options) => {\n statics.push({path, options: mapOptions(options)});\n });\n\n return statics;\n }, [] as {path: string; options: PlatformStaticsOptions}[]);\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function listenServer(injector, server, hostInfo) {
|
|
2
|
+
const { protocol, address, port } = hostInfo;
|
|
3
|
+
const url = `${protocol}://${address}:${port}`;
|
|
4
|
+
injector.logger.debug(`Start server on ${url}`);
|
|
5
|
+
const promise = new Promise((resolve, reject) => {
|
|
6
|
+
server.on("listening", resolve);
|
|
7
|
+
server.on("error", reject);
|
|
8
|
+
}).then(() => {
|
|
9
|
+
const port = server.address().port;
|
|
10
|
+
const info = { ...hostInfo, port };
|
|
11
|
+
injector.logger.info(`Listen server on ${info.toString()}`);
|
|
12
|
+
return info;
|
|
13
|
+
});
|
|
14
|
+
server.listen(port, address);
|
|
15
|
+
return promise;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=listenServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listenServer.js","sourceRoot":"","sources":["../../../src/utils/listenServer.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,YAAY,CAC1B,QAAyB,EACzB,MAAsD,EACtD,QAAgD;IAEhD,MAAM,EAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,GAAG,QAAQ,CAAC;IAC3C,MAAM,GAAG,GAAG,GAAG,QAAQ,MAAM,OAAO,IAAI,IAAI,EAAE,CAAC;IAC/C,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,GAAG,EAAE,CAAC,CAAC;IAEhD,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC9C,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAChC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;QACX,MAAM,IAAI,GAAI,MAAM,CAAC,OAAO,EAAU,CAAC,IAAI,CAAC;QAC5C,MAAM,IAAI,GAAG,EAAC,GAAG,QAAQ,EAAE,IAAI,EAAC,CAAC;QAEjC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAE5D,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAc,CAAC,CAAC;IAEpC,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import type Http from \"http\";\nimport type Https from \"https\";\nimport type Http2 from \"http2\";\nimport {InjectorService} from \"@tsed/di\";\nimport {getHostInfoFromPort} from \"@tsed/core\";\n\nexport function listenServer(\n injector: InjectorService,\n server: Http.Server | Https.Server | Http2.Http2Server,\n hostInfo: ReturnType<typeof getHostInfoFromPort>\n): Promise<ReturnType<typeof getHostInfoFromPort>> {\n const {protocol, address, port} = hostInfo;\n const url = `${protocol}://${address}:${port}`;\n injector.logger.debug(`Start server on ${url}`);\n\n const promise = new Promise((resolve, reject) => {\n server.on(\"listening\", resolve);\n server.on(\"error\", reject);\n }).then(() => {\n const port = (server.address() as any).port;\n const info = {...hostInfo, port};\n\n injector.logger.info(`Listen server on ${info.toString()}`);\n\n return info;\n });\n\n server.listen(port, address as any);\n\n return promise;\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ignore
|
|
3
|
+
*/
|
|
4
|
+
export function mapReturnedResponse({ use, collection, ...options }) {
|
|
5
|
+
return {
|
|
6
|
+
...options,
|
|
7
|
+
type: options.type || use,
|
|
8
|
+
collectionType: options.collectionType || collection
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=mapReturnedResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapReturnedResponse.js","sourceRoot":"","sources":["../../../src/utils/mapReturnedResponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAC,GAAG,EAAE,UAAU,EAAE,GAAG,OAAO,EAAM;IACpE,OAAO;QACL,GAAG,OAAO;QACV,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,GAAG;QACzB,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,UAAU;KACrD,CAAC;AACJ,CAAC","sourcesContent":["/**\n * @ignore\n */\nexport function mapReturnedResponse({use, collection, ...options}: any): any {\n return {\n ...options,\n type: options.type || use,\n collectionType: options.collectionType || collection\n };\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { $log, colorize } from "@tsed/logger";
|
|
2
|
+
export function printRoutes(routes) {
|
|
3
|
+
const mapColor = {
|
|
4
|
+
GET: "green",
|
|
5
|
+
POST: "yellow",
|
|
6
|
+
PUT: "blue",
|
|
7
|
+
DELETE: "red",
|
|
8
|
+
PATCH: "magenta",
|
|
9
|
+
ALL: "cyan"
|
|
10
|
+
};
|
|
11
|
+
const list = routes.map((route) => {
|
|
12
|
+
const obj = route.toJSON();
|
|
13
|
+
const method = obj.method.toUpperCase();
|
|
14
|
+
obj.method = {
|
|
15
|
+
length: method.length,
|
|
16
|
+
toString: () => {
|
|
17
|
+
return colorize(method, mapColor[method]);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
return obj;
|
|
21
|
+
});
|
|
22
|
+
const str = $log.drawTable(list, {
|
|
23
|
+
padding: 1,
|
|
24
|
+
header: {
|
|
25
|
+
method: "Method",
|
|
26
|
+
url: "Endpoint",
|
|
27
|
+
name: "Class method"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return "\n" + str.trim();
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=printRoutes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"printRoutes.js","sourceRoot":"","sources":["../../../src/utils/printRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAG5C,MAAM,UAAU,WAAW,CAAC,MAA8B;IACxD,MAAM,QAAQ,GAA4B;QACxC,GAAG,EAAE,OAAO;QACZ,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,MAAM;QACX,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,MAAM;KACZ,CAAC;IAEF,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAChC,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAExC,GAAG,CAAC,MAAM,GAAG;YACX,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,QAAQ,EAAE,GAAG,EAAE;gBACb,OAAO,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;YAC5C,CAAC;SACK,CAAC;QAET,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;QAC/B,OAAO,EAAE,CAAC;QACV,MAAM,EAAE;YACN,MAAM,EAAE,QAAQ;YAChB,GAAG,EAAE,UAAU;YACf,IAAI,EAAE,cAAc;SACrB;KACF,CAAC,CAAC;IAEH,OAAO,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["import {$log, colorize} from \"@tsed/logger\";\nimport {PlatformRouteDetails} from \"../domain/PlatformRouteDetails\";\n\nexport function printRoutes(routes: PlatformRouteDetails[]) {\n const mapColor: {[key: string]: string} = {\n GET: \"green\",\n POST: \"yellow\",\n PUT: \"blue\",\n DELETE: \"red\",\n PATCH: \"magenta\",\n ALL: \"cyan\"\n };\n\n const list = routes.map((route) => {\n const obj = route.toJSON();\n const method = obj.method.toUpperCase();\n\n obj.method = {\n length: method.length,\n toString: () => {\n return colorize(method, mapColor[method]);\n }\n } as any;\n\n return obj;\n });\n\n const str = $log.drawTable(list, {\n padding: 1,\n header: {\n method: \"Method\",\n url: \"Endpoint\",\n name: \"Class method\"\n }\n });\n\n return \"\\n\" + str.trim();\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function mergeHeaders(specHeaders, headers) {
|
|
2
|
+
return Object.entries(specHeaders).reduce((headers, [key, item]) => {
|
|
3
|
+
key = key.toLowerCase();
|
|
4
|
+
return {
|
|
5
|
+
...headers,
|
|
6
|
+
[key]: headers[key] === undefined ? String(item.example) : headers[key]
|
|
7
|
+
};
|
|
8
|
+
}, headers);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @ignore
|
|
12
|
+
*/
|
|
13
|
+
export function setResponseHeaders(ctx) {
|
|
14
|
+
const { response, endpoint } = ctx;
|
|
15
|
+
const { operation } = endpoint;
|
|
16
|
+
if (response.isDone()) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (!response.hasStatus()) {
|
|
20
|
+
// apply status only if the isn't already modified
|
|
21
|
+
response.status(operation.getStatus());
|
|
22
|
+
}
|
|
23
|
+
const statusCode = response.statusCode;
|
|
24
|
+
const headers = operation.getHeadersOf(response.statusCode);
|
|
25
|
+
const mergedHeaders = mergeHeaders(headers, response.getHeaders());
|
|
26
|
+
response.setHeaders(mergedHeaders);
|
|
27
|
+
if (operation.isRedirection(statusCode)) {
|
|
28
|
+
response.redirect(statusCode, String(mergedHeaders["location"]));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=setResponseHeaders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setResponseHeaders.js","sourceRoot":"","sources":["../../../src/utils/setResponseHeaders.ts"],"names":[],"mappings":"AAIA,SAAS,YAAY,CAAC,WAA2D,EAAE,OAA4B;IAC7G,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE;QACjE,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QACxB,OAAO;YACL,GAAG,OAAO;YACV,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;SACxE,CAAC;IACJ,CAAC,EAAE,OAAO,CAAC,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAoB;IACrD,MAAM,EAAC,QAAQ,EAAE,QAAQ,EAAC,GAAG,GAAG,CAAC;IACjC,MAAM,EAAC,SAAS,EAAC,GAAG,QAAQ,CAAC;IAE7B,IAAI,QAAQ,CAAC,MAAM,EAAE,EAAE;QACrB,OAAO;KACR;IAED,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE;QACzB,kDAAkD;QAClD,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC;KACxC;IAED,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;IACvC,MAAM,OAAO,GAAG,SAAS,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,aAAa,GAAG,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IAEnE,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAEnC,IAAI,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE;QACvC,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;KAClE;AACH,CAAC","sourcesContent":["import {JsonHeader} from \"@tsed/schema\";\nimport {OutgoingHttpHeaders} from \"http\";\nimport {PlatformContext} from \"../domain/PlatformContext\";\n\nfunction mergeHeaders(specHeaders: Record<string, JsonHeader & {example: string}>, headers: OutgoingHttpHeaders) {\n return Object.entries(specHeaders).reduce((headers, [key, item]) => {\n key = key.toLowerCase();\n return {\n ...headers,\n [key]: headers[key] === undefined ? String(item.example) : headers[key]\n };\n }, headers);\n}\n\n/**\n * @ignore\n */\nexport function setResponseHeaders(ctx: PlatformContext) {\n const {response, endpoint} = ctx;\n const {operation} = endpoint;\n\n if (response.isDone()) {\n return;\n }\n\n if (!response.hasStatus()) {\n // apply status only if the isn't already modified\n response.status(operation.getStatus());\n }\n\n const statusCode = response.statusCode;\n const headers = operation.getHeadersOf(response.statusCode);\n const mergedHeaders = mergeHeaders(headers, response.getHeaders());\n\n response.setHeaders(mergedHeaders);\n\n if (operation.isRedirection(statusCode)) {\n response.redirect(statusCode, String(mergedHeaders[\"location\"]));\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HandlerType } from "../interfaces/HandlerType.js";
|
|
2
|
+
/**
|
|
3
|
+
* Create Ts.ED context handler
|
|
4
|
+
* @param fn
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
7
|
+
export function useCtxHandler(fn) {
|
|
8
|
+
fn.type = HandlerType.CTX_FN;
|
|
9
|
+
return fn;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=useCtxHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCtxHandler.js","sourceRoot":"","sources":["../../../src/utils/useCtxHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAItD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,EAA6C;IACzE,EAAE,CAAC,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC;IAE7B,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import {PlatformContext} from \"../domain/PlatformContext\";\nimport {HandlerType} from \"../interfaces/HandlerType\";\n\nexport type PlatformCtxHandler = ($ctx: PlatformContext) => any | Promise<any>;\n\n/**\n * Create Ts.ED context handler\n * @param fn\n * @ignore\n */\nexport function useCtxHandler(fn: PlatformCtxHandler & {type?: HandlerType}) {\n fn.type = HandlerType.CTX_FN;\n\n return fn;\n}\n"]}
|
|
@@ -1,36 +1,25 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { Type } from "@tsed/core";
|
|
2
|
-
import {
|
|
3
|
+
import { InjectorService, ProviderOpts, TokenProvider } from "@tsed/di";
|
|
3
4
|
import { Platform } from "../services/Platform";
|
|
4
5
|
import { PlatformApplication } from "../services/PlatformApplication";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
export interface PlatformType<T = any> extends Type<T> {
|
|
9
|
-
providers: IProvider[];
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @ignore
|
|
13
|
-
*/
|
|
14
|
-
export interface PlatformBootstrap {
|
|
15
|
-
bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<PlatformBuilder>;
|
|
16
|
-
}
|
|
6
|
+
import type { IncomingMessage, ServerResponse } from "http";
|
|
7
|
+
import { PlatformAdapter, PlatformBuilderSettings } from "../services/PlatformAdapter";
|
|
17
8
|
/**
|
|
18
9
|
* @platform
|
|
19
10
|
*/
|
|
20
|
-
export declare
|
|
11
|
+
export declare class PlatformBuilder<App = TsED.Application, Router = TsED.Router> {
|
|
21
12
|
#private;
|
|
22
|
-
static
|
|
13
|
+
static adapter: Type<PlatformAdapter<any, any>>;
|
|
23
14
|
readonly name: string;
|
|
24
15
|
protected startedAt: Date;
|
|
25
|
-
protected
|
|
26
|
-
constructor(
|
|
27
|
-
name: string;
|
|
28
|
-
providers: IProvider[];
|
|
29
|
-
});
|
|
16
|
+
protected current: Date;
|
|
17
|
+
protected constructor(adapter: Type<PlatformAdapter<App, Router>> | undefined, module: Type, settings: Partial<TsED.Configuration>);
|
|
30
18
|
get injector(): InjectorService;
|
|
31
19
|
get rootModule(): any;
|
|
32
20
|
get app(): PlatformApplication<App, Router>;
|
|
33
21
|
get platform(): Platform;
|
|
22
|
+
get adapter(): PlatformAdapter<App, Router>;
|
|
34
23
|
/**
|
|
35
24
|
* Return the settings configured by the decorator @@Configuration@@.
|
|
36
25
|
*
|
|
@@ -54,12 +43,22 @@ export declare abstract class PlatformBuilder<App = TsED.Application, Router = T
|
|
|
54
43
|
*/
|
|
55
44
|
get settings(): TsED.Configuration & import("@tsed/di").DIConfiguration;
|
|
56
45
|
get logger(): import("@tsed/di").DILogger;
|
|
57
|
-
get disableBootstrapLog():
|
|
58
|
-
static
|
|
46
|
+
get disableBootstrapLog(): any;
|
|
47
|
+
static create<App = TsED.Application, Router = TsED.Router>(module: Type<any>, settings: PlatformBuilderSettings<App, Router>): PlatformBuilder<App, Router>;
|
|
48
|
+
static build<App = TsED.Application, Router = TsED.Router>(module: Type<any>, { adapter, ...settings }: PlatformBuilderSettings<App, Router>): PlatformBuilder<App, Router>;
|
|
49
|
+
/**
|
|
50
|
+
* Bootstrap a server application
|
|
51
|
+
* @param module
|
|
52
|
+
* @param settings
|
|
53
|
+
*/
|
|
54
|
+
static bootstrap<App = TsED.Application, Router = TsED.Router>(module: Type<any>, settings: PlatformBuilderSettings<App, Router>): Promise<PlatformBuilder<App, Router>>;
|
|
55
|
+
callback(): (req: IncomingMessage, res: ServerResponse) => void;
|
|
56
|
+
callback(req: IncomingMessage, res: ServerResponse): void;
|
|
59
57
|
log(...data: any[]): any;
|
|
60
58
|
/**
|
|
61
59
|
* Add classes to the components list
|
|
62
60
|
* @param classes
|
|
61
|
+
* @deprecated
|
|
63
62
|
*/
|
|
64
63
|
addComponents(classes: any | any[]): this;
|
|
65
64
|
/**
|
|
@@ -82,28 +81,25 @@ export declare abstract class PlatformBuilder<App = TsED.Application, Router = T
|
|
|
82
81
|
* @param {string} endpoint
|
|
83
82
|
* @param {any[]} controllers
|
|
84
83
|
*/
|
|
85
|
-
addControllers(endpoint: string, controllers:
|
|
86
|
-
runLifecycle(): Promise<
|
|
84
|
+
addControllers(endpoint: string, controllers: TokenProvider | TokenProvider[]): void;
|
|
85
|
+
runLifecycle(): Promise<this>;
|
|
87
86
|
loadInjector(): Promise<void>;
|
|
88
|
-
listen(): Promise<void>;
|
|
87
|
+
listen(network?: boolean): Promise<void>;
|
|
89
88
|
stop(): Promise<void>;
|
|
90
89
|
ready(): Promise<void>;
|
|
91
90
|
callHook(hook: string, ...args: any[]): Promise<void>;
|
|
92
|
-
loadStatics(): Promise<void>;
|
|
93
|
-
useProvider(token: Type<any>, settings?: Partial<
|
|
94
|
-
|
|
91
|
+
loadStatics(hook: string): Promise<void>;
|
|
92
|
+
useProvider(token: Type<any>, settings?: Partial<ProviderOpts>): this;
|
|
93
|
+
bootstrap(): Promise<this>;
|
|
94
|
+
protected loadRoutes(): Promise<void>;
|
|
95
|
+
protected diff(): string;
|
|
95
96
|
/**
|
|
96
97
|
* Load middlewares from configuration for the given hook
|
|
97
98
|
* @param hook
|
|
98
99
|
* @protected
|
|
99
100
|
*/
|
|
100
101
|
protected loadMiddlewaresFor(hook: string): void;
|
|
101
|
-
protected
|
|
102
|
-
protected useContext(): this;
|
|
103
|
-
protected bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<this>;
|
|
102
|
+
protected createHttpServers(): void;
|
|
104
103
|
protected listenServers(): Promise<void>;
|
|
105
104
|
protected logRoutes(): Promise<void>;
|
|
106
|
-
protected loadRoutes(): Promise<void>;
|
|
107
|
-
protected createInjector(module: Type<any>, settings: any): void;
|
|
108
|
-
protected createRootModule(module: Type<any>): void;
|
|
109
105
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InjectorService } from "@tsed/di";
|
|
2
|
+
import { ControllerProvider } from "../domain/ControllerProvider";
|
|
3
|
+
import { PlatformRouter } from "../services/PlatformRouter";
|
|
4
|
+
/**
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
7
|
+
export declare function getRouter(injector: InjectorService, provider: ControllerProvider): any;
|
|
8
|
+
/**
|
|
9
|
+
* @ignore
|
|
10
|
+
*/
|
|
11
|
+
export declare function createRouter(injector: InjectorService, provider: ControllerProvider): PlatformRouter;
|
|
12
|
+
/**
|
|
13
|
+
* @ignore
|
|
14
|
+
* @param injector
|
|
15
|
+
* @param provider
|
|
16
|
+
* @param parentUseBefore
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildRouter(injector: InjectorService, provider: ControllerProvider, parentUseBefore?: any[]): PlatformRouter<TsED.Application, TsED.Router>;
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type multer from "multer";
|
|
2
|
+
declare global {
|
|
3
|
+
namespace TsED {
|
|
4
|
+
type MulterFile = Express.Multer.File;
|
|
5
|
+
type MulterStorageEngine = multer.StorageEngine;
|
|
6
|
+
type MulterOptions = multer.Options;
|
|
7
|
+
type MulterField = multer.Field;
|
|
8
|
+
type Multer = multer.Multer;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export declare type PlatformMulter = TsED.Multer;
|
|
12
|
+
export declare type PlatformMulterSettings = TsED.MulterOptions;
|
|
13
|
+
export declare type PlatformMulterFile = TsED.MulterFile;
|
|
14
|
+
export declare type PlatformMulterField = TsED.MulterField;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Env } from "@tsed/core";
|
|
3
|
-
import { DIConfiguration } from "@tsed/di";
|
|
2
|
+
import { Env, getHostInfoFromPort } from "@tsed/core";
|
|
3
|
+
import { DIConfiguration, TokenProvider } from "@tsed/di";
|
|
4
4
|
import Https from "https";
|
|
5
|
-
import { EndpointDirectoriesSettings, PlatformLoggerSettings } from "../interfaces";
|
|
6
5
|
import { ConverterSettings } from "../interfaces/ConverterSettings";
|
|
6
|
+
import { PlatformLoggerSettings } from "../interfaces/PlatformLoggerSettings";
|
|
7
7
|
/**
|
|
8
8
|
* `PlatformConfiguration` contains all information about your Server configuration.
|
|
9
9
|
*/
|
|
@@ -23,12 +23,18 @@ export declare class PlatformConfiguration extends DIConfiguration {
|
|
|
23
23
|
set httpsPort(value: string | number | false);
|
|
24
24
|
get env(): Env;
|
|
25
25
|
set env(value: Env);
|
|
26
|
-
get mount():
|
|
27
|
-
set mount(value:
|
|
26
|
+
get mount(): Record<string, TokenProvider[]>;
|
|
27
|
+
set mount(value: Record<string, TokenProvider[]>);
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated
|
|
30
|
+
*/
|
|
28
31
|
get componentsScan(): string[];
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated
|
|
34
|
+
*/
|
|
29
35
|
set componentsScan(value: string[]);
|
|
30
|
-
get statics():
|
|
31
|
-
set statics(value:
|
|
36
|
+
get statics(): Record<string, (any | string)[]>;
|
|
37
|
+
set statics(value: Record<string, (any | string)[]>);
|
|
32
38
|
get acceptMimes(): string[];
|
|
33
39
|
set acceptMimes(value: string[]);
|
|
34
40
|
get debug(): boolean;
|
|
@@ -40,20 +46,11 @@ export declare class PlatformConfiguration extends DIConfiguration {
|
|
|
40
46
|
get exclude(): string[];
|
|
41
47
|
set exclude(exclude: string[]);
|
|
42
48
|
get additionalProperties(): boolean;
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @param addressPort
|
|
46
|
-
* @returns {{address: string, port: number}}
|
|
47
|
-
*/
|
|
48
|
-
private static buildAddressAndPort;
|
|
49
49
|
/**
|
|
50
50
|
*
|
|
51
51
|
* @returns {string|number}
|
|
52
52
|
*/
|
|
53
|
-
getHttpPort():
|
|
54
|
-
address: string;
|
|
55
|
-
port: number;
|
|
56
|
-
};
|
|
53
|
+
getHttpPort(): ReturnType<typeof getHostInfoFromPort>;
|
|
57
54
|
/**
|
|
58
55
|
*
|
|
59
56
|
* @param settings
|
|
@@ -67,8 +64,10 @@ export declare class PlatformConfiguration extends DIConfiguration {
|
|
|
67
64
|
* @returns {string|number}
|
|
68
65
|
*/
|
|
69
66
|
getHttpsPort(): {
|
|
67
|
+
protocol: string;
|
|
70
68
|
address: string;
|
|
71
69
|
port: number;
|
|
70
|
+
toString(): string;
|
|
72
71
|
};
|
|
73
72
|
/**
|
|
74
73
|
*
|
|
@@ -78,4 +77,12 @@ export declare class PlatformConfiguration extends DIConfiguration {
|
|
|
78
77
|
address: string;
|
|
79
78
|
port: number;
|
|
80
79
|
}): void;
|
|
80
|
+
getBestHost(): {
|
|
81
|
+
protocol: string;
|
|
82
|
+
address: string;
|
|
83
|
+
port: number;
|
|
84
|
+
toString(): string;
|
|
85
|
+
} | {
|
|
86
|
+
toString(): string;
|
|
87
|
+
};
|
|
81
88
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ControllerMiddlewares, Provider, TokenProvider } from "@tsed/di";
|
|
2
|
+
export declare class ControllerProvider<T = any> extends Provider<T> {
|
|
3
|
+
readonly tokenRouter: string;
|
|
4
|
+
constructor(provide: TokenProvider, options?: Partial<Provider>);
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
get routerOptions(): any;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param value
|
|
12
|
+
*/
|
|
13
|
+
set routerOptions(value: any);
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @returns {any[]}
|
|
17
|
+
*/
|
|
18
|
+
get middlewares(): ControllerMiddlewares;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param middlewares
|
|
22
|
+
*/
|
|
23
|
+
set middlewares(middlewares: ControllerMiddlewares);
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EndpointMetadata } from "@tsed/schema";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
2
|
import { ProviderScope } from "@tsed/di";
|
|
3
|
-
import {
|
|
3
|
+
import { JsonParameterStore } from "@tsed/schema";
|
|
4
4
|
import { HandlerType } from "../interfaces/HandlerType";
|
|
5
5
|
import { PlatformRouteOptions, PlatformRouteWithoutHandlers } from "../interfaces/PlatformRouteOptions";
|
|
6
6
|
export interface HandlerMetadataOptions {
|
|
@@ -25,7 +25,7 @@ export declare class HandlerMetadata {
|
|
|
25
25
|
handler: any;
|
|
26
26
|
constructor(options: HandlerMetadataOptions);
|
|
27
27
|
get hasErrorParam(): boolean;
|
|
28
|
-
getParams():
|
|
28
|
+
getParams(): JsonParameterStore[];
|
|
29
29
|
hasParamType(paramType: any): boolean;
|
|
30
30
|
isFinal(): boolean;
|
|
31
31
|
toString(): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { ContextMethods, DIContext, DIContextOptions } from "@tsed/di";
|
|
3
3
|
import { IncomingMessage, ServerResponse } from "http";
|
|
4
|
-
import { EndpointMetadata } from "
|
|
4
|
+
import { EndpointMetadata } from "@tsed/schema";
|
|
5
5
|
import { PlatformApplication } from "../services/PlatformApplication";
|
|
6
6
|
import { PlatformRequest } from "../services/PlatformRequest";
|
|
7
7
|
import { PlatformResponse } from "../services/PlatformResponse";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EndpointMetadata, JsonOperationRoute } from "@tsed/schema";
|
|
2
|
+
import { ControllerProvider } from "./ControllerProvider";
|
|
3
|
+
export interface PlatformRouterDetailsOptions {
|
|
4
|
+
provider: ControllerProvider;
|
|
5
|
+
endpoint: EndpointMetadata;
|
|
6
|
+
method: string;
|
|
7
|
+
url: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class PlatformRouteDetails extends JsonOperationRoute<EndpointMetadata> {
|
|
10
|
+
readonly rawBody: boolean;
|
|
11
|
+
readonly provider: ControllerProvider;
|
|
12
|
+
constructor(options?: Partial<PlatformRouteDetails>);
|
|
13
|
+
toJSON(): {
|
|
14
|
+
method: string;
|
|
15
|
+
name: string;
|
|
16
|
+
url: string;
|
|
17
|
+
className: string;
|
|
18
|
+
methodClassName: string;
|
|
19
|
+
parameters: import("@tsed/schema").JsonParameterStore[];
|
|
20
|
+
rawBody: boolean;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "@tsed/logger";
|
|
2
|
+
import "@tsed/logger-file";
|
|
3
|
+
export * from "@tsed/di";
|
|
4
|
+
export * from "@tsed/platform-params";
|
|
5
|
+
export * from "@tsed/platform-exceptions";
|
|
6
|
+
export * from "@tsed/platform-response-filter";
|
|
7
|
+
export * from "@tsed/platform-cache";
|
|
8
|
+
export * from "@tsed/platform-middlewares";
|
|
9
|
+
export * from "@tsed/components-scan";
|
|
10
|
+
export * from "@tsed/platform-log-middleware";
|
|
11
|
+
export { $log, Logger } from "@tsed/logger";
|
|
12
|
+
export { AcceptMime, Location, Redirect, View, Get, Post, Put, Patch, Delete, Head, Options, All } from "@tsed/schema";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./exports";
|
|
5
|
+
export * from "./builder/PlatformBuilder";
|
|
6
|
+
export * from "./builder/PlatformControllerBuilder";
|
|
7
|
+
export * from "./config/interfaces/ConverterSettings";
|
|
8
|
+
export * from "./config/interfaces/PlatformLoggerSettings";
|
|
9
|
+
export * from "./config/interfaces/PlatformMulterSettings";
|
|
10
|
+
export * from "./config/interfaces/PlatformStaticsSettings";
|
|
11
|
+
export * from "./config/services/PlatformConfiguration";
|
|
12
|
+
export * from "./constants/routerOptions";
|
|
13
|
+
export * from "./decorators/multer/multerFileSize";
|
|
14
|
+
export * from "./decorators/multer/multerOptions";
|
|
15
|
+
export * from "./decorators/multer/multipartFile";
|
|
16
|
+
export * from "./decorators/params/error";
|
|
17
|
+
export * from "./decorators/params/next";
|
|
18
|
+
export * from "./decorators/params/request";
|
|
19
|
+
export * from "./decorators/params/response";
|
|
20
|
+
export * from "./domain/AnyToPromiseWithCtx";
|
|
21
|
+
export * from "./domain/ControllerProvider";
|
|
22
|
+
export * from "./domain/EndpointMetadata";
|
|
23
|
+
export * from "./domain/HandlerMetadata";
|
|
24
|
+
export * from "./domain/PlatformContext";
|
|
25
|
+
export * from "./domain/PlatformRouteDetails";
|
|
26
|
+
export * from "./interfaces/AfterInit";
|
|
27
|
+
export * from "./interfaces/AfterListen";
|
|
28
|
+
export * from "./interfaces/AfterRoutesInit";
|
|
29
|
+
export * from "./interfaces/BeforeInit";
|
|
30
|
+
export * from "./interfaces/BeforeListen";
|
|
31
|
+
export * from "./interfaces/BeforeRoutesInit";
|
|
32
|
+
export * from "./interfaces/HandlerType";
|
|
33
|
+
export * from "./interfaces/IncomingEvent";
|
|
34
|
+
export * from "./interfaces/OnReady";
|
|
35
|
+
export * from "./interfaces/OnRequest";
|
|
36
|
+
export * from "./interfaces/OnResponse";
|
|
37
|
+
export * from "./interfaces/OnRoutesInit";
|
|
38
|
+
export * from "./interfaces/PlatformRouteOptions";
|
|
39
|
+
export * from "./interfaces/ResponseErrorObject";
|
|
40
|
+
export * from "./interfaces/Route";
|
|
41
|
+
export * from "./middlewares/PlatformAcceptMimesMiddleware";
|
|
42
|
+
export * from "./middlewares/PlatformMulterMiddleware";
|
|
43
|
+
export * from "./middlewares/bindEndpointMiddleware";
|
|
44
|
+
export * from "./services/FakeAdapter";
|
|
45
|
+
export * from "./services/Platform";
|
|
46
|
+
export * from "./services/PlatformAdapter";
|
|
47
|
+
export * from "./services/PlatformApplication";
|
|
48
|
+
export * from "./services/PlatformHandler";
|
|
49
|
+
export * from "./services/PlatformMiddlewaresChain";
|
|
50
|
+
export * from "./services/PlatformRequest";
|
|
51
|
+
export * from "./services/PlatformResponse";
|
|
52
|
+
export * from "./services/PlatformRouter";
|
|
53
|
+
export * from "./services/PlatformTest";
|
|
54
|
+
export * from "./utils/createContext";
|
|
55
|
+
export * from "./utils/createHandlerMetadata";
|
|
56
|
+
export * from "./utils/createHttpServer";
|
|
57
|
+
export * from "./utils/createHttpsServer";
|
|
58
|
+
export * from "./utils/createInjector";
|
|
59
|
+
export * from "./utils/getStaticsOptions";
|
|
60
|
+
export * from "./utils/listenServer";
|
|
61
|
+
export * from "./utils/mapReturnedResponse";
|
|
62
|
+
export * from "./utils/printRoutes";
|
|
63
|
+
export * from "./utils/setResponseHeaders";
|
|
64
|
+
export * from "./utils/useCtxHandler";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
1
2
|
import { PathType } from "@tsed/di";
|
|
2
3
|
/**
|
|
3
4
|
* @ignore
|
|
4
5
|
*/
|
|
5
6
|
export interface PlatformRouteOptions {
|
|
6
|
-
|
|
7
|
-
path
|
|
8
|
-
|
|
7
|
+
token?: Type<any>;
|
|
8
|
+
path?: PathType | undefined;
|
|
9
|
+
method?: string;
|
|
9
10
|
isFinal?: boolean;
|
|
11
|
+
handlers: any[];
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* @ignore
|
|
File without changes
|
|
File without changes
|
|
File without changes
|