@tsed/platform-http 8.38.0-beta.3 → 8.38.0-beta.5
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/common/builder/PlatformBuilder.js +8 -11
- package/lib/esm/common/builder/__fixtures__/PlatformCustom.js +6 -2
- package/lib/esm/testing/PlatformTest.js +2 -1
- package/lib/types/common/builder/PlatformBuilder.d.ts +3 -7
- package/lib/types/common/builder/__fixtures__/PlatformCustom.d.ts +2 -2
- package/package.json +18 -18
|
@@ -18,7 +18,7 @@ export class PlatformBuilder {
|
|
|
18
18
|
#promise;
|
|
19
19
|
#servers;
|
|
20
20
|
#listeners;
|
|
21
|
-
constructor(settings) {
|
|
21
|
+
constructor(settings = {}) {
|
|
22
22
|
this.startedAt = new Date();
|
|
23
23
|
this.current = new Date();
|
|
24
24
|
this.#listeners = [];
|
|
@@ -76,21 +76,18 @@ export class PlatformBuilder {
|
|
|
76
76
|
get injector() {
|
|
77
77
|
return injector();
|
|
78
78
|
}
|
|
79
|
-
static create(
|
|
80
|
-
return
|
|
79
|
+
static create(settings) {
|
|
80
|
+
return new PlatformBuilder({
|
|
81
81
|
httpsPort: false,
|
|
82
82
|
httpPort: false,
|
|
83
83
|
...settings
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
static bootstrap(module, settings) {
|
|
93
|
-
return this.build(module, settings).bootstrap();
|
|
86
|
+
/**
|
|
87
|
+
* Bootstrap a server application
|
|
88
|
+
*/
|
|
89
|
+
static bootstrap(settings) {
|
|
90
|
+
return new PlatformBuilder(settings).bootstrap();
|
|
94
91
|
}
|
|
95
92
|
callback(...args) {
|
|
96
93
|
return this.adapter.app.callback(...args);
|
|
@@ -12,13 +12,17 @@ export class PlatformCustom extends FakeAdapter {
|
|
|
12
12
|
];
|
|
13
13
|
}
|
|
14
14
|
static create(module, settings = {}) {
|
|
15
|
-
return PlatformBuilder
|
|
15
|
+
return new PlatformBuilder({
|
|
16
|
+
rootModule: module,
|
|
17
|
+
httpPort: false,
|
|
18
|
+
httpsPort: false,
|
|
16
19
|
...settings,
|
|
17
20
|
adapter: PlatformCustom
|
|
18
21
|
});
|
|
19
22
|
}
|
|
20
23
|
static bootstrap(module, settings = {}) {
|
|
21
|
-
return PlatformBuilder
|
|
24
|
+
return new PlatformBuilder({
|
|
25
|
+
rootModule: module,
|
|
22
26
|
...settings,
|
|
23
27
|
adapter: PlatformCustom
|
|
24
28
|
}).bootstrap();
|
|
@@ -45,7 +45,8 @@ export class PlatformTest extends DITest {
|
|
|
45
45
|
const settings = DITest.configure(props);
|
|
46
46
|
adapter(settings.adapter || adapter());
|
|
47
47
|
const configuration = defineConfiguration(settings);
|
|
48
|
-
|
|
48
|
+
const builder = new PlatformBuilder(configuration);
|
|
49
|
+
instance = await builder.bootstrap();
|
|
49
50
|
await instance.listen(!!listen);
|
|
50
51
|
};
|
|
51
52
|
}
|
|
@@ -12,7 +12,7 @@ export declare class PlatformBuilder<App = TsED.Application> {
|
|
|
12
12
|
#private;
|
|
13
13
|
protected startedAt: Date;
|
|
14
14
|
protected current: Date;
|
|
15
|
-
|
|
15
|
+
constructor(settings?: Partial<TsED.Configuration>);
|
|
16
16
|
get name(): string;
|
|
17
17
|
get rootModule(): any | undefined;
|
|
18
18
|
get app(): PlatformApplication<App>;
|
|
@@ -43,15 +43,11 @@ export declare class PlatformBuilder<App = TsED.Application> {
|
|
|
43
43
|
* @deprecated use injector() instead of this method.
|
|
44
44
|
*/
|
|
45
45
|
get injector(): InjectorService;
|
|
46
|
-
static create<App = TsED.Application>(settings
|
|
47
|
-
static create<App = TsED.Application>(module: Type<any>, settings?: PlatformBuilderSettings<App>): PlatformBuilder<App>;
|
|
48
|
-
static build<App = TsED.Application>(settings: PlatformBuilderSettings<App>): PlatformBuilder<App>;
|
|
49
|
-
static build<App = TsED.Application>(module: Type<any>, settings?: PlatformBuilderSettings<App>): PlatformBuilder<App>;
|
|
46
|
+
static create<App = TsED.Application>(settings?: PlatformBuilderSettings<App>): PlatformBuilder<App>;
|
|
50
47
|
/**
|
|
51
48
|
* Bootstrap a server application
|
|
52
49
|
*/
|
|
53
|
-
static bootstrap<App = TsED.Application>(settings
|
|
54
|
-
static bootstrap<App = TsED.Application>(module: Type<any>, settings?: PlatformBuilderSettings<App>): Promise<PlatformBuilder<App>>;
|
|
50
|
+
static bootstrap<App = TsED.Application>(settings?: PlatformBuilderSettings<App>): Promise<PlatformBuilder<App>>;
|
|
55
51
|
callback(): (req: IncomingMessage, res: ServerResponse) => void;
|
|
56
52
|
callback(req: IncomingMessage, res: ServerResponse): void;
|
|
57
53
|
log(...data: any[]): any;
|
|
@@ -8,8 +8,8 @@ export declare class PlatformCustom extends FakeAdapter {
|
|
|
8
8
|
new (): {};
|
|
9
9
|
};
|
|
10
10
|
}[];
|
|
11
|
-
static create(module: Type<any>, settings?: Partial<TsED.Configuration>): PlatformBuilder<
|
|
12
|
-
static bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<PlatformBuilder<
|
|
11
|
+
static create(module: Type<any>, settings?: Partial<TsED.Configuration>): PlatformBuilder<TsED.Application>;
|
|
12
|
+
static bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<PlatformBuilder<TsED.Application>>;
|
|
13
13
|
afterLoadRoutes(): Promise<any>;
|
|
14
14
|
beforeLoadRoutes(): Promise<any>;
|
|
15
15
|
useContext(): any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-http",
|
|
3
|
-
"version": "8.38.0-beta.
|
|
3
|
+
"version": "8.38.0-beta.5",
|
|
4
4
|
"description": "A TypeScript Framework on top of Express",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Controller",
|
|
@@ -70,22 +70,22 @@
|
|
|
70
70
|
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@tsed/core": "8.38.0-beta.
|
|
74
|
-
"@tsed/di": "8.38.0-beta.
|
|
75
|
-
"@tsed/exceptions": "8.38.0-beta.
|
|
76
|
-
"@tsed/hooks": "8.38.0-beta.
|
|
77
|
-
"@tsed/json-mapper": "8.38.0-beta.
|
|
73
|
+
"@tsed/core": "8.38.0-beta.5",
|
|
74
|
+
"@tsed/di": "8.38.0-beta.5",
|
|
75
|
+
"@tsed/exceptions": "8.38.0-beta.5",
|
|
76
|
+
"@tsed/hooks": "8.38.0-beta.5",
|
|
77
|
+
"@tsed/json-mapper": "8.38.0-beta.5",
|
|
78
78
|
"@tsed/logger": "^8.0.0",
|
|
79
79
|
"@tsed/logger-std": "^8.0.0",
|
|
80
|
-
"@tsed/platform-accept-mimes": "8.38.0-beta.
|
|
81
|
-
"@tsed/platform-exceptions": "8.38.0-beta.
|
|
82
|
-
"@tsed/platform-middlewares": "8.38.0-beta.
|
|
83
|
-
"@tsed/platform-multer": "8.38.0-beta.
|
|
84
|
-
"@tsed/platform-params": "8.38.0-beta.
|
|
85
|
-
"@tsed/platform-response-filter": "8.38.0-beta.
|
|
86
|
-
"@tsed/platform-router": "8.38.0-beta.
|
|
87
|
-
"@tsed/platform-views": "8.38.0-beta.
|
|
88
|
-
"@tsed/schema": "8.38.0-beta.
|
|
80
|
+
"@tsed/platform-accept-mimes": "8.38.0-beta.5",
|
|
81
|
+
"@tsed/platform-exceptions": "8.38.0-beta.5",
|
|
82
|
+
"@tsed/platform-middlewares": "8.38.0-beta.5",
|
|
83
|
+
"@tsed/platform-multer": "8.38.0-beta.5",
|
|
84
|
+
"@tsed/platform-params": "8.38.0-beta.5",
|
|
85
|
+
"@tsed/platform-response-filter": "8.38.0-beta.5",
|
|
86
|
+
"@tsed/platform-router": "8.38.0-beta.5",
|
|
87
|
+
"@tsed/platform-views": "8.38.0-beta.5",
|
|
88
|
+
"@tsed/schema": "8.38.0-beta.5",
|
|
89
89
|
"@types/json-schema": "7.0.15",
|
|
90
90
|
"accepts": "^1.3.8",
|
|
91
91
|
"encodeurl": "^2.0.0",
|
|
@@ -93,9 +93,9 @@
|
|
|
93
93
|
"uuid": "14.0.0"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
|
-
"@tsed/barrels": "8.38.0-beta.
|
|
97
|
-
"@tsed/engines": "8.38.0-beta.
|
|
98
|
-
"@tsed/typescript": "8.38.0-beta.
|
|
96
|
+
"@tsed/barrels": "8.38.0-beta.5",
|
|
97
|
+
"@tsed/engines": "8.38.0-beta.5",
|
|
98
|
+
"@tsed/typescript": "8.38.0-beta.5",
|
|
99
99
|
"cross-env": "7.0.3",
|
|
100
100
|
"typescript": "6.0.2",
|
|
101
101
|
"vitest": "4.1.4"
|