@tap-payments/auth-jsconnect 2.10.8-beta → 2.10.8-development
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 +9 -2
- package/build/@types/app.js +8 -0
- package/build/@types/form.d.ts +3 -0
- package/build/@types/index.d.ts +1 -0
- package/build/@types/index.js +1 -0
- package/build/@types/terminal.d.ts +116 -0
- package/build/@types/terminal.js +1 -0
- package/build/api/auth.d.ts +10 -1
- package/build/api/index.d.ts +7 -1
- package/build/api/index.js +3 -1
- package/build/api/terminal.d.ts +28 -0
- package/build/api/terminal.js +45 -0
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +3 -1
- package/build/app/settings.d.ts +1 -0
- package/build/app/settings.js +7 -3
- package/build/app/store.d.ts +2 -0
- 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 +43 -6
- package/build/assets/locales/en.json +46 -9
- package/build/components/DeviceCard/DeviceCard.d.ts +18 -0
- package/build/components/DeviceCard/DeviceCard.js +103 -0
- package/build/components/DeviceCard/index.d.ts +3 -0
- package/build/components/DeviceCard/index.js +2 -0
- package/build/components/OTPTimer/OTPTimer.d.ts +2 -1
- package/build/components/OTPTimer/OTPTimer.js +4 -4
- 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 +0 -1
- package/build/constants/api.js +0 -2
- package/build/constants/app.d.ts +15 -3
- package/build/constants/app.js +158 -14
- package/build/constants/assets.d.ts +11 -0
- package/build/constants/assets.js +17 -3
- package/build/constants/flows.d.ts +15 -0
- package/build/constants/flows.js +15 -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 +136 -71
- package/build/features/app/connectExpress/connectExpressStore.d.ts +14 -3
- package/build/features/app/connectExpress/connectExpressStore.js +193 -49
- package/build/features/app/individual/individualStore.js +0 -1
- package/build/features/app/tax/taxStore.js +1 -1
- package/build/features/app/terminal/terminalStore.d.ts +109 -0
- package/build/features/app/terminal/terminalStore.js +676 -0
- 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/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/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.d.ts +1 -0
- package/build/features/featuresScreens.js +77 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/shared/Background/LogoBackground.js +5 -17
- package/build/features/shared/Button/Button.js +2 -3
- package/build/features/shared/Button/FlowsButtons.js +1 -1
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/shared/PushNotification/PushNotification.d.ts +11 -0
- package/build/features/shared/PushNotification/PushNotification.js +34 -0
- package/build/features/shared/PushNotification/index.d.ts +2 -0
- package/build/features/shared/PushNotification/index.js +2 -0
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +2 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
- package/build/features/terminal/Terminal.d.ts +14 -0
- package/build/features/terminal/Terminal.js +95 -0
- package/build/features/terminal/index.d.ts +1 -0
- package/build/features/terminal/index.js +1 -0
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.d.ts +3 -0
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +68 -0
- package/build/features/terminal/screens/LinkNewTerminal/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkNewTerminal/index.js +2 -0
- package/build/features/terminal/screens/LinkNewTerminal/styles.d.ts +10 -0
- package/build/features/terminal/screens/LinkNewTerminal/styles.js +28 -0
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.d.ts +3 -0
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +51 -0
- package/build/features/terminal/screens/LinkedSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkedSuccess/index.js +2 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.d.ts +3 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +50 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/index.js +2 -0
- package/build/features/terminal/screens/Loading/Loading.d.ts +4 -0
- package/build/features/terminal/screens/Loading/Loading.js +10 -0
- package/build/features/terminal/screens/Loading/index.d.ts +2 -0
- package/build/features/terminal/screens/Loading/index.js +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.d.ts +3 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +56 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/index.d.ts +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/index.js +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.d.ts +36 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.js +34 -0
- package/build/features/terminal/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/terminal/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/terminal/screens/OperatorError/index.d.ts +2 -0
- package/build/features/terminal/screens/OperatorError/index.js +2 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +3 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +21 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +31 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.d.ts +2 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.js +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +9 -0
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +20 -0
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.d.ts +3 -0
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +144 -0
- package/build/features/terminal/screens/TerminalDeviceList/index.d.ts +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/index.js +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +9 -0
- package/build/features/terminal/screens/TerminalDeviceList/styles.js +13 -0
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.d.ts +3 -0
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.js +42 -0
- package/build/features/terminal/screens/TerminalListPage/index.d.ts +2 -0
- package/build/features/terminal/screens/TerminalListPage/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.d.ts +3 -0
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +53 -0
- package/build/features/terminal/screens/UnlinkedSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/UnlinkedSuccess/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.d.ts +3 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +98 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.d.ts +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +26 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +30 -0
- package/build/features/terminal/screens/Verify/OTPInput.d.ts +7 -0
- package/build/features/terminal/screens/Verify/OTPInput.js +51 -0
- package/build/features/terminal/screens/Verify/Verify.d.ts +5 -0
- package/build/features/terminal/screens/Verify/Verify.js +85 -0
- package/build/features/terminal/screens/Verify/index.d.ts +2 -0
- package/build/features/terminal/screens/Verify/index.js +2 -0
- package/build/features/terminal/screens/Verify/validation.d.ts +8 -0
- package/build/features/terminal/screens/Verify/validation.js +4 -0
- package/build/features/terminal/screens/shared/Header.d.ts +10 -0
- package/build/features/terminal/screens/shared/Header.js +30 -0
- package/build/features/terminal/screens/shared/TerminalList.d.ts +11 -0
- package/build/features/terminal/screens/shared/TerminalList.js +25 -0
- package/build/features/terminal/screens/shared/index.d.ts +5 -0
- package/build/features/terminal/screens/shared/index.js +5 -0
- package/build/features/terminal/screens/shared/styles.d.ts +196 -0
- package/build/features/terminal/screens/shared/styles.js +155 -0
- package/build/features/terminal/screens/shared/utils.d.ts +7 -0
- package/build/features/terminal/screens/shared/utils.js +24 -0
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/index.d.ts +3 -2
- package/build/index.js +4 -2
- package/build/theme/palette.js +12 -0
- package/build/theme/typography.js +4 -0
- package/build/utils/common.js +4 -4
- package/build/utils/string.d.ts +2 -2
- package/build/utils/string.js +4 -1
- 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)) {
|
|
@@ -113,40 +124,35 @@ 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
|
-
|
|
133
|
+
_e = thunkApi.getState(), settings = _e.settings, auth = _e.auth;
|
|
123
134
|
isStartWithZero = (_b = params.mobile) === null || _b === void 0 ? void 0 : _b.startsWith('0');
|
|
124
135
|
mobileNumber = isStartWithZero ? params.mobile.slice(1) : params.mobile;
|
|
125
|
-
requestBody = {
|
|
126
|
-
country: settings.data.businessCountry.iso2,
|
|
127
|
-
scope: settings.data.appConfig.scope,
|
|
128
|
-
lang: settings.data.language,
|
|
129
|
-
lead_id: auth.data.leadId,
|
|
130
|
-
user_credentail: {
|
|
136
|
+
requestBody = __assign({ country: settings.data.businessCountry.iso2, scope: settings.data.appConfig.scope, lang: settings.data.language, lead_id: auth.data.leadId, user_credentail: {
|
|
131
137
|
phone: mobileNumber || '',
|
|
132
138
|
code: params.countryCode.idd_prefix.toString()
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
};
|
|
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
|
+
}));
|
|
139
144
|
return [4, API.authService.createAuth(requestBody)];
|
|
140
145
|
case 1:
|
|
141
|
-
data =
|
|
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));
|
|
143
149
|
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody.user_credentail);
|
|
144
|
-
return [2, { response: data, formData: params }];
|
|
150
|
+
return [2, { response: data, formData: params, skipPasscode: skipPasscode }];
|
|
145
151
|
}
|
|
146
152
|
});
|
|
147
153
|
}); });
|
|
148
154
|
export var resendMobileAuthOTP = createAsyncThunk('auth/resendMobileAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
149
|
-
var _a, settings, auth, isStartWithZero, mobileNumber, requestBody, data;
|
|
155
|
+
var _a, settings, auth, isStartWithZero, mobileNumber, skipPasscode, requestBody, data;
|
|
150
156
|
var _b;
|
|
151
157
|
return __generator(this, function (_c) {
|
|
152
158
|
switch (_c.label) {
|
|
@@ -154,20 +160,15 @@ export var resendMobileAuthOTP = createAsyncThunk('auth/resendMobileAuthOTP', fu
|
|
|
154
160
|
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
155
161
|
isStartWithZero = (_b = params.mobile) === null || _b === void 0 ? void 0 : _b.startsWith('0');
|
|
156
162
|
mobileNumber = isStartWithZero ? params.mobile.slice(1) : params.mobile;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
scope: settings.data.appConfig.scope,
|
|
160
|
-
lang: settings.data.language,
|
|
161
|
-
lead_id: auth.data.leadId,
|
|
162
|
-
user_credentail: {
|
|
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: {
|
|
163
165
|
phone: mobileNumber,
|
|
164
166
|
code: params.countryCode.idd_prefix.toString()
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
};
|
|
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
|
+
}));
|
|
171
172
|
return [4, API.authService.createAuth(requestBody)];
|
|
172
173
|
case 1:
|
|
173
174
|
data = _c.sent();
|
|
@@ -218,37 +219,79 @@ export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (
|
|
|
218
219
|
}
|
|
219
220
|
});
|
|
220
221
|
}); });
|
|
221
|
-
export var
|
|
222
|
-
var _a, settings, auth,
|
|
223
|
-
var
|
|
224
|
-
return __generator(this, function (
|
|
225
|
-
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) {
|
|
226
227
|
case 0:
|
|
227
228
|
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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']
|
|
240
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
|
+
}));
|
|
241
282
|
return [4, API.authService.createAuth(requestBody)];
|
|
242
283
|
case 1:
|
|
243
|
-
data =
|
|
244
|
-
|
|
284
|
+
data = _e.sent();
|
|
285
|
+
stepName = 'AUTH_PASSWORD_STEP';
|
|
245
286
|
if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.RESET_PASSWORD)
|
|
246
|
-
|
|
247
|
-
if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.EMAIL_OTP)
|
|
248
|
-
|
|
249
|
-
|
|
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));
|
|
250
293
|
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody.user_credentail);
|
|
251
|
-
return [2, { response: data, formData: params }];
|
|
294
|
+
return [2, { response: data, formData: params, skipPasscode: skipPasscode }];
|
|
252
295
|
}
|
|
253
296
|
});
|
|
254
297
|
}); });
|
|
@@ -296,24 +339,19 @@ export var verifyEmailPassword = createAsyncThunk('auth/verifyEmailPassword', fu
|
|
|
296
339
|
});
|
|
297
340
|
}); });
|
|
298
341
|
export var resendEmailAuthOTP = createAsyncThunk('auth/resendEmailAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
299
|
-
var _a, settings, auth, requestBody, data;
|
|
342
|
+
var _a, settings, auth, skipPasscode, requestBody, data;
|
|
300
343
|
return __generator(this, function (_b) {
|
|
301
344
|
switch (_b.label) {
|
|
302
345
|
case 0:
|
|
303
346
|
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
scope: settings.data.appConfig.scope,
|
|
307
|
-
lang: settings.data.language,
|
|
308
|
-
lead_id: auth.data.leadId,
|
|
309
|
-
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: {
|
|
310
349
|
email: params.email || ''
|
|
311
|
-
},
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
};
|
|
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
|
+
}));
|
|
317
355
|
return [4, API.authService.createAuth(requestBody)];
|
|
318
356
|
case 1:
|
|
319
357
|
data = _b.sent();
|
|
@@ -861,6 +899,9 @@ var initialState = {
|
|
|
861
899
|
otp: '',
|
|
862
900
|
authFor: AuthForType.MOBILE
|
|
863
901
|
},
|
|
902
|
+
passcodeData: {
|
|
903
|
+
passcode: ''
|
|
904
|
+
},
|
|
864
905
|
passwordData: {
|
|
865
906
|
password: ''
|
|
866
907
|
},
|
|
@@ -955,6 +996,8 @@ export var authSlice = createSlice({
|
|
|
955
996
|
state.loading = false;
|
|
956
997
|
state.data.mobileData = action.payload.formData;
|
|
957
998
|
state.data.otpData.authFor = AuthForType.MOBILE;
|
|
999
|
+
state.data.passcodeData.skipPasscode = action.payload.skipPasscode;
|
|
1000
|
+
state.data.passcodeData.allowOTPToPasscodeRedirection = action.payload.skipPasscode;
|
|
958
1001
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
|
|
959
1002
|
})
|
|
960
1003
|
.addCase(createMobileAuth.rejected, function (state, action) {
|
|
@@ -981,10 +1024,28 @@ export var authSlice = createSlice({
|
|
|
981
1024
|
state.loading = false;
|
|
982
1025
|
var data = action.payload;
|
|
983
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;
|
|
984
1029
|
})
|
|
985
1030
|
.addCase(verifyMobileOtp.rejected, function (state, action) {
|
|
986
1031
|
state.loading = false;
|
|
987
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;
|
|
988
1049
|
})
|
|
989
1050
|
.addCase(createEmailAuth.pending, function (state) {
|
|
990
1051
|
state.loading = true;
|
|
@@ -994,6 +1055,8 @@ export var authSlice = createSlice({
|
|
|
994
1055
|
state.loading = false;
|
|
995
1056
|
state.data.emailData = action.payload.formData;
|
|
996
1057
|
state.data.otpData.authFor = AuthForType.EMAIL;
|
|
1058
|
+
state.data.passcodeData.skipPasscode = action.payload.skipPasscode;
|
|
1059
|
+
state.data.passcodeData.allowOTPToPasscodeRedirection = action.payload.skipPasscode;
|
|
997
1060
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
|
|
998
1061
|
})
|
|
999
1062
|
.addCase(createEmailAuth.rejected, function (state, action) {
|
|
@@ -1034,6 +1097,8 @@ export var authSlice = createSlice({
|
|
|
1034
1097
|
state.loading = false;
|
|
1035
1098
|
var data = action.payload;
|
|
1036
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;
|
|
1037
1102
|
})
|
|
1038
1103
|
.addCase(verifyEmailOtp.rejected, function (state, action) {
|
|
1039
1104
|
state.loading = false;
|
|
@@ -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;
|