@tap-payments/auth-jsconnect 2.12.1-beta → 2.12.1-development
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +783 -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 { FlowsTypes } from '../../../@types';
|
|
52
52
|
import { handleCurrentActiveScreen, handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
53
53
|
import { PASSWORD_OPERATION_TYPE, PASSWORD_STEP_NAMES } from '../../../constants';
|
|
54
|
-
import { retrieveIndividualData, sendCustomEventToGTM, sleep } from '../../../utils';
|
|
54
|
+
import { isAuthenticationVerificationFailed, retrieveIndividualData, sendCustomEventToGTM, sleep } from '../../../utils';
|
|
55
55
|
export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', function (_a, thunkApi) {
|
|
56
56
|
var token = _a.token, isInternally = _a.isInternally;
|
|
57
57
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -72,6 +72,7 @@ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', functio
|
|
|
72
72
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
73
73
|
if (isInternally)
|
|
74
74
|
data.step_name = PASSWORD_STEP_NAMES.PASSWORD_INFO;
|
|
75
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
75
76
|
_b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.id, recipient = _b.recipient;
|
|
76
77
|
countryIso2 = country_code;
|
|
77
78
|
if (countryIso2)
|
|
@@ -156,9 +157,9 @@ export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails
|
|
|
156
157
|
});
|
|
157
158
|
export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
158
159
|
var _a, password, settings, responseBody, payload, data, _b, config, board_info_password_status, country_code, board_id, recipient, countryIso2, publicKey, flows, data_3, data_4;
|
|
159
|
-
var _c, _d, _e, _f
|
|
160
|
-
return __generator(this, function (
|
|
161
|
-
switch (
|
|
160
|
+
var _c, _d, _e, _f;
|
|
161
|
+
return __generator(this, function (_g) {
|
|
162
|
+
switch (_g.label) {
|
|
162
163
|
case 0:
|
|
163
164
|
_a = thunkApi.getState(), password = _a.password, settings = _a.settings;
|
|
164
165
|
responseBody = password.data.verify.responseBody;
|
|
@@ -169,19 +170,22 @@ export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', fun
|
|
|
169
170
|
step_name: PASSWORD_STEP_NAMES.PHONE_AUTH,
|
|
170
171
|
encryption_contract: ['data']
|
|
171
172
|
};
|
|
172
|
-
return [4, API.leadService.
|
|
173
|
+
return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
|
|
174
|
+
if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
|
|
175
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_OTP_VERIFY_SECURITY_ERROR_STEP'));
|
|
176
|
+
throw new Error(err === null || err === void 0 ? void 0 : err.message);
|
|
177
|
+
})];
|
|
173
178
|
case 1:
|
|
174
|
-
data =
|
|
175
|
-
if ((_d = data === null || data === void 0 ? void 0 : data.errors) === null || _d === void 0 ? void 0 : _d.length)
|
|
176
|
-
throw new Error(data.errors[0].description);
|
|
179
|
+
data = _g.sent();
|
|
177
180
|
_b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.id, recipient = _b.recipient;
|
|
181
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
178
182
|
countryIso2 = country_code;
|
|
179
183
|
if (countryIso2)
|
|
180
184
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
181
185
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
182
186
|
if (publicKey)
|
|
183
187
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
184
|
-
(
|
|
188
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
|
|
185
189
|
flows = [];
|
|
186
190
|
if (!(board_info_password_status === 'completed')) return [3, 3];
|
|
187
191
|
return [4, Promise.all([
|
|
@@ -189,7 +193,7 @@ export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', fun
|
|
|
189
193
|
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: recipient === null || recipient === void 0 ? void 0 : recipient.id, individualType: recipient === null || recipient === void 0 ? void 0 : recipient.type })).unwrap()
|
|
190
194
|
])];
|
|
191
195
|
case 2:
|
|
192
|
-
data_3 = (
|
|
196
|
+
data_3 = (_g.sent())[0];
|
|
193
197
|
flows = (data_3 === null || data_3 === void 0 ? void 0 : data_3.info) || [];
|
|
194
198
|
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
195
199
|
return [3, 6];
|
|
@@ -197,17 +201,66 @@ export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', fun
|
|
|
197
201
|
if (!!country_code) return [3, 5];
|
|
198
202
|
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
199
203
|
case 4:
|
|
200
|
-
data_4 =
|
|
201
|
-
if ((
|
|
204
|
+
data_4 = _g.sent();
|
|
205
|
+
if ((_f = data_4 === null || data_4 === void 0 ? void 0 : data_4.entity) === null || _f === void 0 ? void 0 : _f.country)
|
|
202
206
|
thunkApi.dispatch(handleSetCountryByIso2(data_4.entity.country));
|
|
203
|
-
|
|
207
|
+
_g.label = 5;
|
|
204
208
|
case 5:
|
|
205
209
|
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
206
|
-
|
|
210
|
+
_g.label = 6;
|
|
207
211
|
case 6: return [2, { data: data, formData: __assign({}, params), flows: flows }];
|
|
208
212
|
}
|
|
209
213
|
});
|
|
210
214
|
}); });
|
|
215
|
+
export var verifyLeadTokenSessionExpired = createAsyncThunk('password/verifyLeadTokenSessionExpired', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
216
|
+
var password, payload, data;
|
|
217
|
+
return __generator(this, function (_a) {
|
|
218
|
+
switch (_a.label) {
|
|
219
|
+
case 0:
|
|
220
|
+
password = thunkApi.getState().password;
|
|
221
|
+
payload = {
|
|
222
|
+
service_name: 'tap_email',
|
|
223
|
+
verify_token: password.data.verify.token
|
|
224
|
+
};
|
|
225
|
+
return [4, API.leadService.verifyToken(payload)];
|
|
226
|
+
case 1:
|
|
227
|
+
data = _a.sent();
|
|
228
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
229
|
+
if (redirect)
|
|
230
|
+
thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_SESSION_EXPIRED_OTP_STEP'));
|
|
231
|
+
return [2, { data: data }];
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}); });
|
|
235
|
+
export var verifyLeadOTPSessionExpired = createAsyncThunk('password/verifyLeadOTPSessionExpired', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
236
|
+
var _a, password, settings, session, responseBody, payload, data;
|
|
237
|
+
var _b, _c, _d;
|
|
238
|
+
return __generator(this, function (_e) {
|
|
239
|
+
switch (_e.label) {
|
|
240
|
+
case 0:
|
|
241
|
+
_a = thunkApi.getState(), password = _a.password, settings = _a.settings, session = _a.session;
|
|
242
|
+
responseBody = password.data.verify.responseBody;
|
|
243
|
+
payload = {
|
|
244
|
+
data: params.otp,
|
|
245
|
+
service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
|
|
246
|
+
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
247
|
+
step_name: PASSWORD_STEP_NAMES.PHONE_AUTH,
|
|
248
|
+
encryption_contract: ['data']
|
|
249
|
+
};
|
|
250
|
+
return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
|
|
251
|
+
if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
|
|
252
|
+
thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_OTP_VERIFY_SECURITY_ERROR_STEP'));
|
|
253
|
+
throw new Error(err === null || err === void 0 ? void 0 : err.message);
|
|
254
|
+
})];
|
|
255
|
+
case 1:
|
|
256
|
+
data = _e.sent();
|
|
257
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
258
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
|
|
259
|
+
thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
|
|
260
|
+
return [2, { data: data, formData: __assign({}, params) }];
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
}); });
|
|
211
264
|
export var createPassword = createAsyncThunk('createPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
212
265
|
var _a, settings, password, requestBody, data;
|
|
213
266
|
var _b, _c, _d, _e;
|
|
@@ -296,9 +349,9 @@ export var retrieveBoardStatus = createAsyncThunk('password/retrieveBoardStatus'
|
|
|
296
349
|
}); });
|
|
297
350
|
export var verifyOperationToken = createAsyncThunk('verifyOperationToken', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
298
351
|
var token, boardId, boardInfoId, userId, userType, payload, data, countryIso2, publicKey, data_5;
|
|
299
|
-
var _a, _b
|
|
300
|
-
return __generator(this, function (
|
|
301
|
-
switch (
|
|
352
|
+
var _a, _b;
|
|
353
|
+
return __generator(this, function (_c) {
|
|
354
|
+
switch (_c.label) {
|
|
302
355
|
case 0:
|
|
303
356
|
token = params.token, boardId = params.boardId, boardInfoId = params.boardInfoId, userId = params.userId, userType = params.userType;
|
|
304
357
|
payload = {
|
|
@@ -307,22 +360,21 @@ export var verifyOperationToken = createAsyncThunk('verifyOperationToken', funct
|
|
|
307
360
|
};
|
|
308
361
|
return [4, API.authService.verifyAuth(payload)];
|
|
309
362
|
case 1:
|
|
310
|
-
data =
|
|
311
|
-
|
|
312
|
-
throw new Error(data.errors[0].description);
|
|
363
|
+
data = _c.sent();
|
|
364
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
313
365
|
countryIso2 = data === null || data === void 0 ? void 0 : data.country;
|
|
314
366
|
if (countryIso2)
|
|
315
367
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
316
|
-
publicKey = (
|
|
368
|
+
publicKey = (_a = data === null || data === void 0 ? void 0 : data.config) === null || _a === void 0 ? void 0 : _a.public_key;
|
|
317
369
|
if (publicKey)
|
|
318
370
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
319
371
|
if (!!(data === null || data === void 0 ? void 0 : data.country)) return [3, 3];
|
|
320
372
|
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
321
373
|
case 2:
|
|
322
|
-
data_5 =
|
|
323
|
-
if ((
|
|
374
|
+
data_5 = _c.sent();
|
|
375
|
+
if ((_b = data_5 === null || data_5 === void 0 ? void 0 : data_5.entity) === null || _b === void 0 ? void 0 : _b.country)
|
|
324
376
|
thunkApi.dispatch(handleSetCountryByIso2(data_5.entity.country));
|
|
325
|
-
|
|
377
|
+
_c.label = 3;
|
|
326
378
|
case 3:
|
|
327
379
|
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
328
380
|
return [2, __assign({ data: data, token: token, boardId: boardId, boardInfoId: boardInfoId }, (userId &&
|
|
@@ -347,16 +399,16 @@ export var resendOperationOTP = createAsyncThunk('resendOperationOTPPassword', f
|
|
|
347
399
|
};
|
|
348
400
|
return [4, API.authService.verifyAuth(payload)];
|
|
349
401
|
case 1:
|
|
350
|
-
data =
|
|
402
|
+
data = _a.sent();
|
|
351
403
|
return [2, { data: data }];
|
|
352
404
|
}
|
|
353
405
|
});
|
|
354
406
|
}); });
|
|
355
407
|
export var resetPassword = createAsyncThunk('resetPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
356
408
|
var _a, password, settings, responseBody, passwordData, payload, data;
|
|
357
|
-
var _b, _c
|
|
358
|
-
return __generator(this, function (
|
|
359
|
-
switch (
|
|
409
|
+
var _b, _c;
|
|
410
|
+
return __generator(this, function (_d) {
|
|
411
|
+
switch (_d.label) {
|
|
360
412
|
case 0:
|
|
361
413
|
_a = thunkApi.getState(), password = _a.password, settings = _a.settings;
|
|
362
414
|
responseBody = password.data.verify.responseBody;
|
|
@@ -371,15 +423,16 @@ export var resetPassword = createAsyncThunk('resetPassword', function (params, t
|
|
|
371
423
|
},
|
|
372
424
|
encryption_contract: ['user_credentail.otp', 'user_credentail.new_password']
|
|
373
425
|
};
|
|
374
|
-
return [4, API.authService.verifyAuth(payload)
|
|
426
|
+
return [4, API.authService.verifyAuth(payload).catch(function (err) {
|
|
427
|
+
if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
|
|
428
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_OTP_VERIFY_SECURITY_ERROR_STEP'));
|
|
429
|
+
throw new Error(err === null || err === void 0 ? void 0 : err.message);
|
|
430
|
+
})];
|
|
375
431
|
case 1:
|
|
376
|
-
data =
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP')); });
|
|
381
|
-
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, payload);
|
|
382
|
-
}
|
|
432
|
+
data = _d.sent();
|
|
433
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
434
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP')); });
|
|
435
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, payload);
|
|
383
436
|
return [2, { data: data, formData: __assign(__assign({}, params), passwordData) }];
|
|
384
437
|
}
|
|
385
438
|
});
|
|
@@ -511,9 +564,44 @@ export var passwordSlice = createSlice({
|
|
|
511
564
|
flows: flows
|
|
512
565
|
}));
|
|
513
566
|
})
|
|
514
|
-
.addCase(verifyPasswordLeadOTP.rejected, function (state,
|
|
567
|
+
.addCase(verifyPasswordLeadOTP.rejected, function (state, _a) {
|
|
568
|
+
var message = _a.error.message;
|
|
569
|
+
state.loading = false;
|
|
570
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
571
|
+
state.error = message;
|
|
572
|
+
})
|
|
573
|
+
.addCase(verifyLeadTokenSessionExpired.fulfilled, function (state, action) {
|
|
574
|
+
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.SET_PASSWORD;
|
|
575
|
+
state.error = null;
|
|
515
576
|
state.loading = false;
|
|
577
|
+
var data = action.payload.data;
|
|
578
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
579
|
+
})
|
|
580
|
+
.addCase(verifyLeadTokenSessionExpired.pending, function (state) {
|
|
581
|
+
state.loading = true;
|
|
582
|
+
state.error = null;
|
|
583
|
+
})
|
|
584
|
+
.addCase(verifyLeadTokenSessionExpired.rejected, function (state, action) {
|
|
516
585
|
state.error = action.error.message;
|
|
586
|
+
state.loading = false;
|
|
587
|
+
})
|
|
588
|
+
.addCase(verifyLeadOTPSessionExpired.pending, function (state) {
|
|
589
|
+
state.loading = true;
|
|
590
|
+
state.error = null;
|
|
591
|
+
})
|
|
592
|
+
.addCase(verifyLeadOTPSessionExpired.fulfilled, function (state, action) {
|
|
593
|
+
state.loading = false;
|
|
594
|
+
state.error = null;
|
|
595
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
596
|
+
state.data.otpData = formData;
|
|
597
|
+
state.data.otpData.responseBody = data;
|
|
598
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
599
|
+
})
|
|
600
|
+
.addCase(verifyLeadOTPSessionExpired.rejected, function (state, _a) {
|
|
601
|
+
var message = _a.error.message;
|
|
602
|
+
state.loading = false;
|
|
603
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
604
|
+
state.error = message;
|
|
517
605
|
})
|
|
518
606
|
.addCase(createPassword.pending, function (state) {
|
|
519
607
|
state.loading = true;
|
|
@@ -599,14 +687,8 @@ export var passwordSlice = createSlice({
|
|
|
599
687
|
state.error = null;
|
|
600
688
|
})
|
|
601
689
|
.addCase(resendOperationOTP.fulfilled, function (state, action) {
|
|
602
|
-
var _a;
|
|
603
690
|
state.error = null;
|
|
604
691
|
var data = action.payload.data;
|
|
605
|
-
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
606
|
-
if (description) {
|
|
607
|
-
state.error = description;
|
|
608
|
-
return;
|
|
609
|
-
}
|
|
610
692
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
611
693
|
})
|
|
612
694
|
.addCase(resendOperationOTP.rejected, function (state, action) {
|
|
@@ -624,8 +706,10 @@ export var passwordSlice = createSlice({
|
|
|
624
706
|
state.loading = true;
|
|
625
707
|
state.error = null;
|
|
626
708
|
})
|
|
627
|
-
.addCase(resetPassword.rejected, function (state,
|
|
628
|
-
|
|
709
|
+
.addCase(resetPassword.rejected, function (state, _a) {
|
|
710
|
+
var message = _a.error.message;
|
|
711
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
712
|
+
state.error = message;
|
|
629
713
|
state.loading = false;
|
|
630
714
|
})
|
|
631
715
|
.addCase(retrieveBoardResetPasswordSuccess.fulfilled, function (state, action) {
|
|
@@ -189,12 +189,10 @@ export var verifyAuthOTP = createAsyncThunk('signIn/verifyAuthOTP', function (pa
|
|
|
189
189
|
};
|
|
190
190
|
return [4, API.authService.verifyAuth(requestBody)];
|
|
191
191
|
case 1:
|
|
192
|
-
data =
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
(_e = (_d = settings.data.appConfig).onFlowCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, data);
|
|
197
|
-
}
|
|
192
|
+
data = _f.sent();
|
|
193
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, { otp: params.otp });
|
|
194
|
+
thunkApi.dispatch(handleOpen(false));
|
|
195
|
+
(_e = (_d = settings.data.appConfig).onFlowCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, data);
|
|
198
196
|
return [2, { data: data, formData: params }];
|
|
199
197
|
}
|
|
200
198
|
});
|
|
@@ -221,16 +219,14 @@ export var verifyAuthPassword = createAsyncThunk('signIn/verifyAuthPassword', fu
|
|
|
221
219
|
};
|
|
222
220
|
return [4, API.authService.verifyAuth(requestBody)];
|
|
223
221
|
case 1:
|
|
224
|
-
data =
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
(_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, data);
|
|
233
|
-
}
|
|
222
|
+
data = _g.sent();
|
|
223
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.password });
|
|
224
|
+
if ((data === null || data === void 0 ? void 0 : data.status) === 'pending') {
|
|
225
|
+
thunkApi.dispatch(handleNextScreenStep('SIGIN_OTP_STEP'));
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
thunkApi.dispatch(handleOpen(false));
|
|
229
|
+
(_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, data);
|
|
234
230
|
}
|
|
235
231
|
return [2, data];
|
|
236
232
|
}
|
|
@@ -26,6 +26,13 @@ export declare const verifyTaxLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
26
26
|
entityData: any;
|
|
27
27
|
formData: OTPFormValues;
|
|
28
28
|
}, OTPFormValues, {}>;
|
|
29
|
+
export declare const verifyLeadTokenSessionVerified: import("@reduxjs/toolkit").AsyncThunk<{
|
|
30
|
+
data: any;
|
|
31
|
+
}, boolean, {}>;
|
|
32
|
+
export declare const verifyLeadOTPSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
|
|
33
|
+
data: any;
|
|
34
|
+
formData: OTPFormValues;
|
|
35
|
+
}, OTPFormValues, {}>;
|
|
29
36
|
export declare const updateTaxInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
30
37
|
data: any;
|
|
31
38
|
formData: TaxFormValues;
|
|
@@ -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 { handleNextScreenStep, handleCurrentActiveScreen, handleSetCountryByIso2, handlePrevScreenStep, handlePublicKey, onCloseComplete } from '../../../app/settings';
|
|
53
53
|
import { TAX_STEP_NAMES } from '../../../constants';
|
|
54
|
-
import { getRecentDocumentBasedOnPurpose, hasNoneEditableValue, retrieveIndividualData, sleep } from '../../../utils';
|
|
54
|
+
import { getRecentDocumentBasedOnPurpose, hasNoneEditableValue, isAuthenticationVerificationFailed, retrieveIndividualData, sleep } from '../../../utils';
|
|
55
55
|
export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a, thunkApi) {
|
|
56
56
|
var token = _a.token, isInternally = _a.isInternally;
|
|
57
57
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -73,6 +73,7 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a
|
|
|
73
73
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
74
74
|
if (isInternally)
|
|
75
75
|
data.step_name = TAX_STEP_NAMES.TAX_INFO;
|
|
76
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
76
77
|
_b = data || {}, config = _b.config, country_code = _b.country_code, entity_id = _b.entity_id, boardId = _b.id;
|
|
77
78
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
78
79
|
if (publicKey)
|
|
@@ -178,9 +179,9 @@ export var retrieveBoardDetails = createAsyncThunk('tax/retrieveBrandInfo', func
|
|
|
178
179
|
});
|
|
179
180
|
export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
180
181
|
var _a, tax, settings, responseBody, payload, data, _b, config, entity_id, boardId, country_code, entityData, publicKey, countryIso2, data_2;
|
|
181
|
-
var _c, _d, _e, _f, _g
|
|
182
|
-
return __generator(this, function (
|
|
183
|
-
switch (
|
|
182
|
+
var _c, _d, _e, _f, _g;
|
|
183
|
+
return __generator(this, function (_h) {
|
|
184
|
+
switch (_h.label) {
|
|
184
185
|
case 0:
|
|
185
186
|
_a = thunkApi.getState(), tax = _a.tax, settings = _a.settings;
|
|
186
187
|
responseBody = tax.data.verify.responseBody;
|
|
@@ -191,11 +192,14 @@ export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (par
|
|
|
191
192
|
step_name: TAX_STEP_NAMES.PHONE_AUTH,
|
|
192
193
|
encryption_contract: ['data']
|
|
193
194
|
};
|
|
194
|
-
return [4, API.leadService.
|
|
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(handleNextScreenStep('TAX_OTP_VERIFY_SECURITY_ERROR_STEP'));
|
|
198
|
+
throw new Error(err === null || err === void 0 ? void 0 : err.message);
|
|
199
|
+
})];
|
|
195
200
|
case 1:
|
|
196
|
-
data =
|
|
197
|
-
|
|
198
|
-
throw new Error(data.errors[0].description);
|
|
201
|
+
data = _h.sent();
|
|
202
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
199
203
|
_b = data || {}, config = _b.config, entity_id = _b.entity_id, boardId = _b.id, country_code = _b.country_code;
|
|
200
204
|
entityData = undefined;
|
|
201
205
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
@@ -207,24 +211,73 @@ export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (par
|
|
|
207
211
|
if (!!entity_id) return [3, 3];
|
|
208
212
|
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
209
213
|
case 2:
|
|
210
|
-
data_2 =
|
|
211
|
-
if (!((
|
|
214
|
+
data_2 = _h.sent();
|
|
215
|
+
if (!((_d = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _d === void 0 ? void 0 : _d.id))
|
|
212
216
|
throw new Error('entity_id_missing');
|
|
213
217
|
entityData = data_2;
|
|
214
218
|
return [3, 5];
|
|
215
219
|
case 3: return [4, API.entityService.retrieveEntity(entity_id)];
|
|
216
220
|
case 4:
|
|
217
|
-
entityData =
|
|
218
|
-
|
|
221
|
+
entityData = _h.sent();
|
|
222
|
+
_h.label = 5;
|
|
219
223
|
case 5:
|
|
220
|
-
if (!countryIso2 && ((
|
|
224
|
+
if (!countryIso2 && ((_e = entityData === null || entityData === void 0 ? void 0 : entityData.entity) === null || _e === void 0 ? void 0 : _e.country))
|
|
221
225
|
thunkApi.dispatch(handleSetCountryByIso2(entityData.entity.country));
|
|
222
|
-
(
|
|
226
|
+
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, { otp: params.otp });
|
|
223
227
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP')); });
|
|
224
228
|
return [2, { data: data, entityData: entityData === null || entityData === void 0 ? void 0 : entityData.entity, formData: params }];
|
|
225
229
|
}
|
|
226
230
|
});
|
|
227
231
|
}); });
|
|
232
|
+
export var verifyLeadTokenSessionVerified = createAsyncThunk('tax/verifyLeadTokenSessionVerified', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
233
|
+
var tax, payload, data;
|
|
234
|
+
return __generator(this, function (_a) {
|
|
235
|
+
switch (_a.label) {
|
|
236
|
+
case 0:
|
|
237
|
+
tax = thunkApi.getState().tax;
|
|
238
|
+
payload = {
|
|
239
|
+
service_name: 'tap_email',
|
|
240
|
+
verify_token: tax.data.verify.token
|
|
241
|
+
};
|
|
242
|
+
return [4, API.leadService.verifyToken(payload)];
|
|
243
|
+
case 1:
|
|
244
|
+
data = _a.sent();
|
|
245
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
246
|
+
if (redirect)
|
|
247
|
+
thunkApi.dispatch(handleCurrentActiveScreen('TAX_SESSION_EXPIRED_OTP_STEP'));
|
|
248
|
+
return [2, { data: data }];
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
}); });
|
|
252
|
+
export var verifyLeadOTPSessionExpired = createAsyncThunk('tax/verifyLeadOTPSessionExpired', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
253
|
+
var _a, tax, settings, session, responseBody, payload, data;
|
|
254
|
+
var _b, _c, _d;
|
|
255
|
+
return __generator(this, function (_e) {
|
|
256
|
+
switch (_e.label) {
|
|
257
|
+
case 0:
|
|
258
|
+
_a = thunkApi.getState(), tax = _a.tax, settings = _a.settings, session = _a.session;
|
|
259
|
+
responseBody = tax.data.verify.responseBody;
|
|
260
|
+
payload = {
|
|
261
|
+
data: params.otp,
|
|
262
|
+
service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
|
|
263
|
+
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
264
|
+
step_name: TAX_STEP_NAMES.PHONE_AUTH,
|
|
265
|
+
encryption_contract: ['data']
|
|
266
|
+
};
|
|
267
|
+
return [4, API.leadService.verifyTokenOTP(payload).catch(function (err) {
|
|
268
|
+
if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
|
|
269
|
+
thunkApi.dispatch(handleCurrentActiveScreen('TAX_OTP_VERIFY_SECURITY_ERROR_STEP'));
|
|
270
|
+
throw new Error(err === null || err === void 0 ? void 0 : err.message);
|
|
271
|
+
})];
|
|
272
|
+
case 1:
|
|
273
|
+
data = _e.sent();
|
|
274
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
275
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
|
|
276
|
+
thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
|
|
277
|
+
return [2, { data: data, formData: params }];
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
}); });
|
|
228
281
|
export var updateTaxInfo = createAsyncThunk('updateTaxInfo', function (_a, thunkApi) {
|
|
229
282
|
var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
|
|
230
283
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -323,7 +376,7 @@ export var updateLeadSuccess = createAsyncThunk('taxUpdateLeadSuccess', function
|
|
|
323
376
|
}
|
|
324
377
|
});
|
|
325
378
|
}); });
|
|
326
|
-
export var onCloseCompleteTax = createAsyncThunk('
|
|
379
|
+
export var onCloseCompleteTax = createAsyncThunk('tax/onCloseCompleteTax', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
327
380
|
var tax, _a, merchant, brand, entity;
|
|
328
381
|
return __generator(this, function (_b) {
|
|
329
382
|
switch (_b.label) {
|
|
@@ -426,9 +479,43 @@ export var taxSlice = createSlice({
|
|
|
426
479
|
if (is_vat_acknowledged)
|
|
427
480
|
state.data.taxData.confirmPolicy = is_vat_acknowledged;
|
|
428
481
|
})
|
|
429
|
-
.addCase(verifyTaxLeadOTP.rejected, function (state,
|
|
482
|
+
.addCase(verifyTaxLeadOTP.rejected, function (state, _a) {
|
|
483
|
+
var message = _a.error.message;
|
|
484
|
+
state.loading = false;
|
|
485
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
486
|
+
state.error = message;
|
|
487
|
+
})
|
|
488
|
+
.addCase(verifyLeadTokenSessionVerified.fulfilled, function (state, action) {
|
|
489
|
+
state.error = null;
|
|
430
490
|
state.loading = false;
|
|
491
|
+
var data = action.payload.data;
|
|
492
|
+
state.data.verify.responseBody = __assign({}, data);
|
|
493
|
+
})
|
|
494
|
+
.addCase(verifyLeadTokenSessionVerified.pending, function (state) {
|
|
495
|
+
state.error = null;
|
|
496
|
+
state.loading = true;
|
|
497
|
+
})
|
|
498
|
+
.addCase(verifyLeadTokenSessionVerified.rejected, function (state, action) {
|
|
431
499
|
state.error = action.error.message;
|
|
500
|
+
state.loading = false;
|
|
501
|
+
})
|
|
502
|
+
.addCase(verifyLeadOTPSessionExpired.pending, function (state) {
|
|
503
|
+
state.loading = true;
|
|
504
|
+
state.error = null;
|
|
505
|
+
})
|
|
506
|
+
.addCase(verifyLeadOTPSessionExpired.fulfilled, function (state, action) {
|
|
507
|
+
state.loading = false;
|
|
508
|
+
state.error = null;
|
|
509
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
510
|
+
state.data.otpData = formData;
|
|
511
|
+
state.data.otpData.responseBody = data;
|
|
512
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
513
|
+
})
|
|
514
|
+
.addCase(verifyLeadOTPSessionExpired.rejected, function (state, _a) {
|
|
515
|
+
var message = _a.error.message;
|
|
516
|
+
state.loading = false;
|
|
517
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
518
|
+
state.error = message;
|
|
432
519
|
})
|
|
433
520
|
.addCase(updateTaxInfo.pending, function (state) {
|
|
434
521
|
state.loading = true;
|