cozy-sharing 28.4.4 → 28.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/SharingProvider.js +296 -66
  3. package/dist/SharingProvider.spec.js +332 -2
  4. package/dist/components/FederatedFolder/DumbFederatedFolderModal.js +7 -4
  5. package/dist/components/FederatedFolder/FederatedFolderModal.js +79 -23
  6. package/dist/components/Recipient/LinkRecipient.js +6 -3
  7. package/dist/components/Recipient/LinkRecipient.stories.js +0 -1
  8. package/dist/components/Recipient/MemberRecipient.spec.js +13 -0
  9. package/dist/components/Recipient/MemberRecipientPermissions.js +80 -20
  10. package/dist/components/Recipient/MemberRecipientPermissions.spec.js +214 -0
  11. package/dist/components/Recipient/actions/setReadOnlySharedPermission.js +0 -1
  12. package/dist/components/Recipient/actions/setReadOnlySharedPermission.spec.js +72 -0
  13. package/dist/components/Recipient/actions/setReadWriteSharedPermission.js +0 -1
  14. package/dist/components/Recipient/actions/setReadWriteSharedPermission.spec.js +72 -0
  15. package/dist/components/ShareByLink.js +5 -1
  16. package/dist/components/ShareDialogCozyToCozy.spec.js +9 -0
  17. package/dist/components/ShareRestrictionModal/helpers.js +66 -29
  18. package/dist/components/SharedDrive/DumbSharedDriveModal.js +1 -1
  19. package/dist/components/SharedFolder/DumbBatchSharedFolderModal.js +17 -4
  20. package/dist/components/WhoHasAccess.js +0 -1
  21. package/dist/helpers/shortcodes.js +24 -0
  22. package/dist/state.js +3 -10
  23. package/locales/en.json +4 -1
  24. package/locales/fr.json +4 -1
  25. package/locales/ru.json +4 -1
  26. package/locales/vi.json +4 -1
  27. package/package.json +4 -4
  28. package/src/SharingProvider.jsx +128 -9
  29. package/src/SharingProvider.spec.jsx +224 -1
  30. package/src/components/FederatedFolder/DumbFederatedFolderModal.jsx +6 -3
  31. package/src/components/FederatedFolder/FederatedFolderModal.jsx +39 -6
  32. package/src/components/Recipient/LinkRecipient.jsx +10 -4
  33. package/src/components/Recipient/LinkRecipient.stories.jsx +0 -1
  34. package/src/components/Recipient/MemberRecipient.spec.jsx +11 -0
  35. package/src/components/Recipient/MemberRecipientPermissions.jsx +69 -16
  36. package/src/components/Recipient/MemberRecipientPermissions.spec.jsx +165 -0
  37. package/src/components/Recipient/actions/setReadOnlySharedPermission.js +1 -1
  38. package/src/components/Recipient/actions/setReadOnlySharedPermission.spec.jsx +95 -0
  39. package/src/components/Recipient/actions/setReadWriteSharedPermission.js +1 -1
  40. package/src/components/Recipient/actions/setReadWriteSharedPermission.spec.jsx +95 -0
  41. package/src/components/ShareByLink.jsx +3 -1
  42. package/src/components/ShareDialogCozyToCozy.spec.jsx +6 -0
  43. package/src/components/ShareRestrictionModal/helpers.js +42 -4
  44. package/src/components/SharedDrive/DumbSharedDriveModal.jsx +1 -1
  45. package/src/components/SharedFolder/DumbBatchSharedFolderModal.jsx +32 -16
  46. package/src/components/WhoHasAccess.jsx +0 -1
  47. package/src/helpers/shortcodes.js +28 -0
  48. package/src/state.js +3 -14
