@maiyunnet/kebab 9.29.5 → 10.0.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 (64) hide show
  1. package/abox/proxy.js +24 -2
  2. package/abox/response.js +36 -17
  3. package/abox/session-login.js +1 -13
  4. package/abox/text.d.ts +2 -0
  5. package/abox/text.js +51 -0
  6. package/doc/kebab-rag.md +2700 -1270
  7. package/index.d.ts +12 -1
  8. package/index.js +1 -1
  9. package/lib/ai.d.ts +4 -0
  10. package/lib/ai.js +32 -16
  11. package/lib/cookie.d.ts +2 -0
  12. package/lib/cookie.js +47 -45
  13. package/lib/core.d.ts +26 -0
  14. package/lib/core.js +36 -13
  15. package/lib/cron.js +1 -8
  16. package/lib/crypto.js +20 -6
  17. package/lib/db/conn.d.ts +10 -1
  18. package/lib/db/conn.js +1 -5
  19. package/lib/db/pool.d.ts +10 -2
  20. package/lib/db/pool.js +0 -6
  21. package/lib/db/tran.d.ts +10 -1
  22. package/lib/db/tran.js +0 -5
  23. package/lib/db.d.ts +3 -3
  24. package/lib/fs.js +78 -31
  25. package/lib/kv.d.ts +216 -88
  26. package/lib/kv.js +520 -230
  27. package/lib/s3.d.ts +2 -0
  28. package/lib/s3.js +14 -27
  29. package/lib/session.d.ts +7 -0
  30. package/lib/session.js +23 -2
  31. package/lib/socket.d.ts +4 -1
  32. package/lib/socket.js +1 -0
  33. package/lib/sql.d.ts +0 -5
  34. package/lib/sql.js +48 -12
  35. package/lib/text.d.ts +32 -8
  36. package/lib/text.js +30 -17
  37. package/lib/turnstile.d.ts +6 -0
  38. package/lib/turnstile.js +16 -9
  39. package/lib/undici/response.d.ts +13 -3
  40. package/lib/undici/response.js +0 -1
  41. package/lib/undici.d.ts +33 -1
  42. package/lib/undici.js +72 -56
  43. package/lib/vector.d.ts +33 -19
  44. package/lib/vector.js +0 -1
  45. package/lib/ws.d.ts +1 -1
  46. package/lib/ws.js +85 -128
  47. package/lib/zip.js +46 -45
  48. package/package.json +2 -2
  49. package/sys/child.js +178 -146
  50. package/sys/cmd.js +196 -197
  51. package/sys/ctr.d.ts +14 -14
  52. package/sys/ctr.js +145 -59
  53. package/sys/master.js +111 -80
  54. package/sys/mod.d.ts +112 -51
  55. package/sys/mod.js +23 -51
  56. package/sys/monitor/files.d.ts +2 -1
  57. package/sys/monitor/files.js +77 -21
  58. package/sys/monitor/watchdog.d.ts +7 -0
  59. package/sys/monitor/watchdog.js +311 -203
  60. package/sys/monitor.d.ts +59 -54
  61. package/sys/monitor.js +742 -681
  62. package/sys/route.d.ts +4 -4
  63. package/sys/route.js +93 -52
  64. package/www/example/ctr/test.js +8 -8
package/lib/kv.d.ts CHANGED
@@ -1,34 +1,13 @@
1
1
  /**
2
2
  * Project: Kebab, User: JianSuoQiYue
3
3
  * Date: 2019-5-30 19:25:22
4
- * Last: 2020-3-28 18:54:04, 2022-09-12 23:24:45, 2022-09-22 01:06:22, 2024-2-21 13:32:56, 2024-8-21 16:59:57, 2025-11-6 14:56:45
5
4
  */
6
- import * as redis from '@litert/redis';
5
+ import type * as tls from 'node:tls';
6
+ import * as redis from 'redis';
7
7
  import * as kebab from '#kebab/index.js';
8
8
  import * as sCtr from '#kebab/sys/ctr.js';
