@sellout/service 0.0.317 → 0.0.320
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/.dist/BaseService.d.ts +5 -1
- package/.dist/BaseService.js +8 -1
- package/.dist/BaseService.js.map +1 -1
- package/package.json +4 -4
- package/src/BaseService.ts +12 -3
package/.dist/BaseService.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IConnectionManager, ILogManager, IServiceOpts } from "./interfaces";
|
|
2
2
|
import Segment from "./Segment";
|
|
3
|
+
import * as pb from '@sellout/models/.dist/sellout-proto';
|
|
3
4
|
/**
|
|
4
5
|
* Provides the abstract class for all service implementations.
|
|
5
6
|
*/
|
|
@@ -13,7 +14,10 @@ declare class BaseService {
|
|
|
13
14
|
collectDefaultMetrics: any;
|
|
14
15
|
ready: any;
|
|
15
16
|
constructor(opts: IServiceOpts);
|
|
16
|
-
isReady(): Promise<
|
|
17
|
+
isReady(): Promise<{
|
|
18
|
+
statusCode: pb.StatusCode;
|
|
19
|
+
isReady: boolean;
|
|
20
|
+
}>;
|
|
17
21
|
/**
|
|
18
22
|
* Register message listeners here.
|
|
19
23
|
*/
|
package/.dist/BaseService.js
CHANGED
|
@@ -14,6 +14,7 @@ const express = require("express");
|
|
|
14
14
|
const env_1 = require("./env");
|
|
15
15
|
const Sentry = require("@sentry/node");
|
|
16
16
|
const Segment_1 = require("./Segment");
|
|
17
|
+
const pb = require("@sellout/models/.dist/sellout-proto");
|
|
17
18
|
/**
|
|
18
19
|
* Provides the abstract class for all service implementations.
|
|
19
20
|
*/
|
|
@@ -69,9 +70,15 @@ class BaseService {
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
// override to have derived classes declare non-readiness to k8s
|
|
73
|
+
// public async isReady() : Promise<boolean> {
|
|
74
|
+
// return true;
|
|
75
|
+
// }
|
|
72
76
|
isReady() {
|
|
73
77
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
return
|
|
78
|
+
return {
|
|
79
|
+
statusCode: pb.StatusCode.OK,
|
|
80
|
+
isReady: true, // Confirms that the service is operational
|
|
81
|
+
};
|
|
75
82
|
});
|
|
76
83
|
}
|
|
77
84
|
/**
|
package/.dist/BaseService.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseService.js","sourceRoot":"","sources":["../src/BaseService.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,0CAA0C;AAC1C,mCAAmC;AACnC,+BAKe;AACf,uCAAuC;AACvC,uCAAgC;
|
|
1
|
+
{"version":3,"file":"BaseService.js","sourceRoot":"","sources":["../src/BaseService.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,0CAA0C;AAC1C,mCAAmC;AACnC,+BAKe;AACf,uCAAuC;AACvC,uCAAgC;AAChC,0DAA0D;AAE1D;;GAEG;AACH,MAAM,WAAW;IAUf,YAAY,IAAkB;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;QAC7C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAO,CAAC,0BAAoB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAE9D;;WAEG;QACH,IAAI,gBAAU,EAAE;YACd,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;YAC1E,MAAM,CAAC,IAAI,CAAC;gBACV,GAAG,EAAE,gBAAU;gBACf,WAAW,EAAE,cAAQ;aACtB,CAAC,CAAC;SACJ;aAAM;YACL,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC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,IAAI,CAAC,WAAW,4CAA4C,WAAW,GAAG,CAAC,CAAC,CAAC;SACzI;IACH,CAAC;IAED,gEAAgE;IAEhE,8CAA8C;IAC9C,iBAAiB;IACjB,IAAI;IAES,OAAO;;YAClB,OAAO;gBACL,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE;gBAC5B,OAAO,EAAE,IAAI,EAAE,2CAA2C;aAC3D,CAAC;QACJ,CAAC;KAAA;IAED;;OAEG;IACI,QAAQ;QACb,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IAEM,GAAG;QACR,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;CACF;AAED,kBAAe,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sellout/service",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.320",
|
|
4
4
|
"description": "Sellout.io base service",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"author": "samheutmaker@gmail.com",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@sellout/models": "^0.0.
|
|
19
|
-
"@sellout/utils": "^0.0.
|
|
18
|
+
"@sellout/models": "^0.0.320",
|
|
19
|
+
"@sellout/utils": "^0.0.320",
|
|
20
20
|
"@sentry/node": "^5.30.0",
|
|
21
21
|
"analytics-node": "^3.5.0",
|
|
22
22
|
"express": "^4.18.2",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"nodemon": "^2.0.22",
|
|
32
32
|
"typescript": "^4.4.2"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "834fcc168cca833eed3b1b35303444fea48ae51c"
|
|
35
35
|
}
|
package/src/BaseService.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from "./env";
|
|
10
10
|
import * as Sentry from "@sentry/node";
|
|
11
11
|
import Segment from "./Segment";
|
|
12
|
+
import * as pb from '@sellout/models/.dist/sellout-proto';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Provides the abstract class for all service implementations.
|
|
@@ -45,7 +46,7 @@ class BaseService {
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
// Enable/Disable Prometheus
|
|
48
|
-
if(!DISABLE_PROMETHEUS) {
|
|
49
|
+
if (!DISABLE_PROMETHEUS) {
|
|
49
50
|
// set up Prometheus client metrics gathering
|
|
50
51
|
const collectDefaultMetrics = Prometheus.collectDefaultMetrics;
|
|
51
52
|
// collectDefaultMetrics({ timeout: 5000 });
|
|
@@ -80,8 +81,16 @@ class BaseService {
|
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
// override to have derived classes declare non-readiness to k8s
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
|
|
85
|
+
// public async isReady() : Promise<boolean> {
|
|
86
|
+
// return true;
|
|
87
|
+
// }
|
|
88
|
+
|
|
89
|
+
public async isReady(): Promise<{ statusCode: pb.StatusCode; isReady: boolean }> {
|
|
90
|
+
return {
|
|
91
|
+
statusCode: pb.StatusCode.OK, // Indicates successful readiness
|
|
92
|
+
isReady: true, // Confirms that the service is operational
|
|
93
|
+
};
|
|
85
94
|
}
|
|
86
95
|
|
|
87
96
|
/**
|