redis-smq-common 1.0.0-rc.4 → 1.0.0-rc.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.0.0-rc.5 (2022-05-30)
4
+
5
+ Update IRedisClientMulti interface (be1c534)
6
+
3
7
  ## 1.0.0-rc.4 (2022-05-30)
4
8
 
5
9
  * Update docs (5b88f1d)
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { errors } from './src/errors';
3
3
  export { LockManager } from './src/lock-manager/lock-manager';
4
4
  export { logger } from './src/logger/logger';
5
5
  export { PowerManager } from './src/power-manager/power-manager';
6
- export { RedisClient } from './src/redis-client/redis-client';
6
+ export { createClientInstance } from './src/redis-client/create-client-instance';
7
7
  export { Ticker } from './src/ticker/ticker';
8
8
  export { Worker } from './src/worker/worker';
9
9
  export { WorkerRunner } from './src/worker/worker-runner/worker-runner';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.events = exports.WorkerPool = exports.WorkerRunner = exports.Worker = exports.Ticker = exports.RedisClient = exports.PowerManager = exports.logger = exports.LockManager = exports.errors = exports.async = void 0;
3
+ exports.events = exports.WorkerPool = exports.WorkerRunner = exports.Worker = exports.Ticker = exports.createClientInstance = exports.PowerManager = exports.logger = exports.LockManager = exports.errors = exports.async = void 0;
4
4
  var async_1 = require("./src/async/async");
5
5
  Object.defineProperty(exports, "async", { enumerable: true, get: function () { return async_1.async; } });
6
6
  var errors_1 = require("./src/errors");
@@ -11,8 +11,8 @@ var logger_1 = require("./src/logger/logger");
11
11
  Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return logger_1.logger; } });
12
12
  var power_manager_1 = require("./src/power-manager/power-manager");
13
13
  Object.defineProperty(exports, "PowerManager", { enumerable: true, get: function () { return power_manager_1.PowerManager; } });
14
- var redis_client_1 = require("./src/redis-client/redis-client");
15
- Object.defineProperty(exports, "RedisClient", { enumerable: true, get: function () { return redis_client_1.RedisClient; } });
14
+ var create_client_instance_1 = require("./src/redis-client/create-client-instance");
15
+ Object.defineProperty(exports, "createClientInstance", { enumerable: true, get: function () { return create_client_instance_1.createClientInstance; } });
16
16
  var ticker_1 = require("./src/ticker/ticker");
17
17
  Object.defineProperty(exports, "Ticker", { enumerable: true, get: function () { return ticker_1.Ticker; } });
18
18
  var worker_1 = require("./src/worker/worker");
@@ -12,11 +12,11 @@ export declare class IoredisClientMulti implements IRedisClientMulti {
12
12
  zadd(key: string, score: number, element: string): this;
13
13
  zrem(key: string, element: string): this;
14
14
  sadd(key: string, element: string): this;
15
- srem(key: string, element: string): this;
15
+ srem(key: string, element: string | string[]): this;
16
16
  hset(key: string, field: string, value: string): this;
17
17
  hdel(key: string, field: string): this;
18
18
  pexpire(key: string, millis: number): this;
19
19
  rpoplpush(source: string, destination: string): this;
20
- del(key: string): this;
20
+ del(key: string | string[]): this;
21
21
  exec(cb: ICallback<unknown[]>): void;
22
22
  }
@@ -43,7 +43,7 @@ class IoredisClientMulti {
43
43
  return this;
44
44
  }
45
45
  srem(key, element) {
46
- this.multi.srem(key, element);
46
+ this.multi.srem(key, ...element);
47
47
  return this;
48
48
  }
