cozy-client 34.1.2 → 34.1.4

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.
@@ -2644,7 +2644,7 @@ var CozyClient = /*#__PURE__*/function () {
2644
2644
  CozyClient.hooks = CozyClient.hooks || {};
2645
2645
  CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
2646
2646
 
2647
- CozyClient.version = "34.1.2";
2647
+ CozyClient.version = "34.1.4";
2648
2648
 
2649
2649
  _microee.default.mixin(CozyClient);
2650
2650
 
@@ -304,7 +304,7 @@ var convert$gtNullSelectors = function convert$gtNullSelectors(selector) {
304
304
  exports.convert$gtNullSelectors = convert$gtNullSelectors;
305
305
 
306
306
  var mergeSelectorAndPartialIndex = function mergeSelectorAndPartialIndex(queryDefinition) {
307
- return _objectSpread(_objectSpread({}, queryDefinition.selector), (0, _get.default)(queryDefinition, 'partialFilter'));
307
+ return _objectSpread(_objectSpread({}, (0, _get.default)(queryDefinition, 'selector')), (0, _get.default)(queryDefinition, 'partialFilter'));
308
308
  };
309
309
  /**
310
310
  * @param {QueryDefinition} queryDefinition - A query definition
@@ -315,7 +315,7 @@ var mergeSelectorAndPartialIndex = function mergeSelectorAndPartialIndex(queryDe
315
315
  exports.mergeSelectorAndPartialIndex = mergeSelectorAndPartialIndex;
316
316
 
317
317
  var getSelectorFilterFn = function getSelectorFilterFn(queryDefinition) {
318
- if (queryDefinition.selector) {
318
+ if (queryDefinition.selector || queryDefinition.partialFilter) {
319
319
  var selectors = mergeSelectorAndPartialIndex(queryDefinition); // sift does not work like couchdb when using { $gt: null } as a selector, so we use a custom operator
320
320
 
321
321
  _sift.default.use({
@@ -418,6 +418,22 @@ describe('mergeSelectorAndPartialIndex', () => {
418
418
 
419
419
  expect(mergeSelectorAndPartialIndex(query)).toMatchObject(result)
420
420
  })
421
+
422
+ it('should return a selector even if only partial index', () => {
423
+ const query = Q('io.cozy.files').partialIndex({
424
+ specificAttributes: {
425
+ $exists: false
426
+ }
427
+ })
428
+
429
+ const result = {
430
+ specificAttributes: {
431
+ $exists: false
432
+ }
433
+ }
434
+
435
+ expect(mergeSelectorAndPartialIndex(query)).toMatchObject(result)
436
+ })
421
437
  })
422
438
 
423
439
  describe('sortAndLimitDocsIds', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-client",
3
- "version": "34.1.2",
3
+ "version": "34.1.4",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.node.js",
6
6
  "browser": "dist/index.js",
@@ -18,7 +18,7 @@
18
18
  "@types/jest": "^26.0.20",
19
19
  "@types/lodash": "^4.14.170",
20
20
  "btoa": "^1.2.1",
21
- "cozy-stack-client": "^34.1.2",
21
+ "cozy-stack-client": "^34.1.4",
22
22
  "json-stable-stringify": "^1.0.1",
23
23
  "lodash": "^4.17.13",
24
24
  "microee": "^0.0.6",
@@ -73,5 +73,5 @@
73
73
  "react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
74
74
  },
75
75
  "sideEffects": false,
76
- "gitHead": "4bd8f40a3d224bf474d5e642c2ee1e793cee11da"
76
+ "gitHead": "4992c15de1d5b45cb08feb3e4330bc600c6192be"
77
77
  }