@tsed/common 7.0.0-alpha.1 → 7.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/builder/PlatformBuilder.js +286 -0
- package/lib/cjs/builder/PlatformBuilder.js.map +1 -0
- package/lib/cjs/builder/PlatformControllerBuilder.js +82 -0
- package/lib/cjs/builder/PlatformControllerBuilder.js.map +1 -0
- package/lib/cjs/config/interfaces/ConverterSettings.js +3 -0
- package/lib/cjs/config/interfaces/ConverterSettings.js.map +1 -0
- package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js +3 -0
- package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js.map +1 -0
- package/lib/cjs/config/interfaces/PlatformLoggerSettings.js +3 -0
- package/lib/cjs/config/interfaces/PlatformLoggerSettings.js.map +1 -0
- package/lib/cjs/config/interfaces/PlatformMulterSettings.js +3 -0
- package/lib/cjs/config/interfaces/PlatformMulterSettings.js.map +1 -0
- package/lib/cjs/config/interfaces/PlatformStaticsSettings.js +3 -0
- package/lib/cjs/config/interfaces/PlatformStaticsSettings.js.map +1 -0
- package/lib/cjs/config/services/PlatformConfiguration.js +181 -0
- package/lib/cjs/config/services/PlatformConfiguration.js.map +1 -0
- package/lib/cjs/constants/routerOptions.js +5 -0
- package/lib/cjs/constants/routerOptions.js.map +1 -0
- package/lib/cjs/decorators/multer/multerFileSize.js +35 -0
- package/lib/cjs/decorators/multer/multerFileSize.js.map +1 -0
- package/lib/cjs/decorators/multer/multerOptions.js +52 -0
- package/lib/cjs/decorators/multer/multerOptions.js.map +1 -0
- package/lib/cjs/decorators/multer/multipartFile.js +78 -0
- package/lib/cjs/decorators/multer/multipartFile.js.map +1 -0
- package/lib/cjs/decorators/params/error.js +20 -0
- package/lib/cjs/decorators/params/error.js.map +1 -0
- package/lib/cjs/decorators/params/next.js +21 -0
- package/lib/cjs/decorators/params/next.js.map +1 -0
- package/lib/cjs/decorators/params/request.js +39 -0
- package/lib/cjs/decorators/params/request.js.map +1 -0
- package/lib/cjs/decorators/params/response.js +33 -0
- package/lib/cjs/decorators/params/response.js.map +1 -0
- package/lib/cjs/domain/AnyToPromiseWithCtx.js +27 -0
- package/lib/cjs/domain/AnyToPromiseWithCtx.js.map +1 -0
- package/lib/cjs/domain/ControllerProvider.js +51 -0
- package/lib/cjs/domain/ControllerProvider.js.map +1 -0
- package/lib/cjs/domain/EndpointMetadata.js +6 -0
- package/lib/cjs/domain/EndpointMetadata.js.map +1 -0
- package/lib/cjs/domain/HandlerMetadata.js +57 -0
- package/lib/cjs/domain/HandlerMetadata.js.map +1 -0
- package/lib/cjs/domain/PlatformContext.js +92 -0
- package/lib/cjs/domain/PlatformContext.js.map +1 -0
- package/lib/cjs/domain/PlatformRouteDetails.js +24 -0
- package/lib/cjs/domain/PlatformRouteDetails.js.map +1 -0
- package/lib/cjs/exports.js +31 -0
- package/lib/cjs/exports.js.map +1 -0
- package/lib/cjs/index.js +70 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/interfaces/AfterInit.js +3 -0
- package/lib/cjs/interfaces/AfterInit.js.map +1 -0
- package/lib/cjs/interfaces/AfterListen.js +3 -0
- package/lib/cjs/interfaces/AfterListen.js.map +1 -0
- package/lib/cjs/interfaces/AfterRoutesInit.js +3 -0
- package/lib/cjs/interfaces/AfterRoutesInit.js.map +1 -0
- package/lib/cjs/interfaces/BeforeInit.js +3 -0
- package/lib/cjs/interfaces/BeforeInit.js.map +1 -0
- package/lib/cjs/interfaces/BeforeListen.js +3 -0
- package/lib/cjs/interfaces/BeforeListen.js.map +1 -0
- package/lib/cjs/interfaces/BeforeRoutesInit.js +3 -0
- package/lib/cjs/interfaces/BeforeRoutesInit.js.map +1 -0
- package/lib/cjs/interfaces/HandlerType.js +17 -0
- package/lib/cjs/interfaces/HandlerType.js.map +1 -0
- package/lib/cjs/interfaces/IncomingEvent.js +3 -0
- package/lib/cjs/interfaces/IncomingEvent.js.map +1 -0
- package/lib/cjs/interfaces/OnReady.js +3 -0
- package/lib/cjs/interfaces/OnReady.js.map +1 -0
- package/lib/cjs/interfaces/OnRequest.js +3 -0
- package/lib/cjs/interfaces/OnRequest.js.map +1 -0
- package/lib/cjs/interfaces/OnResponse.js +3 -0
- package/lib/cjs/interfaces/OnResponse.js.map +1 -0
- package/lib/cjs/interfaces/OnRoutesInit.js +3 -0
- package/lib/cjs/interfaces/OnRoutesInit.js.map +1 -0
- package/lib/cjs/interfaces/PlatformRouteOptions.js +3 -0
- package/lib/cjs/interfaces/PlatformRouteOptions.js.map +1 -0
- package/lib/cjs/interfaces/ResponseErrorObject.js +3 -0
- package/lib/cjs/interfaces/ResponseErrorObject.js.map +1 -0
- package/lib/cjs/interfaces/Route.js +3 -0
- package/lib/cjs/interfaces/Route.js.map +1 -0
- package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js +37 -0
- package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -0
- package/lib/cjs/middlewares/PlatformMulterMiddleware.js +67 -0
- package/lib/cjs/middlewares/PlatformMulterMiddleware.js.map +1 -0
- package/lib/cjs/middlewares/__mock__/FakeCtrl.js +12 -0
- package/lib/cjs/middlewares/__mock__/FakeCtrl.js.map +1 -0
- package/lib/cjs/middlewares/bindEndpointMiddleware.js +13 -0
- package/lib/cjs/middlewares/bindEndpointMiddleware.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/services/FakeAdapter.js +55 -0
- package/lib/cjs/services/FakeAdapter.js.map +1 -0
- package/lib/cjs/services/Platform.js +128 -0
- package/lib/cjs/services/Platform.js.map +1 -0
- package/lib/cjs/services/PlatformAdapter.js +14 -0
- package/lib/cjs/services/PlatformAdapter.js.map +1 -0
- package/lib/cjs/services/PlatformApplication.js +32 -0
- package/lib/cjs/services/PlatformApplication.js.map +1 -0
- package/lib/cjs/services/PlatformHandler.js +235 -0
- package/lib/cjs/services/PlatformHandler.js.map +1 -0
- package/lib/cjs/services/PlatformMiddlewaresChain.js +75 -0
- package/lib/cjs/services/PlatformMiddlewaresChain.js.map +1 -0
- package/lib/cjs/services/PlatformRequest.js +138 -0
- package/lib/cjs/services/PlatformRequest.js.map +1 -0
- package/lib/cjs/services/PlatformResponse.js +271 -0
- package/lib/cjs/services/PlatformResponse.js.map +1 -0
- package/lib/cjs/services/PlatformRouter.js +108 -0
- package/lib/cjs/services/PlatformRouter.js.map +1 -0
- package/lib/cjs/services/PlatformTest.js +167 -0
- package/lib/cjs/services/PlatformTest.js.map +1 -0
- package/lib/cjs/utils/__mock__/Test1.js +8 -0
- package/lib/cjs/utils/__mock__/Test1.js.map +1 -0
- package/lib/cjs/utils/__mock__/Test2.js +8 -0
- package/lib/cjs/utils/__mock__/Test2.js.map +1 -0
- package/lib/cjs/utils/createContext.js +38 -0
- package/lib/cjs/utils/createContext.js.map +1 -0
- package/lib/cjs/utils/createHandlerMetadata.js +49 -0
- package/lib/cjs/utils/createHandlerMetadata.js.map +1 -0
- package/lib/cjs/utils/createHttpServer.js +29 -0
- package/lib/cjs/utils/createHttpServer.js.map +1 -0
- package/lib/cjs/utils/createHttpsServer.js +29 -0
- package/lib/cjs/utils/createHttpsServer.js.map +1 -0
- package/lib/cjs/utils/createInjector.js +46 -0
- package/lib/cjs/utils/createInjector.js.map +1 -0
- package/lib/cjs/utils/getConfiguration.js +42 -0
- package/lib/cjs/utils/getConfiguration.js.map +1 -0
- package/lib/cjs/utils/getStaticsOptions.js +21 -0
- package/lib/cjs/utils/getStaticsOptions.js.map +1 -0
- package/lib/cjs/utils/importProviders.js +29 -0
- package/lib/cjs/utils/importProviders.js.map +1 -0
- package/lib/cjs/utils/listenServer.js +21 -0
- package/lib/cjs/utils/listenServer.js.map +1 -0
- package/lib/cjs/utils/mapReturnedResponse.js +15 -0
- package/lib/cjs/utils/mapReturnedResponse.js.map +1 -0
- package/lib/cjs/utils/printRoutes.js +36 -0
- package/lib/cjs/utils/printRoutes.js.map +1 -0
- package/lib/cjs/utils/setResponseHeaders.js +35 -0
- package/lib/cjs/utils/setResponseHeaders.js.map +1 -0
- package/lib/cjs/utils/useCtxHandler.js +15 -0
- package/lib/cjs/utils/useCtxHandler.js.map +1 -0
- package/lib/esm/builder/PlatformBuilder.js +282 -0
- package/lib/esm/builder/PlatformBuilder.js.map +1 -0
- package/lib/esm/builder/PlatformControllerBuilder.js +76 -0
- package/lib/esm/builder/PlatformControllerBuilder.js.map +1 -0
- package/lib/esm/config/interfaces/ConverterSettings.js +2 -0
- package/lib/esm/config/interfaces/ConverterSettings.js.map +1 -0
- package/lib/esm/config/interfaces/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/services/PlatformConfiguration.js +178 -0
- package/lib/esm/config/services/PlatformConfiguration.js.map +1 -0
- package/lib/esm/constants/routerOptions.js +2 -0
- package/lib/esm/constants/routerOptions.js.map +1 -0
- package/lib/esm/decorators/multer/multerFileSize.js +31 -0
- package/lib/esm/decorators/multer/multerFileSize.js.map +1 -0
- package/lib/esm/decorators/multer/multerOptions.js +48 -0
- package/lib/esm/decorators/multer/multerOptions.js.map +1 -0
- package/lib/esm/decorators/multer/multipartFile.js +74 -0
- package/lib/esm/decorators/multer/multipartFile.js.map +1 -0
- package/lib/esm/decorators/params/error.js +16 -0
- package/lib/esm/decorators/params/error.js.map +1 -0
- package/lib/esm/decorators/params/next.js +17 -0
- package/lib/esm/decorators/params/next.js.map +1 -0
- package/lib/esm/decorators/params/request.js +34 -0
- package/lib/esm/decorators/params/request.js.map +1 -0
- package/lib/esm/decorators/params/response.js +28 -0
- package/lib/esm/decorators/params/response.js.map +1 -0
- package/lib/esm/domain/AnyToPromiseWithCtx.js +23 -0
- package/lib/esm/domain/AnyToPromiseWithCtx.js.map +1 -0
- package/lib/esm/domain/ControllerProvider.js +47 -0
- package/lib/esm/domain/ControllerProvider.js.map +1 -0
- package/lib/esm/domain/EndpointMetadata.js +2 -0
- package/lib/esm/domain/EndpointMetadata.js.map +1 -0
- package/lib/esm/domain/HandlerMetadata.js +53 -0
- package/lib/esm/domain/HandlerMetadata.js.map +1 -0
- package/lib/esm/domain/PlatformContext.js +88 -0
- package/lib/esm/domain/PlatformContext.js.map +1 -0
- package/lib/esm/domain/PlatformRouteDetails.js +20 -0
- package/lib/esm/domain/PlatformRouteDetails.js.map +1 -0
- package/lib/esm/exports.js +13 -0
- package/lib/esm/exports.js.map +1 -0
- package/lib/esm/index.js +67 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/interfaces/AfterInit.js +2 -0
- package/lib/esm/interfaces/AfterInit.js.map +1 -0
- package/lib/esm/interfaces/AfterListen.js +2 -0
- package/lib/esm/interfaces/AfterListen.js.map +1 -0
- package/lib/esm/interfaces/AfterRoutesInit.js +2 -0
- package/lib/esm/interfaces/AfterRoutesInit.js.map +1 -0
- package/lib/esm/interfaces/BeforeInit.js +2 -0
- package/lib/esm/interfaces/BeforeInit.js.map +1 -0
- package/lib/esm/interfaces/BeforeListen.js +2 -0
- package/lib/esm/interfaces/BeforeListen.js.map +1 -0
- package/lib/esm/interfaces/BeforeRoutesInit.js +2 -0
- package/lib/esm/interfaces/BeforeRoutesInit.js.map +1 -0
- package/lib/esm/interfaces/HandlerType.js +14 -0
- package/lib/esm/interfaces/HandlerType.js.map +1 -0
- package/lib/esm/interfaces/IncomingEvent.js +2 -0
- package/lib/esm/interfaces/IncomingEvent.js.map +1 -0
- package/lib/esm/interfaces/OnReady.js +2 -0
- package/lib/esm/interfaces/OnReady.js.map +1 -0
- package/lib/esm/interfaces/OnRequest.js +2 -0
- package/lib/esm/interfaces/OnRequest.js.map +1 -0
- package/lib/esm/interfaces/OnResponse.js +2 -0
- package/lib/esm/interfaces/OnResponse.js.map +1 -0
- package/lib/esm/interfaces/OnRoutesInit.js +2 -0
- package/lib/esm/interfaces/OnRoutesInit.js.map +1 -0
- package/lib/esm/interfaces/PlatformRouteOptions.js +2 -0
- package/lib/esm/interfaces/PlatformRouteOptions.js.map +1 -0
- package/lib/esm/interfaces/ResponseErrorObject.js +2 -0
- package/lib/esm/interfaces/ResponseErrorObject.js.map +1 -0
- package/lib/esm/interfaces/Route.js +2 -0
- package/lib/esm/interfaces/Route.js.map +1 -0
- package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js +34 -0
- package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -0
- package/lib/esm/middlewares/PlatformMulterMiddleware.js +63 -0
- package/lib/esm/middlewares/PlatformMulterMiddleware.js.map +1 -0
- package/lib/esm/middlewares/__mock__/FakeCtrl.js +9 -0
- package/lib/esm/middlewares/__mock__/FakeCtrl.js.map +1 -0
- package/lib/esm/middlewares/bindEndpointMiddleware.js +9 -0
- package/lib/esm/middlewares/bindEndpointMiddleware.js.map +1 -0
- package/lib/esm/package.json +3 -0
- package/lib/esm/services/FakeAdapter.js +51 -0
- package/lib/esm/services/FakeAdapter.js.map +1 -0
- package/lib/esm/services/Platform.js +125 -0
- package/lib/esm/services/Platform.js.map +1 -0
- package/lib/esm/services/PlatformAdapter.js +10 -0
- package/lib/esm/services/PlatformAdapter.js.map +1 -0
- package/lib/esm/services/PlatformApplication.js +29 -0
- package/lib/esm/services/PlatformApplication.js.map +1 -0
- package/lib/esm/services/PlatformHandler.js +232 -0
- package/lib/esm/services/PlatformHandler.js.map +1 -0
- package/lib/esm/services/PlatformMiddlewaresChain.js +72 -0
- package/lib/esm/services/PlatformMiddlewaresChain.js.map +1 -0
- package/lib/esm/services/PlatformRequest.js +135 -0
- package/lib/esm/services/PlatformRequest.js.map +1 -0
- package/lib/esm/services/PlatformResponse.js +268 -0
- package/lib/esm/services/PlatformResponse.js.map +1 -0
- package/lib/esm/services/PlatformRouter.js +105 -0
- package/lib/esm/services/PlatformRouter.js.map +1 -0
- package/lib/esm/services/PlatformTest.js +162 -0
- package/lib/esm/services/PlatformTest.js.map +1 -0
- package/lib/esm/utils/__mock__/Test1.js +4 -0
- package/lib/esm/utils/__mock__/Test1.js.map +1 -0
- package/lib/esm/utils/__mock__/Test2.js +4 -0
- package/lib/esm/utils/__mock__/Test2.js.map +1 -0
- package/lib/esm/utils/createContext.js +34 -0
- package/lib/esm/utils/createContext.js.map +1 -0
- package/lib/esm/utils/createHandlerMetadata.js +45 -0
- package/lib/esm/utils/createHandlerMetadata.js.map +1 -0
- package/lib/esm/utils/createHttpServer.js +24 -0
- package/lib/esm/utils/createHttpServer.js.map +1 -0
- package/lib/esm/utils/createHttpsServer.js +24 -0
- package/lib/esm/utils/createHttpsServer.js.map +1 -0
- package/lib/esm/utils/createInjector.js +42 -0
- package/lib/esm/utils/createInjector.js.map +1 -0
- package/lib/esm/utils/getConfiguration.js +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/importProviders.js +25 -0
- package/lib/esm/utils/importProviders.js.map +1 -0
- package/lib/esm/utils/listenServer.js +17 -0
- package/lib/esm/utils/listenServer.js.map +1 -0
- package/lib/esm/utils/mapReturnedResponse.js +11 -0
- package/lib/esm/utils/mapReturnedResponse.js.map +1 -0
- package/lib/esm/utils/printRoutes.js +32 -0
- package/lib/esm/utils/printRoutes.js.map +1 -0
- package/lib/esm/utils/setResponseHeaders.js +31 -0
- package/lib/esm/utils/setResponseHeaders.js.map +1 -0
- package/lib/esm/utils/useCtxHandler.js +11 -0
- package/lib/esm/utils/useCtxHandler.js.map +1 -0
- package/lib/{builder → types/builder}/PlatformBuilder.d.ts +28 -32
- package/lib/types/builder/PlatformControllerBuilder.d.ts +18 -0
- package/lib/{config → types/config}/interfaces/ConverterSettings.d.ts +0 -0
- package/lib/{config → types/config}/interfaces/EndpointDirectoriesSettings.d.ts +0 -0
- package/lib/{config → types/config}/interfaces/PlatformLoggerSettings.d.ts +0 -16
- package/lib/types/config/interfaces/PlatformMulterSettings.d.ts +14 -0
- package/lib/{config → types/config}/interfaces/PlatformStaticsSettings.d.ts +1 -0
- package/lib/{config → types/config}/services/PlatformConfiguration.d.ts +15 -12
- package/lib/{constants → types/constants}/routerOptions.d.ts +0 -0
- package/lib/{decorators → types/decorators}/multer/multerFileSize.d.ts +0 -0
- package/lib/{decorators → types/decorators}/multer/multerOptions.d.ts +0 -0
- package/lib/{decorators → types/decorators}/multer/multipartFile.d.ts +0 -0
- package/lib/{decorators → types/decorators}/params/error.d.ts +0 -0
- package/lib/{decorators → types/decorators}/params/next.d.ts +0 -0
- package/lib/{decorators → types/decorators}/params/request.d.ts +0 -0
- package/lib/{decorators → types/decorators}/params/response.d.ts +0 -0
- package/lib/{domain → types/domain}/AnyToPromiseWithCtx.d.ts +0 -0
- package/lib/types/domain/ControllerProvider.d.ts +24 -0
- package/lib/types/domain/EndpointMetadata.d.ts +1 -0
- package/lib/{domain → types/domain}/HandlerMetadata.d.ts +2 -2
- package/lib/{domain → types/domain}/PlatformContext.d.ts +2 -2
- package/lib/types/domain/PlatformRouteDetails.d.ts +22 -0
- package/lib/types/exports.d.ts +12 -0
- package/lib/types/index.d.ts +66 -0
- package/lib/{interfaces → types/interfaces}/AfterInit.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/AfterListen.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/AfterRoutesInit.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/BeforeInit.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/BeforeListen.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/BeforeRoutesInit.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/HandlerType.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/IncomingEvent.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/OnReady.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/OnRequest.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/OnResponse.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/OnRoutesInit.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/PlatformRouteOptions.d.ts +6 -4
- package/lib/{interfaces → types/interfaces}/ResponseErrorObject.d.ts +0 -0
- package/lib/{interfaces → types/interfaces}/Route.d.ts +0 -0
- package/lib/{middlewares → types/middlewares}/PlatformAcceptMimesMiddleware.d.ts +0 -0
- package/lib/{middlewares → types/middlewares}/PlatformMulterMiddleware.d.ts +8 -3
- package/lib/{middlewares/data → types/middlewares/__mock__}/FakeCtrl.d.ts +0 -0
- package/lib/types/middlewares/bindEndpointMiddleware.d.ts +6 -0
- package/lib/types/services/FakeAdapter.d.ts +30 -0
- package/lib/{services → types/services}/Platform.d.ts +22 -7
- package/lib/types/services/PlatformAdapter.d.ts +47 -0
- package/lib/{services → types/services}/PlatformApplication.d.ts +3 -3
- package/lib/{services → types/services}/PlatformHandler.d.ts +4 -9
- package/lib/types/services/PlatformMiddlewaresChain.d.ts +10 -0
- package/lib/{services → types/services}/PlatformRequest.d.ts +2 -1
- package/lib/{services → types/services}/PlatformResponse.d.ts +10 -10
- package/lib/{services → types/services}/PlatformRouter.d.ts +13 -9
- package/lib/{services → types/services}/PlatformTest.d.ts +6 -5
- package/lib/types/utils/__mock__/Test1.d.ts +3 -0
- package/lib/types/utils/__mock__/Test2.d.ts +3 -0
- package/lib/{utils → types/utils}/createContext.d.ts +0 -0
- package/lib/{utils → types/utils}/createHandlerMetadata.d.ts +1 -1
- package/lib/types/utils/createHttpServer.d.ts +4 -0
- package/lib/types/utils/createHttpsServer.d.ts +5 -0
- package/lib/types/utils/createInjector.d.ts +9 -0
- package/lib/types/utils/getConfiguration.d.ts +2 -0
- package/lib/types/utils/getStaticsOptions.d.ts +5 -0
- package/lib/types/utils/importProviders.d.ts +10 -0
- package/lib/types/utils/listenServer.d.ts +7 -0
- package/lib/{utils → types/utils}/mapReturnedResponse.d.ts +0 -0
- package/lib/{utils → types/utils}/printRoutes.d.ts +0 -0
- package/lib/{utils → types/utils}/setResponseHeaders.d.ts +0 -0
- package/lib/{utils → types/utils}/useCtxHandler.d.ts +0 -0
- package/package.json +47 -30
- package/readme.md +50 -57
- package/tsconfig.compile.esm.json +13 -0
- package/lib/PlatformModule.d.ts +0 -15
- package/lib/builder/PlatformControllerBuilder.d.ts +0 -19
- package/lib/config/index.d.ts +0 -3
- package/lib/config/interfaces/PlatformMulterSettings.d.ts +0 -138
- package/lib/config/interfaces/index.d.ts +0 -82
- package/lib/decorators/class/controller.d.ts +0 -43
- package/lib/decorators/httpServer.d.ts +0 -27
- package/lib/decorators/httpsServer.d.ts +0 -27
- package/lib/decorators/index.d.ts +0 -14
- package/lib/decorators/method/acceptMime.d.ts +0 -19
- package/lib/decorators/method/endpointFn.d.ts +0 -8
- package/lib/decorators/method/location.d.ts +0 -1
- package/lib/decorators/method/redirect.d.ts +0 -1
- package/lib/decorators/method/route.d.ts +0 -128
- package/lib/decorators/multer/index.d.ts +0 -3
- package/lib/domain/ControllerProvider.d.ts +0 -54
- package/lib/domain/EndpointMetadata.d.ts +0 -89
- package/lib/domain/PlatformRouteDetails.d.ts +0 -29
- package/lib/domain/index.d.ts +0 -6
- package/lib/index.d.ts +0 -21
- package/lib/index.js +0 -3990
- package/lib/index.js.map +0 -1
- package/lib/index.modern.js +0 -3870
- package/lib/index.modern.js.map +0 -1
- package/lib/interfaces/PathType.d.ts +0 -1
- package/lib/interfaces/PlatformRouterMethods.d.ts +0 -10
- package/lib/interfaces/index.d.ts +0 -18
- package/lib/middlewares/PlatformLogMiddleware.d.ts +0 -44
- package/lib/middlewares/bindEndpointMiddleware.d.ts +0 -5
- package/lib/middlewares/index.d.ts +0 -4
- package/lib/registries/ControllerRegistry.d.ts +0 -1
- package/lib/services/ConverterService.d.ts +0 -27
- package/lib/services/FakeRawDriver.d.ts +0 -15
- package/lib/services/index.d.ts +0 -8
- package/lib/utils/createHttpServer.d.ts +0 -3
- package/lib/utils/createHttpsServer.d.ts +0 -3
- package/lib/utils/createInjector.d.ts +0 -2
- package/lib/utils/createPlatformApplication.d.ts +0 -2
- package/lib/utils/getControllerPath.d.ts +0 -2
- package/lib/utils/index.d.ts +0 -8
- package/lib/utils/listenServer.d.ts +0 -10
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
3
|
-
*
|
|
4
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
5
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
6
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
7
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
8
|
-
* to continue matching subsequent routes.
|
|
9
|
-
* @param path
|
|
10
|
-
* @param args
|
|
11
|
-
* @returns {Function}
|
|
12
|
-
* @decorator
|
|
13
|
-
* @operation
|
|
14
|
-
* @httpMethod
|
|
15
|
-
*/
|
|
16
|
-
export declare function All(path?: string | RegExp | any, ...args: any[]): Function;
|
|
17
|
-
/**
|
|
18
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
19
|
-
*
|
|
20
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
21
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
22
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
23
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
24
|
-
* to continue matching subsequent routes.
|
|
25
|
-
* @param path
|
|
26
|
-
* @param args
|
|
27
|
-
* @returns {Function}
|
|
28
|
-
* @decorator
|
|
29
|
-
* @operation
|
|
30
|
-
* @httpMethod
|
|
31
|
-
*/
|
|
32
|
-
export declare function Get(path?: string | RegExp | any, ...args: any[]): Function;
|
|
33
|
-
/**
|
|
34
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
35
|
-
*
|
|
36
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
37
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
38
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
39
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
40
|
-
* to continue matching subsequent routes.
|
|
41
|
-
* @param path
|
|
42
|
-
* @param args
|
|
43
|
-
* @returns {Function}
|
|
44
|
-
* @decorator
|
|
45
|
-
* @operation
|
|
46
|
-
* @httpMethod
|
|
47
|
-
*/
|
|
48
|
-
export declare function Post(path?: string | RegExp | any, ...args: any[]): Function;
|
|
49
|
-
/**
|
|
50
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
51
|
-
*
|
|
52
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
53
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
54
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
55
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
56
|
-
* to continue matching subsequent routes.
|
|
57
|
-
* @param path
|
|
58
|
-
* @param args
|
|
59
|
-
* @returns {Function}
|
|
60
|
-
* @decorator
|
|
61
|
-
* @operation
|
|
62
|
-
* @httpMethod
|
|
63
|
-
*/
|
|
64
|
-
export declare function Put(path?: string | RegExp | any, ...args: any[]): Function;
|
|
65
|
-
/**
|
|
66
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
67
|
-
*
|
|
68
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
69
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
70
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
71
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
72
|
-
* to continue matching subsequent routes.
|
|
73
|
-
* @param path
|
|
74
|
-
* @param args
|
|
75
|
-
* @returns {Function}
|
|
76
|
-
* @decorator
|
|
77
|
-
* @operation
|
|
78
|
-
* @httpMethod
|
|
79
|
-
*/
|
|
80
|
-
export declare function Delete(path?: string | RegExp | any, ...args: any[]): Function;
|
|
81
|
-
/**
|
|
82
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
83
|
-
*
|
|
84
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
85
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
86
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
87
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
88
|
-
* to continue matching subsequent routes.
|
|
89
|
-
* @param path
|
|
90
|
-
* @param args
|
|
91
|
-
* @returns {Function}
|
|
92
|
-
* @decorator
|
|
93
|
-
* @operation
|
|
94
|
-
* @httpMethod
|
|
95
|
-
*/
|
|
96
|
-
export declare function Head(path?: string | RegExp | any, ...args: any[]): Function;
|
|
97
|
-
/**
|
|
98
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
99
|
-
*
|
|
100
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
101
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
102
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
103
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
104
|
-
* to continue matching subsequent routes.
|
|
105
|
-
* @param path
|
|
106
|
-
* @param args
|
|
107
|
-
* @returns {Function}
|
|
108
|
-
* @decorator
|
|
109
|
-
* @operation
|
|
110
|
-
* @httpMethod
|
|
111
|
-
*/
|
|
112
|
-
export declare function Patch(path?: string | RegExp | any, ...args: any[]): Function;
|
|
113
|
-
/**
|
|
114
|
-
* This method is just like the `router.METHOD()` methods, except that it matches all HTTP methods (verbs).
|
|
115
|
-
*
|
|
116
|
-
* This method is extremely useful for mapping “global” logic for specific path prefixes or arbitrary matches.
|
|
117
|
-
* For example, if you placed the following route at the top of all other route definitions, it would require that
|
|
118
|
-
* all routes from that point on would require authentication, and automatically load a user.
|
|
119
|
-
* Keep in mind that these callbacks do not have to act as end points; loadUser can perform a task, then call next()
|
|
120
|
-
* to continue matching subsequent routes.
|
|
121
|
-
* @param path
|
|
122
|
-
* @param args
|
|
123
|
-
* @returns {Function}
|
|
124
|
-
* @decorator
|
|
125
|
-
* @operation
|
|
126
|
-
* @httpMethod
|
|
127
|
-
*/
|
|
128
|
-
export declare function Options(path?: string | RegExp | any, ...args: any[]): Function;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Provider, TokenProvider } from "@tsed/di";
|
|
2
|
-
import { JsonEntityStore } from "@tsed/schema";
|
|
3
|
-
import { ControllerMiddlewares } from "../decorators/class/controller";
|
|
4
|
-
import { PlatformRouterMethods } from "../interfaces/PlatformRouterMethods";
|
|
5
|
-
import { EndpointMetadata } from "./EndpointMetadata";
|
|
6
|
-
export declare class ControllerProvider<T = any> extends Provider<T> {
|
|
7
|
-
readonly entity: JsonEntityStore;
|
|
8
|
-
private router;
|
|
9
|
-
constructor(provide: TokenProvider, options?: Partial<Provider>);
|
|
10
|
-
get path(): string;
|
|
11
|
-
set path(path: string);
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @returns {EndpointMetadata[]}
|
|
15
|
-
*/
|
|
16
|
-
get endpoints(): EndpointMetadata[];
|
|
17
|
-
get children(): TokenProvider[];
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @returns {ControllerProvider}
|
|
21
|
-
*/
|
|
22
|
-
get parent(): TokenProvider | undefined;
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
get routerOptions(): any;
|
|
27
|
-
/**
|
|
28
|
-
*
|
|
29
|
-
* @param value
|
|
30
|
-
*/
|
|
31
|
-
set routerOptions(value: any);
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @returns {any[]}
|
|
35
|
-
*/
|
|
36
|
-
get middlewares(): ControllerMiddlewares;
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* @param middlewares
|
|
40
|
-
*/
|
|
41
|
-
set middlewares(middlewares: ControllerMiddlewares);
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* @returns {boolean}
|
|
45
|
-
*/
|
|
46
|
-
hasChildren(): boolean;
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* @returns {boolean}
|
|
50
|
-
*/
|
|
51
|
-
hasParent(): boolean;
|
|
52
|
-
getRouter<T extends PlatformRouterMethods = any>(): T;
|
|
53
|
-
setRouter(router: PlatformRouterMethods): this;
|
|
54
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { ParamMetadata } from "@tsed/platform-params";
|
|
3
|
-
import { JsonEntityStore, JsonEntityStoreOptions, 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 JsonEntityStore implements EndpointConstructorOptions {
|
|
34
|
-
beforeMiddlewares: any[];
|
|
35
|
-
middlewares: any[];
|
|
36
|
-
afterMiddlewares: any[];
|
|
37
|
-
statusCode: number;
|
|
38
|
-
constructor(options: EndpointConstructorOptions);
|
|
39
|
-
get targetName(): string;
|
|
40
|
-
get params(): ParamMetadata[];
|
|
41
|
-
/**
|
|
42
|
-
* Return the JsonOperation
|
|
43
|
-
*/
|
|
44
|
-
get operation(): JsonOperation;
|
|
45
|
-
get operationPaths(): Map<string, import("@tsed/schema").JsonMethodPath>;
|
|
46
|
-
get view(): EndpointViewOptions;
|
|
47
|
-
set view(view: EndpointViewOptions);
|
|
48
|
-
get acceptMimes(): string[];
|
|
49
|
-
set acceptMimes(mimes: string[]);
|
|
50
|
-
/**
|
|
51
|
-
* Get all endpoints from a given class and his parents.
|
|
52
|
-
* @param {Type<any>} target
|
|
53
|
-
* @returns {EndpointMetadata[]}
|
|
54
|
-
*/
|
|
55
|
-
static getEndpoints(target: Type<any>): EndpointMetadata[];
|
|
56
|
-
/**
|
|
57
|
-
* Get an endpoint.
|
|
58
|
-
* @param target
|
|
59
|
-
* @param propertyKey
|
|
60
|
-
* @param descriptor
|
|
61
|
-
*/
|
|
62
|
-
static get(target: Type<any>, propertyKey: string | symbol, descriptor?: PropertyDescriptor): EndpointMetadata;
|
|
63
|
-
addOperationPath(method: string, path: string | RegExp, options?: any): JsonOperation;
|
|
64
|
-
/**
|
|
65
|
-
* Find the a value at the controller level. Let this value be extended or overridden by the endpoint itself.
|
|
66
|
-
*
|
|
67
|
-
* @param key
|
|
68
|
-
* @returns {any}
|
|
69
|
-
*/
|
|
70
|
-
get<T = any>(key: any): T;
|
|
71
|
-
/**
|
|
72
|
-
* Append middlewares to the beforeMiddlewares list.
|
|
73
|
-
* @param args
|
|
74
|
-
* @returns {EndpointMetadata}
|
|
75
|
-
*/
|
|
76
|
-
before(args: Function[]): this;
|
|
77
|
-
/**
|
|
78
|
-
* Append middlewares to the afterMiddlewares list.
|
|
79
|
-
* @param args
|
|
80
|
-
* @returns {EndpointMetadata}
|
|
81
|
-
*/
|
|
82
|
-
after(args: Function[]): this;
|
|
83
|
-
/**
|
|
84
|
-
* Store all arguments collected via Annotation.
|
|
85
|
-
* @param args
|
|
86
|
-
*/
|
|
87
|
-
use(args: Function[]): this;
|
|
88
|
-
clone(): EndpointMetadata;
|
|
89
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { EndpointMetadata } from "./EndpointMetadata";
|
|
2
|
-
import { ControllerProvider } from "./ControllerProvider";
|
|
3
|
-
export interface PlatformRouterDetailsOptions {
|
|
4
|
-
provider: ControllerProvider;
|
|
5
|
-
endpoint: EndpointMetadata;
|
|
6
|
-
method: string;
|
|
7
|
-
url: string;
|
|
8
|
-
}
|
|
9
|
-
export declare class PlatformRouteDetails {
|
|
10
|
-
readonly method: string;
|
|
11
|
-
readonly url: string;
|
|
12
|
-
readonly rawBody: boolean;
|
|
13
|
-
readonly endpoint: EndpointMetadata;
|
|
14
|
-
readonly provider: ControllerProvider;
|
|
15
|
-
constructor({ provider, endpoint, method, url }: PlatformRouterDetailsOptions);
|
|
16
|
-
get name(): string;
|
|
17
|
-
get className(): string;
|
|
18
|
-
get methodClassName(): string;
|
|
19
|
-
get parameters(): import("@tsed/platform-params").ParamMetadata[];
|
|
20
|
-
toJSON(): {
|
|
21
|
-
method: string;
|
|
22
|
-
name: string;
|
|
23
|
-
url: string;
|
|
24
|
-
className: string;
|
|
25
|
-
methodClassName: string;
|
|
26
|
-
parameters: import("@tsed/platform-params").ParamMetadata[];
|
|
27
|
-
rawBody: boolean;
|
|
28
|
-
};
|
|
29
|
-
}
|
package/lib/domain/index.d.ts
DELETED
package/lib/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export * from "@tsed/di";
|
|
2
|
-
export * from "@tsed/platform-params";
|
|
3
|
-
export * from "@tsed/platform-exceptions";
|
|
4
|
-
export * from "@tsed/platform-response-filter";
|
|
5
|
-
export * from "@tsed/platform-cache";
|
|
6
|
-
export * from "@tsed/platform-middlewares";
|
|
7
|
-
export * from "@tsed/platform-views";
|
|
8
|
-
export * from "@tsed/components-scan";
|
|
9
|
-
export { $log, Logger } from "@tsed/logger";
|
|
10
|
-
export * from "./config";
|
|
11
|
-
export * from "./builder/PlatformBuilder";
|
|
12
|
-
export * from "./builder/PlatformControllerBuilder";
|
|
13
|
-
export * from "./decorators";
|
|
14
|
-
export * from "./constants/routerOptions";
|
|
15
|
-
export * from "./interfaces";
|
|
16
|
-
export * from "./middlewares";
|
|
17
|
-
export * from "./domain";
|
|
18
|
-
export * from "./services";
|
|
19
|
-
export * from "./registries/ControllerRegistry";
|
|
20
|
-
export * from "./utils";
|
|
21
|
-
export * from "./PlatformModule";
|