@tap-payments/auth-jsconnect 2.0.22 → 2.0.23
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 +5 -0
- package/build/@types/app.js +6 -0
- package/build/api/auth.d.ts +1 -0
- package/build/api/index.d.ts +4 -2
- package/build/api/individual.d.ts +21 -0
- package/build/api/individual.js +28 -1
- package/build/app/rootReducer.d.ts +0 -1
- package/build/app/rootReducer.js +0 -2
- package/build/app/store.d.ts +0 -2
- package/build/assets/locales/ar.json +10 -1
- package/build/assets/locales/en.json +10 -1
- package/build/constants/app.d.ts +0 -5
- package/build/constants/app.js +0 -12
- package/build/constants/validation.d.ts +4 -0
- package/build/constants/validation.js +4 -0
- package/build/features/app/auth/authStore.d.ts +1 -0
- package/build/features/app/auth/authStore.js +5 -3
- package/build/features/app/bank/bankStore.d.ts +8 -0
- package/build/features/app/bank/bankStore.js +32 -15
- package/build/features/app/business/businessStore.js +1 -1
- package/build/features/app/connect/connectStore.d.ts +4 -2
- package/build/features/app/connect/connectStore.js +98 -97
- package/build/features/app/individual/individualStore.d.ts +17 -0
- package/build/features/app/individual/individualStore.js +141 -66
- package/build/features/app/tax/taxStore.js +1 -0
- package/build/features/auth/Auth.d.ts +1 -1
- package/build/features/auth/Auth.js +4 -3
- package/build/features/bank/Bank.js +2 -2
- package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -5
- package/build/features/business/Business.js +2 -2
- package/build/features/business/screens/BusinessType/BusinessType.js +13 -6
- package/build/features/business/screens/BusinessType/EntityName.js +4 -4
- package/build/features/business/screens/Customers/CustomerLocations.js +1 -1
- package/build/features/business/screens/Customers/ExpectedCustomers.js +1 -1
- package/build/features/connect/Connect.js +2 -2
- package/build/features/connect/screens/Individual/Individual.js +19 -16
- package/build/features/connect/screens/Merchant/Merchant.js +3 -2
- package/build/features/connect/screens/Merchant/SocialMedia.js +4 -2
- package/build/features/connect/screens/Merchant/validation.js +71 -59
- package/build/features/connect/screens/OTP/OTP.js +5 -4
- package/build/features/connect/screens/OTP/OTPInput.js +3 -2
- package/build/features/entity/Entity.js +5 -5
- package/build/features/featuresScreens.d.ts +0 -1
- package/build/features/featuresScreens.js +0 -7
- package/build/features/individual/Individual.js +2 -2
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/individual/screens/Verify/Verify.js +4 -4
- package/build/features/password/Password.js +2 -2
- package/build/features/signIn/SignIn.js +3 -3
- package/build/features/tax/Tax.js +5 -5
- package/build/hooks/useAppDispatch.d.ts +0 -1
- package/build/index.d.ts +2 -3
- package/build/index.js +1 -4
- package/build/utils/object.d.ts +1 -0
- package/build/utils/object.js +12 -0
- package/package.json +1 -1
- package/build/features/app/otp/otpStore.d.ts +0 -28
- package/build/features/app/otp/otpStore.js +0 -153
- package/build/features/otp/OTP.d.ts +0 -7
- package/build/features/otp/OTP.js +0 -58
- package/build/features/otp/index.d.ts +0 -0
- package/build/features/otp/index.js +0 -1
- package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
- package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
- package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
- package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
- package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
- package/build/features/otp/screens/OTPVerify/index.js +0 -2
- package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
- package/build/features/otp/screens/OTPVerify/validation.js +0 -4
|
@@ -27,6 +27,7 @@ import { clearError, connectSelector, resetIndividualScreen, updateLeadIndividua
|
|
|
27
27
|
import { useLanguage } from '../../../../hooks';
|
|
28
28
|
import MobileNumber from './MobileNumber';
|
|
29
29
|
import { countriesCode } from '../../../../constants';
|
|
30
|
+
import { AuthForType } from '../../../../@types';
|
|
30
31
|
import Collapse from '../../../../components/Collapse';
|
|
31
32
|
import { isKW } from '../../../../utils';
|
|
32
33
|
var FormStyled = styled(Form)(function () { return ({
|
|
@@ -34,17 +35,18 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
34
35
|
flexDirection: 'column'
|
|
35
36
|
}); });
|
|
36
37
|
var Individual = function (_a) {
|
|
37
|
-
var _b
|
|
38
|
-
var
|
|
39
|
-
var _j = React.useState(false), emailChecking = _j[0], setEmailChecking = _j[1];
|
|
38
|
+
var _b = React.useState(false), listActive = _b[0], setListActive = _b[1];
|
|
39
|
+
var _c = React.useState(false), emailChecking = _c[0], setEmailChecking = _c[1];
|
|
40
40
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
41
|
-
var
|
|
41
|
+
var _d = useAppSelector(connectSelector), data = _d.data, loading = _d.loading, error = _d.error;
|
|
42
42
|
var dispatch = useAppDispatch();
|
|
43
43
|
var t = useTranslation().t;
|
|
44
44
|
var isAr = useLanguage().isAr;
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
45
|
+
var individualData = data.individualData, otpData = data.otpData, mobileData = data.mobileData;
|
|
46
|
+
var startWithNID = otpData.authFor === AuthForType.NATIONAL_ID;
|
|
47
|
+
var isMobile = mobileData.mobile;
|
|
48
|
+
var _e = otpData.responseBody || {}, contact = _e.contact, name = _e.name, userInfoMissed = _e.userInfoMissed, is_new_individual = _e.is_new_individual;
|
|
49
|
+
var is_available = (individualData.responseBody || {}).is_available;
|
|
48
50
|
var methods = useForm({
|
|
49
51
|
resolver: yupResolver(isMobile ? IndividualValidation : IndividualMobileValidation),
|
|
50
52
|
defaultValues: data.individualData,
|
|
@@ -57,7 +59,7 @@ var Individual = function (_a) {
|
|
|
57
59
|
var _a;
|
|
58
60
|
dispatch(resetIndividualScreen());
|
|
59
61
|
var code = (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2;
|
|
60
|
-
var screen = isKW(code) ? 'CONNECT_CIVIL_ID_STEP' :
|
|
62
|
+
var screen = isKW(code) ? 'CONNECT_CIVIL_ID_STEP' : startWithNID ? 'CONNECT_NID_STEP' : 'CONNECT_MOBILE_STEP';
|
|
61
63
|
dispatch(handlePrevScreenStep(screen));
|
|
62
64
|
};
|
|
63
65
|
React.useEffect(function () {
|
|
@@ -79,16 +81,17 @@ var Individual = function (_a) {
|
|
|
79
81
|
listActive ? setListActive(false) : setListActive(true);
|
|
80
82
|
};
|
|
81
83
|
React.useEffect(function () {
|
|
82
|
-
var _a
|
|
83
|
-
if (((
|
|
84
|
+
var _a;
|
|
85
|
+
if (((_a = individualData === null || individualData === void 0 ? void 0 : individualData.responseBody) === null || _a === void 0 ? void 0 : _a.is_available) === false)
|
|
84
86
|
methods.setError('email', { message: 'tap_js_email_already_exist' });
|
|
85
|
-
}, [
|
|
86
|
-
var isLeadEmailAvailable = (
|
|
87
|
-
var isEmailValid =
|
|
88
|
-
? isLeadEmailAvailable
|
|
89
|
-
: (_g = data.individualData.responseBody) === null || _g === void 0 ? void 0 : _g.is_available;
|
|
87
|
+
}, [individualData === null || individualData === void 0 ? void 0 : individualData.responseBody]);
|
|
88
|
+
var isLeadEmailAvailable = (contact === null || contact === void 0 ? void 0 : contact.email) === methods.watch('email');
|
|
89
|
+
var isEmailValid = typeof is_available === 'undefined' ? isLeadEmailAvailable : is_available;
|
|
90
90
|
var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email || !!error;
|
|
91
91
|
var disabled = emailErrChecks || emailChecking || !isEmailValid;
|
|
92
|
-
|
|
92
|
+
var isNameRequired = (userInfoMissed && !name) || is_new_individual;
|
|
93
|
+
var isEmailRequired = (userInfoMissed && !(contact === null || contact === void 0 ? void 0 : contact.email)) || is_new_individual;
|
|
94
|
+
var isMobileRequired = (userInfoMissed && !(contact === null || contact === void 0 ? void 0 : contact.phone)) || is_new_individual;
|
|
95
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Name, { show: !listActive && isNameRequired }), _jsx(MobileNumber, { show: !isMobile && isMobileRequired, onListOpen: function () { return handleMenuListClick(); }, onListClose: function () { return handleMenuListClick(); }, countries: countriesCode }), _jsx(Email, { show: !listActive && isEmailRequired, fetchingEmail: function (v) { return setEmailChecking(v); }, emailChecking: emailChecking }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
93
96
|
};
|
|
94
97
|
export default React.memo(Individual);
|
|
@@ -22,6 +22,7 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
22
22
|
import Button from '../../../shared/Button';
|
|
23
23
|
import { clearError, connectSelector, updateLeadBrand } from '../../../app/connect/connectStore';
|
|
24
24
|
import { useLanguage } from '../../../../hooks';
|
|
25
|
+
import { AuthForType } from '../../../../@types';
|
|
25
26
|
import { isKW } from '../../../../utils';
|
|
26
27
|
import { MerchantValidationSchema } from './validation';
|
|
27
28
|
import BrandName from './BrandName';
|
|
@@ -37,7 +38,7 @@ var Merchant = function (_a) {
|
|
|
37
38
|
var _g = useAppSelector(connectSelector), data = _g.data, loading = _g.loading, error = _g.error;
|
|
38
39
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
39
40
|
var isNewIndividual = (_b = data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.is_new_individual;
|
|
40
|
-
var
|
|
41
|
+
var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
41
42
|
var _h = data.brandData, brandName = _h.brandName, selectedBrandItem = _h.selectedBrandItem, termAndConditionChecked = _h.termAndConditionChecked, responseBody = _h.responseBody, salesChannels = _h.salesChannels;
|
|
42
43
|
var brandList = (responseBody || {}).brand_list;
|
|
43
44
|
var methods = useForm({
|
|
@@ -64,7 +65,7 @@ var Merchant = function (_a) {
|
|
|
64
65
|
return;
|
|
65
66
|
}
|
|
66
67
|
var code = (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2;
|
|
67
|
-
var screen = isKW(code) ? 'CONNECT_CIVIL_ID_STEP' :
|
|
68
|
+
var screen = isKW(code) ? 'CONNECT_CIVIL_ID_STEP' : startWithNID ? 'CONNECT_NID_STEP' : 'CONNECT_MOBILE_STEP';
|
|
68
69
|
dispatch(handlePrevScreenStep(screen));
|
|
69
70
|
};
|
|
70
71
|
React.useEffect(function () {
|
|
@@ -151,7 +151,9 @@ var SocialMedia = function (_a) {
|
|
|
151
151
|
return ((_b = item.name) === null || _b === void 0 ? void 0 : _b.en) || '';
|
|
152
152
|
};
|
|
153
153
|
var hasError = React.useMemo(function () {
|
|
154
|
-
|
|
154
|
+
var _a;
|
|
155
|
+
var error = salesChannelsState.error;
|
|
156
|
+
return (error === null || error === void 0 ? void 0 : error.message) && 'choose_atleast_one_channel' !== ((_a = salesChannelsState.error) === null || _a === void 0 ? void 0 : _a.message);
|
|
155
157
|
}, [salesChannelsState]);
|
|
156
158
|
var linksErrorMsg = (_b = salesChannelsState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
157
159
|
return (_jsx(Box, { children: _jsx(Collapse, __assign({ in: show && selectedChannels.length > 0 }, { children: _jsxs(Box, __assign({ sx: { mb: 3, direction: 'ltr' } }, { children: [_jsx(SocialMediaGroupStyled, __assign({ exclusive: true, onChange: function (e, value) {
|
|
@@ -174,6 +176,6 @@ var SocialMedia = function (_a) {
|
|
|
174
176
|
})) : (_jsx(Collapse, __assign({ in: isActive, timeout: 300 }, { children: _jsx(InputStyled, { onChange: function (e) {
|
|
175
177
|
onChangeInput(e.target.value, channel.id);
|
|
176
178
|
}, value: channel.address || '', startAdornment: _jsx(TextStyled, {}), placeholder: t(getPlaceHolder(channel)) }) }), index));
|
|
177
|
-
}), _jsx(Collapse, __assign({ in: hasError }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(linksErrorMsg) })) }))] })) })) }));
|
|
179
|
+
}), _jsx(Collapse, __assign({ in: !!hasError }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(linksErrorMsg) })) }))] })) })) }));
|
|
178
180
|
};
|
|
179
181
|
export default React.memo(SocialMedia);
|
|
@@ -7,8 +7,70 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
7
7
|
}
|
|
8
8
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
9
|
};
|
|
10
|
-
import { REGEX_WEBSITE, REGEX_BRAND_NAME } from '../../../../constants';
|
|
10
|
+
import { REGEX_WEBSITE, REGEX_BRAND_NAME, LINKEDIN_URL, SOCIAL_USERNAME, DIGITS_ONLY, REGEX_PHONE_APP_NAME } from '../../../../constants';
|
|
11
11
|
import * as yup from 'yup';
|
|
12
|
+
var validationSalesChannels = function (channels) {
|
|
13
|
+
if (channels === void 0) { channels = []; }
|
|
14
|
+
var dic = {};
|
|
15
|
+
var typeDic = {};
|
|
16
|
+
channels.forEach(function (channel) {
|
|
17
|
+
var _a, _b, _c;
|
|
18
|
+
if ((_a = channel.sub) === null || _a === void 0 ? void 0 : _a.length) {
|
|
19
|
+
var key_1 = (_b = channel.code) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
20
|
+
if (key_1)
|
|
21
|
+
dic[key_1] = [];
|
|
22
|
+
channel.sub.forEach(function (sub) {
|
|
23
|
+
dic[key_1].push(sub.address || '');
|
|
24
|
+
typeDic[sub.code] = sub.address || '';
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
var key = (_c = channel.code) === null || _c === void 0 ? void 0 : _c.toLowerCase();
|
|
29
|
+
if (key)
|
|
30
|
+
dic[key] = [channel.address || ''];
|
|
31
|
+
typeDic[key] = channel.address || '';
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
for (var key in dic) {
|
|
35
|
+
var values = dic[key];
|
|
36
|
+
var atLestOne = values.every(function (item) { return item === ''; });
|
|
37
|
+
if (atLestOne)
|
|
38
|
+
return "enter_at_least_one_".concat(key);
|
|
39
|
+
}
|
|
40
|
+
console.log('dic', dic);
|
|
41
|
+
console.log('typeDic', typeDic);
|
|
42
|
+
for (var key in typeDic) {
|
|
43
|
+
var value = typeDic[key];
|
|
44
|
+
if (key === 'website' && value && !value.match(REGEX_WEBSITE)) {
|
|
45
|
+
return 'invalid_url';
|
|
46
|
+
}
|
|
47
|
+
if (key === 'linkedin' && value && !value.match(LINKEDIN_URL)) {
|
|
48
|
+
return 'invalid_linkedin_profile_url';
|
|
49
|
+
}
|
|
50
|
+
if (key === 'facebook' && value && !value.match(SOCIAL_USERNAME)) {
|
|
51
|
+
return 'invalid_facebook_username';
|
|
52
|
+
}
|
|
53
|
+
if (key === 'instagram' && value && !value.match(SOCIAL_USERNAME)) {
|
|
54
|
+
return 'invalid_instagram_username';
|
|
55
|
+
}
|
|
56
|
+
if (key === 'twitter' && value && !value.match(SOCIAL_USERNAME)) {
|
|
57
|
+
return 'invalid_twitter_username';
|
|
58
|
+
}
|
|
59
|
+
if (key === 'physical_store' && value && value.length < 3) {
|
|
60
|
+
return 'invalid_physical_store_location';
|
|
61
|
+
}
|
|
62
|
+
if (key === 'ios' && value && !value.match(REGEX_PHONE_APP_NAME)) {
|
|
63
|
+
return 'invalid_ios_app';
|
|
64
|
+
}
|
|
65
|
+
if (key === 'android' && value && !value.match(REGEX_PHONE_APP_NAME)) {
|
|
66
|
+
return 'invalid_android_app';
|
|
67
|
+
}
|
|
68
|
+
if (key === 'call_center' && value && !value.match(DIGITS_ONLY)) {
|
|
69
|
+
return 'invalid_call_center_number';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
};
|
|
12
74
|
export var MerchantValidationSchema = function (isNewBrand) {
|
|
13
75
|
if (isNewBrand === void 0) { isNewBrand = true; }
|
|
14
76
|
if (isNewBrand)
|
|
@@ -38,35 +100,10 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
38
100
|
if (length === 0)
|
|
39
101
|
return true;
|
|
40
102
|
var channels = __spreadArray([], (value || []), true);
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var key_1 = (_b = channel.code) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
46
|
-
if (key_1)
|
|
47
|
-
dic[key_1] = [];
|
|
48
|
-
channel.sub.forEach(function (sub) {
|
|
49
|
-
dic[key_1].push(sub.address || '');
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
var key = (_c = channel.code) === null || _c === void 0 ? void 0 : _c.toLowerCase();
|
|
54
|
-
if (key)
|
|
55
|
-
dic[key] = [channel.address || ''];
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
for (var key in dic) {
|
|
59
|
-
var values = dic[key];
|
|
60
|
-
var atLestOne = values.every(function (item) { return item === ''; });
|
|
61
|
-
if (atLestOne)
|
|
62
|
-
return this.createError({ message: "enter_at_least_one_".concat(key) });
|
|
63
|
-
if (key === 'website') {
|
|
64
|
-
var isWebsite = values.every(function (item) { return item === '' || item.match(REGEX_WEBSITE); });
|
|
65
|
-
if (!isWebsite)
|
|
66
|
-
return this.createError({ message: 'invalid_url' });
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return true;
|
|
103
|
+
var result = validationSalesChannels(channels);
|
|
104
|
+
if (result === true)
|
|
105
|
+
return true;
|
|
106
|
+
return this.createError({ message: result });
|
|
70
107
|
}
|
|
71
108
|
})
|
|
72
109
|
.required('choose_atleast_one_channel')
|
|
@@ -84,35 +121,10 @@ export var MerchantValidationSchema = function (isNewBrand) {
|
|
|
84
121
|
if (length === 0)
|
|
85
122
|
return true;
|
|
86
123
|
var channels = __spreadArray([], (value || []), true);
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var key_2 = (_b = channel.code) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
92
|
-
if (key_2)
|
|
93
|
-
dic[key_2] = [];
|
|
94
|
-
channel.sub.forEach(function (sub) {
|
|
95
|
-
dic[key_2].push(sub.address || '');
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
var key = (_c = channel.code) === null || _c === void 0 ? void 0 : _c.toLowerCase();
|
|
100
|
-
if (key)
|
|
101
|
-
dic[key] = [channel.address || ''];
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
for (var key in dic) {
|
|
105
|
-
var values = dic[key];
|
|
106
|
-
var atLestOne = values.every(function (item) { return item === ''; });
|
|
107
|
-
if (atLestOne)
|
|
108
|
-
return this.createError({ message: "enter_at_least_one_".concat(key) });
|
|
109
|
-
if (key === 'website') {
|
|
110
|
-
var isWebsite = values.every(function (item) { return item === '' || item.match(REGEX_WEBSITE); });
|
|
111
|
-
if (!isWebsite)
|
|
112
|
-
return this.createError({ message: 'invalid_url' });
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return true;
|
|
124
|
+
var result = validationSalesChannels(channels);
|
|
125
|
+
if (result === true)
|
|
126
|
+
return true;
|
|
127
|
+
return this.createError({ message: result });
|
|
116
128
|
}
|
|
117
129
|
})
|
|
118
130
|
.required('choose_atleast_one_channel')
|
|
@@ -21,6 +21,7 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
21
21
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
22
22
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
23
23
|
import { useLanguage } from '../../../../hooks';
|
|
24
|
+
import { AuthForType } from '../../../../@types';
|
|
24
25
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
25
26
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
26
27
|
import Form from '../../../../components/Form';
|
|
@@ -57,7 +58,7 @@ var OTP = function () {
|
|
|
57
58
|
});
|
|
58
59
|
var t = useTranslation().t;
|
|
59
60
|
var isAr = useLanguage().isAr;
|
|
60
|
-
var
|
|
61
|
+
var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
61
62
|
React.useEffect(function () {
|
|
62
63
|
if (error)
|
|
63
64
|
dispatch(clearError());
|
|
@@ -69,12 +70,12 @@ var OTP = function () {
|
|
|
69
70
|
dispatch(verifyAuth(formData));
|
|
70
71
|
};
|
|
71
72
|
var onBack = function () {
|
|
72
|
-
dispatch(handlePrevScreenStep(
|
|
73
|
+
dispatch(handlePrevScreenStep(startWithNID ? 'CONNECT_NID_STEP' : 'CONNECT_MOBILE_STEP'));
|
|
73
74
|
};
|
|
74
75
|
var disabled = !methods.formState.isValid || !!error;
|
|
75
76
|
var phone = ((_a = data.mobileData.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix) + (data.mobileData.mobile || '');
|
|
76
77
|
var idNumber = data.nidData.nid;
|
|
77
|
-
var title =
|
|
78
|
-
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') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children:
|
|
78
|
+
var title = startWithNID ? t('opt_nid_sent_title', { provider: 'ABSHER' }) : t('ide_opt_sent_title');
|
|
79
|
+
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') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: startWithNID ? maskID(idNumber) : maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
79
80
|
};
|
|
80
81
|
export default React.memo(OTP);
|
|
@@ -17,6 +17,7 @@ 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 { AuthForType } from '../../../../@types';
|
|
20
21
|
import { connectSelector, resendOTPMobile, resendOTPNID } from '../../../app/connect/connectStore';
|
|
21
22
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
22
23
|
var BoxStyled = styled(Box)(function (_a) {
|
|
@@ -33,7 +34,7 @@ var OTPInput = function (_a) {
|
|
|
33
34
|
var dispatch = useAppDispatch();
|
|
34
35
|
var otpControl = useController({ name: 'otp', control: control });
|
|
35
36
|
var data = useAppSelector(connectSelector).data;
|
|
36
|
-
var
|
|
37
|
+
var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
37
38
|
var handleOnOTPChange = function (otp) {
|
|
38
39
|
otpControl.field.onChange(otp);
|
|
39
40
|
};
|
|
@@ -48,6 +49,6 @@ var OTPInput = function (_a) {
|
|
|
48
49
|
dispatch(resendOTPNID());
|
|
49
50
|
};
|
|
50
51
|
var otpValue = otpControl.field.value;
|
|
51
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick:
|
|
52
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: startWithNID ? handleOnResendAbsherOTP : handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
52
53
|
};
|
|
53
54
|
export default React.memo(OTPInput);
|
|
@@ -27,8 +27,8 @@ import Background from '../shared/Background';
|
|
|
27
27
|
var Entity = memo(function (props) {
|
|
28
28
|
var theme = useAppTheme().theme;
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
|
-
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error,
|
|
31
|
-
var _b = useAppSelector(entitySelector), customLoading = _b.customLoading, entityError = _b.error;
|
|
30
|
+
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
31
|
+
var _b = useAppSelector(entitySelector), customLoading = _b.customLoading, entityError = _b.error, loading = _b.loading;
|
|
32
32
|
useAppConfig(__assign({ navigation: ENTITY_SCREENS_NAVIGATION }, props));
|
|
33
33
|
useErrorListener(entityError || error);
|
|
34
34
|
useStepStartedListener();
|
|
@@ -43,10 +43,10 @@ var Entity = memo(function (props) {
|
|
|
43
43
|
dispatch(verifyLeadToken(token));
|
|
44
44
|
};
|
|
45
45
|
useEffect(function () {
|
|
46
|
-
if (!
|
|
46
|
+
if (!settingLoading)
|
|
47
47
|
verifyToken();
|
|
48
|
-
}, [
|
|
49
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading:
|
|
48
|
+
}, [settingLoading]);
|
|
49
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: settingLoading || customLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: entityFeatureScreens.map(function (_a, index) {
|
|
50
50
|
var Element = _a.element, name = _a.name;
|
|
51
51
|
var isActive = activeScreen.name === name;
|
|
52
52
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -7,5 +7,4 @@ export declare const bankFeatureScreens: Array<FeatureScreenStep>;
|
|
|
7
7
|
export declare const taxFeatureScreens: Array<FeatureScreenStep>;
|
|
8
8
|
export declare const signInFeatureScreens: Array<FeatureScreenStep>;
|
|
9
9
|
export declare const entityFeatureScreens: Array<FeatureScreenStep>;
|
|
10
|
-
export declare const otpFeatureScreens: Array<FeatureScreenStep>;
|
|
11
10
|
export declare const authFeatureScreens: Array<FeatureScreenStep>;
|
|
@@ -47,7 +47,6 @@ import EntityInfoConfirmPage from './entity/screens/EntityInfoConfirm';
|
|
|
47
47
|
import EntitySuccessPage from './entity/screens/Success';
|
|
48
48
|
import EntitySuccessWithFlowPage from './entity/screens/SuccessWithFlowButtons';
|
|
49
49
|
import EntityResetPasswordSuccessPage from './entity/screens/ResetPasswordSuccess';
|
|
50
|
-
import OtpVerifyPage from '../features/otp/screens/OTPVerify';
|
|
51
50
|
import AuthNIDPage from './auth/screens/NID';
|
|
52
51
|
import AuthVerifyPage from './auth/screens/OTP';
|
|
53
52
|
export var connectFeatureScreens = [
|
|
@@ -238,12 +237,6 @@ export var entityFeatureScreens = [
|
|
|
238
237
|
},
|
|
239
238
|
{ name: 'ENTITY_RESET_PASSWORD_SUCCESS', element: EntityResetPasswordSuccessPage }
|
|
240
239
|
];
|
|
241
|
-
export var otpFeatureScreens = [
|
|
242
|
-
{
|
|
243
|
-
name: 'OTP_VERIFY_STEP',
|
|
244
|
-
element: OtpVerifyPage
|
|
245
|
-
}
|
|
246
|
-
];
|
|
247
240
|
export var authFeatureScreens = [
|
|
248
241
|
{
|
|
249
242
|
name: 'AUTH_NID_STEP',
|
|
@@ -28,7 +28,7 @@ var Individual = memo(function (props) {
|
|
|
28
28
|
var theme = useAppTheme().theme;
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
30
|
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
31
|
-
var _b = useAppSelector(individualSelector), customLoading = _b.customLoading, individualError = _b.error;
|
|
31
|
+
var _b = useAppSelector(individualSelector), customLoading = _b.customLoading, individualError = _b.error, loading = _b.loading;
|
|
32
32
|
useAppConfig(__assign({ navigation: INDIVIDUAL_SCREENS_NAVIGATION }, props));
|
|
33
33
|
useErrorListener(individualError || error);
|
|
34
34
|
useStepStartedListener();
|
|
@@ -46,7 +46,7 @@ var Individual = memo(function (props) {
|
|
|
46
46
|
if (!settingLoading && open)
|
|
47
47
|
verifyToken();
|
|
48
48
|
}, [settingLoading]);
|
|
49
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: individualFeatureScreens.map(function (_a, index) {
|
|
49
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: individualFeatureScreens.map(function (_a, index) {
|
|
50
50
|
var Element = _a.element, name = _a.name;
|
|
51
51
|
var isActive = activeScreen.name === name;
|
|
52
52
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -48,7 +48,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
48
48
|
var t = useTranslation().t;
|
|
49
49
|
var isAr = useLanguage().isAr;
|
|
50
50
|
var data = useAppSelector(individualSelector).data;
|
|
51
|
-
var _e = data.verify.responseBody || {}, flows = _e.flows, nameObj = _e.name, entity = _e.entity, brand = _e.brand, bank = _e.bank_account, merchant = _e.merchant,
|
|
51
|
+
var _e = data.verify.responseBody || {}, flows = _e.flows, nameObj = _e.name, entity = _e.entity, brand = _e.brand, bank = _e.bank_account, merchant = _e.merchant, user = _e.user;
|
|
52
52
|
var _f = useState([]), buttons = _f[0], setButtons = _f[1];
|
|
53
53
|
var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
|
|
54
54
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
@@ -58,7 +58,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
58
58
|
var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
|
|
59
59
|
var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
|
|
60
60
|
var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
|
|
61
|
-
var identification = user.identification;
|
|
61
|
+
var identification = (user || {}).identification;
|
|
62
62
|
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)) : '';
|
|
63
63
|
var settings = useAppSelector(settingsSelector);
|
|
64
64
|
var _g = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _g.contact, board_id = _g.board_id, board_info_id = _g.board_info_id;
|
|
@@ -47,9 +47,9 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
47
47
|
flexDirection: 'column'
|
|
48
48
|
}); });
|
|
49
49
|
var VerifyNumber = function (_a) {
|
|
50
|
-
var _b, _c
|
|
50
|
+
var _b, _c;
|
|
51
51
|
var dispatch = useAppDispatch();
|
|
52
|
-
var
|
|
52
|
+
var _d = useAppSelector(individualSelector), data = _d.data, loading = _d.loading, error = _d.error;
|
|
53
53
|
var methods = useForm({
|
|
54
54
|
resolver: yupResolver(OTPValidation),
|
|
55
55
|
defaultValues: data.otpData,
|
|
@@ -57,8 +57,8 @@ var VerifyNumber = function (_a) {
|
|
|
57
57
|
});
|
|
58
58
|
var t = useTranslation().t;
|
|
59
59
|
var isAr = useLanguage().isAr;
|
|
60
|
-
var
|
|
61
|
-
var phone = (
|
|
60
|
+
var _e = React.useState(false), resendLoading = _e[0], setResendLoading = _e[1];
|
|
61
|
+
var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to;
|
|
62
62
|
React.useEffect(function () {
|
|
63
63
|
if (error && methods.formState.isValid && phone)
|
|
64
64
|
dispatch(clearError());
|
|
@@ -28,7 +28,7 @@ var Password = memo(function (props) {
|
|
|
28
28
|
var theme = useAppTheme().theme;
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
30
|
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
31
|
-
var _b = useAppSelector(passwordSelector), customLoading = _b.customLoading, passwordError = _b.error;
|
|
31
|
+
var _b = useAppSelector(passwordSelector), customLoading = _b.customLoading, passwordError = _b.error, loading = _b.loading;
|
|
32
32
|
useAppConfig(__assign({ navigation: PASSWORD_SCREENS_NAVIGATION }, props));
|
|
33
33
|
useErrorListener(passwordError || error);
|
|
34
34
|
useStepStartedListener();
|
|
@@ -53,7 +53,7 @@ var Password = memo(function (props) {
|
|
|
53
53
|
if (!settingLoading && open)
|
|
54
54
|
verifyToken();
|
|
55
55
|
}, [settingLoading]);
|
|
56
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: passwordFeatureScreens.map(function (_a, index) {
|
|
56
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: passwordFeatureScreens.map(function (_a, index) {
|
|
57
57
|
var Element = _a.element, name = _a.name;
|
|
58
58
|
var isActive = activeScreen.name === name;
|
|
59
59
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -26,13 +26,13 @@ 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 _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error,
|
|
30
|
-
var
|
|
29
|
+
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
30
|
+
var _b = useAppSelector(signInSelector), signInError = _b.error, loading = _b.loading;
|
|
31
31
|
useAppConfig(__assign({ navigation: SigIn_SCREENS_NAVIGATION }, props));
|
|
32
32
|
useErrorListener(signInError || error);
|
|
33
33
|
useStepStartedListener();
|
|
34
34
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
35
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading:
|
|
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', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: signInFeatureScreens.map(function (_a, index) {
|
|
36
36
|
var Element = _a.element, name = _a.name;
|
|
37
37
|
var isActive = activeScreen.name === name;
|
|
38
38
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -27,8 +27,8 @@ import Background from '../shared/Background';
|
|
|
27
27
|
var Tax = memo(function (props) {
|
|
28
28
|
var theme = useAppTheme().theme;
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
|
-
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error,
|
|
31
|
-
var _b = useAppSelector(taxSelector), customLoading = _b.customLoading, taxError = _b.error;
|
|
30
|
+
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
31
|
+
var _b = useAppSelector(taxSelector), customLoading = _b.customLoading, taxError = _b.error, loading = _b.loading;
|
|
32
32
|
useAppConfig(__assign({ navigation: TAX_SCREENS_NAVIGATION }, props));
|
|
33
33
|
useErrorListener(taxError || error);
|
|
34
34
|
useStepStartedListener();
|
|
@@ -43,10 +43,10 @@ var Tax = memo(function (props) {
|
|
|
43
43
|
dispatch(verifyLeadToken(token));
|
|
44
44
|
};
|
|
45
45
|
useEffect(function () {
|
|
46
|
-
if (!
|
|
46
|
+
if (!settingLoading && open)
|
|
47
47
|
verifyToken();
|
|
48
|
-
}, [
|
|
49
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading:
|
|
48
|
+
}, [settingLoading]);
|
|
49
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: settingLoading || customLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: taxFeatureScreens.map(function (_a, index) {
|
|
50
50
|
var Element = _a.element, name = _a.name;
|
|
51
51
|
var isActive = activeScreen.name === name;
|
|
52
52
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -8,6 +8,5 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
|
|
|
8
8
|
password: import("../features/app/password/passwordStore").PasswordState;
|
|
9
9
|
signIn: import("../features/app/signIn/signInStore").SignInState;
|
|
10
10
|
entity: import("../features/app/entity/entityStore").EntityState;
|
|
11
|
-
otp: import("../features/app/otp/otpStore").OtpState;
|
|
12
11
|
auth: import("../features/app/auth/authStore").AuthState;
|
|
13
12
|
}, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").AnyAction>;
|
package/build/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ import { BankLib, renderBankLib, BankLibProps, unmountBankLib } from './features
|
|
|
8
8
|
import { TaxLib, renderTaxLib, TaxLibProps, unmountTaxLib } from './features/tax';
|
|
9
9
|
import { SignInLib, renderSignInLib, SignInLibProps, unmountSignInLib } from './features/signIn';
|
|
10
10
|
import { EntityLib, EntityLibProps, renderEntityLib, unmountEntityLib } from './features/entity';
|
|
11
|
-
import { OTPLib, OTPLibProps, renderOTPLib, unmountOTPLib } from './features/otp/OTP';
|
|
12
11
|
import { AuthLib, AuthLibProps, renderAuthLib, unmountAuthLib } from './features/auth';
|
|
13
|
-
export type { ConnectLibProps, BusinessLibProps, PasswordLibProps, IndividualLibProps, BankLibProps, TaxLibProps, EntityLibProps,
|
|
14
|
-
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib,
|
|
12
|
+
export type { ConnectLibProps, BusinessLibProps, PasswordLibProps, IndividualLibProps, BankLibProps, TaxLibProps, EntityLibProps, AuthLibProps, SignInLibProps };
|
|
13
|
+
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib, SignInLib, renderSignInLib, unmountSignInLib, AuthLib, renderAuthLib, unmountAuthLib };
|
package/build/index.js
CHANGED
|
@@ -8,9 +8,8 @@ import { BankLib, renderBankLib, unmountBankLib } from './features/bank';
|
|
|
8
8
|
import { TaxLib, renderTaxLib, unmountTaxLib } from './features/tax';
|
|
9
9
|
import { SignInLib, renderSignInLib, unmountSignInLib } from './features/signIn';
|
|
10
10
|
import { EntityLib, renderEntityLib, unmountEntityLib } from './features/entity';
|
|
11
|
-
import { OTPLib, renderOTPLib, unmountOTPLib } from './features/otp/OTP';
|
|
12
11
|
import { AuthLib, renderAuthLib, unmountAuthLib } from './features/auth';
|
|
13
|
-
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib,
|
|
12
|
+
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib, SignInLib, renderSignInLib, unmountSignInLib, AuthLib, renderAuthLib, unmountAuthLib };
|
|
14
13
|
window['TapAuth'] = {
|
|
15
14
|
renderConnectLib: renderConnectLib,
|
|
16
15
|
unmountConnectLib: unmountConnectLib,
|
|
@@ -26,8 +25,6 @@ window['TapAuth'] = {
|
|
|
26
25
|
unmountTaxLib: unmountTaxLib,
|
|
27
26
|
renderEntityLib: renderEntityLib,
|
|
28
27
|
unmountEntityLib: unmountEntityLib,
|
|
29
|
-
renderOTPLib: renderOTPLib,
|
|
30
|
-
unmountOTPLib: unmountOTPLib,
|
|
31
28
|
renderSignInLib: renderSignInLib,
|
|
32
29
|
unmountSignInLib: unmountSignInLib,
|
|
33
30
|
renderAuthLib: renderAuthLib,
|
package/build/utils/object.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export declare const compareTwoObjects: (obj1: any, obj2: any) => boolean;
|
|
|
2
2
|
export declare const encodeObjectBase64: (obj: any) => string;
|
|
3
3
|
export declare const decodeObjectBase64: (str: string) => any;
|
|
4
4
|
export declare const hasKey: (obj: any, key: string) => boolean;
|
|
5
|
+
export declare const concatenateObjectValues: (data: Record<string, any>, keys: Array<string>) => string;
|
package/build/utils/object.js
CHANGED
|
@@ -21,3 +21,15 @@ export var hasKey = function (obj, key) {
|
|
|
21
21
|
return false;
|
|
22
22
|
return Object.keys(obj).includes(key);
|
|
23
23
|
};
|
|
24
|
+
export var concatenateObjectValues = function (data, keys) {
|
|
25
|
+
if (!data)
|
|
26
|
+
return '';
|
|
27
|
+
var result = '';
|
|
28
|
+
for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
|
|
29
|
+
var key = keys_1[_i];
|
|
30
|
+
if (data[key]) {
|
|
31
|
+
result += data[key] + ' ';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return result.trim();
|
|
35
|
+
};
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { RootState } from '../../../app/store';
|
|
2
|
-
import { FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
|
|
3
|
-
export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
|
-
data: any;
|
|
5
|
-
}, void, {}>;
|
|
6
|
-
export declare const verifyOtpLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
7
|
-
formData: OTPFormValues;
|
|
8
|
-
}, OTPFormValues, {}>;
|
|
9
|
-
declare type VerifyData = {
|
|
10
|
-
token: string;
|
|
11
|
-
};
|
|
12
|
-
export interface OtpData {
|
|
13
|
-
verify: ResponseData & VerifyData;
|
|
14
|
-
otpData: OTPFormValues & ResponseData;
|
|
15
|
-
flowName: FlowsTypes;
|
|
16
|
-
}
|
|
17
|
-
export interface OtpState extends SharedState<OtpData> {
|
|
18
|
-
customLoading?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare const otpSlice: import("@reduxjs/toolkit").Slice<OtpState, {
|
|
21
|
-
clearError: (state: OtpState) => void;
|
|
22
|
-
stopLoader: (state: OtpState) => void;
|
|
23
|
-
resetOTPScreen: (state: OtpState) => void;
|
|
24
|
-
}, "otp/store">;
|
|
25
|
-
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
26
|
-
declare const _default: import("redux").Reducer<OtpState, import("redux").AnyAction>;
|
|
27
|
-
export default _default;
|
|
28
|
-
export declare const otpSelector: (state: RootState) => OtpState;
|