cozy-harvest-lib 32.2.28 → 32.2.30

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,22 @@
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
+ ## [32.2.30](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@32.2.29...cozy-harvest-lib@32.2.30) (2025-02-04)
7
+
8
+ **Note:** Version bump only for package cozy-harvest-lib
9
+
10
+
11
+
12
+
13
+
14
+ ## [32.2.29](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@32.2.28...cozy-harvest-lib@32.2.29) (2025-01-30)
15
+
16
+ **Note:** Version bump only for package cozy-harvest-lib
17
+
18
+
19
+
20
+
21
+
6
22
  ## [32.2.28](https://github.com/cozy/cozy-libs/compare/cozy-harvest-lib@32.2.27...cozy-harvest-lib@32.2.28) (2025-01-30)
7
23
 
8
24
  **Note:** Version bump only for package cozy-harvest-lib
@@ -27,7 +27,6 @@ import clone from 'lodash/clone';
27
27
  import get from 'lodash/get';
28
28
  import keyBy from 'lodash/keyBy';
29
29
  import set from 'lodash/set';
30
- import { biErrorMap } from 'cozy-bi-auth';
31
30
  import { Q } from 'cozy-client';
32
31
  import PromiseCache from 'cozy-client/dist/promise-cache';
33
32
  import { receiveMutationResult } from 'cozy-client/dist/store'; // @ts-ignore (its a peerDep and I don't know how to configure ts for that)
