@tsed/common 6.87.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 -1
- 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 +1 -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/cjs/decorators/method/view.d.ts +25 -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 -1
- 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 +2 -1
- 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 +4 -4
- 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 +1 -1
- 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/cjs/utils/createInjector.d.ts +7 -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 -1
- 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 -3603
- package/lib/index.js.map +0 -1
- package/lib/index.modern.js +0 -3410
- package/lib/index.modern.js.map +0 -1
- package/lib/utils/createInjector.d.ts +0 -2
- package/lib/utils/createPlatformApplication.d.ts +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAE3B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAE9C,OAAO,EAAC,IAAI,EAAE,MAAM,EAAC,MAAM,cAAc,CAAC;AAE1C,cAAc,UAAU,CAAC;AAEzB,UAAU;AACV,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AAEpD,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,aAAa;AACb,cAAc,2BAA2B,CAAC;AAC1C,cAAc,cAAc,CAAC;AAE7B,cAAc;AACd,cAAc,eAAe,CAAC;AAE9B,SAAS;AACT,cAAc,UAAU,CAAC;AAEzB,YAAY;AACZ,cAAc,YAAY,CAAC;AAE3B,QAAQ;AACR,cAAc,SAAS,CAAC;AAExB,SAAS;AACT,cAAc,kBAAkB,CAAC","sourcesContent":["import \"@tsed/logger\";\nimport \"@tsed/logger-file\";\n\nexport * from \"@tsed/di\";\nexport * from \"@tsed/platform-params\";\nexport * from \"@tsed/platform-exceptions\";\nexport * from \"@tsed/platform-response-filter\";\nexport * from \"@tsed/platform-cache\";\nexport * from \"@tsed/platform-middlewares\";\nexport * from \"@tsed/components-scan\";\nexport * from \"@tsed/platform-log-middleware\";\n\nexport {$log, Logger} from \"@tsed/logger\";\n\nexport * from \"./config\";\n\n// builder\nexport * from \"./builder/PlatformBuilder\";\nexport * from \"./builder/PlatformControllerBuilder\";\n\n// decorators\nexport * from \"./decorators\";\n\n// interfaces\nexport * from \"./constants/routerOptions\";\nexport * from \"./interfaces\";\n\n// middlewares\nexport * from \"./middlewares\";\n\n// domain\nexport * from \"./domain\";\n\n// providers\nexport * from \"./services\";\n\n// utils\nexport * from \"./utils\";\n\n// Module\nexport * from \"./PlatformModule\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AfterInit.js","sourceRoot":"","sources":["../../../src/interfaces/AfterInit.ts"],"names":[],"mappings":"","sourcesContent":["export interface AfterInit {\n $afterInit(): void | Promise<any>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AfterListen.js","sourceRoot":"","sources":["../../../src/interfaces/AfterListen.ts"],"names":[],"mappings":"","sourcesContent":["export interface AfterListen {\n $afterListen(): void | Promise<any>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AfterRoutesInit.js","sourceRoot":"","sources":["../../../src/interfaces/AfterRoutesInit.ts"],"names":[],"mappings":"","sourcesContent":["export interface AfterRoutesInit {\n $afterRoutesInit(): void | Promise<any>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BeforeInit.js","sourceRoot":"","sources":["../../../src/interfaces/BeforeInit.ts"],"names":[],"mappings":"","sourcesContent":["export interface BeforeInit {\n $beforeInit(): void | Promise<any>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BeforeListen.js","sourceRoot":"","sources":["../../../src/interfaces/BeforeListen.ts"],"names":[],"mappings":"","sourcesContent":["export interface BeforeListen {\n $beforeListen(): void | Promise<any>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BeforeRoutesInit.js","sourceRoot":"","sources":["../../../src/interfaces/BeforeRoutesInit.ts"],"names":[],"mappings":"","sourcesContent":["export interface BeforeRoutesInit {\n $beforeRoutesInit(): void | Promise<any>;\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ignore
|
|
3
|
+
*/
|
|
4
|
+
export var HandlerType;
|
|
5
|
+
(function (HandlerType) {
|
|
6
|
+
HandlerType["CUSTOM"] = "custom";
|
|
7
|
+
HandlerType["ENDPOINT"] = "endpoint";
|
|
8
|
+
HandlerType["MIDDLEWARE"] = "middleware";
|
|
9
|
+
HandlerType["ERR_MIDDLEWARE"] = "err:middleware";
|
|
10
|
+
HandlerType["CTX_FN"] = "context";
|
|
11
|
+
HandlerType["RAW_FN"] = "raw:middleware";
|
|
12
|
+
HandlerType["RAW_ERR_FN"] = "raw:err:middleware";
|
|
13
|
+
})(HandlerType || (HandlerType = {}));
|
|
14
|
+
//# sourceMappingURL=HandlerType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HandlerType.js","sourceRoot":"","sources":["../../../src/interfaces/HandlerType.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,WAQX;AARD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IACrB,wCAAyB,CAAA;IACzB,gDAAiC,CAAA;IACjC,iCAAkB,CAAA;IAClB,wCAAyB,CAAA;IACzB,gDAAiC,CAAA;AACnC,CAAC,EARW,WAAW,KAAX,WAAW,QAQtB","sourcesContent":["/**\n * @ignore\n */\nexport enum HandlerType {\n CUSTOM = \"custom\",\n ENDPOINT = \"endpoint\",\n MIDDLEWARE = \"middleware\",\n ERR_MIDDLEWARE = \"err:middleware\",\n CTX_FN = \"context\",\n RAW_FN = \"raw:middleware\",\n RAW_ERR_FN = \"raw:err:middleware\"\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IncomingEvent.js","sourceRoot":"","sources":["../../../src/interfaces/IncomingEvent.ts"],"names":[],"mappings":"","sourcesContent":["import {IncomingMessage, ServerResponse} from \"http\";\n\nexport interface IncomingEvent<Req = IncomingMessage, Res = ServerResponse> extends Record<string, unknown> {\n response: Res;\n request: Req;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OnReady.js","sourceRoot":"","sources":["../../../src/interfaces/OnReady.ts"],"names":[],"mappings":"","sourcesContent":["export interface OnReady {\n $onReady(): void | Promise<any>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OnRequest.js","sourceRoot":"","sources":["../../../src/interfaces/OnRequest.ts"],"names":[],"mappings":"","sourcesContent":["import {PlatformContext} from \"../domain/PlatformContext\";\n\nexport interface OnRequest {\n $onRequest(ctx: PlatformContext): void;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OnResponse.js","sourceRoot":"","sources":["../../../src/interfaces/OnResponse.ts"],"names":[],"mappings":"","sourcesContent":["import {PlatformResponse} from \"../services/PlatformResponse\";\n\nexport interface OnResponse {\n $onResponse(ctx: PlatformResponse): void;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OnRoutesInit.js","sourceRoot":"","sources":["../../../src/interfaces/OnRoutesInit.ts"],"names":[],"mappings":"","sourcesContent":["export interface OnRoutesInit {\n $onRoutesInit(): void | Promise<any>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathType.js","sourceRoot":"","sources":["../../../src/interfaces/PathType.ts"],"names":[],"mappings":"","sourcesContent":["export type PathType = string | RegExp | (string | RegExp)[];\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlatformRouteOptions.js","sourceRoot":"","sources":["../../../src/interfaces/PlatformRouteOptions.ts"],"names":[],"mappings":"","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {PathType} from \"./PathType\";\n\n/**\n * @ignore\n */\nexport interface PlatformRouteOptions {\n token?: Type<any>;\n path?: PathType | undefined;\n method?: string;\n isFinal?: boolean;\n handlers: any[];\n}\n\n/**\n * @ignore\n */\nexport type PlatformRouteWithoutHandlers = Partial<Omit<PlatformRouteOptions, \"handlers\">>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResponseErrorObject.js","sourceRoot":"","sources":["../../../src/interfaces/ResponseErrorObject.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface can be implemented to customize the error sent to the client.\n */\nexport interface ResponseErrorObject extends Error {\n errors?: Error[] | Error | any;\n origin?: Error;\n headers?: {};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Route.js","sourceRoot":"","sources":["../../../src/interfaces/Route.ts"],"names":[],"mappings":"","sourcesContent":["import {TokenProvider} from \"@tsed/di\";\nimport {ControllerProvider} from \"../domain/ControllerProvider\";\n\nexport interface Route extends Record<string, any> {\n route: string;\n token: TokenProvider;\n}\n\nexport interface RouteController {\n route: string;\n provider: ControllerProvider;\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
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";
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./ResponseErrorObject\";\nexport * from \"./HandlerType\";\nexport * from \"./PlatformRouteOptions\";\nexport * from \"./BeforeInit\";\nexport * from \"./AfterInit\";\nexport * from \"./AfterRoutesInit\";\nexport * from \"./BeforeListen\";\nexport * from \"./AfterListen\";\nexport * from \"./BeforeRoutesInit\";\nexport * from \"./AfterRoutesInit\";\nexport * from \"./OnRoutesInit\";\nexport * from \"./OnReady\";\nexport * from \"./OnRequest\";\nexport * from \"./OnResponse\";\nexport * from \"./Route\";\nexport * from \"./IncomingEvent\";\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
+
import { Context } from "@tsed/platform-params";
|
|
3
|
+
import { Middleware } from "@tsed/platform-middlewares";
|
|
4
|
+
/**
|
|
5
|
+
* @middleware
|
|
6
|
+
* @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
let AcceptMimesMiddleware = class AcceptMimesMiddleware {
|
|
10
|
+
use(ctx) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
__decorate([
|
|
15
|
+
__param(0, Context()),
|
|
16
|
+
__metadata("design:type", Function),
|
|
17
|
+
__metadata("design:paramtypes", [Object]),
|
|
18
|
+
__metadata("design:returntype", void 0)
|
|
19
|
+
], AcceptMimesMiddleware.prototype, "use", null);
|
|
20
|
+
AcceptMimesMiddleware = __decorate([
|
|
21
|
+
Middleware()
|
|
22
|
+
], AcceptMimesMiddleware);
|
|
23
|
+
export { AcceptMimesMiddleware };
|
|
24
|
+
//# sourceMappingURL=AcceptMimesMiddleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcceptMimesMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/AcceptMimesMiddleware.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAoB,MAAM,4BAA4B,CAAC;AAEzE;;;;GAIG;AAEH,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IACzB,GAAG,CAAY,GAAY;QAChC,OAAO;IACT,CAAC;CACF,CAAA;AAHC;IAAY,WAAA,OAAO,EAAE,CAAA;;;;gDAEpB;AAHU,qBAAqB;IADjC,UAAU,EAAE;GACA,qBAAqB,CAIjC;SAJY,qBAAqB","sourcesContent":["import {Context} from \"@tsed/platform-params\";\nimport {Middleware, MiddlewareMethods} from \"@tsed/platform-middlewares\";\n\n/**\n * @middleware\n * @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.\n * @ignore\n */\n@Middleware()\nexport class AcceptMimesMiddleware implements MiddlewareMethods {\n public use(@Context() ctx: Context): void {\n return;\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
+
import { Middleware } from "@tsed/platform-middlewares";
|
|
3
|
+
import { Context } from "@tsed/platform-params";
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
8
|
+
let GlobalAcceptMimesMiddleware = class GlobalAcceptMimesMiddleware {
|
|
9
|
+
use(ctx) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
__decorate([
|
|
14
|
+
__param(0, Context()),
|
|
15
|
+
__metadata("design:type", Function),
|
|
16
|
+
__metadata("design:paramtypes", [Object]),
|
|
17
|
+
__metadata("design:returntype", void 0)
|
|
18
|
+
], GlobalAcceptMimesMiddleware.prototype, "use", null);
|
|
19
|
+
GlobalAcceptMimesMiddleware = __decorate([
|
|
20
|
+
Middleware()
|
|
21
|
+
], GlobalAcceptMimesMiddleware);
|
|
22
|
+
export { GlobalAcceptMimesMiddleware };
|
|
23
|
+
//# sourceMappingURL=GlobalAcceptMimesMiddleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalAcceptMimesMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/GlobalAcceptMimesMiddleware.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAoB,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAE9C;;;GAGG;AAEH,IAAa,2BAA2B,GAAxC,MAAa,2BAA2B;IACtC,GAAG,CAAY,GAAY;QACzB,OAAO;IACT,CAAC;CACF,CAAA;AAHC;IAAK,WAAA,OAAO,EAAE,CAAA;;;;sDAEb;AAHU,2BAA2B;IADvC,UAAU,EAAE;GACA,2BAA2B,CAIvC;SAJY,2BAA2B","sourcesContent":["import {Middleware, MiddlewareMethods} from \"@tsed/platform-middlewares\";\nimport {Context} from \"@tsed/platform-params\";\n\n/**\n * @deprecated Since 2020-11-30. Use PlatformAcceptMimesMiddleware.\n * @ignore\n */\n@Middleware()\nexport class GlobalAcceptMimesMiddleware implements MiddlewareMethods {\n use(@Context() ctx: Context) {\n return;\n }\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
+
import { uniq } from "@tsed/core";
|
|
3
|
+
import { Constant } from "@tsed/di";
|
|
4
|
+
import { NotAcceptable } from "@tsed/exceptions";
|
|
5
|
+
import { Middleware } from "@tsed/platform-middlewares";
|
|
6
|
+
import { Context } from "@tsed/platform-params";
|
|
7
|
+
/**
|
|
8
|
+
* @middleware
|
|
9
|
+
* @platform
|
|
10
|
+
*/
|
|
11
|
+
let PlatformAcceptMimesMiddleware = class PlatformAcceptMimesMiddleware {
|
|
12
|
+
use(ctx) {
|
|
13
|
+
const { endpoint, request } = ctx;
|
|
14
|
+
const mimes = uniq(((endpoint === null || endpoint === void 0 ? void 0 : endpoint.get("acceptMimes")) || []).concat(this.acceptMimes));
|
|
15
|
+
if (mimes.length && !request.accepts(mimes)) {
|
|
16
|
+
throw new NotAcceptable(mimes.join(", "));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
__decorate([
|
|
21
|
+
Constant("acceptMimes", []),
|
|
22
|
+
__metadata("design:type", Array)
|
|
23
|
+
], PlatformAcceptMimesMiddleware.prototype, "acceptMimes", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
__param(0, Context()),
|
|
26
|
+
__metadata("design:type", Function),
|
|
27
|
+
__metadata("design:paramtypes", [Object]),
|
|
28
|
+
__metadata("design:returntype", void 0)
|
|
29
|
+
], PlatformAcceptMimesMiddleware.prototype, "use", null);
|
|
30
|
+
PlatformAcceptMimesMiddleware = __decorate([
|
|
31
|
+
Middleware()
|
|
32
|
+
], PlatformAcceptMimesMiddleware);
|
|
33
|
+
export { PlatformAcceptMimesMiddleware };
|
|
34
|
+
//# sourceMappingURL=PlatformAcceptMimesMiddleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlatformAcceptMimesMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/PlatformAcceptMimesMiddleware.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,YAAY,CAAC;AAChC,OAAO,EAAC,QAAQ,EAAC,MAAM,UAAU,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAoB,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAE9C;;;GAGG;AAEH,IAAa,6BAA6B,GAA1C,MAAa,6BAA6B;IAIjC,GAAG,CAAY,GAAY;QAChC,MAAM,EAAC,QAAQ,EAAE,OAAO,EAAC,GAAG,GAAG,CAAC;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,GAAG,CAAC,aAAa,CAAC,KAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAElF,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC3C,MAAM,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;SAC3C;IACH,CAAC;CACF,CAAA;AAVC;IADC,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC;;kEACN;AAEtB;IAAY,WAAA,OAAO,EAAE,CAAA;;;;wDAOpB;AAXU,6BAA6B;IADzC,UAAU,EAAE;GACA,6BAA6B,CAYzC;SAZY,6BAA6B","sourcesContent":["import {uniq} from \"@tsed/core\";\nimport {Constant} from \"@tsed/di\";\nimport {NotAcceptable} from \"@tsed/exceptions\";\nimport {Middleware, MiddlewareMethods} from \"@tsed/platform-middlewares\";\nimport {Context} from \"@tsed/platform-params\";\n\n/**\n * @middleware\n * @platform\n */\n@Middleware()\nexport class PlatformAcceptMimesMiddleware implements MiddlewareMethods {\n @Constant(\"acceptMimes\", [])\n acceptMimes: string[];\n\n public use(@Context() ctx: Context): void {\n const {endpoint, request} = ctx;\n const mimes = uniq((endpoint?.get(\"acceptMimes\") || []).concat(this.acceptMimes));\n\n if (mimes.length && !request.accepts(mimes)) {\n throw new NotAcceptable(mimes.join(\", \"));\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var PlatformMulterMiddleware_1;
|
|
2
|
+
import { __decorate, __metadata, __param } from "tslib";
|
|
3
|
+
import { Constant, Inject } from "@tsed/di";
|
|
4
|
+
import { Exception } from "@tsed/exceptions";
|
|
5
|
+
import { Middleware } from "@tsed/platform-middlewares";
|
|
6
|
+
import { Context } from "@tsed/platform-params";
|
|
7
|
+
import { PlatformApplication } from "../services/PlatformApplication";
|
|
8
|
+
/**
|
|
9
|
+
* @middleware
|
|
10
|
+
*/
|
|
11
|
+
let PlatformMulterMiddleware = PlatformMulterMiddleware_1 = class PlatformMulterMiddleware {
|
|
12
|
+
async use(ctx) {
|
|
13
|
+
try {
|
|
14
|
+
const { fields, options = {} } = ctx.endpoint.get(PlatformMulterMiddleware_1);
|
|
15
|
+
const settings = {
|
|
16
|
+
...this.settings,
|
|
17
|
+
...options
|
|
18
|
+
};
|
|
19
|
+
/* istanbul ignore next */
|
|
20
|
+
if (settings.storage) {
|
|
21
|
+
delete settings.dest;
|
|
22
|
+
}
|
|
23
|
+
const middleware = this.app.multer(settings).fields(this.getFields({ fields }));
|
|
24
|
+
return await middleware(ctx.getRequest(), ctx.getResponse());
|
|
25
|
+
}
|
|
26
|
+
catch (er) {
|
|
27
|
+
throw er.code ? new Exception(er.code, `${er.message} ${er.field || ""}`.trim()) : er;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
getFields(conf) {
|
|
31
|
+
return conf.fields.map(({ name, maxCount }) => ({ name, maxCount }));
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
__decorate([
|
|
35
|
+
Constant("multer", {}),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], PlatformMulterMiddleware.prototype, "settings", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
Inject(),
|
|
40
|
+
__metadata("design:type", PlatformApplication)
|
|
41
|
+
], PlatformMulterMiddleware.prototype, "app", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
__param(0, Context()),
|
|
44
|
+
__metadata("design:type", Function),
|
|
45
|
+
__metadata("design:paramtypes", [Object]),
|
|
46
|
+
__metadata("design:returntype", Promise)
|
|
47
|
+
], PlatformMulterMiddleware.prototype, "use", null);
|
|
48
|
+
PlatformMulterMiddleware = PlatformMulterMiddleware_1 = __decorate([
|
|
49
|
+
Middleware()
|
|
50
|
+
], PlatformMulterMiddleware);
|
|
51
|
+
export { PlatformMulterMiddleware };
|
|
52
|
+
//# sourceMappingURL=PlatformMulterMiddleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlatformMulterMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/PlatformMulterMiddleware.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAC,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,UAAU,EAAoB,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AAMpE;;GAEG;AAEH,IAAa,wBAAwB,gCAArC,MAAa,wBAAwB;IAOnC,KAAK,CAAC,GAAG,CAAY,GAAY;QAC/B,IAAI;YACF,MAAM,EAAC,MAAM,EAAE,OAAO,GAAG,EAAE,EAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,0BAAwB,CAAC,CAAC;YAC1E,MAAM,QAAQ,GAA2B;gBACvC,GAAG,IAAI,CAAC,QAAQ;gBAChB,GAAG,OAAO;aACX,CAAC;YAEF,0BAA0B;YAC1B,IAAI,QAAQ,CAAC,OAAO,EAAE;gBACpB,OAAO,QAAQ,CAAC,IAAI,CAAC;aACtB;YAED,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAC,MAAM,EAAC,CAAC,CAAC,CAAC;YAE9E,OAAO,MAAM,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;SAC9D;QAAC,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACvF;IACH,CAAC;IAES,SAAS,CAAC,IAAwB;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAC,EAAE,EAAE,CAAC,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAC,CAAC,CAAC,CAAC;IACnE,CAAC;CACF,CAAA;AA7BC;IADC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC;;0DACU;AAGjC;IADC,MAAM,EAAE;8BACJ,mBAAmB;qDAAC;AAEzB;IAAW,WAAA,OAAO,EAAE,CAAA;;;;mDAmBnB;AA1BU,wBAAwB;IADpC,UAAU,EAAE;GACA,wBAAwB,CA+BpC;SA/BY,wBAAwB","sourcesContent":["import {Constant, Inject} from \"@tsed/di\";\nimport {Exception} from \"@tsed/exceptions\";\nimport {Middleware, MiddlewareMethods} from \"@tsed/platform-middlewares\";\nimport {Context} from \"@tsed/platform-params\";\nimport {PlatformMulterField, PlatformMulterSettings} from \"../config\";\nimport {PlatformApplication} from \"../services/PlatformApplication\";\n\nexport interface MulterInputOptions {\n fields: PlatformMulterField[];\n}\n\n/**\n * @middleware\n */\n@Middleware()\nexport class PlatformMulterMiddleware implements MiddlewareMethods {\n @Constant(\"multer\", {})\n settings: PlatformMulterSettings;\n\n @Inject()\n app: PlatformApplication;\n\n async use(@Context() ctx: Context) {\n try {\n const {fields, options = {}} = ctx.endpoint.get(PlatformMulterMiddleware);\n const settings: PlatformMulterSettings = {\n ...this.settings,\n ...options\n };\n\n /* istanbul ignore next */\n if (settings.storage) {\n delete settings.dest;\n }\n\n const middleware = this.app.multer(settings).fields(this.getFields({fields}));\n\n return await middleware(ctx.getRequest(), ctx.getResponse());\n } catch (er) {\n throw er.code ? new Exception(er.code, `${er.message} ${er.field || \"\"}`.trim()) : er;\n }\n }\n\n protected getFields(conf: MulterInputOptions) {\n return conf.fields.map(({name, maxCount}) => ({name, maxCount}));\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FakeCtrl.js","sourceRoot":"","sources":["../../../../src/middlewares/__mock__/FakeCtrl.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGpC,IAAa,QAAQ,GAArB,MAAa,QAAQ;CAAG,CAAA;AAAX,QAAQ;IADpB,UAAU,CAAC,GAAG,CAAC;GACH,QAAQ,CAAG;SAAX,QAAQ","sourcesContent":["import {Controller} from \"@tsed/di\";\n\n@Controller(\"/\")\nexport class FakeCtrl {}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bindEndpointMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/bindEndpointMiddleware.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAA0B;IAC/D,OAAO,CAAC,GAAoB,EAAE,EAAE;QAC9B,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type {EndpointMetadata, PlatformContext} from \"../domain\";\n\n/**\n * @ignore\n */\nexport function bindEndpointMiddleware(endpoint: EndpointMetadata) {\n return (ctx: PlatformContext) => {\n ctx.endpoint = endpoint;\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/middlewares/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC","sourcesContent":["export * from \"./bindEndpointMiddleware\";\nexport * from \"./PlatformMulterMiddleware\";\nexport * from \"./GlobalAcceptMimesMiddleware\";\nexport * from \"./PlatformAcceptMimesMiddleware\";\nexport * from \"./AcceptMimesMiddleware\";\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ignore
|
|
3
|
+
*/
|
|
4
|
+
export const createFakeRawDriver = () => {
|
|
5
|
+
// istanbul ignore next
|
|
6
|
+
function FakeRawDriver() { }
|
|
7
|
+
// istanbul ignore next
|
|
8
|
+
function use() {
|
|
9
|
+
return this;
|
|
10
|
+
}
|
|
11
|
+
FakeRawDriver.use = use;
|
|
12
|
+
FakeRawDriver.all = use;
|
|
13
|
+
FakeRawDriver.get = use;
|
|
14
|
+
FakeRawDriver.patch = use;
|
|
15
|
+
FakeRawDriver.post = use;
|
|
16
|
+
FakeRawDriver.put = use;
|
|
17
|
+
FakeRawDriver.head = use;
|
|
18
|
+
FakeRawDriver.delete = use;
|
|
19
|
+
FakeRawDriver.options = use;
|
|
20
|
+
return FakeRawDriver;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=FakeRawDriver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FakeRawDriver.js","sourceRoot":"","sources":["../../../src/services/FakeRawDriver.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,uBAAuB;IACvB,SAAS,aAAa,KAAI,CAAC;IAE3B,uBAAuB;IACvB,SAAS,GAAG;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;IACxB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;IACxB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;IACxB,aAAa,CAAC,KAAK,GAAG,GAAG,CAAC;IAC1B,aAAa,CAAC,IAAI,GAAG,GAAG,CAAC;IACzB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;IACxB,aAAa,CAAC,IAAI,GAAG,GAAG,CAAC;IACzB,aAAa,CAAC,MAAM,GAAG,GAAG,CAAC;IAC3B,aAAa,CAAC,OAAO,GAAG,GAAG,CAAC;IAE5B,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC","sourcesContent":["/**\n * @ignore\n */\nexport const createFakeRawDriver = () => {\n // istanbul ignore next\n function FakeRawDriver() {}\n\n // istanbul ignore next\n function use() {\n return this;\n }\n\n FakeRawDriver.use = use;\n FakeRawDriver.all = use;\n FakeRawDriver.get = use;\n FakeRawDriver.patch = use;\n FakeRawDriver.post = use;\n FakeRawDriver.put = use;\n FakeRawDriver.head = use;\n FakeRawDriver.delete = use;\n FakeRawDriver.options = use;\n\n return FakeRawDriver;\n};\n"]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Injectable, InjectorService, ProviderScope, ProviderType } from "@tsed/di";
|
|
3
|
+
import { concatPath, getOperationsRoutes, JsonEntityStore } from "@tsed/schema";
|
|
4
|
+
import { buildRouter, createRouter, getRouter } from "../builder/PlatformControllerBuilder";
|
|
5
|
+
import { PlatformRouteDetails } from "../domain";
|
|
6
|
+
import { PlatformApplication } from "./PlatformApplication";
|
|
7
|
+
import { PlatformMiddlewaresChain } from "./PlatformMiddlewaresChain";
|
|
8
|
+
/**
|
|
9
|
+
* `Platform` is used to provide all routes collected by annotation `@Controller`.
|
|
10
|
+
*
|
|
11
|
+
* @platform
|
|
12
|
+
*/
|
|
13
|
+
let Platform = class Platform {
|
|
14
|
+
constructor(injector, platformApplication) {
|
|
15
|
+
this.injector = injector;
|
|
16
|
+
this.platformApplication = platformApplication;
|
|
17
|
+
this._routes = [];
|
|
18
|
+
this._controllers = [];
|
|
19
|
+
this.createRouters();
|
|
20
|
+
}
|
|
21
|
+
get app() {
|
|
22
|
+
return this.platformApplication;
|
|
23
|
+
}
|
|
24
|
+
get routes() {
|
|
25
|
+
return this._routes;
|
|
26
|
+
}
|
|
27
|
+
addRoutes(routes) {
|
|
28
|
+
routes.forEach((routeSettings) => {
|
|
29
|
+
this.addRoute(routeSettings.route, routeSettings.token);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
addRoute(basePath, token) {
|
|
33
|
+
const { injector } = this;
|
|
34
|
+
const provider = injector.getProvider(token);
|
|
35
|
+
if (!provider || provider.hasParent()) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const ctrlPath = concatPath(basePath, JsonEntityStore.from(provider.token).path);
|
|
39
|
+
this._controllers.push({
|
|
40
|
+
route: ctrlPath,
|
|
41
|
+
provider
|
|
42
|
+
});
|
|
43
|
+
this.app.use(ctrlPath, ...[].concat(getRouter(injector, provider).callback()));
|
|
44
|
+
this._routes = getOperationsRoutes(provider.token, {
|
|
45
|
+
withChildren: true,
|
|
46
|
+
basePath
|
|
47
|
+
}).reduce((routes, operationRoute) => {
|
|
48
|
+
if (injector.hasProvider(token)) {
|
|
49
|
+
const provider = injector.getProvider(operationRoute.token);
|
|
50
|
+
const route = new PlatformRouteDetails({
|
|
51
|
+
...operationRoute,
|
|
52
|
+
provider
|
|
53
|
+
});
|
|
54
|
+
return routes.concat(route);
|
|
55
|
+
}
|
|
56
|
+
return routes;
|
|
57
|
+
}, this._routes);
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get all routes built by TsExpressDecorators and mounted on Express application.
|
|
62
|
+
* @returns {PlatformRouteDetails[]}
|
|
63
|
+
*/
|
|
64
|
+
getRoutes() {
|
|
65
|
+
return this._routes;
|
|
66
|
+
}
|
|
67
|
+
getMountedControllers() {
|
|
68
|
+
return this._controllers;
|
|
69
|
+
}
|
|
70
|
+
$onInit() {
|
|
71
|
+
this.buildControllers();
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Create routers from the collected controllers.
|
|
75
|
+
* @private
|
|
76
|
+
*/
|
|
77
|
+
createRouters() {
|
|
78
|
+
const { injector } = this;
|
|
79
|
+
injector.getProviders(ProviderType.CONTROLLER).map((provider) => {
|
|
80
|
+
createRouter(injector, provider);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Create controllers from DI
|
|
85
|
+
* @private
|
|
86
|
+
*/
|
|
87
|
+
buildControllers() {
|
|
88
|
+
const { injector } = this;
|
|
89
|
+
injector.getProviders(ProviderType.CONTROLLER).map((provider) => {
|
|
90
|
+
if (!provider.hasParent()) {
|
|
91
|
+
return buildRouter(injector, provider);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
Platform = __decorate([
|
|
97
|
+
Injectable({
|
|
98
|
+
scope: ProviderScope.SINGLETON,
|
|
99
|
+
imports: [PlatformMiddlewaresChain]
|
|
100
|
+
}),
|
|
101
|
+
__metadata("design:paramtypes", [InjectorService, PlatformApplication])
|
|
102
|
+
], Platform);
|
|
103
|
+
export { Platform };
|
|
104
|
+
//# sourceMappingURL=Platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Platform.js","sourceRoot":"","sources":["../../../src/services/Platform.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAgB,MAAM,UAAU,CAAC;AACjG,OAAO,EAAC,UAAU,EAAE,mBAAmB,EAAE,eAAe,EAAC,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAC,WAAW,EAAE,YAAY,EAAE,SAAS,EAAC,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAuC,oBAAoB,EAAC,MAAM,WAAW,CAAC;AAErF,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AAEpE;;;;GAIG;AAKH,IAAa,QAAQ,GAArB,MAAa,QAAQ;IAInB,YAAqB,QAAyB,EAAW,mBAAwC;QAA5E,aAAQ,GAAR,QAAQ,CAAiB;QAAW,wBAAmB,GAAnB,mBAAmB,CAAqB;QAHzF,YAAO,GAA2B,EAAE,CAAC;QACrC,iBAAY,GAAsB,EAAE,CAAC;QAG3C,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEM,SAAS,CAAC,MAAe;QAC9B,MAAM,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;YAC/B,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,QAAQ,CAAC,QAAgB,EAAE,KAAoB;QACpD,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC;QACxB,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAuB,CAAC;QAEnE,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,SAAS,EAAE,EAAE;YACrC,OAAO;SACR;QAED,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;QAEjF,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;YACrB,KAAK,EAAE,QAAQ;YACf,QAAQ;SACT,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAE/E,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAmB,QAAQ,CAAC,KAAK,EAAE;YACnE,YAAY,EAAE,IAAI;YAClB,QAAQ;SACT,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE;YACnC,IAAI,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE;gBAC/B,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,cAAc,CAAC,KAAK,CAAuB,CAAC;gBAClF,MAAM,KAAK,GAAG,IAAI,oBAAoB,CAAC;oBACrC,GAAG,cAAc;oBACjB,QAAQ;iBACT,CAAC,CAAC;gBAEH,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAC7B;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAEjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEM,qBAAqB;QAC1B,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAES,OAAO;QACf,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACK,aAAa;QACnB,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC;QAExB,QAAQ,CAAC,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,QAA4B,EAAE,EAAE;YAClF,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACK,gBAAgB;QACtB,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC;QAExB,QAAQ,CAAC,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,QAA4B,EAAE,EAAE;YAClF,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE;gBACzB,OAAO,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;aACxC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AApGY,QAAQ;IAJpB,UAAU,CAAC;QACV,KAAK,EAAE,aAAa,CAAC,SAAS;QAC9B,OAAO,EAAE,CAAC,wBAAwB,CAAC;KACpC,CAAC;qCAK+B,eAAe,EAAgC,mBAAmB;GAJtF,QAAQ,CAoGpB;SApGY,QAAQ","sourcesContent":["import {Injectable, InjectorService, ProviderScope, ProviderType, TokenProvider} from \"@tsed/di\";\nimport {concatPath, getOperationsRoutes, JsonEntityStore} from \"@tsed/schema\";\nimport {buildRouter, createRouter, getRouter} from \"../builder/PlatformControllerBuilder\";\nimport {ControllerProvider, EndpointMetadata, PlatformRouteDetails} from \"../domain\";\nimport {Route, RouteController} from \"../interfaces/Route\";\nimport {PlatformApplication} from \"./PlatformApplication\";\nimport {PlatformMiddlewaresChain} from \"./PlatformMiddlewaresChain\";\n\n/**\n * `Platform` is used to provide all routes collected by annotation `@Controller`.\n *\n * @platform\n */\n@Injectable({\n scope: ProviderScope.SINGLETON,\n imports: [PlatformMiddlewaresChain]\n})\nexport class Platform {\n private _routes: PlatformRouteDetails[] = [];\n private _controllers: RouteController[] = [];\n\n constructor(readonly injector: InjectorService, readonly platformApplication: PlatformApplication) {\n this.createRouters();\n }\n\n get app() {\n return this.platformApplication;\n }\n\n get routes(): PlatformRouteDetails[] {\n return this._routes;\n }\n\n public addRoutes(routes: Route[]) {\n routes.forEach((routeSettings) => {\n this.addRoute(routeSettings.route, routeSettings.token);\n });\n }\n\n public addRoute(basePath: string, token: TokenProvider) {\n const {injector} = this;\n const provider = injector.getProvider(token) as ControllerProvider;\n\n if (!provider || provider.hasParent()) {\n return;\n }\n\n const ctrlPath = concatPath(basePath, JsonEntityStore.from(provider.token).path);\n\n this._controllers.push({\n route: ctrlPath,\n provider\n });\n\n this.app.use(ctrlPath, ...[].concat(getRouter(injector, provider).callback()));\n\n this._routes = getOperationsRoutes<EndpointMetadata>(provider.token, {\n withChildren: true,\n basePath\n }).reduce((routes, operationRoute) => {\n if (injector.hasProvider(token)) {\n const provider = injector.getProvider(operationRoute.token) as ControllerProvider;\n const route = new PlatformRouteDetails({\n ...operationRoute,\n provider\n });\n\n return routes.concat(route);\n }\n\n return routes;\n }, this._routes);\n\n return this;\n }\n\n /**\n * Get all routes built by TsExpressDecorators and mounted on Express application.\n * @returns {PlatformRouteDetails[]}\n */\n public getRoutes(): PlatformRouteDetails[] {\n return this._routes;\n }\n\n public getMountedControllers(): RouteController[] {\n return this._controllers;\n }\n\n protected $onInit() {\n this.buildControllers();\n }\n\n /**\n * Create routers from the collected controllers.\n * @private\n */\n private createRouters() {\n const {injector} = this;\n\n injector.getProviders(ProviderType.CONTROLLER).map((provider: ControllerProvider) => {\n createRouter(injector, provider);\n });\n }\n\n /**\n * Create controllers from DI\n * @private\n */\n private buildControllers() {\n const {injector} = this;\n\n injector.getProviders(ProviderType.CONTROLLER).map((provider: ControllerProvider) => {\n if (!provider.hasParent()) {\n return buildRouter(injector, provider);\n }\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var PlatformApplication_1;
|
|
2
|
+
import { __decorate, __metadata } from "tslib";
|
|
3
|
+
import { Injectable, ProviderScope } from "@tsed/di";
|
|
4
|
+
import { createFakeRawDriver } from "./FakeRawDriver";
|
|
5
|
+
import { PlatformHandler } from "./PlatformHandler";
|
|
6
|
+
import { PlatformRouter } from "./PlatformRouter";
|
|
7
|
+
/**
|
|
8
|
+
* `PlatformApplication` is used to provide all routes collected by annotation `@Controller`.
|
|
9
|
+
*
|
|
10
|
+
* @platform
|
|
11
|
+
*/
|
|
12
|
+
let PlatformApplication = PlatformApplication_1 = class PlatformApplication extends PlatformRouter {
|
|
13
|
+
constructor(platformHandler) {
|
|
14
|
+
super(platformHandler);
|
|
15
|
+
this.rawApp = this.raw = PlatformApplication_1.createRawApp();
|
|
16
|
+
}
|
|
17
|
+
static createRawApp() {
|
|
18
|
+
return createFakeRawDriver();
|
|
19
|
+
}
|
|
20
|
+
getApp() {
|
|
21
|
+
return this.raw;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
PlatformApplication = PlatformApplication_1 = __decorate([
|
|
25
|
+
Injectable({
|
|
26
|
+
scope: ProviderScope.SINGLETON
|
|
27
|
+
}),
|
|
28
|
+
__metadata("design:paramtypes", [PlatformHandler])
|
|
29
|
+
], PlatformApplication);
|
|
30
|
+
export { PlatformApplication };
|
|
31
|
+
//# sourceMappingURL=PlatformApplication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlatformApplication.js","sourceRoot":"","sources":["../../../src/services/PlatformApplication.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;AACnD,OAAO,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAShD;;;;GAIG;AAIH,IAAa,mBAAmB,2BAAhC,MAAa,mBAAkE,SAAQ,cAAsB;IAK3G,YAAY,eAAgC;QAC1C,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,GAAG,qBAAmB,CAAC,YAAY,EAAS,CAAC;IACrE,CAAC;IAES,MAAM,CAAC,YAAY;QAC3B,OAAO,mBAAmB,EAAE,CAAC;IAC/B,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;CACF,CAAA;AAjBY,mBAAmB;IAH/B,UAAU,CAAC;QACV,KAAK,EAAE,aAAa,CAAC,SAAS;KAC/B,CAAC;qCAM6B,eAAe;GALjC,mBAAmB,CAiB/B;SAjBY,mBAAmB","sourcesContent":["import {Injectable, ProviderScope} from \"@tsed/di\";\nimport {createFakeRawDriver} from \"./FakeRawDriver\";\nimport {PlatformHandler} from \"./PlatformHandler\";\nimport {PlatformRouter} from \"./PlatformRouter\";\n\ndeclare global {\n namespace TsED {\n // @ts-ignore\n export interface Application {}\n }\n}\n\n/**\n * `PlatformApplication` is used to provide all routes collected by annotation `@Controller`.\n *\n * @platform\n */\n@Injectable({\n scope: ProviderScope.SINGLETON\n})\nexport class PlatformApplication<App = TsED.Application, Router = TsED.Router> extends PlatformRouter<Router> {\n raw: App;\n rawApp: App;\n declare rawRouter: Router;\n\n constructor(platformHandler: PlatformHandler) {\n super(platformHandler);\n this.rawApp = this.raw = PlatformApplication.createRawApp() as any;\n }\n\n protected static createRawApp(): any {\n return createFakeRawDriver();\n }\n\n getApp(): App {\n return this.raw;\n }\n}\n"]}
|