@deppon/deppon-monitor-shared 2.2.1 → 2.2.3
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/LICENSE +1 -1
- package/es/index.d.ts +82 -82
- package/network.d.ts +36 -36
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
package/es/index.d.ts
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
export declare enum ErrorLevelEnum {
|
|
2
|
-
UNKNOWN = "unknow",
|
|
3
|
-
Low = "low",
|
|
4
|
-
Normal = "normal",
|
|
5
|
-
High = "high",
|
|
6
|
-
Critical = "critical"
|
|
7
|
-
}
|
|
8
|
-
export declare enum ErrorTypeEnum {
|
|
9
|
-
UNKNOWN = "UNKNOWN",
|
|
10
|
-
UNKNOWN_FUNCTION = "UNKNOWN_FUNCTION",
|
|
11
|
-
JAVASCRIPT_ERROR = "JAVASCRIPT_ERROR",
|
|
12
|
-
LOG_ERROR = "LOG_ERROR",
|
|
13
|
-
FETCH_ERROR = "HTTP_ERROR",
|
|
14
|
-
CONSOLE_ERROR = "CONSOLE_ERROR",
|
|
15
|
-
VUE_ERROR = "VUE_ERROR",
|
|
16
|
-
REACT_ERROR = "REACT_ERROR",
|
|
17
|
-
RESOURCE_ERROR = "RESOURCE_ERROR",
|
|
18
|
-
PROMISE_ERROR = "PROMISE_ERROR",
|
|
19
|
-
ROUTE_ERROR = "ROUTE_ERROR"
|
|
20
|
-
}
|
|
21
|
-
export declare enum EventTypeEnum {
|
|
22
|
-
XHR = "xhr",
|
|
23
|
-
FETCH = "fetch",
|
|
24
|
-
CONSOLE = "console",
|
|
25
|
-
DOM = "dom",
|
|
26
|
-
HISTORY = "history",
|
|
27
|
-
ERROR = "error",
|
|
28
|
-
HASHCHANGE = "hashchange",
|
|
29
|
-
UNHANDLEDREJECTION = "unhandledrejection",
|
|
30
|
-
VUE = "Vue"
|
|
31
|
-
}
|
|
32
|
-
export declare enum HttpTypeEnum {
|
|
33
|
-
XHR = "xhr",
|
|
34
|
-
FETCH = "fetch"
|
|
35
|
-
}
|
|
36
|
-
export declare const JS_ERROR_TYPE_REG: RegExp;
|
|
37
|
-
export declare const reportData: {
|
|
38
|
-
reportUrl: string;
|
|
39
|
-
reportMethod: string;
|
|
40
|
-
};
|
|
41
|
-
export interface ReportDataType {
|
|
42
|
-
type?: string;
|
|
43
|
-
message?: string;
|
|
44
|
-
url: string;
|
|
45
|
-
name?: string;
|
|
46
|
-
stack?: any;
|
|
47
|
-
time?: number;
|
|
48
|
-
errorId?: number;
|
|
49
|
-
elapsedTime?: number;
|
|
50
|
-
request?: {
|
|
51
|
-
httpType?: string;
|
|
52
|
-
traceId?: string;
|
|
53
|
-
method: string;
|
|
54
|
-
url: string;
|
|
55
|
-
data: any;
|
|
56
|
-
};
|
|
57
|
-
response?: {
|
|
58
|
-
status: number;
|
|
59
|
-
data: string;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
export interface MonitorOptions {
|
|
63
|
-
/** 应用名称 */
|
|
64
|
-
appName: string;
|
|
65
|
-
/** 环境名称 */
|
|
66
|
-
env: string;
|
|
67
|
-
/** 应用版本号,用来区分不同的 sourcemap 版本 */
|
|
68
|
-
version?: string;
|
|
69
|
-
/** 触发报错的回调 */
|
|
70
|
-
onError?: (error: ReportDataType) => void;
|
|
71
|
-
/** 错误上抛的地址 */
|
|
72
|
-
reportUrl?: string;
|
|
73
|
-
/** 自定义上抛域名地址 */
|
|
74
|
-
customDomain?: string;
|
|
75
|
-
/** 是否开启调试模式,开启后,本地开发环境会启用监控,数据会一律上抛到 dev 服务器中 */
|
|
76
|
-
debug?: boolean;
|
|
77
|
-
}
|
|
78
|
-
export interface ResourceErrorTarget {
|
|
79
|
-
src?: string;
|
|
80
|
-
href?: string;
|
|
81
|
-
localName?: string;
|
|
82
|
-
}
|
|
1
|
+
export declare enum ErrorLevelEnum {
|
|
2
|
+
UNKNOWN = "unknow",
|
|
3
|
+
Low = "low",
|
|
4
|
+
Normal = "normal",
|
|
5
|
+
High = "high",
|
|
6
|
+
Critical = "critical"
|
|
7
|
+
}
|
|
8
|
+
export declare enum ErrorTypeEnum {
|
|
9
|
+
UNKNOWN = "UNKNOWN",
|
|
10
|
+
UNKNOWN_FUNCTION = "UNKNOWN_FUNCTION",
|
|
11
|
+
JAVASCRIPT_ERROR = "JAVASCRIPT_ERROR",
|
|
12
|
+
LOG_ERROR = "LOG_ERROR",
|
|
13
|
+
FETCH_ERROR = "HTTP_ERROR",
|
|
14
|
+
CONSOLE_ERROR = "CONSOLE_ERROR",
|
|
15
|
+
VUE_ERROR = "VUE_ERROR",
|
|
16
|
+
REACT_ERROR = "REACT_ERROR",
|
|
17
|
+
RESOURCE_ERROR = "RESOURCE_ERROR",
|
|
18
|
+
PROMISE_ERROR = "PROMISE_ERROR",
|
|
19
|
+
ROUTE_ERROR = "ROUTE_ERROR"
|
|
20
|
+
}
|
|
21
|
+
export declare enum EventTypeEnum {
|
|
22
|
+
XHR = "xhr",
|
|
23
|
+
FETCH = "fetch",
|
|
24
|
+
CONSOLE = "console",
|
|
25
|
+
DOM = "dom",
|
|
26
|
+
HISTORY = "history",
|
|
27
|
+
ERROR = "error",
|
|
28
|
+
HASHCHANGE = "hashchange",
|
|
29
|
+
UNHANDLEDREJECTION = "unhandledrejection",
|
|
30
|
+
VUE = "Vue"
|
|
31
|
+
}
|
|
32
|
+
export declare enum HttpTypeEnum {
|
|
33
|
+
XHR = "xhr",
|
|
34
|
+
FETCH = "fetch"
|
|
35
|
+
}
|
|
36
|
+
export declare const JS_ERROR_TYPE_REG: RegExp;
|
|
37
|
+
export declare const reportData: {
|
|
38
|
+
reportUrl: string;
|
|
39
|
+
reportMethod: string;
|
|
40
|
+
};
|
|
41
|
+
export interface ReportDataType {
|
|
42
|
+
type?: string;
|
|
43
|
+
message?: string;
|
|
44
|
+
url: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
stack?: any;
|
|
47
|
+
time?: number;
|
|
48
|
+
errorId?: number;
|
|
49
|
+
elapsedTime?: number;
|
|
50
|
+
request?: {
|
|
51
|
+
httpType?: string;
|
|
52
|
+
traceId?: string;
|
|
53
|
+
method: string;
|
|
54
|
+
url: string;
|
|
55
|
+
data: any;
|
|
56
|
+
};
|
|
57
|
+
response?: {
|
|
58
|
+
status: number;
|
|
59
|
+
data: string;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export interface MonitorOptions {
|
|
63
|
+
/** 应用名称 */
|
|
64
|
+
appName: string;
|
|
65
|
+
/** 环境名称 */
|
|
66
|
+
env: string;
|
|
67
|
+
/** 应用版本号,用来区分不同的 sourcemap 版本 */
|
|
68
|
+
version?: string;
|
|
69
|
+
/** 触发报错的回调 */
|
|
70
|
+
onError?: (error: ReportDataType) => void;
|
|
71
|
+
/** 错误上抛的地址 */
|
|
72
|
+
reportUrl?: string;
|
|
73
|
+
/** 自定义上抛域名地址 */
|
|
74
|
+
customDomain?: string;
|
|
75
|
+
/** 是否开启调试模式,开启后,本地开发环境会启用监控,数据会一律上抛到 dev 服务器中 */
|
|
76
|
+
debug?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface ResourceErrorTarget {
|
|
79
|
+
src?: string;
|
|
80
|
+
href?: string;
|
|
81
|
+
localName?: string;
|
|
82
|
+
}
|
package/network.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
declare interface Navigator extends NavigatorNetworkInformation {}
|
|
2
|
-
declare interface WorkerNavigator extends NavigatorNetworkInformation {}
|
|
3
|
-
|
|
4
|
-
// http://wicg.github.io/netinfo/#navigatornetworkinformation-interface
|
|
5
|
-
declare interface NavigatorNetworkInformation {
|
|
6
|
-
readonly connection?: NetworkInformation;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// http://wicg.github.io/netinfo/#connection-types
|
|
10
|
-
type ConnectionType = 'bluetooth' | 'cellular' | 'ethernet' | 'mixed' | 'none' | 'other' | 'unknown' | 'wifi' | 'wimax';
|
|
11
|
-
|
|
12
|
-
// http://wicg.github.io/netinfo/#effectiveconnectiontype-enum
|
|
13
|
-
type EffectiveConnectionType = '2g' | '3g' | '4g' | 'slow-2g';
|
|
14
|
-
|
|
15
|
-
// http://wicg.github.io/netinfo/#dom-megabit
|
|
16
|
-
type Megabit = number;
|
|
17
|
-
// http://wicg.github.io/netinfo/#dom-millisecond
|
|
18
|
-
type Millisecond = number;
|
|
19
|
-
|
|
20
|
-
// http://wicg.github.io/netinfo/#networkinformation-interface
|
|
21
|
-
interface NetworkInformation extends EventTarget {
|
|
22
|
-
// http://wicg.github.io/netinfo/#type-attribute
|
|
23
|
-
readonly type?: ConnectionType;
|
|
24
|
-
// http://wicg.github.io/netinfo/#effectivetype-attribute
|
|
25
|
-
readonly effectiveType?: EffectiveConnectionType;
|
|
26
|
-
// http://wicg.github.io/netinfo/#downlinkmax-attribute
|
|
27
|
-
readonly downlinkMax?: Megabit;
|
|
28
|
-
// http://wicg.github.io/netinfo/#downlink-attribute
|
|
29
|
-
readonly downlink?: Megabit;
|
|
30
|
-
// http://wicg.github.io/netinfo/#rtt-attribute
|
|
31
|
-
readonly rtt?: Millisecond;
|
|
32
|
-
// http://wicg.github.io/netinfo/#savedata-attribute
|
|
33
|
-
readonly saveData?: boolean;
|
|
34
|
-
// http://wicg.github.io/netinfo/#handling-changes-to-the-underlying-connection
|
|
35
|
-
onchange?: EventListener;
|
|
36
|
-
}
|
|
1
|
+
declare interface Navigator extends NavigatorNetworkInformation {}
|
|
2
|
+
declare interface WorkerNavigator extends NavigatorNetworkInformation {}
|
|
3
|
+
|
|
4
|
+
// http://wicg.github.io/netinfo/#navigatornetworkinformation-interface
|
|
5
|
+
declare interface NavigatorNetworkInformation {
|
|
6
|
+
readonly connection?: NetworkInformation;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// http://wicg.github.io/netinfo/#connection-types
|
|
10
|
+
type ConnectionType = 'bluetooth' | 'cellular' | 'ethernet' | 'mixed' | 'none' | 'other' | 'unknown' | 'wifi' | 'wimax';
|
|
11
|
+
|
|
12
|
+
// http://wicg.github.io/netinfo/#effectiveconnectiontype-enum
|
|
13
|
+
type EffectiveConnectionType = '2g' | '3g' | '4g' | 'slow-2g';
|
|
14
|
+
|
|
15
|
+
// http://wicg.github.io/netinfo/#dom-megabit
|
|
16
|
+
type Megabit = number;
|
|
17
|
+
// http://wicg.github.io/netinfo/#dom-millisecond
|
|
18
|
+
type Millisecond = number;
|
|
19
|
+
|
|
20
|
+
// http://wicg.github.io/netinfo/#networkinformation-interface
|
|
21
|
+
interface NetworkInformation extends EventTarget {
|
|
22
|
+
// http://wicg.github.io/netinfo/#type-attribute
|
|
23
|
+
readonly type?: ConnectionType;
|
|
24
|
+
// http://wicg.github.io/netinfo/#effectivetype-attribute
|
|
25
|
+
readonly effectiveType?: EffectiveConnectionType;
|
|
26
|
+
// http://wicg.github.io/netinfo/#downlinkmax-attribute
|
|
27
|
+
readonly downlinkMax?: Megabit;
|
|
28
|
+
// http://wicg.github.io/netinfo/#downlink-attribute
|
|
29
|
+
readonly downlink?: Megabit;
|
|
30
|
+
// http://wicg.github.io/netinfo/#rtt-attribute
|
|
31
|
+
readonly rtt?: Millisecond;
|
|
32
|
+
// http://wicg.github.io/netinfo/#savedata-attribute
|
|
33
|
+
readonly saveData?: boolean;
|
|
34
|
+
// http://wicg.github.io/netinfo/#handling-changes-to-the-underlying-connection
|
|
35
|
+
onchange?: EventListener;
|
|
36
|
+
}
|