9
- export interface IZRangeOptions {
10
- /**
11
- * Range query type.
12
- *
13
- * - SCORE: Query by score range
14
- * - LEX: Query by lexicographical range
15
- */
16
- 'by'?: 'SCORE' | 'LEX';
17
- /**
18
- * Whether to return results in reverse order.
19
- */
20
- 'rev'?: boolean;
21
- /**
22
- * Pagination offset. Must be used together with count.
23
- */
24
- 'offset'?: number;
25
- /**
26
- * Pagination count. Must be used together with offset.
27
- */
28
- 'count'?: number;
29
- }
30
9
  /**
31
- * --- 键值存储操作类 ---
10
+ * --- 键值存储操作类(兼容 Redis 与 Kvrocks) ---
32
11
  *
33
12
  * @example
34
13
  * ```ts
@@ -42,29 +21,46 @@ export interface IZRangeOptions {
42
21
  export declare class Kv {
43
22
  /** --- 当前的 kv 连接信息 --- */
44
23
  private readonly _etc;
24
+ /** --- 实际向服务端选择的数据库编号 --- */
25
+ private readonly _db;
26
+ /** --- 实际生效的键名前缀(启用 dbPre 且 index > 0 时自动附带 db{index}:) --- */
27
+ private readonly _pre;
45
28
  constructor(etc: kebab.IConfigKv);
46
29
  /**
47
- * --- 获取当前 Kv 配置的键名前缀 ---
48
- * @returns 原生 pipeline 不会自动添加的项目前缀
30
+ * --- 获取当前 Kv 实际生效的键名前缀 ---
31
+ * @returns 原生 pipeline / eval 不会自动添加的项目前缀
49
32
  */
50
33
  getPre(): string;
51
34
  /**
52
- * --- 获取一个 pipeline 操作对象 ---
35
+ * --- 获取底层官方 redis 客户端实例(用于执行原生扩展命令) ---
36
+ * @returns 连接失败返回 null
37
+ */
38
+ getClient(): Promise<TRedisClient | null>;
39
+ /**
40
+ * --- 获取一个绑定在共享连接上的原生 multi / pipeline 对象(通过 execAsPipeline() 或 exec() 执行,无需关闭) ---
53
41
  * @returns 失败则返回 false
54
42
  */
55
- pipeline(): Promise<redis.IPipelineClient | false>;
43
+ pipeline(): Promise<TRedisMulti | false>;
44
+ /**
45
+ * --- 在共享连接上执行一个 Redis Lua 脚本 ---
46
+ * @param script Lua 源码
47
+ * @param keys 传给 KEYS 的完整键名,调用方需自行添加项目前缀
48
+ * @param args 传给 ARGV 的参数
49
+ * @returns Redis 原始结果,nil 返回 null,连接或执行失败返回 false
50
+ */
51
+ eval(script: string, keys: string[], args: Array<string | Buffer>): Promise<unknown>;
56
52
  /**
57
53
  * --- 设定一个值 ---
58
- * @param key
59
- * @param val
54
+ * @param key 键
55
+ * @param val 值
60
56
  * @param ttl 秒,0 为不限制
61
57
  * @param mod 设置模式: 空,nx(key不存在才建立),xx(key存在才修改)
62
58
  */
63
59
  set(key: string, val: object | string | number, ttl?: number, mod?: '' | 'nx' | 'xx'): Promise<boolean>;
64
60
  /**
65
61
  * --- 添加一个值,存在则不变 ---
66
- * @param key
67
- * @param val
62
+ * @param key 键
63
+ * @param val 值
68
64
  * @param ttl 秒,0 为不限制
69
65
  */
70
66
  add(key: string, val: object | string | number, ttl?: number): Promise<boolean>;
