@tsed/common 6.88.1 → 6.89.0
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/{PlatformModule.d.ts → cjs/PlatformModule.d.ts} +0 -0
- package/lib/cjs/PlatformModule.js +11 -0
- package/lib/cjs/PlatformModule.js.map +1 -0
- package/lib/{builder → cjs/builder}/PlatformBuilder.d.ts +0 -0
- package/lib/cjs/builder/PlatformBuilder.js +248 -0
- package/lib/cjs/builder/PlatformBuilder.js.map +1 -0
- package/lib/{builder → cjs/builder}/PlatformControllerBuilder.d.ts +0 -0
- package/lib/cjs/builder/PlatformControllerBuilder.js +85 -0
- package/lib/cjs/builder/PlatformControllerBuilder.js.map +1 -0
- package/lib/{config → cjs/config}/index.d.ts +0 -0
- package/lib/cjs/config/index.js +7 -0
- package/lib/cjs/config/index.js.map +1 -0
- package/lib/{config → cjs/config}/interfaces/ConverterSettings.d.ts +0 -0
- package/lib/cjs/config/interfaces/ConverterSettings.js +3 -0
- package/lib/cjs/config/interfaces/ConverterSettings.js.map +1 -0
- package/lib/{config → cjs/config}/interfaces/EndpointDirectoriesSettings.d.ts +0 -0
- package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js +3 -0
- package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js.map +1 -0
- package/lib/{config → cjs/config}/interfaces/PlatformLoggerSettings.d.ts +0 -0
- package/lib/cjs/config/interfaces/PlatformLoggerSettings.js +3 -0
- package/lib/cjs/config/interfaces/PlatformLoggerSettings.js.map +1 -0
- package/lib/{config → cjs/config}/interfaces/PlatformMulterSettings.d.ts +0 -0
- package/lib/cjs/config/interfaces/PlatformMulterSettings.js +3 -0
- package/lib/cjs/config/interfaces/PlatformMulterSettings.js.map +1 -0
- package/lib/{config → cjs/config}/interfaces/PlatformStaticsSettings.d.ts +0 -0
- package/lib/cjs/config/interfaces/PlatformStaticsSettings.js +3 -0
- package/lib/cjs/config/interfaces/PlatformStaticsSettings.js.map +1 -0
- package/lib/{config → cjs/config}/interfaces/index.d.ts +0 -0
- package/lib/cjs/config/interfaces/index.js +8 -0
- package/lib/cjs/config/interfaces/index.js.map +1 -0
- package/lib/{config → cjs/config}/services/PlatformConfiguration.d.ts +0 -0
- package/lib/cjs/config/services/PlatformConfiguration.js +195 -0
- package/lib/cjs/config/services/PlatformConfiguration.js.map +1 -0
- package/lib/{constants → cjs/constants}/routerOptions.d.ts +0 -0
- package/lib/cjs/constants/routerOptions.js +5 -0
- package/lib/cjs/constants/routerOptions.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/httpServer.d.ts +0 -0
- package/lib/cjs/decorators/httpServer.js +31 -0
- package/lib/cjs/decorators/httpServer.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/httpsServer.d.ts +0 -0
- package/lib/cjs/decorators/httpsServer.js +31 -0
- package/lib/cjs/decorators/httpsServer.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/index.d.ts +0 -0
- package/lib/cjs/decorators/index.js +23 -0
- package/lib/cjs/decorators/index.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/method/acceptMime.d.ts +0 -0
- package/lib/cjs/decorators/method/acceptMime.js +28 -0
- package/lib/cjs/decorators/method/acceptMime.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/method/endpointFn.d.ts +0 -0
- package/lib/cjs/decorators/method/endpointFn.js +15 -0
- package/lib/cjs/decorators/method/endpointFn.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/method/location.d.ts +0 -0
- package/lib/cjs/decorators/method/location.js +6 -0
- package/lib/cjs/decorators/method/location.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/method/redirect.d.ts +0 -0
- package/lib/cjs/decorators/method/redirect.js +6 -0
- package/lib/cjs/decorators/method/redirect.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/method/route.d.ts +0 -0
- package/lib/cjs/decorators/method/route.js +13 -0
- package/lib/cjs/decorators/method/route.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/method/view.d.ts +0 -0
- package/lib/cjs/decorators/method/view.js +34 -0
- package/lib/cjs/decorators/method/view.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/multer/index.d.ts +0 -0
- package/lib/cjs/decorators/multer/index.js +7 -0
- package/lib/cjs/decorators/multer/index.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/multer/multerFileSize.d.ts +0 -0
- package/lib/cjs/decorators/multer/multerFileSize.js +35 -0
- package/lib/cjs/decorators/multer/multerFileSize.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/multer/multerOptions.d.ts +0 -0
- package/lib/cjs/decorators/multer/multerOptions.js +52 -0
- package/lib/cjs/decorators/multer/multerOptions.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/multer/multipartFile.d.ts +0 -0
- package/lib/cjs/decorators/multer/multipartFile.js +78 -0
- package/lib/cjs/decorators/multer/multipartFile.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/params/endpointInfo.d.ts +0 -0
- package/lib/cjs/decorators/params/endpointInfo.js +21 -0
- package/lib/cjs/decorators/params/endpointInfo.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/params/error.d.ts +0 -0
- package/lib/cjs/decorators/params/error.js +20 -0
- package/lib/cjs/decorators/params/error.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/params/next.d.ts +0 -0
- package/lib/cjs/decorators/params/next.js +21 -0
- package/lib/cjs/decorators/params/next.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/params/request.d.ts +0 -0
- package/lib/cjs/decorators/params/request.js +39 -0
- package/lib/cjs/decorators/params/request.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/params/response.d.ts +0 -0
- package/lib/cjs/decorators/params/response.js +33 -0
- package/lib/cjs/decorators/params/response.js.map +1 -0
- package/lib/{decorators → cjs/decorators}/params/responseData.d.ts +0 -0
- package/lib/cjs/decorators/params/responseData.js +21 -0
- package/lib/cjs/decorators/params/responseData.js.map +1 -0
- package/lib/{domain → cjs/domain}/AnyToPromiseWithCtx.d.ts +0 -0
- package/lib/cjs/domain/AnyToPromiseWithCtx.js +35 -0
- package/lib/cjs/domain/AnyToPromiseWithCtx.js.map +1 -0
- package/lib/{domain → cjs/domain}/ControllerProvider.d.ts +0 -0
- package/lib/cjs/domain/ControllerProvider.js +51 -0
- package/lib/cjs/domain/ControllerProvider.js.map +1 -0
- package/lib/{domain → cjs/domain}/EndpointMetadata.d.ts +0 -0
- package/lib/cjs/domain/EndpointMetadata.js +111 -0
- package/lib/cjs/domain/EndpointMetadata.js.map +1 -0
- package/lib/{domain → cjs/domain}/HandlerMetadata.d.ts +0 -0
- package/lib/cjs/domain/HandlerMetadata.js +57 -0
- package/lib/cjs/domain/HandlerMetadata.js.map +1 -0
- package/lib/{domain → cjs/domain}/PlatformContext.d.ts +0 -0
- package/lib/cjs/domain/PlatformContext.js +85 -0
- package/lib/cjs/domain/PlatformContext.js.map +1 -0
- package/lib/{domain → cjs/domain}/PlatformRouteDetails.d.ts +0 -0
- package/lib/cjs/domain/PlatformRouteDetails.js +24 -0
- package/lib/cjs/domain/PlatformRouteDetails.js.map +1 -0
- package/lib/{domain → cjs/domain}/PropertyMetadata.d.ts +0 -0
- package/lib/cjs/domain/PropertyMetadata.js +28 -0
- package/lib/cjs/domain/PropertyMetadata.js.map +1 -0
- package/lib/{domain → cjs/domain}/index.d.ts +0 -0
- package/lib/cjs/domain/index.js +11 -0
- package/lib/cjs/domain/index.js.map +1 -0
- package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
- package/lib/cjs/index.js +37 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/AfterInit.d.ts +0 -0
- package/lib/cjs/interfaces/AfterInit.js +3 -0
- package/lib/cjs/interfaces/AfterInit.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/AfterListen.d.ts +0 -0
- package/lib/cjs/interfaces/AfterListen.js +3 -0
- package/lib/cjs/interfaces/AfterListen.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/AfterRoutesInit.d.ts +0 -0
- package/lib/cjs/interfaces/AfterRoutesInit.js +3 -0
- package/lib/cjs/interfaces/AfterRoutesInit.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/BeforeInit.d.ts +0 -0
- package/lib/cjs/interfaces/BeforeInit.js +3 -0
- package/lib/cjs/interfaces/BeforeInit.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/BeforeListen.d.ts +0 -0
- package/lib/cjs/interfaces/BeforeListen.js +3 -0
- package/lib/cjs/interfaces/BeforeListen.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/BeforeRoutesInit.d.ts +0 -0
- package/lib/cjs/interfaces/BeforeRoutesInit.js +3 -0
- package/lib/cjs/interfaces/BeforeRoutesInit.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/HandlerType.d.ts +0 -0
- package/lib/cjs/interfaces/HandlerType.js +17 -0
- package/lib/cjs/interfaces/HandlerType.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/IncomingEvent.d.ts +0 -0
- package/lib/cjs/interfaces/IncomingEvent.js +3 -0
- package/lib/cjs/interfaces/IncomingEvent.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/OnReady.d.ts +0 -0
- package/lib/cjs/interfaces/OnReady.js +3 -0
- package/lib/cjs/interfaces/OnReady.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/OnRequest.d.ts +0 -0
- package/lib/cjs/interfaces/OnRequest.js +3 -0
- package/lib/cjs/interfaces/OnRequest.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/OnResponse.d.ts +0 -0
- package/lib/cjs/interfaces/OnResponse.js +3 -0
- package/lib/cjs/interfaces/OnResponse.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/OnRoutesInit.d.ts +0 -0
- package/lib/cjs/interfaces/OnRoutesInit.js +3 -0
- package/lib/cjs/interfaces/OnRoutesInit.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/PathType.d.ts +0 -0
- package/lib/cjs/interfaces/PathType.js +3 -0
- package/lib/cjs/interfaces/PathType.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/PlatformRouteOptions.d.ts +0 -0
- package/lib/cjs/interfaces/PlatformRouteOptions.js +3 -0
- package/lib/cjs/interfaces/PlatformRouteOptions.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/ResponseErrorObject.d.ts +0 -0
- package/lib/cjs/interfaces/ResponseErrorObject.js +3 -0
- package/lib/cjs/interfaces/ResponseErrorObject.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/Route.d.ts +0 -0
- package/lib/cjs/interfaces/Route.js +3 -0
- package/lib/cjs/interfaces/Route.js.map +1 -0
- package/lib/{interfaces → cjs/interfaces}/index.d.ts +0 -0
- package/lib/cjs/interfaces/index.js +20 -0
- package/lib/cjs/interfaces/index.js.map +1 -0
- package/lib/{middlewares → cjs/middlewares}/AcceptMimesMiddleware.d.ts +0 -0
- package/lib/cjs/middlewares/AcceptMimesMiddleware.js +27 -0
- package/lib/cjs/middlewares/AcceptMimesMiddleware.js.map +1 -0
- package/lib/{middlewares → cjs/middlewares}/GlobalAcceptMimesMiddleware.d.ts +0 -0
- package/lib/cjs/middlewares/GlobalAcceptMimesMiddleware.js +26 -0
- package/lib/cjs/middlewares/GlobalAcceptMimesMiddleware.js.map +1 -0
- package/lib/{middlewares → cjs/middlewares}/PlatformAcceptMimesMiddleware.d.ts +0 -0
- package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js +37 -0
- package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -0
- package/lib/{middlewares → cjs/middlewares}/PlatformMulterMiddleware.d.ts +0 -0
- package/lib/cjs/middlewares/PlatformMulterMiddleware.js +55 -0
- package/lib/cjs/middlewares/PlatformMulterMiddleware.js.map +1 -0
- package/lib/{middlewares/data → cjs/middlewares/__mock__}/FakeCtrl.d.ts +0 -0
- package/lib/cjs/middlewares/__mock__/FakeCtrl.js +12 -0
- package/lib/cjs/middlewares/__mock__/FakeCtrl.js.map +1 -0
- package/lib/{middlewares → cjs/middlewares}/bindEndpointMiddleware.d.ts +0 -0
- package/lib/cjs/middlewares/bindEndpointMiddleware.js +13 -0
- package/lib/cjs/middlewares/bindEndpointMiddleware.js.map +1 -0
- package/lib/{middlewares → cjs/middlewares}/index.d.ts +0 -0
- package/lib/cjs/middlewares/index.js +9 -0
- package/lib/cjs/middlewares/index.js.map +1 -0
- package/lib/{services → cjs/services}/FakeRawDriver.d.ts +0 -0
- package/lib/cjs/services/FakeRawDriver.js +26 -0
- package/lib/cjs/services/FakeRawDriver.js.map +1 -0
- package/lib/{services → cjs/services}/Platform.d.ts +0 -0
- package/lib/cjs/services/Platform.js +107 -0
- package/lib/cjs/services/Platform.js.map +1 -0
- package/lib/{services → cjs/services}/PlatformApplication.d.ts +0 -0
- package/lib/cjs/services/PlatformApplication.js +34 -0
- package/lib/cjs/services/PlatformApplication.js.map +1 -0
- package/lib/{services → cjs/services}/PlatformHandler.d.ts +0 -0
- package/lib/cjs/services/PlatformHandler.js +235 -0
- package/lib/cjs/services/PlatformHandler.js.map +1 -0
- package/lib/{services → cjs/services}/PlatformMiddlewaresChain.d.ts +0 -0
- package/lib/cjs/services/PlatformMiddlewaresChain.js +34 -0
- package/lib/cjs/services/PlatformMiddlewaresChain.js.map +1 -0
- package/lib/{services → cjs/services}/PlatformRequest.d.ts +0 -0
- package/lib/cjs/services/PlatformRequest.js +138 -0
- package/lib/cjs/services/PlatformRequest.js.map +1 -0
- package/lib/{services → cjs/services}/PlatformResponse.d.ts +0 -0
- package/lib/cjs/services/PlatformResponse.js +271 -0
- package/lib/cjs/services/PlatformResponse.js.map +1 -0
- package/lib/{services → cjs/services}/PlatformRouter.d.ts +0 -0
- package/lib/cjs/services/PlatformRouter.js +126 -0
- package/lib/cjs/services/PlatformRouter.js.map +1 -0
- package/lib/{services → cjs/services}/PlatformTest.d.ts +0 -0
- package/lib/cjs/services/PlatformTest.js +172 -0
- package/lib/cjs/services/PlatformTest.js.map +1 -0
- package/lib/{services → cjs/services}/index.d.ts +0 -0
- package/lib/cjs/services/index.js +12 -0
- package/lib/cjs/services/index.js.map +1 -0
- package/lib/{utils → cjs/utils}/createContext.d.ts +0 -0
- package/lib/cjs/utils/createContext.js +38 -0
- package/lib/cjs/utils/createContext.js.map +1 -0
- package/lib/{utils → cjs/utils}/createHandlerMetadata.d.ts +0 -0
- package/lib/cjs/utils/createHandlerMetadata.js +49 -0
- package/lib/cjs/utils/createHandlerMetadata.js.map +1 -0
- package/lib/{utils → cjs/utils}/createHttpServer.d.ts +0 -0
- package/lib/cjs/utils/createHttpServer.js +35 -0
- package/lib/cjs/utils/createHttpServer.js.map +1 -0
- package/lib/{utils → cjs/utils}/createHttpsServer.d.ts +0 -0
- package/lib/cjs/utils/createHttpsServer.js +36 -0
- package/lib/cjs/utils/createHttpsServer.js.map +1 -0
- package/lib/{utils → cjs/utils}/createInjector.d.ts +0 -0
- package/lib/cjs/utils/createInjector.js +42 -0
- package/lib/cjs/utils/createInjector.js.map +1 -0
- package/lib/{utils → cjs/utils}/getConfiguration.d.ts +0 -0
- package/lib/cjs/utils/getConfiguration.js +42 -0
- package/lib/cjs/utils/getConfiguration.js.map +1 -0
- package/lib/{utils → cjs/utils}/getStaticsOptions.d.ts +0 -0
- package/lib/cjs/utils/getStaticsOptions.js +21 -0
- package/lib/cjs/utils/getStaticsOptions.js.map +1 -0
- package/lib/{utils → cjs/utils}/index.d.ts +0 -0
- package/lib/cjs/utils/index.js +12 -0
- package/lib/cjs/utils/index.js.map +1 -0
- package/lib/{utils → cjs/utils}/listenServer.d.ts +0 -0
- package/lib/cjs/utils/listenServer.js +17 -0
- package/lib/cjs/utils/listenServer.js.map +1 -0
- package/lib/{utils → cjs/utils}/loadInjector.d.ts +0 -0
- package/lib/cjs/utils/loadInjector.js +14 -0
- package/lib/cjs/utils/loadInjector.js.map +1 -0
- package/lib/{utils → cjs/utils}/mapReturnedResponse.d.ts +0 -0
- package/lib/cjs/utils/mapReturnedResponse.js +15 -0
- package/lib/cjs/utils/mapReturnedResponse.js.map +1 -0
- package/lib/{utils → cjs/utils}/printRoutes.d.ts +0 -0
- package/lib/cjs/utils/printRoutes.js +36 -0
- package/lib/cjs/utils/printRoutes.js.map +1 -0
- package/lib/{utils → cjs/utils}/setResponseHeaders.d.ts +0 -0
- package/lib/cjs/utils/setResponseHeaders.js +35 -0
- package/lib/cjs/utils/setResponseHeaders.js.map +1 -0
- package/lib/{utils → cjs/utils}/useCtxHandler.d.ts +0 -0
- package/lib/cjs/utils/useCtxHandler.js +15 -0
- package/lib/cjs/utils/useCtxHandler.js.map +1 -0
- package/lib/esm/PlatformModule.js +7 -0
- package/lib/esm/PlatformModule.js.map +1 -0
- package/lib/esm/builder/PlatformBuilder.js +244 -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 +192 -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 +27 -0
- package/lib/esm/decorators/httpServer.js.map +1 -0
- package/lib/esm/decorators/httpsServer.js +27 -0
- package/lib/esm/decorators/httpsServer.js.map +1 -0
- package/lib/esm/decorators/index.js +20 -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/endpointInfo.js +17 -0
- package/lib/esm/decorators/params/endpointInfo.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/decorators/params/responseData.js +17 -0
- package/lib/esm/decorators/params/responseData.js.map +1 -0
- package/lib/esm/domain/AnyToPromiseWithCtx.js +31 -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 +108 -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 +81 -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/PropertyMetadata.js +25 -0
- package/lib/esm/domain/PropertyMetadata.js.map +1 -0
- package/lib/esm/domain/index.js +8 -0
- package/lib/esm/domain/index.js.map +1 -0
- package/lib/esm/index.js +31 -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/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 +17 -0
- package/lib/esm/interfaces/index.js.map +1 -0
- package/lib/esm/middlewares/AcceptMimesMiddleware.js +24 -0
- package/lib/esm/middlewares/AcceptMimesMiddleware.js.map +1 -0
- package/lib/esm/middlewares/GlobalAcceptMimesMiddleware.js +23 -0
- package/lib/esm/middlewares/GlobalAcceptMimesMiddleware.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 +6 -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 +232 -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 +168 -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 +30 -0
- package/lib/esm/utils/createHttpsServer.js.map +1 -0
- package/lib/esm/utils/createInjector.js +38 -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 +9 -0
- package/lib/esm/utils/index.js.map +1 -0
- package/lib/esm/utils/listenServer.js +13 -0
- package/lib/esm/utils/listenServer.js.map +1 -0
- package/lib/esm/utils/loadInjector.js +10 -0
- package/lib/esm/utils/loadInjector.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/types/PlatformModule.d.ts +6 -0
- package/lib/types/builder/PlatformBuilder.d.ts +116 -0
- package/lib/types/builder/PlatformControllerBuilder.d.ts +17 -0
- package/lib/types/config/index.d.ts +3 -0
- package/lib/types/config/interfaces/ConverterSettings.d.ts +6 -0
- package/lib/types/config/interfaces/EndpointDirectoriesSettings.d.ts +3 -0
- package/lib/types/config/interfaces/PlatformLoggerSettings.d.ts +44 -0
- package/lib/types/config/interfaces/PlatformMulterSettings.d.ts +138 -0
- package/lib/types/config/interfaces/PlatformStaticsSettings.d.ts +17 -0
- package/lib/types/config/interfaces/index.d.ts +88 -0
- package/lib/types/config/services/PlatformConfiguration.d.ts +85 -0
- package/lib/types/constants/routerOptions.d.ts +1 -0
- package/lib/types/decorators/httpServer.d.ts +27 -0
- package/lib/types/decorators/httpsServer.d.ts +27 -0
- package/lib/types/decorators/index.d.ts +16 -0
- package/lib/types/decorators/method/acceptMime.d.ts +19 -0
- package/lib/types/decorators/method/endpointFn.d.ts +9 -0
- package/lib/types/decorators/method/location.d.ts +1 -0
- package/lib/types/decorators/method/redirect.d.ts +1 -0
- package/lib/types/decorators/method/route.d.ts +1 -0
- package/lib/types/decorators/method/view.d.ts +25 -0
- package/lib/types/decorators/multer/index.d.ts +3 -0
- package/lib/types/decorators/multer/multerFileSize.d.ts +27 -0
- package/lib/types/decorators/multer/multerOptions.d.ts +41 -0
- package/lib/types/decorators/multer/multipartFile.d.ts +47 -0
- package/lib/types/decorators/params/endpointInfo.d.ts +13 -0
- package/lib/types/decorators/params/error.d.ts +7 -0
- package/lib/types/decorators/params/next.d.ts +22 -0
- package/lib/types/decorators/params/request.d.ts +46 -0
- package/lib/types/decorators/params/response.d.ts +40 -0
- package/lib/types/decorators/params/responseData.d.ts +9 -0
- package/lib/types/domain/AnyToPromiseWithCtx.d.ts +18 -0
- package/lib/types/domain/ControllerProvider.d.ts +24 -0
- package/lib/types/domain/EndpointMetadata.d.ts +76 -0
- package/lib/types/domain/HandlerMetadata.d.ts +32 -0
- package/lib/types/domain/PlatformContext.d.ts +65 -0
- package/lib/types/domain/PlatformRouteDetails.d.ts +23 -0
- package/lib/types/domain/PropertyMetadata.d.ts +17 -0
- package/lib/types/domain/index.d.ts +7 -0
- package/lib/types/index.d.ts +22 -0
- package/lib/types/interfaces/AfterInit.d.ts +3 -0
- package/lib/types/interfaces/AfterListen.d.ts +3 -0
- package/lib/types/interfaces/AfterRoutesInit.d.ts +3 -0
- package/lib/types/interfaces/BeforeInit.d.ts +3 -0
- package/lib/types/interfaces/BeforeListen.d.ts +3 -0
- package/lib/types/interfaces/BeforeRoutesInit.d.ts +3 -0
- package/lib/types/interfaces/HandlerType.d.ts +12 -0
- package/lib/types/interfaces/IncomingEvent.d.ts +6 -0
- package/lib/types/interfaces/OnReady.d.ts +3 -0
- package/lib/types/interfaces/OnRequest.d.ts +4 -0
- package/lib/types/interfaces/OnResponse.d.ts +4 -0
- package/lib/types/interfaces/OnRoutesInit.d.ts +3 -0
- package/lib/types/interfaces/PathType.d.ts +1 -0
- package/lib/types/interfaces/PlatformRouteOptions.d.ts +16 -0
- package/lib/types/interfaces/ResponseErrorObject.d.ts +8 -0
- package/lib/types/interfaces/Route.d.ts +10 -0
- package/lib/types/interfaces/index.d.ts +16 -0
- package/lib/types/middlewares/AcceptMimesMiddleware.d.ts +10 -0
- package/lib/types/middlewares/GlobalAcceptMimesMiddleware.d.ts +9 -0
- package/lib/types/middlewares/PlatformAcceptMimesMiddleware.d.ts +10 -0
- package/lib/types/middlewares/PlatformMulterMiddleware.d.ts +19 -0
- package/lib/types/middlewares/__mock__/FakeCtrl.d.ts +2 -0
- package/lib/types/middlewares/bindEndpointMiddleware.d.ts +5 -0
- package/lib/types/middlewares/index.d.ts +5 -0
- package/lib/types/services/FakeRawDriver.d.ts +15 -0
- package/lib/types/services/Platform.d.ts +37 -0
- package/lib/types/services/PlatformApplication.d.ts +21 -0
- package/lib/types/services/PlatformHandler.d.ts +80 -0
- package/lib/types/services/PlatformMiddlewaresChain.d.ts +6 -0
- package/lib/types/services/PlatformRequest.d.ts +112 -0
- package/lib/types/services/PlatformResponse.d.ts +161 -0
- package/lib/types/services/PlatformRouter.d.ts +48 -0
- package/lib/types/services/PlatformTest.d.ts +57 -0
- package/lib/types/services/index.d.ts +8 -0
- package/lib/types/utils/createContext.d.ts +9 -0
- package/lib/types/utils/createHandlerMetadata.d.ts +8 -0
- package/lib/types/utils/createHttpServer.d.ts +3 -0
- package/lib/types/utils/createHttpsServer.d.ts +3 -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/types/utils/index.d.ts +8 -0
- package/lib/types/utils/listenServer.d.ts +10 -0
- package/lib/types/utils/loadInjector.d.ts +6 -0
- package/lib/types/utils/mapReturnedResponse.d.ts +4 -0
- package/lib/types/utils/printRoutes.d.ts +2 -0
- package/lib/types/utils/setResponseHeaders.d.ts +5 -0
- package/lib/types/utils/useCtxHandler.d.ts +13 -0
- package/package.json +26 -22
- package/tsconfig.compile.esm.json +23 -0
- package/lib/index.js +0 -3634
- package/lib/index.js.map +0 -1
- package/lib/index.modern.js +0 -3448
- package/lib/index.modern.js.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the Next function (for express application and middleware).
|
|
3
|
+
*
|
|
4
|
+
* @decorator
|
|
5
|
+
* @operation
|
|
6
|
+
* @input
|
|
7
|
+
*/
|
|
8
|
+
export declare function Next(): ParameterDecorator;
|
|
9
|
+
declare global {
|
|
10
|
+
namespace TsED {
|
|
11
|
+
interface NextFunction extends Function {
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get the Next function (for express application and middleware).
|
|
17
|
+
*
|
|
18
|
+
* @decorator
|
|
19
|
+
* @operation
|
|
20
|
+
* @input
|
|
21
|
+
*/
|
|
22
|
+
export declare type Next = TsED.NextFunction;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import { ParamOptions } from "@tsed/platform-params";
|
|
3
|
+
/**
|
|
4
|
+
* Request service.
|
|
5
|
+
*
|
|
6
|
+
* @decorator
|
|
7
|
+
* @operation
|
|
8
|
+
* @input
|
|
9
|
+
*/
|
|
10
|
+
export declare function Request(expression: string, useType: Type<any>): ParameterDecorator;
|
|
11
|
+
export declare function Request(expression: string): ParameterDecorator;
|
|
12
|
+
export declare function Request(useType: Type<any>): ParameterDecorator;
|
|
13
|
+
export declare function Request(options: ParamOptions<any>): ParameterDecorator;
|
|
14
|
+
export declare function Request(): ParameterDecorator;
|
|
15
|
+
/**
|
|
16
|
+
* Request service.
|
|
17
|
+
*
|
|
18
|
+
* @alias Request
|
|
19
|
+
* @decorator
|
|
20
|
+
* @operation
|
|
21
|
+
* @input
|
|
22
|
+
*/
|
|
23
|
+
export declare function Req(expression: string, useType: Type<any>): ParameterDecorator;
|
|
24
|
+
export declare function Req(expression: string): ParameterDecorator;
|
|
25
|
+
export declare function Req(useType: Type<any>): ParameterDecorator;
|
|
26
|
+
export declare function Req(options: Partial<ParamOptions>): ParameterDecorator;
|
|
27
|
+
export declare function Req(): ParameterDecorator;
|
|
28
|
+
/**
|
|
29
|
+
* Request service.
|
|
30
|
+
*
|
|
31
|
+
* @decorator
|
|
32
|
+
* @operation
|
|
33
|
+
* @input
|
|
34
|
+
*/
|
|
35
|
+
export interface Request extends TsED.Request {
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Request service.
|
|
39
|
+
*
|
|
40
|
+
* @alias Request
|
|
41
|
+
* @decorator
|
|
42
|
+
* @operation
|
|
43
|
+
* @input
|
|
44
|
+
*/
|
|
45
|
+
export interface Req extends Request {
|
|
46
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response service.
|
|
3
|
+
*
|
|
4
|
+
* @decorator
|
|
5
|
+
* @operation
|
|
6
|
+
* @input
|
|
7
|
+
* @response
|
|
8
|
+
*/
|
|
9
|
+
export declare function Response(): ParameterDecorator;
|
|
10
|
+
/**
|
|
11
|
+
* Request service.
|
|
12
|
+
*
|
|
13
|
+
* @alias Response
|
|
14
|
+
* @decorator
|
|
15
|
+
* @operation
|
|
16
|
+
* @input
|
|
17
|
+
* @response
|
|
18
|
+
*/
|
|
19
|
+
export declare function Res(): ParameterDecorator;
|
|
20
|
+
/**
|
|
21
|
+
* Response service.
|
|
22
|
+
*
|
|
23
|
+
* @decorator
|
|
24
|
+
* @operation
|
|
25
|
+
* @input
|
|
26
|
+
* @response
|
|
27
|
+
*/
|
|
28
|
+
export interface Response extends TsED.Response {
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Response service.
|
|
32
|
+
*
|
|
33
|
+
* @alias Response
|
|
34
|
+
* @decorator
|
|
35
|
+
* @operation
|
|
36
|
+
* @input
|
|
37
|
+
* @response
|
|
38
|
+
*/
|
|
39
|
+
export interface Res extends Response {
|
|
40
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return the current response data. Prefer the @@Context@@ decorator to get or set data.
|
|
3
|
+
*
|
|
4
|
+
* @decorator
|
|
5
|
+
* @operation
|
|
6
|
+
* @input
|
|
7
|
+
* @deprecated Use `@Context() $ctx: Context` then $ctx.data.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ResponseData(): ParameterDecorator;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AnyPromiseResult, AnyToPromise } from "@tsed/core";
|
|
2
|
+
import { PlatformContext } from "./PlatformContext";
|
|
3
|
+
/**
|
|
4
|
+
* @ignore
|
|
5
|
+
*/
|
|
6
|
+
export interface HandlerContextOptions {
|
|
7
|
+
$ctx: PlatformContext;
|
|
8
|
+
err?: any;
|
|
9
|
+
}
|
|
10
|
+
export declare class AnyToPromiseWithCtx extends AnyToPromise {
|
|
11
|
+
$ctx: PlatformContext;
|
|
12
|
+
err: unknown;
|
|
13
|
+
constructor({ $ctx, err }: HandlerContextOptions);
|
|
14
|
+
isDone(): boolean;
|
|
15
|
+
call(cb: Function): Promise<AnyPromiseResult<any>>;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
isCanceledResponse(process: any): boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ControllerMiddlewares, Provider, TokenProvider } from "@tsed/di";
|
|
2
|
+
export declare class ControllerProvider<T = any> extends Provider<T> {
|
|
3
|
+
readonly tokenRouter: string;
|
|
4
|
+
constructor(provide: TokenProvider, options?: Partial<Provider>);
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
get routerOptions(): any;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param value
|
|
12
|
+
*/
|
|
13
|
+
set routerOptions(value: any);
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @returns {any[]}
|
|
17
|
+
*/
|
|
18
|
+
get middlewares(): ControllerMiddlewares;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param middlewares
|
|
22
|
+
*/
|
|
23
|
+
set middlewares(middlewares: ControllerMiddlewares);
|
|
24
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import { ParamMetadata } from "@tsed/platform-params";
|
|
3
|
+
import { JsonEntityStoreOptions, JsonMethodStore, JsonOperation } from "@tsed/schema";
|
|
4
|
+
export interface EndpointConstructorOptions extends JsonEntityStoreOptions {
|
|
5
|
+
beforeMiddlewares?: Function[];
|
|
6
|
+
middlewares?: Function[];
|
|
7
|
+
afterMiddlewares?: Function[];
|
|
8
|
+
}
|
|
9
|
+
export interface EndpointViewOptions {
|
|
10
|
+
path: string;
|
|
11
|
+
options: any;
|
|
12
|
+
}
|
|
13
|
+
export interface EndpointRedirectOptions {
|
|
14
|
+
status: number | undefined;
|
|
15
|
+
url: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* EndpointMetadata contains metadata about a controller and his method.
|
|
19
|
+
* Each annotation (@Get, @Body...) attached to a method are stored in a endpoint.
|
|
20
|
+
* EndpointMetadata convert this metadata to an array which contain arguments to call an Express method.
|
|
21
|
+
*
|
|
22
|
+
* Example :
|
|
23
|
+
*
|
|
24
|
+
* @Controller("/my-path")
|
|
25
|
+
* provide MyClass {
|
|
26
|
+
*
|
|
27
|
+
* @Get("/")
|
|
28
|
+
* @Authenticated()
|
|
29
|
+
* public myMethod(){}
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
export declare class EndpointMetadata extends JsonMethodStore implements EndpointConstructorOptions {
|
|
34
|
+
beforeMiddlewares: any[];
|
|
35
|
+
middlewares: any[];
|
|
36
|
+
afterMiddlewares: any[];
|
|
37
|
+
constructor(options: EndpointConstructorOptions);
|
|
38
|
+
get targetName(): string;
|
|
39
|
+
get params(): ParamMetadata[];
|
|
40
|
+
get view(): EndpointViewOptions;
|
|
41
|
+
set view(view: EndpointViewOptions);
|
|
42
|
+
get acceptMimes(): string[];
|
|
43
|
+
set acceptMimes(mimes: string[]);
|
|
44
|
+
/**
|
|
45
|
+
* Get an endpoint.
|
|
46
|
+
* @param target
|
|
47
|
+
* @param propertyKey
|
|
48
|
+
* @param descriptor
|
|
49
|
+
*/
|
|
50
|
+
static get(target: Type<any>, propertyKey: string | symbol, descriptor?: PropertyDescriptor): EndpointMetadata;
|
|
51
|
+
addOperationPath(method: string, path: string | RegExp, options?: any): JsonOperation;
|
|
52
|
+
/**
|
|
53
|
+
* Find the a value at the controller level. Let this value be extended or overridden by the endpoint itself.
|
|
54
|
+
*
|
|
55
|
+
* @param key
|
|
56
|
+
* @returns {any}
|
|
57
|
+
*/
|
|
58
|
+
get<T = any>(key: any): T;
|
|
59
|
+
/**
|
|
60
|
+
* Append middlewares to the beforeMiddlewares list.
|
|
61
|
+
* @param args
|
|
62
|
+
* @returns {EndpointMetadata}
|
|
63
|
+
*/
|
|
64
|
+
before(args: Function[]): this;
|
|
65
|
+
/**
|
|
66
|
+
* Append middlewares to the afterMiddlewares list.
|
|
67
|
+
* @param args
|
|
68
|
+
* @returns {EndpointMetadata}
|
|
69
|
+
*/
|
|
70
|
+
after(args: Function[]): this;
|
|
71
|
+
/**
|
|
72
|
+
* Store all arguments collected via Annotation.
|
|
73
|
+
* @param args
|
|
74
|
+
*/
|
|
75
|
+
use(args: Function[]): this;
|
|
76
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import { ProviderScope } from "@tsed/di";
|
|
3
|
+
import { JsonParameterStore } from "@tsed/schema";
|
|
4
|
+
import { HandlerType } from "../interfaces/HandlerType";
|
|
5
|
+
import { PlatformRouteOptions, PlatformRouteWithoutHandlers } from "../interfaces/PlatformRouteOptions";
|
|
6
|
+
export interface HandlerMetadataOptions {
|
|
7
|
+
target: (Type<any> | Function) & {
|
|
8
|
+
type?: HandlerType;
|
|
9
|
+
};
|
|
10
|
+
routeOptions?: PlatformRouteWithoutHandlers;
|
|
11
|
+
token?: Type<any>;
|
|
12
|
+
propertyKey?: string | symbol;
|
|
13
|
+
scope?: ProviderScope;
|
|
14
|
+
type?: HandlerType;
|
|
15
|
+
}
|
|
16
|
+
export declare class HandlerMetadata {
|
|
17
|
+
readonly target: any;
|
|
18
|
+
readonly token: Type<any>;
|
|
19
|
+
readonly propertyKey: string | symbol;
|
|
20
|
+
readonly injectable: boolean;
|
|
21
|
+
readonly type: HandlerType;
|
|
22
|
+
readonly hasNextFunction: boolean;
|
|
23
|
+
readonly routeOptions: Partial<PlatformRouteOptions>;
|
|
24
|
+
readonly scope: ProviderScope;
|
|
25
|
+
handler: any;
|
|
26
|
+
constructor(options: HandlerMetadataOptions);
|
|
27
|
+
get hasErrorParam(): boolean;
|
|
28
|
+
getParams(): JsonParameterStore[];
|
|
29
|
+
hasParamType(paramType: any): boolean;
|
|
30
|
+
isFinal(): boolean;
|
|
31
|
+
toString(): string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ContextMethods, DIContext, DIContextOptions } from "@tsed/di";
|
|
3
|
+
import { IncomingMessage, ServerResponse } from "http";
|
|
4
|
+
import { EndpointMetadata } from "./EndpointMetadata";
|
|
5
|
+
import { PlatformApplication } from "../services/PlatformApplication";
|
|
6
|
+
import { PlatformRequest } from "../services/PlatformRequest";
|
|
7
|
+
import { PlatformResponse } from "../services/PlatformResponse";
|
|
8
|
+
declare global {
|
|
9
|
+
namespace TsED {
|
|
10
|
+
interface Context extends PlatformContext {
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export interface PlatformContextOptions extends DIContextOptions {
|
|
15
|
+
event: {
|
|
16
|
+
response?: ServerResponse;
|
|
17
|
+
request?: IncomingMessage;
|
|
18
|
+
};
|
|
19
|
+
ignoreUrlPatterns?: any[];
|
|
20
|
+
endpoint?: EndpointMetadata;
|
|
21
|
+
}
|
|
22
|
+
export declare class PlatformContext extends DIContext implements ContextMethods {
|
|
23
|
+
/**
|
|
24
|
+
* The current @@EndpointMetadata@@ resolved by Ts.ED during the request.
|
|
25
|
+
*/
|
|
26
|
+
endpoint: EndpointMetadata;
|
|
27
|
+
/**
|
|
28
|
+
* The data return by the previous endpoint if you use multiple handler on the same route. By default data is empty.
|
|
29
|
+
*/
|
|
30
|
+
data: any;
|
|
31
|
+
/**
|
|
32
|
+
* The current @@PlatformResponse@@.
|
|
33
|
+
*/
|
|
34
|
+
response: PlatformResponse;
|
|
35
|
+
/**
|
|
36
|
+
* The current @@PlatformRequest@@.
|
|
37
|
+
*/
|
|
38
|
+
request: PlatformRequest;
|
|
39
|
+
private ignoreUrlPatterns;
|
|
40
|
+
constructor({ event, endpoint, ignoreUrlPatterns, ResponseKlass, RequestKlass, ...options }: PlatformContextOptions);
|
|
41
|
+
get url(): string;
|
|
42
|
+
get app(): PlatformApplication<TsED.Application, TsED.Router>;
|
|
43
|
+
destroy(): Promise<void>;
|
|
44
|
+
isDone(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Return the framework request instance (Express, Koa, etc...)
|
|
47
|
+
*/
|
|
48
|
+
getRequest<Req = any>(): Req;
|
|
49
|
+
/**
|
|
50
|
+
* Return the framework response instance (Express, Koa, etc...)
|
|
51
|
+
*/
|
|
52
|
+
getResponse<Res = any>(): Res;
|
|
53
|
+
/**
|
|
54
|
+
* Get Node.js request
|
|
55
|
+
*/
|
|
56
|
+
getReq(): IncomingMessage;
|
|
57
|
+
/**
|
|
58
|
+
* Get Node.js response
|
|
59
|
+
*/
|
|
60
|
+
getRes(): ServerResponse;
|
|
61
|
+
/**
|
|
62
|
+
* Return the original application instance.
|
|
63
|
+
*/
|
|
64
|
+
getApp<T = any>(): T;
|
|
65
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { JsonOperationRoute } from "@tsed/schema";
|
|
2
|
+
import { EndpointMetadata } from "./EndpointMetadata";
|
|
3
|
+
import { ControllerProvider } from "./ControllerProvider";
|
|
4
|
+
export interface PlatformRouterDetailsOptions {
|
|
5
|
+
provider: ControllerProvider;
|
|
6
|
+
endpoint: EndpointMetadata;
|
|
7
|
+
method: string;
|
|
8
|
+
url: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class PlatformRouteDetails extends JsonOperationRoute<EndpointMetadata> {
|
|
11
|
+
readonly rawBody: boolean;
|
|
12
|
+
readonly provider: ControllerProvider;
|
|
13
|
+
constructor(options?: Partial<PlatformRouteDetails>);
|
|
14
|
+
toJSON(): {
|
|
15
|
+
method: string;
|
|
16
|
+
name: string;
|
|
17
|
+
url: string;
|
|
18
|
+
className: string;
|
|
19
|
+
methodClassName: string;
|
|
20
|
+
parameters: any;
|
|
21
|
+
rawBody: boolean;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import { JsonPropertyStore } from "@tsed/schema";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Since 2020-11-11. Use getProperties from @tsed/schema
|
|
5
|
+
*/
|
|
6
|
+
export declare class PropertyMetadata extends JsonPropertyStore {
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Since 2020-11-11. Use getProperties from @tsed/schema
|
|
9
|
+
*/
|
|
10
|
+
static get(target: Type<any>, propertyKey: string | symbol): PropertyMetadata;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Since 2020-11-11. Use getProperties from @tsed/schema
|
|
13
|
+
*/
|
|
14
|
+
static getProperties(target: Type<any>, options?: Partial<{
|
|
15
|
+
withIgnoredProps: boolean;
|
|
16
|
+
}>): Map<string | number | symbol, JsonPropertyStore>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./AnyToPromiseWithCtx";
|
|
2
|
+
export * from "./PlatformContext";
|
|
3
|
+
export * from "./PlatformRouteDetails";
|
|
4
|
+
export * from "./ControllerProvider";
|
|
5
|
+
export * from "./EndpointMetadata";
|
|
6
|
+
export * from "./HandlerMetadata";
|
|
7
|
+
export * from "./PropertyMetadata";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "@tsed/logger";
|
|
2
|
+
import "@tsed/logger-file";
|
|
3
|
+
export * from "@tsed/di";
|
|
4
|
+
export * from "@tsed/platform-params";
|
|
5
|
+
export * from "@tsed/platform-exceptions";
|
|
6
|
+
export * from "@tsed/platform-response-filter";
|
|
7
|
+
export * from "@tsed/platform-cache";
|
|
8
|
+
export * from "@tsed/platform-middlewares";
|
|
9
|
+
export * from "@tsed/components-scan";
|
|
10
|
+
export * from "@tsed/platform-log-middleware";
|
|
11
|
+
export { $log, Logger } from "@tsed/logger";
|
|
12
|
+
export * from "./config";
|
|
13
|
+
export * from "./builder/PlatformBuilder";
|
|
14
|
+
export * from "./builder/PlatformControllerBuilder";
|
|
15
|
+
export * from "./decorators";
|
|
16
|
+
export * from "./constants/routerOptions";
|
|
17
|
+
export * from "./interfaces";
|
|
18
|
+
export * from "./middlewares";
|
|
19
|
+
export * from "./domain";
|
|
20
|
+
export * from "./services";
|
|
21
|
+
export * from "./utils";
|
|
22
|
+
export * from "./PlatformModule";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ignore
|
|
3
|
+
*/
|
|
4
|
+
export declare enum HandlerType {
|
|
5
|
+
CUSTOM = "custom",
|
|
6
|
+
ENDPOINT = "endpoint",
|
|
7
|
+
MIDDLEWARE = "middleware",
|
|
8
|
+
ERR_MIDDLEWARE = "err:middleware",
|
|
9
|
+
CTX_FN = "context",
|
|
10
|
+
RAW_FN = "raw:middleware",
|
|
11
|
+
RAW_ERR_FN = "raw:err:middleware"
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type PathType = string | RegExp | (string | RegExp)[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Type } from "@tsed/core";
|
|
2
|
+
import { PathType } from "./PathType";
|
|
3
|
+
/**
|
|
4
|
+
* @ignore
|
|
5
|
+
*/
|
|
6
|
+
export interface PlatformRouteOptions {
|
|
7
|
+
token?: Type<any>;
|
|
8
|
+
path?: PathType | undefined;
|
|
9
|
+
method?: string;
|
|
10
|
+
isFinal?: boolean;
|
|
11
|
+
handlers: any[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @ignore
|
|
15
|
+
*/
|
|
16
|
+
export declare type PlatformRouteWithoutHandlers = Partial<Omit<PlatformRouteOptions, "handlers">>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TokenProvider } from "@tsed/di";
|
|
2
|
+
import { ControllerProvider } from "../domain/ControllerProvider";
|
|
3
|
+
export interface Route extends Record<string, any> {
|
|
4
|
+
route: string;
|
|
5
|
+
token: TokenProvider;
|
|
6
|
+
}
|
|
7
|
+
export interface RouteController {
|
|
8
|
+
route: string;
|
|
9
|
+
provider: ControllerProvider;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from "./ResponseErrorObject";
|
|
2
|
+
export * from "./HandlerType";
|
|
3
|
+
export * from "./PlatformRouteOptions";
|
|
4
|
+
export * from "./BeforeInit";
|
|
5
|
+
export * from "./AfterInit";
|
|
6
|
+
export * from "./AfterRoutesInit";
|
|
7
|
+
export * from "./BeforeListen";
|
|
8
|
+
export * from "./AfterListen";
|
|
9
|
+
export * from "./BeforeRoutesInit";
|
|
10
|
+
export * from "./AfterRoutesInit";
|
|
11
|
+
export * from "./OnRoutesInit";
|
|
12
|
+
export * from "./OnReady";
|
|
13
|
+
export * from "./OnRequest";
|
|
14
|
+
export * from "./OnResponse";
|
|
15
|
+
export * from "./Route";
|
|
16
|
+
export * from "./IncomingEvent";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Context } from "@tsed/platform-params";
|
|
2
|
+
import { MiddlewareMethods } from "@tsed/platform-middlewares";
|
|
3
|
+
/**
|
|
4
|
+
* @middleware
|
|
5
|
+
* @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
8
|
+
export declare class AcceptMimesMiddleware implements MiddlewareMethods {
|
|
9
|
+
use(ctx: Context): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MiddlewareMethods } from "@tsed/platform-middlewares";
|
|
2
|
+
import { Context } from "@tsed/platform-params";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
7
|
+
export declare class GlobalAcceptMimesMiddleware implements MiddlewareMethods {
|
|
8
|
+
use(ctx: Context): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MiddlewareMethods } from "@tsed/platform-middlewares";
|
|
2
|
+
import { Context } from "@tsed/platform-params";
|
|
3
|
+
/**
|
|
4
|
+
* @middleware
|
|
5
|
+
* @platform
|
|
6
|
+
*/
|
|
7
|
+
export declare class PlatformAcceptMimesMiddleware implements MiddlewareMethods {
|
|
8
|
+
acceptMimes: string[];
|
|
9
|
+
use(ctx: Context): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MiddlewareMethods } from "@tsed/platform-middlewares";
|
|
2
|
+
import { Context } from "@tsed/platform-params";
|
|
3
|
+
import { PlatformMulterField, PlatformMulterSettings } from "../config";
|
|
4
|
+
import { PlatformApplication } from "../services/PlatformApplication";
|
|
5
|
+
export interface MulterInputOptions {
|
|
6
|
+
fields: PlatformMulterField[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* @middleware
|
|
10
|
+
*/
|
|
11
|
+
export declare class PlatformMulterMiddleware implements MiddlewareMethods {
|
|
12
|
+
settings: PlatformMulterSettings;
|
|
13
|
+
app: PlatformApplication;
|
|
14
|
+
use(ctx: Context): Promise<any>;
|
|
15
|
+
protected getFields(conf: MulterInputOptions): {
|
|
16
|
+
name: string;
|
|
17
|
+
maxCount: number | undefined;
|
|
18
|
+
}[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ignore
|
|
3
|
+
*/
|
|
4
|
+
export declare const createFakeRawDriver: () => {
|
|
5
|
+
(): void;
|
|
6
|
+
use: () => any;
|
|
7
|
+
all: () => any;
|
|
8
|
+
get: () => any;
|
|
9
|
+
patch: () => any;
|
|
10
|
+
post: () => any;
|
|
11
|
+
put: () => any;
|
|
12
|
+
head: () => any;
|
|
13
|
+
delete: () => any;
|
|
14
|
+
options: () => any;
|
|
15
|
+
};
|