@tap-payments/auth-jsconnect 2.0.27-test → 2.0.27

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 (292) hide show
  1. package/build/@types/app.d.ts +59 -20
  2. package/build/@types/app.js +16 -1
  3. package/build/@types/form.d.ts +21 -7
  4. package/build/api/auth.d.ts +24 -2
  5. package/build/api/auth.js +36 -1
  6. package/build/api/axios.js +2 -2
  7. package/build/api/brand.d.ts +2 -1
  8. package/build/api/brand.js +10 -1
  9. package/build/api/country.d.ts +3 -1
  10. package/build/api/country.js +3 -1
  11. package/build/api/data.d.ts +38 -7
  12. package/build/api/data.js +57 -17
  13. package/build/api/entity.d.ts +28 -5
  14. package/build/api/entity.js +23 -9
  15. package/build/api/firebase.d.ts +1 -1
  16. package/build/api/firebase.js +3 -1
  17. package/build/api/index.d.ts +41 -14
  18. package/build/api/individual.d.ts +76 -19
  19. package/build/api/individual.js +29 -2
  20. package/build/api/lead.d.ts +8 -6
  21. package/build/app/rootReducer.d.ts +2 -0
  22. package/build/app/rootReducer.js +5 -1
  23. package/build/app/settings.d.ts +8 -2
  24. package/build/app/settings.js +29 -12
  25. package/build/app/store.d.ts +5 -1
  26. package/build/assets/locales/ar.json +256 -179
  27. package/build/assets/locales/en.json +188 -104
  28. package/build/components/AnimationFlow/AnimationFlow.d.ts +5 -1
  29. package/build/components/AnimationFlow/AnimationFlow.js +6 -8
  30. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  31. package/build/components/AnimationFlow/BottomSheet.js +4 -3
  32. package/build/components/AnimationFlow/Dialog.d.ts +5 -1
  33. package/build/components/AnimationFlow/Dialog.js +11 -5
  34. package/build/components/FileInput/DragAndDrop.d.ts +10 -1
  35. package/build/components/FileInput/DragAndDrop.js +107 -8
  36. package/build/components/Lottie/Lottie.d.ts +878 -0
  37. package/build/components/Lottie/Lottie.js +58 -0
  38. package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
  39. package/build/components/Lottie/files/success.json +425 -0
  40. package/build/components/Lottie/index.d.ts +3 -0
  41. package/build/components/Lottie/index.js +3 -0
  42. package/build/components/OTPField/OTPField.d.ts +2 -1
  43. package/build/components/OTPField/OTPField.js +2 -2
  44. package/build/components/OTPTimer/OTPTimer.js +1 -1
  45. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
  46. package/build/components/ProgressBar/CircularProgressBar.js +48 -0
  47. package/build/components/ProgressBar/index.d.ts +2 -0
  48. package/build/components/ProgressBar/index.js +2 -0
  49. package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
  50. package/build/components/RadioLabel/RadioLabel.js +2 -2
  51. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +1 -4
  52. package/build/components/SocialMediaGroup/SocialMediaGroup.js +3 -55
  53. package/build/constants/api.d.ts +6 -0
  54. package/build/constants/api.js +14 -1
  55. package/build/constants/app.d.ts +18 -0
  56. package/build/constants/app.js +98 -15
  57. package/build/constants/assets.d.ts +20 -1
  58. package/build/constants/assets.js +27 -8
  59. package/build/constants/dummy.d.ts +1 -1
  60. package/build/constants/dummy.js +2 -2
  61. package/build/constants/validation.d.ts +7 -0
  62. package/build/constants/validation.js +8 -1
  63. package/build/features/app/auth/authStore.d.ts +47 -0
  64. package/build/features/app/auth/authStore.js +265 -0
  65. package/build/features/app/bank/bankStore.d.ts +21 -1
  66. package/build/features/app/bank/bankStore.js +84 -40
  67. package/build/features/app/business/businessStore.d.ts +22 -3
  68. package/build/features/app/business/businessStore.js +458 -257
  69. package/build/features/app/connect/connectStore.d.ts +33 -30
  70. package/build/features/app/connect/connectStore.js +398 -258
  71. package/build/features/app/entity/entityStore.d.ts +53 -0
  72. package/build/features/app/entity/entityStore.js +461 -0
  73. package/build/features/app/individual/individualStore.d.ts +22 -1
  74. package/build/features/app/individual/individualStore.js +170 -86
  75. package/build/features/app/password/passwordStore.d.ts +10 -2
  76. package/build/features/app/password/passwordStore.js +5 -5
  77. package/build/features/app/tax/taxStore.js +6 -5
  78. package/build/features/auth/Auth.d.ts +10 -0
  79. package/build/features/auth/Auth.js +87 -0
  80. package/build/features/auth/index.d.ts +1 -0
  81. package/build/features/auth/index.js +1 -0
  82. package/build/features/auth/screens/NID/DOB.d.ts +7 -0
  83. package/build/features/auth/screens/NID/DOB.js +47 -0
  84. package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
  85. package/build/features/auth/screens/NID/IDNumber.js +64 -0
  86. package/build/features/auth/screens/NID/NID.d.ts +5 -0
  87. package/build/features/auth/screens/NID/NID.js +67 -0
  88. package/build/features/auth/screens/NID/TAC.d.ts +3 -0
  89. package/build/features/auth/screens/NID/TAC.js +87 -0
  90. package/build/features/auth/screens/NID/index.d.ts +3 -0
  91. package/build/features/auth/screens/NID/index.js +2 -0
  92. package/build/features/auth/screens/NID/validation.d.ts +27 -0
  93. package/build/features/auth/screens/NID/validation.js +19 -0
  94. package/build/features/auth/screens/OTP/OTP.d.ts +5 -0
  95. package/build/features/auth/screens/OTP/OTP.js +76 -0
  96. package/build/features/auth/screens/OTP/OTPInput.d.ts +5 -0
  97. package/build/features/auth/screens/OTP/OTPInput.js +51 -0
  98. package/build/features/auth/screens/OTP/index.d.ts +3 -0
  99. package/build/features/auth/screens/OTP/index.js +2 -0
  100. package/build/features/auth/screens/OTP/validation.d.ts +8 -0
  101. package/build/features/auth/screens/OTP/validation.js +4 -0
  102. package/build/features/bank/Bank.js +12 -6
  103. package/build/features/bank/screens/BankDetails/BankDetails.js +2 -2
  104. package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
  105. package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -9
  106. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -9
  107. package/build/features/business/Business.d.ts +1 -1
  108. package/build/features/business/Business.js +14 -7
  109. package/build/features/business/screens/Activities/Activities.js +1 -6
  110. package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
  111. package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
  112. package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
  113. package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
  114. package/build/features/business/screens/Activities/validation.d.ts +0 -51
  115. package/build/features/business/screens/Activities/validation.js +0 -9
  116. package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
  117. package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
  118. package/build/features/business/screens/BusinessType/EntityName.js +56 -0
  119. package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
  120. package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
  121. package/build/features/business/screens/BusinessType/LicenseList.js +24 -7
  122. package/build/features/business/screens/BusinessType/LicenseNumber.js +14 -8
  123. package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
  124. package/build/features/business/screens/BusinessType/LicenseType.js +67 -0
  125. package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
  126. package/build/features/business/screens/BusinessType/validation.js +50 -1
  127. package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
  128. package/build/features/business/screens/CivilID/CivilID.js +84 -0
  129. package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
  130. package/build/features/business/screens/CivilID/IDNumber.js +59 -0
  131. package/build/features/business/screens/CivilID/index.d.ts +3 -0
  132. package/build/features/business/screens/CivilID/index.js +2 -0
  133. package/build/features/business/screens/CivilID/validation.d.ts +8 -0
  134. package/build/features/business/screens/CivilID/validation.js +4 -0
  135. package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
  136. package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
  137. package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
  138. package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
  139. package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
  140. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
  141. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +11 -8
  142. package/build/features/business/screens/Verify/Verify.js +4 -4
  143. package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  144. package/build/features/business/screens/VerifyPACI/VerifyPACI.js +156 -0
  145. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +5 -0
  146. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +22 -0
  147. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  148. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  149. package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
  150. package/build/features/business/screens/VerifyPACI/index.js +2 -0
  151. package/build/features/connect/Connect.d.ts +2 -1
  152. package/build/features/connect/Connect.js +47 -12
  153. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
  154. package/build/features/connect/screens/CivilID/CivilID.js +86 -0
  155. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
  156. package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
  157. package/build/features/connect/screens/CivilID/index.d.ts +3 -0
  158. package/build/features/connect/screens/CivilID/index.js +2 -0
  159. package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
  160. package/build/features/connect/screens/CivilID/validation.js +4 -0
  161. package/build/features/connect/screens/Individual/Email.js +11 -3
  162. package/build/features/connect/screens/Individual/Individual.js +27 -14
  163. package/build/features/connect/screens/Merchant/BrandList.js +15 -7
  164. package/build/features/connect/screens/Merchant/BrandName.js +7 -4
  165. package/build/features/connect/screens/Merchant/Merchant.js +47 -50
  166. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +7 -0
  167. package/build/features/connect/screens/Merchant/SalesChannels.js +113 -0
  168. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
  169. package/build/features/connect/screens/Merchant/SocialMedia.js +131 -66
  170. package/build/features/connect/screens/Merchant/TAC.js +8 -2
  171. package/build/features/connect/screens/Merchant/validation.d.ts +22 -45
  172. package/build/features/connect/screens/Merchant/validation.js +117 -116
  173. package/build/features/connect/screens/Mobile/Mobile.js +15 -6
  174. package/build/features/connect/screens/NID/NID.js +2 -1
  175. package/build/features/connect/screens/OTP/OTP.js +5 -4
  176. package/build/features/connect/screens/OTP/OTPInput.js +3 -2
  177. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  178. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +158 -0
  179. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +5 -0
  180. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +22 -0
  181. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  182. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  183. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
  184. package/build/features/connect/screens/VerifyPACI/index.js +2 -0
  185. package/build/features/entity/Entity.d.ts +7 -0
  186. package/build/features/entity/Entity.js +70 -0
  187. package/build/features/entity/index.d.ts +1 -0
  188. package/build/features/entity/index.js +1 -0
  189. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +54 -0
  190. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +140 -0
  191. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.d.ts +5 -0
  192. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +56 -0
  193. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +5 -0
  194. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +17 -0
  195. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +5 -0
  196. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +28 -0
  197. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +6 -0
  198. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +38 -0
  199. package/build/features/{business/screens/Activities → entity/screens/EntityInfoConfirm}/SalesChannels.d.ts +0 -0
  200. package/build/features/{business/screens/Activities → entity/screens/EntityInfoConfirm}/SalesChannels.js +8 -4
  201. package/build/features/entity/screens/EntityInfoConfirm/index.d.ts +2 -0
  202. package/build/features/entity/screens/EntityInfoConfirm/index.js +2 -0
  203. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +107 -0
  204. package/build/features/entity/screens/EntityInfoConfirm/validation.js +17 -0
  205. package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  206. package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  207. package/build/features/entity/screens/ResetPasswordSuccess/index.d.ts +3 -0
  208. package/build/features/entity/screens/ResetPasswordSuccess/index.js +2 -0
  209. package/build/features/entity/screens/Success/Success.d.ts +5 -0
  210. package/build/features/entity/screens/Success/Success.js +16 -0
  211. package/build/features/entity/screens/Success/index.d.ts +3 -0
  212. package/build/features/entity/screens/Success/index.js +2 -0
  213. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
  214. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +110 -0
  215. package/build/features/entity/screens/SuccessWithFlowButtons/index.d.ts +2 -0
  216. package/build/features/entity/screens/SuccessWithFlowButtons/index.js +2 -0
  217. package/build/features/entity/screens/Verify/OTPInput.d.ts +7 -0
  218. package/build/features/entity/screens/Verify/OTPInput.js +47 -0
  219. package/build/features/entity/screens/Verify/Verify.d.ts +5 -0
  220. package/build/features/entity/screens/Verify/Verify.js +78 -0
  221. package/build/features/entity/screens/Verify/index.d.ts +2 -0
  222. package/build/features/entity/screens/Verify/index.js +2 -0
  223. package/build/features/entity/screens/Verify/validation.d.ts +8 -0
  224. package/build/features/entity/screens/Verify/validation.js +4 -0
  225. package/build/features/featuresScreens.d.ts +2 -0
  226. package/build/features/featuresScreens.js +56 -0
  227. package/build/features/individual/Individual.d.ts +1 -1
  228. package/build/features/individual/Individual.js +14 -7
  229. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -1
  230. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
  231. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
  232. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
  233. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -9
  234. package/build/features/individual/screens/Verify/Verify.js +4 -4
  235. package/build/features/password/Password.d.ts +1 -1
  236. package/build/features/password/Password.js +14 -7
  237. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -10
  238. package/build/features/shared/Background/Background.d.ts +7 -5
  239. package/build/features/shared/Background/Background.js +16 -5
  240. package/build/features/shared/Button/Button.d.ts +2 -1
  241. package/build/features/shared/Button/Button.js +2 -2
  242. package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
  243. package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
  244. package/build/features/shared/Button/MobileButton.d.ts +2 -1
  245. package/build/features/shared/Button/MobileButton.js +2 -2
  246. package/build/features/shared/Button/SuccessButton.js +1 -1
  247. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
  248. package/build/features/shared/Dialog/CloseDialog.js +71 -0
  249. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
  250. package/build/features/shared/Dialog/DialogContainer.js +56 -0
  251. package/build/features/shared/Dialog/index.d.ts +4 -0
  252. package/build/features/shared/Dialog/index.js +4 -0
  253. package/build/features/shared/Input/Input.d.ts +1 -1
  254. package/build/features/shared/Input/Input.js +2 -2
  255. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  256. package/build/features/shared/UploadFile/UploadFile.d.ts +9 -3
  257. package/build/features/shared/UploadFile/UploadFile.js +23 -8
  258. package/build/features/signIn/SignIn.d.ts +1 -1
  259. package/build/features/signIn/SignIn.js +14 -6
  260. package/build/features/tax/Tax.d.ts +1 -1
  261. package/build/features/tax/Tax.js +16 -8
  262. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -8
  263. package/build/hooks/index.d.ts +1 -0
  264. package/build/hooks/index.js +1 -0
  265. package/build/hooks/useAppConfig.d.ts +3 -1
  266. package/build/hooks/useAppConfig.js +4 -2
  267. package/build/hooks/useAppDispatch.d.ts +2 -0
  268. package/build/hooks/useErrorListener.js +0 -5
  269. package/build/hooks/useScreen.d.ts +3 -0
  270. package/build/hooks/useScreen.js +14 -0
  271. package/build/index.d.ts +4 -2
  272. package/build/index.js +8 -2
  273. package/build/utils/array.d.ts +13 -1
  274. package/build/utils/array.js +26 -0
  275. package/build/utils/common.d.ts +1 -0
  276. package/build/utils/common.js +3 -0
  277. package/build/utils/device.d.ts +1 -0
  278. package/build/utils/device.js +13 -0
  279. package/build/utils/html.d.ts +1 -0
  280. package/build/utils/html.js +6 -0
  281. package/build/utils/index.d.ts +1 -0
  282. package/build/utils/index.js +1 -0
  283. package/build/utils/locale.js +1 -1
  284. package/build/utils/object.d.ts +1 -0
  285. package/build/utils/object.js +12 -0
  286. package/build/utils/rsa.d.ts +2 -2
  287. package/build/utils/rsa.js +1 -1
  288. package/build/utils/string.d.ts +33 -20
  289. package/build/utils/string.js +71 -1
  290. package/build/utils/validation.d.ts +1 -0
  291. package/build/utils/validation.js +3 -0
  292. package/package.json +3 -2
