@tap-payments/auth-jsconnect 2.10.8-beta → 2.10.8
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 +2 -2
- package/build/@types/app.d.ts +8 -1
- package/build/@types/app.js +7 -0
- package/build/@types/form.d.ts +5 -0
- package/build/api/auth.d.ts +1 -0
- package/build/api/axios.d.ts +1 -1
- package/build/api/entity.d.ts +3 -0
- package/build/api/lead.d.ts +1 -0
- package/build/app/settings.d.ts +1 -0
- package/build/app/settings.js +8 -5
- package/build/assets/currencies/AEDSymbol.d.ts +7 -0
- package/build/assets/currencies/AEDSymbol.js +28 -0
- package/build/assets/currencies/SARSymbol.d.ts +7 -0
- package/build/assets/currencies/SARSymbol.js +28 -0
- package/build/assets/currencies/index.d.ts +2 -0
- package/build/assets/currencies/index.js +2 -0
- package/build/assets/currencies/utils.d.ts +4 -0
- package/build/assets/currencies/utils.js +6 -0
- package/build/assets/locales/ar.json +52 -7
- package/build/assets/locales/en.json +55 -9
- package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
- package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
- package/build/components/TextWithCurrency/index.d.ts +2 -0
- package/build/components/TextWithCurrency/index.js +2 -0
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +12 -0
- package/build/constants/app.js +48 -15
- package/build/constants/assets.d.ts +12 -3
- package/build/constants/assets.js +123 -105
- package/build/constants/dummy.js +27 -20
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/auth/authStore.d.ts +24 -5
- package/build/features/app/auth/authStore.js +136 -71
- package/build/features/app/business/businessStore.js +15 -10
- package/build/features/app/connectExpress/connectExpressStore.d.ts +14 -3
- package/build/features/app/connectExpress/connectExpressStore.js +212 -53
- package/build/features/app/tax/taxStore.js +1 -1
- package/build/features/auth/Auth.d.ts +1 -1
- package/build/features/auth/screens/AuthenticationList/EntityList.js +2 -2
- package/build/features/auth/screens/OTP/OTP.d.ts +13 -2
- package/build/features/auth/screens/OTP/OTP.js +15 -3
- package/build/features/auth/screens/OTP/index.d.ts +1 -2
- package/build/features/auth/screens/Passcode/Passcode.d.ts +16 -0
- package/build/features/auth/screens/Passcode/Passcode.js +82 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.d.ts +6 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.js +42 -0
- package/build/features/auth/screens/Passcode/index.d.ts +2 -0
- package/build/features/auth/screens/Passcode/index.js +2 -0
- package/build/features/auth/screens/Passcode/validation.d.ts +8 -0
- package/build/features/auth/screens/Passcode/validation.js +4 -0
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -8
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +1 -1
- package/build/features/business/screens/BusinessType/BusinessType.js +13 -2
- package/build/features/business/screens/BusinessType/EntityLicenseList.js +11 -5
- package/build/features/business/screens/BusinessType/LicenseList.js +15 -7
- package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +35 -0
- package/build/features/business/screens/BusinessType/UnifiedNumber.js +84 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +6 -3
- package/build/features/business/screens/BusinessType/validation.js +31 -10
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -8
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +1 -1
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +23 -7
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +36 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.js +81 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +6 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +57 -21
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.d.ts +3 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.js +9 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.d.ts +2 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.js +2 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.js +49 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.js +88 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.d.ts +3 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.js +2 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.js +4 -0
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +9 -3
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +3 -7
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +3 -7
- package/build/features/entity/screens/EntityName/EntityName.js +16 -15
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
- package/build/features/entity/screens/EntityName/validation.d.ts +50 -48
- package/build/features/entity/screens/EntityName/validation.js +100 -85
- package/build/features/featuresScreens.js +10 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/shared/Background/LogoBackground.js +5 -17
- package/build/features/shared/Button/Button.js +1 -2
- package/build/features/shared/Button/FlowsButtons.js +1 -2
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/hooks/useAppConfig.js +1 -1
- package/build/utils/common.d.ts +1 -1
- package/build/utils/common.js +14 -8
- package/build/utils/string.d.ts +3 -2
- package/build/utils/string.js +4 -1
- package/build/utils/validation.js +1 -1
- package/package.json +4 -5
package/build/utils/common.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { axiosInstance } from '../api';
|
|
2
|
-
import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL,
|
|
2
|
+
import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_PROD_URL } from '../constants';
|
|
3
3
|
import { objectHasValues } from './object';
|
|
4
|
-
import { isSA } from './string';
|
|
4
|
+
import { isDisasterRecoveryEnv, isSA } from './string';
|
|
5
5
|
export var sleep = function (milliseconds) {
|
|
6
6
|
if (milliseconds === void 0) { milliseconds = 1000; }
|
|
7
7
|
return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
|
|
@@ -12,14 +12,20 @@ export var dangerousMessage = function (message, callBack) {
|
|
|
12
12
|
}
|
|
13
13
|
callBack === null || callBack === void 0 ? void 0 : callBack({ message: message });
|
|
14
14
|
};
|
|
15
|
-
export var setBaseUrl = function (publicKey,
|
|
16
|
-
if (
|
|
15
|
+
export var setBaseUrl = function (publicKey, region) {
|
|
16
|
+
if (region === void 0) { region = ''; }
|
|
17
17
|
var isProd = publicKey.includes('pk_live');
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
var _a = region.split('-'), country = _a[0], envType = _a[1];
|
|
19
|
+
if (!isProd) {
|
|
20
|
+
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
|
|
20
21
|
return;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
+
if (isSA(country)) {
|
|
24
|
+
axiosInstance.defaults.baseURL = isDisasterRecoveryEnv(envType) ? ENDPOINT_PATHS.PRODUCTION_BASE_URL_SA_DR : ENDPOINT_PATHS.PRODUCTION_BASE_URL_SA;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.PRODUCTION_BASE_URL;
|
|
28
|
+
}
|
|
23
29
|
};
|
|
24
30
|
export var updateLocationUrlWithCountry = function (countryIso2) {
|
|
25
31
|
var country = countryIso2.toLowerCase();
|
|
@@ -38,7 +44,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
|
|
|
38
44
|
window.history.replaceState({}, '', newUrl);
|
|
39
45
|
};
|
|
40
46
|
export var openConnect = function (pk, countryCode) {
|
|
41
|
-
var newUrl = new URL(pk.includes('pk_live') ?
|
|
47
|
+
var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_SANDBOX_URL);
|
|
42
48
|
if (countryCode) {
|
|
43
49
|
newUrl.pathname = "/".concat(countryCode.toLowerCase());
|
|
44
50
|
}
|
package/build/utils/string.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export declare const getBaseUrl: () => string;
|
|
|
46
46
|
export declare const getScreenNameBasedOnFlow: (flow: string, isAuthorizedUser?: boolean, isOtherThanSAOrKWCountry?: boolean) => "CONNECT_NID_STEP" | "" | "BUSINESS_BUSINESS_TYPE_STEP" | "INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP" | "INDIVIDUAL_LIST_STEP" | "PASSWORD_CREATE_PASSWORD_STEP" | "BANK_BANK_DETAILS_STEP" | "TAX_TAX_DETAILS_STEP" | "ENTITY_NAME_STEP" | "BRAND_INFO_STEP";
|
|
47
47
|
export declare const getEighteenYearsAgo: () => string;
|
|
48
48
|
export declare const isKW: (flag: string) => boolean;
|
|
49
|
-
export declare const isSA: (flag: string) => boolean;
|
|
49
|
+
export declare const isSA: (flag: string | undefined) => boolean;
|
|
50
50
|
export declare const isOtherThanKWOrSA: (flag: string) => boolean;
|
|
51
51
|
export declare const isKWOrSA: (flag: string) => boolean;
|
|
52
52
|
export declare const isLinkedIn: (flag: string) => boolean;
|
|
@@ -75,6 +75,7 @@ export declare const getFileType: (type: string) => "" | "image/jpeg" | "image/p
|
|
|
75
75
|
export declare const isStringHasOneAsterisk: (value: string) => boolean;
|
|
76
76
|
export declare const isOtherLicense: (item?: License) => boolean;
|
|
77
77
|
export declare const formatNumberAsCurrency: (number: string) => string;
|
|
78
|
-
export declare const getCurrencyByCountryIso2: (countryCode
|
|
78
|
+
export declare const getCurrencyByCountryIso2: (countryCode?: string) => string;
|
|
79
79
|
export declare const getMobileNumberLen: (initialLen: number, number: string) => number;
|
|
80
80
|
export declare const getWebsiteLink: (isAr: boolean, countryCode: string, path: string) => string;
|
|
81
|
+
export declare const isDisasterRecoveryEnv: (type?: string) => boolean;
|
package/build/utils/string.js
CHANGED
|
@@ -214,7 +214,9 @@ export var isKW = function (flag) {
|
|
|
214
214
|
return ['kw', 'kwd'].includes(flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
215
215
|
};
|
|
216
216
|
export var isSA = function (flag) {
|
|
217
|
-
|
|
217
|
+
if (!flag)
|
|
218
|
+
return false;
|
|
219
|
+
return ['sa', 'sau'].includes(flag.toLowerCase());
|
|
218
220
|
};
|
|
219
221
|
export var isOtherThanKWOrSA = function (flag) {
|
|
220
222
|
return !isKW(flag) && !isSA(flag);
|
|
@@ -344,3 +346,4 @@ export var getWebsiteLink = function (isAr, countryCode, path) {
|
|
|
344
346
|
var language = isAr ? LANGUAGE_ABBREVIATIONS.ARABIC : LANGUAGE_ABBREVIATIONS.ENGLISH;
|
|
345
347
|
return TAP_WEBSITE + language + '-' + countryCode + path;
|
|
346
348
|
};
|
|
349
|
+
export var isDisasterRecoveryEnv = function (type) { return type === 'dr'; };
|
|
@@ -53,7 +53,7 @@ export var keepLettersAndSpace = function (str) {
|
|
|
53
53
|
return str.replace(/[^a-zA-Z] /g, '');
|
|
54
54
|
};
|
|
55
55
|
export var isConnectTapDomain = function (domain) {
|
|
56
|
-
var regex = /^(https:\/\/)?connect(
|
|
56
|
+
var regex = /^(https:\/\/)?connect((\.|-)\w+)?\.tap\.(company|com\.\w{2})$/;
|
|
57
57
|
return regex.test(domain);
|
|
58
58
|
};
|
|
59
59
|
export var isTapDomain = function (domain) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "2.10.8
|
|
3
|
+
"version": "2.10.8",
|
|
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
|
|
24
|
+
"push": "npm publish --access public"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [],
|
|
27
27
|
"author": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@mui/icons-material": "^5.8.4",
|
|
83
83
|
"@mui/material": "^5.8.7",
|
|
84
84
|
"@reduxjs/toolkit": "^1.8.3",
|
|
85
|
-
"axios": "^
|
|
85
|
+
"axios": "^1.11.0",
|
|
86
86
|
"device-detector-js": "^3.0.3",
|
|
87
87
|
"i18next": "^21.8.14",
|
|
88
88
|
"i18next-browser-languagedetector": "^6.1.4",
|
|
@@ -112,8 +112,7 @@
|
|
|
112
112
|
"lint-staged": {
|
|
113
113
|
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
114
114
|
"yarn run prettier:fix",
|
|
115
|
-
"yarn run lint"
|
|
116
|
-
"git add ."
|
|
115
|
+
"yarn run lint"
|
|
117
116
|
]
|
|
118
117
|
},
|
|
119
118
|
"browserslist": {
|