@tap-payments/auth-jsconnect 2.11.0-development → 2.11.0
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 +2 -2
- package/build/@types/terminal.d.ts +32 -44
- package/build/api/account.d.ts +2 -2
- package/build/api/account.js +7 -4
- package/build/api/auth.d.ts +8 -2
- package/build/api/auth.js +7 -3
- package/build/api/axios.d.ts +1 -1
- package/build/api/headers.d.ts +5 -0
- package/build/api/headers.js +3 -0
- package/build/api/index.d.ts +6 -6
- package/build/api/operator.d.ts +1 -1
- package/build/api/operator.js +5 -2
- package/build/api/terminal.d.ts +3 -6
- package/build/api/terminal.js +22 -12
- package/build/assets/currencies/AEDSymbol.js +1 -1
- package/build/assets/currencies/SARSymbol.js +1 -1
- package/build/assets/locales/ar.json +5 -0
- package/build/assets/locales/en.json +8 -2
- package/build/components/DeviceCard/DeviceCard.d.ts +3 -2
- package/build/components/DeviceCard/DeviceCard.js +9 -10
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/components/TruncatedTooltipText/TruncatedTooltipText.d.ts +7 -0
- package/build/components/TruncatedTooltipText/TruncatedTooltipText.js +33 -0
- package/build/components/TruncatedTooltipText/index.d.ts +2 -0
- package/build/components/TruncatedTooltipText/index.js +2 -0
- package/build/constants/api.d.ts +2 -0
- package/build/constants/api.js +4 -0
- package/build/constants/app.d.ts +4 -2
- package/build/constants/app.js +137 -38
- package/build/constants/flows.d.ts +2 -1
- package/build/constants/flows.js +2 -1
- package/build/features/app/auth/authStore.js +64 -54
- package/build/features/app/bank/bankStore.js +24 -20
- package/build/features/app/board/boardStore.js +11 -7
- package/build/features/app/brand/brandStore.js +22 -18
- package/build/features/app/business/businessStore.js +30 -26
- package/build/features/app/connect/connectStore.d.ts +6 -5
- package/build/features/app/connect/connectStore.js +48 -31
- package/build/features/app/connectExpress/connectExpressStore.d.ts +6 -5
- package/build/features/app/connectExpress/connectExpressStore.js +42 -16
- package/build/features/app/entity/entityStore.js +21 -17
- package/build/features/app/individual/individualStore.js +34 -28
- package/build/features/app/password/passwordStore.js +44 -46
- package/build/features/app/signIn/signInStore.js +12 -16
- package/build/features/app/tax/taxStore.js +20 -16
- package/build/features/app/terminal/terminalStore.d.ts +7 -7
- package/build/features/app/terminal/terminalStore.js +89 -62
- package/build/features/auth/Auth.d.ts +1 -1
- package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +10 -7
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +4 -1
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.js +6 -4
- package/build/features/auth/screens/AuthenticationList/EntityList.js +9 -1
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +1 -1
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -3
- package/build/features/business/screens/BusinessType/LicenseList.js +5 -5
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +1 -1
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +10 -10
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +4 -1
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +6 -4
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +9 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +6 -11
- package/build/features/connectExpress/screens/Mobile/Mobile.js +7 -6
- package/build/features/entity/screens/EntityName/EntityName.js +14 -14
- package/build/features/entity/screens/EntityName/validation.d.ts +47 -45
- package/build/features/entity/screens/EntityName/validation.js +99 -95
- package/build/features/featuresScreens.js +63 -3
- package/build/features/shared/OTPVerifySecurityError/OTPVerifySecurityError.js +9 -0
- package/build/features/shared/OTPVerifySecurityError/index.d.ts +2 -0
- package/build/features/shared/OTPVerifySecurityError/index.js +2 -0
- package/build/features/terminal/Terminal.js +2 -2
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +8 -9
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +5 -6
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +9 -9
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +59 -14
- package/build/features/terminal/screens/POSDeviceListPage/POSDeviceListPage.d.ts +3 -0
- package/build/features/terminal/screens/{TerminalListPage/TerminalListPage.js → POSDeviceListPage/POSDeviceListPage.js} +13 -10
- package/build/features/terminal/screens/POSDeviceListPage/index.d.ts +2 -0
- package/build/features/terminal/screens/POSDeviceListPage/index.js +2 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +3 -3
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +2 -2
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +15 -15
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +5 -7
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +12 -11
- package/build/features/terminal/screens/Verify/Verify.js +6 -2
- package/build/features/terminal/screens/shared/POSDeviceList.d.ts +11 -0
- package/build/features/terminal/screens/shared/POSDeviceList.js +30 -0
- package/build/features/terminal/screens/shared/index.d.ts +2 -2
- package/build/features/terminal/screens/shared/index.js +2 -2
- package/build/features/terminal/screens/shared/styles.d.ts +1 -1
- package/build/features/terminal/screens/shared/styles.js +1 -1
- package/build/features/terminal/screens/shared/utils.d.ts +4 -4
- package/build/features/terminal/screens/shared/utils.js +9 -9
- package/build/utils/common.js +13 -6
- package/build/utils/error.d.ts +3 -0
- package/build/utils/error.js +9 -0
- package/build/utils/string.d.ts +1 -0
- package/build/utils/string.js +1 -0
- package/build/utils/validation.js +1 -1
- package/package.json +3 -3
- package/build/features/terminal/screens/TerminalListPage/index.d.ts +0 -2
- package/build/features/terminal/screens/TerminalListPage/index.js +0 -2
- package/build/features/terminal/screens/shared/TerminalList.d.ts +0 -11
- package/build/features/terminal/screens/shared/TerminalList.js +0 -25
- /package/build/features/{terminal/screens/TerminalListPage/TerminalListPage.d.ts → shared/OTPVerifySecurityError/OTPVerifySecurityError.d.ts} +0 -0
package/build/utils/error.js
CHANGED
|
@@ -7,3 +7,12 @@ export var isTokenExpired = function (error) {
|
|
|
7
7
|
export var isTimeoutError = function (error) {
|
|
8
8
|
return (error || '').trim().toLowerCase().includes('timeout');
|
|
9
9
|
};
|
|
10
|
+
export var isInternalServerError = function (error) {
|
|
11
|
+
return ['internal_server_error'].includes((error || '').trim().toLowerCase());
|
|
12
|
+
};
|
|
13
|
+
export var isAuthenticationVerificationFailed = function (error) {
|
|
14
|
+
return ['failed to verify the auth'].includes((error || '').trim().toLowerCase());
|
|
15
|
+
};
|
|
16
|
+
export var isNoDataFoundError = function (error) {
|
|
17
|
+
return ['no data found'].includes((error || '').trim().toLowerCase());
|
|
18
|
+
};
|
package/build/utils/string.d.ts
CHANGED
|
@@ -79,3 +79,4 @@ 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
81
|
export declare function formatCode(code: string, chunkSize?: number, delimiter?: string): string;
|
|
82
|
+
export declare const isDisasterRecoveryEnv: (type?: string) => boolean;
|
package/build/utils/string.js
CHANGED
|
@@ -355,3 +355,4 @@ export function formatCode(code, chunkSize, delimiter) {
|
|
|
355
355
|
if (delimiter === void 0) { delimiter = ' - '; }
|
|
356
356
|
return ((_a = code.match(new RegExp(".{1,".concat(chunkSize, "}"), 'g'))) === null || _a === void 0 ? void 0 : _a.join(delimiter)) || code;
|
|
357
357
|
}
|
|
358
|
+
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.11.0
|
|
3
|
+
"version": "2.11.0",
|
|
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",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TerminalInfo } from '../../../../@types';
|
|
3
|
-
interface TerminalListProps {
|
|
4
|
-
selectedTerminal: TerminalInfo;
|
|
5
|
-
list: TerminalInfo[];
|
|
6
|
-
select?: boolean;
|
|
7
|
-
loading?: boolean;
|
|
8
|
-
onClick: (device: TerminalInfo) => void;
|
|
9
|
-
}
|
|
10
|
-
declare const _default: React.MemoExoticComponent<({ list, onClick, selectedTerminal, select, loading }: TerminalListProps) => JSX.Element>;
|
|
11
|
-
export default _default;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { ICONS_NAMES } from '../../../../constants';
|
|
5
|
-
import Icon from '../../../../components/Icon';
|
|
6
|
-
import Loader from '../../../../components/Loader';
|
|
7
|
-
import { getTerminalId, getTerminalIdLabel, getTerminalName } from './utils';
|
|
8
|
-
import { ListContainer, TerminalListContainer, TitleContainer, Image, Title, ScrollContainer, ListItem, StyledRadio, ArrowIcon } from './styles';
|
|
9
|
-
var TerminalList = function (_a) {
|
|
10
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
11
|
-
var list = _a.list, onClick = _a.onClick, selectedTerminal = _a.selectedTerminal, _k = _a.select, select = _k === void 0 ? true : _k, loading = _a.loading;
|
|
12
|
-
var t = useTranslation().t;
|
|
13
|
-
var platformImage = ((_d = (_c = (_b = list === null || list === void 0 ? void 0 : list[0]) === null || _b === void 0 ? void 0 : _b.platform) === null || _c === void 0 ? void 0 : _c.brand) === null || _d === void 0 ? void 0 : _d.logo) || ICONS_NAMES.platform_image;
|
|
14
|
-
var platformName = (_j = (_h = (_g = (_f = (_e = list === null || list === void 0 ? void 0 : list[0]) === null || _e === void 0 ? void 0 : _e.platform) === null || _f === void 0 ? void 0 : _f.brand) === null || _g === void 0 ? void 0 : _g.name) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.text;
|
|
15
|
-
var getEndComponent = function (terminal) {
|
|
16
|
-
if (loading && (selectedTerminal === null || selectedTerminal === void 0 ? void 0 : selectedTerminal.id) === (terminal === null || terminal === void 0 ? void 0 : terminal.id))
|
|
17
|
-
return _jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 10, style: { height: 24, width: 24 }, toggleAnimation: !!loading });
|
|
18
|
-
if (select)
|
|
19
|
-
return (_jsx(StyledRadio, { sx: { paddingInlineEnd: 0 }, disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, onChange: function () { return onClick(terminal); }, checkedIcon: _jsx(Icon, { src: ICONS_NAMES.radio_checked }), checked: (selectedTerminal === null || selectedTerminal === void 0 ? void 0 : selectedTerminal.id) === terminal.id }));
|
|
20
|
-
if (!select)
|
|
21
|
-
return _jsx(ArrowIcon, {});
|
|
22
|
-
};
|
|
23
|
-
return (_jsxs(ListContainer, { children: [_jsxs(TitleContainer, { children: [_jsx(Image, { src: platformImage, alt: 'Device' }), _jsx(Title, { children: t('terminal_devices', { name: platformName }) })] }), _jsx(ScrollContainer, { children: _jsx(TerminalListContainer, { children: (list || []).map(function (terminal, index) { return (_jsx(ListItem, { sx: { minHeight: 'unset' }, onClick: function () { return onClick(terminal); }, name: getTerminalName(terminal), deviceId: getTerminalId(terminal), deviceIdLabel: getTerminalIdLabel(terminal), endAdornment: getEndComponent(terminal) }, index)); }) }) })] }));
|
|
24
|
-
};
|
|
25
|
-
export default memo(TerminalList);
|