@tsed/terminus 7.79.3 → 7.80.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/types-esm/TerminusModule.d.ts +37 -0
- package/lib/types-esm/decorators/health.d.ts +20 -0
- package/lib/types-esm/index.d.ts +7 -0
- package/lib/types-esm/interfaces/TerminusSettings.d.ts +4 -0
- package/lib/types-esm/interfaces/interfaces.d.ts +8 -0
- package/package.json +22 -18
- package/vitest.config.mts +21 -0
- package/jest.config.js +0 -15
- package/lib/cjs/package.json +0 -3
- package/lib/esm/package.json +0 -3
- package/tsconfig.esm.json +0 -42
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { PlatformRouteDetails } from "@tsed/common";
|
|
2
|
+
import { OnInit } from "@tsed/di";
|
|
3
|
+
export declare class TerminusModule implements OnInit {
|
|
4
|
+
private settings;
|
|
5
|
+
private basePath;
|
|
6
|
+
private injector;
|
|
7
|
+
private httpServer;
|
|
8
|
+
private httpsServer;
|
|
9
|
+
$onInit(): void;
|
|
10
|
+
getConfiguration(): {
|
|
11
|
+
caseInsensitive?: boolean | undefined;
|
|
12
|
+
timeout?: number | undefined;
|
|
13
|
+
signal?: string | undefined;
|
|
14
|
+
signals?: string[] | undefined;
|
|
15
|
+
sendFailuresDuringShutdown?: boolean | undefined;
|
|
16
|
+
statusOk?: number | undefined;
|
|
17
|
+
statusOkResponse?: Record<string, unknown> | undefined;
|
|
18
|
+
statusError?: number | undefined;
|
|
19
|
+
statusErrorResponse?: Record<string, unknown> | undefined;
|
|
20
|
+
useExit0?: boolean | undefined;
|
|
21
|
+
logger: (event: string, error: any) => any;
|
|
22
|
+
headers?: {
|
|
23
|
+
[key: string]: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
healthChecks: Record<string, any>;
|
|
26
|
+
onSignal: (...args: any[]) => Promise<void>;
|
|
27
|
+
onShutdown: (...args: any[]) => Promise<void>;
|
|
28
|
+
beforeShutdown: (...args: any[]) => Promise<void>;
|
|
29
|
+
onSendFailureDuringShutdown: (...args: any[]) => Promise<void>;
|
|
30
|
+
};
|
|
31
|
+
$logRoutes(routes: PlatformRouteDetails[]): Promise<PlatformRouteDetails[]>;
|
|
32
|
+
private mount;
|
|
33
|
+
private getAll;
|
|
34
|
+
private getHealths;
|
|
35
|
+
private getPath;
|
|
36
|
+
private createEmitter;
|
|
37
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a readiness / liveness checks.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { Health } from "@tsed/terminus";
|
|
6
|
+
*
|
|
7
|
+
* @Controller("/mongo")
|
|
8
|
+
* class MongoCtrl {
|
|
9
|
+
* @Health("/health")
|
|
10
|
+
* health() {
|
|
11
|
+
* // Here check the mongo health
|
|
12
|
+
* return Promise.resolve();
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* @param name
|
|
17
|
+
* @decorator
|
|
18
|
+
* @terminus
|
|
19
|
+
*/
|
|
20
|
+
export declare function Health(name: string): MethodDecorator;
|
package/package.json
CHANGED
|
@@ -1,45 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/terminus",
|
|
3
|
-
"version": "7.79.3",
|
|
4
3
|
"description": "Adds graceful shutdown and Kubernetes readiness / liveness checks for any HTTP applications.",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"version": "7.80.0",
|
|
5
6
|
"author": "Romain Lenzotti",
|
|
6
7
|
"source": "./src/index.ts",
|
|
7
8
|
"main": "./lib/cjs/index.js",
|
|
8
9
|
"module": "./lib/esm/index.js",
|
|
9
10
|
"typings": "./lib/types/index.d.ts",
|
|
10
11
|
"exports": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./lib/types/index.d.ts",
|
|
14
|
+
"import": "./lib/esm/index.js",
|
|
15
|
+
"default": "./lib/cjs/index.js"
|
|
16
|
+
}
|
|
15
17
|
},
|
|
16
18
|
"scripts": {
|
|
17
19
|
"build": "yarn barrels && yarn build:ts",
|
|
18
20
|
"barrels": "barrels",
|
|
19
21
|
"start": "ts-node test/app/index.ts",
|
|
20
|
-
"test": "
|
|
21
|
-
"build:ts": "tsc --build tsconfig.json
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"build:ts": "tsc --build tsconfig.json",
|
|
24
|
+
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
22
25
|
},
|
|
23
26
|
"dependencies": {
|
|
24
27
|
"tslib": "2.6.1"
|
|
25
28
|
},
|
|
26
29
|
"devDependencies": {
|
|
27
30
|
"@godaddy/terminus": "^4.12.1",
|
|
28
|
-
"@tsed/barrels": "7.
|
|
29
|
-
"@tsed/common": "7.
|
|
30
|
-
"@tsed/core": "7.
|
|
31
|
-
"@tsed/di": "7.
|
|
32
|
-
"@tsed/schema": "7.
|
|
33
|
-
"@tsed/typescript": "7.
|
|
31
|
+
"@tsed/barrels": "7.80.0",
|
|
32
|
+
"@tsed/common": "7.80.0",
|
|
33
|
+
"@tsed/core": "7.80.0",
|
|
34
|
+
"@tsed/di": "7.80.0",
|
|
35
|
+
"@tsed/schema": "7.80.0",
|
|
36
|
+
"@tsed/typescript": "7.80.0",
|
|
34
37
|
"eslint": "^8.57.0",
|
|
35
|
-
"
|
|
38
|
+
"typescript": "4.9.5",
|
|
39
|
+
"vitest": "2.0.4"
|
|
36
40
|
},
|
|
37
41
|
"peerDependencies": {
|
|
38
42
|
"@godaddy/terminus": "^4.7.1",
|
|
39
|
-
"@tsed/common": "7.
|
|
40
|
-
"@tsed/core": "7.
|
|
41
|
-
"@tsed/di": "7.
|
|
42
|
-
"@tsed/schema": "7.
|
|
43
|
+
"@tsed/common": "7.80.0",
|
|
44
|
+
"@tsed/core": "7.80.0",
|
|
45
|
+
"@tsed/di": "7.80.0",
|
|
46
|
+
"@tsed/schema": "7.80.0"
|
|
43
47
|
},
|
|
44
48
|
"peerDependenciesMeta": {
|
|
45
49
|
"@godaddy/terminus": {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import {presets} from "@tsed/vitest/presets";
|
|
3
|
+
import {defineConfig} from "vitest/config";
|
|
4
|
+
|
|
5
|
+
export default defineConfig(
|
|
6
|
+
{
|
|
7
|
+
...presets,
|
|
8
|
+
test: {
|
|
9
|
+
...presets.test,
|
|
10
|
+
coverage: {
|
|
11
|
+
...presets.test.coverage,
|
|
12
|
+
thresholds: {
|
|
13
|
+
statements: 0,
|
|
14
|
+
branches: 0,
|
|
15
|
+
functions: 0,
|
|
16
|
+
lines: 0
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
);
|
package/jest.config.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// For a detailed explanation regarding each configuration property, visit:
|
|
2
|
-
// https://jestjs.io/docs/en/configuration.html
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
...require("@tsed/jest-config"),
|
|
6
|
-
roots: ["<rootDir>/src"],
|
|
7
|
-
coverageThreshold: {
|
|
8
|
-
global: {
|
|
9
|
-
statements: 0,
|
|
10
|
-
branches: 0,
|
|
11
|
-
functions: 0,
|
|
12
|
-
lines: 0
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
};
|
package/lib/cjs/package.json
DELETED
package/lib/esm/package.json
DELETED
package/tsconfig.esm.json
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@tsed/typescript/tsconfig.node.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"baseUrl": ".",
|
|
5
|
-
"module": "ES2020",
|
|
6
|
-
"rootDir": "src",
|
|
7
|
-
"outDir": "./lib/esm",
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"declarationDir": "./lib/types",
|
|
10
|
-
"composite": true,
|
|
11
|
-
"noEmit": false
|
|
12
|
-
},
|
|
13
|
-
"include": ["src", "src/**/*.json"],
|
|
14
|
-
"exclude": [
|
|
15
|
-
"node_modules",
|
|
16
|
-
"test",
|
|
17
|
-
"lib",
|
|
18
|
-
"benchmark",
|
|
19
|
-
"coverage",
|
|
20
|
-
"spec",
|
|
21
|
-
"**/*.benchmark.ts",
|
|
22
|
-
"**/*.spec.ts",
|
|
23
|
-
"keys",
|
|
24
|
-
"jest.config.js",
|
|
25
|
-
"**/__mock__/**",
|
|
26
|
-
"webpack.config.js"
|
|
27
|
-
],
|
|
28
|
-
"references": [
|
|
29
|
-
{
|
|
30
|
-
"path": "../../platform/common"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"path": "../../core"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"path": "../../di"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"path": "../../specs/schema"
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
}
|