cozy-client 27.6.0 → 27.6.5

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/CHANGELOG.md CHANGED
@@ -3,6 +3,55 @@
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
+ ## [27.6.5](https://github.com/cozy/cozy-client/compare/v27.6.4...v27.6.5) (2021-12-20)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Use fetchOwnPermissions instead of deprecated getOwnPermissions ([fb1dd51](https://github.com/cozy/cozy-client/commit/fb1dd517c3f8ca6e184055ad3194d387a5901027))
12
+
13
+
14
+
15
+
16
+
17
+ ## [27.6.4](https://github.com/cozy/cozy-client/compare/v27.6.3...v27.6.4) (2021-12-20)
18
+
19
+ **Note:** Version bump only for package cozy-client
20
+
21
+
22
+
23
+
24
+
25
+ ## [27.6.3](https://github.com/cozy/cozy-client/compare/v27.6.2...v27.6.3) (2021-12-16)
26
+
27
+ **Note:** Version bump only for package cozy-client
28
+
29
+
30
+
31
+
32
+
33
+ ## [27.6.2](https://github.com/cozy/cozy-client/compare/v27.6.1...v27.6.2) (2021-12-16)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * Update dependency date-fns to v2.27.0 ([5ec7911](https://github.com/cozy/cozy-client/commit/5ec7911352072a72de99ec68f545f0b36c56c990))
39
+
40
+
41
+
42
+
43
+
44
+ ## [27.6.1](https://github.com/cozy/cozy-client/compare/v27.6.0...v27.6.1) (2021-12-15)
45
+
46
+
47
+ ### Bug Fixes
48
+
49
+ * **filename:** Get illegal characters from file name and returns them ([7c00526](https://github.com/cozy/cozy-client/commit/7c00526283dd865aea929c2983d32f7a12121c65))
50
+
51
+
52
+
53
+
54
+
6
55
  # [27.6.0](https://github.com/cozy/cozy-client/compare/v27.5.1...v27.6.0) (2021-12-13)
7
56
 
8
57
 
@@ -2452,7 +2452,7 @@ var CozyClient = /*#__PURE__*/function () {
2452
2452
  CozyClient.hooks = CozyClient.hooks || {};
2453
2453
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2454
2454
 
2455
- CozyClient.version = "27.6.0";
2455
+ CozyClient.version = "27.6.5";
2456
2456
 
2457
2457
  _microee.default.mixin(CozyClient);
2458
2458
 
@@ -92,7 +92,8 @@ var FILE_1 = {
92
92
  _id: 1,
93
93
  _rev: '3-bd9bb7286a094842b954d9e86429090d',
94
94
  _type: 'io.cozy.files',
95
- label: 'File 1'
95
+ label: 'File 1',
96
+ name: 'New document name'
96
97
  };
97
98
  exports.FILE_1 = FILE_1;
98
99
  var FILE_2 = {
@@ -57,7 +57,7 @@ var FILENAME_WITH_EXTENSION_REGEX = /(.+)(\..*)$/;
57
57
  */
58
58
 
59
59
  var splitFilename = function splitFilename(file) {
60
- if (!(0, _isString.default)(file.name)) throw new Error('file should have a name property ');
60
+ if (!(0, _isString.default)(file.name)) throw new Error('file should have a name property');
61
61
 
62
62
  if (file.type === 'file') {
63
63
  var match = file.name.match(FILENAME_WITH_EXTENSION_REGEX);
@@ -483,7 +483,7 @@ var getFullpath = /*#__PURE__*/function () {
483
483
  *
484
484
  * @param {CozyClient} client - The CozyClient instance
485
485
  * @param {string} fileId - The file's id (required)
486
- * @param {object} destination
486
+ * @param {object} destination - The destination object containing:
487
487
  * @param {string} destination.folderId - The destination folder's id (required)
488
488
  * @param {string} destination.path - The file's path after the move (optional, used to optimize performance in case of conflict)
489
489
  * @param {boolean} force - Whether we should overwrite, i.e. put to trash, the destination in case of conflict (defaults to false).
@@ -244,7 +244,9 @@ describe('File Model', () => {
244
244
  expect(fileModel.splitFilename(opts)).toEqual(result)
245
245
  })
246
246
  it('should throw an error if the file is not correct', () => {
247
- expect(() => fileModel.splitFilename({})).toThrow()
247
+ expect(() => fileModel.splitFilename({})).toThrow(
248
+ 'file should have a name property'
249
+ )
248
250
  expect(() => fileModel.splitFilename({ name: null })).toThrow()
249
251
  expect(() => fileModel.splitFilename({ name: '' })).not.toThrow()
250
252
  })
@@ -100,7 +100,7 @@ function _fetchOwn() {
100
100
  case 0:
101
101
  collection = client.collection('io.cozy.permissions');
102
102
  _context.next = 3;
103
- return collection.getOwnPermissions();
103
+ return collection.fetchOwnPermissions();
104
104
 
105
105
  case 3:
106
106
  data = _context.sent;
@@ -42,7 +42,7 @@ function setupClient(verbs = [], ids = ['first', 'other']) {
42
42
  return {
43
43
  query: async data => data,
44
44
  collection: () => ({
45
- getOwnPermissions: async () => ({
45
+ fetchOwnPermissions: async () => ({
46
46
  data: {
47
47
  id: '9385e37389cb9f71a230168f245df2f8',
48
48
  _id: '9385e37389cb9f71a230168f245df2f8',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "27.6.0",
3
+ "version": "27.6.5",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "cozy-device-helper": "^1.12.0",
22
22
  "cozy-flags": "2.7.1",
23
23
  "cozy-logger": "^1.6.0",
24
- "cozy-stack-client": "^27.1.0",
24
+ "cozy-stack-client": "^27.6.5",
25
25
  "json-stable-stringify": "^1.0.1",
26
26
  "lodash": "^4.17.13",
27
27
  "microee": "^0.0.6",
@@ -52,7 +52,7 @@
52
52
  "btoa": "^1.2.1",
53
53
  "cozy-logger": "1.7.0",
54
54
  "cozy-ui": "48.0.0",
55
- "date-fns": "2.19.0",
55
+ "date-fns": "2.27.0",
56
56
  "jsdoc-plugin-intersection": "^1.0.4",
57
57
  "mockdate": "^2.0.2",
58
58
  "react": "16.14.0",
@@ -69,5 +69,5 @@
69
69
  "react-native-inappbrowser-reborn": "^3.5.1"
70
70
  },
71
71
  "sideEffects": false,
72
- "gitHead": "4228ec1287e3b18892f2e57128a09a77e87cae2e"
72
+ "gitHead": "6c0a47314fa5bcf19ca6a0b0322beca088576360"
73
73
  }
@@ -103,6 +103,7 @@ export namespace FILE_1 {
103
103
  export { _type_6 as _type };
104
104
  const label_6: string;
105
105
  export { label_6 as label };
106
+ export const name: string;
106
107
  }
107
108
  export namespace FILE_2 {
108
109
  const _id_7: number;