anys-web 3.0.3 → 4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anys-web",
3
- "version": "3.0.3",
3
+ "version": "4.0.0",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -11,23 +11,23 @@
11
11
  "author": "tangshuang",
12
12
  "license": "Apache-2.0",
13
13
  "dependencies": {
14
- "anys": "^3.0.2",
15
- "anys-shared": "^3.0.2",
16
- "anys-web-plugin-identify": "^3.0.0",
17
- "anys-web-plugin-monitor-ajax": "^3.0.2",
18
- "anys-web-plugin-monitor-dom-mutation": "^3.0.2",
19
- "anys-web-plugin-monitor-input-event": "^3.0.2",
20
- "anys-web-plugin-monitor-mouse-event": "^3.0.2",
21
- "anys-web-plugin-monitor-scroll-event": "^3.0.2",
22
- "anys-web-plugin-monitor-touch-event": "^3.0.2",
23
- "anys-web-plugin-monitor-url": "^3.0.2",
24
- "anys-web-plugin-monitor-window-activity": "^3.0.2",
25
- "anys-web-plugin-monitor-window-size": "^3.0.2",
26
- "anys-web-plugin-send-by-ajax": "^3.0.2",
27
- "anys-web-plugin-store-offline": "^3.0.3"
14
+ "anys": "^4.0.0",
15
+ "anys-shared": "^4.0.0",
16
+ "anys-web-plugin-identify": "^4.0.0",
17
+ "anys-web-plugin-monitor-ajax": "^4.0.0",
18
+ "anys-web-plugin-monitor-dom-mutation": "^4.0.0",
19
+ "anys-web-plugin-monitor-input-event": "^4.0.0",
20
+ "anys-web-plugin-monitor-mouse-event": "^4.0.0",
21
+ "anys-web-plugin-monitor-scroll-event": "^4.0.0",
22
+ "anys-web-plugin-monitor-touch-event": "^4.0.0",
23
+ "anys-web-plugin-monitor-url": "^4.0.0",
24
+ "anys-web-plugin-monitor-window-activity": "^4.0.0",
25
+ "anys-web-plugin-monitor-window-size": "^4.0.0",
26
+ "anys-web-plugin-send-by-ajax": "^4.0.0",
27
+ "anys-web-plugin-store-offline": "^4.0.0"
28
28
  },
29
29
  "publishConfig": {
30
30
  "registry": "https://registry.npmjs.org/"
31
31
  },
32
- "gitHead": "a142fb157c290b620d0955425a316708e890df42"
32
+ "gitHead": "ef55853eed15d3f8654ea449ef2d23751a385b05"
33
33
  }
@@ -117,7 +117,7 @@ export class AnysRecorderPlugin extends AnysPlugin {
117
117
  return this.offlineStore.read(message);
118
118
  }
119
119
 
120
- send(logs) {
120
+ arrange(logs) {
121
121
  const groups = [];
122
122
  let i = 0;
123
123
 
@@ -129,30 +129,30 @@ export class AnysRecorderPlugin extends AnysPlugin {
129
129
  }
130
130
  });
131
131
 
132
- const defers = groups.map((data) => {
133
- const items = [];
134
- const ids = [];
132
+ return groups;
133
+ }
135
134
 
136
- data.forEach((item) => {
137
- const { _id, ...info } = item;
138
- ids.push(_id);
139
- items.push(info);
140
- });
135
+ send(data) {
136
+ const items = [];
137
+ const ids = [];
141
138
 
142
- if (!items.length) {
143
- return;
144
- }
139
+ data.forEach((item) => {
140
+ const { _id, ...info } = item;
141
+ ids.push(_id);
142
+ items.push(info);
143
+ });
144
+
145
+ if (!items.length) {
146
+ return;
147
+ }
145
148
 
146
- const { reportUrl, reportParams } = this.anys.options;
147
- const url = reportParams ? replaceUrlSearch(reportUrl, reportParams) : reportUrl;
148
- return ajaxPost(url, { data: items }).then(() => {
149
- ids.forEach((id) => {
150
- delete this.cache[id];
151
- });
149
+ const { reportUrl, reportParams } = this.anys.options;
150
+ const url = reportParams ? replaceUrlSearch(reportUrl, reportParams) : reportUrl;
151
+ return ajaxPost(url, { data: items }).then(() => {
152
+ ids.forEach((id) => {
153
+ delete this.cache[id];
152
154
  });
153
155
  });
154
-
155
- return Promise.all(defers);
156
156
  }
157
157
 
158
158
  clear() {