@xmtp/browser-sdk 5.3.0 → 6.0.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.
Files changed (53) hide show
  1. package/dist/index.d.ts +541 -671
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/workers/client.js +1 -1
  5. package/dist/workers/client.js.map +1 -1
  6. package/dist/workers/opfs.js +2 -0
  7. package/dist/workers/opfs.js.map +1 -0
  8. package/package.json +12 -16
  9. package/src/Client.ts +92 -219
  10. package/src/CodecRegistry.ts +27 -0
  11. package/src/Conversation.ts +275 -104
  12. package/src/Conversations.ts +188 -99
  13. package/src/DebugInformation.ts +10 -27
  14. package/src/DecodedMessage.ts +155 -58
  15. package/src/Dm.ts +25 -9
  16. package/src/Group.ts +30 -29
  17. package/src/Opfs.ts +63 -0
  18. package/src/Preferences.ts +68 -52
  19. package/src/WorkerClient.ts +5 -5
  20. package/src/WorkerConversation.ts +98 -45
  21. package/src/WorkerConversations.ts +35 -74
  22. package/src/WorkerDebugInformation.ts +1 -12
  23. package/src/WorkerPreferences.ts +6 -14
  24. package/src/index.ts +54 -24
  25. package/src/types/actions/client.ts +6 -17
  26. package/src/types/actions/conversation.ts +160 -31
  27. package/src/types/actions/conversations.ts +21 -24
  28. package/src/types/actions/debugInformation.ts +3 -11
  29. package/src/types/actions/dm.ts +1 -1
  30. package/src/types/actions/opfs.ts +66 -0
  31. package/src/types/actions/preferences.ts +6 -13
  32. package/src/types/actions/streams.ts +8 -8
  33. package/src/types/actions.ts +11 -9
  34. package/src/types/options.ts +46 -6
  35. package/src/{ClientWorkerClass.ts → utils/WorkerBridge.ts} +35 -45
  36. package/src/utils/contentTypes.ts +77 -0
  37. package/src/utils/conversions.ts +17 -590
  38. package/src/utils/createClient.ts +16 -11
  39. package/src/utils/errors.ts +13 -19
  40. package/src/utils/inboxId.ts +46 -0
  41. package/src/utils/inboxState.ts +23 -0
  42. package/src/utils/installations.ts +95 -0
  43. package/src/utils/metadata.ts +15 -0
  44. package/src/utils/signer.ts +4 -4
  45. package/src/utils/uuid.ts +8 -0
  46. package/src/workers/client.ts +176 -135
  47. package/src/workers/opfs.ts +127 -0
  48. package/dist/workers/utils.js +0 -2
  49. package/dist/workers/utils.js.map +0 -1
  50. package/src/Utils.ts +0 -143
  51. package/src/UtilsWorkerClass.ts +0 -121
  52. package/src/types/actions/utils.ts +0 -69
  53. package/src/workers/utils.ts +0 -155
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  ConversationType,
3
3
  type ConsentState,
4
+ type CreateDmOptions,
5
+ type CreateGroupOptions,
4
6
  type Identifier,
7
+ type ListConversationsOptions,
8
+ type DecodedMessage as XmtpDecodedMessage,
5
9
  } from "@xmtp/wasm-bindings";
6
- import { v4 } from "uuid";
7
- import type { Client } from "@/Client";
10
+ import type { CodecRegistry } from "@/CodecRegistry";
8
11
  import { DecodedMessage } from "@/DecodedMessage";
9
12
  import { Dm } from "@/Dm";
10
13
  import { Group } from "@/Group";
11
- import type {
12
- SafeConversation,
13
- SafeCreateDmOptions,
14
- SafeCreateGroupOptions,
15
- SafeListConversationsOptions,
16
- SafeMessage,
17
- } from "@/utils/conversions";
14
+ import type { ClientWorkerAction } from "@/types/actions";
15
+ import type { SafeConversation } from "@/utils/conversions";
18
16
  import {
19
17
  createStream,
20
18
  type StreamCallback,
21
19
  type StreamOptions,
22
20
  } from "@/utils/streams";
21
+ import { uuid } from "@/utils/uuid";
22
+ import type { WorkerBridge } from "@/utils/WorkerBridge";
23
23
 
24
24
  /**
25
25
  * Manages conversations
@@ -27,15 +27,21 @@ import {
27
27
  * This class is not intended to be initialized directly.
28
28
  */
