@chat-adapter/state-ioredis 4.27.0 → 4.29.0

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +11 -5
  2. package/package.json +5 -2
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Logger, StateAdapter, Lock, QueueEntry } from 'chat';
2
2
  import Redis from 'ioredis';
3
3
 
4
- interface IoRedisStateAdapterOptions {
4
+ interface IoRedisStateAdapterUrlOptions {
5
5
  /** Key prefix for all Redis keys (default: "chat-sdk") */
6
6
  keyPrefix?: string;
7
7
  /** Logger instance for error reporting */
@@ -9,7 +9,7 @@ interface IoRedisStateAdapterOptions {
9
9
  /** Redis connection URL (e.g., redis://localhost:6379) */
10
10
  url: string;
11
11
  }
12
- interface IoRedisStateClientOptions {
12
+ interface IoRedisStateAdapterClientOptions {
13
13
  /** Existing ioredis client instance */
14
14
  client: Redis;
15
15
  /** Key prefix for all Redis keys (default: "chat-sdk") */
@@ -17,6 +17,12 @@ interface IoRedisStateClientOptions {
17
17
  /** Logger instance for error reporting */
18
18
  logger: Logger;
19
19
  }
20
+ type IoRedisStateAdapterOptions = IoRedisStateAdapterUrlOptions | IoRedisStateAdapterClientOptions;
21
+ /**
22
+ * @deprecated Use `IoRedisStateAdapterClientOptions`. Renamed for consistency
23
+ * with the rest of the state adapter packages.
24
+ */
25
+ type IoRedisStateClientOptions = IoRedisStateAdapterClientOptions;
20
26
  /**
21
27
  * Redis state adapter using ioredis for production use.
22
28
  *
@@ -40,7 +46,7 @@ declare class IoRedisStateAdapter implements StateAdapter {
40
46
  private connected;
41
47
  private connectPromise;
42
48
  private readonly ownsClient;
43
- constructor(options: IoRedisStateAdapterOptions | IoRedisStateClientOptions);
49
+ constructor(options: IoRedisStateAdapterOptions);
44
50
  private key;
45
51
  private subscriptionsSetKey;
46
52
  connect(): Promise<void>;
@@ -84,6 +90,6 @@ declare class IoRedisStateAdapter implements StateAdapter {
84
90
  * const state = createIoRedisState({ client });
85
91
  * ```
86
92
  */
87
- declare function createIoRedisState(options: IoRedisStateAdapterOptions | IoRedisStateClientOptions): IoRedisStateAdapter;
93
+ declare function createIoRedisState(options: IoRedisStateAdapterOptions): IoRedisStateAdapter;
88
94
 
89
- export { IoRedisStateAdapter, type IoRedisStateAdapterOptions, type IoRedisStateClientOptions, createIoRedisState };
95
+ export { IoRedisStateAdapter, type IoRedisStateAdapterClientOptions, type IoRedisStateAdapterOptions, type IoRedisStateAdapterUrlOptions, type IoRedisStateClientOptions, createIoRedisState };
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@chat-adapter/state-ioredis",
3
- "version": "4.27.0",
3
+ "version": "4.29.0",
4
4
  "description": "ioredis state adapter for chat (production)",
5
5
  "type": "module",
6
+ "engines": {
7
+ "node": ">=20"
8
+ },
6
9
  "main": "./dist/index.js",
7
10
  "module": "./dist/index.js",
8
11
  "types": "./dist/index.d.ts",
@@ -17,7 +20,7 @@
17
20
  ],
18
21
  "dependencies": {
19
22
  "ioredis": "^5.4.1",
20
- "chat": "4.27.0"
23
+ "chat": "4.29.0"
21
24
  },
22
25
  "repository": {
23
26
  "type": "git",