vite-uni-dev-tool 0.0.21 → 0.0.23

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.
Files changed (47) hide show
  1. package/README.md +13 -3
  2. package/dist/const.d.ts +16 -0
  3. package/dist/const.d.ts.map +1 -1
  4. package/dist/const.js +29 -25
  5. package/dist/core.d.ts +3 -3
  6. package/dist/core.d.ts.map +1 -1
  7. package/dist/core.js +89 -49
  8. package/dist/devEvent/index.d.ts +34 -0
  9. package/dist/devEvent/index.d.ts.map +1 -1
  10. package/dist/devEvent/index.js +71 -27
  11. package/dist/devIntercept/index.d.ts.map +1 -1
  12. package/dist/devIntercept/index.js +195 -157
  13. package/dist/devStore/index.d.ts +9 -0
  14. package/dist/devStore/index.d.ts.map +1 -1
  15. package/dist/devStore/index.js +54 -20
  16. package/dist/plugins/uniDevTool/uniDevTool.d.ts +1 -1
  17. package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
  18. package/dist/type.d.ts +22 -2
  19. package/dist/type.d.ts.map +1 -1
  20. package/dist/v2/DevTool/index.vue +8 -8
  21. package/dist/v3/ConsoleList/ConsoleItem.vue +1 -1
  22. package/dist/v3/DevTool/index.vue +13 -12
  23. package/dist/v3/DevToolWindow/const.d.ts +30 -0
  24. package/dist/v3/DevToolWindow/const.d.ts.map +1 -0
  25. package/dist/v3/DevToolWindow/const.ts +123 -0
  26. package/dist/v3/DevToolWindow/index.vue +242 -108
  27. package/dist/v3/NetworkList/InterceptConfig.vue +835 -0
  28. package/dist/v3/NetworkList/InterceptItem.vue +132 -0
  29. package/dist/v3/NetworkList/NetworkDetail.vue +25 -13
  30. package/dist/v3/NetworkList/NetworkIntercept.vue +85 -0
  31. package/dist/v3/NetworkList/NetworkItem.vue +18 -29
  32. package/dist/v3/NetworkList/NetworkSend.vue +61 -45
  33. package/dist/v3/NetworkList/index.vue +11 -67
  34. package/dist/v3/SettingList/index.vue +26 -2
  35. package/dist/v3/SettingList/typing.d.ts +2 -0
  36. package/dist/v3/SourceCode/Line.vue +3 -3
  37. package/dist/v3/SourceCode/index.vue +1 -2
  38. package/dist/v3/Tag/index.vue +1 -0
  39. package/dist/v3/UploadList/UploadDetail.vue +36 -18
  40. package/dist/v3/UploadList/UploadItem.vue +38 -34
  41. package/dist/v3/UploadList/index.vue +12 -1
  42. package/dist/v3/VirtualListPro/index.vue +15 -12
  43. package/dist/v3/WebSocket/WebSocketDetail.vue +258 -0
  44. package/dist/v3/WebSocket/WebSocketItem.vue +14 -30
  45. package/dist/v3/WebSocket/index.vue +6 -1
  46. package/package.json +1 -1
  47. package/dist/v3/WebSocket/WebSocketList.vue +0 -161
@@ -1,11 +1,11 @@
1
- import { backup as v } from "../core.js";
1
+ import { backup as y } from "../core.js";
2
2
  import "../utils/index.js";
