@tsed/terminus 6.107.3 → 6.108.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/TerminusModule.js +11 -11
- package/lib/cjs/TerminusModule.js.map +1 -1
- package/lib/cjs/index.js +5 -5
- package/lib/cjs/index.js.map +1 -1
- package/package.json +19 -10
|
@@ -4,8 +4,8 @@ exports.TerminusModule = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const terminus_1 = require("@godaddy/terminus");
|
|
6
6
|
const di_1 = require("@tsed/di");
|
|
7
|
-
const https_1 =
|
|
8
|
-
const http_1 =
|
|
7
|
+
const https_1 = tslib_1.__importDefault(require("https"));
|
|
8
|
+
const http_1 = tslib_1.__importDefault(require("http"));
|
|
9
9
|
let TerminusModule = class TerminusModule {
|
|
10
10
|
$onInit() {
|
|
11
11
|
this.mount();
|
|
@@ -55,23 +55,23 @@ let TerminusModule = class TerminusModule {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
|
|
58
|
+
tslib_1.__decorate([
|
|
59
59
|
(0, di_1.Configuration)(),
|
|
60
|
-
|
|
60
|
+
tslib_1.__metadata("design:type", Object)
|
|
61
61
|
], TerminusModule.prototype, "configuration", void 0);
|
|
62
|
-
|
|
62
|
+
tslib_1.__decorate([
|
|
63
63
|
(0, di_1.Inject)(),
|
|
64
|
-
|
|
64
|
+
tslib_1.__metadata("design:type", di_1.InjectorService)
|
|
65
65
|
], TerminusModule.prototype, "injector", void 0);
|
|
66
|
-
|
|
66
|
+
tslib_1.__decorate([
|
|
67
67
|
(0, di_1.Inject)(http_1.default.Server),
|
|
68
|
-
|
|
68
|
+
tslib_1.__metadata("design:type", Object)
|
|
69
69
|
], TerminusModule.prototype, "httpServer", void 0);
|
|
70
|
-
|
|
70
|
+
tslib_1.__decorate([
|
|
71
71
|
(0, di_1.Inject)(https_1.default.Server),
|
|
72
|
-
|
|
72
|
+
tslib_1.__metadata("design:type", Object)
|
|
73
73
|
], TerminusModule.prototype, "httpsServer", void 0);
|
|
74
|
-
TerminusModule =
|
|
74
|
+
TerminusModule = tslib_1.__decorate([
|
|
75
75
|
(0, di_1.Module)()
|
|
76
76
|
], TerminusModule);
|
|
77
77
|
exports.TerminusModule = TerminusModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerminusModule.js","sourceRoot":"","sources":["../../src/TerminusModule.ts"],"names":[],"mappings":";;;;AAAA,gDAAiD;AACjD,iCAAgF;AAChF
|
|
1
|
+
{"version":3,"file":"TerminusModule.js","sourceRoot":"","sources":["../../src/TerminusModule.ts"],"names":[],"mappings":";;;;AAAA,gDAAiD;AACjD,iCAAgF;AAChF,0DAA0B;AAC1B,wDAAwB;AAGxB,IAAa,cAAc,GAA3B,MAAa,cAAc;IAalB,OAAO;QACZ,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAEO,KAAK;QACX,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QACtC,MAAM,cAAc,GAAG;YACrB,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAa;YACnC,YAAY,EAAE,IAAI,CAAC,UAAU,EAAE;YAC/B,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;YACvC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC;YAC3C,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC;YACnD,2BAA2B,EAAE,IAAI,CAAC,YAAY,CAAC,6BAA6B,CAAC;YAC7E,GAAG,QAAQ;SACZ,CAAC;QAEF,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,IAAA,yBAAc,EAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;SACjD;QAED,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,IAAA,yBAAc,EAAC,IAAI,CAAC,WAAW,EAA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IACJ,CAAC;CACF,CAAA;AAnEC;IADC,IAAA,kBAAa,GAAE;;qDACqB;AAGrC;IADC,IAAA,WAAM,GAAE;sCACS,oBAAe;gDAAC;AAGlC;IADC,IAAA,WAAM,EAAC,cAAI,CAAC,MAAM,CAAC;;kDACmB;AAGvC;IADC,IAAA,WAAM,EAAC,eAAK,CAAC,MAAM,CAAC;;mDACoB;AAX9B,cAAc;IAD1B,IAAA,WAAM,GAAE;GACI,cAAc,CAqE1B;AArEY,wCAAc","sourcesContent":["import {createTerminus} from \"@godaddy/terminus\";\nimport {Configuration, Inject, InjectorService, Module, OnInit} from \"@tsed/di\";\nimport Https from \"https\";\nimport Http from \"http\";\n\n@Module()\nexport class TerminusModule implements OnInit {\n @Configuration()\n private configuration: Configuration;\n\n @Inject()\n private injector: InjectorService;\n\n @Inject(Http.Server)\n private httpServer: Http.Server | null;\n\n @Inject(Https.Server)\n private httpsServer: Https.Server | null;\n\n public $onInit() {\n this.mount();\n }\n\n private mount() {\n const {terminus} = this.configuration;\n const terminusConfig = {\n logger: this.injector.logger as any,\n healthChecks: this.getHealths(),\n onSignal: this.execShutdown(\"onSignal\"),\n onShutdown: this.execShutdown(\"onShutdown\"),\n beforeShutdown: this.execShutdown(\"beforeShutdown\"),\n onSendFailureDuringShutdown: this.execShutdown(\"onSendFailureDuringShutdown\"),\n ...terminus\n };\n\n if (this.httpServer) {\n createTerminus(this.httpServer, terminusConfig);\n }\n\n if (this.httpsServer) {\n createTerminus(this.httpsServer, terminusConfig);\n }\n }\n\n private getProviders(name: string) {\n return this.injector.getProviders().filter((provider) => {\n return provider.store.get(name);\n });\n }\n\n private getStore(name: string) {\n return this.injector\n .getProviders()\n .map((provider) => provider.store.get(name))\n .filter((x) => !!x)\n .flat();\n }\n\n private getHealths() {\n const healths: {[k: string]: () => Promise<any>} = {};\n\n this.getProviders(\"terminus\").forEach((provider) => {\n Object.keys(provider.store.get(\"terminus\")).forEach((name) => {\n healths[`${provider.path}${name}`] = provider.store.get(\"terminus\")[name];\n });\n });\n\n return healths;\n }\n\n private execShutdown(name: string) {\n return async () => {\n this.getStore(name).forEach((func) => func());\n };\n }\n}\n"]}
|
package/lib/cjs/index.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
tslib_1.__exportStar(require("./TerminusModule"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./decorators/health"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./decorators/shutdown"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./interfaces/TerminusSettings"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./interfaces/interfaces"), exports);
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,2DAAiC;AACjC,8DAAoC;AACpC,gEAAsC;AACtC,wEAA8C;AAC9C,kEAAwC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./TerminusModule\";\nexport * from \"./decorators/health\";\nexport * from \"./decorators/shutdown\";\nexport * from \"./interfaces/TerminusSettings\";\nexport * from \"./interfaces/interfaces\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/terminus",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.108.0",
|
|
4
4
|
"description": "Adds graceful shutdown and Kubernetes readiness / liveness checks for any HTTP applications.",
|
|
5
5
|
"author": "Romain Lenzotti",
|
|
6
6
|
"private": false,
|
|
@@ -23,19 +23,28 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@godaddy/terminus": "^4.7.1",
|
|
26
|
-
"tslib": "2.
|
|
26
|
+
"tslib": "2.3.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@tsed/core": "6.
|
|
30
|
-
"@tsed/di": "6.
|
|
31
|
-
"@tsed/
|
|
32
|
-
"@tsed/schema": "6.107.3"
|
|
29
|
+
"@tsed/core": "6.108.0",
|
|
30
|
+
"@tsed/di": "6.108.0",
|
|
31
|
+
"@tsed/schema": "6.108.0"
|
|
33
32
|
},
|
|
34
33
|
"peerDependencies": {
|
|
35
|
-
"@tsed/core": "^6.
|
|
36
|
-
"@tsed/di": "^6.
|
|
37
|
-
"@tsed/
|
|
38
|
-
|
|
34
|
+
"@tsed/core": "^6.108.0",
|
|
35
|
+
"@tsed/di": "^6.108.0",
|
|
36
|
+
"@tsed/schema": "^6.108.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"@tsed/core": {
|
|
40
|
+
"optional": false
|
|
41
|
+
},
|
|
42
|
+
"@tsed/di": {
|
|
43
|
+
"optional": false
|
|
44
|
+
},
|
|
45
|
+
"@tsed/schema": {
|
|
46
|
+
"optional": false
|
|
47
|
+
}
|
|
39
48
|
},
|
|
40
49
|
"repository": "https://github.com/tsedio/tsed",
|
|
41
50
|
"bugs": {
|