@golemio/core 1.2.14 → 1.2.15-dev.591279008
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/output-gateway/redis/CacheMiddleware.js +5 -5
- package/dist/output-gateway/redis/CacheMiddleware.js.map +1 -1
- package/dist/output-gateway/redis/RedisConnector.d.ts +8 -3
- package/dist/output-gateway/redis/RedisConnector.js +51 -26
- package/dist/output-gateway/redis/RedisConnector.js.map +1 -1
- package/package.json +126 -127
|
@@ -4,15 +4,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.useCacheMiddleware = exports.CacheMiddleware = void 0;
|
|
7
|
-
const
|
|
7
|
+
const apicache_plus_1 = __importDefault(require("apicache-plus"));
|
|
8
8
|
const config_1 = require("../config");
|
|
9
9
|
const Logger_1 = require("../Logger");
|
|
10
|
-
const
|
|
10
|
+
const RedisConnector_1 = require("./RedisConnector");
|
|
11
11
|
class MyCacheMiddleware {
|
|
12
12
|
constructor() {
|
|
13
13
|
this.defaultCacheTtl = parseInt(config_1.config.redis_ttl || "60000", 10);
|
|
14
14
|
// as default is used memory-cache
|
|
15
|
-
this.cacheWithRedisMiddleware =
|
|
15
|
+
this.cacheWithRedisMiddleware = apicache_plus_1.default.options({
|
|
16
16
|
defaultDuration: this.defaultCacheTtl.toString(),
|
|
17
17
|
}).middleware;
|
|
18
18
|
this.isNoCacheHeader = (req, res) => {
|
|
@@ -33,9 +33,9 @@ class MyCacheMiddleware {
|
|
|
33
33
|
}
|
|
34
34
|
init() {
|
|
35
35
|
if (config_1.config.redis_enable) {
|
|
36
|
-
this.redisClient =
|
|
36
|
+
this.redisClient = RedisConnector_1.RedisConnector.getConnection(RedisConnector_1.ConnectionType.APICACHE);
|
|
37
37
|
// sets redis to apicache
|
|
38
|
-
this.cacheWithRedisMiddleware =
|
|
38
|
+
this.cacheWithRedisMiddleware = apicache_plus_1.default.options({
|
|
39
39
|
defaultDuration: this.defaultCacheTtl.toString(),
|
|
40
40
|
redisClient: this.redisClient,
|
|
41
41
|
}).middleware;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CacheMiddleware.js","sourceRoot":"","sources":["../../../src/output-gateway/redis/CacheMiddleware.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"CacheMiddleware.js","sourceRoot":"","sources":["../../../src/output-gateway/redis/CacheMiddleware.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAqC;AAGrC,sCAAoC;AACpC,sCAAiC;AACjC,qDAAkE;AAElE,MAAM,iBAAiB;IAAvB;QACY,oBAAe,GAAW,QAAQ,CAAC,eAAM,CAAC,SAAS,IAAI,OAAO,EAAE,EAAE,CAAC,CAAC;QAI5E,kCAAkC;QAC1B,6BAAwB,GAAG,uBAAQ,CAAC,OAAO,CAAC;YAChD,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;SACnD,CAAC,CAAC,UAAU,CAAC;QAoBP,oBAAe,GAAG,CAAC,GAAY,EAAE,GAAa,EAAW,EAAE;YAC9D,MAAM,WAAW,GAAuB,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;YACrE,OAAO,WAAW,KAAK,UAAU,CAAC;QACtC,CAAC,CAAC;QAMM,eAAU,GAAG,CAAC,MAAwB,EAAE,EAAE;YAC9C,OAAO,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;gBACvD,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;oBACjC,MAAM,UAAU,GAAG,IAAI,CAAC,wBAAwB,CAAC,MAAM,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC;oBACjF,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;iBAC9B;qBAAM;oBACH,IAAI,EAAE,CAAC;iBACV;YACL,CAAC,CAAC;QACN,CAAC,CAAC;IACN,CAAC;IArCU,IAAI;QACP,IAAI,eAAM,CAAC,YAAY,EAAE;YACrB,IAAI,CAAC,WAAW,GAAG,+BAAc,CAAC,aAAa,CAAC,+BAAc,CAAC,QAAQ,CAAC,CAAC;YAEzE,yBAAyB;YACzB,IAAI,CAAC,wBAAwB,GAAG,uBAAQ,CAAC,OAAO,CAAC;gBAC7C,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;gBAChD,WAAW,EAAE,IAAI,CAAC,WAAW;aAChC,CAAC,CAAC,UAAU,CAAC;SACjB;aAAM;YACH,YAAG,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;SAC1E;IACL,CAAC;IAEM,kBAAkB;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAOM,aAAa,CAAC,MAAwB;QACzC,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;CAYJ;AAED,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAGvC,0CAAe;AAFxB,MAAM,kBAAkB,GAAG,CAAC,MAAwB,EAAE,EAAE,CAAC,eAAe,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AAErE,gDAAkB"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { RedisClient } from "redis";
|
|
2
|
+
export declare enum ConnectionType {
|
|
3
|
+
DEFAULT = "DEFAULT",
|
|
4
|
+
APICACHE = "APICACHE"
|
|
5
|
+
}
|
|
2
6
|
declare class MyRedis {
|
|
3
|
-
private
|
|
7
|
+
private connections;
|
|
4
8
|
connect: () => Promise<RedisClient>;
|
|
5
|
-
getConnection(): RedisClient;
|
|
6
|
-
isConnected(): boolean;
|
|
9
|
+
getConnection(connectionType?: ConnectionType): RedisClient;
|
|
10
|
+
isConnected(connectionType?: ConnectionType): boolean;
|
|
7
11
|
disconnect(): Promise<void>;
|
|
12
|
+
private createConnection;
|
|
8
13
|
private checkOnConnect;
|
|
9
14
|
}
|
|
10
15
|
declare const RedisConnector: MyRedis;
|
|
@@ -12,62 +12,87 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.RedisConnector = void 0;
|
|
15
|
+
exports.RedisConnector = exports.ConnectionType = void 0;
|
|
16
16
|
const errors_1 = require("@golemio/errors");
|
|
17
|
+
const promises_1 = require("timers/promises");
|
|
17
18
|
const redis_1 = __importDefault(require("redis"));
|
|
18
19
|
const config_1 = require("../config");
|
|
19
20
|
const Logger_1 = require("../Logger");
|
|
21
|
+
var ConnectionType;
|
|
22
|
+
(function (ConnectionType) {
|
|
23
|
+
ConnectionType["DEFAULT"] = "DEFAULT";
|
|
24
|
+
ConnectionType["APICACHE"] = "APICACHE";
|
|
25
|
+
})(ConnectionType = exports.ConnectionType || (exports.ConnectionType = {}));
|
|
26
|
+
const connectionOptions = {
|
|
27
|
+
[ConnectionType.DEFAULT]: {},
|
|
28
|
+
[ConnectionType.APICACHE]: { detect_buffers: true },
|
|
29
|
+
};
|
|
20
30
|
class MyRedis {
|
|
21
31
|
constructor() {
|
|
32
|
+
this.connections = new Map();
|
|
22
33
|
this.connect = () => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (this.connections.has(ConnectionType.DEFAULT)) {
|
|
35
|
+
return this.connections.get(ConnectionType.DEFAULT);
|
|
36
|
+
}
|
|
37
|
+
for (const connectionType of Object.values(ConnectionType)) {
|
|
38
|
+
yield this.createConnection(connectionType);
|
|
39
|
+
}
|
|
40
|
+
return this.connections.get(ConnectionType.DEFAULT);
|
|
41
|
+
});
|
|
42
|
+
this.createConnection = (connectionType) => __awaiter(this, void 0, void 0, function* () {
|
|
23
43
|
try {
|
|
24
|
-
if (this.connection) {
|
|
25
|
-
return this.connection;
|
|
26
|
-
}
|
|
27
44
|
if (!config_1.config.redis_connection) {
|
|
28
45
|
throw new errors_1.CustomError("The ENV variable REDIS_CONN cannot be undefined.", true, this.constructor.name);
|
|
29
46
|
}
|
|
30
|
-
|
|
31
|
-
.createClient(config_1.config.redis_connection
|
|
47
|
+
const connection = redis_1.default
|
|
48
|
+
.createClient(config_1.config.redis_connection, connectionOptions[connectionType])
|
|
32
49
|
.on("message", (message) => Logger_1.log.info(message))
|
|
33
50
|
.on("error", (error) => Logger_1.log.warn(error))
|
|
34
51
|
.on("connect", () => Logger_1.log.info("Connected to Redis!"));
|
|
35
|
-
|
|
52
|
+
this.connections.set(connectionType, connection);
|
|
53
|
+
// waiting for the redis client to connect
|
|
36
54
|
const delay = 500; // millis
|
|
37
55
|
const attemps = 4;
|
|
38
|
-
yield
|
|
39
|
-
return
|
|
56
|
+
yield this.checkOnConnect(connectionType, attemps, attemps, delay);
|
|
57
|
+
return connection;
|
|
40
58
|
}
|
|
41
59
|
catch (err) {
|
|
42
60
|
throw new errors_1.CustomError("Error while connecting to Redis.", false, this.constructor.name, 1001, err);
|
|
43
61
|
}
|
|
44
62
|
});
|
|
45
|
-
this.checkOnConnect = (retry, attemps, delay) => (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
else {
|
|
53
|
-
setTimeout(() => this.checkOnConnect(retry - 1, attemps, delay)(resolve, reject), delay);
|
|
63
|
+
this.checkOnConnect = (connectionType, retry, attemps, delay) => __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
while (retry > 0) {
|
|
65
|
+
if (this.isConnected(connectionType)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
yield (0, promises_1.setTimeout)(delay);
|
|
69
|
+
retry -= 1;
|
|
54
70
|
}
|
|
55
|
-
|
|
71
|
+
throw new Error(`Failed to connect to Redis after ${attemps * delay} millis.`);
|
|
72
|
+
});
|
|
56
73
|
}
|
|
57
|
-
getConnection() {
|
|
58
|
-
|
|
74
|
+
getConnection(connectionType = ConnectionType.DEFAULT) {
|
|
75
|
+
const connection = this.connections.get(connectionType);
|
|
76
|
+
if (!connection) {
|
|
59
77
|
throw new errors_1.CustomError("Redis connection does not exists. First call connect() method.", false, this.constructor.name, 1002);
|
|
60
78
|
}
|
|
61
|
-
return
|
|
79
|
+
return connection;
|
|
62
80
|
}
|
|
63
|
-
isConnected() {
|
|
64
|
-
|
|
81
|
+
isConnected(connectionType = ConnectionType.DEFAULT) {
|
|
82
|
+
const connection = this.connections.get(connectionType);
|
|
83
|
+
return !!connection && connection.connected;
|
|
65
84
|
}
|
|
66
85
|
disconnect() {
|
|
67
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68
87
|
Logger_1.log.info("Redis disconnect called");
|
|
69
|
-
|
|
70
|
-
yield
|
|
88
|
+
for (const connection of this.connections.values()) {
|
|
89
|
+
yield new Promise((resolve, reject) => {
|
|
90
|
+
connection.quit((err) => {
|
|
91
|
+
if (err)
|
|
92
|
+
reject(err);
|
|
93
|
+
resolve();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
71
96
|
}
|
|
72
97
|
});
|
|
73
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisConnector.js","sourceRoot":"","sources":["../../../src/output-gateway/redis/RedisConnector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"RedisConnector.js","sourceRoot":"","sources":["../../../src/output-gateway/redis/RedisConnector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAA8C;AAC9C,8CAAsD;AACtD,kDAAuD;AACvD,sCAAoC;AACpC,sCAAiC;AAEjC,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;AACzB,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AAED,MAAM,iBAAiB,G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
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
"
|
|
127
|
-
|
|
128
|
-
}
|
|
2
|
+
"name": "@golemio/core",
|
|
3
|
+
"version": "1.2.15-dev.591279008",
|
|
4
|
+
"description": "Golemio Core Module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"golemio-import-test-data": "bin/import-test-data.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "rimraf ./dist && ttsc -p ./tsconfig.build.json",
|
|
12
|
+
"build-minimal": "run-s 'build --sourceMap false --declaration false'",
|
|
13
|
+
"build-watch": "run-s 'build --watch --preserveWatchOutput'",
|
|
14
|
+
"test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config 'test/**/*.test.ts'",
|
|
15
|
+
"test-debug": "run-s 'test --inspect-brk=9230'",
|
|
16
|
+
"code-coverage": "nyc run-s 'test -r source-map-support/register'",
|
|
17
|
+
"generate-docs": "typedoc --out docs/typedoc src",
|
|
18
|
+
"lint": "eslint --cache \"{src,test}/**/*.ts\""
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"golemio"
|
|
22
|
+
],
|
|
23
|
+
"author": "Operator ICT, a.s.",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://gitlab.com/operator-ict/golemio/code/modules/core"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@commitlint/cli": "^16.2.1",
|
|
31
|
+
"@commitlint/config-conventional": "^16.2.1",
|
|
32
|
+
"@golemio/eslint-config": "^1.1.0",
|
|
33
|
+
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
|
34
|
+
"@types/amqplib": "^0.5.17",
|
|
35
|
+
"@types/chai": "4.2.3",
|
|
36
|
+
"@types/chai-as-promised": "7.1.2",
|
|
37
|
+
"@types/content-type": "^1.1.3",
|
|
38
|
+
"@types/debug": "0.0.31",
|
|
39
|
+
"@types/decompress": "^4.2.3",
|
|
40
|
+
"@types/lodash": "^4.14.165",
|
|
41
|
+
"@types/mocha": "^8.2.0",
|
|
42
|
+
"@types/morgan": "^1.9.2",
|
|
43
|
+
"@types/node": "^16.11.35",
|
|
44
|
+
"@types/sinon": "7.0.13",
|
|
45
|
+
"@types/ssh2-sftp-client": "^5.3.1",
|
|
46
|
+
"@types/supertest": "^2.0.11",
|
|
47
|
+
"chai": "4.2.0",
|
|
48
|
+
"chai-as-promised": "7.1.1",
|
|
49
|
+
"cross-env": "^7.0.3",
|
|
50
|
+
"eslint": "^8.1.1",
|
|
51
|
+
"husky": "^4.3.7",
|
|
52
|
+
"mocha": "^9.1.2",
|
|
53
|
+
"nock": "^13.0.5",
|
|
54
|
+
"npm-run-all": "^4.1.5",
|
|
55
|
+
"nyc": "^15.1.0",
|
|
56
|
+
"prettier": "^2.5.1",
|
|
57
|
+
"pretty-quick": "^3.1.0",
|
|
58
|
+
"rimraf": "^3.0.2",
|
|
59
|
+
"sinon": "7.1.1",
|
|
60
|
+
"source-map-support": "0.5.9",
|
|
61
|
+
"supertest": "^6.1.6",
|
|
62
|
+
"ts-node": "^10.7.0",
|
|
63
|
+
"ttypescript": "^1.5.13",
|
|
64
|
+
"typedoc": "^0.22.15",
|
|
65
|
+
"typescript": "4.6.4"
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@golemio/errors": "^1.0.1",
|
|
69
|
+
"@golemio/utils": "^1.0.0",
|
|
70
|
+
"@golemio/validator": "0.2.3",
|
|
71
|
+
"@google-cloud/storage": "^5.18.0",
|
|
72
|
+
"@opentelemetry/api": "1.0.4",
|
|
73
|
+
"@opentelemetry/exporter-jaeger": "^1.2.0",
|
|
74
|
+
"@opentelemetry/instrumentation-amqplib": "^0.28.0",
|
|
75
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.6.0",
|
|
76
|
+
"@opentelemetry/instrumentation-express": "^0.28.0",
|
|
77
|
+
"@opentelemetry/instrumentation-http": "^0.27.0",
|
|
78
|
+
"@opentelemetry/instrumentation-ioredis": "^0.28.0",
|
|
79
|
+
"@opentelemetry/instrumentation-pg": "^0.28.0",
|
|
80
|
+
"@opentelemetry/instrumentation-redis": "^0.29.0",
|
|
81
|
+
"@opentelemetry/resources": "^1.2.0",
|
|
82
|
+
"@opentelemetry/sdk-trace-base": "^1.2.0",
|
|
83
|
+
"@opentelemetry/sdk-trace-node": "^1.2.0",
|
|
84
|
+
"@sentry/node": "^6.19.7",
|
|
85
|
+
"@sentry/tracing": "^6.19.7",
|
|
86
|
+
"@types/express": "^4.16.0",
|
|
87
|
+
"@types/luxon": "^2.3.1",
|
|
88
|
+
"@types/request-promise": "^4.1.45",
|
|
89
|
+
"ajv": "^8.10.0",
|
|
90
|
+
"amqplib": "^0.7.1",
|
|
91
|
+
"apicache-plus": "^2.3.1",
|
|
92
|
+
"aws-sdk": "^2.823.0",
|
|
93
|
+
"axios": "^0.24.0",
|
|
94
|
+
"basic-ftp": "^4.6.6",
|
|
95
|
+
"content-type": "^1.0.4",
|
|
96
|
+
"debug": "3.1.0",
|
|
97
|
+
"decompress": "^4.2.1",
|
|
98
|
+
"dotenv": "^8.2.0",
|
|
99
|
+
"express": "^4.16.4",
|
|
100
|
+
"express-validator": "^5.3.1",
|
|
101
|
+
"fast-csv": "^4.3.6",
|
|
102
|
+
"fast-glob": "^3.2.5",
|
|
103
|
+
"iconv-lite": "^0.6.2",
|
|
104
|
+
"ioredis": "^4.28.5",
|
|
105
|
+
"lightship": "^6.7.2",
|
|
106
|
+
"lodash": "^4.17.21",
|
|
107
|
+
"luxon": "^2.3.2",
|
|
108
|
+
"moment-timezone": "^0.5.26",
|
|
109
|
+
"mongodb-restore-dump": "1.0.1",
|
|
110
|
+
"mongoose": "^5.3.6",
|
|
111
|
+
"morgan": "^1.10.0",
|
|
112
|
+
"opentelemetry-instrumentation-mongoose": "^0.27.1",
|
|
113
|
+
"opentelemetry-instrumentation-sequelize": "^0.27.1",
|
|
114
|
+
"path-to-regexp": "^6.2.0",
|
|
115
|
+
"pg": "^8.6.0",
|
|
116
|
+
"prom-client": "^14.0.0",
|
|
117
|
+
"redis": "^3.1.1",
|
|
118
|
+
"request": "2.88.0",
|
|
119
|
+
"request-promise": "^4.2.5",
|
|
120
|
+
"sequelize": "^6.6.5",
|
|
121
|
+
"ssh2-sftp-client": "^7.1.0",
|
|
122
|
+
"winston": "^3.3.3",
|
|
123
|
+
"xml2js-es6-promise": "^1.1.1"
|
|
124
|
+
},
|
|
125
|
+
"resolutions": {
|
|
126
|
+
"moment": "2.29.4"
|
|
127
|
+
}
|
|
129
128
|
}
|