cozy-client 41.6.1 → 41.7.1

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.
@@ -2703,7 +2703,7 @@ var CozyClient = /*#__PURE__*/function () {
2703
2703
  CozyClient.hooks = CozyClient.hooks || {};
2704
2704
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2705
2705
 
2706
- CozyClient.version = "41.6.1";
2706
+ CozyClient.version = "41.7.1";
2707
2707
 
2708
2708
  _microee.default.mixin(CozyClient);
2709
2709
 
@@ -22,6 +22,7 @@ var _exportNames = {
22
22
  HasOneInPlace: true,
23
23
  HasManyInPlace: true,
24
24
  HasManyTriggers: true,
25
+ getReferencedBy: true,
25
26
  deconstructCozyWebLinkWithSlug: true,
26
27
  deconstructRedirectLink: true,
27
28
  dehydrate: true,
@@ -129,58 +130,64 @@ Object.defineProperty(exports, "HasManyTriggers", {
129
130
  return _associations.HasManyTriggers;
130
131
  }
131
132
  });
133
+ Object.defineProperty(exports, "getReferencedBy", {
134
+ enumerable: true,
135
+ get: function get() {
136
+ return _helpers.getReferencedBy;
137
+ }
138
+ });
132
139
  Object.defineProperty(exports, "deconstructCozyWebLinkWithSlug", {
133
140
  enumerable: true,
134
141
  get: function get() {
135
- return _helpers.deconstructCozyWebLinkWithSlug;
142
+ return _helpers2.deconstructCozyWebLinkWithSlug;
136
143
  }
137
144
  });
138
145
  Object.defineProperty(exports, "deconstructRedirectLink", {
139
146
  enumerable: true,
140
147
  get: function get() {
141
- return _helpers.deconstructRedirectLink;
148
+ return _helpers2.deconstructRedirectLink;
142
149
  }
143
150
  });
144
151
  Object.defineProperty(exports, "dehydrate", {
145
152
  enumerable: true,
146
153
  get: function get() {
147
- return _helpers.dehydrate;
154
+ return _helpers2.dehydrate;
148
155
  }
149
156
  });
150
157
  Object.defineProperty(exports, "generateWebLink", {
151
158
  enumerable: true,
152
159
  get: function get() {
153
- return _helpers.generateWebLink;
160
+ return _helpers2.generateWebLink;
154
161
  }
155
162
  });
156
163
  Object.defineProperty(exports, "ensureFirstSlash", {
157
164
  enumerable: true,
158
165
  get: function get() {
159
- return _helpers.ensureFirstSlash;
166
+ return _helpers2.ensureFirstSlash;
160
167
  }
161
168
  });
162
169
  Object.defineProperty(exports, "rootCozyUrl", {
163
170
  enumerable: true,
164
171
  get: function get() {
165
- return _helpers.rootCozyUrl;
172
+ return _helpers2.rootCozyUrl;
166
173
  }
167
174
  });
168
175
  Object.defineProperty(exports, "InvalidCozyUrlError", {
169
176
  enumerable: true,
170
177
  get: function get() {
171
- return _helpers.InvalidCozyUrlError;
178
+ return _helpers2.InvalidCozyUrlError;
172
179
  }
173
180
  });
174
181
  Object.defineProperty(exports, "InvalidProtocolError", {
175
182
  enumerable: true,
176
183
  get: function get() {
177
- return _helpers.InvalidProtocolError;
184
+ return _helpers2.InvalidProtocolError;
178
185
  }
179
186
  });
180
187
  Object.defineProperty(exports, "BlockedCozyError", {
181
188
  enumerable: true,
182
189
  get: function get() {
183
- return _helpers.BlockedCozyError;
190
+ return _helpers2.BlockedCozyError;
184
191
  }
185
192
  });
186
193
  Object.defineProperty(exports, "cancelable", {
@@ -227,7 +234,9 @@ var _dsl = require("./queries/dsl");
227
234
 
228
235
  var _associations = require("./associations");
229
236
 
230
- var _helpers = require("./helpers");
237
+ var _helpers = require("./associations/helpers");
238
+
239
+ var _helpers2 = require("./helpers");
231
240
 
232
241
  var _utils = require("./utils");
233
242
 
@@ -663,3 +663,79 @@ Object {
663
663
  },
664
664
  }
665
665
  `;
666
+
667
+ exports[`queries reducer updates should update a query with a partiel index 1`] = `
668
+ Object {
669
+ "a": Object {
670
+ "bookmark": null,
671
+ "count": 3,
672
+ "data": Array [
673
+ "todo_1",
674
+ "todo_2",
675
+ "todo_3",
676
+ ],
677
+ "definition": QueryDefinition {
678
+ "bookmark": undefined,
679
+ "cursor": undefined,
680
+ "doctype": "io.cozy.todos",
681
+ "fields": undefined,
682
+ "id": undefined,
683
+ "ids": undefined,
684
+ "includes": undefined,
685
+ "indexedFields": undefined,
686
+ "limit": undefined,
687
+ "partialFilter": undefined,
688
+ "referenced": undefined,
689
+ "selector": undefined,
690
+ "skip": undefined,
691
+ "sort": undefined,
692
+ },
693
+ "fetchStatus": "loaded",
694
+ "fetchedPagesCount": 1,
695
+ "hasMore": false,
696
+ "id": "a",
697
+ "isFetching": null,
698
+ "lastError": null,
699
+ "lastErrorUpdate": null,
700
+ "lastFetch": 1337,
701
+ "lastUpdate": 1337,
702
+ "options": null,
703
+ },
704
+ "b": Object {
705
+ "bookmark": null,
706
+ "count": 2,
707
+ "data": Array [
708
+ "todo_1",
709
+ "todo_2",
710
+ ],
711
+ "definition": QueryDefinition {
712
+ "bookmark": undefined,
713
+ "cursor": undefined,
714
+ "doctype": "io.cozy.todos",
715
+ "fields": undefined,
716
+ "id": undefined,
717
+ "ids": undefined,
718
+ "includes": undefined,
719
+ "indexedFields": undefined,
720
+ "limit": undefined,
721
+ "partialFilter": Object {
722
+ "done": false,
723
+ },
724
+ "referenced": undefined,
725
+ "selector": undefined,
726
+ "skip": undefined,
727
+ "sort": undefined,
728
+ },
729
+ "fetchStatus": "pending",
730
+ "fetchedPagesCount": 0,
731
+ "hasMore": false,
732
+ "id": "b",
733
+ "isFetching": null,
734
+ "lastError": null,
735
+ "lastErrorUpdate": null,
736
+ "lastFetch": null,
737
+ "lastUpdate": 1337,
738
+ "options": null,
739
+ },
740
+ }
741
+ `;
@@ -208,7 +208,23 @@ describe('queries reducer', () => {
208
208
  )
209
209
  expect(state).toMatchSnapshot()
210
210
  })
211
-
211
+ it('should update a query with a partiel index', () => {
212
+ applyAction(initQuery('a', Q('io.cozy.todos')))
213
+ applyAction(
214
+ initQuery(
215
+ 'b',
216
+ Q('io.cozy.todos').partialIndex({
217
+ done: false
218
+ })
219
+ )
220
+ )
221
+ applyAction(
222
+ receiveQueryResult('a', {
223
+ data: [TODO_1, TODO_2, TODO_3]
224
+ })
225
+ )
226
+ expect(state).toMatchSnapshot()
227
+ })
212
228
  it('should correctly update a sorted query with a deleted document', () => {
213
229
  const query = Q('io.cozy.todos')
214
230
  applyAction(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "41.6.1",
3
+ "version": "41.7.1",
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": "7581135cce0b70f5d23907bf3776e490995606b1"
78
+ "gitHead": "df34927987e59d91d47e215d3a8af5843cd161f7"
79
79
  }
@@ -2,6 +2,7 @@ export { default } from "./CozyClient";
2
2
  export { default as CozyLink } from "./CozyLink";
3
3
  export { default as StackLink } from "./StackLink";
4
4
  export { default as compose } from "lodash/flow";
5
+ export { getReferencedBy } from "./associations/helpers";
5
6
  export { cancelable } from "./utils";
6
7
  export { getQueryFromState } from "./store";
7
8
  export { default as Registry } from "./registry";