package/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [28.6.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@28.5.0...cozy-sharing@28.6.0) (2026-03-11)
7
+
8
+ ### Features
9
+
10
+ - Add ability to change member permission type in sharing ([76d0dce](https://github.com/cozy/cozy-libs/commit/76d0dce150d8ea7ac7cb12c6e00b340756b6512a))
11
+ - Hide link text in link recipient ([209857f](https://github.com/cozy/cozy-libs/commit/209857fcf01b71e584e49ef8ab3da4a897d408ed))
12
+ - Remove link prop from LinkRecipient component ([7bbf831](https://github.com/cozy/cozy-libs/commit/7bbf831594d7c33357ade79665f4308fd35e2b8e))
13
+
14
+ # [28.5.0](https://github.com/cozy/cozy-libs/compare/cozy-sharing@28.4.4...cozy-sharing@28.5.0) (2026-03-10)
15
+
16
+ ### Bug Fixes
17
+
18
+ - Make sharingDesc prop optional with default empty string ([538eaa6](https://github.com/cozy/cozy-libs/commit/538eaa61988405be4225a6147fad17805b218e30))
19
+
20
+ ### Features
21
+
22
+ - Allow to share a shared drive file by link ([a78e796](https://github.com/cozy/cozy-libs/commit/a78e7963af05b6815856246a722542acee2d900f))
23
+
6
24
  ## [28.4.4](https://github.com/cozy/cozy-libs/compare/cozy-sharing@28.4.3...cozy-sharing@28.4.4) (2026-03-09)
7
25
 
8
26
  **Note:** Version bump only for package cozy-sharing
@@ -33,13 +33,15 @@ function _callSuper(_this, derived, args) {
33
33
  import React, { Component } from 'react';
34
34
  import { withClient } from 'cozy-client';
35
35
  import minilog from 'cozy-minilog';
36
+ import { generateShareLinkFromFile } from './components/ShareRestrictionModal/helpers';
36
37
  import SharingContext from './context';
37
38
  import { fetchNextPermissions } from './fetchNextPermissions';
38
39
  import { fetchFilesPaths } from './helpers/files';
39
40
  import { getSharingObject, createSharingInStore, updateSharingInStore } from './helpers/sharings';
41
+ import { getShortcode } from './helpers/shortcodes';
40
42
  import { SynchronousJobQueue } from './helpers/synchronousJobQueue';
41
43
  import { fetchApps } from './queries/queries';
42
- import reducer, { receiveSharings, addSharing, updateSharing, addSharingLink, updateSharingLink, revokeSharingLink, revokeRecipient, revokeGroup as revokeGroupFromState, revokeSelf, receivePaths, isOwner as _isOwner, isSharedDrive as _isSharedDrive, canReshare as _canReshare, getOwner as _getOwner, getRecipients as _getRecipients, getSharingById, getExternalSharingIds, getSharingForSelf as _getSharingForSelf, getSharingType as _getSharingType, getSharingLink as _getSharingLink, getSharedDocIdsBySharings, getDocumentSharing, getDocumentPermissions as _getDocumentPermissions, hasSharedParent as _hasSharedParent, hasSharedChild as _hasSharedChild, getSharedParentPath as _getSharedParentPath, getSharedDriveSharingType, SHARING_TYPE } from './state';
44
+ import reducer, { receiveSharings, addSharing, updateSharing, addSharingLink, updateSharingLink, revokeSharingLink, revokeRecipient, revokeGroup as revokeGroupFromState, revokeSelf, receivePaths, isOwner as _isOwner, isSharedDrive as _isSharedDrive, canReshare as _canReshare, getOwner as _getOwner, getRecipients as _getRecipients, getSharingById as _getSharingById, getExternalSharingIds, getSharingForSelf as _getSharingForSelf, getSharingType as _getSharingType, getSharingLink as _getSharingLink, getSharedDocIdsBySharings, getDocumentSharing, getDocumentPermissions as _getDocumentPermissions, hasSharedParent as _hasSharedParent, hasSharedChild as _hasSharedChild, getSharedParentPath as _getSharedParentPath, getSharedDriveSharingType, SHARING_TYPE } from './state';
43
45
  var log = minilog('SharingProvider');
44
46
  var SHARING_DOCTYPE = 'io.cozy.sharings';
45
47
  var PERMISSION_DOCTYPE = 'io.cozy.permissions';
@@ -87,7 +89,7 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
87
89
  while (1) switch (_context.prev = _context.next) {
88
90
  case 0:
89
91
  _this2$props = _this2.props, client = _this2$props.client, doctype = _this2$props.doctype;
90
- internalSharing = getSharingById(_this2.state, sharing._id);
92
+ internalSharing = _getSharingById(_this2.state, sharing._id);
91
93
  newSharing = getSharingObject(internalSharing, sharing);
92
94
 
93
95
  if (internalSharing) {
@@ -348,7 +350,7 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
348
350
  while (1) switch (_context7.prev = _context7.next) {
349
351
  case 0:
350
352
  _this2$props4 = _this2.props, client = _this2$props4.client, doctype = _this2$props4.doctype;
351
- sharing = getSharingById(_this2.state, sharingId);
353
+ sharing = _getSharingById(_this2.state, sharingId);
352
354
  _context7.next = 4;
353
355
  return _this2.sharingCol.revokeRecipient(sharing, recipientIndex);
354
356
 
@@ -396,7 +398,7 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
396
398
  while (1) switch (_context8.prev = _context8.next) {
397
399
  case 0:
398
400
  _this2$props5 = _this2.props, client = _this2$props5.client, doctype = _this2$props5.doctype;
399
- sharing = getSharingById(_this2.state, sharingId);
401
+ sharing = _getSharingById(_this2.state, sharingId);
400
402
  _context8.next = 4;
401
403
  return _this2.sharingCol.revokeGroup(sharing, recipientIndex);
402
404
 
@@ -461,31 +463,230 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
461
463
  };
462
464
  }());
463
465
 
464
- _defineProperty(_this2, "shareByLink", /*#__PURE__*/function () {
465
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(document, options) {
466
- var resp;
466
+ /**
467
+ * Update a sharing member's read_only field to change permission type
468
+ * @param {string} sharingId - The ID of the sharing
469
+ * @param {number} memberIndex - The index of the member in the sharing members array
470
+ * @param {string} newType - 'one-way' for read-only, 'two-way' for read-write
471
+ */
472
+ _defineProperty(_this2, "updateSharingMemberType", /*#__PURE__*/function () {
473
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(sharingId, memberIndex, newType) {
474
+ var sharing, member, matchedContacts, contact, readOnly;
467
475
  return _regeneratorRuntime.wrap(function _callee10$(_context10) {
468
476
  while (1) switch (_context10.prev = _context10.next) {
469
477
  case 0:
470
- _context10.next = 2;
478
+ sharing = _getSharingById(_this2.state, sharingId);
479
+
480
+ if (sharing) {
481
+ _context10.next = 3;
482
+ break;
483
+ }
484
+
485
+ throw new Error('Sharing not found');
486
+
487
+ case 3:
488
+ member = sharing.attributes.members[memberIndex];
489
+
490
+ if (member) {
491
+ _context10.next = 6;
492
+ break;
493
+ }
494
+
495
+ throw new Error('Member not found');
496
+
497
+ case 6:
498
+ _context10.next = 8;
499
+ return _this2.props.client.collection('io.cozy.contacts').find({
500
+ email: {
501
+ $elemMatch: {
502
+ address: member.email
503
+ }
504
+ },
505
+ _id: {
506
+ $gt: null
507
+ }
508
+ }, {
509
+ indexedFields: ['_id']
510
+ });
511
+
512
+ case 8:
513
+ matchedContacts = _context10.sent;
514
+
515
+ if (matchedContacts.data.length) {
516
+ _context10.next = 11;
517
+ break;
518
+ }
519
+
520
+ throw new Error("Contact not found for member ".concat(member.email));
521
+
522
+ case 11:
523
+ contact = matchedContacts.data[0]; // Revoke (API call only, no state dispatch to avoid UI flickering)
524
+
525
+ _context10.next = 14;
526
+ return _this2.sharingCol.revokeRecipient(sharing, memberIndex);
527
+
528
+ case 14:
529
+ // Re-add with the new permission type
530
+ readOnly = newType === 'one-way';
531
+ _context10.prev = 15;
532
+ _context10.next = 18;
533
+ return _this2.addRecipients({
534
+ document: sharing,
535
+ recipients: readOnly ? [] : [contact],
536
+ readOnlyRecipients: readOnly ? [contact] : []
537
+ });
538
+
539
+ case 18:
540
+ _context10.next = 24;
541
+ break;
542
+
543
+ case 20:
544
+ _context10.prev = 20;
545
+ _context10.t0 = _context10["catch"](15);
546
+ log.error("Failed to re-add member ".concat(member.email, " after revocation. The member has been revoked but could not be re-added with the new permission type."), _context10.t0);
547
+ throw _context10.t0;
548
+
549
+ case 24:
550
+ case "end":
551
+ return _context10.stop();
552
+ }
553
+ }, _callee10, null, [[15, 20]]);
554
+ }));
555
+
556
+ return function (_x16, _x17, _x18) {
557
+ return _ref12.apply(this, arguments);
558
+ };
559
+ }());
560
+
561
+ _defineProperty(_this2, "shareByLink", /*#__PURE__*/function () {
562
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(document, options) {
563
+ var resp;
564
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
565
+ while (1) switch (_context11.prev = _context11.next) {
566
+ case 0:
567
+ if (!document.driveId) {
568
+ _context11.next = 6;
569
+ break;
570
+ }
571
+
572
+ _context11.next = 3;
573
+ return _this2.createSharedDriveSharingLink(document, options);
574
+
575
+ case 3:
576
+ _context11.t0 = _context11.sent;
577
+ _context11.next = 9;
578
+ break;
579
+
580
+ case 6:
581
+ _context11.next = 8;
471
582
  return _this2.permissionCol.createSharingLink(document, options);
472
583
 
473
- case 2:
474
- resp = _context10.sent;
584
+ case 8:
585
+ _context11.t0 = _context11.sent;
586
+
587
+ case 9:
588
+ resp = _context11.t0;
475
589
 
476
590
  _this2.dispatch(addSharingLink(resp.data));
477
591
 
478
- return _context10.abrupt("return", resp);
592
+ return _context11.abrupt("return", resp);
593
+
594
+ case 12:
595
+ case "end":
596
+ return _context11.stop();
597
+ }
598
+ }, _callee11);
599
+ }));
600
+
601
+ return function (_x19, _x20) {
602
+ return _ref13.apply(this, arguments);
603
+ };
604
+ }());
605
+
606
+ _defineProperty(_this2, "getFederatedShareLink", function (document) {
607
+ if (!document.driveId) return null;
608
+
609
+ var permissions = _getDocumentPermissions(_this2.state, document._id);
610
+
611
+ var perm = permissions.find(function (p) {
612
+ return getShortcode(p);
613
+ });
614
+ if (!perm) return null;
615
+ var code = getShortcode(perm);
616
+ if (!code) return null;
617
+ var client = _this2.props.client;
618
+ return generateShareLinkFromFile({
619
+ client: client,
620
+ file: document,
621
+ sharecode: code,
622
+ getOwner: _this2.state.getOwner,
623
+ getSharingById: _this2.state.getSharingById,
624
+ documentType: _this2.state.documentType
625
+ });
626
+ });
627
+
628
+ _defineProperty(_this2, "createSharedDriveSharingLink", /*#__PURE__*/function () {
629
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(document, options) {
630
+ var client, drivePermissionCollection, resp;
631
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
632
+ while (1) switch (_context12.prev = _context12.next) {
633
+ case 0:
634
+ client = _this2.props.client;
635
+ drivePermissionCollection = client.collection('io.cozy.permissions', {
636
+ driveId: document.driveId
637
+ });
638
+ _context12.next = 4;
639
+ return drivePermissionCollection.createSharingLink(document, options);
640
+
641
+ case 4:
642
+ resp = _context12.sent;
643
+ return _context12.abrupt("return", resp);
644
+
645
+ case 6:
646
+ case "end":
647
+ return _context12.stop();
648
+ }
649
+ }, _callee12);
650
+ }));
651
+
652
+ return function (_x21, _x22) {
653
+ return _ref14.apply(this, arguments);
654
+ };
655
+ }());
656
+
657
+ _defineProperty(_this2, "updateSharedDrivePermissions", /*#__PURE__*/function () {
658
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(document, permissionDocument, updatedPermissions, options) {
659
+ var client, expiresAt, password, drivePermissionCollection, resp;
660
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
661
+ while (1) switch (_context13.prev = _context13.next) {
662
+ case 0:
663
+ client = _this2.props.client;
664
+ expiresAt = options.expiresAt, password = options.password;
665
+ drivePermissionCollection = client.collection('io.cozy.permissions', {
666
+ driveId: document.driveId
667
+ });
668
+ _context13.next = 5;
669
+ return drivePermissionCollection.add(permissionDocument, updatedPermissions, {
670
+ expiresAt: expiresAt,
671
+ password: password
672
+ });
479
673
 
480
674
  case 5:
675
+ resp = _context13.sent;
676
+
677
+ _this2.dispatch(updateSharingLink(resp.data));
678
+
679
+ return _context13.abrupt("return", resp);
680
+
681
+ case 8:
481
682
  case "end":
482
- return _context10.stop();
683
+ return _context13.stop();
483
684
  }
484
- }, _callee10);
685
+ }, _callee13);
485
686
  }));
486
687
 
487
- return function (_x16, _x17) {
488
- return _ref12.apply(this, arguments);
688
+ return function (_x23, _x24, _x25, _x26) {
689
+ return _ref15.apply(this, arguments);
489
690
  };
490
691
  }());
