befly 3.62.0 → 3.63.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.
@@ -0,0 +1,124 @@
1
+ {
2
+ "id": {
3
+ "name": "ID",
4
+ "input": "integer",
5
+ "min": 1,
6
+ "max": null,
7
+ "detail": "1"
8
+ },
9
+ "reportTime": {
10
+ "name": "上报时间戳",
11
+ "input": "number",
12
+ "detail": "1720875600000"
13
+ },
14
+ "reportDate": {
15
+ "name": "上报日期",
16
+ "input": "integer",
17
+ "detail": "20260713"
18
+ },
19
+ "memberType": {
20
+ "name": "成员类型",
21
+ "input": "enum",
22
+ "check": "user|client|ip",
23
+ "min": 2,
24
+ "max": 6,
25
+ "detail": "user"
26
+ },
27
+ "member": {
28
+ "name": "成员标识",
29
+ "input": "string",
30
+ "max": 500,
31
+ "detail": "user:42:befly-admin"
32
+ },
33
+ "userId": {
34
+ "name": "用户ID",
35
+ "input": "integer",
36
+ "detail": "42"
37
+ },
38
+ "clientId": {
39
+ "name": "客户端标识",
40
+ "input": "string",
41
+ "max": 120,
42
+ "detail": "1691234567890-a1b2c3d4"
43
+ },
44
+ "ip": {
45
+ "name": "IP地址",
46
+ "input": "string",
47
+ "max": 50,
48
+ "detail": "192.168.1.1"
49
+ },
50
+ "clientType": {
51
+ "name": "客户端类型",
52
+ "input": "enum",
53
+ "check": "browser|vscode|desktop|miniapp|app",
54
+ "min": 3,
55
+ "max": 20,
56
+ "detail": "browser"
57
+ },
58
+ "productName": {
59
+ "name": "产品名称",
60
+ "input": "string",
61
+ "max": 100,
62
+ "detail": "Befly 后台管理"
63
+ },
64
+ "productCode": {
65
+ "name": "产品代号",
66
+ "input": "string",
67
+ "max": 100,
68
+ "detail": "befly-admin"
69
+ },
70
+ "productVersion": {
71
+ "name": "产品版本",
72
+ "input": "string",
73
+ "max": 50,
74
+ "detail": "1.2.3"
75
+ },
76
+ "clientVersion": {
77
+ "name": "客户端版本",
78
+ "input": "string",
79
+ "max": 100,
80
+ "detail": "1.90.0"
81
+ },
82
+ "os": {
83
+ "name": "操作系统",
84
+ "input": "string",
85
+ "max": 100,
86
+ "detail": "Android 14"
87
+ },
88
+ "system": {
89
+ "name": "系统",
90
+ "input": "string",
91
+ "max": 100,
92
+ "detail": "iOS 17.0"
93
+ },
94
+ "brand": {
95
+ "name": "设备品牌",
96
+ "input": "string",
97
+ "max": 100,
98
+ "detail": "Apple"
99
+ },
100
+ "model": {
101
+ "name": "设备型号",
102
+ "input": "string",
103
+ "max": 100,
104
+ "detail": "TAS-AN00"
105
+ },
106
+ "state": {
107
+ "name": "状态(0=已删除,1=正常,2=禁用)",
108
+ "input": "enumInteger",
109
+ "check": "0|1|2"
110
+ },
111
+ "createdAt": {
112
+ "name": "创建时间",
113
+ "input": "number",
114
+ "detail": "1720875600000"
115
+ },
116
+ "updatedAt": {
117
+ "name": "更新时间",
118
+ "input": "number"
119
+ },
120
+ "deletedAt": {
121
+ "name": "删除时间",
122
+ "input": "number"
123
+ }
124
+ }
@@ -21,15 +21,6 @@
21
21
  "name": "时间桶日期",
22
22
  "input": "number"
23
23
  },