@@ -692,7 +691,7 @@ export var findAccountWithBiConnection = /*#__PURE__*/function () {
692
691
 
693
692
  export var convertBIErrortoKonnectorJobError = function convertBIErrortoKonnectorJobError(error) {
694
693
  var errorCode = error ? error.code : null;
695
- var cozyErrorMessage = errorCode ? biErrorMap[errorCode] || extraBIErrorMap[errorCode] || null : null;
694
+ var cozyErrorMessage = errorCode ? biErrorMap[errorCode] || null : null;
696
695
  var errorMessage = cozyErrorMessage || (errorCode ? "UNKNOWN_ERROR.".concat(errorCode) : 'UNKNOWN_ERROR');
697
696
  var err = new KonnectorJobError(errorMessage);
698
697
  err.original = error;
@@ -703,14 +702,16 @@ export var isBudgetInsightConnector = function isBudgetInsightConnector(konnecto
703
702
 
704
703
  return (konnector === null || konnector === void 0 || (_konnector$partnershi = konnector.partnership) === null || _konnector$partnershi === void 0 ? void 0 : _konnector$partnershi.domain) === 'budget-insight.com';
705
704
  };
706
- /**
707
- * This error map is not in the bi-auth package since it is not really
708
- * satisfying to have "config" mapped to LOGIN_FAILED. It might change.
709
- * We should not have this error if we validate the fields in the
710
- * front-end.
711
- */
712
-
713
- var extraBIErrorMap = {
705
+ var biErrorMap = {
706
+ actionNeeded: 'USER_ACTION_NEEDED',
707
+ wrongpass: 'LOGIN_FAILED',
708
+ decoupled: 'USER_ACTION_NEEDED.TWOFA_NEEDED.APP',
709
+ passwordExpired: 'USER_ACTION_NEEDED.CHANGE_PASSWORD',
710
+ SCARequired: 'USER_ACTION_NEEDED.SCA_REQUIRED',
711
+ webauthRequired: 'USER_ACTION_NEEDED.WEBAUTH_REQUIRED',
712
+ websiteUnavailable: 'VENDOR_DOWN.BANK_DOWN',
713
+ additionalInformationNeeded: 'CHALLENGE_ASKED',
714
+ bug: 'VENDOR_DOWN',
714
715
  config: 'LOGIN_FAILED',
715
716
  ACCOUNT_WITH_SAME_IDENTIFIER_ALREADY_DEFINED: 'ACCOUNT_WITH_SAME_IDENTIFIER_ALREADY_DEFINED'
716
717
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-harvest-lib",
3
- "version": "32.2.28",
3
+ "version": "32.2.30",
4
4
  "description": "Provides logic, modules and components for Cozy's harvest applications.",
5
5
  "main": "dist/index.js",
6
6
  "author": "Cozy",
@@ -31,7 +31,6 @@
31
31
  "dependencies": {
32
32
  "@cozy/minilog": "^1.0.0",
33
33
  "classnames": "^2.3.1",
34
- "cozy-bi-auth": "0.0.25",
35
34
  "cozy-doctypes": "^1.97.1",
36
35
  "cozy-logger": "^1.16.1",
37
36
  "date-fns": "2.30.0",
@@ -75,7 +74,7 @@
75
74
  "cozy-realtime": "^5.6.3",
76
75
  "cozy-tsconfig": "^1.8.1",
77
76
  "cozy-ui": "^115.0.2",
78
- "cozy-viewer": "^16.1.0",
77
+ "cozy-viewer": "^16.2.1",
79
78
  "enzyme": "3.11.0",
80
79
  "enzyme-adapter-react-16": "1.15.6",
81
80
  "form-data": "4.0.0",
@@ -111,5 +110,5 @@
111
110
  "react-router-dom": ">=6.14.2"
112
111
  },
113
112
  "sideEffects": false,
114
- "gitHead": "df33cf39f2c2a448ddff02f63db3dfa818f7fb01"
113
+ "gitHead": "b257fb0f869d9797d5222aa8481e7035a890aeb4"
115
114
  }
@@ -10,7 +10,6 @@ import get from 'lodash/get'
10
10
  import keyBy from 'lodash/keyBy'
11
11
  import set from 'lodash/set'
12
12
 
13
- import { biErrorMap } from 'cozy-bi-auth'
14
13
  import { Q } from 'cozy-client'
15
14
  import PromiseCache from 'cozy-client/dist/promise-cache'
16
15
  import { receiveMutationResult } from 'cozy-client/dist/store'
@@ -447,9 +446,7 @@ export const findAccountWithBiConnection = async ({
447
446
  */
448
447
  export const convertBIErrortoKonnectorJobError = error => {
449
448
  const errorCode = error ? error.code : null
450
- const cozyErrorMessage = errorCode
451
- ? biErrorMap[errorCode] || extraBIErrorMap[errorCode] || null
452
- : null
449
+ const cozyErrorMessage = errorCode ? biErrorMap[errorCode] || null : null
453
450
  const errorMessage =
454
451
  cozyErrorMessage ||
455
452
  (errorCode ? `UNKNOWN_ERROR.${errorCode}` : 'UNKNOWN_ERROR')
@@ -461,13 +458,16 @@ export const convertBIErrortoKonnectorJobError = error => {
461
458
  export const isBudgetInsightConnector = konnector =>
462
459
  konnector?.partnership?.domain === 'budget-insight.com'
463
460
 
464
- /**
465
- * This error map is not in the bi-auth package since it is not really
466
- * satisfying to have "config" mapped to LOGIN_FAILED. It might change.
467
- * We should not have this error if we validate the fields in the
468
- * front-end.
469
- */
470
- const extraBIErrorMap = {
461
+ const biErrorMap = {
462
+ actionNeeded: 'USER_ACTION_NEEDED',
463
+ wrongpass: 'LOGIN_FAILED',
464
+ decoupled: 'USER_ACTION_NEEDED.TWOFA_NEEDED.APP',
465
+ passwordExpired: 'USER_ACTION_NEEDED.CHANGE_PASSWORD',
466
+ SCARequired: 'USER_ACTION_NEEDED.SCA_REQUIRED',
467
+ webauthRequired: 'USER_ACTION_NEEDED.WEBAUTH_REQUIRED',
468
+ websiteUnavailable: 'VENDOR_DOWN.BANK_DOWN',
469
+ additionalInformationNeeded: 'CHALLENGE_ASKED',
470
+ bug: 'VENDOR_DOWN',
471
471
  config: 'LOGIN_FAILED',
472
472
  ACCOUNT_WITH_SAME_IDENTIFIER_ALREADY_DEFINED:
473
473
  'ACCOUNT_WITH_SAME_IDENTIFIER_ALREADY_DEFINED'