@tap-payments/auth-jsconnect 2.9.40-development → 2.9.40-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.
@@ -33,7 +33,7 @@ var StyledTooltip = styled(function (_a) {
33
33
  var _b;
34
34
  var theme = _a.theme;
35
35
  return (_b = {},
36
- _b["& .".concat(tooltipClasses.tooltip)] = __assign(__assign({ color: alpha(theme.palette.text.primary, 0.5), width: 'fit-content', maxHeight: 'fit-content' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight, backgroundColor: theme.palette.secondary.light, border: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) }),
36
+ _b["& .".concat(tooltipClasses.tooltip)] = __assign(__assign({ color: alpha(theme.palette.text.primary, 0.5), width: 'fit-content', maxHeight: 'fit-content' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight, backgroundColor: theme.palette.secondary.light, border: "1px solid ".concat(alpha(theme.palette.divider, 0.8)), zIndex: 2147483647 }),
37
37
  _b);
38
38
  });
39
39
  var TextStyled = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
@@ -1,5 +1,6 @@
1
1
  import { ScreenStepNavigation, BusinessType } from '../@types';
2
2
  export declare const CONNECT_DEV_URL = "https://connect.dev.tap.company";
3
+ export declare const CONNECT_SANDBOX_URL = "https://connect.sandbox.tap.company";
3
4
  export declare const CONNECT_PROD_URL = "https://connect.tap.company";
4
5
  export declare const CLIENT_ORIGIN: string;
5
6
  export declare const TAP_WEBSITE = "https://www.tap.company/";
@@ -1,6 +1,7 @@
1
1
  import { BusinessType } from '../@types';
2
2
  import { CONNECT_FLOWS } from './flows';
3
3
  export var CONNECT_DEV_URL = 'https://connect.dev.tap.company';
4
+ export var CONNECT_SANDBOX_URL = 'https://connect.sandbox.tap.company';
4
5
  export var CONNECT_PROD_URL = 'https://connect.tap.company';
5
6
  export var CLIENT_ORIGIN = window.location.origin;
6
7
  export var TAP_WEBSITE = 'https://www.tap.company/';
@@ -238,15 +239,19 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
238
239
  },
239
240
  {
240
241
  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'],
242
+ next: [
243
+ 'CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP',
244
+ 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
245
+ 'COLLECT_MOBILE_OWNERSHIP',
246
+ 'CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP'
247
+ ],
242
248
  prev: [
243
249
  'CONNECT_EXPRESS_MOBILE_STEP',
244
250
  'CONNECT_EXPRESS_NID_STEP',
245
251
  'CONNECT_EXPRESS_CIVIL_ID_STEP',
246
252
  'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
247
253
  'CONNECT_EXPRESS_NID_MISSED_STEP',
248
- 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
249
- 'CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP'
254
+ 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP'
250
255
  ],
251
256
  order: 5
252
257
  },
@@ -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;
@@ -831,7 +831,7 @@ export var verifyPaciLeadIdentityAsync = createAsyncThunk('connectExpress/verify
831
831
  case 9:
832
832
  count++;
833
833
  return [3, 1];
834
- case 10: throw new Error('paci_verification_failed');
834
+ case 10: throw new Error('nafath_verification_failed');
835
835
  }
836
836
  });
837
837
  }); });
@@ -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()); } }) })));
@@ -1,5 +1,5 @@
1
1
  import { axiosInstance } from '../api';
2
- import { ENDPOINT_PATHS, CONNECT_DEV_URL, CONNECT_PROD_URL } from '../constants';
2
+ import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_PROD_URL } from '../constants';
3
3
  import { objectHasValues } from './object';
4
4
  import { isSA } from './string';
5
5
  export var sleep = function (milliseconds) {
@@ -19,7 +19,7 @@ export var setBaseUrl = function (publicKey, countryCode) {
19
19
  axiosInstance.defaults.baseURL = isSA(countryCode) ? ENDPOINT_PATHS.PRODUCTION_BASE_URL_SA : ENDPOINT_PATHS.PRODUCTION_BASE_URL;
20
20
  return;
21
21
  }
22
- axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
22
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
23
23
  };
24
24
  export var updateLocationUrlWithCountry = function (countryIso2) {
25
25
  var country = countryIso2.toLowerCase();
@@ -38,7 +38,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
38
38
  window.history.replaceState({}, '', newUrl);
39
39
  };
40
40
  export var openConnect = function (pk, countryCode) {
41
- var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_DEV_URL);
41
+ var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_SANDBOX_URL);
42
42
  if (countryCode) {
43
43
  newUrl.pathname = "/".concat(countryCode.toLowerCase());
44
44
  }
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.40-sandbox",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",
@@ -21,7 +21,7 @@
21
21
  "copy:files": "copyfiles -u 1 src/**/*.css build/",
22
22
  "tsc:alias": "tsc-alias -p tsconfig.json",
23
23
  "ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
24
- "push": "npm publish --access public --tag development"
24
+ "push": "npm publish --access public --tag sandbox"
25
25
  },
26
26
  "keywords": [],
27
27
  "author": {