cozy-harvest-lib 22.5.0 → 22.5.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,28 @@
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
+ ## [22.5.2](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@22.5.1...cozy-harvest-lib@22.5.2) (2024-03-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Avoir losing cozy-client cache after reload ([dd36fcc](https://github.com/cozy/cozy-libs/commit/dd36fcc44c4158ea6a9b86b7bbf315a5bd19715f))
12
+
13
+
14
+
15
+
16
+
17
+ ## [22.5.1](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@22.5.0...cozy-harvest-lib@22.5.1) (2024-03-07)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * Deep clone account ([1febba9](https://github.com/cozy/cozy-libs/commit/1febba90b97e7c907b126aced41ba64f86452de1)), closes [/github.com/cozy/cozy-libs/pull/2447#discussion_r1514112607](https://github.com//github.com/cozy/cozy-libs/pull/2447/issues/discussion_r1514112607)
23
+
24
+
25
+
26
+
27
+
6
28
  # 22.5.0 (2024-03-07)
7
29
 
8
30
 
@@ -6,6 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
 
8
8
  import _regeneratorRuntime from "@babel/runtime/regenerator";
9
+ import cloneDeep from 'lodash/cloneDeep';
9
10
  import keyBy from 'lodash/keyBy';
10
11
  import merge from 'lodash/merge';
11
12
  import { Q, models } from 'cozy-client';
@@ -332,8 +333,7 @@ export var updateAccount = /*#__PURE__*/function () {
332
333
  export var saveAccount = function saveAccount(client, konnector, account) {
333
334
  assert(client && konnector && account, 'Must pass both client, konnector and account to saveAccount');
334
335
  var sourceAccountIdentifier = models.account.getAccountLogin(account);
335
-
336
- var updatedAccount = _objectSpread({}, account);
336
+ var updatedAccount = cloneDeep(account);
337
337
 
338
338
  if (sourceAccountIdentifier) {
339
339
  updatedAccount.cozyMetadata = _objectSpread(_objectSpread({}, account.cozyMetadata), {}, {
@@ -163,7 +163,9 @@ function _getTriggers() {
163
163
  case 0:
164
164
  _context3.next = 2;
165
165
  return client.query(Q(TRIGGERS_DOCTYPE).where({
166
- worker: ['client', 'konnector']
166
+ worker: {
167
+ $in: ['client', 'konnector']
168
+ }
167
169
  }));
168
170
 
169
171
  case 2:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-harvest-lib",
3
- "version": "22.5.0",
3
+ "version": "22.5.2",
4
4
  "description": "Provides logic, modules and components for Cozy's harvest applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -107,5 +107,5 @@
107
107
  "react-router-dom": ">=4.3.1"
108
108
  },
109
109
  "sideEffects": false,
110
- "gitHead": "a4994e610dac9588c6d13798f2474e5b1a2646f5"
110
+ "gitHead": "a93bc9fc1ee9a73dbb110f184606acaf4fa6d9f6"
111
111
  }
@@ -1,3 +1,4 @@
1
+ import cloneDeep from 'lodash/cloneDeep'
1
2
  import keyBy from 'lodash/keyBy'
2
3
  import merge from 'lodash/merge'
3
4
 
@@ -173,7 +174,7 @@ export const saveAccount = (client, konnector, account) => {
173
174
  )
174
175
 
175
176
  const sourceAccountIdentifier = models.account.getAccountLogin(account)
176
- const updatedAccount = { ...account }
177
+ const updatedAccount = cloneDeep(account)
177
178
  if (sourceAccountIdentifier) {
178
179
  updatedAccount.cozyMetadata = {
179
180
  ...account.cozyMetadata,
@@ -70,7 +70,11 @@ async function getKonnector(client, slug) {
70
70
 
71
71
  async function getTriggers(client, slug) {
72
72
  const { data: allTriggers } = await client.query(
73
- Q(TRIGGERS_DOCTYPE).where({ worker: ['client', 'konnector'] })
73
+ Q(TRIGGERS_DOCTYPE).where({
74
+ worker: {
75
+ $in: ['client', 'konnector']
76
+ }
77
+ })
74
78
  )
75
79
  return allTriggers.filter(
76
80
  trigger =>