@@ -1,3 +1,14 @@
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
+ };
1
12
  export var isArray = function (value) { return Array.isArray(value); };
2
13
  export var joinArray = function (items, joiner) {
3
14
  if (joiner === void 0) { joiner = '__'; }
@@ -63,3 +74,18 @@ export var findCountryByIso2 = function (countries, iso2) {
63
74
  throw new Error('iso2 is required');
64
75
  return countries.find(function (country) { return country.iso2.toLowerCase() === iso2.toLowerCase(); });
65
76
  };
77
+ export var findCountryByIddPrefix = function (countries, iddPrefix) {
78
+ if (!iddPrefix)
79
+ throw new Error('idd_prefix is required');
80
+ return countries.find(function (country) { return country.idd_prefix.toString() === iddPrefix; });
81
+ };
82
+ export var mapSalesChannel = function (salesChannel) {
83
+ return salesChannel.map(function (item) {
84
+ var hasSub = item.sub && item.sub.length > 0;
85
+ return __assign(__assign(__assign({}, item), { address: (item.address || '').replaceAll('https://', '').replaceAll('@', '') }), (hasSub && {
86
+ sub: item.sub.map(function (subItem) {
87
+ return __assign(__assign({}, subItem), { address: (subItem.address || '').replaceAll('https://', '').replaceAll('@', '') });
88
+ })
89
+ }));
90
+ });
91
+ };
@@ -0,0 +1 @@
1
+ export declare const sleep: (milliseconds: number) => Promise<unknown>;
@@ -0,0 +1,3 @@
1
+ export var sleep = function (milliseconds) {
2
+ return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
3
+ };
@@ -2,3 +2,4 @@ import { DeviceDetectorResult } from 'device-detector-js';
2
2
  import { GetResult } from '@fingerprintjs/fingerprintjs';
3
3
  export declare const getBrowserInfo: () => DeviceDetectorResult;
4
4
  export declare const getFingerPrint: () => Promise<GetResult>;
5
+ export declare const mobileOS: () => 'Windows Phone' | 'Android' | 'iOS' | 'unknown';
@@ -11,3 +11,16 @@ export var getFingerPrint = function () {
11
11
  });
