@tsed/common 8.0.0-beta.1 → 8.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/index.js +12 -63
- package/lib/esm/index.js.map +1 -1
- package/lib/types/index.d.ts +12 -63
- package/package.json +11 -32
- package/readme.md +3 -3
- package/vitest.config.mts +5 -5
- package/.barrelsby.json +0 -5
- package/lib/esm/builder/PlatformBuilder.js +0 -308
- package/lib/esm/builder/PlatformBuilder.js.map +0 -1
- package/lib/esm/config/interfaces/PlatformJsonMapperSettings.js +0 -2
- package/lib/esm/config/interfaces/PlatformJsonMapperSettings.js.map +0 -1
- package/lib/esm/config/interfaces/PlatformMulterSettings.js +0 -2
- package/lib/esm/config/interfaces/PlatformMulterSettings.js.map +0 -1
- package/lib/esm/config/interfaces/PlatformRouterSettings.js +0 -2
- package/lib/esm/config/interfaces/PlatformRouterSettings.js.map +0 -1
- package/lib/esm/config/interfaces/PlatformStaticsSettings.js +0 -2
- package/lib/esm/config/interfaces/PlatformStaticsSettings.js.map +0 -1
- package/lib/esm/config/services/PlatformConfiguration.js +0 -119
- package/lib/esm/config/services/PlatformConfiguration.js.map +0 -1
- package/lib/esm/constants/routerOptions.js +0 -2
- package/lib/esm/constants/routerOptions.js.map +0 -1
- package/lib/esm/decorators/PlatformProvider.js +0 -7
- package/lib/esm/decorators/PlatformProvider.js.map +0 -1
- package/lib/esm/decorators/multer/multerFileSize.js +0 -31
- package/lib/esm/decorators/multer/multerFileSize.js.map +0 -1
- package/lib/esm/decorators/multer/multerOptions.js +0 -49
- package/lib/esm/decorators/multer/multerOptions.js.map +0 -1
- package/lib/esm/decorators/multer/multipartFile.js +0 -74
- package/lib/esm/decorators/multer/multipartFile.js.map +0 -1
- package/lib/esm/decorators/params/error.js +0 -16
- package/lib/esm/decorators/params/error.js.map +0 -1
- package/lib/esm/decorators/params/next.js +0 -17
- package/lib/esm/decorators/params/next.js.map +0 -1
- package/lib/esm/decorators/params/request.js +0 -34
- package/lib/esm/decorators/params/request.js.map +0 -1
- package/lib/esm/decorators/params/response.js +0 -28
- package/lib/esm/decorators/params/response.js.map +0 -1
- package/lib/esm/domain/AnyToPromiseWithCtx.js +0 -21
- package/lib/esm/domain/AnyToPromiseWithCtx.js.map +0 -1
- package/lib/esm/domain/EndpointMetadata.js +0 -2
- package/lib/esm/domain/EndpointMetadata.js.map +0 -1
- package/lib/esm/domain/PlatformContext.js +0 -69
- package/lib/esm/domain/PlatformContext.js.map +0 -1
- package/lib/esm/domain/PlatformRouteDetails.js +0 -2
- package/lib/esm/domain/PlatformRouteDetails.js.map +0 -1
- package/lib/esm/exports.js +0 -10
- package/lib/esm/exports.js.map +0 -1
- package/lib/esm/interfaces/AfterInit.js +0 -2
- package/lib/esm/interfaces/AfterInit.js.map +0 -1
- package/lib/esm/interfaces/AfterListen.js +0 -2
- package/lib/esm/interfaces/AfterListen.js.map +0 -1
- package/lib/esm/interfaces/AfterRoutesInit.js +0 -2
- package/lib/esm/interfaces/AfterRoutesInit.js.map +0 -1
- package/lib/esm/interfaces/BeforeInit.js +0 -2
- package/lib/esm/interfaces/BeforeInit.js.map +0 -1
- package/lib/esm/interfaces/BeforeListen.js +0 -2
- package/lib/esm/interfaces/BeforeListen.js.map +0 -1
- package/lib/esm/interfaces/BeforeRoutesInit.js +0 -2
- package/lib/esm/interfaces/BeforeRoutesInit.js.map +0 -1
- package/lib/esm/interfaces/HandlerType.js +0 -14
- package/lib/esm/interfaces/HandlerType.js.map +0 -1
- package/lib/esm/interfaces/IncomingEvent.js +0 -2
- package/lib/esm/interfaces/IncomingEvent.js.map +0 -1
- package/lib/esm/interfaces/OnReady.js +0 -2
- package/lib/esm/interfaces/OnReady.js.map +0 -1
- package/lib/esm/interfaces/OnRequest.js +0 -2
- package/lib/esm/interfaces/OnRequest.js.map +0 -1
- package/lib/esm/interfaces/OnResponse.js +0 -2
- package/lib/esm/interfaces/OnResponse.js.map +0 -1
- package/lib/esm/interfaces/OnRoutesInit.js +0 -2
- package/lib/esm/interfaces/OnRoutesInit.js.map +0 -1
- package/lib/esm/interfaces/PlatformRouteOptions.js +0 -2
- package/lib/esm/interfaces/PlatformRouteOptions.js.map +0 -1
- package/lib/esm/interfaces/ResponseErrorObject.js +0 -2
- package/lib/esm/interfaces/ResponseErrorObject.js.map +0 -1
- package/lib/esm/interfaces/Route.js +0 -2
- package/lib/esm/interfaces/Route.js.map +0 -1
- package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js +0 -36
- package/lib/esm/middlewares/PlatformAcceptMimesMiddleware.js.map +0 -1
- package/lib/esm/middlewares/PlatformMulterMiddleware.js +0 -66
- package/lib/esm/middlewares/PlatformMulterMiddleware.js.map +0 -1
- package/lib/esm/services/FakeAdapter.js +0 -2
- package/lib/esm/services/FakeAdapter.js.map +0 -1
- package/lib/esm/services/FakeResponse.js +0 -55
- package/lib/esm/services/FakeResponse.js.map +0 -1
- package/lib/esm/services/Platform.js +0 -73
- package/lib/esm/services/Platform.js.map +0 -1
- package/lib/esm/services/PlatformAdapter.js +0 -77
- package/lib/esm/services/PlatformAdapter.js.map +0 -1
- package/lib/esm/services/PlatformApplication.js +0 -41
- package/lib/esm/services/PlatformApplication.js.map +0 -1
- package/lib/esm/services/PlatformHandler.js +0 -130
- package/lib/esm/services/PlatformHandler.js.map +0 -1
- package/lib/esm/services/PlatformMiddlewaresChain.js +0 -57
- package/lib/esm/services/PlatformMiddlewaresChain.js.map +0 -1
- package/lib/esm/services/PlatformRequest.js +0 -141
- package/lib/esm/services/PlatformRequest.js.map +0 -1
- package/lib/esm/services/PlatformResponse.js +0 -306
- package/lib/esm/services/PlatformResponse.js.map +0 -1
- package/lib/esm/services/PlatformTest.js +0 -137
- package/lib/esm/services/PlatformTest.js.map +0 -1
- package/lib/esm/utils/closeServer.js +0 -4
- package/lib/esm/utils/closeServer.js.map +0 -1
- package/lib/esm/utils/createContext.js +0 -44
- package/lib/esm/utils/createContext.js.map +0 -1
- package/lib/esm/utils/createHttpServer.js +0 -13
- package/lib/esm/utils/createHttpServer.js.map +0 -1
- package/lib/esm/utils/createHttpsServer.js +0 -13
- package/lib/esm/utils/createHttpsServer.js.map +0 -1
- package/lib/esm/utils/createInjector.js +0 -41
- package/lib/esm/utils/createInjector.js.map +0 -1
- package/lib/esm/utils/createServer.js +0 -29
- package/lib/esm/utils/createServer.js.map +0 -1
- package/lib/esm/utils/ensureContext.js +0 -12
- package/lib/esm/utils/ensureContext.js.map +0 -1
- package/lib/esm/utils/getConfiguration.js +0 -32
- package/lib/esm/utils/getConfiguration.js.map +0 -1
- package/lib/esm/utils/getStaticsOptions.js +0 -17
- package/lib/esm/utils/getStaticsOptions.js.map +0 -1
- package/lib/esm/utils/listenServer.js +0 -10
- package/lib/esm/utils/listenServer.js.map +0 -1
- package/lib/esm/utils/mapReturnedResponse.js +0 -11
- package/lib/esm/utils/mapReturnedResponse.js.map +0 -1
- package/lib/esm/utils/printRoutes.js +0 -34
- package/lib/esm/utils/printRoutes.js.map +0 -1
- package/lib/esm/utils/registerPlatformAdapter.js +0 -7
- package/lib/esm/utils/registerPlatformAdapter.js.map +0 -1
- package/lib/esm/utils/setResponseHeaders.js +0 -25
- package/lib/esm/utils/setResponseHeaders.js.map +0 -1
- package/lib/types/builder/PlatformBuilder.d.ts +0 -100
- package/lib/types/config/interfaces/PlatformJsonMapperSettings.d.ts +0 -10
- package/lib/types/config/interfaces/PlatformMulterSettings.d.ts +0 -14
- package/lib/types/config/interfaces/PlatformRouterSettings.d.ts +0 -10
- package/lib/types/config/interfaces/PlatformStaticsSettings.d.ts +0 -17
- package/lib/types/config/services/PlatformConfiguration.d.ts +0 -67
- package/lib/types/constants/routerOptions.d.ts +0 -1
- package/lib/types/decorators/PlatformProvider.d.ts +0 -3
- package/lib/types/decorators/multer/multerFileSize.d.ts +0 -27
- package/lib/types/decorators/multer/multerOptions.d.ts +0 -42
- package/lib/types/decorators/multer/multipartFile.d.ts +0 -47
- package/lib/types/decorators/params/error.d.ts +0 -7
- package/lib/types/decorators/params/next.d.ts +0 -22
- package/lib/types/decorators/params/request.d.ts +0 -46
- package/lib/types/decorators/params/response.d.ts +0 -40
- package/lib/types/domain/AnyToPromiseWithCtx.d.ts +0 -10
- package/lib/types/domain/EndpointMetadata.d.ts +0 -1
- package/lib/types/domain/PlatformContext.d.ts +0 -80
- package/lib/types/domain/PlatformRouteDetails.d.ts +0 -7
- package/lib/types/exports.d.ts +0 -9
- package/lib/types/interfaces/AfterInit.d.ts +0 -3
- package/lib/types/interfaces/AfterListen.d.ts +0 -3
- package/lib/types/interfaces/AfterRoutesInit.d.ts +0 -3
- package/lib/types/interfaces/BeforeInit.d.ts +0 -3
- package/lib/types/interfaces/BeforeListen.d.ts +0 -3
- package/lib/types/interfaces/BeforeRoutesInit.d.ts +0 -3
- package/lib/types/interfaces/HandlerType.d.ts +0 -12
- package/lib/types/interfaces/IncomingEvent.d.ts +0 -6
- package/lib/types/interfaces/OnReady.d.ts +0 -3
- package/lib/types/interfaces/OnRequest.d.ts +0 -4
- package/lib/types/interfaces/OnResponse.d.ts +0 -4
- package/lib/types/interfaces/OnRoutesInit.d.ts +0 -3
- package/lib/types/interfaces/PlatformRouteOptions.d.ts +0 -15
- package/lib/types/interfaces/ResponseErrorObject.d.ts +0 -8
- package/lib/types/interfaces/Route.d.ts +0 -10
- package/lib/types/middlewares/PlatformAcceptMimesMiddleware.d.ts +0 -10
- package/lib/types/middlewares/PlatformMulterMiddleware.d.ts +0 -24
- package/lib/types/services/FakeAdapter.d.ts +0 -1
- package/lib/types/services/FakeResponse.d.ts +0 -22
- package/lib/types/services/Platform.d.ts +0 -25
- package/lib/types/services/PlatformAdapter.d.ts +0 -89
- package/lib/types/services/PlatformApplication.d.ts +0 -29
- package/lib/types/services/PlatformHandler.d.ts +0 -39
- package/lib/types/services/PlatformMiddlewaresChain.d.ts +0 -17
- package/lib/types/services/PlatformRequest.d.ts +0 -111
- package/lib/types/services/PlatformResponse.d.ts +0 -175
- package/lib/types/services/PlatformTest.d.ts +0 -60
- package/lib/types/utils/closeServer.d.ts +0 -7
- package/lib/types/utils/createContext.d.ts +0 -10
- package/lib/types/utils/createHttpServer.d.ts +0 -4
- package/lib/types/utils/createHttpsServer.d.ts +0 -4
- package/lib/types/utils/createInjector.d.ts +0 -9
- package/lib/types/utils/createServer.d.ts +0 -17
- package/lib/types/utils/ensureContext.d.ts +0 -2
- package/lib/types/utils/getConfiguration.d.ts +0 -2
- package/lib/types/utils/getStaticsOptions.d.ts +0 -5
- package/lib/types/utils/listenServer.d.ts +0 -8
- package/lib/types/utils/mapReturnedResponse.d.ts +0 -4
- package/lib/types/utils/printRoutes.d.ts +0 -2
- package/lib/types/utils/registerPlatformAdapter.d.ts +0 -3
- package/lib/types/utils/setResponseHeaders.d.ts +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OnReady.js","sourceRoot":"","sources":["../../../src/interfaces/OnReady.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OnRequest.js","sourceRoot":"","sources":["../../../src/interfaces/OnRequest.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OnResponse.js","sourceRoot":"","sources":["../../../src/interfaces/OnResponse.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OnRoutesInit.js","sourceRoot":"","sources":["../../../src/interfaces/OnRoutesInit.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformRouteOptions.js","sourceRoot":"","sources":["../../../src/interfaces/PlatformRouteOptions.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseErrorObject.js","sourceRoot":"","sources":["../../../src/interfaces/ResponseErrorObject.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Route.js","sourceRoot":"","sources":["../../../src/interfaces/Route.ts"],"names":[],"mappings":""}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata, __param } from "tslib";
|
|
2
|
-
import { uniq } from "@tsed/core";
|
|
3
|
-
import { Constant } from "@tsed/di";
|
|
4
|
-
import { NotAcceptable } from "@tsed/exceptions";
|
|
5
|
-
import { Middleware } from "@tsed/platform-middlewares";
|
|
6
|
-
import { Context } from "@tsed/platform-params";
|
|
7
|
-
/**
|
|
8
|
-
* @middleware
|
|
9
|
-
* @platform
|
|
10
|
-
*/
|
|
11
|
-
let PlatformAcceptMimesMiddleware = class PlatformAcceptMimesMiddleware {
|
|
12
|
-
use(ctx) {
|
|
13
|
-
const { endpoint, request } = ctx;
|
|
14
|
-
const mimes = uniq((endpoint?.get("acceptMimes") || []).concat(this.acceptMimes));
|
|
15
|
-
if (mimes.length && !request.accepts(mimes)) {
|
|
16
|
-
throw new NotAcceptable(mimes.join(", "));
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
__decorate([
|
|
21
|
-
Constant("acceptMimes", []),
|
|
22
|
-
__metadata("design:type", Array)
|
|
23
|
-
], PlatformAcceptMimesMiddleware.prototype, "acceptMimes", void 0);
|
|
24
|
-
__decorate([
|
|
25
|
-
__param(0, Context()),
|
|
26
|
-
__metadata("design:type", Function),
|
|
27
|
-
__metadata("design:paramtypes", [Object]),
|
|
28
|
-
__metadata("design:returntype", void 0)
|
|
29
|
-
], PlatformAcceptMimesMiddleware.prototype, "use", null);
|
|
30
|
-
PlatformAcceptMimesMiddleware = __decorate([
|
|
31
|
-
Middleware({
|
|
32
|
-
priority: -10
|
|
33
|
-
})
|
|
34
|
-
], PlatformAcceptMimesMiddleware);
|
|
35
|
-
export { PlatformAcceptMimesMiddleware };
|
|
36
|
-
//# sourceMappingURL=PlatformAcceptMimesMiddleware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAII,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IAIjC,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,CAAC;YAC5C,MAAM,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;CACF,CAAA;AAVC;IADC,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC;;kEACN;AAEf;IAAK,WAAA,OAAO,EAAE,CAAA;;;;wDAOpB;AAXU,6BAA6B;IAHzC,UAAU,CAAC;QACV,QAAQ,EAAE,CAAC,EAAE;KACd,CAAC;GACW,6BAA6B,CAYzC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
var PlatformMulterMiddleware_1;
|
|
2
|
-
import { __decorate, __metadata, __param } from "tslib";
|
|
3
|
-
import { Inject, Value } from "@tsed/di";
|
|
4
|
-
import { BadRequest } from "@tsed/exceptions";
|
|
5
|
-
import { Middleware } from "@tsed/platform-middlewares";
|
|
6
|
-
import { Context } from "@tsed/platform-params";
|
|
7
|
-
import { PlatformContext } from "../domain/PlatformContext.js";
|
|
8
|
-
import { PlatformApplication } from "../services/PlatformApplication.js";
|
|
9
|
-
export class MulterException extends BadRequest {
|
|
10
|
-
constructor(er) {
|
|
11
|
-
super(er.message);
|
|
12
|
-
this.origin = er;
|
|
13
|
-
this.name = er.code;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* @middleware
|
|
18
|
-
*/
|
|
19
|
-
let PlatformMulterMiddleware = PlatformMulterMiddleware_1 = class PlatformMulterMiddleware {
|
|
20
|
-
async use(ctx) {
|
|
21
|
-
try {
|
|
22
|
-
const { fields, options = {} } = ctx.endpoint.get(PlatformMulterMiddleware_1);
|
|
23
|
-
const settings = {
|
|
24
|
-
...this.settings,
|
|
25
|
-
...options
|
|
26
|
-
};
|
|
27
|
-
/* istanbul ignore next */
|
|
28
|
-
if (settings.storage) {
|
|
29
|
-
delete settings.dest;
|
|
30
|
-
}
|
|
31
|
-
const middleware = this.app.multer(settings).fields(this.getFields({ fields }));
|
|
32
|
-
return await middleware(ctx.getRequest(), ctx.getResponse());
|
|
33
|
-
}
|
|
34
|
-
catch (er) {
|
|
35
|
-
if (er.code) {
|
|
36
|
-
throw new MulterException(er);
|
|
37
|
-
}
|
|
38
|
-
throw er;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
getFields(conf) {
|
|
42
|
-
return conf.fields.map(({ name, maxCount }) => ({ name, maxCount }));
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
__decorate([
|
|
46
|
-
Value("multer", {}) // NOTE: don't use constant to getting multer configuration. See issue #1840
|
|
47
|
-
,
|
|
48
|
-
__metadata("design:type", Object)
|
|
49
|
-
], PlatformMulterMiddleware.prototype, "settings", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
Inject(),
|
|
52
|
-
__metadata("design:type", PlatformApplication)
|
|
53
|
-
], PlatformMulterMiddleware.prototype, "app", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
__param(0, Context()),
|
|
56
|
-
__metadata("design:type", Function),
|
|
57
|
-
__metadata("design:paramtypes", [PlatformContext]),
|
|
58
|
-
__metadata("design:returntype", Promise)
|
|
59
|
-
], PlatformMulterMiddleware.prototype, "use", null);
|
|
60
|
-
PlatformMulterMiddleware = PlatformMulterMiddleware_1 = __decorate([
|
|
61
|
-
Middleware({
|
|
62
|
-
priority: 10
|
|
63
|
-
})
|
|
64
|
-
], PlatformMulterMiddleware);
|
|
65
|
-
export { PlatformMulterMiddleware };
|
|
66
|
-
//# sourceMappingURL=PlatformMulterMiddleware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAI9C,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,mBAAmB,EAAC,MAAM,oCAAoC,CAAC;AAMvE,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;AAII,IAAM,wBAAwB,gCAA9B,MAAM,wBAAwB;IAO7B,AAAN,KAAK,CAAC,GAAG,CAAY,GAAoB;QACvC,IAAI,CA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CAmCpC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FakeAdapter.js","sourceRoot":"","sources":["../../../src/services/FakeAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "node:events";
|
|
2
|
-
export class FakeResponse extends EventEmitter {
|
|
3
|
-
constructor(opts = {}) {
|
|
4
|
-
super();
|
|
5
|
-
this.headers = {};
|
|
6
|
-
this.locals = {};
|
|
7
|
-
this.statusCode = 200;
|
|
8
|
-
Object.assign(this, opts);
|
|
9
|
-
}
|
|
10
|
-
status(code) {
|
|
11
|
-
this.statusCode = code;
|
|
12
|
-
return this;
|
|
13
|
-
}
|
|
14
|
-
contentType(content) {
|
|
15
|
-
this.set("content-type", content);
|
|
16
|
-
}
|
|
17
|
-
contentLength(content) {
|
|
18
|
-
this.set("content-length", content);
|
|
19
|
-
}
|
|
20
|
-
redirect(status, path) {
|
|
21
|
-
this.statusCode = status;
|
|
22
|
-
this.set("location", path);
|
|
23
|
-
}
|
|
24
|
-
location(path) {
|
|
25
|
-
this.set("location", path);
|
|
26
|
-
}
|
|
27
|
-
get(key) {
|
|
28
|
-
return this.headers[key.toLowerCase()];
|
|
29
|
-
}
|
|
30
|
-
getHeaders() {
|
|
31
|
-
return this.headers;
|
|
32
|
-
}
|
|
33
|
-
set(key, value) {
|
|
34
|
-
this.headers[key.toLowerCase()] = value;
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
setHeader(key, value) {
|
|
38
|
-
this.headers[key.toLowerCase()] = value;
|
|
39
|
-
return this;
|
|
40
|
-
}
|
|
41
|
-
send(data) {
|
|
42
|
-
this.data = data;
|
|
43
|
-
}
|
|
44
|
-
json(data) {
|
|
45
|
-
this.data = data;
|
|
46
|
-
}
|
|
47
|
-
write(chunk) {
|
|
48
|
-
this.emit("data", chunk);
|
|
49
|
-
}
|
|
50
|
-
end(data) {
|
|
51
|
-
data !== undefined && (this.data = data);
|
|
52
|
-
this.emit("end");
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=FakeResponse.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FakeResponse.js","sourceRoot":"","sources":["../../../src/services/FakeResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAEzC,MAAM,OAAO,YAAa,SAAQ,YAAY;IAM5C,YAAY,IAAI,GAAG,EAAE;QACnB,KAAK,EAAE,CAAC;QANV,YAAO,GAA4B,EAAE,CAAC;QACtC,WAAM,GAA4B,EAAE,CAAC;QACrC,eAAU,GAAW,GAAG,CAAC;QAMvB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,WAAW,CAAC,OAAe;QACzB,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,aAAa,CAAC,OAAe;QAC3B,IAAI,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAED,QAAQ,CAAC,MAAc,EAAE,IAAY;QACnC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,GAAG,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,GAAG,CAAC,GAAW,EAAE,KAAU;QACzB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,KAAK,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,GAAW,EAAE,KAAU;QAC/B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,KAAK,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,IAAS;QACZ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,IAAI,CAAC,IAAS;QACZ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,KAAU;QACd,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,GAAG,CAAC,IAAS;QACX,IAAI,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;QAEzC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Injectable, InjectorService, ProviderScope } from "@tsed/di";
|
|
3
|
-
import { PlatformRouters } from "@tsed/platform-router";
|
|
4
|
-
import { PlatformApplication } from "./PlatformApplication.js";
|
|
5
|
-
import { PlatformHandler } from "./PlatformHandler.js";
|
|
6
|
-
/**
|
|
7
|
-
* `Platform` is used to provide all routes collected by annotation `@Controller`.
|
|
8
|
-
*
|
|
9
|
-
* @platform
|
|
10
|
-
*/
|
|
11
|
-
let Platform = class Platform {
|
|
12
|
-
#layers;
|
|
13
|
-
constructor(injector, platformApplication, platformRouters) {
|
|
14
|
-
this.injector = injector;
|
|
15
|
-
this.platformApplication = platformApplication;
|
|
16
|
-
this.platformRouters = platformRouters;
|
|
17
|
-
platformRouters.prebuild();
|
|
18
|
-
}
|
|
19
|
-
get app() {
|
|
20
|
-
return this.platformApplication;
|
|
21
|
-
}
|
|
22
|
-
addRoutes(routes) {
|
|
23
|
-
routes.forEach((routeSettings) => {
|
|
24
|
-
this.addRoute(routeSettings.route, routeSettings.token);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
addRoute(route, token) {
|
|
28
|
-
const provider = this.injector.getProvider(token);
|
|
29
|
-
if (!provider || provider.hasParent()) {
|
|
30
|
-
return this;
|
|
31
|
-
}
|
|
32
|
-
const router = this.platformRouters.from(provider.token);
|
|
33
|
-
this.app.use(route, router);
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
getLayers() {
|
|
37
|
-
this.#layers = this.#layers || this.platformRouters.getLayers(this.app);
|
|
38
|
-
return this.#layers;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Get all controllers mounted on the application.
|
|
42
|
-
* @returns {RouteController[]}
|
|
43
|
-
*/
|
|
44
|
-
getMountedControllers() {
|
|
45
|
-
const controllers = this.getLayers().reduce((controllers, layer) => {
|
|
46
|
-
if (layer.isProvider()) {
|
|
47
|
-
const route = String(layer.getBasePath());
|
|
48
|
-
const key = `${layer.provider.toString()}:${route}`;
|
|
49
|
-
if (!controllers.has(key)) {
|
|
50
|
-
controllers.set(key, {
|
|
51
|
-
route,
|
|
52
|
-
routes: new Set(),
|
|
53
|
-
provider: layer.provider
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
controllers.get(key).routes.add(String(layer.path));
|
|
57
|
-
}
|
|
58
|
-
return controllers;
|
|
59
|
-
}, new Map());
|
|
60
|
-
return [...controllers.values()];
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
Platform = __decorate([
|
|
64
|
-
Injectable({
|
|
65
|
-
scope: ProviderScope.SINGLETON,
|
|
66
|
-
imports: [PlatformHandler]
|
|
67
|
-
}),
|
|
68
|
-
__metadata("design:paramtypes", [InjectorService,
|
|
69
|
-
PlatformApplication,
|
|
70
|
-
PlatformRouters])
|
|
71
|
-
], Platform);
|
|
72
|
-
export { Platform };
|
|
73
|
-
//# sourceMappingURL=Platform.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Platform.js","sourceRoot":"","sources":["../../../src/services/Platform.ts"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAE,eAAe,EAAE,aAAa,EAAgB,MAAM,UAAU,CAAC;AACvG,OAAO,EAAgB,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAGrE,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAErD;;;;GAIG;AAKI,IAAM,QAAQ,GAAd,MAAM,QAAQ;IACnB,OAAO,CAAkB;IAEzB,YACW,QAAyB,EACzB,mBAAwC,EACxC,eAAgC;QAFhC,aAAQ,GAAR,QAAQ,CAAiB;QACzB,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,oBAAe,GAAf,eAAe,CAAiB;QAEzC,eAAe,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAEM,SAAS,CAAC,MAAe;QAC9B,MAAM,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;YAC/B,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,QAAQ,CAAC,KAAa,EAAE,KAAoB;QACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAuB,CAAC;QAExE,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC;YACtC,OAAO,IAAI,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AC,CAAC;IACnC,CAAC;CACF,CAAA;AAnEY,QAAQ;IAJpB,UAAU,CAAC;QACV,KAAK,EAAE,aAAa,CAAC,SAAS;QAC9B,OAAO,EAAE,CAAC,eAAe,CAAC;KAC3B,CAAC;qCAKqB,eAAe;QACJ,mBAAmB;QACvB,eAAe;GANhC,QAAQ,CAmEpB"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { InjectorService, registerProvider } from "@tsed/di";
|
|
2
|
-
import { createHttpServer } from "../utils/createHttpServer.js";
|
|
3
|
-
import { createHttpsServer } from "../utils/createHttpsServer.js";
|
|
4
|
-
export class PlatformAdapter {
|
|
5
|
-
constructor(injector) {
|
|
6
|
-
this.injector = injector;
|
|
7
|
-
}
|
|
8
|
-
get app() {
|
|
9
|
-
return this.injector.get("PlatformApplication");
|
|
10
|
-
}
|
|
11
|
-
getServers() {
|
|
12
|
-
return [createHttpServer(this.injector, this.app.callback()), createHttpsServer(this.injector, this.app.callback())].filter(Boolean);
|
|
13
|
-
}
|
|
14
|
-
onInit() {
|
|
15
|
-
return Promise.resolve();
|
|
16
|
-
}
|
|
17
|
-
beforeLoadRoutes() {
|
|
18
|
-
return Promise.resolve();
|
|
19
|
-
}
|
|
20
|
-
afterLoadRoutes() {
|
|
21
|
-
return Promise.resolve();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export class FakeAdapter extends PlatformAdapter {
|
|
25
|
-
constructor() {
|
|
26
|
-
super(...arguments);
|
|
27
|
-
this.providers = [];
|
|
28
|
-
}
|
|
29
|
-
static { this.NAME = "FAKE_ADAPTER"; }
|
|
30
|
-
static createFakeRawDriver() {
|
|
31
|
-
// istanbul ignore next
|
|
32
|
-
function FakeRawDriver() { }
|
|
33
|
-
// istanbul ignore next
|
|
34
|
-
function use() {
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
FakeRawDriver.use = use;
|
|
38
|
-
FakeRawDriver.all = use;
|
|
39
|
-
FakeRawDriver.get = use;
|
|
40
|
-
FakeRawDriver.patch = use;
|
|
41
|
-
FakeRawDriver.post = use;
|
|
42
|
-
FakeRawDriver.put = use;
|
|
43
|
-
FakeRawDriver.head = use;
|
|
44
|
-
FakeRawDriver.delete = use;
|
|
45
|
-
FakeRawDriver.options = use;
|
|
46
|
-
return FakeRawDriver;
|
|
47
|
-
}
|
|
48
|
-
createApp() {
|
|
49
|
-
const app = FakeAdapter.createFakeRawDriver();
|
|
50
|
-
return {
|
|
51
|
-
app,
|
|
52
|
-
callback() {
|
|
53
|
-
return app;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
multipart(options) {
|
|
58
|
-
return {};
|
|
59
|
-
}
|
|
60
|
-
statics(endpoint, options) {
|
|
61
|
-
return {};
|
|
62
|
-
}
|
|
63
|
-
bodyParser(type) {
|
|
64
|
-
return () => { };
|
|
65
|
-
}
|
|
66
|
-
mapLayers(layers) { }
|
|
67
|
-
mapHandler(handler) {
|
|
68
|
-
return handler;
|
|
69
|
-
}
|
|
70
|
-
useContext() { }
|
|
71
|
-
}
|
|
72
|
-
registerProvider({
|
|
73
|
-
provide: PlatformAdapter,
|
|
74
|
-
deps: [InjectorService],
|
|
75
|
-
useClass: FakeAdapter
|
|
76
|
-
});
|
|
77
|
-
//# sourceMappingURL=PlatformAdapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformAdapter.js","sourceRoot":"","sources":["../../../src/services/PlatformAdapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,eAAe,EAAgB,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAOzE,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AAIhE,MAAM,OAAgB,eAAe;IAOnC,YAAsB,QAAyB;QAAzB,aAAQ,GAAR,QAAQ,CAAiB;IAAG,CAAC;IAEnD,IAAI,GAAG;QACL,OAAO,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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;;AAGjB,gBAAgB,CAAC;IACf,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,CAAC,eAAe,CAAC;IACvB,QAAQ,EAAE,WAAW;CACtB,CAAC,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Injectable, InjectorService, ProviderScope } from "@tsed/di";
|
|
3
|
-
import { PlatformRouter } from "@tsed/platform-router";
|
|
4
|
-
import { PlatformAdapter } from "./PlatformAdapter.js";
|
|
5
|
-
/**
|
|
6
|
-
* `PlatformApplication` is used to provide all routes collected by annotation `@Controller`.
|
|
7
|
-
*
|
|
8
|
-
* @platform
|
|
9
|
-
*/
|
|
10
|
-
let PlatformApplication = class PlatformApplication extends PlatformRouter {
|
|
11
|
-
constructor(adapter, injector) {
|
|
12
|
-
super(injector);
|
|
13
|
-
this.adapter = adapter;
|
|
14
|
-
this.injector = injector;
|
|
15
|
-
const { app, callback } = adapter.createApp();
|
|
16
|
-
this.rawApp = app;
|
|
17
|
-
this.rawCallback = callback;
|
|
18
|
-
}
|
|
19
|
-
getApp() {
|
|
20
|
-
return this.rawApp;
|
|
21
|
-
}
|
|
22
|
-
multer(options) {
|
|
23
|
-
return this.adapter.multipart(options);
|
|
24
|
-
}
|
|
25
|
-
callback(req, res) {
|
|
26
|
-
if (req && res) {
|
|
27
|
-
return this.callback()(req, res);
|
|
28
|
-
}
|
|
29
|
-
return this.rawCallback();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
PlatformApplication = __decorate([
|
|
33
|
-
Injectable({
|
|
34
|
-
scope: ProviderScope.SINGLETON,
|
|
35
|
-
alias: "PlatformApplication"
|
|
36
|
-
}),
|
|
37
|
-
__metadata("design:paramtypes", [PlatformAdapter,
|
|
38
|
-
InjectorService])
|
|
39
|
-
], PlatformApplication);
|
|
40
|
-
export { PlatformApplication };
|
|
41
|
-
//# sourceMappingURL=PlatformApplication.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformApplication.js","sourceRoot":"","sources":["../../../src/services/PlatformApplication.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAE,eAAe,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC;AACpE,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAIrD,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AASrD;;;;GAIG;AAKI,IAAM,mBAAmB,GAAzB,MAAM,mBAA4C,SAAQ,cAAc;IAI7E,YACS,OAA6B,EAC7B,QAAyB;QAEhC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAHT,YAAO,GAAP,OAAO,CAAsB;QAC7B,aAAQ,GAAR,QAAQ,CAAiB;QAGhC,MAAM,EAAC,GAAG,EAAE,QAAQ,EAAC,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;QAE5C,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC;IAC9B,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,OAA+B;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAID,QAAQ,CAAC,GAAqB,EAAE,GAAoB;QAClD,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACnC,CAAC;QAED,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC;CACF,CAAA;AAhCY,mBAAmB;IAJ/B,UAAU,CAAC;QACV,KAAK,EAAE,aAAa,CAAC,SAAS;QAC9B,KAAK,EAAE,qBAAqB;KAC7B,CAAC;qCAMkB,eAAe;QACd,eAAe;GANvB,mBAAmB,CAgC/B"}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { AnyToPromiseStatus, catchAsyncError } from "@tsed/core";
|
|
3
|
-
import { Inject, Injectable, ProviderScope } from "@tsed/di";
|
|
4
|
-
import { PlatformExceptions } from "@tsed/platform-exceptions";
|
|
5
|
-
import { PlatformParams } from "@tsed/platform-params";
|
|
6
|
-
import { PlatformResponseFilter } from "@tsed/platform-response-filter";
|
|
7
|
-
import { PlatformHandlerMetadata, PlatformHandlerType, PlatformRouters, useResponseHandler } from "@tsed/platform-router";
|
|
8
|
-
import { AnyToPromiseWithCtx } from "../domain/AnyToPromiseWithCtx.js";
|
|
9
|
-
import { setResponseHeaders } from "../utils/setResponseHeaders.js";
|
|
10
|
-
import { PlatformApplication } from "./PlatformApplication.js";
|
|
11
|
-
import { PlatformMiddlewaresChain } from "./PlatformMiddlewaresChain.js";
|
|
12
|
-
/**
|
|
13
|
-
* Platform Handler abstraction layer. Wrap original class method to a pure platform handler (Express, Koa, etc...).
|
|
14
|
-
* @platform
|
|
15
|
-
*/
|
|
16
|
-
let PlatformHandler = class PlatformHandler {
|
|
17
|
-
constructor(platformRouters) {
|
|
18
|
-
this.platformRouters = platformRouters;
|
|
19
|
-
// configure the router module
|
|
20
|
-
platformRouters.hooks
|
|
21
|
-
.on("alterEndpointHandlers", (handlers, operationRoute) => {
|
|
22
|
-
handlers = this.platformMiddlewaresChain.get(handlers, operationRoute);
|
|
23
|
-
handlers.after.push(useResponseHandler(this.flush.bind(this)));
|
|
24
|
-
return handlers;
|
|
25
|
-
})
|
|
26
|
-
.on("alterHandler", (handlerMetadata) => {
|
|
27
|
-
const handler = handlerMetadata.isInjectable() ? this.createHandler(handlerMetadata) : handlerMetadata.handler;
|
|
28
|
-
return this.platformApplication.adapter.mapHandler(handler, handlerMetadata);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
createHandler(handlerMetadata) {
|
|
32
|
-
const handler = this.platformParams.compileHandler(handlerMetadata);
|
|
33
|
-
return ($ctx) => {
|
|
34
|
-
$ctx.handlerMetadata = handlerMetadata;
|
|
35
|
-
return this.onRequest(handler, $ctx);
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @param provider
|
|
40
|
-
* @param propertyKey
|
|
41
|
-
*/
|
|
42
|
-
createCustomHandler(provider, propertyKey) {
|
|
43
|
-
const metadata = new PlatformHandlerMetadata({
|
|
44
|
-
provider,
|
|
45
|
-
type: PlatformHandlerType.CUSTOM,
|
|
46
|
-
propertyKey
|
|
47
|
-
});
|
|
48
|
-
return this.createHandler(metadata);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Call handler when a request his handle
|
|
52
|
-
*/
|
|
53
|
-
async onRequest(handler, $ctx) {
|
|
54
|
-
const { handlerMetadata } = $ctx;
|
|
55
|
-
if (handlerMetadata.type === PlatformHandlerType.CTX_FN) {
|
|
56
|
-
return handler({ $ctx });
|
|
57
|
-
}
|
|
58
|
-
const resolver = new AnyToPromiseWithCtx($ctx);
|
|
59
|
-
const response = await resolver.call(handler);
|
|
60
|
-
// Note: restore previous handler metadata (for OIDC)
|
|
61
|
-
$ctx.handlerMetadata = handlerMetadata;
|
|
62
|
-
if (response.state === AnyToPromiseStatus.RESOLVED && !$ctx.isDone()) {
|
|
63
|
-
return this.onResponse(response, $ctx);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
onResponse({ status, data, headers }, $ctx) {
|
|
67
|
-
if (status) {
|
|
68
|
-
$ctx.response.status(status);
|
|
69
|
-
}
|
|
70
|
-
if (headers) {
|
|
71
|
-
$ctx.response.setHeaders(headers);
|
|
72
|
-
}
|
|
73
|
-
if (data !== undefined) {
|
|
74
|
-
$ctx.data = data;
|
|
75
|
-
}
|
|
76
|
-
$ctx.error = null;
|
|
77
|
-
// set headers each times that an endpoint is called
|
|
78
|
-
if ($ctx.handlerMetadata.isEndpoint()) {
|
|
79
|
-
setResponseHeaders($ctx);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Send the response to the consumer.
|
|
84
|
-
* @protected
|
|
85
|
-
* @param $ctx
|
|
86
|
-
*/
|
|
87
|
-
async flush($ctx) {
|
|
88
|
-
if (!$ctx.error) {
|
|
89
|
-
$ctx.error = await catchAsyncError(async () => {
|
|
90
|
-
const { response } = $ctx;
|
|
91
|
-
if (!$ctx.isDone()) {
|
|
92
|
-
let data = await this.responseFilter.serialize($ctx.data, $ctx);
|
|
93
|
-
data = await this.responseFilter.transform(data, $ctx);
|
|
94
|
-
response.body(data);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
if ($ctx.error) {
|
|
99
|
-
this.platformExceptions.catch($ctx.error, $ctx);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
__decorate([
|
|
104
|
-
Inject(),
|
|
105
|
-
__metadata("design:type", PlatformResponseFilter)
|
|
106
|
-
], PlatformHandler.prototype, "responseFilter", void 0);
|
|
107
|
-
__decorate([
|
|
108
|
-
Inject(),
|
|
109
|
-
__metadata("design:type", PlatformParams)
|
|
110
|
-
], PlatformHandler.prototype, "platformParams", void 0);
|
|
111
|
-
__decorate([
|
|
112
|
-
Inject(),
|
|
113
|
-
__metadata("design:type", PlatformExceptions)
|
|
114
|
-
], PlatformHandler.prototype, "platformExceptions", void 0);
|
|
115
|
-
__decorate([
|
|
116
|
-
Inject(),
|
|
117
|
-
__metadata("design:type", PlatformApplication)
|
|
118
|
-
], PlatformHandler.prototype, "platformApplication", void 0);
|
|
119
|
-
__decorate([
|
|
120
|
-
Inject(),
|
|
121
|
-
__metadata("design:type", PlatformMiddlewaresChain)
|
|
122
|
-
], PlatformHandler.prototype, "platformMiddlewaresChain", void 0);
|
|
123
|
-
PlatformHandler = __decorate([
|
|
124
|
-
Injectable({
|
|
125
|
-
scope: ProviderScope.SINGLETON
|
|
126
|
-
}),
|
|
127
|
-
__metadata("design:paramtypes", [PlatformRouters])
|
|
128
|
-
], PlatformHandler);
|
|
129
|
-
export { PlatformHandler };
|
|
130
|
-
//# sourceMappingURL=PlatformHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformHandler.js","sourceRoot":"","sources":["../../../src/services/PlatformHandler.ts"],"names":[],"mappings":";AAAA,OAAO,EAAmB,kBAAkB,EAAE,eAAe,EAAC,MAAM,YAAY,CAAC;AACjF,OAAO,EAAC,MAAM,EAAE,UAAU,EAAY,aAAa,EAAC,MAAM,UAAU,CAAC;AACrE,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAC,cAAc,EAAyB,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAC,sBAAsB,EAAC,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAEL,uBAAuB,EACvB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AAC7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1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { isClass } from "@tsed/core";
|
|
3
|
-
import { Constant, Inject, Injectable, InjectorService } from "@tsed/di";
|
|
4
|
-
import { ParamTypes } from "@tsed/platform-params";
|
|
5
|
-
import { JsonEntityStore } from "@tsed/schema";
|
|
6
|
-
import { PlatformAcceptMimesMiddleware } from "../middlewares/PlatformAcceptMimesMiddleware.js";
|
|
7
|
-
import { PlatformMulterMiddleware } from "../middlewares/PlatformMulterMiddleware.js";
|
|
8
|
-
import { PlatformAdapter } from "../services/PlatformAdapter.js";
|
|
9
|
-
let PlatformMiddlewaresChain = class PlatformMiddlewaresChain {
|
|
10
|
-
get(handlers, operationRoute) {
|
|
11
|
-
const { ACCEPT_MIMES, FILE } = this.getParamTypes(handlers, operationRoute);
|
|
12
|
-
return {
|
|
13
|
-
...handlers,
|
|
14
|
-
before: [ACCEPT_MIMES && PlatformAcceptMimesMiddleware, ...handlers.before, FILE && PlatformMulterMiddleware].filter(Boolean)
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
hasAcceptMimes(operationRoute) {
|
|
18
|
-
return operationRoute.endpoint.acceptMimes.length || this.acceptMimes.length;
|
|
19
|
-
}
|
|
20
|
-
getParamTypes(middlewares, operationRoute) {
|
|
21
|
-
return middlewares.before
|
|
22
|
-
.concat(middlewares.after)
|
|
23
|
-
.filter(isClass)
|
|
24
|
-
.reduce((paramTypes, token) => {
|
|
25
|
-
const entity = JsonEntityStore.fromMethod(token, "use");
|
|
26
|
-
if (entity.decoratorType === "method") {
|
|
27
|
-
const { FILE, RAW_BODY, BODY } = entity.getParamTypes();
|
|
28
|
-
paramTypes.FILE = paramTypes.FILE || FILE;
|
|
29
|
-
paramTypes.RAW_BODY = paramTypes.RAW_BODY || RAW_BODY;
|
|
30
|
-
paramTypes.BODY = paramTypes.BODY || BODY;
|
|
31
|
-
}
|
|
32
|
-
return paramTypes;
|
|
33
|
-
}, {
|
|
34
|
-
ACCEPT_MIMES: this.hasAcceptMimes(operationRoute),
|
|
35
|
-
FILE: operationRoute.has(ParamTypes.FILES),
|
|
36
|
-
RAW_BODY: operationRoute.has(ParamTypes.RAW_BODY),
|
|
37
|
-
BODY: operationRoute.has(ParamTypes.BODY) || operationRoute.method === "ALL"
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
__decorate([
|
|
42
|
-
Constant("acceptMimes", []),
|
|
43
|
-
__metadata("design:type", Array)
|
|
44
|
-
], PlatformMiddlewaresChain.prototype, "acceptMimes", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
Inject(PlatformAdapter),
|
|
47
|
-
__metadata("design:type", PlatformAdapter)
|
|
48
|
-
], PlatformMiddlewaresChain.prototype, "adapter", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
Inject(InjectorService),
|
|
51
|
-
__metadata("design:type", InjectorService)
|
|
52
|
-
], PlatformMiddlewaresChain.prototype, "injector", void 0);
|
|
53
|
-
PlatformMiddlewaresChain = __decorate([
|
|
54
|
-
Injectable()
|
|
55
|
-
], PlatformMiddlewaresChain);
|
|
56
|
-
export { PlatformMiddlewaresChain };
|
|
57
|
-
//# sourceMappingURL=PlatformMiddlewaresChain.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformMiddlewaresChain.js","sourceRoot":"","sources":["../../../src/services/PlatformMiddlewaresChain.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAgB,MAAM,UAAU,CAAC;AACtF,OAAO,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAC,eAAe,EAAqB,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAC,6BAA6B,EAAC,MAAM,iDAAiD,CAAC;AAC9F,OAAO,EAAC,wBAAwB,EAAC,MAAM,4CAA4C,CAAC;A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