29
29
  export class Conversations<ContentTypes = unknown> {
30
- #client: Client<ContentTypes>;
30
+ #codecRegistry: CodecRegistry;
31
+ #worker: WorkerBridge<ClientWorkerAction>;
31
32
 
32
33
  /**
33
34
  * Creates a new conversations instance
34
35
  *
35
- * @param client - The client instance managing the conversations
36
+ * @param worker - The worker bridge instance for client communication
37
+ * @param codecRegistry - The codec registry instance
36
38
  */
37
- constructor(client: Client<ContentTypes>) {
38
- this.#client = client;
39
+ constructor(
40
+ worker: WorkerBridge<ClientWorkerAction>,
41
+ codecRegistry: CodecRegistry,
42
+ ) {
43
+ this.#worker = worker;
44
+ this.#codecRegistry = codecRegistry;
39
45
  }
40
46
 
41
47
  /**
@@ -44,7 +50,7 @@ export class Conversations<ContentTypes = unknown> {
44
50
  * @returns Promise that resolves when sync is complete
45
51
  */
46
52
  async sync() {
47
- return this.#client.sendMessage("conversations.sync", undefined);
53
+ return this.#worker.action("conversations.sync");
48
54
  }
49
55
 
50
56
  /**
@@ -56,7 +62,7 @@ export class Conversations<ContentTypes = unknown> {
56
62
  * @returns Promise that resolves when sync is complete
57
63
  */
58
64
  async syncAll(consentStates?: ConsentState[]) {
59
- return this.#client.sendMessage("conversations.syncAll", {
65
+ return this.#worker.action("conversations.syncAll", {
60
66
  consentStates,
61
67
  });
62
68
  }
