@fle-sdk/event-tracking-web 1.0.6 → 1.1.1
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/README.md +315 -93
- package/lib/index.ems.js +1 -1
- package/lib/index.ems.js.map +1 -1
- package/lib/index.esm.js +16 -0
- package/lib/index.esm.js.map +1 -0
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/types/index.d.ts +73 -107
- package/lib/types/tools.d.ts +112 -0
- package/lib/types/type.d.ts +186 -0
- package/package.json +3 -3
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
export interface Target extends Window {
|
|
2
|
+
/**
|
|
3
|
+
* @description 自定义扩展取消监听函数
|
|
4
|
+
* @default
|
|
5
|
+
*/
|
|
6
|
+
detachEvent?: (type: string, fun: (event: Event) => void, bol: boolean) => void;
|
|
7
|
+
/**
|
|
8
|
+
* @description 自定义扩展添加监听函数
|
|
9
|
+
* @default
|
|
10
|
+
*/
|
|
11
|
+
attachEvent?: (type: string, fun: (event: Event) => void, bol: boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface EventParams extends Event {
|
|
14
|
+
/**
|
|
15
|
+
* @description 重写添加 arguments
|
|
16
|
+
* @default
|
|
17
|
+
*/
|
|
18
|
+
arguments?: any[];
|
|
19
|
+
}
|
|
20
|
+
export interface JsonProps {
|
|
21
|
+
[key: string]: string | number | boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @description 事件类型
|
|
25
|
+
*/
|
|
26
|
+
export declare type EventTypes = "PageView" | "PageRetained" | "CustomTrack" | "WebClick";
|
|
27
|
+
export interface PresetParams {
|
|
28
|
+
/**
|
|
29
|
+
* @description 应用唯一标识(由接口生成)
|
|
30
|
+
*/
|
|
31
|
+
appKey?: string;
|
|
32
|
+
/**
|
|
33
|
+
* @description 数据接收地址
|
|
34
|
+
*/
|
|
35
|
+
serverUrl?: string;
|
|
36
|
+
/**
|
|
37
|
+
* @description 站点 ID
|
|
38
|
+
*/
|
|
39
|
+
siteId?: string | number;
|
|
40
|
+
/**
|
|
41
|
+
* @description 是否在网页控制台打印发送的数据
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
showLog?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* @description pc或h5
|
|
47
|
+
*/
|
|
48
|
+
platform?: "h5" | "pc";
|
|
49
|
+
/**
|
|
50
|
+
* @description 是否开启全埋点 指的是:页面浏览、元素点击事件自动上报
|
|
51
|
+
* @default true
|
|
52
|
+
*/
|
|
53
|
+
autoTrack?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @description (是否使用客户端系统时间)注意:客户端系统时间可能会不准确,导致该字段不准确
|
|
56
|
+
* @default true
|
|
57
|
+
*/
|
|
58
|
+
useClientTime?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* @description 队列单条数据最大发送时长,超过该时长将自动发送下一条数据,单位:毫秒
|
|
61
|
+
* @default 500
|
|
62
|
+
*/
|
|
63
|
+
queueTimeout?: number;
|
|
64
|
+
/**
|
|
65
|
+
* @description 接口发送超时时长,超过该时长未发送成功将强制取消,单位:毫秒
|
|
66
|
+
* @default 3000
|
|
67
|
+
*/
|
|
68
|
+
sendTimeout?: number;
|
|
69
|
+
/**
|
|
70
|
+
* @description 是否采集单页面应用的路由变化
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
isTrackSinglePage?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* @description 数据类型
|
|
76
|
+
* @default "application/x-www-form-urlencoded"
|
|
77
|
+
*/
|
|
78
|
+
contentType?: "application/x-www-form-urlencoded" | "application/json";
|
|
79
|
+
}
|
|
80
|
+
export interface InitParams extends PresetParams {
|
|
81
|
+
/**
|
|
82
|
+
* @description 应用唯一标识(由接口生成)
|
|
83
|
+
*/
|
|
84
|
+
appKey: string;
|
|
85
|
+
/**
|
|
86
|
+
* @description 数据接收地址
|
|
87
|
+
*/
|
|
88
|
+
serverUrl: string;
|
|
89
|
+
}
|
|
90
|
+
export interface ConfigTypes extends InitParams {
|
|
91
|
+
/**
|
|
92
|
+
* @description sdk版本
|
|
93
|
+
* @default "1.0.0"
|
|
94
|
+
*/
|
|
95
|
+
sdkVersion: string;
|
|
96
|
+
}
|
|
97
|
+
export interface SystemsInfo {
|
|
98
|
+
language?: string;
|
|
99
|
+
location?: string;
|
|
100
|
+
network?: string;
|
|
101
|
+
ua?: string;
|
|
102
|
+
client?: string;
|
|
103
|
+
navigationStart?: number;
|
|
104
|
+
navigation?: string;
|
|
105
|
+
dns?: string;
|
|
106
|
+
tcp?: string;
|
|
107
|
+
"tcp (ssl)"?: string;
|
|
108
|
+
request?: string;
|
|
109
|
+
response?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface TrackParams {
|
|
112
|
+
/**
|
|
113
|
+
* @description 控件/自定义事件的唯一标识
|
|
114
|
+
*/
|
|
115
|
+
partkey: string | number;
|
|
116
|
+
/**
|
|
117
|
+
* @description 自定义代码埋点描述
|
|
118
|
+
* @default "自定义代码埋点上报"
|
|
119
|
+
*/
|
|
120
|
+
desc?: string;
|
|
121
|
+
/**
|
|
122
|
+
* @description 自定义属性
|
|
123
|
+
* @default {}
|
|
124
|
+
*/
|
|
125
|
+
business?: {
|
|
126
|
+
[key: string]: any;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
export interface TargetEleProps {
|
|
130
|
+
/**
|
|
131
|
+
* @description dom节点名称
|
|
132
|
+
*/
|
|
133
|
+
nodeName?: string;
|
|
134
|
+
/**
|
|
135
|
+
* @description id类名
|
|
136
|
+
*/
|
|
137
|
+
id?: string;
|
|
138
|
+
/**
|
|
139
|
+
* @description class类名
|
|
140
|
+
*/
|
|
141
|
+
className?: string;
|
|
142
|
+
}
|
|
143
|
+
export interface TargetEleProps {
|
|
144
|
+
/**
|
|
145
|
+
* @description dom节点名称
|
|
146
|
+
*/
|
|
147
|
+
nodeName?: string;
|
|
148
|
+
/**
|
|
149
|
+
* @description id类名
|
|
150
|
+
*/
|
|
151
|
+
id?: string;
|
|
152
|
+
/**
|
|
153
|
+
* @description class类名
|
|
154
|
+
*/
|
|
155
|
+
className?: string;
|
|
156
|
+
/**
|
|
157
|
+
* @description 元素位置
|
|
158
|
+
*/
|
|
159
|
+
position?: number[];
|
|
160
|
+
}
|
|
161
|
+
export interface ExtroInfoProps {
|
|
162
|
+
sourceUrl?: string;
|
|
163
|
+
targetUrl?: string;
|
|
164
|
+
business?: JsonProps;
|
|
165
|
+
position?: number[];
|
|
166
|
+
targetEle?: TargetEleProps;
|
|
167
|
+
currentUrl?: string;
|
|
168
|
+
pageWidth?: number;
|
|
169
|
+
pageHeight?: number;
|
|
170
|
+
screenWidth?: number;
|
|
171
|
+
screenHeight?: number;
|
|
172
|
+
pointerType?: string;
|
|
173
|
+
elementSelector?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface TrackingPostParams {
|
|
176
|
+
event: EventTypes;
|
|
177
|
+
desc: string;
|
|
178
|
+
itemKey?: string;
|
|
179
|
+
extroInfo?: ExtroInfoProps;
|
|
180
|
+
}
|
|
181
|
+
export declare type HistoryType = "load" | "beforeunload" | "pushState" | "replaceState" | "popstate" | "hashchange";
|
|
182
|
+
export interface PageViewHandleParams {
|
|
183
|
+
currentUrl?: string;
|
|
184
|
+
targetUrl?: string;
|
|
185
|
+
type: HistoryType;
|
|
186
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fle-sdk/event-tracking-web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "event tracking in web",
|
|
5
5
|
"author": "飞象前端团队",
|
|
6
6
|
"license": "ISC",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"typescript": "^4.3.4"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@fle-sdk/event-tracking-web": "^1.
|
|
59
|
+
"@fle-sdk/event-tracking-web": "^1.1.1"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "685abeb34facc4f7aebe86d98137fc7593826233"
|
|
62
62
|
}
|