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