@tap-payments/auth-jsconnect 2.8.44-test → 2.8.45-beta
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/form.d.ts +0 -1
- package/build/@types/redux.d.ts +0 -1
- package/build/api/axios.js +1 -2
- package/build/api/entity.d.ts +2 -2
- package/build/api/entity.js +4 -12
- package/build/api/index.d.ts +2 -2
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +2 -0
- package/build/constants/app.js +11 -3
- package/build/features/app/bank/bankStore.d.ts +18 -13
- package/build/features/app/bank/bankStore.js +161 -173
- package/build/features/app/board/boardStore.js +30 -52
- package/build/features/app/brand/brandStore.d.ts +33 -16
- package/build/features/app/brand/brandStore.js +204 -173
- package/build/features/app/business/businessStore.d.ts +5 -0
- package/build/features/app/business/businessStore.js +86 -69
- package/build/features/app/connectExpress/connectExpressStore.js +10 -18
- package/build/features/app/entity/entityStore.d.ts +35 -15
- package/build/features/app/entity/entityStore.js +228 -159
- package/build/features/app/individual/individualStore.d.ts +37 -21
- package/build/features/app/individual/individualStore.js +265 -253
- package/build/features/app/password/passwordStore.d.ts +23 -40
- package/build/features/app/password/passwordStore.js +233 -226
- package/build/features/app/tax/taxStore.d.ts +7 -13
- package/build/features/app/tax/taxStore.js +147 -167
- package/build/features/bank/Bank.d.ts +0 -1
- package/build/features/bank/Bank.js +4 -7
- package/build/features/bank/screens/BankDetails/BankDetails.js +4 -12
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/bank/screens/Verify/Verify.js +5 -5
- package/build/features/board/Board.js +4 -8
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -3
- package/build/features/brand/Brand.d.ts +0 -1
- package/build/features/brand/Brand.js +4 -7
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +1 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -6
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +1 -1
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +1 -1
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/brand/screens/Verify/Verify.js +1 -1
- package/build/features/business/Business.js +4 -9
- package/build/features/business/screens/Activities/Activities.js +1 -1
- package/build/features/business/screens/BusinessType/BusinessType.js +1 -1
- package/build/features/business/screens/CivilID/CivilID.js +1 -1
- package/build/features/business/screens/Customers/Customers.js +1 -1
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -6
- package/build/features/business/screens/IDBOD/IDBOD.js +1 -1
- package/build/features/business/screens/OTP/OTP.js +1 -1
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/business/screens/Verify/Verify.js +1 -1
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +1 -2
- package/build/features/connect/screens/CivilID/CivilID.js +1 -1
- package/build/features/connect/screens/Individual/Email.js +1 -3
- package/build/features/connect/screens/Individual/Individual.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +3 -3
- package/build/features/connect/screens/Merchant/Merchant.js +1 -1
- package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
- package/build/features/connect/screens/Mobile/Mobile.js +1 -1
- package/build/features/connect/screens/NID/NID.js +1 -1
- package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +2 -5
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +1 -6
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +0 -3
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +0 -10
- package/build/features/connectExpress/screens/CivilID/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
- package/build/features/connectExpress/screens/Mobile/Mobile.js +1 -1
- package/build/features/connectExpress/screens/NID/NID.js +1 -1
- package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/Entity.d.ts +0 -1
- package/build/features/entity/Entity.js +4 -7
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -8
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -8
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +1 -1
- package/build/features/entity/screens/EntityName/EntityName.js +1 -1
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/screens/Verify/Verify.js +1 -1
- package/build/features/featuresScreens.js +7 -62
- package/build/features/individual/Individual.d.ts +0 -1
- package/build/features/individual/Individual.js +4 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +7 -14
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -3
- package/build/features/individual/screens/IndividualList/Email.js +2 -3
- package/build/features/individual/screens/IndividualList/IndividualList.js +5 -11
- package/build/features/individual/screens/IndividualList/UserList.js +9 -13
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +3 -4
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/individual/screens/Verify/Verify.js +1 -1
- package/build/features/password/Password.d.ts +0 -1
- package/build/features/password/Password.js +28 -75
- package/build/features/password/screens/CreatePassword/CreatePassword.js +4 -8
- package/build/features/password/screens/OTP/OTP.js +1 -1
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/password/screens/Verify/Verify.js +5 -5
- package/build/features/shared/Button/FlowsButtons.js +3 -4
- package/build/features/shared/Containers/FeatureContainer.d.ts +0 -1
- package/build/features/shared/Containers/FeatureContainer.js +3 -3
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +1 -5
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -3
- package/build/features/signIn/SignIn.js +3 -12
- package/build/features/tax/Tax.d.ts +0 -1
- package/build/features/tax/Tax.js +4 -7
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -7
- package/build/features/tax/screens/Verify/Verify.js +5 -5
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/useVerifyToken.d.ts +2 -5
- package/build/hooks/useVerifyToken.js +5 -10
- package/build/utils/common.js +4 -4
- package/build/utils/locale.js +1 -2
- package/build/utils/string.d.ts +2 -5
- package/build/utils/string.js +5 -34
- package/package.json +2 -2
- package/build/features/bank/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/bank/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/bank/screens/OperatorError/index.d.ts +0 -3
- package/build/features/bank/screens/OperatorError/index.js +0 -2
- package/build/features/board/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/board/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/board/screens/OperatorError/index.d.ts +0 -3
- package/build/features/board/screens/OperatorError/index.js +0 -2
- package/build/features/brand/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/brand/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/brand/screens/OperatorError/index.d.ts +0 -3
- package/build/features/brand/screens/OperatorError/index.js +0 -2
- package/build/features/business/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/business/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/business/screens/OperatorError/index.d.ts +0 -3
- package/build/features/business/screens/OperatorError/index.js +0 -2
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +0 -31
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +0 -90
- package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/connectExpress/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/connectExpress/screens/OperatorError/index.d.ts +0 -3
- package/build/features/connectExpress/screens/OperatorError/index.js +0 -2
- package/build/features/entity/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/entity/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/entity/screens/OperatorError/index.d.ts +0 -3
- package/build/features/entity/screens/OperatorError/index.js +0 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +0 -36
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +0 -76
- package/build/features/individual/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/individual/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/individual/screens/OperatorError/index.d.ts +0 -3
- package/build/features/individual/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/password/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/password/screens/OperatorError/index.d.ts +0 -3
- package/build/features/password/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -4
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +0 -10
- package/build/features/password/screens/PrepareDataLoading/index.d.ts +0 -2
- package/build/features/password/screens/PrepareDataLoading/index.js +0 -2
- package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/signIn/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/signIn/screens/OperatorError/index.d.ts +0 -3
- package/build/features/signIn/screens/OperatorError/index.js +0 -2
- package/build/features/tax/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/tax/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/tax/screens/OperatorError/index.d.ts +0 -3
- package/build/features/tax/screens/OperatorError/index.js +0 -2
- package/build/hooks/useFormDirtyCheck.d.ts +0 -6
- package/build/hooks/useFormDirtyCheck.js +0 -29
|
@@ -17,7 +17,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
17
17
|
import Box from '@mui/material/Box';
|
|
18
18
|
import { styled } from '@mui/material/styles';
|
|
19
19
|
import { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
|
|
20
|
-
import {
|
|
20
|
+
import { handleCurrentActiveScreen, handleNextScreenStep, settingsSelector } from '../../../../app/settings';
|
|
21
21
|
import Form from '../../../../components/Form';
|
|
22
22
|
import { useLanguage } from '../../../../hooks';
|
|
23
23
|
import { PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
@@ -25,7 +25,7 @@ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
|
25
25
|
import Button from '../../../shared/Button';
|
|
26
26
|
import { PasswordValidation } from './validation';
|
|
27
27
|
import Password from './Password';
|
|
28
|
-
import { createPassword, passwordSelector,
|
|
28
|
+
import { createPassword, passwordSelector, storePasswordScreen } from '../../../app/password/passwordStore';
|
|
29
29
|
import { useSelector } from 'react-redux';
|
|
30
30
|
import { deepCopy } from '../../../../utils';
|
|
31
31
|
var InputsContainerStyled = styled(Box)(function (_a) {
|
|
@@ -61,13 +61,9 @@ var CreatePassword = function (_a) {
|
|
|
61
61
|
dispatch(createPassword(deepCopy(data)));
|
|
62
62
|
};
|
|
63
63
|
var onBack = function () {
|
|
64
|
-
|
|
65
|
-
dispatch(handlePrevScreenStep());
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
dispatch(retrieveBoardStatus());
|
|
64
|
+
dispatch(handleCurrentActiveScreen('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
69
65
|
};
|
|
70
|
-
var disableBack = settingsData.appConfig.mode === 'content';
|
|
66
|
+
var disableBack = settingsData.appConfig.mode === 'content' ? true : !(flows === null || flows === void 0 ? void 0 : flows.length);
|
|
71
67
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(Password, {}) }), _jsx(Button, __assign({ disableBack: disableBack, onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
72
68
|
};
|
|
73
69
|
export default React.memo(CreatePassword);
|
|
@@ -83,7 +83,7 @@ var OTP = function (_a) {
|
|
|
83
83
|
var onBack = function () {
|
|
84
84
|
dispatch(handlePrevScreenStep());
|
|
85
85
|
};
|
|
86
|
-
var disabled = !methods.formState.isValid;
|
|
86
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
87
87
|
var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.auth_info) === null || _c === void 0 ? void 0 : _c.phone;
|
|
88
88
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
89
89
|
};
|
|
@@ -21,10 +21,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
21
21
|
var _a = useAppSelector(passwordSelector), data = _a.data, loading = _a.loading;
|
|
22
22
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
23
23
|
var isScopeAuthentication = settingsData.appConfig.scope === SCOPE_AUTH;
|
|
24
|
-
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals
|
|
24
|
+
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals;
|
|
25
25
|
var onClose = function () {
|
|
26
26
|
dispatch(onCloseCompletePassword());
|
|
27
27
|
};
|
|
28
|
-
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined
|
|
28
|
+
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined }));
|
|
29
29
|
};
|
|
30
30
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -46,9 +46,9 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
46
46
|
flexDirection: 'column'
|
|
47
47
|
}); });
|
|
48
48
|
var VerifyNumber = function (_a) {
|
|
49
|
-
var _b, _c;
|
|
49
|
+
var _b, _c, _d;
|
|
50
50
|
var dispatch = useAppDispatch();
|
|
51
|
-
var
|
|
51
|
+
var _e = useAppSelector(passwordSelector), data = _e.data, loading = _e.loading, error = _e.error;
|
|
52
52
|
var otp = data.otpData.otp;
|
|
53
53
|
var methods = useForm({
|
|
54
54
|
resolver: yupResolver(OTPValidation),
|
|
@@ -60,8 +60,8 @@ var VerifyNumber = function (_a) {
|
|
|
60
60
|
useSetFromDefaultValues(methods, data.otpData);
|
|
61
61
|
var t = useTranslation().t;
|
|
62
62
|
var isAr = useLanguage().isAr;
|
|
63
|
-
var
|
|
64
|
-
var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.
|
|
63
|
+
var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
|
|
64
|
+
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
65
65
|
React.useEffect(function () {
|
|
66
66
|
if (error && methods.formState.isValid && phone)
|
|
67
67
|
dispatch(clearError());
|
|
@@ -72,7 +72,7 @@ var VerifyNumber = function (_a) {
|
|
|
72
72
|
var onSubmit = function (formData) {
|
|
73
73
|
dispatch(verifyPasswordLeadOTP(deepCopy(formData)));
|
|
74
74
|
};
|
|
75
|
-
var disabled = !methods.formState.isValid || !phone || resendLoading;
|
|
75
|
+
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
76
76
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled || resendLoading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
77
77
|
};
|
|
78
78
|
export default React.memo(VerifyNumber);
|
|
@@ -57,7 +57,7 @@ import { ICONS_NAMES } from '../../../constants';
|
|
|
57
57
|
import CheckIcon from '@mui/icons-material/Check';
|
|
58
58
|
import { useAppDispatch, useAppSelector, useLanguage } from '../../../hooks';
|
|
59
59
|
import { handleOpen, handleCurrentActiveScreen, handleNextScreenStep, settingsSelector } from '../../../app/settings';
|
|
60
|
-
import { dangerousMessage, getScreenNameBasedOnFlow
|
|
60
|
+
import { dangerousMessage, getScreenNameBasedOnFlow } from '../../../utils';
|
|
61
61
|
import API from '../../../api';
|
|
62
62
|
import Text from '../../../components/Text';
|
|
63
63
|
import Dot from '../Dot';
|
|
@@ -160,9 +160,8 @@ export default function FlowsButtons(_a) {
|
|
|
160
160
|
var onRedirect = function (item) {
|
|
161
161
|
if (!item.href)
|
|
162
162
|
return;
|
|
163
|
-
if (flowName === item.name &&
|
|
164
|
-
|
|
165
|
-
dispatch(handleCurrentActiveScreen(getScreenNameBasedOnFlow(item.name, isAuthorizedUser, isOtherThanSAOrKWCountry)));
|
|
163
|
+
if (flowName === item.name && item.name !== 'password') {
|
|
164
|
+
dispatch(handleCurrentActiveScreen(getScreenNameBasedOnFlow(item.name, isAuthorizedUser)));
|
|
166
165
|
return;
|
|
167
166
|
}
|
|
168
167
|
if (typeof settingsData.appConfig.onBoardButtonClick === 'function') {
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { BoxProps } from '@mui/material/Box';
|
|
3
3
|
interface FeatureContainerProps extends BoxProps {
|
|
4
4
|
isMaturityExpress?: boolean;
|
|
5
|
-
mode?: 'popup' | 'page' | 'content';
|
|
6
5
|
}
|
|
7
6
|
declare const FeatureContainer: React.ForwardRefExoticComponent<Omit<FeatureContainerProps, "ref"> & React.RefAttributes<unknown>>;
|
|
8
7
|
export default FeatureContainer;
|
|
@@ -13,9 +13,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { styled } from '@mui/material/styles';
|
|
15
15
|
import Box from '@mui/material/Box';
|
|
16
|
-
var Container = styled(Box, { shouldForwardProp: function (prop) { return
|
|
16
|
+
var Container = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'isMaturityExpress'; } })(function (_a) {
|
|
17
17
|
var _b;
|
|
18
|
-
var theme = _a.theme, isMaturityExpress = _a.isMaturityExpress
|
|
18
|
+
var theme = _a.theme, isMaturityExpress = _a.isMaturityExpress;
|
|
19
19
|
return (_b = {
|
|
20
20
|
width: '100%',
|
|
21
21
|
minHeight: theme.spacing(30),
|
|
@@ -27,7 +27,7 @@ var Container = styled(Box, { shouldForwardProp: function (prop) { return !['isM
|
|
|
27
27
|
property: 'all'
|
|
28
28
|
},
|
|
29
29
|
_b[theme.breakpoints.down('sm')] = {
|
|
30
|
-
paddingTop: isMaturityExpress
|
|
30
|
+
paddingTop: isMaturityExpress ? theme.spacing(2.5) : theme.spacing(6)
|
|
31
31
|
},
|
|
32
32
|
_b);
|
|
33
33
|
});
|
|
@@ -12,12 +12,8 @@ interface SuccessFlowButtonsProps {
|
|
|
12
12
|
boardInfoId: string;
|
|
13
13
|
boardId: string;
|
|
14
14
|
flowName: FlowsTypes;
|
|
15
|
-
recipient: {
|
|
16
|
-
id: string;
|
|
17
|
-
type: string;
|
|
18
|
-
};
|
|
19
15
|
onClose?: () => void;
|
|
20
16
|
loading?: boolean;
|
|
21
17
|
}
|
|
22
|
-
declare const _default: React.MemoExoticComponent<({ brand, entity, business, merchant, bank, user, flows, boardInfoId, boardId, flowName, individuals,
|
|
18
|
+
declare const _default: React.MemoExoticComponent<({ brand, entity, business, merchant, bank, user, flows, boardInfoId, boardId, flowName, individuals, onClose, loading }: SuccessFlowButtonsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
23
19
|
export default _default;
|
|
@@ -45,12 +45,12 @@ var ButtonGroupStyled = styled(Box)(function (_a) {
|
|
|
45
45
|
});
|
|
46
46
|
var SuccessFlowButtons = function (_a) {
|
|
47
47
|
var _b, _c, _d;
|
|
48
|
-
var brand = _a.brand, entity = _a.entity, business = _a.business, merchant = _a.merchant, bank = _a.bank, user = _a.user, flows = _a.flows, boardInfoId = _a.boardInfoId, boardId = _a.boardId, flowName = _a.flowName, individuals = _a.individuals,
|
|
48
|
+
var brand = _a.brand, entity = _a.entity, business = _a.business, merchant = _a.merchant, bank = _a.bank, user = _a.user, flows = _a.flows, boardInfoId = _a.boardInfoId, boardId = _a.boardId, flowName = _a.flowName, individuals = _a.individuals, onClose = _a.onClose, loading = _a.loading;
|
|
49
49
|
var _e = useState([]), buttons = _e[0], setButtons = _e[1];
|
|
50
50
|
var t = useTranslation().t;
|
|
51
51
|
var isAr = useLanguage().isAr;
|
|
52
52
|
var settings = useAppSelector(settingsSelector);
|
|
53
|
-
var _f = user || {}, names = _f.names, identification = _f.identification, is_authorized = _f.is_authorized
|
|
53
|
+
var _f = user || {}, names = _f.names, identification = _f.identification, is_authorized = _f.is_authorized;
|
|
54
54
|
var primary_contact = (business || {}).primary_contact;
|
|
55
55
|
var _g = entity || {}, license = _g.license, vat_id = _g.vat_id, legal_name = _g.legal_name;
|
|
56
56
|
var count = (individuals || {}).count;
|
|
@@ -66,7 +66,7 @@ var SuccessFlowButtons = function (_a) {
|
|
|
66
66
|
var isPayout = payout_status === MerchantStatus.ENABLED;
|
|
67
67
|
var maskedId = (identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
|
|
68
68
|
var email = (primary_contact || {}).email;
|
|
69
|
-
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, boardId, boardInfoId
|
|
69
|
+
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, boardId, boardInfoId);
|
|
70
70
|
var flowsDetails = [
|
|
71
71
|
{ name: 'brand', status: brand === null || brand === void 0 ? void 0 : brand.data_state },
|
|
72
72
|
{ name: 'entity', status: entity === null || entity === void 0 ? void 0 : entity.data_state },
|
|
@@ -10,10 +10,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import { memo } from 'react';
|
|
14
14
|
import { createRoot } from 'react-dom/client';
|
|
15
|
-
import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener
|
|
16
|
-
import {
|
|
15
|
+
import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener } from '../../hooks';
|
|
16
|
+
import { settingsSelector } from '../../app/settings';
|
|
17
17
|
import AnimationFlow from '../../components/AnimationFlow';
|
|
18
18
|
import { store } from '../../app/store';
|
|
19
19
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
@@ -26,21 +26,12 @@ import { signInSelector } from '../app/signIn/signInStore';
|
|
|
26
26
|
import Background from '../shared/Background';
|
|
27
27
|
var SignIn = memo(function (props) {
|
|
28
28
|
var theme = useAppTheme().theme;
|
|
29
|
-
var dispatch = useAppDispatch();
|
|
30
29
|
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
31
30
|
var _b = useAppSelector(signInSelector), signInError = _b.error, loading = _b.loading;
|
|
32
31
|
useAppConfig(__assign({ navigation: SigIn_SCREENS_NAVIGATION }, props));
|
|
33
32
|
useErrorListener(signInError || error);
|
|
34
33
|
useStepStartedListener();
|
|
35
34
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, merchant = data.merchant, isMaturityExpress = data.isMaturityExpress;
|
|
36
|
-
React.useEffect(function () {
|
|
37
|
-
if (settingLoading || !props.open)
|
|
38
|
-
return;
|
|
39
|
-
if (!data.isValidOperator) {
|
|
40
|
-
dispatch(handleCurrentActiveScreen('SIGIN_OPERATOR_ERROR_STEP'));
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
}, [data.isValidOperator, settingLoading]);
|
|
44
35
|
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: settingLoading, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: signInFeatureScreens.map(function (_a, index) {
|
|
45
36
|
var Element = _a.element, name = _a.name;
|
|
46
37
|
var isActive = activeScreen.name === name;
|
|
@@ -2,7 +2,6 @@ import { LibConfig } from '../../@types';
|
|
|
2
2
|
export interface TaxLibProps extends LibConfig {
|
|
3
3
|
verifyToken?: string;
|
|
4
4
|
configToken?: string;
|
|
5
|
-
loaderColor?: string;
|
|
6
5
|
}
|
|
7
6
|
export declare function TaxElement(props: TaxLibProps): import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export declare function renderTaxLib(config: TaxLibProps, elementId: string): {
|
|
@@ -36,7 +36,7 @@ import { taxFeatureScreens } from '../featuresScreens';
|
|
|
36
36
|
import { taxSelector, verifyLeadToken } from '../app/tax/taxStore';
|
|
37
37
|
import Background from '../shared/Background';
|
|
38
38
|
var Tax = memo(function (_a) {
|
|
39
|
-
var configToken = _a.configToken, verifyToken = _a.verifyToken,
|
|
39
|
+
var configToken = _a.configToken, verifyToken = _a.verifyToken, props = __rest(_a, ["configToken", "verifyToken"]);
|
|
40
40
|
var theme = useAppTheme().theme;
|
|
41
41
|
var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
|
|
42
42
|
var _c = useAppSelector(taxSelector), customLoading = _c.customLoading, taxError = _c.error, loading = _c.loading;
|
|
@@ -54,14 +54,11 @@ var Tax = memo(function (_a) {
|
|
|
54
54
|
loadingScreenName: 'TAX_LOADING_DATA_STEP',
|
|
55
55
|
navigation: featureScreensNavigation,
|
|
56
56
|
open: open,
|
|
57
|
-
mode: props.mode,
|
|
58
57
|
internalToken: verifyToken,
|
|
59
|
-
settingLoading: settingLoading
|
|
60
|
-
operatorErrorScreenName: 'TAX_OPERATOR_ERROR_STEP',
|
|
61
|
-
isValidOperator: data.isValidOperator
|
|
58
|
+
settingLoading: settingLoading
|
|
62
59
|
});
|
|
63
|
-
var initialLoading = verifyToken
|
|
64
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({
|
|
60
|
+
var initialLoading = verifyToken ? settingLoading : settingLoading || customLoading;
|
|
61
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: initialLoading, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: taxFeatureScreens.map(function (_a, index) {
|
|
65
62
|
var Element = _a.element, name = _a.name;
|
|
66
63
|
var isActive = activeScreen.name === name;
|
|
67
64
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -21,10 +21,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
21
21
|
var _a = useAppSelector(taxSelector), data = _a.data, loading = _a.loading;
|
|
22
22
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
23
23
|
var isScopeAuthentication = settingsData.appConfig.scope === SCOPE_AUTH;
|
|
24
|
-
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals
|
|
24
|
+
var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals;
|
|
25
25
|
var onClose = function () {
|
|
26
26
|
dispatch(onCloseCompleteTax());
|
|
27
27
|
};
|
|
28
|
-
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined
|
|
28
|
+
return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined }));
|
|
29
29
|
};
|
|
30
30
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -16,7 +16,7 @@ import { useForm, FormProvider } from 'react-hook-form';
|
|
|
16
16
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import Form from '../../../../components/Form';
|
|
19
|
-
import { useAppDispatch, useLanguage, useAppSelector, useSetFromDefaultValues, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified
|
|
19
|
+
import { useAppDispatch, useLanguage, useAppSelector, useSetFromDefaultValues, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
|
|
20
20
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
21
21
|
import { DocumentPurpose } from '../../../../@types';
|
|
22
22
|
import { deepCopy, getFileDetailsFromDocument, isSA } from '../../../../utils';
|
|
@@ -55,18 +55,13 @@ var TaxDetails = function () {
|
|
|
55
55
|
var noneEditable = useDataNoneEditable(data_status, ['tax_number', 'documents', 'is_vat_acknowledged']);
|
|
56
56
|
var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
|
|
57
57
|
var dataVerified = useDataVerified(data_verification, ['tax_number']);
|
|
58
|
-
var isDirty = useFormDirtyCheck(methods, {
|
|
59
|
-
vatId: entity === null || entity === void 0 ? void 0 : entity.vat_id,
|
|
60
|
-
confirmPolicy: entity === null || entity === void 0 ? void 0 : entity.is_vat_acknowledged
|
|
61
|
-
}).isDirty;
|
|
62
58
|
var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
|
|
63
59
|
var isVatIdVerified = dataVerified['tax_number'] && vat_id === methods.watch('vatId');
|
|
64
60
|
var t = useTranslation().t;
|
|
65
61
|
var isAr = useLanguage().isAr;
|
|
66
62
|
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
67
63
|
var onSubmit = function (data) {
|
|
68
|
-
|
|
69
|
-
dispatch(updateTaxInfo(formData));
|
|
64
|
+
dispatch(updateTaxInfo(deepCopy(getFelids(data))));
|
|
70
65
|
};
|
|
71
66
|
var onBack = function () {
|
|
72
67
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
|
|
@@ -46,9 +46,9 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
46
46
|
flexDirection: 'column'
|
|
47
47
|
}); });
|
|
48
48
|
var VerifyNumber = function (_a) {
|
|
49
|
-
var _b, _c;
|
|
49
|
+
var _b, _c, _d, _e;
|
|
50
50
|
var dispatch = useAppDispatch();
|
|
51
|
-
var
|
|
51
|
+
var _f = useAppSelector(taxSelector), data = _f.data, loading = _f.loading, error = _f.error;
|
|
52
52
|
var methods = useForm({
|
|
53
53
|
resolver: yupResolver(OTPValidation),
|
|
54
54
|
defaultValues: data.otpData,
|
|
@@ -57,8 +57,8 @@ var VerifyNumber = function (_a) {
|
|
|
57
57
|
useSetFromDefaultValues(methods, data.otpData);
|
|
58
58
|
var t = useTranslation().t;
|
|
59
59
|
var isAr = useLanguage().isAr;
|
|
60
|
-
var
|
|
61
|
-
var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.
|
|
60
|
+
var _g = React.useState(false), resendLoading = _g[0], setResendLoading = _g[1];
|
|
61
|
+
var phone = (_e = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.user) === null || _c === void 0 ? void 0 : _c.contact) === null || _d === void 0 ? void 0 : _d.phone) === null || _e === void 0 ? void 0 : _e.number;
|
|
62
62
|
React.useEffect(function () {
|
|
63
63
|
if (error && methods.formState.isValid && phone)
|
|
64
64
|
dispatch(clearError());
|
|
@@ -69,7 +69,7 @@ var VerifyNumber = function (_a) {
|
|
|
69
69
|
var onSubmit = function (formData) {
|
|
70
70
|
dispatch(verifyTaxLeadOTP(deepCopy(formData)));
|
|
71
71
|
};
|
|
72
|
-
var disabled = !methods.formState.isValid || !phone || resendLoading;
|
|
72
|
+
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
73
73
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
74
74
|
};
|
|
75
75
|
export default React.memo(VerifyNumber);
|
package/build/hooks/index.d.ts
CHANGED
package/build/hooks/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ScreenStepNavigation } from '../@types';
|
|
2
|
-
|
|
2
|
+
interface VerifyLeadTokenProps {
|
|
3
3
|
token: string;
|
|
4
4
|
isInternally?: boolean;
|
|
5
5
|
}
|
|
@@ -8,11 +8,8 @@ interface IVerifyToken {
|
|
|
8
8
|
internalToken?: string;
|
|
9
9
|
open: boolean;
|
|
10
10
|
settingLoading: boolean;
|
|
11
|
-
isValidOperator: boolean;
|
|
12
11
|
navigation: ScreenStepNavigation[];
|
|
13
12
|
loadingScreenName: string;
|
|
14
|
-
operatorErrorScreenName: string;
|
|
15
|
-
mode?: 'popup' | 'page' | 'content';
|
|
16
13
|
}
|
|
17
|
-
export declare const useVerifyToken: ({ verify, internalToken, navigation, open, settingLoading, loadingScreenName
|
|
14
|
+
export declare const useVerifyToken: ({ verify, internalToken, navigation, open, settingLoading, loadingScreenName }: IVerifyToken) => void;
|
|
18
15
|
export {};
|
|
@@ -3,7 +3,7 @@ import { getParameterByName } from '../utils';
|
|
|
3
3
|
import { useAppDispatch } from './useAppDispatch';
|
|
4
4
|
import { useEffect } from 'react';
|
|
5
5
|
export var useVerifyToken = function (_a) {
|
|
6
|
-
var verify = _a.verify, internalToken = _a.internalToken, navigation = _a.navigation, open = _a.open, settingLoading = _a.settingLoading, loadingScreenName = _a.loadingScreenName
|
|
6
|
+
var verify = _a.verify, internalToken = _a.internalToken, navigation = _a.navigation, open = _a.open, settingLoading = _a.settingLoading, loadingScreenName = _a.loadingScreenName;
|
|
7
7
|
var dispatch = useAppDispatch();
|
|
8
8
|
var verifyTokenFun = function () {
|
|
9
9
|
var token = internalToken ? internalToken : getParameterByName('token');
|
|
@@ -15,16 +15,11 @@ export var useVerifyToken = function (_a) {
|
|
|
15
15
|
dispatch(verify({ token: token, isInternally: !!internalToken }));
|
|
16
16
|
};
|
|
17
17
|
useEffect(function () {
|
|
18
|
-
if (settingLoading
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
dispatch(handleCurrentActiveScreen(operatorErrorScreenName));
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
verifyTokenFun();
|
|
25
|
-
}, [settingLoading, open, isValidOperator]);
|
|
18
|
+
if (!settingLoading && open)
|
|
19
|
+
verifyTokenFun();
|
|
20
|
+
}, [settingLoading, open]);
|
|
26
21
|
useEffect(function () {
|
|
27
|
-
if (internalToken && open
|
|
22
|
+
if (internalToken && open)
|
|
28
23
|
dispatch(handleCurrentActiveScreen(loadingScreenName));
|
|
29
24
|
}, [navigation]);
|
|
30
25
|
};
|
package/build/utils/common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { axiosInstance } from '../api';
|
|
2
|
-
import { ENDPOINT_PATHS,
|
|
2
|
+
import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_BETA_URL } from '../constants';
|
|
3
3
|
export var sleep = function (milliseconds) {
|
|
4
4
|
if (milliseconds === void 0) { milliseconds = 1000; }
|
|
5
5
|
return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
|
|
@@ -13,10 +13,10 @@ export var dangerousMessage = function (message, callBack) {
|
|
|
13
13
|
export var setBaseUrl = function (publicKey) {
|
|
14
14
|
var isProd = publicKey.includes('pk_live');
|
|
15
15
|
if (isProd) {
|
|
16
|
-
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.
|
|
16
|
+
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.BETA_BASE_URL;
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.
|
|
19
|
+
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
|
|
20
20
|
};
|
|
21
21
|
export var updateLocationUrlWithCountry = function (countryIso2) {
|
|
22
22
|
var country = countryIso2.toLowerCase();
|
|
@@ -35,7 +35,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
|
|
|
35
35
|
window.history.replaceState({}, '', newUrl);
|
|
36
36
|
};
|
|
37
37
|
export var openConnect = function (pk, countryCode) {
|
|
38
|
-
var newUrl = new URL(pk.includes('pk_live') ?
|
|
38
|
+
var newUrl = new URL(pk.includes('pk_live') ? CONNECT_BETA_URL : CONNECT_SANDBOX_URL);
|
|
39
39
|
if (countryCode) {
|
|
40
40
|
newUrl.pathname = "/".concat(countryCode.toLowerCase());
|
|
41
41
|
}
|
package/build/utils/locale.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { initReactI18next } from 'react-i18next';
|
|
2
2
|
import i18n from '../i18n';
|
|
3
3
|
export var updateLocale = function (locale, country) {
|
|
4
|
-
var
|
|
5
|
-
var data = (_a = locale[country.toUpperCase()]) !== null && _a !== void 0 ? _a : (locale['SA'] || locale['default']);
|
|
4
|
+
var data = locale['SA'] || locale[country.toUpperCase()] || locale['default'];
|
|
6
5
|
if (i18n.isInitialized) {
|
|
7
6
|
i18n.removeResourceBundle('*', 'translation');
|
|
8
7
|
i18n.addResourceBundle('en', 'translation', data.en.translation);
|
package/build/utils/string.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const convertNumbers2English: (str: string) => string;
|
|
|
15
15
|
export declare const getParameterByName: (name: string) => string | null;
|
|
16
16
|
export declare const getClientEmailUrl: () => string;
|
|
17
17
|
export declare const getFlowUrl: (path: string, lang: string) => string;
|
|
18
|
-
export declare const getResetFlowUrl: (path: string, lang: string, operationType: string, id: string, infoId: string
|
|
18
|
+
export declare const getResetFlowUrl: (path: string, lang: string, operationType: string, id: string, infoId: string) => string;
|
|
19
19
|
export declare const capitalizeTheFirstLetterOfEachWord: (words: string) => string;
|
|
20
20
|
export declare const getRequestHeaders: (deviceInfo: DeviceInfo) => {
|
|
21
21
|
al: any;
|
|
@@ -41,13 +41,11 @@ export declare const getRequestHeaders: (deviceInfo: DeviceInfo) => {
|
|
|
41
41
|
l: any;
|
|
42
42
|
};
|
|
43
43
|
export declare const removeRequestHeaders: () => void;
|
|
44
|
-
export declare const
|
|
45
|
-
export declare const getScreenNameBasedOnFlow: (flow: string, isAuthorizedUser?: boolean, isOtherThanSAOrKWCountry?: boolean) => "CONNECT_NID_STEP" | "" | "BUSINESS_BUSINESS_TYPE_STEP" | "INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP" | "INDIVIDUAL_LIST_STEP" | "PASSWORD_CREATE_PASSWORD_STEP" | "BANK_BANK_DETAILS_STEP" | "TAX_TAX_DETAILS_STEP" | "ENTITY_NAME_STEP" | "BRAND_INFO_STEP";
|
|
44
|
+
export declare const getScreenNameBasedOnFlow: (flow: string, isAuthorizedUser?: boolean) => "CONNECT_NID_STEP" | "" | "BUSINESS_BUSINESS_TYPE_STEP" | "INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP" | "INDIVIDUAL_LIST_STEP" | "BANK_BANK_DETAILS_STEP" | "TAX_TAX_DETAILS_STEP" | "ENTITY_NAME_STEP" | "BRAND_INFO_STEP";
|
|
46
45
|
export declare const getEighteenYearsAgo: () => string;
|
|
47
46
|
export declare const isKW: (flag: string) => boolean;
|
|
48
47
|
export declare const isSA: (flag: string) => boolean;
|
|
49
48
|
export declare const isOtherThanKWOrSA: (flag: string) => boolean;
|
|
50
|
-
export declare const isKWOrSA: (flag: string) => boolean;
|
|
51
49
|
export declare const isLinkedIn: (flag: string) => boolean;
|
|
52
50
|
export declare const isTwitter: (flag: string) => boolean;
|
|
53
51
|
export declare const isWebsite: (flag: string) => boolean;
|
|
@@ -74,4 +72,3 @@ export declare const getFileType: (type: string) => "" | "image/jpeg" | "image/p
|
|
|
74
72
|
export declare const isStringHasOneAsterisk: (value: string) => boolean;
|
|
75
73
|
export declare const isOtherLicense: (item?: License) => boolean;
|
|
76
74
|
export declare const formatNumberAsCurrency: (number: string) => string;
|
|
77
|
-
export declare const getCurrencyByCountryIso2: (countryCode: string) => string;
|
package/build/utils/string.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FlowsTypes } from '../@types';
|
|
2
2
|
import { concatenateObjectValues, encryptString } from '.';
|
|
3
3
|
import { removeAxiosGlobalHeaders } from '../api';
|
|
4
|
-
import {
|
|
4
|
+
import { ICONS_FULL_PATH } from '../constants';
|
|
5
5
|
import moment from 'moment';
|
|
6
6
|
export var maskPhone = function (str) {
|
|
7
7
|
if (str === void 0) { str = ''; }
|
|
@@ -94,12 +94,9 @@ export var getFlowUrl = function (path, lang) {
|
|
|
94
94
|
var origin = window.location.origin;
|
|
95
95
|
return origin + path + "?lang=".concat(lang, "&token=");
|
|
96
96
|
};
|
|
97
|
-
export var getResetFlowUrl = function (path, lang, operationType, id, infoId
|
|
97
|
+
export var getResetFlowUrl = function (path, lang, operationType, id, infoId) {
|
|
98
98
|
var origin = window.location.origin;
|
|
99
|
-
|
|
100
|
-
if (userId && userType)
|
|
101
|
-
baseUrl = baseUrl + "&user_id=".concat(userId, "&user_type=").concat(userType);
|
|
102
|
-
return baseUrl + "&token=";
|
|
99
|
+
return origin + path + "?lang=".concat(lang, "&operation_type=").concat(operationType, "&board_id=").concat(id, "&board_info_id=").concat(infoId, "&token=");
|
|
103
100
|
};
|
|
104
101
|
export var capitalizeTheFirstLetterOfEachWord = function (words) {
|
|
105
102
|
var separateWord = words.toLowerCase().split(' ');
|
|
@@ -162,20 +159,7 @@ export var removeRequestHeaders = function () {
|
|
|
162
159
|
'authorization'
|
|
163
160
|
]);
|
|
164
161
|
};
|
|
165
|
-
export var
|
|
166
|
-
var origin = window.location.origin;
|
|
167
|
-
if (origin.includes('localhost')) {
|
|
168
|
-
return ENDPOINT_PATHS.DEV_BASE_URL;
|
|
169
|
-
}
|
|
170
|
-
if (origin.includes('dev')) {
|
|
171
|
-
return ENDPOINT_PATHS.DEV_BASE_URL;
|
|
172
|
-
}
|
|
173
|
-
if (origin.includes('sandbox')) {
|
|
174
|
-
return ENDPOINT_PATHS.SANDBOX_BASE_URL;
|
|
175
|
-
}
|
|
176
|
-
return ENDPOINT_PATHS.PRODUCTION_BASE_URL;
|
|
177
|
-
};
|
|
178
|
-
export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser, isOtherThanSAOrKWCountry) {
|
|
162
|
+
export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser) {
|
|
179
163
|
if (flow === FlowsTypes.BANK) {
|
|
180
164
|
return 'BANK_BANK_DETAILS_STEP';
|
|
181
165
|
}
|
|
@@ -183,7 +167,7 @@ export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser, isOtherT
|
|
|
183
167
|
return 'BUSINESS_BUSINESS_TYPE_STEP';
|
|
184
168
|
}
|
|
185
169
|
if (flow === FlowsTypes.INDIVIDUAL) {
|
|
186
|
-
return isAuthorizedUser
|
|
170
|
+
return isAuthorizedUser ? 'INDIVIDUAL_LIST_STEP' : 'INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP';
|
|
187
171
|
}
|
|
188
172
|
if (flow === FlowsTypes.CONNECT) {
|
|
189
173
|
return 'CONNECT_NID_STEP';
|
|
@@ -197,9 +181,6 @@ export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser, isOtherT
|
|
|
197
181
|
if (flow === FlowsTypes.ENTITY) {
|
|
198
182
|
return 'ENTITY_NAME_STEP';
|
|
199
183
|
}
|
|
200
|
-
if (flow === FlowsTypes.PASSWORD) {
|
|
201
|
-
return 'PASSWORD_CREATE_PASSWORD_STEP';
|
|
202
|
-
}
|
|
203
184
|
return '';
|
|
204
185
|
};
|
|
205
186
|
export var getEighteenYearsAgo = function () {
|
|
@@ -215,9 +196,6 @@ export var isSA = function (flag) {
|
|
|
215
196
|
export var isOtherThanKWOrSA = function (flag) {
|
|
216
197
|
return !isKW(flag) && !isSA(flag);
|
|
217
198
|
};
|
|
218
|
-
export var isKWOrSA = function (flag) {
|
|
219
|
-
return isKW(flag) || isSA(flag);
|
|
220
|
-
};
|
|
221
199
|
export var isLinkedIn = function (flag) {
|
|
222
200
|
return 'linkedin' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
223
201
|
};
|
|
@@ -325,10 +303,3 @@ export var formatNumberAsCurrency = function (number) {
|
|
|
325
303
|
return '';
|
|
326
304
|
return parseInt(number).toLocaleString();
|
|
327
305
|
};
|
|
328
|
-
export var getCurrencyByCountryIso2 = function (countryCode) {
|
|
329
|
-
var _a;
|
|
330
|
-
if (!countryCode)
|
|
331
|
-
return '';
|
|
332
|
-
var currencyCode = (_a = COUNTRY_TO_CURRENCY[countryCode]) !== null && _a !== void 0 ? _a : '';
|
|
333
|
-
return currencyCode;
|
|
334
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.45-beta",
|
|
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
|
|
24
|
+
"push": "npm publish --access public --tag beta"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [],
|
|
27
27
|
"author": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import GenericError from '../../../shared/GenericError';
|
|
5
|
-
var OperatorError = function (_a) {
|
|
6
|
-
var t = useTranslation().t;
|
|
7
|
-
return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
|
|
8
|
-
};
|
|
9
|
-
export default React.memo(OperatorError);
|