@@ -68,16 +74,31 @@ export class Conversations<ContentTypes = unknown> {
68
74
  * @returns Promise that resolves with the conversation, if found
69
75
  */
70
76
  async getConversationById(id: string) {
71
- const data = await this.#client.sendMessage(
77
+ const data = await this.#worker.action(
72
78
  "conversations.getConversationById",
73
79
  {
74
80
  id,
75
81
  },
76
82
  );
77
83
  if (data) {
78
- return data.metadata.conversationType === "group"
79
- ? new Group(this.#client, data.id, data)
80
- : new Dm(this.#client, data.id, data);
84
+ switch (data.metadata.conversationType) {
85
+ case ConversationType.Group:
86
+ return new Group<ContentTypes>(
87
+ this.#worker,
88
+ this.#codecRegistry,
89
+ data.id,
90
+ data,
91
+ );
92
+ case ConversationType.Dm:
93
+ return new Dm<ContentTypes>(
94
+ this.#worker,
95
+ this.#codecRegistry,
96
+ data.id,
97
+ data,
98
+ );
99
+ default:
100
+ return undefined;
101
+ }
81
102
  }
82
103
  return undefined;
83
104
  }
@@ -89,13 +110,12 @@ export class Conversations<ContentTypes = unknown> {
89
110
  * @returns Promise that resolves with the decoded message, if found
90
111
  */
91
112
  async getMessageById(id: string) {
92
- const data = await this.#client.sendMessage(
93
- "conversations.getMessageById",
94
- {
95
- id,
96
- },
97
- );
98
- return data ? new DecodedMessage(this.#client, data) : undefined;
113
+ const data = await this.#worker.action("conversations.getMessageById", {
114
+ id,
115
+ });
116
+ return data
117
+ ? new DecodedMessage<ContentTypes>(this.#codecRegistry, data)
118
+ : undefined;
99
119
  }
100
120
 
101
121
  /**
@@ -105,23 +125,24 @@ export class Conversations<ContentTypes = unknown> {
105
125
  * @returns Promise that resolves with the DM, if found
106
126
  */
107
127
  async getDmByInboxId(inboxId: string) {
108
- const data = await this.#client.sendMessage(
109
- "conversations.getDmByInboxId",
110
- {
111
- inboxId,
112
- },
113
- );
114
- return data ? new Dm(this.#client, data.id, data) : undefined;
128
+ const data = await this.#worker.action("conversations.getDmByInboxId", {
129
+ inboxId,
130
+ });
131
+ return data
132
+ ? new Dm(this.#worker, this.#codecRegistry, data.id, data)
133
+ : undefined;
115
134
  }
116
135
 
117
136
  /**
118
- * Retrieves a DM by identifier
137
+ * Fetches a DM by identifier
119
138
  *
120
139
  * @param identifier - The identifier to look up
121
140
  * @returns Promise that resolves with the DM, if found
122
141
  */
123
- async getDmByIdentifier(identifier: Identifier) {
124
- const inboxId = await this.#client.findInboxIdByIdentifier(identifier);
142
+ async fetchDmByIdentifier(identifier: Identifier) {
143
+ const inboxId = await this.#worker.action("client.getInboxIdByIdentifier", {
144
+ identifier,
145
+ });
125
146
  if (!inboxId) {
126
147
  return undefined;
127
148
  }
@@ -134,18 +155,28 @@ export class Conversations<ContentTypes = unknown> {
134
155
  * @param options - Optional filtering and pagination options
135
156
  * @returns Promise that resolves with an array of conversations
136
157
  */
137
- async list(options?: SafeListConversationsOptions) {
138
- const conversations = await this.#client.sendMessage("conversations.list", {
158
+ async list(options?: ListConversationsOptions) {
159
+ const conversations = await this.#worker.action("conversations.list", {
139
160
  options,
140
161
  });
141
162
 
142
163
  return conversations
143
164
  .map((conversation) => {
144
165
  switch (conversation.metadata.conversationType) {
145
- case "dm":
146
- return new Dm(this.#client, conversation.id, conversation);
147
- case "group":
148
- return new Group(this.#client, conversation.id, conversation);
166
+ case ConversationType.Dm:
167
+ return new Dm<ContentTypes>(
168
+ this.#worker,
169
+ this.#codecRegistry,
170
+ conversation.id,
171
+ conversation,
172
+ );
173
+ case ConversationType.Group:
174
+ return new Group<ContentTypes>(
175
+ this.#worker,
176
+ this.#codecRegistry,
177
+ conversation.id,
178
+ conversation,
179
+ );
149
180
  default:
150
181
  return undefined;
151
182
  }
@@ -160,9 +191,9 @@ export class Conversations<ContentTypes = unknown> {
160
191
  * @returns Promise that resolves with an array of groups
161
192
  */
162
193
  async listGroups(
163
- options?: Omit<SafeListConversationsOptions, "conversation_type">,
194
+ options?: Omit<ListConversationsOptions, "conversationType">,
164
195
  ) {
165
- const conversations = await this.#client.sendMessage(
196
+ const conversations = await this.#worker.action(
166
197
  "conversations.listGroups",
167
198
  {
168
199
  options,
@@ -170,7 +201,13 @@ export class Conversations<ContentTypes = unknown> {
170
201
  );
171
202
 
172
203
  return conversations.map(
173
- (conversation) => new Group(this.#client, conversation.id, conversation),
204
+ (conversation) =>
205
+ new Group<ContentTypes>(
206
+ this.#worker,
207
+ this.#codecRegistry,
208
+ conversation.id,
209
+ conversation,
210
+ ),
174
211
  );
175
212
  }
176
213
 
@@ -180,36 +217,42 @@ export class Conversations<ContentTypes = unknown> {
180
217
  * @param options - Optional filtering and pagination options
181
218
  * @returns Promise that resolves with an array of DMs
182
219
  */
183
- async listDms(
184
- options?: Omit<SafeListConversationsOptions, "conversation_type">,
185
- ) {
186
- const conversations = await this.#client.sendMessage(
187
- "conversations.listDms",
188
- {
189
- options,
190
- },
191
- );
220
+ async listDms(options?: Omit<ListConversationsOptions, "conversationType">) {
221
+ const conversations = await this.#worker.action("conversations.listDms", {
222
+ options,
223
+ });
192
224
 
193
225
  return conversations.map(
194
- (conversation) => new Dm(this.#client, conversation.id, conversation),
226
+ (conversation) =>
227
+ new Dm<ContentTypes>(
228
+ this.#worker,
229
+ this.#codecRegistry,
230
+ conversation.id,
231
+ conversation,
232
+ ),
195
233
  );
196
234
  }
197
235
 
198
236
  /**
199
- * Creates a new group without syncing to the network
237
+ * Creates a new group conversation without publishing to the network
200
238
  *
201
239
  * @param options - Optional group creation options
202
240
  * @returns Promise that resolves with the new group
203
241
  */
204
- async newGroupOptimistic(options?: SafeCreateGroupOptions) {
205
- const conversation = await this.#client.sendMessage(
206
- "conversations.newGroupOptimistic",
242
+ async createGroupOptimistic(options?: CreateGroupOptions) {
243
+ const conversation = await this.#worker.action(
244
+ "conversations.createGroupOptimistic",
207
245
  {
208
246
  options,
209
247
  },
210
248
  );
211
249
 
212
- return new Group(this.#client, conversation.id, conversation);
250
+ return new Group<ContentTypes>(
251
+ this.#worker,
252
+ this.#codecRegistry,
253
+ conversation.id,
254
+ conversation,
255
+ );
213
256
  }
214
257
 
215
258
  /**
@@ -219,19 +262,24 @@ export class Conversations<ContentTypes = unknown> {
219
262
  * @param options - Optional group creation options
220
263
  * @returns Promise that resolves with the new group
221
264
  */
222
- async newGroupWithIdentifiers(
265
+ async createGroupWithIdentifiers(
223
266
  identifiers: Identifier[],
224
- options?: SafeCreateGroupOptions,
267
+ options?: CreateGroupOptions,
225
268
  ) {
226
- const conversation = await this.#client.sendMessage(
227
- "conversations.newGroupWithIdentifiers",
269
+ const conversation = await this.#worker.action(
270
+ "conversations.createGroupWithIdentifiers",
228
271
  {
229
272
  identifiers,
230
273
  options,
231
274
  },
232
275
  );
233
276
 
234
- return new Group(this.#client, conversation.id, conversation);
277
+ return new Group<ContentTypes>(
278
+ this.#worker,
279
+ this.#codecRegistry,
280
+ conversation.id,
281
+ conversation,
282
+ );
235
283
  }
236
284
 
237
285
  /**
@@ -241,16 +289,21 @@ export class Conversations<ContentTypes = unknown> {
241
289
  * @param options - Optional group creation options
242
290
  * @returns Promise that resolves with the new group
243
291
  */
244
- async newGroup(inboxIds: string[], options?: SafeCreateGroupOptions) {
245
- const conversation = await this.#client.sendMessage(
246
- "conversations.newGroup",
292
+ async createGroup(inboxIds: string[], options?: CreateGroupOptions) {
293
+ const conversation = await this.#worker.action(
294
+ "conversations.createGroup",
247
295
  {
248
296
  inboxIds,
249
297
  options,
250
298
  },
251
299
  );
252
300
 
253
- return new Group(this.#client, conversation.id, conversation);
301
+ return new Group<ContentTypes>(
302
+ this.#worker,
303
+ this.#codecRegistry,
304
+ conversation.id,
305
+ conversation,
306
+ );
254
307
  }
255
308
 
256
309
  /**
@@ -260,19 +313,24 @@ export class Conversations<ContentTypes = unknown> {
260
313
  * @param options - Optional DM creation options
261
314
  * @returns Promise that resolves with the new DM
262
315
  */
263
- async newDmWithIdentifier(
316
+ async createDmWithIdentifier(
264
317
  identifier: Identifier,
265
- options?: SafeCreateDmOptions,
318
+ options?: CreateDmOptions,
266
319
  ) {
267
- const conversation = await this.#client.sendMessage(
268
- "conversations.newDmWithIdentifier",
320
+ const conversation = await this.#worker.action(
321
+ "conversations.createDmWithIdentifier",
269
322
  {
270
323
  identifier,
271
324
  options,
272
325
  },
273
326
  );
274
327
 
275
- return new Dm(this.#client, conversation.id, conversation);
328
+ return new Dm<ContentTypes>(
329
+ this.#worker,
330
+ this.#codecRegistry,
331
+ conversation.id,
332
+ conversation,
333
+ );
276
334
  }
277
335
 
278
336
  /**
@@ -282,22 +340,27 @@ export class Conversations<ContentTypes = unknown> {
282
340
  * @param options - Optional DM creation options
283
341
  * @returns Promise that resolves with the new DM
284
342
  */
285
- async newDm(inboxId: string, options?: SafeCreateDmOptions) {
286
- const conversation = await this.#client.sendMessage("conversations.newDm", {
343
+ async createDm(inboxId: string, options?: CreateDmOptions) {
344
+ const conversation = await this.#worker.action("conversations.createDm", {
287
345
  inboxId,
288
346
  options,
289
347
  });
290
348
 
291
- return new Dm(this.#client, conversation.id, conversation);
349
+ return new Dm<ContentTypes>(
350
+ this.#worker,
351
+ this.#codecRegistry,
352
+ conversation.id,
353
+ conversation,
354
+ );
292
355
  }
293
356
 
294
357
  /**
295
- * Retrieves HMAC keys for all conversations
358
+ * Gets the HMAC keys for all conversations
296
359
  *
297
360
  * @returns Promise that resolves with the HMAC keys for all conversations
298
361
  */
299
- async getHmacKeys() {
300
- return this.#client.sendMessage("conversations.getHmacKeys", undefined);
362
+ async hmacKeys() {
363
+ return this.#worker.action("conversations.hmacKeys");
301
364
  }
302
365
 
303
366
  /**
@@ -320,18 +383,18 @@ export class Conversations<ContentTypes = unknown> {
320
383
  callback: StreamCallback<SafeConversation>,
321
384
  onFail: () => void,
322
385
  ) => {
323
- const streamId = v4();
386
+ const streamId = uuid();
324
387
  if (!options?.disableSync) {
325
388
  // sync the conversation
326
389
  await this.sync();
327
390
  }
328
391
  // start the stream
329
- await this.#client.sendMessage("conversations.stream", {
392
+ await this.#worker.action("conversations.stream", {
330
393
  streamId,
331
394
  conversationType: options?.conversationType,
332
395
  });
333
396
  // handle stream messages
334
- return this.#client.handleStreamMessage<SafeConversation, T>(
397
+ return this.#worker.handleStreamMessage<SafeConversation, T>(
335
398
  streamId,
336
399
  callback,
337
400
  {
@@ -341,9 +404,26 @@ export class Conversations<ContentTypes = unknown> {
341
404
  );
342
405
  };
343
406
  const convertConversation = (value: SafeConversation) => {
344
- return value.metadata.conversationType === "group"
345
- ? (new Group(this.#client, value.id, value) as T)
346
- : (new Dm(this.#client, value.id, value) as T);
407
+ switch (value.metadata.conversationType) {
408
+ case ConversationType.Group:
409
+ return new Group<ContentTypes>(
410
+ this.#worker,
411
+ this.#codecRegistry,
412
+ value.id,
413
+ value,
414
+ ) as T;
415
+ case ConversationType.Dm:
416
+ return new Dm<ContentTypes>(
417
+ this.#worker,
418
+ this.#codecRegistry,
419
+ value.id,
420
+ value,
421
+ ) as T;
422
+ default:
423
+ throw new Error(
424
+ `Unknown conversation type: ${value.metadata.conversationType}`,
425
+ );
426
+ }
347
427
  };
348
428
 
349
429
  return createStream(stream, convertConversation, options);
@@ -386,37 +466,40 @@ export class Conversations<ContentTypes = unknown> {
386
466
  * @returns Stream instance for new messages
387
467
  */
388
468
  async streamAllMessages(
389
- options?: StreamOptions<SafeMessage, DecodedMessage<ContentTypes>> & {
469
+ options?: StreamOptions<
470
+ XmtpDecodedMessage,
471
+ DecodedMessage<ContentTypes>
472
+ > & {
390
473
  conversationType?: ConversationType;
391
474
  consentStates?: ConsentState[];
392
475
  },
393
476
  ) {
394
477
  const stream = async (
395
- callback: StreamCallback<SafeMessage>,
478
+ callback: StreamCallback<XmtpDecodedMessage>,
396
479
  onFail: () => void,
397
480
  ) => {
398
- const streamId = v4();
481
+ const streamId = uuid();
399
482
  if (!options?.disableSync) {
400
483
  // sync the conversation
401
484
  await this.sync();
402
485
  }
403
486
  // start the stream
404
- await this.#client.sendMessage("conversations.streamAllMessages", {
487
+ await this.#worker.action("conversations.streamAllMessages", {
405
488
  streamId,
406
489
  conversationType: options?.conversationType,
407
490
  consentStates: options?.consentStates,
408
491
  });
409
492
  // handle stream messages
410
- return this.#client.handleStreamMessage<
411
- SafeMessage,
493
+ return this.#worker.handleStreamMessage<
494
+ XmtpDecodedMessage,
412
495
  DecodedMessage<ContentTypes>
413
496
  >(streamId, callback, {
414
497
  ...options,
415
498
  onFail,
416
499
  });
417
500
  };
418
- const convertMessage = (value: SafeMessage) => {
419
- return new DecodedMessage(this.#client, value);
501
+ const convertMessage = (value: XmtpDecodedMessage) => {
502
+ return new DecodedMessage<ContentTypes>(this.#codecRegistry, value);
420
503
  };
421
504
 
422
505
  return createStream(stream, convertMessage, options);
@@ -430,7 +513,10 @@ export class Conversations<ContentTypes = unknown> {
430
513
  * @returns Stream instance for new group messages
431
514
  */
432
515
  async streamAllGroupMessages(
433
- options?: StreamOptions<SafeMessage, DecodedMessage<ContentTypes>> & {
516
+ options?: StreamOptions<
517
+ XmtpDecodedMessage,
518
+ DecodedMessage<ContentTypes>
519
+ > & {
434
520
  consentStates?: ConsentState[];
435
521
  },
436
522
  ) {
@@ -448,7 +534,10 @@ export class Conversations<ContentTypes = unknown> {
448
534
  * @returns Stream instance for new DM messages
449
535
  */
450
536
  async streamAllDmMessages(
451
- options?: StreamOptions<SafeMessage, DecodedMessage<ContentTypes>> & {
537
+ options?: StreamOptions<
538
+ XmtpDecodedMessage,
539
+ DecodedMessage<ContentTypes>
540
+ > & {
452
541
  consentStates?: ConsentState[];
453
542
  },
454
543
  ) {
@@ -477,13 +566,13 @@ export class Conversations<ContentTypes = unknown> {
477
566
  >,
478
567
  ) {
479
568
  const stream = async (callback: StreamCallback<string>) => {
480
- const streamId = v4();
569
+ const streamId = uuid();
481
570
  // start the stream
482
- await this.#client.sendMessage("conversations.streamMessageDeletions", {
571
+ await this.#worker.action("conversations.streamMessageDeletions", {
483
572
  streamId,
484
573
  });
485
574
  // handle stream messages
486
- return this.#client.handleStreamMessage<string>(
575
+ return this.#worker.handleStreamMessage<string>(
487
576
  streamId,
488
577
  callback,
489
578
  options,
@@ -1,48 +1,31 @@
1
- import type { Client } from "./Client";
1
+ import type { ClientWorkerAction } from "@/types/actions";
2
+ import type { WorkerBridge } from "@/utils/WorkerBridge";
2
3
 
3
4
  /**
4
5
  * Debug information helpers for the client
5
6
  *
6
7
  * This class is not intended to be initialized directly.
7
8
  */
8
- export class DebugInformation<ContentTypes = unknown> {
9
- #client: Client<ContentTypes>;
9
+ export class DebugInformation {
10
+ #worker: WorkerBridge<ClientWorkerAction>;
10
11
 
11
- constructor(client: Client<ContentTypes>) {
12
- this.#client = client;
12
+ constructor(worker: WorkerBridge<ClientWorkerAction>) {
13
+ this.#worker = worker;
13
14
  }
14
15
 
15
16
  apiStatistics() {
16
- return this.#client.sendMessage(
17
- "debugInformation.apiStatistics",
18
- undefined,
19
- );
17
+ return this.#worker.action("debugInformation.apiStatistics");
20
18
  }
21
19
 
22
20
  apiIdentityStatistics() {
23
- return this.#client.sendMessage(
24
- "debugInformation.apiIdentityStatistics",
25
- undefined,
26
- );
21
+ return this.#worker.action("debugInformation.apiIdentityStatistics");
27
22
  }
28
23
 
29
24
  apiAggregateStatistics() {
30
- return this.#client.sendMessage(
31
- "debugInformation.apiAggregateStatistics",
32
- undefined,
33
- );
25
+ return this.#worker.action("debugInformation.apiAggregateStatistics");
34
26
  }
35
27
 
36
28
  clearAllStatistics() {
37
- return this.#client.sendMessage(
38
- "debugInformation.clearAllStatistics",
39
- undefined,
40
- );
41
- }
42
-
43
- uploadDebugArchive(serverUrl?: string) {
44
- return this.#client.sendMessage("debugInformation.uploadDebugArchive", {
45
- serverUrl,
46
- });
29
+ return this.#worker.action("debugInformation.clearAllStatistics");
47
30
  }
48
31
  }