@tsed/common 7.0.0-alpha.2 → 7.0.0-beta.1
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 +275 -0
- package/lib/cjs/builder/PlatformBuilder.js.map +1 -0
- package/lib/cjs/builder/PlatformControllerBuilder.js +85 -0
- package/lib/cjs/builder/PlatformControllerBuilder.js.map +1 -0
- package/lib/cjs/config/index.js +7 -0
- package/lib/cjs/config/index.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/EndpointDirectoriesSettings.js +3 -0
- package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.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/interfaces/index.js +8 -0
- package/lib/cjs/config/interfaces/index.js.map +1 -0
- package/lib/cjs/config/services/PlatformConfiguration.js +181 -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/httpServer.js +32 -0
- package/lib/cjs/decorators/httpServer.js.map +1 -0
- package/lib/cjs/decorators/httpsServer.js +32 -0
- package/lib/cjs/decorators/httpsServer.js.map +1 -0
- package/lib/cjs/decorators/index.js +21 -0
- package/lib/cjs/decorators/index.js.map +1 -0
- package/lib/cjs/decorators/method/acceptMime.js +28 -0
- package/lib/cjs/decorators/method/acceptMime.js.map +1 -0
- package/lib/cjs/decorators/method/endpointFn.js +15 -0
- package/lib/cjs/decorators/method/endpointFn.js.map +1 -0
- package/lib/cjs/decorators/method/location.js +6 -0
- package/lib/cjs/decorators/method/location.js.map +1 -0
- package/lib/cjs/decorators/method/redirect.js +6 -0
- package/lib/cjs/decorators/method/redirect.js.map +1 -0
- package/lib/cjs/decorators/method/route.js +13 -0
- package/lib/cjs/decorators/method/route.js.map +1 -0
- package/lib/cjs/decorators/method/view.js +34 -0
- package/lib/cjs/decorators/method/view.js.map +1 -0
- package/lib/cjs/decorators/multer/index.js +7 -0
- package/lib/cjs/decorators/multer/index.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 +70 -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/domain/index.js +10 -0
- package/lib/cjs/domain/index.js.map +1 -0
- package/lib/cjs/index.js +34 -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/PathType.js +3 -0
- package/lib/cjs/interfaces/PathType.js.map +1 -0
- package/lib/cjs/interfaces/PlatformAdapter.js +3 -0
- package/lib/cjs/interfaces/PlatformAdapter.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/interfaces/index.js +21 -0
- package/lib/cjs/interfaces/index.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 +55 -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/middlewares/index.js +7 -0
- package/lib/cjs/middlewares/index.js.map +1 -0
- package/lib/cjs/services/FakeRawDriver.js +26 -0
- package/lib/cjs/services/FakeRawDriver.js.map +1 -0
- package/lib/cjs/services/Platform.js +107 -0
- package/lib/cjs/services/Platform.js.map +1 -0
- package/lib/cjs/services/PlatformApplication.js +34 -0
- package/lib/cjs/services/PlatformApplication.js.map +1 -0
- package/lib/cjs/services/PlatformHandler.js +233 -0
- package/lib/cjs/services/PlatformHandler.js.map +1 -0
- package/lib/cjs/services/PlatformMiddlewaresChain.js +34 -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 +126 -0
- package/lib/cjs/services/PlatformRouter.js.map +1 -0
- package/lib/cjs/services/PlatformTest.js +166 -0
- package/lib/cjs/services/PlatformTest.js.map +1 -0
- package/lib/cjs/services/index.js +12 -0
- package/lib/cjs/services/index.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 +34 -0
- package/lib/cjs/utils/createHttpServer.js.map +1 -0
- package/lib/cjs/utils/createHttpsServer.js +34 -0
- package/lib/cjs/utils/createHttpsServer.js.map +1 -0
- package/lib/cjs/utils/createInjector.js +38 -0
- package/lib/cjs/utils/createInjector.js.map +1 -0
- package/lib/cjs/utils/getConfiguration.js +42 -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/index.js +11 -0
- package/lib/cjs/utils/index.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 +271 -0
- package/lib/esm/builder/PlatformBuilder.js.map +1 -0
- package/lib/esm/builder/PlatformControllerBuilder.js +79 -0
- package/lib/esm/builder/PlatformControllerBuilder.js.map +1 -0
- package/lib/esm/config/index.js +4 -0
- package/lib/esm/config/index.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/EndpointDirectoriesSettings.js +2 -0
- package/lib/esm/config/interfaces/EndpointDirectoriesSettings.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/interfaces/index.js +5 -0
- package/lib/esm/config/interfaces/index.js.map +1 -0
- package/lib/esm/config/services/PlatformConfiguration.js +178 -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/httpServer.js +28 -0
- package/lib/esm/decorators/httpServer.js.map +1 -0
- package/lib/esm/decorators/httpsServer.js +28 -0
- package/lib/esm/decorators/httpsServer.js.map +1 -0
- package/lib/esm/decorators/index.js +18 -0
- package/lib/esm/decorators/index.js.map +1 -0
- package/lib/esm/decorators/method/acceptMime.js +24 -0
- package/lib/esm/decorators/method/acceptMime.js.map +1 -0
- package/lib/esm/decorators/method/endpointFn.js +11 -0
- package/lib/esm/decorators/method/endpointFn.js.map +1 -0
- package/lib/esm/decorators/method/location.js +2 -0
- package/lib/esm/decorators/method/location.js.map +1 -0
- package/lib/esm/decorators/method/redirect.js +2 -0
- package/lib/esm/decorators/method/redirect.js.map +1 -0
- package/lib/esm/decorators/method/route.js +2 -0
- package/lib/esm/decorators/method/route.js.map +1 -0
- package/lib/esm/decorators/method/view.js +30 -0
- package/lib/esm/decorators/method/view.js.map +1 -0
- package/lib/esm/decorators/multer/index.js +4 -0
- package/lib/esm/decorators/multer/index.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 +67 -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/domain/index.js +7 -0
- package/lib/esm/domain/index.js.map +1 -0
- package/lib/esm/index.js +28 -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/PathType.js +2 -0
- package/lib/esm/interfaces/PathType.js.map +1 -0
- package/lib/esm/interfaces/PlatformAdapter.js +2 -0
- package/lib/esm/interfaces/PlatformAdapter.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/interfaces/index.js +18 -0
- package/lib/esm/interfaces/index.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 +52 -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/middlewares/index.js +4 -0
- package/lib/esm/middlewares/index.js.map +1 -0
- package/lib/esm/services/FakeRawDriver.js +22 -0
- package/lib/esm/services/FakeRawDriver.js.map +1 -0
- package/lib/esm/services/Platform.js +104 -0
- package/lib/esm/services/Platform.js.map +1 -0
- package/lib/esm/services/PlatformApplication.js +31 -0
- package/lib/esm/services/PlatformApplication.js.map +1 -0
- package/lib/esm/services/PlatformHandler.js +230 -0
- package/lib/esm/services/PlatformHandler.js.map +1 -0
- package/lib/esm/services/PlatformMiddlewaresChain.js +31 -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 +123 -0
- package/lib/esm/services/PlatformRouter.js.map +1 -0
- package/lib/esm/services/PlatformTest.js +162 -0
- package/lib/esm/services/PlatformTest.js.map +1 -0
- package/lib/esm/services/index.js +9 -0
- package/lib/esm/services/index.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 +29 -0
- package/lib/esm/utils/createHttpServer.js.map +1 -0
- package/lib/esm/utils/createHttpsServer.js +29 -0
- package/lib/esm/utils/createHttpsServer.js.map +1 -0
- package/lib/esm/utils/createInjector.js +34 -0
- package/lib/esm/utils/createInjector.js.map +1 -0
- package/lib/esm/utils/getConfiguration.js +38 -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/index.js +8 -0
- package/lib/esm/utils/index.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 +25 -30
- package/lib/types/builder/PlatformControllerBuilder.d.ts +17 -0
- package/lib/{config → types/config}/index.d.ts +0 -0
- package/lib/{config → types/config}/interfaces/ConverterSettings.d.ts +0 -0
- package/lib/{config → types/config}/interfaces/EndpointDirectoriesSettings.d.ts +0 -0
- package/lib/{config → types/config}/interfaces/PlatformLoggerSettings.d.ts +0 -0
- package/lib/{config → types/config}/interfaces/PlatformMulterSettings.d.ts +0 -0
- package/lib/{config → types/config}/interfaces/PlatformStaticsSettings.d.ts +1 -0
- package/lib/{config → types/config}/interfaces/index.d.ts +14 -1
- package/lib/{config → types/config}/services/PlatformConfiguration.d.ts +12 -11
- package/lib/{constants → types/constants}/routerOptions.d.ts +0 -0
- package/lib/{decorators → types/decorators}/httpServer.d.ts +1 -0
- package/lib/{decorators → types/decorators}/httpsServer.d.ts +1 -0
- package/lib/{decorators → types/decorators}/index.d.ts +1 -0
- package/lib/{decorators → types/decorators}/method/acceptMime.d.ts +0 -0
- package/lib/{decorators → types/decorators}/method/endpointFn.d.ts +1 -0
- package/lib/{decorators → types/decorators}/method/location.d.ts +0 -0
- package/lib/{decorators → types/decorators}/method/redirect.d.ts +0 -0
- package/lib/{decorators → types/decorators}/method/route.d.ts +0 -0
- package/lib/types/decorators/method/view.d.ts +25 -0
- package/lib/{decorators → types/decorators}/multer/index.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/{domain → types/domain}/EndpointMetadata.d.ts +3 -41
- package/lib/{domain → types/domain}/HandlerMetadata.d.ts +2 -2
- package/lib/{domain → types/domain}/PlatformContext.d.ts +0 -0
- package/lib/{domain → types/domain}/PlatformRouteDetails.d.ts +4 -10
- package/lib/{domain → types/domain}/index.d.ts +0 -0
- package/lib/{index.d.ts → types/index.d.ts} +1 -3
- 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}/PathType.d.ts +0 -0
- package/lib/types/interfaces/PlatformAdapter.d.ts +19 -0
- package/lib/{interfaces → types/interfaces}/PlatformRouteOptions.d.ts +6 -4
- package/lib/{interfaces → types/interfaces}/ResponseErrorObject.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/Route.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/index.d.ts +1 -1
- package/lib/{middlewares → types/middlewares}/PlatformAcceptMimesMiddleware.d.ts +0 -0
- package/lib/{middlewares → types/middlewares}/PlatformMulterMiddleware.d.ts +0 -0
- package/lib/{middlewares/data → types/middlewares/__mock__}/FakeCtrl.d.ts +0 -0
- package/lib/{middlewares → types/middlewares}/bindEndpointMiddleware.d.ts +0 -0
- package/lib/{middlewares → types/middlewares}/index.d.ts +0 -0
- package/lib/{services → types/services}/FakeRawDriver.d.ts +0 -0
- package/lib/{services → types/services}/Platform.d.ts +12 -6
- package/lib/{services → types/services}/PlatformApplication.d.ts +0 -0
- package/lib/{services → types/services}/PlatformHandler.d.ts +0 -0
- package/lib/types/services/PlatformMiddlewaresChain.d.ts +6 -0
- package/lib/{services → types/services}/PlatformRequest.d.ts +2 -1
- package/lib/{services → types/services}/PlatformResponse.d.ts +4 -4
- package/lib/{services → types/services}/PlatformRouter.d.ts +3 -2
- package/lib/{services → types/services}/PlatformTest.d.ts +7 -6
- package/lib/{services → types/services}/index.d.ts +1 -0
- package/lib/{utils → types/utils}/createContext.d.ts +0 -0
- package/lib/{utils → types/utils}/createHandlerMetadata.d.ts +0 -0
- package/lib/types/utils/createHttpServer.d.ts +4 -0
- package/lib/types/utils/createHttpsServer.d.ts +4 -0
- package/lib/types/utils/createInjector.d.ts +7 -0
- package/lib/types/utils/getConfiguration.d.ts +2 -0
- package/lib/types/utils/getStaticsOptions.d.ts +5 -0
- package/lib/{utils → types/utils}/index.d.ts +0 -1
- 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 +29 -28
- package/tsconfig.compile.esm.json +23 -0
- package/lib/PlatformModule.d.ts +0 -15
- package/lib/builder/PlatformControllerBuilder.d.ts +0 -19
- package/lib/domain/ControllerProvider.d.ts +0 -53
- 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/PlatformRouterMethods.d.ts +0 -10
- package/lib/registries/ControllerRegistry.d.ts +0 -1
- 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/listenServer.d.ts +0 -10
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HandlerType } from "../interfaces/HandlerType";
|
|
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,32 +1,20 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { Type } from "@tsed/core";
|
|
2
|
-
import {
|
|
3
|
+
import { InjectorService, IProvider } 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 { IncomingMessage, ServerResponse } from "http";
|
|
7
|
+
import { PlatformAdapter, PlatformBuilderSettings } from "../interfaces/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>;
|
|
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>;
|
|
@@ -55,7 +43,16 @@ export declare abstract class PlatformBuilder<App = TsED.Application, Router = T
|
|
|
55
43
|
get settings(): TsED.Configuration & import("@tsed/di").DIConfiguration;
|
|
56
44
|
get logger(): import("@tsed/di").DILogger;
|
|
57
45
|
get disableBootstrapLog(): boolean | undefined;
|
|
58
|
-
static
|
|
46
|
+
static create<App = TsED.Application, Router = TsED.Router>(module: Type<any>, settings: PlatformBuilderSettings<App, Router>): PlatformBuilder<App, Router>;
|
|
47
|
+
static build<App = TsED.Application, Router = TsED.Router>(module: Type<any>, { adapter, ...settings }: PlatformBuilderSettings<App, Router>): PlatformBuilder<App, Router>;
|
|
48
|
+
/**
|
|
49
|
+
* Bootstrap a server application
|
|
50
|
+
* @param module
|
|
51
|
+
* @param settings
|
|
52
|
+
*/
|
|
53
|
+
static bootstrap<App = TsED.Application, Router = TsED.Router>(module: Type<any>, settings: PlatformBuilderSettings<App, Router>): Promise<PlatformBuilder<App, Router>>;
|
|
54
|
+
callback(): (req: IncomingMessage, res: ServerResponse) => void;
|
|
55
|
+
callback(req: IncomingMessage, res: ServerResponse): void;
|
|
59
56
|
log(...data: any[]): any;
|
|
60
57
|
/**
|
|
61
58
|
* Add classes to the components list
|
|
@@ -83,14 +80,17 @@ export declare abstract class PlatformBuilder<App = TsED.Application, Router = T
|
|
|
83
80
|
* @param {any[]} controllers
|
|
84
81
|
*/
|
|
85
82
|
addControllers(endpoint: string, controllers: any | string | (any | string)[]): void;
|
|
86
|
-
runLifecycle(): Promise<
|
|
83
|
+
runLifecycle(): Promise<this>;
|
|
87
84
|
loadInjector(): Promise<void>;
|
|
88
|
-
listen(): Promise<void>;
|
|
85
|
+
listen(network?: boolean): Promise<void>;
|
|
89
86
|
stop(): Promise<void>;
|
|
90
87
|
ready(): Promise<void>;
|
|
91
88
|
callHook(hook: string, ...args: any[]): Promise<void>;
|
|
92
|
-
loadStatics(): Promise<void>;
|
|
89
|
+
loadStatics(hook: string): Promise<void>;
|
|
93
90
|
useProvider(token: Type<any>, settings?: Partial<IProvider>): this;
|
|
91
|
+
bootstrap(): Promise<this>;
|
|
92
|
+
protected loadRoutes(): Promise<void>;
|
|
93
|
+
protected diff(): string;
|
|
94
94
|
protected importProviders(): Promise<void>;
|
|
95
95
|
/**
|
|
96
96
|
* Load middlewares from configuration for the given hook
|
|
@@ -98,12 +98,7 @@ export declare abstract class PlatformBuilder<App = TsED.Application, Router = T
|
|
|
98
98
|
* @protected
|
|
99
99
|
*/
|
|
100
100
|
protected loadMiddlewaresFor(hook: string): void;
|
|
101
|
-
protected
|
|
102
|
-
protected useContext(): this;
|
|
103
|
-
protected bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<this>;
|
|
101
|
+
protected createHttpServers(): void;
|
|
104
102
|
protected listenServers(): Promise<void>;
|
|
105
103
|
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
104
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
*/
|
|
17
|
+
export declare function buildRouter(injector: InjectorService, provider: ControllerProvider): PlatformRouter<TsED.Router>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Env } from "@tsed/core";
|
|
3
|
-
import Https from "https";
|
|
4
3
|
import { ConverterSettings } from "./ConverterSettings";
|
|
5
4
|
import { EndpointDirectoriesSettings } from "./EndpointDirectoriesSettings";
|
|
6
5
|
import { PlatformLoggerSettings } from "./PlatformLoggerSettings";
|
|
7
6
|
import { PlatformMulterSettings } from "./PlatformMulterSettings";
|
|
8
7
|
import { PlatformStaticsSettings } from "./PlatformStaticsSettings";
|
|
8
|
+
import type Http from "http";
|
|
9
|
+
import type Https from "https";
|
|
9
10
|
declare global {
|
|
10
11
|
namespace TsED {
|
|
11
12
|
interface LoggerConfiguration extends Partial<PlatformLoggerSettings> {
|
|
@@ -27,6 +28,14 @@ declare global {
|
|
|
27
28
|
* Port number for the [HTTP.Server](https://nodejs.org/api/http.html#http_class_http_server).
|
|
28
29
|
*/
|
|
29
30
|
httpPort: string | number | boolean;
|
|
31
|
+
/**
|
|
32
|
+
* [Https.ServerOptions](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)):
|
|
33
|
+
* - `key` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | <Object[]>: The private key of the server in PEM format. To support multiple keys using different algorithms an array can be provided either as a plain array of key strings or an array of objects in the format `{pem: key, passphrase: passphrase}`. This option is required for ciphers that make use of private keys.
|
|
34
|
+
* - `passphrase` <string> A string containing the passphrase for the private key or pfx.
|
|
35
|
+
* - `cert` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers containing the certificate key of the server in PEM format. (Required)
|
|
36
|
+
* - `ca` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers of trusted certificates in PEM format. If this is omitted several well known "root" CAs (like VeriSign) will be used. These are used to authorize connections.
|
|
37
|
+
*/
|
|
38
|
+
httpOptions: Http.ServerOptions;
|
|
30
39
|
/**
|
|
31
40
|
* Port number for the [HTTPs.Server](https://nodejs.org/api/https.html#https_class_https_server).
|
|
32
41
|
*/
|
|
@@ -47,6 +56,10 @@ declare global {
|
|
|
47
56
|
* List of directories to scan [Services](/docs/services.md), [Middlewares](/docs/middlewares.md) or [Converters](/docs/converters.md).
|
|
48
57
|
*/
|
|
49
58
|
componentsScan: (string | RegExp)[];
|
|
59
|
+
/**
|
|
60
|
+
* Disable the glob pattern. In v7 the componentsScan options will be removed in favor of external module loader.
|
|
61
|
+
*/
|
|
62
|
+
disableComponentsScan: boolean;
|
|
50
63
|
/**
|
|
51
64
|
* List of glob patterns. Exclude all files which matching with this list when Server scan all components with the `mount` or `scanComponents` options.
|
|
52
65
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Env } from "@tsed/core";
|
|
2
|
+
import { Env, getHostInfoFromPort } from "@tsed/core";
|
|
3
3
|
import { DIConfiguration } from "@tsed/di";
|
|
4
4
|
import Https from "https";
|
|
5
5
|
import { EndpointDirectoriesSettings, PlatformLoggerSettings } from "../interfaces";
|
|
@@ -40,20 +40,11 @@ export declare class PlatformConfiguration extends DIConfiguration {
|
|
|
40
40
|
get exclude(): string[];
|
|
41
41
|
set exclude(exclude: string[]);
|
|
42
42
|
get additionalProperties(): boolean;
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @param addressPort
|
|
46
|
-
* @returns {{address: string, port: number}}
|
|
47
|
-
*/
|
|
48
|
-
private static buildAddressAndPort;
|
|
49
43
|
/**
|
|
50
44
|
*
|
|
51
45
|
* @returns {string|number}
|
|
52
46
|
*/
|
|
53
|
-
getHttpPort():
|
|
54
|
-
address: string;
|
|
55
|
-
port: number;
|
|
56
|
-
};
|
|
47
|
+
getHttpPort(): ReturnType<typeof getHostInfoFromPort>;
|
|
57
48
|
/**
|
|
58
49
|
*
|
|
59
50
|
* @param settings
|
|
@@ -67,8 +58,10 @@ export declare class PlatformConfiguration extends DIConfiguration {
|
|
|
67
58
|
* @returns {string|number}
|
|
68
59
|
*/
|
|
69
60
|
getHttpsPort(): {
|
|
61
|
+
protocol: string;
|
|
70
62
|
address: string;
|
|
71
63
|
port: number;
|
|
64
|
+
toString(): string;
|
|
72
65
|
};
|
|
73
66
|
/**
|
|
74
67
|
*
|
|
@@ -78,4 +71,12 @@ export declare class PlatformConfiguration extends DIConfiguration {
|
|
|
78
71
|
address: string;
|
|
79
72
|
port: number;
|
|
80
73
|
}): void;
|
|
74
|
+
getBestHost(): {
|
|
75
|
+
protocol: string;
|
|
76
|
+
address: string;
|
|
77
|
+
port: number;
|
|
78
|
+
toString(): string;
|
|
79
|
+
} | {
|
|
80
|
+
toString(): string;
|
|
81
|
+
};
|
|
81
82
|
}
|
|
File without changes
|
|
@@ -22,6 +22,7 @@ import Http from "http";
|
|
|
22
22
|
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
23
23
|
* @returns {any}
|
|
24
24
|
* @decorator
|
|
25
|
+
* @deprecated Use Https.Server from "http"
|
|
25
26
|
*/
|
|
26
27
|
export declare function HttpServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
|
|
27
28
|
export declare type HttpServer = Http.Server;
|
|
@@ -22,6 +22,7 @@ import Https from "https";
|
|
|
22
22
|
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
23
23
|
* @returns {any}
|
|
24
24
|
* @decorator
|
|
25
|
+
* @deprecated Use Https.Server from "https"
|
|
25
26
|
*/
|
|
26
27
|
export declare function HttpsServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
|
|
27
28
|
export declare type HttpsServer = Https.Server;
|
|
@@ -6,6 +6,7 @@ export * from "./method/acceptMime";
|
|
|
6
6
|
export * from "./method/location";
|
|
7
7
|
export * from "./method/redirect";
|
|
8
8
|
export * from "./method/endpointFn";
|
|
9
|
+
export * from "./method/view";
|
|
9
10
|
export * from "./params/response";
|
|
10
11
|
export * from "./params/request";
|
|
11
12
|
export * from "./params/next";
|
|
File without changes
|
|
@@ -4,5 +4,6 @@ import { EndpointMetadata } from "../../domain";
|
|
|
4
4
|
*
|
|
5
5
|
* @param fn
|
|
6
6
|
* @decorator
|
|
7
|
+
* @deprecated Deprecated since 2021-10-05. Use JsonEntityFn instead.
|
|
7
8
|
*/
|
|
8
9
|
export declare function EndpointFn(fn: (endpoint: EndpointMetadata, parameters: DecoratorParameters) => void): MethodDecorator;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use a view and sends the rendered HTML string to the client. Optional parameter:
|
|
3
|
+
*
|
|
4
|
+
* * viewOptions, an object whose properties define local variables for the view.
|
|
5
|
+
*
|
|
6
|
+
* The view argument is a string that is the file path of the view file to render.
|
|
7
|
+
* This can be an absolute path, or a path relative to the views setting.
|
|
8
|
+
* If the path does not contain a file extension, then the view engine setting determines the file extension.
|
|
9
|
+
* If the path does contain a file extension, then Express will load the module for the specified template engine (via require())
|
|
10
|
+
* and render it using the loaded module’s __express function.
|
|
11
|
+
*
|
|
12
|
+
* For more information, see [Using template engines with Express](http://expressjs.com/guide/using-template-engines.html).
|
|
13
|
+
*
|
|
14
|
+
* > NOTE: The view argument performs file system operations like reading a file from disk and evaluating Node.js modules,
|
|
15
|
+
* and as so for security reasons should not contain input from the end-user.
|
|
16
|
+
*
|
|
17
|
+
* @param path Relative path to the view file.
|
|
18
|
+
* @param options Additional options
|
|
19
|
+
* @decorator
|
|
20
|
+
* @operation
|
|
21
|
+
* @response
|
|
22
|
+
* @ignores
|
|
23
|
+
* @deprecated Use View decorator from @tsed/platform-views instead.
|
|
24
|
+
*/
|
|
25
|
+
export declare function View(path: string, options?: Object): MethodDecorator;
|
|
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
|
+
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
2
|
import { ParamMetadata } from "@tsed/platform-params";
|
|
3
|
-
import {
|
|
4
|
-
export interface EndpointConstructorOptions extends JsonEntityStoreOptions {
|
|
5
|
-
beforeMiddlewares?: Function[];
|
|
6
|
-
middlewares?: Function[];
|
|
7
|
-
afterMiddlewares?: Function[];
|
|
8
|
-
}
|
|
3
|
+
import { JsonMethodStore } from "@tsed/schema";
|
|
9
4
|
export interface EndpointViewOptions {
|
|
10
5
|
path: string;
|
|
11
6
|
options: any;
|
|
@@ -30,28 +25,13 @@ export interface EndpointRedirectOptions {
|
|
|
30
25
|
* }
|
|
31
26
|
*
|
|
32
27
|
*/
|
|
33
|
-
export declare class EndpointMetadata extends
|
|
34
|
-
beforeMiddlewares: any[];
|
|
35
|
-
middlewares: any[];
|
|
36
|
-
afterMiddlewares: any[];
|
|
37
|
-
constructor(options: EndpointConstructorOptions);
|
|
28
|
+
export declare class EndpointMetadata extends JsonMethodStore {
|
|
38
29
|
get targetName(): string;
|
|
39
30
|
get params(): ParamMetadata[];
|
|
40
|
-
/**
|
|
41
|
-
* Return the JsonOperation
|
|
42
|
-
*/
|
|
43
|
-
get operation(): JsonOperation;
|
|
44
|
-
get operationPaths(): Map<string, import("@tsed/schema").JsonMethodPath>;
|
|
45
31
|
get view(): EndpointViewOptions;
|
|
46
32
|
set view(view: EndpointViewOptions);
|
|
47
33
|
get acceptMimes(): string[];
|
|
48
34
|
set acceptMimes(mimes: string[]);
|
|
49
|
-
/**
|
|
50
|
-
* Get all endpoints from a given class and his parents.
|
|
51
|
-
* @param {Type<any>} target
|
|
52
|
-
* @returns {EndpointMetadata[]}
|
|
53
|
-
*/
|
|
54
|
-
static getEndpoints(target: Type<any>): EndpointMetadata[];
|
|
55
35
|
/**
|
|
56
36
|
* Get an endpoint.
|
|
57
37
|
* @param target
|
|
@@ -59,7 +39,7 @@ export declare class EndpointMetadata extends JsonEntityStore implements Endpoin
|
|
|
59
39
|
* @param descriptor
|
|
60
40
|
*/
|
|
61
41
|
static get(target: Type<any>, propertyKey: string | symbol, descriptor?: PropertyDescriptor): EndpointMetadata;
|
|
62
|
-
addOperationPath(method: string, path: string | RegExp, options?: any): JsonOperation;
|
|
42
|
+
addOperationPath(method: string, path: string | RegExp, options?: any): import("@tsed/schema").JsonOperation;
|
|
63
43
|
/**
|
|
64
44
|
* Find the a value at the controller level. Let this value be extended or overridden by the endpoint itself.
|
|
65
45
|
*
|
|
@@ -67,22 +47,4 @@ export declare class EndpointMetadata extends JsonEntityStore implements Endpoin
|
|
|
67
47
|
* @returns {any}
|
|
68
48
|
*/
|
|
69
49
|
get<T = any>(key: any): T;
|
|
70
|
-
/**
|
|
71
|
-
* Append middlewares to the beforeMiddlewares list.
|
|
72
|
-
* @param args
|
|
73
|
-
* @returns {EndpointMetadata}
|
|
74
|
-
*/
|
|
75
|
-
before(args: Function[]): this;
|
|
76
|
-
/**
|
|
77
|
-
* Append middlewares to the afterMiddlewares list.
|
|
78
|
-
* @param args
|
|
79
|
-
* @returns {EndpointMetadata}
|
|
80
|
-
*/
|
|
81
|
-
after(args: Function[]): this;
|
|
82
|
-
/**
|
|
83
|
-
* Store all arguments collected via Annotation.
|
|
84
|
-
* @param args
|
|
85
|
-
*/
|
|
86
|
-
use(args: Function[]): this;
|
|
87
|
-
clone(): EndpointMetadata;
|
|
88
50
|
}
|
|
@@ -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;
|
|
File without changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JsonOperationRoute } from "@tsed/schema";
|
|
1
2
|
import { EndpointMetadata } from "./EndpointMetadata";
|
|
2
3
|
import { ControllerProvider } from "./ControllerProvider";
|
|
3
4
|
export interface PlatformRouterDetailsOptions {
|
|
@@ -6,24 +7,17 @@ export interface PlatformRouterDetailsOptions {
|
|
|
6
7
|
method: string;
|
|
7
8
|
url: string;
|
|
8
9
|
}
|
|
9
|
-
export declare class PlatformRouteDetails {
|
|
10
|
-
readonly method: string;
|
|
11
|
-
readonly url: string;
|
|
10
|
+
export declare class PlatformRouteDetails extends JsonOperationRoute<EndpointMetadata> {
|
|
12
11
|
readonly rawBody: boolean;
|
|
13
|
-
readonly endpoint: EndpointMetadata;
|
|
14
12
|
readonly provider: ControllerProvider;
|
|
15
|
-
constructor(
|
|
16
|
-
get name(): string;
|
|
17
|
-
get className(): string;
|
|
18
|
-
get methodClassName(): string;
|
|
19
|
-
get parameters(): import("@tsed/platform-params").ParamMetadata[];
|
|
13
|
+
constructor(options?: Partial<PlatformRouteDetails>);
|
|
20
14
|
toJSON(): {
|
|
21
15
|
method: string;
|
|
22
16
|
name: string;
|
|
23
17
|
url: string;
|
|
24
18
|
className: string;
|
|
25
19
|
methodClassName: string;
|
|
26
|
-
parameters:
|
|
20
|
+
parameters: any;
|
|
27
21
|
rawBody: boolean;
|
|
28
22
|
};
|
|
29
23
|
}
|
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import "@tsed/logger";
|
|
1
2
|
export * from "@tsed/di";
|
|
2
3
|
export * from "@tsed/platform-params";
|
|
3
4
|
export * from "@tsed/platform-exceptions";
|
|
4
5
|
export * from "@tsed/platform-response-filter";
|
|
5
6
|
export * from "@tsed/platform-cache";
|
|
6
7
|
export * from "@tsed/platform-middlewares";
|
|
7
|
-
export * from "@tsed/platform-views";
|
|
8
8
|
export * from "@tsed/components-scan";
|
|
9
9
|
export * from "@tsed/platform-log-middleware";
|
|
10
10
|
export { $log, Logger } from "@tsed/logger";
|
|
@@ -17,6 +17,4 @@ export * from "./interfaces";
|
|
|
17
17
|
export * from "./middlewares";
|
|
18
18
|
export * from "./domain";
|
|
19
19
|
export * from "./services";
|
|
20
|
-
export * from "./registries/ControllerRegistry";
|
|
21
20
|
export * from "./utils";
|
|
22
|
-
export * from "./PlatformModule";
|
|
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
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import { IProvider } from "@tsed/di";
|
|
3
|
+
export interface PlatformAdapter<App = TsED.Application, Router = TsED.Router> {
|
|
4
|
+
/**
|
|
5
|
+
* Load providers in top priority
|
|
6
|
+
*/
|
|
7
|
+
readonly providers: IProvider[];
|
|
8
|
+
/**
|
|
9
|
+
* Called after the injector instantiation
|
|
10
|
+
*/
|
|
11
|
+
onInit?: () => any;
|
|
12
|
+
beforeLoadRoutes?: () => Promise<any>;
|
|
13
|
+
afterLoadRoutes?: () => Promise<any>;
|
|
14
|
+
useRouter?: () => any;
|
|
15
|
+
useContext?: () => any;
|
|
16
|
+
}
|
|
17
|
+
export interface PlatformBuilderSettings<App = TsED.Application, Router = TsED.Router> extends Partial<TsED.Configuration> {
|
|
18
|
+
adapter?: Type<PlatformAdapter<App, Router>>;
|
|
19
|
+
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import { PathType } from "./PathType";
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|