12
12
  });
13
13
  };
14
+ export var mobileOS = function () {
15
+ var userAgent = navigator.userAgent || navigator.vendor || window.opera;
16
+ if (/windows phone/i.test(userAgent)) {
17
+ return 'Windows Phone';
18
+ }
19
+ if (/android/i.test(userAgent)) {
20
+ return 'Android';
21
+ }
22
+ if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
23
+ return 'iOS';
24
+ }
25
+ return 'unknown';
26
+ };
@@ -2,3 +2,4 @@ export declare const createElementAndInject: (id: string) => HTMLDivElement;
2
2
  export declare const reactElement: (elementId: string) => import("react-dom/client").Root;
3
3
  export declare const scrollUp: (elementId: string, top?: number) => void;
4
4
  export declare const scrollDown: (elementId: string) => void;
5
+ export declare const removeElement: (elementId: string) => void;
@@ -24,3 +24,9 @@ export var scrollDown = function (elementId) {
24
24
  return;
25
25
  el.scrollTop = 0;
26
26
  };
27
+ export var removeElement = function (elementId) {
28
+ var el = document.getElementById(elementId);
29
+ if (!el)
30
+ return;
31
+ el.remove();
32
+ };
@@ -7,3 +7,4 @@ export * from './validation';
7
7
  export * from './string';
