@tap-payments/auth-jsconnect 2.10.2-beta → 2.10.5-beta

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.
@@ -1,93 +1,93 @@
1
- .rmdp-wrapper {
2
- box-shadow: none !important;
3
- width: 100% !important;
4
- z-index: 0 !important;
5
- }
6
- .rmdp-day-picker {
7
- padding-inline: 0px !important;
8
- }
9
-
10
- .rmdp-day-picker > div {
11
- width: 100%;
12
- }
13
- .rmdp-day {
14
- color: #3a4154 !important;
15
- }
16
-
17
- .rmdp-calendar {
18
- width: 100%;
19
- padding: 0 !important;
20
- padding-bottom: 15px !important;
21
- padding-top: 12px !important;
22
- }
23
-
24
- .rmdp-day.rmdp-selected span:not(.highlight) {
25
- /* background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%) !important; */
26
- color: #ffffff !important;
27
- background-color: black !important;
28
- }
29
- .rmdp-week,
30
- .rmdp-ym {
31
- justify-content: start !important;
32
- }
33
- .rmdp-day span,
34
- .rmdp-week-day {
35
- flex: 0 0 14.2857%;
36
- }
37
- .rmdp-week-day {
38
- color: #abaeb6 !important;
39
- font-weight: 400 !important;
40
- font-size: 0.75em !important;
41
- text-transform: uppercase;
42
- }
43
- .rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover {
44
- background-color: #fafafa !important;
45
- /* border-radius: 50%; */
46
- color: #3a4154 !important;
47
- /* background: radial-gradient(circle closest-side, #fafafa 0, #fafafa 98%, transparent 100%) !important; */
48
- }
49
- .rmdp-day.rmdp-disabled {
50
- background-color: #f0f0f0 !important;
51
- }
52
- .rmdp-day.rmdp-selected span:not(.highlight):hover {
53
- color: #ffffff !important;
54
- background-color: black !important;
55
- }
56
- .rmdp-arrow-container:hover {
57
- background-color: unset !important;
58
- box-shadow: unset !important;
59
- }
60
- .rmdp-arrow {
61
- border: solid #000 !important;
62
- border-width: 0 1px 1px 0 !important;
63
- }
64
- .rmdp-day.rmdp-today span {
65
- background-color: unset !important;
66
- color: #000 !important;
67
- }
68
- .rmdp-header {
69
- margin-bottom: 12px;
70
- }
71
- .rmdp-day-picker .rmdp-day {
72
- height: 40px !important;
73
- width: 40px !important;
74
- flex: 0 0 14.2857%;
75
- }
76
- .rmdp-day-picker .rmdp-day span {
77
- height: 36px !important;
78
- width: 36px !important;
79
- }
80
- .rmdp-month-picker .rmdp-ym .rmdp-day {
81
- margin: unset;
82
- }
83
- .rmdp-month-picker .rmdp-ym .rmdp-day,
84
- .rmdp-week-day {
85
- height: 100%;
86
- }
87
- .rmdp-year-picker .rmdp-ym .rmdp-day {
88
- margin: unset;
89
- }
90
- .rmdp-year-picker .rmdp-ym .rmdp-day,
91
- .rmdp-week-day {
92
- height: 100%;
93
- }
1
+ .rmdp-wrapper {
2
+ box-shadow: none !important;
3
+ width: 100% !important;
4
+ z-index: 0 !important;
5
+ }
6
+ .rmdp-day-picker {
7
+ padding-inline: 0px !important;
8
+ }
9
+
10
+ .rmdp-day-picker > div {
11
+ width: 100%;
12
+ }
13
+ .rmdp-day {
14
+ color: #3a4154 !important;
15
+ }
16
+
17
+ .rmdp-calendar {
18
+ width: 100%;
19
+ padding: 0 !important;
20
+ padding-bottom: 15px !important;
21
+ padding-top: 12px !important;
22
+ }
23
+
24
+ .rmdp-day.rmdp-selected span:not(.highlight) {
25
+ /* background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%) !important; */
26
+ color: #ffffff !important;
27
+ background-color: black !important;
28
+ }
29
+ .rmdp-week,
30
+ .rmdp-ym {
31
+ justify-content: start !important;
32
+ }
33
+ .rmdp-day span,
34
+ .rmdp-week-day {
35
+ flex: 0 0 14.2857%;
36
+ }
37
+ .rmdp-week-day {
38
+ color: #abaeb6 !important;
39
+ font-weight: 400 !important;
40
+ font-size: 0.75em !important;
41
+ text-transform: uppercase;
42
+ }
43
+ .rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover {
44
+ background-color: #fafafa !important;
45
+ /* border-radius: 50%; */
46
+ color: #3a4154 !important;
47
+ /* background: radial-gradient(circle closest-side, #fafafa 0, #fafafa 98%, transparent 100%) !important; */
48
+ }
49
+ .rmdp-day.rmdp-disabled {
50
+ background-color: #f0f0f0 !important;
51
+ }
52
+ .rmdp-day.rmdp-selected span:not(.highlight):hover {
53
+ color: #ffffff !important;
54
+ background-color: black !important;
55
+ }
56
+ .rmdp-arrow-container:hover {
57
+ background-color: unset !important;
58
+ box-shadow: unset !important;
59
+ }
60
+ .rmdp-arrow {
61
+ border: solid #000 !important;
62
+ border-width: 0 1px 1px 0 !important;
63
+ }
64
+ .rmdp-day.rmdp-today span {
65
+ background-color: unset !important;
66
+ color: #000 !important;
67
+ }
68
+ .rmdp-header {
69
+ margin-bottom: 12px;
70
+ }
71
+ .rmdp-day-picker .rmdp-day {
72
+ height: 40px !important;
73
+ width: 40px !important;
74
+ flex: 0 0 14.2857%;
75
+ }
76
+ .rmdp-day-picker .rmdp-day span {
77
+ height: 36px !important;
78
+ width: 36px !important;
79
+ }
80
+ .rmdp-month-picker .rmdp-ym .rmdp-day {
81
+ margin: unset;
82
+ }
83
+ .rmdp-month-picker .rmdp-ym .rmdp-day,
84
+ .rmdp-week-day {
85
+ height: 100%;
86
+ }
87
+ .rmdp-year-picker .rmdp-ym .rmdp-day {
88
+ margin: unset;
89
+ }
90
+ .rmdp-year-picker .rmdp-ym .rmdp-day,
91
+ .rmdp-week-day {
92
+ height: 100%;
93
+ }
@@ -1,86 +1,86 @@
1
- .date_picker_input {
2
- cursor: pointer;
3
- }
4
-
5
- .react-calendar {
6
- width: 100%;
7
- border: none;
8
- padding: 15px 0px 15px 0px;
9
- }
10
-
11
- .react-calendar__navigation {
12
- display: flex;
13
- position: relative;
14
- }
15
- .react-calendar__navigation__label__labelText {
16
- font-family: 'Lato', 'Roboto';
17
- }
18
- .react-calendar__navigation button:enabled:hover,
19
- .react-calendar__navigation button:enabled:focus {
20
- background-color: #ffffff;
21
- }
22
- .react-calendar__navigation__prev-button {
23
- top: 20px;
24
- left: 86px;
25
- }
26
-
27
- .react-calendar__navigation__next-button {
28
- top: 0px;
29
- left: 86px;
30
- }
31
-
32
- .react-calendar__navigation__prev2-button {
33
- top: 20px;
34
- right: 13px;
35
- }
36
-
37
- .react-calendar__navigation__next2-button {
38
- top: 0px;
39
- right: 13px;
40
- }
41
-
42
- .react-calendar__navigation__arrow {
43
- background-color: transparent !important;
44
- }
45
-
46
- abbr[title] {
47
- text-decoration: none;
48
- font-weight: 400;
49
- color: #abaeb6;
50
- }
51
-
52
- .react-calendar__tile {
53
- transition: all 0.5s ease;
54
- }
55
-
56
- .react-calendar__tile:enabled:hover,
57
- .react-calendar__tile:enabled:focus {
58
- background-color: transparent;
59
- }
60
-
61
- .react-calendar__tile:enabled:hover {
62
- background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
63
- }
64
-
65
- .react-calendar__month-view__days__day--weekend,
66
- .react-calendar__tile {
67
- color: #3a4154;
68
- }
69
- .react-calendar__tile--hasActive {
70
- background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
71
- }
72
-
73
- .react-calendar__tile--active,
74
- .react-calendar__tile--active:enabled:hover,
75
- .react-calendar__tile--active:enabled:focus {
76
- background-color: transparent;
77
- background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%);
78
- color: #ffffff;
79
- }
80
- .react-calendar__tile--now {
81
- background-color: transparent;
82
- }
83
- .react-calendar__navigation button:disabled {
84
- background-color: #ffffff;
85
- color: #3a4154;
86
- }
1
+ .date_picker_input {
2
+ cursor: pointer;
3
+ }
4
+
5
+ .react-calendar {
6
+ width: 100%;
7
+ border: none;
8
+ padding: 15px 0px 15px 0px;
9
+ }
10
+
11
+ .react-calendar__navigation {
12
+ display: flex;
13
+ position: relative;
14
+ }
15
+ .react-calendar__navigation__label__labelText {
16
+ font-family: 'Lato', 'Roboto';
17
+ }
18
+ .react-calendar__navigation button:enabled:hover,
19
+ .react-calendar__navigation button:enabled:focus {
20
+ background-color: #ffffff;
21
+ }
22
+ .react-calendar__navigation__prev-button {
23
+ top: 20px;
24
+ left: 86px;
25
+ }
26
+
27
+ .react-calendar__navigation__next-button {
28
+ top: 0px;
29
+ left: 86px;
30
+ }
31
+
32
+ .react-calendar__navigation__prev2-button {
33
+ top: 20px;
34
+ right: 13px;
35
+ }
36
+
37
+ .react-calendar__navigation__next2-button {
38
+ top: 0px;
39
+ right: 13px;
40
+ }
41
+
42
+ .react-calendar__navigation__arrow {
43
+ background-color: transparent !important;
44
+ }
45
+
46
+ abbr[title] {
47
+ text-decoration: none;
48
+ font-weight: 400;
49
+ color: #abaeb6;
50
+ }
51
+
52
+ .react-calendar__tile {
53
+ transition: all 0.5s ease;
54
+ }
55
+
56
+ .react-calendar__tile:enabled:hover,
57
+ .react-calendar__tile:enabled:focus {
58
+ background-color: transparent;
59
+ }
60
+
61
+ .react-calendar__tile:enabled:hover {
62
+ background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
63
+ }
64
+
65
+ .react-calendar__month-view__days__day--weekend,
66
+ .react-calendar__tile {
67
+ color: #3a4154;
68
+ }
69
+ .react-calendar__tile--hasActive {
70
+ background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
71
+ }
72
+
73
+ .react-calendar__tile--active,
74
+ .react-calendar__tile--active:enabled:hover,
75
+ .react-calendar__tile--active:enabled:focus {
76
+ background-color: transparent;
77
+ background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%);
78
+ color: #ffffff;
79
+ }
80
+ .react-calendar__tile--now {
81
+ background-color: transparent;
82
+ }
83
+ .react-calendar__navigation button:disabled {
84
+ background-color: #ffffff;
85
+ color: #3a4154;
86
+ }
@@ -60,7 +60,7 @@ import { AuthForType, AuthTypeNumber, FlowsTypes, MigrationStatus } from '../../
60
60
  import { ADD_NEW_ENTITY, AUTH_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, SCOPE_AUTH, defaultCountry } from '../../../constants';
