@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
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
import type { MulterError } from "multer";
|
|
2
|
+
import { BadRequest } from "@tsed/exceptions";
|
|
1
3
|
import { MiddlewareMethods } from "@tsed/platform-middlewares";
|
|
2
4
|
import { Context } from "@tsed/platform-params";
|
|
3
|
-
import { PlatformMulterField, PlatformMulterSettings } from "../config";
|
|
5
|
+
import { PlatformMulterField, PlatformMulterSettings } from "../config/interfaces/PlatformMulterSettings";
|
|
4
6
|
import { PlatformApplication } from "../services/PlatformApplication";
|
|
5
7
|
export interface MulterInputOptions {
|
|
6
8
|
fields: PlatformMulterField[];
|
|
7
9
|
}
|
|
10
|
+
export declare class MulterException extends BadRequest {
|
|
11
|
+
constructor(er: MulterError);
|
|
12
|
+
}
|
|
8
13
|
/**
|
|
9
14
|
* @middleware
|
|
10
15
|
*/
|
|
11
16
|
export declare class PlatformMulterMiddleware implements MiddlewareMethods {
|
|
12
|
-
settings: PlatformMulterSettings;
|
|
13
|
-
app: PlatformApplication;
|
|
17
|
+
protected settings: PlatformMulterSettings;
|
|
18
|
+
protected app: PlatformApplication;
|
|
14
19
|
use(ctx: Context): Promise<any>;
|
|
15
20
|
protected getFields(conf: MulterInputOptions): {
|
|
16
21
|
name: string;
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ProviderOpts } from "@tsed/di";
|
|
2
|
+
import { PlatformAdapter } from "./PlatformAdapter";
|
|
3
|
+
import { PlatformMulter, PlatformMulterSettings } from "../config/interfaces/PlatformMulterSettings";
|
|
4
|
+
import { PlatformStaticsOptions } from "../config/interfaces/PlatformStaticsSettings";
|
|
5
|
+
export declare class FakeAdapter implements PlatformAdapter<any, any> {
|
|
6
|
+
providers: ProviderOpts[];
|
|
7
|
+
static createFakeRawDriver(): {
|
|
8
|
+
(): void;
|
|
9
|
+
use: () => any;
|
|
10
|
+
all: () => any;
|
|
11
|
+
get: () => any;
|
|
12
|
+
patch: () => any;
|
|
13
|
+
post: () => any;
|
|
14
|
+
put: () => any;
|
|
15
|
+
head: () => any;
|
|
16
|
+
delete: () => any;
|
|
17
|
+
options: () => any;
|
|
18
|
+
};
|
|
19
|
+
app(): {
|
|
20
|
+
app: any;
|
|
21
|
+
callback(): any;
|
|
22
|
+
};
|
|
23
|
+
multipart(options: PlatformMulterSettings): PlatformMulter;
|
|
24
|
+
router(routerOptions: any): {
|
|
25
|
+
router: any;
|
|
26
|
+
callback(): any;
|
|
27
|
+
};
|
|
28
|
+
statics(endpoint: string, options: PlatformStaticsOptions): any;
|
|
29
|
+
bodyParser(type: string): any;
|
|
30
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InjectorService, TokenProvider } from "@tsed/di";
|
|
2
|
-
import { PlatformRouteDetails } from "../domain";
|
|
2
|
+
import { PlatformRouteDetails } from "../domain/PlatformRouteDetails";
|
|
3
3
|
import { Route, RouteController } from "../interfaces/Route";
|
|
4
4
|
import { PlatformApplication } from "./PlatformApplication";
|
|
5
5
|
/**
|
|
@@ -8,24 +8,39 @@ import { PlatformApplication } from "./PlatformApplication";
|
|
|
8
8
|
* @platform
|
|
9
9
|
*/
|
|
10
10
|
export declare class Platform {
|
|
11
|
-
#private;
|
|
12
11
|
readonly injector: InjectorService;
|
|
13
12
|
readonly platformApplication: PlatformApplication;
|
|
13
|
+
private _routes;
|
|
14
|
+
private _controllers;
|
|
14
15
|
constructor(injector: InjectorService, platformApplication: PlatformApplication);
|
|
15
16
|
get app(): PlatformApplication<TsED.Application, TsED.Router>;
|
|
16
17
|
get routes(): PlatformRouteDetails[];
|
|
17
18
|
addRoutes(routes: Route[]): void;
|
|
18
|
-
addRoute(
|
|
19
|
+
addRoute(basePath: string, token: TokenProvider): this | undefined;
|
|
19
20
|
/**
|
|
20
21
|
* Get all routes built by TsExpressDecorators and mounted on Express application.
|
|
21
22
|
* @returns {PlatformRouteDetails[]}
|
|
22
23
|
*/
|
|
23
24
|
getRoutes(): PlatformRouteDetails[];
|
|
25
|
+
/**
|
|
26
|
+
* Get all controllers mounted on the application.
|
|
27
|
+
* @returns {RouteController[]}
|
|
28
|
+
*/
|
|
24
29
|
getMountedControllers(): RouteController[];
|
|
30
|
+
protected $onInit(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Create routers from the collected controllers.
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
private createRouters;
|
|
36
|
+
/**
|
|
37
|
+
* Get all router controllers from the controller token.
|
|
38
|
+
* @private
|
|
39
|
+
*/
|
|
40
|
+
private getAllControllers;
|
|
25
41
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @
|
|
28
|
-
* @param endpointUrl
|
|
42
|
+
* Create controllers from DI
|
|
43
|
+
* @private
|
|
29
44
|
*/
|
|
30
|
-
private
|
|
45
|
+
private buildControllers;
|
|
31
46
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import { ProviderOpts } from "@tsed/di";
|
|
3
|
+
import { PlatformMulter, PlatformMulterSettings } from "../config/interfaces/PlatformMulterSettings";
|
|
4
|
+
import { PlatformStaticsOptions } from "../config/interfaces/PlatformStaticsSettings";
|
|
5
|
+
import { RouterOptions } from "express";
|
|
6
|
+
export declare abstract class PlatformAdapter<App = TsED.Application, Router = TsED.Router> {
|
|
7
|
+
/**
|
|
8
|
+
* Load providers in top priority
|
|
9
|
+
*/
|
|
10
|
+
providers: ProviderOpts[];
|
|
11
|
+
/**
|
|
12
|
+
* Called after the injector instantiation
|
|
13
|
+
*/
|
|
14
|
+
onInit?: () => any;
|
|
15
|
+
beforeLoadRoutes?: () => Promise<any>;
|
|
16
|
+
afterLoadRoutes?: () => Promise<any>;
|
|
17
|
+
useRouter?: () => any;
|
|
18
|
+
useContext?: () => any;
|
|
19
|
+
abstract app(): {
|
|
20
|
+
app: App;
|
|
21
|
+
callback(): any;
|
|
22
|
+
};
|
|
23
|
+
abstract router(routerOptions?: Partial<RouterOptions>): {
|
|
24
|
+
router: Router;
|
|
25
|
+
callback(): any;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Return the statics middlewares
|
|
29
|
+
* @param endpoint
|
|
30
|
+
* @param options
|
|
31
|
+
*/
|
|
32
|
+
abstract statics(endpoint: string, options: PlatformStaticsOptions): any;
|
|
33
|
+
/**
|
|
34
|
+
* Return the multipart middleware
|
|
35
|
+
* @param options
|
|
36
|
+
*/
|
|
37
|
+
abstract multipart(options: PlatformMulterSettings): PlatformMulter;
|
|
38
|
+
/**
|
|
39
|
+
* Return the body parser for the given
|
|
40
|
+
* @param type
|
|
41
|
+
* @param opts
|
|
42
|
+
*/
|
|
43
|
+
abstract bodyParser(type: string, opts?: Record<string, any>): any;
|
|
44
|
+
}
|
|
45
|
+
export interface PlatformBuilderSettings<App = TsED.Application, Router = TsED.Router> extends Partial<TsED.Configuration> {
|
|
46
|
+
adapter?: Type<PlatformAdapter<App, Router>>;
|
|
47
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PlatformHandler } from "./PlatformHandler";
|
|
2
2
|
import { PlatformRouter } from "./PlatformRouter";
|
|
3
|
+
import { PlatformAdapter } from "./PlatformAdapter";
|
|
3
4
|
declare global {
|
|
4
5
|
namespace TsED {
|
|
5
6
|
interface Application {
|
|
@@ -11,11 +12,10 @@ declare global {
|
|
|
11
12
|
*
|
|
12
13
|
* @platform
|
|
13
14
|
*/
|
|
14
|
-
export declare class PlatformApplication<App = TsED.Application, Router = TsED.Router> extends PlatformRouter<Router> {
|
|
15
|
+
export declare class PlatformApplication<App = TsED.Application, Router = TsED.Router> extends PlatformRouter<App, Router> {
|
|
15
16
|
raw: App;
|
|
16
17
|
rawApp: App;
|
|
17
18
|
rawRouter: Router;
|
|
18
|
-
constructor(platformHandler: PlatformHandler);
|
|
19
|
-
protected static createRawApp(): any;
|
|
19
|
+
constructor(platformHandler: PlatformHandler, adapter: PlatformAdapter<App, Router>);
|
|
20
20
|
getApp(): App;
|
|
21
21
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InjectorService, Provider } from "@tsed/di";
|
|
2
2
|
import { ArgScope, HandlerWithScope, PlatformParams } from "@tsed/platform-params";
|
|
3
3
|
import { PlatformResponseFilter } from "@tsed/platform-response-filter";
|
|
4
|
-
import { EndpointMetadata } from "
|
|
4
|
+
import { EndpointMetadata } from "@tsed/schema";
|
|
5
5
|
import { HandlerMetadata } from "../domain/HandlerMetadata";
|
|
6
6
|
import { PlatformContext } from "../domain/PlatformContext";
|
|
7
7
|
import { PlatformRouteWithoutHandlers } from "../interfaces/PlatformRouteOptions";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JsonOperationRoute } from "@tsed/schema";
|
|
2
|
+
import { ControllerProvider } from "../domain/ControllerProvider";
|
|
3
|
+
import { PlatformAdapter } from "../services/PlatformAdapter";
|
|
4
|
+
export declare class PlatformMiddlewaresChain {
|
|
5
|
+
protected acceptMimes: string[];
|
|
6
|
+
protected adapter: PlatformAdapter;
|
|
7
|
+
get(provider: ControllerProvider, operationRoute: JsonOperationRoute, parentMiddlewares?: any[]): any[];
|
|
8
|
+
protected hasAcceptMimes(operationRoute: JsonOperationRoute): number;
|
|
9
|
+
protected getParamTypes(middlewares: any[], operationRoute: JsonOperationRoute): any;
|
|
10
|
+
}
|
|
@@ -18,12 +18,13 @@ declare global {
|
|
|
18
18
|
export declare class PlatformRequest<T extends {
|
|
19
19
|
[key: string]: any;
|
|
20
20
|
} = any> {
|
|
21
|
+
protected $ctx: PlatformContext;
|
|
21
22
|
raw: T;
|
|
22
23
|
/**
|
|
23
24
|
* The current @@PlatformResponse@@.
|
|
24
25
|
*/
|
|
25
26
|
response: PlatformResponse;
|
|
26
|
-
constructor({ request }: IncomingEvent);
|
|
27
|
+
constructor({ request }: IncomingEvent, $ctx: PlatformContext);
|
|
27
28
|
get secure(): boolean;
|
|
28
29
|
get host(): string;
|
|
29
30
|
get protocol(): string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import {
|
|
3
|
-
import { ServerResponse } from "http";
|
|
2
|
+
import { OutgoingHttpHeaders, ServerResponse } from "http";
|
|
4
3
|
import { IncomingEvent } from "../interfaces/IncomingEvent";
|
|
5
4
|
import type { PlatformRequest } from "./PlatformRequest";
|
|
5
|
+
import type { PlatformContext } from "../domain/PlatformContext";
|
|
6
6
|
declare global {
|
|
7
7
|
namespace TsED {
|
|
8
8
|
interface Response {
|
|
@@ -15,14 +15,14 @@ export declare type HeaderValue = Array<boolean | number | string> | boolean | n
|
|
|
15
15
|
* @platform
|
|
16
16
|
*/
|
|
17
17
|
export declare class PlatformResponse<T extends Record<string, any> = any> {
|
|
18
|
-
|
|
18
|
+
protected $ctx: PlatformContext;
|
|
19
19
|
/**
|
|
20
20
|
* The current @@PlatformRequest@@.
|
|
21
21
|
*/
|
|
22
22
|
request: PlatformRequest;
|
|
23
23
|
data: any;
|
|
24
24
|
raw: T;
|
|
25
|
-
constructor({ response }: IncomingEvent);
|
|
25
|
+
constructor({ response }: IncomingEvent, $ctx: PlatformContext);
|
|
26
26
|
/**
|
|
27
27
|
* Get the current statusCode
|
|
28
28
|
*/
|
|
@@ -41,7 +41,7 @@ export declare class PlatformResponse<T extends Record<string, any> = any> {
|
|
|
41
41
|
* Return the original response node.js instance
|
|
42
42
|
*/
|
|
43
43
|
get res(): ServerResponse;
|
|
44
|
-
static onFinished(res: any, cb:
|
|
44
|
+
static onFinished(res: any, cb: (er: Error | null, message: string) => void): void;
|
|
45
45
|
/**
|
|
46
46
|
* Returns the HTTP response header specified by field. The match is case-insensitive.
|
|
47
47
|
*
|
|
@@ -52,7 +52,7 @@ export declare class PlatformResponse<T extends Record<string, any> = any> {
|
|
|
52
52
|
* @param name
|
|
53
53
|
*/
|
|
54
54
|
get(name: string): any;
|
|
55
|
-
getHeaders():
|
|
55
|
+
getHeaders(): OutgoingHttpHeaders;
|
|
56
56
|
/**
|
|
57
57
|
* Return the Framework response object (express, koa, etc...)
|
|
58
58
|
*/
|
|
@@ -79,7 +79,7 @@ export declare class PlatformResponse<T extends Record<string, any> = any> {
|
|
|
79
79
|
*
|
|
80
80
|
* Aliased as `res.header()`.
|
|
81
81
|
*/
|
|
82
|
-
setHeaders(headers:
|
|
82
|
+
setHeaders(headers: OutgoingHttpHeaders): this;
|
|
83
83
|
setHeader(key: string, item: any): this;
|
|
84
84
|
/**
|
|
85
85
|
* Set `Content-Type` response header with `type` through `mime.lookup()`
|
|
@@ -132,14 +132,14 @@ export declare class PlatformResponse<T extends Record<string, any> = any> {
|
|
|
132
132
|
*
|
|
133
133
|
* @param data
|
|
134
134
|
*/
|
|
135
|
-
stream(data:
|
|
135
|
+
stream(data: any): this;
|
|
136
136
|
/**
|
|
137
137
|
* Renders a view and sends the rendered HTML string to the client.
|
|
138
138
|
*
|
|
139
139
|
* @param path
|
|
140
140
|
* @param options
|
|
141
141
|
*/
|
|
142
|
-
render(path: string, options?: any): Promise<
|
|
142
|
+
render(path: string, options?: any): Promise<any>;
|
|
143
143
|
/**
|
|
144
144
|
* Send any data to your consumer.
|
|
145
145
|
*
|
|
@@ -154,7 +154,7 @@ export declare class PlatformResponse<T extends Record<string, any> = any> {
|
|
|
154
154
|
* Add a listener to handler the end of the request/response.
|
|
155
155
|
* @param cb
|
|
156
156
|
*/
|
|
157
|
-
onEnd(cb:
|
|
157
|
+
onEnd(cb: (er: Error | null, message: string) => void): this;
|
|
158
158
|
isDone(): boolean;
|
|
159
159
|
destroy(): void;
|
|
160
160
|
isHeadersSent(): boolean;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { InjectorService, PathType } from "@tsed/di";
|
|
2
|
-
import { PlatformMulter, PlatformMulterSettings, PlatformStaticsOptions } from "../config";
|
|
3
|
-
import { PlatformRouteWithoutHandlers, PlatformRouteOptions } from "../interfaces";
|
|
4
2
|
import { PlatformHandler } from "./PlatformHandler";
|
|
3
|
+
import { PlatformRouteOptions, PlatformRouteWithoutHandlers } from "../interfaces/PlatformRouteOptions";
|
|
4
|
+
import { PlatformStaticsOptions } from "../config/interfaces/PlatformStaticsSettings";
|
|
5
|
+
import { PlatformMulter, PlatformMulterSettings } from "../config/interfaces/PlatformMulterSettings";
|
|
6
|
+
import { PlatformAdapter } from "./PlatformAdapter";
|
|
7
|
+
import { RouterOptions } from "express";
|
|
5
8
|
/**
|
|
6
9
|
* @ignore
|
|
7
10
|
*/
|
|
@@ -16,23 +19,24 @@ declare global {
|
|
|
16
19
|
* Platform Router abstraction layer.
|
|
17
20
|
* @platform
|
|
18
21
|
*/
|
|
19
|
-
export declare class PlatformRouter<Router = TsED.Router> {
|
|
22
|
+
export declare class PlatformRouter<App = TsED.Application, Router = TsED.Router> {
|
|
20
23
|
protected platformHandler: PlatformHandler;
|
|
24
|
+
readonly adapter: PlatformAdapter<App, Router>;
|
|
21
25
|
rawRouter: Router;
|
|
22
26
|
raw: any;
|
|
27
|
+
isBuilt: boolean;
|
|
23
28
|
injector: InjectorService;
|
|
24
|
-
|
|
29
|
+
callback: () => any;
|
|
30
|
+
constructor(platformHandler: PlatformHandler, adapter: PlatformAdapter<App, Router>, routerOptions?: Partial<RouterOptions>);
|
|
25
31
|
/**
|
|
26
32
|
* Create a new instance of PlatformRouter
|
|
27
33
|
* @param injector
|
|
28
34
|
* @param routerOptions
|
|
29
35
|
*/
|
|
30
|
-
static create(injector: InjectorService, routerOptions?: any): PlatformRouter<TsED.Router>;
|
|
31
|
-
protected static createRawRouter(): any;
|
|
32
|
-
callback(): any;
|
|
36
|
+
static create(injector: InjectorService, routerOptions?: any): PlatformRouter<TsED.Application, TsED.Router>;
|
|
33
37
|
getRouter(): Router;
|
|
34
38
|
use(...handlers: any[]): this;
|
|
35
|
-
addRoute(options: PlatformRouteOptions): this;
|
|
39
|
+
addRoute(options: Partial<PlatformRouteOptions>): this;
|
|
36
40
|
all(path: PathType, ...handlers: any[]): this;
|
|
37
41
|
get(path: PathType, ...handlers: any[]): this;
|
|
38
42
|
post(path: PathType, ...handlers: any[]): this;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { DITest, DITestOptions, InjectorService } from "@tsed/di";
|
|
1
2
|
import { Type } from "@tsed/core";
|
|
2
|
-
import { DITest, InjectorService } from "@tsed/di";
|
|
3
|
-
import { PlatformBuilder } from "../builder/PlatformBuilder";
|
|
4
3
|
import { PlatformContext, PlatformContextOptions } from "../domain/PlatformContext";
|
|
4
|
+
import { PlatformAdapter, PlatformBuilderSettings } from "./PlatformAdapter";
|
|
5
5
|
/**
|
|
6
6
|
* @platform
|
|
7
7
|
*/
|
|
8
8
|
export declare class PlatformTest extends DITest {
|
|
9
|
-
static
|
|
10
|
-
static create(
|
|
9
|
+
static adapter: Type<PlatformAdapter>;
|
|
10
|
+
static create(settings?: DITestOptions): Promise<void>;
|
|
11
11
|
/**
|
|
12
12
|
* Create a new injector with the right default services
|
|
13
13
|
*/
|
|
@@ -16,10 +16,11 @@ export declare class PlatformTest extends DITest {
|
|
|
16
16
|
* Load the server silently without listening port and configure it on test profile.
|
|
17
17
|
* @decorator
|
|
18
18
|
* @param mod
|
|
19
|
+
* @param listen
|
|
19
20
|
* @param settings
|
|
20
21
|
* @returns {Promise<void>}
|
|
21
22
|
*/
|
|
22
|
-
static bootstrap(mod: any, settings?: Partial<
|
|
23
|
+
static bootstrap(mod: any, { listen, ...settings }?: Partial<PlatformBuilderSettings & {
|
|
23
24
|
listen: boolean;
|
|
24
25
|
}>): () => Promise<void>;
|
|
25
26
|
/**
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InjectorService } from "@tsed/di";
|
|
2
|
-
import { EndpointMetadata } from "
|
|
2
|
+
import { EndpointMetadata } from "@tsed/schema";
|
|
3
3
|
import { HandlerMetadata } from "../domain/HandlerMetadata";
|
|
4
4
|
import { PlatformRouteWithoutHandlers } from "../interfaces/PlatformRouteOptions";
|
|
5
5
|
/**
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { InjectorService } from "@tsed/di";
|
|
3
|
+
import Https from "https";
|
|
4
|
+
import Http from "http";
|
|
5
|
+
export declare function createHttpsServer(injector: InjectorService, requestListener?: Http.RequestListener): (() => Promise<Https.Server>) | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InjectorService } from "@tsed/di";
|
|
2
|
+
import { Type } from "@tsed/core";
|
|
3
|
+
import { PlatformAdapter } from "../services/PlatformAdapter";
|
|
4
|
+
interface CreateInjectorOptions {
|
|
5
|
+
adapter?: Type<PlatformAdapter<any, any>>;
|
|
6
|
+
settings?: Partial<TsED.Configuration>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createInjector({ adapter, settings }: CreateInjectorOptions): InjectorService;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type Http from "http";
|
|
3
|
+
import type Https from "https";
|
|
4
|
+
import type Http2 from "http2";
|
|
5
|
+
import { InjectorService } from "@tsed/di";
|
|
6
|
+
import { getHostInfoFromPort } from "@tsed/core";
|
|
7
|
+
export declare function listenServer(injector: InjectorService, server: Http.Server | Https.Server | Http2.Http2Server, hostInfo: ReturnType<typeof getHostInfoFromPort>): Promise<ReturnType<typeof getHostInfoFromPort>>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/common",
|
|
3
|
-
"version": "7.0.0-
|
|
3
|
+
"version": "7.0.0-beta.11",
|
|
4
4
|
"description": "A TypeScript Framework on top of Express",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
|
-
"main": "./lib/index.js",
|
|
8
|
-
"
|
|
7
|
+
"main": "./lib/cjs/index.js",
|
|
8
|
+
"module": "./lib/esm/index.js",
|
|
9
|
+
"typings": "./lib/types/index.d.ts",
|
|
9
10
|
"exports": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
11
|
+
"types": "./lib/types/index.d.ts",
|
|
12
|
+
"import": "./lib/esm/index.js",
|
|
13
|
+
"require": "./lib/cjs/index.js",
|
|
14
|
+
"default": "./lib/esm/index.js"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
|
|
18
|
+
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
19
|
+
"build:esm": "tsc --build tsconfig.compile.esm.json",
|
|
20
|
+
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\" -e \"getConfiguration\""
|
|
12
21
|
},
|
|
13
22
|
"keywords": [
|
|
14
23
|
"Express",
|
|
@@ -39,7 +48,7 @@
|
|
|
39
48
|
"bugs": {
|
|
40
49
|
"url": "https://github.com/tsedio/tsed/issues"
|
|
41
50
|
},
|
|
42
|
-
"homepage": "https://github.com/tsedio/tsed/tree/
|
|
51
|
+
"homepage": "https://github.com/tsedio/tsed/tree/beta/packages/platform/common",
|
|
43
52
|
"repository": "https://github.com/tsedio/tsed",
|
|
44
53
|
"funding": [
|
|
45
54
|
{
|
|
@@ -51,36 +60,40 @@
|
|
|
51
60
|
"url": "https://opencollective.com/tsed"
|
|
52
61
|
}
|
|
53
62
|
],
|
|
54
|
-
"scripts": {
|
|
55
|
-
"build": "microbundle --target node --no-compress --format modern,cjs --tsconfig ./tsconfig.compile.json"
|
|
56
|
-
},
|
|
57
63
|
"dependencies": {
|
|
58
|
-
"@tsed/components-scan": "7.0.0-
|
|
59
|
-
"@tsed/core": "7.0.0-
|
|
60
|
-
"@tsed/di": "7.0.0-
|
|
61
|
-
"@tsed/exceptions": "7.0.0-
|
|
62
|
-
"@tsed/json-mapper": "7.0.0-
|
|
63
|
-
"@tsed/logger": "
|
|
64
|
-
"@tsed/
|
|
65
|
-
"@tsed/
|
|
66
|
-
"@tsed/platform-
|
|
67
|
-
"@tsed/platform-
|
|
68
|
-
"@tsed/platform-
|
|
69
|
-
"@tsed/platform-
|
|
70
|
-
"@tsed/platform-
|
|
71
|
-
"@tsed/platform-
|
|
72
|
-
"@tsed/
|
|
73
|
-
"@
|
|
74
|
-
"json-schema": "
|
|
75
|
-
"on-finished": "2.3.
|
|
76
|
-
"
|
|
64
|
+
"@tsed/components-scan": "7.0.0-beta.11",
|
|
65
|
+
"@tsed/core": "7.0.0-beta.11",
|
|
66
|
+
"@tsed/di": "7.0.0-beta.11",
|
|
67
|
+
"@tsed/exceptions": "7.0.0-beta.11",
|
|
68
|
+
"@tsed/json-mapper": "7.0.0-beta.11",
|
|
69
|
+
"@tsed/logger": ">=6.1.1",
|
|
70
|
+
"@tsed/logger-file": ">=6.1.0",
|
|
71
|
+
"@tsed/perf": "7.0.0-beta.11",
|
|
72
|
+
"@tsed/platform-cache": "7.0.0-beta.11",
|
|
73
|
+
"@tsed/platform-exceptions": "7.0.0-beta.11",
|
|
74
|
+
"@tsed/platform-log-middleware": "7.0.0-beta.11",
|
|
75
|
+
"@tsed/platform-middlewares": "7.0.0-beta.11",
|
|
76
|
+
"@tsed/platform-params": "7.0.0-beta.11",
|
|
77
|
+
"@tsed/platform-response-filter": "7.0.0-beta.11",
|
|
78
|
+
"@tsed/platform-views": "7.0.0-beta.11",
|
|
79
|
+
"@tsed/schema": "7.0.0-beta.11",
|
|
80
|
+
"@types/json-schema": "7.0.11",
|
|
81
|
+
"@types/on-finished": "2.3.1",
|
|
82
|
+
"on-finished": "2.4.1",
|
|
83
|
+
"tslib": "2.3.1",
|
|
77
84
|
"uuid": "8.3.2"
|
|
78
85
|
},
|
|
79
|
-
"
|
|
80
|
-
"
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"@tsed/logger": ">=6.1.1",
|
|
88
|
+
"@tsed/logger-file": ">=6.1.0"
|
|
89
|
+
},
|
|
90
|
+
"peerDependenciesMeta": {
|
|
91
|
+
"@tsed/logger": {
|
|
92
|
+
"optional": false
|
|
93
|
+
},
|
|
94
|
+
"@tsed/logger-file": {
|
|
95
|
+
"optional": false
|
|
96
|
+
}
|
|
81
97
|
},
|
|
82
|
-
"
|
|
83
|
-
"publishConfig": {
|
|
84
|
-
"tag": "alpha"
|
|
85
|
-
}
|
|
98
|
+
"devDependencies": {}
|
|
86
99
|
}
|