@tsed/terminus 7.79.4 → 7.80.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.
@@ -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;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @file Automatically generated by @tsed/barrels.
3
+ */
4
+ export * from "./decorators/health.js";
5
+ export * from "./interfaces/interfaces.js";
6
+ export * from "./interfaces/TerminusSettings.js";
7
+ export * from "./TerminusModule.js";
@@ -0,0 +1,4 @@
1
+ import { TerminusOptions } from "@godaddy/terminus";
2
+ export type TerminusSettings = Omit<TerminusOptions, "healthChecks" | "onSignal" | "onSendFailureDuringShutdown" | "onShutdown" | "beforeShutdown" | "onSigterm"> & {
3
+ path?: string;
4
+ };
@@ -0,0 +1,8 @@
1
+ import { TerminusSettings } from "./TerminusSettings.js";
2
+ declare global {
3
+ namespace TsED {
4
+ interface Configuration {
5
+ terminus: TerminusSettings;
6
+ }
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,45 +1,49 @@
1
1
  {
2
2
  "name": "@tsed/terminus",
3
- "version": "7.79.4",
4
3
  "description": "Adds graceful shutdown and Kubernetes readiness / liveness checks for any HTTP applications.",
4
+ "type": "commonjs",
5
+ "version": "7.80.1",
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
- "types": "./lib/types/index.d.ts",
12
- "import": "./lib/esm/index.js",
13
- "require": "./lib/cjs/index.js",
14
- "default": "./lib/esm/index.js"
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": "jest --max-workers=2 && jest-coverage-thresholds-bumper",
21
- "build:ts": "tsc --build tsconfig.json && tsc --build tsconfig.esm.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.79.4",
29
- "@tsed/common": "7.79.4",
30
- "@tsed/core": "7.79.4",
31
- "@tsed/di": "7.79.4",
32
- "@tsed/schema": "7.79.4",
33
- "@tsed/typescript": "7.79.4",
31
+ "@tsed/barrels": "7.80.1",
32
+ "@tsed/common": "7.80.1",
33
+ "@tsed/core": "7.80.1",
34
+ "@tsed/di": "7.80.1",
35
+ "@tsed/schema": "7.80.1",
36
+ "@tsed/typescript": "7.80.1",
34
37
  "eslint": "^8.57.0",
35
- "jest": "^29.7.0"
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.79.4",
40
- "@tsed/core": "7.79.4",
41
- "@tsed/di": "7.79.4",
42
- "@tsed/schema": "7.79.4"
43
+ "@tsed/common": "7.80.1",
44
+ "@tsed/core": "7.80.1",
45
+ "@tsed/di": "7.80.1",
46
+ "@tsed/schema": "7.80.1"
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
- };
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
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
- }