@tsed/common 7.0.0-alpha.1 → 7.0.0-beta.3
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 +26 -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/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 +14 -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/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 -16
- 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 +17 -2
- package/lib/{config → types/config}/services/PlatformConfiguration.d.ts +13 -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 -5
- package/lib/{decorators → types/decorators}/method/acceptMime.d.ts +0 -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 -42
- package/lib/{domain → types/domain}/HandlerMetadata.d.ts +2 -2
- package/lib/{domain → types/domain}/PlatformContext.d.ts +1 -1
- 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} +2 -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 +5 -3
- 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 -2
- 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 -1
- 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 +3 -8
- 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 +4 -3
- package/lib/{services → types/services}/PlatformTest.d.ts +7 -6
- package/lib/{services → types/services}/index.d.ts +1 -1
- 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 -24
- package/tsconfig.compile.esm.json +23 -0
- package/lib/PlatformModule.d.ts +0 -15
- package/lib/builder/PlatformControllerBuilder.d.ts +0 -19
- package/lib/decorators/class/controller.d.ts +0 -43
- 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 -128
- package/lib/domain/ControllerProvider.d.ts +0 -54
- package/lib/index.js +0 -3990
- package/lib/index.js.map +0 -1
- package/lib/index.modern.js +0 -3870
- package/lib/index.modern.js.map +0 -1
- package/lib/interfaces/PlatformRouterMethods.d.ts +0 -10
- package/lib/middlewares/PlatformLogMiddleware.d.ts +0 -44
- package/lib/registries/ControllerRegistry.d.ts +0 -1
- package/lib/services/ConverterService.d.ts +0 -27
- 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
|
@@ -8,24 +8,30 @@ 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[];
|
|
24
25
|
getMountedControllers(): RouteController[];
|
|
26
|
+
protected $onInit(): void;
|
|
25
27
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @
|
|
28
|
-
* @param endpointUrl
|
|
28
|
+
* Create routers from the collected controllers.
|
|
29
|
+
* @private
|
|
29
30
|
*/
|
|
30
|
-
private
|
|
31
|
+
private createRouters;
|
|
32
|
+
/**
|
|
33
|
+
* Create controllers from DI
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
private buildControllers;
|
|
31
37
|
}
|
|
File without changes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InjectorService, Provider } from "@tsed/di";
|
|
2
2
|
import { ArgScope, HandlerWithScope, PlatformParams } from "@tsed/platform-params";
|
|
3
|
+
import { PlatformResponseFilter } from "@tsed/platform-response-filter";
|
|
3
4
|
import { EndpointMetadata } from "../domain/EndpointMetadata";
|
|
4
5
|
import { HandlerMetadata } from "../domain/HandlerMetadata";
|
|
5
6
|
import { PlatformContext } from "../domain/PlatformContext";
|
|
@@ -19,6 +20,7 @@ export interface OnRequestOptions {
|
|
|
19
20
|
export declare class PlatformHandler {
|
|
20
21
|
protected injector: InjectorService;
|
|
21
22
|
protected params: PlatformParams;
|
|
23
|
+
protected responseFilter: PlatformResponseFilter;
|
|
22
24
|
constructor(injector: InjectorService, params: PlatformParams);
|
|
23
25
|
/**
|
|
24
26
|
* Create a native middleware based on the given metadata and return an instance of AnyToPromiseWithCtx
|
|
@@ -46,7 +48,7 @@ export declare class PlatformHandler {
|
|
|
46
48
|
* @param requestOptions
|
|
47
49
|
*/
|
|
48
50
|
protected onRequest(requestOptions: OnRequestOptions): Promise<any>;
|
|
49
|
-
protected onError(er:
|
|
51
|
+
protected onError(er: Error, requestOptions: OnRequestOptions): Promise<any>;
|
|
50
52
|
/**
|
|
51
53
|
* Manage success scenario
|
|
52
54
|
* @param data
|
|
@@ -62,13 +64,6 @@ export declare class PlatformHandler {
|
|
|
62
64
|
* @protected
|
|
63
65
|
*/
|
|
64
66
|
protected callReturnedMiddleware(middleware: any, ctx: PlatformContext, next: any): any;
|
|
65
|
-
/**
|
|
66
|
-
* Render the view if the endpoint has a configured view.
|
|
67
|
-
* @param data
|
|
68
|
-
* @param ctx
|
|
69
|
-
* @protected
|
|
70
|
-
*/
|
|
71
|
-
protected render(data: any, ctx: PlatformContext): Promise<any>;
|
|
72
67
|
/**
|
|
73
68
|
* create Raw handler
|
|
74
69
|
* @param metadata
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { JsonOperationRoute } from "@tsed/schema";
|
|
2
|
+
import { ControllerProvider } from "../domain/ControllerProvider";
|
|
3
|
+
import { EndpointMetadata } from "../domain/EndpointMetadata";
|
|
4
|
+
export declare class PlatformMiddlewaresChain {
|
|
5
|
+
get(provider: ControllerProvider, operationRoute: JsonOperationRoute<EndpointMetadata>): any[];
|
|
6
|
+
}
|
|
@@ -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 { PlatformViews } from "@tsed/platform-views";
|
|
3
2
|
import { 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
|
*/
|
|
@@ -139,7 +139,7 @@ export declare class PlatformResponse<T extends Record<string, any> = any> {
|
|
|
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
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InjectorService } from "@tsed/di";
|
|
1
|
+
import { InjectorService, PathType } from "@tsed/di";
|
|
2
2
|
import { PlatformMulter, PlatformMulterSettings, PlatformStaticsOptions } from "../config";
|
|
3
|
-
import {
|
|
3
|
+
import { PlatformRouteOptions, PlatformRouteWithoutHandlers } from "../interfaces";
|
|
4
4
|
import { PlatformHandler } from "./PlatformHandler";
|
|
5
5
|
/**
|
|
6
6
|
* @ignore
|
|
@@ -20,6 +20,7 @@ export declare class PlatformRouter<Router = TsED.Router> {
|
|
|
20
20
|
protected platformHandler: PlatformHandler;
|
|
21
21
|
rawRouter: Router;
|
|
22
22
|
raw: any;
|
|
23
|
+
isBuilt: boolean;
|
|
23
24
|
injector: InjectorService;
|
|
24
25
|
constructor(platformHandler: PlatformHandler);
|
|
25
26
|
/**
|
|
@@ -32,7 +33,7 @@ export declare class PlatformRouter<Router = TsED.Router> {
|
|
|
32
33
|
callback(): any;
|
|
33
34
|
getRouter(): Router;
|
|
34
35
|
use(...handlers: any[]): this;
|
|
35
|
-
addRoute(options: PlatformRouteOptions): this;
|
|
36
|
+
addRoute(options: Partial<PlatformRouteOptions>): this;
|
|
36
37
|
all(path: PathType, ...handlers: any[]): this;
|
|
37
38
|
get(path: PathType, ...handlers: any[]): this;
|
|
38
39
|
post(path: PathType, ...handlers: any[]): this;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DITest, InjectorService } from "@tsed/di";
|
|
3
|
-
import { PlatformBuilder } from "../builder/PlatformBuilder";
|
|
1
|
+
import { DITest, DITestOptions, InjectorService } from "@tsed/di";
|
|
4
2
|
import { PlatformContext, PlatformContextOptions } from "../domain/PlatformContext";
|
|
3
|
+
import { PlatformAdapter, PlatformBuilderSettings } from "../interfaces/PlatformAdapter";
|
|
4
|
+
import { Type } from "@tsed/core";
|
|
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
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InjectorService, IProvider } from "@tsed/di";
|
|
2
|
+
interface CreateInjectorOptions {
|
|
3
|
+
providers?: IProvider[];
|
|
4
|
+
settings?: Partial<TsED.Configuration>;
|
|
5
|
+
}
|
|
6
|
+
export declare function createInjector({ providers, settings }: CreateInjectorOptions): InjectorService;
|
|
7
|
+
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,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/common",
|
|
3
|
-
"version": "7.0.0-
|
|
3
|
+
"version": "7.0.0-beta.3",
|
|
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
|
-
"typings": "./lib/index.d.ts",
|
|
7
|
+
"main": "./lib/cjs/index.js",
|
|
8
|
+
"typings": "./lib/types/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"types": "./lib/types/index.d.ts",
|
|
11
|
+
"import": "./lib/esm/index.js",
|
|
12
|
+
"require": "./lib/cjs/index.js",
|
|
13
|
+
"default": "./lib/esm/index.js"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "yarn run build:esm && yarn run build:cjs",
|
|
17
|
+
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
18
|
+
"build:esm": "tsc --build tsconfig.compile.esm.json"
|
|
12
19
|
},
|
|
13
20
|
"keywords": [
|
|
14
21
|
"Express",
|
|
@@ -39,7 +46,7 @@
|
|
|
39
46
|
"bugs": {
|
|
40
47
|
"url": "https://github.com/tsedio/tsed/issues"
|
|
41
48
|
},
|
|
42
|
-
"homepage": "https://github.com/tsedio/tsed/tree/
|
|
49
|
+
"homepage": "https://github.com/tsedio/tsed/tree/beta/packages/platform/common",
|
|
43
50
|
"repository": "https://github.com/tsedio/tsed",
|
|
44
51
|
"funding": [
|
|
45
52
|
{
|
|
@@ -51,26 +58,24 @@
|
|
|
51
58
|
"url": "https://opencollective.com/tsed"
|
|
52
59
|
}
|
|
53
60
|
],
|
|
54
|
-
"scripts": {
|
|
55
|
-
"build": "microbundle --target node --no-compress --format modern,cjs --tsconfig ./tsconfig.compile.json"
|
|
56
|
-
},
|
|
57
61
|
"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/
|
|
62
|
+
"@tsed/components-scan": "7.0.0-beta.3",
|
|
63
|
+
"@tsed/core": "7.0.0-beta.3",
|
|
64
|
+
"@tsed/di": "7.0.0-beta.3",
|
|
65
|
+
"@tsed/exceptions": "7.0.0-beta.3",
|
|
66
|
+
"@tsed/json-mapper": "7.0.0-beta.3",
|
|
67
|
+
"@tsed/logger": "^6.0.0",
|
|
68
|
+
"@tsed/logger-file": "^6.0.0",
|
|
69
|
+
"@tsed/perf": "7.0.0-beta.3",
|
|
70
|
+
"@tsed/platform-cache": "7.0.0-beta.3",
|
|
71
|
+
"@tsed/platform-exceptions": "7.0.0-beta.3",
|
|
72
|
+
"@tsed/platform-log-middleware": "7.0.0-beta.3",
|
|
73
|
+
"@tsed/platform-middlewares": "7.0.0-beta.3",
|
|
74
|
+
"@tsed/platform-params": "7.0.0-beta.3",
|
|
75
|
+
"@tsed/platform-response-filter": "7.0.0-beta.3",
|
|
76
|
+
"@tsed/platform-views": "7.0.0-beta.3",
|
|
77
|
+
"@tsed/schema": "7.0.0-beta.3",
|
|
72
78
|
"@types/json-schema": "7.0.7",
|
|
73
|
-
"json-schema": "^0.2.3",
|
|
74
79
|
"on-finished": "2.3.0",
|
|
75
80
|
"tslib": "2.2.0",
|
|
76
81
|
"uuid": "8.3.2"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.compile.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"baseUrl": ".",
|
|
5
|
+
"module": "ES2020",
|
|
6
|
+
"rootDir": "src",
|
|
7
|
+
"outDir": "./lib/esm",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"declarationDir": "./lib/types"
|
|
10
|
+
},
|
|
11
|
+
"exclude": [
|
|
12
|
+
"node_modules",
|
|
13
|
+
"test",
|
|
14
|
+
"lib",
|
|
15
|
+
"benchmark",
|
|
16
|
+
"coverage",
|
|
17
|
+
"spec",
|
|
18
|
+
"**/*.benchmark.ts",
|
|
19
|
+
"**/*.spec.ts",
|
|
20
|
+
"keys",
|
|
21
|
+
"jest.config.js"
|
|
22
|
+
]
|
|
23
|
+
}
|
package/lib/PlatformModule.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { InjectorService } from "@tsed/di";
|
|
2
|
-
import { Platform } from "./services/Platform";
|
|
3
|
-
/**
|
|
4
|
-
* @ignore
|
|
5
|
-
*/
|
|
6
|
-
export declare class PlatformModule {
|
|
7
|
-
protected injector: InjectorService;
|
|
8
|
-
protected platform: Platform;
|
|
9
|
-
constructor(injector: InjectorService, platform: Platform);
|
|
10
|
-
/**
|
|
11
|
-
* Create routers from the collected controllers
|
|
12
|
-
*/
|
|
13
|
-
createRoutersFromControllers(): (import("./interfaces").PlatformRouterMethods<any> | undefined)[];
|
|
14
|
-
$$loadRoutes(): void;
|
|
15
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { InjectorService } from "@tsed/di";
|
|
2
|
-
import { ControllerProvider } from "../domain/ControllerProvider";
|
|
3
|
-
import { PlatformRouterMethods } from "../interfaces/PlatformRouterMethods";
|
|
4
|
-
/**
|
|
5
|
-
* @ignore
|
|
6
|
-
*/
|
|
7
|
-
export declare class PlatformControllerBuilder {
|
|
8
|
-
private provider;
|
|
9
|
-
constructor(provider: ControllerProvider);
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* @returns {any}
|
|
13
|
-
*/
|
|
14
|
-
build(injector: InjectorService): PlatformRouterMethods;
|
|
15
|
-
private buildEndpoints;
|
|
16
|
-
private buildEndpoint;
|
|
17
|
-
private buildChildrenCtrls;
|
|
18
|
-
private buildMiddlewares;
|
|
19
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { IProvider } from "@tsed/di";
|
|
3
|
-
import { PathType } from "../../interfaces";
|
|
4
|
-
export interface ControllerMiddlewares {
|
|
5
|
-
useBefore: any[];
|
|
6
|
-
use: any[];
|
|
7
|
-
useAfter: any[];
|
|
8
|
-
}
|
|
9
|
-
export interface ControllerOptions extends Partial<IProvider<any>> {
|
|
10
|
-
path?: PathType;
|
|
11
|
-
children?: Type<any>[];
|
|
12
|
-
routerOptions?: any;
|
|
13
|
-
middlewares?: Partial<ControllerMiddlewares>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Declare a new controller with his Rest path. His methods annotated will be collected to build the routing list.
|
|
17
|
-
* This routing listing will be built with the `express.Router` object.
|
|
18
|
-
*
|
|
19
|
-
* ::: tip
|
|
20
|
-
* See [Controllers](/docs/controllers.md) section for more details
|
|
21
|
-
* :::
|
|
22
|
-
*
|
|
23
|
-
* ```typescript
|
|
24
|
-
* @Controller("/calendars")
|
|
25
|
-
* export provide CalendarCtrl {
|
|
26
|
-
*
|
|
27
|
-
* @Get("/:id")
|
|
28
|
-
* public get(
|
|
29
|
-
* @Req() request: Req,
|
|
30
|
-
* @Res() response: Res,
|
|
31
|
-
* @Next() next: Next
|
|
32
|
-
* ): void {
|
|
33
|
-
*
|
|
34
|
-
* }
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* @param options
|
|
39
|
-
* @controller
|
|
40
|
-
* @decorator
|
|
41
|
-
* @classDecorator
|
|
42
|
-
*/
|
|
43
|
-
export declare function Controller(options: PathType | ControllerOptions): ClassDecorator;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DecoratorParameters } from "@tsed/core";
|
|
2
|
-
import { EndpointMetadata } from "../../domain";
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param fn
|
|
6
|
-
* @decorator
|
|
7
|
-
*/
|
|
8
|
-
export declare function EndpointFn(fn: (endpoint: EndpointMetadata, parameters: DecoratorParameters) => void): MethodDecorator;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Location } from "@tsed/schema";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Redirect } from "@tsed/schema";
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
3
|
-
*
|
|
4
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
5
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
6
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
7
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
8
|
-
* to continue matching subsequent routes.
|
|
9
|
-
* @param path
|
|
10
|
-
* @param args
|
|
11
|
-
* @returns {Function}
|
|
12
|
-
* @decorator
|
|
13
|
-
* @operation
|
|
14
|
-
* @httpMethod
|
|
15
|
-
*/
|
|
16
|
-
export declare function All(path?: string | RegExp | any, ...args: any[]): Function;
|
|
17
|
-
/**
|
|
18
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
19
|
-
*
|
|
20
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
21
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
22
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
23
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
24
|
-
* to continue matching subsequent routes.
|
|
25
|
-
* @param path
|
|
26
|
-
* @param args
|
|
27
|
-
* @returns {Function}
|
|
28
|
-
* @decorator
|
|
29
|
-
* @operation
|
|
30
|
-
* @httpMethod
|
|
31
|
-
*/
|
|
32
|
-
export declare function Get(path?: string | RegExp | any, ...args: any[]): Function;
|
|
33
|
-
/**
|
|
34
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
35
|
-
*
|
|
36
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
37
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
38
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
39
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
40
|
-
* to continue matching subsequent routes.
|
|
41
|
-
* @param path
|
|
42
|
-
* @param args
|
|
43
|
-
* @returns {Function}
|
|
44
|
-
* @decorator
|
|
45
|
-
* @operation
|
|
46
|
-
* @httpMethod
|
|
47
|
-
*/
|
|
48
|
-
export declare function Post(path?: string | RegExp | any, ...args: any[]): Function;
|
|
49
|
-
/**
|
|
50
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
51
|
-
*
|
|
52
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
53
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
54
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
55
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
56
|
-
* to continue matching subsequent routes.
|
|
57
|
-
* @param path
|
|
58
|
-
* @param args
|
|
59
|
-
* @returns {Function}
|
|
60
|
-
* @decorator
|
|
61
|
-
* @operation
|
|
62
|
-
* @httpMethod
|
|
63
|
-
*/
|
|
64
|
-
export declare function Put(path?: string | RegExp | any, ...args: any[]): Function;
|
|
65
|
-
/**
|
|
66
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
67
|
-
*
|
|
68
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
69
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
70
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
71
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
72
|
-
* to continue matching subsequent routes.
|
|
73
|
-
* @param path
|
|
74
|
-
* @param args
|
|
75
|
-
* @returns {Function}
|
|
76
|
-
* @decorator
|
|
77
|
-
* @operation
|
|
78
|
-
* @httpMethod
|
|
79
|
-
*/
|
|
80
|
-
export declare function Delete(path?: string | RegExp | any, ...args: any[]): Function;
|
|
81
|
-
/**
|
|
82
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
83
|
-
*
|
|
84
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
85
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
86
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
87
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
88
|
-
* to continue matching subsequent routes.
|
|
89
|
-
* @param path
|
|
90
|
-
* @param args
|
|
91
|
-
* @returns {Function}
|
|
92
|
-
* @decorator
|
|
93
|
-
* @operation
|
|
94
|
-
* @httpMethod
|
|
95
|
-
*/
|
|
96
|
-
export declare function Head(path?: string | RegExp | any, ...args: any[]): Function;
|
|
97
|
-
/**
|
|
98
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
99
|
-
*
|
|
100
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
101
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
102
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
103
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
104
|
-
* to continue matching subsequent routes.
|
|
105
|
-
* @param path
|
|
106
|
-
* @param args
|
|
107
|
-
* @returns {Function}
|
|
108
|
-
* @decorator
|
|
109
|
-
* @operation
|
|
110
|
-
* @httpMethod
|
|
111
|
-
*/
|
|
112
|
-
export declare function Patch(path?: string | RegExp | any, ...args: any[]): Function;
|
|
113
|
-
/**
|
|
114
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
115
|
-
*
|
|
116
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
117
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
118
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
119
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
120
|
-
* to continue matching subsequent routes.
|
|
121
|
-
* @param path
|
|
122
|
-
* @param args
|
|
123
|
-
* @returns {Function}
|
|
124
|
-
* @decorator
|
|
125
|
-
* @operation
|
|
126
|
-
* @httpMethod
|
|
127
|
-
*/
|
|
128
|
-
export declare function Options(path?: string | RegExp | any, ...args: any[]): Function;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Provider, TokenProvider } from "@tsed/di";
|
|
2
|
-
import { JsonEntityStore } from "@tsed/schema";
|
|
3
|
-
import { ControllerMiddlewares } from "../decorators/class/controller";
|
|
4
|
-
import { PlatformRouterMethods } from "../interfaces/PlatformRouterMethods";
|
|
5
|
-
import { EndpointMetadata } from "./EndpointMetadata";
|
|
6
|
-
export declare class ControllerProvider<T = any> extends Provider<T> {
|
|
7
|
-
readonly entity: JsonEntityStore;
|
|
8
|
-
private router;
|
|
9
|
-
constructor(provide: TokenProvider, options?: Partial<Provider>);
|
|
10
|
-
get path(): string;
|
|
11
|
-
set path(path: string);
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @returns {EndpointMetadata[]}
|
|
15
|
-
*/
|
|
16
|
-
get endpoints(): EndpointMetadata[];
|
|
17
|
-
get children(): TokenProvider[];
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @returns {ControllerProvider}
|
|
21
|
-
*/
|
|
22
|
-
get parent(): TokenProvider | undefined;
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
get routerOptions(): any;
|
|
27
|
-
/**
|
|
28
|
-
*
|
|
29
|
-
* @param value
|
|
30
|
-
*/
|
|
31
|
-
set routerOptions(value: any);
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @returns {any[]}
|
|
35
|
-
*/
|
|
36
|
-
get middlewares(): ControllerMiddlewares;
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* @param middlewares
|
|
40
|
-
*/
|
|
41
|
-
set middlewares(middlewares: ControllerMiddlewares);
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* @returns {boolean}
|
|
45
|
-
*/
|
|
46
|
-
hasChildren(): boolean;
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* @returns {boolean}
|
|
50
|
-
*/
|
|
51
|
-
hasParent(): boolean;
|
|
52
|
-
getRouter<T extends PlatformRouterMethods = any>(): T;
|
|
53
|
-
setRouter(router: PlatformRouterMethods): this;
|
|
54
|
-
}
|