@tap-payments/auth-jsconnect 2.12.0-beta → 2.12.0-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 (341) 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 +4 -2
  4. package/build/@types/index.d.ts +1 -0
  5. package/build/@types/index.js +1 -0
  6. package/build/@types/terminal.d.ts +104 -0
  7. package/build/@types/terminal.js +1 -0
  8. package/build/api/account.d.ts +2 -2
  9. package/build/api/account.js +7 -4
  10. package/build/api/auth.d.ts +18 -3
  11. package/build/api/auth.js +7 -3
  12. package/build/api/axios.d.ts +1 -1
  13. package/build/api/axios.js +9 -1
  14. package/build/api/entity.d.ts +3 -0
  15. package/build/api/headers.d.ts +6 -0
  16. package/build/api/headers.js +18 -0
  17. package/build/api/index.d.ts +15 -8
  18. package/build/api/index.js +5 -2
  19. package/build/api/lead.d.ts +3 -2
  20. package/build/api/operator.d.ts +1 -1
  21. package/build/api/operator.js +5 -2
  22. package/build/api/terminal.d.ts +25 -0
  23. package/build/api/terminal.js +55 -0
  24. package/build/app/rootReducer.d.ts +2 -0
  25. package/build/app/rootReducer.js +5 -1
  26. package/build/app/session.d.ts +17 -0
  27. package/build/app/session.js +28 -0
  28. package/build/app/settings.js +1 -1
  29. package/build/app/store.d.ts +4 -0
  30. package/build/assets/currencies/AEDSymbol.js +1 -1
  31. package/build/assets/currencies/SARSymbol.js +1 -1
  32. package/build/assets/locales/ar.json +51 -15
  33. package/build/assets/locales/en.json +56 -46
  34. package/build/components/DeviceCard/DeviceCard.d.ts +19 -0
  35. package/build/components/DeviceCard/DeviceCard.js +102 -0
  36. package/build/components/DeviceCard/index.d.ts +3 -0
  37. package/build/components/DeviceCard/index.js +2 -0
  38. package/build/components/OTPTimer/OTPTimer.d.ts +2 -1
  39. package/build/components/OTPTimer/OTPTimer.js +4 -4
  40. package/build/components/Tooltip/Tooltip.js +1 -1
  41. package/build/components/TruncatedTooltipText/TruncatedTooltipText.d.ts +7 -0
  42. package/build/components/TruncatedTooltipText/TruncatedTooltipText.js +33 -0
  43. package/build/components/TruncatedTooltipText/index.d.ts +2 -0
  44. package/build/components/TruncatedTooltipText/index.js +2 -0
  45. package/build/constants/api.d.ts +1 -1
  46. package/build/constants/api.js +2 -2
  47. package/build/constants/app.d.ts +27 -3
  48. package/build/constants/app.js +350 -40
  49. package/build/constants/dummy.d.ts +2 -29
  50. package/build/constants/dummy.js +4 -4
  51. package/build/constants/flows.d.ts +27 -22
  52. package/build/constants/flows.js +27 -23
  53. package/build/constants/validation.d.ts +2 -0
  54. package/build/constants/validation.js +2 -0
  55. package/build/features/app/auth/authStore.d.ts +4 -0
  56. package/build/features/app/auth/authStore.js +168 -54
  57. package/build/features/app/bank/bankStore.d.ts +7 -0
  58. package/build/features/app/bank/bankStore.js +110 -20
  59. package/build/features/app/board/boardStore.d.ts +5 -0
  60. package/build/features/app/board/boardStore.js +94 -7
  61. package/build/features/app/brand/brandStore.d.ts +7 -0
  62. package/build/features/app/brand/brandStore.js +107 -19
  63. package/build/features/app/business/businessStore.d.ts +10 -0
  64. package/build/features/app/business/businessStore.js +130 -37
  65. package/build/features/app/connect/connectStore.d.ts +12 -5
  66. package/build/features/app/connect/connectStore.js +146 -31
  67. package/build/features/app/connectExpress/connectExpressStore.d.ts +10 -5
  68. package/build/features/app/connectExpress/connectExpressStore.js +159 -21
  69. package/build/features/app/entity/entityStore.d.ts +7 -0
  70. package/build/features/app/entity/entityStore.js +108 -18
  71. package/build/features/app/individual/individualStore.d.ts +9 -0
  72. package/build/features/app/individual/individualStore.js +126 -34
  73. package/build/features/app/kyc/kycStore.d.ts +5 -5
  74. package/build/features/app/kyc/kycStore.js +4 -1
  75. package/build/features/app/password/passwordStore.d.ts +9 -0
  76. package/build/features/app/password/passwordStore.js +130 -46
  77. package/build/features/app/signIn/signInStore.js +12 -16
  78. package/build/features/app/tax/taxStore.d.ts +7 -0
  79. package/build/features/app/tax/taxStore.js +104 -17
  80. package/build/features/app/terminal/terminalStore.d.ts +119 -0
  81. package/build/features/app/terminal/terminalStore.js +781 -0
  82. package/build/features/auth/Auth.js +3 -2
  83. package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +10 -7
  84. package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +6 -3
  85. package/build/features/auth/screens/AuthenticationList/EntityLicenseType.js +6 -4
  86. package/build/features/auth/screens/AuthenticationList/EntityList.js +11 -3
  87. package/build/features/auth/screens/OTPSessionExpired/OTPInput.d.ts +3 -0
  88. package/build/features/auth/screens/OTPSessionExpired/OTPInput.js +58 -0
  89. package/build/features/auth/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
  90. package/build/features/auth/screens/OTPSessionExpired/OTPSessionExpired.js +85 -0
  91. package/build/features/auth/screens/OTPSessionExpired/index.d.ts +2 -0
  92. package/build/features/auth/screens/OTPSessionExpired/index.js +2 -0
  93. package/build/features/auth/screens/OTPSessionExpired/validation.d.ts +8 -0
  94. package/build/features/auth/screens/OTPSessionExpired/validation.js +4 -0
  95. package/build/features/bank/Bank.js +3 -2
  96. package/build/features/bank/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
  97. package/build/features/bank/screens/OTPSessionExpired/OTPInput.js +51 -0
  98. package/build/features/bank/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
  99. package/build/features/bank/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
  100. package/build/features/bank/screens/OTPSessionExpired/index.d.ts +2 -0
  101. package/build/features/bank/screens/OTPSessionExpired/index.js +2 -0
  102. package/build/features/bank/screens/OTPSessionExpired/validation.d.ts +8 -0
  103. package/build/features/bank/screens/OTPSessionExpired/validation.js +4 -0
  104. package/build/features/board/Board.js +5 -4
  105. package/build/features/board/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
  106. package/build/features/board/screens/OTPSessionExpired/OTPInput.js +51 -0
  107. package/build/features/board/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
  108. package/build/features/board/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
  109. package/build/features/board/screens/OTPSessionExpired/index.d.ts +2 -0
  110. package/build/features/board/screens/OTPSessionExpired/index.js +2 -0
  111. package/build/features/board/screens/OTPSessionExpired/validation.d.ts +8 -0
  112. package/build/features/board/screens/OTPSessionExpired/validation.js +4 -0
  113. package/build/features/brand/Brand.js +3 -2
  114. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +2 -2
  115. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +1 -1
  116. package/build/features/brand/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
  117. package/build/features/brand/screens/OTPSessionExpired/OTPInput.js +51 -0
  118. package/build/features/brand/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
  119. package/build/features/brand/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
  120. package/build/features/brand/screens/OTPSessionExpired/index.d.ts +2 -0
  121. package/build/features/brand/screens/OTPSessionExpired/index.js +2 -0
  122. package/build/features/brand/screens/OTPSessionExpired/validation.d.ts +8 -0
  123. package/build/features/brand/screens/OTPSessionExpired/validation.js +4 -0
  124. package/build/features/business/Business.js +3 -2
  125. package/build/features/business/screens/BusinessType/BusinessType.js +15 -5
  126. package/build/features/business/screens/BusinessType/EntityLicenseList.js +11 -5
  127. package/build/features/business/screens/BusinessType/LicenseList.js +20 -12
  128. package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
  129. package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +35 -0
  130. package/build/features/business/screens/BusinessType/UnifiedNumber.js +84 -0
  131. package/build/features/business/screens/BusinessType/validation.d.ts +6 -3
  132. package/build/features/business/screens/BusinessType/validation.js +31 -10
  133. package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
  134. package/build/features/business/screens/Customers/RefundPolicy.d.ts +1 -1
  135. package/build/features/business/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
  136. package/build/features/business/screens/OTPSessionExpired/OTPInput.js +51 -0
  137. package/build/features/business/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
  138. package/build/features/business/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
  139. package/build/features/business/screens/OTPSessionExpired/index.d.ts +2 -0
  140. package/build/features/business/screens/OTPSessionExpired/index.js +2 -0
  141. package/build/features/business/screens/OTPSessionExpired/validation.d.ts +8 -0
  142. package/build/features/business/screens/OTPSessionExpired/validation.js +4 -0
  143. package/build/features/connect/Connect.js +3 -2
  144. package/build/features/connect/screens/OTPSessionExpired/OTPInput.d.ts +5 -0
  145. package/build/features/connect/screens/OTPSessionExpired/OTPInput.js +58 -0
  146. package/build/features/connect/screens/OTPSessionExpired/OTPSessionExpired.d.ts +3 -0
  147. package/build/features/connect/screens/OTPSessionExpired/OTPSessionExpired.js +86 -0
  148. package/build/features/connect/screens/OTPSessionExpired/index.d.ts +2 -0
  149. package/build/features/connect/screens/OTPSessionExpired/index.js +2 -0
  150. package/build/features/connect/screens/OTPSessionExpired/validation.d.ts +8 -0
  151. package/build/features/connect/screens/OTPSessionExpired/validation.js +4 -0
  152. package/build/features/connectExpress/ConnectExpress.js +3 -2
  153. package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +10 -10
  154. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +6 -3
  155. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +6 -4
  156. package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +11 -3
  157. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -0
  158. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +27 -16
  159. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
  160. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +2 -2
  161. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +1 -1
  162. package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +36 -0
  163. package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.js +81 -0
  164. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +6 -3
  165. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +57 -21
  166. package/build/features/connectExpress/screens/Mobile/Mobile.js +7 -6
  167. package/build/features/connectExpress/screens/OTPSessionExpired/OTPInput.d.ts +3 -0
  168. package/build/features/connectExpress/screens/OTPSessionExpired/OTPInput.js +58 -0
  169. package/build/features/connectExpress/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
  170. package/build/features/connectExpress/screens/OTPSessionExpired/OTPSessionExpired.js +85 -0
  171. package/build/features/connectExpress/screens/OTPSessionExpired/index.d.ts +2 -0
  172. package/build/features/connectExpress/screens/OTPSessionExpired/index.js +2 -0
  173. package/build/features/connectExpress/screens/OTPSessionExpired/validation.d.ts +8 -0
  174. package/build/features/connectExpress/screens/OTPSessionExpired/validation.js +4 -0
  175. package/build/features/entity/Entity.js +3 -2
  176. package/build/features/entity/screens/EntityName/EntityName.js +16 -15
  177. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +2 -2
  178. package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
  179. package/build/features/entity/screens/EntityName/validation.d.ts +50 -48
  180. package/build/features/entity/screens/EntityName/validation.js +100 -85
  181. package/build/features/entity/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
  182. package/build/features/entity/screens/OTPSessionExpired/OTPInput.js +51 -0
  183. package/build/features/entity/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
  184. package/build/features/entity/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
  185. package/build/features/entity/screens/OTPSessionExpired/index.d.ts +2 -0
  186. package/build/features/entity/screens/OTPSessionExpired/index.js +2 -0
  187. package/build/features/entity/screens/OTPSessionExpired/validation.d.ts +8 -0
  188. package/build/features/entity/screens/OTPSessionExpired/validation.js +4 -0
  189. package/build/features/featuresScreens.d.ts +1 -0
  190. package/build/features/featuresScreens.js +187 -0
  191. package/build/features/individual/Individual.js +3 -2
  192. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +2 -2
  193. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -2
  194. package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -2
  195. package/build/features/individual/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
  196. package/build/features/individual/screens/OTPSessionExpired/OTPInput.js +51 -0
  197. package/build/features/individual/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
  198. package/build/features/individual/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
  199. package/build/features/individual/screens/OTPSessionExpired/index.d.ts +2 -0
  200. package/build/features/individual/screens/OTPSessionExpired/index.js +2 -0
  201. package/build/features/individual/screens/OTPSessionExpired/validation.d.ts +8 -0
  202. package/build/features/individual/screens/OTPSessionExpired/validation.js +4 -0
  203. package/build/features/password/Password.js +3 -2
  204. package/build/features/password/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
  205. package/build/features/password/screens/OTPSessionExpired/OTPInput.js +51 -0
  206. package/build/features/password/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
  207. package/build/features/password/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
  208. package/build/features/password/screens/OTPSessionExpired/index.d.ts +2 -0
  209. package/build/features/password/screens/OTPSessionExpired/index.js +2 -0
  210. package/build/features/password/screens/OTPSessionExpired/validation.d.ts +8 -0
  211. package/build/features/password/screens/OTPSessionExpired/validation.js +4 -0
  212. package/build/features/shared/Address/CountryList.d.ts +1 -1
  213. package/build/features/shared/Address/InputSelect.d.ts +1 -1
  214. package/build/features/shared/Button/Button.js +1 -1
  215. package/build/features/shared/Button/FlowsButtons.d.ts +1 -0
  216. package/build/features/shared/Button/FlowsButtons.js +2 -2
  217. package/build/features/shared/OTPVerifySecurityError/OTPVerifySecurityError.d.ts +3 -0
  218. package/build/features/shared/OTPVerifySecurityError/OTPVerifySecurityError.js +9 -0
  219. package/build/features/shared/OTPVerifySecurityError/index.d.ts +2 -0
  220. package/build/features/shared/OTPVerifySecurityError/index.js +2 -0
  221. package/build/features/shared/PushNotification/PushNotification.d.ts +11 -0
  222. package/build/features/shared/PushNotification/PushNotification.js +34 -0
  223. package/build/features/shared/PushNotification/index.d.ts +2 -0
  224. package/build/features/shared/PushNotification/index.js +2 -0
  225. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +2 -1
  226. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +6 -5
  227. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
  228. package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
  229. package/build/features/tax/Tax.js +3 -2
  230. package/build/features/tax/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
  231. package/build/features/tax/screens/OTPSessionExpired/OTPInput.js +51 -0
  232. package/build/features/tax/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
  233. package/build/features/tax/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
  234. package/build/features/tax/screens/OTPSessionExpired/index.d.ts +2 -0
  235. package/build/features/tax/screens/OTPSessionExpired/index.js +2 -0
  236. package/build/features/tax/screens/OTPSessionExpired/validation.d.ts +8 -0
  237. package/build/features/tax/screens/OTPSessionExpired/validation.js +4 -0
  238. package/build/features/terminal/Terminal.d.ts +14 -0
  239. package/build/features/terminal/Terminal.js +96 -0
  240. package/build/features/terminal/index.d.ts +1 -0
  241. package/build/features/terminal/index.js +1 -0
  242. package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.d.ts +3 -0
  243. package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +68 -0
  244. package/build/features/terminal/screens/LinkNewTerminal/index.d.ts +2 -0
  245. package/build/features/terminal/screens/LinkNewTerminal/index.js +2 -0
  246. package/build/features/terminal/screens/LinkNewTerminal/styles.d.ts +10 -0
  247. package/build/features/terminal/screens/LinkNewTerminal/styles.js +28 -0
  248. package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.d.ts +3 -0
  249. package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +50 -0
  250. package/build/features/terminal/screens/LinkedSuccess/index.d.ts +2 -0
  251. package/build/features/terminal/screens/LinkedSuccess/index.js +2 -0
  252. package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.d.ts +3 -0
  253. package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +55 -0
  254. package/build/features/terminal/screens/LinkedTerminalInfo/index.d.ts +2 -0
  255. package/build/features/terminal/screens/LinkedTerminalInfo/index.js +2 -0
  256. package/build/features/terminal/screens/Loading/Loading.d.ts +4 -0
  257. package/build/features/terminal/screens/Loading/Loading.js +10 -0
  258. package/build/features/terminal/screens/Loading/index.d.ts +2 -0
  259. package/build/features/terminal/screens/Loading/index.js +2 -0
  260. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.d.ts +3 -0
  261. package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +103 -0
  262. package/build/features/terminal/screens/NoTerminalDeviceLinked/index.d.ts +2 -0
  263. package/build/features/terminal/screens/NoTerminalDeviceLinked/index.js +2 -0
  264. package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.d.ts +36 -0
  265. package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.js +34 -0
  266. package/build/features/terminal/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
  267. package/build/features/terminal/screens/OTPSessionExpired/OTPInput.js +51 -0
  268. package/build/features/terminal/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
  269. package/build/features/terminal/screens/OTPSessionExpired/OTPSessionExpired.js +89 -0
  270. package/build/features/terminal/screens/OTPSessionExpired/index.d.ts +2 -0
  271. package/build/features/terminal/screens/OTPSessionExpired/index.js +2 -0
  272. package/build/features/terminal/screens/OTPSessionExpired/validation.d.ts +8 -0
  273. package/build/features/terminal/screens/OTPSessionExpired/validation.js +4 -0
  274. package/build/features/terminal/screens/OperatorError/OperatorError.d.ts +5 -0
  275. package/build/features/terminal/screens/OperatorError/OperatorError.js +9 -0
  276. package/build/features/terminal/screens/OperatorError/index.d.ts +2 -0
  277. package/build/features/terminal/screens/OperatorError/index.js +2 -0
  278. package/build/features/terminal/screens/POSDeviceListPage/POSDeviceListPage.d.ts +3 -0
  279. package/build/features/terminal/screens/POSDeviceListPage/POSDeviceListPage.js +50 -0
  280. package/build/features/terminal/screens/POSDeviceListPage/index.d.ts +2 -0
  281. package/build/features/terminal/screens/POSDeviceListPage/index.js +2 -0
  282. package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +3 -0
  283. package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +21 -0
  284. package/build/features/terminal/screens/ResetPasswordSuccess/index.d.ts +2 -0
  285. package/build/features/terminal/screens/ResetPasswordSuccess/index.js +2 -0
  286. package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
  287. package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +32 -0
  288. package/build/features/terminal/screens/SuccessWithFlowButtons/index.d.ts +2 -0
  289. package/build/features/terminal/screens/SuccessWithFlowButtons/index.js +2 -0
  290. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +9 -0
  291. package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +20 -0
  292. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.d.ts +3 -0
  293. package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +153 -0
  294. package/build/features/terminal/screens/TerminalDeviceList/index.d.ts +2 -0
  295. package/build/features/terminal/screens/TerminalDeviceList/index.js +2 -0
  296. package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +9 -0
  297. package/build/features/terminal/screens/TerminalDeviceList/styles.js +13 -0
  298. package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.d.ts +3 -0
  299. package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +51 -0
  300. package/build/features/terminal/screens/UnlinkedSuccess/index.d.ts +2 -0
  301. package/build/features/terminal/screens/UnlinkedSuccess/index.js +2 -0
  302. package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.d.ts +3 -0
  303. package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +99 -0
  304. package/build/features/terminal/screens/UnlinkedTerminalInfo/index.d.ts +2 -0
  305. package/build/features/terminal/screens/UnlinkedTerminalInfo/index.js +2 -0
  306. package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +26 -0
  307. package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +30 -0
  308. package/build/features/terminal/screens/Verify/OTPInput.d.ts +7 -0
  309. package/build/features/terminal/screens/Verify/OTPInput.js +51 -0
  310. package/build/features/terminal/screens/Verify/Verify.d.ts +5 -0
  311. package/build/features/terminal/screens/Verify/Verify.js +89 -0
  312. package/build/features/terminal/screens/Verify/index.d.ts +2 -0
  313. package/build/features/terminal/screens/Verify/index.js +2 -0
  314. package/build/features/terminal/screens/Verify/validation.d.ts +8 -0
  315. package/build/features/terminal/screens/Verify/validation.js +4 -0
  316. package/build/features/terminal/screens/shared/Header.d.ts +10 -0
  317. package/build/features/terminal/screens/shared/Header.js +30 -0
  318. package/build/features/terminal/screens/shared/POSDeviceList.d.ts +11 -0
  319. package/build/features/terminal/screens/shared/POSDeviceList.js +30 -0
  320. package/build/features/terminal/screens/shared/index.d.ts +5 -0
  321. package/build/features/terminal/screens/shared/index.js +5 -0
  322. package/build/features/terminal/screens/shared/styles.d.ts +196 -0
  323. package/build/features/terminal/screens/shared/styles.js +155 -0
  324. package/build/features/terminal/screens/shared/utils.d.ts +7 -0
  325. package/build/features/terminal/screens/shared/utils.js +24 -0
  326. package/build/hooks/index.d.ts +1 -0
  327. package/build/hooks/index.js +1 -0
  328. package/build/hooks/useAppDispatch.d.ts +2 -0
  329. package/build/hooks/useSessionExpiryHandler.d.ts +8 -0
  330. package/build/hooks/useSessionExpiryHandler.js +71 -0
  331. package/build/index.d.ts +3 -2
  332. package/build/index.js +4 -2
  333. package/build/theme/palette.js +12 -0
  334. package/build/theme/typography.js +4 -0
  335. package/build/utils/common.js +13 -6
  336. package/build/utils/error.d.ts +4 -0
  337. package/build/utils/error.js +12 -0
  338. package/build/utils/string.d.ts +3 -1
  339. package/build/utils/string.js +12 -2
  340. package/build/utils/validation.js +1 -1
  341. package/package.json +3 -3
