cozy-client 60.21.0 → 60.21.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.
@@ -3126,7 +3126,7 @@ var CozyClient = /*#__PURE__*/function () {
3126
3126
  CozyClient.hooks = CozyClient.hooks || {};
3127
3127
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
3128
3128
 
3129
- CozyClient.version = "60.21.0";
3129
+ CozyClient.version = "60.21.2";
3130
3130
 
3131
3131
  _microee.default.mixin(CozyClient);
3132
3132
 
@@ -1223,7 +1223,7 @@ var copy = /*#__PURE__*/function () {
1223
1223
  _context9.next = 19;
1224
1224
  return client.collection(_const.DOCTYPE_FILES, {
1225
1225
  driveId: driveId
1226
- }).copy(file._id, undefined, destination._id);
1226
+ }).copy(file._id, file.name, destination._id);
1227
1227
 
1228
1228
  case 19:
1229
1229
  resp = _context9.sent;
@@ -46,7 +46,7 @@ exports.arePremiumLinksEnabled = arePremiumLinksEnabled;
46
46
 
47
47
  var isFreemiumUser = function isFreemiumUser(instanceInfo) {
48
48
  var quota = (0, _get.default)(instanceInfo, 'diskUsage.data.quota', false);
49
- return parseInt(quota) <= PREMIUM_QUOTA;
49
+ return parseInt(quota) < PREMIUM_QUOTA;
50
50
  };
51
51
 
52
52
  exports.isFreemiumUser = isFreemiumUser;
@@ -49,6 +49,22 @@ const hadAnOfferInstance = {
49
49
  }
50
50
  }
51
51
  }
52
+
53
+ const freemiumInstance = {
54
+ diskUsage: {
55
+ data: {
56
+ quota: '1000'
57
+ }
58
+ }
59
+ }
60
+
61
+ const nonFreemiumInstance = {
62
+ diskUsage: {
63
+ data: {
64
+ quota: '50000000000'
65
+ }
66
+ }
67
+ }
52
68
  describe('instance', () => {
53
69
  it('should test if self hosted or not', () => {
54
70
  expect(instance.isSelfHosted(noSelfHostedInstance)).toBe(false)
@@ -69,7 +85,10 @@ describe('instance', () => {
69
85
  expect(instance.isFreemiumUser(noSelfHostedInstance)).toBe(true)
70
86
  expect(instance.isFreemiumUser(selftHostedInstance)).toBe(false)
71
87
  })
72
-
88
+ it('should correctly identify freemium vs non-freemium based on quota boundary', () => {
89
+ expect(instance.isFreemiumUser(freemiumInstance)).toBe(true)
90
+ expect(instance.isFreemiumUser(nonFreemiumInstance)).toBe(false)
91
+ })
73
92
  it('should tell us that this instance is concerned by our offers', () => {
74
93
  expect(instance.shouldDisplayOffers(noSelfHostedInstance)).toBe(true)
75
94
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "60.21.0",
3
+ "version": "60.21.2",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "@types/jest": "^26.0.20",
20
20
  "@types/lodash": "^4.14.170",
21
21
  "btoa": "^1.2.1",
22
- "cozy-stack-client": "^60.21.0",
22
+ "cozy-stack-client": "^60.21.1",
23
23
  "date-fns": "^2.30.0",
24
24
  "fast-deep-equal": "^3.1.3",
25
25
  "json-stable-stringify": "^1.0.1",
@@ -74,5 +74,5 @@
74
74
  "react-native-ios11-devicecheck": "^0.0.3"
75
75
  },
76
76
  "sideEffects": false,
77
- "gitHead": "a832efcd3a152a0ea11f5a736abcd3ece28cf181"
77
+ "gitHead": "ea2ffd13a2f79cf84efb9833c3aa93bfe3d53dc7"
78
78
  }