@tsed/platform-http 8.37.1 → 8.38.0-beta.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $alter, $asyncAlter, $asyncEmit } from "@tsed/hooks";
|
|
2
|
-
import {
|
|
2
|
+
import { colors, configuration, constant, createContainer, destroyInjector, injector, logger, ProviderScope } from "@tsed/di";
|
|
3
3
|
import { PlatformAdapter } from "../services/PlatformAdapter.js";
|
|
4
4
|
import { Platform } from "../services/Platform.js";
|
|
5
5
|
import { PlatformApplication } from "../services/PlatformApplication.js";
|
|
@@ -161,7 +161,7 @@ export class PlatformBuilder {
|
|
|
161
161
|
const container = createContainer();
|
|
162
162
|
if (this.#rootModule) {
|
|
163
163
|
container.delete(this.#rootModule);
|
|
164
|
-
container.
|
|
164
|
+
container.add(this.#rootModule, {
|
|
165
165
|
type: "server:module",
|
|
166
166
|
scope: ProviderScope.SINGLETON
|
|
167
167
|
});
|
|
@@ -209,7 +209,7 @@ export class PlatformBuilder {
|
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
useProvider(token, settings) {
|
|
212
|
-
injector().
|
|
212
|
+
injector().add(token, settings);
|
|
213
213
|
return this;
|
|
214
214
|
}
|
|
215
215
|
bootstrap() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { injector, Provider, refValue } from "@tsed/di";
|
|
2
2
|
import { PlatformAdapter } from "../services/PlatformAdapter.js";
|
|
3
3
|
const ADAPTER = "platform.adapter";
|
|
4
4
|
let globalAdapter;
|
|
@@ -10,11 +10,11 @@ export function adapter(adapter, imports = []) {
|
|
|
10
10
|
const provider = Provider.Registry.get(token);
|
|
11
11
|
if (useClass && provider) {
|
|
12
12
|
provider.useClass = useClass;
|
|
13
|
-
injector().
|
|
13
|
+
injector().setProvider(token, provider);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
injector()
|
|
17
|
-
.
|
|
17
|
+
.add(PlatformAdapter, {
|
|
18
18
|
useClass: adapter
|
|
19
19
|
})
|
|
20
20
|
.alias(PlatformAdapter, "PlatformAdapter");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlatformRouters } from "@tsed/platform-router";
|
|
2
|
-
import {
|
|
2
|
+
import { inject, injectable, injector, ProviderScope } from "@tsed/di";
|
|
3
3
|
import { application } from "../fn/application.js";
|
|
4
4
|
/**
|
|
5
5
|
* `Platform` is used to provide all routes collected by annotation `@Controller`.
|
|
@@ -22,7 +22,7 @@ export class Platform {
|
|
|
22
22
|
}
|
|
23
23
|
addRoute(route, token) {
|
|
24
24
|
const app = application();
|
|
25
|
-
const provider = injector().
|
|
25
|
+
const provider = injector().providers.get(token);
|
|
26
26
|
if (!provider || provider.hasParent()) {
|
|
27
27
|
return this;
|
|
28
28
|
}
|
|
@@ -20,8 +20,8 @@ export function buildIgnoreLog(ignoreUrlPatterns) {
|
|
|
20
20
|
* @ignore
|
|
21
21
|
*/
|
|
22
22
|
export function createContext() {
|
|
23
|
-
const ResponseKlass = injector().
|
|
24
|
-
const RequestKlass = injector().
|
|
23
|
+
const ResponseKlass = injector().providers.get(PlatformResponse)?.useClass;
|
|
24
|
+
const RequestKlass = injector().providers.get(PlatformRequest)?.useClass;
|
|
25
25
|
const { reqIdBuilder = defaultReqIdBuilder, ...loggerOptions } = configuration().logger;
|
|
26
26
|
const opts = {
|
|
27
27
|
...loggerOptions,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { configuration, injector, logger, ProviderScope } from "@tsed/di";
|
|
2
2
|
import { getHostInfoFromPort } from "@tsed/core";
|
|
3
3
|
import { listenServer } from "./listenServer.js";
|
|
4
4
|
export function createServer({ token, type, port, server: get, listen }) {
|
|
5
5
|
const server = port !== false ? get() : null;
|
|
6
|
-
injector().
|
|
6
|
+
injector().add(token, {
|
|
7
7
|
scope: ProviderScope.SINGLETON,
|
|
8
8
|
useValue: server
|
|
9
9
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-http",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.38.0-beta.1",
|
|
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.
|
|
74
|
-
"@tsed/di": "8.
|
|
75
|
-
"@tsed/exceptions": "8.
|
|
76
|
-
"@tsed/hooks": "8.
|
|
77
|
-
"@tsed/json-mapper": "8.
|
|
73
|
+
"@tsed/core": "8.38.0-beta.1",
|
|
74
|
+
"@tsed/di": "8.38.0-beta.1",
|
|
75
|
+
"@tsed/exceptions": "8.38.0-beta.1",
|
|
76
|
+
"@tsed/hooks": "8.38.0-beta.1",
|
|
77
|
+
"@tsed/json-mapper": "8.38.0-beta.1",
|
|
78
78
|
"@tsed/logger": "^8.0.0",
|
|
79
79
|
"@tsed/logger-std": "^8.0.0",
|
|
80
|
-
"@tsed/platform-accept-mimes": "8.
|
|
81
|
-
"@tsed/platform-exceptions": "8.
|
|
82
|
-
"@tsed/platform-middlewares": "8.
|
|
83
|
-
"@tsed/platform-multer": "8.
|
|
84
|
-
"@tsed/platform-params": "8.
|
|
85
|
-
"@tsed/platform-response-filter": "8.
|
|
86
|
-
"@tsed/platform-router": "8.
|
|
87
|
-
"@tsed/platform-views": "8.
|
|
88
|
-
"@tsed/schema": "8.
|
|
80
|
+
"@tsed/platform-accept-mimes": "8.38.0-beta.1",
|
|
81
|
+
"@tsed/platform-exceptions": "8.38.0-beta.1",
|
|
82
|
+
"@tsed/platform-middlewares": "8.38.0-beta.1",
|
|
83
|
+
"@tsed/platform-multer": "8.38.0-beta.1",
|
|
84
|
+
"@tsed/platform-params": "8.38.0-beta.1",
|
|
85
|
+
"@tsed/platform-response-filter": "8.38.0-beta.1",
|
|
86
|
+
"@tsed/platform-router": "8.38.0-beta.1",
|
|
87
|
+
"@tsed/platform-views": "8.38.0-beta.1",
|
|
88
|
+
"@tsed/schema": "8.38.0-beta.1",
|
|
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.
|
|
97
|
-
"@tsed/engines": "8.
|
|
98
|
-
"@tsed/typescript": "8.
|
|
96
|
+
"@tsed/barrels": "8.38.0-beta.1",
|
|
97
|
+
"@tsed/engines": "8.38.0-beta.1",
|
|
98
|
+
"@tsed/typescript": "8.38.0-beta.1",
|
|
99
99
|
"cross-env": "7.0.3",
|
|
100
100
|
"typescript": "6.0.2",
|
|
101
101
|
"vitest": "4.1.4"
|
|
@@ -107,5 +107,8 @@
|
|
|
107
107
|
"@tsed/logger": {
|
|
108
108
|
"optional": false
|
|
109
109
|
}
|
|
110
|
+
},
|
|
111
|
+
"publishConfig": {
|
|
112
|
+
"tag": "beta"
|
|
110
113
|
}
|
|
111
114
|
}
|