cozy-client 48.11.1 → 48.11.2

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.
@@ -2839,7 +2839,7 @@ var CozyClient = /*#__PURE__*/function () {
2839
2839
  CozyClient.hooks = CozyClient.hooks || {};
2840
2840
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2841
2841
 
2842
- CozyClient.version = "48.11.1";
2842
+ CozyClient.version = "48.11.2";
2843
2843
 
2844
2844
  _microee.default.mixin(CozyClient);
2845
2845
 
@@ -482,9 +482,6 @@ var move = /*#__PURE__*/function () {
482
482
  force,
483
483
  resp,
484
484
  destinationPath,
485
- _yield$client$query2,
486
- movedFile,
487
- filename,
488
485
  conflictResp,
489
486
  _resp,
490
487
  _args4 = arguments;
@@ -570,59 +567,40 @@ var move = /*#__PURE__*/function () {
570
567
  _context4.t1 = _context4["catch"](19);
571
568
 
572
569
  if (!(_context4.t1.status === 409 && force)) {
573
- _context4.next = 52;
570
+ _context4.next = 43;
574
571
  break;
575
572
  }
576
573
 
577
- if (!destination.path) {
578
- _context4.next = 33;
579
- break;
580
- }
581
-
582
- destinationPath = destination.path;
583
- _context4.next = 41;
584
- break;
585
-
586
- case 33:
587
- _context4.next = 35;
588
- return client.query((0, _dsl.Q)(_const.DOCTYPE_FILES).getById(file._id));
574
+ _context4.next = 31;
575
+ return getFullpath(client, destination._id, file.name);
589
576
 
590
- case 35:
591
- _yield$client$query2 = _context4.sent;
592
- movedFile = _yield$client$query2.data;
593
- filename = movedFile.name;
594
- _context4.next = 40;
595
- return getFullpath(client, destination._id, filename);
596
-
597
- case 40:
577
+ case 31:
598
578
  destinationPath = _context4.sent;
599
-
600
- case 41:
601
- _context4.next = 43;
579
+ _context4.next = 34;
602
580
  return client.collection(_const.DOCTYPE_FILES).statByPath(destinationPath);
603
581
 
604
- case 43:
582
+ case 34:
605
583
  conflictResp = _context4.sent;
606
- _context4.next = 46;
584
+ _context4.next = 37;
607
585
  return client.collection(_const.DOCTYPE_FILES).destroy(conflictResp.data);
608
586
 
609
- case 46:
610
- _context4.next = 48;
587
+ case 37:
588
+ _context4.next = 39;
611
589
  return client.collection(_const.DOCTYPE_FILES).updateFileMetadata(file._id, {
612
590
  dir_id: destination._id
613
591
  });
614
592
 
615
- case 48:
593
+ case 39:
616
594
  _resp = _context4.sent;
617
595
  return _context4.abrupt("return", {
618
596
  moved: _resp.data,
619
597
  deleted: conflictResp.data.id
620
598
  });
621
599
 
622
- case 52:
600
+ case 43:
623
601
  throw _context4.t1;
624
602
 
625
- case 53:
603
+ case 44:
626
604
  case "end":
627
605
  return _context4.stop();
628
606
  }
@@ -455,8 +455,11 @@ describe('File Model', () => {
455
455
  _id: 'dir-b1e1c256',
456
456
  _type: 'io.cozy.files',
457
457
  dir_id: 'io.cozy.files.root-dir',
458
- path: '/'
458
+ type: 'directory',
459
+ name: 'Photos',
460
+ path: '/Photos'
459
461
  }
462
+
460
463
  const nextcloudFolder = {
461
464
  _id: 'folder-12435',
462
465
  _type: 'io.cozy.remote.nextcloud.files',
@@ -520,13 +523,6 @@ describe('File Model', () => {
520
523
  _type: 'io.cozy.files'
521
524
  }
522
525
  })
523
- getSpy.mockResolvedValue({
524
- data: {
525
- id: cozyFile._id,
526
- name: 'mydoc.odt',
527
- _type: 'io.cozy.files'
528
- }
529
- })
530
526
  statByPathSpy.mockResolvedValue({
531
527
  data: {
532
528
  id: DELETED_FILE_ID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "48.11.1",
3
+ "version": "48.11.2",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -75,5 +75,5 @@
75
75
  "react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
76
76
  },
77
77
  "sideEffects": false,
78
- "gitHead": "73a573aa72e2b1d5d2589ae5c0afeec349092c1e"
78
+ "gitHead": "e8129adc0b6d19e3165c79fe00294428e213f9c4"
79
79
  }