@tap-payments/auth-jsconnect 2.8.73-development → 2.8.75-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 +1 -1
- package/build/api/auth.d.ts +0 -13
- package/build/api/index.d.ts +2 -2
- package/build/api/lead.d.ts +0 -6
- package/build/assets/locales/ar.json +1 -10
- package/build/assets/locales/en.json +1 -10
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +2 -1
- package/build/constants/app.js +14 -35
- package/build/constants/assets.d.ts +0 -2
- package/build/constants/assets.js +0 -2
- package/build/features/app/auth/authStore.d.ts +15 -5
- package/build/features/app/auth/authStore.js +113 -58
- package/build/features/app/business/businessStore.d.ts +11 -16
- package/build/features/app/business/businessStore.js +44 -58
- package/build/features/app/connect/connectStore.d.ts +12 -19
- package/build/features/app/connect/connectStore.js +82 -151
- package/build/features/app/connectExpress/connectExpressStore.d.ts +33 -10
- package/build/features/app/connectExpress/connectExpressStore.js +251 -156
- package/build/features/app/individual/individualStore.js +2 -4
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +2 -2
- package/build/features/auth/screens/AuthenticationList/LicenseNumber.js +2 -2
- package/build/features/auth/screens/NID/DOB.d.ts +6 -0
- package/build/features/auth/screens/NID/DOB.js +47 -0
- package/build/features/auth/screens/NID/IDNumber.js +1 -1
- package/build/features/auth/screens/NID/NID.js +10 -4
- package/build/features/auth/screens/NID/validation.d.ts +3 -0
- package/build/features/auth/screens/NID/validation.js +1 -0
- package/build/features/auth/screens/OTP/OTP.js +5 -1
- package/build/features/auth/screens/OTP/OTPInput.js +13 -2
- package/build/features/business/screens/BusinessType/LicenseNumber.js +2 -2
- package/build/features/business/screens/OTP/OTP.d.ts +8 -0
- package/build/features/business/screens/OTP/OTP.js +90 -0
- package/build/features/business/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/business/screens/OTP/OTPInput.js +49 -0
- package/build/features/business/screens/OTP/index.d.ts +3 -0
- package/build/features/business/screens/OTP/index.js +2 -0
- package/build/features/business/screens/OTP/validation.d.ts +8 -0
- package/build/features/business/screens/OTP/validation.js +4 -0
- package/build/features/connect/screens/Mobile/Mobile.js +2 -2
- package/build/features/connect/screens/NID/DOB.d.ts +5 -0
- package/build/features/connect/screens/NID/DOB.js +47 -0
- package/build/features/connect/screens/NID/IDNumber.d.ts +0 -1
- package/build/features/connect/screens/NID/IDNumber.js +2 -2
- package/build/features/connect/screens/NID/NID.js +11 -5
- package/build/features/connect/screens/NID/validation.d.ts +3 -0
- package/build/features/connect/screens/NID/validation.js +1 -0
- package/build/features/connect/screens/OTP/OTPInput.js +11 -3
- package/build/features/connectExpress/screens/AuthenticationList/LicenseNumber.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
- package/build/features/{auth/screens/VerifyNafath/VerifyNafath.d.ts → connectExpress/screens/IdentityOTP/OTP.d.ts} +2 -2
- package/build/features/connectExpress/screens/IdentityOTP/OTP.js +88 -0
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +5 -0
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +56 -0
- package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +3 -0
- package/build/features/connectExpress/screens/IdentityOTP/index.js +2 -0
- package/build/features/connectExpress/screens/IdentityOTP/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/IdentityOTP/validation.js +4 -0
- package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -2
- package/build/features/connectExpress/screens/NID/DOB.d.ts +6 -0
- package/build/features/connectExpress/screens/NID/DOB.js +47 -0
- package/build/features/connectExpress/screens/NID/IDNumber.d.ts +0 -1
- package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
- package/build/features/connectExpress/screens/NID/NID.js +9 -4
- package/build/features/connectExpress/screens/NID/validation.d.ts +3 -0
- package/build/features/connectExpress/screens/NID/validation.js +2 -0
- package/build/features/connectExpress/screens/NIDMissed/NID.js +2 -2
- package/build/features/connectExpress/screens/OTP/OTP.js +13 -5
- package/build/features/connectExpress/screens/OTP/OTPInput.js +11 -3
- package/build/features/entity/screens/EntityName/LicenseNumber.js +2 -2
- package/build/features/featuresScreens.js +6 -21
- package/build/features/shared/Button/AbsherButton.d.ts +7 -0
- package/build/features/shared/Button/{NafathButton.js → AbsherButton.js} +3 -13
- package/build/features/shared/Button/index.d.ts +2 -2
- package/build/features/shared/Button/index.js +2 -2
- package/build/theme/palette.js +1 -2
- package/build/utils/common.js +4 -4
- package/build/utils/validation.d.ts +1 -0
- package/build/utils/validation.js +3 -0
- package/package.json +2 -2
- package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +0 -34
- package/build/features/auth/screens/VerifyNafath/index.d.ts +0 -3
- package/build/features/auth/screens/VerifyNafath/index.js +0 -2
- package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +0 -5
- package/build/features/business/screens/VerifyNafath/VerifyNafath.js +0 -34
- package/build/features/business/screens/VerifyNafath/index.d.ts +0 -3
- package/build/features/business/screens/VerifyNafath/index.js +0 -2
- package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +0 -5
- package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +0 -34
- package/build/features/connect/screens/VerifyNafath/index.d.ts +0 -3
- package/build/features/connect/screens/VerifyNafath/index.js +0 -2
- package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +0 -5
- package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +0 -34
- package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +0 -3
- package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +0 -2
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +0 -5
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +0 -34
- package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +0 -3
- package/build/features/connectExpress/screens/VerifyNafath/index.js +0 -2
- package/build/features/shared/Button/NafathButton.d.ts +0 -7
- package/build/features/shared/NafathVerification/NafathVerification.d.ts +0 -13
- package/build/features/shared/NafathVerification/NafathVerification.js +0 -92
- package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +0 -8
- package/build/features/shared/NafathVerification/VerifyNafathLoading.js +0 -53
- package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +0 -5
- package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +0 -8
- package/build/features/shared/NafathVerification/index.d.ts +0 -2
- package/build/features/shared/NafathVerification/index.js +0 -2
|
@@ -3,7 +3,6 @@ import MobileScreen from './connect/screens/Mobile';
|
|
|
3
3
|
import NIDScreen from './connect/screens/NID';
|
|
4
4
|
import ConnectCivilIDScreen from '../features/connect/screens/CivilID';
|
|
5
5
|
import ConnectVerifyPACIScreen from './connect/screens/VerifyPACI';
|
|
6
|
-
import ConnectVerifyNafathScreen from './connect/screens/VerifyNafath';
|
|
7
6
|
import IndividualScreen from './connect/screens/Individual';
|
|
8
7
|
import MerchantInfoScreen from './connect/screens/Merchant';
|
|
9
8
|
import BrandSegmentInfoScreen from './connect/screens/BrandSegment';
|
|
@@ -13,14 +12,13 @@ import OperatorError from './connect/screens/OperatorError';
|
|
|
13
12
|
import ConnectExpressBusinessCountry from './connectExpress/screens/BusinessCountry/BusinessCountry';
|
|
14
13
|
import ConnectExpressMobileScreen from './connectExpress/screens/Mobile';
|
|
15
14
|
import ConnectExpressNIDScreen from './connectExpress/screens/NID';
|
|
16
|
-
import ConnectExpressVerifyNafathScreen from './connectExpress/screens/VerifyNafath';
|
|
17
15
|
import ConnectExpressCivilIDScreen from './connectExpress/screens/CivilID';
|
|
18
16
|
import ConnectExpressVerifyPACIScreen from './connectExpress/screens/VerifyPACI';
|
|
19
17
|
import ConnectExpressOTPScreen from './connectExpress/screens/OTP';
|
|
20
18
|
import ConnectExpressNIDMissedScreen from './connectExpress/screens/NIDMissed';
|
|
21
19
|
import ConnectExpressCivilIDMissedScreen from './connectExpress/screens/CivilIDMissed';
|
|
22
20
|
import ConnectExpressIdentityVerifyPACIScreen from './connectExpress/screens/IdentityVerifyPACI';
|
|
23
|
-
import
|
|
21
|
+
import ConnectExpressIdentityVerifyOTPScreen from './connectExpress/screens/IdentityOTP';
|
|
24
22
|
import ConnectExpressCollectIndividualScreen from './connectExpress/screens/CollectIndividualInfo';
|
|
25
23
|
import ConnectExpressCollectBusinessScreen from './connectExpress/screens/CollectBusinessInfo';
|
|
26
24
|
import ConnectExpressCreateAccountLoaderScreen from './connectExpress/screens/CreateAccountLoader';
|
|
@@ -38,7 +36,6 @@ import AuthNIDScreen from './auth/screens/NID';
|
|
|
38
36
|
import AuthEmailScreen from './auth/screens/Email';
|
|
39
37
|
import AuthCivilIDScreen from './auth/screens/CivilID';
|
|
40
38
|
import AuthVerifyPACIScreen from './auth/screens/VerifyPACI';
|
|
41
|
-
import AuthVerifyNafathScreen from './auth/screens/VerifyNafath';
|
|
42
39
|
import AuthOTPScreen from './auth/screens/OTP';
|
|
43
40
|
import AuthPasswordScreen from './auth/screens/Password';
|
|
44
41
|
import AuthResetPasswordMessageScreen from './auth/screens/ResetPasswordMessage';
|
|
@@ -53,7 +50,7 @@ import AuthOperatorError from './auth/screens/OperatorError';
|
|
|
53
50
|
import CustomersPage from './business/screens/Customers';
|
|
54
51
|
import IDBODPage from './business/screens/IDBOD';
|
|
55
52
|
import BusinessVerifyPage from './business/screens/Verify';
|
|
56
|
-
import
|
|
53
|
+
import BusinessOTPPage from './business/screens/OTP';
|
|
57
54
|
import BusinessTypePage from './business/screens/BusinessType';
|
|
58
55
|
import ActivitiesPage from './business/screens/Activities';
|
|
59
56
|
import SuccessPage from './business/screens/Success';
|
|
@@ -147,10 +144,6 @@ export var connectFeatureScreens = [
|
|
|
147
144
|
name: 'CONNECT_VERIFY_PACI_STEP',
|
|
148
145
|
element: ConnectVerifyPACIScreen
|
|
149
146
|
},
|
|
150
|
-
{
|
|
151
|
-
name: 'CONNECT_VERIFY_NAFATH_STEP',
|
|
152
|
-
element: ConnectVerifyNafathScreen
|
|
153
|
-
},
|
|
154
147
|
{
|
|
155
148
|
name: 'CONNECT_INDIVIDUAL_STEP',
|
|
156
149
|
element: IndividualScreen
|
|
@@ -193,10 +186,6 @@ export var connectExpressFeatureScreens = [
|
|
|
193
186
|
name: 'CONNECT_EXPRESS_OTP_STEP',
|
|
194
187
|
element: ConnectExpressOTPScreen
|
|
195
188
|
},
|
|
196
|
-
{
|
|
197
|
-
name: 'CONNECT_EXPRESS_VERIFY_NAFATH_STEP',
|
|
198
|
-
element: ConnectExpressVerifyNafathScreen
|
|
199
|
-
},
|
|
200
189
|
{
|
|
201
190
|
name: 'CONNECT_EXPRESS_VERIFY_PACI_STEP',
|
|
202
191
|
element: ConnectExpressVerifyPACIScreen
|
|
@@ -214,8 +203,8 @@ export var connectExpressFeatureScreens = [
|
|
|
214
203
|
element: ConnectExpressIdentityVerifyPACIScreen
|
|
215
204
|
},
|
|
216
205
|
{
|
|
217
|
-
name: '
|
|
218
|
-
element:
|
|
206
|
+
name: 'CONNECT_EXPRESS_OTP_IDENTITY_STEP',
|
|
207
|
+
element: ConnectExpressIdentityVerifyOTPScreen
|
|
219
208
|
},
|
|
220
209
|
{
|
|
221
210
|
name: 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
|
|
@@ -299,10 +288,6 @@ export var authFeatureScreens = [
|
|
|
299
288
|
name: 'AUTH_VERIFY_PACI_STEP',
|
|
300
289
|
element: AuthVerifyPACIScreen
|
|
301
290
|
},
|
|
302
|
-
{
|
|
303
|
-
name: 'AUTH_NAFATH_VERIFY_STEP',
|
|
304
|
-
element: AuthVerifyNafathScreen
|
|
305
|
-
},
|
|
306
291
|
{
|
|
307
292
|
name: 'AUTH_ACCOUNT_NOT_FOUND_STEP',
|
|
308
293
|
element: AccountNotFoundScreen
|
|
@@ -354,8 +339,8 @@ export var businessFeatureScreens = [
|
|
|
354
339
|
element: BusVerifyPACIScreen
|
|
355
340
|
},
|
|
356
341
|
{
|
|
357
|
-
name: '
|
|
358
|
-
element:
|
|
342
|
+
name: 'BUSINESS_OTP_STEP',
|
|
343
|
+
element: BusinessOTPPage
|
|
359
344
|
},
|
|
360
345
|
{
|
|
361
346
|
name: 'BUSINESS_BUSINESS_TYPE_STEP',
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ButtonProps } from '../../../components/Button';
|
|
2
|
+
interface AbsherButtonProps extends ButtonProps {
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
hideIcon?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export default function AbsherButton({ children, hideIcon, disabled, ...props }: AbsherButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -28,7 +28,7 @@ import Box from '@mui/material/Box';
|
|
|
28
28
|
import { ICONS_NAMES } from '../../../constants';
|
|
29
29
|
var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
|
|
30
30
|
var theme = _a.theme, disabled = _a.disabled;
|
|
31
|
-
return (__assign({ width: theme.spacing(3), height: theme.spacing(3) }, (disabled && {
|
|
31
|
+
return (__assign({ width: theme.spacing(3), height: theme.spacing(3), marginInlineStart: theme.spacing(0.75) }, (disabled && {
|
|
32
32
|
opacity: 0.3
|
|
33
33
|
})));
|
|
34
34
|
});
|
|
@@ -38,19 +38,9 @@ var ButtonBoxStyled = styled(Box)(function (_a) {
|
|
|
38
38
|
margin: theme.spacing(0, 2.5, 2.5, 2.5)
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
|
-
|
|
42
|
-
var theme = _a.theme;
|
|
43
|
-
return ({
|
|
44
|
-
paddingInlineStart: theme.spacing(1.75),
|
|
45
|
-
fontWeight: theme.typography.fontWeightRegular,
|
|
46
|
-
'& .MuiButton-startIcon': {
|
|
47
|
-
margin: theme.spacing(0)
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
export default function NafathButton(_a) {
|
|
41
|
+
export default function AbsherButton(_a) {
|
|
52
42
|
var children = _a.children, hideIcon = _a.hideIcon, disabled = _a.disabled, props = __rest(_a, ["children", "hideIcon", "disabled"]);
|
|
53
43
|
var theme = useTheme();
|
|
54
44
|
var btnColor = theme.palette.primary.light;
|
|
55
|
-
return (_jsx(ButtonBoxStyled, { children: _jsx(
|
|
45
|
+
return (_jsx(ButtonBoxStyled, { children: _jsx(Button, __assign({ outLineColor: btnColor, variant: 'outlined', disabled: disabled, type: 'button', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.ABSHER_LOGO }) }, props, { children: children })) }));
|
|
56
46
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Button from './Button';
|
|
2
|
-
import
|
|
2
|
+
import AbsherButton from './AbsherButton';
|
|
3
3
|
import MobileButton from './MobileButton';
|
|
4
4
|
import EmailProvidersButton from './EmailProvidersButtons';
|
|
5
5
|
import FlowsButtons from './FlowsButtons';
|
|
6
6
|
import SuccessButton from './SuccessButton';
|
|
7
7
|
import ListButton from './IndividualActionButtons';
|
|
8
|
-
export {
|
|
8
|
+
export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
|
|
9
9
|
export default Button;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Button from './Button';
|
|
2
|
-
import
|
|
2
|
+
import AbsherButton from './AbsherButton';
|
|
3
3
|
import MobileButton from './MobileButton';
|
|
4
4
|
import EmailProvidersButton from './EmailProvidersButtons';
|
|
5
5
|
import FlowsButtons from './FlowsButtons';
|
|
6
6
|
import SuccessButton from './SuccessButton';
|
|
7
7
|
import ListButton from './IndividualActionButtons';
|
|
8
|
-
export {
|
|
8
|
+
export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
|
|
9
9
|
export default Button;
|
package/build/theme/palette.js
CHANGED
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
|
}
|
|
@@ -6,6 +6,7 @@ export declare const removeAllOtherThanAlphabetAndSpace: (str: string) => string
|
|
|
6
6
|
export declare const removeAllNumberFromChars: (str: string) => string;
|
|
7
7
|
export declare const keepEmailCharacters: (str: string) => string;
|
|
8
8
|
export declare const removeAllOtherThanCharsAndNumber: (str: string) => string;
|
|
9
|
+
export declare const cleanFLandCRNumber: (str: string) => string;
|
|
9
10
|
export declare const removeAllOtherThanCharsNumberSlashAndHyphen: (str: string) => string;
|
|
10
11
|
export declare const removeAllOtherThanCharsNumbersAtAndDot: (str: string) => string;
|
|
11
12
|
export declare const removeAllOtherThanCharsNumbersAndSpace: (str: string) => string;
|
|
@@ -22,6 +22,9 @@ export var keepEmailCharacters = function (str) {
|
|
|
22
22
|
export var removeAllOtherThanCharsAndNumber = function (str) {
|
|
23
23
|
return str.replace(/[^A-Za-z0-9]/g, '');
|
|
24
24
|
};
|
|
25
|
+
export var cleanFLandCRNumber = function (str) {
|
|
26
|
+
return str.replace(/[^a-zA-Z0-9_-]/g, '');
|
|
27
|
+
};
|
|
25
28
|
export var removeAllOtherThanCharsNumberSlashAndHyphen = function (str) {
|
|
26
29
|
return str.replace(/[^A-Za-z0-9/-]/g, '');
|
|
27
30
|
};
|
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.75-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,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { authSelector, verifyNafath as verifyNafathFun } from '../../../app/auth/authStore';
|
|
4
|
-
import NafathVerification from '../../../shared/NafathVerification';
|
|
5
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
6
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
7
|
-
var VerifyNafath = function () {
|
|
8
|
-
var _a;
|
|
9
|
-
var _b = React.useState(false), success = _b[0], setSuccess = _b[1];
|
|
10
|
-
var _c = React.useState(false), isReady = _c[0], setIsReady = _c[1];
|
|
11
|
-
var dispatch = useAppDispatch();
|
|
12
|
-
var data = useAppSelector(authSelector).data;
|
|
13
|
-
var _d = ((_a = data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse) || {}, expiry = _d.expiry, app_url_android = _d.app_url_android, app_url_ios = _d.app_url_ios, random = _d.random;
|
|
14
|
-
React.useEffect(function () {
|
|
15
|
-
if (data.responseData && !isReady) {
|
|
16
|
-
setIsReady(true);
|
|
17
|
-
}
|
|
18
|
-
}, [data.responseData]);
|
|
19
|
-
React.useEffect(function () {
|
|
20
|
-
if (!isReady)
|
|
21
|
-
return;
|
|
22
|
-
var promise = dispatch(verifyNafathFun({ onSuccess: function () { return setSuccess(true); } }));
|
|
23
|
-
return function () {
|
|
24
|
-
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
25
|
-
};
|
|
26
|
-
}, [isReady]);
|
|
27
|
-
var onBack = React.useCallback(function () {
|
|
28
|
-
dispatch(handlePrevScreenStep());
|
|
29
|
-
}, []);
|
|
30
|
-
if (!isReady)
|
|
31
|
-
return null;
|
|
32
|
-
return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
33
|
-
};
|
|
34
|
-
export default React.memo(VerifyNafath);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { businessSelector, verifyNafath } from '../../../app/business/businessStore';
|
|
4
|
-
import NafathVerification from '../../../shared/NafathVerification';
|
|
5
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
6
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
7
|
-
var VerifyNafath = function () {
|
|
8
|
-
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
9
|
-
var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
|
|
10
|
-
var dispatch = useAppDispatch();
|
|
11
|
-
var data = useAppSelector(businessSelector).data;
|
|
12
|
-
var responseBody = data.nidData.responseBody;
|
|
13
|
-
var _c = responseBody || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios, random = _c.random;
|
|
14
|
-
React.useEffect(function () {
|
|
15
|
-
if (responseBody && !isReady) {
|
|
16
|
-
setIsReady(true);
|
|
17
|
-
}
|
|
18
|
-
}, [responseBody]);
|
|
19
|
-
React.useEffect(function () {
|
|
20
|
-
if (!isReady)
|
|
21
|
-
return;
|
|
22
|
-
var promise = dispatch(verifyNafath({ onSuccess: function () { return setSuccess(true); } }));
|
|
23
|
-
return function () {
|
|
24
|
-
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
25
|
-
};
|
|
26
|
-
}, [isReady]);
|
|
27
|
-
var onBack = React.useCallback(function () {
|
|
28
|
-
dispatch(handlePrevScreenStep());
|
|
29
|
-
}, []);
|
|
30
|
-
if (!isReady)
|
|
31
|
-
return null;
|
|
32
|
-
return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
33
|
-
};
|
|
34
|
-
export default React.memo(VerifyNafath);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { connectSelector, verifyNafath as verifyNafathFun } from '../../../app/connect/connectStore';
|
|
4
|
-
import NafathVerification from '../../../shared/NafathVerification';
|
|
5
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
6
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
7
|
-
var VerifyNafath = function () {
|
|
8
|
-
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
9
|
-
var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
|
|
10
|
-
var dispatch = useAppDispatch();
|
|
11
|
-
var data = useAppSelector(connectSelector).data;
|
|
12
|
-
var responseBody = data.nidData.responseBody;
|
|
13
|
-
var _c = responseBody || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios, random = _c.random;
|
|
14
|
-
React.useEffect(function () {
|
|
15
|
-
if (responseBody && !isReady) {
|
|
16
|
-
setIsReady(true);
|
|
17
|
-
}
|
|
18
|
-
}, [responseBody]);
|
|
19
|
-
React.useEffect(function () {
|
|
20
|
-
if (!isReady)
|
|
21
|
-
return;
|
|
22
|
-
var promise = dispatch(verifyNafathFun({ onSuccess: function () { return setSuccess(true); } }));
|
|
23
|
-
return function () {
|
|
24
|
-
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
25
|
-
};
|
|
26
|
-
}, [isReady]);
|
|
27
|
-
var onBack = React.useCallback(function () {
|
|
28
|
-
dispatch(handlePrevScreenStep());
|
|
29
|
-
}, []);
|
|
30
|
-
if (!isReady)
|
|
31
|
-
return null;
|
|
32
|
-
return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
33
|
-
};
|
|
34
|
-
export default React.memo(VerifyNafath);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { connectExpressSelector, verifyNafathIdentityAsync } from '../../../app/connectExpress/connectExpressStore';
|
|
4
|
-
import NafathVerification from '../../../shared/NafathVerification';
|
|
5
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
6
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
7
|
-
var IdentityVerifyNafath = function () {
|
|
8
|
-
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
9
|
-
var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
|
|
10
|
-
var dispatch = useAppDispatch();
|
|
11
|
-
var data = useAppSelector(connectExpressSelector).data;
|
|
12
|
-
var authData = (data.responseData || {}).authData;
|
|
13
|
-
var _c = authData || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios, random = _c.random;
|
|
14
|
-
React.useEffect(function () {
|
|
15
|
-
if (authData && !isReady) {
|
|
16
|
-
setIsReady(true);
|
|
17
|
-
}
|
|
18
|
-
}, [authData]);
|
|
19
|
-
React.useEffect(function () {
|
|
20
|
-
if (!isReady)
|
|
21
|
-
return;
|
|
22
|
-
var promise = dispatch(verifyNafathIdentityAsync({ onSuccess: function () { return setSuccess(true); } }));
|
|
23
|
-
return function () {
|
|
24
|
-
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
25
|
-
};
|
|
26
|
-
}, [isReady]);
|
|
27
|
-
var onBack = React.useCallback(function () {
|
|
28
|
-
dispatch(handlePrevScreenStep());
|
|
29
|
-
}, []);
|
|
30
|
-
if (!isReady)
|
|
31
|
-
return null;
|
|
32
|
-
return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
33
|
-
};
|
|
34
|
-
export default React.memo(IdentityVerifyNafath);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { connectExpressSelector, verifyNafathAsync } from '../../../app/connectExpress/connectExpressStore';
|
|
4
|
-
import NafathVerification from '../../../shared/NafathVerification';
|
|
5
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
6
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
7
|
-
var VerifyNafath = function () {
|
|
8
|
-
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
9
|
-
var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
|
|
10
|
-
var dispatch = useAppDispatch();
|
|
11
|
-
var data = useAppSelector(connectExpressSelector).data;
|
|
12
|
-
var authData = (data.responseData || {}).authData;
|
|
13
|
-
var _c = authData || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios, random = _c.random;
|
|
14
|
-
React.useEffect(function () {
|
|
15
|
-
if (authData && !isReady) {
|
|
16
|
-
setIsReady(true);
|
|
17
|
-
}
|
|
18
|
-
}, [authData]);
|
|
19
|
-
React.useEffect(function () {
|
|
20
|
-
if (!isReady)
|
|
21
|
-
return;
|
|
22
|
-
var promise = dispatch(verifyNafathAsync({ onSuccess: function () { return setSuccess(true); } }));
|
|
23
|
-
return function () {
|
|
24
|
-
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
25
|
-
};
|
|
26
|
-
}, [isReady]);
|
|
27
|
-
var onBack = React.useCallback(function () {
|
|
28
|
-
dispatch(handlePrevScreenStep());
|
|
29
|
-
}, []);
|
|
30
|
-
if (!isReady)
|
|
31
|
-
return null;
|
|
32
|
-
return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
33
|
-
};
|
|
34
|
-
export default React.memo(VerifyNafath);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from '../../../components/Button';
|
|
2
|
-
interface NafathButtonProps extends ButtonProps {
|
|
3
|
-
loading?: boolean;
|
|
4
|
-
hideIcon?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export default function NafathButton({ children, hideIcon, disabled, ...props }: NafathButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface VerifyNafathProps {
|
|
3
|
-
randomNumber: string;
|
|
4
|
-
success: boolean;
|
|
5
|
-
expiryInSeconds: number;
|
|
6
|
-
urls?: {
|
|
7
|
-
android: string;
|
|
8
|
-
ios: string;
|
|
9
|
-
};
|
|
10
|
-
onFinish?: () => void;
|
|
11
|
-
}
|
|
12
|
-
declare const _default: React.MemoExoticComponent<({ randomNumber, success, expiryInSeconds, urls, onFinish }: VerifyNafathProps) => import("react/jsx-runtime").JSX.Element>;
|
|
13
|
-
export default _default;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import Box from '@mui/material/Box/Box';
|
|
15
|
-
import { styled } from '@mui/material/styles';
|
|
16
|
-
import { useTranslation } from 'react-i18next';
|
|
17
|
-
import Text from '../../../components/Text';
|
|
18
|
-
import { ScreenContainer } from '../../shared/Containers';
|
|
19
|
-
import { MobileButton } from '../../shared/Button';
|
|
20
|
-
import { mobileOS } from '../../../utils';
|
|
21
|
-
import { useCountUp } from '../../../hooks';
|
|
22
|
-
import VerifyNafathLoading from './VerifyNafathLoading';
|
|
23
|
-
import VerifyNafathSuccess from './VerifyNafathSuccess';
|
|
24
|
-
var VerifyNafathTitleContainerStyled = styled(Box)(function (_a) {
|
|
25
|
-
var theme = _a.theme;
|
|
26
|
-
return ({
|
|
27
|
-
direction: theme.direction,
|
|
28
|
-
display: 'flex',
|
|
29
|
-
flexDirection: 'column',
|
|
30
|
-
alignItems: 'center',
|
|
31
|
-
marginBottom: theme.spacing(2.5)
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
var VerifyNafathTitleStyled = styled(Text)(function (_a) {
|
|
35
|
-
var theme = _a.theme;
|
|
36
|
-
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightBold, marginBottom: theme.spacing(2.4), lineHeight: '19.2px' }));
|
|
37
|
-
});
|
|
38
|
-
var VerifyNafathSubTitleStyled = styled(Text)(function (_a) {
|
|
39
|
-
var theme = _a.theme;
|
|
40
|
-
return (__assign(__assign({}, theme.typography.body2), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightMedium, lineHeight: '16.8px', textAlign: 'center', marginLeft: theme.spacing(3), marginRight: theme.spacing(3) }));
|
|
41
|
-
});
|
|
42
|
-
var Container = styled(Box)(function (_a) {
|
|
43
|
-
var theme = _a.theme;
|
|
44
|
-
return ({
|
|
45
|
-
position: 'relative',
|
|
46
|
-
display: 'flex',
|
|
47
|
-
justifyContent: 'center',
|
|
48
|
-
alignItems: 'center',
|
|
49
|
-
maxHeight: '300px',
|
|
50
|
-
marginBottom: theme.spacing(3.25)
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
var VerifyNafath = function (_a) {
|
|
54
|
-
var randomNumber = _a.randomNumber, success = _a.success, expiryInSeconds = _a.expiryInSeconds, urls = _a.urls, onFinish = _a.onFinish;
|
|
55
|
-
var t = useTranslation().t;
|
|
56
|
-
var count = useCountUp({ start: 0, end: expiryInSeconds, sleepMS: 1000 }).count;
|
|
57
|
-
var errorWaitingTime = 3;
|
|
58
|
-
var phases = 2;
|
|
59
|
-
var remainingTime = expiryInSeconds - errorWaitingTime;
|
|
60
|
-
var phaseNumber = Math.floor((count / remainingTime) * phases) + 1;
|
|
61
|
-
var isEnded = count === expiryInSeconds;
|
|
62
|
-
var endPhaseStarted = count >= remainingTime;
|
|
63
|
-
console.log('VerifyNafath', VerifyNafath);
|
|
64
|
-
React.useEffect(function () {
|
|
65
|
-
if (isEnded && onFinish)
|
|
66
|
-
onFinish();
|
|
67
|
-
}, [isEnded]);
|
|
68
|
-
var onRedirect = React.useCallback(function () {
|
|
69
|
-
if (os === 'Android') {
|
|
70
|
-
window.open(urls === null || urls === void 0 ? void 0 : urls.android, '_blank');
|
|
71
|
-
}
|
|
72
|
-
if (os === 'iOS') {
|
|
73
|
-
window.open(urls === null || urls === void 0 ? void 0 : urls.ios, '_blank');
|
|
74
|
-
}
|
|
75
|
-
}, [urls]);
|
|
76
|
-
var os = React.useMemo(function () { return mobileOS(); }, []);
|
|
77
|
-
var isAndroid = React.useMemo(function () { return os === 'Android' && (urls === null || urls === void 0 ? void 0 : urls.android); }, [os, urls]);
|
|
78
|
-
var isIOS = React.useMemo(function () { return os === 'iOS' && (urls === null || urls === void 0 ? void 0 : urls.ios); }, [os, urls]);
|
|
79
|
-
var title = React.useMemo(function () {
|
|
80
|
-
if (phaseNumber === 1)
|
|
81
|
-
return 'nafath_verification_title_wait';
|
|
82
|
-
return 'nafath_verification_title_check';
|
|
83
|
-
}, [phaseNumber]);
|
|
84
|
-
var description = React.useMemo(function () {
|
|
85
|
-
if (phaseNumber === 1)
|
|
86
|
-
return 'nafath_verification_description_wait';
|
|
87
|
-
return 'nafath_verification_description_check';
|
|
88
|
-
}, [phaseNumber]);
|
|
89
|
-
var isErrorPhase = endPhaseStarted && !success;
|
|
90
|
-
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(VerifyNafathTitleContainerStyled, { children: [_jsx(Container, { children: success ? _jsx(VerifyNafathSuccess, {}) : _jsx(VerifyNafathLoading, { randomNumber: randomNumber, type: isErrorPhase ? 3 : phaseNumber }) }), isErrorPhase ? (_jsxs(_Fragment, { children: [_jsx(VerifyNafathTitleStyled, { children: t('nafath_verification_title_error') }), _jsx(VerifyNafathSubTitleStyled, __assign({ sx: { pb: 1 } }, { children: t('nafath_verification_description_error') })), _jsx(VerifyNafathSubTitleStyled, { children: t('nafath_verification_redirection_message') })] })) : (_jsxs(_Fragment, { children: [_jsx(VerifyNafathTitleStyled, { children: t(title) }), _jsx(VerifyNafathSubTitleStyled, { children: t(description) })] }))] }), (isAndroid || isIOS) && (_jsx(MobileButton, __assign({ onClick: onRedirect, hideIcon: true }, { children: t('open_nafath_app') })))] })));
|
|
91
|
-
};
|
|
92
|
-
export default React.memo(VerifyNafath);
|