61
61
  import API from '../../../api';
62
62
  import { handleCurrentActiveScreen, handleNextScreenStep, handleOpen, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
63
- import { findCountryByIddPrefix, openConnect, sendCustomEventToGTM, sleep } from '../../../utils';
63
+ import { findCountryByIddPrefix, isNetworkError, openConnect, sendCustomEventToGTM, sleep } from '../../../utils';
64
64
  export var updateBusinessCountry = createAsyncThunk('auth/updateBusinessCountry', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
65
65
  var auth, payload, data;
66
66
  return __generator(this, function (_a) {
@@ -414,17 +414,29 @@ export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params
414
414
  interval = 3;
415
415
  maxCalls = Math.floor(expiry / interval);
416
416
  _loop_1 = function (count) {
417
- var data, isSuccess, isFailed, screen_1;
417
+ var data, error_1, isSuccess, isFailed, screen_1;
418
418
  return __generator(this, function (_h) {
419
419
  switch (_h.label) {
420
420
  case 0:
421
421
  if (thunkApi.signal.aborted) {
422
422
  return [2, "break"];
423
423
  }
424
- return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token)];
424
+ data = void 0;
425
+ _h.label = 1;
425
426
  case 1:
427
+ _h.trys.push([1, 3, , 4]);
428
+ return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token)];
429
+ case 2:
426
430
  data = _h.sent();
427
- isSuccess = ((_b = data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
431
+ return [3, 4];
432
+ case 3:
433
+ error_1 = _h.sent();
434
+ if (!isNetworkError(error_1.message)) {
435
+ throw new Error(error_1);
436
+ }
437
+ return [3, 4];
438
+ case 4:
439
+ isSuccess = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
428
440
  isFailed = ((_c = data === null || data === void 0 ? void 0 : data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'failed';
429
441
  if (isFailed) {
430
442
  (_d = params.onFailure) === null || _d === void 0 ? void 0 : _d.call(params);
@@ -441,7 +453,7 @@ export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params
441
453
  return [2, { value: data }];
442
454
  }
443
455
  return [4, sleep(interval * 1000)];
444
- case 2:
456
+ case 5:
445
457
  _h.sent();
446
458
  return [2];
447
459
  }
@@ -521,7 +533,7 @@ export var createCivilIdAuth = createAsyncThunk('auth/createCivilAuth', function
521
533
  });
522
534
  }); });
523
535
  export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
524
- var _a, settings, auth, authResponse, scope, expiry, interval, maxCalls, count, data, isSuccess;
536
+ var _a, settings, auth, authResponse, scope, expiry, interval, maxCalls, count, data, error_2, isSuccess;
525
537
  var _b, _c, _d;
526
538
  return __generator(this, function (_e) {
527
539
  switch (_e.label) {
@@ -535,13 +547,25 @@ export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, th
535
547
  count = 1;
536
548
  _e.label = 1;
537
549
  case 1:
538
- if (!(count <= maxCalls)) return [3, 5];
550
+ if (!(count <= maxCalls)) return [3, 8];
539
551
  if (thunkApi.signal.aborted) {
540
- return [3, 5];
552
+ return [3, 8];
541
553
  }
542
- return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token)];
554
+ data = void 0;
555
+ _e.label = 2;
543
556
  case 2:
557
+ _e.trys.push([2, 4, , 5]);
558
+ return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token)];
559
+ case 3:
544
560
  data = _e.sent();
561
+ return [3, 5];
562
+ case 4:
563
+ error_2 = _e.sent();
564
+ if (!isNetworkError(error_2.message)) {
565
+ throw new Error(error_2);
566
+ }
567
+ return [3, 5];
568
+ case 5:
545
569
  isSuccess = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
546
570
  if (isSuccess) {
547
571
  if (scope === 'merchant') {
@@ -553,13 +577,13 @@ export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, th
553
577
  return [2, data];
554
578
  }
555
579
  return [4, sleep(interval * 1000)];
556
- case 3:
580
+ case 6:
557
581
  _e.sent();
558
- _e.label = 4;
559
- case 4:
582
+ _e.label = 7;
583
+ case 7:
560
584
  count++;
561
585
  return [3, 1];
562
- case 5: throw new Error('paci_verification_failed');
586
+ case 8: throw new Error('paci_verification_failed');
563
587
  }
564
588
  });
