@tap-payments/auth-jsconnect 1.0.90-test → 1.0.94-test
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/README.md +58 -52
- package/build/@types/app.d.ts +9 -0
- package/build/@types/app.js +9 -0
- package/build/@types/form.d.ts +2 -0
- package/build/api/account.js +1 -1
- package/build/api/auth.js +1 -1
- package/build/api/availabilityServices.js +1 -1
- package/build/api/axios.d.ts +2 -0
- package/build/api/axios.js +4 -2
- package/build/api/country.js +1 -1
- package/build/api/data.js +1 -1
- package/build/api/entity.js +1 -1
- package/build/api/firebase.js +1 -1
- package/build/api/individual.js +1 -1
- package/build/api/ip.js +1 -1
- package/build/api/lead.js +1 -1
- package/build/api/operator.js +1 -1
- package/build/app/rootReducer.d.ts +6 -7
- package/build/app/rootReducer.js +7 -9
- package/build/app/settings.d.ts +9 -3
- package/build/app/settings.js +42 -6
- package/build/app/store.d.ts +0 -2
- package/build/components/AnimationFlow/BottomSheet.js +1 -1
- package/build/components/AnimationFlow/Dialog.js +2 -2
- package/build/components/AnimationFlow/Loader.js +1 -1
- package/build/components/DatePicker/DatePicker.js +3 -3
- package/build/components/DatePicker/customStyle.css +86 -0
- package/build/components/Footer/Footer.d.ts +0 -2
- package/build/components/Footer/Footer.js +3 -4
- package/build/components/Input/Input.js +2 -2
- package/build/components/OTPTimer/OTPTimer.js +1 -1
- package/build/components/Providers/ThemeProvider.d.ts +1 -1
- package/build/components/SimpleList/SimpleList.js +1 -1
- package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +1 -1
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +2 -2
- package/build/constants/app.d.ts +1 -2
- package/build/constants/app.js +1 -9
- package/build/features/app/bank/bankStore.d.ts +6 -2
- package/build/features/app/bank/bankStore.js +42 -5
- package/build/features/app/business/businessStore.d.ts +8 -10
- package/build/features/app/business/businessStore.js +42 -44
- package/build/features/app/connect/connectStore.d.ts +3 -8
- package/build/features/app/connect/connectStore.js +27 -61
- package/build/features/app/individual/individualStore.d.ts +7 -8
- package/build/features/app/individual/individualStore.js +53 -48
- package/build/features/app/password/passwordStore.d.ts +6 -2
- package/build/features/app/password/passwordStore.js +41 -5
- package/build/features/app/tax/taxStore.d.ts +6 -2
- package/build/features/app/tax/taxStore.js +43 -6
- package/build/features/bank/Bank.d.ts +1 -1
- package/build/features/bank/Bank.js +13 -12
- package/build/features/bank/screens/BankDetails/BankDetails.js +10 -9
- package/build/features/bank/screens/BankDetails/BankName.js +8 -8
- package/build/features/bank/screens/BankDetails/Beneficiary.js +7 -7
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +67 -0
- package/build/features/bank/screens/BankDetails/IBAN.js +8 -8
- package/build/features/bank/screens/BankDetails/validation.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/validation.js +3 -2
- package/build/features/bank/screens/Success/Success.js +3 -3
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -10
- package/build/features/bank/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/bank/screens/Verify/OTPInput.js +8 -3
- package/build/features/bank/screens/Verify/Verify.js +12 -11
- package/build/features/business/Business.d.ts +1 -1
- package/build/features/business/Business.js +13 -15
- package/build/features/business/screens/Activities/Activities.js +7 -7
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +1 -1
- package/build/features/business/screens/Activities/ActivitiesList.js +9 -9
- package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
- package/build/features/business/screens/Activities/SalesChannels.d.ts +1 -1
- package/build/features/business/screens/Activities/SalesChannels.js +7 -7
- package/build/features/business/screens/BusinessType/BusinessType.js +8 -8
- package/build/features/business/screens/BusinessType/LicenseList.js +10 -10
- package/build/features/business/screens/BusinessType/LicenseNumber.js +8 -8
- package/build/features/business/screens/BusinessType/SelectType.js +6 -6
- package/build/features/business/screens/BusinessType/validation.js +2 -2
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.js +8 -8
- package/build/features/business/screens/Customers/Customers.js +8 -8
- package/build/features/business/screens/Customers/ExpectedCustomers.js +6 -6
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +7 -7
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +2 -2
- package/build/features/business/screens/Customers/RefundPolicy.js +7 -7
- package/build/features/business/screens/Customers/TransactionPolicy.js +5 -5
- package/build/features/business/screens/IDBOD/DOB.js +5 -5
- package/build/features/business/screens/IDBOD/ID.js +6 -6
- package/build/features/business/screens/IDBOD/IDBOD.js +6 -6
- package/build/features/business/screens/OTP/OTP.js +9 -9
- package/build/features/business/screens/OTP/OTPInput.js +4 -4
- package/build/features/business/screens/Success/Success.js +3 -3
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -9
- package/build/features/business/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/business/screens/Verify/OTPInput.js +8 -3
- package/build/features/business/screens/Verify/Verify.js +12 -11
- package/build/features/connect/Connect.d.ts +1 -1
- package/build/features/connect/Connect.js +14 -16
- package/build/features/connect/screens/Individual/Email.js +7 -7
- package/build/features/connect/screens/Individual/Individual.js +9 -9
- package/build/features/connect/screens/Individual/MobileNumber.d.ts +1 -1
- package/build/features/connect/screens/Individual/MobileNumber.js +11 -11
- package/build/features/connect/screens/Individual/Name.js +6 -6
- package/build/features/connect/screens/Individual/validation.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.d.ts +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +8 -8
- package/build/features/connect/screens/Merchant/BrandName.js +12 -11
- package/build/features/connect/screens/Merchant/Merchant.js +7 -7
- package/build/features/connect/screens/Merchant/SocialMedia.js +9 -9
- package/build/features/connect/screens/Merchant/TAC.js +7 -7
- package/build/features/connect/screens/Merchant/validation.js +1 -1
- package/build/features/connect/screens/Mobile/Mobile.js +10 -10
- package/build/features/connect/screens/Mobile/MobileNumber.d.ts +1 -1
- package/build/features/connect/screens/Mobile/MobileNumber.js +12 -12
- package/build/features/connect/screens/Mobile/Title.js +2 -2
- package/build/features/connect/screens/NID/DOB.js +5 -5
- package/build/features/connect/screens/NID/IDNumber.js +8 -8
- package/build/features/connect/screens/NID/NID.js +9 -9
- package/build/features/connect/screens/OTP/OTP.js +9 -9
- package/build/features/connect/screens/OTP/OTPInput.js +4 -4
- package/build/features/connect/screens/ThankYou/ThankYou.js +3 -3
- package/build/features/featuresScreens.d.ts +1 -2
- package/build/features/featuresScreens.js +30 -37
- package/build/features/individual/Individual.d.ts +1 -1
- package/build/features/individual/Individual.js +13 -15
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +11 -9
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.js +8 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +6 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +6 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +9 -9
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +6 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +8 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -1
- package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.js +6 -6
- package/build/features/individual/screens/ShowIndividualInfo/info.js +1 -1
- package/build/features/individual/screens/Success/Success.js +3 -3
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -10
- package/build/features/individual/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/individual/screens/Verify/OTPInput.js +8 -3
- package/build/features/individual/screens/Verify/Verify.js +12 -11
- package/build/features/password/Password.d.ts +1 -1
- package/build/features/password/Password.js +13 -12
- package/build/features/password/screens/CreatePassword/ConditionText.js +1 -1
- package/build/features/password/screens/CreatePassword/ConfirmPassword.js +3 -3
- package/build/features/password/screens/CreatePassword/CreatePassword.js +7 -7
- package/build/features/password/screens/CreatePassword/Password.js +6 -6
- package/build/features/password/screens/Success/Success.js +3 -3
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -10
- package/build/features/password/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/password/screens/Verify/OTPInput.js +8 -3
- package/build/features/password/screens/Verify/Verify.js +12 -11
- package/build/features/shared/AcceptancePayouts/AcceptancePayouts.js +4 -4
- package/build/features/shared/Background/Background.js +3 -2
- package/build/features/shared/Background/LogoBackground.d.ts +1 -4
- package/build/features/shared/Background/LogoBackground.js +8 -39
- package/build/features/shared/Button/AbsherButton.d.ts +2 -3
- package/build/features/shared/Button/AbsherButton.js +7 -12
- package/build/features/shared/Button/Button.d.ts +1 -1
- package/build/features/shared/Button/Button.js +7 -7
- package/build/features/shared/Button/EmailProvidersButtons.d.ts +1 -1
- package/build/features/shared/Button/EmailProvidersButtons.js +4 -3
- package/build/features/shared/Button/FlowsButtons.d.ts +5 -2
- package/build/features/shared/Button/FlowsButtons.js +14 -9
- package/build/features/shared/Button/MobileButton.d.ts +2 -3
- package/build/features/shared/Button/MobileButton.js +7 -12
- package/build/features/shared/Button/SuccessButton.js +1 -1
- package/build/features/shared/Footer/Footer.js +5 -6
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/shared/Input/Input.js +2 -2
- package/build/features/shared/OTP/OTP.d.ts +3 -2
- package/build/features/shared/OTP/OTP.js +13 -5
- package/build/features/shared/Search/Search.js +1 -1
- package/build/features/shared/SearchIcon/SearchIcon.js +2 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.js +5 -5
- package/build/features/tax/Tax.d.ts +1 -1
- package/build/features/tax/Tax.js +13 -12
- package/build/features/tax/screens/Success/Success.js +3 -3
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -10
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +3 -0
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +66 -0
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +11 -8
- package/build/features/tax/screens/TaxDetails/VATId.js +18 -7
- package/build/features/tax/screens/TaxDetails/validation.d.ts +3 -0
- package/build/features/tax/screens/TaxDetails/validation.js +2 -1
- package/build/features/tax/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/tax/screens/Verify/OTPInput.js +8 -3
- package/build/features/tax/screens/Verify/Verify.js +12 -11
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useAppConfig.d.ts +1 -1
- package/build/hooks/useAppConfig.js +7 -4
- package/build/hooks/useAppDispatch.d.ts +0 -1
- package/build/hooks/useAppSelector.d.ts +1 -1
- package/build/hooks/useAppTheme.d.ts +1 -1
- package/build/hooks/useAppTheme.js +3 -3
- package/build/hooks/useErrorListener.d.ts +1 -1
- package/build/hooks/useErrorListener.js +5 -7
- package/build/hooks/useLanguage.js +1 -1
- package/build/hooks/useRedirectionListener.js +1 -1
- package/build/hooks/useStepStartedListener.d.ts +1 -0
- package/build/hooks/useStepStartedListener.js +10 -0
- package/build/i18n.js +1 -1
- package/build/index.css +135 -0
- package/build/index.d.ts +8 -9
- package/build/index.js +8 -11
- package/build/theme/theme.d.ts +1 -1
- package/build/utils/locale.d.ts +1 -1
- package/build/utils/locale.js +1 -1
- package/build/utils/rsa.js +1 -1
- package/build/utils/string.d.ts +2 -1
- package/build/utils/string.js +22 -3
- package/package.json +127 -127
- package/build/features/Landing/Landing.d.ts +0 -7
- package/build/features/Landing/Landing.js +0 -55
- package/build/features/Landing/index.d.ts +0 -1
- package/build/features/Landing/index.js +0 -1
- package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.d.ts +0 -5
- package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.js +0 -41
- package/build/features/Landing/screens/VerifyAndRedirect/index.d.ts +0 -2
- package/build/features/Landing/screens/VerifyAndRedirect/index.js +0 -2
- package/build/features/app/landing/landingStore.d.ts +0 -22
- package/build/features/app/landing/landingStore.js +0 -103
package/build/utils/string.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeviceInfo } from '
|
|
1
|
+
import { DeviceInfo } from '../@types';
|
|
2
2
|
export declare const maskPhone: (str?: string) => string;
|
|
3
3
|
export declare const maskID: (str: string) => string;
|
|
4
4
|
export declare const showLastFour: (str: string) => string;
|
|
@@ -37,3 +37,4 @@ export declare const getRequestHeaders: (deviceInfo: DeviceInfo) => {
|
|
|
37
37
|
};
|
|
38
38
|
export declare const removeRequestHeaders: () => void;
|
|
39
39
|
export declare const getBaseUrl: () => string;
|
|
40
|
+
export declare const getScreenNameBasedOnFlow: (flow: string) => "CONNECT_NID_STEP" | "" | "BUSINESS_BUSINESS_TYPE_STEP" | "INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP" | "BANK_BANK_DETAILS_STEP" | "TAX_TAX_DETAILS_STEP";
|
package/build/utils/string.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { FlowsTypes } from '../@types';
|
|
2
|
+
import { encryptString } from '.';
|
|
3
|
+
import { removeAxiosGlobalHeaders } from '../api';
|
|
4
|
+
import { ENDPOINT_PATHS } from '../constants';
|
|
4
5
|
export var maskPhone = function (str) {
|
|
5
6
|
if (str === void 0) { str = ''; }
|
|
6
7
|
var lastTwo = str.substring(str.length - 2, str.length);
|
|
@@ -134,3 +135,21 @@ export var getBaseUrl = function () {
|
|
|
134
135
|
}
|
|
135
136
|
return ENDPOINT_PATHS.PRODUCTION_BASE_URL;
|
|
136
137
|
};
|
|
138
|
+
export var getScreenNameBasedOnFlow = function (flow) {
|
|
139
|
+
if (flow === FlowsTypes.BANK) {
|
|
140
|
+
return 'BANK_BANK_DETAILS_STEP';
|
|
141
|
+
}
|
|
142
|
+
if (flow === FlowsTypes.BUSINESS) {
|
|
143
|
+
return 'BUSINESS_BUSINESS_TYPE_STEP';
|
|
144
|
+
}
|
|
145
|
+
if (flow === FlowsTypes.INDIVIDUAL) {
|
|
146
|
+
return 'INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP';
|
|
147
|
+
}
|
|
148
|
+
if (flow === FlowsTypes.CONNECT) {
|
|
149
|
+
return 'CONNECT_NID_STEP';
|
|
150
|
+
}
|
|
151
|
+
if (flow === FlowsTypes.TAX) {
|
|
152
|
+
return 'TAX_TAX_DETAILS_STEP';
|
|
153
|
+
}
|
|
154
|
+
return '';
|
|
155
|
+
};
|
package/package.json
CHANGED
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "connect library, auth",
|
|
5
|
-
"private": false,
|
|
6
|
-
"main": "build/index.js",
|
|
7
|
-
"module": "build/index.js",
|
|
8
|
-
"types": "build/index.d.ts",
|
|
9
|
-
"files": [
|
|
10
|
-
"build",
|
|
11
|
-
"README.md"
|
|
12
|
-
],
|
|
13
|
-
"scripts": {
|
|
14
|
-
"husky:setup": "npx husky install",
|
|
15
|
-
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
|
|
16
|
-
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
|
|
17
|
-
"lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
|
|
18
|
-
"lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
|
|
19
|
-
"start": "cross-env NODE_ENV=development webpack serve",
|
|
20
|
-
"build": "rm -rf build && cross-env NODE_ENV=production webpack",
|
|
21
|
-
"copy:files": "copyfiles -u 1 src/**/*.css build/",
|
|
22
|
-
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
23
|
-
"ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
|
|
24
|
-
"push": "npm publish --access public"
|
|
25
|
-
},
|
|
26
|
-
"keywords": [],
|
|
27
|
-
"author": {
|
|
28
|
-
"name": "Ahmed Elsharkawy",
|
|
29
|
-
"email": "a.elsharkawy@tap.company"
|
|
30
|
-
},
|
|
31
|
-
"license": "ISC",
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@babel/core": "^7.18.6",
|
|
34
|
-
"@babel/preset-env": "^7.18.6",
|
|
35
|
-
"@babel/preset-react": "^7.18.6",
|
|
36
|
-
"@babel/preset-typescript": "^7.18.6",
|
|
37
|
-
"@types/lodash-es": "^4.17.6",
|
|
38
|
-
"@types/moment-hijri": "^2.1.0",
|
|
39
|
-
"@types/react": "^18.0.15",
|
|
40
|
-
"@types/react-calendar": "~3.5.1",
|
|
41
|
-
"@types/react-dom": "^18.0.6",
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
43
|
-
"@typescript-eslint/parser": "^5.30.5",
|
|
44
|
-
"babel-loader": "^8.2.5",
|
|
45
|
-
"copyfiles": "^2.4.1",
|
|
46
|
-
"cross-env": "^7.0.3",
|
|
47
|
-
"css-loader": "^6.7.1",
|
|
48
|
-
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
49
|
-
"eslint": "^8.19.0",
|
|
50
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
51
|
-
"eslint-config-prettier": "^8.5.0",
|
|
52
|
-
"eslint-plugin-import": "^2.26.0",
|
|
53
|
-
"eslint-plugin-jsx-a11y": "^6.6.0",
|
|
54
|
-
"eslint-plugin-node": "^11.1.0",
|
|
55
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
56
|
-
"eslint-plugin-react": "^7.30.1",
|
|
57
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
58
|
-
"file-loader": "^6.2.0",
|
|
59
|
-
"fork-ts-checker-webpack-plugin": "^7.2.12",
|
|
60
|
-
"html-loader": "^3.1.2",
|
|
61
|
-
"html-webpack-plugin": "^5.5.0",
|
|
62
|
-
"husky": "^8.0.1",
|
|
63
|
-
"lint-staged": "^13.0.3",
|
|
64
|
-
"mini-css-extract-plugin": "^2.6.1",
|
|
65
|
-
"prettier": "^2.7.1",
|
|
66
|
-
"sass": "^1.53.0",
|
|
67
|
-
"sass-loader": "^13.0.2",
|
|
68
|
-
"style-loader": "^3.3.1",
|
|
69
|
-
"terser-webpack-plugin": "^5.3.3",
|
|
70
|
-
"tsc-alias": "^1.6.11",
|
|
71
|
-
"typescript": "^4.7.4",
|
|
72
|
-
"webpack": "^5.73.0",
|
|
73
|
-
"webpack-cli": "^4.10.0",
|
|
74
|
-
"webpack-dev-server": "^4.9.3",
|
|
75
|
-
"webpack-merge": "^5.8.0"
|
|
76
|
-
},
|
|
77
|
-
"dependencies": {
|
|
78
|
-
"@emotion/react": "^11.9.3",
|
|
79
|
-
"@emotion/styled": "^11.9.3",
|
|
80
|
-
"@fingerprintjs/fingerprintjs": "~3.3.4",
|
|
81
|
-
"@hookform/resolvers": "^2.9.6",
|
|
82
|
-
"@mui/icons-material": "^5.8.4",
|
|
83
|
-
"@mui/material": "^5.8.7",
|
|
84
|
-
"@reduxjs/toolkit": "^1.8.3",
|
|
85
|
-
"axios": "^0.27.2",
|
|
86
|
-
"device-detector-js": "^3.0.3",
|
|
87
|
-
"i18next": "^21.8.14",
|
|
88
|
-
"i18next-browser-languagedetector": "^6.1.4",
|
|
89
|
-
"i18next-http-backend": "^1.4.1",
|
|
90
|
-
"jsencrypt": "^3.2.1",
|
|
91
|
-
"lodash-es": "^4.17.21",
|
|
92
|
-
"moment-hijri": "~2.1.2",
|
|
93
|
-
"react": "^18.2.0",
|
|
94
|
-
"react-calendar": "~3.7.0",
|
|
95
|
-
"react-device-detect": "^2.2.2",
|
|
96
|
-
"react-dom": "^18.2.0",
|
|
97
|
-
"react-hook-form": "^7.33.1",
|
|
98
|
-
"react-i18next": "^11.18.1",
|
|
99
|
-
"react-otp-input": "^2.4.0",
|
|
100
|
-
"react-redux": "^8.0.2",
|
|
101
|
-
"react-spring-bottom-sheet": "^3.4.1",
|
|
102
|
-
"yup": "^0.32.11"
|
|
103
|
-
},
|
|
104
|
-
"peerDependencies": {
|
|
105
|
-
"react": "^18.2.0",
|
|
106
|
-
"react-dom": "^18.2.0"
|
|
107
|
-
},
|
|
108
|
-
"lint-staged": {
|
|
109
|
-
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
110
|
-
"yarn run prettier:fix",
|
|
111
|
-
"yarn run lint",
|
|
112
|
-
"git add ."
|
|
113
|
-
]
|
|
114
|
-
},
|
|
115
|
-
"browserslist": {
|
|
116
|
-
"production": [
|
|
117
|
-
">0.2%",
|
|
118
|
-
"not dead",
|
|
119
|
-
"not op_mini all"
|
|
120
|
-
],
|
|
121
|
-
"development": [
|
|
122
|
-
"last 1 chrome version",
|
|
123
|
-
"last 1 firefox version",
|
|
124
|
-
"last 1 safari version"
|
|
125
|
-
]
|
|
126
|
-
}
|
|
127
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
+
"version": "1.0.94-test",
|
|
4
|
+
"description": "connect library, auth",
|
|
5
|
+
"private": false,
|
|
6
|
+
"main": "build/index.js",
|
|
7
|
+
"module": "build/index.js",
|
|
8
|
+
"types": "build/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"build",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"husky:setup": "npx husky install",
|
|
15
|
+
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\" *.json *.js",
|
|
16
|
+
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\" *.json *.js",
|
|
17
|
+
"lint": "eslint src --color --ext .js,.jsx,.ts,.tsx,.json",
|
|
18
|
+
"lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
|
|
19
|
+
"start": "cross-env NODE_ENV=development webpack serve",
|
|
20
|
+
"build": "rm -rf build && cross-env NODE_ENV=production webpack",
|
|
21
|
+
"copy:files": "copyfiles -u 1 src/**/*.css build/",
|
|
22
|
+
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
23
|
+
"ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
|
|
24
|
+
"push": "npm publish --access public"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [],
|
|
27
|
+
"author": {
|
|
28
|
+
"name": "Ahmed Elsharkawy",
|
|
29
|
+
"email": "a.elsharkawy@tap.company"
|
|
30
|
+
},
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@babel/core": "^7.18.6",
|
|
34
|
+
"@babel/preset-env": "^7.18.6",
|
|
35
|
+
"@babel/preset-react": "^7.18.6",
|
|
36
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
37
|
+
"@types/lodash-es": "^4.17.6",
|
|
38
|
+
"@types/moment-hijri": "^2.1.0",
|
|
39
|
+
"@types/react": "^18.0.15",
|
|
40
|
+
"@types/react-calendar": "~3.5.1",
|
|
41
|
+
"@types/react-dom": "^18.0.6",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
43
|
+
"@typescript-eslint/parser": "^5.30.5",
|
|
44
|
+
"babel-loader": "^8.2.5",
|
|
45
|
+
"copyfiles": "^2.4.1",
|
|
46
|
+
"cross-env": "^7.0.3",
|
|
47
|
+
"css-loader": "^6.7.1",
|
|
48
|
+
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
49
|
+
"eslint": "^8.19.0",
|
|
50
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
51
|
+
"eslint-config-prettier": "^8.5.0",
|
|
52
|
+
"eslint-plugin-import": "^2.26.0",
|
|
53
|
+
"eslint-plugin-jsx-a11y": "^6.6.0",
|
|
54
|
+
"eslint-plugin-node": "^11.1.0",
|
|
55
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
56
|
+
"eslint-plugin-react": "^7.30.1",
|
|
57
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
58
|
+
"file-loader": "^6.2.0",
|
|
59
|
+
"fork-ts-checker-webpack-plugin": "^7.2.12",
|
|
60
|
+
"html-loader": "^3.1.2",
|
|
61
|
+
"html-webpack-plugin": "^5.5.0",
|
|
62
|
+
"husky": "^8.0.1",
|
|
63
|
+
"lint-staged": "^13.0.3",
|
|
64
|
+
"mini-css-extract-plugin": "^2.6.1",
|
|
65
|
+
"prettier": "^2.7.1",
|
|
66
|
+
"sass": "^1.53.0",
|
|
67
|
+
"sass-loader": "^13.0.2",
|
|
68
|
+
"style-loader": "^3.3.1",
|
|
69
|
+
"terser-webpack-plugin": "^5.3.3",
|
|
70
|
+
"tsc-alias": "^1.6.11",
|
|
71
|
+
"typescript": "^4.7.4",
|
|
72
|
+
"webpack": "^5.73.0",
|
|
73
|
+
"webpack-cli": "^4.10.0",
|
|
74
|
+
"webpack-dev-server": "^4.9.3",
|
|
75
|
+
"webpack-merge": "^5.8.0"
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@emotion/react": "^11.9.3",
|
|
79
|
+
"@emotion/styled": "^11.9.3",
|
|
80
|
+
"@fingerprintjs/fingerprintjs": "~3.3.4",
|
|
81
|
+
"@hookform/resolvers": "^2.9.6",
|
|
82
|
+
"@mui/icons-material": "^5.8.4",
|
|
83
|
+
"@mui/material": "^5.8.7",
|
|
84
|
+
"@reduxjs/toolkit": "^1.8.3",
|
|
85
|
+
"axios": "^0.27.2",
|
|
86
|
+
"device-detector-js": "^3.0.3",
|
|
87
|
+
"i18next": "^21.8.14",
|
|
88
|
+
"i18next-browser-languagedetector": "^6.1.4",
|
|
89
|
+
"i18next-http-backend": "^1.4.1",
|
|
90
|
+
"jsencrypt": "^3.2.1",
|
|
91
|
+
"lodash-es": "^4.17.21",
|
|
92
|
+
"moment-hijri": "~2.1.2",
|
|
93
|
+
"react": "^18.2.0",
|
|
94
|
+
"react-calendar": "~3.7.0",
|
|
95
|
+
"react-device-detect": "^2.2.2",
|
|
96
|
+
"react-dom": "^18.2.0",
|
|
97
|
+
"react-hook-form": "^7.33.1",
|
|
98
|
+
"react-i18next": "^11.18.1",
|
|
99
|
+
"react-otp-input": "^2.4.0",
|
|
100
|
+
"react-redux": "^8.0.2",
|
|
101
|
+
"react-spring-bottom-sheet": "^3.4.1",
|
|
102
|
+
"yup": "^0.32.11"
|
|
103
|
+
},
|
|
104
|
+
"peerDependencies": {
|
|
105
|
+
"react": "^18.2.0",
|
|
106
|
+
"react-dom": "^18.2.0"
|
|
107
|
+
},
|
|
108
|
+
"lint-staged": {
|
|
109
|
+
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
110
|
+
"yarn run prettier:fix",
|
|
111
|
+
"yarn run lint",
|
|
112
|
+
"git add ."
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
"browserslist": {
|
|
116
|
+
"production": [
|
|
117
|
+
">0.2%",
|
|
118
|
+
"not dead",
|
|
119
|
+
"not op_mini all"
|
|
120
|
+
],
|
|
121
|
+
"development": [
|
|
122
|
+
"last 1 chrome version",
|
|
123
|
+
"last 1 firefox version",
|
|
124
|
+
"last 1 safari version"
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { LibConfig } from '@src/@types';
|
|
3
|
-
export interface LandingProps extends LibConfig {
|
|
4
|
-
}
|
|
5
|
-
export declare function LandingLib(props: LandingProps): JSX.Element;
|
|
6
|
-
export declare function renderLandingLib(config: LandingProps, elementId: string): void;
|
|
7
|
-
export declare function unmountLandingLib(elementId: string): void;
|
|
@@ -1,55 +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 } from "react/jsx-runtime";
|
|
13
|
-
import React, { memo, useEffect } from 'react';
|
|
14
|
-
import { useAppTheme, useAppDispatch, useAppSelector, useErrorListener, useAppConfig } from '@hooks';
|
|
15
|
-
import { settingsSelector } from '@app/settings';
|
|
16
|
-
import { store } from '@app/store';
|
|
17
|
-
import { ReduxProvider, ThemeProvider } from '@components/Providers';
|
|
18
|
-
import Collapse from '@components/Collapse';
|
|
19
|
-
import { getParameterByName, reactElement } from '@utils';
|
|
20
|
-
import { LANDING_SCREENS_NAVIGATION } from '@constants';
|
|
21
|
-
import { landingFeatureScreens } from '../featuresScreens';
|
|
22
|
-
import { verifyAuthToken } from '@features/app/landing/landingStore';
|
|
23
|
-
var Landing = memo(function (props) {
|
|
24
|
-
var open = React.useState(true)[0];
|
|
25
|
-
var theme = useAppTheme().theme;
|
|
26
|
-
var dispatch = useAppDispatch();
|
|
27
|
-
var data = useAppSelector(settingsSelector).data;
|
|
28
|
-
var loading = useAppConfig(__assign({ navigation: LANDING_SCREENS_NAVIGATION }, props)).loading;
|
|
29
|
-
useErrorListener();
|
|
30
|
-
var activeScreen = data.activeScreen;
|
|
31
|
-
var verifyToken = function () {
|
|
32
|
-
var token = getParameterByName('token');
|
|
33
|
-
if (!token)
|
|
34
|
-
throw new Error('Auth token is not found!');
|
|
35
|
-
dispatch(verifyAuthToken(token));
|
|
36
|
-
};
|
|
37
|
-
useEffect(function () {
|
|
38
|
-
if (!loading)
|
|
39
|
-
verifyToken();
|
|
40
|
-
}, [loading]);
|
|
41
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: landingFeatureScreens.map(function (_a, index) {
|
|
42
|
-
var Element = _a.element, name = _a.name;
|
|
43
|
-
var isActive = activeScreen.name === name;
|
|
44
|
-
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
45
|
-
}) })));
|
|
46
|
-
});
|
|
47
|
-
export function LandingLib(props) {
|
|
48
|
-
return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Landing, __assign({}, props)) })));
|
|
49
|
-
}
|
|
50
|
-
export function renderLandingLib(config, elementId) {
|
|
51
|
-
reactElement(elementId).render(_jsx(LandingLib, __assign({}, config)));
|
|
52
|
-
}
|
|
53
|
-
export function unmountLandingLib(elementId) {
|
|
54
|
-
reactElement(elementId).unmount();
|
|
55
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Landing';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Landing';
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import Box from '@mui/material/Box/Box';
|
|
4
|
-
import { styled } from '@mui/material/styles';
|
|
5
|
-
import { settingsSelector } from '@app/settings';
|
|
6
|
-
import { landingSelector } from '@features/app/landing/landingStore';
|
|
7
|
-
import { useAppSelector } from '@hooks';
|
|
8
|
-
import Loader from '@components/AnimationFlow/Loader';
|
|
9
|
-
import Error from '@components/AnimationFlow/Error';
|
|
10
|
-
import { getParameterByName } from '@utils';
|
|
11
|
-
var ScreenContainerStyled = styled(Box)(function (_a) {
|
|
12
|
-
var theme = _a.theme;
|
|
13
|
-
return ({
|
|
14
|
-
display: 'flex',
|
|
15
|
-
justifyContent: 'center',
|
|
16
|
-
alignItems: 'center',
|
|
17
|
-
width: '100vw',
|
|
18
|
-
height: '100vh'
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
var VerifyAndRedirect = function (_a) {
|
|
22
|
-
var _b = useAppSelector(settingsSelector), sLoading = _b.loading, sError = _b.error;
|
|
23
|
-
var _c = useAppSelector(landingSelector), data = _c.data, error = _c.error, loading = _c.loading;
|
|
24
|
-
var isLoading = sLoading || loading;
|
|
25
|
-
var errorMessage = sError || error;
|
|
26
|
-
var token = getParameterByName('token');
|
|
27
|
-
var getFlowName = function (stepName) {
|
|
28
|
-
return stepName.split('_')[0];
|
|
29
|
-
};
|
|
30
|
-
React.useEffect(function () {
|
|
31
|
-
var step_name = (data.verify.responseBody || {}).step_name;
|
|
32
|
-
if (step_name) {
|
|
33
|
-
var flowName_1 = getFlowName(step_name);
|
|
34
|
-
setTimeout(function () {
|
|
35
|
-
window.location.href = "".concat(window.location.origin, "/").concat(flowName_1, "?token=").concat(token);
|
|
36
|
-
}, 300);
|
|
37
|
-
}
|
|
38
|
-
}, [data.verify.responseBody]);
|
|
39
|
-
return (_jsxs(ScreenContainerStyled, { children: [isLoading && _jsx(Loader, {}), errorMessage && _jsx(Error, { error: errorMessage })] }));
|
|
40
|
-
};
|
|
41
|
-
export default React.memo(VerifyAndRedirect);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { RootState } from '@store';
|
|
2
|
-
import { ResponseData, SharedState } from '@types';
|
|
3
|
-
export declare const verifyAuthToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
|
-
data: any;
|
|
5
|
-
token: string;
|
|
6
|
-
}, string, {}>;
|
|
7
|
-
declare type VerifyData = {
|
|
8
|
-
token: string;
|
|
9
|
-
};
|
|
10
|
-
export interface LandingData {
|
|
11
|
-
verify: ResponseData & VerifyData;
|
|
12
|
-
}
|
|
13
|
-
export interface LandingState extends SharedState<LandingData> {
|
|
14
|
-
}
|
|
15
|
-
export declare const landingSlice: import("@reduxjs/toolkit").Slice<LandingState, {
|
|
16
|
-
clearError: (state: LandingState) => void;
|
|
17
|
-
stopLoader: (state: LandingState) => void;
|
|
18
|
-
}, "landing/store">;
|
|
19
|
-
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
20
|
-
declare const _default: import("redux").Reducer<LandingState, import("redux").AnyAction>;
|
|
21
|
-
export default _default;
|
|
22
|
-
export declare const landingSelector: (state: RootState) => LandingState;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var _a;
|
|
38
|
-
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
39
|
-
import API from '@api';
|
|
40
|
-
export var verifyAuthToken = createAsyncThunk('verifyAuthToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
41
|
-
var payload, data;
|
|
42
|
-
return __generator(this, function (_a) {
|
|
43
|
-
switch (_a.label) {
|
|
44
|
-
case 0:
|
|
45
|
-
payload = {
|
|
46
|
-
service_name: 'tap_email',
|
|
47
|
-
verify_token: token
|
|
48
|
-
};
|
|
49
|
-
return [4, API.leadService.verifyLeadToken(payload)];
|
|
50
|
-
case 1:
|
|
51
|
-
data = (_a.sent()).data;
|
|
52
|
-
return [2, { data: data, token: token }];
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}); });
|
|
56
|
-
var initialState = {
|
|
57
|
-
error: null,
|
|
58
|
-
loading: false,
|
|
59
|
-
data: {
|
|
60
|
-
verify: {
|
|
61
|
-
token: ''
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
export var landingSlice = createSlice({
|
|
66
|
-
name: 'landing/store',
|
|
67
|
-
initialState: initialState,
|
|
68
|
-
reducers: {
|
|
69
|
-
clearError: function (state) {
|
|
70
|
-
state.error = null;
|
|
71
|
-
},
|
|
72
|
-
stopLoader: function (state) {
|
|
73
|
-
state.loading = false;
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
extraReducers: function (builder) {
|
|
77
|
-
builder
|
|
78
|
-
.addCase(verifyAuthToken.fulfilled, function (state, action) {
|
|
79
|
-
var _a;
|
|
80
|
-
state.loading = false;
|
|
81
|
-
state.error = null;
|
|
82
|
-
var _b = action.payload, data = _b.data, token = _b.token;
|
|
83
|
-
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
84
|
-
if (description) {
|
|
85
|
-
state.error = description;
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
state.data.verify.responseBody = data;
|
|
89
|
-
state.data.verify.token = token;
|
|
90
|
-
})
|
|
91
|
-
.addCase(verifyAuthToken.rejected, function (state, action) {
|
|
92
|
-
state.error = action.error.message;
|
|
93
|
-
state.loading = false;
|
|
94
|
-
})
|
|
95
|
-
.addCase(verifyAuthToken.pending, function (state) {
|
|
96
|
-
state.loading = true;
|
|
97
|
-
state.error = null;
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
export var clearError = (_a = landingSlice.actions, _a.clearError), stopLoader = _a.stopLoader;
|
|
102
|
-
export default landingSlice.reducer;
|
|
103
|
-
export var landingSelector = function (state) { return state.landing; };
|