49
49
  hset(key, field, value) {
@@ -63,7 +63,7 @@ class IoredisClientMulti {
63
63
  return this;
64
64
  }
65
65
  del(key) {
66
- this.multi.del(key);
66
+ this.multi.del(...key);
67
67
  return this;
68
68
  }
69
69
  exec(cb) {
@@ -12,11 +12,11 @@ export declare class NodeRedisV3ClientMulti implements IRedisClientMulti {
12
12
  zadd(key: string, score: number, element: string): this;
13
13
  zrem(key: string, element: string): this;
14
14
  sadd(key: string, element: string): this;
15
- srem(key: string, element: string): this;
15
+ srem(key: string, element: string | string[]): this;
16
16
  hset(key: string, field: string, value: string): this;
17
17
  hdel(key: string, field: string): this;
18
18
  pexpire(key: string, millis: number): this;
19
19
  rpoplpush(source: string, destination: string): this;
20
- del(key: string): this;
20
+ del(key: string | string[]): this;
21
21
  exec(cb: ICallback<unknown[]>): void;
22
22
  }
@@ -11,11 +11,11 @@ export declare class NodeRedisV4ClientMulti implements IRedisClientMulti {
11
11
  zadd(key: string, score: number, element: string): this;
12
12
  zrem(key: string, element: string): this;
13
13
  sadd(key: string, element: string): this;
14
- srem(key: string, element: string): this;
14
+ srem(key: string, element: string | string[]): this;
15
15
  hset(key: string, field: string, value: string): this;
16
16
  hdel(key: string, field: string): this;
17
17
  pexpire(key: string, millis: number): this;
18
18
  rpoplpush(source: string, destination: string): this;
19
- del(key: string): this;
19
+ del(key: string | string[]): this;
20
20
  exec(cb: ICallback<unknown[]>): void;
21
21
  }
@@ -0,0 +1,3 @@
1
+ import { ICallback, TRedisConfig } from '../../types';
2
+ import { RedisClient } from './redis-client';
3
+ export declare function createClientInstance(config: TRedisConfig, cb: ICallback<RedisClient>): void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createInstance = void 0;
3
+ exports.createClientInstance = void 0;
4
4
  const types_1 = require("../../types");
5
5
  const async_1 = require("../async/async");
6
6
  const node_redis_v3_client_1 = require("./clients/node-redis-v3-client");
@@ -15,7 +15,7 @@ function getClient(config) {
15
15
  }
16
16
  return new ioredis_client_1.IoredisClient(config.options);
17
17
  }
18
- function createInstance(config, cb) {
18
+ function createClientInstance(config, cb) {
19
19
  const client = getClient(config);
20
20
  client.once('ready', () => {
21
21
  async_1.async.waterfall([
@@ -29,5 +29,5 @@ function createInstance(config, cb) {
29
29
  });
30
30
  });
31
31
  }
32
- exports.createInstance = createInstance;
33
- //# sourceMappingURL=create-instance.js.map
32
+ exports.createClientInstance = createClientInstance;
33
+ //# sourceMappingURL=create-client-instance.js.map
@@ -30,8 +30,8 @@ export interface IRedisClientMulti {
30
30
  rpop(key: string): this;
31
31
  lpush(key: string, element: string): this;
32
32
  hdel(key: string, field: string): this;
33
- del(key: string): this;
34
- srem(key: string, element: string): this;
33
+ del(key: string | string[]): this;
34
+ srem(key: string, element: string | string[]): this;
35
35
  sadd(key: string, element: string): this;
36
36
  zrem(key: string, element: string): this;
37
37
  zadd(key: string, score: number, element: string): this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redis-smq-common",
3
- "version": "1.0.0-rc.4",
3
+ "version": "1.0.0-rc.5",
4
4
  "description": "RedisSMQ shared components that may be used by integrated applications and extensions.",
5
5
  "author": "Weyoss <weyoss@protonmail.com>",
6
6
  "license": "MIT",
@@ -1,3 +0,0 @@
1
- import { ICallback, TRedisConfig } from '../../types';
2
- import { RedisClient } from './redis-client';
3
- export declare function createInstance(config: TRedisConfig, cb: ICallback<RedisClient>): void;