cozy-harvest-lib 30.0.0 → 30.0.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
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
+ ## [30.0.2](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@30.0.1...cozy-harvest-lib@30.0.2) (2024-10-15)
7
+
8
+ **Note:** Version bump only for package cozy-harvest-lib
9
+
10
+
11
+
12
+
13
+
14
+ ## [30.0.1](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@30.0.0...cozy-harvest-lib@30.0.1) (2024-09-24)
15
+
16
+ ### Bug Fixes
17
+
18
+ - **cozy-harvest-lib:** Use a query for fetching accounts ([dc43063](https://github.com/cozy/cozy-libs/commit/dc430630cf11717d94c9a0609bd3cdefa3e6ba94))
19
+
6
20
  # [30.0.0](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@29.1.3...cozy-harvest-lib@30.0.0) (2024-09-23)
7
21
 
8
22
  ### Features
@@ -387,21 +387,20 @@ export var deleteAccount = /*#__PURE__*/function () {
387
387
 
388
388
  export var fetchAccountsFromTriggers = /*#__PURE__*/function () {
389
389
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(client, triggers) {
390
- var accountCol, accountIdToTrigger, accountIds, _yield$accountCol$get, accounts;
390
+ var accountIdToTrigger, accountIds, _yield$client$query2, accounts;
391
391
 
392
392
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
393
393
  while (1) {
394
394
  switch (_context6.prev = _context6.next) {
395
395
  case 0:
396
- accountCol = client.collection('io.cozy.accounts');
397
396
  accountIdToTrigger = keyBy(triggers, triggersModel.getAccountId);
398
397
  accountIds = Object.keys(accountIdToTrigger);
399
- _context6.next = 5;
400
- return accountCol.getAll(accountIds);
398
+ _context6.next = 4;
399
+ return client.query(Q('io.cozy.accounts').getByIds(accountIds));
401
400
 
402
- case 5:
403
- _yield$accountCol$get = _context6.sent;
404
- accounts = _yield$accountCol$get.data;
401
+ case 4:
402
+ _yield$client$query2 = _context6.sent;
403
+ accounts = _yield$client$query2.data;
405
404
  return _context6.abrupt("return", accounts.filter(Boolean).map(function (account) {
406
405
  return {
407
406
  account: account,
@@ -409,7 +408,7 @@ export var fetchAccountsFromTriggers = /*#__PURE__*/function () {
409
408
  };
410
409
  }));
411
410
 
412
- case 8:
411
+ case 7:
413
412
  case "end":
414
413
  return _context6.stop();
415
414
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-harvest-lib",
3
- "version": "30.0.0",
3
+ "version": "30.0.2",
4
4
  "description": "Provides logic, modules and components for Cozy's harvest applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -32,7 +32,7 @@
32
32
  "@cozy/minilog": "^1.0.0",
33
33
  "classnames": "^2.3.1",
34
34
  "cozy-bi-auth": "0.0.25",
35
- "cozy-doctypes": "^1.91.1",
35
+ "cozy-doctypes": "^1.91.2",
36
36
  "cozy-logger": "^1.10.4",
37
37
  "date-fns": "^1.30.1",
38
38
  "final-form": "^4.18.5",
@@ -64,14 +64,14 @@
64
64
  "@types/react-redux": "7.1.25",
65
65
  "babel-jest": "26.6.3",
66
66
  "babel-plugin-inline-react-svg": "1.1.2",
67
- "babel-preset-cozy-app": "^2.1.0",
67
+ "babel-preset-cozy-app": "^2.2.0",
68
68
  "cozy-client": "^48.8.0",
69
- "cozy-device-helper": "^3.1.0",
70
- "cozy-flags": "^4.0.0",
71
- "cozy-intent": "^2.23.0",
72
- "cozy-interapp": "^0.9.0",
69
+ "cozy-device-helper": "^3.1.1",
70
+ "cozy-flags": "^4.0.1",
71
+ "cozy-intent": "^2.23.1",
72
+ "cozy-interapp": "^0.9.1",
73
73
  "cozy-keys-lib": "^6.1.1",
74
- "cozy-realtime": "^5.0.2",
74
+ "cozy-realtime": "^5.0.3",
75
75
  "cozy-tsconfig": "^1.2.0",
76
76
  "cozy-ui": "^111.12.0",
77
77
  "enzyme": "3.11.0",
@@ -108,5 +108,5 @@
108
108
  "react-router-dom": ">=4.3.1"
109
109
  },
110
110
  "sideEffects": false,
111
- "gitHead": "cd826b4d7b13547bb315574bc554f090efdca11f"
111
+ "gitHead": "e9dcaac26718732ec692e8ac9eceed87fea22548"
112
112
  }
@@ -191,10 +191,11 @@ export const deleteAccount = async (client, account) => {
191
191
  * Returns { trigger, account } list
192
192
  */
193
193
  export const fetchAccountsFromTriggers = async (client, triggers) => {
194
- const accountCol = client.collection('io.cozy.accounts')
195
194
  const accountIdToTrigger = keyBy(triggers, triggersModel.getAccountId)
196
195
  const accountIds = Object.keys(accountIdToTrigger)
197
- const { data: accounts } = await accountCol.getAll(accountIds)
196
+ const { data: accounts } = await client.query(
197
+ Q('io.cozy.accounts').getByIds(accountIds)
198
+ )
198
199
  return accounts
199
200
  .filter(Boolean)
200
201
  .map(account => ({ account, trigger: accountIdToTrigger[account._id] }))