anys-web 3.1.0 → 5.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.1.0",
3
+ "version": "5.0.0",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -11,23 +11,25 @@
11
11
  "author": "tangshuang",
12
12
  "license": "Apache-2.0",
13
13
  "dependencies": {
14
- "anys": "^3.1.0",
15
- "anys-shared": "^3.1.0",
16
- "anys-web-plugin-identify": "^3.1.0",
17
- "anys-web-plugin-monitor-ajax": "^3.1.0",
18
- "anys-web-plugin-monitor-dom-mutation": "^3.1.0",
19
- "anys-web-plugin-monitor-input-event": "^3.1.0",
20
- "anys-web-plugin-monitor-mouse-event": "^3.1.0",
21
- "anys-web-plugin-monitor-scroll-event": "^3.1.0",
22
- "anys-web-plugin-monitor-touch-event": "^3.1.0",
23
- "anys-web-plugin-monitor-url": "^3.1.0",
24
- "anys-web-plugin-monitor-window-activity": "^3.1.0",
25
- "anys-web-plugin-monitor-window-size": "^3.1.0",
26
- "anys-web-plugin-send-by-ajax": "^3.1.0",
27
- "anys-web-plugin-store-offline": "^3.1.0"
14
+ "anys": "^5.0.0",
15
+ "anys-shared": "^5.0.0",
16
+ "anys-web-plugin-identify": "^5.0.0",
17
+ "anys-web-plugin-monitor-ajax": "^5.0.0",
18
+ "anys-web-plugin-monitor-dom-mutation": "^5.0.0",
19
+ "anys-web-plugin-monitor-error": "^5.0.0",
20
+ "anys-web-plugin-monitor-input-event": "^5.0.0",
21
+ "anys-web-plugin-monitor-mouse-event": "^5.0.0",
22
+ "anys-web-plugin-monitor-performance": "^5.0.0",
23
+ "anys-web-plugin-monitor-scroll-event": "^5.0.0",
24
+ "anys-web-plugin-monitor-touch-event": "^5.0.0",
25
+ "anys-web-plugin-monitor-url": "^5.0.0",
26
+ "anys-web-plugin-monitor-window-activity": "^5.0.0",
27
+ "anys-web-plugin-monitor-window-size": "^5.0.0",
28
+ "anys-web-plugin-send-by-ajax": "^5.0.0",
29
+ "anys-web-plugin-store-offline": "^5.0.0"
28
30
  },
29
31
  "publishConfig": {
30
32
  "registry": "https://registry.npmjs.org/"
31
33
  },
32
- "gitHead": "8da7b416d85e5d862c70ffd8fbc14fc3eb494920"
34
+ "gitHead": "afad4091bf4b9410721a2d876b64d6325505584e"
33
35
  }
@@ -10,6 +10,8 @@ import { AnysStoreOfflinePlugin } from 'anys-web-plugin-store-offline';
10
10
  import { AnysMonitorDOMMutationPlugin } from 'anys-web-plugin-monitor-dom-mutation';
11
11
  import { AnysMonitorWindowSizePlugin } from 'anys-web-plugin-monitor-window-size';
12
12
  import { AnysMonitorScrollEventPlugin } from 'anys-web-plugin-monitor-scroll-event';
13
+ import { AnysMonitorErrorPlugin } from 'anys-web-plugin-monitor-error';
14
+ import { AnysMonitorPerformancePlugin } from 'anys-web-plugin-monitor-performance';
13
15
 
14
16
  export class AnysRecorderPlugin extends AnysPlugin {
15
17
  static dependencies = [
@@ -24,6 +26,8 @@ export class AnysRecorderPlugin extends AnysPlugin {
24
26
  AnysMonitorWindowActivityPlugin,
25
27
  AnysMonitorTouchEventPlugin,
26
28
  AnysMonitorScrollEventPlugin,
29
+ AnysMonitorErrorPlugin,
30
+ AnysMonitorPerformancePlugin,
27
31
  ];
28
32
 
29
33
  constructor(anys, [offlineStore, urlMonitor, windowSizeMonitor, DOMMutationMonitor]) {
@@ -117,7 +121,7 @@ export class AnysRecorderPlugin extends AnysPlugin {
117
121
  return this.offlineStore.read(message);
118
122
  }
119
123
 
120
- send(logs) {
124
+ arrange(logs) {
121
125
  const groups = [];
122
126
  let i = 0;
123
127
 
@@ -129,30 +133,30 @@ export class AnysRecorderPlugin extends AnysPlugin {
129
133
  }
130
134
  });
131
135
 
132
- const defers = groups.map((data) => {
133
- const items = [];
134
- const ids = [];
136
+ return groups;
137
+ }
135
138
 
136
- data.forEach((item) => {
137
- const { _id, ...info } = item;
138
- ids.push(_id);
139
- items.push(info);
140
- });
139
+ send(data) {
140
+ const items = [];
141
+ const ids = [];
141
142
 
142
- if (!items.length) {
143
- return;
144
- }
143
+ data.forEach((item) => {
144
+ const { _id, ...info } = item;
145
+ ids.push(_id);
146
+ items.push(info);
147
+ });
148
+
149
+ if (!items.length) {
150
+ return;
151
+ }
145
152
 
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
- });
153
+ const { reportUrl, reportParams } = this.anys.options;
154
+ const url = reportParams ? replaceUrlSearch(reportUrl, reportParams) : reportUrl;
155
+ return ajaxPost(url, { data: items }).then(() => {
156
+ ids.forEach((id) => {
157
+ delete this.cache[id];
152
158
  });
153
159
  });
154
-
155
- return Promise.all(defers);
156
160
  }
157
161
 
158
162
  clear() {