@maiyunnet/kebab 6.0.0 → 6.1.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 CHANGED
@@ -5,7 +5,7 @@
5
5
  * --- 本文件用来定义每个目录实体地址的常量 ---
6
6
  */
7
7
  /** --- 当前系统版本号 --- */
8
- export declare const VER = "6.0.0";
8
+ export declare const VER = "6.1.0";
9
9
  /** --- 框架根目录,以 / 结尾 --- */
10
10
  export declare const ROOT_PATH: string;
11
11
  export declare const LIB_PATH: string;
package/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * --- 本文件用来定义每个目录实体地址的常量 ---
7
7
  */
8
8
  /** --- 当前系统版本号 --- */
9
- export const VER = '6.0.0';
9
+ export const VER = '6.1.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
@@ -6,6 +6,27 @@
6
6
  import * as redis from '@litert/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
+ }
9
30
  /**
10
31
  * --- 键值存储操作类 ---
11
32
  *
@@ -209,6 +230,12 @@ export declare class Kv {
209
230
  bRPop(key: string | string[], timeout: number): Promise<Record<string, string> | false>;
210
231
  lRange(key: string, start: number, stop: number): Promise<string[] | false>;
211
232
  lLen(key: string): Promise<number | false>;
233
+ zAdd(key: string, score: number, member: string | Buffer): Promise<boolean>;
234
+ zRangeWithScores(key: string, start: number, stop: number, options?: IZRangeOptions): Promise<Array<{
235
+ member: string;
236
+ score: number;
237
+ }> | false>;
238
+ zRem(key: string, members: Array<string | Buffer>): Promise<number | false>;
212
239
  /**
213
240
  * --- 从连接池中获取一个符合要求的连接 ---
214
241
  */
package/lib/kv.js CHANGED
@@ -728,6 +728,47 @@ end`;
728
728
  return false;
729
729
  }
730
730
  }
731
+ async zAdd(key, score, member) {
732
+ const conn = await this._getConnection();
733
+ if (!conn) {
734
+ return false;
735
+ }
736
+ try {
737
+ return await conn.zAdd(this._etc.pre + key, score, member);
738
+ }
739
+ catch {
740
+ return false;
741
+ }
742
+ }
743
+ async zRangeWithScores(key, start, stop, options) {
744
+ const conn = await this._getConnection();
745
+ if (!conn) {
746
+ return false;
747
+ }
748
+ try {
749
+ return await conn.zRangeWithScores(this._etc.pre + key, start, stop, {
750
+ 'by': options?.by,
751
+ 'reverse': options?.rev,
752
+ 'offset': options?.offset,
753
+ 'count': options?.count,
754
+ });
755
+ }
756
+ catch {
757
+ return false;
758
+ }
759
+ }
760
+ async zRem(key, members) {
761
+ const conn = await this._getConnection();
762
+ if (!conn) {
763
+ return false;
764
+ }
765
+ try {
766
+ return await conn.zRem(this._etc.pre + key, members);
767
+ }
768
+ catch {
769
+ return false;
770
+ }
771
+ }
731
772
  /**
732
773
  * --- 从连接池中获取一个符合要求的连接 ---
733
774
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "6.0.0",
3
+ "version": "6.1.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,28 +22,28 @@
22
22
  "#kebab/*": "./*"
23
23
  },
24
24
  "dependencies": {
25
- "@aws-sdk/client-s3": "^3.927.0",
26
- "@aws-sdk/lib-storage": "^3.927.0",
25
+ "@aws-sdk/client-s3": "^3.939.0",
26
+ "@aws-sdk/lib-storage": "^3.939.0",
27
27
  "@litert/http-client": "^1.1.2",
28
28
  "@litert/mime": "^0.1.3",
29
- "@litert/redis": "^3.0.5",
29
+ "@litert/redis": "^3.0.6",
30
30
  "@litert/websocket": "^0.2.8",
31
31
  "@types/ssh2": "^1.15.5",
32
- "@zilliz/milvus2-sdk-node": "^2.6.4",
32
+ "@zilliz/milvus2-sdk-node": "^2.6.5",
33
33
  "ejs": "^3.1.10",
34
34
  "jszip": "^3.10.1",
35
35
  "mysql2": "^3.15.3",
36
36
  "node-cron": "^4.2.1",
37
- "openai": "^6.8.1",
37
+ "openai": "^6.9.1",
38
38
  "pg": "^8.16.3",
39
39
  "ssh2": "^1.17.0",
40
40
  "svg-captcha": "^1.4.0",
41
- "tencentcloud-sdk-nodejs": "^4.1.140"
41
+ "tencentcloud-sdk-nodejs": "^4.1.149"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@litert/eslint-plugin-rules": "^0.3.1",
45
45
  "@types/ejs": "^3.1.5",
46
- "@types/node": "^24.10.0",
46
+ "@types/node": "^24.10.1",
47
47
  "@types/pg": "^8.15.6",
48
48
  "typedoc": "^0.28.14",
49
49
  "typedoc-plugin-markdown": "^4.9.0",