@xmtp/wasm-bindings 1.7.0-rc2 → 1.8.0-dev.8ab4077

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.
@@ -300,31 +300,36 @@ export function applySignatureRequest(host, gatewayHost, signatureRequest) {
300
300
  }
301
301
 
302
302
  /**
303
- * @param {Attachment} attachment
304
- * @returns {EncodedContent}
303
+ * @param {MetadataField} field
304
+ * @returns {string}
305
305
  */
306
- export function encodeAttachment(attachment) {
307
- const ret = wasm.encodeAttachment(attachment);
308
- if (ret[2]) {
309
- throw takeFromExternrefTable0(ret[1]);
306
+ export function metadataFieldName(field) {
307
+ let deferred1_0;
308
+ let deferred1_1;
309
+ try {
310
+ const ret = wasm.metadataFieldName(field);
311
+ deferred1_0 = ret[0];
312
+ deferred1_1 = ret[1];
313
+ return getStringFromWasm0(ret[0], ret[1]);
314
+ } finally {
315
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
310
316
  }
311
- return takeFromExternrefTable0(ret[0]);
312
317
  }
313
318
 
314
319
  /**
315
320
  * @returns {ContentTypeId}
316
321
  */
317
- export function attachmentContentType() {
318
- const ret = wasm.attachmentContentType();
322
+ export function contentTypeAttachment() {
323
+ const ret = wasm.contentTypeAttachment();
319
324
  return ret;
320
325
  }
321
326
 
322
327
  /**
323
- * @param {ReadReceipt} read_receipt
328
+ * @param {Attachment} attachment
324
329
  * @returns {EncodedContent}
325
330
  */
326
- export function encodeReadReceipt(read_receipt) {
327
- const ret = wasm.encodeReadReceipt(read_receipt);
331
+ export function encodeAttachment(attachment) {
332
+ const ret = wasm.encodeAttachment(attachment);
328
333
  if (ret[2]) {
329
334
  throw takeFromExternrefTable0(ret[1]);
330
335
  }
@@ -334,33 +339,33 @@ export function encodeReadReceipt(read_receipt) {
334
339
  /**
335
340
  * @returns {ContentTypeId}
336
341
  */
337
- export function readReceiptContentType() {
338
- const ret = wasm.readReceiptContentType();
342
+ export function contentTypeGroupUpdated() {
343
+ const ret = wasm.contentTypeGroupUpdated();
339
344
  return ret;
340
345
  }
341
346
 
342
347
  /**
343
348
  * @returns {ContentTypeId}
344
349
  */
345
- export function groupUpdatedContentType() {
346
- const ret = wasm.groupUpdatedContentType();
350
+ export function contentTypeLeaveRequest() {
351
+ const ret = wasm.contentTypeLeaveRequest();
347
352
  return ret;
348
353
  }
349
354
 
350
355
  /**
351
356
  * @returns {ContentTypeId}
352
357
  */
353
- export function leaveRequestContentType() {
354
- const ret = wasm.leaveRequestContentType();
358
+ export function contentTypeMultiRemoteAttachment() {
359
+ const ret = wasm.contentTypeMultiRemoteAttachment();
355
360
  return ret;
356
361
  }
357
362
 
358
363
  /**
359
- * @param {RemoteAttachment} remote_attachment
364
+ * @param {MultiRemoteAttachment} multi_remote_attachment
360
365
  * @returns {EncodedContent}
361
366
  */
362
- export function encodeRemoteAttachment(remote_attachment) {
363
- const ret = wasm.encodeRemoteAttachment(remote_attachment);
367
+ export function encodeMultiRemoteAttachment(multi_remote_attachment) {
368
+ const ret = wasm.encodeMultiRemoteAttachment(multi_remote_attachment);
364
369
  if (ret[2]) {
365
370
  throw takeFromExternrefTable0(ret[1]);
366
371
  }
@@ -368,34 +373,21 @@ export function encodeRemoteAttachment(remote_attachment) {
368
373
  }
369
374
 
370
375
  /**
371
- * Encrypts an attachment for storage as a remote attachment.
372
- * @param {Attachment} attachment
373
- * @returns {EncryptedAttachment}
376
+ * @returns {ContentTypeId}
374
377
  */
375
- export function encryptAttachment(attachment) {
376
- const ret = wasm.encryptAttachment(attachment);
377
- if (ret[2]) {
378
- throw takeFromExternrefTable0(ret[1]);
379
- }
380
- return takeFromExternrefTable0(ret[0]);
378
+ export function contentTypeText() {
379
+ const ret = wasm.contentTypeText();
380
+ return ret;
381
381
  }
382
382
 
383
- function passArray8ToWasm0(arg, malloc) {
384
- const ptr = malloc(arg.length * 1, 1) >>> 0;
385
- getUint8ArrayMemory0().set(arg, ptr / 1);
386
- WASM_VECTOR_LEN = arg.length;
387
- return ptr;
388
- }
389
383
  /**
390
- * Decrypts an encrypted payload from a remote attachment.
391
- * @param {Uint8Array} encryptedBytes
392
- * @param {RemoteAttachment} remoteAttachment
393
- * @returns {Attachment}
384
+ * @param {string} text
385
+ * @returns {EncodedContent}
394
386
  */
395
- export function decryptAttachment(encryptedBytes, remoteAttachment) {
396
- const ptr0 = passArray8ToWasm0(encryptedBytes, wasm.__wbindgen_malloc);
387
+ export function encodeText(text) {
388
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
397
389
  const len0 = WASM_VECTOR_LEN;
398
- const ret = wasm.decryptAttachment(ptr0, len0, remoteAttachment);
390
+ const ret = wasm.encodeText(ptr0, len0);
399
391
  if (ret[2]) {
400
392
  throw takeFromExternrefTable0(ret[1]);
401
393
  }
@@ -403,19 +395,11 @@ export function decryptAttachment(encryptedBytes, remoteAttachment) {
403
395
  }
404
396
 
405
397
  /**
406
- * @returns {ContentTypeId}
407
- */
408
- export function remoteAttachmentContentType() {
409
- const ret = wasm.remoteAttachmentContentType();
410
- return ret;
411
- }
412
-
413
- /**
414
- * @param {WalletSendCalls} wallet_send_calls
398
+ * @param {Intent} intent
415
399
  * @returns {EncodedContent}
416
400
  */
417
- export function encodeWalletSendCalls(wallet_send_calls) {
418
- const ret = wasm.encodeWalletSendCalls(wallet_send_calls);
401
+ export function encodeIntent(intent) {
402
+ const ret = wasm.encodeIntent(intent);
419
403
  if (ret[2]) {
420
404
  throw takeFromExternrefTable0(ret[1]);
421
405
  }
@@ -425,25 +409,19 @@ export function encodeWalletSendCalls(wallet_send_calls) {
425
409
  /**
426
410
  * @returns {ContentTypeId}
427
411
  */
428
- export function walletSendCallsContentType() {
429
- const ret = wasm.walletSendCallsContentType();
430
- return ret;
431
- }
432
-
433
- /**
434
- * @returns {ContentTypeId}
435
- */
436
- export function transactionReferenceContentType() {
437
- const ret = wasm.transactionReferenceContentType();
412
+ export function contentTypeIntent() {
413
+ const ret = wasm.contentTypeIntent();
438
414
  return ret;
439
415
  }
440
416
 
441
417
  /**
442
- * @param {TransactionReference} transaction_reference
418
+ * @param {string} text
443
419
  * @returns {EncodedContent}
444
420
  */
445
- export function encodeTransactionReference(transaction_reference) {
446
- const ret = wasm.encodeTransactionReference(transaction_reference);
421
+ export function encodeMarkdown(text) {
422
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
423
+ const len0 = WASM_VECTOR_LEN;
424
+ const ret = wasm.encodeMarkdown(ptr0, len0);
447
425
  if (ret[2]) {
448
426
  throw takeFromExternrefTable0(ret[1]);
449
427
  }
@@ -451,11 +429,19 @@ export function encodeTransactionReference(transaction_reference) {
451
429
  }
452
430
 
453
431
  /**
454
- * @param {MultiRemoteAttachment} multi_remote_attachment
432
+ * @returns {ContentTypeId}
433
+ */
434
+ export function contentTypeMarkdown() {
435
+ const ret = wasm.contentTypeMarkdown();
436
+ return ret;
437
+ }
438
+
439
+ /**
440
+ * @param {Reaction} reaction
455
441
  * @returns {EncodedContent}
456
442
  */
457
- export function encodeMultiRemoteAttachment(multi_remote_attachment) {
458
- const ret = wasm.encodeMultiRemoteAttachment(multi_remote_attachment);
443
+ export function encodeReaction(reaction) {
444
+ const ret = wasm.encodeReaction(reaction);
459
445
  if (ret[2]) {
460
446
  throw takeFromExternrefTable0(ret[1]);
461
447
  }
@@ -465,120 +451,152 @@ export function encodeMultiRemoteAttachment(multi_remote_attachment) {
465
451
  /**
466
452
  * @returns {ContentTypeId}
467
453
  */
468
- export function multiRemoteAttachmentContentType() {
469
- const ret = wasm.multiRemoteAttachmentContentType();
454
+ export function contentTypeReaction() {
455
+ const ret = wasm.contentTypeReaction();
470
456
  return ret;
471
457
  }
472
458
 
473
459
  /**
474
- * @param {string} text
475
- * @returns {EncodedContent}
460
+ * Import a database from a byte array into OPFS.
461
+ * This will overwrite any existing database with the same name.
462
+ * The byte array must contain a valid SQLite database.
463
+ * Note: Any existing database with the same name must be closed before importing.
464
+ * @param {string} filename
465
+ * @param {Uint8Array} data
466
+ * @returns {Promise<void>}
476
467
  */
477
- export function encodeText(text) {
478
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
468
+ export function opfsImportDb(filename, data) {
469
+ const ptr0 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
479
470
  const len0 = WASM_VECTOR_LEN;
480
- const ret = wasm.encodeText(ptr0, len0);
481
- if (ret[2]) {
482
- throw takeFromExternrefTable0(ret[1]);
483
- }
484
- return takeFromExternrefTable0(ret[0]);
471
+ const ret = wasm.opfsImportDb(ptr0, len0, data);
472
+ return ret;
485
473
  }
486
474
 
487
475
  /**
488
- * @returns {ContentTypeId}
476
+ * List all database files stored in OPFS.
477
+ * Returns an array of file names.
478
+ * @returns {Promise<string[]>}
489
479
  */
490
- export function textContentType() {
491
- const ret = wasm.textContentType();
480
+ export function opfsListFiles() {
481
+ const ret = wasm.opfsListFiles();
492
482
  return ret;
493
483
  }
494
484
 
495
485
  /**
496
- * @returns {ContentTypeId}
486
+ * Check if a database file exists in OPFS.
487
+ * @param {string} filename
488
+ * @returns {Promise<boolean>}
497
489
  */
498
- export function replyContentType() {
499
- const ret = wasm.replyContentType();
490
+ export function opfsFileExists(filename) {
491
+ const ptr0 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
492
+ const len0 = WASM_VECTOR_LEN;
493
+ const ret = wasm.opfsFileExists(ptr0, len0);
500
494
  return ret;
501
495
  }
502
496
 
503
497
  /**
504
- * @param {Intent} intent
505
- * @returns {EncodedContent}
498
+ * Export a database file from OPFS as a byte array.
499
+ * This can be used to backup or transfer a database.
500
+ * Note: The database should be closed before exporting for consistency.
501
+ * @param {string} filename
502
+ * @returns {Promise<Uint8Array>}
506
503
  */
507
- export function encodeIntent(intent) {
508
- const ret = wasm.encodeIntent(intent);
509
- if (ret[2]) {
510
- throw takeFromExternrefTable0(ret[1]);
511
- }
512
- return takeFromExternrefTable0(ret[0]);
504
+ export function opfsExportDb(filename) {
505
+ const ptr0 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
506
+ const len0 = WASM_VECTOR_LEN;
507
+ const ret = wasm.opfsExportDb(ptr0, len0);
508
+ return ret;
513
509
  }
514
510
 
515
511
  /**
516
- * @returns {ContentTypeId}
512
+ * Delete all database files from OPFS.
513
+ * Note: All databases must be closed before calling this function.
514
+ * @returns {Promise<void>}
517
515
  */
518
- export function intentContentType() {
519
- const ret = wasm.intentContentType();
516
+ export function opfsClearAll() {
517
+ const ret = wasm.opfsClearAll();
520
518
  return ret;
521
519
  }
522
520
 
523
521
  /**
524
- * @param {Actions} actions
525
- * @returns {EncodedContent}
522
+ * Delete a specific database file from OPFS.
523
+ * Returns true if the file was deleted, false if it didn't exist.
524
+ * Note: The database must be closed before calling this function.
525
+ * @param {string} filename
526
+ * @returns {Promise<boolean>}
526
527
  */
527
- export function encodeActions(actions) {
528
- const ret = wasm.encodeActions(actions);
529
- if (ret[2]) {
530
- throw takeFromExternrefTable0(ret[1]);
531
- }
532
- return takeFromExternrefTable0(ret[0]);
528
+ export function opfsDeleteFile(filename) {
529
+ const ptr0 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
530
+ const len0 = WASM_VECTOR_LEN;
531
+ const ret = wasm.opfsDeleteFile(ptr0, len0);
532
+ return ret;
533
533
  }
534
534
 
535
535
  /**
536
- * @returns {ContentTypeId}
536
+ * Get the current capacity of the OPFS file pool.
537
+ * @returns {Promise<number>}
537
538
  */
538
- export function actionsContentType() {
539
- const ret = wasm.actionsContentType();
539
+ export function opfsPoolCapacity() {
540
+ const ret = wasm.opfsPoolCapacity();
540
541
  return ret;
541
542
  }
542
543
 
543
544
  /**
544
- * @returns {ContentTypeId}
545
+ * Initialize the OPFS SQLite VFS if not already initialized.
546
+ * This must be called before using other OPFS functions.
547
+ * @returns {Promise<void>}
545
548
  */
546
- export function markdownContentType() {
547
- const ret = wasm.markdownContentType();
549
+ export function opfsInit() {
550
+ const ret = wasm.opfsInit();
548
551
  return ret;
549
552
  }
550
553
 
551
554
  /**
552
- * @param {string} text
553
- * @returns {EncodedContent}
555
+ * Get the number of database files stored in OPFS.
556
+ * @returns {Promise<number>}
554
557
  */
555
- export function encodeMarkdown(text) {
556
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
557
- const len0 = WASM_VECTOR_LEN;
558
- const ret = wasm.encodeMarkdown(ptr0, len0);
559
- if (ret[2]) {
560
- throw takeFromExternrefTable0(ret[1]);
561
- }
562
- return takeFromExternrefTable0(ret[0]);
558
+ export function opfsFileCount() {
559
+ const ret = wasm.opfsFileCount();
560
+ return ret;
563
561
  }
564
562
 
565
563
  /**
566
- * @param {Reaction} reaction
567
- * @returns {EncodedContent}
564
+ * @param {Identifier} accountIdentifier
565
+ * @param {bigint | null} [nonce]
566
+ * @returns {string}
568
567
  */
569
- export function encodeReaction(reaction) {
570
- const ret = wasm.encodeReaction(reaction);
571
- if (ret[2]) {
572
- throw takeFromExternrefTable0(ret[1]);
568
+ export function generateInboxId(accountIdentifier, nonce) {
569
+ let deferred2_0;
570
+ let deferred2_1;
571
+ try {
572
+ const ret = wasm.generateInboxId(accountIdentifier, !isLikeNone(nonce), isLikeNone(nonce) ? BigInt(0) : nonce);
573
+ var ptr1 = ret[0];
574
+ var len1 = ret[1];
575
+ if (ret[3]) {
576
+ ptr1 = 0; len1 = 0;
577
+ throw takeFromExternrefTable0(ret[2]);
578
+ }
579
+ deferred2_0 = ptr1;
580
+ deferred2_1 = len1;
581
+ return getStringFromWasm0(ptr1, len1);
582
+ } finally {
583
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
573
584
  }
574
- return takeFromExternrefTable0(ret[0]);
575
585
  }
576
586
 
577
587
  /**
578
- * @returns {ContentTypeId}
588
+ * @param {string} host
589
+ * @param {string | null | undefined} gatewayHost
590
+ * @param {boolean} isSecure
591
+ * @param {Identifier} accountIdentifier
592
+ * @returns {Promise<string | undefined>}
579
593
  */
580
- export function reactionContentType() {
581
- const ret = wasm.reactionContentType();
594
+ export function getInboxIdForIdentifier(host, gatewayHost, isSecure, accountIdentifier) {
595
+ const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
596
+ const len0 = WASM_VECTOR_LEN;
597
+ var ptr1 = isLikeNone(gatewayHost) ? 0 : passStringToWasm0(gatewayHost, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
598
+ var len1 = WASM_VECTOR_LEN;
599
+ const ret = wasm.getInboxIdForIdentifier(ptr0, len0, ptr1, len1, isSecure, accountIdentifier);
582
600
  return ret;
583
601
  }
584
602
 
@@ -618,47 +636,151 @@ export function createClient(host, inboxId, accountIdentifier, dbPath, encryptio
618
636
  _assertClass(authHandle, AuthHandle);
619
637
  ptr6 = authHandle.__destroy_into_raw();
620
638
  }
621
- const ret = wasm.createClient(ptr0, len0, ptr1, len1, accountIdentifier, ptr2, len2, isLikeNone(encryptionKey) ? 0 : addToExternrefTable0(encryptionKey), ptr3, len3, isLikeNone(deviceSyncWorkerMode) ? 0 : addToExternrefTable0(deviceSyncWorkerMode), isLikeNone(logOptions) ? 0 : addToExternrefTable0(logOptions), isLikeNone(allowOffline) ? 0xFFFFFF : allowOffline ? 1 : 0, ptr4, len4, ptr5, len5, !isLikeNone(nonce), isLikeNone(nonce) ? BigInt(0) : nonce, isLikeNone(authCallback) ? 0 : addToExternrefTable0(authCallback), ptr6, isLikeNone(clientMode) ? 0 : addToExternrefTable0(clientMode));
639
+ const ret = wasm.createClient(ptr0, len0, ptr1, len1, accountIdentifier, ptr2, len2, isLikeNone(encryptionKey) ? 0 : addToExternrefTable0(encryptionKey), ptr3, len3, isLikeNone(deviceSyncWorkerMode) ? 2 : deviceSyncWorkerMode, isLikeNone(logOptions) ? 0 : addToExternrefTable0(logOptions), isLikeNone(allowOffline) ? 0xFFFFFF : allowOffline ? 1 : 0, ptr4, len4, ptr5, len5, !isLikeNone(nonce), isLikeNone(nonce) ? BigInt(0) : nonce, isLikeNone(authCallback) ? 0 : addToExternrefTable0(authCallback), ptr6, isLikeNone(clientMode) ? 2 : clientMode);
640
+ return ret;
641
+ }
642
+
643
+ /**
644
+ * @param {ReadReceipt} read_receipt
645
+ * @returns {EncodedContent}
646
+ */
647
+ export function encodeReadReceipt(read_receipt) {
648
+ const ret = wasm.encodeReadReceipt(read_receipt);
649
+ if (ret[2]) {
650
+ throw takeFromExternrefTable0(ret[1]);
651
+ }
652
+ return takeFromExternrefTable0(ret[0]);
653
+ }
654
+
655
+ /**
656
+ * @returns {ContentTypeId}
657
+ */
658
+ export function contentTypeReadReceipt() {
659
+ const ret = wasm.contentTypeReadReceipt();
660
+ return ret;
661
+ }
662
+
663
+ /**
664
+ * @returns {ContentTypeId}
665
+ */
666
+ export function contentTypeRemoteAttachment() {
667
+ const ret = wasm.contentTypeRemoteAttachment();
668
+ return ret;
669
+ }
670
+
671
+ function passArray8ToWasm0(arg, malloc) {
672
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
673
+ getUint8ArrayMemory0().set(arg, ptr / 1);
674
+ WASM_VECTOR_LEN = arg.length;
675
+ return ptr;
676
+ }
677
+ /**
678
+ * Decrypts an encrypted payload from a remote attachment.
679
+ * @param {Uint8Array} encryptedBytes
680
+ * @param {RemoteAttachment} remoteAttachment
681
+ * @returns {Attachment}
682
+ */
683
+ export function decryptAttachment(encryptedBytes, remoteAttachment) {
684
+ const ptr0 = passArray8ToWasm0(encryptedBytes, wasm.__wbindgen_malloc);
685
+ const len0 = WASM_VECTOR_LEN;
686
+ const ret = wasm.decryptAttachment(ptr0, len0, remoteAttachment);
687
+ if (ret[2]) {
688
+ throw takeFromExternrefTable0(ret[1]);
689
+ }
690
+ return takeFromExternrefTable0(ret[0]);
691
+ }
692
+
693
+ /**
694
+ * @param {RemoteAttachment} remote_attachment
695
+ * @returns {EncodedContent}
696
+ */
697
+ export function encodeRemoteAttachment(remote_attachment) {
698
+ const ret = wasm.encodeRemoteAttachment(remote_attachment);
699
+ if (ret[2]) {
700
+ throw takeFromExternrefTable0(ret[1]);
701
+ }
702
+ return takeFromExternrefTable0(ret[0]);
703
+ }
704
+
705
+ /**
706
+ * Encrypts an attachment for storage as a remote attachment.
707
+ * @param {Attachment} attachment
708
+ * @returns {EncryptedAttachment}
709
+ */
710
+ export function encryptAttachment(attachment) {
711
+ const ret = wasm.encryptAttachment(attachment);
712
+ if (ret[2]) {
713
+ throw takeFromExternrefTable0(ret[1]);
714
+ }
715
+ return takeFromExternrefTable0(ret[0]);
716
+ }
717
+
718
+ /**
719
+ * @param {WalletSendCalls} wallet_send_calls
720
+ * @returns {EncodedContent}
721
+ */
722
+ export function encodeWalletSendCalls(wallet_send_calls) {
723
+ const ret = wasm.encodeWalletSendCalls(wallet_send_calls);
724
+ if (ret[2]) {
725
+ throw takeFromExternrefTable0(ret[1]);
726
+ }
727
+ return takeFromExternrefTable0(ret[0]);
728
+ }
729
+
730
+ /**
731
+ * @returns {ContentTypeId}
732
+ */
733
+ export function contentTypeWalletSendCalls() {
734
+ const ret = wasm.contentTypeWalletSendCalls();
735
+ return ret;
736
+ }
737
+
738
+ /**
739
+ * @param {TransactionReference} transaction_reference
740
+ * @returns {EncodedContent}
741
+ */
742
+ export function encodeTransactionReference(transaction_reference) {
743
+ const ret = wasm.encodeTransactionReference(transaction_reference);
744
+ if (ret[2]) {
745
+ throw takeFromExternrefTable0(ret[1]);
746
+ }
747
+ return takeFromExternrefTable0(ret[0]);
748
+ }
749
+
750
+ /**
751
+ * @returns {ContentTypeId}
752
+ */
753
+ export function contentTypeTransactionReference() {
754
+ const ret = wasm.contentTypeTransactionReference();
622
755
  return ret;
623
756
  }
624
757
 
625
758
  /**
626
- * @param {string} host
627
- * @param {string | null | undefined} gatewayHost
628
- * @param {Identifier} accountIdentifier
629
- * @returns {Promise<string | undefined>}
759
+ * @returns {ContentTypeId}
630
760
  */
631
- export function getInboxIdForIdentifier(host, gatewayHost, accountIdentifier) {
632
- const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
633
- const len0 = WASM_VECTOR_LEN;
634
- var ptr1 = isLikeNone(gatewayHost) ? 0 : passStringToWasm0(gatewayHost, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
635
- var len1 = WASM_VECTOR_LEN;
636
- const ret = wasm.getInboxIdForIdentifier(ptr0, len0, ptr1, len1, accountIdentifier);
761
+ export function contentTypeReply() {
762
+ const ret = wasm.contentTypeReply();
637
763
  return ret;
638
764
  }
639
765
 
640
766
  /**
641
- * @param {Identifier} accountIdentifier
642
- * @param {bigint | null} [nonce]
643
- * @returns {string}
767
+ * @param {Actions} actions
768
+ * @returns {EncodedContent}
644
769
  */
645
- export function generateInboxId(accountIdentifier, nonce) {
646
- let deferred2_0;
647
- let deferred2_1;
648
- try {
649
- const ret = wasm.generateInboxId(accountIdentifier, !isLikeNone(nonce), isLikeNone(nonce) ? BigInt(0) : nonce);
650
- var ptr1 = ret[0];
651
- var len1 = ret[1];
652
- if (ret[3]) {
653
- ptr1 = 0; len1 = 0;
654
- throw takeFromExternrefTable0(ret[2]);
655
- }
656
- deferred2_0 = ptr1;
657
- deferred2_1 = len1;
658
- return getStringFromWasm0(ptr1, len1);
659
- } finally {
660
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
770
+ export function encodeActions(actions) {
771
+ const ret = wasm.encodeActions(actions);
772
+ if (ret[2]) {
773
+ throw takeFromExternrefTable0(ret[1]);
661
774
  }
775
+ return takeFromExternrefTable0(ret[0]);
776
+ }
777
+
778
+ /**
779
+ * @returns {ContentTypeId}
780
+ */
781
+ export function contentTypeActions() {
782
+ const ret = wasm.contentTypeActions();
783
+ return ret;
662
784
  }
663
785
 
664
786
  /**
@@ -693,14 +815,14 @@ function wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005(arg0, arg
693
815
  wasm.wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005(arg0, arg1);
694
816
  }
695
817
 
696
- function wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6(arg0, arg1, arg2) {
697
- wasm.wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6(arg0, arg1, arg2);
698
- }
699
-
700
818
  function wasm_bindgen__convert__closures_____invoke__hceddd2b8fc291040(arg0, arg1) {
701
819
  wasm.wasm_bindgen__convert__closures_____invoke__hceddd2b8fc291040(arg0, arg1);
702
820
  }
703
821
 
822
+ function wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6(arg0, arg1, arg2) {
823
+ wasm.wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6(arg0, arg1, arg2);
824
+ }
825
+
704
826
  function wasm_bindgen__convert__closures_____invoke__h6af3cd86eb56f4b1(arg0, arg1) {
705
827
  wasm.wasm_bindgen__convert__closures_____invoke__h6af3cd86eb56f4b1(arg0, arg1);
706
828
  }
@@ -709,6 +831,210 @@ function wasm_bindgen__convert__closures_____invoke__h47a8fb56fc48c5fb(arg0, arg
709
831
  wasm.wasm_bindgen__convert__closures_____invoke__h47a8fb56fc48c5fb(arg0, arg1, arg2, arg3);
710
832
  }
711
833
 
834
+ /**
835
+ * @enum {0 | 1 | 2}
836
+ */
837
+ export const ActionStyle = Object.freeze({
838
+ Primary: 0, "0": "Primary",
839
+ Secondary: 1, "1": "Secondary",
840
+ Danger: 2, "2": "Danger",
841
+ });
842
+ /**
843
+ * @enum {0 | 1}
844
+ */
845
+ export const ClientMode = Object.freeze({
846
+ Default: 0, "0": "Default",
847
+ Notification: 1, "1": "Notification",
848
+ });
849
+ /**
850
+ * @enum {0 | 1}
851
+ */
852
+ export const ConsentEntityType = Object.freeze({
853
+ GroupId: 0, "0": "GroupId",
854
+ InboxId: 1, "1": "InboxId",
855
+ });
856
+ /**
857
+ * @enum {0 | 1 | 2}
858
+ */
859
+ export const ConsentState = Object.freeze({
860
+ Unknown: 0, "0": "Unknown",
861
+ Allowed: 1, "1": "Allowed",
862
+ Denied: 2, "2": "Denied",
863
+ });
864
+ /**
865
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15}
866
+ */
867
+ export const ContentType = Object.freeze({
868
+ Actions: 0, "0": "Actions",
869
+ Attachment: 1, "1": "Attachment",
870
+ Custom: 2, "2": "Custom",
871
+ GroupMembershipChange: 3, "3": "GroupMembershipChange",
872
+ GroupUpdated: 4, "4": "GroupUpdated",
873
+ Intent: 5, "5": "Intent",
874
+ LeaveRequest: 6, "6": "LeaveRequest",
875
+ Markdown: 7, "7": "Markdown",
876
+ MultiRemoteAttachment: 8, "8": "MultiRemoteAttachment",
877
+ Reaction: 9, "9": "Reaction",
878
+ ReadReceipt: 10, "10": "ReadReceipt",
879
+ RemoteAttachment: 11, "11": "RemoteAttachment",
880
+ Reply: 12, "12": "Reply",
881
+ Text: 13, "13": "Text",
882
+ TransactionReference: 14, "14": "TransactionReference",
883
+ WalletSendCalls: 15, "15": "WalletSendCalls",
884
+ });
885
+ /**
886
+ * @enum {0 | 1 | 2 | 3}
887
+ */
888
+ export const ConversationType = Object.freeze({
889
+ Dm: 0, "0": "Dm",
890
+ Group: 1, "1": "Group",
891
+ Sync: 2, "2": "Sync",
892
+ Oneshot: 3, "3": "Oneshot",
893
+ });
894
+ /**
895
+ * @enum {0 | 1}
896
+ */
897
+ export const DeletedBy = Object.freeze({
898
+ Sender: 0, "0": "Sender",
899
+ Admin: 1, "1": "Admin",
900
+ });
901
+ /**
902
+ * @enum {0 | 1 | 2}
903
+ */
904
+ export const DeliveryStatus = Object.freeze({
905
+ Unpublished: 0, "0": "Unpublished",
906
+ Published: 1, "1": "Published",
907
+ Failed: 2, "2": "Failed",
908
+ });
909
+ /**
910
+ * @enum {0 | 1}
911
+ */
912
+ export const DeviceSyncWorkerMode = Object.freeze({
913
+ Enabled: 0, "0": "Enabled",
914
+ Disabled: 1, "1": "Disabled",
915
+ });
916
+ /**
917
+ * @enum {0 | 1 | 2 | 3 | 4}
918
+ */
919
+ export const GroupMembershipState = Object.freeze({
920
+ Allowed: 0, "0": "Allowed",
921
+ Rejected: 1, "1": "Rejected",
922
+ Pending: 2, "2": "Pending",
923
+ Restored: 3, "3": "Restored",
924
+ PendingRemove: 4, "4": "PendingRemove",
925
+ });
926
+ /**
927
+ * @enum {0 | 1}
928
+ */
929
+ export const GroupMessageKind = Object.freeze({
930
+ Application: 0, "0": "Application",
931
+ MembershipChange: 1, "1": "MembershipChange",
932
+ });
933
+ /**
934
+ * @enum {0 | 1 | 2}
935
+ */
936
+ export const GroupPermissionsOptions = Object.freeze({
937
+ Default: 0, "0": "Default",
938
+ AdminOnly: 1, "1": "AdminOnly",
939
+ CustomPolicy: 2, "2": "CustomPolicy",
940
+ });
941
+ /**
942
+ * @enum {0 | 1}
943
+ */
944
+ export const IdentifierKind = Object.freeze({
945
+ Ethereum: 0, "0": "Ethereum",
946
+ Passkey: 1, "1": "Passkey",
947
+ });
948
+ /**
949
+ * @enum {0 | 1}
950
+ */
951
+ export const ListConversationsOrderBy = Object.freeze({
952
+ CreatedAt: 0, "0": "CreatedAt",
953
+ LastActivity: 1, "1": "LastActivity",
954
+ });
955
+ /**
956
+ * @enum {0 | 1 | 2 | 3 | 4 | 5}
957
+ */
958
+ export const LogLevel = Object.freeze({
959
+ Off: 0, "0": "Off",
960
+ Error: 1, "1": "Error",
961
+ Warn: 2, "2": "Warn",
962
+ Info: 3, "3": "Info",
963
+ Debug: 4, "4": "Debug",
964
+ Trace: 5, "5": "Trace",
965
+ });
966
+ /**
967
+ * @enum {0 | 1}
968
+ */
969
+ export const MessageSortBy = Object.freeze({
970
+ SentAt: 0, "0": "SentAt",
971
+ InsertedAt: 1, "1": "InsertedAt",
972
+ });
973
+ /**
974
+ * @enum {0 | 1 | 2 | 3 | 4 | 5}
975
+ */
976
+ export const MetadataField = Object.freeze({
977
+ AppData: 0, "0": "AppData",
978
+ Description: 1, "1": "Description",
979
+ GroupName: 2, "2": "GroupName",
980
+ GroupImageUrlSquare: 3, "3": "GroupImageUrlSquare",
981
+ MessageExpirationFromNs: 4, "4": "MessageExpirationFromNs",
982
+ MessageExpirationInNs: 5, "5": "MessageExpirationInNs",
983
+ });
984
+ /**
985
+ * @enum {0 | 1 | 2}
986
+ */
987
+ export const PermissionLevel = Object.freeze({
988
+ Member: 0, "0": "Member",
989
+ Admin: 1, "1": "Admin",
990
+ SuperAdmin: 2, "2": "SuperAdmin",
991
+ });
992
+ /**
993
+ * @enum {0 | 1 | 2 | 3 | 4 | 5}
994
+ */
995
+ export const PermissionPolicy = Object.freeze({
996
+ Allow: 0, "0": "Allow",
997
+ Deny: 1, "1": "Deny",
998
+ Admin: 2, "2": "Admin",
999
+ SuperAdmin: 3, "3": "SuperAdmin",
1000
+ DoesNotExist: 4, "4": "DoesNotExist",
1001
+ Other: 5, "5": "Other",
1002
+ });
1003
+ /**
1004
+ * @enum {0 | 1 | 2 | 3 | 4}
1005
+ */
1006
+ export const PermissionUpdateType = Object.freeze({
1007
+ AddMember: 0, "0": "AddMember",
1008
+ RemoveMember: 1, "1": "RemoveMember",
1009
+ AddAdmin: 2, "2": "AddAdmin",
1010
+ RemoveAdmin: 3, "3": "RemoveAdmin",
1011
+ UpdateMetadata: 4, "4": "UpdateMetadata",
1012
+ });
1013
+ /**
1014
+ * @enum {0 | 1 | 2}
1015
+ */
1016
+ export const ReactionAction = Object.freeze({
1017
+ Unknown: 0, "0": "Unknown",
1018
+ Added: 1, "1": "Added",
1019
+ Removed: 2, "2": "Removed",
1020
+ });
1021
+ /**
1022
+ * @enum {0 | 1 | 2 | 3}
1023
+ */
1024
+ export const ReactionSchema = Object.freeze({
1025
+ Unknown: 0, "0": "Unknown",
1026
+ Unicode: 1, "1": "Unicode",
1027
+ Shortcode: 2, "2": "Shortcode",
1028
+ Custom: 3, "3": "Custom",
1029
+ });
1030
+ /**
1031
+ * @enum {0 | 1}
1032
+ */
1033
+ export const SortDirection = Object.freeze({
1034
+ Ascending: 0, "0": "Ascending",
1035
+ Descending: 1, "1": "Descending",
1036
+ });
1037
+
712
1038
  const __wbindgen_enum_ReadableStreamType = ["bytes"];
713
1039
 
714
1040
  const __wbindgen_enum_ReferrerPolicy = ["", "no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "unsafe-url", "same-origin", "strict-origin", "strict-origin-when-cross-origin"];
@@ -882,6 +1208,27 @@ export class Client {
882
1208
  const ret = wasm.client_revokeAllOtherInstallationsSignatureRequest(this.__wbg_ptr);
883
1209
  return ret;
884
1210
  }
1211
+ /**
1212
+ * @param {ConsentEntityType} entityType
1213
+ * @param {string} entity
1214
+ * @returns {Promise<ConsentState>}
1215
+ */
1216
+ getConsentState(entityType, entity) {
1217
+ const ptr0 = passStringToWasm0(entity, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1218
+ const len0 = WASM_VECTOR_LEN;
1219
+ const ret = wasm.client_getConsentState(this.__wbg_ptr, entityType, ptr0, len0);
1220
+ return ret;
1221
+ }
1222
+ /**
1223
+ * @param {Consent[]} records
1224
+ * @returns {Promise<void>}
1225
+ */
1226
+ setConsentStates(records) {
1227
+ const ptr0 = passArrayJsValueToWasm0(records, wasm.__wbindgen_malloc);
1228
+ const len0 = WASM_VECTOR_LEN;
1229
+ const ret = wasm.client_setConsentStates(this.__wbg_ptr, ptr0, len0);
1230
+ return ret;
1231
+ }
885
1232
  /**
886
1233
  * @returns {string}
887
1234
  */
@@ -1085,27 +1432,6 @@ export class Client {
1085
1432
  const ret = wasm.client_getKeyPackageStatusesForInstallationIds(this.__wbg_ptr, ptr0, len0);
1086
1433
  return ret;
1087
1434
  }
1088
- /**
1089
- * @param {ConsentEntityType} entityType
1090
- * @param {string} entity
1091
- * @returns {Promise<ConsentState>}
1092
- */
1093
- getConsentState(entityType, entity) {
1094
- const ptr0 = passStringToWasm0(entity, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1095
- const len0 = WASM_VECTOR_LEN;
1096
- const ret = wasm.client_getConsentState(this.__wbg_ptr, entityType, ptr0, len0);
1097
- return ret;
1098
- }
1099
- /**
1100
- * @param {Consent[]} records
1101
- * @returns {Promise<void>}
1102
- */
1103
- setConsentStates(records) {
1104
- const ptr0 = passArrayJsValueToWasm0(records, wasm.__wbindgen_malloc);
1105
- const len0 = WASM_VECTOR_LEN;
1106
- const ret = wasm.client_setConsentStates(this.__wbg_ptr, ptr0, len0);
1107
- return ret;
1108
- }
1109
1435
  }
1110
1436
  if (Symbol.dispose) Client.prototype[Symbol.dispose] = Client.prototype.free;
1111
1437
 
@@ -1329,25 +1655,17 @@ export class Conversation {
1329
1655
  return ret;
1330
1656
  }
1331
1657
  /**
1332
- * @param {Attachment} attachment
1333
- * @param {boolean | null} [optimistic]
1334
- * @returns {Promise<string>}
1335
- */
1336
- sendAttachment(attachment, optimistic) {
1337
- const ret = wasm.conversation_sendAttachment(this.__wbg_ptr, attachment, isLikeNone(optimistic) ? 0xFFFFFF : optimistic ? 1 : 0);
1338
- return ret;
1339
- }
1340
- /**
1341
- * send a message without immediately publishing to the delivery service.
1658
+ * Prepare a message for later publishing.
1659
+ * Stores the message locally without publishing. Returns the message ID.
1342
1660
  * @param {EncodedContent} encodedContent
1343
- * @param {SendMessageOpts} opts
1661
+ * @param {boolean} shouldPush
1344
1662
  * @returns {string}
1345
1663
  */
1346
- sendOptimistic(encodedContent, opts) {
1664
+ prepareMessage(encodedContent, shouldPush) {
1347
1665
  let deferred2_0;
1348
1666
  let deferred2_1;
1349
1667
  try {
1350
- const ret = wasm.conversation_sendOptimistic(this.__wbg_ptr, encodedContent, opts);
1668
+ const ret = wasm.conversation_prepareMessage(this.__wbg_ptr, encodedContent, shouldPush);
1351
1669
  var ptr1 = ret[0];
1352
1670
  var len1 = ret[1];
1353
1671
  if (ret[3]) {
@@ -1361,6 +1679,15 @@ export class Conversation {
1361
1679
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1362
1680
  }
1363
1681
  }
1682
+ /**
1683
+ * @param {Attachment} attachment
1684
+ * @param {boolean | null} [optimistic]
1685
+ * @returns {Promise<string>}
1686
+ */
1687
+ sendAttachment(attachment, optimistic) {
1688
+ const ret = wasm.conversation_sendAttachment(this.__wbg_ptr, attachment, isLikeNone(optimistic) ? 0xFFFFFF : optimistic ? 1 : 0);
1689
+ return ret;
1690
+ }
1364
1691
  /**
1365
1692
  * @param {string} appData
1366
1693
  * @returns {Promise<void>}
@@ -1400,7 +1727,7 @@ export class Conversation {
1400
1727
  if (ret[2]) {
1401
1728
  throw takeFromExternrefTable0(ret[1]);
1402
1729
  }
1403
- return takeFromExternrefTable0(ret[0]);
1730
+ return ret[0];
1404
1731
  }
1405
1732
  /**
1406
1733
  * Publish all unpublished messages
@@ -1560,6 +1887,17 @@ export class Conversation {
1560
1887
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
1561
1888
  }
1562
1889
  }
1890
+ /**
1891
+ * Publish a previously prepared message by ID.
1892
+ * @param {string} messageId
1893
+ * @returns {Promise<void>}
1894
+ */
1895
+ publishStoredMessage(messageId) {
1896
+ const ptr0 = passStringToWasm0(messageId, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1897
+ const len0 = WASM_VECTOR_LEN;
1898
+ const ret = wasm.conversation_publishStoredMessage(this.__wbg_ptr, ptr0, len0);
1899
+ return ret;
1900
+ }
1563
1901
  /**
1564
1902
  * @param {RemoteAttachment} remoteAttachment
1565
1903
  * @param {boolean | null} [optimistic]
@@ -1605,7 +1943,7 @@ export class Conversation {
1605
1943
  * @returns {Promise<void>}
1606
1944
  */
1607
1945
  updatePermissionPolicy(permissionUpdateType, permissionPolicyOption, metadataField) {
1608
- const ret = wasm.conversation_updatePermissionPolicy(this.__wbg_ptr, permissionUpdateType, permissionPolicyOption, isLikeNone(metadataField) ? 0 : addToExternrefTable0(metadataField));
1946
+ const ret = wasm.conversation_updatePermissionPolicy(this.__wbg_ptr, permissionUpdateType, permissionPolicyOption, isLikeNone(metadataField) ? 6 : metadataField);
1609
1947
  return ret;
1610
1948
  }
1611
1949
  /**
@@ -1627,14 +1965,6 @@ export class Conversation {
1627
1965
  const ret = wasm.conversation_sendTransactionReference(this.__wbg_ptr, transactionReference, isLikeNone(optimistic) ? 0xFFFFFF : optimistic ? 1 : 0);
1628
1966
  return ret;
1629
1967
  }
1630
- /**
1631
- * @param {ListMessagesOptions | null} [opts]
1632
- * @returns {Promise<MessageWithReactions[]>}
1633
- */
1634
- findMessagesWithReactions(opts) {
1635
- const ret = wasm.conversation_findMessagesWithReactions(this.__wbg_ptr, isLikeNone(opts) ? 0 : addToExternrefTable0(opts));
1636
- return ret;
1637
- }
1638
1968
  /**
1639
1969
  * @param {MultiRemoteAttachment} multiRemoteAttachment
1640
1970
  * @param {boolean | null} [optimistic]
@@ -1812,7 +2142,7 @@ export class Conversation {
1812
2142
  if (ret[2]) {
1813
2143
  throw takeFromExternrefTable0(ret[1]);
1814
2144
  }
1815
- return takeFromExternrefTable0(ret[0]);
2145
+ return ret[0];
1816
2146
  }
1817
2147
  /**
1818
2148
  * @param {ConsentState} state
@@ -1980,7 +2310,7 @@ export class Conversations {
1980
2310
  }
1981
2311
  /**
1982
2312
  * @param {Identifier} accountIdentifier
1983
- * @param {CreateDMOptions | null} [options]
2313
+ * @param {CreateDmOptions | null} [options]
1984
2314
  * @returns {Promise<Conversation>}
1985
2315
  */
1986
2316
  createDm(accountIdentifier, options) {
@@ -2014,13 +2344,13 @@ export class Conversations {
2014
2344
  /**
2015
2345
  * @param {any} callback
2016
2346
  * @param {ConversationType | null} [conversationType]
2017
- * @param {ConsentState[] | null} [consentStates]
2347
+ * @param {any[] | null} [consentStates]
2018
2348
  * @returns {StreamCloser}
2019
2349
  */
2020
2350
  streamAllMessages(callback, conversationType, consentStates) {
2021
2351
  var ptr0 = isLikeNone(consentStates) ? 0 : passArrayJsValueToWasm0(consentStates, wasm.__wbindgen_malloc);
2022
2352
  var len0 = WASM_VECTOR_LEN;
2023
- const ret = wasm.conversations_streamAllMessages(this.__wbg_ptr, callback, isLikeNone(conversationType) ? 0 : addToExternrefTable0(conversationType), ptr0, len0);
2353
+ const ret = wasm.conversations_streamAllMessages(this.__wbg_ptr, callback, isLikeNone(conversationType) ? 4 : conversationType, ptr0, len0);
2024
2354
  if (ret[2]) {
2025
2355
  throw takeFromExternrefTable0(ret[1]);
2026
2356
  }
@@ -2040,7 +2370,7 @@ export class Conversations {
2040
2370
  return ret[0] >>> 0;
2041
2371
  }
2042
2372
  /**
2043
- * @param {ConsentState[] | null} [consentStates]
2373
+ * @param {any[] | null} [consentStates]
2044
2374
  * @returns {Promise<GroupSyncSummary>}
2045
2375
  */
2046
2376
  syncAllConversations(consentStates) {
@@ -2101,7 +2431,7 @@ export class Conversations {
2101
2431
  * @returns {Promise<ReadableStream>}
2102
2432
  */
2103
2433
  streamLocal(conversationType) {
2104
- const ret = wasm.conversations_streamLocal(this.__wbg_ptr, isLikeNone(conversationType) ? 0 : addToExternrefTable0(conversationType));
2434
+ const ret = wasm.conversations_streamLocal(this.__wbg_ptr, isLikeNone(conversationType) ? 4 : conversationType);
2105
2435
  return ret;
2106
2436
  }
2107
2437
  /**
@@ -2116,7 +2446,7 @@ export class Conversations {
2116
2446
  }
2117
2447
  /**
2118
2448
  * @param {string} inboxId
2119
- * @param {CreateDMOptions | null} [options]
2449
+ * @param {CreateDmOptions | null} [options]
2120
2450
  * @returns {Promise<Conversation>}
2121
2451
  */
2122
2452
  createDmByInboxId(inboxId, options) {
@@ -2149,7 +2479,7 @@ export class Conversations {
2149
2479
  * @returns {StreamCloser}
2150
2480
  */
2151
2481
  stream(callback, conversationType) {
2152
- const ret = wasm.conversations_stream(this.__wbg_ptr, callback, isLikeNone(conversationType) ? 0 : addToExternrefTable0(conversationType));
2482
+ const ret = wasm.conversations_stream(this.__wbg_ptr, callback, isLikeNone(conversationType) ? 4 : conversationType);
2153
2483
  if (ret[2]) {
2154
2484
  throw takeFromExternrefTable0(ret[1]);
2155
2485
  }
@@ -2158,6 +2488,59 @@ export class Conversations {
2158
2488
  }
2159
2489
  if (Symbol.dispose) Conversations.prototype[Symbol.dispose] = Conversations.prototype.free;
2160
2490
 
2491
+ const DeletedMessageFinalization = (typeof FinalizationRegistry === 'undefined')
2492
+ ? { register: () => {}, unregister: () => {} }
2493
+ : new FinalizationRegistry(ptr => wasm.__wbg_deletedmessage_free(ptr >>> 0, 1));
2494
+
2495
+ export class DeletedMessage {
2496
+
2497
+ __destroy_into_raw() {
2498
+ const ptr = this.__wbg_ptr;
2499
+ this.__wbg_ptr = 0;
2500
+ DeletedMessageFinalization.unregister(this);
2501
+ return ptr;
2502
+ }
2503
+
2504
+ free() {
2505
+ const ptr = this.__destroy_into_raw();
2506
+ wasm.__wbg_deletedmessage_free(ptr, 0);
2507
+ }
2508
+ /**
2509
+ * @returns {DeletedBy}
2510
+ */
2511
+ get deletedBy() {
2512
+ const ret = wasm.__wbg_get_deletedmessage_deletedBy(this.__wbg_ptr);
2513
+ return ret;
2514
+ }
2515
+ /**
2516
+ * @param {DeletedBy} arg0
2517
+ */
2518
+ set deletedBy(arg0) {
2519
+ wasm.__wbg_set_deletedmessage_deletedBy(this.__wbg_ptr, arg0);
2520
+ }
2521
+ /**
2522
+ * @returns {string | undefined}
2523
+ */
2524
+ get adminInboxId() {
2525
+ const ret = wasm.__wbg_get_deletedmessage_adminInboxId(this.__wbg_ptr);
2526
+ let v1;
2527
+ if (ret[0] !== 0) {
2528
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
2529
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2530
+ }
2531
+ return v1;
2532
+ }
2533
+ /**
2534
+ * @param {string | null} [arg0]
2535
+ */
2536
+ set adminInboxId(arg0) {
2537
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2538
+ var len0 = WASM_VECTOR_LEN;
2539
+ wasm.__wbg_set_deletedmessage_adminInboxId(this.__wbg_ptr, ptr0, len0);
2540
+ }
2541
+ }
2542
+ if (Symbol.dispose) DeletedMessage.prototype[Symbol.dispose] = DeletedMessage.prototype.free;
2543
+
2161
2544
  const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
2162
2545
  ? { register: () => {}, unregister: () => {} }
2163
2546
  : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1));
@@ -2538,6 +2921,12 @@ function __wbg_get_imports() {
2538
2921
  imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
2539
2922
  throw new Error(getStringFromWasm0(arg0, arg1));
2540
2923
  };
2924
+ imports.wbg.__wbg___wbindgen_try_into_number_e60ef6e208abc399 = function(arg0) {
2925
+ let result;
2926
+ try { result = +arg0 } catch (e) { result = e }
2927
+ const ret = result;
2928
+ return ret;
2929
+ };
2541
2930
  imports.wbg.__wbg__wbg_cb_unref_2454a539ea5790d9 = function(arg0) {
2542
2931
  arg0._wbg_cb_unref();
2543
2932
  };
@@ -2616,6 +3005,9 @@ function __wbg_get_imports() {
2616
3005
  imports.wbg.__wbg_close_6956df845478561a = function() { return handleError(function (arg0) {
2617
3006
  arg0.close();
2618
3007
  }, arguments) };
3008
+ imports.wbg.__wbg_close_6b987dbb02427741 = function(arg0) {
3009
+ arg0.close();
3010
+ };
2619
3011
  imports.wbg.__wbg_code_218f5fdf8c7fcabd = function(arg0) {
2620
3012
  const ret = arg0.code;
2621
3013
  return ret;
@@ -3047,37 +3439,29 @@ function __wbg_get_imports() {
3047
3439
  const ret = Date.now();
3048
3440
  return ret;
3049
3441
  };
3050
- imports.wbg.__wbg_on_auth_required_e368aaddaa60794a = function() { return handleError(function (arg0) {
3442
+ imports.wbg.__wbg_on_auth_required_975519af8ba0af3b = function() { return handleError(function (arg0) {
3051
3443
  const ret = arg0.on_auth_required();
3052
3444
  return ret;
3053
3445
  }, arguments) };
3054
- imports.wbg.__wbg_on_close_d69734f43badf0eb = function(arg0) {
3446
+ imports.wbg.__wbg_on_close_01e7d08665451df5 = function(arg0) {
3055
3447
  arg0.on_close();
3056
3448
  };
3057
- imports.wbg.__wbg_on_consent_update_4208639345abe4bc = function(arg0, arg1) {
3449
+ imports.wbg.__wbg_on_consent_update_6bf5ca12f36a50e4 = function(arg0, arg1) {
3058
3450
  arg0.on_consent_update(arg1);
3059
3451
  };
3060
- imports.wbg.__wbg_on_conversation_3f44180a0d9b4cea = function(arg0, arg1) {
3452
+ imports.wbg.__wbg_on_conversation_3cbfe1b8e7235c0d = function(arg0, arg1) {
3061
3453
  arg0.on_conversation(Conversation.__wrap(arg1));
3062
3454
  };
3063
- imports.wbg.__wbg_on_error_d7ae86c5b7c32997 = function(arg0, arg1) {
3455
+ imports.wbg.__wbg_on_error_56204a0c937c5bf5 = function(arg0, arg1) {
3064
3456
  arg0.on_error(arg1);
3065
3457
  };
3066
- imports.wbg.__wbg_on_message_deleted_96ff70f0f1607b68 = function(arg0, arg1, arg2) {
3067
- let deferred0_0;
3068
- let deferred0_1;
3069
- try {
3070
- deferred0_0 = arg1;
3071
- deferred0_1 = arg2;
3072
- arg0.on_message_deleted(getStringFromWasm0(arg1, arg2));
3073
- } finally {
3074
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
3075
- }
3458
+ imports.wbg.__wbg_on_message_deleted_4820d2dc739612d0 = function(arg0, arg1) {
3459
+ arg0.on_message_deleted(arg1);
3076
3460
  };
3077
- imports.wbg.__wbg_on_message_f4d392e5315b2bcd = function(arg0, arg1) {
3461
+ imports.wbg.__wbg_on_message_ea0e4641a0595363 = function(arg0, arg1) {
3078
3462
  arg0.on_message(arg1);
3079
3463
  };
3080
- imports.wbg.__wbg_on_user_preference_update_ee6c6db0e041f04d = function(arg0, arg1, arg2) {
3464
+ imports.wbg.__wbg_on_user_preference_update_6fc82e48172502df = function(arg0, arg1, arg2) {
3081
3465
  var v0 = getArrayJsValueFromWasm0(arg1, arg2).slice();
3082
3466
  wasm.__wbindgen_free(arg1, arg2 * 4, 4);
3083
3467
  arg0.on_user_preference_update(v0);
@@ -3341,16 +3725,23 @@ function __wbg_get_imports() {
3341
3725
  const ret = arg0.write(arg1, arg2);
3342
3726
  return ret;
3343
3727
  }, arguments) };
3344
- imports.wbg.__wbindgen_cast_211e08c655cf62bf = function(arg0, arg1) {
3345
- // Cast intrinsic for `Closure(Closure { dtor_idx: 6889, function: Function { arguments: [], shim_idx: 6890, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3346
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he7b712e0eb1b5ac1, wasm_bindgen__convert__closures_____invoke__h6af3cd86eb56f4b1);
3347
- return ret;
3348
- };
3349
3728
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
3350
3729
  // Cast intrinsic for `Ref(String) -> Externref`.
3351
3730
  const ret = getStringFromWasm0(arg0, arg1);
3352
3731
  return ret;
3353
3732
  };
3733
+ imports.wbg.__wbindgen_cast_25a0a844437d0e92 = function(arg0, arg1) {
3734
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3735
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3736
+ // Cast intrinsic for `Vector(NamedExternref("string")) -> Externref`.
3737
+ const ret = v0;
3738
+ return ret;
3739
+ };
3740
+ imports.wbg.__wbindgen_cast_30e1c5c34bba5e02 = function(arg0, arg1) {
3741
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 7207, function: Function { arguments: [], shim_idx: 7208, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3742
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hfbd660e60d498df9, wasm_bindgen__convert__closures_____invoke__hceddd2b8fc291040);
3743
+ return ret;
3744
+ };
3354
3745
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
3355
3746
  // Cast intrinsic for `U64 -> Externref`.
3356
3747
  const ret = BigInt.asUintN(64, arg0);
@@ -3363,13 +3754,8 @@ function __wbg_get_imports() {
3363
3754
  const ret = v0;
3364
3755
  return ret;
3365
3756
  };
3366
- imports.wbg.__wbindgen_cast_653b194fefadb0d3 = function(arg0, arg1) {
3367
- // Cast intrinsic for `Closure(Closure { dtor_idx: 7298, function: Function { arguments: [Externref], shim_idx: 7299, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3368
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hed8af60076250245, wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6);
3369
- return ret;
3370
- };
3371
- imports.wbg.__wbindgen_cast_71b65f902d88c9ed = function(arg0, arg1) {
3372
- // Cast intrinsic for `Closure(Closure { dtor_idx: 7265, function: Function { arguments: [], shim_idx: 7266, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3757
+ imports.wbg.__wbindgen_cast_565992b11e0ca2e1 = function(arg0, arg1) {
3758
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 7363, function: Function { arguments: [], shim_idx: 7364, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3373
3759
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h3c5639ee43c80f22, wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005);
3374
3760
  return ret;
3375
3761
  };
@@ -3380,21 +3766,14 @@ function __wbg_get_imports() {
3380
3766
  const ret = v0;
3381
3767
  return ret;
3382
3768
  };
3383
- imports.wbg.__wbindgen_cast_998222446b91a002 = function(arg0, arg1) {
3384
- var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3385
- wasm.__wbindgen_free(arg0, arg1 * 4, 4);
3386
- // Cast intrinsic for `Vector(NamedExternref("MessageWithReactions")) -> Externref`.
3387
- const ret = v0;
3388
- return ret;
3389
- };
3390
3769
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
3391
3770
  // Cast intrinsic for `I64 -> Externref`.
3392
3771
  const ret = arg0;
3393
3772
  return ret;
3394
3773
  };
3395
- imports.wbg.__wbindgen_cast_c57c2f5798589a39 = function(arg0, arg1) {
3396
- // Cast intrinsic for `Closure(Closure { dtor_idx: 7106, function: Function { arguments: [], shim_idx: 7107, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3397
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hfbd660e60d498df9, wasm_bindgen__convert__closures_____invoke__hceddd2b8fc291040);
3774
+ imports.wbg.__wbindgen_cast_ad8b0e06693e980a = function(arg0, arg1) {
3775
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 6994, function: Function { arguments: [], shim_idx: 6995, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3776
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he7b712e0eb1b5ac1, wasm_bindgen__convert__closures_____invoke__h6af3cd86eb56f4b1);
3398
3777
  return ret;
3399
3778
  };
3400
3779
  imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
@@ -3414,6 +3793,11 @@ function __wbg_get_imports() {
3414
3793
  const ret = v0;
3415
3794
  return ret;
3416
3795
  };
3796
+ imports.wbg.__wbindgen_cast_f0f770d7ae28c6c6 = function(arg0, arg1) {
3797
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 7396, function: Function { arguments: [Externref], shim_idx: 7397, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3798
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hed8af60076250245, wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6);
3799
+ return ret;
3800
+ };
3417
3801
  imports.wbg.__wbindgen_cast_f20a506f31063fd0 = function(arg0, arg1) {
3418
3802
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3419
3803
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);