@@ -56,11 +56,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
56
56
  };
57
57
  var _a;
58
58
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
59
- import API from '../../../api';
59
+ import API, { setAuthSessionToGlobalHeaders } from '../../../api';
60
60
  import { BusinessType, FlowsTypes, DocumentPurpose, LicenseType } from '../../../@types';
61
61
  import { BUSINESS_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, EXPECTED_SALES_LIST, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_ENTITY_LICENSE, OTHER_FL_LICENSE, defaultCountry } from '../../../constants';
62
- import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense, isOtherThanKWOrSA, hasNoneEditableValue, sendCustomEventToGTM, findCountryByIddPrefix, isNetworkError, isTimeoutError } from '../../../utils';
63
- import { handleNextScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
62
+ import { convertNumbers2English, hasKey, sleep, isKW, isSA, dateFormat, isOtherLicense, isOtherThanKWOrSA, hasNoneEditableValue, sendCustomEventToGTM, findCountryByIddPrefix, isNetworkError, isTimeoutError, isAuthenticationVerificationFailed } from '../../../utils';
63
+ import { handleCurrentActiveScreen, handleNextScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
64
64
  export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
65
65
  var payload, data, publicKey, countryIso2, boardData, brandData, isicActivityList, leadData, _a, steps, brand, board_id, business_id, entity, brandID, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, list, list;
66
66
  var _b, _c;
@@ -78,6 +78,7 @@ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', functio
78
78
  throw new Error(data.errors[0].description);
79
79
  if (data.mw_error)
80
80
  throw new Error(data.mw_error);
81
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
81
82
  publicKey = (_c = data === null || data === void 0 ? void 0 : data.config) === null || _c === void 0 ? void 0 : _c.public_key;
82
83
  if (publicKey) {
83
84
  thunkApi.dispatch(handlePublicKey(publicKey));
@@ -198,9 +199,9 @@ export var resendOTP = createAsyncThunk('resendOTPBusiness', function (params, t
198
199
  }); });
199
200
  export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
200
201
  var _a, business, settings, isNID, responseBody, stepName, payload, data, publicKey, brandData, isicActivityList, leadData, brand, country_code, steps, board_id, business_id, entity, brandID, countryIso2, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, isIdentityAuthStep, boardResponse, list, list;
201
- var _b, _c, _d, _e, _f, _g, _h, _j;
202
- return __generator(this, function (_k) {
203
- switch (_k.label) {
202
+ var _b, _c, _d, _e, _f, _g, _h;
203
+ return __generator(this, function (_j) {
204
+ switch (_j.label) {
204
205
  case 0:
205
206
  _a = thunkApi.getState(), business = _a.business, settings = _a.settings;
206
207
  isNID = business.data.otpData.isNID;
@@ -213,26 +214,29 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
213
214
  step_name: stepName,
214
215
  encryption_contract: ['data']
215
216
  };
216
- return [4, API.leadService.verifyLeadOTP(payload)];
217
+ return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
218
+ if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
219
+ thunkApi.dispatch(handleNextScreenStep('BUSINESS_OTP_VERIFY_SECURITY_ERROR_STEP'));
220
+ throw new Error(err === null || err === void 0 ? void 0 : err.message);
221
+ })];
217
222
  case 1:
218
- data = (_k.sent()).data;
219
- if ((_f = data.errors) === null || _f === void 0 ? void 0 : _f.length)
220
- throw new Error(data.errors[0].description);
221
- publicKey = (_g = data === null || data === void 0 ? void 0 : data.config) === null || _g === void 0 ? void 0 : _g.public_key;
223
+ data = _j.sent();
224
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
225
+ publicKey = (_f = data === null || data === void 0 ? void 0 : data.config) === null || _f === void 0 ? void 0 : _f.public_key;
222
226
  if (publicKey) {
223
227
  thunkApi.dispatch(handlePublicKey(publicKey));
224
228
  }
225
229
  isicActivityList = undefined;
226
230
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
227
231
  case 2:
228
- leadData = (_k.sent()).data;
232
+ leadData = (_j.sent()).data;
229
233
  thunkApi.dispatch(updateStepName(stepName));
230
234
  brand = leadData.brand, country_code = leadData.country_code, steps = leadData.steps, board_id = leadData.board_id, business_id = leadData.business_id, entity = leadData.entity;
231
235
  brandID = brand === null || brand === void 0 ? void 0 : brand.id;
232
236
  countryIso2 = country_code;
233
237
  if (countryIso2)
234
238
  thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
235
- (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, { otp: params.otp });
239
+ (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, { otp: params.otp });
236
240
  hasBusinessCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_SUCCESS);
237
241
  hasBusinessCRInfoCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_INFO) && hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_INFO_CONFIRM);
