@conduitplatform/grpc-sdk 0.15.5 → 0.15.7

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.
@@ -1,6 +1,24 @@
1
- import { Redis, RedisOptions } from 'ioredis';
1
+ import { Cluster, ClusterOptions, Redis, RedisOptions } from 'ioredis';
2
2
  export declare class RedisManager {
3
- redisConnection: RedisOptions;
4
- constructor(redisIp: string, redisPort: any);
5
- getClient(connectionOps?: RedisOptions): Redis;
3
+ redisConnection: RedisOptions | {
4
+ nodes: {
5
+ host: string;
6
+ port: number;
7
+ }[];
8
+ options: ClusterOptions;
9
+ };
10
+ constructor(redisDetails?: RedisOptions | {
11
+ nodes: {
12
+ host: string;
13
+ port: number;
14
+ }[];
15
+ options: ClusterOptions;
16
+ });
17
+ getClient(options?: RedisOptions | {
18
+ nodes: {
19
+ host: string;
20
+ port: number;
21
+ }[];
22
+ options: ClusterOptions;
23
+ }): Redis | Cluster;
6
24
  }
@@ -17,14 +17,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.RedisManager = void 0;
18
18
  var ioredis_1 = __importDefault(require("ioredis"));
19
19
  var RedisManager = /** @class */ (function () {
20
- function RedisManager(redisIp, redisPort) {
21
- this.redisConnection = {
22
- host: redisIp,
23
- port: redisPort,
24
- };
20
+ function RedisManager(redisDetails) {
21
+ this.redisConnection = __assign({}, redisDetails);
25
22
  }
26
- RedisManager.prototype.getClient = function (connectionOps) {
27
- return new ioredis_1.default(__assign(__assign({}, this.redisConnection), connectionOps));
23
+ RedisManager.prototype.getClient = function (options) {
24
+ if (this.redisConnection.hasOwnProperty('nodes')) {
25
+ var clusterOptions = this.redisConnection;
26
+ return new ioredis_1.default.Cluster(clusterOptions.nodes, clusterOptions.options);
27
+ }
28
+ else {
29
+ return new ioredis_1.default(__assign(__assign({}, this.redisConnection), options));
30
+ }
28
31
  };
29
32
  return RedisManager;
30
33
  }());
@@ -1 +1 @@
1
- {"version":3,"file":"RedisManager.js","sourceRoot":"","sources":["../../src/utilities/RedisManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAuD;AAEvD;IAGE,sBAAY,OAAe,EAAE,SAAc;QACzC,IAAI,CAAC,eAAe,GAAG;YACrB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,SAAS;SAChB,CAAC;IACJ,CAAC;IAED,gCAAS,GAAT,UAAU,aAA4B;QACpC,OAAO,IAAI,iBAAO,uBAAM,IAAI,CAAC,eAAe,GAAK,aAAa,EAAG,CAAC;IACpE,CAAC;IACH,mBAAC;AAAD,CAAC,AAbD,IAaC;AAbY,oCAAY"}
1
+ {"version":3,"file":"RedisManager.js","sourceRoot":"","sources":["../../src/utilities/RedisManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAgF;AAEhF;IAKE,sBACE,YAEwE;QAExE,IAAI,CAAC,eAAe,gBACf,YAAY,CAChB,CAAC;IACJ,CAAC;IACD,gCAAS,GAAT,UACE,OAEwE;QAExE,IAAI,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE;YAChD,IAAM,cAAc,GAAG,IAAI,CAAC,eAG3B,CAAC;YACF,OAAO,IAAI,iBAAO,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;SAC1E;aAAM;YACL,OAAO,IAAI,iBAAO,uBAAO,IAAI,CAAC,eAAgC,GAAK,OAAO,EAAG,CAAC;SAC/E;IACH,CAAC;IACH,mBAAC;AAAD,CAAC,AA7BD,IA6BC;AA7BY,oCAAY"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduitplatform/grpc-sdk",
3
- "version": "0.15.5",
3
+ "version": "0.15.7",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "engines": {
@@ -23,6 +23,7 @@
23
23
  "convict": "^6.2.3",
24
24
  "express": "^4.18.1",
25
25
  "fast-jwt": "^1.6.0",
26
+ "fs-extra": "^10.1.0",
26
27
  "ioredis": "^5.1.0",
27
28
  "lodash": "^4.17.21",
28
29
  "nice-grpc": "^1.2.0",
@@ -47,6 +48,7 @@
47
48
  "devDependencies": {
48
49
  "@types/convict": "^6.1.1",
49
50
  "@types/express": "^4.17.13",
51
+ "@types/fs-extra": "^9.0.13",
50
52
  "@types/google-protobuf": "^3.15.6",
51
53
  "@types/ioredis": "^4.28.10",
52
54
  "@types/lodash": "^4.14.182",