@maiyunnet/kebab 9.17.3 → 9.18.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiyunnet/kebab",
3
- "version": "9.17.3",
3
+ "version": "9.18.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,46 +22,47 @@
22
22
  "#kebab/*": "./*"
23
23
  },
24
24
  "dependencies": {
25
- "@aws-sdk/client-s3": "^3.1120.0",
26
- "@aws-sdk/lib-storage": "^3.1120.0",
25
+ "@aws-sdk/client-s3": "^3.1131.0",
26
+ "@aws-sdk/lib-storage": "^3.1131.0",
27
27
  "@litert/http-client": "^1.1.2",
28
28
  "@litert/mime": "^2.0.0",
29
29
  "@litert/redis": "^3.2.1",
30
- "@litert/websocket": "^0.2.8",
31
30
  "@radix-ui/react-checkbox": "^1.3.11",
32
31
  "@radix-ui/react-label": "^2.1.15",
33
32
  "@radix-ui/react-slot": "^1.3.3",
34
33
  "@radix-ui/react-switch": "^1.3.7",
35
34
  "@tailwindcss/cli": "^4.3.3",
36
- "@types/ssh2": "^1.15.5",
35
+ "@types/ssh2": "^1.15.6",
37
36
  "ajv": "^8.20.0",
38
37
  "ajv-formats": "^3.0.1",
39
38
  "class-variance-authority": "^0.7.1",
40
39
  "clsx": "^2.1.1",
41
40
  "ejs": "^6.0.1",
42
41
  "esbuild": "^0.28.2",
43
- "jszip": "^3.10.1",
44
- "mysql2": "^3.24.2",
42
+ "jszip": "^3.10.2",
43
+ "mysql2": "^3.24.4",
45
44
  "node-cron": "^4.6.0",
46
- "openai": "^7.8.0",
45
+ "openai": "^7.15.0",
47
46
  "pg": "^8.23.0",
48
- "react": "^19.2.8",
49
- "react-dom": "^19.2.8",
50
- "react-router-dom": "^7.18.2",
47
+ "react": "^19.3.0",
48
+ "react-dom": "^19.3.0",
49
+ "react-router-dom": "^7.18.3",
51
50
  "ssh2": "^1.17.0",
52
51
  "svg-captcha": "^1.4.0",
53
52
  "tailwind-merge": "^3.6.0",
54
- "tencentcloud-sdk-nodejs": "^4.1.303",
55
- "undici": "^8.10.0",
56
- "valibot": "^1.4.2"
53
+ "tencentcloud-sdk-nodejs": "^4.1.311",
54
+ "undici": "^8.10.2",
55
+ "valibot": "^1.5.0",
56
+ "ws": "^8.21.3"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@litert/eslint-plugin-rules": "^0.3.1",
60
60
  "@types/ejs": "^3.1.5",
61
61
  "@types/node": "^26.4.0",
62
62
  "@types/pg": "^8.23.1",
63
- "@types/react": "^19.2.18",
64
- "@types/react-dom": "^19.2.5",
63
+ "@types/react": "^19.3.0",
64
+ "@types/react-dom": "^19.3.0",
65
+ "@types/ws": "^8.18.1",
65
66
  "typedoc": "^0.28.20",
66
67
  "typedoc-plugin-markdown": "^4.13.0",
67
68
  "typescript": "^6.0.3"
package/sys/ctr.d.ts CHANGED
@@ -411,8 +411,10 @@ export declare class Ctr {
411
411
  protected _pong(data?: Buffer | string): boolean;
412
412
  /**
413
413
  * --- 主动关闭当前 socket 连接 ---
414
+ * @param code WebSocket 关闭码
415
+ * @param reason 关闭原因
414
416
  */
415
- protected _end(): void;
417
+ protected _end(code?: number, reason?: string): void;
416
418
  /**
417
419
  * --- 获取 formdata 的信息 ---
418
420
  * @param events 文件处理情况
package/sys/ctr.js CHANGED
@@ -1010,9 +1010,11 @@ export class Ctr {
1010
1010
  }
1011
1011
  /**
1012
1012
  * --- 主动关闭当前 socket 连接 ---
1013
+ * @param code WebSocket 关闭码
1014
+ * @param reason 关闭原因
1013
1015
  */
1014
- _end() {
1015
- this._socket.end();
1016
+ _end(code = 1000, reason = '') {
1017
+ this._socket.end(code, reason);
1016
1018
  }
1017
1019
  /**
1018
1020
  * --- 获取 formdata 的信息 ---
package/sys/route.js CHANGED
@@ -5,8 +5,6 @@
5
5
  */
6
6
  import * as http from 'http';
7
7
  import * as stream from 'stream';
8
- // --- 第三方 ---
9
- import * as ws from '@litert/websocket';
10
8
  // --- 库和定义 ---
11
9
  import * as lFs from '#kebab/lib/fs.js';
12
10
  import * as lZlib from '#kebab/lib/zlib.js';
@@ -331,7 +329,7 @@ export async function run(data) {
331
329
  await new Promise(function (resolve) {
332
330
  wsSocket.on('message', async function (msg) {
333
331
  switch (msg.opcode) {
334
- case ws.EOpcode.CLOSE: {
332
+ case lWs.EOpcode.CLOSE: {
335
333
  const r = await cctr['onMessage'](msg.data, msg.opcode);
336
334
  if (r === false) {
337
335
  break;
@@ -339,7 +337,7 @@ export async function run(data) {
339
337
  wsSocket.end();
340
338
  break;
341
339
  }
342
- case ws.EOpcode.PING: {
340
+ case lWs.EOpcode.PING: {
343
341
  const r = await cctr['onMessage'](msg.data, msg.opcode);
344
342
  if (r === false) {
345
343
  break;
@@ -347,14 +345,14 @@ export async function run(data) {
347
345
  wsSocket.pong();
348
346
  break;
349
347
  }
350
- case ws.EOpcode.BINARY:
351
- case ws.EOpcode.TEXT: {
348
+ case lWs.EOpcode.BINARY:
349
+ case lWs.EOpcode.TEXT: {
352
350
  try {
353
351
  const r = await cctr['onMessage'](msg.data, msg.opcode);
354
352
  if (r === false) {
355
353
  break;
356
354
  }
357
- const wrtn = await cctr['onData'](msg.opcode === ws.EOpcode.TEXT ? msg.data.toString() : msg.data, msg.opcode);
355
+ const wrtn = await cctr['onData'](msg.opcode === lWs.EOpcode.TEXT ? msg.data.toString() : msg.data, msg.opcode);
358
356
  if (wrtn === false) {
359
357
  wsSocket.end();
360
358
  return;