@maiyunnet/kebab 6.1.0 → 6.2.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.
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/kv.d.ts +36 -0
- package/lib/kv.js +5 -2
- package/package.json +4 -4
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '6.
|
|
9
|
+
export const VER = '6.2.0';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/lib/kv.d.ts
CHANGED
|
@@ -230,7 +230,43 @@ export declare class Kv {
|
|
|
230
230
|
bRPop(key: string | string[], timeout: number): Promise<Record<string, string> | false>;
|
|
231
231
|
lRange(key: string, start: number, stop: number): Promise<string[] | false>;
|
|
232
232
|
lLen(key: string): Promise<number | false>;
|
|
233
|
+
/**
|
|
234
|
+
* --- 添加有序集合元素(单个元素) ---
|
|
235
|
+
* @param key key 名
|
|
236
|
+
* @param score 分数
|
|
237
|
+
* @param member 成员
|
|
238
|
+
*/
|
|
233
239
|
zAdd(key: string, score: number, member: string | Buffer): Promise<boolean>;
|
|
240
|
+
/**
|
|
241
|
+
* --- 添加有序集合元素(多个元素,含 INCR 选项) ---
|
|
242
|
+
* @param key key 名
|
|
243
|
+
* @param elements 元素数组
|
|
244
|
+
* @param options 选项,需要 INCR
|
|
245
|
+
*/
|
|
246
|
+
zAdd(key: string, elements: Array<{
|
|
247
|
+
'score': number;
|
|
248
|
+
'member': string | Buffer;
|
|
249
|
+
}>, options: redis.IZAddOptionsIncr): Promise<number | false>;
|
|
250
|
+
/**
|
|
251
|
+
* --- 添加有序集合元素(多个元素,含 INCR 选项,可空) ---
|
|
252
|
+
* @param key key 名
|
|
253
|
+
* @param elements 元素数组
|
|
254
|
+
* @param options 选项,需要 INCR Nullable
|
|
255
|
+
*/
|
|
256
|
+
zAdd(key: string, elements: Array<{
|
|
257
|
+
'score': number;
|
|
258
|
+
'member': string | Buffer;
|
|
259
|
+
}>, options: redis.IZAddOptionsIncrNullable): Promise<number | null | false>;
|
|
260
|
+
/**
|
|
261
|
+
* --- 添加有序集合元素(多个元素) ---
|
|
262
|
+
* @param key key 名
|
|
263
|
+
* @param elements 元素数组
|
|
264
|
+
* @param options 选项
|
|
265
|
+
*/
|
|
266
|
+
zAdd(key: string, elements: Array<{
|
|
267
|
+
'score': number;
|
|
268
|
+
'member': string | Buffer;
|
|
269
|
+
}>, options?: redis.IZAddOptions): Promise<number | false>;
|
|
234
270
|
zRangeWithScores(key: string, start: number, stop: number, options?: IZRangeOptions): Promise<Array<{
|
|
235
271
|
member: string;
|
|
236
272
|
score: number;
|
package/lib/kv.js
CHANGED
|
@@ -728,13 +728,16 @@ end`;
|
|
|
728
728
|
return false;
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
|
-
|
|
731
|
+
/**
|
|
732
|
+
* --- 添加有序集合元素 ---
|
|
733
|
+
*/
|
|
734
|
+
async zAdd(key, scoreOrItems, memberOrOptions) {
|
|
732
735
|
const conn = await this._getConnection();
|
|
733
736
|
if (!conn) {
|
|
734
737
|
return false;
|
|
735
738
|
}
|
|
736
739
|
try {
|
|
737
|
-
return await conn.zAdd(this._etc.pre + key,
|
|
740
|
+
return await conn.zAdd(this._etc.pre + key, scoreOrItems, memberOrOptions);
|
|
738
741
|
}
|
|
739
742
|
catch {
|
|
740
743
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maiyunnet/kebab",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Simple, easy-to-use, and fully-featured Node.js framework that is ready-to-use out of the box.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"#kebab/*": "./*"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@aws-sdk/client-s3": "^3.
|
|
26
|
-
"@aws-sdk/lib-storage": "^3.
|
|
25
|
+
"@aws-sdk/client-s3": "^3.940.0",
|
|
26
|
+
"@aws-sdk/lib-storage": "^3.940.0",
|
|
27
27
|
"@litert/http-client": "^1.1.2",
|
|
28
28
|
"@litert/mime": "^0.1.3",
|
|
29
|
-
"@litert/redis": "^3.0
|
|
29
|
+
"@litert/redis": "^3.1.0",
|
|
30
30
|
"@litert/websocket": "^0.2.8",
|
|
31
31
|
"@types/ssh2": "^1.15.5",
|
|
32
32
|
"@zilliz/milvus2-sdk-node": "^2.6.5",
|