491
692
 
@@ -501,75 +702,99 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
501
702
  * @return {Array}
502
703
  */
503
704
  _defineProperty(_this2, "updateDocumentPermissions", /*#__PURE__*/function () {
504
- var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(document, options) {
705
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(document, options) {
505
706
  var verbs, expiresAt, password, permissions, responses;
506
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
507
- while (1) switch (_context12.prev = _context12.next) {
707
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
708
+ while (1) switch (_context15.prev = _context15.next) {
508
709
  case 0:
509
710
  verbs = options.verbs, expiresAt = options.expiresAt, password = options.password;
510
711
  permissions = _getDocumentPermissions(_this2.state, document.id);
511
- _context12.next = 4;
712
+
713
+ if (!(!permissions || permissions.length === 0)) {
714
+ _context15.next = 4;
715
+ break;
716
+ }
717
+
718
+ return _context15.abrupt("return", []);
719
+
720
+ case 4:
721
+ _context15.next = 6;
512
722
  return Promise.all(permissions.map( /*#__PURE__*/function () {
513
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(permissionDocument) {
723
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(permissionDocument) {
514
724
  var updatedPermissions, resp;
515
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
516
- while (1) switch (_context11.prev = _context11.next) {
725
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
726
+ while (1) switch (_context14.prev = _context14.next) {
517
727
  case 0:
518
728
  updatedPermissions = permissionDocument.attributes.permissions;
519
- Object.keys(updatedPermissions).map(function (permType) {
729
+ Object.keys(updatedPermissions).forEach(function (permType) {
520
730
  updatedPermissions[permType].verbs = verbs;
521
731
  });
522
- _context11.next = 4;
732
+
733
+ if (!document.driveId) {
734
+ _context14.next = 8;
735
+ break;
736
+ }
737
+
738
+ _context14.next = 5;
739
+ return _this2.updateSharedDrivePermissions(document, permissionDocument, updatedPermissions, options);
740
+
741
+ case 5:
742
+ _context14.t0 = _context14.sent;
743
+ _context14.next = 11;
744
+ break;
745
+
746
+ case 8:
747
+ _context14.next = 10;
523
748
  return _this2.permissionCol.add(permissionDocument, updatedPermissions, {
524
749
  expiresAt: expiresAt,
525
750
  password: password
526
751
  });
527
752
 
528
- case 4:
529
- resp = _context11.sent;
530
-
531
- _this2.dispatch(updateSharingLink(resp.data));
753
+ case 10:
754
+ _context14.t0 = _context14.sent;
532
755
 
533
- return _context11.abrupt("return", resp);
756
+ case 11:
757
+ resp = _context14.t0;
758
+ return _context14.abrupt("return", resp);
534
759
 
535
- case 7:
760
+ case 13:
536
761
  case "end":
537
- return _context11.stop();
762
+ return _context14.stop();
538
763
  }
539
- }, _callee11);
764
+ }, _callee14);
540
765
  }));
541
766
 
542
- return function (_x20) {
543
- return _ref14.apply(this, arguments);
767
+ return function (_x29) {
768
+ return _ref17.apply(this, arguments);
544
769
  };
545
770
  }()));
546
771
 
547
- case 4:
548
- responses = _context12.sent;
549
- return _context12.abrupt("return", responses);
550
-
551
772
  case 6:
773
+ responses = _context15.sent;
774
+ return _context15.abrupt("return", responses);
775
+
776
+ case 8:
552
777
  case "end":
553
- return _context12.stop();
778
+ return _context15.stop();
554
779
  }
555
- }, _callee12);
780
+ }, _callee15);
556
781
  }));
