@maiyunnet/kebab 3.2.14 → 3.2.15

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 = "3.2.14";
8
+ export declare const VER = "3.2.15";
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 = '3.2.14';
9
+ export const VER = '3.2.15';
10
10
  // --- 服务端用的路径 ---
11
11
  const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
12
12
  /** --- /xxx/xxx --- */
package/lib/s3.d.ts CHANGED
@@ -60,7 +60,7 @@ export declare class S3 {
60
60
  * @param key 对象路径
61
61
  * @param bucket bucket 名
62
62
  */
63
- getObject(key: string, bucket?: string): Promise<false | (stream.Readable & import("@smithy/types").SdkStreamMixin) | (Blob & import("@smithy/types").SdkStreamMixin) | (ReadableStream<any> & import("@smithy/types").SdkStreamMixin) | undefined>;
63
+ getObject(key: string, bucket?: string): Promise<any>;
64
64
  /**
65
65
  * --- 删除对象 ---
66
66
  * @param key 对象路径
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "3.2.14",
3
+ "version": "3.2.15",
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": [
@@ -19,8 +19,8 @@
19
19
  "#kebab/*": "./*"
20
20
  },
21
21
  "dependencies": {
22
- "@aws-sdk/client-s3": "^3.908.0",
23
- "@aws-sdk/lib-storage": "^3.908.0",
22
+ "@aws-sdk/client-s3": "^3.913.0",
23
+ "@aws-sdk/lib-storage": "^3.913.0",
24
24
  "@litert/http-client": "^1.1.2",
25
25
  "@litert/mime": "^0.1.3",
26
26
  "@litert/redis": "^3.0.5",
@@ -31,12 +31,12 @@
31
31
  "mysql2": "^3.15.2",
32
32
  "ssh2": "^1.17.0",
33
33
  "svg-captcha": "^1.4.0",
34
- "tencentcloud-sdk-nodejs": "^4.1.128"
34
+ "tencentcloud-sdk-nodejs": "^4.1.133"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@litert/eslint-plugin-rules": "^0.3.1",
38
38
  "@types/ejs": "^3.1.5",
39
- "@types/node": "^24.7.2",
39
+ "@types/node": "^24.9.1",
40
40
  "tsc-alias": "^1.8.16",
41
41
  "typescript": "^5.9.3"
42
42
  }
package/sys/child.js CHANGED
@@ -294,7 +294,7 @@ async function requestHandler(req, res, https) {
294
294
  'cookie': {},
295
295
  'headers': {}
296
296
  }, '[CHILD][requestHandler][E0]' + lText.stringifyJson(e.stack).slice(1, -1), '-error');
297
- const content = '<h1>500 Server Error</h1><hr>Kebabb';
297
+ const content = '<h1>500 Server Error</h1><hr>Kebab';
298
298
  res.setHeader('content-type', 'text/html; charset=utf-8');
299
299
  res.setHeader('content-length', Buffer.byteLength(content));
300
300
  res.writeHead(500);
@@ -333,7 +333,7 @@ async function requestHandler(req, res, https) {
333
333
  }
334
334
  catch (e) {
335
335
  lCore.log({}, '[CHILD][requestHandler][E1]' + lText.stringifyJson(e.stack).slice(1, -1), '-error');
336
- const content = '<h1>500 Server Error</h1><hr>Kebabb';
336
+ const content = '<h1>500 Server Error</h1><hr>Kebab';
337
337
  res.setHeader('content-type', 'text/html; charset=utf-8');
338
338
  res.setHeader('content-length', Buffer.byteLength(content));
339
339
  res.writeHead(500);
package/sys/mod.d.ts CHANGED
@@ -12,7 +12,7 @@ type TOnlyProperties<T> = {
12
12
  [K in keyof T as T[K] extends (...args: any[]) => any ? never : K]: T[K];
13
13
  };
14
14
  /** --- 条数列表 --- */
15
- declare class Rows<T extends Mod> implements CRows<T> {
15
+ declare class Rows<T extends Mod> implements IRows<T> {
16
16
  private readonly _items;
17
17
  constructor(initialItems?: T[]);
18
18
  /** --- 总行数 --- */
@@ -24,8 +24,9 @@ declare class Rows<T extends Mod> implements CRows<T> {
24
24
  /** --- 根据规则筛掉项,predicate 返回 true 代表保留 --- */
25
25
  filter(predicate: (value: T, index: number) => boolean): Rows<T>;
26
26
  /** --- 重塑对象内容 --- */
27
- map<TU>(allbackfn: (value: T, index: number) => TU): TU[];
28
- [Symbol.iterator](): Iterator<T>;
27
+ map<TU extends Mod>(fn: (v: T, i: number) => TU): Rows<TU>;
28
+ /** --- for of --- */
29
+ [Symbol.iterator](): IterableIterator<T>;
29
30
  }
30
31
  /**
31
32
  * --- 开启软更需要在表添加字段:ALTER TABLE `table_name` ADD `time_remove` bigint NOT NULL DEFAULT '0' AFTER `xxx`; ---
@@ -475,15 +476,10 @@ export default class Mod {
475
476
  */
476
477
  protected _keyGenerator(): string;
477
478
  }
478
- /** --- mod ls 对象 --- */
479
- export declare class CRows<T> implements Iterable<T> {
480
- /** --- 总行数 --- */
481
- get length(): number;
482
- /** --- 通过索引获取一个对象 --- */
479
+ export interface IRows<T> extends Iterable<T> {
480
+ readonly length: number;
483
481
  item(index: number): T;
484
- /** --- 转换为数组对象,获取的是新创建的数组 --- */
485
- toArray(): Array<Record<string, kebab.DbValue>>;
486
- [Symbol.iterator](): Iterator<T>;
482
+ toArray(): Array<Record<string, any>>;
487
483
  }
488
484
  export interface IModUnionItem {
489
485
  'field': string;
package/sys/mod.js CHANGED
@@ -11,7 +11,6 @@ import * as sCtr from '#kebab/sys/ctr.js';
11
11
  /** --- 条数列表 --- */
12
12
  class Rows {
13
13
  constructor(initialItems = []) {
14
- this._items = [];
15
14
  this._items = initialItems;
16
15
  }
17
16
  /** --- 总行数 --- */
@@ -24,49 +23,19 @@ class Rows {
24
23
  }
25
24
  /** --- 转换为数组对象,获取的是新创建的数组 --- */
26
25
  toArray() {
27
- const arr = [];
28
- for (const item of this._items) {
29
- arr.push(item.toArray());
30
- }
31
- return arr;
26
+ return this._items.map(i => i.toArray());
32
27
  }
33
28
  /** --- 根据规则筛掉项,predicate 返回 true 代表保留 --- */
34
29
  filter(predicate) {
35
- const items = [];
36
- for (let i = 0; i < this._items.length; ++i) {
37
- if (!predicate(this._items[i], i)) {
38
- continue;
39
- }
40
- items.push(this._items[i]);
41
- }
42
- return new Rows(items);
30
+ return new Rows(this._items.filter(predicate));
43
31
  }
44
32
  /** --- 重塑对象内容 --- */
45
- map(allbackfn) {
46
- const items = [];
47
- for (let i = 0; i < this._items.length; ++i) {
48
- items.push(allbackfn(this._items[i], i));
49
- }
50
- return items;
33
+ map(fn) {
34
+ return new Rows(this._items.map(fn));
51
35
  }
36
+ /** --- for of --- */
52
37
  [Symbol.iterator]() {
53
- let index = 0;
54
- return {
55
- next: () => {
56
- if (index < this._items.length) {
57
- return {
58
- value: this._items[++index],
59
- done: false
60
- };
61
- }
62
- else {
63
- return {
64
- value: undefined,
65
- done: true
66
- };
67
- }
68
- }
69
- };
38
+ return this._items[Symbol.iterator]();
70
39
  }
71
40
  }
72
41
  /**