@tap-payments/auth-jsconnect 2.11.1-beta → 2.11.1-development

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 (167) hide show
  1. package/build/@types/app.d.ts +3 -1
  2. package/build/@types/app.js +1 -0
  3. package/build/@types/form.d.ts +2 -0
  4. package/build/@types/index.d.ts +1 -0
  5. package/build/@types/index.js +1 -0
  6. package/build/@types/terminal.d.ts +116 -0
  7. package/build/@types/terminal.js +1 -0
  8. package/build/api/auth.d.ts +9 -1
  9. package/build/api/entity.d.ts +3 -0
  10. package/build/api/index.d.ts +7 -1
  11. package/build/api/index.js +3 -1
  12. package/build/api/lead.d.ts +1 -0
  13. package/build/api/terminal.d.ts +28 -0
  14. package/build/api/terminal.js +45 -0
  15. package/build/app/rootReducer.d.ts +1 -0
  16. package/build/app/rootReducer.js +3 -1
  17. package/build/app/settings.js +1 -2
  18. package/build/app/store.d.ts +2 -0
  19. package/build/assets/locales/ar.json +48 -16
  20. package/build/assets/locales/en.json +51 -45
  21. package/build/components/DeviceCard/DeviceCard.d.ts +18 -0
  22. package/build/components/DeviceCard/DeviceCard.js +103 -0
  23. package/build/components/DeviceCard/index.d.ts +3 -0
  24. package/build/components/DeviceCard/index.js +2 -0
  25. package/build/components/OTPTimer/OTPTimer.d.ts +2 -1
  26. package/build/components/OTPTimer/OTPTimer.js +4 -4
  27. package/build/components/Tooltip/Tooltip.js +1 -1
  28. package/build/constants/api.d.ts +0 -1
  29. package/build/constants/api.js +0 -2
  30. package/build/constants/app.d.ts +21 -3
  31. package/build/constants/app.js +122 -5
  32. package/build/constants/flows.d.ts +15 -0
  33. package/build/constants/flows.js +15 -0
  34. package/build/constants/validation.d.ts +2 -0
  35. package/build/constants/validation.js +2 -0
  36. package/build/features/app/business/businessStore.js +15 -10
  37. package/build/features/app/connectExpress/connectExpressStore.js +19 -4
  38. package/build/features/app/individual/individualStore.js +0 -1
  39. package/build/features/app/tax/taxStore.js +1 -1
  40. package/build/features/app/terminal/terminalStore.d.ts +110 -0
  41. package/build/features/app/terminal/terminalStore.js +676 -0
  42. package/build/features/auth/screens/AuthenticationList/EntityList.js +2 -2
  43. package/build/features/business/screens/BusinessType/BusinessType.js +13 -2
  44. package/build/features/business/screens/BusinessType/EntityLicenseList.js +11 -5
  45. package/build/features/business/screens/BusinessType/LicenseList.js +15 -7
  46. package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +35 -0
  47. package/build/features/business/screens/BusinessType/UnifiedNumber.js +84 -0
  48. package/build/features/business/screens/BusinessType/validation.d.ts +6 -3
  49. package/build/features/business/screens/BusinessType/validation.js +31 -10
  50. package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +2 -2
  51. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -0
  52. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +23 -7
  53. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
  54. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +1 -1
  55. package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +36 -0
  56. package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.js +81 -0
  57. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +6 -3
  58. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +57 -21
  59. package/build/features/entity/screens/EntityName/EntityName.js +2 -1
  60. package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
  61. package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
  62. package/build/features/entity/screens/EntityName/validation.js +14 -3
  63. package/build/features/featuresScreens.d.ts +1 -0
  64. package/build/features/featuresScreens.js +67 -0
  65. package/build/features/shared/Button/Button.js +1 -1
  66. package/build/features/shared/Button/FlowsButtons.d.ts +1 -0
  67. package/build/features/shared/Button/FlowsButtons.js +2 -2
  68. package/build/features/shared/PushNotification/PushNotification.d.ts +11 -0
  69. package/build/features/shared/PushNotification/PushNotification.js +34 -0
  70. package/build/features/shared/PushNotification/index.d.ts +2 -0
  71. package/build/features/shared/PushNotification/index.js +2 -0
  72. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +2 -1
  73. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +5 -4
  74. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
  75. package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
  76. package/build/features/terminal/Terminal.d.ts +14 -0
  77. package/build/features/terminal/Terminal.js +95 -0
  78. package/build/features/terminal/index.d.ts +1 -0
  79. package/build/features/terminal/index.js +1 -0
  80. package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.d.ts +3 -0
  81. package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +69 -0
  82. package/build/features/terminal/screens/LinkNewTerminal/index.d.ts +2 -0
  83. package/build/features/terminal/screens/LinkNewTerminal/index.js +2 -0
  84. package/build/features/terminal/screens/LinkNewTerminal/styles.d.ts +10 -0
  85. package/build/features/terminal/screens/LinkNewTerminal/styles.js +28 -0
  86. package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.d.ts +3 -0
  87. package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +51 -0
  88. package/build/features/terminal/screens/LinkedSuccess/index.d.ts +2 -0
  89. package/build/features/terminal/screens/LinkedSuccess/index.js +2 -0
  90. package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.d.ts +3 -0
  91. package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +55 -0
  92. package/build/features/terminal/screens/LinkedTerminalInfo/index.d.ts +2 -0
  93. package/build/features/terminal/screens/LinkedTerminalInfo/index.js +2 -0
  94. package/build/features/terminal/screens/Loading/Loading.d.ts +4 -0
  95. package/build/features/terminal/screens/Loading/Loading.js +10 -0
  96. package/build/features/terminal/screens/Loading/index.d.ts +2 -0
  97. package/build/features/terminal/screens/Loading/index.js +2 -0
  98. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.d.ts +3 -0
  99. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +58 -0
  100. package/build/features/terminal/screens/NoTerminalDeviceLinked/index.d.ts +2 -0
  101. package/build/features/terminal/screens/NoTerminalDeviceLinked/index.js +2 -0
  102. package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.d.ts +36 -0
  103. package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.js +34 -0
  104. package/build/features/terminal/screens/OperatorError/OperatorError.d.ts +5 -0
  105. package/build/features/terminal/screens/OperatorError/OperatorError.js +9 -0
  106. package/build/features/terminal/screens/OperatorError/index.d.ts +2 -0
  107. package/build/features/terminal/screens/OperatorError/index.js +2 -0
  108. package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +3 -0
  109. package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +21 -0
  110. package/build/features/terminal/screens/ResetPasswordSuccess/index.d.ts +2 -0
  111. package/build/features/terminal/screens/ResetPasswordSuccess/index.js +2 -0
  112. package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
  113. package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +32 -0
  114. package/build/features/terminal/screens/SuccessWithFlowButtons/index.d.ts +2 -0
  115. package/build/features/terminal/screens/SuccessWithFlowButtons/index.js +2 -0
  116. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +9 -0
  117. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +20 -0
  118. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.d.ts +3 -0
  119. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +153 -0
  120. package/build/features/terminal/screens/TerminalDeviceList/index.d.ts +2 -0
  121. package/build/features/terminal/screens/TerminalDeviceList/index.js +2 -0
  122. package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +9 -0
  123. package/build/features/terminal/screens/TerminalDeviceList/styles.js +13 -0
  124. package/build/features/terminal/screens/TerminalListPage/TerminalListPage.d.ts +3 -0
  125. package/build/features/terminal/screens/TerminalListPage/TerminalListPage.js +47 -0
  126. package/build/features/terminal/screens/TerminalListPage/index.d.ts +2 -0
  127. package/build/features/terminal/screens/TerminalListPage/index.js +2 -0
  128. package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.d.ts +3 -0
  129. package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +53 -0
  130. package/build/features/terminal/screens/UnlinkedSuccess/index.d.ts +2 -0
  131. package/build/features/terminal/screens/UnlinkedSuccess/index.js +2 -0
  132. package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.d.ts +3 -0
  133. package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +98 -0
  134. package/build/features/terminal/screens/UnlinkedTerminalInfo/index.d.ts +2 -0
  135. package/build/features/terminal/screens/UnlinkedTerminalInfo/index.js +2 -0
  136. package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +26 -0
  137. package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +30 -0
  138. package/build/features/terminal/screens/Verify/OTPInput.d.ts +7 -0
  139. package/build/features/terminal/screens/Verify/OTPInput.js +51 -0
  140. package/build/features/terminal/screens/Verify/Verify.d.ts +5 -0
  141. package/build/features/terminal/screens/Verify/Verify.js +85 -0
  142. package/build/features/terminal/screens/Verify/index.d.ts +2 -0
  143. package/build/features/terminal/screens/Verify/index.js +2 -0
  144. package/build/features/terminal/screens/Verify/validation.d.ts +8 -0
  145. package/build/features/terminal/screens/Verify/validation.js +4 -0
  146. package/build/features/terminal/screens/shared/Header.d.ts +10 -0
  147. package/build/features/terminal/screens/shared/Header.js +30 -0
  148. package/build/features/terminal/screens/shared/TerminalList.d.ts +11 -0
  149. package/build/features/terminal/screens/shared/TerminalList.js +25 -0
  150. package/build/features/terminal/screens/shared/index.d.ts +5 -0
  151. package/build/features/terminal/screens/shared/index.js +5 -0
  152. package/build/features/terminal/screens/shared/styles.d.ts +196 -0
  153. package/build/features/terminal/screens/shared/styles.js +155 -0
  154. package/build/features/terminal/screens/shared/utils.d.ts +7 -0
  155. package/build/features/terminal/screens/shared/utils.js +24 -0
  156. package/build/hooks/useAppConfig.js +1 -1
  157. package/build/hooks/useAppDispatch.d.ts +1 -0
  158. package/build/index.d.ts +3 -2
  159. package/build/index.js +4 -2
  160. package/build/theme/palette.js +12 -0
  161. package/build/theme/typography.js +4 -0
  162. package/build/utils/common.d.ts +1 -1
  163. package/build/utils/common.js +5 -6
  164. package/build/utils/string.d.ts +3 -2
  165. package/build/utils/string.js +14 -3
  166. package/build/utils/validation.js +1 -1
  167. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import { axiosInstance } from '../api';
