@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.
- package/build/@types/app.d.ts +3 -1
- package/build/@types/app.js +1 -0
- package/build/@types/form.d.ts +4 -2
- package/build/@types/index.d.ts +1 -0
- package/build/@types/index.js +1 -0
- package/build/@types/terminal.d.ts +104 -0
- package/build/@types/terminal.js +1 -0
- package/build/api/account.d.ts +2 -2
- package/build/api/account.js +7 -4
- package/build/api/auth.d.ts +18 -3
- package/build/api/auth.js +7 -3
- package/build/api/axios.d.ts +1 -1
- package/build/api/axios.js +9 -1
- package/build/api/entity.d.ts +3 -0
- package/build/api/headers.d.ts +6 -0
- package/build/api/headers.js +18 -0
- package/build/api/index.d.ts +15 -8
- package/build/api/index.js +5 -2
- package/build/api/lead.d.ts +3 -2
- package/build/api/operator.d.ts +1 -1
- package/build/api/operator.js +5 -2
- package/build/api/terminal.d.ts +25 -0
- package/build/api/terminal.js +55 -0
- package/build/app/rootReducer.d.ts +2 -0
- package/build/app/rootReducer.js +5 -1
- package/build/app/session.d.ts +17 -0
- package/build/app/session.js +28 -0
- package/build/app/settings.js +1 -1
- package/build/app/store.d.ts +4 -0
- package/build/assets/currencies/AEDSymbol.js +1 -1
- package/build/assets/currencies/SARSymbol.js +1 -1
- package/build/assets/locales/ar.json +51 -15
- package/build/assets/locales/en.json +56 -46
- package/build/components/DeviceCard/DeviceCard.d.ts +19 -0
- package/build/components/DeviceCard/DeviceCard.js +102 -0
- package/build/components/DeviceCard/index.d.ts +3 -0
- package/build/components/DeviceCard/index.js +2 -0
- package/build/components/OTPTimer/OTPTimer.d.ts +2 -1
- package/build/components/OTPTimer/OTPTimer.js +4 -4
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/components/TruncatedTooltipText/TruncatedTooltipText.d.ts +7 -0
- package/build/components/TruncatedTooltipText/TruncatedTooltipText.js +33 -0
- package/build/components/TruncatedTooltipText/index.d.ts +2 -0
- package/build/components/TruncatedTooltipText/index.js +2 -0
- package/build/constants/api.d.ts +1 -1
- package/build/constants/api.js +2 -2
- package/build/constants/app.d.ts +27 -3
- package/build/constants/app.js +350 -40
- package/build/constants/dummy.d.ts +2 -29
- package/build/constants/dummy.js +4 -4
- package/build/constants/flows.d.ts +27 -22
- package/build/constants/flows.js +27 -23
- package/build/constants/validation.d.ts +2 -0
- package/build/constants/validation.js +2 -0
- package/build/features/app/auth/authStore.d.ts +4 -0
- package/build/features/app/auth/authStore.js +168 -54
- package/build/features/app/bank/bankStore.d.ts +7 -0
- package/build/features/app/bank/bankStore.js +110 -20
- package/build/features/app/board/boardStore.d.ts +5 -0
- package/build/features/app/board/boardStore.js +94 -7
- package/build/features/app/brand/brandStore.d.ts +7 -0
- package/build/features/app/brand/brandStore.js +107 -19
- package/build/features/app/business/businessStore.d.ts +10 -0
- package/build/features/app/business/businessStore.js +130 -37
- package/build/features/app/connect/connectStore.d.ts +12 -5
- package/build/features/app/connect/connectStore.js +146 -31
- package/build/features/app/connectExpress/connectExpressStore.d.ts +10 -5
- package/build/features/app/connectExpress/connectExpressStore.js +159 -21
- package/build/features/app/entity/entityStore.d.ts +7 -0
- package/build/features/app/entity/entityStore.js +108 -18
- package/build/features/app/individual/individualStore.d.ts +9 -0
- package/build/features/app/individual/individualStore.js +126 -34
- package/build/features/app/kyc/kycStore.d.ts +5 -5
- package/build/features/app/kyc/kycStore.js +4 -1
- package/build/features/app/password/passwordStore.d.ts +9 -0
- package/build/features/app/password/passwordStore.js +130 -46
- package/build/features/app/signIn/signInStore.js +12 -16
- package/build/features/app/tax/taxStore.d.ts +7 -0
- package/build/features/app/tax/taxStore.js +104 -17
- package/build/features/app/terminal/terminalStore.d.ts +119 -0
- package/build/features/app/terminal/terminalStore.js +781 -0
- package/build/features/auth/Auth.js +3 -2
- package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +10 -7
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +6 -3
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.js +6 -4
- package/build/features/auth/screens/AuthenticationList/EntityList.js +11 -3
- package/build/features/auth/screens/OTPSessionExpired/OTPInput.d.ts +3 -0
- package/build/features/auth/screens/OTPSessionExpired/OTPInput.js +58 -0
- package/build/features/auth/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/auth/screens/OTPSessionExpired/OTPSessionExpired.js +85 -0
- package/build/features/auth/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/auth/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/auth/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/auth/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/bank/Bank.js +3 -2
- package/build/features/bank/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/bank/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/bank/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/bank/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/bank/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/bank/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/bank/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/bank/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/board/Board.js +5 -4
- package/build/features/board/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/board/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/board/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/board/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/board/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/board/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/board/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/board/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/brand/Brand.js +3 -2
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +2 -2
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +1 -1
- package/build/features/brand/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/brand/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/brand/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/brand/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/brand/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/brand/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/brand/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/brand/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/business/Business.js +3 -2
- package/build/features/business/screens/BusinessType/BusinessType.js +15 -5
- package/build/features/business/screens/BusinessType/EntityLicenseList.js +11 -5
- package/build/features/business/screens/BusinessType/LicenseList.js +20 -12
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
- package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +35 -0
- package/build/features/business/screens/BusinessType/UnifiedNumber.js +84 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +6 -3
- package/build/features/business/screens/BusinessType/validation.js +31 -10
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +1 -1
- package/build/features/business/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/business/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/business/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/business/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/business/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/business/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/business/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/business/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/connect/Connect.js +3 -2
- package/build/features/connect/screens/OTPSessionExpired/OTPInput.d.ts +5 -0
- package/build/features/connect/screens/OTPSessionExpired/OTPInput.js +58 -0
- package/build/features/connect/screens/OTPSessionExpired/OTPSessionExpired.d.ts +3 -0
- package/build/features/connect/screens/OTPSessionExpired/OTPSessionExpired.js +86 -0
- package/build/features/connect/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/connect/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/connect/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/connect/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/connectExpress/ConnectExpress.js +3 -2
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +10 -10
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +6 -3
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +6 -4
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +11 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +27 -16
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +36 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.js +81 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.d.ts +6 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +57 -21
- package/build/features/connectExpress/screens/Mobile/Mobile.js +7 -6
- package/build/features/connectExpress/screens/OTPSessionExpired/OTPInput.d.ts +3 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/OTPInput.js +58 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/OTPSessionExpired.js +85 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/entity/Entity.js +3 -2
- package/build/features/entity/screens/EntityName/EntityName.js +16 -15
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +2 -2
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
- package/build/features/entity/screens/EntityName/validation.d.ts +50 -48
- package/build/features/entity/screens/EntityName/validation.js +100 -85
- package/build/features/entity/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/entity/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/entity/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/entity/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/entity/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/entity/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/entity/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/entity/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/featuresScreens.d.ts +1 -0
- package/build/features/featuresScreens.js +187 -0
- package/build/features/individual/Individual.js +3 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -2
- package/build/features/individual/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/individual/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/individual/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/individual/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/individual/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/individual/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/individual/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/individual/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/password/Password.js +3 -2
- package/build/features/password/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/password/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/password/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/password/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/password/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/password/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/password/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/password/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/shared/Address/CountryList.d.ts +1 -1
- package/build/features/shared/Address/InputSelect.d.ts +1 -1
- package/build/features/shared/Button/Button.js +1 -1
- package/build/features/shared/Button/FlowsButtons.d.ts +1 -0
- package/build/features/shared/Button/FlowsButtons.js +2 -2
- package/build/features/shared/OTPVerifySecurityError/OTPVerifySecurityError.d.ts +3 -0
- package/build/features/shared/OTPVerifySecurityError/OTPVerifySecurityError.js +9 -0
- package/build/features/shared/OTPVerifySecurityError/index.d.ts +2 -0
- package/build/features/shared/OTPVerifySecurityError/index.js +2 -0
- package/build/features/shared/PushNotification/PushNotification.d.ts +11 -0
- package/build/features/shared/PushNotification/PushNotification.js +34 -0
- package/build/features/shared/PushNotification/index.d.ts +2 -0
- package/build/features/shared/PushNotification/index.js +2 -0
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +2 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +6 -5
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
- package/build/features/tax/Tax.js +3 -2
- package/build/features/tax/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/tax/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/tax/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/tax/screens/OTPSessionExpired/OTPSessionExpired.js +75 -0
- package/build/features/tax/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/tax/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/tax/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/tax/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/terminal/Terminal.d.ts +14 -0
- package/build/features/terminal/Terminal.js +96 -0
- package/build/features/terminal/index.d.ts +1 -0
- package/build/features/terminal/index.js +1 -0
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.d.ts +3 -0
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +68 -0
- package/build/features/terminal/screens/LinkNewTerminal/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkNewTerminal/index.js +2 -0
- package/build/features/terminal/screens/LinkNewTerminal/styles.d.ts +10 -0
- package/build/features/terminal/screens/LinkNewTerminal/styles.js +28 -0
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.d.ts +3 -0
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +50 -0
- package/build/features/terminal/screens/LinkedSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkedSuccess/index.js +2 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.d.ts +3 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +55 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/index.js +2 -0
- package/build/features/terminal/screens/Loading/Loading.d.ts +4 -0
- package/build/features/terminal/screens/Loading/Loading.js +10 -0
- package/build/features/terminal/screens/Loading/index.d.ts +2 -0
- package/build/features/terminal/screens/Loading/index.js +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.d.ts +3 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +103 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/index.d.ts +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/index.js +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.d.ts +36 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.js +34 -0
- package/build/features/terminal/screens/OTPSessionExpired/OTPInput.d.ts +7 -0
- package/build/features/terminal/screens/OTPSessionExpired/OTPInput.js +51 -0
- package/build/features/terminal/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/terminal/screens/OTPSessionExpired/OTPSessionExpired.js +89 -0
- package/build/features/terminal/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/terminal/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/terminal/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/terminal/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/terminal/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/terminal/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/terminal/screens/OperatorError/index.d.ts +2 -0
- package/build/features/terminal/screens/OperatorError/index.js +2 -0
- package/build/features/terminal/screens/POSDeviceListPage/POSDeviceListPage.d.ts +3 -0
- package/build/features/terminal/screens/POSDeviceListPage/POSDeviceListPage.js +50 -0
- package/build/features/terminal/screens/POSDeviceListPage/index.d.ts +2 -0
- package/build/features/terminal/screens/POSDeviceListPage/index.js +2 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +3 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +21 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +32 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.d.ts +2 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.js +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +9 -0
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +20 -0
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.d.ts +3 -0
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +153 -0
- package/build/features/terminal/screens/TerminalDeviceList/index.d.ts +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/index.js +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +9 -0
- package/build/features/terminal/screens/TerminalDeviceList/styles.js +13 -0
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.d.ts +3 -0
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +51 -0
- package/build/features/terminal/screens/UnlinkedSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/UnlinkedSuccess/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.d.ts +3 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +99 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.d.ts +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +26 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +30 -0
- package/build/features/terminal/screens/Verify/OTPInput.d.ts +7 -0
- package/build/features/terminal/screens/Verify/OTPInput.js +51 -0
- package/build/features/terminal/screens/Verify/Verify.d.ts +5 -0
- package/build/features/terminal/screens/Verify/Verify.js +89 -0
- package/build/features/terminal/screens/Verify/index.d.ts +2 -0
- package/build/features/terminal/screens/Verify/index.js +2 -0
- package/build/features/terminal/screens/Verify/validation.d.ts +8 -0
- package/build/features/terminal/screens/Verify/validation.js +4 -0
- package/build/features/terminal/screens/shared/Header.d.ts +10 -0
- package/build/features/terminal/screens/shared/Header.js +30 -0
- package/build/features/terminal/screens/shared/POSDeviceList.d.ts +11 -0
- package/build/features/terminal/screens/shared/POSDeviceList.js +30 -0
- package/build/features/terminal/screens/shared/index.d.ts +5 -0
- package/build/features/terminal/screens/shared/index.js +5 -0
- package/build/features/terminal/screens/shared/styles.d.ts +196 -0
- package/build/features/terminal/screens/shared/styles.js +155 -0
- package/build/features/terminal/screens/shared/utils.d.ts +7 -0
- package/build/features/terminal/screens/shared/utils.js +24 -0
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useAppDispatch.d.ts +2 -0
- package/build/hooks/useSessionExpiryHandler.d.ts +8 -0
- package/build/hooks/useSessionExpiryHandler.js +71 -0
- package/build/index.d.ts +3 -2
- package/build/index.js +4 -2
- package/build/theme/palette.js +12 -0
- package/build/theme/typography.js +4 -0
- package/build/utils/common.js +13 -6
- package/build/utils/error.d.ts +4 -0
- package/build/utils/error.js +12 -0
- package/build/utils/string.d.ts +3 -1
- package/build/utils/string.js +12 -2
- package/build/utils/validation.js +1 -1
- 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
|
|
139
|
-
return __generator(this, function (
|
|
140
|
-
switch (
|
|
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.
|
|
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 =
|
|
154
|
-
|
|
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 = (
|
|
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 =
|
|
168
|
-
if (!countryIso2 && ((
|
|
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 (!((
|
|
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 =
|
|
180
|
-
|
|
183
|
+
bankData = _m.sent();
|
|
184
|
+
_m.label = 5;
|
|
181
185
|
case 5:
|
|
182
|
-
(
|
|
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,
|
|
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.
|
|
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 =
|
|
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,
|
|
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
|
|
147
|
-
return __generator(this, function (
|
|
148
|
-
switch (
|
|
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.
|
|
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 =
|
|
162
|
-
|
|
163
|
-
|
|
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 =
|
|
176
|
-
if (!countryIso2 && ((
|
|
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 (!((
|
|
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 =
|
|
185
|
-
|
|
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 =
|
|
189
|
-
(
|
|
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,
|
|
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;
|