238
242
  hasBusinessCRActivitiesCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_ACTIVITIES);
@@ -241,14 +245,14 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
241
245
  if (!(!isIdentityAuthStep && !hasBusinessCRInfoCompleted)) return [3, 4];
242
246
  return [4, thunkApi.dispatch(retrieveAllEntityList({ businessId: business_id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
243
247
  case 3:
244
- _k.sent();
245
- _k.label = 4;
248
+ _j.sent();
249
+ _j.label = 4;
246
250
  case 4:
247
251
  if (!(isSA(countryIso2) && !isIdentityAuthStep && !hasBusinessCRInfoCompleted)) return [3, 6];
248
252
  return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
249
253
  case 5:
250
- _k.sent();
251
- _k.label = 6;
254
+ _j.sent();
255
+ _j.label = 6;
252
256
  case 6:
253
257
  if (!isNID) return [3, 7];
254
258
  thunkApi.dispatch(handleNextScreenStep());
@@ -262,12 +266,12 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
262
266
  if (!board_id) return [3, 11];
263
267
  return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
264
268
  case 9:
265
- boardResponse = _k.sent();
269
+ boardResponse = _j.sent();
266
270
  leadData = __assign(__assign({}, leadData), { flows: (boardResponse === null || boardResponse === void 0 ? void 0 : boardResponse.info) || [] });
267
271
  return [4, thunkApi.dispatch(retrieveBoardDetails(board_id))];
268
272
  case 10:
269
- _k.sent();
270
- _k.label = 11;
273
+ _j.sent();
274
+ _j.label = 11;
271
275
  case 11:
272
276
  sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP')); });
273
277
  return [3, 23];
@@ -287,34 +291,84 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
287
291
  if (!hasBusinessCRActivitiesCompleted) return [3, 19];
288
292
  return [4, API.dataService.getActivitiesIsIc()];
289
293
  case 16:
290
- list = (_k.sent()).list;
294
+ list = (_j.sent()).list;
291
295
  isicActivityList = list || [];
292
296
  return [4, thunkApi.dispatch(retrieveDataList())];
293
297
  case 17:
294
- _k.sent();
298
+ _j.sent();
295
299
  return [4, API.brandService.retrieveBrand(brandID)];
296
300
  case 18:
297
- brandData = _k.sent();
301
+ brandData = _j.sent();
298
302
  sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP')); });
299
303
  return [3, 23];
300
304
  case 19:
301
305
  if (!hasBusinessCRInfoCompleted) return [3, 22];
302
306
  return [4, API.dataService.getActivitiesIsIc()];
303
307
  case 20:
304
- list = (_k.sent()).list;
308
+ list = (_j.sent()).list;
305
309
  isicActivityList = list || [];
306
310
  return [4, API.brandService.retrieveBrand(brandID)];
307
311
  case 21:
308
- brandData = _k.sent();
312
+ brandData = _j.sent();
309
313
  sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP')); });
310
314
  return [3, 23];
311
315
  case 22:
312
316
  sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP')); });
313
- _k.label = 23;
317
+ _j.label = 23;
314
318
  case 23: return [2, { data: data, verifyNextStepName: data.step_name, isicActivityList: isicActivityList, formData: __assign(__assign({}, params), { isNID: isNID }), brand: brandData === null || brandData === void 0 ? void 0 : brandData.brand, leadData: leadData }];
315
319
  }
316
320
  });
317
321
  }); });
