@tap-payments/auth-jsconnect 2.9.40-development → 2.9.41-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.
@@ -238,15 +238,19 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
238
238
  },
239
239
  {
240
240
  name: 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP',
241
- next: ['CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP', 'COLLECT_MOBILE_OWNERSHIP'],
241
+ next: [
242
+ 'CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP',
243
+ 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
244
+ 'COLLECT_MOBILE_OWNERSHIP',
245
+ 'CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP'
246
+ ],
242
247
  prev: [
243
248
  'CONNECT_EXPRESS_MOBILE_STEP',
244
249
  'CONNECT_EXPRESS_NID_STEP',
245
250
  'CONNECT_EXPRESS_CIVIL_ID_STEP',
246
251
  'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
247
252
  'CONNECT_EXPRESS_NID_MISSED_STEP',
248
- 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
249
- 'CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP'
253
+ 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP'
250
254
  ],
251
255
  order: 5
252
256
  },
@@ -139,6 +139,7 @@ export declare const skipUpdateLeadMobile: import("@reduxjs/toolkit").AsyncThunk
139
139
  export declare const verifyAuthMobileOtpAsync: import("@reduxjs/toolkit").AsyncThunk<{
140
140
  data: any;
141
141
  }, OTPFormValues, {}>;
142
+ export declare const resendLeadMobileAuthOTP: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
142
143
  export declare const confirmInfo: import("@reduxjs/toolkit").AsyncThunk<{
143
144
  boardInfo: any;
144
145
  boardData: any;
@@ -1305,6 +1305,31 @@ export var verifyAuthMobileOtpAsync = createAsyncThunk('connectExpress/verifyAut
1305
1305
  }
1306
1306
  });
1307
1307
  }); });
1308
+ export var resendLeadMobileAuthOTP = createAsyncThunk('connectExpress/resendLeadMobileAuthOTPExpress', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
1309
+ var connectExpress, payload, data;
1310
+ var _a, _b, _c, _d, _e, _f;
1311
+ return __generator(this, function (_g) {
1312
+ switch (_g.label) {
1313
+ case 0:
1314
+ connectExpress = thunkApi.getState().connectExpress;
1315
+ payload = {
1316
+ id: ((_b = (_a = connectExpress.data.responseData) === null || _a === void 0 ? void 0 : _a.leadData) === null || _b === void 0 ? void 0 : _b.id) || '',
1317
+ contact: {
1318
+ phone: {
1319
+ country_code: (_e = (_d = (_c = connectExpress.data.individualData) === null || _c === void 0 ? void 0 : _c.countryCode) === null || _d === void 0 ? void 0 : _d.idd_prefix) === null || _e === void 0 ? void 0 : _e.toString(),
1320
+ number: ((_f = connectExpress.data.individualData) === null || _f === void 0 ? void 0 : _f.mobile) || ''
1321
+ }
1322
+ },
1323
+ step_name: CONNECT_EXPRESS_STEP_NAMES.UPDATE_LEAD_INDIVIDUAL,
1324
+ encryption_contract: ['contact.phone.country_code', 'contact.phone.number']
1325
+ };
1326
+ return [4, API.leadService.updateLeadExpress(payload)];
1327
+ case 1:
1328
+ data = _g.sent();
1329
+ return [2, data];
1330
+ }
1331
+ });
1332
+ }); });
1308
1333
  export var confirmInfo = createAsyncThunk('connectExpress/confirmInfo', function (_a, thunkApi) {
1309
1334
  var brandInfo = _a.brandInfo, entityInfo = _a.entityInfo, merchantInfo = _a.merchantInfo;
1310
1335
  return __awaiter(void 0, void 0, void 0, function () {
@@ -1908,6 +1933,18 @@ export var connectSlice = createSlice({
1908
1933
  .addCase(verifyAuthMobileOtpAsync.rejected, function (state, action) {
1909
1934
  state.loading = false;
1910
1935
  state.error = action.error.message;
1936
+ })
1937
+ .addCase(resendLeadMobileAuthOTP.pending, function (state) {
1938
+ state.loading = true;
1939
+ state.error = null;
1940
+ })
1941
+ .addCase(resendLeadMobileAuthOTP.fulfilled, function (state) {
1942
+ state.loading = false;
1943
+ state.error = null;
1944
+ })
1945
+ .addCase(resendLeadMobileAuthOTP.rejected, function (state, action) {
1946
+ state.loading = false;
1947
+ state.error = action.error.message;
1911
1948
  })
1912
1949
  .addCase(createAccountAsync.pending, function (state) {
1913
1950
  state.loading = true;
@@ -17,10 +17,8 @@ import Box from '@mui/material/Box/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { connectExpressSelector, clearError, updateLeadIndividualAsync, updateLeadMobile, updateLeadDOBAsync } from '../../../app/connectExpress/connectExpressStore';
20
+ import { connectExpressSelector, clearError, resendLeadMobileAuthOTP } from '../../../app/connectExpress/connectExpressStore';
21
21
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
22
- import { deepCopy } from '../../../../utils';
23
- import { AuthForScreen } from '../../../../@types';
24
22
  var BoxStyled = styled(Box)(function (_a) {
25
23
  var theme = _a.theme;
26
24
  return ({
@@ -34,9 +32,7 @@ var OTPInput = function (_a) {
34
32
  var t = useTranslation().t;
35
33
  var dispatch = useAppDispatch();
36
34
  var otpControl = useController({ name: 'otp', control: control });
37
- var _c = useAppSelector(connectExpressSelector), data = _c.data, error = _c.error;
38
- var verifyAuthOtpData = data.verifyAuthOtpData, individualData = data.individualData, dobData = data.dobData;
39
- var authFor = verifyAuthOtpData.authFor;
35
+ var error = useAppSelector(connectExpressSelector).error;
40
36
  var handleOnOTPChange = function (otp) {
41
37
  if (error)
42
38
  dispatch(clearError());
@@ -45,12 +41,7 @@ var OTPInput = function (_a) {
45
41
  var handleOnResendOTP = function () {
46
42
  if (otpControl.field.value)
47
43
  setValue('otp', '', { shouldValidate: true });
48
- if (authFor === AuthForScreen.MOBILE_OWNERSHIP)
49
- dispatch(updateLeadMobile(deepCopy(individualData)));
50
- else if (authFor === AuthForScreen.DOB)
51
- dispatch(updateLeadDOBAsync(deepCopy(dobData)));
52
- else
53
- dispatch(updateLeadIndividualAsync(deepCopy(individualData)));
44
+ dispatch(resendLeadMobileAuthOTP());
54
45
  };
55
46
  var otpValue = otpControl.field.value;
56
47
  return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.9.40-development",
3
+ "version": "2.9.41-development",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",