565
589
  }); });
@@ -59,7 +59,7 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
59
59
  import API from '../../../api';
60
60
  import { BusinessType, FlowsTypes, DocumentPurpose, LicenseType } from '../../../@types';
61
61
  import { BUSINESS_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, EXPECTED_SALES_LIST, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_ENTITY_LICENSE, OTHER_FL_LICENSE, defaultCountry } from '../../../constants';
62
- import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense, isOtherThanKWOrSA, hasNoneEditableValue, sendCustomEventToGTM, findCountryByIddPrefix } from '../../../utils';
62
+ import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense, isOtherThanKWOrSA, hasNoneEditableValue, sendCustomEventToGTM, findCountryByIddPrefix, isNetworkError } from '../../../utils';
63
63
  import { handleNextScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
64
64
  export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
65
65
  var payload, data, publicKey, countryIso2, boardData, brandData, isicActivityList, leadData, _a, steps, brand, board_id, business_id, entity, brandID, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, list, list;
@@ -316,7 +316,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
316
316
  });
317
317
  }); });
318
318
  export var verifyNafath = createAsyncThunk('business/verifyNafathParams', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
319
- var _a, settings, business, responseBody, expiry, interval, maxCalls, count, data, isSuccess, isFailed, isNextScreenDob, isNextScreenCollectMobileOwnership, screen_1;
319
+ var _a, settings, business, responseBody, expiry, interval, maxCalls, count, data, error_1, isSuccess, isFailed, isNextScreenDob, isNextScreenCollectMobileOwnership, screen_1;
320
320
  var _b, _c, _d, _e, _f, _g;
321
321
  return __generator(this, function (_h) {
322
322
  switch (_h.label) {
@@ -332,24 +332,36 @@ export var verifyNafath = createAsyncThunk('business/verifyNafathParams', functi
332
332
  count = 1;
333
333
  _h.label = 1;
334
334
  case 1:
335
- if (!(count <= maxCalls)) return [3, 8];
336
- return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token)];
335
+ if (!(count <= maxCalls)) return [3, 11];
336
+ data = undefined;
337
+ _h.label = 2;
337
338
  case 2:
339
+ _h.trys.push([2, 4, , 5]);
340
+ return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token)];
341
+ case 3:
338
342
  data = _h.sent();
343
+ return [3, 5];
344
+ case 4:
345
+ error_1 = _h.sent();
346
+ if (!isNetworkError(error_1.message)) {
347
+ throw new Error(error_1);
348
+ }
349
+ return [3, 5];
350
+ case 5:
339
351
  isSuccess = ((_b = data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
340
352
  isFailed = ((_c = data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'failed';
341
353
  if (isFailed) {
342
354
  (_d = params.onFailure) === null || _d === void 0 ? void 0 : _d.call(params);
343
355
  return [2, { response: data }];
344
356
  }
345
- if (!isSuccess) return [3, 5];
357
+ if (!isSuccess) return [3, 8];
346
358
  return [4, thunkApi.dispatch(retrieveEntityList({ leadId: responseBody === null || responseBody === void 0 ? void 0 : responseBody.id }))];
347
- case 3:
359
+ case 6:
348
360
  _h.sent();
349
361
  (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
350
362
  (_g = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _g === void 0 ? void 0 : _g.call(params);
351
363
  return [4, sleep(3000)];
352
- case 4:
364
+ case 7:
353
365
  _h.sent();
354
366
  isNextScreenDob = data.step_name === COLLECT_DOB_INFO_NAFATH;
355
367
  isNextScreenCollectMobileOwnership = data.step_name === BUSINESS_STEP_NAMES.BUSINESS_MOBILE_OWNERSHIP;
@@ -361,14 +373,14 @@ export var verifyNafath = createAsyncThunk('business/verifyNafathParams', functi
361
373
  thunkApi.dispatch(handleNextScreenStep(screen_1));
362
374
  }
363
375
  return [2, { response: data, isNextScreenDob: isNextScreenDob }];
364
- case 5: return [4, sleep(interval * 1000)];
365
- case 6:
376
+ case 8: return [4, sleep(interval * 1000)];
377
+ case 9:
366
378
  _h.sent();
367
- _h.label = 7;
368
- case 7:
379
+ _h.label = 10;
380
+ case 10:
369
381
  count++;
370
382
  return [3, 1];
371
- case 8: throw new Error(NAFATH_VERIFICATION_FAILED);
383
+ case 11: throw new Error(NAFATH_VERIFICATION_FAILED);
372
384
  }
373
385
  });
374
386
  }); });
@@ -430,7 +442,7 @@ export var skipUpdateLeadMobile = createAsyncThunk('connect/skipUpdateLeadMobile
430
442
  });
431
443
  }); });
432
444
  export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
433
- var _a, settings, business, responseBody, _b, business_id, entity, expiry, interval, maxCalls, count, data, isSuccess;
445
+ var _a, settings, business, responseBody, _b, business_id, entity, expiry, interval, maxCalls, count, data, error_2, isSuccess;
434
446
  var _c, _d, _e, _f;