557
782
 
558
- return function (_x18, _x19) {
559
- return _ref13.apply(this, arguments);
783
+ return function (_x27, _x28) {
784
+ return _ref16.apply(this, arguments);
560
785
  };
561
786
  }());
562
787
 
563
788
  _defineProperty(_this2, "revokeSharingLink", /*#__PURE__*/function () {
564
- var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(document) {
789
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(document) {
565
790
  var perms;
566
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
567
- while (1) switch (_context13.prev = _context13.next) {
791
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
792
+ while (1) switch (_context16.prev = _context16.next) {
568
793
  case 0:
569
794
  // Because some duplicate links have been created in the past, we must ensure
570
795
  // we revoke all of them
571
796
  perms = _getDocumentPermissions(_this2.state, document.id);
572
- _context13.next = 3;
797
+ _context16.next = 3;
573
798
  return Promise.all(perms.map(function (p) {
574
799
  return _this2.permissionCol.destroy(p);
575
800
  }));
@@ -579,13 +804,13 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
579
804
 
580
805
  case 4:
581
806
  case "end":
582
- return _context13.stop();
807
+ return _context16.stop();
583
808
  }
584
- }, _callee13);
809
+ }, _callee16);
585
810
  }));
586
811
 
587
- return function (_x21) {
588
- return _ref15.apply(this, arguments);
812
+ return function (_x30) {
813
+ return _ref18.apply(this, arguments);
589
814
  };
590
815
  }());
