cozy-client 33.0.6 → 33.0.7
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/dist/CozyClient.js +26 -17
- package/dist/CozyClient.spec.js +6 -0
- package/package.json +2 -2
package/dist/CozyClient.js
CHANGED
|
@@ -1398,54 +1398,63 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
1398
1398
|
mergedOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
1399
1399
|
as: queryId
|
|
1400
1400
|
});
|
|
1401
|
-
_context9.
|
|
1401
|
+
_context9.prev = 3;
|
|
1402
|
+
_context9.next = 6;
|
|
1402
1403
|
return this.query(queryDefinition, mergedOptions);
|
|
1403
1404
|
|
|
1404
|
-
case
|
|
1405
|
+
case 6:
|
|
1405
1406
|
resp = _context9.sent;
|
|
1406
1407
|
documents = resp.data;
|
|
1407
1408
|
|
|
1408
|
-
case
|
|
1409
|
+
case 8:
|
|
1409
1410
|
if (!(resp && resp.next)) {
|
|
1410
|
-
_context9.next =
|
|
1411
|
+
_context9.next = 22;
|
|
1411
1412
|
break;
|
|
1412
1413
|
}
|
|
1413
1414
|
|
|
1414
1415
|
if (!resp.bookmark) {
|
|
1415
|
-
_context9.next =
|
|
1416
|
+
_context9.next = 15;
|
|
1416
1417
|
break;
|
|
1417
1418
|
}
|
|
1418
1419
|
|
|
1419
|
-
_context9.next =
|
|
1420
|
+
_context9.next = 12;
|
|
1420
1421
|
return this.query(queryDefinition.offsetBookmark(resp.bookmark), mergedOptions);
|
|
1421
1422
|
|
|
1422
|
-
case
|
|
1423
|
+
case 12:
|
|
1423
1424
|
resp = _context9.sent;
|
|
1424
|
-
_context9.next =
|
|
1425
|
+
_context9.next = 19;
|
|
1425
1426
|
break;
|
|
1426
1427
|
|
|
1427
|
-
case
|
|
1428
|
+
case 15:
|
|
1428
1429
|
currentResult = (0, _store.getRawQueryFromState)(this.store.getState(), queryId);
|
|
1429
|
-
_context9.next =
|
|
1430
|
+
_context9.next = 18;
|
|
1430
1431
|
return this.query(queryDefinition.offset(currentResult.data.length), mergedOptions);
|
|
1431
1432
|
|
|
1432
|
-
case
|
|
1433
|
+
case 18:
|
|
1433
1434
|
resp = _context9.sent;
|
|
1434
1435
|
|
|
1435
|
-
case
|
|
1436
|
+
case 19:
|
|
1436
1437
|
documents.push.apply(documents, (0, _toConsumableArray2.default)(resp.data));
|
|
1437
|
-
_context9.next =
|
|
1438
|
+
_context9.next = 8;
|
|
1438
1439
|
break;
|
|
1439
1440
|
|
|
1440
|
-
case
|
|
1441
|
+
case 22:
|
|
1441
1442
|
return _context9.abrupt("return", documents);
|
|
1442
1443
|
|
|
1443
|
-
case
|
|
1444
|
+
case 25:
|
|
1445
|
+
_context9.prev = 25;
|
|
1446
|
+
_context9.t0 = _context9["catch"](3);
|
|
1447
|
+
|
|
1448
|
+
_logger.default.log("queryAll error for ".concat(_context9.t0.toString()));
|
|
1449
|
+
|
|
1450
|
+
return _context9.abrupt("return", []);
|
|
1451
|
+
|
|
1452
|
+
case 29:
|
|
1444
1453
|
case "end":
|
|
1445
1454
|
return _context9.stop();
|
|
1446
1455
|
}
|
|
1447
1456
|
}
|
|
1448
|
-
}, _callee9, this);
|
|
1457
|
+
}, _callee9, this, [[3, 25]]);
|
|
1449
1458
|
}));
|
|
1450
1459
|
|
|
1451
1460
|
function queryAll(_x10) {
|
|
@@ -2636,7 +2645,7 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
2636
2645
|
CozyClient.hooks = CozyClient.hooks || {};
|
|
2637
2646
|
CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
|
|
2638
2647
|
|
|
2639
|
-
CozyClient.version = "33.0.
|
|
2648
|
+
CozyClient.version = "33.0.7";
|
|
2640
2649
|
|
|
2641
2650
|
_microee.default.mixin(CozyClient);
|
|
2642
2651
|
|
package/dist/CozyClient.spec.js
CHANGED
|
@@ -1619,6 +1619,12 @@ describe('CozyClient', () => {
|
|
|
1619
1619
|
expect(getRawQueryFromState).not.toHaveBeenCalled()
|
|
1620
1620
|
expect(documents).toMatchSnapshot()
|
|
1621
1621
|
})
|
|
1622
|
+
it('should not throw error if there is an error', async () => {
|
|
1623
|
+
const error = new Error('Fake error')
|
|
1624
|
+
jest.spyOn(client, 'query').mockRejectedValue(error)
|
|
1625
|
+
|
|
1626
|
+
await expect(client.queryAll(query)).resolves.not.toThrowError()
|
|
1627
|
+
})
|
|
1622
1628
|
})
|
|
1623
1629
|
|
|
1624
1630
|
describe('mutate', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-client",
|
|
3
|
-
"version": "33.0.
|
|
3
|
+
"version": "33.0.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.node.js",
|
|
6
6
|
"browser": "dist/index.js",
|
|
@@ -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": "
|
|
76
|
+
"gitHead": "f0761c3014dae0b6c7bf498de1942d360acd6d60"
|
|
77
77
|
}
|