435
447
  return __generator(this, function (_g) {
436
448
  switch (_g.label) {
@@ -447,30 +459,42 @@ export var verifyPACI = createAsyncThunk('businessVerifyPACI', function (params,
447
459
  count = 1;
448
460
  _g.label = 1;
449
461
  case 1:
450
- if (!(count <= maxCalls)) return [3, 8];
451
- return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token)];
462
+ if (!(count <= maxCalls)) return [3, 11];
463
+ data = undefined;
464
+ _g.label = 2;
452
465
  case 2:
466
+ _g.trys.push([2, 4, , 5]);
467
+ return [4, API.authService.getTokenVerify(responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token)];
468
+ case 3:
453
469
  data = _g.sent();
470
+ return [3, 5];
471
+ case 4:
472
+ error_2 = _g.sent();
473
+ if (!isNetworkError(error_2.message)) {
474
+ throw new Error(error_2);
475
+ }
476
+ return [3, 5];
477
+ case 5:
454
478
  isSuccess = ((_c = data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'success';
455
- if (!isSuccess) return [3, 5];
479
+ if (!isSuccess) return [3, 8];
456
480
  return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
457
- case 3:
481
+ case 6:
458
482
  _g.sent();
459
483
  (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
460
484
  (_f = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _f === void 0 ? void 0 : _f.call(params);
461
485
  return [4, sleep(3000)];
462
- case 4:
486
+ case 7:
463
487
  _g.sent();
464
488
  thunkApi.dispatch(handleNextScreenStep());
465
489
  return [2, { response: data }];
466
- case 5: return [4, sleep(interval * 1000)];
467
- case 6:
490
+ case 8: return [4, sleep(interval * 1000)];
491
+ case 9:
468
492
  _g.sent();
469
- _g.label = 7;
470
- case 7:
493
+ _g.label = 10;
494
+ case 10:
471
495
  count++;
472
496
  return [3, 1];
473
- case 8: throw new Error('paci_verification_failed');
497
+ case 11: throw new Error('paci_verification_failed');
474
498
  }
475
499
  });
476
500
  }); });
@@ -284,7 +284,7 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
284
284
  });
285
285
  }); });
286
286
  export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
287
- var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, isSuccess, lead_id, leadResponse, countryCode, channels, brand, err_3, brands, err_4, phone;
287
+ var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, error_1, isSuccess, lead_id, leadResponse, countryCode, channels, brand, err_3, brands, err_4, phone;
288
288
  var _b, _c, _d, _e, _f;
