@tsed/common 7.0.0-beta.9 → 7.0.0-rc.1
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 +86 -68
- package/lib/cjs/builder/PlatformBuilder.js.map +1 -1
- package/lib/cjs/config/interfaces/PlatformLoggerSettings.js.map +1 -1
- package/lib/cjs/config/services/PlatformConfiguration.js +0 -64
- package/lib/cjs/config/services/PlatformConfiguration.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/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 +1 -0
- package/lib/cjs/exports.js.map +1 -1
- package/lib/cjs/index.js +1 -9
- 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 +2 -1
- package/lib/cjs/middlewares/PlatformAcceptMimesMiddleware.js.map +1 -1
- package/lib/cjs/middlewares/PlatformMulterMiddleware.js +2 -0
- package/lib/cjs/middlewares/PlatformMulterMiddleware.js.map +1 -1
- package/lib/cjs/services/FakeAdapter.js +6 -12
- package/lib/cjs/services/FakeAdapter.js.map +1 -1
- package/lib/cjs/services/Platform.js +30 -86
- package/lib/cjs/services/Platform.js.map +1 -1
- package/lib/cjs/services/PlatformAdapter.js +10 -0
- package/lib/cjs/services/PlatformAdapter.js.map +1 -1
- package/lib/cjs/services/PlatformApplication.js +23 -9
- package/lib/cjs/services/PlatformApplication.js.map +1 -1
- package/lib/cjs/services/PlatformHandler.js +112 -171
- package/lib/cjs/services/PlatformHandler.js.map +1 -1
- package/lib/cjs/services/PlatformMiddlewaresChain.js +5 -19
- package/lib/cjs/services/PlatformMiddlewaresChain.js.map +1 -1
- package/lib/cjs/services/PlatformRequest.js +16 -12
- package/lib/cjs/services/PlatformRequest.js.map +1 -1
- package/lib/cjs/services/PlatformResponse.js +19 -22
- package/lib/cjs/services/PlatformResponse.js.map +1 -1
- package/lib/cjs/services/PlatformTest.js +29 -9
- 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 +3 -3
- package/lib/cjs/utils/createHttpServer.js.map +1 -1
- package/lib/cjs/utils/createHttpsServer.js +3 -3
- package/lib/cjs/utils/createHttpsServer.js.map +1 -1
- package/lib/cjs/utils/createInjector.js +6 -8
- 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 +63 -68
- package/lib/esm/builder/PlatformBuilder.js.map +1 -1
- package/lib/esm/config/interfaces/PlatformLoggerSettings.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/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/PlatformContext.js +46 -38
- 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 +1 -0
- package/lib/esm/exports.js.map +1 -1
- package/lib/esm/index.js +1 -9
- 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 +2 -0
- package/lib/esm/middlewares/PlatformMulterMiddleware.js.map +1 -1
- package/lib/esm/services/FakeAdapter.js +6 -12
- package/lib/esm/services/FakeAdapter.js.map +1 -1
- package/lib/esm/services/Platform.js +31 -87
- package/lib/esm/services/Platform.js.map +1 -1
- package/lib/esm/services/PlatformAdapter.js +10 -0
- package/lib/esm/services/PlatformAdapter.js.map +1 -1
- package/lib/esm/services/PlatformApplication.js +23 -9
- package/lib/esm/services/PlatformApplication.js.map +1 -1
- package/lib/esm/services/PlatformHandler.js +114 -173
- package/lib/esm/services/PlatformHandler.js.map +1 -1
- package/lib/esm/services/PlatformMiddlewaresChain.js +5 -19
- 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 +29 -9
- package/lib/esm/services/PlatformTest.js.map +1 -1
- package/lib/esm/utils/createContext.js +30 -20
- package/lib/esm/utils/createContext.js.map +1 -1
- package/lib/esm/utils/createHttpServer.js +3 -3
- package/lib/esm/utils/createHttpServer.js.map +1 -1
- package/lib/esm/utils/createHttpsServer.js +3 -3
- package/lib/esm/utils/createHttpsServer.js.map +1 -1
- package/lib/esm/utils/createInjector.js +7 -9
- 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 +17 -16
- package/lib/types/config/interfaces/PlatformLoggerSettings.d.ts +2 -43
- package/lib/types/config/services/PlatformConfiguration.d.ts +6 -22
- package/lib/types/domain/AnyToPromiseWithCtx.d.ts +1 -9
- package/lib/types/domain/PlatformContext.d.ts +32 -18
- package/lib/types/domain/PlatformRouteDetails.d.ts +4 -19
- package/lib/types/exports.d.ts +1 -0
- package/lib/types/index.d.ts +1 -9
- package/lib/types/interfaces/PlatformRouteOptions.d.ts +0 -1
- package/lib/types/interfaces/Route.d.ts +2 -3
- package/lib/types/middlewares/PlatformMulterMiddleware.d.ts +1 -1
- package/lib/types/services/FakeAdapter.d.ts +7 -6
- package/lib/types/services/Platform.d.ts +7 -28
- package/lib/types/services/PlatformAdapter.d.ts +22 -11
- package/lib/types/services/PlatformApplication.d.ts +14 -6
- package/lib/types/services/PlatformHandler.d.ts +21 -59
- package/lib/types/services/PlatformMiddlewaresChain.d.ts +1 -2
- package/lib/types/services/PlatformRequest.d.ts +8 -10
- package/lib/types/services/PlatformResponse.d.ts +11 -15
- package/lib/types/services/PlatformTest.d.ts +4 -3
- package/lib/types/utils/createContext.d.ts +4 -1
- package/lib/types/utils/createHttpsServer.d.ts +1 -0
- package/lib/types/utils/createInjector.d.ts +2 -2
- package/lib/types/utils/ensureContext.d.ts +2 -0
- package/lib/types/utils/listenServer.d.ts +2 -0
- package/package.json +28 -23
- package/readme.md +2 -1
- package/lib/cjs/builder/PlatformControllerBuilder.js +0 -82
- package/lib/cjs/builder/PlatformControllerBuilder.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/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/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/services/PlatformRouter.js +0 -108
- package/lib/cjs/services/PlatformRouter.js.map +0 -1
- package/lib/cjs/utils/__mock__/Test1.js +0 -8
- package/lib/cjs/utils/__mock__/Test1.js.map +0 -1
- package/lib/cjs/utils/__mock__/Test2.js +0 -8
- package/lib/cjs/utils/__mock__/Test2.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/importProviders.js +0 -29
- package/lib/cjs/utils/importProviders.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 -76
- package/lib/esm/builder/PlatformControllerBuilder.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/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/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/services/PlatformRouter.js +0 -105
- package/lib/esm/services/PlatformRouter.js.map +0 -1
- package/lib/esm/utils/__mock__/Test1.js +0 -4
- package/lib/esm/utils/__mock__/Test1.js.map +0 -1
- package/lib/esm/utils/__mock__/Test2.js +0 -4
- package/lib/esm/utils/__mock__/Test2.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/importProviders.js +0 -25
- package/lib/esm/utils/importProviders.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 -18
- package/lib/types/config/interfaces/EndpointDirectoriesSettings.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/middlewares/__mock__/FakeCtrl.d.ts +0 -2
- package/lib/types/middlewares/bindEndpointMiddleware.d.ts +0 -6
- package/lib/types/services/PlatformRouter.d.ts +0 -51
- package/lib/types/utils/__mock__/Test1.d.ts +0 -3
- package/lib/types/utils/__mock__/Test2.d.ts +0 -3
- package/lib/types/utils/createHandlerMetadata.d.ts +0 -8
- package/lib/types/utils/importProviders.d.ts +0 -10
- package/lib/types/utils/useCtxHandler.d.ts +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../src/decorators/params/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,UAAU,GAAG;IACjB,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,GAAG;QACzB,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../src/decorators/params/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,UAAU,GAAG;IACjB,OAAO,QAAQ,CAAC;QACd,SAAS,EAAE,UAAU,CAAC,GAAG;QACzB,QAAQ,EAAE,YAAY;QACtB,aAAa,EAAE,KAAK;QACpB,YAAY,EAAE,KAAK;KACpB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {ParamTypes, UseParam} from \"@tsed/platform-params\";\n\n/**\n * @returns {Function}\n * @decorator\n * @operation\n * @input\n */\nexport function Err(): Function {\n return UseParam({\n paramType: ParamTypes.ERR,\n dataPath: \"$ctx.error\",\n useValidation: false,\n useConverter: false\n });\n}\n"]}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { AnyToPromise } from "@tsed/core";
|
|
2
2
|
export class AnyToPromiseWithCtx extends AnyToPromise {
|
|
3
|
-
|
|
3
|
+
$ctx;
|
|
4
|
+
constructor($ctx) {
|
|
4
5
|
super();
|
|
5
6
|
this.$ctx = $ctx;
|
|
6
|
-
this.err = err;
|
|
7
7
|
}
|
|
8
8
|
isDone() {
|
|
9
9
|
const { $ctx } = this;
|
|
10
|
-
return
|
|
10
|
+
return $ctx?.isDone() || super.isDone();
|
|
11
11
|
}
|
|
12
12
|
async call(cb) {
|
|
13
13
|
return super.call(() => cb(this));
|
|
14
14
|
}
|
|
15
15
|
destroy() {
|
|
16
|
-
|
|
17
|
-
delete this.$ctx;
|
|
16
|
+
this.$ctx = null;
|
|
18
17
|
}
|
|
19
18
|
isCanceledResponse(process) {
|
|
20
19
|
return process === this.$ctx.getResponse();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnyToPromiseWithCtx.js","sourceRoot":"","sources":["../../../src/domain/AnyToPromiseWithCtx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"AnyToPromiseWithCtx.js","sourceRoot":"","sources":["../../../src/domain/AnyToPromiseWithCtx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAC,MAAM,YAAY,CAAC;AAG1D,MAAM,OAAO,mBAAoB,SAAQ,YAAY;IAC5C,IAAI,CAAkB;IAE7B,YAAY,IAAqB;QAC/B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,MAAM;QACJ,MAAM,EAAC,IAAI,EAAC,GAAG,IAAI,CAAC;QAEpB,OAAO,IAAI,EAAE,MAAM,EAAE,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAY;QACrB,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,OAAO;QACJ,IAAI,CAAC,IAAY,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED,kBAAkB,CAAC,OAAY;QAC7B,OAAO,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import {AnyPromiseResult, AnyToPromise} from \"@tsed/core\";\nimport {PlatformContext} from \"./PlatformContext\";\n\nexport class AnyToPromiseWithCtx extends AnyToPromise {\n public $ctx: PlatformContext;\n\n constructor($ctx: PlatformContext) {\n super();\n this.$ctx = $ctx;\n }\n\n isDone(): boolean {\n const {$ctx} = this;\n\n return $ctx?.isDone() || super.isDone();\n }\n\n async call(cb: Function): Promise<AnyPromiseResult<any>> {\n return super.call(() => cb(this));\n }\n\n destroy() {\n (this.$ctx as any) = null;\n }\n\n isCanceledResponse(process: any) {\n return process === this.$ctx.getResponse();\n }\n}\n"]}
|
|
@@ -3,26 +3,44 @@ import { PlatformApplication } from "../services/PlatformApplication.js";
|
|
|
3
3
|
import { PlatformRequest } from "../services/PlatformRequest.js";
|
|
4
4
|
import { PlatformResponse } from "../services/PlatformResponse.js";
|
|
5
5
|
export class PlatformContext extends DIContext {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
event;
|
|
7
|
+
/**
|
|
8
|
+
* The data return by the previous endpoint if you use multiple handler on the same route. By default data is empty.
|
|
9
|
+
*/
|
|
10
|
+
data;
|
|
11
|
+
/**
|
|
12
|
+
* The error caught by the current handler
|
|
13
|
+
*/
|
|
14
|
+
error;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
next;
|
|
19
|
+
/**
|
|
20
|
+
* The current @@PlatformResponse@@.
|
|
21
|
+
*/
|
|
22
|
+
response;
|
|
23
|
+
/**
|
|
24
|
+
* The current @@PlatformRequest@@.
|
|
25
|
+
*/
|
|
26
|
+
request;
|
|
27
|
+
/**
|
|
28
|
+
* The current @@EndpointMetadata@@ resolved by Ts.ED during the request.
|
|
29
|
+
*/
|
|
30
|
+
endpoint;
|
|
31
|
+
/**
|
|
32
|
+
* The current @@PlatformHandlerMetadata@@ resolved by Ts.ED during the request.
|
|
33
|
+
*/
|
|
34
|
+
handlerMetadata;
|
|
35
|
+
#isFinished = false;
|
|
36
|
+
constructor(options) {
|
|
37
|
+
super(options);
|
|
38
|
+
options.endpoint && (this.endpoint = options.endpoint);
|
|
39
|
+
this.event = options.event;
|
|
40
|
+
this.response = new (options.ResponseKlass || PlatformResponse)(this);
|
|
41
|
+
this.request = new (options.RequestKlass || PlatformRequest)(this);
|
|
20
42
|
this.request.request.$ctx = this;
|
|
21
43
|
this.request.request.id = this.id;
|
|
22
|
-
this.logger.url = this.url;
|
|
23
|
-
this.container.set(PlatformResponse, this.response);
|
|
24
|
-
this.container.set(PlatformRequest, this.request);
|
|
25
|
-
this.container.set(PlatformContext, this);
|
|
26
44
|
this.response.setHeader("x-request-id", this.id);
|
|
27
45
|
}
|
|
28
46
|
get url() {
|
|
@@ -31,28 +49,18 @@ export class PlatformContext extends DIContext {
|
|
|
31
49
|
get app() {
|
|
32
50
|
return this.injector.get(PlatformApplication);
|
|
33
51
|
}
|
|
34
|
-
async
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
this.
|
|
39
|
-
this
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
delete this.response;
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
delete this.request;
|
|
52
|
+
async start() {
|
|
53
|
+
return this.emit("$onRequest", this);
|
|
54
|
+
}
|
|
55
|
+
async finish() {
|
|
56
|
+
await Promise.all([this.emit("$onResponse", this), this.destroy()]);
|
|
57
|
+
this.#isFinished = true;
|
|
58
|
+
}
|
|
59
|
+
isFinished() {
|
|
60
|
+
return this.#isFinished;
|
|
46
61
|
}
|
|
47
62
|
isDone() {
|
|
48
|
-
|
|
49
|
-
if (!this.request || !this.response) {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
if ((_a = this.request) === null || _a === void 0 ? void 0 : _a.isAborted()) {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
return (_b = this.response) === null || _b === void 0 ? void 0 : _b.isDone();
|
|
63
|
+
return this.request?.isAborted() || this.response?.isDone() || this.isFinished();
|
|
56
64
|
}
|
|
57
65
|
/**
|
|
58
66
|
* Return the framework request instance (Express, Koa, etc...)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformContext.js","sourceRoot":"","sources":["../../../src/domain/PlatformContext.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
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from \"@tsed/platform-router\";\nimport {EndpointMetadata} from \"@tsed/schema\";\nimport {IncomingMessage, ServerResponse} from \"http\";\nimport {IncomingEvent} from \"../interfaces/IncomingEvent\";\nimport {PlatformApplication} from \"../services/PlatformApplication\";\nimport {PlatformRequest} from \"../services/PlatformRequest\";\nimport {PlatformResponse} from \"../services/PlatformResponse\";\n\ndeclare global {\n namespace TsED {\n export interface Context extends PlatformContext {}\n }\n}\n\nexport interface PlatformContextOptions extends DIContextOptions {\n event: IncomingEvent;\n ignoreUrlPatterns?: any[];\n endpoint?: EndpointMetadata;\n}\n\nexport class PlatformContext<\n PReq extends PlatformRequest = PlatformRequest,\n PRes extends PlatformResponse = PlatformResponse\n> extends DIContext {\n public event: IncomingEvent;\n /**\n * The data return by the previous endpoint if you use multiple handler on the same route. By default data is empty.\n */\n public data: any;\n /**\n * The error caught by the current handler\n */\n public error?: unknown;\n /**\n *\n */\n public next?: any;\n /**\n * The current @@PlatformResponse@@.\n */\n readonly response: PRes;\n /**\n * The current @@PlatformRequest@@.\n */\n readonly request: PReq;\n /**\n * The current @@EndpointMetadata@@ resolved by Ts.ED during the request.\n */\n endpoint: EndpointMetadata;\n /**\n * The current @@PlatformHandlerMetadata@@ resolved by Ts.ED during the request.\n */\n handlerMetadata: PlatformHandlerMetadata;\n\n #isFinished: boolean = false;\n\n constructor(options: PlatformContextOptions) {\n super(options);\n\n options.endpoint && (this.endpoint = options.endpoint);\n\n this.event = options.event;\n this.response = new (options.ResponseKlass || PlatformResponse)(this);\n this.request = new (options.RequestKlass || PlatformRequest)(this);\n\n this.request.request.$ctx = this;\n this.request.request.id = this.id;\n\n this.response.setHeader(\"x-request-id\", this.id);\n }\n\n get url() {\n return this.request.url;\n }\n\n get app() {\n return this.injector.get<PlatformApplication>(PlatformApplication)!;\n }\n\n async start() {\n return this.emit(\"$onRequest\", this);\n }\n\n async finish() {\n await Promise.all([this.emit(\"$onResponse\", this), this.destroy()]);\n this.#isFinished = true;\n }\n\n isFinished() {\n return this.#isFinished;\n }\n\n isDone() {\n return this.request?.isAborted() || this.response?.isDone() || this.isFinished();\n }\n\n /**\n * Return the framework request instance (Express, Koa, etc...)\n */\n getRequest<Req = any>(): Req {\n return this.request.getRequest<Req>();\n }\n\n /**\n * Return the framework response instance (Express, Koa, etc...)\n */\n getResponse<Res = any>(): Res {\n return this.response.getResponse<Res>();\n }\n\n /**\n * Get Node.js request\n */\n getReq(): IncomingMessage {\n return this.request.getReq();\n }\n\n /**\n * Get Node.js response\n */\n getRes(): ServerResponse {\n return this.response.getRes();\n }\n\n /**\n * Return the original application instance.\n */\n getApp<T = any>(): T {\n return this.app.getApp() as any;\n }\n}\n"]}
|
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { JsonOperationRoute } from "@tsed/schema";
|
|
3
|
-
export class PlatformRouteDetails extends JsonOperationRoute {
|
|
4
|
-
constructor(options = {}) {
|
|
5
|
-
super(options);
|
|
6
|
-
this.rawBody = !!this.endpoint.parameters.find((param) => param.paramType === ParamTypes.RAW_BODY);
|
|
7
|
-
}
|
|
8
|
-
toJSON() {
|
|
9
|
-
return {
|
|
10
|
-
method: this.method,
|
|
11
|
-
name: this.name,
|
|
12
|
-
url: this.url,
|
|
13
|
-
className: this.className,
|
|
14
|
-
methodClassName: this.methodClassName,
|
|
15
|
-
parameters: this.parameters,
|
|
16
|
-
rawBody: this.rawBody
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
}
|
|
1
|
+
export {};
|
|
20
2
|
//# sourceMappingURL=PlatformRouteDetails.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformRouteDetails.js","sourceRoot":"","sources":["../../../src/domain/PlatformRouteDetails.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlatformRouteDetails.js","sourceRoot":"","sources":["../../../src/domain/PlatformRouteDetails.ts"],"names":[],"mappings":"","sourcesContent":["export interface PlatformRouteDetails {\n method: string;\n name: string;\n url: string;\n className: string;\n methodClassName: string;\n}\n"]}
|
package/lib/esm/exports.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from "@tsed/platform-cache";
|
|
|
8
8
|
export * from "@tsed/platform-middlewares";
|
|
9
9
|
export * from "@tsed/components-scan";
|
|
10
10
|
export * from "@tsed/platform-log-middleware";
|
|
11
|
+
export * from "@tsed/platform-router";
|
|
11
12
|
export { $log, Logger } from "@tsed/logger";
|
|
12
13
|
export { AcceptMime, Location, Redirect, View, Get, Post, Put, Patch, Delete, Head, Options, All } from "@tsed/schema";
|
|
13
14
|
//# sourceMappingURL=exports.js.map
|
package/lib/esm/exports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAE3B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAE3B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AAEtC,OAAO,EAAC,IAAI,EAAE,MAAM,EAAC,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAC,MAAM,cAAc,CAAC","sourcesContent":["import \"@tsed/logger\";\nimport \"@tsed/logger-file\";\n\nexport * from \"@tsed/di\";\nexport * from \"@tsed/platform-params\";\nexport * from \"@tsed/platform-exceptions\";\nexport * from \"@tsed/platform-response-filter\";\nexport * from \"@tsed/platform-cache\";\nexport * from \"@tsed/platform-middlewares\";\nexport * from \"@tsed/components-scan\";\nexport * from \"@tsed/platform-log-middleware\";\nexport * from \"@tsed/platform-router\";\n\nexport {$log, Logger} from \"@tsed/logger\";\n\nexport {AcceptMime, Location, Redirect, View, Get, Post, Put, Patch, Delete, Head, Options, All} from \"@tsed/schema\";\n"]}
|
package/lib/esm/index.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export * from "./exports.js";
|
|
5
5
|
export * from "./builder/PlatformBuilder.js";
|
|
6
|
-
export * from "./builder/PlatformControllerBuilder.js";
|
|
7
6
|
export * from "./config/interfaces/ConverterSettings.js";
|
|
8
|
-
export * from "./config/interfaces/EndpointDirectoriesSettings.js";
|
|
9
7
|
export * from "./config/interfaces/PlatformLoggerSettings.js";
|
|
10
8
|
export * from "./config/interfaces/PlatformMulterSettings.js";
|
|
11
9
|
export * from "./config/interfaces/PlatformStaticsSettings.js";
|
|
@@ -19,9 +17,7 @@ export * from "./decorators/params/next.js";
|
|
|
19
17
|
export * from "./decorators/params/request.js";
|
|
20
18
|
export * from "./decorators/params/response.js";
|
|
21
19
|
export * from "./domain/AnyToPromiseWithCtx.js";
|
|
22
|
-
export * from "./domain/ControllerProvider.js";
|
|
23
20
|
export * from "./domain/EndpointMetadata.js";
|
|
24
|
-
export * from "./domain/HandlerMetadata.js";
|
|
25
21
|
export * from "./domain/PlatformContext.js";
|
|
26
22
|
export * from "./domain/PlatformRouteDetails.js";
|
|
27
23
|
export * from "./interfaces/AfterInit.js";
|
|
@@ -41,7 +37,6 @@ export * from "./interfaces/ResponseErrorObject.js";
|
|
|
41
37
|
export * from "./interfaces/Route.js";
|
|
42
38
|
export * from "./middlewares/PlatformAcceptMimesMiddleware.js";
|
|
43
39
|
export * from "./middlewares/PlatformMulterMiddleware.js";
|
|
44
|
-
export * from "./middlewares/bindEndpointMiddleware.js";
|
|
45
40
|
export * from "./services/FakeAdapter.js";
|
|
46
41
|
export * from "./services/Platform.js";
|
|
47
42
|
export * from "./services/PlatformAdapter.js";
|
|
@@ -50,18 +45,15 @@ export * from "./services/PlatformHandler.js";
|
|
|
50
45
|
export * from "./services/PlatformMiddlewaresChain.js";
|
|
51
46
|
export * from "./services/PlatformRequest.js";
|
|
52
47
|
export * from "./services/PlatformResponse.js";
|
|
53
|
-
export * from "./services/PlatformRouter.js";
|
|
54
48
|
export * from "./services/PlatformTest.js";
|
|
55
49
|
export * from "./utils/createContext.js";
|
|
56
|
-
export * from "./utils/createHandlerMetadata.js";
|
|
57
50
|
export * from "./utils/createHttpServer.js";
|
|
58
51
|
export * from "./utils/createHttpsServer.js";
|
|
59
52
|
export * from "./utils/createInjector.js";
|
|
53
|
+
export * from "./utils/ensureContext.js";
|
|
60
54
|
export * from "./utils/getStaticsOptions.js";
|
|
61
|
-
export * from "./utils/importProviders.js";
|
|
62
55
|
export * from "./utils/listenServer.js";
|
|
63
56
|
export * from "./utils/mapReturnedResponse.js";
|
|
64
57
|
export * from "./utils/printRoutes.js";
|
|
65
58
|
export * from "./utils/setResponseHeaders.js";
|
|
66
|
-
export * from "./utils/useCtxHandler.js";
|
|
67
59
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,c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Ac,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./exports\";\nexport * from \"./builder/PlatformBuilder\";\nexport * from \"./config/interfaces/ConverterSettings\";\nexport * from \"./config/interfaces/PlatformLoggerSettings\";\nexport * from \"./config/interfaces/PlatformMulterSettings\";\nexport * from \"./config/interfaces/PlatformStaticsSettings\";\nexport * from \"./config/services/PlatformConfiguration\";\nexport * from \"./constants/routerOptions\";\nexport * from \"./decorators/multer/multerFileSize\";\nexport * from \"./decorators/multer/multerOptions\";\nexport * from \"./decorators/multer/multipartFile\";\nexport * from \"./decorators/params/error\";\nexport * from \"./decorators/params/next\";\nexport * from \"./decorators/params/request\";\nexport * from \"./decorators/params/response\";\nexport * from \"./domain/AnyToPromiseWithCtx\";\nexport * from \"./domain/EndpointMetadata\";\nexport * from \"./domain/PlatformContext\";\nexport * from \"./domain/PlatformRouteDetails\";\nexport * from \"./interfaces/AfterInit\";\nexport * from \"./interfaces/AfterListen\";\nexport * from \"./interfaces/AfterRoutesInit\";\nexport * from \"./interfaces/BeforeInit\";\nexport * from \"./interfaces/BeforeListen\";\nexport * from \"./interfaces/BeforeRoutesInit\";\nexport * from \"./interfaces/HandlerType\";\nexport * from \"./interfaces/IncomingEvent\";\nexport * from \"./interfaces/OnReady\";\nexport * from \"./interfaces/OnRequest\";\nexport * from \"./interfaces/OnResponse\";\nexport * from \"./interfaces/OnRoutesInit\";\nexport * from \"./interfaces/PlatformRouteOptions\";\nexport * from \"./interfaces/ResponseErrorObject\";\nexport * from \"./interfaces/Route\";\nexport * from \"./middlewares/PlatformAcceptMimesMiddleware\";\nexport * from \"./middlewares/PlatformMulterMiddleware\";\nexport * from \"./services/FakeAdapter\";\nexport * from \"./services/Platform\";\nexport * from \"./services/PlatformAdapter\";\nexport * from \"./services/PlatformApplication\";\nexport * from \"./services/PlatformHandler\";\nexport * from \"./services/PlatformMiddlewaresChain\";\nexport * from \"./services/PlatformRequest\";\nexport * from \"./services/PlatformResponse\";\nexport * from \"./services/PlatformTest\";\nexport * from \"./utils/createContext\";\nexport * from \"./utils/createHttpServer\";\nexport * from \"./utils/createHttpsServer\";\nexport * from \"./utils/createInjector\";\nexport * from \"./utils/ensureContext\";\nexport * from \"./utils/getStaticsOptions\";\nexport * from \"./utils/listenServer\";\nexport * from \"./utils/mapReturnedResponse\";\nexport * from \"./utils/printRoutes\";\nexport * from \"./utils/setResponseHeaders\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformRouteOptions.js","sourceRoot":"","sources":["../../../src/interfaces/PlatformRouteOptions.ts"],"names":[],"mappings":"","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {PathType} from \"@tsed/di\";\n\n/**\n * @ignore\n */\nexport interface PlatformRouteOptions {\n token?: Type<any>;\n path?: PathType | undefined;\n method?: string;\n
|
|
1
|
+
{"version":3,"file":"PlatformRouteOptions.js","sourceRoot":"","sources":["../../../src/interfaces/PlatformRouteOptions.ts"],"names":[],"mappings":"","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {PathType} from \"@tsed/di\";\n\n/**\n * @ignore\n */\nexport interface PlatformRouteOptions {\n token?: Type<any>;\n path?: PathType | undefined;\n method?: string;\n handlers: any[];\n}\n\n/**\n * @ignore\n */\nexport type PlatformRouteWithoutHandlers = Partial<Omit<PlatformRouteOptions, \"handlers\">>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Route.js","sourceRoot":"","sources":["../../../src/interfaces/Route.ts"],"names":[],"mappings":"","sourcesContent":["import {TokenProvider} from \"@tsed/di\";\
|
|
1
|
+
{"version":3,"file":"Route.js","sourceRoot":"","sources":["../../../src/interfaces/Route.ts"],"names":[],"mappings":"","sourcesContent":["import {Provider, TokenProvider} from \"@tsed/di\";\n\nexport interface Route extends Record<string, any> {\n route: string;\n token: TokenProvider;\n}\n\nexport interface RouteController {\n route: string;\n provider: Provider;\n}\n"]}
|
|
@@ -9,9 +9,10 @@ import { Context } from "@tsed/platform-params";
|
|
|
9
9
|
* @platform
|
|
10
10
|
*/
|
|
11
11
|
let PlatformAcceptMimesMiddleware = class PlatformAcceptMimesMiddleware {
|
|
12
|
+
acceptMimes;
|
|
12
13
|
use(ctx) {
|
|
13
14
|
const { endpoint, request } = ctx;
|
|
14
|
-
const mimes = uniq((
|
|
15
|
+
const mimes = uniq((endpoint?.get("acceptMimes") || []).concat(this.acceptMimes));
|
|
15
16
|
if (mimes.length && !request.accepts(mimes)) {
|
|
16
17
|
throw new NotAcceptable(mimes.join(", "));
|
|
17
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformAcceptMimesMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/PlatformAcceptMimesMiddleware.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,YAAY,CAAC;AAChC,OAAO,EAAC,QAAQ,EAAC,MAAM,UAAU,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAoB,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAE9C;;;GAGG;AAEH,IAAa,6BAA6B,GAA1C,MAAa,6BAA6B;
|
|
1
|
+
{"version":3,"file":"PlatformAcceptMimesMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/PlatformAcceptMimesMiddleware.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,YAAY,CAAC;AAChC,OAAO,EAAC,QAAQ,EAAC,MAAM,UAAU,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAoB,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAE9C;;;GAGG;AAEH,IAAa,6BAA6B,GAA1C,MAAa,6BAA6B;IAExC,WAAW,CAAW;IAEf,GAAG,CAAY,GAAY;QAChC,MAAM,EAAC,QAAQ,EAAE,OAAO,EAAC,GAAG,GAAG,CAAC;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAElF,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC3C,MAAM,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;SAC3C;IACH,CAAC;CACF,CAAA;AAVC;IADC,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC;;kEACN;AAEtB;IAAY,WAAA,OAAO,EAAE,CAAA;;;;wDAOpB;AAXU,6BAA6B;IADzC,UAAU,EAAE;GACA,6BAA6B,CAYzC;SAZY,6BAA6B","sourcesContent":["import {uniq} from \"@tsed/core\";\nimport {Constant} from \"@tsed/di\";\nimport {NotAcceptable} from \"@tsed/exceptions\";\nimport {Middleware, MiddlewareMethods} from \"@tsed/platform-middlewares\";\nimport {Context} from \"@tsed/platform-params\";\n\n/**\n * @middleware\n * @platform\n */\n@Middleware()\nexport class PlatformAcceptMimesMiddleware implements MiddlewareMethods {\n @Constant(\"acceptMimes\", [])\n acceptMimes: string[];\n\n public use(@Context() ctx: Context): void {\n const {endpoint, request} = ctx;\n const mimes = uniq((endpoint?.get(\"acceptMimes\") || []).concat(this.acceptMimes));\n\n if (mimes.length && !request.accepts(mimes)) {\n throw new NotAcceptable(mimes.join(\", \"));\n }\n }\n}\n"]}
|
|
@@ -16,6 +16,8 @@ export class MulterException extends BadRequest {
|
|
|
16
16
|
* @middleware
|
|
17
17
|
*/
|
|
18
18
|
let PlatformMulterMiddleware = PlatformMulterMiddleware_1 = class PlatformMulterMiddleware {
|
|
19
|
+
settings;
|
|
20
|
+
app;
|
|
19
21
|
async use(ctx) {
|
|
20
22
|
try {
|
|
21
23
|
const { fields, options = {} } = ctx.endpoint.get(PlatformMulterMiddleware_1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformMulterMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/PlatformMulterMiddleware.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"PlatformMulterMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/PlatformMulterMiddleware.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAC,UAAU,EAAoB,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAG9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AAMpE,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAC7C,YAAY,EAAe;QACzB,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC;IACtB,CAAC;CACF;AAED;;GAEG;AAEH,IAAa,wBAAwB,gCAArC,MAAa,wBAAwB;IAEzB,QAAQ,CAAyB;IAG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esContent":["import {Inject, Value} from \"@tsed/di\";\nimport {BadRequest} from \"@tsed/exceptions\";\nimport {Middleware, MiddlewareMethods} from \"@tsed/platform-middlewares\";\nimport {Context} from \"@tsed/platform-params\";\nimport type {MulterError} from \"multer\";\nimport {PlatformMulterField, PlatformMulterSettings} from \"../config/interfaces/PlatformMulterSettings\";\nimport {PlatformApplication} from \"../services/PlatformApplication\";\n\nexport interface MulterInputOptions {\n fields: PlatformMulterField[];\n}\n\nexport class MulterException extends BadRequest {\n constructor(er: MulterError) {\n super(er.message);\n this.origin = er;\n this.name = er.code;\n }\n}\n\n/**\n * @middleware\n */\n@Middleware()\nexport class PlatformMulterMiddleware implements MiddlewareMethods {\n @Value(\"multer\", {}) // NOTE: don't use constant to getting multer configuration. See issue #1840\n protected settings: PlatformMulterSettings;\n\n @Inject()\n protected app: PlatformApplication;\n\n async use(@Context() ctx: Context) {\n try {\n const {fields, options = {}} = ctx.endpoint.get(PlatformMulterMiddleware);\n const settings: PlatformMulterSettings = {\n ...this.settings,\n ...options\n };\n\n /* istanbul ignore next */\n if (settings.storage) {\n delete settings.dest;\n }\n\n const middleware: any = this.app.multer(settings).fields(this.getFields({fields}));\n\n return await middleware(ctx.getRequest(), ctx.getResponse());\n } catch (er) {\n if (er.code) {\n throw new MulterException(er);\n }\n\n throw er;\n }\n }\n\n protected getFields(conf: MulterInputOptions) {\n return conf.fields.map(({name, maxCount}) => ({name, maxCount}));\n }\n}\n"]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export class FakeAdapter {
|
|
2
|
-
|
|
3
|
-
this.providers = [];
|
|
4
|
-
}
|
|
2
|
+
providers = [];
|
|
5
3
|
static createFakeRawDriver() {
|
|
6
4
|
// istanbul ignore next
|
|
7
5
|
function FakeRawDriver() { }
|
|
@@ -32,20 +30,16 @@ export class FakeAdapter {
|
|
|
32
30
|
multipart(options) {
|
|
33
31
|
return {};
|
|
34
32
|
}
|
|
35
|
-
router(routerOptions) {
|
|
36
|
-
const router = FakeAdapter.createFakeRawDriver();
|
|
37
|
-
return {
|
|
38
|
-
router,
|
|
39
|
-
callback() {
|
|
40
|
-
return router;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
33
|
statics(endpoint, options) {
|
|
45
34
|
return {};
|
|
46
35
|
}
|
|
47
36
|
bodyParser(type) {
|
|
48
37
|
return () => { };
|
|
49
38
|
}
|
|
39
|
+
mapLayers(layers) { }
|
|
40
|
+
mapHandler(handler) {
|
|
41
|
+
return handler;
|
|
42
|
+
}
|
|
43
|
+
useContext() { }
|
|
50
44
|
}
|
|
51
45
|
//# sourceMappingURL=FakeAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FakeAdapter.js","sourceRoot":"","sources":["../../../src/services/FakeAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FakeAdapter.js","sourceRoot":"","sources":["../../../src/services/FakeAdapter.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,WAAW;IACtB,SAAS,GAAmB,EAAE,CAAC;IAE/B,MAAM,CAAC,mBAAmB;QACxB,uBAAuB;QACvB,SAAS,aAAa,KAAI,CAAC;QAE3B,uBAAuB;QACvB,SAAS,GAAG;YACV,OAAO,IAAI,CAAC;QACd,CAAC;QAED,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;QACxB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;QACxB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;QACxB,aAAa,CAAC,KAAK,GAAG,GAAG,CAAC;QAC1B,aAAa,CAAC,IAAI,GAAG,GAAG,CAAC;QACzB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;QACxB,aAAa,CAAC,IAAI,GAAG,GAAG,CAAC;QACzB,aAAa,CAAC,MAAM,GAAG,GAAG,CAAC;QAC3B,aAAa,CAAC,OAAO,GAAG,GAAG,CAAC;QAE5B,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,GAAG;QACD,MAAM,GAAG,GAAG,WAAW,CAAC,mBAAmB,EAAE,CAAC;QAC9C,OAAO;YACL,GAAG;YACH,QAAQ;gBACN,OAAO,GAAG,CAAC;YACb,CAAC;SACF,CAAC;IACJ,CAAC;IAED,SAAS,CAAC,OAA+B;QACvC,OAAO,EAAS,CAAC;IACnB,CAAC;IAED,OAAO,CAAC,QAAgB,EAAE,OAA+B;QACvD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,UAAU,CAAC,IAAY;QACrB,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IAClB,CAAC;IAED,SAAS,CAAC,MAAuB,IAAG,CAAC;IAErC,UAAU,CAAC,OAAgD;QACzD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,UAAU,KAAI,CAAC;CAChB","sourcesContent":["import {ProviderOpts} from \"@tsed/di\";\nimport {PlatformContextHandler, PlatformLayer} from \"@tsed/platform-router\";\nimport {PlatformMulter, PlatformMulterSettings} from \"../config/interfaces/PlatformMulterSettings\";\nimport {PlatformStaticsOptions} from \"../config/interfaces/PlatformStaticsSettings\";\nimport {PlatformContext} from \"../domain/PlatformContext\";\nimport {PlatformAdapter} from \"./PlatformAdapter\";\n\nexport class FakeAdapter implements PlatformAdapter<any> {\n providers: ProviderOpts[] = [];\n\n static 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\n app(): {app: any; callback(): any} {\n const app = FakeAdapter.createFakeRawDriver();\n return {\n app,\n callback() {\n return app;\n }\n };\n }\n\n multipart(options: PlatformMulterSettings): PlatformMulter {\n return {} as any;\n }\n\n statics(endpoint: string, options: PlatformStaticsOptions): any {\n return {};\n }\n\n bodyParser(type: string): any {\n return () => {};\n }\n\n mapLayers(layers: PlatformLayer[]) {}\n\n mapHandler(handler: PlatformContextHandler<PlatformContext>) {\n return handler;\n }\n\n useContext() {}\n}\n"]}
|
|
@@ -1,125 +1,69 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Injectable, InjectorService, ProviderScope
|
|
3
|
-
import {
|
|
4
|
-
import { buildRouter, createRouter, getRouter } from "../builder/PlatformControllerBuilder.js";
|
|
5
|
-
import { PlatformRouteDetails } from "../domain/PlatformRouteDetails.js";
|
|
2
|
+
import { Injectable, InjectorService, ProviderScope } from "@tsed/di";
|
|
3
|
+
import { PlatformRouters } from "@tsed/platform-router";
|
|
6
4
|
import { PlatformApplication } from "./PlatformApplication.js";
|
|
7
|
-
import {
|
|
5
|
+
import { PlatformHandler } from "./PlatformHandler.js";
|
|
8
6
|
/**
|
|
9
7
|
* `Platform` is used to provide all routes collected by annotation `@Controller`.
|
|
10
8
|
*
|
|
11
9
|
* @platform
|
|
12
10
|
*/
|
|
13
11
|
let Platform = class Platform {
|
|
14
|
-
|
|
12
|
+
injector;
|
|
13
|
+
platformApplication;
|
|
14
|
+
platformRouters;
|
|
15
|
+
#controllers = new Map();
|
|
16
|
+
constructor(injector, platformApplication, platformRouters) {
|
|
15
17
|
this.injector = injector;
|
|
16
18
|
this.platformApplication = platformApplication;
|
|
17
|
-
this.
|
|
18
|
-
|
|
19
|
-
this.createRouters();
|
|
19
|
+
this.platformRouters = platformRouters;
|
|
20
|
+
platformRouters.prebuild();
|
|
20
21
|
}
|
|
21
22
|
get app() {
|
|
22
23
|
return this.platformApplication;
|
|
23
24
|
}
|
|
24
|
-
get routes() {
|
|
25
|
-
return this._routes;
|
|
26
|
-
}
|
|
27
25
|
addRoutes(routes) {
|
|
28
26
|
routes.forEach((routeSettings) => {
|
|
29
27
|
this.addRoute(routeSettings.route, routeSettings.token);
|
|
30
28
|
});
|
|
31
29
|
}
|
|
32
|
-
addRoute(
|
|
33
|
-
const
|
|
34
|
-
const provider = injector.getProvider(token);
|
|
30
|
+
addRoute(route, token) {
|
|
31
|
+
const provider = this.injector.getProvider(token);
|
|
35
32
|
if (!provider || provider.hasParent()) {
|
|
36
|
-
return;
|
|
33
|
+
return this;
|
|
37
34
|
}
|
|
38
|
-
this.
|
|
39
|
-
|
|
40
|
-
this.app.use(ctrlPath, ...[].concat(getRouter(injector, provider).callback()));
|
|
41
|
-
this._routes = getOperationsRoutes(provider.token, {
|
|
42
|
-
withChildren: true,
|
|
43
|
-
basePath
|
|
44
|
-
}).reduce((routes, operationRoute) => {
|
|
45
|
-
if (injector.hasProvider(token)) {
|
|
46
|
-
const provider = injector.getProvider(operationRoute.token);
|
|
47
|
-
const route = new PlatformRouteDetails({
|
|
48
|
-
...operationRoute,
|
|
49
|
-
provider
|
|
50
|
-
});
|
|
51
|
-
routes = routes.concat(route);
|
|
52
|
-
}
|
|
53
|
-
return routes;
|
|
54
|
-
}, this._routes);
|
|
35
|
+
const router = this.platformRouters.from(provider.token);
|
|
36
|
+
this.app.use(route, router);
|
|
55
37
|
return this;
|
|
56
38
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
39
|
+
getLayers() {
|
|
40
|
+
this.#controllers = new Map();
|
|
41
|
+
return this.platformRouters.getLayers(this.app).map((layer) => {
|
|
42
|
+
if (layer.isProvider()) {
|
|
43
|
+
this.#controllers.set(layer.provider.token, {
|
|
44
|
+
route: String(layer.path).split(layer.provider.path)[0],
|
|
45
|
+
provider: layer.provider
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return layer;
|
|
49
|
+
});
|
|
63
50
|
}
|
|
64
51
|
/**
|
|
65
52
|
* Get all controllers mounted on the application.
|
|
66
53
|
* @returns {RouteController[]}
|
|
67
54
|
*/
|
|
68
55
|
getMountedControllers() {
|
|
69
|
-
return this.
|
|
70
|
-
}
|
|
71
|
-
$onInit() {
|
|
72
|
-
this.buildControllers();
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Create routers from the collected controllers.
|
|
76
|
-
* @private
|
|
77
|
-
*/
|
|
78
|
-
createRouters() {
|
|
79
|
-
const { injector } = this;
|
|
80
|
-
injector.getProviders(ProviderType.CONTROLLER).map((provider) => {
|
|
81
|
-
createRouter(injector, provider);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Get all router controllers from the controller token.
|
|
86
|
-
* @private
|
|
87
|
-
*/
|
|
88
|
-
getAllControllers(basePath, token) {
|
|
89
|
-
const store = token.isStore ? token : getJsonEntityStore(token);
|
|
90
|
-
const ctrlPath = concatPath(basePath, JsonEntityStore.from(token).path);
|
|
91
|
-
const children = store.get("childrenControllers", []);
|
|
92
|
-
return children
|
|
93
|
-
.reduce((controllers, token) => {
|
|
94
|
-
const childBasePath = concatPath(basePath, store.path);
|
|
95
|
-
return controllers.concat(this.getAllControllers(childBasePath, token));
|
|
96
|
-
}, [])
|
|
97
|
-
.concat([
|
|
98
|
-
{
|
|
99
|
-
route: ctrlPath,
|
|
100
|
-
provider: this.injector.getProvider(token)
|
|
101
|
-
}
|
|
102
|
-
]);
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Create controllers from DI
|
|
106
|
-
* @private
|
|
107
|
-
*/
|
|
108
|
-
buildControllers() {
|
|
109
|
-
const { injector } = this;
|
|
110
|
-
injector.getProviders(ProviderType.CONTROLLER).map((provider) => {
|
|
111
|
-
if (!provider.hasParent()) {
|
|
112
|
-
return buildRouter(injector, provider);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
56
|
+
return [...this.#controllers.values()];
|
|
115
57
|
}
|
|
116
58
|
};
|
|
117
59
|
Platform = __decorate([
|
|
118
60
|
Injectable({
|
|
119
61
|
scope: ProviderScope.SINGLETON,
|
|
120
|
-
imports: [
|
|
62
|
+
imports: [PlatformHandler]
|
|
121
63
|
}),
|
|
122
|
-
__metadata("design:paramtypes", [InjectorService,
|
|
64
|
+
__metadata("design:paramtypes", [InjectorService,
|
|
65
|
+
PlatformApplication,
|
|
66
|
+
PlatformRouters])
|
|
123
67
|
], Platform);
|
|
124
68
|
export { Platform };
|
|
125
69
|
//# sourceMappingURL=Platform.js.map
|