@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
@@ -47,11 +47,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  };
48
48
  var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
- import API from '../../../api';
50
+ import API, { setAuthSessionToGlobalHeaders } from '../../../api';
51
51
  import { DocumentPurpose, FlowsTypes } from '../../../@types';
52
52
  import { handleCurrentActiveScreen, handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
53
53
  import { BANK_STEP_NAMES } from '../../../constants';
54
- import { hasNoneEditableValue, isStringHasOneAsterisk, retrieveIndividualData, sendCustomEventToGTM, sleep } from '../../../utils';
54
+ import { hasNoneEditableValue, isAuthenticationVerificationFailed, isStringHasOneAsterisk, retrieveIndividualData, sendCustomEventToGTM, sleep } from '../../../utils';
55
55
  export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (_a, thunkApi) {
56
56
  var token = _a.token, isInternally = _a.isInternally;
57
57
  return __awaiter(void 0, void 0, void 0, function () {
@@ -70,6 +70,7 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (_
70
70
  data = (_j.sent()).data;
71
71
  if ((_c = data.errors) === null || _c === void 0 ? void 0 : _c.length)
72
72
  throw new Error(data.errors[0].description);
73
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
73
74
  bankData = undefined;
74
75
  _b = data || {}, config = _b.config, country_code = _b.country_code, step_name = _b.step_name, bank_account_id = _b.bank_account_id, wallet_id = _b.wallet_id, boardId = _b.id;
75
76
  publicKey = config === null || config === void 0 ? void 0 : config.public_key;
@@ -103,9 +104,9 @@ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (_
103
104
  _j.label = 6;
104
105
  case 6:
105
106
  if (isInternally)
106
- sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
107
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('BANK_BANK_DETAILS_STEP')); });
107
108
  else
108
- thunkApi.dispatch(handleNextScreenStep());
109
+ thunkApi.dispatch(handleNextScreenStep('BANK_BANK_DETAILS_STEP'));
109
110
  _j.label = 7;
110
111
  case 7: return [2, {
111
112
  data: data,
@@ -135,9 +136,9 @@ export var resendOTP = createAsyncThunk('resendOTPBank', function (params, thunk
135
136
  }); });
136
137
  export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
137
138
  var _a, bank, settings, responseBody, payload, data, countryIso2, publicKey, _b, bank_account_id, wallet_id, boardId, bankData, data_2;
138
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
139
- return __generator(this, function (_o) {
140
- switch (_o.label) {
139
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l;
140
+ return __generator(this, function (_m) {
141
+ switch (_m.label) {
141
142
  case 0:
142
143
  _a = thunkApi.getState(), bank = _a.bank, settings = _a.settings;
143
144
  responseBody = bank.data.verify.responseBody;
@@ -148,13 +149,16 @@ export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (p
148
149
  step_name: BANK_STEP_NAMES.PHONE_AUTH,
149
150
  encryption_contract: ['data']
150
151
  };
151
- return [4, API.leadService.verifyLeadOTP(payload)];
152
+ return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
153
+ if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
154
+ thunkApi.dispatch(handleNextScreenStep('BANK_OTP_VERIFY_SECURITY_ERROR_STEP'));
155
+ throw new Error(err === null || err === void 0 ? void 0 : err.message);
156
+ })];
152
157
  case 1:
153
- data = (_o.sent()).data;
154
- if ((_d = data.errors) === null || _d === void 0 ? void 0 : _d.length)
155
- throw new Error(data.errors[0].description);
158
+ data = _m.sent();
159
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
156
160
  countryIso2 = (data === null || data === void 0 ? void 0 : data.country_code) || (responseBody === null || responseBody === void 0 ? void 0 : responseBody.country_code);
157
- publicKey = (_e = data === null || data === void 0 ? void 0 : data.config) === null || _e === void 0 ? void 0 : _e.public_key;
161
+ publicKey = (_d = data === null || data === void 0 ? void 0 : data.config) === null || _d === void 0 ? void 0 : _d.public_key;
158
162
  if (countryIso2)
159
163
  thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
160
164
  if (publicKey)
@@ -164,10 +168,10 @@ export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (p
164
168
  if (!(!wallet_id || !countryIso2)) return [3, 3];
165
169
  return [4, API.boardService.retrieveBoardDetails(boardId)];
166
170
  case 2:
167
- data_2 = _o.sent();
168
- if (!countryIso2 && ((_f = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _f === void 0 ? void 0 : _f.country))
171
+ data_2 = _m.sent();
172
+ if (!countryIso2 && ((_e = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _e === void 0 ? void 0 : _e.country))
169
173
  thunkApi.dispatch(handleSetCountryByIso2(data_2.entity.country));
170
- if (!((_k = (_j = (_h = (_g = data_2 === null || data_2 === void 0 ? void 0 : data_2.business) === null || _g === void 0 ? void 0 : _g.entity) === null || _h === void 0 ? void 0 : _h.merchant) === null || _j === void 0 ? void 0 : _j.wallet) === null || _k === void 0 ? void 0 : _k.id))
174
+ if (!((_j = (_h = (_g = (_f = data_2 === null || data_2 === void 0 ? void 0 : data_2.business) === null || _f === void 0 ? void 0 : _f.entity) === null || _g === void 0 ? void 0 : _g.merchant) === null || _h === void 0 ? void 0 : _h.wallet) === null || _j === void 0 ? void 0 : _j.id))
171
175
  throw new Error('wallet_id_missing');
172
176
  if (data_2 === null || data_2 === void 0 ? void 0 : data_2.bank_account)
173
177
  bankData = data_2.bank_account;
@@ -176,11 +180,11 @@ export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (p
176
180
  if (!bank_account_id) return [3, 5];
177
181
  return [4, API.entityService.retrieveBankAccount(bank_account_id)];
178
182
  case 4:
179
- bankData = _o.sent();
180
- _o.label = 5;
183
+ bankData = _m.sent();
184
+ _m.label = 5;
181
185
  case 5:
182
- (_m = (_l = settings.data.appConfig).onStepCompleted) === null || _m === void 0 ? void 0 : _m.call(_l, settings.data.activeScreen.name, { otp: params.otp });
183
- sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
186
+ (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, { otp: params.otp });
187
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('BANK_BANK_DETAILS_STEP')); });
184
188
  return [2, {
185
189
  data: data,
186
190
  bankData: bankData,
@@ -189,6 +193,58 @@ export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (p
189
193
  }
190
194
  });
191
195
  }); });
196
+ export var verifyTokenSessionExpired = createAsyncThunk('bank/verifyTokenSessionExpired', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
197
+ var bank, payload, data;
198
+ return __generator(this, function (_a) {
199
+ switch (_a.label) {
200
+ case 0:
201
+ bank = thunkApi.getState().bank;
202
+ payload = {
203
+ service_name: 'tap_email',
204
+ verify_token: bank.data.verify.token
205
+ };
206
+ return [4, API.leadService.verifyToken(payload)];
207
+ case 1:
208
+ data = _a.sent();
209
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
210
+ if (redirect)
211
+ thunkApi.dispatch(handleCurrentActiveScreen('BANK_SESSION_EXPIRED_OTP_STEP'));
212
+ return [2, { data: data }];
213
+ }
214
+ });
215
+ }); });
216
+ export var verifyBankLeadOTPSessionExpired = createAsyncThunk('bank/verifyBankLeadOTPSessionExpired', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
217
+ var _a, bank, settings, session, responseBody, payload, data;
218
+ var _b, _c, _d;
219
+ return __generator(this, function (_e) {
220
+ switch (_e.label) {
221
+ case 0:
222
+ _a = thunkApi.getState(), bank = _a.bank, settings = _a.settings, session = _a.session;
223
+ responseBody = bank.data.verify.responseBody;
224
+ payload = {
225
+ data: params.otp,
226
+ service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
227
+ verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
228
+ step_name: BANK_STEP_NAMES.PHONE_AUTH,
229
+ encryption_contract: ['data']
230
+ };
231
+ return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
232
+ if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
233
+ thunkApi.dispatch(handleCurrentActiveScreen('BANK_OTP_VERIFY_SECURITY_ERROR_STEP'));
234
+ throw new Error(err === null || err === void 0 ? void 0 : err.message);
235
+ })];
236
+ case 1:
237
+ data = _e.sent();
238
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
239
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
240
+ thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
241
+ return [2, {
242
+ data: data,
243
+ formData: params
244
+ }];
245
+ }
246
+ });
247
+ }); });
192
248
  export var retrieveBoardStatus = createAsyncThunk('bank/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
193
249
  var bank, _a, board_id, board_info_id, recipient, _b, id, type, data;
194
250
  return __generator(this, function (_c) {
@@ -469,9 +525,43 @@ export var bankSlice = createSlice({
469
525
  state.data.bankData.confirmPolicy = is_acknowledged;
470
526
  state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { bank_account: bank_account, board_id: data.id });
471
527
  })
472
- .addCase(verifyBankLeadOTP.rejected, function (state, action) {
528
+ .addCase(verifyBankLeadOTP.rejected, function (state, _a) {
529
+ var message = _a.error.message;
473
530
  state.loading = false;
531
+ if (!isAuthenticationVerificationFailed(message))
532
+ state.error = message;
533
+ })
534
+ .addCase(verifyTokenSessionExpired.pending, function (state) {
535
+ state.error = null;
536
+ state.loading = true;
537
+ })
538
+ .addCase(verifyTokenSessionExpired.fulfilled, function (state, action) {
539
+ state.error = null;
540
+ state.loading = false;
541
+ var data = (action.payload || {}).data;
542
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
543
+ })
544
+ .addCase(verifyTokenSessionExpired.rejected, function (state, action) {
474
545
  state.error = action.error.message;
546
+ state.loading = false;
547
+ })
548
+ .addCase(verifyBankLeadOTPSessionExpired.pending, function (state) {
549
+ state.loading = true;
550
+ state.error = null;
551
+ })
552
+ .addCase(verifyBankLeadOTPSessionExpired.fulfilled, function (state, action) {
553
+ state.loading = false;
554
+ state.error = null;
555
+ var _a = action.payload, data = _a.data, formData = _a.formData;
556
+ state.data.otpData = formData;
557
+ state.data.otpData.responseBody = data;
558
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
559
+ })
560
+ .addCase(verifyBankLeadOTPSessionExpired.rejected, function (state, _a) {
561
+ var message = _a.error.message;
562
+ state.loading = false;
563
+ if (!isAuthenticationVerificationFailed(message))
564
+ state.error = message;
475
565
  })
476
566
  .addCase(retrieveBoardDetails.pending, function (state) {
477
567
  state.error = null;
@@ -12,6 +12,11 @@ export declare const verifyBoardLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
12
12
  data: any;
13
13
  formData: OTPFormValues;
14
14
  }, OTPFormValues, {}>;
15
+ export declare const createVerifyTokenSessionExpired: import("@reduxjs/toolkit").AsyncThunk<any, boolean, {}>;
16
+ export declare const verifyOTPSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
17
+ data: any;
18
+ formData: OTPFormValues;
19
+ }, OTPFormValues, {}>;
15
20
  export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<{
16
21
  data: any;
17
22
  }, {
@@ -47,11 +47,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  };
48
48
  var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
- import API from '../../../api';
50
+ import API, { setAuthSessionToGlobalHeaders } from '../../../api';
51
51
  import { FlowsTypes } from '../../../@types';
52
52
  import { handleCurrentActiveScreen, handleNextScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
53
53
  import { BOARD_STEP_STEPS } from '../../../constants';
54
- import { retrieveIndividualData, sleep } from '../../../utils';
54
+ import { isAuthenticationVerificationFailed, retrieveIndividualData, sleep } from '../../../utils';
55
55
  export var createVerifyTokenBy = createAsyncThunk('board/createVerifyTokenByBoardId', function (_a, thunkApi) {
56
56
  var boardId = _a.boardId, isInternally = _a.isInternally;
57
57
  return __awaiter(void 0, void 0, void 0, function () {
@@ -72,6 +72,7 @@ export var createVerifyTokenBy = createAsyncThunk('board/createVerifyTokenByBoar
72
72
  data = _f.sent();
73
73
  _b = data || {}, country_code = _b.country_code, config = _b.config;
74
74
  publicKey = config === null || config === void 0 ? void 0 : config.public_key;
75
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
75
76
  if (country_code)
76
77
  thunkApi.dispatch(handleSetCountryByIso2(country_code));
77
78
  if (publicKey)
@@ -129,17 +130,20 @@ export var verifyBoardLeadOTP = createAsyncThunk('board/verifyBoardLeadOTP', fun
129
130
  step_name: BOARD_STEP_STEPS.PHONE_AUTH,
130
131
  encryption_contract: ['data']
131
132
  };
132
- return [4, API.leadService.verifyLeadOTP(payload)];
133
+ return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
134
+ if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
135
+ thunkApi.dispatch(handleNextScreenStep('BOARD_OTP_VERIFY_SECURITY_ERROR_STEP'));
136
+ throw new Error(err === null || err === void 0 ? void 0 : err.message);
137
+ })];
133
138
  case 1:
134
- data = (_j.sent()).data;
139
+ data = _j.sent();
140
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
135
141
  _b = data || {}, country_code = _b.country_code, config = _b.config;
136
142
  publicKey = config === null || config === void 0 ? void 0 : config.public_key;
137
143
  if (country_code)
138
144
  thunkApi.dispatch(handleSetCountryByIso2(country_code));
139
145
  if (publicKey)
140
146
  thunkApi.dispatch(handlePublicKey(publicKey));
141
- if (data.errors)
142
- throw new Error(data.errors[0].description);
143
147
  return [4, thunkApi.dispatch(retrieveBoardDetails({ boardId: data.id, boardInfoId: data.board_info_id })).unwrap()];
144
148
  case 2:
145
149
  boardData = (_j.sent()).data;
@@ -152,6 +156,57 @@ export var verifyBoardLeadOTP = createAsyncThunk('board/verifyBoardLeadOTP', fun
152
156
  }
153
157
  });
154
158
  }); });
159
+ export var createVerifyTokenSessionExpired = createAsyncThunk('board/createVerifyTokenAuthExpired', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
160
+ var settings, payload, data;
161
+ var _a, _b;
162
+ return __generator(this, function (_c) {
163
+ switch (_c.label) {
164
+ case 0:
165
+ settings = thunkApi.getState().settings;
166
+ payload = {
167
+ service_name: 'tap_email'
168
+ };
169
+ return [4, API.leadService.createVerifyTokenByBoardId(payload)];
170
+ case 1:
171
+ data = _c.sent();
172
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
173
+ (_b = (_a = settings.data.appConfig).onFlowCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, { boardId: data.id, boardInfoId: data.board_info_id });
174
+ if (redirect)
175
+ thunkApi.dispatch(handleCurrentActiveScreen('BOARD_SESSION_EXPIRED_OTP_STEP'));
176
+ return [2, __assign({}, data)];
177
+ }
178
+ });
179
+ }); });
180
+ export var verifyOTPSessionExpired = createAsyncThunk('board/verifyOTPSessionExpired', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
181
+ var _a, board, settings, session, responseBody, payload, data;
182
+ var _b, _c, _d, _e, _f;
183
+ return __generator(this, function (_g) {
184
+ switch (_g.label) {
185
+ case 0:
186
+ _a = thunkApi.getState(), board = _a.board, settings = _a.settings, session = _a.session;
187
+ responseBody = board.data.verify.responseBody;
188
+ payload = {
189
+ data: params.otp,
190
+ service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
191
+ verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
192
+ step_name: BOARD_STEP_STEPS.PHONE_AUTH,
193
+ encryption_contract: ['data']
194
+ };
195
+ return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
196
+ if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
197
+ thunkApi.dispatch(handleCurrentActiveScreen('BOARD_OTP_VERIFY_SECURITY_ERROR_STEP'));
198
+ throw new Error(err === null || err === void 0 ? void 0 : err.message);
199
+ })];
200
+ case 1:
201
+ data = _g.sent();
202
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
203
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
204
+ (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { boardId: responseBody === null || responseBody === void 0 ? void 0 : responseBody.id, boardInfoId: responseBody === null || responseBody === void 0 ? void 0 : responseBody.board_info_id });
205
+ thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
206
+ return [2, { data: data, formData: params }];
207
+ }
208
+ });
209
+ }); });
155
210
  export var retrieveBoardDetails = createAsyncThunk('board/retrieveBoardDetails', function (_a) {
156
211
  var boardId = _a.boardId, boardInfoId = _a.boardInfoId;
157
212
  return __awaiter(void 0, void 0, void 0, function () {
@@ -249,9 +304,41 @@ export var boardSlice = createSlice({
249
304
  state.data.otpData = formData;
250
305
  state.data.otpData.responseBody = data;
251
306
  })
252
- .addCase(verifyBoardLeadOTP.rejected, function (state, action) {
307
+ .addCase(verifyBoardLeadOTP.rejected, function (state, _a) {
308
+ var message = _a.error.message;
253
309
  state.loading = false;
310
+ if (!isAuthenticationVerificationFailed(message))
311
+ state.error = message;
312
+ })
313
+ .addCase(createVerifyTokenSessionExpired.pending, function (state) {
314
+ state.error = null;
315
+ state.loading = true;
316
+ })
317
+ .addCase(createVerifyTokenSessionExpired.fulfilled, function (state, action) {
318
+ state.error = null;
319
+ state.loading = false;
320
+ state.data.verify = __assign(__assign({}, state.data.verify), { responseBody: __assign(__assign({}, state.data.verify.responseBody), action.payload) });
321
+ })
322
+ .addCase(createVerifyTokenSessionExpired.rejected, function (state, action) {
254
323
  state.error = action.error.message;
324
+ state.loading = false;
325
+ })
326
+ .addCase(verifyOTPSessionExpired.pending, function (state) {
327
+ state.loading = true;
328
+ state.error = null;
329
+ })
330
+ .addCase(verifyOTPSessionExpired.fulfilled, function (state, action) {
331
+ state.loading = false;
332
+ state.error = null;
333
+ var _a = action.payload, data = _a.data, formData = _a.formData;
334
+ state.data.otpData = formData;
335
+ state.data.otpData.responseBody = data;
336
+ })
337
+ .addCase(verifyOTPSessionExpired.rejected, function (state, _a) {
338
+ var message = _a.error.message;
339
+ state.loading = false;
340
+ if (!isAuthenticationVerificationFailed(message))
341
+ state.error = message;
255
342
  })
256
343
  .addCase(retrieveBoardDetails.pending, function (state) {
257
344
  state.error = null;
@@ -22,6 +22,13 @@ export declare const verifyBrandLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
22
22
  entityInfoId: any;
23
23
  formData: OTPFormValues;
24
24
  }, OTPFormValues, {}>;
25
+ export declare const verifyTokenSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
26
+ data: any;
27
+ }, boolean, {}>;
28
+ export declare const verifyTokenSessionExpiredOTP: import("@reduxjs/toolkit").AsyncThunk<{
29
+ data: any;
30
+ formData: OTPFormValues;
31
+ }, OTPFormValues, {}>;
25
32
  export declare const retrieveSegmentDataList: import("@reduxjs/toolkit").AsyncThunk<{
26
33
  segmentLocation: any;
27
34
  segmentProfit: any;
@@ -58,11 +58,11 @@ var __rest = (this && this.__rest) || function (s, e) {
58
58
  };
59
59
  var _a;
60
60
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
61
- import API from '../../../api';
61
+ import API, { setAuthSessionToGlobalHeaders } from '../../../api';
62
62
  import { FlowsTypes } from '../../../@types';
63
- import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
63
+ import { handleCurrentActiveScreen, handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
64
64
  import { BRAND_STEP_NAMES, EXPECTED_SALES_LIST } from '../../../constants';
65
- import { hasNoneEditableValue, isKW, isTwitter, isWebsite, mapSalesChannel, retrieveIndividualData, sendCustomEventToGTM, sleep } from '../../../utils';
65
+ import { hasNoneEditableValue, isAuthenticationVerificationFailed, isKW, isTwitter, isWebsite, mapSalesChannel, retrieveIndividualData, sendCustomEventToGTM, sleep } from '../../../utils';
66
66
  export var verifyLeadToken = createAsyncThunk('brand/verifyLeadToken', function (_a, thunkApi) {
67
67
  var token = _a.token, isInternally = _a.isInternally;
68
68
  return __awaiter(void 0, void 0, void 0, function () {
@@ -83,6 +83,7 @@ export var verifyLeadToken = createAsyncThunk('brand/verifyLeadToken', function
83
83
  throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
84
84
  _b = data || {}, config = _b.config, brand_id = _b.brand_id, entity_id = _b.entity_id, board_id = _b.id, country_code = _b.country_code;
85
85
  publicKey = config === null || config === void 0 ? void 0 : config.public_key;
86
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
86
87
  if (country_code)
87
88
  thunkApi.dispatch(handleSetCountryByIso2(country_code));
88
89
  if (publicKey)
@@ -143,9 +144,9 @@ export var resendOTP = createAsyncThunk('brandResendOTP', function (params, thun
143
144
  }); });
144
145
  export var verifyBrandLeadOTP = createAsyncThunk('brand/verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
145
146
  var _a, brand, settings, responseBody, payload, data, publicKey, countryIso2, _b, brand_id, entity_id, boardId, brandData, data_2, salesChannels;
146
- var _c, _d, _e, _f, _g, _h, _j;
147
- return __generator(this, function (_k) {
148
- switch (_k.label) {
147
+ var _c, _d, _e, _f, _g, _h;
148
+ return __generator(this, function (_j) {
149
+ switch (_j.label) {
149
150
  case 0:
150
151
  _a = thunkApi.getState(), brand = _a.brand, settings = _a.settings;
151
152
  responseBody = brand.data.verify.responseBody;
@@ -156,12 +157,15 @@ export var verifyBrandLeadOTP = createAsyncThunk('brand/verifyLeadOTP', function
156
157
  step_name: BRAND_STEP_NAMES.PHONE_AUTH,
157
158
  encryption_contract: ['data']
158
159
  };
159
- return [4, API.leadService.verifyLeadOTP(payload)];
160
+ return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
161
+ if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
162
+ thunkApi.dispatch(handleNextScreenStep('BRAND_OTP_VERIFY_SECURITY_ERROR_STEP'));
163
+ throw new Error(err === null || err === void 0 ? void 0 : err.message);
164
+ })];
160
165
  case 1:
161
- data = (_k.sent()).data;
162
- if ((_d = data.errors) === null || _d === void 0 ? void 0 : _d.length)
163
- throw new Error(data.errors[0].description);
164
- publicKey = (_e = data === null || data === void 0 ? void 0 : data.config) === null || _e === void 0 ? void 0 : _e.public_key;
166
+ data = _j.sent();
167
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
168
+ publicKey = (_d = data === null || data === void 0 ? void 0 : data.config) === null || _d === void 0 ? void 0 : _d.public_key;
165
169
  countryIso2 = (data === null || data === void 0 ? void 0 : data.country_code) || (responseBody === null || responseBody === void 0 ? void 0 : responseBody.country_code);
166
170
  if (publicKey)
167
171
  thunkApi.dispatch(handlePublicKey(publicKey));
@@ -172,21 +176,21 @@ export var verifyBrandLeadOTP = createAsyncThunk('brand/verifyLeadOTP', function
172
176
  if (!(!brand_id || !countryIso2)) return [3, 3];
173
177
  return [4, API.boardService.retrieveBoardDetails(boardId)];
174
178
  case 2:
175
- data_2 = _k.sent();
176
- if (!countryIso2 && ((_f = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _f === void 0 ? void 0 : _f.country))
179
+ data_2 = _j.sent();
180
+ if (!countryIso2 && ((_e = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _e === void 0 ? void 0 : _e.country))
177
181
  thunkApi.dispatch(handleSetCountryByIso2(data_2.entity.country));
178
- if (!((_g = data_2 === null || data_2 === void 0 ? void 0 : data_2.brand) === null || _g === void 0 ? void 0 : _g.id))
182
+ if (!((_f = data_2 === null || data_2 === void 0 ? void 0 : data_2.brand) === null || _f === void 0 ? void 0 : _f.id))
179
183
  throw new Error('brand_id_missing');
180
184
  brandData = data_2;
181
185
  return [3, 5];
182
186
  case 3: return [4, API.brandService.retrieveBrand(brand_id)];
183
187
  case 4:
184
- brandData = _k.sent();
185
- _k.label = 5;
188
+ brandData = _j.sent();
189
+ _j.label = 5;
186
190
  case 5: return [4, API.dataService.getChannelsOfServices({ page: 0 })];
187
191
  case 6:
188
- salesChannels = _k.sent();
189
- (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, { otp: params.otp });
192
+ salesChannels = _j.sent();
193
+ (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, { otp: params.otp });
190
194
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('BRAND_INFO_STEP')); });
191
195
  return [2, {
192
196
  data: data,
@@ -198,6 +202,58 @@ export var verifyBrandLeadOTP = createAsyncThunk('brand/verifyLeadOTP', function
198
202
  }
199
203
  });
200
204
  }); });
205
+ export var verifyTokenSessionExpired = createAsyncThunk('brand/verifyTokenSessionExpired', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
206
+ var brand, payload, data;
207
+ return __generator(this, function (_a) {
208
+ switch (_a.label) {
209
+ case 0:
210
+ brand = thunkApi.getState().brand;
211
+ payload = {
212
+ service_name: 'tap_email',
213
+ verify_token: brand.data.verify.token
214
+ };
215
+ return [4, API.leadService.verifyToken(payload)];
216
+ case 1:
217
+ data = _a.sent();
218
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
219
+ if (redirect)
220
+ thunkApi.dispatch(handleCurrentActiveScreen('BRAND_SESSION_EXPIRED_OTP_STEP'));
221
+ return [2, { data: data }];
222
+ }
223
+ });
224
+ }); });
225
+ export var verifyTokenSessionExpiredOTP = createAsyncThunk('brand/verifyTokenSessionExpiredOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
226
+ var _a, brand, settings, session, responseBody, payload, data;
227
+ var _b, _c, _d;
228
+ return __generator(this, function (_e) {
229
+ switch (_e.label) {
230
+ case 0:
231
+ _a = thunkApi.getState(), brand = _a.brand, settings = _a.settings, session = _a.session;
232
+ responseBody = brand.data.verify.responseBody;
233
+ payload = {
234
+ data: params.otp,
235
+ service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
236
+ verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
237
+ step_name: BRAND_STEP_NAMES.PHONE_AUTH,
238
+ encryption_contract: ['data']
239
+ };
240
+ return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
241
+ if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
242
+ thunkApi.dispatch(handleCurrentActiveScreen('BRAND_OTP_VERIFY_SECURITY_ERROR_STEP'));
243
+ throw new Error(err === null || err === void 0 ? void 0 : err.message);
244
+ })];
245
+ case 1:
246
+ data = _e.sent();
247
+ setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
248
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
249
+ thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
250
+ return [2, {
251
+ data: data,
252
+ formData: params
253
+ }];
254
+ }
255
+ });
256
+ }); });
201
257
  export var retrieveSegmentDataList = createAsyncThunk('brandRetrieveSegmentDataList', function () { return __awaiter(void 0, void 0, void 0, function () {
202
258
  var dataBody, _a, team, location, profit, tech;
203
259
  return __generator(this, function (_b) {
@@ -682,9 +738,41 @@ export var brandSlice = createSlice({
682
738
  state.data.brandActivities.refundPolicy = termFlag;
683
739
  state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { brand: brand, board_id: data.id, channel_list: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.list) || [], salesChannels: mappedSalesChannels, entityInfoId: entityInfoId });
684
740
  })
685
- .addCase(verifyBrandLeadOTP.rejected, function (state, action) {
741
+ .addCase(verifyBrandLeadOTP.rejected, function (state, _a) {
742
+ var message = _a.error.message;
686
743
  state.loading = false;
744
+ if (!isAuthenticationVerificationFailed(message))
745
+ state.error = message;
746
+ })
747
+ .addCase(verifyTokenSessionExpired.pending, function (state) {
748
+ state.error = null;
749
+ state.loading = true;
750
+ })
751
+ .addCase(verifyTokenSessionExpired.fulfilled, function (state, action) {
752
+ state.error = null;
753
+ state.loading = false;
754
+ var data = action.payload.data;
755
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
756
+ })
757
+ .addCase(verifyTokenSessionExpired.rejected, function (state, action) {
687
758
  state.error = action.error.message;
759
+ state.customLoading = false;
760
+ })
761
+ .addCase(verifyTokenSessionExpiredOTP.pending, function (state) {
762
+ state.loading = true;
763
+ state.error = null;
764
+ })
765
+ .addCase(verifyTokenSessionExpiredOTP.fulfilled, function (state, action) {
766
+ state.loading = false;
767
+ state.error = null;
768
+ var data = action.payload.data;
769
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
770
+ })
771
+ .addCase(verifyTokenSessionExpiredOTP.rejected, function (state, _a) {
772
+ var message = _a.error.message;
773
+ state.loading = false;
774
+ if (!isAuthenticationVerificationFailed(message))
775
+ state.error = message;
688
776
  })
689
777
  .addCase(checkBrandNameAvailability.fulfilled, function (state, action) {
690
778
  var _a;
@@ -34,6 +34,16 @@ export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
34
34
  brand: any;
35
35
  leadData: any;
36
36
  }, OTPFormValues, {}>;
37
+ export declare const verifyLeadTokenSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
38
+ data: any;
39
+ }, boolean, {}>;
40
+ export declare const verifyLeadOTPSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
41
+ data: any;
42
+ formData: {
43
+ isNID: boolean;
44
+ otp: string;
45
+ };
46
+ }, OTPFormValues, {}>;
37
47
  interface verifyNafathParams {
38
48
  onSuccess?: () => void;
39
49
  onFailure?: () => void;