8
8
  export * from './device';
9
9
  export * from './rsa';
10
+ export * from './common';
@@ -7,3 +7,4 @@ export * from './validation';
7
7
  export * from './string';
8
8
  export * from './device';
9
9
  export * from './rsa';
10
+ export * from './common';
@@ -1,7 +1,7 @@
1
1
  import { initReactI18next } from 'react-i18next';
2
2
  import i18n from '../i18n';
3
3
  export var updateLocale = function (locale, country) {
4
- var data = locale[country.toUpperCase()] || locale['default'];
4
+ var data = locale['SA'] || locale[country.toUpperCase()] || locale['default'];
5
5
  if (i18n.isInitialized) {
6
6
  i18n.removeResourceBundle('*', 'translation');
7
7
  i18n.addResourceBundle('en', 'translation', data.en.translation);
@@ -2,3 +2,4 @@ export declare const compareTwoObjects: (obj1: any, obj2: any) => boolean;
2
2
  export declare const encodeObjectBase64: (obj: any) => string;
3
3
  export declare const decodeObjectBase64: (str: string) => any;
4
4
  export declare const hasKey: (obj: any, key: string) => boolean;
5
+ export declare const concatenateObjectValues: (data: Record<string, any>, keys: Array<string>) => string;
@@ -21,3 +21,15 @@ export var hasKey = function (obj, key) {
21
21
  return false;
22
22
  return Object.keys(obj).includes(key);
23
23
  };
24
+ export var concatenateObjectValues = function (data, keys) {
25
+ if (!data)
26
+ return '';
27
+ var result = '';
28
+ for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
29
+ var key = keys_1[_i];
30
+ if (data[key]) {
31
+ result += data[key] + ' ';
32
+ }
33
+ }
34
+ return result.trim();
35
+ };
@@ -1,2 +1,2 @@
1
- export declare const encryptObject: (data: unknown) => string | false;
2
- export declare const encryptString: (string: string) => string;
1
+ export declare const encryptObject: (data: unknown) => any;
2
+ export declare const encryptString: (string: string) => any;
@@ -1,5 +1,5 @@
1
- import { JSEncrypt } from 'jsencrypt';
2
1
  import { RSA_FRONTEND_MW_PUBLIC_KEY } from '../constants';
2
+ var JSEncrypt = require('jsencrypt').JSEncrypt;
3
3
  var rsa = new JSEncrypt();
4
4
  rsa.setPublicKey(RSA_FRONTEND_MW_PUBLIC_KEY);
5
5
  export var encryptObject = function (data) {
@@ -3,6 +3,7 @@ export declare const maskPhone: (str?: string) => string;
3
3
  export declare const maskID: (str: string) => string;
4
4
  export declare const maskEmail: (str: string) => string;
5
5
  export declare const showLastFour: (str: string) => string;
6
+ export declare const maskFileName: (str: string) => string;
6
7
  export declare const getIndividualName: (name: string) => {
7
8
  first: string;
8
9
  middle: string;
@@ -15,29 +16,41 @@ export declare const getFlowUrl: (path: string, lang: string) => string;
15
16
  export declare const getResetFlowUrl: (path: string, lang: string, operationType: string, id: string, infoId: string) => string;
16
17
  export declare const capitalizeTheFirstLetterOfEachWord: (words: string) => string;
17
18
  export declare const getRequestHeaders: (deviceInfo: DeviceInfo) => {
18
- al: string;
19
- at: string;
20
- aid: string;
21
- an: string;
22
- av: string;
23
- acv: string;
24
- asv: string;
25
- rn: string;
26
- rt: string;
27
- rb: string;
28
- rm: string;
29
- ro: string;
30
- rov: string;
31
- bn: string;
32
- bb: string;
33
- bv: string;
34
- bua: string;
19
+ al: any;
20
+ at: any;
21
+ aid: any;
22
+ an: any;
23
+ av: any;
24
+ acv: any;
25
+ asv: any;
26
+ rn: any;
27
+ rt: any;
28
+ rb: any;
29
+ rm: any;
30
+ ro: any;
31
+ rov: any;
32
+ bn: any;
33
+ bb: any;
34
+ bv: any;
35
+ bua: any;
35
36
  bi: string;
36
- ci: string;
37
- cm: string;
38
- l: string;
37
+ ci: any;
38
+ cm: any;
39
+ l: any;
39
40
  };
40
41
  export declare const removeRequestHeaders: () => void;
41
42
  export declare const getBaseUrl: () => string;
42
43
  export declare const getScreenNameBasedOnFlow: (flow: string) => "CONNECT_NID_STEP" | "" | "BUSINESS_BUSINESS_TYPE_STEP" | "INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP" | "BANK_BANK_DETAILS_STEP" | "TAX_TAX_DETAILS_STEP";
43
44
  export declare const getEighteenYearsAgo: () => string;
45
+ export declare const isKW: (flag: string) => boolean;
46
+ export declare const isSA: (flag: string) => boolean;
47
+ export declare const isLinkedIn: (flag: string) => boolean;
48
+ export declare const isTwitter: (flag: string) => boolean;
49
+ export declare const isWebsite: (flag: string) => boolean;
50
+ export declare const isIos: (flag: string) => boolean;
51
+ export declare const isAndroid: (flag: string) => boolean;
52
+ export declare const isFacebook: (flag: string) => boolean;
53
+ export declare const isInstagram: (flag: string) => boolean;
54
+ export declare const isPhysicalStore: (flag: string) => boolean;
55
+ export declare const isCallCenter: (flag: string) => boolean;
56
+ export declare const getChannelIcon: (channel: string) => string;
@@ -1,7 +1,7 @@
1
1
  import { FlowsTypes } from '../@types';
2
2
  import { encryptString } from '.';
3
3
  import { removeAxiosGlobalHeaders } from '../api';
4
- import { ENDPOINT_PATHS } from '../constants';
4
+ import { ENDPOINT_PATHS, ICONS_FULL_PATH } from '../constants';
5
5
  import moment from 'moment';
6
6
  export var maskPhone = function (str) {
7
7
  if (str === void 0) { str = ''; }
@@ -23,6 +23,12 @@ export var showLastFour = function (str) {
23
23
  }
24
24
  return str;
25
25
  };
26
+ export var maskFileName = function (str) {
27
+ if (str.length < 28)
28
+ return str;
29
+ var first = str.substring(0, 28);
30
+ return first + '....';
31
+ };
26
32
  export var getIndividualName = function (name) {
27
33
  var _a;
28
34
  var nameArray = (name === null || name === void 0 ? void 0 : name.split(' ')) || [];
@@ -167,3 +173,67 @@ export var getEighteenYearsAgo = function () {
167
173
  var eighteenYearsAgo = new Date();
168
174
  return moment(eighteenYearsAgo.setFullYear(eighteenYearsAgo.getFullYear() - 18)).format('YYYY-MM-DD');
169
175
  };
176
+ export var isKW = function (flag) {
177
+ return ['kw', 'kwd'].includes(flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
178
+ };
179
+ export var isSA = function (flag) {
180
+ return ['sa', 'sau'].includes(flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
181
+ };
182
+ export var isLinkedIn = function (flag) {
183
+ return 'linkedin' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
184
+ };
185
+ export var isTwitter = function (flag) {
186
+ return 'twitter' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
187
+ };
188
+ export var isWebsite = function (flag) {
189
+ return 'website' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
190
+ };
191
+ export var isIos = function (flag) {
192
+ return 'ios' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
193
+ };
194
+ export var isAndroid = function (flag) {
195
+ return 'android' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
196
+ };
197
+ export var isFacebook = function (flag) {
198
+ return 'facebook' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
199
+ };
200
+ export var isInstagram = function (flag) {
201
+ return 'instagram' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
202
+ };
203
+ export var isPhysicalStore = function (flag) {
204
+ return 'physical_store' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
205
+ };
206
+ export var isCallCenter = function (flag) {
207
+ return 'call_center' === (flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
208
+ };
209
+ export var getChannelIcon = function (channel) {
210
+ var key = channel === null || channel === void 0 ? void 0 : channel.toLowerCase();
211
+ if (isWebsite(key)) {
212
+ return ICONS_FULL_PATH + '/website.svg';
213
+ }
214
+ if (isLinkedIn(key)) {
215
+ return ICONS_FULL_PATH + '/LinkedIn-white.png';
216
+ }
217
+ if (isFacebook(key)) {
218
+ return ICONS_FULL_PATH + '/facebook.svg';
219
+ }
220
+ if (isInstagram(key)) {
221
+ return ICONS_FULL_PATH + '/insta.svg';
222
+ }
223
+ if (isTwitter(key)) {
224
+ return ICONS_FULL_PATH + '/twitter-icon.svg';
225
+ }
226
+ if (isPhysicalStore(key)) {
227
+ return ICONS_FULL_PATH + '/physical-store.svg';
228
+ }
229
+ if (isIos(key)) {
230
+ return ICONS_FULL_PATH + '/apple.svg';
231
+ }
232
+ if (isAndroid(key)) {
233
+ return ICONS_FULL_PATH + '/play-store.svgg';
234
+ }
235
+ if (isCallCenter(key)) {
236
+ return ICONS_FULL_PATH + '/call-center.svg';
237
+ }
238
+ return '';
239
+ };
@@ -13,3 +13,4 @@ export declare function isPasswordHasLowerLetter(password: string): boolean;
13
13
  export declare function isPasswordHasSpecialLetter(password: string): boolean;
14
14
  export declare const keepLettersAndSpace: (str: string) => string;
15
15
  export declare const isTapDomain: (domain: string) => boolean;
16
+ export declare const removeArabicWords: (str: string) => string;
@@ -43,3 +43,6 @@ export var keepLettersAndSpace = function (str) {
43
43
  export var isTapDomain = function (domain) {
44
44
  return domain.includes('tap.company');
45
45
  };
46
+ export var removeArabicWords = function (str) {
47
+ return str.replace(/[\u0600-\u06FF]/g, '').trim();
48
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.0.27-test",
3
+ "version": "2.0.27",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",
@@ -87,8 +87,9 @@
87
87
  "i18next": "^21.8.14",
88
88
  "i18next-browser-languagedetector": "^6.1.4",
89
89
  "i18next-http-backend": "^1.4.1",
90
- "jsencrypt": "^3.2.1",
90
+ "jsencrypt": "^2.3.1",
91
91
  "lodash-es": "^4.17.21",
92
+ "lottie-web": "^5.9.6",
92
93
  "moment-hijri": "~2.1.2",
93
94
  "react": "^18.2.0",
94
95
  "react-calendar": "~3.7.0",