@tap-payments/auth-jsconnect 2.10.1-beta → 2.10.1-sandbox

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 (203) hide show
  1. package/README.md +2 -2
  2. package/build/@types/app.d.ts +9 -2
  3. package/build/@types/app.js +8 -0
  4. package/build/@types/form.d.ts +3 -0
  5. package/build/@types/index.d.ts +1 -0
  6. package/build/@types/index.js +1 -0
  7. package/build/@types/terminal.d.ts +116 -0
  8. package/build/@types/terminal.js +1 -0
  9. package/build/api/account.d.ts +1 -0
  10. package/build/api/account.js +7 -0
  11. package/build/api/auth.d.ts +10 -1
  12. package/build/api/index.d.ts +8 -1
  13. package/build/api/index.js +3 -1
  14. package/build/api/terminal.d.ts +28 -0
  15. package/build/api/terminal.js +45 -0
  16. package/build/app/rootReducer.d.ts +1 -0
  17. package/build/app/rootReducer.js +3 -1
  18. package/build/app/settings.d.ts +1 -0
  19. package/build/app/settings.js +9 -4
  20. package/build/app/store.d.ts +2 -0
  21. package/build/assets/currencies/AEDSymbol.d.ts +7 -0
  22. package/build/assets/currencies/AEDSymbol.js +28 -0
  23. package/build/assets/currencies/SARSymbol.d.ts +7 -0
  24. package/build/assets/currencies/SARSymbol.js +28 -0
  25. package/build/assets/currencies/index.d.ts +2 -0
  26. package/build/assets/currencies/index.js +2 -0
  27. package/build/assets/currencies/utils.d.ts +4 -0
  28. package/build/assets/currencies/utils.js +6 -0
  29. package/build/assets/locales/ar.json +48 -6
  30. package/build/assets/locales/en.json +51 -9
  31. package/build/components/DeviceCard/DeviceCard.d.ts +18 -0
  32. package/build/components/DeviceCard/DeviceCard.js +103 -0
  33. package/build/components/DeviceCard/index.d.ts +3 -0
  34. package/build/components/DeviceCard/index.js +2 -0
  35. package/build/components/OTPTimer/OTPTimer.d.ts +2 -1
  36. package/build/components/OTPTimer/OTPTimer.js +4 -4
  37. package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
  38. package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
  39. package/build/components/TextWithCurrency/index.d.ts +2 -0
  40. package/build/components/TextWithCurrency/index.js +2 -0
  41. package/build/constants/api.d.ts +1 -1
  42. package/build/constants/api.js +2 -2
  43. package/build/constants/app.d.ts +15 -2
  44. package/build/constants/app.js +158 -13
  45. package/build/constants/assets.d.ts +12 -3
  46. package/build/constants/assets.js +123 -105
  47. package/build/constants/dummy.js +27 -20
  48. package/build/constants/flows.d.ts +15 -0
  49. package/build/constants/flows.js +15 -0
  50. package/build/constants/validation.d.ts +2 -0
  51. package/build/constants/validation.js +2 -0
  52. package/build/features/app/auth/authStore.d.ts +24 -5
  53. package/build/features/app/auth/authStore.js +186 -89
  54. package/build/features/app/business/businessStore.js +53 -29
  55. package/build/features/app/connect/connectStore.js +47 -35
  56. package/build/features/app/connectExpress/connectExpressStore.d.ts +14 -3
  57. package/build/features/app/connectExpress/connectExpressStore.js +301 -109
  58. package/build/features/app/individual/individualStore.js +0 -1
  59. package/build/features/app/kyc/kycStore.js +49 -25
  60. package/build/features/app/tax/taxStore.js +1 -1
  61. package/build/features/app/terminal/terminalStore.d.ts +109 -0
  62. package/build/features/app/terminal/terminalStore.js +673 -0
  63. package/build/features/auth/screens/OTP/OTP.d.ts +13 -2
  64. package/build/features/auth/screens/OTP/OTP.js +15 -3
  65. package/build/features/auth/screens/OTP/index.d.ts +1 -2
  66. package/build/features/auth/screens/Passcode/Passcode.d.ts +16 -0
  67. package/build/features/auth/screens/Passcode/Passcode.js +82 -0
  68. package/build/features/auth/screens/Passcode/PasscodeInput.d.ts +6 -0
  69. package/build/features/auth/screens/Passcode/PasscodeInput.js +42 -0
  70. package/build/features/auth/screens/Passcode/index.d.ts +2 -0
  71. package/build/features/auth/screens/Passcode/index.js +2 -0
  72. package/build/features/auth/screens/Passcode/validation.d.ts +8 -0
  73. package/build/features/auth/screens/Passcode/validation.js +4 -0
  74. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -8
  75. package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -8
  76. package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +3 -4
  77. package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +3 -4
  78. package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.d.ts +3 -0
  79. package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.js +9 -0
  80. package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.d.ts +2 -0
  81. package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.js +2 -0
  82. package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +3 -4
  83. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.d.ts +5 -0
  84. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.js +49 -0
  85. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.d.ts +5 -0
  86. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.js +88 -0
  87. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.d.ts +3 -0
  88. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.js +2 -0
  89. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.d.ts +8 -0
  90. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.js +4 -0
  91. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +9 -3
  92. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +3 -7
  93. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +3 -7
  94. package/build/features/featuresScreens.d.ts +1 -0
  95. package/build/features/featuresScreens.js +77 -0
  96. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
  97. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
  98. package/build/features/kyc/screens/Terms/Terms.js +8 -2
  99. package/build/features/kyc/screens/Users/Users.js +1 -1
  100. package/build/features/shared/Background/LogoBackground.js +5 -17
  101. package/build/features/shared/Button/Button.js +2 -3
  102. package/build/features/shared/Button/FlowsButtons.js +3 -2
  103. package/build/features/shared/Input/Input.d.ts +1 -1
  104. package/build/features/shared/PushNotification/PushNotification.d.ts +11 -0
  105. package/build/features/shared/PushNotification/PushNotification.js +34 -0
  106. package/build/features/shared/PushNotification/index.d.ts +2 -0
  107. package/build/features/shared/PushNotification/index.js +2 -0
  108. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +2 -2
  109. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
  110. package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
  111. package/build/features/terminal/Terminal.d.ts +14 -0
  112. package/build/features/terminal/Terminal.js +95 -0
  113. package/build/features/terminal/index.d.ts +1 -0
  114. package/build/features/terminal/index.js +1 -0
  115. package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.d.ts +3 -0
  116. package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +69 -0
  117. package/build/features/terminal/screens/LinkNewTerminal/index.d.ts +2 -0
  118. package/build/features/terminal/screens/LinkNewTerminal/index.js +2 -0
  119. package/build/features/terminal/screens/LinkNewTerminal/styles.d.ts +10 -0
  120. package/build/features/terminal/screens/LinkNewTerminal/styles.js +28 -0
  121. package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.d.ts +3 -0
  122. package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +51 -0
  123. package/build/features/terminal/screens/LinkedSuccess/index.d.ts +2 -0
  124. package/build/features/terminal/screens/LinkedSuccess/index.js +2 -0
  125. package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.d.ts +3 -0
  126. package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +50 -0
  127. package/build/features/terminal/screens/LinkedTerminalInfo/index.d.ts +2 -0
  128. package/build/features/terminal/screens/LinkedTerminalInfo/index.js +2 -0
  129. package/build/features/terminal/screens/Loading/Loading.d.ts +4 -0
  130. package/build/features/terminal/screens/Loading/Loading.js +10 -0
  131. package/build/features/terminal/screens/Loading/index.d.ts +2 -0
  132. package/build/features/terminal/screens/Loading/index.js +2 -0
  133. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.d.ts +3 -0
  134. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +56 -0
  135. package/build/features/terminal/screens/NoTerminalDeviceLinked/index.d.ts +2 -0
  136. package/build/features/terminal/screens/NoTerminalDeviceLinked/index.js +2 -0
  137. package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.d.ts +36 -0
  138. package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.js +34 -0
  139. package/build/features/terminal/screens/OperatorError/OperatorError.d.ts +5 -0
  140. package/build/features/terminal/screens/OperatorError/OperatorError.js +9 -0
  141. package/build/features/terminal/screens/OperatorError/index.d.ts +2 -0
  142. package/build/features/terminal/screens/OperatorError/index.js +2 -0
  143. package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +3 -0
  144. package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +21 -0
  145. package/build/features/terminal/screens/ResetPasswordSuccess/index.d.ts +2 -0
  146. package/build/features/terminal/screens/ResetPasswordSuccess/index.js +2 -0
  147. package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
  148. package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +31 -0
  149. package/build/features/terminal/screens/SuccessWithFlowButtons/index.d.ts +2 -0
  150. package/build/features/terminal/screens/SuccessWithFlowButtons/index.js +2 -0
  151. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +9 -0
  152. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +20 -0
  153. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.d.ts +3 -0
  154. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +144 -0
  155. package/build/features/terminal/screens/TerminalDeviceList/index.d.ts +2 -0
  156. package/build/features/terminal/screens/TerminalDeviceList/index.js +2 -0
  157. package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +9 -0
  158. package/build/features/terminal/screens/TerminalDeviceList/styles.js +13 -0
  159. package/build/features/terminal/screens/TerminalListPage/TerminalListPage.d.ts +3 -0
  160. package/build/features/terminal/screens/TerminalListPage/TerminalListPage.js +42 -0
  161. package/build/features/terminal/screens/TerminalListPage/index.d.ts +2 -0
  162. package/build/features/terminal/screens/TerminalListPage/index.js +2 -0
  163. package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.d.ts +3 -0
  164. package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +53 -0
  165. package/build/features/terminal/screens/UnlinkedSuccess/index.d.ts +2 -0
  166. package/build/features/terminal/screens/UnlinkedSuccess/index.js +2 -0
  167. package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.d.ts +3 -0
  168. package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +98 -0
  169. package/build/features/terminal/screens/UnlinkedTerminalInfo/index.d.ts +2 -0
  170. package/build/features/terminal/screens/UnlinkedTerminalInfo/index.js +2 -0
  171. package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +26 -0
  172. package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +30 -0
  173. package/build/features/terminal/screens/Verify/OTPInput.d.ts +7 -0
  174. package/build/features/terminal/screens/Verify/OTPInput.js +51 -0
  175. package/build/features/terminal/screens/Verify/Verify.d.ts +5 -0
  176. package/build/features/terminal/screens/Verify/Verify.js +85 -0
  177. package/build/features/terminal/screens/Verify/index.d.ts +2 -0
  178. package/build/features/terminal/screens/Verify/index.js +2 -0
  179. package/build/features/terminal/screens/Verify/validation.d.ts +8 -0
  180. package/build/features/terminal/screens/Verify/validation.js +4 -0
  181. package/build/features/terminal/screens/shared/Header.d.ts +10 -0
  182. package/build/features/terminal/screens/shared/Header.js +30 -0
  183. package/build/features/terminal/screens/shared/TerminalList.d.ts +11 -0
  184. package/build/features/terminal/screens/shared/TerminalList.js +25 -0
  185. package/build/features/terminal/screens/shared/index.d.ts +5 -0
  186. package/build/features/terminal/screens/shared/index.js +5 -0
  187. package/build/features/terminal/screens/shared/styles.d.ts +196 -0
  188. package/build/features/terminal/screens/shared/styles.js +155 -0
  189. package/build/features/terminal/screens/shared/utils.d.ts +7 -0
  190. package/build/features/terminal/screens/shared/utils.js +24 -0
  191. package/build/hooks/useAppConfig.js +1 -1
  192. package/build/hooks/useAppDispatch.d.ts +1 -0
  193. package/build/index.d.ts +3 -2
  194. package/build/index.js +4 -2
  195. package/build/theme/palette.js +12 -0
  196. package/build/theme/typography.js +4 -0
  197. package/build/utils/common.d.ts +1 -1
  198. package/build/utils/common.js +6 -4
  199. package/build/utils/error.d.ts +1 -0
  200. package/build/utils/error.js +3 -0
  201. package/build/utils/string.d.ts +3 -2
  202. package/build/utils/string.js +10 -1
  203. package/package.json +3 -4
