@tsed/common 6.90.0 → 6.93.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.
- package/lib/cjs/builder/PlatformBuilder.d.ts +2 -1
- package/lib/cjs/builder/PlatformBuilder.js +12 -5
- package/lib/cjs/builder/PlatformBuilder.js.map +1 -1
- package/lib/cjs/config/interfaces/index.d.ts +10 -1
- package/lib/cjs/config/interfaces/index.js.map +1 -1
- package/lib/cjs/config/services/PlatformConfiguration.d.ts +9 -13
- package/lib/cjs/config/services/PlatformConfiguration.js +12 -29
- package/lib/cjs/config/services/PlatformConfiguration.js.map +1 -1
- package/lib/cjs/decorators/httpServer.d.ts +1 -0
- package/lib/cjs/decorators/httpServer.js +1 -0
- package/lib/cjs/decorators/httpServer.js.map +1 -1
- package/lib/cjs/decorators/httpsServer.d.ts +1 -0
- package/lib/cjs/decorators/httpsServer.js +1 -0
- package/lib/cjs/decorators/httpsServer.js.map +1 -1
- package/lib/cjs/decorators/multer/multipartFile.js +1 -1
- package/lib/cjs/decorators/multer/multipartFile.js.map +1 -1
- package/lib/cjs/domain/EndpointMetadata.d.ts +3 -29
- package/lib/cjs/domain/EndpointMetadata.js +1 -42
- package/lib/cjs/domain/EndpointMetadata.js.map +1 -1
- package/lib/cjs/services/PlatformTest.js +2 -9
- package/lib/cjs/services/PlatformTest.js.map +1 -1
- package/lib/cjs/utils/createHttpServer.d.ts +3 -2
- package/lib/cjs/utils/createHttpServer.js +23 -24
- package/lib/cjs/utils/createHttpServer.js.map +1 -1
- package/lib/cjs/utils/createHttpsServer.d.ts +3 -2
- package/lib/cjs/utils/createHttpsServer.js +23 -25
- package/lib/cjs/utils/createHttpsServer.js.map +1 -1
- package/lib/cjs/utils/createInjector.js +0 -4
- package/lib/cjs/utils/createInjector.js.map +1 -1
- package/lib/cjs/utils/listenServer.d.ts +6 -9
- package/lib/cjs/utils/listenServer.js +11 -7
- package/lib/cjs/utils/listenServer.js.map +1 -1
- package/lib/esm/builder/PlatformBuilder.js +13 -6
- package/lib/esm/builder/PlatformBuilder.js.map +1 -1
- package/lib/esm/config/interfaces/index.js.map +1 -1
- package/lib/esm/config/services/PlatformConfiguration.js +12 -29
- package/lib/esm/config/services/PlatformConfiguration.js.map +1 -1
- package/lib/esm/decorators/httpServer.js +1 -0
- package/lib/esm/decorators/httpServer.js.map +1 -1
- package/lib/esm/decorators/httpsServer.js +1 -0
- package/lib/esm/decorators/httpsServer.js.map +1 -1
- package/lib/esm/decorators/multer/multipartFile.js +2 -2
- package/lib/esm/decorators/multer/multipartFile.js.map +1 -1
- package/lib/esm/domain/EndpointMetadata.js +3 -44
- package/lib/esm/domain/EndpointMetadata.js.map +1 -1
- package/lib/esm/services/PlatformTest.js +2 -9
- package/lib/esm/services/PlatformTest.js.map +1 -1
- package/lib/esm/utils/createHttpServer.js +22 -22
- package/lib/esm/utils/createHttpServer.js.map +1 -1
- package/lib/esm/utils/createHttpsServer.js +22 -23
- package/lib/esm/utils/createHttpsServer.js.map +1 -1
- package/lib/esm/utils/createInjector.js +0 -4
- package/lib/esm/utils/createInjector.js.map +1 -1
- package/lib/esm/utils/listenServer.js +11 -7
- package/lib/esm/utils/listenServer.js.map +1 -1
- package/lib/types/builder/PlatformBuilder.d.ts +2 -1
- package/lib/types/config/interfaces/index.d.ts +10 -1
- package/lib/types/config/services/PlatformConfiguration.d.ts +9 -13
- package/lib/types/decorators/httpServer.d.ts +1 -0
- package/lib/types/decorators/httpsServer.d.ts +1 -0
- package/lib/types/domain/EndpointMetadata.d.ts +3 -29
- package/lib/types/utils/createHttpServer.d.ts +3 -2
- package/lib/types/utils/createHttpsServer.d.ts +3 -2
- package/lib/types/utils/listenServer.d.ts +6 -9
- package/package.json +15 -15
|
@@ -82,7 +82,7 @@ export declare class PlatformBuilder<App = TsED.Application, Router = TsED.Route
|
|
|
82
82
|
addControllers(endpoint: string, controllers: any | string | (any | string)[]): void;
|
|
83
83
|
runLifecycle(): Promise<this>;
|
|
84
84
|
loadInjector(): Promise<void>;
|
|
85
|
-
listen(): Promise<void>;
|
|
85
|
+
listen(network?: boolean): Promise<void>;
|
|
86
86
|
stop(): Promise<void>;
|
|
87
87
|
ready(): Promise<void>;
|
|
88
88
|
callHook(hook: string, ...args: any[]): Promise<void>;
|
|
@@ -98,6 +98,7 @@ export declare class PlatformBuilder<App = TsED.Application, Router = TsED.Route
|
|
|
98
98
|
* @protected
|
|
99
99
|
*/
|
|
100
100
|
protected loadMiddlewaresFor(hook: string): void;
|
|
101
|
+
protected createHttpServers(): void;
|
|
101
102
|
protected listenServers(): Promise<void>;
|
|
102
103
|
protected logRoutes(): Promise<void>;
|
|
103
104
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Env } from "@tsed/core";
|
|
3
|
-
import Https from "https";
|
|
4
3
|
import { ConverterSettings } from "./ConverterSettings";
|
|
5
4
|
import { EndpointDirectoriesSettings } from "./EndpointDirectoriesSettings";
|
|
6
5
|
import { PlatformLoggerSettings } from "./PlatformLoggerSettings";
|
|
7
6
|
import { PlatformMulterSettings } from "./PlatformMulterSettings";
|
|
8
7
|
import { PlatformStaticsSettings } from "./PlatformStaticsSettings";
|
|
8
|
+
import type Http from "http";
|
|
9
|
+
import type Https from "https";
|
|
9
10
|
declare global {
|
|
10
11
|
namespace TsED {
|
|
11
12
|
interface LoggerConfiguration extends Partial<PlatformLoggerSettings> {
|
|
@@ -27,6 +28,14 @@ declare global {
|
|
|
27
28
|
* Port number for the [HTTP.Server](https://nodejs.org/api/http.html#http_class_http_server).
|
|
28
29
|
*/
|
|
29
30
|
httpPort: string | number | boolean;
|
|
31
|
+
/**
|
|
32
|
+
* [Https.ServerOptions](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)):
|
|
33
|
+
* - `key` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | <Object[]>: The private key of the server in PEM format. To support multiple keys using different algorithms an array can be provided either as a plain array of key strings or an array of objects in the format `{pem: key, passphrase: passphrase}`. This option is required for ciphers that make use of private keys.
|
|
34
|
+
* - `passphrase` <string> A string containing the passphrase for the private key or pfx.
|
|
35
|
+
* - `cert` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers containing the certificate key of the server in PEM format. (Required)
|
|
36
|
+
* - `ca` <string> | <string[]> | [<Buffer>](https://nodejs.org/api/buffer.html#buffer_class_buffer) | [<Buffer[]>](https://nodejs.org/api/buffer.html#buffer_class_buffer): A string, Buffer, array of strings, or array of Buffers of trusted certificates in PEM format. If this is omitted several well known "root" CAs (like VeriSign) will be used. These are used to authorize connections.
|
|
37
|
+
*/
|
|
38
|
+
httpOptions: Http.ServerOptions;
|
|
30
39
|
/**
|
|
31
40
|
* Port number for the [HTTPs.Server](https://nodejs.org/api/https.html#https_class_https_server).
|
|
32
41
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Env } from "@tsed/core";
|
|
2
|
+
import { Env, getHostInfoFromPort } from "@tsed/core";
|
|
3
3
|
import { DIConfiguration } from "@tsed/di";
|
|
4
4
|
import Https from "https";
|
|
5
5
|
import { EndpointDirectoriesSettings, PlatformLoggerSettings } from "../interfaces";
|
|
@@ -39,20 +39,11 @@ export declare class PlatformConfiguration extends DIConfiguration {
|
|
|
39
39
|
set logger(value: Partial<PlatformLoggerSettings>);
|
|
40
40
|
get exclude(): string[];
|
|
41
41
|
set exclude(exclude: string[]);
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* @param addressPort
|
|
45
|
-
* @returns {{address: string, port: number}}
|
|
46
|
-
*/
|
|
47
|
-
private static buildAddressAndPort;
|
|
48
42
|
/**
|
|
49
43
|
*
|
|
50
44
|
* @returns {string|number}
|
|
51
45
|
*/
|
|
52
|
-
getHttpPort():
|
|
53
|
-
address: string;
|
|
54
|
-
port: number;
|
|
55
|
-
};
|
|
46
|
+
getHttpPort(): ReturnType<typeof getHostInfoFromPort>;
|
|
56
47
|
/**
|
|
57
48
|
*
|
|
58
49
|
* @param settings
|
|
@@ -66,8 +57,10 @@ export declare class PlatformConfiguration extends DIConfiguration {
|
|
|
66
57
|
* @returns {string|number}
|
|
67
58
|
*/
|
|
68
59
|
getHttpsPort(): {
|
|
60
|
+
protocol: string;
|
|
69
61
|
address: string;
|
|
70
62
|
port: number;
|
|
63
|
+
toString(): string;
|
|
71
64
|
};
|
|
72
65
|
/**
|
|
73
66
|
*
|
|
@@ -78,8 +71,11 @@ export declare class PlatformConfiguration extends DIConfiguration {
|
|
|
78
71
|
port: number;
|
|
79
72
|
}): void;
|
|
80
73
|
getBestHost(): {
|
|
74
|
+
protocol: string;
|
|
81
75
|
address: string;
|
|
82
76
|
port: number;
|
|
83
|
-
|
|
84
|
-
} |
|
|
77
|
+
toString(): string;
|
|
78
|
+
} | {
|
|
79
|
+
toString(): string;
|
|
80
|
+
};
|
|
85
81
|
}
|
|
@@ -22,6 +22,7 @@ import Http from "http";
|
|
|
22
22
|
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
23
23
|
* @returns {any}
|
|
24
24
|
* @decorator
|
|
25
|
+
* @deprecated Use Https.Server from "http"
|
|
25
26
|
*/
|
|
26
27
|
export declare function HttpServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
|
|
27
28
|
export declare type HttpServer = Http.Server;
|
|
@@ -22,6 +22,7 @@ import Https from "https";
|
|
|
22
22
|
* @param {TypedPropertyDescriptor<Function> | number} descriptor
|
|
23
23
|
* @returns {any}
|
|
24
24
|
* @decorator
|
|
25
|
+
* @deprecated Use Https.Server from "https"
|
|
25
26
|
*/
|
|
26
27
|
export declare function HttpsServer(target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<Function> | number): any;
|
|
27
28
|
export declare type HttpsServer = Https.Server;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
2
|
import { ParamMetadata } from "@tsed/platform-params";
|
|
3
|
-
import {
|
|
4
|
-
export interface EndpointConstructorOptions extends JsonEntityStoreOptions {
|
|
5
|
-
beforeMiddlewares?: Function[];
|
|
6
|
-
middlewares?: Function[];
|
|
7
|
-
afterMiddlewares?: Function[];
|
|
8
|
-
}
|
|
3
|
+
import { JsonMethodStore } from "@tsed/schema";
|
|
9
4
|
export interface EndpointViewOptions {
|
|
10
5
|
path: string;
|
|
11
6
|
options: any;
|
|
@@ -30,11 +25,7 @@ export interface EndpointRedirectOptions {
|
|
|
30
25
|
* }
|
|
31
26
|
*
|
|
32
27
|
*/
|
|
33
|
-
export declare class EndpointMetadata extends JsonMethodStore
|
|
34
|
-
beforeMiddlewares: any[];
|
|
35
|
-
middlewares: any[];
|
|
36
|
-
afterMiddlewares: any[];
|
|
37
|
-
constructor(options: EndpointConstructorOptions);
|
|
28
|
+
export declare class EndpointMetadata extends JsonMethodStore {
|
|
38
29
|
get targetName(): string;
|
|
39
30
|
get params(): ParamMetadata[];
|
|
40
31
|
get view(): EndpointViewOptions;
|
|
@@ -48,7 +39,7 @@ export declare class EndpointMetadata extends JsonMethodStore implements Endpoin
|
|
|
48
39
|
* @param descriptor
|
|
49
40
|
*/
|
|
50
41
|
static get(target: Type<any>, propertyKey: string | symbol, descriptor?: PropertyDescriptor): EndpointMetadata;
|
|
51
|
-
addOperationPath(method: string, path: string | RegExp, options?: any): JsonOperation;
|
|
42
|
+
addOperationPath(method: string, path: string | RegExp, options?: any): import("@tsed/schema").JsonOperation;
|
|
52
43
|
/**
|
|
53
44
|
* Find the a value at the controller level. Let this value be extended or overridden by the endpoint itself.
|
|
54
45
|
*
|
|
@@ -56,21 +47,4 @@ export declare class EndpointMetadata extends JsonMethodStore implements Endpoin
|
|
|
56
47
|
* @returns {any}
|
|
57
48
|
*/
|
|
58
49
|
get<T = any>(key: any): T;
|
|
59
|
-
/**
|
|
60
|
-
* Append middlewares to the beforeMiddlewares list.
|
|
61
|
-
* @param args
|
|
62
|
-
* @returns {EndpointMetadata}
|
|
63
|
-
*/
|
|
64
|
-
before(args: Function[]): this;
|
|
65
|
-
/**
|
|
66
|
-
* Append middlewares to the afterMiddlewares list.
|
|
67
|
-
* @param args
|
|
68
|
-
* @returns {EndpointMetadata}
|
|
69
|
-
*/
|
|
70
|
-
after(args: Function[]): this;
|
|
71
|
-
/**
|
|
72
|
-
* Store all arguments collected via Annotation.
|
|
73
|
-
* @param args
|
|
74
|
-
*/
|
|
75
|
-
use(args: Function[]): this;
|
|
76
50
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { InjectorService } from "@tsed/di";
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
3
|
+
import Http from "http";
|
|
4
|
+
export declare function createHttpServer(injector: InjectorService, requestListener: Http.RequestListener): (() => Promise<void>) | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { InjectorService } from "@tsed/di";
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
3
|
+
import Http from "http";
|
|
4
|
+
export declare function createHttpsServer(injector: InjectorService, requestListener?: Http.RequestListener): (() => Promise<void>) | undefined;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import Http from "http";
|
|
3
|
-
import Https from "https";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
address: string;
|
|
9
|
-
port: number;
|
|
10
|
-
}>;
|
|
2
|
+
import type Http from "http";
|
|
3
|
+
import type Https from "https";
|
|
4
|
+
import type Http2 from "http2";
|
|
5
|
+
import { InjectorService } from "@tsed/di";
|
|
6
|
+
import { getHostInfoFromPort } from "@tsed/core";
|
|
7
|
+
export declare function listenServer(injector: InjectorService, server: Http.Server | Https.Server | Http2.Http2Server, hostInfo: ReturnType<typeof getHostInfoFromPort>): Promise<ReturnType<typeof getHostInfoFromPort>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/common",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.93.0",
|
|
4
4
|
"description": "A TypeScript Framework on top of Express",
|
|
5
5
|
"private": false,
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -59,22 +59,22 @@
|
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@tsed/components-scan": "6.
|
|
63
|
-
"@tsed/core": "6.
|
|
64
|
-
"@tsed/di": "6.
|
|
65
|
-
"@tsed/exceptions": "6.
|
|
66
|
-
"@tsed/json-mapper": "6.
|
|
62
|
+
"@tsed/components-scan": "6.93.0",
|
|
63
|
+
"@tsed/core": "6.93.0",
|
|
64
|
+
"@tsed/di": "6.93.0",
|
|
65
|
+
"@tsed/exceptions": "6.93.0",
|
|
66
|
+
"@tsed/json-mapper": "6.93.0",
|
|
67
67
|
"@tsed/logger": "^6.0.0",
|
|
68
68
|
"@tsed/logger-file": "^6.0.0",
|
|
69
|
-
"@tsed/perf": "6.
|
|
70
|
-
"@tsed/platform-cache": "6.
|
|
71
|
-
"@tsed/platform-exceptions": "6.
|
|
72
|
-
"@tsed/platform-log-middleware": "6.
|
|
73
|
-
"@tsed/platform-middlewares": "6.
|
|
74
|
-
"@tsed/platform-params": "6.
|
|
75
|
-
"@tsed/platform-response-filter": "6.
|
|
76
|
-
"@tsed/platform-views": "6.
|
|
77
|
-
"@tsed/schema": "6.
|
|
69
|
+
"@tsed/perf": "6.93.0",
|
|
70
|
+
"@tsed/platform-cache": "6.93.0",
|
|
71
|
+
"@tsed/platform-exceptions": "6.93.0",
|
|
72
|
+
"@tsed/platform-log-middleware": "6.93.0",
|
|
73
|
+
"@tsed/platform-middlewares": "6.93.0",
|
|
74
|
+
"@tsed/platform-params": "6.93.0",
|
|
75
|
+
"@tsed/platform-response-filter": "6.93.0",
|
|
76
|
+
"@tsed/platform-views": "6.93.0",
|
|
77
|
+
"@tsed/schema": "6.93.0",
|
|
78
78
|
"@types/json-schema": "7.0.7",
|
|
79
79
|
"on-finished": "2.3.0",
|
|
80
80
|
"tslib": "2.2.0",
|