@mulingai-npm/redis 3.40.6 → 3.40.9

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.
@@ -51,6 +51,8 @@ export declare class RedisClient {
51
51
  jsonArrAppend<T>(key: string, path: string, ...values: T[]): Promise<number>;
52
52
  jsonArrLen(key: string, path: string): Promise<number | null>;
53
53
  jsonArrPop(key: string, path: string, index?: number): Promise<any>;
54
+ publish(channel: string, message: string): Promise<number>;
55
+ createSubscriber(): IORedis;
54
56
  flushAll(): Promise<string>;
55
57
  flushDb(): Promise<string>;
56
58
  }
@@ -155,6 +155,13 @@ class RedisClient {
155
155
  async jsonArrPop(key, path, index) {
156
156
  return index !== undefined ? this.client.call('JSON.ARRPOP', key, path, index) : this.client.call('JSON.ARRPOP', key, path);
157
157
  }
158
+ // Pub/Sub support
159
+ async publish(channel, message) {
160
+ return this.client.publish(channel, message);
161
+ }
162
+ createSubscriber() {
163
+ return this.client.duplicate();
164
+ }
158
165
  async flushAll() {
159
166
  console.warn('Flushing all Redis data!');
160
167
  return this.client.flushall();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mulingai-npm/redis",
3
- "version": "3.40.6",
3
+ "version": "3.40.9",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {