@y-monitor/types 1.0.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.
- package/dist/types.d.ts +132 -0
- package/dist/types.esm.js +15 -0
- package/dist/types.esm.js.map +1 -0
- package/dist/types.js +15 -0
- package/dist/types.js.map +1 -0
- package/dist/types.min.js +1 -0
- package/package.json +18 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { BREADCRUMBCATEGORYS } from '@monitor/shared';
|
|
2
|
+
import { BreadcrumbTypes } from '@monitor/shared';
|
|
3
|
+
import { ErrorTypes } from '@monitor/shared';
|
|
4
|
+
import { EventTypes } from '@monitor/shared';
|
|
5
|
+
import { HttpTypes } from '@monitor/shared';
|
|
6
|
+
|
|
7
|
+
export declare interface AuthInfo {
|
|
8
|
+
apiKey?: string;
|
|
9
|
+
sdkVersion: string;
|
|
10
|
+
sdkName: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export declare interface BaseClientType<O extends BaseOptionsFieldsIntegrationType = BaseOptionsFieldsIntegrationType> {
|
|
14
|
+
options: O;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare type BaseOptionsFieldsIntegrationType = BaseOptionsFieldsType & BaseOptionsHooksType;
|
|
18
|
+
|
|
19
|
+
export declare interface BaseOptionsFieldsType {
|
|
20
|
+
dsn?: string;
|
|
21
|
+
apiKey?: string;
|
|
22
|
+
includeHttpUrlTraceIdRegExp?: RegExp;
|
|
23
|
+
filterXhrUrlRegExp?: RegExp;
|
|
24
|
+
maxBreadcrumbs?: number;
|
|
25
|
+
throttleDelayTime?: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export declare interface BaseOptionsHooksType {
|
|
29
|
+
beforeDataReport?(): any;
|
|
30
|
+
beforePushBreadcrumb?(): any;
|
|
31
|
+
beforeAjaxSend?(): any;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export declare interface BaseOptionsType<O extends BaseOptionsFieldsIntegrationType> extends BaseOptionsFieldsIntegrationType {
|
|
35
|
+
bindOptions(options: O): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export declare interface BasePluginType<E extends EventTypes = EventTypes, T extends BaseClientType = BaseClientType> {
|
|
39
|
+
name: E;
|
|
40
|
+
monitor: (this: T, notify: () => void) => void;
|
|
41
|
+
transform: (this: T, data: any) => void;
|
|
42
|
+
consumer: (this: T, data: any) => void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export declare interface BaseTransformType {
|
|
46
|
+
type?: ErrorTypes;
|
|
47
|
+
message?: string;
|
|
48
|
+
time?: number;
|
|
49
|
+
name?: string;
|
|
50
|
+
level?: string;
|
|
51
|
+
url: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export declare interface BreadcrumbPushDataType {
|
|
55
|
+
type: BreadcrumbTypes;
|
|
56
|
+
time?: number;
|
|
57
|
+
data: ReportDataType | RouteChangeCollectType | ConsoleCollectType | TNumStrObj;
|
|
58
|
+
category?: BREADCRUMBCATEGORYS;
|
|
59
|
+
level: Severity;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export declare interface ConsoleCollectType {
|
|
63
|
+
args: any[];
|
|
64
|
+
level: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export declare interface HttpCollectedType {
|
|
68
|
+
request: {
|
|
69
|
+
httpType?: HttpTypes;
|
|
70
|
+
traceId?: string;
|
|
71
|
+
method?: string;
|
|
72
|
+
url?: string;
|
|
73
|
+
data?: any;
|
|
74
|
+
};
|
|
75
|
+
response: {
|
|
76
|
+
status?: number;
|
|
77
|
+
data?: any;
|
|
78
|
+
};
|
|
79
|
+
errMsg?: string;
|
|
80
|
+
elapsedTime?: number;
|
|
81
|
+
time?: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export declare interface HttpTransformType extends HttpCollectedType, BaseTransformType {
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export declare interface IAnyObject {
|
|
88
|
+
[key: string]: any;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export declare interface LogTypes {
|
|
92
|
+
level?: Severity;
|
|
93
|
+
message?: NumStrObj;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export declare interface MITOXMLHttpRequest extends XMLHttpRequest {
|
|
97
|
+
[key: string]: any;
|
|
98
|
+
httpCollect?: HttpCollectedType;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export declare type NumStrObj = number | string | object;
|
|
102
|
+
|
|
103
|
+
export declare interface ReportDataType extends Partial<HttpTransformType> {
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export declare interface RouteChangeCollectType {
|
|
107
|
+
from: string;
|
|
108
|
+
to: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export declare enum Severity {
|
|
112
|
+
Else = "else",
|
|
113
|
+
Error = "error",
|
|
114
|
+
Warning = "warning",
|
|
115
|
+
Info = "info",
|
|
116
|
+
Debug = "debug",
|
|
117
|
+
Low = "low",
|
|
118
|
+
Normal = "normal",
|
|
119
|
+
High = "high",
|
|
120
|
+
Critical = "critical"
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export declare type TNumStrObj = number | string | object;
|
|
124
|
+
|
|
125
|
+
export declare interface TransportDataType {
|
|
126
|
+
authInfo?: AuthInfo;
|
|
127
|
+
breadcrumb?: BreadcrumbPushDataType[];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export declare type voidFun = () => void;
|
|
131
|
+
|
|
132
|
+
export { }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var Severity;
|
|
2
|
+
(function (Severity) {
|
|
3
|
+
Severity["Else"] = "else";
|
|
4
|
+
Severity["Error"] = "error";
|
|
5
|
+
Severity["Warning"] = "warning";
|
|
6
|
+
Severity["Info"] = "info";
|
|
7
|
+
Severity["Debug"] = "debug";
|
|
8
|
+
Severity["Low"] = "low";
|
|
9
|
+
Severity["Normal"] = "normal";
|
|
10
|
+
Severity["High"] = "high";
|
|
11
|
+
Severity["Critical"] = "critical";
|
|
12
|
+
})(Severity || (Severity = {}));
|
|
13
|
+
|
|
14
|
+
export { Severity };
|
|
15
|
+
//# sourceMappingURL=types.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.esm.js","sources":["../src/common.ts"],"sourcesContent":["import { HttpCollectedType } from './http';\n\nexport enum Severity {\n Else = 'else',\n Error = 'error',\n Warning = 'warning',\n Info = 'info',\n Debug = 'debug',\n /** 上报的错误等级 */\n Low = 'low',\n Normal = 'normal',\n High = 'high',\n Critical = 'critical'\n}\n\nexport type NumStrObj = number | string | object;\n\nexport interface LogTypes {\n level?: Severity;\n message?: NumStrObj;\n}\n\nexport interface IAnyObject {\n [key: string]: any;\n}\n\nexport interface MITOXMLHttpRequest extends XMLHttpRequest {\n [key: string]: any;\n httpCollect?: HttpCollectedType;\n}\n\nexport type voidFun = () => void;\n\nexport type TNumStrObj = number | string | object;\n"],"names":[],"mappings":"IAEY,SAWX;AAXD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,QAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AAEf,IAAA,QAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACX,IAAA,QAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,QAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACvB,CAAC,EAXW,QAAQ,KAAR,QAAQ,GAAA,EAAA,CAAA,CAAA;;;;"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.Severity = void 0;
|
|
4
|
+
(function (Severity) {
|
|
5
|
+
Severity["Else"] = "else";
|
|
6
|
+
Severity["Error"] = "error";
|
|
7
|
+
Severity["Warning"] = "warning";
|
|
8
|
+
Severity["Info"] = "info";
|
|
9
|
+
Severity["Debug"] = "debug";
|
|
10
|
+
Severity["Low"] = "low";
|
|
11
|
+
Severity["Normal"] = "normal";
|
|
12
|
+
Severity["High"] = "high";
|
|
13
|
+
Severity["Critical"] = "critical";
|
|
14
|
+
})(exports.Severity || (exports.Severity = {}));
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../src/common.ts"],"sourcesContent":["import { HttpCollectedType } from './http';\n\nexport enum Severity {\n Else = 'else',\n Error = 'error',\n Warning = 'warning',\n Info = 'info',\n Debug = 'debug',\n /** 上报的错误等级 */\n Low = 'low',\n Normal = 'normal',\n High = 'high',\n Critical = 'critical'\n}\n\nexport type NumStrObj = number | string | object;\n\nexport interface LogTypes {\n level?: Severity;\n message?: NumStrObj;\n}\n\nexport interface IAnyObject {\n [key: string]: any;\n}\n\nexport interface MITOXMLHttpRequest extends XMLHttpRequest {\n [key: string]: any;\n httpCollect?: HttpCollectedType;\n}\n\nexport type voidFun = () => void;\n\nexport type TNumStrObj = number | string | object;\n"],"names":["Severity"],"mappings":";;AAEYA,0BAWX;AAXD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,QAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,QAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AAEf,IAAA,QAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACX,IAAA,QAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,QAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACvB,CAAC,EAXWA,gBAAQ,KAARA,gBAAQ,GAAA,EAAA,CAAA,CAAA;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var MONITOR=function(r){"use strict";var i;return r.Severity=void 0,(i=r.Severity||(r.Severity={})).Else="else",i.Error="error",i.Warning="warning",i.Info="info",i.Debug="debug",i.Low="low",i.Normal="normal",i.High="high",i.Critical="critical",r}({});
|
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@y-monitor/types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "@y-monitor/types",
|
|
5
|
+
"main": "dist/types.js",
|
|
6
|
+
"module": "dist/types.esm.js",
|
|
7
|
+
"types": "dist/types.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
|
+
},
|
|
11
|
+
"files": ["dist"],
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public",
|
|
14
|
+
"registry": "https://registry.npmjs.org/"
|
|
15
|
+
},
|
|
16
|
+
"author": "Joanna",
|
|
17
|
+
"license": "ISC"
|
|
18
|
+
}
|