@newbeebox/newbeebox-client-web-sdk 1.0.5 → 1.0.7

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.js CHANGED
@@ -6,7 +6,7 @@ const TASK_REQUEST_TIMEOUT = 1000; // 1秒
6
6
  const LOCAL_PORT_LIST = [35560, 35561, 35562, 35563, 35564, 35565, 35566, 35567, 35568, 35569, 35570, 35571, 35572, 35573, 35574, 35575, 35576, 35577, 35578, 35579];
7
7
  // 服务端地址
8
8
  const CLIENT_SERVICE_BASE_URL = "http://127.0.0.1";
9
- export default class NewBeeClient {
9
+ export class NewBeeClient {
10
10
  app_id = "";
11
11
 
12
12
  newbee_client_port = 0;
@@ -14,7 +14,6 @@ export default class NewBeeClient {
14
14
  constructor() {}
15
15
 
16
16
  async Init(app_id) {
17
-
18
17
  if (!app_id || typeof app_id !== "string") {
19
18
  throw new Error("APPID格式不正确 请前往后台获取");
20
19
  }
@@ -55,6 +54,10 @@ export default class NewBeeClient {
55
54
  }
56
55
  }
57
56
 
57
+ if (!this.newbee_client_port) {
58
+ throw new Error("未检测到新手盒子客户端 初始化失败");
59
+ }
60
+
58
61
  console.log("客户端开启的端口号:", this.newbee_client_port);
59
62
  }
60
63
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newbeebox/newbeebox-client-web-sdk",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "NewBeeBox Client SDK for Web",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/types/index.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * @date 2025年9月23日14:42:24
7
7
  * @version 1.0.0
8
8
  */
9
- export default class NewBeeClient {
9
+ export class NewBeeClient {
10
10
  /**
11
11
  * 构造函数
12
12
  */