@@ -0,0 +1,155 @@
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 Box from '@mui/material/Box';
13
+ import Button from '@mui/material/Button';
14
+ import { alpha, styled } from '@mui/material/styles';
15
+ import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
16
+ import Typography from '@mui/material/Typography';
17
+ import Radio from '@mui/material/Radio';
18
+ import Icon from '../../../../components/Icon';
19
+ import DeviceCard from '../../../../components/DeviceCard';
20
+ export var Container = styled(Box)(function () { return ({
21
+ display: 'flex',
22
+ flexDirection: 'column',
23
+ width: '100%'
24
+ }); });
25
+ export var LinkNewTerminalContainer = styled(Container)(function (_a) {
26
+ var spacing = _a.theme.spacing;
27
+ return ({
28
+ gap: spacing(1)
29
+ });
30
+ });
31
+ export var TextTypography = styled(Typography)(function (_a) {
32
+ var _b = _a.theme, palette = _b.palette, typography = _b.typography;
33
+ return (__assign(__assign({}, typography.caption), { color: alpha(palette.text.primary, 0.6) }));
34
+ });
35
+ export var LinkWithText = styled(TextTypography)(function (_a) {
36
+ var spacing = _a.theme.spacing;
37
+ return ({
38
+ paddingBlock: spacing(1)
39
+ });
40
+ });
41
+ export var LinkTerminalText = styled(TextTypography)(function (_a) {
42
+ var spacing = _a.theme.spacing;
43
+ return ({
44
+ paddingInline: spacing(2.625)
45
+ });
46
+ });
47
+ export var QRCodeDescription = styled(Box)(function (_a) {
48
+ var _b = _a.theme, palette = _b.palette, spacing = _b.spacing, typography = _b.typography;
49
+ return (__assign(__assign({ backgroundColor: palette.common.white, borderWidth: spacing(0.125, 0, 0.125, 0), borderStyle: 'solid', borderColor: palette.divider, padding: spacing(1.5, 2.5, 1.5, 2.5), marginTop: spacing(1), color: palette.text.primary }, typography.body1), { fontWeight: typography.fontWeightLight }));
50
+ });
51
+ export var SuccessContainerStyled = styled(Container)(function () { return ({
52
+ justifyContent: 'space-between',
53
+ alignItems: 'center',
54
+ pointerEvents: 'auto'
55
+ }); });
56
+ export var ScrollContainer = styled(Box)(function (_a) {
57
+ var spacing = _a.theme.spacing;
58
+ return ({
59
+ maxHeight: spacing(20.625),
60
+ overflow: 'scroll'
61
+ });
62
+ });
63
+ export var TerminalListContainer = styled(Box)(function (_a) {
64
+ var spacing = _a.theme.spacing;
65
+ return ({
66
+ display: 'flex',
67
+ justifyContent: 'space-between',
68
+ flexDirection: 'column',
69
+ alignItems: 'center',
70
+ width: '100%',
71
+ gap: spacing(0.75)
72
+ });
73
+ });
74
+ export var ListContainer = styled(Box)(function (_a) {
75
+ var _b = _a.theme, spacing = _b.spacing, _c = _b.palette, common = _c.common, toastDeviceSelectorDropdown = _c.components.toastDeviceSelectorDropdown;
76
+ return ({
77
+ marginTop: spacing(1),
78
+ border: "1px solid ".concat(toastDeviceSelectorDropdown.border),
79
+ backgroundColor: common.white,
80
+ borderRadius: spacing(1)
81
+ });
82
+ });
83
+ export var TitleContainer = styled(Box)(function (_a) {
84
+ var _b = _a.theme, spacing = _b.spacing, toastDeviceSelectorDropdown = _b.palette.components.toastDeviceSelectorDropdown;
85
+ return ({
86
+ padding: spacing(1.5, 2, 1.5, 2),
87
+ display: 'flex',
88
+ flexDirection: 'row',
89
+ gap: spacing(0.75),
90
+ alignItems: 'center',
91
+ borderBottom: "1px solid ".concat(toastDeviceSelectorDropdown.border)
92
+ });
93
+ });
94
+ export var Image = styled(Icon)(function (_a) {
95
+ var spacing = _a.theme.spacing;
96
+ return ({
97
+ width: spacing(3),
98
+ height: spacing(3)
99
+ });
100
+ });
101
+ export var Title = styled(Typography)(function (_a) {
102
+ var _b = _a.theme, typography = _b.typography, palette = _b.palette;
103
+ return (__assign(__assign({}, typography.body2), { color: palette.components.deviceCard.title, fontWeight: typography.fontWeightBold }));
104
+ });
105
+ export var ListItem = styled(DeviceCard)(function (_a) {
106
+ var spacing = _a.theme.spacing;
107
+ return ({
108
+ paddingTop: spacing(1),
109
+ paddingBottom: spacing(1)
110
+ });
111
+ });
112
+ export var StyledRadio = styled(Radio)(function (_a) {
113
+ var theme = _a.theme;
114
+ return ({
115
+ '&.Mui-checked': {
116
+ color: theme.palette.primary.main
117
+ }
118
+ });
119
+ });
120
+ export var ArrowIcon = styled(ArrowForwardIosIcon)(function (_a) {
121
+ var _b = _a.theme, palette = _b.palette, direction = _b.direction;
122
+ return (__assign({ color: palette.components.deviceCard.title, fontSize: '16px' }, (direction === 'rtl' && {
123
+ transform: 'rotate(180deg)'
124
+ })));
125
+ });
126
+ export var HeadContainer = styled(Box)(function (_a) {
127
+ var spacing = _a.theme.spacing;
128
+ return ({
129
+ display: 'flex',
130
+ justifyContent: 'space-between',
131
+ alignItems: 'center',
132
+ width: '100%',
133
+ paddingBottom: spacing(2)
134
+ });
135
+ });
136
+ export var LinkButton = styled(Button)(function (_a) {
137
+ var _b = _a.theme, spacing = _b.spacing, palette = _b.palette, typography = _b.typography;
138
+ return (__assign(__assign({}, typography.button_small), { fontWeight: typography.fontWeightRegular, textTransform: 'none', color: palette.primary.main, display: 'flex', alignItems: 'center', gap: spacing(0.5) }));
139
+ });
140
+ export var AddIconContainer = styled(Box)(function (_a) {
141
+ var _b = _a.theme, spacing = _b.spacing, palette = _b.palette;
142
+ return ({
143
+ background: alpha(palette.primary.main, 0.1),
144
+ height: spacing(2.25),
145
+ width: spacing(2.25),
146
+ display: 'flex',
147
+ justifyContent: 'center',
148
+ borderRadius: spacing(11.25),
149
+ alignItems: 'center'
150
+ });
151
+ });
152
+ export var LinkText = styled(Typography)(function (_a) {
153
+ var typography = _a.theme.typography;
154
+ return (__assign({}, typography.button_small));
155
+ });
@@ -0,0 +1,7 @@
1
+ import { TerminalDeviceInfo, TerminalInfo } from '../../../../@types';
2
+ export declare const getPairedWith: (device: TerminalDeviceInfo) => string | undefined;
3
+ export declare const getId: (device: TerminalDeviceInfo) => string;
4
+ export declare const getIdLabel: (device: TerminalDeviceInfo) => "terminal_device_id" | "terminal_serial_number";
5
+ export declare const getTerminalId: (terminal: TerminalInfo) => string;
6
+ export declare const getTerminalName: (terminal: TerminalInfo) => string;
7
+ export declare const getTerminalIdLabel: (terminal: TerminalInfo) => "terminal_device_id" | "terminal_id";
@@ -0,0 +1,24 @@
1
+ export var getPairedWith = function (device) {
2
+ var _a, _b, _c, _d;
3
+ return (_c = (_b = (_a = device === null || device === void 0 ? void 0 : device.terminal) === null || _a === void 0 ? void 0 : _a.device) === null || _b === void 0 ? void 0 : _b.display_name) !== null && _c !== void 0 ? _c : (_d = device === null || device === void 0 ? void 0 : device.terminal) === null || _d === void 0 ? void 0 : _d.name.en;
4
+ };
5
+ export var getId = function (device) {
6
+ var _a, _b, _c;
7
+ return (_c = (_b = (_a = device === null || device === void 0 ? void 0 : device.terminal) === null || _a === void 0 ? void 0 : _a.device) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : device.serial_number;
8
+ };
9
+ export var getIdLabel = function (device) {
10
+ var _a, _b;
11
+ return ((_b = (_a = device === null || device === void 0 ? void 0 : device.terminal) === null || _a === void 0 ? void 0 : _a.device) === null || _b === void 0 ? void 0 : _b.id) ? 'terminal_device_id' : 'terminal_serial_number';
12
+ };
13
+ export var getTerminalId = function (terminal) {
14
+ var _a, _b;
15
+ return (_b = (_a = terminal === null || terminal === void 0 ? void 0 : terminal.device) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : terminal.legacy_id;
16
+ };
17
+ export var getTerminalName = function (terminal) {
18
+ var _a, _b, _c;
19
+ return (_b = (_a = terminal === null || terminal === void 0 ? void 0 : terminal.device) === null || _a === void 0 ? void 0 : _a.display_name) !== null && _b !== void 0 ? _b : (_c = terminal === null || terminal === void 0 ? void 0 : terminal.name) === null || _c === void 0 ? void 0 : _c.en;
20
+ };
21
+ export var getTerminalIdLabel = function (terminal) {
22
+ var _a;
23
+ return ((_a = terminal === null || terminal === void 0 ? void 0 : terminal.device) === null || _a === void 0 ? void 0 : _a.id) ? 'terminal_device_id' : 'terminal_id';
24
+ };
@@ -48,7 +48,7 @@ export var useAppConfig = function (_a) {
48
48
  if (!disableSettingFetching && !configToken)
49
49
  removeRequestHeaders();
50
50
  checkDomain();
51
- setBaseUrl(publicKey);
51
+ setBaseUrl(publicKey, rest.businessCountryCode);
52
52
  setAppConfig();
53
53
  if (typeof boardMaturity === 'boolean')
54
54
  dispatch(handelBoardMaturity(boardMaturity));
@@ -13,4 +13,5 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
13
13
  auth: import("../features/app/auth/authStore").AuthState;
14
14
  board: import("../features/app/board/boardStore").BoardState;
15
15
  kyc: import("../features/app/kyc/kycStore").KYCDataState;
16
+ terminal: import("../features/app/terminal/terminalStore").TerminalDataState;
16
17
  }, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").AnyAction>;
package/build/index.d.ts CHANGED
@@ -13,5 +13,6 @@ import { EntityElement, EntityLibProps } from './features/entity';
13
13
  import { BrandElement, BrandLibProps } from './features/brand';
14
14
  import { BoardLibProps, BoardElement } from './features/board';
15
15
  import { KYCLibProps, KYCElement } from './features/kyc';
16
- export type { ConnectLibProps, ConnectExpressLibProps, AuthLibProps, BusinessLibProps, PasswordLibProps, IndividualLibProps, BankLibProps, TaxLibProps, EntityLibProps, BrandLibProps, SignInLibProps, BoardLibProps, KYCLibProps };
17
- export { ConnectElement, ConnectExpressElement, AuthElement, BusinessElement, PasswordElement, IndividualElement, BankElement, TaxElement, EntityElement, BrandElement, SignInElement, BoardElement, KYCElement };
16
+ import { TerminalLibProps, TerminalElement } from './features/terminal';
17
+ export type { ConnectLibProps, ConnectExpressLibProps, AuthLibProps, BusinessLibProps, PasswordLibProps, IndividualLibProps, BankLibProps, TaxLibProps, EntityLibProps, BrandLibProps, SignInLibProps, BoardLibProps, KYCLibProps, TerminalLibProps };
18
+ export { ConnectElement, ConnectExpressElement, AuthElement, BusinessElement, PasswordElement, IndividualElement, BankElement, TaxElement, EntityElement, BrandElement, SignInElement, BoardElement, KYCElement, TerminalElement };
package/build/index.js CHANGED
@@ -13,7 +13,8 @@ import { EntityElement, renderEntityLib } from './features/entity';
13
13
  import { BrandElement, renderBrandLib } from './features/brand';
14
14
  import { BoardElement, renderBoardLib } from './features/board';
15
15
  import { KYCElement, renderKYCLib } from './features/kyc';
16
- export { ConnectElement, ConnectExpressElement, AuthElement, BusinessElement, PasswordElement, IndividualElement, BankElement, TaxElement, EntityElement, BrandElement, SignInElement, BoardElement, KYCElement };
16
+ import { TerminalElement, renderTerminalLib } from './features/terminal';
17
+ export { ConnectElement, ConnectExpressElement, AuthElement, BusinessElement, PasswordElement, IndividualElement, BankElement, TaxElement, EntityElement, BrandElement, SignInElement, BoardElement, KYCElement, TerminalElement };
17
18
  window['TapAuth'] = {
18
19
  renderConnectLib: renderConnectLib,
19
20
  renderConnectExpressLib: renderConnectExpressLib,
@@ -27,6 +28,7 @@ window['TapAuth'] = {
27
28
  renderBrandLib: renderBrandLib,
28
29
  renderSignInLib: renderSignInLib,
29
30
  renderBoardLib: renderBoardLib,
30
- renderKYCLib: renderKYCLib
31
+ renderKYCLib: renderKYCLib,
32
+ renderTerminalLib: renderTerminalLib
31
33
  };
32
34
  console.log("TapAuth version: ".concat(require('../package.json').version));
@@ -48,6 +48,18 @@ export var lightPalette = {
48
48
  main: '#808592',
49
49
  light: '#EAECEF',
50
50
  dark: '#3B4152'
51
+ },
52
+ components: {
53
+ deviceCard: {
54
+ title: '#20232B',
55
+ statusText: '#1F222A80',
56
+ statusBackground: ' #F0F0F0',
57
+ deviceInfoBackground: 'linear-gradient(127.37deg, rgba(255, 255, 255, 0.6) 59.07%, rgba(255, 255, 255, 0.444) 100.12%);',
58
+ border: '#e8ecf2'
59
+ },
60
+ toastDeviceSelectorDropdown: {
61
+ border: '#f2f2f2'
62
+ }
51
63
  }
52
64
  };
53
65
  export var darkPalette = {
@@ -5,6 +5,7 @@ export var typography = {
5
5
  fontWeightLight: 300,
6
6
  fontWeightRegular: 400,
7
7
  fontWeightMedium: 500,
8
+ fontWeightSemiBold: 600,
8
9
  fontWeightBold: 700,
9
10
  allVariants: {
10
11
  fontFamily: '"Lato", "Tajawal", "Roboto"',
@@ -19,6 +20,7 @@ export var typography = {
19
20
  h2: { fontSize: '3rem' },
20
21
  h3: { fontSize: '2.5rem' },
21
22
  h4: { fontSize: '2rem' },
23
+ h4_small: { fontSize: '1.625rem' },
22
24
  h5: { fontSize: '1.5rem' },
23
25
  h6: { fontSize: '1.25rem' },
24
26
  subtitle1: { fontSize: '1.125rem' },
@@ -26,6 +28,8 @@ export var typography = {
26
28
  body1: { fontSize: '1rem' },
27
29
  body2: { fontSize: '0.875rem' },
28
30
  button: { fontSize: '0.875rem' },
31
+ button_small: { fontSize: '0.813rem' },
29
32
  caption: { fontSize: '0.75rem' },
33
+ caption_small: { fontSize: '0.625rem' },
30
34
  overline: { fontSize: '0.5rem' }
31
35
  };
@@ -1,6 +1,6 @@
1
1
  export declare const sleep: (milliseconds?: number) => Promise<unknown>;
2
2
  export declare const dangerousMessage: (message: string, callBack?: Function) => void;
3
- export declare const setBaseUrl: (publicKey: string) => void;
3
+ export declare const setBaseUrl: (publicKey: string, countryCode?: string) => void;
4
4
  export declare const updateLocationUrlWithCountry: (countryIso2: string) => void;
5
5
  export declare const openConnect: (pk: string, countryCode?: string) => void;
6
6
  export declare function getMetaData(): Record<string, string> | undefined;
@@ -1,6 +1,7 @@
1
1
  import { axiosInstance } from '../api';
2
- import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_BETA_URL } from '../constants';
2
+ import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_PROD_URL } from '../constants';
3
3
  import { objectHasValues } from './object';
4
+ import { isSA } from './string';
4
5
  export var sleep = function (milliseconds) {
5
6
  if (milliseconds === void 0) { milliseconds = 1000; }
6
7
  return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
@@ -11,10 +12,11 @@ export var dangerousMessage = function (message, callBack) {
11
12
  }
12
13
  callBack === null || callBack === void 0 ? void 0 : callBack({ message: message });
13
14
  };
14
- export var setBaseUrl = function (publicKey) {
15
+ export var setBaseUrl = function (publicKey, countryCode) {
16
+ if (countryCode === void 0) { countryCode = ''; }
15
17
  var isProd = publicKey.includes('pk_live');
16
18
  if (isProd) {
17
- axiosInstance.defaults.baseURL = ENDPOINT_PATHS.BETA_BASE_URL;
19
+ axiosInstance.defaults.baseURL = isSA(countryCode) ? ENDPOINT_PATHS.PRODUCTION_BASE_URL_SA : ENDPOINT_PATHS.PRODUCTION_BASE_URL;
18
20
  return;
19
21
  }
20
22
  axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
@@ -36,7 +38,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
36
38
  window.history.replaceState({}, '', newUrl);
37
39
  };
38
40
  export var openConnect = function (pk, countryCode) {
39
- var newUrl = new URL(pk.includes('pk_live') ? CONNECT_BETA_URL : CONNECT_SANDBOX_URL);
41
+ var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_SANDBOX_URL);
40
42
  if (countryCode) {
41
43
  newUrl.pathname = "/".concat(countryCode.toLowerCase());
42
44
  }
@@ -1,2 +1,3 @@
1
1
  export declare const isNetworkError: (error: string | null) => boolean;
2
2
  export declare const isTokenExpired: (error: string | null) => boolean;
3
+ export declare const isTimeoutError: (error: string | null) => boolean;
@@ -4,3 +4,6 @@ export var isNetworkError = function (error) {
4
4
  export var isTokenExpired = function (error) {
5
5
  return ['token expired'].includes((error || '').trim().toLowerCase());
6
6
  };
7
+ export var isTimeoutError = function (error) {
8
+ return (error || '').trim().toLowerCase().includes('timeout');
9
+ };
@@ -43,7 +43,7 @@ export declare const getRequestHeaders: (deviceInfo: DeviceInfo) => {
43
43
  };
44
44
  export declare const removeRequestHeaders: () => void;
45
45
  export declare const getBaseUrl: () => string;
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";
46
+ export declare const getScreenNameBasedOnFlow: (flow: string, isAuthorizedUser?: boolean, isOtherThanSAOrKWCountry?: boolean) => string;
47
47
  export declare const getEighteenYearsAgo: () => string;
48
48
  export declare const isKW: (flag: string) => boolean;
49
49
  export declare const isSA: (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: string) => string;
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 function formatCode(code: string, chunkSize?: number, delimiter?: string): string;
@@ -1,7 +1,7 @@
1
1
  import { FlowsTypes } from '../@types';
2
2
  import { concatenateObjectValues, encryptString } from '.';
3
3
  import { removeAxiosGlobalHeaders } from '../api';
4
- import { COUNTRY_TO_CURRENCY, ENDPOINT_PATHS, ICONS_FULL_PATH, LANGUAGE_ABBREVIATIONS, TAP_WEBSITE } from '../constants';
4
+ import { CONNECT_FLOWS, COUNTRY_TO_CURRENCY, ENDPOINT_PATHS, ICONS_FULL_PATH, LANGUAGE_ABBREVIATIONS, TAP_WEBSITE } from '../constants';
5
5
  import moment from 'moment';
6
6
  export var maskPhone = function (str) {
7
7
  if (str === void 0) { str = ''; }
@@ -204,6 +204,9 @@ export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser, isOtherT
204
204
  if (flow === FlowsTypes.PASSWORD) {
205
205
  return 'PASSWORD_CREATE_PASSWORD_STEP';
206
206
  }
207
+ if (flow === FlowsTypes.TERMINAL) {
208
+ return CONNECT_FLOWS.terminal.terminalDeviceList;
209
+ }
207
210
  return '';
208
211
  };
209
212
  export var getEighteenYearsAgo = function () {
@@ -344,3 +347,9 @@ export var getWebsiteLink = function (isAr, countryCode, path) {
344
347
  var language = isAr ? LANGUAGE_ABBREVIATIONS.ARABIC : LANGUAGE_ABBREVIATIONS.ENGLISH;
345
348
  return TAP_WEBSITE + language + '-' + countryCode + path;
346
349
  };
350
+ export function formatCode(code, chunkSize, delimiter) {
351
+ var _a;
352
+ if (chunkSize === void 0) { chunkSize = 3; }
353
+ if (delimiter === void 0) { delimiter = ' - '; }
354
+ return ((_a = code.match(new RegExp(".{1,".concat(chunkSize, "}"), 'g'))) === null || _a === void 0 ? void 0 : _a.join(delimiter)) || code;
355
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.10.1-beta",
3
+ "version": "2.10.1-sandbox",
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 beta"
24
+ "push": "npm publish --access public --tag sandbox"
25
25
  },
26
26
  "keywords": [],
27
27
  "author": {
@@ -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": {