289
289
  return __generator(this, function (_g) {
290
290
  switch (_g.label) {
@@ -297,53 +297,65 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
297
297
  count = 1;
298
298
  _g.label = 1;
299
299
  case 1:
300
- if (!(count <= maxCalls)) return [3, 16];
300
+ if (!(count <= maxCalls)) return [3, 19];
301
301
  if (thunkApi.signal.aborted) {
302
- return [3, 16];
302
+ return [3, 19];
303
303
  }
304
- return [4, API.authService.getVerifyAuth(responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token)];
304
+ authResponse = void 0;
305
+ _g.label = 2;
305
306
  case 2:
307
+ _g.trys.push([2, 4, , 5]);
308
+ return [4, API.authService.getVerifyAuth(responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token)];
309
+ case 3:
306
310
  authResponse = _g.sent();
307
- isSuccess = ((_b = authResponse.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
308
- if (!isSuccess) return [3, 13];
311
+ return [3, 5];
312
+ case 4:
313
+ error_1 = _g.sent();
314
+ if (!isNetworkError(error_1.message)) {
315
+ throw new Error(error_1);
316
+ }
317
+ return [3, 5];
318
+ case 5:
319
+ isSuccess = ((_b = authResponse === null || authResponse === void 0 ? void 0 : authResponse.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
320
+ if (!isSuccess) return [3, 16];
309
321
  lead_id = authResponse.lead_id;
310
322
  if (!lead_id)
311
323
  throw new Error('Lead id is missing');
312
324
  return [4, API.leadService.retrieveLead(lead_id)];
313
- case 3:
325
+ case 6:
314
326
  leadResponse = (_g.sent()).data;
315
327
  if ((_c = leadResponse.errors) === null || _c === void 0 ? void 0 : _c.length)
316
328
  throw new Error(leadResponse.errors[0].description);
317
329
  countryCode = settings.data.businessCountry;
318
330
  return [4, API.dataService.getChannelsOfServices({ page: 0 })];
319
- case 4:
331
+ case 7:
320
332
  channels = (_g.sent()).list;
321
333
  leadResponse.channel_list = channels;
322
- _g.label = 5;
323
- case 5:
324
- _g.trys.push([5, 7, , 8]);
334
+ _g.label = 8;
335
+ case 8:
336
+ _g.trys.push([8, 10, , 11]);
325
337
  return [4, API.brandService.retrieveBrand(leadResponse.brand.id)];
326
- case 6:
338
+ case 9:
327
339
  brand = (_g.sent()).brand;
328
340
  leadResponse.brand = __assign(__assign({}, leadResponse.brand), brand);
329
- return [3, 8];
330
- case 7:
341
+ return [3, 11];
342
+ case 10:
331
343
  err_3 = _g.sent();
332
- return [3, 8];
333
- case 8:
334
- _g.trys.push([8, 10, , 11]);
344
+ return [3, 11];
345
+ case 11:
346
+ _g.trys.push([11, 13, , 14]);
335
347
  return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
336
- case 9:
348
+ case 12:
337
349
  brands = (_g.sent()).brands;
338
350
  leadResponse.brand_list = fixBrandList(brands, channels);
339
- return [3, 11];
340
- case 10:
351
+ return [3, 14];
352
+ case 13:
341
353
  err_4 = _g.sent();
342
- return [3, 11];
343
- case 11:
354
+ return [3, 14];
355
+ case 14:
344
356
  (_d = params.onSuccess) === null || _d === void 0 ? void 0 : _d.call(params);
345
357
  return [4, sleep(3000)];
346
- case 12:
358
+ case 15:
347
359
  _g.sent();
348
360
  phone = (leadResponse.contact || {}).phone;
349
361
  if (phone === null || phone === void 0 ? void 0 : phone.country_code)
@@ -351,19 +363,19 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
351
363
  (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
352
364
  thunkApi.dispatch(handleNextScreenStep());
353
365
  return [2, { authResponse: authResponse, leadResponse: leadResponse, countryCode: countryCode }];
354
- case 13: return [4, sleep(interval * 1000)];
355
- case 14:
366
+ case 16: return [4, sleep(interval * 1000)];
367
+ case 17:
356
368
  _g.sent();
357
- _g.label = 15;
358
- case 15:
369
+ _g.label = 18;
370
+ case 18:
359
371
  count++;
360
372
  return [3, 1];
361
- case 16: throw new Error('paci_verification_failed');
373
+ case 19: throw new Error('paci_verification_failed');
362
374
  }
363
375
  });
364
376
  }); });
365
377
  export var verifyNafath = createAsyncThunk('connect/verifyNafath', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
366
- var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, error_1, isSuccess, isFailed, countryCode, lead_id, leadResponse, channels, brand, err_5, brands, err_6, phone, isNextScreenDob, stepName;
378
+ var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, error_2, isSuccess, isFailed, countryCode, lead_id, leadResponse, channels, brand, err_5, brands, err_6, phone, isNextScreenDob, stepName;
367
379
  var _b, _c, _d, _e, _f, _g, _h;
368
380
  return __generator(this, function (_j) {
369
381
  switch (_j.label) {
@@ -389,9 +401,9 @@ export var verifyNafath = createAsyncThunk('connect/verifyNafath', function (par
389
401
  authResponse = _j.sent();
390
402
  return [3, 5];
391
403
  case 4:
392
- error_1 = _j.sent();
393
- if (!isNetworkError(error_1.message)) {
394
- throw new Error(error_1);
404
+ error_2 = _j.sent();
405
+ if (!isNetworkError(error_2.message)) {
406
+ throw new Error(error_2);
395
407
  }
396
408
  return [3, 5];
397
409
  case 5:
@@ -61,7 +61,7 @@ import { FlowsTypes, AuthForType, BusinessType, LicenseType } from '../../../@ty
61
61
  import API from '../../../api';
62
62
  import { ADD_NEW_ENTITY, COLLECT_DOB_INFO_NAFATH, CONNECT_EXPRESS_STEP_NAMES, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_FL_LICENSE, SCOPE_AUTH } from '../../../constants';
63
63
  import { defaultCountry } from '../../../constants';
64
- import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA, isKW, isOtherThanKWOrSA, sendCustomEventToGTM, sendCustomDimension, getMetaData } from '../../../utils';
64
+ import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA, isKW, isOtherThanKWOrSA, sendCustomEventToGTM, sendCustomDimension, getMetaData, isNetworkError } from '../../../utils';
65
65
  export var updateBusinessCountryAsync = createAsyncThunk('connectExpress/updateBusinessCountryAsync', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
66
66
  var connectExpress, payload, data;
67
67
  return __generator(this, function (_a) {
@@ -346,7 +346,7 @@ export var createNafathAuth = createAsyncThunk('connectExpress/createNafathAuth'
346
346
  });
347
347
  }); });
348
348
  export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
349
- var _a, settings, connectExpress, authData, _b, scope, redirectUrl, authConfigData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, expiry, interval, maxCalls, count, data, isSuccess, isFailed, authId, leadId, urlQueryStart, _c, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount, askDobInfo;
349
+ var _a, settings, connectExpress, authData, _b, scope, redirectUrl, authConfigData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, expiry, interval, maxCalls, count, data, error_2, isSuccess, isFailed, authId, leadId, urlQueryStart, _c, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount, askDobInfo;
350
350
  var _d, _e, _f, _g, _h, _j, _k, _l;
351
351
  return __generator(this, function (_m) {
352
352
  switch (_m.label) {
@@ -364,20 +364,32 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
364
364
  count = 1;
365
365
  _m.label = 1;
366
366
  case 1:
367
- if (!(count <= maxCalls)) return [3, 9];
367
+ if (!(count <= maxCalls)) return [3, 12];
368
368
  if (thunkApi.signal.aborted) {
369
- return [3, 9];
369
+ return [3, 12];
370
370
  }
371
- return [4, API.authService.getVerifyExpressAuth(authData === null || authData === void 0 ? void 0 : authData.auth_token)];
371
+ data = undefined;
372
+ _m.label = 2;
372
373
  case 2:
374
+ _m.trys.push([2, 4, , 5]);
375
+ return [4, API.authService.getVerifyExpressAuth(authData === null || authData === void 0 ? void 0 : authData.auth_token)];
376
+ case 3:
373
377
  data = _m.sent();
378
+ return [3, 5];
379
+ case 4:
380
+ error_2 = _m.sent();
381
+ if (!isNetworkError(error_2.message)) {
382
+ throw new Error(error_2);
383
+ }
384
+ return [3, 5];
385
+ case 5:
374
386
  isSuccess = ((_e = (_d = data.auth) === null || _d === void 0 ? void 0 : _d.status) === null || _e === void 0 ? void 0 : _e.toLowerCase()) === 'success';
375
387
  isFailed = ((_g = (_f = data.auth) === null || _f === void 0 ? void 0 : _f.status) === null || _g === void 0 ? void 0 : _g.toLowerCase()) === 'failed';
376
388
  if (isFailed) {
377
389
  (_h = params.onFailure) === null || _h === void 0 ? void 0 : _h.call(params);
378
390
  return [2, { data: data }];
379
391
  }
380
- if (!isSuccess) return [3, 6];
392
+ if (!isSuccess) return [3, 9];
381
393
  authId = (_j = data.auth) === null || _j === void 0 ? void 0 : _j.id;
382
394
  leadId = (_k = data.auth) === null || _k === void 0 ? void 0 : _k.lead_id;
383
395
  thunkApi.dispatch(storeAuthId(authId));
@@ -393,17 +405,17 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
393
405
  return [2, { data: data }];
394
406
  }
395
407
  }
396
- if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 4];
408
+ if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 7];
397
409
  return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
398
- case 3:
410
+ case 6:
399
411
  _c = _m.sent(), brandList = _c.brandList, entityList = _c.entityList;
400
412
  if (brandList.length && entityList.length) {
401
413
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP')); });
402
414
  return [2, { data: data }];
403
415
  }
404
- _m.label = 4;
405
- case 4: return [4, thunkApi.dispatch(getLeadByIdAsync(leadId)).unwrap()];
406
- case 5:
416
+ _m.label = 7;
417
+ case 7: return [4, thunkApi.dispatch(getLeadByIdAsync(leadId)).unwrap()];
418
+ case 8:
407
419
  _m.sent();
408
420
  stepName = data.step_name;
409
421
  needToCollectMoreInfo = stepName === 'collect_info';
@@ -420,14 +432,14 @@ export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsyn
420
432
  sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP')); });
421
433
  }
422
434
  return [2, { data: data, isNextScreenIsDob: askDobInfo }];
423
- case 6: return [4, sleep(interval * 1000)];
424
- case 7:
435
+ case 9: return [4, sleep(interval * 1000)];
436
+ case 10:
425
437
  _m.sent();
426
- _m.label = 8;
427
- case 8:
438
+ _m.label = 11;
439
+ case 11:
428
440
  count++;
429
441
  return [3, 1];
430
- case 9: throw new Error(NAFATH_VERIFICATION_FAILED);
442
+ case 12: throw new Error(NAFATH_VERIFICATION_FAILED);
431
443
  }
432
444
  });
433
445
  }); });
@@ -536,7 +548,7 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
536
548
  });
537
549
  }); });
538
550
  export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
539
- var _a, settings, connectExpress, authData, _b, scope, redirectUrl, authConfigData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, expiry, interval, maxCalls, count, data, isSuccess, authId, urlQueryStart, _c, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
551
+ var _a, settings, connectExpress, authData, _b, scope, redirectUrl, authConfigData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, expiry, interval, maxCalls, count, data, error_3, isSuccess, authId, urlQueryStart, _c, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
540
552
  var _d, _e, _f;
541
553
  return __generator(this, function (_g) {
542
554
  switch (_g.label) {
@@ -554,15 +566,27 @@ export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync',
554
566
  count = 1;
555
567
  _g.label = 1;
556
568
  case 1:
557
- if (!(count <= maxCalls)) return [3, 9];
569
+ if (!(count <= maxCalls)) return [3, 12];
558
570
  if (thunkApi.signal.aborted) {
559
- return [3, 9];
571
+ return [3, 12];
560
572
  }
561
- return [4, API.authService.getVerifyExpressAuth(authData === null || authData === void 0 ? void 0 : authData.auth_token)];
573
+ data = undefined;
574
+ _g.label = 2;
562
575
  case 2:
576
+ _g.trys.push([2, 4, , 5]);
577
+ return [4, API.authService.getVerifyExpressAuth(authData === null || authData === void 0 ? void 0 : authData.auth_token)];
578
+ case 3:
563
579
  data = _g.sent();
580
+ return [3, 5];
581
+ case 4:
582
+ error_3 = _g.sent();
583
+ if (!isNetworkError(error_3.message)) {
584
+ throw new Error(error_3);
585
+ }
586
+ return [3, 5];
587
+ case 5:
564
588
  isSuccess = ((_e = (_d = data.auth) === null || _d === void 0 ? void 0 : _d.status) === null || _e === void 0 ? void 0 : _e.toLowerCase()) === 'success';
565
- if (!isSuccess) return [3, 6];
589
+ if (!isSuccess) return [3, 9];
566
590
  authId = data.auth.id;
567
591
  thunkApi.dispatch(storeAuthId(authId));
568
592
  if (isScopeAuthentication && !data.new_user && isDataHasIndividualOnly && authId) {
@@ -577,17 +601,17 @@ export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync',
577
601
  return [2, data];
578
602
  }
579
603
  }
580
- if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 4];
604
+ if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 7];
581
605
  return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
582
- case 3:
606
+ case 6:
583
607
  _c = _g.sent(), brandList = _c.brandList, entityList = _c.entityList;
584
608
  if (brandList.length && entityList.length) {
585
609
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP')); });
586
610
  return [2, data];
587
611
  }
588
- _g.label = 4;
589
- case 4: return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead.id)).unwrap()];
590
- case 5:
612
+ _g.label = 7;
613
+ case 7: return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead.id)).unwrap()];
614
+ case 8:
591
615
  _g.sent();
592
616
  stepName = data.step_name;
593
617
  needToCollectMoreInfo = stepName === 'collect_info';
@@ -600,14 +624,14 @@ export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync',
600
624
  sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP')); });
601
625
  }
602
626
  return [2, data];
603
- case 6: return [4, sleep(interval * 1000)];
604
- case 7:
627
+ case 9: return [4, sleep(interval * 1000)];
628
+ case 10:
605
629
  _g.sent();
606
- _g.label = 8;
607
- case 8:
630
+ _g.label = 11;
631
+ case 11:
608
632
  count++;
609
633
  return [3, 1];
610
- case 9: throw new Error('paci_verification_failed');
634
+ case 12: throw new Error('paci_verification_failed');
611
635
  }
612
636
  });
613
637
  }); });
@@ -685,7 +709,7 @@ export var createNIDNafathAuthIdentityAsync = createAsyncThunk('connectExpress/c
685
709
  });
686
710
  }); });
687
711
  export var verifyNafathIdentityAsync = createAsyncThunk('connectExpress/verifyNafathIdentityAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
688
- var connectExpress, authData, expiry, interval, maxCalls, count, data, isSuccess, isFailed, needToCollectMoreInfo, creatingAccount, askDobInfo, collectPhoneOwnershipScreen;
712
+ var connectExpress, authData, expiry, interval, maxCalls, count, data, error_4, isSuccess, isFailed, needToCollectMoreInfo, creatingAccount, askDobInfo, collectPhoneOwnershipScreen;
689
713
  var _a, _b, _c, _d, _e, _f, _g;
690
714
  return __generator(this, function (_h) {
691
715
  switch (_h.label) {
@@ -698,22 +722,34 @@ export var verifyNafathIdentityAsync = createAsyncThunk('connectExpress/verifyNa
698
722
  count = 1;
699
723
  _h.label = 1;
700
724
  case 1:
701
- if (!(count <= maxCalls)) return [3, 7];
725
+ if (!(count <= maxCalls)) return [3, 10];
702
726
  if (thunkApi.signal.aborted) {
703
- return [3, 7];
727
+ return [3, 10];
704
728
  }
705
- return [4, API.authService.getExpressTokenVerify({ token: authData === null || authData === void 0 ? void 0 : authData.verify_token, leadId: authData === null || authData === void 0 ? void 0 : authData.lead_id })];
729
+ data = undefined;
730
+ _h.label = 2;
706
731
  case 2:
732
+ _h.trys.push([2, 4, , 5]);
733
+ return [4, API.authService.getExpressTokenVerify({ token: authData === null || authData === void 0 ? void 0 : authData.verify_token, leadId: authData === null || authData === void 0 ? void 0 : authData.lead_id })];
734
+ case 3:
707
735
  data = _h.sent();
736
+ return [3, 5];
737
+ case 4:
738
+ error_4 = _h.sent();
739
+ if (!isNetworkError(error_4.message)) {
740
+ throw new Error(error_4);
741
+ }
742
+ return [3, 5];
743
+ case 5:
708
744
  isSuccess = ((_b = (_a = data.auth) === null || _a === void 0 ? void 0 : _a.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
709
745
  isFailed = ((_d = (_c = data.auth) === null || _c === void 0 ? void 0 : _c.status) === null || _d === void 0 ? void 0 : _d.toLowerCase()) === 'failed';
710
746
  if (isFailed) {
711
747
  (_e = params.onFailure) === null || _e === void 0 ? void 0 : _e.call(params);
712
748
  return [2, { data: data }];
713
749
  }
714
- if (!isSuccess) return [3, 4];
750
+ if (!isSuccess) return [3, 7];
715
751
  return [4, thunkApi.dispatch(getLeadByIdAsync((_f = data.auth) === null || _f === void 0 ? void 0 : _f.lead_id)).unwrap()];
716
- case 3:
752
+ case 6:
717
753
  _h.sent();
718
754
  needToCollectMoreInfo = data.step_name === 'collect_info';
719
755
  creatingAccount = data.step_name === 'create_account';
@@ -733,19 +769,19 @@ export var verifyNafathIdentityAsync = createAsyncThunk('connectExpress/verifyNa
733
769
  sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP')); });
734
770
  }
735
771
  return [2, { data: data, isNextScreenIsDob: askDobInfo }];
736
- case 4: return [4, sleep(interval * 1000)];
737
- case 5:
772
+ case 7: return [4, sleep(interval * 1000)];
773
+ case 8:
738
774
  _h.sent();
739
- _h.label = 6;
740
- case 6:
775
+ _h.label = 9;
776
+ case 9:
741
777
  count++;
742
778
  return [3, 1];
743
- case 7: throw new Error(NAFATH_VERIFICATION_FAILED);
779
+ case 10: throw new Error(NAFATH_VERIFICATION_FAILED);
744
780
  }
745
781
  });
746
782
  }); });
747
783
  export var verifyPaciLeadIdentityAsync = createAsyncThunk('connectExpress/verifyPaciLeadIdentityAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
748
- var connectExpress, authData, expiry, interval, maxCalls, count, data, isSuccess, needToCollectMoreInfo, creatingAccount;
784
+ var connectExpress, authData, expiry, interval, maxCalls, count, data, error_5, isSuccess, needToCollectMoreInfo, creatingAccount;
749
785
  var _a, _b, _c;
750
786
  return __generator(this, function (_d) {
751
787
  switch (_d.label) {
@@ -758,17 +794,29 @@ export var verifyPaciLeadIdentityAsync = createAsyncThunk('connectExpress/verify
758
794
  count = 1;
759
795
  _d.label = 1;
760
796
  case 1:
761
- if (!(count <= maxCalls)) return [3, 7];
797
+ if (!(count <= maxCalls)) return [3, 10];
762
798
  if (thunkApi.signal.aborted) {
763
- return [3, 7];
799
+ return [3, 10];
764
800
  }
765
- return [4, API.authService.getExpressTokenVerify({ token: authData === null || authData === void 0 ? void 0 : authData.verify_token, leadId: authData === null || authData === void 0 ? void 0 : authData.lead_id })];
801
+ data = undefined;
802
+ _d.label = 2;
766
803
  case 2:
804
+ _d.trys.push([2, 4, , 5]);
805
+ return [4, API.authService.getExpressTokenVerify({ token: authData === null || authData === void 0 ? void 0 : authData.verify_token, leadId: authData === null || authData === void 0 ? void 0 : authData.lead_id })];
806
+ case 3:
767
807
  data = _d.sent();
808
+ return [3, 5];
809
+ case 4:
810
+ error_5 = _d.sent();
811
+ if (!isNetworkError(error_5.message)) {
812
+ throw new Error(error_5);
813
+ }
814
+ return [3, 5];
815
+ case 5:
768
816
  isSuccess = ((_b = (_a = data.auth) === null || _a === void 0 ? void 0 : _a.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
769
- if (!isSuccess) return [3, 4];
817
+ if (!isSuccess) return [3, 7];
770
818
  return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead.id)).unwrap()];
771
- case 3:
819
+ case 6:
772
820
  _d.sent();
773
821
  needToCollectMoreInfo = data.step_name === 'collect_info';
774
822
  creatingAccount = data.step_name === 'create_account';
@@ -780,14 +828,14 @@ export var verifyPaciLeadIdentityAsync = createAsyncThunk('connectExpress/verify
780
828
  sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP')); });
781
829
  }
782
830
  return [2, data];
783
- case 4: return [4, sleep(interval * 1000)];
784
- case 5:
831
+ case 7: return [4, sleep(interval * 1000)];
832
+ case 8:
785
833
  _d.sent();
786
- _d.label = 6;
787
- case 6:
834
+ _d.label = 9;
835
+ case 9:
788
836
  count++;
789
837
  return [3, 1];
790
- case 7: throw new Error('nafath_verification_failed');
838
+ case 10: throw new Error('nafath_verification_failed');
791
839
  }
792
840
  });
793
841
  }); });
@@ -51,7 +51,7 @@ import { handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
51
51
  import { FlowsTypes } from '../../../@types';
52
52
  import { CONNECT_FLOWS, KYC_STEP_NAMES, NAFATH_VERIFICATION_FAILED } from '../../../constants';
53
53
  import API from '../../../api';
54
- import { sendCustomEventToGTM, sleep } from '../../../utils';
54
+ import { isNetworkError, sendCustomEventToGTM, sleep } from '../../../utils';
55
55
  export var verifyTokenApi = createAsyncThunk('kyc/verifyTokenApi', function (_a, thunkApi) {
56
56
  var token = _a.token;
57
57
  return __awaiter(void 0, void 0, void 0, function () {
@@ -161,7 +161,7 @@ export var createNafathAuth = createAsyncThunk('kyc/createNafathAuth', function
161
161
  });
162
162
  }); });
163
163
  export var verifyNafath = createAsyncThunk('kyc/verifyNafath', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
164
- var kyc, createAuthData, expiry, interval, maxCalls, count, data, isSuccess, isFailed, nextScreen;
164
+ var kyc, createAuthData, expiry, interval, maxCalls, count, data, error_1, isSuccess, isFailed, nextScreen;
165
165
  var _a, _b, _c, _d;
166
166
  return __generator(this, function (_e) {
167
167
  switch (_e.label) {
@@ -174,39 +174,51 @@ export var verifyNafath = createAsyncThunk('kyc/verifyNafath', function (params,
174
174
  count = 1;
175
175
  _e.label = 1;
176
176
  case 1:
177
- if (!(count <= maxCalls)) return [3, 7];
177
+ if (!(count <= maxCalls)) return [3, 10];
178
178
  if (thunkApi.signal.aborted) {
179
- return [3, 7];
179
+ return [3, 10];
180
180
  }
181
- return [4, API.authService.getVerifyAuth(createAuthData === null || createAuthData === void 0 ? void 0 : createAuthData.auth_token)];
181
+ data = undefined;
182
+ _e.label = 2;
182
183
  case 2:
184
+ _e.trys.push([2, 4, , 5]);
185
+ return [4, API.authService.getVerifyAuth(createAuthData === null || createAuthData === void 0 ? void 0 : createAuthData.auth_token)];
186
+ case 3:
183
187
  data = _e.sent();
188
+ return [3, 5];
189
+ case 4:
190
+ error_1 = _e.sent();
191
+ if (!isNetworkError(error_1.message)) {
192
+ throw new Error(error_1);
193
+ }
194
+ return [3, 5];
195
+ case 5:
184
196
  isSuccess = ((_a = data === null || data === void 0 ? void 0 : data.status) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'success';
185
197
  isFailed = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'failed';
186
198
  if (isFailed) {
187
199
  (_c = params.onFailure) === null || _c === void 0 ? void 0 : _c.call(params);
188
200
  return [2, { data: data, createAuthData: createAuthData }];
189
201
  }
190
- if (!isSuccess) return [3, 4];
202
+ if (!isSuccess) return [3, 7];
191
203
  (_d = params.onSuccess) === null || _d === void 0 ? void 0 : _d.call(params);
192
204
  return [4, thunkApi.dispatch(updateKYCSuccess())];
193
- case 3:
205
+ case 6:
194
206
  _e.sent();
195
207
  nextScreen = CONNECT_FLOWS.kyc.success;
196
208
  return [2, { data: data, nextScreen: nextScreen, createAuthData: createAuthData }];
197
- case 4: return [4, sleep(interval * 1000)];
198
- case 5:
209
+ case 7: return [4, sleep(interval * 1000)];
210
+ case 8:
199
211
  _e.sent();
200
- _e.label = 6;
201
- case 6:
212
+ _e.label = 9;
213
+ case 9:
202
214
  count++;
203
215
  return [3, 1];
204
- case 7: throw new Error(NAFATH_VERIFICATION_FAILED);
216
+ case 10: throw new Error(NAFATH_VERIFICATION_FAILED);
205
217
  }
206
218
  });
207
219
  }); });
208
220
  export var verifyPaci = createAsyncThunk('kyc/verifyPaci', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
209
- var kyc, createAuthData, expiry, interval, maxCalls, count, data, isSuccess, nextScreen;
221
+ var kyc, createAuthData, expiry, interval, maxCalls, count, data, error_2, isSuccess, nextScreen;
210
222
  var _a, _b;
211
223
  return __generator(this, function (_c) {
212
224
  switch (_c.label) {
@@ -219,29 +231,41 @@ export var verifyPaci = createAsyncThunk('kyc/verifyPaci', function (params, thu
219
231
  count = 1;
220
232
  _c.label = 1;
221
233
  case 1:
222
- if (!(count <= maxCalls)) return [3, 7];
234
+ if (!(count <= maxCalls)) return [3, 10];
223
235
  if (thunkApi.signal.aborted) {
224
- return [3, 7];
236
+ return [3, 10];
225
237
  }
226
- return [4, API.authService.getVerifyAuth(createAuthData === null || createAuthData === void 0 ? void 0 : createAuthData.auth_token)];
238
+ data = undefined;
239
+ _c.label = 2;
227
240
  case 2:
241
+ _c.trys.push([2, 4, , 5]);
242
+ return [4, API.authService.getVerifyAuth(createAuthData === null || createAuthData === void 0 ? void 0 : createAuthData.auth_token)];
243
+ case 3:
228
244
  data = _c.sent();
245
+ return [3, 5];
246
+ case 4:
247
+ error_2 = _c.sent();
248
+ if (!isNetworkError(error_2.message)) {
249
+ throw new Error(error_2);
250
+ }
251
+ return [3, 5];
252
+ case 5:
229
253
  isSuccess = ((_a = data.status) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'success';
230
- if (!isSuccess) return [3, 4];
254
+ if (!isSuccess) return [3, 7];
231
255
  (_b = params.onSuccess) === null || _b === void 0 ? void 0 : _b.call(params);
232
256
  return [4, thunkApi.dispatch(updateKYCSuccess())];
233
- case 3:
257
+ case 6:
234
258
  _c.sent();
235
259
  nextScreen = CONNECT_FLOWS.kyc.success;
236
260
  return [2, { data: data, nextScreen: nextScreen, createAuthData: createAuthData }];
237
- case 4: return [4, sleep(interval * 1000)];
238
- case 5:
261
+ case 7: return [4, sleep(interval * 1000)];
262
+ case 8:
239
263
  _c.sent();
240
- _c.label = 6;
241
- case 6:
264
+ _c.label = 9;
265
+ case 9:
242
266
  count++;
243
267
  return [3, 1];
244
- case 7: throw new Error('paci_verification_failed');
268
+ case 10: throw new Error('paci_verification_failed');
245
269
  }
246
270
  });
247
271
  }); });
@@ -59,10 +59,9 @@ var CurrentMobileContainerStyled = styled(Box)(function (_a) {
59
59
  });
60
60
  var MobileNumberContainer = styled(Box)(function (_a) {
61
61
  var theme = _a.theme;
62
- return ({
63
- display: 'flex',
64
- columnGap: theme.spacing(0.9)
65
- });
62
+ return (__assign({ display: 'flex', columnGap: theme.spacing(0.9), direction: 'ltr' }, (theme.direction === 'rtl' && {
63
+ marginLeft: 'auto'
64
+ })));
66
65
  });
67
66
  var CountryCodeStyled = styled(Text)(function (_a) {
68
67
  var theme = _a.theme;
@@ -60,10 +60,9 @@ var CurrentMobileContainerStyled = styled(Box)(function (_a) {
60
60
  });
61
61
  var MobileNumberContainer = styled(Box)(function (_a) {
62
62
  var theme = _a.theme;
63
- return ({
64
- display: 'flex',
65
- columnGap: theme.spacing(0.9)
66
- });
63
+ return (__assign({ display: 'flex', columnGap: theme.spacing(0.9), direction: 'ltr' }, (theme.direction === 'rtl' && {
64
+ marginLeft: 'auto'
65
+ })));
67
66
  });
68
67
  var CountryCodeStyled = styled(Text)(function (_a) {
69
68
  var theme = _a.theme;
@@ -61,10 +61,9 @@ var CurrentMobileContainerStyled = styled(Box)(function (_a) {
61
61
  });
62
62
  var MobileNumberContainer = styled(Box)(function (_a) {
63
63
  var theme = _a.theme;
64
- return ({
65
- display: 'flex',
66
- columnGap: theme.spacing(0.9)
67
- });
64
+ return (__assign({ display: 'flex', columnGap: theme.spacing(0.9), direction: 'ltr' }, (theme.direction === 'rtl' && {
65
+ marginLeft: 'auto'
66
+ })));
68
67
  });
69
68
  var CountryCodeStyled = styled(Text)(function (_a) {
70
69
  var theme = _a.theme;
@@ -69,7 +69,7 @@ var Users = function () {
69
69
  })
70
70
  .catch(function () { });
71
71
  };
72
- return (_jsxs(ScreenContainer, __assign({ sx: { pl: 2, pr: 2 } }, { children: [_jsx(DescriptionStyled, { children: st('kyc_users_description', { provider: isSACountry ? 'NAFATH' : 'PACI' }) }), userList.map(function (user, index) {
72
+ return (_jsxs(ScreenContainer, __assign({ sx: { pl: 2, pr: 2, pb: 3 } }, { children: [_jsx(DescriptionStyled, { children: st('kyc_users_description', { provider: isSACountry ? 'NAFATH' : 'PACI' }) }), userList.map(function (user, index) {
73
73
  return (_jsx(BoxStyled, __assign({ onClick: function () { return onClickUser(user); } }, { children: (activeUser === null || activeUser === void 0 ? void 0 : activeUser.id) === user.id && loading ? (_jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 8, style: { height: 20, width: 20 }, toggleAnimation: !!loading })) : (_jsxs(_Fragment, { children: [_jsx(ImgStyled, { src: ICONS_NAMES.individual_filled_icon }), maskIDNumber(user.identification.id), _jsx("span", {})] })) }), index));
74
74
  }), error && (_jsx(Warning, __assign({ sx: { mt: 3, mb: 3 }, warningType: 'error' }, { children: error })))] })));
75
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.10.2-beta",
3
+ "version": "2.10.5-beta",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",