322
+ export var verifyLeadTokenSessionExpired = createAsyncThunk('business/verifyLeadTokenSessionExpired', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
323
+ var business, payload, data;
324
+ return __generator(this, function (_a) {
325
+ switch (_a.label) {
326
+ case 0:
327
+ business = thunkApi.getState().business;
328
+ payload = {
329
+ service_name: 'tap_email',
330
+ verify_token: business.data.verify.token
331
+ };
332
+ return [4, API.leadService.verifyToken(payload)];
333
+ case 1:
334
+ data = _a.sent();
335
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
336
+ if (redirect)
337
+ thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_SESSION_EXPIRED_OTP_STEP'));
338
+ return [2, { data: data }];
339
+ }
340
+ });
341
+ }); });
342
+ export var verifyLeadOTPSessionExpired = createAsyncThunk('business/verifyLeadOTPSessionExpired', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
343
+ var _a, business, settings, session, isNID, responseBody, payload, data;
344
+ var _b, _c, _d, _e, _f, _g;
345
+ return __generator(this, function (_h) {
346
+ switch (_h.label) {
347
+ case 0:
348
+ _a = thunkApi.getState(), business = _a.business, settings = _a.settings, session = _a.session;
349
+ isNID = business.data.otpData.isNID;
350
+ responseBody = (isNID ? business.data.nidData : business.data.verify).responseBody;
351
+ payload = {
352
+ data: params.otp,
353
+ service_name: ((_c = (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_token) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.service_name) || ((_d = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _d === void 0 ? void 0 : _d.service_name),
354
+ verify_token: ((_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_token) === null || _e === void 0 ? void 0 : _e.verify_token) || (responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token),
355
+ step_name: BUSINESS_STEP_NAMES.PHONE_AUTH,
356
+ encryption_contract: ['data']
357
+ };
358
+ return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
359
+ if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
360
+ thunkApi.dispatch(handleCurrentActiveScreen('BUSINESS_OTP_VERIFY_SECURITY_ERROR_STEP'));
361
+ throw new Error(err === null || err === void 0 ? void 0 : err.message);
362
+ })];
363
+ case 1:
364
+ data = _h.sent();
365
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
366
+ (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, { otp: params.otp });
367
+ thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
368
+ return [2, { data: data, formData: __assign(__assign({}, params), { isNID: false }) }];
369
+ }
370
+ });
371
+ }); });
318
372
  export var verifyNafath = createAsyncThunk('business/verifyNafathParams', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
319
373
  var _a, settings, business, responseBody, expiry, interval, maxCalls, count, data, error_1, isSuccess, isFailed, isNextScreenDob, isNextScreenCollectMobileOwnership, screen_1;
320
374
  var _b, _c, _d, _e, _f, _g;
@@ -651,26 +705,26 @@ export var retrieveBoardDetails = createAsyncThunk('retrieveBoardDetails', funct
651
705
  });
652
706
  }); });
653
707
  export var updateLeadBusinessType = createAsyncThunk('updateLeadBusinessType', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
654
- var _a, settings, business, isKWCountry, selectedLicense, licenseNumber, entityLegalName, certificateId, articleId, selectedEntityLicense, isFL, _b, lead_id, brand, stepName, payload, data, accountBody, accountData, documentData, entityData, brandData, data_1, brandRes, _c, message, error, list, entityId, documentBody, payload_1;
708
+ var _a, settings, business, isKWCountry, selectedLicense, licenseNumber, entityLegalName, certificateId, articleId, selectedEntityLicense, unifiedNumber, isFL, _b, lead_id, brand, stepName, payload, data, accountBody, accountData, documentData, entityData, brandData, data_1, brandRes, _c, message, error, list, entityId, documentBody, payload_1;
655
709
  var _d, _e, _f;
656
710
  return __generator(this, function (_g) {
657
711
  switch (_g.label) {
658
712
  case 0:
659
713
  _a = thunkApi.getState(), settings = _a.settings, business = _a.business;
660
714
  isKWCountry = isKW(settings.data.businessCountry.iso2);
661
- selectedLicense = params.selectedLicense, licenseNumber = params.licenseNumber, entityLegalName = params.entityLegalName, certificateId = params.certificateId, articleId = params.articleId, selectedEntityLicense = params.selectedEntityLicense;
715
+ selectedLicense = params.selectedLicense, licenseNumber = params.licenseNumber, entityLegalName = params.entityLegalName, certificateId = params.certificateId, articleId = params.articleId, selectedEntityLicense = params.selectedEntityLicense, unifiedNumber = params.unifiedNumber;
662
716
  isFL = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.FL;
663
717
  _b = business.data.verify.responseBody || {}, lead_id = _b.lead_id, brand = _b.brand;
664
718
  stepName = 'BUSINESS_ACTIVITIES_STEP';
665
719
  payload = __assign(__assign(__assign(__assign({ id: lead_id || '', entity: {
666
720
  id: (selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) && (isKWCountry ? !isFL : true) ? selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id : ''
667
- } }, (!(selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) && {
721
+ }, unified_number: unifiedNumber }, (!(selectedEntityLicense === null || selectedEntityLicense === void 0 ? void 0 : selectedEntityLicense.id) && {
668
722
  license_number: isKWCountry && isFL ? '' : licenseNumber,
669
723
  license_type: isFL ? LicenseType.FL : LicenseType.CR,
670
724
  business_type: selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type
671
725
  })), { step_name: BUSINESS_STEP_NAMES.BUSINESS_CR_INFO }), (isKWCountry && {
672
726
  business_name: isFL ? undefined : { ar: entityLegalName, en: entityLegalName }
673
- })), { encryption_contract: ['license_number', 'business_type', 'license_type'] });
727
+ })), { encryption_contract: ['license_number', 'business_type', 'license_type', 'entity.unified_number'] });
674
728
  return [4, API.leadService.updateLead(payload)];
675
729
  case 1:
676
730
  data = _g.sent();
@@ -988,6 +1042,7 @@ var initialState = {
988
1042
  businessTypeData: {
989
1043
  licenseNumber: '',
990
1044
  entityLegalName: '',
1045
+ unifiedNumber: '',
991
1046
  isPrevDob: false
992
1047
  },
993
1048
  activitiesData: {
@@ -1134,9 +1189,43 @@ export var businessSlice = createSlice({
1134
1189
  var licenseList = [OTHER_CR_LICENSE, OTHER_FL_LICENSE];
1135
1190
  state.data.businessTypeData.responseBody = __assign(__assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activityList: isicActivityList }), (!((_e = (_d = (_c = state.data.businessTypeData) === null || _c === void 0 ? void 0 : _c.responseBody) === null || _d === void 0 ? void 0 : _d.licenseList) === null || _e === void 0 ? void 0 : _e.length) && { licenseList: licenseList }));
1136
1191
  })
