@mulingai-npm/redis 1.2.3 → 1.2.4

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.
@@ -13,11 +13,6 @@ export declare class MulingstreamListenerManager {
13
13
  private redisClient;
14
14
  constructor(redisClient: RedisClient);
15
15
  private parseHashData;
16
- /**
17
- * Creates a new listener.
18
- * 1) Generates a unique listenerId and adds it to the room's set.
19
- * 2) Stores the listener data in a Redis hash under `listener:{listenerId}`.
20
- */
21
16
  addListener(listenerData: Omit<MulingstreamListenerData, 'listenerId'>): Promise<string>;
22
17
  getAllListeners(): Promise<MulingstreamListenerData[]>;
23
18
  getListenersByRoom(roomId: string): Promise<MulingstreamListenerData[]>;
@@ -18,15 +18,13 @@ class MulingstreamListenerManager {
18
18
  isActive: data.isActive === 'true'
19
19
  };
20
20
  }
21
- /**
22
- * Creates a new listener.
23
- * 1) Generates a unique listenerId and adds it to the room's set.
24
- * 2) Stores the listener data in a Redis hash under `listener:{listenerId}`.
25
- */
21
+ // Creates a new listener.
22
+ // -Generates a unique listenerId and adds it to the room's set.
23
+ // -Stores the listener data in a Redis hash under `listener:{listenerId}`.
26
24
  async addListener(listenerData) {
27
25
  var _a, _b, _c;
28
26
  // You can combine roomId + uuid, or just a uuid, up to you:
29
- const listenerId = `${listenerData.roomId}--${(0, uuid_1.v4)()}`;
27
+ const listenerId = `[${listenerData.roomId}]-[${(0, uuid_1.v4)()}]`;
30
28
  // Add listenerId to the set for that room
31
29
  await this.redisClient.sadd(`room:${listenerData.roomId}:listeners`, listenerId);
32
30
  // Store listener data in a hash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mulingai-npm/redis",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {