@tsed/common 7.0.0-beta.2 → 7.0.0-beta.20
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/coverage.json +6 -0
- package/jest.config.js +9 -0
- package/lib/cjs/builder/PlatformBuilder.js +94 -65
- package/lib/cjs/builder/PlatformBuilder.js.map +1 -1
- package/lib/cjs/config/interfaces/PlatformLoggerSettings.js.map +1 -1
- package/lib/cjs/config/interfaces/PlatformMulterSettings.js.map +1 -1
- package/lib/cjs/config/services/PlatformConfiguration.js +2 -66
- package/lib/cjs/config/services/PlatformConfiguration.js.map +1 -1
- package/lib/cjs/decorators/multer/multipartFile.js.map +1 -1
- package/lib/cjs/decorators/params/error.js +1 -1
- package/lib/cjs/decorators/params/error.js.map +1 -1
- package/lib/cjs/domain/AnyToPromiseWithCtx.js +4 -5
- package/lib/cjs/domain/AnyToPromiseWithCtx.js.map +1 -1
- package/lib/cjs/domain/EndpointMetadata.js +2 -66
- package/lib/cjs/domain/EndpointMetadata.js.map +1 -1
- package/lib/cjs/domain/PlatformContext.js +46 -38
- package/lib/cjs/domain/PlatformContext.js.map +1 -1
- package/lib/cjs/domain/PlatformRouteDetails.js +0 -21
- package/lib/cjs/domain/PlatformRouteDetails.js.map +1 -1
- package/lib/cjs/exports.js +32 -0
- package/lib/cjs/exports.js.map +1 -0
- package/lib/cjs/index.js +58 -30
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interfaces/PlatformRouteOptions.js.map +1 -1
- package/lib/cjs/interfaces/Route.js.map +1 -1
- package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js +10 -9
- package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -1
- package/lib/cjs/middlewares/PlatformMulterMiddleware.js +27 -13
- package/lib/cjs/middlewares/PlatformMulterMiddleware.js.map +1 -1
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/services/FakeAdapter.js +49 -0
- package/lib/cjs/services/FakeAdapter.js.map +1 -0
- package/lib/cjs/services/Platform.js +33 -68
- package/lib/cjs/services/Platform.js.map +1 -1
- package/lib/cjs/services/PlatformAdapter.js +24 -0
- package/lib/cjs/services/PlatformAdapter.js.map +1 -0
- package/lib/cjs/services/PlatformApplication.js +26 -14
- package/lib/cjs/services/PlatformApplication.js.map +1 -1
- package/lib/cjs/services/PlatformHandler.js +115 -172
- package/lib/cjs/services/PlatformHandler.js.map +1 -1
- package/lib/cjs/services/PlatformMiddlewaresChain.js +46 -19
- package/lib/cjs/services/PlatformMiddlewaresChain.js.map +1 -1
- package/lib/cjs/services/PlatformRequest.js +17 -13
- package/lib/cjs/services/PlatformRequest.js.map +1 -1
- package/lib/cjs/services/PlatformResponse.js +20 -23
- package/lib/cjs/services/PlatformResponse.js.map +1 -1
- package/lib/cjs/services/PlatformTest.js +31 -10
- package/lib/cjs/services/PlatformTest.js.map +1 -1
- package/lib/cjs/utils/createContext.js +32 -21
- package/lib/cjs/utils/createContext.js.map +1 -1
- package/lib/cjs/utils/createHttpServer.js +6 -11
- package/lib/cjs/utils/createHttpServer.js.map +1 -1
- package/lib/cjs/utils/createHttpsServer.js +6 -11
- package/lib/cjs/utils/createHttpsServer.js.map +1 -1
- package/lib/cjs/utils/createInjector.js +16 -10
- package/lib/cjs/utils/createInjector.js.map +1 -1
- package/lib/cjs/utils/ensureContext.js +16 -0
- package/lib/cjs/utils/ensureContext.js.map +1 -0
- package/lib/cjs/utils/getConfiguration.js +6 -12
- package/lib/cjs/utils/getConfiguration.js.map +1 -1
- package/lib/cjs/utils/printRoutes.js +10 -8
- package/lib/cjs/utils/printRoutes.js.map +1 -1
- package/lib/cjs/utils/setResponseHeaders.js +8 -14
- package/lib/cjs/utils/setResponseHeaders.js.map +1 -1
- package/lib/esm/builder/PlatformBuilder.js +74 -68
- package/lib/esm/builder/PlatformBuilder.js.map +1 -1
- package/lib/esm/config/interfaces/PlatformLoggerSettings.js.map +1 -1
- package/lib/esm/config/interfaces/PlatformMulterSettings.js.map +1 -1
- package/lib/esm/config/services/PlatformConfiguration.js +0 -64
- package/lib/esm/config/services/PlatformConfiguration.js.map +1 -1
- package/lib/esm/decorators/multer/multerFileSize.js +1 -1
- package/lib/esm/decorators/multer/multerOptions.js +1 -1
- package/lib/esm/decorators/multer/multipartFile.js +1 -1
- package/lib/esm/decorators/multer/multipartFile.js.map +1 -1
- package/lib/esm/decorators/params/error.js +1 -1
- package/lib/esm/decorators/params/error.js.map +1 -1
- package/lib/esm/domain/AnyToPromiseWithCtx.js +4 -5
- package/lib/esm/domain/AnyToPromiseWithCtx.js.map +1 -1
- package/lib/esm/domain/EndpointMetadata.js +1 -66
- package/lib/esm/domain/EndpointMetadata.js.map +1 -1
- package/lib/esm/domain/PlatformContext.js +49 -41
- package/lib/esm/domain/PlatformContext.js.map +1 -1
- package/lib/esm/domain/PlatformRouteDetails.js +1 -19
- package/lib/esm/domain/PlatformRouteDetails.js.map +1 -1
- package/lib/esm/exports.js +14 -0
- package/lib/esm/exports.js.map +1 -0
- package/lib/esm/index.js +58 -27
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/PlatformRouteOptions.js.map +1 -1
- package/lib/esm/interfaces/Route.js.map +1 -1
- package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js +2 -1
- package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -1
- package/lib/esm/middlewares/PlatformMulterMiddleware.js +18 -5
- package/lib/esm/middlewares/PlatformMulterMiddleware.js.map +1 -1
- package/lib/esm/package.json +3 -0
- package/lib/esm/services/FakeAdapter.js +45 -0
- package/lib/esm/services/FakeAdapter.js.map +1 -0
- package/lib/esm/services/Platform.js +34 -69
- package/lib/esm/services/Platform.js.map +1 -1
- package/lib/esm/services/PlatformAdapter.js +20 -0
- package/lib/esm/services/PlatformAdapter.js.map +1 -0
- package/lib/esm/services/PlatformApplication.js +27 -15
- package/lib/esm/services/PlatformApplication.js.map +1 -1
- package/lib/esm/services/PlatformHandler.js +116 -173
- package/lib/esm/services/PlatformHandler.js.map +1 -1
- package/lib/esm/services/PlatformMiddlewaresChain.js +49 -22
- package/lib/esm/services/PlatformMiddlewaresChain.js.map +1 -1
- package/lib/esm/services/PlatformRequest.js +16 -12
- package/lib/esm/services/PlatformRequest.js.map +1 -1
- package/lib/esm/services/PlatformResponse.js +19 -22
- package/lib/esm/services/PlatformResponse.js.map +1 -1
- package/lib/esm/services/PlatformTest.js +34 -14
- package/lib/esm/services/PlatformTest.js.map +1 -1
- package/lib/esm/utils/createContext.js +33 -23
- package/lib/esm/utils/createContext.js.map +1 -1
- package/lib/esm/utils/createHttpServer.js +6 -11
- package/lib/esm/utils/createHttpServer.js.map +1 -1
- package/lib/esm/utils/createHttpsServer.js +6 -11
- package/lib/esm/utils/createHttpsServer.js.map +1 -1
- package/lib/esm/utils/createInjector.js +20 -14
- package/lib/esm/utils/createInjector.js.map +1 -1
- package/lib/esm/utils/ensureContext.js +12 -0
- package/lib/esm/utils/ensureContext.js.map +1 -0
- package/lib/esm/utils/getConfiguration.js +8 -14
- package/lib/esm/utils/getConfiguration.js.map +1 -1
- package/lib/esm/utils/printRoutes.js +10 -8
- package/lib/esm/utils/printRoutes.js.map +1 -1
- package/lib/esm/utils/setResponseHeaders.js +8 -14
- package/lib/esm/utils/setResponseHeaders.js.map +1 -1
- package/lib/types/builder/PlatformBuilder.d.ts +19 -17
- package/lib/types/config/interfaces/PlatformLoggerSettings.d.ts +2 -43
- package/lib/types/config/interfaces/PlatformMulterSettings.d.ts +6 -130
- package/lib/types/config/services/PlatformConfiguration.d.ts +6 -21
- package/lib/types/domain/AnyToPromiseWithCtx.d.ts +1 -9
- package/lib/types/domain/EndpointMetadata.d.ts +1 -50
- package/lib/types/domain/PlatformContext.d.ts +32 -18
- package/lib/types/domain/PlatformRouteDetails.d.ts +4 -20
- package/lib/types/exports.d.ts +13 -0
- package/lib/types/index.d.ts +56 -18
- package/lib/types/interfaces/PlatformRouteOptions.d.ts +1 -2
- package/lib/types/interfaces/Route.d.ts +2 -3
- package/lib/types/middlewares/PlatformMulterMiddleware.d.ts +8 -3
- package/lib/types/services/FakeAdapter.d.ts +31 -0
- package/lib/types/services/Platform.d.ts +9 -21
- package/lib/types/services/PlatformAdapter.d.ts +58 -0
- package/lib/types/services/PlatformApplication.d.ts +15 -7
- package/lib/types/services/PlatformHandler.d.ts +21 -59
- package/lib/types/services/PlatformMiddlewaresChain.d.ts +6 -3
- package/lib/types/services/PlatformRequest.d.ts +8 -10
- package/lib/types/services/PlatformResponse.d.ts +15 -19
- package/lib/types/services/PlatformTest.d.ts +5 -4
- package/lib/types/utils/createContext.d.ts +4 -1
- package/lib/types/utils/createHttpServer.d.ts +1 -1
- package/lib/types/utils/createHttpsServer.d.ts +3 -1
- package/lib/types/utils/createInjector.d.ts +5 -3
- package/lib/types/utils/ensureContext.d.ts +2 -0
- package/lib/types/utils/listenServer.d.ts +2 -0
- package/package.json +43 -26
- package/readme.md +52 -58
- package/tsconfig.compile.esm.json +2 -12
- package/lib/cjs/builder/PlatformControllerBuilder.js +0 -85
- package/lib/cjs/builder/PlatformControllerBuilder.js.map +0 -1
- package/lib/cjs/config/index.js +0 -7
- package/lib/cjs/config/index.js.map +0 -1
- package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js +0 -3
- package/lib/cjs/config/interfaces/EndpointDirectoriesSettings.js.map +0 -1
- package/lib/cjs/config/interfaces/index.js +0 -8
- package/lib/cjs/config/interfaces/index.js.map +0 -1
- package/lib/cjs/decorators/httpServer.js +0 -32
- package/lib/cjs/decorators/httpServer.js.map +0 -1
- package/lib/cjs/decorators/httpsServer.js +0 -32
- package/lib/cjs/decorators/httpsServer.js.map +0 -1
- package/lib/cjs/decorators/index.js +0 -21
- package/lib/cjs/decorators/index.js.map +0 -1
- package/lib/cjs/decorators/method/acceptMime.js +0 -28
- package/lib/cjs/decorators/method/acceptMime.js.map +0 -1
- package/lib/cjs/decorators/method/endpointFn.js +0 -15
- package/lib/cjs/decorators/method/endpointFn.js.map +0 -1
- package/lib/cjs/decorators/method/location.js +0 -6
- package/lib/cjs/decorators/method/location.js.map +0 -1
- package/lib/cjs/decorators/method/redirect.js +0 -6
- package/lib/cjs/decorators/method/redirect.js.map +0 -1
- package/lib/cjs/decorators/method/route.js +0 -13
- package/lib/cjs/decorators/method/route.js.map +0 -1
- package/lib/cjs/decorators/method/view.js +0 -34
- package/lib/cjs/decorators/method/view.js.map +0 -1
- package/lib/cjs/decorators/multer/index.js +0 -7
- package/lib/cjs/decorators/multer/index.js.map +0 -1
- package/lib/cjs/domain/ControllerProvider.js +0 -51
- package/lib/cjs/domain/ControllerProvider.js.map +0 -1
- package/lib/cjs/domain/HandlerMetadata.js +0 -57
- package/lib/cjs/domain/HandlerMetadata.js.map +0 -1
- package/lib/cjs/domain/index.js +0 -10
- package/lib/cjs/domain/index.js.map +0 -1
- package/lib/cjs/interfaces/PathType.js +0 -3
- package/lib/cjs/interfaces/PathType.js.map +0 -1
- package/lib/cjs/interfaces/PlatformAdapter.js +0 -3
- package/lib/cjs/interfaces/PlatformAdapter.js.map +0 -1
- package/lib/cjs/interfaces/index.js +0 -21
- package/lib/cjs/interfaces/index.js.map +0 -1
- package/lib/cjs/middlewares/__mock__/FakeCtrl.js +0 -12
- package/lib/cjs/middlewares/__mock__/FakeCtrl.js.map +0 -1
- package/lib/cjs/middlewares/bindEndpointMiddleware.js +0 -13
- package/lib/cjs/middlewares/bindEndpointMiddleware.js.map +0 -1
- package/lib/cjs/middlewares/index.js +0 -7
- package/lib/cjs/middlewares/index.js.map +0 -1
- package/lib/cjs/services/FakeRawDriver.js +0 -26
- package/lib/cjs/services/FakeRawDriver.js.map +0 -1
- package/lib/cjs/services/PlatformRouter.js +0 -126
- package/lib/cjs/services/PlatformRouter.js.map +0 -1
- package/lib/cjs/services/index.js +0 -12
- package/lib/cjs/services/index.js.map +0 -1
- package/lib/cjs/utils/createHandlerMetadata.js +0 -49
- package/lib/cjs/utils/createHandlerMetadata.js.map +0 -1
- package/lib/cjs/utils/index.js +0 -11
- package/lib/cjs/utils/index.js.map +0 -1
- package/lib/cjs/utils/useCtxHandler.js +0 -15
- package/lib/cjs/utils/useCtxHandler.js.map +0 -1
- package/lib/esm/builder/PlatformControllerBuilder.js +0 -79
- package/lib/esm/builder/PlatformControllerBuilder.js.map +0 -1
- package/lib/esm/config/index.js +0 -4
- package/lib/esm/config/index.js.map +0 -1
- package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js +0 -2
- package/lib/esm/config/interfaces/EndpointDirectoriesSettings.js.map +0 -1
- package/lib/esm/config/interfaces/index.js +0 -5
- package/lib/esm/config/interfaces/index.js.map +0 -1
- package/lib/esm/decorators/httpServer.js +0 -28
- package/lib/esm/decorators/httpServer.js.map +0 -1
- package/lib/esm/decorators/httpsServer.js +0 -28
- package/lib/esm/decorators/httpsServer.js.map +0 -1
- package/lib/esm/decorators/index.js +0 -18
- package/lib/esm/decorators/index.js.map +0 -1
- package/lib/esm/decorators/method/acceptMime.js +0 -24
- package/lib/esm/decorators/method/acceptMime.js.map +0 -1
- package/lib/esm/decorators/method/endpointFn.js +0 -11
- package/lib/esm/decorators/method/endpointFn.js.map +0 -1
- package/lib/esm/decorators/method/location.js +0 -2
- package/lib/esm/decorators/method/location.js.map +0 -1
- package/lib/esm/decorators/method/redirect.js +0 -2
- package/lib/esm/decorators/method/redirect.js.map +0 -1
- package/lib/esm/decorators/method/route.js +0 -2
- package/lib/esm/decorators/method/route.js.map +0 -1
- package/lib/esm/decorators/method/view.js +0 -30
- package/lib/esm/decorators/method/view.js.map +0 -1
- package/lib/esm/decorators/multer/index.js +0 -4
- package/lib/esm/decorators/multer/index.js.map +0 -1
- package/lib/esm/domain/ControllerProvider.js +0 -47
- package/lib/esm/domain/ControllerProvider.js.map +0 -1
- package/lib/esm/domain/HandlerMetadata.js +0 -53
- package/lib/esm/domain/HandlerMetadata.js.map +0 -1
- package/lib/esm/domain/index.js +0 -7
- package/lib/esm/domain/index.js.map +0 -1
- package/lib/esm/interfaces/PathType.js +0 -2
- package/lib/esm/interfaces/PathType.js.map +0 -1
- package/lib/esm/interfaces/PlatformAdapter.js +0 -2
- package/lib/esm/interfaces/PlatformAdapter.js.map +0 -1
- package/lib/esm/interfaces/index.js +0 -18
- package/lib/esm/interfaces/index.js.map +0 -1
- package/lib/esm/middlewares/__mock__/FakeCtrl.js +0 -9
- package/lib/esm/middlewares/__mock__/FakeCtrl.js.map +0 -1
- package/lib/esm/middlewares/bindEndpointMiddleware.js +0 -9
- package/lib/esm/middlewares/bindEndpointMiddleware.js.map +0 -1
- package/lib/esm/middlewares/index.js +0 -4
- package/lib/esm/middlewares/index.js.map +0 -1
- package/lib/esm/services/FakeRawDriver.js +0 -22
- package/lib/esm/services/FakeRawDriver.js.map +0 -1
- package/lib/esm/services/PlatformRouter.js +0 -123
- package/lib/esm/services/PlatformRouter.js.map +0 -1
- package/lib/esm/services/index.js +0 -9
- package/lib/esm/services/index.js.map +0 -1
- package/lib/esm/utils/createHandlerMetadata.js +0 -45
- package/lib/esm/utils/createHandlerMetadata.js.map +0 -1
- package/lib/esm/utils/index.js +0 -8
- package/lib/esm/utils/index.js.map +0 -1
- package/lib/esm/utils/useCtxHandler.js +0 -11
- package/lib/esm/utils/useCtxHandler.js.map +0 -1
- package/lib/types/builder/PlatformControllerBuilder.d.ts +0 -17
- package/lib/types/config/index.d.ts +0 -3
- package/lib/types/config/interfaces/EndpointDirectoriesSettings.d.ts +0 -3
- package/lib/types/config/interfaces/index.d.ts +0 -97
- package/lib/types/decorators/httpServer.d.ts +0 -28
- package/lib/types/decorators/httpsServer.d.ts +0 -28
- package/lib/types/decorators/index.d.ts +0 -14
- package/lib/types/decorators/method/acceptMime.d.ts +0 -19
- package/lib/types/decorators/method/endpointFn.d.ts +0 -9
- package/lib/types/decorators/method/location.d.ts +0 -1
- package/lib/types/decorators/method/redirect.d.ts +0 -1
- package/lib/types/decorators/method/route.d.ts +0 -1
- package/lib/types/decorators/method/view.d.ts +0 -25
- package/lib/types/decorators/multer/index.d.ts +0 -3
- package/lib/types/domain/ControllerProvider.d.ts +0 -24
- package/lib/types/domain/HandlerMetadata.d.ts +0 -32
- package/lib/types/domain/index.d.ts +0 -6
- package/lib/types/interfaces/PathType.d.ts +0 -1
- package/lib/types/interfaces/PlatformAdapter.d.ts +0 -19
- package/lib/types/interfaces/index.d.ts +0 -17
- package/lib/types/middlewares/__mock__/FakeCtrl.d.ts +0 -2
- package/lib/types/middlewares/bindEndpointMiddleware.d.ts +0 -5
- package/lib/types/middlewares/index.d.ts +0 -3
- package/lib/types/services/FakeRawDriver.d.ts +0 -15
- package/lib/types/services/PlatformRouter.d.ts +0 -48
- package/lib/types/services/index.d.ts +0 -8
- package/lib/types/utils/createHandlerMetadata.d.ts +0 -8
- package/lib/types/utils/index.d.ts +0 -7
- package/lib/types/utils/useCtxHandler.d.ts +0 -13
|
@@ -1 +0,0 @@
|
|
|
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;AAChC,cAAc,mBAAmB,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\";\nexport * from \"./PlatformAdapter\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/middlewares/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC","sourcesContent":["export * from \"./bindEndpointMiddleware\";\nexport * from \"./PlatformMulterMiddleware\";\nexport * from \"./PlatformAcceptMimesMiddleware\";\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"]}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
var PlatformRouter_1;
|
|
2
|
-
import { __decorate, __metadata } from "tslib";
|
|
3
|
-
import { Inject, Injectable, InjectorService, ProviderScope } from "@tsed/di";
|
|
4
|
-
import { promisify } from "util";
|
|
5
|
-
import { createFakeRawDriver } from "./FakeRawDriver";
|
|
6
|
-
import { PlatformHandler } from "./PlatformHandler";
|
|
7
|
-
/**
|
|
8
|
-
* @ignore
|
|
9
|
-
*/
|
|
10
|
-
export const PLATFORM_ROUTER_OPTIONS = Symbol.for("PlatformRouterOptions");
|
|
11
|
-
/**
|
|
12
|
-
* Platform Router abstraction layer.
|
|
13
|
-
* @platform
|
|
14
|
-
*/
|
|
15
|
-
let PlatformRouter = PlatformRouter_1 = class PlatformRouter {
|
|
16
|
-
constructor(platformHandler) {
|
|
17
|
-
this.platformHandler = platformHandler;
|
|
18
|
-
this.isBuilt = false;
|
|
19
|
-
this.rawRouter = this.raw = PlatformRouter_1.createRawRouter();
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Create a new instance of PlatformRouter
|
|
23
|
-
* @param injector
|
|
24
|
-
* @param routerOptions
|
|
25
|
-
*/
|
|
26
|
-
static create(injector, routerOptions = {}) {
|
|
27
|
-
const locals = new Map();
|
|
28
|
-
locals.set(PLATFORM_ROUTER_OPTIONS, routerOptions);
|
|
29
|
-
return injector.invoke(PlatformRouter_1, locals);
|
|
30
|
-
}
|
|
31
|
-
static createRawRouter() {
|
|
32
|
-
return createFakeRawDriver();
|
|
33
|
-
}
|
|
34
|
-
callback() {
|
|
35
|
-
return this.raw;
|
|
36
|
-
}
|
|
37
|
-
getRouter() {
|
|
38
|
-
return this.rawRouter;
|
|
39
|
-
}
|
|
40
|
-
use(...handlers) {
|
|
41
|
-
// @ts-ignore
|
|
42
|
-
this.getRouter().use(...this.mapHandlers(handlers));
|
|
43
|
-
return this;
|
|
44
|
-
}
|
|
45
|
-
addRoute(options) {
|
|
46
|
-
const { method, path, handlers, ...opts } = options;
|
|
47
|
-
// @ts-ignore
|
|
48
|
-
this.getRouter()[method](path, ...this.mapHandlers(handlers, { method, path, ...opts }));
|
|
49
|
-
return this;
|
|
50
|
-
}
|
|
51
|
-
all(path, ...handlers) {
|
|
52
|
-
return this.addRoute({ method: "all", path, handlers, isFinal: true });
|
|
53
|
-
}
|
|
54
|
-
get(path, ...handlers) {
|
|
55
|
-
return this.addRoute({ method: "get", path, handlers, isFinal: true });
|
|
56
|
-
}
|
|
57
|
-
post(path, ...handlers) {
|
|
58
|
-
return this.addRoute({ method: "post", path, handlers, isFinal: true });
|
|
59
|
-
}
|
|
60
|
-
put(path, ...handlers) {
|
|
61
|
-
return this.addRoute({ method: "put", path, handlers, isFinal: true });
|
|
62
|
-
}
|
|
63
|
-
delete(path, ...handlers) {
|
|
64
|
-
return this.addRoute({ method: "delete", path, handlers, isFinal: true });
|
|
65
|
-
}
|
|
66
|
-
patch(path, ...handlers) {
|
|
67
|
-
return this.addRoute({ method: "patch", path, handlers, isFinal: true });
|
|
68
|
-
}
|
|
69
|
-
head(path, ...handlers) {
|
|
70
|
-
return this.addRoute({ method: "head", path, handlers, isFinal: true });
|
|
71
|
-
}
|
|
72
|
-
options(path, ...handlers) {
|
|
73
|
-
return this.addRoute({ method: "options", path, handlers, isFinal: true });
|
|
74
|
-
}
|
|
75
|
-
statics(path, options) {
|
|
76
|
-
return this;
|
|
77
|
-
}
|
|
78
|
-
multer(options) {
|
|
79
|
-
const m = require("multer")(options);
|
|
80
|
-
const makePromise = (multer, name) => {
|
|
81
|
-
// istanbul ignore next
|
|
82
|
-
if (!multer[name])
|
|
83
|
-
return;
|
|
84
|
-
const fn = multer[name];
|
|
85
|
-
multer[name] = function apply(...args) {
|
|
86
|
-
const middleware = Reflect.apply(fn, this, args);
|
|
87
|
-
return (req, res) => promisify(middleware)(req, res);
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
makePromise(m, "any");
|
|
91
|
-
makePromise(m, "array");
|
|
92
|
-
makePromise(m, "fields");
|
|
93
|
-
makePromise(m, "none");
|
|
94
|
-
makePromise(m, "single");
|
|
95
|
-
return m;
|
|
96
|
-
}
|
|
97
|
-
mapHandlers(handlers, options = {}) {
|
|
98
|
-
return handlers.reduce((list, handler, index) => {
|
|
99
|
-
if (typeof handler === "string") {
|
|
100
|
-
return list.concat(handler);
|
|
101
|
-
}
|
|
102
|
-
if (handler instanceof PlatformRouter_1) {
|
|
103
|
-
return list.concat(handler.callback());
|
|
104
|
-
}
|
|
105
|
-
return list.concat(this.platformHandler.createHandler(handler, {
|
|
106
|
-
...options,
|
|
107
|
-
isFinal: options.isFinal ? index === handlers.length - 1 : false
|
|
108
|
-
}));
|
|
109
|
-
}, []);
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
__decorate([
|
|
113
|
-
Inject(),
|
|
114
|
-
__metadata("design:type", InjectorService)
|
|
115
|
-
], PlatformRouter.prototype, "injector", void 0);
|
|
116
|
-
PlatformRouter = PlatformRouter_1 = __decorate([
|
|
117
|
-
Injectable({
|
|
118
|
-
scope: ProviderScope.INSTANCE
|
|
119
|
-
}),
|
|
120
|
-
__metadata("design:paramtypes", [PlatformHandler])
|
|
121
|
-
], PlatformRouter);
|
|
122
|
-
export { PlatformRouter };
|
|
123
|
-
//# sourceMappingURL=PlatformRouter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformRouter.js","sourceRoot":"","sources":["../../../src/services/PlatformRouter.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,eAAe,EAAY,aAAa,EAAC,MAAM,UAAU,CAAC;AACtF,OAAO,EAAC,SAAS,EAAC,MAAM,MAAM,CAAC;AAG/B,OAAO,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAS3E;;;GAGG;AAIH,IAAa,cAAc,sBAA3B,MAAa,cAAc;IAQzB,YAAsB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;QALtD,YAAO,GAAY,KAAK,CAAC;QAMvB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,GAAG,gBAAc,CAAC,eAAe,EAAE,CAAC;IAC/D,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,QAAyB,EAAE,gBAAqB,EAAE;QAC9D,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC;QAEnD,OAAO,QAAQ,CAAC,MAAM,CAAiB,gBAAc,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IAES,MAAM,CAAC,eAAe;QAC9B,OAAO,mBAAmB,EAAE,CAAC;IAC/B,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,GAAG,CAAC,GAAG,QAAe;QACpB,aAAa;QACb,IAAI,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;QAEpD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAQ,CAAC,OAAsC;QAC7C,MAAM,EAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAC,GAAG,OAAO,CAAC;QAElD,aAAa;QACb,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAC,CAAC,CAAC,CAAC;QAEvF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,GAAG,CAAC,IAAc,EAAE,GAAG,QAAe;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IACvE,CAAC;IAED,GAAG,CAAC,IAAc,EAAE,GAAG,QAAe;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IACvE,CAAC;IAED,IAAI,CAAC,IAAc,EAAE,GAAG,QAAe;QACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IACxE,CAAC;IAED,GAAG,CAAC,IAAc,EAAE,GAAG,QAAe;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IACvE,CAAC;IAED,MAAM,CAAC,IAAc,EAAE,GAAG,QAAe;QACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,IAAc,EAAE,GAAG,QAAe;QACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IACzE,CAAC;IAED,IAAI,CAAC,IAAc,EAAE,GAAG,QAAe;QACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,CAAC,IAAc,EAAE,GAAG,QAAe;QACxC,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,CAAC,IAAY,EAAE,OAA+B;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,OAA+B;QACpC,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;QAErC,MAAM,WAAW,GAAG,CAAC,MAAW,EAAE,IAAY,EAAE,EAAE;YAChD,uBAAuB;YACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBAAE,OAAO;YAE1B,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;YAExB,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,KAAK,CAAC,GAAG,IAAW;gBAC1C,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;gBAEjD,OAAO,CAAC,GAAQ,EAAE,GAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YACjE,CAAC,CAAC;QACJ,CAAC,CAAC;QAEF,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QACtB,WAAW,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACxB,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;QACzB,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACvB,WAAW,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;QAEzB,OAAO,CAAC,CAAC;IACX,CAAC;IAES,WAAW,CAAC,QAAe,EAAE,UAAwC,EAAE;QAC/E,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;YAC9C,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;gBAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;aAC7B;YAED,IAAI,OAAO,YAAY,gBAAc,EAAE;gBACrC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;aACxC;YAED,OAAO,IAAI,CAAC,MAAM,CAChB,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,OAAO,EAAE;gBAC1C,GAAG,OAAO;gBACV,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK;aACjE,CAAC,CACH,CAAC;QACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;CACF,CAAA;AA7HC;IADC,MAAM,EAAE;8BACC,eAAe;gDAAC;AANf,cAAc;IAH1B,UAAU,CAAC;QACV,KAAK,EAAE,aAAa,CAAC,QAAQ;KAC9B,CAAC;qCASuC,eAAe;GAR3C,cAAc,CAmI1B;SAnIY,cAAc","sourcesContent":["import {Inject, Injectable, InjectorService, PathType, ProviderScope} from \"@tsed/di\";\nimport {promisify} from \"util\";\nimport {PlatformMulter, PlatformMulterSettings, PlatformStaticsOptions} from \"../config\";\nimport {PlatformRouteOptions, PlatformRouteWithoutHandlers} from \"../interfaces\";\nimport {createFakeRawDriver} from \"./FakeRawDriver\";\nimport {PlatformHandler} from \"./PlatformHandler\";\n\n/**\n * @ignore\n */\nexport const PLATFORM_ROUTER_OPTIONS = Symbol.for(\"PlatformRouterOptions\");\n\ndeclare global {\n namespace TsED {\n // @ts-ignore\n export interface Router {}\n }\n}\n\n/**\n * Platform Router abstraction layer.\n * @platform\n */\n@Injectable({\n scope: ProviderScope.INSTANCE\n})\nexport class PlatformRouter<Router = TsED.Router> {\n rawRouter: Router;\n raw: any;\n isBuilt: boolean = false;\n\n @Inject()\n injector: InjectorService;\n\n constructor(protected platformHandler: PlatformHandler) {\n this.rawRouter = this.raw = PlatformRouter.createRawRouter();\n }\n\n /**\n * Create a new instance of PlatformRouter\n * @param injector\n * @param routerOptions\n */\n static create(injector: InjectorService, routerOptions: any = {}) {\n const locals = new Map();\n locals.set(PLATFORM_ROUTER_OPTIONS, routerOptions);\n\n return injector.invoke<PlatformRouter>(PlatformRouter, locals);\n }\n\n protected static createRawRouter(): any {\n return createFakeRawDriver();\n }\n\n callback(): any {\n return this.raw;\n }\n\n getRouter(): Router {\n return this.rawRouter;\n }\n\n use(...handlers: any[]) {\n // @ts-ignore\n this.getRouter().use(...this.mapHandlers(handlers));\n\n return this;\n }\n\n addRoute(options: Partial<PlatformRouteOptions>) {\n const {method, path, handlers, ...opts} = options;\n\n // @ts-ignore\n this.getRouter()[method](path, ...this.mapHandlers(handlers, {method, path, ...opts}));\n\n return this;\n }\n\n all(path: PathType, ...handlers: any[]) {\n return this.addRoute({method: \"all\", path, handlers, isFinal: true});\n }\n\n get(path: PathType, ...handlers: any[]) {\n return this.addRoute({method: \"get\", path, handlers, isFinal: true});\n }\n\n post(path: PathType, ...handlers: any[]) {\n return this.addRoute({method: \"post\", path, handlers, isFinal: true});\n }\n\n put(path: PathType, ...handlers: any[]) {\n return this.addRoute({method: \"put\", path, handlers, isFinal: true});\n }\n\n delete(path: PathType, ...handlers: any[]) {\n return this.addRoute({method: \"delete\", path, handlers, isFinal: true});\n }\n\n patch(path: PathType, ...handlers: any[]) {\n return this.addRoute({method: \"patch\", path, handlers, isFinal: true});\n }\n\n head(path: PathType, ...handlers: any[]) {\n return this.addRoute({method: \"head\", path, handlers, isFinal: true});\n }\n\n options(path: PathType, ...handlers: any[]) {\n return this.addRoute({method: \"options\", path, handlers, isFinal: true});\n }\n\n statics(path: string, options: PlatformStaticsOptions): this {\n return this;\n }\n\n multer(options: PlatformMulterSettings): PlatformMulter {\n const m = require(\"multer\")(options);\n\n const makePromise = (multer: any, name: string) => {\n // istanbul ignore next\n if (!multer[name]) return;\n\n const fn = multer[name];\n\n multer[name] = function apply(...args: any[]) {\n const middleware = Reflect.apply(fn, this, args);\n\n return (req: any, res: any) => promisify(middleware)(req, res);\n };\n };\n\n makePromise(m, \"any\");\n makePromise(m, \"array\");\n makePromise(m, \"fields\");\n makePromise(m, \"none\");\n makePromise(m, \"single\");\n\n return m;\n }\n\n protected mapHandlers(handlers: any[], options: PlatformRouteWithoutHandlers = {}): any[] {\n return handlers.reduce((list, handler, index) => {\n if (typeof handler === \"string\") {\n return list.concat(handler);\n }\n\n if (handler instanceof PlatformRouter) {\n return list.concat(handler.callback());\n }\n\n return list.concat(\n this.platformHandler.createHandler(handler, {\n ...options,\n isFinal: options.isFinal ? index === handlers.length - 1 : false\n })\n );\n }, []);\n }\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./Platform";
|
|
2
|
-
export * from "./PlatformApplication";
|
|
3
|
-
export * from "./PlatformHandler";
|
|
4
|
-
export * from "./PlatformRequest";
|
|
5
|
-
export * from "./PlatformResponse";
|
|
6
|
-
export * from "./PlatformRouter";
|
|
7
|
-
export * from "./PlatformTest";
|
|
8
|
-
export * from "./PlatformMiddlewaresChain";
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC","sourcesContent":["export * from \"./Platform\";\nexport * from \"./PlatformApplication\";\nexport * from \"./PlatformHandler\";\nexport * from \"./PlatformRequest\";\nexport * from \"./PlatformResponse\";\nexport * from \"./PlatformRouter\";\nexport * from \"./PlatformTest\";\nexport * from \"./PlatformMiddlewaresChain\";\n"]}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { EndpointMetadata } from "../domain/EndpointMetadata";
|
|
2
|
-
import { HandlerMetadata } from "../domain/HandlerMetadata";
|
|
3
|
-
import { HandlerType } from "../interfaces/HandlerType";
|
|
4
|
-
function isMetadata(input) {
|
|
5
|
-
return input instanceof HandlerMetadata;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* @ignore
|
|
9
|
-
*/
|
|
10
|
-
export function createHandlerMetadata(injector, obj, routeOptions = {}) {
|
|
11
|
-
if (isMetadata(obj)) {
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
let options;
|
|
15
|
-
if (obj instanceof EndpointMetadata) {
|
|
16
|
-
const provider = injector.getProvider(routeOptions.token);
|
|
17
|
-
options = {
|
|
18
|
-
token: provider.token,
|
|
19
|
-
target: provider.useClass,
|
|
20
|
-
scope: provider.scope,
|
|
21
|
-
type: HandlerType.ENDPOINT,
|
|
22
|
-
propertyKey: obj.propertyKey
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
const provider = injector.getProvider(obj);
|
|
27
|
-
if (provider) {
|
|
28
|
-
options = {
|
|
29
|
-
token: provider.token,
|
|
30
|
-
target: provider.useClass,
|
|
31
|
-
scope: provider.scope,
|
|
32
|
-
type: HandlerType.MIDDLEWARE,
|
|
33
|
-
propertyKey: "use"
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
options = {
|
|
38
|
-
target: obj
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
options.routeOptions = routeOptions;
|
|
43
|
-
return new HandlerMetadata(options);
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=createHandlerMetadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createHandlerMetadata.js","sourceRoot":"","sources":["../../../src/utils/createHandlerMetadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAC,eAAe,EAAyB,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAGtD,SAAS,UAAU,CAAC,KAAU;IAC5B,OAAO,KAAK,YAAY,eAAe,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAyB,EACzB,GAA2B,EAC3B,eAA6C,EAAE;IAE/C,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE;QACnB,OAAO,GAAsB,CAAC;KAC/B;IAED,IAAI,OAA+B,CAAC;IAEpC,IAAI,GAAG,YAAY,gBAAgB,EAAE;QACnC,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,CAAE,CAAC;QAE3D,OAAO,GAAG;YACR,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,MAAM,EAAE,QAAQ,CAAC,QAAQ;YACzB,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,IAAI,EAAE,WAAW,CAAC,QAAQ;YAC1B,WAAW,EAAE,GAAG,CAAC,WAAW;SAC7B,CAAC;KACH;SAAM;QACL,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAE3C,IAAI,QAAQ,EAAE;YACZ,OAAO,GAAG;gBACR,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,MAAM,EAAE,QAAQ,CAAC,QAAQ;gBACzB,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,IAAI,EAAE,WAAW,CAAC,UAAU;gBAC5B,WAAW,EAAE,KAAK;aACnB,CAAC;SACH;aAAM;YACL,OAAO,GAAG;gBACR,MAAM,EAAE,GAAG;aACZ,CAAC;SACH;KACF;IAED,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC;IAEpC,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import {InjectorService} from \"@tsed/di\";\nimport {EndpointMetadata} from \"../domain/EndpointMetadata\";\nimport {HandlerMetadata, HandlerMetadataOptions} from \"../domain/HandlerMetadata\";\nimport {HandlerType} from \"../interfaces/HandlerType\";\nimport {PlatformRouteWithoutHandlers} from \"../interfaces/PlatformRouteOptions\";\n\nfunction isMetadata(input: any) {\n return input instanceof HandlerMetadata;\n}\n\n/**\n * @ignore\n */\nexport function createHandlerMetadata(\n injector: InjectorService,\n obj: any | EndpointMetadata,\n routeOptions: PlatformRouteWithoutHandlers = {}\n): HandlerMetadata {\n if (isMetadata(obj)) {\n return obj as HandlerMetadata;\n }\n\n let options: HandlerMetadataOptions;\n\n if (obj instanceof EndpointMetadata) {\n const provider = injector.getProvider(routeOptions.token)!;\n\n options = {\n token: provider.token,\n target: provider.useClass,\n scope: provider.scope,\n type: HandlerType.ENDPOINT,\n propertyKey: obj.propertyKey\n };\n } else {\n const provider = injector.getProvider(obj);\n\n if (provider) {\n options = {\n token: provider.token,\n target: provider.useClass,\n scope: provider.scope,\n type: HandlerType.MIDDLEWARE,\n propertyKey: \"use\"\n };\n } else {\n options = {\n target: obj\n };\n }\n }\n\n options.routeOptions = routeOptions;\n\n return new HandlerMetadata(options);\n}\n"]}
|
package/lib/esm/utils/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from "./createInjector";
|
|
2
|
-
export * from "./createHttpServer";
|
|
3
|
-
export * from "./createHttpsServer";
|
|
4
|
-
export * from "./printRoutes";
|
|
5
|
-
export * from "./listenServer";
|
|
6
|
-
export * from "./createContext";
|
|
7
|
-
export * from "./useCtxHandler";
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./createInjector\";\nexport * from \"./createHttpServer\";\nexport * from \"./createHttpsServer\";\nexport * from \"./printRoutes\";\nexport * from \"./listenServer\";\nexport * from \"./createContext\";\nexport * from \"./useCtxHandler\";\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HandlerType } from "../interfaces/HandlerType";
|
|
2
|
-
/**
|
|
3
|
-
* Create Ts.ED context handler
|
|
4
|
-
* @param fn
|
|
5
|
-
* @ignore
|
|
6
|
-
*/
|
|
7
|
-
export function useCtxHandler(fn) {
|
|
8
|
-
fn.type = HandlerType.CTX_FN;
|
|
9
|
-
return fn;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=useCtxHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCtxHandler.js","sourceRoot":"","sources":["../../../src/utils/useCtxHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAItD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,EAA6C;IACzE,EAAE,CAAC,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC;IAE7B,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import {PlatformContext} from \"../domain/PlatformContext\";\nimport {HandlerType} from \"../interfaces/HandlerType\";\n\nexport type PlatformCtxHandler = ($ctx: PlatformContext) => any | Promise<any>;\n\n/**\n * Create Ts.ED context handler\n * @param fn\n * @ignore\n */\nexport function useCtxHandler(fn: PlatformCtxHandler & {type?: HandlerType}) {\n fn.type = HandlerType.CTX_FN;\n\n return fn;\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { InjectorService } from "@tsed/di";
|
|
2
|
-
import { ControllerProvider } from "../domain/ControllerProvider";
|
|
3
|
-
import { PlatformRouter } from "../services/PlatformRouter";
|
|
4
|
-
/**
|
|
5
|
-
* @ignore
|
|
6
|
-
*/
|
|
7
|
-
export declare function getRouter(injector: InjectorService, provider: ControllerProvider): any;
|
|
8
|
-
/**
|
|
9
|
-
* @ignore
|
|
10
|
-
*/
|
|
11
|
-
export declare function createRouter(injector: InjectorService, provider: ControllerProvider): PlatformRouter;
|
|
12
|
-
/**
|
|
13
|
-
* @ignore
|
|
14
|
-
* @param injector
|
|
15
|
-
* @param provider
|
|
16
|
-
*/
|
|
17
|
-
export declare function buildRouter(injector: InjectorService, provider: ControllerProvider): PlatformRouter<TsED.Router>;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Env } from "@tsed/core";
|
|
3
|
-
import { ConverterSettings } from "./ConverterSettings";
|
|
4
|
-
import { EndpointDirectoriesSettings } from "./EndpointDirectoriesSettings";
|
|
5
|
-
import { PlatformLoggerSettings } from "./PlatformLoggerSettings";
|
|
6
|
-
import { PlatformMulterSettings } from "./PlatformMulterSettings";
|
|
7
|
-
import { PlatformStaticsSettings } from "./PlatformStaticsSettings";
|
|
8
|
-
import type Http from "http";
|
|
9
|
-
import type Https from "https";
|
|
10
|
-
declare global {
|
|
11
|
-
namespace TsED {
|
|
12
|
-
interface LoggerConfiguration extends Partial<PlatformLoggerSettings> {
|
|
13
|
-
}
|
|
14
|
-
interface Configuration {
|
|
15
|
-
/**
|
|
16
|
-
* The root directory where you build run project. By default, it's equal to `process.cwd().
|
|
17
|
-
*/
|
|
18
|
-
rootDir: string;
|
|
19
|
-
/**
|
|
20
|
-
* The environment profile. By default the environment profile is equals to `NODE_ENV`.
|
|
21
|
-
*/
|
|
22
|
-
env: Env;
|
|
23
|
-
/**
|
|
24
|
-
* Port number for the [HTTP.Server](https://nodejs.org/api/http.html#http_class_http_server).
|
|
25
|
-
*/
|
|
26
|
-
port: string | number;
|
|
27
|
-
/**
|
|
28
|
-
* Port number for the [HTTP.Server](https://nodejs.org/api/http.html#http_class_http_server).
|
|
29
|
-
*/
|
|
30
|
-
httpPort: string | number | boolean;
|
|
31
|
-
/**
|
|
32
|
-
* [Https.ServerOptions](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)):
|
|
33
|
-
* - `key` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | <Object[]>: The private key of the server in PEM format. To support multiple keys using different algorithms an array can be provided either as a plain array of key strings or an array of objects in the format `{pem: key, passphrase: passphrase}`. This option is required for ciphers that make use of private keys.
|
|
34
|
-
* - `passphrase` <string> A string containing the passphrase for the private key or pfx.
|
|
35
|
-
* - `cert` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers containing the certificate key of the server in PEM format. (Required)
|
|
36
|
-
* - `ca` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers of trusted certificates in PEM format. If this is omitted several well known "root" CAs (like VeriSign) will be used. These are used to authorize connections.
|
|
37
|
-
*/
|
|
38
|
-
httpOptions: Http.ServerOptions;
|
|
39
|
-
/**
|
|
40
|
-
* Port number for the [HTTPs.Server](https://nodejs.org/api/https.html#https_class_https_server).
|
|
41
|
-
*/
|
|
42
|
-
httpsPort: string | number | boolean;
|
|
43
|
-
/**
|
|
44
|
-
* [Https.ServerOptions](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)):
|
|
45
|
-
* - `key` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | <Object[]>: The private key of the server in PEM format. To support multiple keys using different algorithms an array can be provided either as a plain array of key strings or an array of objects in the format `{pem: key, passphrase: passphrase}`. This option is required for ciphers that make use of private keys.
|
|
46
|
-
* - `passphrase` <string> A string containing the passphrase for the private key or pfx.
|
|
47
|
-
* - `cert` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers containing the certificate key of the server in PEM format. (Required)
|
|
48
|
-
* - `ca` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers of trusted certificates in PEM format. If this is omitted several well known "root" CAs (like VeriSign) will be used. These are used to authorize connections.
|
|
49
|
-
*/
|
|
50
|
-
httpsOptions: Https.ServerOptions;
|
|
51
|
-
/**
|
|
52
|
-
* Mount all controllers under a directories to an endpoint.
|
|
53
|
-
*/
|
|
54
|
-
mount: EndpointDirectoriesSettings;
|
|
55
|
-
/**
|
|
56
|
-
* List of directories to scan [Services](/docs/services.md), [Middlewares](/docs/middlewares.md) or [Converters](/docs/converters.md).
|
|
57
|
-
*/
|
|
58
|
-
componentsScan: (string | RegExp)[];
|
|
59
|
-
/**
|
|
60
|
-
* Disable the glob pattern. In v7 the componentsScan options will be removed in favor of external module loader.
|
|
61
|
-
*/
|
|
62
|
-
disableComponentsScan: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* List of glob patterns. Exclude all files which matching with this list when Server scan all components with the `mount` or `scanComponents` options.
|
|
65
|
-
*/
|
|
66
|
-
exclude: string[];
|
|
67
|
-
/**
|
|
68
|
-
* Configure the mimes accepted by default by the server.
|
|
69
|
-
*/
|
|
70
|
-
acceptMimes: string[];
|
|
71
|
-
/**
|
|
72
|
-
* Enable debug mode. By default debug is false.
|
|
73
|
-
*/
|
|
74
|
-
debug: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Converter configuration.
|
|
77
|
-
*/
|
|
78
|
-
converter: Partial<ConverterSettings>;
|
|
79
|
-
/**
|
|
80
|
-
* Logger configuration.
|
|
81
|
-
*/
|
|
82
|
-
logger?: LoggerConfiguration;
|
|
83
|
-
/**
|
|
84
|
-
* Object to mount all directories under to his endpoints. See more on [Serve Static](/tutorials/serve-static-files.md).
|
|
85
|
-
*/
|
|
86
|
-
statics: PlatformStaticsSettings;
|
|
87
|
-
/**
|
|
88
|
-
* Object configure Multer. See more on [Upload file](/tutorials/serve-static-files.md).
|
|
89
|
-
*/
|
|
90
|
-
multer: PlatformMulterSettings;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
export * from "./PlatformLoggerSettings";
|
|
95
|
-
export * from "./EndpointDirectoriesSettings";
|
|
96
|
-
export * from "./PlatformStaticsSettings";
|
|
97
|
-
export * from "./PlatformMulterSettings";
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Type } from "@tsed/core";
|
|
3
|
-
import Http from "http";
|
|
4
|
-
/**
|
|
5
|
-
* Inject the Http.Server instance.
|
|
6
|
-
*
|
|
7
|
-
* ### Example
|
|
8
|
-
*
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import {HttpServer, Service} from "@tsed/common";
|
|
11
|
-
*
|
|
12
|
-
* @Service()
|
|
13
|
-
* export default class OtherService {
|
|
14
|
-
* constructor(@HttpServer httpServer: HttpServer) {}
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* > Note: TypeScript transform and store `HttpServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
|
|
19
|
-
*
|
|
20
|
-
* @param {Type<any>} target
|
|
21
|
-
* @param {string} targetKey
|
|
22
|
-
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
23
|
-
* @returns {any}
|
|
24
|
-
* @decorator
|
|
25
|
-
* @deprecated Use Https.Server from "http"
|
|
26
|
-
*/
|
|
27
|
-
export declare function HttpServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
|
|
28
|
-
export declare type HttpServer = Http.Server;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Type } from "@tsed/core";
|
|
3
|
-
import Https from "https";
|
|
4
|
-
/**
|
|
5
|
-
* Inject the Https.Server instance.
|
|
6
|
-
*
|
|
7
|
-
* ### Example
|
|
8
|
-
*
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import {HttpsServer, Service} from "@tsed/common";
|
|
11
|
-
*
|
|
12
|
-
* @Service()
|
|
13
|
-
* export default class OtherService {
|
|
14
|
-
* constructor(@HttpsServer httpServer: HttpServer) {}
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* > Note: TypeScript transform and store `HttpsServer` as `Function` type in the metadata. So to inject a factory, you must use the `@Inject(type)` decorator.
|
|
19
|
-
*
|
|
20
|
-
* @param {Type<any>} target
|
|
21
|
-
* @param {string} targetKey
|
|
22
|
-
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
23
|
-
* @returns {any}
|
|
24
|
-
* @decorator
|
|
25
|
-
* @deprecated Use Https.Server from "https"
|
|
26
|
-
*/
|
|
27
|
-
export declare function HttpsServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
|
|
28
|
-
export declare type HttpsServer = Https.Server;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from "./httpServer";
|
|
2
|
-
export * from "./httpsServer";
|
|
3
|
-
export * from "./multer";
|
|
4
|
-
export * from "./method/route";
|
|
5
|
-
export * from "./method/acceptMime";
|
|
6
|
-
export * from "./method/location";
|
|
7
|
-
export * from "./method/redirect";
|
|
8
|
-
export * from "./method/endpointFn";
|
|
9
|
-
export * from "./method/view";
|
|
10
|
-
export * from "./params/response";
|
|
11
|
-
export * from "./params/request";
|
|
12
|
-
export * from "./params/next";
|
|
13
|
-
export * from "./params/error";
|
|
14
|
-
export * from "../utils/mapReturnedResponse";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Set a mime list which are acceptable and checks if the specified content types are acceptable, based on the request’s Accept HTTP header field.
|
|
3
|
-
*
|
|
4
|
-
* ```typescript
|
|
5
|
-
* @Controller('/mypath')
|
|
6
|
-
* export class MyCtrl {
|
|
7
|
-
*
|
|
8
|
-
* @Get('/')
|
|
9
|
-
* @AcceptMime('application/json')
|
|
10
|
-
* public getResource(){}
|
|
11
|
-
* }
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* @param mimes
|
|
15
|
-
* @decorator
|
|
16
|
-
* @operation
|
|
17
|
-
* @response
|
|
18
|
-
*/
|
|
19
|
-
export declare function AcceptMime(...mimes: string[]): Function;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DecoratorParameters } from "@tsed/core";
|
|
2
|
-
import { EndpointMetadata } from "../../domain";
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param fn
|
|
6
|
-
* @decorator
|
|
7
|
-
* @deprecated Deprecated since 2021-10-05. Use JsonEntityFn instead.
|
|
8
|
-
*/
|
|
9
|
-
export declare function EndpointFn(fn: (endpoint: EndpointMetadata, parameters: DecoratorParameters) => void): MethodDecorator;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Location } from "@tsed/schema";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Redirect } from "@tsed/schema";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Get, Post, Put, Patch, Delete, Head, Options, All } from "@tsed/schema";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Use a view and sends the rendered HTML string to the client. Optional parameter:
|
|
3
|
-
*
|
|
4
|
-
* * viewOptions, an object whose properties define local variables for the view.
|
|
5
|
-
*
|
|
6
|
-
* The view argument is a string that is the file path of the view file to render.
|
|
7
|
-
* This can be an absolute path, or a path relative to the views setting.
|
|
8
|
-
* If the path does not contain a file extension, then the view engine setting determines the file extension.
|
|
9
|
-
* If the path does contain a file extension, then Express will load the module for the specified template engine (via require())
|
|
10
|
-
* and render it using the loaded module’s __express function.
|
|
11
|
-
*
|
|
12
|
-
* For more information, see [Using template engines with Express](http://expressjs.com/guide/using-template-engines.html).
|
|
13
|
-
*
|
|
14
|
-
* > NOTE: The view argument performs file system operations like reading a file from disk and evaluating Node.js modules,
|
|
15
|
-
* and as so for security reasons should not contain input from the end-user.
|
|
16
|
-
*
|
|
17
|
-
* @param path Relative path to the view file.
|
|
18
|
-
* @param options Additional options
|
|
19
|
-
* @decorator
|
|
20
|
-
* @operation
|
|
21
|
-
* @response
|
|
22
|
-
* @ignores
|
|
23
|
-
* @deprecated Use View decorator from @tsed/platform-views instead.
|
|
24
|
-
*/
|
|
25
|
-
export declare function View(path: string, options?: Object): MethodDecorator;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ControllerMiddlewares, Provider, TokenProvider } from "@tsed/di";
|
|
2
|
-
export declare class ControllerProvider<T = any> extends Provider<T> {
|
|
3
|
-
readonly tokenRouter: string;
|
|
4
|
-
constructor(provide: TokenProvider, options?: Partial<Provider>);
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
get routerOptions(): any;
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* @param value
|
|
12
|
-
*/
|
|
13
|
-
set routerOptions(value: any);
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* @returns {any[]}
|
|
17
|
-
*/
|
|
18
|
-
get middlewares(): ControllerMiddlewares;
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @param middlewares
|
|
22
|
-
*/
|
|
23
|
-
set middlewares(middlewares: ControllerMiddlewares);
|
|
24
|
-
}
|