1137
- .addCase(verifyLeadOTP.rejected, function (state, action) {
1192
+ .addCase(verifyLeadOTP.rejected, function (state, _a) {
1193
+ var message = _a.error.message;
1194
+ state.loading = false;
1195
+ if (!isAuthenticationVerificationFailed(message))
1196
+ state.error = message;
1197
+ })
1198
+ .addCase(verifyLeadTokenSessionExpired.pending, function (state) {
1199
+ state.error = null;
1200
+ state.loading = true;
1201
+ })
1202
+ .addCase(verifyLeadTokenSessionExpired.fulfilled, function (state, action) {
1203
+ state.error = null;
1138
1204
  state.loading = false;
1205
+ var data = action.payload.data;
1206
+ var responseBody = state.data.verify.responseBody;
1207
+ state.data.verify.responseBody = __assign(__assign({}, responseBody), data);
1208
+ })
1209
+ .addCase(verifyLeadTokenSessionExpired.rejected, function (state, action) {
1139
1210
  state.error = action.error.message;
1211
+ state.loading = false;
1212
+ })
1213
+ .addCase(verifyLeadOTPSessionExpired.pending, function (state) {
1214
+ state.loading = true;
1215
+ state.error = null;
1216
+ })
1217
+ .addCase(verifyLeadOTPSessionExpired.fulfilled, function (state, action) {
1218
+ state.loading = false;
1219
+ state.error = null;
1220
+ var _a = action.payload, data = _a.data, formData = _a.formData;
1221
+ state.data.otpData = formData;
1222
+ state.data.otpData.responseBody = data;
1223
+ })
1224
+ .addCase(verifyLeadOTPSessionExpired.rejected, function (state, _a) {
1225
+ var message = _a.error.message;
1226
+ state.loading = false;
1227
+ if (!isAuthenticationVerificationFailed(message))
1228
+ state.error = message;
1140
1229
  })
1141
1230
  .addCase(createCivilIdAuth.pending, function (state) {
1142
1231
  state.loading = true;
@@ -1264,7 +1353,7 @@ export var businessSlice = createSlice({
1264
1353
  state.loading = true;
1265
1354
  })
1266
1355
  .addCase(retrieveEntityList.fulfilled, function (state, action) {
1267
- var _a, _b, _c, _d;
1356
+ var _a, _b, _c, _d, _e, _f;
1268
1357
  state.error = null;
1269
1358
  state.loading = false;
1270
1359
  var data = action.payload;
@@ -1285,7 +1374,7 @@ export var businessSlice = createSlice({
1285
1374
  licenseList = __spreadArray(__spreadArray([], licenseList, true), mappedFL, true);
1286
1375
  licenseList = licenseList.filter(function (_a) {
1287
1376
  var license = _a.license;
1288
- return !(entityLicenseList || []).some(function (e) { return e.license.number === license.number; });
1377
+ return !(entityLicenseList || []).some(function (e) { var _a, _b; return e.license.number === license.number || ((_a = e.license.additional_info) === null || _a === void 0 ? void 0 : _a.unified_number) === ((_b = license.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number); });
1289
1378
  });
1290
1379
  }
1291
1380
  }
@@ -1295,8 +1384,10 @@ export var businessSlice = createSlice({
1295
1384
  var selectedLicense = licenseList === null || licenseList === void 0 ? void 0 : licenseList[0];
1296
1385
  var isOtherLicense_1 = ((_b = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _b === void 0 ? void 0 : _b.number) === 'other_fl' || ((_c = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _c === void 0 ? void 0 : _c.number) === 'other_cr';
1297
1386
  state.data.businessTypeData.selectedLicense = selectedLicense;
1298
- if (!isOtherLicense_1)
1387
+ if (!isOtherLicense_1) {
1299
1388
  state.data.businessTypeData.licenseNumber = ((_d = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _d === void 0 ? void 0 : _d.number) || '';
1389
+ state.data.businessTypeData.unifiedNumber = ((_f = (_e = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _e === void 0 ? void 0 : _e.additional_info) === null || _f === void 0 ? void 0 : _f.unified_number) || '';
1390
+ }
1300
1391
  }
1301
1392
  })
1302
1393
  .addCase(retrieveEntityList.rejected, function (state, action) {
@@ -1308,10 +1399,10 @@ export var businessSlice = createSlice({
1308
1399
  state.loading = true;
1309
1400
  })
1310
1401
  .addCase(retrieveAllEntityList.fulfilled, function (state, action) {
1311
- var _a;
1402
+ var _a, _b, _c;
1312
1403
  state.error = null;
1313
1404
  state.loading = false;
1314
- var _b = action.payload, data = _b.data, businessCountryCode = _b.businessCountryCode, entityId = _b.entityId;
1405
+ var _d = action.payload, data = _d.data, businessCountryCode = _d.businessCountryCode, entityId = _d.entityId;
1315
1406
  var isKWCountry = isKW(businessCountryCode);
1316
1407
  var list = (data === null || data === void 0 ? void 0 : data.entities_info) || [];
1317
1408
  if (isKWCountry) {
@@ -1329,8 +1420,10 @@ export var businessSlice = createSlice({
1329
1420
  var selectedLicense = findEntity ? findEntity : entityLicenseList[0];
1330
1421
  state.data.businessTypeData.selectedEntityLicense = selectedLicense;
1331
1422
  state.data.businessTypeData.selectedLicense = selectedLicense;
1332
- if (!isOtherLicense(selectedLicense))
1423
+ if (!isOtherLicense(selectedLicense)) {
1333
1424
  state.data.businessTypeData.licenseNumber = ((_a = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _a === void 0 ? void 0 : _a.number) || '';
1425
+ state.data.businessTypeData.unifiedNumber = ((_c = (_b = selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.license) === null || _b === void 0 ? void 0 : _b.additional_info) === null || _c === void 0 ? void 0 : _c.unified_number) || '';
1426
+ }
1334
1427
  }
1335
1428
  })
1336
1429
  .addCase(retrieveAllEntityList.rejected, function (state, action) {
@@ -25,6 +25,12 @@ export declare const verifyAuth: import("@reduxjs/toolkit").AsyncThunk<{
25
25
  leadResponse: any;
26
26
  countryCode: CountryCode;
27
27
  }, OTPFormValues, {}>;
28
+ export declare const createAuthSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
29
+ response: any;
30
+ }, boolean, {}>;
31
+ export declare const verifySessionExpiredOtp: import("@reduxjs/toolkit").AsyncThunk<{
32
+ data: any;
33
+ }, OTPFormValues, {}>;
28
34
  interface verifyPACIParams {
29
35
  onSuccess?: () => void;
30
36
  }
@@ -82,14 +88,15 @@ export declare const updateLeadMobile: import("@reduxjs/toolkit").AsyncThunk<{
82
88
  export declare const skipUpdateLeadMobile: import("@reduxjs/toolkit").AsyncThunk<{
83
89
  leadResponse: any;
84
90
  }, void, {}>;
91
+ interface EmailCheckProps {
92
+ email: string;
93
+ cancelToken: CancelToken;
94
+ onSuccess?: () => void;
95
+ }
85
96
  export declare const checkEmailAvailability: import("@reduxjs/toolkit").AsyncThunk<{
86
97
  response: any;
87
98
  formData: string;
88
- } | undefined, {
89
- email: string;
90
- cancelToken: CancelToken;
91
- onSuccess?: (() => void) | undefined;
92
- }, {}>;
99
+ } | undefined, EmailCheckProps, {}>;
93
100
  export declare const checkBrandNameAvailability: import("@reduxjs/toolkit").AsyncThunk<{
94
101
  response: any;
95
102
  formData: {
@@ -66,12 +66,12 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
66
66
  return to.concat(ar || Array.prototype.slice.call(from));
67
67
  };
68
68
  var _a;
69
- import API from '../../../api';
69
+ import API, { setAuthSessionToGlobalHeaders } from '../../../api';
70
70
  import { handleCurrentActiveScreen, handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
71
71
  import { COLLECT_DOB_INFO_NAFATH, CONNECT_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, OTHER_BRAND } from '../../../constants';
72
72
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
73
73
  import { AuthForType, FlowsTypes } from '../../../@types';
74
- import { capitalizeTheFirstLetterOfEachWord, concatenateObjectValues, findCountryByIddPrefix, fixBrandList, isTwitter, getIndividualName, isWebsite, sleep, sendCustomEventToGTM, isOtherThanKWOrSA, isKW, findCountryByIso2, getMetaData, isNetworkError, isTimeoutError } from '../../../utils';
74
+ import { capitalizeTheFirstLetterOfEachWord, concatenateObjectValues, findCountryByIddPrefix, fixBrandList, isTwitter, getIndividualName, isWebsite, sleep, sendCustomEventToGTM, isOtherThanKWOrSA, isKW, findCountryByIso2, getMetaData, isNetworkError, isTimeoutError, isInternalServerError, isAuthenticationVerificationFailed } from '../../../utils';
75
75
  export var updateBusinessCountry = createAsyncThunk('connect/updateBusinessCountry', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
76
76
  var connect, payload, data;
77
77
  return __generator(this, function (_a) {
@@ -209,9 +209,9 @@ export var createNafathAuth = createAsyncThunk('connect/createNafathAuth', funct
209
209
  }); });
210
210
  export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
211
211
  var _a, connect, settings, startWithNID, _b, mobileData, nidData, responseBody, stepName, payload, data, lead_id, leadResponse, channels, brand, err_1, brands, err_2, countryCode, phone;
212
- var _c, _d, _e, _f;
213
- return __generator(this, function (_g) {
214
- switch (_g.label) {
212
+ var _c, _d, _e;
213
+ return __generator(this, function (_f) {
214
+ switch (_f.label) {
215
215
  case 0:
216
216
  _a = thunkApi.getState(), connect = _a.connect, settings = _a.settings;
217
217
  startWithNID = connect.data.otpData.authFor === AuthForType.NATIONAL_ID;
@@ -229,11 +229,14 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
229
229
  step_name: stepName,
230
230
  encryption_contract: ['data']
231
231
  };
232
- return [4, API.authService.verifyAuth(payload)];
232
+ return [4, API.authService.verifyAuth(payload).catch(function (err) {
233
+ if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
234
+ thunkApi.dispatch(handleNextScreenStep('CONNECT_OTP_VERIFY_SECURITY_ERROR_STEP'));
235
+ throw new Error(err === null || err === void 0 ? void 0 : err.message);
236
+ })];
233
237
  case 1:
234
- data = (_g.sent()).data;
235
- if ((_c = data.errors) === null || _c === void 0 ? void 0 : _c.length)
236
- throw new Error(data.errors[0].description);
238
+ data = _f.sent();
239
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
237
240
  sendCustomEventToGTM({
238
241
  event: 'Send Event',
239
242
  event_category: 'User Registration Flow',
@@ -244,45 +247,109 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
244
247
  throw new Error('Lead id is missing');
245
248
  return [4, API.leadService.retrieveLead(lead_id)];
246
249
  case 2:
247
- leadResponse = (_g.sent()).data;
248
- if ((_d = leadResponse.errors) === null || _d === void 0 ? void 0 : _d.length)
250
+ leadResponse = (_f.sent()).data;
251
+ if ((_c = leadResponse.errors) === null || _c === void 0 ? void 0 : _c.length)
249
252
  throw new Error(leadResponse.errors[0].description);
250
253
  return [4, API.dataService.getChannelsOfServices({ page: 0 })];
251
254
  case 3:
252
- channels = (_g.sent()).list;
255
+ channels = (_f.sent()).list;
253
256
  leadResponse.channel_list = channels;
254
- _g.label = 4;
257
+ _f.label = 4;
255
258
  case 4:
256
- _g.trys.push([4, 6, , 7]);
259
+ _f.trys.push([4, 6, , 7]);
257
260
  return [4, API.brandService.retrieveBrand(leadResponse.brand.id)];
258
261
  case 5:
259
- brand = (_g.sent()).brand;
262
+ brand = (_f.sent()).brand;
260
263
  leadResponse.brand = __assign(__assign({}, leadResponse.brand), brand);
261
264
  return [3, 7];
262
265
  case 6:
263
- err_1 = _g.sent();
266
+ err_1 = _f.sent();
264
267
  return [3, 7];
265
268
  case 7:
266
- _g.trys.push([7, 9, , 10]);
269
+ _f.trys.push([7, 9, , 10]);
267
270
  return [4, API.brandService.getBrandList({ individual_id: leadResponse.individual_id })];
268
271
  case 8:
269
- brands = (_g.sent()).brands;
272
+ brands = (_f.sent()).brands;
270
273
  leadResponse.brand_list = fixBrandList(brands, channels);
271
274
  return [3, 10];
272
275
  case 9:
273
- err_2 = _g.sent();
276
+ err_2 = _f.sent();
274
277
  return [3, 10];
275
278
  case 10:
276
279
  countryCode = settings.data.businessCountry;
277
280
  phone = (leadResponse.contact || {}).phone;
278
281
  if (phone === null || phone === void 0 ? void 0 : phone.country_code)
279
282
  countryCode = findCountryByIddPrefix(settings.data.countries, phone.country_code);
280
- (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, { otp: params.otp });
281
- thunkApi.dispatch(handleNextScreenStep());
283
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
284
+ thunkApi.dispatch(handleNextScreenStep('CONNECT_INDIVIDUAL_STEP'));
282
285
  return [2, { authResponse: data, leadResponse: leadResponse, countryCode: countryCode }];
283
286
  }
284
287
  });
285
288
  }); });
289
+ export var createAuthSessionExpired = createAsyncThunk('createAuthSessionExpiredAsync', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
290
+ var settings, requestBody, data;
291
+ var _a, _b;
292
+ return __generator(this, function (_c) {
293
+ switch (_c.label) {
294
+ case 0:
295
+ settings = thunkApi.getState().settings;
296
+ requestBody = {
297
+ country: settings.data.businessCountry.iso2,
298
+ scope: settings.data.appConfig.scope,
299
+ lang: settings.data.language,
300
+ sign_in: false,
301
+ is_lead: true,
302
+ step_name: CONNECT_STEP_NAMES.CREATE_AUTH_SESSION_EXPIRED,
303
+ encryption_contract: []
304
+ };
305
+ return [4, API.authService.createAuth(requestBody)];
306
+ case 1:
307
+ data = _c.sent();
308
+ if (redirect)
309
+ thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_SESSION_EXPIRED_OTP_STEP'));
310
+ (_b = (_a = settings.data.appConfig).onStepCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, settings.data.activeScreen.name, requestBody);
311
+ return [2, { response: data }];
312
+ }
313
+ });
314
+ }); });
315
+ export var verifySessionExpiredOtp = createAsyncThunk('connect/verifySessionExpiredOtp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
316
+ var _a, connect, settings, session, responseBody, payload, data;
317
+ var _b, _c;
318
+ return __generator(this, function (_d) {
319
+ switch (_d.label) {
320
+ case 0:
321
+ _a = thunkApi.getState(), connect = _a.connect, settings = _a.settings, session = _a.session;
322
+ responseBody = connect.data.mobileData.responseBody;
323
+ payload = {
324
+ data: params.otp,
325
+ auth_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token,
326
+ auth_type: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_type,
327
+ device_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.device_token,
328
+ service_name: responseBody === null || responseBody === void 0 ? void 0 : responseBody.service_name,
329
+ sign_in: responseBody === null || responseBody === void 0 ? void 0 : responseBody.sign_in,
330
+ remember_me: responseBody === null || responseBody === void 0 ? void 0 : responseBody.remember_me,
331
+ step_name: CONNECT_STEP_NAMES.VERIFY_AUTH_SESSION_EXPIRED,
332
+ encryption_contract: ['data']
333
+ };
334
+ return [4, API.authService.verifyAuth(payload).catch(function (err) {
335
+ if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
336
+ thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_OTP_VERIFY_SECURITY_ERROR_STEP'));
337
+ throw new Error(err === null || err === void 0 ? void 0 : err.message);
338
+ })];
339
+ case 1:
340
+ data = _d.sent();
341
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
342
+ sendCustomEventToGTM({
343
+ event: 'Send Event',
344
+ event_category: 'User Registration Flow',
345
+ event_action: 'Session Expired - OTP Success'
346
+ });
347
+ (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, { otp: params.otp });
348
+ thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
349
+ return [2, { data: data }];
350
+ }
351
+ });
352
+ }); });
286
353
  export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
287
354
  var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, error_1, isSuccess, lead_id, leadResponse, countryCode, channels, brand, err_3, brands, err_4, phone;
288
355
  var _b, _c, _d, _e, _f;
@@ -318,6 +385,7 @@ export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params,
318
385
  case 5:
319
386
  isSuccess = ((_b = authResponse === null || authResponse === void 0 ? void 0 : authResponse.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
320
387
  if (!isSuccess) return [3, 16];
388
+ setAuthSessionToGlobalHeaders(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_session);
321
389
  lead_id = authResponse.lead_id;
322
390
  if (!lead_id)
323
391
  throw new Error('Lead id is missing');
@@ -415,6 +483,7 @@ export var verifyNafath = createAsyncThunk('connect/verifyNafath', function (par
415
483
  return [2, { authResponse: authResponse, countryCode: countryCode }];
416
484
  }
417
485
  if (!isSuccess) return [3, 16];
486
+ setAuthSessionToGlobalHeaders(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_session);
418
487
  lead_id = authResponse.lead_id;
419
488
  if (!lead_id)
420
489
  throw new Error('Lead id is missing');
@@ -763,23 +832,36 @@ export var skipUpdateLeadMobile = createAsyncThunk('connect/skipUpdateLeadMobile
763
832
  export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', function (_a, thunkApi) {
764
833
  var email = _a.email, cancelToken = _a.cancelToken, onSuccess = _a.onSuccess;
765
834
  return __awaiter(void 0, void 0, void 0, function () {
766
- var connect, requestBody, data;
767
- var _b, _c;
768
- return __generator(this, function (_d) {
769
- switch (_d.label) {
835
+ var responseBody, requestBody, data, retryData;
836
+ var _b, _c, _d, _e, _f, _g;
837
+ return __generator(this, function (_h) {
838
+ switch (_h.label) {
770
839
  case 0:
771
- connect = thunkApi.getState().connect;
840
+ responseBody = thunkApi.getState().connect.data.otpData.responseBody;
772
841
  requestBody = {
773
842
  email: email,
774
- country: (_c = (_b = connect.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.leadData) === null || _c === void 0 ? void 0 : _c.country_code,
843
+ country: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.leadData) === null || _b === void 0 ? void 0 : _b.country_code,
775
844
  encryption_contract: ['email']
776
845
  };
777
846
  return [4, API.availabilityServices.checkEmail(requestBody, { cancelToken: cancelToken })];
778
847
  case 1:
779
- data = (_d.sent()).data;
780
- onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
781
- if (!data.errors)
848
+ data = (_h.sent()).data;
849
+ if (!data.errors) {
850
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
782
851
  return [2, { response: data, formData: email }];
852
+ }
853
+ if (!isInternalServerError((_d = (_c = data.errors) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.error)) {
854
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
855
+ throw new Error((_f = (_e = data.errors) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.error);
856
+ }
857
+ return [4, API.availabilityServices.checkEmail(requestBody, { cancelToken: cancelToken })];
858
+ case 2:
859
+ retryData = (_h.sent()).data;
860
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
861
+ if (!retryData.errors)
862
+ return [2, { response: retryData, formData: email }];
863
+ if (isInternalServerError((_g = retryData.errors) === null || _g === void 0 ? void 0 : _g[0].error))
864
+ return [2, { response: { is_available: true }, formData: email }];
783
865
  return [2];
784
866
  }
785
867
  });
@@ -1122,9 +1204,42 @@ export var connectSlice = createSlice({
1122
1204
  state.loading = true;
1123
1205
  state.error = null;
1124
1206
  })
1125
- .addCase(verifyAuth.rejected, function (state, action) {
1207
+ .addCase(verifyAuth.rejected, function (state, _a) {
1208
+ var message = _a.error.message;
1209
+ state.loading = false;
1210
+ if (!isAuthenticationVerificationFailed(message))
1211
+ state.error = message;
1212
+ })
1213
+ .addCase(createAuthSessionExpired.fulfilled, function (state, action) {
1214
+ state.loading = false;
1215
+ state.error = null;
1216
+ var response = action.payload.response;
1217
+ state.data.mobileData.responseBody = response;
1218
+ state.data.otpData.authFor = AuthForType.MOBILE;
1219
+ })
1220
+ .addCase(createAuthSessionExpired.pending, function (state) {
1221
+ state.loading = true;
1222
+ state.error = null;
1223
+ })
1224
+ .addCase(createAuthSessionExpired.rejected, function (state, action) {
1126
1225
  state.loading = false;
1127
1226
  state.error = action.error.message;
1227
+ })
1228
+ .addCase(verifySessionExpiredOtp.fulfilled, function (state, action) {
1229
+ state.loading = false;
1230
+ state.error = null;
1231
+ var data = action.payload.data;
1232
+ state.data.otpData.responseBody = __assign({}, data);
1233
+ })
1234
+ .addCase(verifySessionExpiredOtp.pending, function (state) {
1235
+ state.loading = true;
1236
+ state.error = null;
1237
+ })
1238
+ .addCase(verifySessionExpiredOtp.rejected, function (state, _a) {
1239
+ var message = _a.error.message;
1240
+ state.loading = false;
1241
+ if (!isAuthenticationVerificationFailed(message))
1242
+ state.error = message;
1128
1243
  })
1129
1244
  .addCase(updateLeadDOB.fulfilled, function (state, action) {
1130
1245
  state.loading = false;