@@ -83,8 +79,8 @@ export declare class Kv {
83
79
  append(key: string, val: string): Promise<boolean>;
84
80
  /**
85
81
  * --- 向已存在的值之前追加数据 ---
86
- * @param key
87
- * @param val
82
+ * @param key 键
83
+ * @param val 值
88
84
  */
89
85
  prepend(key: string, val: string): Promise<boolean>;
90
86
  /**
@@ -94,18 +90,18 @@ export declare class Kv {
94
90
  exists(keys: string | string[]): Promise<number>;
95
91
  /**
96
92
  * --- 获取字符串 ---
97
- * @param key
93
+ * @param key 键
98
94
  * @returns 字符串 / false / null(即使存入时是 number,这个方法也只会返回字符串)
99
95
  */
100
96
  get(key: string): Promise<string | false | null>;
101
97
  /**
102
98
  * --- 获取相应的剩余有效期秒数 ---
103
- * @param key
99
+ * @param key 键
104
100
  */
105
101
  ttl(key: string): Promise<number | null>;
106
102
  /**
107
103
  * --- 获取相应的剩余有效期毫秒数 ---
108
- * @param key
104
+ * @param key 键
109
105
  */
110
106
  pttl(key: string): Promise<number | null>;
111
107
  /**
@@ -114,55 +110,71 @@ export declare class Kv {
114
110
  */
115
111
  mGet(keys: string[]): Promise<Record<string, string | null> | false>;
116
112
  /**
117
- * --- 批量设置哈希值 ---
118
- * @param rows key / val 数组
113
+ * --- 批量设置键值 ---
114
+ * @param rows key / val 对象
119
115
  */
120
116
  mSet(rows: Record<string, string | Buffer>): Promise<boolean>;
121
117
  /**
122
- * --- 获取 json 对象 ---
123
- * @param key
118
+ * --- 读取并解析键中的 JSON ---
119
+ * @param key 键
120
+ * @returns 解析结果,键不存在或未取得连接返回 null,读取异常或解析失败返回 false
121
+ */
122
+ getJson(key: string): Promise<kebab.Json | false | null>;
123
+ /**
124
+ * --- 读取并解析键中的 JSON ---
125
+ * @typeParam T 预期的结果类型,解析时只检查 JSON 语法
126
+ * @param key 键
127
+ * @returns 解析结果,键不存在或未取得连接返回 null,读取异常或解析失败返回 false
128
+ */
129
+ getJson<T>(key: string): Promise<T | false | null>;
130
+ /**
131
+ * --- 原子读取并删除键,再解析 JSON ---
132
+ * @param key 键
133
+ * @returns 解析结果,键不存在返回 null,Redis 操作或解析失败返回 false
124
134
  */
125
- getJson(key: string): Promise<any | false | null>;
135
+ getDelJson(key: string): Promise<kebab.Json | false | null>;
126
136
  /**
127
- * --- 原子获取并删除 JSON 对象 ---
137
+ * --- 原子读取并删除键,再解析 JSON ---
138
+ * @typeParam T 预期的结果类型,解析时只检查 JSON 语法
128
139
  * @param key 键
140
+ * @returns 解析结果,键不存在返回 null,Redis 操作或解析失败返回 false
129
141
  */
130
- getDelJson(key: string): Promise<any | false | null>;
142
+ getDelJson<T>(key: string): Promise<T | false | null>;
131
143
  /**
132
144
  * --- 删除已存在的值 ---
133
- * @param keys
145
+ * @param keys 单个或序列
134
146
  */
135
147
  del(keys: string | string[]): Promise<boolean>;
136
148
  /**
137
149
  * --- 自增 ---
138
- * @param key
150
+ * @param key 键
139
151
  * @param num 整数或浮点正数
140
152
  */
141
153
  incr(key: string, num?: number): Promise<number | false>;
142
154
  /**
143
155
  * --- 自减 ---
144
- * @param key
156
+ * @param key 键
145
157
  * @param num 整数或浮点正数
146
158
  */
147
159
  decr(key: string, num?: number): Promise<number | false>;
148
160
  /**
149
161
  * --- 仅修改过期时间不修改值 ---
150
- * @param key
151
- * @param ttl
162
+ * @param key 键
163
+ * @param ttl 秒
152
164
  */
153
165
  expire(key: string, ttl: number): Promise<boolean>;
154
166
  /**
155
167
  * --- 获取服务器上的所有 key 列表 ---
156
- * @param pattern
168
+ * @param pattern 匹配模式
157
169
  */
158
170
  keys(pattern: string): Promise<string[] | false>;
159
171
  /**
160
- * --- 根据条件获取服务器上的 keys ---
161
- * @param cursor
172
+ * --- 根据条件获取服务器上的 keys(兼容 Redis 数字串游标与 Kvrocks 字符串游标) ---
173
+ * @param cursor 游标,首次传 '0'(或 0)
162
174
  * @param pattern 例如 *
163
175
  * @param count 获取的条数
164
176
  */
165
- scan(cursor?: number, pattern?: string, count?: number): Promise<redis.IScanResult<string> | false>;
177
+ scan(cursor?: string | number, pattern?: string, count?: number): Promise<IScanResult | false>;
166
178
  /**
167
179
  * --- 清除当前所选数据库的所有内容 ---
168
180
  */
@@ -176,48 +188,57 @@ export declare class Kv {
176
188
  * @param key key 名
177
189
  * @param field 字段名
178
190
  * @param val 值
179
- * @param mod 空,nx(key不存在才建立)
191
+ * @param mod 空,nx(field不存在才建立)
180
192
  */
181
193
  hSet(key: string, field: string, val: object | string | number, mod?: '' | 'nx'): Promise<boolean>;
182
194
  /**
183
195
  * --- 批量设置哈希值 ---
184
196
  * @param key key 名
185
- * @param rows key / val 数组
197
+ * @param rows field / val 对象
186
198
  */
187
199
  hMSet(key: string, rows: Record<string, object | string | number>): Promise<boolean>;
188
200
  /**
189
201
  * --- 获取哈希值 ---
190
- * @param key
191
- * @param field
202
+ * @param key 键
203
+ * @param field 字段
192
204
  */
193
205
  hGet(key: string, field: string): Promise<string | false | null>;
194
206
  /**
195
- * --- 获取哈希 json 对象 ---
196
- * @param key
197
- * @param field
207
+ * --- 读取并解析哈希字段中的 JSON ---
208
+ * @param key 键
209
+ * @param field 哈希字段
210
+ * @returns 解析结果,字段不存在、JSON 无效或值为 JSON false 时返回 null;读取失败返回 false
211
+ */
212
+ hGetJson(key: string, field: string): Promise<kebab.Json | false | null>;
213
+ /**
214
+ * --- 读取并解析哈希字段中的 JSON ---
215
+ * @typeParam T 预期的结果类型,解析时只检查 JSON 语法
216
+ * @param key 键
217
+ * @param field 哈希字段
218
+ * @returns 解析结果,字段不存在、JSON 无效或值为 JSON false 时返回 null;读取失败返回 false
198
219
  */
199
- hGetJson(key: string, field: string): Promise<any | false | null>;
220
+ hGetJson<T>(key: string, field: string): Promise<T | false | null>;
200
221
  /**
201
222
  * --- 批量获取哈希值 ---
202
- * @param key
203
- * @param fields
223
+ * @param key 键
224
+ * @param fields 字段列表
204
225
  */
205
226
  hMGet(key: string, fields: string[]): Promise<Record<string, string | null> | false>;
206
227
  /**
207
228
  * --- 批量获取哈希键值对 ---
208
- * @param key
229
+ * @param key 键
209
230
  */
210
231
  hGetAll(key: string): Promise<Record<string, string | null> | false>;
211
232
  /**
212
233
  * --- 删除哈希键 ---
213
- * @param key
214
- * @param fields 值序列
234
+ * @param key 键
235
+ * @param fields 字段序列
215
236
  */
216
237
  hDel(key: string, fields: string | string[]): Promise<number | false>;
217
238
  /**
218
239
  * --- 判断哈希字段是否存在 ---
219
- * @param key
220
- * @param field
240
+ * @param key 键
241
+ * @param field 字段
221
242
  */
222
243
  hExists(key: string, field: string): Promise<boolean>;
223
244
  /**
@@ -229,16 +250,57 @@ export declare class Kv {
229
250
  hIncr(key: string, field: string, increment: number): Promise<number | false>;
230
251
  /**
231
252
  * --- 获取哈希所有字段 ---
232
- * @param key
253
+ * @param key 键
233
254
  */
234
255
  hKeys(key: string): Promise<string[] | false>;
256
+ /**
257
+ * --- 从列表左侧推入元素 ---
258
+ * @param key 键
259
+ * @param values 元素数组
260
+ */
235
261
  lPush(key: string, values: Array<string | Buffer>): Promise<number | false>;
262
+ /**
263
+ * --- 从列表右侧推入元素 ---
264
+ * @param key 键
265
+ * @param values 元素数组
266
+ */
236
267
  rPush(key: string, values: Array<string | Buffer>): Promise<number | false>;
268
+ /**
269
+ * --- 阻塞式在两个列表间移动元素(使用独立连接,避免阻塞共享连接) ---
270
+ * @param sourceKey 源列表键
271
+ * @param destKey 目标列表键
272
+ * @param soo 源端方向
273
+ * @param deo 目标端方向
274
+ * @param timeout 超时秒数,0 为无限等待
275
+ */
237
276
  bLMove(sourceKey: string, destKey: string, soo: 'LEFT' | 'RIGHT', deo: 'LEFT' | 'RIGHT', timeout: number): Promise<string | null | false>;
277
+ /**
278
+ * --- 从列表左侧弹出元素 ---
279
+ * @param key 键
280
+ */
238
281
  lPop(key: string): Promise<string | null | false>;
282
+ /**
283
+ * --- 从列表右侧弹出元素 ---
284
+ * @param key 键
285
+ */
239
286
  rPop(key: string): Promise<string | null | false>;
287
+ /**
288
+ * --- 阻塞式从列表右侧弹出元素(使用独立连接,避免阻塞共享连接) ---
289
+ * @param key 单个或序列键
290
+ * @param timeout 超时秒数,0 为无限等待
291
+ */
240
292
  bRPop(key: string | string[], timeout: number): Promise<Record<string, string> | false>;
293
+ /**
294
+ * --- 获取列表指定区间元素 ---
295
+ * @param key 键
296
+ * @param start 起始位置
297
+ * @param stop 结束位置
298
+ */
241
299
  lRange(key: string, start: number, stop: number): Promise<string[] | false>;
300
+ /**
301
+ * --- 获取列表长度 ---
302
+ * @param key 键
303
+ */
242
304
  lLen(key: string): Promise<number | false>;
243
305
  /**
244
306
  * --- 添加有序集合元素(单个元素) ---
@@ -251,56 +313,122 @@ export declare class Kv {
251
313
  * --- 添加有序集合元素(多个元素,含 INCR 选项) ---
252
314
  * @param key key 名
253
315
  * @param elements 元素数组
254
- * @param options 选项,需要 INCR
316
+ * @param options 选项(INCR 为 true 时返回新分数,条件未满足时返回 null)
255
317
  */
256
318
  zAdd(key: string, elements: Array<{
257
319
  'score': number;
258
320
  'member': string | Buffer;
259
- }>, options: redis.IZAddOptionsIncr): Promise<number | false>;
321
+ }>, options: IZAddOptions & {
322
+ 'INCR': true;
323
+ }): Promise<number | null | false>;
260
324
  /**
261
- * --- 添加有序集合元素(多个元素,含 INCR 选项,可空) ---
325
+ * --- 添加有序集合元素(多个元素) ---
262
326
  * @param key key 名
263
327
  * @param elements 元素数组
264
- * @param options 选项,需要 INCR Nullable
328
+ * @param options 选项
265
329
  */
