@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.
Files changed (105) hide show
  1. package/build/@types/form.d.ts +2 -2
  2. package/build/@types/terminal.d.ts +32 -44
  3. package/build/api/account.d.ts +2 -2
  4. package/build/api/account.js +7 -4
  5. package/build/api/auth.d.ts +8 -2
  6. package/build/api/auth.js +7 -3
  7. package/build/api/axios.d.ts +1 -1
  8. package/build/api/headers.d.ts +5 -0
  9. package/build/api/headers.js +3 -0
  10. package/build/api/index.d.ts +6 -6
  11. package/build/api/operator.d.ts +1 -1
  12. package/build/api/operator.js +5 -2
  13. package/build/api/terminal.d.ts +3 -6
  14. package/build/api/terminal.js +22 -12
  15. package/build/assets/currencies/AEDSymbol.js +1 -1
  16. package/build/assets/currencies/SARSymbol.js +1 -1
  17. package/build/assets/locales/ar.json +5 -0
  18. package/build/assets/locales/en.json +8 -2
  19. package/build/components/DeviceCard/DeviceCard.d.ts +3 -2
  20. package/build/components/DeviceCard/DeviceCard.js +9 -10
  21. package/build/components/Tooltip/Tooltip.js +1 -1
  22. package/build/components/TruncatedTooltipText/TruncatedTooltipText.d.ts +7 -0
  23. package/build/components/TruncatedTooltipText/TruncatedTooltipText.js +33 -0
  24. package/build/components/TruncatedTooltipText/index.d.ts +2 -0
  25. package/build/components/TruncatedTooltipText/index.js +2 -0
  26. package/build/constants/api.d.ts +2 -0
  27. package/build/constants/api.js +4 -0
  28. package/build/constants/app.d.ts +4 -2
  29. package/build/constants/app.js +137 -38
  30. package/build/constants/flows.d.ts +2 -1
  31. package/build/constants/flows.js +2 -1
  32. package/build/features/app/auth/authStore.js +64 -54
  33. package/build/features/app/bank/bankStore.js +24 -20
  34. package/build/features/app/board/boardStore.js +11 -7
  35. package/build/features/app/brand/brandStore.js +22 -18
  36. package/build/features/app/business/businessStore.js +30 -26
  37. package/build/features/app/connect/connectStore.d.ts +6 -5
  38. package/build/features/app/connect/connectStore.js +48 -31
  39. package/build/features/app/connectExpress/connectExpressStore.d.ts +6 -5
  40. package/build/features/app/connectExpress/connectExpressStore.js +42 -16
  41. package/build/features/app/entity/entityStore.js +21 -17
  42. package/build/features/app/individual/individualStore.js +34 -28
  43. package/build/features/app/password/passwordStore.js +44 -46
  44. package/build/features/app/signIn/signInStore.js +12 -16
  45. package/build/features/app/tax/taxStore.js +20 -16
  46. package/build/features/app/terminal/terminalStore.d.ts +7 -7
  47. package/build/features/app/terminal/terminalStore.js +89 -62
  48. package/build/features/auth/Auth.d.ts +1 -1
  49. package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +10 -7
  50. package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +4 -1
  51. package/build/features/auth/screens/AuthenticationList/EntityLicenseType.js +6 -4
  52. package/build/features/auth/screens/AuthenticationList/EntityList.js +9 -1
  53. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +1 -1
  54. package/build/features/business/screens/BusinessType/BusinessType.js +2 -3
  55. package/build/features/business/screens/BusinessType/LicenseList.js +5 -5
  56. package/build/features/business/screens/Customers/RefundPolicy.d.ts +1 -1
  57. package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +10 -10
  58. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +4 -1
  59. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +6 -4
  60. package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +9 -1
  61. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +6 -11
  62. package/build/features/connectExpress/screens/Mobile/Mobile.js +7 -6
  63. package/build/features/entity/screens/EntityName/EntityName.js +14 -14
  64. package/build/features/entity/screens/EntityName/validation.d.ts +47 -45
  65. package/build/features/entity/screens/EntityName/validation.js +99 -95
  66. package/build/features/featuresScreens.js +63 -3
  67. package/build/features/shared/OTPVerifySecurityError/OTPVerifySecurityError.js +9 -0
  68. package/build/features/shared/OTPVerifySecurityError/index.d.ts +2 -0
  69. package/build/features/shared/OTPVerifySecurityError/index.js +2 -0
  70. package/build/features/terminal/Terminal.js +2 -2
  71. package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +8 -9
  72. package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +5 -6
  73. package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +9 -9
  74. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +59 -14
  75. package/build/features/terminal/screens/POSDeviceListPage/POSDeviceListPage.d.ts +3 -0
  76. package/build/features/terminal/screens/{TerminalListPage/TerminalListPage.js → POSDeviceListPage/POSDeviceListPage.js} +13 -10
  77. package/build/features/terminal/screens/POSDeviceListPage/index.d.ts +2 -0
  78. package/build/features/terminal/screens/POSDeviceListPage/index.js +2 -0
  79. package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
  80. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +3 -3
  81. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +2 -2
  82. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +15 -15
  83. package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +5 -7
  84. package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +12 -11
  85. package/build/features/terminal/screens/Verify/Verify.js +6 -2
  86. package/build/features/terminal/screens/shared/POSDeviceList.d.ts +11 -0
  87. package/build/features/terminal/screens/shared/POSDeviceList.js +30 -0
  88. package/build/features/terminal/screens/shared/index.d.ts +2 -2
  89. package/build/features/terminal/screens/shared/index.js +2 -2
  90. package/build/features/terminal/screens/shared/styles.d.ts +1 -1
  91. package/build/features/terminal/screens/shared/styles.js +1 -1
  92. package/build/features/terminal/screens/shared/utils.d.ts +4 -4
  93. package/build/features/terminal/screens/shared/utils.js +9 -9
  94. package/build/utils/common.js +13 -6
  95. package/build/utils/error.d.ts +3 -0
  96. package/build/utils/error.js +9 -0
  97. package/build/utils/string.d.ts +1 -0
  98. package/build/utils/string.js +1 -0
  99. package/build/utils/validation.js +1 -1
  100. package/package.json +3 -3
  101. package/build/features/terminal/screens/TerminalListPage/index.d.ts +0 -2
  102. package/build/features/terminal/screens/TerminalListPage/index.js +0 -2
  103. package/build/features/terminal/screens/shared/TerminalList.d.ts +0 -11
  104. package/build/features/terminal/screens/shared/TerminalList.js +0 -25
  105. /package/build/features/{terminal/screens/TerminalListPage/TerminalListPage.d.ts → shared/OTPVerifySecurityError/OTPVerifySecurityError.d.ts} +0 -0
@@ -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
+ };
@@ -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;
@@ -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(\.\w+)?\.tap\.company$/;
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-development",
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 --tag development"
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": "^0.27.2",
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,2 +0,0 @@
1
- import TerminalListPage from './TerminalListPage';
2
- export default TerminalListPage;
@@ -1,2 +0,0 @@
1
- import TerminalListPage from './TerminalListPage';
2
- export default TerminalListPage;
@@ -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);