3
- import { transformValueToView as E } from "../utils/language.js";
4
- import { getCurrentPagePath as f } from "../utils/page.js";
5
- import { getCurrentDate as p } from "../utils/date.js";
6
- import { parseValue as C } from "../utils/object.js";
7
- import { escapeHTML as P } from "../utils/string.js";
8
- class I {
3
+ import { transformValueToView as x } from "../utils/language.js";
4
+ import { getCurrentPagePath as w } from "../utils/page.js";
5
+ import { getCurrentDate as T } from "../utils/date.js";
6
+ import { parseValue as F } from "../utils/object.js";
7
+ import { escapeHTML as V } from "../utils/string.js";
8
+ class K {
9
9
  constructor(e) {
10
10
  this.initPinia = !1, this.cache$on = /* @__PURE__ */ new Map(), this.cache$once = /* @__PURE__ */ new Map(), this.cache$emit = /* @__PURE__ */ new Map(), this.cache$off = /* @__PURE__ */ new Map(), this.event = e.event, this.init(e);
11
11
  }
@@ -22,15 +22,15 @@ class I {
22
22
  return;
23
23
  const e = this;
24
24
  uni.__log__ = function(r, t, ...n) {
25
- const s = f();
26
- v.__log__(r, t, ...n), e.event.updateConsoleList([
25
+ const a = w();
26
+ y.__log__(r, t, ...n), e.event.updateConsoleList([
27
27
  {
28
28
  type: r,
29
- position: s,
30
- time: p(),
29
+ position: a,
30
+ time: T(),
31
31
  args: n.map((c) => ({
32
- type: E(c),
33
- value: C(c)
32
+ type: x(c),
33
+ value: F(c)
34
34
  })),
35
35
  stack: t
36
36
  }
@@ -45,9 +45,9 @@ class I {
45
45
  interceptVue(e) {
46
46
  if (!e)
47
47
  return;
48
- const r = (n, s, c) => {
48
+ const r = (n, a, c) => {
49
49
  this.event.getDevToolDestroy() || this.interceptErrorVue(n);
50
- }, t = (n, s, c) => {
50
+ }, t = (n, a, c) => {
51
51
  this.event.getDevToolDestroy() || this.interceptWarnVue(n + `
52
52
  ` + c);
53
53
  };
@@ -60,11 +60,11 @@ class I {
60
60
  */
61
61
  interceptAppError() {
62
62
  uni.onError((e) => {
63
- var n, s;
63
+ var n, a;
64
64
  if (this.event.getDevToolDestroy())
65
65
  return;
66
- const r = e.toString(), t = ((s = (n = e == null ? void 0 : e.stack) == null ? void 0 : n.split(`
67
- `)) == null ? void 0 : s[1]) ?? "";
66
+ const r = e.toString(), t = ((a = (n = e == null ? void 0 : e.stack) == null ? void 0 : n.split(`
67
+ `)) == null ? void 0 : a[1]) ?? "";
68
68
  this.event.updateConsoleList([
69
69
  {
70
70
  type: "error",
@@ -74,8 +74,8 @@ class I {
74
74
  value: r
75
75
  }
76
76
  ],
77
- position: f(),
78
- time: p(),
77
+ position: w(),
78
+ time: T(),
79
79
  stack: t
80
80
  }
81
81
  ]);
@@ -100,8 +100,8 @@ class I {
100
100
  value: e.toString()
101
101
  }
102
102
  ],
103
- position: f(),
104
- time: p(),
103
+ position: w(),
104
+ time: T(),
105
105
  stack: t
106
106
  }
107
107
  ]);
@@ -114,15 +114,15 @@ class I {
114
114
  * @memberof DevIntercept
115
115
  */
116
116
  interceptWarnVue(e) {
117
- var c, i, l, o;
117
+ var c, l, u, m;
118
118
  if (this.preWarn === e)
119
119
  return;
120
120
  this.preWarn = e;
121
- const r = f(), t = (i = (c = new Error()) == null ? void 0 : c.stack) == null ? void 0 : i.split(`
122
- `), n = (l = t == null ? void 0 : t.slice(2)) == null ? void 0 : l[0];
121
+ const r = w(), t = (l = (c = new Error()) == null ? void 0 : c.stack) == null ? void 0 : l.split(`
122
+ `), n = (u = t == null ? void 0 : t.slice(2)) == null ? void 0 : u[0];
123
123
  console.warn(e);
124
- const s = (o = e.split(`
125
- `)) == null ? void 0 : o.map((m) => P(m)).join(`
124
+ const a = (m = e.split(`
125
+ `)) == null ? void 0 : m.map((v) => V(v)).join(`
126
126
  `);
127
127
  this.event.updateConsoleList([
128
128
  {
@@ -130,11 +130,11 @@ class I {
130
130
  args: [
131
131
  {
132
132
  type: "string",
133
- value: s
133
+ value: a
134
134
  }
135
135
  ],
136
136
  position: r,
137
- time: p(),
137
+ time: T(),
138
138
  stack: n
139
139
  }
140
140
  ]);
@@ -146,8 +146,9 @@ class I {
146
146
  */
147
147
  interceptPromiseReject() {
148
148
  Object.defineProperty(Promise, "reject", {
149
+ configurable: !0,
149
150
  value: function(e) {
150
- return this.interceptErrorApp(e), v.reject.call(Promise, e);
151
+ return this.interceptErrorApp(e), y.reject.call(Promise, e);
151
152
  }
152
153
  });
153
154
  }
@@ -162,10 +163,10 @@ class I {
162
163
  invoke(r) {
163
164
  const t = r.complete;
164
165
  r.complete = function(n) {
165
- var c, i, l;
166
+ var c, l, u;
166
167
  t && t(n);
167
- const s = ((l = (i = (c = r.url) == null ? void 0 : c.slice(1)) == null ? void 0 : i.split("?")) == null ? void 0 : l[0]) || "/";
168
- e.event.updateCurrentPagePath(s);
168
+ const a = ((u = (l = (c = r.url) == null ? void 0 : c.slice(1)) == null ? void 0 : l.split("?")) == null ? void 0 : u[0]) || "/";
169
+ e.event.updateCurrentPagePath(a);
169
170
  };
170
171
  }
171
172
  });
@@ -181,10 +182,10 @@ class I {
181
182
  invoke(r) {
182
183
  const t = r.complete;
183
184
  r.complete = function(n) {
184
- var c, i, l;
185
+ var c, l, u;
185
186
  t && t(n);
186
- const s = ((l = (i = (c = r.url) == null ? void 0 : c.slice(1)) == null ? void 0 : i.split("?")) == null ? void 0 : l[0]) || "/";
187
- e.event.updateCurrentPagePath(s);
187
+ const a = ((u = (l = (c = r.url) == null ? void 0 : c.slice(1)) == null ? void 0 : l.split("?")) == null ? void 0 : u[0]) || "/";
188
+ e.event.updateCurrentPagePath(a);
188
189
  };
189
190
  }
190
191
  });
@@ -198,21 +199,21 @@ class I {
198
199
  const e = this;
199
200
  uni.addInterceptor("request", {
200
201
  invoke(r) {
201
- var u, S, k;
202
- const t = e.event.getRequestIndex(), n = e.event.setRequestIndex(t + 1), s = r.url, c = (u = s == null ? void 0 : s.split("?")) == null ? void 0 : u[0], i = c == null ? void 0 : c.lastIndexOf("/"), l = (c == null ? void 0 : c.slice(i + 1)) ?? "", o = (k = (S = new Error()) == null ? void 0 : S.stack) == null ? void 0 : k.split(`
203
- `), m = o == null ? void 0 : o[5], a = {
202
+ var P, D, E, b, U, H, j;
203
+ const t = e.event.getRequestIndex(), n = e.event.setRequestIndex(t + 1), a = r.url, c = (P = a == null ? void 0 : a.split("?")) == null ? void 0 : P[0], l = c == null ? void 0 : c.lastIndexOf("/"), u = (c == null ? void 0 : c.slice(l + 1)) ?? "", m = (E = (D = new Error()) == null ? void 0 : D.stack) == null ? void 0 : E.split(`
204
+ `), v = m == null ? void 0 : m[5], s = e.event.getInterceptNetworkMap(), d = `${(b = r.method) == null ? void 0 : b.toUpperCase()}|${c}`, i = s == null ? void 0 : s.get(d), o = {
204
205
  index: n,
205
- stack: m,
206
+ stack: v,
206
207
  url: r.url,
207
- name: l,
208
+ name: u,
208
209
  startTime: Date.now(),
209
210
  endTime: 0,
210
211
  time: "-",
211
212
  headers: {
212
213
  requestHeader: Object.entries(r.header ?? {}).map(
213
- ([h, g]) => ({
214
+ ([h, S]) => ({
214
215
  key: h,
215
- value: g
216
+ value: S
216
217
  })
217
218
  ),
218
219
  responseHeader: []
@@ -220,23 +221,49 @@ class I {
220
221
  method: r.method || "GET",
221
222
  status: "pending",
222
223
  payload: r != null && r.data ? JSON.stringify(r.data) : "",
223
- response: "",
224
+ response: {
225
+ data: void 0,
226
+ statusCode: 0,
227
+ header: {},
228
+ cookies: [],
229
+ errMsg: ""
230
+ },
224
231
  size: ""
225
232
  };
226
- e.event.updateNetworkList([a]);
227
- let d = r.complete;
228
- r.complete = function(h) {
229
- var T, w;
230
- d && d(h), a.status = h.statusCode ?? "error", a.endTime = Date.now();
231
- const g = Date.now() - a.startTime;
232
- a.time = g < 1e3 ? g + "ms" : g / 1e3 + "s";
233
- const y = ((T = h == null ? void 0 : h.header) == null ? void 0 : T["Content-Length"]) || ((w = h == null ? void 0 : h.header) == null ? void 0 : w["content-length"]) || 0;
234
- a.size = y > 1024 ? (y / 1024).toFixed(2) + "k" : y + "b", a.response = h, a.headers.responseHeader = Object.entries(
233
+ i && (o.headers.requestHeader = {
234
+ ...o.headers.requestHeader,
235
+ // 拦截规则中的请求头权重更高
236
+ ...i.headers.requestHeader
237
+ }, o.payload = {
238
+ ...i.payload
239
+ }, o.intercepted = !0, Object.assign(r, { timeout: i.timeout })), e.event.updateNetworkList([o]);
240
+ const p = {
241
+ errMsg: ""
242
+ };
243
+ let C = !0;
244
+ i && (p.statusCode = i.status, (H = (U = i == null ? void 0 : i.status) == null ? void 0 : U.toString()) != null && H.startsWith("2") ? (C = !0, p.errMsg = "request:ok", p.header = (j = i.headers.responseHeader) == null ? void 0 : j.reduce(
245
+ (h, S) => ({
246
+ ...h,
247
+ [S.key]: S.value
248
+ }),
249
+ {}
250
+ ), p.data = i.response.data) : (C = !1, p.errMsg = "request:fail"));
251
+ let f = r.fail, g = r.success, k = r.complete;
252
+ r.fail = function(h) {
253
+ i ? C ? g == null || g(p) : f == null || f(p) : f == null || f(h);
254
+ }, r.success = function(h) {
255
+ i ? C ? g == null || g(p) : f == null || f(p) : g == null || g(h);
256
+ }, r.complete = function(h) {
257
+ var q, W;
258
+ const S = Date.now() - o.startTime;
259
+ o.time = S < 1e3 ? S + "ms" : S / 1e3 + "s", o.endTime = Date.now();
260
+ const L = ((q = h == null ? void 0 : h.header) == null ? void 0 : q["Content-Length"]) || ((W = h == null ? void 0 : h.header) == null ? void 0 : W["content-length"]) || 0;
261
+ o.size = L > 1024 ? (L / 1024).toFixed(2) + "k" : L + "b", i ? (k == null || k(p), o.status = i.status, o.response = p, o.headers.responseHeader = i.headers.responseHeader) : (k == null || k(h), o.status = h.statusCode ?? "error", o.response = h, o.headers.responseHeader = Object.entries(
235
262
  h.header ?? {}
236
- ).map(([L, D]) => ({
237
- key: L,
238
- value: D
239
- })), e.event.updateNetworkList([a], n);
263
+ ).map(([$, I]) => ({
264
+ key: $,
265
+ value: I
266
+ }))), e.event.updateNetworkList([o], n);
240
267
  };
241
268
  }
242
269
  });
@@ -248,146 +275,151 @@ class I {
248
275
  */
249
276
  interceptSocket() {
250
277
  const e = this, r = function(t) {
251
- const n = t.url, s = Object.entries(t.header ?? {}).map(
252
- ([a, d]) => ({ key: a, value: d })
253
- ), c = (t.method ?? "GET").toLowerCase(), i = t.protocols ?? [];
278
+ const n = t.url, a = Object.entries(t.header ?? {}).map(
279
+ ([s, d]) => ({ key: s, value: d })
280
+ ), c = (t.method ?? "GET").toLowerCase(), l = t.protocols ?? [];
254
281
  e.event.updateWsList({
255
282
  url: n,
256
- headers: s,
283
+ headers: a,
257
284
  method: c,
258
- protocols: i,
285
+ protocols: l,
259
286
  readyState: "connection",
260
287
  message: []
261
288
  });
262
- const l = v.connectSocket({
289
+ const u = y.connectSocket({
263
290
  ...t,
264
- success: (a) => {
291
+ success: (s) => {
265
292
  var d;
266
- (d = t.success) == null || d.call(t, a), e.event.updateWsList({
293
+ (d = t.success) == null || d.call(t, s), e.event.updateWsList({
267
294
  url: n,
268
295
  readyState: "open",
269
- headers: s,
270
- protocols: i,
296
+ headers: a,
297
+ protocols: l,
271
298
  message: [
272
299
  {
273
300
  data: "连接成功",
274
- type: "success",
275
- time: Date.now()
301
+ status: "success",
302
+ time: Date.now(),
303
+ type: "receive"
276
304
  }
277
305
  ]
278
306
  });
279
307
  },
280
- fail: (a) => {
308
+ fail: (s) => {
281
309
  var d;
282
- (d = t.fail) == null || d.call(t, a), e.event.updateWsList({
310
+ (d = t.fail) == null || d.call(t, s), e.event.updateWsList({
283
311
  url: n,
284
312
  readyState: "error",
285
- headers: s,
286
- protocols: i,
313
+ headers: a,
314
+ protocols: l,
287
315
  message: [
288
316
  {
289
317
  data: "连接失败",
290
- type: "error",
291
- time: Date.now()
318
+ status: "error",
319
+ time: Date.now(),
320
+ type: "receive"
292
321
  }
293
322
  ]
294
323
  });
295
324
  },
296
- complete: (a) => {
325
+ complete: (s) => {
297
326
  var d;
298
- (d = t == null ? void 0 : t.complete) == null || d.call(t, a);
327
+ (d = t == null ? void 0 : t.complete) == null || d.call(t, s);
299
328
  }
300
- }), o = l.send;
301
- l.send = (a) => {
302
- o.call(l, {
303
- data: a.data,
329
+ }), m = u.send;
330
+ u.send = (s) => {
331
+ m.call(u, {
332
+ data: s.data,
304
333
  fail: (d) => {
305
- var u;
306
- (u = a == null ? void 0 : a.fail) == null || u.call(a, d), e.event.updateWsList({
334
+ var i;
335
+ (i = s == null ? void 0 : s.fail) == null || i.call(s, d), e.event.updateWsList({
307
336
  url: n,
308
337
  readyState: "error",
309
- headers: s,
310
- protocols: i,
338
+ headers: a,
339
+ protocols: l,
311
340
  message: [
312
341
  {
313
342
  data: JSON.stringify(d),
314
- type: "error",
315
- time: Date.now()
343
+ status: "error",
344
+ time: Date.now(),
345
+ type: "send"
316
346
  }
317
347
  ]
318
348
  });
319
349
  },
320
350
  success: (d) => {
321
- var u, S;
322
- (u = a == null ? void 0 : a.success) == null || u.call(a, d), e.event.updateWsList({
351
+ var i, o;
352
+ (i = s == null ? void 0 : s.success) == null || i.call(s, d), e.event.updateWsList({
323
353
  readyState: "open",
324
354
  url: n,
325
- headers: s,
326
- protocols: i,
355
+ headers: a,
356
+ protocols: l,
327
357
  message: [
328
358
  {
329
- type: "success",
359
+ status: "success",
330
360
  time: Date.now(),
331
- data: (S = a.data) == null ? void 0 : S.toString()
361
+ data: (o = s.data) == null ? void 0 : o.toString(),
362
+ type: "send"
332
363
  }
333
364
  ]
334
365
  });
335
366
  },
336
367
  complete: (d) => {
337
- var u;
338
- (u = a == null ? void 0 : a.complete) == null || u.call(a, d);
368
+ var i;
369
+ (i = s == null ? void 0 : s.complete) == null || i.call(s, d);
339
370
  }
340
371
  });
341
372
  };
342
- const m = l.close;
343
- return l.close = (a) => {
373
+ const v = u.close;
374
+ return u.close = (s) => {
344
375
  e.event.updateWsList({
345
376
  url: n,
346
377
  readyState: "closing",
347
- headers: s,
348
- protocols: i,
378
+ headers: a,
379
+ protocols: l,
349
380
  message: []
350
- }), m.call(l, {
351
- ...a,
381
+ }), v.call(u, {
382
+ ...s,
352
383
  fail: (d) => {
353
- var u;
354
- (u = a == null ? void 0 : a.fail) == null || u.call(a, d), e.event.updateWsList({
384
+ var i;
385
+ (i = s == null ? void 0 : s.fail) == null || i.call(s, d), e.event.updateWsList({
355
386
  url: n,
356
- headers: s,
387
+ headers: a,
357
388
  readyState: "open",
358
- protocols: i,
389
+ protocols: l,
359
390
  message: []
360
391
  });
361
392
  },
362
393
  success: (d) => {
363
- var u;
364
- (u = a == null ? void 0 : a.success) == null || u.call(a, d), e.event.updateWsList({
394
+ var i;
395
+ (i = s == null ? void 0 : s.success) == null || i.call(s, d), e.event.updateWsList({
365
396
  url: n,
366
- headers: s,
397
+ headers: a,
367
398
  readyState: "closed",
368
- protocols: i,
399
+ protocols: l,
369
400
  message: []
370
401
  });
371
402
  },
372
403
  complete: (d) => {
373
- var u;
374
- (u = a == null ? void 0 : a.complete) == null || u.call(a, d);
404
+ var i;
405
+ (i = s == null ? void 0 : s.complete) == null || i.call(s, d);
375
406
  }
376
407
  });
377
- }, l.onMessage((a) => {
408
+ }, u.onMessage((s) => {
378
409
  e.event.updateWsList({
379
410
  url: n,
380
- headers: s,
381
- protocols: i,
411
+ headers: a,
412
+ protocols: l,
382
413
  message: [
383
414
  {
384
- type: "success",
415
+ status: "success",
385
416
  time: Date.now(),
386
- data: JSON.parse(a.data)
417
+ data: JSON.parse(s.data),
418
+ type: "receive"
387
419
  }
388
420
  ]
389
421
  });
390
- }), l;
422
+ }), u;
391
423
  };
392
424
  uni.connectSocket = r;
393
425
  }
@@ -399,8 +431,9 @@ class I {
399
431
  interceptSetStorage() {
400
432
  const e = this;
401
433
  Object.defineProperty(uni, "setStorageSync", {
434
+ configurable: !0,
402
435
  value: function(r, t) {
403
- v.setStorageSync(r.toString(), t), e.event.updateStoreList([
436
+ y.setStorageSync(r.toString(), t), e.event.updateStoreList([
404
437
  {
405
438
  key: r.toString(),
406
439
  _oldKey: r.toString(),
@@ -412,10 +445,10 @@ class I {
412
445
  invoke(r) {
413
446
  const t = r.complete;
414
447
  r.complete = function(n) {
415
- var s, c;
448
+ var a, c;
416
449
  t && t(n), e.event.updateStoreList([
417
450
  {
418
- key: (s = r.key) == null ? void 0 : s.toString(),
451
+ key: (a = r.key) == null ? void 0 : a.toString(),
419
452
  _oldKey: (c = r.key) == null ? void 0 : c.toString(),
420
453
  value: r.data
421
454
  }
@@ -432,8 +465,9 @@ class I {
432
465
  interceptClearStorage() {
433
466
  const e = this;
434
467
  Object.defineProperty(uni, "clearStorage", {
468
+ configurable: !0,
435
469
  value: function() {
436
- v.clearStorage(), e.event.clearStorage();
470
+ y.clearStorage(), e.event.clearStorage();
437
471
  }
438
472
  }), uni.addInterceptor("clearStorage", {
439
473
  invoke() {
@@ -449,8 +483,9 @@ class I {
449
483
  interceptRemoveStorage() {
450
484
  const e = this;
451
485
  Object.defineProperty(uni, "removeStorageSync", {
486
+ configurable: !0,
452
487
  value: function(r) {
453
- v.removeStorageSync(r), e.event.removeStorage(r);
488
+ y.removeStorageSync(r), e.event.removeStorage(r);
454
489
  }
455
490
  }), uni.addInterceptor("removeStorage", {
456
491
  invoke(r) {
@@ -484,18 +519,21 @@ class I {
484
519
  */
485
520
  interceptUploadFile() {
486
521
  const e = this, r = (t) => {
487
- const n = e.event.getUploadIndex(), s = e.event.setUploadIndex(n + 1);
522
+ var m, v;
523
+ const n = e.event.getUploadIndex(), a = e.event.setUploadIndex(n + 1), c = (v = (m = new Error()) == null ? void 0 : m.stack) == null ? void 0 : v.split(`
524
+ `), l = c == null ? void 0 : c[2];
488
525
  e.event.updateUploadList(
489
526
  [
490
527
  {
491
- index: s,
528
+ index: a,
529
+ stack: l,
492
530
  name: t.name,
493
531
  url: t.url,
494
532
  filePath: t.filePath,
495
533
  fileType: t.fileType,
496
534
  headers: {
497
535
  requestHeader: Object.entries(t.header || {}).map(
498
- ([i, l]) => ({ key: i, value: l })
536
+ ([s, d]) => ({ key: s, value: d })
499
537
  ),
500
538
  responseHeader: []
501
539
  },
@@ -507,69 +545,69 @@ class I {
507
545
  startTime: Date.now()
508
546
  }
509
547
  ],
510
- s
548
+ a
511
549
  );
512
- const c = v.uploadFile({
550
+ const u = y.uploadFile({
513
551
  ...t,
514
- success: (i) => {
515
- var l;
516
- (l = t == null ? void 0 : t.success) == null || l.call(t, i), e.event.updateUploadList(
552
+ success: (s) => {
553
+ var d;
554
+ (d = t == null ? void 0 : t.success) == null || d.call(t, s), e.event.updateUploadList(
517
555
  [
518
556
  {
519
- index: s,
557
+ index: a,
520
558
  status: "success",
521
559
  endTime: Date.now(),
522
560
  response: {
523
- ...i,
524
- data: JSON.parse(i.data)
561
+ ...s,
562
+ data: JSON.parse(s.data)
525
563
  }
526
564
  }
527
565
  ],
528
- s
529
- ), e.event.removeUploadTask(s);
566
+ a
567
+ ), e.event.removeUploadTask(a);
530
568
  },
531
- fail: (i) => {
532
- var l;
533
- (l = t == null ? void 0 : t.fail) == null || l.call(t, i), e.event.updateUploadList(
569
+ fail: (s) => {
570
+ var d;
571
+ (d = t == null ? void 0 : t.fail) == null || d.call(t, s), e.event.updateUploadList(
534
572
  [
535
573
  {
536
- index: s,
574
+ index: a,
537
575
  status: "error",
538
- response: i,
576
+ response: s,
539
577
  endTime: Date.now()
540
578
  }
541
579
  ],
542
- s
543
- ), e.event.removeUploadTask(s);
580
+ a
581
+ ), e.event.removeUploadTask(a);
544
582
  }
545
583
  });
546
- return c.onProgressUpdate((i) => {
584
+ return u.onProgressUpdate((s) => {
547
585
  e.event.updateUploadList(
548
586
  [
549
587
  {
550
- index: s,
551
- progress: i.progress,
552
- totalBytesSent: i.totalBytesSent,
553
- totalBytesExpectedToSend: i.totalBytesExpectedToSend,
588
+ index: a,
589
+ progress: s.progress,
590
+ totalBytesSent: s.totalBytesSent,
591
+ totalBytesExpectedToSend: s.totalBytesExpectedToSend,
554
592
  status: "uploading"
555
593
  }
556
594
  ],
557
- s
595
+ a
558
596
  );
559
- }), e.event.addUploadTask(s, c), c;
597
+ }), e.event.addUploadTask(a, u), u;
560
598
  };
561
599
  uni.uploadFile = r.bind(uni);
562
600
  }
563
601
  interceptUniEventFactory(e) {
564
602
  const r = `$${e}`;
565
603
  uni[`$${e}`] = (t, n) => {
566
- var i, l, o, m;
567
- const s = (l = (i = new Error()) == null ? void 0 : i.stack) == null ? void 0 : l.split(`
568
- `), c = s == null ? void 0 : s[2];
569
- (m = (o = v) == null ? void 0 : o[r]) == null || m.call(o, t, n), this.event.updateUniEventList([
604
+ var l, u, m, v;
605
+ const a = (u = (l = new Error()) == null ? void 0 : l.stack) == null ? void 0 : u.split(`
606
+ `), c = a == null ? void 0 : a[2];
607
+ (v = (m = y) == null ? void 0 : m[r]) == null || v.call(m, t, n), this.event.updateUniEventList([
570
608
  {
571
609
  eventName: t,
572
- timer: p(),
610
+ timer: T(),
573
611
  stack: c,
574
612
  type: e
575
613
  }
@@ -588,13 +626,13 @@ class I {
588
626
  uni.onUserCaptureScreen(() => {
589
627
  this.event.getDevToolDestroy() || this.event.updateCaptureScreenList([
590
628
  {
591
- position: f(),
592
- timer: p()
629
+ position: w(),
630
+ timer: T()
593
631
  }
594
632
  ]);
595
633
  });
596
634
  }
597
635
  }
598
636
  export {
599
- I as DevIntercept
637
+ K as DevIntercept
600
638
  };