@filen/sdk-rs 0.3.13 → 0.3.14

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/browser/sdk-rs.js CHANGED
@@ -203,6 +203,23 @@ function debugString(val) {
203
203
  return className;
204
204
  }
205
205
 
206
+ function takeFromExternrefTable0(idx) {
207
+ const value = wasm.__wbindgen_export_4.get(idx);
208
+ wasm.__externref_table_dealloc(idx);
209
+ return value;
210
+ }
211
+ /**
212
+ * @param {StringifiedClient} serialized
213
+ * @returns {Client}
214
+ */
215
+ export function fromStringified(serialized) {
216
+ const ret = wasm.fromStringified(serialized);
217
+ if (ret[2]) {
218
+ throw takeFromExternrefTable0(ret[1]);
219
+ }
220
+ return Client.__wrap(ret[0]);
221
+ }
222
+
206
223
  export function main_js() {
207
224
  wasm.main_js();
208
225
  }
@@ -224,23 +241,6 @@ export function login(email, password, twoFactorCode) {
224
241
  return ret;
225
242
  }
226
243
 
227
- function takeFromExternrefTable0(idx) {
228
- const value = wasm.__wbindgen_export_4.get(idx);
229
- wasm.__externref_table_dealloc(idx);
230
- return value;
231
- }
232
- /**
233
- * @param {StringifiedClient} serialized
234
- * @returns {Client}
235
- */
236
- export function fromStringified(serialized) {
237
- const ret = wasm.fromStringified(serialized);
238
- if (ret[2]) {
239
- throw takeFromExternrefTable0(ret[1]);
240
- }
241
- return Client.__wrap(ret[0]);
242
- }
243
-
244
244
  function passArray8ToWasm0(arg, malloc) {
245
245
  const ptr = malloc(arg.length * 1, 1) >>> 0;
246
246
  getUint8ArrayMemory0().set(arg, ptr / 1);
@@ -256,11 +256,11 @@ function __wbg_adapter_63(arg0, arg1) {
256
256
  }
257
257
 
258
258
  function __wbg_adapter_66(arg0, arg1, arg2) {
259
- wasm.closure1185_externref_shim(arg0, arg1, arg2);
259
+ wasm.closure1307_externref_shim(arg0, arg1, arg2);
260
260
  }
261
261
 
262
- function __wbg_adapter_326(arg0, arg1, arg2, arg3) {
263
- wasm.closure1332_externref_shim(arg0, arg1, arg2, arg3);
262
+ function __wbg_adapter_352(arg0, arg1, arg2, arg3) {
263
+ wasm.closure1459_externref_shim(arg0, arg1, arg2, arg3);
264
264
  }
265
265
 
266
266
  const __wbindgen_enum_ReadableStreamReaderMode = ["byob"];
@@ -304,18 +304,18 @@ export class Client {
304
304
  return ret;
305
305
  }
306
306
  /**
307
- * @param {AcquireLockParams} params
308
307
  * @returns {Promise<ResourceLock>}
309
308
  */
310
- acquireLock(params) {
311
- const ret = wasm.client_acquireLock(this.__wbg_ptr, params);
309
+ lockDrive() {
310
+ const ret = wasm.client_lockDrive(this.__wbg_ptr);
312
311
  return ret;
313
312
  }
314
313
  /**
314
+ * @param {AcquireLockParams} params
315
315
  * @returns {Promise<ResourceLock>}
316
316
  */
317
- lockDrive() {
318
- const ret = wasm.client_lockDrive(this.__wbg_ptr);
317
+ acquireLock(params) {
318
+ const ret = wasm.client_acquireLock(this.__wbg_ptr, params);
319
319
  return ret;
320
320
  }
321
321
  /**
@@ -327,30 +327,90 @@ export class Client {
327
327
  return ret;
328
328
  }
329
329
  /**
330
- * @param {Dir} dir
331
- * @returns {Promise<DirPublicLink>}
330
+ * @param {File} file
331
+ * @returns {Promise<FilePublicLink | undefined>}
332
332
  */
333
- publicLinkDir(dir) {
334
- const ret = wasm.client_publicLinkDir(this.__wbg_ptr, dir);
333
+ getFileLinkStatus(file) {
334
+ const ret = wasm.client_getFileLinkStatus(this.__wbg_ptr, file);
335
335
  return ret;
336
336
  }
337
337
  /**
338
- * @param {Dir} dir
339
- * @param {Contact} contact
338
+ * @param {string} contact_uuid
340
339
  * @returns {Promise<void>}
341
340
  */
342
- shareDir(dir, contact) {
343
- const ret = wasm.client_shareDir(this.__wbg_ptr, dir, contact);
341
+ unblockContact(contact_uuid) {
342
+ const ptr0 = passStringToWasm0(contact_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
343
+ const len0 = WASM_VECTOR_LEN;
344
+ const ret = wasm.client_unblockContact(this.__wbg_ptr, ptr0, len0);
345
+ return ret;
346
+ }
347
+ /**
348
+ * @param {DirWithMetaEnum | null} [dir]
349
+ * @returns {[SharedDirectory[], SharedFile[]]}
350
+ */
351
+ listInShared(dir) {
352
+ const ret = wasm.client_listInShared(this.__wbg_ptr, isLikeNone(dir) ? 0 : addToExternrefTable0(dir));
353
+ return ret;
354
+ }
355
+ /**
356
+ * @returns {ContactRequestOut[]}
357
+ */
358
+ listOutgoingContactRequests() {
359
+ const ret = wasm.client_listOutgoingContactRequests(this.__wbg_ptr);
360
+ return ret;
361
+ }
362
+ /**
363
+ * @returns {Contact[]}
364
+ */
365
+ getContacts() {
366
+ const ret = wasm.client_getContacts(this.__wbg_ptr);
367
+ return ret;
368
+ }
369
+ /**
370
+ * @param {string} contact_uuid
371
+ * @returns {Promise<void>}
372
+ */
373
+ deleteContact(contact_uuid) {
374
+ const ptr0 = passStringToWasm0(contact_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
375
+ const len0 = WASM_VECTOR_LEN;
376
+ const ret = wasm.client_deleteContact(this.__wbg_ptr, ptr0, len0);
377
+ return ret;
378
+ }
379
+ /**
380
+ * @param {File} file
381
+ * @param {FilePublicLink} link
382
+ * @returns {Promise<void>}
383
+ */
384
+ updateFileLink(file, link) {
385
+ const ret = wasm.client_updateFileLink(this.__wbg_ptr, file, link);
344
386
  return ret;
345
387
  }
346
388
  /**
347
389
  * @param {string} email
348
390
  * @returns {Promise<string>}
349
391
  */
350
- blockContact(email) {
392
+ sendContactRequest(email) {
351
393
  const ptr0 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
352
394
  const len0 = WASM_VECTOR_LEN;
353
- const ret = wasm.client_blockContact(this.__wbg_ptr, ptr0, len0);
395
+ const ret = wasm.client_sendContactRequest(this.__wbg_ptr, ptr0, len0);
396
+ return ret;
397
+ }
398
+ /**
399
+ * @param {string} contact_uuid
400
+ * @returns {Promise<void>}
401
+ */
402
+ denyContactRequest(contact_uuid) {
403
+ const ptr0 = passStringToWasm0(contact_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
404
+ const len0 = WASM_VECTOR_LEN;
405
+ const ret = wasm.client_denyContactRequest(this.__wbg_ptr, ptr0, len0);
406
+ return ret;
407
+ }
408
+ /**
409
+ * @param {File} file
410
+ * @returns {Promise<FilePublicLink>}
411
+ */
412
+ publicLinkFile(file) {
413
+ const ret = wasm.client_publicLinkFile(this.__wbg_ptr, file);
354
414
  return ret;
355
415
  }
356
416
  /**
@@ -362,6 +422,16 @@ export class Client {
362
422
  const ret = wasm.client_updateDirLink(this.__wbg_ptr, dir, link);
363
423
  return ret;
364
424
  }
425
+ /**
426
+ * @param {string} contact_uuid
427
+ * @returns {Promise<string>}
428
+ */
429
+ acceptContactRequest(contact_uuid) {
430
+ const ptr0 = passStringToWasm0(contact_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
431
+ const len0 = WASM_VECTOR_LEN;
432
+ const ret = wasm.client_acceptContactRequest(this.__wbg_ptr, ptr0, len0);
433
+ return ret;
434
+ }
365
435
  /**
366
436
  * @param {DirPublicLink} link
367
437
  * @returns {Promise<void>}
@@ -371,37 +441,38 @@ export class Client {
371
441
  return ret;
372
442
  }
373
443
  /**
374
- * @returns {ContactRequestIn[]}
444
+ * @param {DirWithMetaEnum | null} [dir]
445
+ * @param {Contact | null} [contact]
446
+ * @returns {[SharedDirectory[], SharedFile[]]}
375
447
  */
376
- listIncomingContactRequests() {
377
- const ret = wasm.client_listIncomingContactRequests(this.__wbg_ptr);
448
+ listOutShared(dir, contact) {
449
+ const ret = wasm.client_listOutShared(this.__wbg_ptr, isLikeNone(dir) ? 0 : addToExternrefTable0(dir), isLikeNone(contact) ? 0 : addToExternrefTable0(contact));
378
450
  return ret;
379
451
  }
380
452
  /**
381
- * @returns {ContactRequestOut[]}
453
+ * @param {DirWithMetaEnum} dir
454
+ * @param {DirPublicLink} link
455
+ * @returns {[Dir[], File[]]}
382
456
  */
383
- listOutgoingContactRequests() {
384
- const ret = wasm.client_listOutgoingContactRequests(this.__wbg_ptr);
457
+ listLinkedDir(dir, link) {
458
+ const ret = wasm.client_listLinkedDir(this.__wbg_ptr, dir, link);
385
459
  return ret;
386
460
  }
387
461
  /**
388
462
  * @param {string} contact_uuid
389
- * @returns {Promise<string>}
463
+ * @returns {Promise<void>}
390
464
  */
391
- acceptContactRequest(contact_uuid) {
465
+ cancelContactRequest(contact_uuid) {
392
466
  const ptr0 = passStringToWasm0(contact_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
393
467
  const len0 = WASM_VECTOR_LEN;
394
- const ret = wasm.client_acceptContactRequest(this.__wbg_ptr, ptr0, len0);
468
+ const ret = wasm.client_cancelContactRequest(this.__wbg_ptr, ptr0, len0);
395
469
  return ret;
396
470
  }
397
471
  /**
398
- * @param {string} contact_uuid
399
- * @returns {Promise<void>}
472
+ * @returns {BlockedContact[]}
400
473
  */
401
- cancelContactRequest(contact_uuid) {
402
- const ptr0 = passStringToWasm0(contact_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
403
- const len0 = WASM_VECTOR_LEN;
404
- const ret = wasm.client_cancelContactRequest(this.__wbg_ptr, ptr0, len0);
474
+ getBlockedContacts() {
475
+ const ret = wasm.client_getBlockedContacts(this.__wbg_ptr);
405
476
  return ret;
406
477
  }
407
478
  /**
@@ -414,259 +485,427 @@ export class Client {
414
485
  return ret;
415
486
  }
416
487
  /**
417
- * @param {Dir} dir
418
- * @returns {Promise<DirPublicLink | undefined>}
488
+ * @param {Dir} dir
489
+ * @returns {Promise<DirPublicLink>}
490
+ */
491
+ publicLinkDir(dir) {
492
+ const ret = wasm.client_publicLinkDir(this.__wbg_ptr, dir);
493
+ return ret;
494
+ }
495
+ /**
496
+ * @param {string} link_uuid
497
+ * @param {bigint} receiver_id
498
+ * @returns {Promise<void>}
499
+ */
500
+ removeSharedLinkOut(link_uuid, receiver_id) {
501
+ const ptr0 = passStringToWasm0(link_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
502
+ const len0 = WASM_VECTOR_LEN;
503
+ const ret = wasm.client_removeSharedLinkOut(this.__wbg_ptr, ptr0, len0, receiver_id);
504
+ return ret;
505
+ }
506
+ /**
507
+ * @param {Dir} dir
508
+ * @returns {Promise<DirPublicLink | undefined>}
509
+ */
510
+ getDirLinkStatus(dir) {
511
+ const ret = wasm.client_getDirLinkStatus(this.__wbg_ptr, dir);
512
+ return ret;
513
+ }
514
+ /**
515
+ * @param {string} email
516
+ * @returns {Promise<string>}
517
+ */
518
+ blockContact(email) {
519
+ const ptr0 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
520
+ const len0 = WASM_VECTOR_LEN;
521
+ const ret = wasm.client_blockContact(this.__wbg_ptr, ptr0, len0);
522
+ return ret;
523
+ }
524
+ /**
525
+ * @returns {ContactRequestIn[]}
526
+ */
527
+ listIncomingContactRequests() {
528
+ const ret = wasm.client_listIncomingContactRequests(this.__wbg_ptr);
529
+ return ret;
530
+ }
531
+ /**
532
+ * @param {string} link_uuid
533
+ * @returns {Promise<void>}
534
+ */
535
+ removeSharedLinkIn(link_uuid) {
536
+ const ptr0 = passStringToWasm0(link_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
537
+ const len0 = WASM_VECTOR_LEN;
538
+ const ret = wasm.client_removeSharedLinkIn(this.__wbg_ptr, ptr0, len0);
539
+ return ret;
540
+ }
541
+ /**
542
+ * @param {Dir} dir
543
+ * @param {Contact} contact
544
+ * @returns {Promise<void>}
545
+ */
546
+ shareDir(dir, contact) {
547
+ const ret = wasm.client_shareDir(this.__wbg_ptr, dir, contact);
548
+ return ret;
549
+ }
550
+ /**
551
+ * @param {Dir} dir
552
+ * @returns {Promise<Dir>}
553
+ */
554
+ trashDir(dir) {
555
+ const ret = wasm.client_trashDir(this.__wbg_ptr, dir);
556
+ return ret;
557
+ }
558
+ /**
559
+ * @param {DirEnum} dir
560
+ * @returns {[Dir[], File[]]}
561
+ */
562
+ listDirRecursive(dir) {
563
+ const ret = wasm.client_listDirRecursive(this.__wbg_ptr, dir);
564
+ return ret;
565
+ }
566
+ /**
567
+ * @returns {[Dir[], File[]]}
568
+ */
569
+ listFavorites() {
570
+ const ret = wasm.client_listFavorites(this.__wbg_ptr);
571
+ return ret;
572
+ }
573
+ /**
574
+ * @param {Dir} dir
575
+ * @param {DirColor} color
576
+ * @returns {Promise<Dir>}
577
+ */
578
+ setDirColor(dir, color) {
579
+ const ret = wasm.client_setDirColor(this.__wbg_ptr, dir, color);
580
+ return ret;
581
+ }
582
+ /**
583
+ * @param {Dir} dir
584
+ * @param {DirectoryMetaChanges} changes
585
+ * @returns {Promise<Dir>}
586
+ */
587
+ updateDirMetadata(dir, changes) {
588
+ const ret = wasm.client_updateDirMetadata(this.__wbg_ptr, dir, changes);
589
+ return ret;
590
+ }
591
+ /**
592
+ * @param {AnyDirEnum} parent
593
+ * @param {string} name
594
+ * @returns {Promise<void>}
595
+ */
596
+ dirExists(parent, name) {
597
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
598
+ const len0 = WASM_VECTOR_LEN;
599
+ const ret = wasm.client_dirExists(this.__wbg_ptr, parent, ptr0, len0);
600
+ return ret;
601
+ }
602
+ /**
603
+ * @param {AnyDirEnum} dir
604
+ * @param {string} nameOrUuid
605
+ * @returns {Promise<NonRootItemTagged | undefined>}
606
+ */
607
+ findItemInDir(dir, nameOrUuid) {
608
+ const ptr0 = passStringToWasm0(nameOrUuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
609
+ const len0 = WASM_VECTOR_LEN;
610
+ const ret = wasm.client_findItemInDir(this.__wbg_ptr, dir, ptr0, len0);
611
+ return ret;
612
+ }
613
+ /**
614
+ * @param {Dir} dir
615
+ * @returns {Promise<void>}
616
+ */
617
+ deleteDirPermanently(dir) {
618
+ const ret = wasm.client_deleteDirPermanently(this.__wbg_ptr, dir);
619
+ return ret;
620
+ }
621
+ /**
622
+ * @param {DirEnum} parent
623
+ * @param {string} name
624
+ * @returns {Promise<Dir>}
625
+ */
626
+ createDir(parent, name) {
627
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
628
+ const len0 = WASM_VECTOR_LEN;
629
+ const ret = wasm.client_createDir(this.__wbg_ptr, parent, ptr0, len0);
630
+ return ret;
631
+ }
632
+ /**
633
+ * @param {DirEnum} dir
634
+ * @returns {[Dir[], File[]]}
635
+ */
636
+ listDir(dir) {
637
+ const ret = wasm.client_listDir(this.__wbg_ptr, dir);
638
+ return ret;
639
+ }
640
+ /**
641
+ * @returns {[Dir[], File[]]}
642
+ */
643
+ listRecents() {
644
+ const ret = wasm.client_listRecents(this.__wbg_ptr);
645
+ return ret;
646
+ }
647
+ /**
648
+ * @param {string} uuid
649
+ * @returns {Promise<Dir>}
419
650
  */
420
- getDirLinkStatus(dir) {
421
- const ret = wasm.client_getDirLinkStatus(this.__wbg_ptr, dir);
651
+ getDir(uuid) {
652
+ const ptr0 = passStringToWasm0(uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
653
+ const len0 = WASM_VECTOR_LEN;
654
+ const ret = wasm.client_getDir(this.__wbg_ptr, ptr0, len0);
422
655
  return ret;
423
656
  }
424
657
  /**
425
- * @param {string} link_uuid
426
- * @param {bigint} receiver_id
427
- * @returns {Promise<void>}
658
+ * @returns {Root}
428
659
  */
429
- removeSharedLinkOut(link_uuid, receiver_id) {
430
- const ptr0 = passStringToWasm0(link_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
431
- const len0 = WASM_VECTOR_LEN;
432
- const ret = wasm.client_removeSharedLinkOut(this.__wbg_ptr, ptr0, len0, receiver_id);
660
+ root() {
661
+ const ret = wasm.client_root(this.__wbg_ptr);
433
662
  return ret;
434
663
  }
435
664
  /**
436
- * @returns {BlockedContact[]}
665
+ * @param {AnyDirEnumWithShareInfo} dir
666
+ * @returns {Promise<DirSizeResponse>}
437
667
  */
438
- getBlockedContacts() {
439
- const ret = wasm.client_getBlockedContacts(this.__wbg_ptr);
668
+ getDirSize(dir) {
669
+ const ret = wasm.client_getDirSize(this.__wbg_ptr, dir);
440
670
  return ret;
441
671
  }
442
672
  /**
443
- * @param {string} contact_uuid
444
- * @returns {Promise<void>}
673
+ * @param {string | null} [title]
674
+ * @returns {Promise<Note>}
445
675
  */
446
- unblockContact(contact_uuid) {
447
- const ptr0 = passStringToWasm0(contact_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
448
- const len0 = WASM_VECTOR_LEN;
449
- const ret = wasm.client_unblockContact(this.__wbg_ptr, ptr0, len0);
676
+ createNote(title) {
677
+ var ptr0 = isLikeNone(title) ? 0 : passStringToWasm0(title, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
678
+ var len0 = WASM_VECTOR_LEN;
679
+ const ret = wasm.client_createNote(this.__wbg_ptr, ptr0, len0);
450
680
  return ret;
451
681
  }
452
682
  /**
453
- * @param {DirWithMetaEnum | null} [dir]
454
- * @param {Contact | null} [contact]
455
- * @returns {[SharedDirectory[], SharedFile[]]}
683
+ * @param {Note} note
684
+ * @returns {Promise<Note>}
456
685
  */
457
- listOutShared(dir, contact) {
458
- const ret = wasm.client_listOutShared(this.__wbg_ptr, isLikeNone(dir) ? 0 : addToExternrefTable0(dir), isLikeNone(contact) ? 0 : addToExternrefTable0(contact));
686
+ trashNote(note) {
687
+ const ret = wasm.client_trashNote(this.__wbg_ptr, note);
459
688
  return ret;
460
689
  }
461
690
  /**
462
- * @param {File} file
463
- * @param {FilePublicLink} link
464
- * @returns {Promise<void>}
691
+ * @param {Note} note
692
+ * @param {string} new_title
693
+ * @returns {Promise<Note>}
465
694
  */
466
- updateFileLink(file, link) {
467
- const ret = wasm.client_updateFileLink(this.__wbg_ptr, file, link);
695
+ setNoteTitle(note, new_title) {
696
+ const ptr0 = passStringToWasm0(new_title, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
697
+ const len0 = WASM_VECTOR_LEN;
698
+ const ret = wasm.client_setNoteTitle(this.__wbg_ptr, note, ptr0, len0);
468
699
  return ret;
469
700
  }
470
701
  /**
471
- * @param {string} contact_uuid
472
- * @returns {Promise<void>}
702
+ * @param {Note} note
703
+ * @returns {Promise<string | undefined>}
473
704
  */
474
- deleteContact(contact_uuid) {
475
- const ptr0 = passStringToWasm0(contact_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
476
- const len0 = WASM_VECTOR_LEN;
477
- const ret = wasm.client_deleteContact(this.__wbg_ptr, ptr0, len0);
705
+ getNoteContent(note) {
706
+ const ret = wasm.client_getNoteContent(this.__wbg_ptr, note);
478
707
  return ret;
479
708
  }
480
709
  /**
481
- * @param {File} file
482
- * @returns {Promise<FilePublicLink | undefined>}
710
+ * @param {Note} note
711
+ * @param {NoteType} note_type
712
+ * @param {string | null} [known_content]
713
+ * @returns {Promise<Note>}
483
714
  */
484
- getFileLinkStatus(file) {
485
- const ret = wasm.client_getFileLinkStatus(this.__wbg_ptr, file);
715
+ setNoteType(note, note_type, known_content) {
716
+ var ptr0 = isLikeNone(known_content) ? 0 : passStringToWasm0(known_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
717
+ var len0 = WASM_VECTOR_LEN;
718
+ const ret = wasm.client_setNoteType(this.__wbg_ptr, note, note_type, ptr0, len0);
486
719
  return ret;
487
720
  }
488
721
  /**
489
- * @param {string} link_uuid
490
- * @returns {Promise<void>}
722
+ * @param {Note} note
723
+ * @returns {Promise<DuplicateNoteResponse>}
491
724
  */
492
- removeSharedLinkIn(link_uuid) {
493
- const ptr0 = passStringToWasm0(link_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
494
- const len0 = WASM_VECTOR_LEN;
495
- const ret = wasm.client_removeSharedLinkIn(this.__wbg_ptr, ptr0, len0);
725
+ duplicateNote(note) {
726
+ const ret = wasm.client_duplicateNote(this.__wbg_ptr, note);
496
727
  return ret;
497
728
  }
498
729
  /**
499
- * @param {string} contact_uuid
500
- * @returns {Promise<void>}
730
+ * @param {Note} note
731
+ * @param {boolean} pinned
732
+ * @returns {Promise<Note>}
501
733
  */
502
- denyContactRequest(contact_uuid) {
503
- const ptr0 = passStringToWasm0(contact_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
504
- const len0 = WASM_VECTOR_LEN;
505
- const ret = wasm.client_denyContactRequest(this.__wbg_ptr, ptr0, len0);
734
+ setNotePinned(note, pinned) {
735
+ const ret = wasm.client_setNotePinned(this.__wbg_ptr, note, pinned);
506
736
  return ret;
507
737
  }
508
738
  /**
509
- * @param {DirWithMetaEnum | null} [dir]
510
- * @returns {[SharedDirectory[], SharedFile[]]}
739
+ * @param {Note} note
740
+ * @param {NoteTag} tag
741
+ * @returns {[Note, NoteTag]}
511
742
  */
512
- listInShared(dir) {
513
- const ret = wasm.client_listInShared(this.__wbg_ptr, isLikeNone(dir) ? 0 : addToExternrefTable0(dir));
743
+ addTagToNote(note, tag) {
744
+ const ret = wasm.client_addTagToNote(this.__wbg_ptr, note, tag);
514
745
  return ret;
515
746
  }
516
747
  /**
517
- * @returns {Contact[]}
748
+ * @param {string} note_uuid
749
+ * @returns {Promise<Note | undefined>}
518
750
  */
519
- getContacts() {
520
- const ret = wasm.client_getContacts(this.__wbg_ptr);
751
+ getNote(note_uuid) {
752
+ const ptr0 = passStringToWasm0(note_uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
753
+ const len0 = WASM_VECTOR_LEN;
754
+ const ret = wasm.client_getNote(this.__wbg_ptr, ptr0, len0);
521
755
  return ret;
522
756
  }
523
757
  /**
524
- * @param {DirWithMetaEnum} dir
525
- * @param {DirPublicLink} link
526
- * @returns {[Dir[], File[]]}
758
+ * @param {Note} note
759
+ * @param {Contact} contact
760
+ * @param {boolean} write
761
+ * @returns {Promise<Note>}
527
762
  */
528
- listLinkedDir(dir, link) {
529
- const ret = wasm.client_listLinkedDir(this.__wbg_ptr, dir, link);
763
+ setNoteParticipantPermission(note, contact, write) {
764
+ const ret = wasm.client_setNoteParticipantPermission(this.__wbg_ptr, note, contact, write);
530
765
  return ret;
531
766
  }
532
767
  /**
533
- * @param {string} email
534
- * @returns {Promise<string>}
768
+ * @param {Note} note
769
+ * @param {Contact} contact
770
+ * @returns {Promise<Note>}
535
771
  */
536
- sendContactRequest(email) {
537
- const ptr0 = passStringToWasm0(email, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
538
- const len0 = WASM_VECTOR_LEN;
539
- const ret = wasm.client_sendContactRequest(this.__wbg_ptr, ptr0, len0);
772
+ removeNoteParticipant(note, contact) {
773
+ const ret = wasm.client_removeNoteParticipant(this.__wbg_ptr, note, contact);
540
774
  return ret;
541
775
  }
542
776
  /**
543
- * @param {File} file
544
- * @returns {Promise<FilePublicLink>}
777
+ * @param {Note} note
778
+ * @param {Contact} contact
779
+ * @param {boolean} write
780
+ * @returns {Promise<Note>}
545
781
  */
546
- publicLinkFile(file) {
547
- const ret = wasm.client_publicLinkFile(this.__wbg_ptr, file);
782
+ addNoteParticipant(note, contact, write) {
783
+ const ret = wasm.client_addNoteParticipant(this.__wbg_ptr, note, contact, write);
548
784
  return ret;
549
785
  }
550
786
  /**
551
- * @param {Dir} dir
552
- * @param {DirColor} color
553
- * @returns {Promise<Dir>}
787
+ * @param {Note} note
788
+ * @param {boolean} favorite
789
+ * @returns {Promise<Note>}
554
790
  */
555
- setDirColor(dir, color) {
556
- const ret = wasm.client_setDirColor(this.__wbg_ptr, dir, color);
791
+ setNoteFavorited(note, favorite) {
792
+ const ret = wasm.client_setNoteFavorited(this.__wbg_ptr, note, favorite);
557
793
  return ret;
558
794
  }
559
795
  /**
560
- * @returns {Root}
796
+ * @param {Note} note
797
+ * @param {string} new_content
798
+ * @param {string} new_preview
799
+ * @returns {Promise<Note>}
561
800
  */
562
- root() {
563
- const ret = wasm.client_root(this.__wbg_ptr);
801
+ setNoteContent(note, new_content, new_preview) {
802
+ const ptr0 = passStringToWasm0(new_content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
803
+ const len0 = WASM_VECTOR_LEN;
804
+ const ptr1 = passStringToWasm0(new_preview, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
805
+ const len1 = WASM_VECTOR_LEN;
806
+ const ret = wasm.client_setNoteContent(this.__wbg_ptr, note, ptr0, len0, ptr1, len1);
564
807
  return ret;
565
808
  }
566
809
  /**
567
- * @param {DirEnum} parent
568
810
  * @param {string} name
569
- * @returns {Promise<Dir>}
811
+ * @returns {Promise<NoteTag>}
570
812
  */
571
- createDir(parent, name) {
813
+ createNoteTag(name) {
572
814
  const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
573
815
  const len0 = WASM_VECTOR_LEN;
574
- const ret = wasm.client_createDir(this.__wbg_ptr, parent, ptr0, len0);
816
+ const ret = wasm.client_createNoteTag(this.__wbg_ptr, ptr0, len0);
575
817
  return ret;
576
818
  }
577
819
  /**
578
- * @returns {[Dir[], File[]]}
820
+ * @param {Note} note
821
+ * @returns {Promise<Note>}
579
822
  */
580
- listFavorites() {
581
- const ret = wasm.client_listFavorites(this.__wbg_ptr);
823
+ archiveNote(note) {
824
+ const ret = wasm.client_archiveNote(this.__wbg_ptr, note);
582
825
  return ret;
583
826
  }
584
827
  /**
585
- * @returns {[Dir[], File[]]}
828
+ * @returns {Promise<NoteTag[]>}
586
829
  */
587
- listRecents() {
588
- const ret = wasm.client_listRecents(this.__wbg_ptr);
830
+ listNoteTags() {
831
+ const ret = wasm.client_listNoteTags(this.__wbg_ptr);
589
832
  return ret;
590
833
  }
591
834
  /**
592
- * @param {Dir} dir
593
- * @returns {Promise<Dir>}
835
+ * @param {NoteTag} tag
836
+ * @param {boolean} favorite
837
+ * @returns {Promise<NoteTag>}
594
838
  */
595
- trashDir(dir) {
596
- const ret = wasm.client_trashDir(this.__wbg_ptr, dir);
839
+ setNoteTagFavorited(tag, favorite) {
840
+ const ret = wasm.client_setNoteTagFavorited(this.__wbg_ptr, tag, favorite);
597
841
  return ret;
598
842
  }
599
843
  /**
600
- * @param {Dir} dir
601
- * @returns {Promise<void>}
844
+ * @param {Note} note
845
+ * @param {NoteTag} tag
846
+ * @returns {Promise<Note>}
602
847
  */
603
- deleteDirPermanently(dir) {
604
- const ret = wasm.client_deleteDirPermanently(this.__wbg_ptr, dir);
848
+ removeTagFromNote(note, tag) {
849
+ const ret = wasm.client_removeTagFromNote(this.__wbg_ptr, note, tag);
605
850
  return ret;
606
851
  }
607
852
  /**
608
- * @param {string} uuid
609
- * @returns {Promise<Dir>}
853
+ * @param {NoteTag} tag
854
+ * @param {string} new_name
855
+ * @returns {Promise<NoteTag>}
610
856
  */
611
- getDir(uuid) {
612
- const ptr0 = passStringToWasm0(uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
857
+ renameNoteTag(tag, new_name) {
858
+ const ptr0 = passStringToWasm0(new_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
613
859
  const len0 = WASM_VECTOR_LEN;
614
- const ret = wasm.client_getDir(this.__wbg_ptr, ptr0, len0);
860
+ const ret = wasm.client_renameNoteTag(this.__wbg_ptr, tag, ptr0, len0);
615
861
  return ret;
616
862
  }
617
863
  /**
618
- * @param {AnyDirEnum} parent
619
- * @param {string} name
864
+ * @param {NoteTag} tag
620
865
  * @returns {Promise<void>}
621
866
  */
622
- dirExists(parent, name) {
623
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
624
- const len0 = WASM_VECTOR_LEN;
625
- const ret = wasm.client_dirExists(this.__wbg_ptr, parent, ptr0, len0);
867
+ deleteNoteTag(tag) {
868
+ const ret = wasm.client_deleteNoteTag(this.__wbg_ptr, tag);
626
869
  return ret;
627
870
  }
628
871
  /**
629
- * @param {AnyDirEnum} dir
630
- * @param {string} nameOrUuid
631
- * @returns {Promise<NonRootItemTagged | undefined>}
872
+ * @returns {Promise<Note[]>}
632
873
  */
633
- findItemInDir(dir, nameOrUuid) {
634
- const ptr0 = passStringToWasm0(nameOrUuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
635
- const len0 = WASM_VECTOR_LEN;
636
- const ret = wasm.client_findItemInDir(this.__wbg_ptr, dir, ptr0, len0);
874
+ listNotes() {
875
+ const ret = wasm.client_listNotes(this.__wbg_ptr);
637
876
  return ret;
638
877
  }
639
878
  /**
640
- * @param {DirEnum} dir
641
- * @returns {[Dir[], File[]]}
879
+ * @param {Note} note
880
+ * @param {NoteHistory} history
881
+ * @returns {Promise<Note>}
642
882
  */
643
- listDir(dir) {
644
- const ret = wasm.client_listDir(this.__wbg_ptr, dir);
883
+ restoreNoteFromHistory(note, history) {
884
+ const ret = wasm.client_restoreNoteFromHistory(this.__wbg_ptr, note, history);
645
885
  return ret;
646
886
  }
647
887
  /**
648
- * @param {Dir} dir
649
- * @param {DirectoryMetaChanges} changes
650
- * @returns {Promise<Dir>}
888
+ * @param {Note} note
889
+ * @returns {Promise<Note>}
651
890
  */
652
- updateDirMetadata(dir, changes) {
653
- const ret = wasm.client_updateDirMetadata(this.__wbg_ptr, dir, changes);
891
+ restoreNote(note) {
892
+ const ret = wasm.client_restoreNote(this.__wbg_ptr, note);
654
893
  return ret;
655
894
  }
656
895
  /**
657
- * @param {DirEnum} dir
658
- * @returns {[Dir[], File[]]}
896
+ * @param {Note} note
897
+ * @returns {Promise<void>}
659
898
  */
660
- listDirRecursive(dir) {
661
- const ret = wasm.client_listDirRecursive(this.__wbg_ptr, dir);
899
+ deleteNote(note) {
900
+ const ret = wasm.client_deleteNote(this.__wbg_ptr, note);
662
901
  return ret;
663
902
  }
664
903
  /**
665
- * @param {AnyDirEnumWithShareInfo} dir
666
- * @returns {Promise<DirSizeResponse>}
904
+ * @param {Note} note
905
+ * @returns {Promise<NoteHistory[]>}
667
906
  */
668
- getDirSize(dir) {
669
- const ret = wasm.client_getDirSize(this.__wbg_ptr, dir);
907
+ getNoteHistory(note) {
908
+ const ret = wasm.client_getNoteHistory(this.__wbg_ptr, note);
670
909
  return ret;
671
910
  }
672
911
  /**
@@ -680,11 +919,22 @@ export class Client {
680
919
  return ret;
681
920
  }
682
921
  /**
683
- * @param {FileEnum} file
684
- * @returns {Promise<Uint8Array>}
922
+ * @param {Uint8Array} data
923
+ * @param {UploadFileParams} params
924
+ * @returns {Promise<File>}
685
925
  */
686
- downloadFile(file) {
687
- const ret = wasm.client_downloadFile(this.__wbg_ptr, file);
926
+ uploadFile(data, params) {
927
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
928
+ const len0 = WASM_VECTOR_LEN;
929
+ const ret = wasm.client_uploadFile(this.__wbg_ptr, ptr0, len0, params);
930
+ return ret;
931
+ }
932
+ /**
933
+ * @param {File} file
934
+ * @returns {Promise<File>}
935
+ */
936
+ trashFile(file) {
937
+ const ret = wasm.client_trashFile(this.__wbg_ptr, file);
688
938
  return ret;
689
939
  }
690
940
  /**
@@ -695,6 +945,14 @@ export class Client {
695
945
  const ret = wasm.client_deleteFilePermanently(this.__wbg_ptr, file);
696
946
  return ret;
697
947
  }
948
+ /**
949
+ * @param {DownloadFileStreamParams} params
950
+ * @returns {Promise<void>}
951
+ */
952
+ downloadFileToWriter(params) {
953
+ const ret = wasm.client_downloadFileToWriter(this.__wbg_ptr, params);
954
+ return ret;
955
+ }
698
956
  /**
699
957
  * @param {File} file
700
958
  * @param {FileMetaChanges} changes
@@ -704,6 +962,14 @@ export class Client {
704
962
  const ret = wasm.client_updateFileMetadata(this.__wbg_ptr, file, changes);
705
963
  return ret;
706
964
  }
965
+ /**
966
+ * @param {FileEnum} file
967
+ * @returns {Promise<Uint8Array>}
968
+ */
969
+ downloadFile(file) {
970
+ const ret = wasm.client_downloadFile(this.__wbg_ptr, file);
971
+ return ret;
972
+ }
707
973
  /**
708
974
  * @param {string} uuid
709
975
  * @returns {Promise<File>}
@@ -714,22 +980,6 @@ export class Client {
714
980
  const ret = wasm.client_getFile(this.__wbg_ptr, ptr0, len0);
715
981
  return ret;
716
982
  }
717
- /**
718
- * @param {DownloadFileStreamParams} params
719
- * @returns {Promise<void>}
720
- */
721
- downloadFileToWriter(params) {
722
- const ret = wasm.client_downloadFileToWriter(this.__wbg_ptr, params);
723
- return ret;
724
- }
725
- /**
726
- * @param {File} file
727
- * @returns {Promise<File>}
728
- */
729
- trashFile(file) {
730
- const ret = wasm.client_trashFile(this.__wbg_ptr, file);
731
- return ret;
732
- }
733
983
  /**
734
984
  * @param {UploadFileStreamParams} params
735
985
  * @returns {Promise<File>}
@@ -738,17 +988,6 @@ export class Client {
738
988
  const ret = wasm.client_uploadFileFromReader(this.__wbg_ptr, params);
739
989
  return ret;
740
990
  }
741
- /**
742
- * @param {Uint8Array} data
743
- * @param {UploadFileParams} params
744
- * @returns {Promise<File>}
745
- */
746
- uploadFile(data, params) {
747
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
748
- const len0 = WASM_VECTOR_LEN;
749
- const ret = wasm.client_uploadFile(this.__wbg_ptr, ptr0, len0, params);
750
- return ret;
751
- }
752
991
  /**
753
992
  * @param {NonRootItem} item
754
993
  * @param {boolean} favorited
@@ -911,15 +1150,6 @@ export class PauseSignal {
911
1150
  const ptr = this.__destroy_into_raw();
912
1151
  wasm.__wbg_pausesignal_free(ptr, 0);
913
1152
  }
914
- resume() {
915
- wasm.pausesignal_resume(this.__wbg_ptr);
916
- }
917
- constructor() {
918
- const ret = wasm.pausesignal_new();
919
- this.__wbg_ptr = ret >>> 0;
920
- PauseSignalFinalization.register(this, this.__wbg_ptr, this);
921
- return this;
922
- }
923
1153
  /**
924
1154
  * @returns {boolean}
925
1155
  */
@@ -930,6 +1160,15 @@ export class PauseSignal {
930
1160
  pause() {
931
1161
  wasm.pausesignal_pause(this.__wbg_ptr);
932
1162
  }
1163
+ constructor() {
1164
+ const ret = wasm.pausesignal_new();
1165
+ this.__wbg_ptr = ret >>> 0;
1166
+ PauseSignalFinalization.register(this, this.__wbg_ptr, this);
1167
+ return this;
1168
+ }
1169
+ resume() {
1170
+ wasm.pausesignal_resume(this.__wbg_ptr);
1171
+ }
933
1172
  }
934
1173
 
935
1174
  const ResourceLockFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -957,13 +1196,6 @@ export class ResourceLock {
957
1196
  const ptr = this.__destroy_into_raw();
958
1197
  wasm.__wbg_resourcelock_free(ptr, 0);
959
1198
  }
960
- /**
961
- * Utility function to be able to immediately drop the lock from JS
962
- */
963
- drop() {
964
- const ptr = this.__destroy_into_raw();
965
- wasm.resourcelock_drop(ptr);
966
- }
967
1199
  /**
968
1200
  * The resource this lock is for
969
1201
  * @returns {string}
@@ -980,6 +1212,13 @@ export class ResourceLock {
980
1212
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
981
1213
  }
982
1214
  }
1215
+ /**
1216
+ * Utility function to be able to immediately drop the lock from JS
1217
+ */
1218
+ drop() {
1219
+ const ptr = this.__destroy_into_raw();
1220
+ wasm.resourcelock_drop(ptr);
1221
+ }
983
1222
  }
984
1223
 
985
1224
  async function __wbg_load(module, imports) {
@@ -1064,6 +1303,10 @@ function __wbg_get_imports() {
1064
1303
  const ret = arg0.byteOffset;
1065
1304
  return ret;
1066
1305
  };
1306
+ imports.wbg.__wbg_call_4a62ab20d860e9df = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
1307
+ const ret = arg0.call(arg1, arg2, arg3, arg4, arg5);
1308
+ return ret;
1309
+ }, arguments) };
1067
1310
  imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
1068
1311
  const ret = arg0.call(arg1);
1069
1312
  return ret;
@@ -1072,10 +1315,6 @@ function __wbg_get_imports() {
1072
1315
  const ret = arg0.call(arg1, arg2);
1073
1316
  return ret;
1074
1317
  }, arguments) };
1075
- imports.wbg.__wbg_call_a091c2894d4a4ac1 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
1076
- const ret = arg0.call(arg1, arg2, arg3, arg4, arg5);
1077
- return ret;
1078
- }, arguments) };
1079
1318
  imports.wbg.__wbg_cancel_81ebaa65c2a54d20 = function(arg0) {
1080
1319
  const ret = arg0.cancel();
1081
1320
  return ret;
@@ -1318,7 +1557,7 @@ function __wbg_get_imports() {
1318
1557
  const a = state0.a;
1319
1558
  state0.a = 0;
1320
1559
  try {
1321
- return __wbg_adapter_326(a, state0.b, arg0, arg1);
1560
+ return __wbg_adapter_352(a, state0.b, arg0, arg1);
1322
1561
  } finally {
1323
1562
  state0.a = a;
1324
1563
  }
@@ -1600,16 +1839,16 @@ function __wbg_get_imports() {
1600
1839
  const ret = false;
1601
1840
  return ret;
1602
1841
  };
1603
- imports.wbg.__wbindgen_closure_wrapper3419 = function(arg0, arg1, arg2) {
1604
- const ret = makeMutClosure(arg0, arg1, 690, __wbg_adapter_60);
1842
+ imports.wbg.__wbindgen_closure_wrapper4021 = function(arg0, arg1, arg2) {
1843
+ const ret = makeMutClosure(arg0, arg1, 813, __wbg_adapter_60);
1605
1844
  return ret;
1606
1845
  };
1607
- imports.wbg.__wbindgen_closure_wrapper5141 = function(arg0, arg1, arg2) {
1608
- const ret = makeMutClosure(arg0, arg1, 1118, __wbg_adapter_63);
1846
+ imports.wbg.__wbindgen_closure_wrapper5744 = function(arg0, arg1, arg2) {
1847
+ const ret = makeMutClosure(arg0, arg1, 1240, __wbg_adapter_63);
1609
1848
  return ret;
1610
1849
  };
1611
- imports.wbg.__wbindgen_closure_wrapper5308 = function(arg0, arg1, arg2) {
1612
- const ret = makeMutClosure(arg0, arg1, 1186, __wbg_adapter_66);
1850
+ imports.wbg.__wbindgen_closure_wrapper5911 = function(arg0, arg1, arg2) {
1851
+ const ret = makeMutClosure(arg0, arg1, 1308, __wbg_adapter_66);
1613
1852
  return ret;
1614
1853
  };
1615
1854
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {