@tap-payments/auth-jsconnect 2.10.0-beta → 2.10.0-sandbox
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/build/@types/app.d.ts +7 -1
- package/build/@types/app.js +7 -0
- package/build/@types/form.d.ts +3 -0
- package/build/api/account.d.ts +1 -0
- package/build/api/account.js +7 -0
- package/build/api/auth.d.ts +1 -0
- package/build/api/index.d.ts +1 -0
- package/build/app/settings.d.ts +1 -0
- package/build/app/settings.js +9 -4
- package/build/assets/currencies/SARSymbol.d.ts +7 -0
- package/build/assets/currencies/SARSymbol.js +28 -0
- package/build/assets/currencies/index.d.ts +2 -0
- package/build/assets/currencies/index.js +2 -0
- package/build/assets/currencies/utils.d.ts +4 -0
- package/build/assets/currencies/utils.js +4 -0
- package/build/assets/locales/ar.json +10 -1
- package/build/assets/locales/en.json +36 -1
- package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
- package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
- package/build/components/TextWithCurrency/index.d.ts +2 -0
- package/build/components/TextWithCurrency/index.js +2 -0
- package/build/constants/api.d.ts +1 -1
- package/build/constants/api.js +2 -2
- package/build/constants/app.d.ts +3 -1
- package/build/constants/app.js +42 -13
- package/build/constants/assets.d.ts +4 -0
- package/build/constants/assets.js +9 -2
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/auth/authStore.d.ts +24 -5
- package/build/features/app/auth/authStore.js +186 -89
- package/build/features/app/business/businessStore.js +53 -29
- package/build/features/app/connect/connectStore.js +47 -35
- package/build/features/app/connectExpress/connectExpressStore.d.ts +14 -3
- package/build/features/app/connectExpress/connectExpressStore.js +301 -109
- package/build/features/app/individual/individualStore.js +0 -1
- package/build/features/app/kyc/kycStore.js +49 -25
- package/build/features/auth/screens/OTP/OTP.d.ts +13 -2
- package/build/features/auth/screens/OTP/OTP.js +15 -3
- package/build/features/auth/screens/OTP/index.d.ts +1 -2
- package/build/features/auth/screens/Passcode/Passcode.d.ts +16 -0
- package/build/features/auth/screens/Passcode/Passcode.js +82 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.d.ts +6 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.js +42 -0
- package/build/features/auth/screens/Passcode/index.d.ts +2 -0
- package/build/features/auth/screens/Passcode/index.js +2 -0
- package/build/features/auth/screens/Passcode/validation.d.ts +8 -0
- package/build/features/auth/screens/Passcode/validation.js +4 -0
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -8
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -8
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +4 -6
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +4 -6
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.d.ts +3 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.js +9 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.d.ts +2 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.js +2 -0
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +4 -6
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.js +49 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.js +88 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.d.ts +3 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.js +2 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.js +4 -0
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +9 -3
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +3 -7
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +3 -7
- package/build/features/featuresScreens.js +10 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/kyc/screens/Terms/Terms.js +8 -2
- package/build/features/kyc/screens/Users/Users.js +1 -1
- package/build/features/shared/Background/LogoBackground.js +5 -17
- package/build/features/shared/Button/Button.js +1 -2
- package/build/features/shared/Button/FlowsButtons.js +2 -1
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/hooks/useAppConfig.js +1 -1
- package/build/utils/common.d.ts +1 -1
- package/build/utils/common.js +6 -4
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/build/utils/string.d.ts +1 -1
- package/package.json +3 -4
|
@@ -58,8 +58,8 @@ var _a;
|
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
59
|
import API from '../../../api';
|
|
60
60
|
import { BusinessType, FlowsTypes, DocumentPurpose, LicenseType } from '../../../@types';
|
|
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';
|
|
61
|
+
import { BUSINESS_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, EXPECTED_SALES_LIST, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, 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, isNetworkError, isTimeoutError } 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,
|
|
336
|
-
|
|
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, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
|
|
341
|
+
case 3:
|
|
338
342
|
data = _h.sent();
|
|
339
|
-
|
|
340
|
-
|
|
343
|
+
return [3, 5];
|
|
344
|
+
case 4:
|
|
345
|
+
error_1 = _h.sent();
|
|
346
|
+
if (!isNetworkError(error_1.message) && !isTimeoutError(error_1.message)) {
|
|
347
|
+
throw new Error(error_1);
|
|
348
|
+
}
|
|
349
|
+
return [3, 5];
|
|
350
|
+
case 5:
|
|
351
|
+
isSuccess = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
352
|
+
isFailed = ((_c = data === null || data === void 0 ? void 0 : 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,
|
|
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
|
|
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
|
|
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,18 +373,18 @@ 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
|
|
365
|
-
case
|
|
376
|
+
case 8: return [4, sleep(interval * 1000)];
|
|
377
|
+
case 9:
|
|
366
378
|
_h.sent();
|
|
367
|
-
_h.label =
|
|
368
|
-
case
|
|
379
|
+
_h.label = 10;
|
|
380
|
+
case 10:
|
|
369
381
|
count++;
|
|
370
382
|
return [3, 1];
|
|
371
|
-
case
|
|
383
|
+
case 11: throw new Error(NAFATH_VERIFICATION_FAILED);
|
|
372
384
|
}
|
|
373
385
|
});
|
|
374
386
|
}); });
|
|
375
|
-
export var updateLeadMobile = createAsyncThunk('
|
|
387
|
+
export var updateLeadMobile = createAsyncThunk('business/updateLeadMobile', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
376
388
|
var _a, settings, business, lead_id, payload, leadResponse, isNextScreenDob, screen;
|
|
377
389
|
var _b, _c;
|
|
378
390
|
return __generator(this, function (_d) {
|
|
@@ -405,7 +417,7 @@ export var updateLeadMobile = createAsyncThunk('connect/updateLeadMobile', funct
|
|
|
405
417
|
}
|
|
406
418
|
});
|
|
407
419
|
}); });
|
|
408
|
-
export var skipUpdateLeadMobile = createAsyncThunk('
|
|
420
|
+
export var skipUpdateLeadMobile = createAsyncThunk('business/skipUpdateLeadMobile', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
409
421
|
var _a, settings, business, lead_id, payload, leadResponse, isNextScreenDob, screen;
|
|
410
422
|
var _b, _c;
|
|
411
423
|
return __generator(this, function (_d) {
|
|
@@ -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,
|
|
451
|
-
|
|
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, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
|
|
468
|
+
case 3:
|
|
453
469
|
data = _g.sent();
|
|
454
|
-
|
|
455
|
-
|
|
470
|
+
return [3, 5];
|
|
471
|
+
case 4:
|
|
472
|
+
error_2 = _g.sent();
|
|
473
|
+
if (!isNetworkError(error_2.message) && !isTimeoutError(error_2.message)) {
|
|
474
|
+
throw new Error(error_2);
|
|
475
|
+
}
|
|
476
|
+
return [3, 5];
|
|
477
|
+
case 5:
|
|
478
|
+
isSuccess = ((_c = data === null || data === void 0 ? void 0 : data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'success';
|
|
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
|
|
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
|
|
486
|
+
case 7:
|
|
463
487
|
_g.sent();
|
|
464
488
|
thunkApi.dispatch(handleNextScreenStep());
|
|
465
489
|
return [2, { response: data }];
|
|
466
|
-
case
|
|
467
|
-
case
|
|
490
|
+
case 8: return [4, sleep(interval * 1000)];
|
|
491
|
+
case 9:
|
|
468
492
|
_g.sent();
|
|
469
|
-
_g.label =
|
|
470
|
-
case
|
|
493
|
+
_g.label = 10;
|
|
494
|
+
case 10:
|
|
471
495
|
count++;
|
|
472
496
|
return [3, 1];
|
|
473
|
-
case
|
|
497
|
+
case 11: throw new Error('paci_verification_failed');
|
|
474
498
|
}
|
|
475
499
|
});
|
|
476
500
|
}); });
|
|
@@ -68,10 +68,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
68
68
|
var _a;
|
|
69
69
|
import API from '../../../api';
|
|
70
70
|
import { handleCurrentActiveScreen, handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
71
|
-
import { COLLECT_DOB_INFO_NAFATH, CONNECT_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, OTHER_BRAND } from '../../../constants';
|
|
71
|
+
import { COLLECT_DOB_INFO_NAFATH, CONNECT_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, OTHER_BRAND } from '../../../constants';
|
|
72
72
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
73
73
|
import { AuthForType, FlowsTypes } from '../../../@types';
|
|
74
|
-
import { capitalizeTheFirstLetterOfEachWord, concatenateObjectValues, findCountryByIddPrefix, fixBrandList, isTwitter, getIndividualName, isWebsite, sleep, sendCustomEventToGTM, isOtherThanKWOrSA, isKW, findCountryByIso2, getMetaData, isNetworkError } from '../../../utils';
|
|
74
|
+
import { capitalizeTheFirstLetterOfEachWord, concatenateObjectValues, findCountryByIddPrefix, fixBrandList, isTwitter, getIndividualName, isWebsite, sleep, sendCustomEventToGTM, isOtherThanKWOrSA, isKW, findCountryByIso2, getMetaData, isNetworkError, isTimeoutError } from '../../../utils';
|
|
75
75
|
export var updateBusinessCountry = createAsyncThunk('connect/updateBusinessCountry', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
76
76
|
var connect, payload, data;
|
|
77
77
|
return __generator(this, function (_a) {
|
|
@@ -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,
|
|
300
|
+
if (!(count <= maxCalls)) return [3, 19];
|
|
301
301
|
if (thunkApi.signal.aborted) {
|
|
302
|
-
return [3,
|
|
302
|
+
return [3, 19];
|
|
303
303
|
}
|
|
304
|
-
|
|
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, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
|
|
309
|
+
case 3:
|
|
306
310
|
authResponse = _g.sent();
|
|
307
|
-
|
|
308
|
-
|
|
311
|
+
return [3, 5];
|
|
312
|
+
case 4:
|
|
313
|
+
error_1 = _g.sent();
|
|
314
|
+
if (!isNetworkError(error_1.message) && !isTimeoutError(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
|
|
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
|
|
331
|
+
case 7:
|
|
320
332
|
channels = (_g.sent()).list;
|
|
321
333
|
leadResponse.channel_list = channels;
|
|
322
|
-
_g.label =
|
|
323
|
-
case
|
|
324
|
-
_g.trys.push([
|
|
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
|
|
338
|
+
case 9:
|
|
327
339
|
brand = (_g.sent()).brand;
|
|
328
340
|
leadResponse.brand = __assign(__assign({}, leadResponse.brand), brand);
|
|
329
|
-
return [3,
|
|
330
|
-
case
|
|
341
|
+
return [3, 11];
|
|
342
|
+
case 10:
|
|
331
343
|
err_3 = _g.sent();
|
|
332
|
-
return [3,
|
|
333
|
-
case
|
|
334
|
-
_g.trys.push([
|
|
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
|
|
348
|
+
case 12:
|
|
337
349
|
brands = (_g.sent()).brands;
|
|
338
350
|
leadResponse.brand_list = fixBrandList(brands, channels);
|
|
339
|
-
return [3,
|
|
340
|
-
case
|
|
351
|
+
return [3, 14];
|
|
352
|
+
case 13:
|
|
341
353
|
err_4 = _g.sent();
|
|
342
|
-
return [3,
|
|
343
|
-
case
|
|
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
|
|
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
|
|
355
|
-
case
|
|
366
|
+
case 16: return [4, sleep(interval * 1000)];
|
|
367
|
+
case 17:
|
|
356
368
|
_g.sent();
|
|
357
|
-
_g.label =
|
|
358
|
-
case
|
|
369
|
+
_g.label = 18;
|
|
370
|
+
case 18:
|
|
359
371
|
count++;
|
|
360
372
|
return [3, 1];
|
|
361
|
-
case
|
|
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,
|
|
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) {
|
|
@@ -384,14 +396,14 @@ export var verifyNafath = createAsyncThunk('connect/verifyNafath', function (par
|
|
|
384
396
|
_j.label = 2;
|
|
385
397
|
case 2:
|
|
386
398
|
_j.trys.push([2, 4, , 5]);
|
|
387
|
-
return [4, API.authService.getVerifyAuth(responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token)];
|
|
399
|
+
return [4, API.authService.getVerifyAuth(responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
|
|
388
400
|
case 3:
|
|
389
401
|
authResponse = _j.sent();
|
|
390
402
|
return [3, 5];
|
|
391
403
|
case 4:
|
|
392
|
-
|
|
393
|
-
if (!isNetworkError(
|
|
394
|
-
throw new Error(
|
|
404
|
+
error_2 = _j.sent();
|
|
405
|
+
if (!isNetworkError(error_2.message) && !isTimeoutError(error_2.message)) {
|
|
406
|
+
throw new Error(error_2);
|
|
395
407
|
}
|
|
396
408
|
return [3, 5];
|
|
397
409
|
case 5:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { MobileFormValues, NIDFormValues, CivilFormValues, OTPFormValues, IndividualFormValues, SharedState, FlowsTypes, ActionState, CountryCode, AuthForType, BusinessDataFormValues, AsyncThunkParams, AuthenticationListFormValues, AuthMerchantFormValues, DOBFormValues, MobileOwnershipFormValues } from '../../../@types';
|
|
2
|
+
import { MobileFormValues, NIDFormValues, CivilFormValues, OTPFormValues, IndividualFormValues, SharedState, FlowsTypes, ActionState, CountryCode, AuthForType, BusinessDataFormValues, AsyncThunkParams, AuthenticationListFormValues, AuthMerchantFormValues, DOBFormValues, MobileOwnershipFormValues, AuthForScreen } from '../../../@types';
|
|
3
3
|
import { CancelToken } from 'axios';
|
|
4
4
|
export declare const updateBusinessCountryAsync: import("@reduxjs/toolkit").AsyncThunk<any, string, {}>;
|
|
5
5
|
export declare const retrieveLeadIdentityByIdAsync: import("@reduxjs/toolkit").AsyncThunk<{
|
|
@@ -46,13 +46,16 @@ export declare const createNafathAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
46
46
|
termAndConditionChecked?: boolean | undefined;
|
|
47
47
|
};
|
|
48
48
|
}, NIDFormValues, {}>;
|
|
49
|
+
declare type VerifyNafathAsyncParams = verifyPACIAsyncParams & {
|
|
50
|
+
showLoadingScreenAfterNafathSuccess: () => void;
|
|
51
|
+
};
|
|
49
52
|
export declare const verifyNafathAsync: import("@reduxjs/toolkit").AsyncThunk<{
|
|
50
53
|
data: any;
|
|
51
54
|
isNextScreenIsDob?: undefined;
|
|
52
55
|
} | {
|
|
53
56
|
data: any;
|
|
54
57
|
isNextScreenIsDob: boolean;
|
|
55
|
-
},
|
|
58
|
+
}, VerifyNafathAsyncParams, {}>;
|
|
56
59
|
export declare const createCivilIdAuthAsync: import("@reduxjs/toolkit").AsyncThunk<{
|
|
57
60
|
response: any;
|
|
58
61
|
formData: CivilFormValues;
|
|
@@ -133,6 +136,10 @@ export declare const updateLeadMobile: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
133
136
|
export declare const skipUpdateLeadMobile: import("@reduxjs/toolkit").AsyncThunk<{
|
|
134
137
|
leadResponse: any;
|
|
135
138
|
}, void, {}>;
|
|
139
|
+
export declare const verifyAuthMobileOtpAsync: import("@reduxjs/toolkit").AsyncThunk<{
|
|
140
|
+
data: any;
|
|
141
|
+
}, OTPFormValues, {}>;
|
|
142
|
+
export declare const resendLeadMobileAuthOTP: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
|
|
136
143
|
export declare const confirmInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
137
144
|
boardInfo: any;
|
|
138
145
|
boardData: any;
|
|
@@ -156,6 +163,9 @@ export interface ConnectExpressData {
|
|
|
156
163
|
individualData: IndividualFormValues & {
|
|
157
164
|
isPrevDob?: boolean;
|
|
158
165
|
};
|
|
166
|
+
verifyAuthOtpData: OTPFormValues & {
|
|
167
|
+
authFor: AuthForScreen;
|
|
168
|
+
};
|
|
159
169
|
businessData: BusinessDataFormValues;
|
|
160
170
|
authenticationData: AuthenticationListFormValues;
|
|
161
171
|
authMerchantData: AuthMerchantFormValues;
|
|
@@ -177,10 +187,11 @@ export declare const connectSlice: import("@reduxjs/toolkit").Slice<ConnectExpre
|
|
|
177
187
|
resetCivilScreen: (state: ConnectExpressState) => void;
|
|
178
188
|
resetAuthenticationScreen: (state: ConnectExpressState) => void;
|
|
179
189
|
resetOTPValue: (state: ConnectExpressState) => void;
|
|
190
|
+
resetVerifyAuthOTPValue: (state: ConnectExpressState) => void;
|
|
180
191
|
resetStore: (state: ConnectExpressState) => void;
|
|
181
192
|
resetIndividualScreen: (state: ConnectExpressState) => void;
|
|
182
193
|
}, "connectExpress/store">;
|
|
183
|
-
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setIsLeadIdPassed: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, resetOTPValue: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetCivilScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setError: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, setLeadId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setDefaultCountryCode: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, storeIsStartFromBusinessCountry: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetAuthenticationScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
194
|
+
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setIsLeadIdPassed: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, resetOTPValue: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetVerifyAuthOTPValue: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetCivilScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setError: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, setLeadId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setDefaultCountryCode: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, storeIsStartFromBusinessCountry: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetAuthenticationScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
184
195
|
declare const _default: import("redux").Reducer<ConnectExpressState, import("redux").AnyAction>;
|
|
185
196
|
export default _default;
|
|
186
197
|
export declare const connectExpressSelector: (state: RootState) => ConnectExpressState;
|