@fle-sdk/event-tracking-web 1.1.1 → 1.2.0-beta.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/README.md +142 -133
- package/lib/index.esm.js +1 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/types/index.d.ts +22 -42
- package/lib/types/tools.d.ts +8 -11
- package/lib/types/type.d.ts +93 -51
- package/package.json +3 -4
package/lib/types/type.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export interface EventParams extends Event {
|
|
|
18
18
|
arguments?: any[];
|
|
19
19
|
}
|
|
20
20
|
export interface JsonProps {
|
|
21
|
-
[key: string]:
|
|
21
|
+
[key: string]: any;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* @description 事件类型
|
|
@@ -34,18 +34,14 @@ export interface PresetParams {
|
|
|
34
34
|
*/
|
|
35
35
|
serverUrl?: string;
|
|
36
36
|
/**
|
|
37
|
-
* @description
|
|
37
|
+
* @description 手动指定客户端平台类型(h5、pc、ipad、other)
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
platform?: PlatformType | string;
|
|
40
40
|
/**
|
|
41
41
|
* @description 是否在网页控制台打印发送的数据
|
|
42
42
|
* @default false
|
|
43
43
|
*/
|
|
44
44
|
showLog?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* @description pc或h5
|
|
47
|
-
*/
|
|
48
|
-
platform?: "h5" | "pc";
|
|
49
45
|
/**
|
|
50
46
|
* @description 是否开启全埋点 指的是:页面浏览、元素点击事件自动上报
|
|
51
47
|
* @default true
|
|
@@ -56,11 +52,6 @@ export interface PresetParams {
|
|
|
56
52
|
* @default true
|
|
57
53
|
*/
|
|
58
54
|
useClientTime?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* @description 队列单条数据最大发送时长,超过该时长将自动发送下一条数据,单位:毫秒
|
|
61
|
-
* @default 500
|
|
62
|
-
*/
|
|
63
|
-
queueTimeout?: number;
|
|
64
55
|
/**
|
|
65
56
|
* @description 接口发送超时时长,超过该时长未发送成功将强制取消,单位:毫秒
|
|
66
57
|
* @default 3000
|
|
@@ -76,6 +67,13 @@ export interface PresetParams {
|
|
|
76
67
|
* @default "application/x-www-form-urlencoded"
|
|
77
68
|
*/
|
|
78
69
|
contentType?: "application/x-www-form-urlencoded" | "application/json";
|
|
70
|
+
/**
|
|
71
|
+
* @description 全局自定义业务参数
|
|
72
|
+
* @default {}
|
|
73
|
+
*/
|
|
74
|
+
business?: {
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
};
|
|
79
77
|
}
|
|
80
78
|
export interface InitParams extends PresetParams {
|
|
81
79
|
/**
|
|
@@ -87,26 +85,22 @@ export interface InitParams extends PresetParams {
|
|
|
87
85
|
*/
|
|
88
86
|
serverUrl: string;
|
|
89
87
|
}
|
|
90
|
-
export
|
|
88
|
+
export declare type PlatformType = "h5" | "pc" | "ipad" | "other";
|
|
89
|
+
export interface SystemsInfoTypes {
|
|
90
|
+
language?: string;
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
93
|
-
* @default "1.0.0"
|
|
92
|
+
* 网络类型
|
|
94
93
|
*/
|
|
95
|
-
sdkVersion: string;
|
|
96
|
-
}
|
|
97
|
-
export interface SystemsInfo {
|
|
98
|
-
language?: string;
|
|
99
|
-
location?: string;
|
|
100
94
|
network?: string;
|
|
101
95
|
ua?: string;
|
|
96
|
+
/**
|
|
97
|
+
* @description 客户端(Mac/Android/iPhone/iPad/iPod/WeChat)
|
|
98
|
+
*/
|
|
102
99
|
client?: string;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"tcp (ssl)"?: string;
|
|
108
|
-
request?: string;
|
|
109
|
-
response?: string;
|
|
100
|
+
/**
|
|
101
|
+
* @description 客户端平台类型(h5、pc、ipad)
|
|
102
|
+
*/
|
|
103
|
+
platform?: PlatformType | string;
|
|
110
104
|
}
|
|
111
105
|
export interface TrackParams {
|
|
112
106
|
/**
|
|
@@ -119,7 +113,7 @@ export interface TrackParams {
|
|
|
119
113
|
*/
|
|
120
114
|
desc?: string;
|
|
121
115
|
/**
|
|
122
|
-
* @description
|
|
116
|
+
* @description 自定义业务参数
|
|
123
117
|
* @default {}
|
|
124
118
|
*/
|
|
125
119
|
business?: {
|
|
@@ -139,48 +133,96 @@ export interface TargetEleProps {
|
|
|
139
133
|
* @description class类名
|
|
140
134
|
*/
|
|
141
135
|
className?: string;
|
|
142
|
-
}
|
|
143
|
-
export interface TargetEleProps {
|
|
144
136
|
/**
|
|
145
|
-
* @description
|
|
137
|
+
* @description 元素触发位置:[x, y]
|
|
146
138
|
*/
|
|
147
|
-
|
|
139
|
+
position?: [number, number];
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* @description 基础系统信息
|
|
143
|
+
*/
|
|
144
|
+
export interface PrivateParamProps {
|
|
148
145
|
/**
|
|
149
|
-
* @description
|
|
146
|
+
* @description 当前URL
|
|
150
147
|
*/
|
|
151
|
-
|
|
148
|
+
currentUrl?: string;
|
|
152
149
|
/**
|
|
153
|
-
* @description
|
|
150
|
+
* @description 目标URL
|
|
154
151
|
*/
|
|
155
|
-
|
|
152
|
+
targetUrl?: string;
|
|
156
153
|
/**
|
|
157
|
-
* @description
|
|
154
|
+
* @description 手动埋点参数
|
|
158
155
|
*/
|
|
159
|
-
position?: number[];
|
|
160
|
-
}
|
|
161
|
-
export interface ExtroInfoProps {
|
|
162
|
-
sourceUrl?: string;
|
|
163
|
-
targetUrl?: string;
|
|
164
156
|
business?: JsonProps;
|
|
165
|
-
|
|
157
|
+
/**
|
|
158
|
+
* @description 触发元素属性
|
|
159
|
+
*/
|
|
166
160
|
targetEle?: TargetEleProps;
|
|
167
|
-
|
|
161
|
+
/**
|
|
162
|
+
* @description 页面可视区宽度
|
|
163
|
+
*/
|
|
168
164
|
pageWidth?: number;
|
|
165
|
+
/**
|
|
166
|
+
* @description 页面可视区高度
|
|
167
|
+
*/
|
|
169
168
|
pageHeight?: number;
|
|
169
|
+
/**
|
|
170
|
+
* @description 显示屏宽度
|
|
171
|
+
*/
|
|
170
172
|
screenWidth?: number;
|
|
173
|
+
/**
|
|
174
|
+
* @description 显示屏高度
|
|
175
|
+
*/
|
|
171
176
|
screenHeight?: number;
|
|
172
|
-
|
|
177
|
+
/**
|
|
178
|
+
* @description 手动触发的指针类型
|
|
179
|
+
*/
|
|
180
|
+
pointerType?: "mouse" | "touch" | "pen";
|
|
181
|
+
/**
|
|
182
|
+
* @description 触发元素链路
|
|
183
|
+
*/
|
|
173
184
|
elementSelector?: string;
|
|
185
|
+
/**
|
|
186
|
+
* @description 用户信息
|
|
187
|
+
*/
|
|
188
|
+
userInfo?: JsonProps;
|
|
189
|
+
/**
|
|
190
|
+
* @description 路由参数
|
|
191
|
+
*/
|
|
192
|
+
urlParams?: JsonProps;
|
|
193
|
+
/**
|
|
194
|
+
* @description 系统信息
|
|
195
|
+
*/
|
|
196
|
+
systemsInfo?: SystemsInfoTypes;
|
|
197
|
+
/**
|
|
198
|
+
* @description SDk版本
|
|
199
|
+
*/
|
|
200
|
+
sdkVersion?: string;
|
|
201
|
+
/**
|
|
202
|
+
* @description 页面停留时长(毫秒)
|
|
203
|
+
*/
|
|
204
|
+
retainedDuration?: number;
|
|
174
205
|
}
|
|
175
206
|
export interface TrackingPostParams {
|
|
207
|
+
/**
|
|
208
|
+
* @description 事件类型
|
|
209
|
+
*/
|
|
176
210
|
event: EventTypes;
|
|
211
|
+
/**
|
|
212
|
+
* @description 埋点事件描述
|
|
213
|
+
*/
|
|
177
214
|
desc: string;
|
|
215
|
+
/**
|
|
216
|
+
* @description 当前埋点事件Key
|
|
217
|
+
*/
|
|
178
218
|
itemKey?: string;
|
|
179
|
-
|
|
219
|
+
/**
|
|
220
|
+
* @description 发送请求事件
|
|
221
|
+
*/
|
|
222
|
+
requestTime?: number;
|
|
223
|
+
/**
|
|
224
|
+
* @description 私有参数
|
|
225
|
+
*/
|
|
226
|
+
privateParamMap?: PrivateParamProps;
|
|
180
227
|
}
|
|
181
228
|
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.2.0-beta.0",
|
|
4
4
|
"description": "event tracking in web",
|
|
5
5
|
"author": "飞象前端团队",
|
|
6
6
|
"license": "ISC",
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
"typescript": "^4.3.4"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@fle-sdk/event-tracking-web": "^1.1.
|
|
60
|
-
}
|
|
61
|
-
"gitHead": "685abeb34facc4f7aebe86d98137fc7593826233"
|
|
59
|
+
"@fle-sdk/event-tracking-web": "^1.1.2-alpha.0"
|
|
60
|
+
}
|
|
62
61
|
}
|