591
816
 
@@ -634,6 +859,9 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
634
859
  getSharingType: function getSharingType(docId) {
635
860
  return _getSharingType(_this2.state, docId, _instanceUri);
636
861
  },
862
+ getSharingById: function getSharingById(docId) {
863
+ return _getSharingById(_this2.state, docId);
864
+ },
637
865
  getSharingForSelf: function getSharingForSelf(docId) {
638
866
  return _getSharingForSelf(_this2.state, docId);
639
867
  },
@@ -661,6 +889,7 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
661
889
  revokeGroup: _this2.revokeGroup,
662
890
  revokeSelf: _this2.revokeSelf,
663
891
  shareByLink: _this2.shareByLink,
892
+ getFederatedShareLink: _this2.getFederatedShareLink,
664
893
  updateDocumentPermissions: _this2.updateDocumentPermissions,
665
894
  revokeSharingLink: _this2.revokeSharingLink,
666
895
  hasLoadedAtLeastOnePage: false,
@@ -668,7 +897,8 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
668
897
  revokeAllRecipients: _this2.revokeAllRecipients,
669
898
  refresh: _this2.fetchAllSharings,
670
899
  hasWriteAccess: _this2.hasWriteAccess,
671
- renameSharedDrive: _this2.renameSharedDrive
900
+ renameSharedDrive: _this2.renameSharedDrive,
901
+ updateSharingMemberType: _this2.updateSharingMemberType
672
902
  };