24
- "hitCount": {
25
- "name": "命中次数",
26
- "input": "number"
27
- },
28
- "source": {
29
- "name": "来源",
30
- "input": "string",
31
- "max": 50
32
- },
33
24
  "productName": {
34
25
  "name": "产品名称",
35
26
  "input": "string",
@@ -65,60 +56,52 @@
65
56
  "input": "string",
66
57
  "max": 500
67
58
  },
59
+ "extractedMessage": {
60
+ "name": "提取的错误信息",
61
+ "input": "string",
62
+ "max": 200
63
+ },
68
64
  "detail": {
69
65
  "name": "错误详情",
70
66
  "input": "string",
71
67
  "max": 5000
72
68
  },
73
- "userAgent": {
74
- "name": "用户代理",
75
- "input": "string",
76
- "max": 500
69
+ "clientType": {
70
+ "name": "客户端类型",
71
+ "input": "enum",
72
+ "check": "browser|vscode|desktop|miniapp|app",
73
+ "min": 3,
74
+ "max": 20
77
75
  },
78
- "browserName": {
79
- "name": "浏览器名称",
76
+ "clientId": {
77
+ "name": "客户端标识",
80
78
  "input": "string",
81
- "max": 100
79
+ "max": 120
82
80
  },
83
- "browserVersion": {
84
- "name": "浏览器版本",
85
- "input": "string",
86
- "max": 100
81
+ "memberType": {
82
+ "name": "成员类型",
83
+ "input": "enum",
84
+ "check": "user|client|ip",
85
+ "min": 2,
86
+ "max": 6
87
87
  },
88
- "osName": {
89
- "name": "操作系统名称",
88
+ "member": {
89
+ "name": "成员标识",
90
90
  "input": "string",
91
- "max": 100
91
+ "max": 200
92
92
  },
93
- "osVersion": {
94
- "name": "操作系统版本",
95
- "input": "string",
96
- "max": 100
93
+ "userId": {
94
+ "name": "用户ID",
95
+ "input": "integer"
97
96
  },
98
- "deviceType": {
99
- "name": "设备类型",
97
+ "ip": {
98
+ "name": "IP地址",
100
99
  "input": "string",
101
100
  "max": 50
102
101
  },
103
- "deviceVendor": {
104
- "name": "设备厂商",
105
- "input": "string",
106
- "max": 100
107
- },
108
- "deviceModel": {
109
- "name": "设备型号",
110
- "input": "string",
111
- "max": 100
112
- },
113
- "engineName": {
114
- "name": "引擎名称",
115
- "input": "string",
116
- "max": 100
117
- },
118
- "cpuArchitecture": {
119
- "name": "CPU架构",
120
- "input": "string",
121
- "max": 100
102
+ "lastReportTime": {
103
+ "name": "最后上报时间",
104
+ "input": "number"
122
105
  },
123
106
  "state": {
124
107
  "name": "状态(0=已删除,1=正常,2=禁用)",
@@ -25,55 +25,52 @@
25
25
  "input": "string",
26
26
  "max": 50
27
27
  },
28
- "userAgent": {
29
- "name": "用户代理",
30
- "input": "string",
31
- "max": 500
32
- },
33
- "browserName": {
34
- "name": "浏览器名称",
35
- "input": "string",
36
- "max": 50
28
+ "clientType": {
29
+ "name": "客户端类型",
30
+ "input": "enum",
31
+ "check": "browser|vscode|desktop|miniapp|app",
32
+ "min": 3,
33
+ "max": 20
37
34
  },
38
- "browserVersion": {
39
- "name": "浏览器版本",
35
+ "productName": {
36
+ "name": "产品名称",
40
37
  "input": "string",
41
- "max": 50
38
+ "max": 100
42
39
  },
43
- "osName": {
44
- "name": "操作系统",
40
+ "productCode": {
41
+ "name": "产品代号",
45
42
  "input": "string",
46
- "max": 50
43
+ "max": 100
47
44
  },
48
- "osVersion": {
49
- "name": "系统版本",
45
+ "productVersion": {
46
+ "name": "产品版本",
50
47
  "input": "string",
51
48
  "max": 50
52
49
  },
53
- "deviceType": {
54
- "name": "设备类型",
50
+ "clientVersion": {
51
+ "name": "客户端版本",
55
52
  "input": "string",
56
- "max": 20
53
+ "max": 100
57
54
  },
58
- "deviceVendor": {
59
- "name": "设备厂商",
55
+ "os": {
56
+ "name": "操作系统",
60
57
  "input": "string",
61
- "max": 50
58
+ "max": 100
62
59
  },
63
- "deviceModel": {
64
- "name": "设备型号",
60
+ "system": {
61
+ "name": "系统",
65
62
  "input": "string",
66
- "max": 50
63
+ "max": 100
67
64
  },
68
- "engineName": {
69
- "name": "引擎名称",
65
+ "brand": {
66
+ "name": "设备品牌",
70
67
  "input": "string",
71
- "max": 50
68
+ "max": 100
72
69
  },
73
- "cpuArchitecture": {
74
- "name": "CPU架构",
70
+ "model": {
71
+ "name": "设备型号",
75
72
  "input": "string",
76
- "max": 20
73
+ "max": 100
77
74
  },
78
75
  "loginTime": {
79
76
  "name": "登录时间",
package/utils/is.js CHANGED
@@ -346,44 +346,11 @@ export function isEmpty(value) {
346
346
  }
347
347
 
348
348
  /**
349
- * 判断当前进程是否为主进程(针对 PM2 cluster 常见环境变量)。
349
+ * 判断当前进程是否为主进程。
350
+ * PM2 cluster 的实例 0 是主进程;未由 PM2 启动时视为主进程。
350
351
  */
351
352
  export function isPrimaryProcess(env) {
352
- const sourceEnv = env && typeof env === "object" ? env : process.env;
353
-
354
- const bunWorkerId = sourceEnv.BUN_WORKER_ID;
355
- if (bunWorkerId !== undefined && bunWorkerId !== null) {
356
- const normalizedBunWorkerId = String(bunWorkerId).trim();
357
- if (normalizedBunWorkerId === "" || normalizedBunWorkerId === "0") {
358
- return true;
359
- }
360
- const bunWorkerIdNumber = Number(normalizedBunWorkerId);
361
- if (Number.isInteger(bunWorkerIdNumber) && bunWorkerIdNumber >= 0) {
362
- return bunWorkerIdNumber === 0;
363
- }
364
- return false;
365
- }
366
-
367
- const pm2InstanceIdRaw = sourceEnv.NODE_APP_INSTANCE ?? sourceEnv.PM2_INSTANCE_ID ?? sourceEnv.pm_id;
368
- if (pm2InstanceIdRaw !== undefined && pm2InstanceIdRaw !== null) {
369
- const normalizedPm2InstanceId = String(pm2InstanceIdRaw).trim();
370
- if (normalizedPm2InstanceId === "0") {
371
- return true;
372
- }
373
- const pm2InstanceIdNumber = Number(normalizedPm2InstanceId);
374
- if (Number.isInteger(pm2InstanceIdNumber) && pm2InstanceIdNumber >= 0) {
375
- return pm2InstanceIdNumber === 0;
376
- }
377
- return false;
378
- }
379
-
380
- const execMode = String(sourceEnv.exec_mode || sourceEnv.NODE_EXEC_MODE || "").toLowerCase();
381
- const hasPm2Markers = sourceEnv.PM2_HOME !== undefined || sourceEnv.pm_exec_path !== undefined || sourceEnv.PM2_USAGE !== undefined || execMode.includes("cluster");
382
- if (hasPm2Markers) {
383
- return false;
384
- }
385
-
386
- return true;
353
+ return env.NODE_APP_INSTANCE === "0" || env.NODE_APP_INSTANCE === undefined;
387
354
  }
388
355
 
389
356
  export const isDirentDirectory = (parentDir, entry) => {