@xmtp/wasm-bindings 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bindings_wasm.d.ts +187 -165
- package/dist/bindings_wasm.js +316 -203
- package/dist/bindings_wasm_bg.wasm +0 -0
- package/dist/bindings_wasm_bg.wasm.d.ts +155 -143
- package/package.json +1 -1
package/dist/bindings_wasm.js
CHANGED
|
@@ -200,6 +200,41 @@ function debugString(val) {
|
|
|
200
200
|
return className;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
function _assertClass(instance, klass) {
|
|
204
|
+
if (!(instance instanceof klass)) {
|
|
205
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* @param {string} host
|
|
210
|
+
* @param {string} inbox_id
|
|
211
|
+
* @param {string} account_address
|
|
212
|
+
* @param {string | undefined} [db_path]
|
|
213
|
+
* @param {Uint8Array | undefined} [encryption_key]
|
|
214
|
+
* @param {string | undefined} [history_sync_url]
|
|
215
|
+
* @param {LogOptions | undefined} [log_options]
|
|
216
|
+
* @returns {Promise<Client>}
|
|
217
|
+
*/
|
|
218
|
+
export function createClient(host, inbox_id, account_address, db_path, encryption_key, history_sync_url, log_options) {
|
|
219
|
+
const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
220
|
+
const len0 = WASM_VECTOR_LEN;
|
|
221
|
+
const ptr1 = passStringToWasm0(inbox_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
222
|
+
const len1 = WASM_VECTOR_LEN;
|
|
223
|
+
const ptr2 = passStringToWasm0(account_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
224
|
+
const len2 = WASM_VECTOR_LEN;
|
|
225
|
+
var ptr3 = isLikeNone(db_path) ? 0 : passStringToWasm0(db_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
226
|
+
var len3 = WASM_VECTOR_LEN;
|
|
227
|
+
var ptr4 = isLikeNone(history_sync_url) ? 0 : passStringToWasm0(history_sync_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
228
|
+
var len4 = WASM_VECTOR_LEN;
|
|
229
|
+
let ptr5 = 0;
|
|
230
|
+
if (!isLikeNone(log_options)) {
|
|
231
|
+
_assertClass(log_options, LogOptions);
|
|
232
|
+
ptr5 = log_options.__destroy_into_raw();
|
|
233
|
+
}
|
|
234
|
+
const ret = wasm.createClient(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(encryption_key) ? 0 : addToExternrefTable0(encryption_key), ptr4, len4, ptr5);
|
|
235
|
+
return ret;
|
|
236
|
+
}
|
|
237
|
+
|
|
203
238
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
204
239
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
205
240
|
const mem = getDataViewMemory0();
|
|
@@ -209,29 +244,6 @@ function passArrayJsValueToWasm0(array, malloc) {
|
|
|
209
244
|
WASM_VECTOR_LEN = array.length;
|
|
210
245
|
return ptr;
|
|
211
246
|
}
|
|
212
|
-
|
|
213
|
-
function takeFromExternrefTable0(idx) {
|
|
214
|
-
const value = wasm.__wbindgen_export_5.get(idx);
|
|
215
|
-
wasm.__externref_table_dealloc(idx);
|
|
216
|
-
return value;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
220
|
-
ptr = ptr >>> 0;
|
|
221
|
-
const mem = getDataViewMemory0();
|
|
222
|
-
const result = [];
|
|
223
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
224
|
-
result.push(wasm.__wbindgen_export_5.get(mem.getUint32(i, true)));
|
|
225
|
-
}
|
|
226
|
-
wasm.__externref_drop_slice(ptr, len);
|
|
227
|
-
return result;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function _assertClass(instance, klass) {
|
|
231
|
-
if (!(instance instanceof klass)) {
|
|
232
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
247
|
/**
|
|
236
248
|
* @param {string} host
|
|
237
249
|
* @param {string} account_address
|
|
@@ -246,6 +258,11 @@ export function getInboxIdForAddress(host, account_address) {
|
|
|
246
258
|
return ret;
|
|
247
259
|
}
|
|
248
260
|
|
|
261
|
+
function takeFromExternrefTable0(idx) {
|
|
262
|
+
const value = wasm.__wbindgen_export_5.get(idx);
|
|
263
|
+
wasm.__externref_table_dealloc(idx);
|
|
264
|
+
return value;
|
|
265
|
+
}
|
|
249
266
|
/**
|
|
250
267
|
* @param {string} account_address
|
|
251
268
|
* @returns {string}
|
|
@@ -271,6 +288,16 @@ export function generateInboxId(account_address) {
|
|
|
271
288
|
}
|
|
272
289
|
}
|
|
273
290
|
|
|
291
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
292
|
+
ptr = ptr >>> 0;
|
|
293
|
+
const mem = getDataViewMemory0();
|
|
294
|
+
const result = [];
|
|
295
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
296
|
+
result.push(wasm.__wbindgen_export_5.get(mem.getUint32(i, true)));
|
|
297
|
+
}
|
|
298
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
299
|
+
return result;
|
|
300
|
+
}
|
|
274
301
|
/**
|
|
275
302
|
* @param {string} signature_text
|
|
276
303
|
* @param {Uint8Array} signature_bytes
|
|
@@ -285,42 +312,23 @@ export function verifySignedWithPublicKey(signature_text, signature_bytes, publi
|
|
|
285
312
|
}
|
|
286
313
|
}
|
|
287
314
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
* @param {string} account_address
|
|
292
|
-
* @param {string | undefined} [db_path]
|
|
293
|
-
* @param {Uint8Array | undefined} [encryption_key]
|
|
294
|
-
* @param {string | undefined} [history_sync_url]
|
|
295
|
-
* @param {LogOptions | undefined} [log_options]
|
|
296
|
-
* @returns {Promise<Client>}
|
|
297
|
-
*/
|
|
298
|
-
export function createClient(host, inbox_id, account_address, db_path, encryption_key, history_sync_url, log_options) {
|
|
299
|
-
const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
300
|
-
const len0 = WASM_VECTOR_LEN;
|
|
301
|
-
const ptr1 = passStringToWasm0(inbox_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
302
|
-
const len1 = WASM_VECTOR_LEN;
|
|
303
|
-
const ptr2 = passStringToWasm0(account_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
304
|
-
const len2 = WASM_VECTOR_LEN;
|
|
305
|
-
var ptr3 = isLikeNone(db_path) ? 0 : passStringToWasm0(db_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
306
|
-
var len3 = WASM_VECTOR_LEN;
|
|
307
|
-
var ptr4 = isLikeNone(history_sync_url) ? 0 : passStringToWasm0(history_sync_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
308
|
-
var len4 = WASM_VECTOR_LEN;
|
|
309
|
-
let ptr5 = 0;
|
|
310
|
-
if (!isLikeNone(log_options)) {
|
|
311
|
-
_assertClass(log_options, LogOptions);
|
|
312
|
-
ptr5 = log_options.__destroy_into_raw();
|
|
313
|
-
}
|
|
314
|
-
const ret = wasm.createClient(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(encryption_key) ? 0 : addToExternrefTable0(encryption_key), ptr4, len4, ptr5);
|
|
315
|
-
return ret;
|
|
315
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
316
|
+
ptr = ptr >>> 0;
|
|
317
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
316
318
|
}
|
|
317
319
|
|
|
318
|
-
function
|
|
319
|
-
|
|
320
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
321
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
322
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
323
|
+
WASM_VECTOR_LEN = arg.length;
|
|
324
|
+
return ptr;
|
|
325
|
+
}
|
|
326
|
+
function __wbg_adapter_52(arg0, arg1, arg2) {
|
|
327
|
+
wasm.closure2568_externref_shim(arg0, arg1, arg2);
|
|
320
328
|
}
|
|
321
329
|
|
|
322
|
-
function
|
|
323
|
-
wasm.
|
|
330
|
+
function __wbg_adapter_591(arg0, arg1, arg2, arg3) {
|
|
331
|
+
wasm.closure3670_externref_shim(arg0, arg1, arg2, arg3);
|
|
324
332
|
}
|
|
325
333
|
|
|
326
334
|
/**
|
|
@@ -374,7 +382,7 @@ export const GroupMessageKind = Object.freeze({
|
|
|
374
382
|
* @enum {0 | 1 | 2}
|
|
375
383
|
*/
|
|
376
384
|
export const GroupPermissionsOptions = Object.freeze({
|
|
377
|
-
|
|
385
|
+
Default: 0, "0": "Default",
|
|
378
386
|
AdminOnly: 1, "1": "AdminOnly",
|
|
379
387
|
CustomPolicy: 2, "2": "CustomPolicy",
|
|
380
388
|
});
|
|
@@ -467,24 +475,134 @@ export class Client {
|
|
|
467
475
|
wasm.__wbg_client_free(ptr, 0);
|
|
468
476
|
}
|
|
469
477
|
/**
|
|
470
|
-
* @
|
|
478
|
+
* @returns {string}
|
|
479
|
+
*/
|
|
480
|
+
get accountAddress() {
|
|
481
|
+
let deferred1_0;
|
|
482
|
+
let deferred1_1;
|
|
483
|
+
try {
|
|
484
|
+
const ret = wasm.client_accountAddress(this.__wbg_ptr);
|
|
485
|
+
deferred1_0 = ret[0];
|
|
486
|
+
deferred1_1 = ret[1];
|
|
487
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
488
|
+
} finally {
|
|
489
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* @returns {string}
|
|
494
|
+
*/
|
|
495
|
+
get inboxId() {
|
|
496
|
+
let deferred1_0;
|
|
497
|
+
let deferred1_1;
|
|
498
|
+
try {
|
|
499
|
+
const ret = wasm.client_inboxId(this.__wbg_ptr);
|
|
500
|
+
deferred1_0 = ret[0];
|
|
501
|
+
deferred1_1 = ret[1];
|
|
502
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
503
|
+
} finally {
|
|
504
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* @returns {boolean}
|
|
509
|
+
*/
|
|
510
|
+
get isRegistered() {
|
|
511
|
+
const ret = wasm.client_isRegistered(this.__wbg_ptr);
|
|
512
|
+
return ret !== 0;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* @returns {string}
|
|
516
|
+
*/
|
|
517
|
+
get installationId() {
|
|
518
|
+
let deferred1_0;
|
|
519
|
+
let deferred1_1;
|
|
520
|
+
try {
|
|
521
|
+
const ret = wasm.client_installationId(this.__wbg_ptr);
|
|
522
|
+
deferred1_0 = ret[0];
|
|
523
|
+
deferred1_1 = ret[1];
|
|
524
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
525
|
+
} finally {
|
|
526
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* @returns {Uint8Array}
|
|
531
|
+
*/
|
|
532
|
+
get installationIdBytes() {
|
|
533
|
+
const ret = wasm.client_installationIdBytes(this.__wbg_ptr);
|
|
534
|
+
return ret;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* @param {(string)[]} account_addresses
|
|
538
|
+
* @returns {Promise<any>}
|
|
539
|
+
*/
|
|
540
|
+
canMessage(account_addresses) {
|
|
541
|
+
const ptr0 = passArrayJsValueToWasm0(account_addresses, wasm.__wbindgen_malloc);
|
|
542
|
+
const len0 = WASM_VECTOR_LEN;
|
|
543
|
+
const ret = wasm.client_canMessage(this.__wbg_ptr, ptr0, len0);
|
|
544
|
+
return ret;
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
471
547
|
* @returns {Promise<void>}
|
|
472
548
|
*/
|
|
473
|
-
|
|
474
|
-
const
|
|
549
|
+
registerIdentity() {
|
|
550
|
+
const ret = wasm.client_registerIdentity(this.__wbg_ptr);
|
|
551
|
+
return ret;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* @returns {Promise<void>}
|
|
555
|
+
*/
|
|
556
|
+
sendHistorySyncRequest() {
|
|
557
|
+
const ret = wasm.client_sendHistorySyncRequest(this.__wbg_ptr);
|
|
558
|
+
return ret;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* @returns {Promise<void>}
|
|
562
|
+
*/
|
|
563
|
+
sendConsentSyncRequest() {
|
|
564
|
+
const ret = wasm.client_sendConsentSyncRequest(this.__wbg_ptr);
|
|
565
|
+
return ret;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* @param {string} address
|
|
569
|
+
* @returns {Promise<string | undefined>}
|
|
570
|
+
*/
|
|
571
|
+
findInboxIdByAddress(address) {
|
|
572
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
475
573
|
const len0 = WASM_VECTOR_LEN;
|
|
476
|
-
const ret = wasm.
|
|
574
|
+
const ret = wasm.client_findInboxIdByAddress(this.__wbg_ptr, ptr0, len0);
|
|
477
575
|
return ret;
|
|
478
576
|
}
|
|
479
577
|
/**
|
|
480
|
-
* @
|
|
481
|
-
* @param {string} entity
|
|
482
|
-
* @returns {Promise<ConsentState>}
|
|
578
|
+
* @returns {Conversations}
|
|
483
579
|
*/
|
|
484
|
-
|
|
485
|
-
const
|
|
580
|
+
conversations() {
|
|
581
|
+
const ret = wasm.client_conversations(this.__wbg_ptr);
|
|
582
|
+
return Conversations.__wrap(ret);
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
*
|
|
586
|
+
* * Get the client's inbox state.
|
|
587
|
+
* *
|
|
588
|
+
* * If `refresh_from_network` is true, the client will go to the network first to refresh the state.
|
|
589
|
+
* * Otherwise, the state will be read from the local database.
|
|
590
|
+
*
|
|
591
|
+
* @param {boolean} refresh_from_network
|
|
592
|
+
* @returns {Promise<InboxState>}
|
|
593
|
+
*/
|
|
594
|
+
inboxState(refresh_from_network) {
|
|
595
|
+
const ret = wasm.client_inboxState(this.__wbg_ptr, refresh_from_network);
|
|
596
|
+
return ret;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* @param {string} inbox_id
|
|
600
|
+
* @returns {Promise<InboxState>}
|
|
601
|
+
*/
|
|
602
|
+
getLatestInboxState(inbox_id) {
|
|
603
|
+
const ptr0 = passStringToWasm0(inbox_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
486
604
|
const len0 = WASM_VECTOR_LEN;
|
|
487
|
-
const ret = wasm.
|
|
605
|
+
const ret = wasm.client_getLatestInboxState(this.__wbg_ptr, ptr0, len0);
|
|
488
606
|
return ret;
|
|
489
607
|
}
|
|
490
608
|
/**
|
|
@@ -584,136 +702,26 @@ export class Client {
|
|
|
584
702
|
}
|
|
585
703
|
}
|
|
586
704
|
/**
|
|
587
|
-
*
|
|
588
|
-
* * Get the client's inbox state.
|
|
589
|
-
* *
|
|
590
|
-
* * If `refresh_from_network` is true, the client will go to the network first to refresh the state.
|
|
591
|
-
* * Otherwise, the state will be read from the local database.
|
|
592
|
-
*
|
|
593
|
-
* @param {boolean} refresh_from_network
|
|
594
|
-
* @returns {Promise<InboxState>}
|
|
595
|
-
*/
|
|
596
|
-
inboxState(refresh_from_network) {
|
|
597
|
-
const ret = wasm.client_inboxState(this.__wbg_ptr, refresh_from_network);
|
|
598
|
-
return ret;
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* @param {string} inbox_id
|
|
602
|
-
* @returns {Promise<InboxState>}
|
|
603
|
-
*/
|
|
604
|
-
getLatestInboxState(inbox_id) {
|
|
605
|
-
const ptr0 = passStringToWasm0(inbox_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
606
|
-
const len0 = WASM_VECTOR_LEN;
|
|
607
|
-
const ret = wasm.client_getLatestInboxState(this.__wbg_ptr, ptr0, len0);
|
|
608
|
-
return ret;
|
|
609
|
-
}
|
|
610
|
-
/**
|
|
611
|
-
* @returns {string}
|
|
612
|
-
*/
|
|
613
|
-
get accountAddress() {
|
|
614
|
-
let deferred1_0;
|
|
615
|
-
let deferred1_1;
|
|
616
|
-
try {
|
|
617
|
-
const ret = wasm.client_accountAddress(this.__wbg_ptr);
|
|
618
|
-
deferred1_0 = ret[0];
|
|
619
|
-
deferred1_1 = ret[1];
|
|
620
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
621
|
-
} finally {
|
|
622
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
/**
|
|
626
|
-
* @returns {string}
|
|
627
|
-
*/
|
|
628
|
-
get inboxId() {
|
|
629
|
-
let deferred1_0;
|
|
630
|
-
let deferred1_1;
|
|
631
|
-
try {
|
|
632
|
-
const ret = wasm.client_inboxId(this.__wbg_ptr);
|
|
633
|
-
deferred1_0 = ret[0];
|
|
634
|
-
deferred1_1 = ret[1];
|
|
635
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
636
|
-
} finally {
|
|
637
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
/**
|
|
641
|
-
* @returns {boolean}
|
|
642
|
-
*/
|
|
643
|
-
get isRegistered() {
|
|
644
|
-
const ret = wasm.client_isRegistered(this.__wbg_ptr);
|
|
645
|
-
return ret !== 0;
|
|
646
|
-
}
|
|
647
|
-
/**
|
|
648
|
-
* @returns {string}
|
|
649
|
-
*/
|
|
650
|
-
get installationId() {
|
|
651
|
-
let deferred1_0;
|
|
652
|
-
let deferred1_1;
|
|
653
|
-
try {
|
|
654
|
-
const ret = wasm.client_installationId(this.__wbg_ptr);
|
|
655
|
-
deferred1_0 = ret[0];
|
|
656
|
-
deferred1_1 = ret[1];
|
|
657
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
658
|
-
} finally {
|
|
659
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
/**
|
|
663
|
-
* @returns {Uint8Array}
|
|
664
|
-
*/
|
|
665
|
-
get installationIdBytes() {
|
|
666
|
-
const ret = wasm.client_installationIdBytes(this.__wbg_ptr);
|
|
667
|
-
return ret;
|
|
668
|
-
}
|
|
669
|
-
/**
|
|
670
|
-
* @param {(string)[]} account_addresses
|
|
671
|
-
* @returns {Promise<any>}
|
|
672
|
-
*/
|
|
673
|
-
canMessage(account_addresses) {
|
|
674
|
-
const ptr0 = passArrayJsValueToWasm0(account_addresses, wasm.__wbindgen_malloc);
|
|
675
|
-
const len0 = WASM_VECTOR_LEN;
|
|
676
|
-
const ret = wasm.client_canMessage(this.__wbg_ptr, ptr0, len0);
|
|
677
|
-
return ret;
|
|
678
|
-
}
|
|
679
|
-
/**
|
|
680
|
-
* @returns {Promise<void>}
|
|
681
|
-
*/
|
|
682
|
-
registerIdentity() {
|
|
683
|
-
const ret = wasm.client_registerIdentity(this.__wbg_ptr);
|
|
684
|
-
return ret;
|
|
685
|
-
}
|
|
686
|
-
/**
|
|
687
|
-
* @returns {Promise<void>}
|
|
688
|
-
*/
|
|
689
|
-
sendHistorySyncRequest() {
|
|
690
|
-
const ret = wasm.client_sendHistorySyncRequest(this.__wbg_ptr);
|
|
691
|
-
return ret;
|
|
692
|
-
}
|
|
693
|
-
/**
|
|
705
|
+
* @param {(Consent)[]} records
|
|
694
706
|
* @returns {Promise<void>}
|
|
695
707
|
*/
|
|
696
|
-
|
|
697
|
-
const
|
|
708
|
+
setConsentStates(records) {
|
|
709
|
+
const ptr0 = passArrayJsValueToWasm0(records, wasm.__wbindgen_malloc);
|
|
710
|
+
const len0 = WASM_VECTOR_LEN;
|
|
711
|
+
const ret = wasm.client_setConsentStates(this.__wbg_ptr, ptr0, len0);
|
|
698
712
|
return ret;
|
|
699
713
|
}
|
|
700
714
|
/**
|
|
701
|
-
* @param {
|
|
702
|
-
* @
|
|
715
|
+
* @param {ConsentEntityType} entity_type
|
|
716
|
+
* @param {string} entity
|
|
717
|
+
* @returns {Promise<ConsentState>}
|
|
703
718
|
*/
|
|
704
|
-
|
|
705
|
-
const ptr0 = passStringToWasm0(
|
|
719
|
+
getConsentState(entity_type, entity) {
|
|
720
|
+
const ptr0 = passStringToWasm0(entity, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
706
721
|
const len0 = WASM_VECTOR_LEN;
|
|
707
|
-
const ret = wasm.
|
|
722
|
+
const ret = wasm.client_getConsentState(this.__wbg_ptr, entity_type, ptr0, len0);
|
|
708
723
|
return ret;
|
|
709
724
|
}
|
|
710
|
-
/**
|
|
711
|
-
* @returns {Conversations}
|
|
712
|
-
*/
|
|
713
|
-
conversations() {
|
|
714
|
-
const ret = wasm.client_conversations(this.__wbg_ptr);
|
|
715
|
-
return Conversations.__wrap(ret);
|
|
716
|
-
}
|
|
717
725
|
}
|
|
718
726
|
|
|
719
727
|
const ConsentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -850,7 +858,7 @@ export class ContentTypeId {
|
|
|
850
858
|
set authorityId(arg0) {
|
|
851
859
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
852
860
|
const len0 = WASM_VECTOR_LEN;
|
|
853
|
-
wasm.
|
|
861
|
+
wasm.__wbg_set_contenttypeid_authorityId(this.__wbg_ptr, ptr0, len0);
|
|
854
862
|
}
|
|
855
863
|
/**
|
|
856
864
|
* @returns {string}
|
|
@@ -1542,6 +1550,16 @@ export class Conversations {
|
|
|
1542
1550
|
}
|
|
1543
1551
|
return takeFromExternrefTable0(ret[0]);
|
|
1544
1552
|
}
|
|
1553
|
+
/**
|
|
1554
|
+
* @returns {any}
|
|
1555
|
+
*/
|
|
1556
|
+
getHmacKeys() {
|
|
1557
|
+
const ret = wasm.conversations_getHmacKeys(this.__wbg_ptr);
|
|
1558
|
+
if (ret[2]) {
|
|
1559
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1560
|
+
}
|
|
1561
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1562
|
+
}
|
|
1545
1563
|
}
|
|
1546
1564
|
|
|
1547
1565
|
const CreateGroupOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -1672,6 +1690,32 @@ export class CreateGroupOptions {
|
|
|
1672
1690
|
}
|
|
1673
1691
|
wasm.__wbg_set_creategroupoptions_customPermissionPolicySet(this.__wbg_ptr, ptr0);
|
|
1674
1692
|
}
|
|
1693
|
+
/**
|
|
1694
|
+
* @returns {bigint | undefined}
|
|
1695
|
+
*/
|
|
1696
|
+
get messageExpirationFromMillis() {
|
|
1697
|
+
const ret = wasm.__wbg_get_creategroupoptions_messageExpirationFromMillis(this.__wbg_ptr);
|
|
1698
|
+
return ret[0] === 0 ? undefined : ret[1];
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* @param {bigint | undefined} [arg0]
|
|
1702
|
+
*/
|
|
1703
|
+
set messageExpirationFromMillis(arg0) {
|
|
1704
|
+
wasm.__wbg_set_creategroupoptions_messageExpirationFromMillis(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* @returns {bigint | undefined}
|
|
1708
|
+
*/
|
|
1709
|
+
get messageExpirationMillis() {
|
|
1710
|
+
const ret = wasm.__wbg_get_creategroupoptions_messageExpirationMillis(this.__wbg_ptr);
|
|
1711
|
+
return ret[0] === 0 ? undefined : ret[1];
|
|
1712
|
+
}
|
|
1713
|
+
/**
|
|
1714
|
+
* @param {bigint | undefined} [arg0]
|
|
1715
|
+
*/
|
|
1716
|
+
set messageExpirationMillis(arg0) {
|
|
1717
|
+
wasm.__wbg_set_creategroupoptions_messageExpirationMillis(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
|
|
1718
|
+
}
|
|
1675
1719
|
/**
|
|
1676
1720
|
* @param {GroupPermissionsOptions | undefined} [permissions]
|
|
1677
1721
|
* @param {string | undefined} [group_name]
|
|
@@ -1679,8 +1723,10 @@ export class CreateGroupOptions {
|
|
|
1679
1723
|
* @param {string | undefined} [group_description]
|
|
1680
1724
|
* @param {string | undefined} [group_pinned_frame_url]
|
|
1681
1725
|
* @param {PermissionPolicySet | undefined} [custom_permission_policy_set]
|
|
1726
|
+
* @param {bigint | undefined} [message_expiration_from_ms]
|
|
1727
|
+
* @param {bigint | undefined} [message_expiration_ms]
|
|
1682
1728
|
*/
|
|
1683
|
-
constructor(permissions, group_name, group_image_url_square, group_description, group_pinned_frame_url, custom_permission_policy_set) {
|
|
1729
|
+
constructor(permissions, group_name, group_image_url_square, group_description, group_pinned_frame_url, custom_permission_policy_set, message_expiration_from_ms, message_expiration_ms) {
|
|
1684
1730
|
var ptr0 = isLikeNone(group_name) ? 0 : passStringToWasm0(group_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1685
1731
|
var len0 = WASM_VECTOR_LEN;
|
|
1686
1732
|
var ptr1 = isLikeNone(group_image_url_square) ? 0 : passStringToWasm0(group_image_url_square, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -1694,7 +1740,7 @@ export class CreateGroupOptions {
|
|
|
1694
1740
|
_assertClass(custom_permission_policy_set, PermissionPolicySet);
|
|
1695
1741
|
ptr4 = custom_permission_policy_set.__destroy_into_raw();
|
|
1696
1742
|
}
|
|
1697
|
-
const ret = wasm.creategroupoptions_new(isLikeNone(permissions) ? 3 : permissions, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4);
|
|
1743
|
+
const ret = wasm.creategroupoptions_new(isLikeNone(permissions) ? 3 : permissions, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, !isLikeNone(message_expiration_from_ms), isLikeNone(message_expiration_from_ms) ? BigInt(0) : message_expiration_from_ms, !isLikeNone(message_expiration_ms), isLikeNone(message_expiration_ms) ? BigInt(0) : message_expiration_ms);
|
|
1698
1744
|
this.__wbg_ptr = ret >>> 0;
|
|
1699
1745
|
CreateGroupOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
1700
1746
|
return this;
|
|
@@ -1863,7 +1909,7 @@ export class GroupMember {
|
|
|
1863
1909
|
set inboxId(arg0) {
|
|
1864
1910
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1865
1911
|
const len0 = WASM_VECTOR_LEN;
|
|
1866
|
-
wasm.
|
|
1912
|
+
wasm.__wbg_set_consent_entity(this.__wbg_ptr, ptr0, len0);
|
|
1867
1913
|
}
|
|
1868
1914
|
/**
|
|
1869
1915
|
* @returns {(string)[]}
|
|
@@ -2050,6 +2096,55 @@ export class GroupPermissions {
|
|
|
2050
2096
|
}
|
|
2051
2097
|
}
|
|
2052
2098
|
|
|
2099
|
+
const HmacKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2100
|
+
? { register: () => {}, unregister: () => {} }
|
|
2101
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_hmackey_free(ptr >>> 0, 1));
|
|
2102
|
+
|
|
2103
|
+
export class HmacKey {
|
|
2104
|
+
|
|
2105
|
+
__destroy_into_raw() {
|
|
2106
|
+
const ptr = this.__wbg_ptr;
|
|
2107
|
+
this.__wbg_ptr = 0;
|
|
2108
|
+
HmacKeyFinalization.unregister(this);
|
|
2109
|
+
return ptr;
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
free() {
|
|
2113
|
+
const ptr = this.__destroy_into_raw();
|
|
2114
|
+
wasm.__wbg_hmackey_free(ptr, 0);
|
|
2115
|
+
}
|
|
2116
|
+
/**
|
|
2117
|
+
* @returns {Uint8Array}
|
|
2118
|
+
*/
|
|
2119
|
+
get key() {
|
|
2120
|
+
const ret = wasm.__wbg_get_hmackey_key(this.__wbg_ptr);
|
|
2121
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
2122
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2123
|
+
return v1;
|
|
2124
|
+
}
|
|
2125
|
+
/**
|
|
2126
|
+
* @param {Uint8Array} arg0
|
|
2127
|
+
*/
|
|
2128
|
+
set key(arg0) {
|
|
2129
|
+
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
2130
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2131
|
+
wasm.__wbg_set_hmackey_key(this.__wbg_ptr, ptr0, len0);
|
|
2132
|
+
}
|
|
2133
|
+
/**
|
|
2134
|
+
* @returns {bigint}
|
|
2135
|
+
*/
|
|
2136
|
+
get epoch() {
|
|
2137
|
+
const ret = wasm.__wbg_get_hmackey_epoch(this.__wbg_ptr);
|
|
2138
|
+
return ret;
|
|
2139
|
+
}
|
|
2140
|
+
/**
|
|
2141
|
+
* @param {bigint} arg0
|
|
2142
|
+
*/
|
|
2143
|
+
set epoch(arg0) {
|
|
2144
|
+
wasm.__wbg_set_hmackey_epoch(this.__wbg_ptr, arg0);
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2053
2148
|
const InboxStateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2054
2149
|
? { register: () => {}, unregister: () => {} }
|
|
2055
2150
|
: new FinalizationRegistry(ptr => wasm.__wbg_inboxstate_free(ptr >>> 0, 1));
|
|
@@ -2096,7 +2191,7 @@ export class InboxState {
|
|
|
2096
2191
|
set inboxId(arg0) {
|
|
2097
2192
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2098
2193
|
const len0 = WASM_VECTOR_LEN;
|
|
2099
|
-
wasm.
|
|
2194
|
+
wasm.__wbg_set_inboxstate_inboxId(this.__wbg_ptr, ptr0, len0);
|
|
2100
2195
|
}
|
|
2101
2196
|
/**
|
|
2102
2197
|
* @returns {string}
|
|
@@ -2460,7 +2555,7 @@ export class ListConversationsOptions {
|
|
|
2460
2555
|
* @param {bigint | undefined} [arg0]
|
|
2461
2556
|
*/
|
|
2462
2557
|
set createdAfterNs(arg0) {
|
|
2463
|
-
wasm.
|
|
2558
|
+
wasm.__wbg_set_creategroupoptions_messageExpirationFromMillis(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
|
|
2464
2559
|
}
|
|
2465
2560
|
/**
|
|
2466
2561
|
* @returns {bigint | undefined}
|
|
@@ -2473,7 +2568,7 @@ export class ListConversationsOptions {
|
|
|
2473
2568
|
* @param {bigint | undefined} [arg0]
|
|
2474
2569
|
*/
|
|
2475
2570
|
set createdBeforeNs(arg0) {
|
|
2476
|
-
wasm.
|
|
2571
|
+
wasm.__wbg_set_creategroupoptions_messageExpirationMillis(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
|
|
2477
2572
|
}
|
|
2478
2573
|
/**
|
|
2479
2574
|
* @returns {bigint | undefined}
|
|
@@ -2533,7 +2628,7 @@ export class ListMessagesOptions {
|
|
|
2533
2628
|
* @param {bigint | undefined} [arg0]
|
|
2534
2629
|
*/
|
|
2535
2630
|
set sentBeforeNs(arg0) {
|
|
2536
|
-
wasm.
|
|
2631
|
+
wasm.__wbg_set_creategroupoptions_messageExpirationFromMillis(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
|
|
2537
2632
|
}
|
|
2538
2633
|
/**
|
|
2539
2634
|
* @returns {bigint | undefined}
|
|
@@ -2546,7 +2641,7 @@ export class ListMessagesOptions {
|
|
|
2546
2641
|
* @param {bigint | undefined} [arg0]
|
|
2547
2642
|
*/
|
|
2548
2643
|
set sentAfterNs(arg0) {
|
|
2549
|
-
wasm.
|
|
2644
|
+
wasm.__wbg_set_creategroupoptions_messageExpirationMillis(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
|
|
2550
2645
|
}
|
|
2551
2646
|
/**
|
|
2552
2647
|
* @returns {bigint | undefined}
|
|
@@ -2731,14 +2826,14 @@ export class Message {
|
|
|
2731
2826
|
* @returns {bigint}
|
|
2732
2827
|
*/
|
|
2733
2828
|
get sentAtNs() {
|
|
2734
|
-
const ret = wasm.
|
|
2829
|
+
const ret = wasm.__wbg_get_hmackey_epoch(this.__wbg_ptr);
|
|
2735
2830
|
return ret;
|
|
2736
2831
|
}
|
|
2737
2832
|
/**
|
|
2738
2833
|
* @param {bigint} arg0
|
|
2739
2834
|
*/
|
|
2740
2835
|
set sentAtNs(arg0) {
|
|
2741
|
-
wasm.
|
|
2836
|
+
wasm.__wbg_set_hmackey_epoch(this.__wbg_ptr, arg0);
|
|
2742
2837
|
}
|
|
2743
2838
|
/**
|
|
2744
2839
|
* @returns {string}
|
|
@@ -2981,6 +3076,19 @@ export class PermissionPolicySet {
|
|
|
2981
3076
|
set updateGroupPinnedFrameUrlPolicy(arg0) {
|
|
2982
3077
|
wasm.__wbg_set_permissionpolicyset_updateGroupPinnedFrameUrlPolicy(this.__wbg_ptr, arg0);
|
|
2983
3078
|
}
|
|
3079
|
+
/**
|
|
3080
|
+
* @returns {PermissionPolicy}
|
|
3081
|
+
*/
|
|
3082
|
+
get updateMessageExpirationPolicy() {
|
|
3083
|
+
const ret = wasm.__wbg_get_permissionpolicyset_updateMessageExpirationPolicy(this.__wbg_ptr);
|
|
3084
|
+
return ret;
|
|
3085
|
+
}
|
|
3086
|
+
/**
|
|
3087
|
+
* @param {PermissionPolicy} arg0
|
|
3088
|
+
*/
|
|
3089
|
+
set updateMessageExpirationPolicy(arg0) {
|
|
3090
|
+
wasm.__wbg_set_permissionpolicyset_updateMessageExpirationPolicy(this.__wbg_ptr, arg0);
|
|
3091
|
+
}
|
|
2984
3092
|
/**
|
|
2985
3093
|
* @param {PermissionPolicy} add_member_policy
|
|
2986
3094
|
* @param {PermissionPolicy} remove_member_policy
|
|
@@ -2990,9 +3098,10 @@ export class PermissionPolicySet {
|
|
|
2990
3098
|
* @param {PermissionPolicy} update_group_description_policy
|
|
2991
3099
|
* @param {PermissionPolicy} update_group_image_url_square_policy
|
|
2992
3100
|
* @param {PermissionPolicy} update_group_pinned_frame_url_policy
|
|
3101
|
+
* @param {PermissionPolicy} update_message_expiration_ms_policy
|
|
2993
3102
|
*/
|
|
2994
|
-
constructor(add_member_policy, remove_member_policy, add_admin_policy, remove_admin_policy, update_group_name_policy, update_group_description_policy, update_group_image_url_square_policy, update_group_pinned_frame_url_policy) {
|
|
2995
|
-
const ret = wasm.permissionpolicyset_new(add_member_policy, remove_member_policy, add_admin_policy, remove_admin_policy, update_group_name_policy, update_group_description_policy, update_group_image_url_square_policy, update_group_pinned_frame_url_policy);
|
|
3103
|
+
constructor(add_member_policy, remove_member_policy, add_admin_policy, remove_admin_policy, update_group_name_policy, update_group_description_policy, update_group_image_url_square_policy, update_group_pinned_frame_url_policy, update_message_expiration_ms_policy) {
|
|
3104
|
+
const ret = wasm.permissionpolicyset_new(add_member_policy, remove_member_policy, add_admin_policy, remove_admin_policy, update_group_name_policy, update_group_description_policy, update_group_image_url_square_policy, update_group_pinned_frame_url_policy, update_message_expiration_ms_policy);
|
|
2996
3105
|
this.__wbg_ptr = ret >>> 0;
|
|
2997
3106
|
PermissionPolicySetFinalization.register(this, this.__wbg_ptr, this);
|
|
2998
3107
|
return this;
|
|
@@ -3514,7 +3623,7 @@ function __wbg_get_imports() {
|
|
|
3514
3623
|
const a = state0.a;
|
|
3515
3624
|
state0.a = 0;
|
|
3516
3625
|
try {
|
|
3517
|
-
return
|
|
3626
|
+
return __wbg_adapter_591(a, state0.b, arg0, arg1);
|
|
3518
3627
|
} finally {
|
|
3519
3628
|
state0.a = a;
|
|
3520
3629
|
}
|
|
@@ -3824,6 +3933,10 @@ function __wbg_get_imports() {
|
|
|
3824
3933
|
const ret = +arg0;
|
|
3825
3934
|
return ret;
|
|
3826
3935
|
};
|
|
3936
|
+
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
3937
|
+
const ret = arg0;
|
|
3938
|
+
return ret;
|
|
3939
|
+
};
|
|
3827
3940
|
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
3828
3941
|
const v = arg0;
|
|
3829
3942
|
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
@@ -3838,8 +3951,8 @@ function __wbg_get_imports() {
|
|
|
3838
3951
|
const ret = false;
|
|
3839
3952
|
return ret;
|
|
3840
3953
|
};
|
|
3841
|
-
imports.wbg.
|
|
3842
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3954
|
+
imports.wbg.__wbindgen_closure_wrapper11337 = function(arg0, arg1, arg2) {
|
|
3955
|
+
const ret = makeMutClosure(arg0, arg1, 2569, __wbg_adapter_52);
|
|
3843
3956
|
return ret;
|
|
3844
3957
|
};
|
|
3845
3958
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|