2
- import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_BETA_URL } from '../constants';
2
+ import { ENDPOINT_PATHS, CONNECT_DEV_URL, CONNECT_PROD_URL } from '../constants';
3
3
  import { objectHasValues } from './object';
4
4
  import { isSA } from './string';
5
5
  export var sleep = function (milliseconds) {
@@ -12,14 +12,13 @@ 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, countryCode) {
16
- if (countryCode === void 0) { countryCode = ''; }
15
+ export var setBaseUrl = function (publicKey, region) {
17
16
  var isProd = publicKey.includes('pk_live');
18
17
  if (isProd) {
19
- axiosInstance.defaults.baseURL = isSA(countryCode) ? ENDPOINT_PATHS.PRODUCTION_BASE_URL_SA : ENDPOINT_PATHS.BETA_BASE_URL;
18
+ axiosInstance.defaults.baseURL = isSA(region) ? ENDPOINT_PATHS.PRODUCTION_BASE_URL_SA : ENDPOINT_PATHS.PRODUCTION_BASE_URL;
20
19
  return;
21
20
  }
22
- axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
21
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
23
22
  };
24
23
  export var updateLocationUrlWithCountry = function (countryIso2) {
25
24
  var country = countryIso2.toLowerCase();
@@ -38,7 +37,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
38
37
  window.history.replaceState({}, '', newUrl);
39
38
  };
40
39
  export var openConnect = function (pk, countryCode) {
41
- var newUrl = new URL(pk.includes('pk_live') ? CONNECT_BETA_URL : CONNECT_SANDBOX_URL);
40
+ var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_DEV_URL);
42
41
  if (countryCode) {
43
42
  newUrl.pathname = "/".concat(countryCode.toLowerCase());
44
43
  }
@@ -43,10 +43,10 @@ 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, terminalStepName?: string) => string;
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;
@@ -78,3 +78,4 @@ export declare const formatNumberAsCurrency: (number: string) => string;
78
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 = ''; }
@@ -179,7 +179,7 @@ export var getBaseUrl = function () {
179
179
  }