266
330
  zAdd(key: string, elements: Array<{
267
331
  'score': number;
268
332
  'member': string | Buffer;
269
- }>, options: redis.IZAddOptionsIncrNullable): Promise<number | null | false>;
333
+ }>, options?: IZAddOptions): Promise<number | false>;
270
334
  /**
271
- * --- 添加有序集合元素(多个元素) ---
272
- * @param key key 名
273
- * @param elements 元素数组
274
- * @param options 选项
335
+ * --- 查询有序集合成员及分数 ---
336
+ * @param key 键
337
+ * @param start 起点
338
+ * @param stop 终点
339
+ * @param options 范围与分页选项
275
340
  */
276
- zAdd(key: string, elements: Array<{
341
+ zRangeWithScores(key: string, start: number | string, stop: number | string, options?: IZRangeOptions): Promise<Array<{
342
+ 'member': string;
277
343
  'score': number;
278
- 'member': string | Buffer;
279
- }>, options?: redis.IZAddOptions): Promise<number | false>;
280
- zRangeWithScores(key: string, start: number, stop: number, options?: IZRangeOptions): Promise<Array<{
281
- member: string;
282
- score: number;
283
344
  }> | false>;
345
+ /**
346
+ * --- 移除有序集合成员 ---
347
+ * @param key 键
348
+ * @param members 成员列表
349
+ */
284
350
  zRem(key: string, members: Array<string | Buffer>): Promise<number | false>;
285
351
  /**
286
- * --- 从连接池中获取一个符合要求的连接 ---
352
+ * --- 在独立副本连接上执行阻塞命令,避免阻塞共享连接和触发默认 5 秒命令超时 ---
353
+ * @param timeout 阻塞超时秒数,0 为无限等待
354
+ * @param fn 实际执行函数
355
+ */
356
+ private _runBlocking;
357
+ /**
358
+ * --- 从连接池中获取一个符合要求的共享连接 ---
287
359
  */
288
360
  private _getConnection;
361
+ /**
362
+ * --- 建立共享连接,统一走 RESP2 兼容 Redis 与 Kvrocks,并在非 0 库时校验 Kvrocks 多库隔离 ---
363
+ */
364
+ private _connect;
289
365
  }
