@tap-payments/auth-jsconnect 2.8.99-development → 2.9.0
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/README.md +2 -2
- package/build/@types/app.d.ts +11 -3
- package/build/@types/app.js +7 -0
- package/build/@types/config.d.ts +4 -0
- package/build/@types/form.d.ts +7 -0
- package/build/api/account.d.ts +3 -1
- package/build/api/account.js +7 -0
- package/build/api/auth.d.ts +16 -1
- package/build/api/index.d.ts +4 -3
- package/build/app/settings.d.ts +1 -0
- package/build/app/settings.js +14 -8
- package/build/assets/currencies/AEDSymbol.d.ts +7 -0
- package/build/assets/currencies/AEDSymbol.js +28 -0
- 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 +6 -0
- package/build/assets/locales/ar.json +18 -1
- package/build/assets/locales/en.json +44 -1
- package/build/components/AnimationFlow/BottomSheet.js +16 -12
- package/build/components/AnimationFlow/Dialog.js +3 -1
- package/build/components/Input/Input.js +1 -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/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +2 -0
- package/build/constants/api.js +4 -0
- package/build/constants/app.d.ts +17 -0
- package/build/constants/app.js +97 -17
- package/build/constants/assets.d.ts +12 -3
- package/build/constants/assets.js +123 -105
- package/build/constants/dummy.js +27 -20
- package/build/constants/flows.d.ts +4 -0
- package/build/constants/flows.js +4 -0
- 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 +197 -95
- package/build/features/app/board/boardStore.d.ts +5 -1
- package/build/features/app/board/boardStore.js +40 -35
- package/build/features/app/business/businessStore.d.ts +10 -1
- package/build/features/app/business/businessStore.js +164 -35
- package/build/features/app/connect/connectStore.d.ts +8 -1
- package/build/features/app/connect/connectStore.js +181 -68
- package/build/features/app/connectExpress/connectExpressStore.d.ts +21 -3
- package/build/features/app/connectExpress/connectExpressStore.js +448 -117
- package/build/features/app/individual/individualStore.js +2 -4
- package/build/features/app/kyc/kycStore.js +88 -66
- package/build/features/app/signIn/signInStore.js +19 -15
- package/build/features/auth/Auth.d.ts +1 -1
- package/build/features/auth/screens/Mobile/MobileNumber.js +5 -7
- package/build/features/auth/screens/Mobile/validation.js +5 -2
- 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/bank/Bank.d.ts +5 -1
- package/build/features/bank/Bank.js +15 -7
- package/build/features/board/Board.js +1 -1
- package/build/features/brand/Brand.d.ts +5 -1
- package/build/features/brand/Brand.js +15 -7
- 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.d.ts +3 -0
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +103 -0
- package/build/features/business/screens/MobileOwnership/MobileNumber.d.ts +3 -0
- package/build/features/business/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/business/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/business/screens/MobileOwnership/index.js +2 -0
- package/build/features/business/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/business/screens/MobileOwnership/validation.js +38 -0
- package/build/features/connect/Connect.js +1 -1
- package/build/features/connect/screens/Individual/MobileNumber.js +5 -7
- package/build/features/connect/screens/Individual/validation.js +5 -2
- package/build/features/connect/screens/Mobile/MobileNumber.js +5 -7
- package/build/features/connect/screens/Mobile/validation.js +5 -2
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +104 -0
- package/build/features/connect/screens/MobileOwnership/MobileNumber.d.ts +3 -0
- package/build/features/connect/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/connect/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/connect/screens/MobileOwnership/index.js +2 -0
- package/build/features/connect/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/connect/screens/MobileOwnership/validation.js +38 -0
- package/build/features/connectExpress/ConnectExpress.js +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +5 -7
- package/build/features/connectExpress/screens/CollectIndividualInfo/validation.js +5 -2
- 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/Mobile/MobileNumber.js +5 -7
- package/build/features/connectExpress/screens/Mobile/validation.js +9 -4
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +106 -0
- package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.d.ts +3 -0
- package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/connectExpress/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/connectExpress/screens/MobileOwnership/index.js +2 -0
- package/build/features/connectExpress/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/MobileOwnership/validation.js +38 -0
- 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/Entity.d.ts +4 -1
- package/build/features/entity/Entity.js +15 -7
- 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 +35 -0
- package/build/features/individual/Individual.d.ts +4 -1
- package/build/features/individual/Individual.js +15 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/individual/screens/IndividualList/MobileNumber.js +5 -10
- package/build/features/individual/screens/IndividualList/validation.js +5 -3
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +3 -5
- package/build/features/individual/screens/IndividualPersonalInfo/validation.js +5 -2
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +5 -10
- package/build/features/individual/screens/IndividualPhoneInfo/validation.js +5 -2
- package/build/features/kyc/KYC.js +5 -1
- package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.d.ts +5 -0
- package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.js +19 -0
- package/build/features/kyc/screens/AlreadySubmitted/index.d.ts +2 -0
- package/build/features/kyc/screens/AlreadySubmitted/index.js +2 -0
- package/build/features/kyc/screens/Success/Success.js +18 -5
- package/build/features/kyc/screens/Terms/Terms.js +19 -4
- package/build/features/kyc/screens/TokenError/TokenError.d.ts +5 -0
- package/build/features/kyc/screens/TokenError/TokenError.js +9 -0
- package/build/features/kyc/screens/TokenError/index.d.ts +2 -0
- package/build/features/kyc/screens/TokenError/index.js +2 -0
- package/build/features/kyc/screens/Users/Users.js +6 -3
- package/build/features/password/Password.d.ts +4 -1
- package/build/features/password/Password.js +13 -6
- 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 +5 -2
- package/build/features/shared/Containers/FeatureContainer.d.ts +2 -1
- package/build/features/shared/Containers/FeatureContainer.js +5 -3
- package/build/features/shared/Dialog/DialogContainer.js +5 -4
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/signIn/screens/Mobile/MobileNumber.js +5 -7
- package/build/features/signIn/screens/Mobile/validation.js +5 -2
- package/build/features/tax/Tax.d.ts +4 -1
- package/build/features/tax/Tax.js +15 -7
- package/build/hooks/useAppConfig.js +1 -1
- package/build/utils/common.d.ts +1 -1
- package/build/utils/common.js +6 -5
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/build/utils/string.d.ts +4 -2
- package/build/utils/string.js +12 -2
- package/package.json +3 -4
|
@@ -45,6 +45,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
49
|
+
var t = {};
|
|
50
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
51
|
+
t[p] = s[p];
|
|
52
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
53
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
54
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
55
|
+
t[p[i]] = s[p[i]];
|
|
56
|
+
}
|
|
57
|
+
return t;
|
|
58
|
+
};
|
|
48
59
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
49
60
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
50
61
|
if (ar || !(i in from)) {
|
|
@@ -57,10 +68,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
57
68
|
var _a;
|
|
58
69
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
70
|
import { AuthForType, AuthTypeNumber, FlowsTypes, MigrationStatus } from '../../../@types';
|
|
60
|
-
import { ADD_NEW_ENTITY, AUTH_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, SCOPE_AUTH, defaultCountry } from '../../../constants';
|
|
71
|
+
import { ADD_NEW_ENTITY, AUTH_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, SCOPE_AUTH, defaultCountry } from '../../../constants';
|
|
61
72
|
import API from '../../../api';
|
|
62
73
|
import { handleCurrentActiveScreen, handleNextScreenStep, handleOpen, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
63
|
-
import { findCountryByIddPrefix, openConnect, sendCustomEventToGTM, sleep } from '../../../utils';
|
|
74
|
+
import { findCountryByIddPrefix, isNetworkError, isTimeoutError, openConnect, sendCustomEventToGTM, sleep } from '../../../utils';
|
|
64
75
|
export var updateBusinessCountry = createAsyncThunk('auth/updateBusinessCountry', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
76
|
var auth, payload, data;
|
|
66
77
|
return __generator(this, function (_a) {
|
|
@@ -113,59 +124,54 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('auth/retrieveLeadId
|
|
|
113
124
|
}
|
|
114
125
|
});
|
|
115
126
|
}); });
|
|
116
|
-
export var createMobileAuth = createAsyncThunk('auth/createMobileAuth', function (
|
|
117
|
-
var
|
|
118
|
-
var
|
|
119
|
-
return __generator(this, function (
|
|
120
|
-
switch (
|
|
127
|
+
export var createMobileAuth = createAsyncThunk('auth/createMobileAuth', function (_a, thunkApi) { var _b, _c, _d; return __awaiter(void 0, void 0, void 0, function () {
|
|
128
|
+
var _e, settings, auth, isStartWithZero, mobileNumber, requestBody, data, stepName;
|
|
129
|
+
var skipPasscode = _a.skipPasscode, params = __rest(_a, ["skipPasscode"]);
|
|
130
|
+
return __generator(this, function (_f) {
|
|
131
|
+
switch (_f.label) {
|
|
121
132
|
case 0:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
lead_id: auth.data.leadId,
|
|
128
|
-
user_credentail: {
|
|
129
|
-
phone: params.mobile || '',
|
|
133
|
+
_e = thunkApi.getState(), settings = _e.settings, auth = _e.auth;
|
|
134
|
+
isStartWithZero = (_b = params.mobile) === null || _b === void 0 ? void 0 : _b.startsWith('0');
|
|
135
|
+
mobileNumber = isStartWithZero ? params.mobile.slice(1) : params.mobile;
|
|
136
|
+
requestBody = __assign({ country: settings.data.businessCountry.iso2, scope: settings.data.appConfig.scope, lang: settings.data.language, lead_id: auth.data.leadId, user_credentail: {
|
|
137
|
+
phone: mobileNumber || '',
|
|
130
138
|
code: params.countryCode.idd_prefix.toString()
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
};
|
|
139
|
+
}, sign_in: false, login: true, is_lead: true, step_name: AUTH_STEP_NAMES.CREATE_AUTH_MOBILE, encryption_contract: ['user_credentail.phone', 'user_credentail.code'] }, (skipPasscode && {
|
|
140
|
+
auth_info: {
|
|
141
|
+
skip_auth_method: true
|
|
142
|
+
}
|
|
143
|
+
}));
|
|
137
144
|
return [4, API.authService.createAuth(requestBody)];
|
|
138
145
|
case 1:
|
|
139
|
-
data =
|
|
140
|
-
|
|
141
|
-
(
|
|
142
|
-
|
|
146
|
+
data = _f.sent();
|
|
147
|
+
stepName = (data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.PASSCODE ? 'AUTH_PASSCODE_STEP' : 'AUTH_OTP_STEP';
|
|
148
|
+
thunkApi.dispatch(handleNextScreenStep(stepName));
|
|
149
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody.user_credentail);
|
|
150
|
+
return [2, { response: data, formData: params, skipPasscode: skipPasscode }];
|
|
143
151
|
}
|
|
144
152
|
});
|
|
145
153
|
}); });
|
|
146
154
|
export var resendMobileAuthOTP = createAsyncThunk('auth/resendMobileAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
147
|
-
var _a, settings, auth, requestBody, data;
|
|
148
|
-
|
|
149
|
-
|
|
155
|
+
var _a, settings, auth, isStartWithZero, mobileNumber, skipPasscode, requestBody, data;
|
|
156
|
+
var _b;
|
|
157
|
+
return __generator(this, function (_c) {
|
|
158
|
+
switch (_c.label) {
|
|
150
159
|
case 0:
|
|
151
160
|
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
user_credentail: {
|
|
158
|
-
phone: params.mobile,
|
|
161
|
+
isStartWithZero = (_b = params.mobile) === null || _b === void 0 ? void 0 : _b.startsWith('0');
|
|
162
|
+
mobileNumber = isStartWithZero ? params.mobile.slice(1) : params.mobile;
|
|
163
|
+
skipPasscode = auth.data.passcodeData.skipPasscode;
|
|
164
|
+
requestBody = __assign({ country: settings.data.businessCountry.iso2, scope: settings.data.appConfig.scope, lang: settings.data.language, lead_id: auth.data.leadId, user_credentail: {
|
|
165
|
+
phone: mobileNumber,
|
|
159
166
|
code: params.countryCode.idd_prefix.toString()
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
};
|
|
167
|
+
}, sign_in: false, login: true, is_lead: true, step_name: AUTH_STEP_NAMES.CREATE_AUTH_MOBILE, encryption_contract: ['user_credentail.phone', 'user_credentail.code'] }, (skipPasscode && {
|
|
168
|
+
auth_info: {
|
|
169
|
+
skip_auth_method: true
|
|
170
|
+
}
|
|
171
|
+
}));
|
|
166
172
|
return [4, API.authService.createAuth(requestBody)];
|
|
167
173
|
case 1:
|
|
168
|
-
data =
|
|
174
|
+
data = _c.sent();
|
|
169
175
|
return [2, { response: data, formData: params }];
|
|
170
176
|
}
|
|
171
177
|
});
|
|
@@ -213,37 +219,79 @@ export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (
|
|
|
213
219
|
}
|
|
214
220
|
});
|
|
215
221
|
}); });
|
|
216
|
-
export var
|
|
217
|
-
var _a, settings, auth,
|
|
218
|
-
var
|
|
219
|
-
return __generator(this, function (
|
|
220
|
-
switch (
|
|
222
|
+
export var verifyPasscode = createAsyncThunk('auth/verifyPasscode', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
223
|
+
var _a, settings, auth, _b, responseData, leadId, _c, auth_token, device_token, service_name, auth_type, sign_in, scope, payload, data, stepName_1;
|
|
224
|
+
var _d, _e, _f, _g, _h, _j;
|
|
225
|
+
return __generator(this, function (_k) {
|
|
226
|
+
switch (_k.label) {
|
|
221
227
|
case 0:
|
|
222
228
|
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
229
|
+
_b = auth.data || {}, responseData = _b.responseData, leadId = _b.leadId;
|
|
230
|
+
_c = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.authResponse) !== null && _d !== void 0 ? _d : {}, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name, auth_type = _c.auth_type, sign_in = _c.sign_in;
|
|
231
|
+
if (!auth_token)
|
|
232
|
+
throw new Error('Auth token is missing');
|
|
233
|
+
scope = settings.data.appConfig.scope;
|
|
234
|
+
payload = {
|
|
235
|
+
auth_token: auth_token,
|
|
236
|
+
lead_id: leadId,
|
|
237
|
+
data: params.passcode,
|
|
238
|
+
auth_type: auth_type,
|
|
239
|
+
device_token: device_token,
|
|
240
|
+
service_name: service_name,
|
|
241
|
+
sign_in: sign_in,
|
|
242
|
+
step_name: AUTH_STEP_NAMES.CREATE_AUTH_PASSCODE,
|
|
243
|
+
encryption_contract: ['data']
|
|
235
244
|
};
|
|
245
|
+
return [4, API.authService.verifyAuth(payload)];
|
|
246
|
+
case 1:
|
|
247
|
+
data = (_k.sent()).data;
|
|
248
|
+
if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
|
|
249
|
+
throw new Error(data.errors[0].description);
|
|
250
|
+
if (((_f = data === null || data === void 0 ? void 0 : data.status) === null || _f === void 0 ? void 0 : _f.toLowerCase()) === 'success' && (data === null || data === void 0 ? void 0 : data.auth_session)) {
|
|
251
|
+
if (scope === 'merchant') {
|
|
252
|
+
openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
|
|
253
|
+
return [2, data];
|
|
254
|
+
}
|
|
255
|
+
stepName_1 = 'AUTH_PREPARING_DATA_STEP';
|
|
256
|
+
if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.MIGRATION)
|
|
257
|
+
stepName_1 = 'AUTH_MIGRATING_DATA_STEP';
|
|
258
|
+
(_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, params);
|
|
259
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep(stepName_1)); });
|
|
260
|
+
}
|
|
261
|
+
else if (((_j = data === null || data === void 0 ? void 0 : data.status) === null || _j === void 0 ? void 0 : _j.toLowerCase()) === 'pending') {
|
|
262
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_OTP_STEP')); });
|
|
263
|
+
}
|
|
264
|
+
return [2, data];
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
}); });
|
|
268
|
+
export var createEmailAuth = createAsyncThunk('auth/createEmailAuth', function (_a, thunkApi) { var _b, _c; return __awaiter(void 0, void 0, void 0, function () {
|
|
269
|
+
var _d, settings, auth, requestBody, data, stepName;
|
|
270
|
+
var skipPasscode = _a.skipPasscode, params = __rest(_a, ["skipPasscode"]);
|
|
271
|
+
return __generator(this, function (_e) {
|
|
272
|
+
switch (_e.label) {
|
|
273
|
+
case 0:
|
|
274
|
+
_d = thunkApi.getState(), settings = _d.settings, auth = _d.auth;
|
|
275
|
+
requestBody = __assign({ country: settings.data.businessCountry.iso2, scope: settings.data.appConfig.scope, lang: settings.data.language, lead_id: auth.data.leadId, user_credentail: {
|
|
276
|
+
email: params.email || ''
|
|
277
|
+
}, sign_in: true, login: true, is_lead: false, step_name: AUTH_STEP_NAMES.CREATE_AUTH_EMAIL, encryption_contract: ['user_credentail.email'] }, (skipPasscode && {
|
|
278
|
+
auth_info: {
|
|
279
|
+
skip_auth_method: true
|
|
280
|
+
}
|
|
281
|
+
}));
|
|
236
282
|
return [4, API.authService.createAuth(requestBody)];
|
|
237
283
|
case 1:
|
|
238
|
-
data =
|
|
239
|
-
|
|
284
|
+
data = _e.sent();
|
|
285
|
+
stepName = 'AUTH_PASSWORD_STEP';
|
|
240
286
|
if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.RESET_PASSWORD)
|
|
241
|
-
|
|
242
|
-
if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.EMAIL_OTP)
|
|
243
|
-
|
|
244
|
-
|
|
287
|
+
stepName = 'AUTH_RESET_PASSWORD_MESSAGE_STEP';
|
|
288
|
+
else if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.EMAIL_OTP)
|
|
289
|
+
stepName = 'AUTH_OTP_STEP';
|
|
290
|
+
else if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.PASSCODE)
|
|
291
|
+
stepName = 'AUTH_PASSCODE_STEP';
|
|
292
|
+
thunkApi.dispatch(handleNextScreenStep(stepName));
|
|
245
293
|
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody.user_credentail);
|
|
246
|
-
return [2, { response: data, formData: params }];
|
|
294
|
+
return [2, { response: data, formData: params, skipPasscode: skipPasscode }];
|
|
247
295
|
}
|
|
248
296
|
});
|
|
249
297
|
}); });
|
|
@@ -291,24 +339,19 @@ export var verifyEmailPassword = createAsyncThunk('auth/verifyEmailPassword', fu
|
|
|
291
339
|
});
|
|
292
340
|
}); });
|
|
293
341
|
export var resendEmailAuthOTP = createAsyncThunk('auth/resendEmailAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
294
|
-
var _a, settings, auth, requestBody, data;
|
|
342
|
+
var _a, settings, auth, skipPasscode, requestBody, data;
|
|
295
343
|
return __generator(this, function (_b) {
|
|
296
344
|
switch (_b.label) {
|
|
297
345
|
case 0:
|
|
298
346
|
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
scope: settings.data.appConfig.scope,
|
|
302
|
-
lang: settings.data.language,
|
|
303
|
-
lead_id: auth.data.leadId,
|
|
304
|
-
user_credentail: {
|
|
347
|
+
skipPasscode = auth.data.passcodeData.skipPasscode;
|
|
348
|
+
requestBody = __assign({ country: settings.data.businessCountry.iso2, scope: settings.data.appConfig.scope, lang: settings.data.language, lead_id: auth.data.leadId, user_credentail: {
|
|
305
349
|
email: params.email || ''
|
|
306
|
-
},
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
};
|
|
350
|
+
}, sign_in: true, login: true, is_lead: false, step_name: AUTH_STEP_NAMES.CREATE_AUTH_EMAIL, encryption_contract: ['user_credentail.email'] }, (skipPasscode && {
|
|
351
|
+
auth_info: {
|
|
352
|
+
skip_auth_method: true
|
|
353
|
+
}
|
|
354
|
+
}));
|
|
312
355
|
return [4, API.authService.createAuth(requestBody)];
|
|
313
356
|
case 1:
|
|
314
357
|
data = _b.sent();
|
|
@@ -409,17 +452,29 @@ export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params
|
|
|
409
452
|
interval = 3;
|
|
410
453
|
maxCalls = Math.floor(expiry / interval);
|
|
411
454
|
_loop_1 = function (count) {
|
|
412
|
-
var data, isSuccess, isFailed, screen_1;
|
|
455
|
+
var data, error_1, isSuccess, isFailed, screen_1;
|
|
413
456
|
return __generator(this, function (_h) {
|
|
414
457
|
switch (_h.label) {
|
|
415
458
|
case 0:
|
|
416
459
|
if (thunkApi.signal.aborted) {
|
|
417
460
|
return [2, "break"];
|
|
418
461
|
}
|
|
419
|
-
|
|
462
|
+
data = void 0;
|
|
463
|
+
_h.label = 1;
|
|
420
464
|
case 1:
|
|
465
|
+
_h.trys.push([1, 3, , 4]);
|
|
466
|
+
return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
|
|
467
|
+
case 2:
|
|
421
468
|
data = _h.sent();
|
|
422
|
-
|
|
469
|
+
return [3, 4];
|
|
470
|
+
case 3:
|
|
471
|
+
error_1 = _h.sent();
|
|
472
|
+
if (!isNetworkError(error_1.message) && !isTimeoutError(error_1.message)) {
|
|
473
|
+
throw new Error(error_1);
|
|
474
|
+
}
|
|
475
|
+
return [3, 4];
|
|
476
|
+
case 4:
|
|
477
|
+
isSuccess = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
423
478
|
isFailed = ((_c = data === null || data === void 0 ? void 0 : data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'failed';
|
|
424
479
|
if (isFailed) {
|
|
425
480
|
(_d = params.onFailure) === null || _d === void 0 ? void 0 : _d.call(params);
|
|
@@ -436,7 +491,7 @@ export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params
|
|
|
436
491
|
return [2, { value: data }];
|
|
437
492
|
}
|
|
438
493
|
return [4, sleep(interval * 1000)];
|
|
439
|
-
case
|
|
494
|
+
case 5:
|
|
440
495
|
_h.sent();
|
|
441
496
|
return [2];
|
|
442
497
|
}
|
|
@@ -516,7 +571,7 @@ export var createCivilIdAuth = createAsyncThunk('auth/createCivilAuth', function
|
|
|
516
571
|
});
|
|
517
572
|
}); });
|
|
518
573
|
export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
519
|
-
var _a, settings, auth, authResponse, scope, expiry, interval, maxCalls, count, data, isSuccess;
|
|
574
|
+
var _a, settings, auth, authResponse, scope, expiry, interval, maxCalls, count, data, error_2, isSuccess;
|
|
520
575
|
var _b, _c, _d;
|
|
521
576
|
return __generator(this, function (_e) {
|
|
522
577
|
switch (_e.label) {
|
|
@@ -530,13 +585,25 @@ export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, th
|
|
|
530
585
|
count = 1;
|
|
531
586
|
_e.label = 1;
|
|
532
587
|
case 1:
|
|
533
|
-
if (!(count <= maxCalls)) return [3,
|
|
588
|
+
if (!(count <= maxCalls)) return [3, 8];
|
|
534
589
|
if (thunkApi.signal.aborted) {
|
|
535
|
-
return [3,
|
|
590
|
+
return [3, 8];
|
|
536
591
|
}
|
|
537
|
-
|
|
592
|
+
data = void 0;
|
|
593
|
+
_e.label = 2;
|
|
538
594
|
case 2:
|
|
595
|
+
_e.trys.push([2, 4, , 5]);
|
|
596
|
+
return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
|
|
597
|
+
case 3:
|
|
539
598
|
data = _e.sent();
|
|
599
|
+
return [3, 5];
|
|
600
|
+
case 4:
|
|
601
|
+
error_2 = _e.sent();
|
|
602
|
+
if (!isNetworkError(error_2.message) && !isTimeoutError(error_2.message)) {
|
|
603
|
+
throw new Error(error_2);
|
|
604
|
+
}
|
|
605
|
+
return [3, 5];
|
|
606
|
+
case 5:
|
|
540
607
|
isSuccess = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
541
608
|
if (isSuccess) {
|
|
542
609
|
if (scope === 'merchant') {
|
|
@@ -548,13 +615,13 @@ export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, th
|
|
|
548
615
|
return [2, data];
|
|
549
616
|
}
|
|
550
617
|
return [4, sleep(interval * 1000)];
|
|
551
|
-
case
|
|
618
|
+
case 6:
|
|
552
619
|
_e.sent();
|
|
553
|
-
_e.label =
|
|
554
|
-
case
|
|
620
|
+
_e.label = 7;
|
|
621
|
+
case 7:
|
|
555
622
|
count++;
|
|
556
623
|
return [3, 1];
|
|
557
|
-
case
|
|
624
|
+
case 8: throw new Error('paci_verification_failed');
|
|
558
625
|
}
|
|
559
626
|
});
|
|
560
627
|
}); });
|
|
@@ -621,19 +688,27 @@ export var checkAccountAvailability = createAsyncThunk('auth/checkAccountAvailab
|
|
|
621
688
|
isDataHasIndividualOnly = (authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length) === 1 && authConfigData.includes('individual');
|
|
622
689
|
data = (_c = auth.data.responseData) === null || _c === void 0 ? void 0 : _c.authResponse;
|
|
623
690
|
authId = (data || {}).id;
|
|
624
|
-
|
|
691
|
+
accountData = undefined;
|
|
692
|
+
if (!isDataHasIndividualOnly) return [3, 2];
|
|
693
|
+
return [4, API.accountService.checkAccountAvailabilityStatus(data === null || data === void 0 ? void 0 : data.individual_id)];
|
|
625
694
|
case 1:
|
|
626
695
|
accountData = _d.sent();
|
|
696
|
+
return [3, 4];
|
|
697
|
+
case 2: return [4, API.accountService.checkAccountAvailability(data === null || data === void 0 ? void 0 : data.individual_id)];
|
|
698
|
+
case 3:
|
|
699
|
+
accountData = _d.sent();
|
|
700
|
+
_d.label = 4;
|
|
701
|
+
case 4:
|
|
627
702
|
_b = accountData || {}, step_name = _b.step_name, brands = _b.brands, entities = _b.entities;
|
|
628
703
|
brandList = brands || [];
|
|
629
704
|
entityList = entities || [];
|
|
630
705
|
isExistingUser = step_name === 'select_account';
|
|
631
|
-
if (!(isExistingUser && isDataHasIndividualOnly && authId)) return [3,
|
|
706
|
+
if (!(isExistingUser && isDataHasIndividualOnly && authId)) return [3, 6];
|
|
632
707
|
return [4, thunkApi.dispatch(confirmInfo({ authId: authId }))];
|
|
633
|
-
case
|
|
708
|
+
case 5:
|
|
634
709
|
_d.sent();
|
|
635
710
|
return [2, { brandList: brandList, entityList: entityList }];
|
|
636
|
-
case
|
|
711
|
+
case 6:
|
|
637
712
|
if (isExistingUser && authDataHasValue && brandList.length && entityList.length) {
|
|
638
713
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_AUTHENTICATION_LIST_STEP')); });
|
|
639
714
|
return [2, { brandList: brandList, entityList: entityList }];
|
|
@@ -824,6 +899,9 @@ var initialState = {
|
|
|
824
899
|
otp: '',
|
|
825
900
|
authFor: AuthForType.MOBILE
|
|
826
901
|
},
|
|
902
|
+
passcodeData: {
|
|
903
|
+
passcode: ''
|
|
904
|
+
},
|
|
827
905
|
passwordData: {
|
|
828
906
|
password: ''
|
|
829
907
|
},
|
|
@@ -918,6 +996,8 @@ export var authSlice = createSlice({
|
|
|
918
996
|
state.loading = false;
|
|
919
997
|
state.data.mobileData = action.payload.formData;
|
|
920
998
|
state.data.otpData.authFor = AuthForType.MOBILE;
|
|
999
|
+
state.data.passcodeData.skipPasscode = action.payload.skipPasscode;
|
|
1000
|
+
state.data.passcodeData.allowOTPToPasscodeRedirection = action.payload.skipPasscode;
|
|
921
1001
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
|
|
922
1002
|
})
|
|
923
1003
|
.addCase(createMobileAuth.rejected, function (state, action) {
|
|
@@ -944,10 +1024,28 @@ export var authSlice = createSlice({
|
|
|
944
1024
|
state.loading = false;
|
|
945
1025
|
var data = action.payload;
|
|
946
1026
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
|
|
1027
|
+
state.data.passcodeData.skipPasscode = false;
|
|
1028
|
+
state.data.passcodeData.allowOTPToPasscodeRedirection = false;
|
|
947
1029
|
})
|
|
948
1030
|
.addCase(verifyMobileOtp.rejected, function (state, action) {
|
|
949
1031
|
state.loading = false;
|
|
950
1032
|
state.error = action.error.message;
|
|
1033
|
+
})
|
|
1034
|
+
.addCase(verifyPasscode.pending, function (state) {
|
|
1035
|
+
state.loading = true;
|
|
1036
|
+
state.error = null;
|
|
1037
|
+
})
|
|
1038
|
+
.addCase(verifyPasscode.fulfilled, function (state, action) {
|
|
1039
|
+
var _a, _b;
|
|
1040
|
+
state.loading = false;
|
|
1041
|
+
var data = action.payload;
|
|
1042
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
|
|
1043
|
+
state.data.passcodeData.skipPasscode = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'pending';
|
|
1044
|
+
state.data.passcodeData.allowOTPToPasscodeRedirection = false;
|
|
1045
|
+
})
|
|
1046
|
+
.addCase(verifyPasscode.rejected, function (state, action) {
|
|
1047
|
+
state.loading = false;
|
|
1048
|
+
state.error = action.error.message;
|
|
951
1049
|
})
|
|
952
1050
|
.addCase(createEmailAuth.pending, function (state) {
|
|
953
1051
|
state.loading = true;
|
|
@@ -957,6 +1055,8 @@ export var authSlice = createSlice({
|
|
|
957
1055
|
state.loading = false;
|
|
958
1056
|
state.data.emailData = action.payload.formData;
|
|
959
1057
|
state.data.otpData.authFor = AuthForType.EMAIL;
|
|
1058
|
+
state.data.passcodeData.skipPasscode = action.payload.skipPasscode;
|
|
1059
|
+
state.data.passcodeData.allowOTPToPasscodeRedirection = action.payload.skipPasscode;
|
|
960
1060
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
|
|
961
1061
|
})
|
|
962
1062
|
.addCase(createEmailAuth.rejected, function (state, action) {
|
|
@@ -997,6 +1097,8 @@ export var authSlice = createSlice({
|
|
|
997
1097
|
state.loading = false;
|
|
998
1098
|
var data = action.payload;
|
|
999
1099
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
|
|
1100
|
+
state.data.passcodeData.skipPasscode = false;
|
|
1101
|
+
state.data.passcodeData.allowOTPToPasscodeRedirection = false;
|
|
1000
1102
|
})
|
|
1001
1103
|
.addCase(verifyEmailOtp.rejected, function (state, action) {
|
|
1002
1104
|
state.loading = false;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
2
|
import { FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
|
|
3
|
-
|
|
3
|
+
interface CreateVerifyTokenByProps {
|
|
4
|
+
boardId: string;
|
|
5
|
+
isInternally?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const createVerifyTokenBy: import("@reduxjs/toolkit").AsyncThunk<any, CreateVerifyTokenByProps, {}>;
|
|
4
8
|
export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
5
9
|
data: any;
|
|
6
10
|
}, void, {}>;
|
|
@@ -52,44 +52,49 @@ import { FlowsTypes } from '../../../@types';
|
|
|
52
52
|
import { handleCurrentActiveScreen, handleNextScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
|
|
53
53
|
import { BOARD_STEP_STEPS } from '../../../constants';
|
|
54
54
|
import { retrieveIndividualData, sleep } from '../../../utils';
|
|
55
|
-
export var createVerifyTokenBy = createAsyncThunk('board/createVerifyTokenByBoardId', function (
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
export var createVerifyTokenBy = createAsyncThunk('board/createVerifyTokenByBoardId', function (_a, thunkApi) {
|
|
56
|
+
var boardId = _a.boardId, isInternally = _a.isInternally;
|
|
57
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
+
var settings, isModeContent, payload, data, _b, country_code, config, publicKey, step_name, boardData;
|
|
59
|
+
var _c, _d, _e;
|
|
60
|
+
return __generator(this, function (_f) {
|
|
61
|
+
switch (_f.label) {
|
|
62
|
+
case 0:
|
|
63
|
+
settings = thunkApi.getState().settings;
|
|
64
|
+
isModeContent = settings.data.appConfig.mode === 'content';
|
|
65
|
+
payload = __assign({ service_name: 'tap_email', board_id: boardId }, ((isModeContent || isInternally) && {
|
|
66
|
+
notification: {
|
|
67
|
+
sms: false
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
70
|
+
return [4, API.leadService.createVerifyTokenByBoardId(payload)];
|
|
71
|
+
case 1:
|
|
72
|
+
data = _f.sent();
|
|
73
|
+
_b = data || {}, country_code = _b.country_code, config = _b.config;
|
|
74
|
+
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
75
|
+
if (country_code)
|
|
76
|
+
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
77
|
+
if (publicKey)
|
|
78
|
+
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
79
|
+
if (isInternally)
|
|
80
|
+
data.step_name = BOARD_STEP_STEPS.BOARD_INFO;
|
|
81
|
+
step_name = data.step_name;
|
|
82
|
+
if (step_name == BOARD_STEP_STEPS.PHONE_AUTH) {
|
|
83
|
+
sleep(0).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('BOARD_VERIFY_STEP')); });
|
|
84
|
+
return [2, __assign(__assign({}, data), { board_id: boardId })];
|
|
66
85
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
75
|
-
if (publicKey)
|
|
76
|
-
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
77
|
-
step_name = data.step_name;
|
|
78
|
-
if (step_name == BOARD_STEP_STEPS.PHONE_AUTH) {
|
|
79
|
-
sleep(0).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('BOARD_VERIFY_STEP')); });
|
|
86
|
+
return [4, thunkApi.dispatch(retrieveBoardDetails({ boardId: data.id, boardInfoId: data.board_info_id })).unwrap()];
|
|
87
|
+
case 2:
|
|
88
|
+
boardData = (_f.sent()).data;
|
|
89
|
+
if (!country_code && ((_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.country))
|
|
90
|
+
thunkApi.dispatch(handleSetCountryByIso2(boardData.entity.country));
|
|
91
|
+
(_e = (_d = settings.data.appConfig).onFlowCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, { boardId: data.id, boardInfoId: data.board_info_id });
|
|
92
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('BOARD_SUCCESS_FLOWS_BUTTONS_STEP')); });
|
|
80
93
|
return [2, __assign(__assign({}, data), { board_id: boardId })];
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
case 2:
|
|
84
|
-
boardData = (_e.sent()).data;
|
|
85
|
-
if (!country_code && ((_b = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _b === void 0 ? void 0 : _b.country))
|
|
86
|
-
thunkApi.dispatch(handleSetCountryByIso2(boardData.entity.country));
|
|
87
|
-
(_d = (_c = settings.data.appConfig).onFlowCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, { boardId: data.id, boardInfoId: data.board_info_id });
|
|
88
|
-
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('BOARD_SUCCESS_FLOWS_BUTTONS_STEP')); });
|
|
89
|
-
return [2, __assign(__assign({}, data), { board_id: boardId })];
|
|
90
|
-
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
91
96
|
});
|
|
92
|
-
});
|
|
97
|
+
});
|
|
93
98
|
export var resendOTP = createAsyncThunk('board/resendOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
94
99
|
var board, boardId, payload, data;
|
|
95
100
|
var _a, _b;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes, CivilFormValues, ActionState, AsyncThunkParams, DOBFormValues } from '../../../@types';
|
|
2
|
+
import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes, CivilFormValues, ActionState, AsyncThunkParams, DOBFormValues, MobileFormValues, MobileOwnershipFormValues } from '../../../@types';
|
|
3
3
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
4
|
data: any;
|
|
5
5
|
verifyNextStepName: any;
|
|
@@ -45,6 +45,13 @@ export declare const verifyNafath: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
45
45
|
response: any;
|
|
46
46
|
isNextScreenDob: boolean;
|
|
47
47
|
}, verifyNafathParams, {}>;
|
|
48
|
+
export declare const updateLeadMobile: import("@reduxjs/toolkit").AsyncThunk<{
|
|
49
|
+
leadResponse: any;
|
|
50
|
+
formData: MobileOwnershipFormValues;
|
|
51
|
+
}, MobileOwnershipFormValues, {}>;
|
|
52
|
+
export declare const skipUpdateLeadMobile: import("@reduxjs/toolkit").AsyncThunk<{
|
|
53
|
+
leadResponse: any;
|
|
54
|
+
}, void, {}>;
|
|
48
55
|
interface verifyPACIParams {
|
|
49
56
|
onSuccess?: () => void;
|
|
50
57
|
}
|
|
@@ -63,6 +70,7 @@ export declare const updateLeadIdentity: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
63
70
|
dob?: any;
|
|
64
71
|
termAndConditionChecked?: boolean | undefined;
|
|
65
72
|
};
|
|
73
|
+
countryCode: import("../../../@types").CountryCode;
|
|
66
74
|
}, NIDFormValues, {}>;
|
|
67
75
|
export declare const updateLeadDOB: import("@reduxjs/toolkit").AsyncThunk<{
|
|
68
76
|
data: any;
|
|
@@ -130,6 +138,7 @@ export interface BusinessData {
|
|
|
130
138
|
activitiesData: ActivitiesFormValues & ResponseData;
|
|
131
139
|
customersData: CustomersFormValues & ResponseData;
|
|
132
140
|
flowName: FlowsTypes;
|
|
141
|
+
mobileData: (MobileFormValues | undefined) & ResponseData;
|
|
133
142
|
}
|
|
134
143
|
export interface BusinessState extends SharedState<BusinessData> {
|
|
135
144
|
customLoading?: boolean;
|