180
180
  return ENDPOINT_PATHS.PRODUCTION_BASE_URL;
181
181
  };
182
- export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser, isOtherThanSAOrKWCountry) {
182
+ export var getScreenNameBasedOnFlow = function (flow, isAuthorizedUser, isOtherThanSAOrKWCountry, terminalStepName) {
183
183
  if (flow === FlowsTypes.BANK) {
184
184
  return 'BANK_BANK_DETAILS_STEP';
185
185
  }
@@ -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 terminalStepName !== null && terminalStepName !== void 0 ? terminalStepName : CONNECT_FLOWS.terminal.terminalDeviceList;
209
+ }
207
210
  return '';
208
211
  };
209
212
  export var getEighteenYearsAgo = function () {
@@ -214,7 +217,9 @@ export var isKW = function (flag) {
214
217
  return ['kw', 'kwd'].includes(flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
215
218
  };
216
219
  export var isSA = function (flag) {
217
- return ['sa', 'sau'].includes(flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
220
+ if (!flag)
221
+ return false;
222
+ return ['sa', 'sau'].includes(flag.toLowerCase());
218
223
  };
219
224
  export var isOtherThanKWOrSA = function (flag) {
220
225
  return !isKW(flag) && !isSA(flag);
@@ -344,3 +349,9 @@ export var getWebsiteLink = function (isAr, countryCode, path) {
344
349
  var language = isAr ? LANGUAGE_ABBREVIATIONS.ARABIC : LANGUAGE_ABBREVIATIONS.ENGLISH;
345
350
  return TAP_WEBSITE + language + '-' + countryCode + path;
346
351
  };
352
+ export function formatCode(code, chunkSize, delimiter) {
353
+ var _a;
354
+ if (chunkSize === void 0) { chunkSize = 3; }
355
+ if (delimiter === void 0) { delimiter = ' - '; }
356
+ return ((_a = code.match(new RegExp(".{1,".concat(chunkSize, "}"), 'g'))) === null || _a === void 0 ? void 0 : _a.join(delimiter)) || code;
357
+ }
@@ -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.1-beta",
3
+ "version": "2.11.1-development",
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 development"
25
25
  },
26
26
  "keywords": [],
27
27
  "author": {