sobey-monitor-sdk 1.1.8 → 1.1.9
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/dist/index.cjs.js +112 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.esm.js +112 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +112 -11
- package/dist/index.umd.js.map +1 -1
- package/dist/types/index.d.ts +18 -0
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -70,6 +70,18 @@ export interface ReportConfig {
|
|
|
70
70
|
/** 请求超时(ms) */
|
|
71
71
|
timeout?: number;
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* 业务错误检测规则
|
|
75
|
+
* 用于检测 HTTP 200 响应中的业务层错误
|
|
76
|
+
*/
|
|
77
|
+
export interface BusinessErrorRule {
|
|
78
|
+
/** 字段路径,如 "status" 或 "data.code" */
|
|
79
|
+
field: string;
|
|
80
|
+
/** 比较操作符 */
|
|
81
|
+
operator: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'exists';
|
|
82
|
+
/** 比较值(当 operator 为 'exists' 时可不填) */
|
|
83
|
+
value?: string | number | boolean;
|
|
84
|
+
}
|
|
73
85
|
/**
|
|
74
86
|
* 错误监控配置
|
|
75
87
|
*/
|
|
@@ -86,6 +98,12 @@ export interface ErrorMonitorConfig {
|
|
|
86
98
|
httpError?: boolean;
|
|
87
99
|
/** 错误过滤函数 */
|
|
88
100
|
filter?: (error: ErrorData) => boolean;
|
|
101
|
+
/**
|
|
102
|
+
* 业务错误检测规则
|
|
103
|
+
* 当 HTTP 状态码为 200 时,根据这些规则检测响应体中的业务错误
|
|
104
|
+
* 任一规则匹配时将上报 http_error
|
|
105
|
+
*/
|
|
106
|
+
businessErrorRules?: BusinessErrorRule[];
|
|
89
107
|
}
|
|
90
108
|
/**
|
|
91
109
|
* 性能监控配置
|