673
903
  _this2.isPublic = (_props$isPublic = props.isPublic) !== null && _props$isPublic !== void 0 ? _props$isPublic : false;
674
904
  _this2.realtime = null;
@@ -704,14 +934,14 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
704
934
  }, {
705
935
  key: "fetchAllSharings",
706
936
  value: function () {
707
- var _fetchAllSharings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
937
+ var _fetchAllSharings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
708
938
  var _this$props, doctype, client, _yield$Promise$all, _yield$Promise$all2, sharings, permissions, apps, sharedDocIds, resp, folderPaths, filePaths;
709
939
 
710
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
711
- while (1) switch (_context14.prev = _context14.next) {
940
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
941
+ while (1) switch (_context17.prev = _context17.next) {
712
942
  case 0:
713
943
  if (!this.isPublic) {
714
- _context14.next = 4;
944
+ _context17.next = 4;
715
945
  break;
716
946
  }
717
947
 
@@ -720,17 +950,17 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
720
950
  this.setState({
721
951
  allLoaded: true
722
952
  });
723
- return _context14.abrupt("return");
953
+ return _context17.abrupt("return");
724
954
 
725
955
  case 4:
726
956
  _this$props = this.props, doctype = _this$props.doctype, client = _this$props.client;
727
- _context14.next = 7;
957
+ _context17.next = 7;
728
958
  return Promise.all([this.sharingCol.findByDoctype(doctype, {
729
959
  withSharedDocs: false
730
960
  }), this.permissionCol.findLinksByDoctype(doctype), client.fetchQueryAndGetFromState(fetchApps())]);
731
961
 
732
962
  case 7:
733
- _yield$Promise$all = _context14.sent;
963
+ _yield$Promise$all = _context17.sent;
734
964
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);
735
965
  sharings = _yield$Promise$all2[0];
736
966
  permissions = _yield$Promise$all2[1];
@@ -745,35 +975,35 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
745
975
  hasLoadedAtLeastOnePage: true
746
976
  }); // eslint-disable-next-line promise/catch-or-return
747
977
 
748
- _context14.next = 16;
978
+ _context17.next = 16;
749
979
  return fetchNextPermissions(permissions, this.dispatch, this.permissionCol);
750
980
 
751
981
  case 16:
752
982
  if (!(doctype === 'io.cozy.files')) {
753
- _context14.next = 26;
983
+ _context17.next = 26;
754
984
  break;
755
985
  }
756
986
 
757
987
  sharedDocIds = getSharedDocIdsBySharings(sharings);
758
- _context14.next = 20;
988
+ _context17.next = 20;
759
989
  return client.collection(doctype).all({
760
990
  keys: sharedDocIds
761
991
  });
762
992
 
763
993
  case 20:
764
- resp = _context14.sent;
994
+ resp = _context17.sent;
765
995
  folderPaths = resp.data.filter(function (f) {
766
996
  return f.type === 'directory' && !f.trashed;
767
997
  }).map(function (f) {
768
998
  return f.path;
769
999
  });
770
- _context14.next = 24;
1000
+ _context17.next = 24;
771
1001
  return fetchFilesPaths(client, doctype, resp.data.filter(function (f) {
772
1002
  return f.type !== 'directory' && !f.trashed;
773
1003
  }));
774
1004
 
775
1005
  case 24:
776
- filePaths = _context14.sent;
1006
+ filePaths = _context17.sent;
777
1007
  this.dispatch(receivePaths([].concat(_toConsumableArray(folderPaths), _toConsumableArray(filePaths))));
778
1008
 
779
1009
  case 26:
@@ -783,9 +1013,9 @@ export var SharingProvider = /*#__PURE__*/function (_Component) {
783
1013
 
784
1014
  case 27:
785
1015
  case "end":
786
- return _context14.stop();
1016
+ return _context17.stop();
787
1017
  }
788
- }, _callee14, this);
1018
+ }, _callee17, this);
789
1019
  }));
790
1020
 
791
1021
  function fetchAllSharings() {