@tsed/platform-express 8.6.1 → 8.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@tsed/platform-multer/express";
|
|
2
2
|
import { catchAsyncError, Env, isFunction } from "@tsed/core";
|
|
3
3
|
import { constant, inject, logger, runInContext } from "@tsed/di";
|
|
4
4
|
import { PlatformExceptions } from "@tsed/platform-exceptions";
|
|
@@ -17,11 +17,9 @@ function callNext(next, metadata, $ctx) {
|
|
|
17
17
|
* @express
|
|
18
18
|
*/
|
|
19
19
|
export class PlatformExpress extends PlatformAdapter {
|
|
20
|
-
#multer;
|
|
21
20
|
constructor() {
|
|
22
|
-
super();
|
|
21
|
+
super(...arguments);
|
|
23
22
|
this.NAME = "express";
|
|
24
|
-
import("multer").then(({ default: multer }) => (this.#multer = multer));
|
|
25
23
|
}
|
|
26
24
|
/**
|
|
27
25
|
* Create new serverless application. In this mode, the component scan are disabled.
|
|
@@ -115,25 +113,6 @@ export class PlatformExpress extends PlatformAdapter {
|
|
|
115
113
|
callback: () => app
|
|
116
114
|
};
|
|
117
115
|
}
|
|
118
|
-
multipart(options) {
|
|
119
|
-
const m = this.#multer(options);
|
|
120
|
-
const makePromise = (multer, name) => {
|
|
121
|
-
// istanbul ignore next
|
|
122
|
-
if (!multer[name])
|
|
123
|
-
return;
|
|
124
|
-
const fn = multer[name];
|
|
125
|
-
multer[name] = function apply(...args) {
|
|
126
|
-
const middleware = Reflect.apply(fn, this, args);
|
|
127
|
-
return (req, res) => promisify(middleware)(req, res);
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
makePromise(m, "any");
|
|
131
|
-
makePromise(m, "array");
|
|
132
|
-
makePromise(m, "fields");
|
|
133
|
-
makePromise(m, "none");
|
|
134
|
-
makePromise(m, "single");
|
|
135
|
-
return m;
|
|
136
|
-
}
|
|
137
116
|
statics(endpoint, options) {
|
|
138
117
|
const { root, ...props } = options;
|
|
139
118
|
return staticsMiddleware(root, props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformExpress.js","sourceRoot":"","sources":["../../../src/components/PlatformExpress.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlatformExpress.js","sourceRoot":"","sources":["../../../src/components/PlatformExpress.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAIvC,OAAO,EAAC,eAAe,EAAE,GAAG,EAAE,UAAU,EAAO,MAAM,YAAY,CAAC;AAClE,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAC,MAAM,UAAU,CAAC;AAChE,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,OAAO,EACP,WAAW,EACX,aAAa,EAEb,eAAe,EAEf,eAAe,EAEf,eAAe,EAIhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAA0B,mBAAmB,EAAgB,MAAM,uBAAuB,CAAC;AAElG,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAC,iBAAiB,EAAC,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAC,sBAAsB,EAAC,MAAM,uCAAuC,CAAC;AAS7E,SAAS,QAAQ,CAAC,IAAS,EAAE,QAAiC,EAAE,IAAqB;IACnF,IAAI,QAAQ,CAAC,IAAI,KAAK,mBAAmB,CAAC,WAAW,EAAE,CAAC;QACtD,OAAO,IAAI,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1E,CAAC;AACH,CAAC;AAiBD;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,eAAoC;IAAzE;;QACW,SAAI,GAAG,SAAS,CAAC;IAoL5B,CAAC;IA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AM,CAAC,aAAa,CAAE,CAAC;gBAC7C,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;gBAE7B,aAAa,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,EAAC,SAAS,EAAE,MAAM,EAAC,EAAE,EAAE;oBACzD,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC3C,CAAC,CAAC,CAAC;gBAEH,aAAa,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;gBACjF,aAAa,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,uBAAuB;YACvB,MAAM,EAAE,CAAC,IAAI,CAAC;gBACZ,KAAK,EAAE,sBAAsB;gBAC7B,OAAO,EAAE,oEAAoE;gBAC7E,KAAK;aACN,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAED,OAAO,CAAC,eAAe,EAAE;IACvB;QACE,KAAK,EAAE,eAAe;QACtB,QAAQ,EAAE,sBAAsB;KACjC;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import "@tsed/platform-multer/express";
|
|
1
2
|
import { Type } from "@tsed/core";
|
|
2
|
-
import { PlatformAdapter, PlatformBuilder, PlatformContext,
|
|
3
|
+
import { PlatformAdapter, PlatformBuilder, PlatformContext, PlatformStaticsOptions } from "@tsed/platform-http";
|
|
3
4
|
import { PlatformHandlerMetadata, PlatformLayer } from "@tsed/platform-router";
|
|
4
5
|
import Express from "express";
|
|
5
6
|
import { PlatformExpressStaticsOptions } from "../interfaces/PlatformExpressStaticsOptions.js";
|
|
@@ -26,9 +27,7 @@ declare global {
|
|
|
26
27
|
* @express
|
|
27
28
|
*/
|
|
28
29
|
export declare class PlatformExpress extends PlatformAdapter<Express.Application> {
|
|
29
|
-
#private;
|
|
30
30
|
readonly NAME = "express";
|
|
31
|
-
constructor();
|
|
32
31
|
/**
|
|
33
32
|
* Create new serverless application. In this mode, the component scan are disabled.
|
|
34
33
|
* @param module
|
|
@@ -50,7 +49,6 @@ export declare class PlatformExpress extends PlatformAdapter<Express.Application
|
|
|
50
49
|
app: Express.Express;
|
|
51
50
|
callback: () => Express.Express;
|
|
52
51
|
};
|
|
53
|
-
multipart(options: PlatformMulterSettings): PlatformMulter;
|
|
54
52
|
statics(endpoint: string, options: PlatformStaticsOptions): (request: any, response: any, next: any) => void;
|
|
55
53
|
bodyParser(type: "json" | "text" | "urlencoded", additionalOptions?: any): any;
|
|
56
54
|
private configureViewsEngine;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsed/platform-express",
|
|
3
3
|
"description": "A TypeScript Framework on top of Express",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.
|
|
5
|
+
"version": "8.7.0",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"start": "ts-node test/app/index.ts",
|
|
22
22
|
"start:emulate": "ts-node test/app/emulate.ts",
|
|
23
23
|
"test": "vitest run",
|
|
24
|
-
"build:ts": "tsc --build tsconfig.json",
|
|
24
|
+
"build:ts": "tsc --build tsconfig.esm.json",
|
|
25
25
|
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"tslib": "2.7.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@tsed/barrels": "8.
|
|
63
|
-
"@tsed/core": "8.
|
|
64
|
-
"@tsed/di": "8.
|
|
65
|
-
"@tsed/platform-http": "8.
|
|
66
|
-
"@tsed/platform-test-sdk": "8.
|
|
67
|
-
"@tsed/platform-views": "8.
|
|
68
|
-
"@tsed/typescript": "8.
|
|
62
|
+
"@tsed/barrels": "8.7.0",
|
|
63
|
+
"@tsed/core": "8.7.0",
|
|
64
|
+
"@tsed/di": "8.7.0",
|
|
65
|
+
"@tsed/platform-http": "8.7.0",
|
|
66
|
+
"@tsed/platform-test-sdk": "8.7.0",
|
|
67
|
+
"@tsed/platform-views": "8.7.0",
|
|
68
|
+
"@tsed/typescript": "8.7.0",
|
|
69
69
|
"@types/body-parser": "1.19.5",
|
|
70
70
|
"@types/compression": "1.7.5",
|
|
71
71
|
"@types/cookie-parser": "1.4.7",
|
|
@@ -82,17 +82,17 @@
|
|
|
82
82
|
"express-session": "1.18.1",
|
|
83
83
|
"method-override": "3.0.0",
|
|
84
84
|
"typescript": "5.4.5",
|
|
85
|
-
"vitest": "
|
|
85
|
+
"vitest": "3.0.9"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@tsed/core": ">=8.
|
|
89
|
-
"@tsed/di": ">=8.
|
|
90
|
-
"@tsed/json-mapper": ">=8.
|
|
88
|
+
"@tsed/core": ">=8.7.0",
|
|
89
|
+
"@tsed/di": ">=8.7.0",
|
|
90
|
+
"@tsed/json-mapper": ">=8.7.0",
|
|
91
91
|
"@tsed/logger": ">=7.0.1",
|
|
92
|
-
"@tsed/openspec": ">=8.
|
|
93
|
-
"@tsed/platform-http": ">=8.
|
|
94
|
-
"@tsed/platform-views": ">=8.
|
|
95
|
-
"@tsed/schema": ">=8.
|
|
92
|
+
"@tsed/openspec": ">=8.7.0",
|
|
93
|
+
"@tsed/platform-http": ">=8.7.0",
|
|
94
|
+
"@tsed/platform-views": ">=8.7.0",
|
|
95
|
+
"@tsed/schema": ">=8.7.0",
|
|
96
96
|
"@types/multer": "^1.4.5",
|
|
97
97
|
"body-parser": "^1.19.0",
|
|
98
98
|
"cross-env": "7.0.3",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import "@tsed/platform-multer/express";
|
|
2
|
+
|
|
1
3
|
import {IncomingMessage, ServerResponse} from "node:http";
|
|
2
|
-
import {promisify} from "node:util";
|
|
3
4
|
|
|
4
5
|
import {catchAsyncError, Env, isFunction, Type} from "@tsed/core";
|
|
5
6
|
import {constant, inject, logger, runInContext} from "@tsed/di";
|
|
@@ -14,8 +15,6 @@ import {
|
|
|
14
15
|
PlatformBuilder,
|
|
15
16
|
PlatformContext,
|
|
16
17
|
PlatformHandler,
|
|
17
|
-
PlatformMulter,
|
|
18
|
-
PlatformMulterSettings,
|
|
19
18
|
PlatformRequest,
|
|
20
19
|
PlatformResponse,
|
|
21
20
|
PlatformStaticsOptions
|
|
@@ -64,13 +63,6 @@ declare global {
|
|
|
64
63
|
export class PlatformExpress extends PlatformAdapter<Express.Application> {
|
|
65
64
|
readonly NAME = "express";
|
|
66
65
|
|
|
67
|
-
#multer: typeof multer;
|
|
68
|
-
|
|
69
|
-
constructor() {
|
|
70
|
-
super();
|
|
71
|
-
import("multer").then(({default: multer}) => (this.#multer = multer));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
66
|
/**
|
|
75
67
|
* Create new serverless application. In this mode, the component scan are disabled.
|
|
76
68
|
* @param module
|
|
@@ -79,7 +71,7 @@ export class PlatformExpress extends PlatformAdapter<Express.Application> {
|
|
|
79
71
|
static create(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {
|
|
80
72
|
return PlatformBuilder.create<Express.Application>(module, {
|
|
81
73
|
...settings,
|
|
82
|
-
adapter: PlatformExpress
|
|
74
|
+
adapter: PlatformExpress as any
|
|
83
75
|
});
|
|
84
76
|
}
|
|
85
77
|
|
|
@@ -91,7 +83,7 @@ export class PlatformExpress extends PlatformAdapter<Express.Application> {
|
|
|
91
83
|
static bootstrap(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {
|
|
92
84
|
return PlatformBuilder.bootstrap<Express.Application>(module, {
|
|
93
85
|
...settings,
|
|
94
|
-
adapter: PlatformExpress
|
|
86
|
+
adapter: PlatformExpress as any
|
|
95
87
|
});
|
|
96
88
|
}
|
|
97
89
|
|
|
@@ -188,30 +180,6 @@ export class PlatformExpress extends PlatformAdapter<Express.Application> {
|
|
|
188
180
|
};
|
|
189
181
|
}
|
|
190
182
|
|
|
191
|
-
multipart(options: PlatformMulterSettings): PlatformMulter {
|
|
192
|
-
const m = this.#multer(options);
|
|
193
|
-
const makePromise = (multer: any, name: string) => {
|
|
194
|
-
// istanbul ignore next
|
|
195
|
-
if (!multer[name]) return;
|
|
196
|
-
|
|
197
|
-
const fn = multer[name];
|
|
198
|
-
|
|
199
|
-
multer[name] = function apply(...args: any[]) {
|
|
200
|
-
const middleware: any = Reflect.apply(fn, this, args);
|
|
201
|
-
|
|
202
|
-
return (req: any, res: any) => promisify(middleware)(req, res);
|
|
203
|
-
};
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
makePromise(m, "any");
|
|
207
|
-
makePromise(m, "array");
|
|
208
|
-
makePromise(m, "fields");
|
|
209
|
-
makePromise(m, "none");
|
|
210
|
-
makePromise(m, "single");
|
|
211
|
-
|
|
212
|
-
return m;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
183
|
statics(endpoint: string, options: PlatformStaticsOptions) {
|
|
216
184
|
const {root, ...props} = options;
|
|
217
185
|
|
package/vitest.config.mts
CHANGED