290
366
  /**
291
367
  * --- 获取 Kv 对象 ---
292
368
  * @param ctrEtc 控制器或配置信息
293
- * @param oetc 可用来覆盖 ctr 的一些选项,如 index
369
+ * @param oetc 可用来覆盖 ctr 的部分连接选项
294
370
  */
295
371
  export declare function get(ctrEtc: sCtr.Ctr | kebab.IConfigKv, oetc?: {
372
+ /** --- 数据库编号(0 起) --- */
296
373
  'index'?: number;
374
+ /** --- ACL 用户名(留空则走传统单密码认证) --- */
297
375
  'user'?: string;
376
+ /** --- 认证密码或 Kvrocks namespace token --- */
298
377
  'pwd'?: string;
378
+ /** --- 业务键名前缀 --- */
379
+ 'pre'?: string;
380
+ /** --- 为 true 时将非 0 的 index 折算为键名前缀(如 db1:),不再发 SELECT --- */
381
+ 'dbPre'?: boolean;
382
+ /** --- 启用 TLS;传对象时自动开启 TLS 并透传 servername、ca 等参数 --- */
383
+ 'tls'?: boolean | tls.ConnectionOptions;
299
384
  }): Kv;
300
- /** --- 连接信息 --- */
385
+ /** --- 底层官方 redis 客户端类型(固定 RESP2) --- */
386
+ export type TRedisClient = redis.RedisClientType<Record<string, never>, Record<string, never>, Record<string, never>, 2>;
387
+ /** --- 底层原生 multi / pipeline 类型 --- */
388
+ export type TRedisMulti = ReturnType<TRedisClient['multi']>;
389
+ /** --- SCAN 分页结果 --- */
390
+ export interface IScanResult<T = string> {
391
+ /** --- 下一页游标('0' 表示结束;兼容 Redis 数字串与 Kvrocks 原生字符串游标) --- */
392
+ 'cursor': string;
393
+ /** --- 当前页匹配到的键名列表(已去除项目前缀) --- */
394
+ 'items': T[];
395
+ }
396
+ /** --- ZRANGE 查询选项 --- */
397
+ export interface IZRangeOptions {
398
+ /** --- 查询方式:SCORE 按分数范围,LEX 按字典序 --- */
399
+ 'by'?: 'SCORE' | 'LEX';
400
+ /** --- 是否倒序返回 --- */
401
+ 'rev'?: boolean;
402
+ /** --- 分页偏移量,需与 count 同用 --- */
403
+ 'offset'?: number;
404
+ /** --- 分页条数,需与 offset 同用 --- */
405
+ 'count'?: number;
406
+ }
407
+ /** --- ZADD 选项 --- */
408
+ export interface IZAddOptions {
409
+ /** --- 写入条件:NX 仅添加不存在的成员,XX 仅更新已存在的成员 --- */
410
+ 'condition'?: 'NX' | 'XX';
411
+ /** --- 分数比较条件:GT 仅新分数大于旧分数时更新,LT 仅新分数小于旧分数时更新(不影响新增成员) --- */
412
+ 'comparison'?: 'GT' | 'LT';
413
+ /** --- 返回值改为受影响总数(新增 + 分数变化的成员数),默认仅返回新增成员数 --- */
414
+ 'CH'?: boolean;
415
+ /** --- 改为在原分数上累加(类似 ZINCRBY,仅支持单个成员),返回更新后的新分数 --- */
416
+ 'INCR'?: boolean;
417
+ }
418
+ /** --- Redis 连接缓存项 --- */
301
419
  export interface IConnectionInfo {
420
+ /** --- 服务端地址(IP 或域名) --- */
302
421
  'host': string;
422
+ /** --- 服务端端口 --- */
303
423
  'port': number;
424
+ /** --- 实际选择的数据库编号 --- */
304
425
  'index': number;
305
- 'conn': redis.ICommandClient;
426
+ /** --- ACL 用户名 --- */
427
+ 'user': string;
428
+ /** --- 认证密码或 Kvrocks namespace token --- */
429
+ 'pwd': string;
430
+ /** --- TLS 配置区分键(空串表示明文,'1' 表示默认 TLS,其余为对象序列化键) --- */
431
+ 'tls': string;
432
+ /** --- 并发请求等待同一次建连,成功返回客户端,失败返回 null --- */
433
+ 'ready': Promise<TRedisClient | null>;
306
434
  }