@deppon/deppon-monitor-shared 2.4.23 → 2.4.24

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.
Files changed (2) hide show
  1. package/es/index.d.ts +18 -0
  2. package/package.json +1 -1
package/es/index.d.ts CHANGED
@@ -74,6 +74,24 @@ export interface MonitorOptions {
74
74
  customDomain?: string;
75
75
  /** 是否开启调试模式,开启后,本地开发环境会启用监控,数据会一律上抛到 dev 服务器中 */
76
76
  debug?: boolean;
77
+ /**
78
+ * 是否对原生 XMLHttpRequest 打补丁采集 HTTP 错误。
79
+ * 未传时:`Monitor.init` 默认为开启;`@deppon/deppon-monitor-browser/vue` 插件默认关闭,
80
+ * 由 `@deppon/deppon-request` 在响应拦截器内上报,避免与 axios 重复。
81
+ * 未使用 deppon-request 的 Vue 应用可显式设为 `true`。
82
+ */
83
+ enableXHRPrototypeHook?: boolean;
84
+ /** 是否劫持 `console.error` 上报(无 stack 的打印才会上报,与既有逻辑一致) */
85
+ enableConsoleErrorHook?: boolean;
86
+ /** 是否劫持 `window.fetch` 上报非 ok 与网络异常 */
87
+ enableFetchPrototypeHook?: boolean;
88
+ /**
89
+ * 是否在 `@deppon/deppon-request` 中对 HTTP 200 但业务失败体(如 `success: false`、非成功 `code`)上报。
90
+ * 由 Monitor 初始化时在 window 上打标,未初始化监控时不生效。
91
+ */
92
+ reportAxiosBusinessErrors?: boolean;
93
+ /** 当前用户工号/用户编码,会并入上报体 `vo`;若登录晚于监控初始化,可同步设置 `window.__DEPPON_MONITOR_USER_CODE__`(见监控后端约定文档) */
94
+ userCode?: string;
77
95
  }
78
96
  export interface ResourceErrorTarget {
79
97
  src?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deppon/deppon-monitor-shared",
3
- "version": "2.4.23",
3
+ "version": "2.4.24",
4
4
  "description": "",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",