@golemio/core 2.0.4 → 3.0.0-rc.2195750988
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,14 @@
|
|
|
1
|
+
import { ConfigurationInput, Lightship } from "../shared/lightship";
|
|
2
|
+
import { ISimpleConfig } from "./configuration/ISimpleConfig";
|
|
3
|
+
import { ILogger } from "./logger";
|
|
4
|
+
export declare class LightshipStarter {
|
|
5
|
+
private logger;
|
|
6
|
+
private simpleConfig;
|
|
7
|
+
protected readonly DEFAULT_SHUTDOWN_DELAY = "5000";
|
|
8
|
+
protected readonly DEFAULT_SHUTDOWN_TIMEOUT = "60000";
|
|
9
|
+
protected readonly DEFAULT_HANDLER_TIMEOUT = "5000";
|
|
10
|
+
protected lightship?: Lightship;
|
|
11
|
+
constructor(logger: ILogger, simpleConfig: ISimpleConfig);
|
|
12
|
+
initialize(): Promise<Lightship>;
|
|
13
|
+
protected getConfiguration(): ConfigurationInput;
|
|
14
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.LightshipStarter = void 0;
|
|
16
|
+
const lightship_1 = require("../shared/lightship");
|
|
17
|
+
const tsyringe_1 = require("../shared/tsyringe");
|
|
18
|
+
const CoreToken_1 = require("./ioc/CoreToken");
|
|
19
|
+
let LightshipStarter = exports.LightshipStarter = class LightshipStarter {
|
|
20
|
+
constructor(logger, simpleConfig) {
|
|
21
|
+
this.logger = logger;
|
|
22
|
+
this.simpleConfig = simpleConfig;
|
|
23
|
+
this.DEFAULT_SHUTDOWN_DELAY = "5000";
|
|
24
|
+
this.DEFAULT_SHUTDOWN_TIMEOUT = "60000";
|
|
25
|
+
this.DEFAULT_HANDLER_TIMEOUT = "5000";
|
|
26
|
+
}
|
|
27
|
+
async initialize() {
|
|
28
|
+
if (!this.lightship) {
|
|
29
|
+
this.lightship = await (0, lightship_1.createLightship)(this.getConfiguration());
|
|
30
|
+
}
|
|
31
|
+
return this.lightship;
|
|
32
|
+
}
|
|
33
|
+
getConfiguration() {
|
|
34
|
+
return {
|
|
35
|
+
detectKubernetes: this.simpleConfig.getValue("env.NODE_ENV", "development") !== "production",
|
|
36
|
+
shutdownHandlerTimeout: parseInt(this.simpleConfig.getValue("env.LIGHTSHIP_HANDLER_TIMEOUT", this.DEFAULT_SHUTDOWN_DELAY), 10),
|
|
37
|
+
gracefulShutdownTimeout: parseInt(this.simpleConfig.getValue("env.LIGHTSHIP_SHUTDOWN_TIMEOUT", this.DEFAULT_SHUTDOWN_TIMEOUT), 10),
|
|
38
|
+
shutdownDelay: parseInt(this.simpleConfig.getValue("env.LIGHTSHIP_SHUTDOWN_DELAY", this.DEFAULT_HANDLER_TIMEOUT), 10),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.LightshipStarter = LightshipStarter = __decorate([
|
|
43
|
+
(0, tsyringe_1.injectable)(),
|
|
44
|
+
__param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
|
|
45
|
+
__param(1, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.SimpleConfig)),
|
|
46
|
+
__metadata("design:paramtypes", [Object, Object])
|
|
47
|
+
], LightshipStarter);
|
|
48
|
+
//# sourceMappingURL=LightshipStarter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LightshipStarter.js","sourceRoot":"","sources":["../../src/helpers/LightshipStarter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsF;AACtF,iDAAyD;AAEzD,+CAA4C;AAIrC,IAAM,gBAAgB,8BAAtB,MAAM,gBAAgB;IAMzB,YAC8B,MAAuB,EACjB,YAAmC;QADjC,WAAM,GAAN,MAAM,CAAS;QACT,iBAAY,GAAZ,YAAY,CAAe;QAPpD,2BAAsB,GAAG,MAAM,CAAC;QAChC,6BAAwB,GAAG,OAAO,CAAC;QACnC,4BAAuB,GAAG,MAAM,CAAC;IAMjD,CAAC;IAEG,KAAK,CAAC,UAAU;QACnB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACjB,IAAI,CAAC,SAAS,GAAG,MAAM,IAAA,2BAAe,EAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;SACnE;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAES,gBAAgB;QACtB,OAAO;YACH,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,cAAc,EAAE,aAAa,CAAC,KAAK,YAAY;YAC5F,sBAAsB,EAAE,QAAQ,CAC5B,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,+BAA+B,EAAE,IAAI,CAAC,sBAAsB,CAAC,EACxF,EAAE,CACL;YACD,uBAAuB,EAAE,QAAQ,CAC7B,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,gCAAgC,EAAE,IAAI,CAAC,wBAAwB,CAAC,EAC3F,EAAE,CACL;YACD,aAAa,EAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,8BAA8B,EAAE,IAAI,CAAC,uBAAuB,CAAC,EAAE,EAAE,CAAC;SAClG,CAAC;IAC5B,CAAC;CACJ,CAAA;2BAjCY,gBAAgB;IAD5B,IAAA,qBAAU,GAAE;IAQJ,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;IACxB,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,YAAY,CAAC,CAAA;;GAR1B,gBAAgB,CAiC5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-rc.2195750988",
|
|
4
4
|
"description": "Golemio Core Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"html-entities": "^2.4.0",
|
|
106
106
|
"iconv-lite": "^0.6.2",
|
|
107
107
|
"ioredis": "^5.4.1",
|
|
108
|
-
"lightship": "
|
|
108
|
+
"lightship": "9.0.2",
|
|
109
109
|
"luxon": "^2.5.2",
|
|
110
110
|
"moment-timezone": "^0.5.26",
|
|
111
111
|
"opentelemetry-instrumentation-sequelize": "^0.41.0",
|