@tap-payments/auth-jsconnect 2.7.1-test → 2.7.1
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 +46 -8
- package/build/@types/app.js +16 -0
- package/build/@types/config.d.ts +21 -64
- package/build/@types/form.d.ts +11 -1
- package/build/@types/redux.d.ts +1 -0
- package/build/@types/theme.d.ts +1 -1
- package/build/@types/theme.js +1 -1
- package/build/api/account.d.ts +4 -0
- package/build/api/account.js +9 -2
- package/build/api/auth.d.ts +35 -20
- package/build/api/auth.js +1 -1
- package/build/api/data.d.ts +4 -17
- package/build/api/data.js +5 -45
- package/build/api/entity.d.ts +5 -2
- package/build/api/entity.js +12 -4
- package/build/api/firebase.js +68 -8
- package/build/api/index.d.ts +13 -25
- package/build/api/lead.d.ts +16 -3
- package/build/api/lead.js +16 -0
- package/build/api/user.d.ts +7 -0
- package/build/api/user.js +9 -1
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +3 -1
- package/build/app/settings.d.ts +3 -2
- package/build/app/settings.js +56 -29
- package/build/app/store.d.ts +2 -0
- package/build/assets/locales/ar.json +353 -151
- package/build/assets/locales/en.json +349 -150
- package/build/components/AnimationFlow/AnimationFlow.d.ts +9 -6
- package/build/components/AnimationFlow/AnimationFlow.js +5 -5
- package/build/components/AnimationFlow/BottomSheet.d.ts +5 -3
- package/build/components/AnimationFlow/BottomSheet.js +43 -14
- package/build/components/AnimationFlow/Dialog.d.ts +4 -4
- package/build/components/AnimationFlow/Dialog.js +5 -3
- package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +1 -1
- package/build/components/ArabicDatePicker/ArabicDatePicker.js +2 -2
- package/build/components/ArabicDatePicker/style.css +32 -3
- package/build/components/DatePicker/DatePicker.d.ts +1 -1
- package/build/components/DatePicker/DatePicker.js +2 -2
- package/build/components/Footer/Footer.js +2 -1
- package/build/components/Input/Input.js +1 -1
- package/build/components/Providers/ThemeProvider.js +3 -3
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +5 -7
- package/build/constants/api.js +11 -15
- package/build/constants/app.d.ts +39 -0
- package/build/constants/app.js +345 -35
- package/build/constants/assets.d.ts +3 -0
- package/build/constants/assets.js +4 -1
- package/build/constants/dummy.d.ts +4 -219
- package/build/constants/dummy.js +64 -6194
- package/build/constants/flows.d.ts +26 -0
- package/build/constants/flows.js +27 -0
- package/build/constants/index.d.ts +1 -0
- package/build/constants/index.js +1 -0
- package/build/constants/validation.d.ts +2 -0
- package/build/constants/validation.js +2 -0
- package/build/features/app/auth/authStore.d.ts +29 -15
- package/build/features/app/auth/authStore.js +454 -155
- package/build/features/app/bank/bankStore.d.ts +13 -18
- package/build/features/app/bank/bankStore.js +186 -153
- package/build/features/app/board/boardStore.d.ts +5 -1
- package/build/features/app/board/boardStore.js +82 -51
- package/build/features/app/brand/brandStore.d.ts +17 -33
- package/build/features/app/brand/brandStore.js +254 -257
- package/build/features/app/business/businessStore.d.ts +37 -15
- package/build/features/app/business/businessStore.js +407 -223
- package/build/features/app/connect/connectStore.d.ts +34 -13
- package/build/features/app/connect/connectStore.js +317 -123
- package/build/features/app/connectExpress/connectExpressStore.d.ts +53 -30
- package/build/features/app/connectExpress/connectExpressStore.js +601 -370
- package/build/features/app/entity/entityStore.d.ts +20 -36
- package/build/features/app/entity/entityStore.js +204 -238
- package/build/features/app/individual/individualStore.d.ts +18 -34
- package/build/features/app/individual/individualStore.js +269 -292
- package/build/features/app/kyc/kycStore.d.ts +67 -0
- package/build/features/app/kyc/kycStore.js +408 -0
- package/build/features/app/password/passwordStore.d.ts +33 -18
- package/build/features/app/password/passwordStore.js +260 -219
- package/build/features/app/signIn/signInStore.js +19 -15
- package/build/features/app/tax/taxStore.d.ts +13 -7
- package/build/features/app/tax/taxStore.js +170 -136
- package/build/features/auth/Auth.d.ts +5 -6
- package/build/features/auth/Auth.js +44 -21
- package/build/features/auth/screens/AccountNotFound/AccountNotFound.js +2 -5
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.d.ts +5 -0
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +58 -0
- package/build/features/auth/screens/AuthSwitch/index.d.ts +3 -0
- package/build/features/auth/screens/AuthSwitch/index.js +2 -0
- package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +2 -8
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
- package/build/features/auth/screens/AuthenticationList/LicenseNumber.js +2 -2
- package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +8 -2
- package/build/features/auth/screens/CivilID/CivilID.js +4 -35
- package/build/features/auth/screens/{NID → DOB}/DOB.js +3 -3
- package/build/features/auth/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/auth/screens/DOB/DOBForm.js +59 -0
- package/build/features/auth/screens/DOB/index.d.ts +3 -0
- package/build/features/auth/screens/DOB/index.js +2 -0
- package/build/features/{business/screens/OTP → auth/screens/DOB}/validation.d.ts +4 -4
- package/build/features/auth/screens/DOB/validation.js +4 -0
- package/build/features/auth/screens/Email/Email.d.ts +5 -0
- package/build/features/auth/screens/Email/Email.js +57 -0
- package/build/features/auth/screens/Email/EmailField.d.ts +8 -0
- package/build/features/auth/screens/Email/EmailField.js +52 -0
- package/build/features/auth/screens/Email/index.d.ts +3 -0
- package/build/features/auth/screens/Email/index.js +2 -0
- package/build/features/auth/screens/Email/validation.d.ts +8 -0
- package/build/features/auth/screens/Email/validation.js +4 -0
- package/build/features/auth/screens/EmailSent/EmailSent.d.ts +5 -0
- package/build/features/auth/screens/EmailSent/EmailSent.js +79 -0
- package/build/features/auth/screens/EmailSent/index.d.ts +2 -0
- package/build/features/auth/screens/EmailSent/index.js +2 -0
- package/build/features/auth/screens/MigratingData/MigratingData.d.ts +5 -0
- package/build/features/auth/screens/MigratingData/MigratingData.js +44 -0
- package/build/features/auth/screens/MigratingData/index.d.ts +2 -0
- package/build/features/auth/screens/MigratingData/index.js +2 -0
- package/build/features/auth/screens/Mobile/Mobile.js +6 -38
- package/build/features/auth/screens/Mobile/MobileNumber.js +13 -15
- package/build/features/auth/screens/Mobile/validation.js +11 -3
- package/build/features/auth/screens/NID/IDNumber.js +1 -1
- package/build/features/auth/screens/NID/NID.js +7 -43
- package/build/features/auth/screens/NID/validation.d.ts +0 -3
- package/build/features/auth/screens/NID/validation.js +0 -1
- package/build/features/auth/screens/OTP/OTP.js +41 -10
- package/build/features/auth/screens/OTP/OTPInput.js +23 -6
- package/build/features/auth/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/auth/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/auth/screens/OperatorError/index.d.ts +3 -0
- package/build/features/auth/screens/OperatorError/index.js +2 -0
- package/build/features/auth/screens/Password/Password.d.ts +5 -0
- package/build/features/auth/screens/Password/Password.js +61 -0
- package/build/features/auth/screens/Password/PasswordField.d.ts +5 -0
- package/build/features/auth/screens/Password/PasswordField.js +28 -0
- package/build/features/auth/screens/Password/index.d.ts +3 -0
- package/build/features/auth/screens/Password/index.js +2 -0
- package/build/features/auth/screens/Password/validation.d.ts +8 -0
- package/build/features/auth/screens/Password/validation.js +4 -0
- package/build/features/auth/screens/PreparingData/PreparingData.js +3 -0
- package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.d.ts +5 -0
- package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.js +21 -0
- package/build/features/auth/screens/ResetPasswordMessage/index.d.ts +3 -0
- package/build/features/auth/screens/ResetPasswordMessage/index.js +2 -0
- package/build/features/auth/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +35 -0
- package/build/features/auth/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/auth/screens/VerifyNafath/index.js +2 -0
- package/build/features/bank/Bank.d.ts +5 -1
- package/build/features/bank/Bank.js +22 -9
- package/build/features/bank/screens/BankDetails/BankDetails.js +20 -6
- package/build/features/bank/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/bank/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/bank/screens/OperatorError/index.d.ts +3 -0
- package/build/features/bank/screens/OperatorError/index.js +2 -0
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/bank/screens/Verify/Verify.js +7 -6
- package/build/features/board/Board.d.ts +2 -0
- package/build/features/board/Board.js +24 -13
- package/build/features/board/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/board/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/board/screens/OperatorError/index.d.ts +3 -0
- package/build/features/board/screens/OperatorError/index.js +2 -0
- package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/board/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/board/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -4
- package/build/features/board/screens/Verify/Verify.js +3 -2
- package/build/features/brand/Brand.d.ts +5 -1
- package/build/features/brand/Brand.js +22 -9
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +7 -7
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +48 -11
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +6 -6
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +1 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +6 -3
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +4 -4
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +26 -6
- package/build/features/brand/screens/BrandInfo/BrandName.js +5 -2
- package/build/features/brand/screens/BrandInfo/validation.js +2 -2
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +22 -6
- package/build/features/brand/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/brand/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/brand/screens/OperatorError/index.d.ts +3 -0
- package/build/features/brand/screens/OperatorError/index.js +2 -0
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/brand/screens/Verify/Verify.js +3 -2
- package/build/features/business/Business.js +20 -12
- package/build/features/business/screens/Activities/Activities.js +26 -9
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +4 -4
- package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +5 -3
- package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
- package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +2 -2
- package/build/features/business/screens/BusinessType/BusinessType.js +11 -3
- package/build/features/business/screens/BusinessType/LicenseNumber.js +3 -3
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +12 -10
- package/build/features/business/screens/Customers/CustomerLocations.js +5 -3
- package/build/features/business/screens/Customers/Customers.js +50 -10
- package/build/features/business/screens/Customers/ExpectedCustomers.d.ts +3 -1
- package/build/features/business/screens/Customers/ExpectedCustomers.js +5 -3
- package/build/features/business/screens/Customers/ExpectedSalesRange.d.ts +3 -1
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +11 -5
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +12 -5
- package/build/features/business/screens/Customers/RefundPolicy.js +13 -13
- package/build/features/business/screens/Customers/TransactionPolicy.d.ts +4 -1
- package/build/features/business/screens/Customers/TransactionPolicy.js +8 -5
- package/build/features/business/screens/Customers/validation.d.ts +6 -6
- package/build/features/business/screens/Customers/validation.js +3 -8
- package/build/features/business/screens/DOB/DOB.d.ts +6 -0
- package/build/features/business/screens/DOB/DOB.js +45 -0
- package/build/features/business/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/business/screens/DOB/DOBForm.js +72 -0
- package/build/features/business/screens/DOB/index.d.ts +3 -0
- package/build/features/business/screens/DOB/index.js +2 -0
- package/build/features/{connectExpress/screens/IdentityOTP → business/screens/DOB}/validation.d.ts +4 -4
- package/build/features/business/screens/DOB/validation.js +4 -0
- package/build/features/business/screens/IDBOD/IDBOD.js +10 -2
- package/build/features/business/screens/IDBOD/validation.d.ts +0 -3
- package/build/features/business/screens/IDBOD/validation.js +0 -1
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +104 -0
- package/build/features/{connectExpress/screens/IdentityOTP/OTP.d.ts → business/screens/MobileOwnership/MobileNumber.d.ts} +0 -2
- package/build/features/business/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/business/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/business/screens/MobileOwnership/index.js +2 -0
- package/build/features/business/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/business/screens/MobileOwnership/validation.js +38 -0
- package/build/features/business/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/business/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/business/screens/OperatorError/index.d.ts +3 -0
- package/build/features/business/screens/OperatorError/index.js +2 -0
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -3
- package/build/features/business/screens/Verify/Verify.js +15 -4
- package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/business/screens/VerifyNafath/VerifyNafath.js +35 -0
- package/build/features/business/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/business/screens/VerifyNafath/index.js +2 -0
- package/build/features/connect/Connect.d.ts +5 -1
- package/build/features/connect/Connect.js +22 -17
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/connect/screens/CivilID/CivilID.js +6 -1
- package/build/features/{auth/screens/NID → connect/screens/DOB}/DOB.d.ts +1 -2
- package/build/features/connect/screens/{NID → DOB}/DOB.js +2 -2
- package/build/features/connect/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/connect/screens/DOB/DOBForm.js +59 -0
- package/build/features/connect/screens/DOB/index.d.ts +3 -0
- package/build/features/connect/screens/DOB/index.js +2 -0
- package/build/features/connect/screens/DOB/validation.d.ts +8 -0
- package/build/features/connect/screens/DOB/validation.js +4 -0
- package/build/features/connect/screens/Individual/Email.js +1 -3
- package/build/features/connect/screens/Individual/Individual.js +11 -5
- package/build/features/connect/screens/Individual/MobileNumber.js +8 -7
- package/build/features/connect/screens/Individual/validation.js +11 -3
- package/build/features/connect/screens/Merchant/BrandName.js +5 -2
- package/build/features/connect/screens/Merchant/validation.js +2 -2
- package/build/features/connect/screens/Mobile/Mobile.js +12 -9
- package/build/features/connect/screens/Mobile/MobileNumber.js +8 -7
- package/build/features/connect/screens/Mobile/validation.js +11 -3
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +105 -0
- package/build/features/connect/screens/MobileOwnership/MobileNumber.d.ts +3 -0
- package/build/features/connect/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/connect/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/connect/screens/MobileOwnership/index.js +2 -0
- package/build/features/connect/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/connect/screens/MobileOwnership/validation.js +38 -0
- package/build/features/connect/screens/NID/IDNumber.d.ts +1 -0
- package/build/features/connect/screens/NID/IDNumber.js +2 -2
- package/build/features/connect/screens/NID/NID.js +5 -11
- package/build/features/connect/screens/NID/validation.d.ts +0 -3
- package/build/features/connect/screens/NID/validation.js +0 -1
- package/build/features/connect/screens/OTP/OTP.js +6 -6
- package/build/features/connect/screens/OTP/OTPInput.js +3 -11
- package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
- package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +35 -0
- package/build/features/connect/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/connect/screens/VerifyNafath/index.js +2 -0
- package/build/features/connectExpress/ConnectExpress.d.ts +5 -2
- package/build/features/connectExpress/ConnectExpress.js +63 -42
- package/build/features/connectExpress/screens/AccountAlreadyCreated/AccountAlreadyCreated.js +14 -2
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
- package/build/features/connectExpress/screens/AuthenticationList/LicenseNumber.js +2 -2
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/connectExpress/screens/CivilID/CivilID.js +6 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +5 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +8 -1
- 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.d.ts +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +2 -2
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +30 -7
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
- package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +9 -8
- package/build/features/connectExpress/screens/CollectIndividualInfo/validation.js +11 -3
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -24
- package/build/features/connectExpress/screens/{NID → DOB}/DOB.d.ts +1 -2
- package/build/features/connectExpress/screens/{NID → DOB}/DOB.js +3 -3
- package/build/features/connectExpress/screens/DOB/DOBForm.d.ts +5 -0
- package/build/features/connectExpress/screens/DOB/DOBForm.js +63 -0
- package/build/features/connectExpress/screens/DOB/index.d.ts +3 -0
- package/build/features/connectExpress/screens/DOB/index.js +2 -0
- package/build/features/connectExpress/screens/DOB/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/DOB/validation.js +4 -0
- package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +5 -0
- package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +35 -0
- package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +3 -0
- package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +2 -0
- package/build/features/connectExpress/screens/Mobile/Mobile.js +10 -3
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +9 -8
- package/build/features/connectExpress/screens/Mobile/validation.js +21 -6
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +107 -0
- package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.d.ts +3 -0
- package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.js +72 -0
- package/build/features/connectExpress/screens/MobileOwnership/index.d.ts +2 -0
- package/build/features/connectExpress/screens/MobileOwnership/index.js +2 -0
- package/build/features/connectExpress/screens/MobileOwnership/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/MobileOwnership/validation.js +38 -0
- package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
- package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
- package/build/features/connectExpress/screens/NID/NID.js +10 -10
- package/build/features/connectExpress/screens/NID/TAC.d.ts +1 -1
- package/build/features/connectExpress/screens/NID/TAC.js +2 -2
- package/build/features/connectExpress/screens/NID/validation.d.ts +0 -3
- package/build/features/connectExpress/screens/NID/validation.js +0 -2
- package/build/features/connectExpress/screens/NIDMissed/NID.js +3 -3
- package/build/features/connectExpress/screens/NIDMissed/validation.d.ts +0 -3
- package/build/features/connectExpress/screens/NIDMissed/validation.js +0 -1
- package/build/features/connectExpress/screens/OTP/OTP.js +13 -15
- package/build/features/connectExpress/screens/OTP/OTPInput.js +12 -10
- package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/connectExpress/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/connectExpress/screens/OperatorError/index.d.ts +3 -0
- package/build/features/connectExpress/screens/OperatorError/index.js +2 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +5 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +34 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -3
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +35 -0
- package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/connectExpress/screens/VerifyNafath/index.js +2 -0
- package/build/features/entity/Entity.d.ts +4 -1
- package/build/features/entity/Entity.js +22 -9
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +4 -4
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +8 -4
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +8 -4
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +33 -9
- package/build/features/entity/screens/EntityName/EntityName.js +33 -15
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +7 -7
- package/build/features/entity/screens/EntityName/EntityTypeList.js +2 -3
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -2
- package/build/features/entity/screens/EntityName/ExpiryDate.js +13 -8
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -2
- package/build/features/entity/screens/EntityName/IssuingDate.js +15 -8
- package/build/features/entity/screens/EntityName/LegalName.js +1 -13
- package/build/features/entity/screens/EntityName/LicenseNumber.js +6 -8
- package/build/features/entity/screens/EntityName/UnifiedNumber.js +4 -6
- package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
- package/build/features/entity/screens/EntityName/validation.js +1 -10
- package/build/features/entity/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/entity/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/entity/screens/OperatorError/index.d.ts +3 -0
- package/build/features/entity/screens/OperatorError/index.js +2 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/screens/Verify/Verify.js +3 -2
- package/build/features/featuresScreens.d.ts +1 -0
- package/build/features/featuresScreens.js +211 -13
- package/build/features/individual/Individual.d.ts +4 -1
- package/build/features/individual/Individual.js +22 -9
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +44 -11
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +5 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +8 -3
- package/build/features/individual/screens/IndividualList/Email.js +2 -3
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
- package/build/features/individual/screens/IndividualList/IndividualList.js +21 -6
- package/build/features/individual/screens/IndividualList/MobileNumber.js +8 -10
- package/build/features/individual/screens/IndividualList/UserList.js +7 -7
- package/build/features/individual/screens/IndividualList/validation.js +11 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +76 -20
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +6 -5
- package/build/features/individual/screens/IndividualPersonalInfo/validation.js +11 -3
- package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +9 -11
- package/build/features/individual/screens/IndividualPhoneInfo/validation.js +11 -3
- package/build/features/individual/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/individual/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/individual/screens/OperatorError/index.d.ts +3 -0
- package/build/features/individual/screens/OperatorError/index.js +2 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/individual/screens/Verify/Verify.js +3 -2
- package/build/features/kyc/KYC.d.ts +11 -0
- package/build/features/kyc/KYC.js +99 -0
- package/build/features/kyc/index.d.ts +1 -0
- package/build/features/kyc/index.js +1 -0
- package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.d.ts +5 -0
- package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.js +19 -0
- package/build/features/kyc/screens/AlreadySubmitted/index.d.ts +2 -0
- package/build/features/kyc/screens/AlreadySubmitted/index.js +2 -0
- package/build/features/kyc/screens/Loading/Loading.d.ts +4 -0
- package/build/features/kyc/screens/Loading/Loading.js +10 -0
- package/build/features/kyc/screens/Loading/index.d.ts +2 -0
- package/build/features/kyc/screens/Loading/index.js +2 -0
- package/build/features/kyc/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/kyc/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/kyc/screens/OperatorError/index.d.ts +2 -0
- package/build/features/kyc/screens/OperatorError/index.js +2 -0
- package/build/features/kyc/screens/Success/Success.d.ts +5 -0
- package/build/features/kyc/screens/Success/Success.js +32 -0
- package/build/features/kyc/screens/Success/index.d.ts +2 -0
- package/build/features/kyc/screens/Success/index.js +2 -0
- package/build/features/kyc/screens/Terms/Header.d.ts +6 -0
- package/build/features/kyc/screens/Terms/Header.js +36 -0
- package/build/features/kyc/screens/Terms/Terms.d.ts +4 -0
- package/build/features/kyc/screens/Terms/Terms.js +81 -0
- package/build/features/kyc/screens/Terms/index.d.ts +2 -0
- package/build/features/kyc/screens/Terms/index.js +2 -0
- package/build/features/kyc/screens/TokenError/TokenError.d.ts +5 -0
- package/build/features/kyc/screens/TokenError/TokenError.js +9 -0
- package/build/features/kyc/screens/TokenError/index.d.ts +2 -0
- package/build/features/kyc/screens/TokenError/index.js +2 -0
- package/build/features/kyc/screens/Users/Users.d.ts +3 -0
- package/build/features/kyc/screens/Users/Users.js +76 -0
- package/build/features/kyc/screens/Users/index.d.ts +2 -0
- package/build/features/kyc/screens/Users/index.js +2 -0
- package/build/features/kyc/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
- package/build/features/kyc/screens/VerifyNafath/VerifyNafath.js +45 -0
- package/build/features/kyc/screens/VerifyNafath/index.d.ts +3 -0
- package/build/features/kyc/screens/VerifyNafath/index.js +2 -0
- package/build/features/kyc/screens/VerifyPaci/VerifyPACI.d.ts +5 -0
- package/build/features/kyc/screens/VerifyPaci/VerifyPACI.js +44 -0
- package/build/features/kyc/screens/VerifyPaci/index.d.ts +3 -0
- package/build/features/kyc/screens/VerifyPaci/index.js +2 -0
- package/build/features/password/Password.d.ts +4 -1
- package/build/features/password/Password.js +88 -31
- package/build/features/password/screens/CreatePassword/CreatePassword.js +10 -4
- package/build/features/password/screens/OTP/OTP.js +3 -3
- package/build/features/password/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/password/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/password/screens/OperatorError/index.d.ts +3 -0
- package/build/features/password/screens/OperatorError/index.js +2 -0
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/password/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/password/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/password/screens/Verify/Verify.js +7 -6
- package/build/features/shared/Address/CountryList.d.ts +6 -6
- package/build/features/shared/Address/InputSelect.d.ts +6 -6
- package/build/features/shared/Background/Background.js +1 -1
- package/build/features/shared/BusinessCountry/BusinessCountry.js +1 -1
- package/build/features/shared/Button/Button.js +3 -1
- package/build/features/shared/Button/EmailProvidersButtons.js +2 -0
- package/build/features/shared/Button/FlowsButtons.js +18 -4
- package/build/features/shared/Button/NafathButton.d.ts +8 -0
- package/build/features/shared/Button/{AbsherButton.js → NafathButton.js} +12 -3
- package/build/features/shared/Button/index.d.ts +2 -2
- package/build/features/shared/Button/index.js +2 -2
- package/build/features/shared/Calender/Calender.d.ts +2 -1
- package/build/features/shared/Calender/Calender.js +3 -3
- package/build/features/shared/Containers/FeatureContainer.d.ts +2 -1
- package/build/features/shared/Containers/FeatureContainer.js +5 -3
- package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
- package/build/features/shared/Dialog/DialogContainer.js +5 -4
- package/build/features/shared/Input/Input.d.ts +2 -2
- package/build/features/shared/NafathVerification/NafathVerification.d.ts +14 -0
- package/build/features/shared/NafathVerification/NafathVerification.js +92 -0
- package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +8 -0
- package/build/features/shared/NafathVerification/VerifyNafathLoading.js +53 -0
- package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +5 -0
- package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +8 -0
- package/build/features/shared/NafathVerification/index.d.ts +2 -0
- package/build/features/shared/NafathVerification/index.js +2 -0
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +6 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +10 -13
- package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
- package/build/features/shared/UploadFile/FileUpload.d.ts +1 -1
- package/build/features/shared/UploadFile/UploadFile.d.ts +1 -1
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +1 -1
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +1 -1
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +1 -1
- package/build/features/signIn/SignIn.js +18 -7
- package/build/features/signIn/screens/Mobile/MobileNumber.js +8 -7
- package/build/features/signIn/screens/Mobile/validation.js +11 -3
- package/build/features/signIn/screens/OTP/OTP.js +5 -4
- package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/signIn/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/signIn/screens/OperatorError/index.d.ts +3 -0
- package/build/features/signIn/screens/OperatorError/index.js +2 -0
- package/build/features/tax/Tax.d.ts +4 -1
- package/build/features/tax/Tax.js +22 -9
- package/build/features/tax/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/tax/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/tax/screens/OperatorError/index.d.ts +3 -0
- package/build/features/tax/screens/OperatorError/index.js +2 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +9 -3
- package/build/features/tax/screens/Verify/Verify.js +7 -6
- package/build/hooks/index.d.ts +3 -0
- package/build/hooks/index.js +3 -0
- package/build/hooks/useAppConfig.d.ts +3 -3
- package/build/hooks/useAppConfig.js +4 -3
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/hooks/useAppTheme.js +4 -6
- package/build/hooks/useCountDown.d.ts +10 -0
- package/build/hooks/useCountDown.js +17 -0
- package/build/hooks/useFormDirtyCheck.d.ts +10 -0
- package/build/hooks/useFormDirtyCheck.js +66 -0
- package/build/hooks/useSanitizedTranslation.d.ts +2 -0
- package/build/hooks/useSanitizedTranslation.js +15 -0
- package/build/hooks/useVerifyToken.d.ts +4 -2
- package/build/hooks/useVerifyToken.js +9 -4
- package/build/index.css +360 -120
- package/build/index.d.ts +3 -2
- package/build/index.js +4 -2
- package/build/theme/components.js +7 -0
- package/build/theme/palette.js +2 -1
- package/build/theme/shadows.js +1 -1
- package/build/theme/theme.d.ts +1 -1
- package/build/theme/theme.js +2 -2
- package/build/utils/array.js +2 -2
- package/build/utils/common.d.ts +1 -0
- package/build/utils/common.js +16 -3
- package/build/utils/object.d.ts +1 -0
- package/build/utils/object.js +3 -0
- package/build/utils/string.d.ts +6 -2
- package/build/utils/string.js +28 -3
- package/build/utils/validation.d.ts +2 -0
- package/build/utils/validation.js +6 -0
- package/package.json +2 -2
- package/build/features/business/screens/OTP/OTP.d.ts +0 -8
- package/build/features/business/screens/OTP/OTP.js +0 -90
- package/build/features/business/screens/OTP/OTPInput.d.ts +0 -5
- package/build/features/business/screens/OTP/OTPInput.js +0 -49
- package/build/features/business/screens/OTP/index.d.ts +0 -3
- package/build/features/business/screens/OTP/index.js +0 -2
- package/build/features/business/screens/OTP/validation.js +0 -4
- package/build/features/connectExpress/screens/IdentityOTP/OTP.js +0 -87
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +0 -5
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +0 -54
- package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +0 -3
- package/build/features/connectExpress/screens/IdentityOTP/index.js +0 -2
- package/build/features/connectExpress/screens/IdentityOTP/validation.js +0 -4
- package/build/features/shared/Button/AbsherButton.d.ts +0 -8
- /package/build/features/{connect/screens/NID → auth/screens/DOB}/DOB.d.ts +0 -0
|
@@ -56,11 +56,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
56
56
|
};
|
|
57
57
|
var _a;
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
|
-
import { AuthForType, FlowsTypes } from '../../../@types';
|
|
60
|
-
import { ADD_NEW_ENTITY, AUTH_STEP_NAMES, IDENTIFICATION_TYPE, defaultCountry } from '../../../constants';
|
|
59
|
+
import { AuthForType, AuthTypeNumber, FlowsTypes, MigrationStatus } from '../../../@types';
|
|
60
|
+
import { ADD_NEW_ENTITY, AUTH_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, SCOPE_AUTH, defaultCountry } from '../../../constants';
|
|
61
61
|
import API from '../../../api';
|
|
62
|
-
import { handleCurrentActiveScreen, handleNextScreenStep, handleOpen, handleSetCountryByIso2 } from '../../../app/settings';
|
|
63
|
-
import { findCountryByIddPrefix,
|
|
62
|
+
import { handleCurrentActiveScreen, handleNextScreenStep, handleOpen, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
|
|
63
|
+
import { findCountryByIddPrefix, openConnect, sendCustomEventToGTM, sleep } from '../../../utils';
|
|
64
64
|
export var updateBusinessCountry = createAsyncThunk('auth/updateBusinessCountry', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
65
|
var auth, payload, data;
|
|
66
66
|
return __generator(this, function (_a) {
|
|
@@ -101,6 +101,7 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('auth/retrieveLeadId
|
|
|
101
101
|
if (phone === null || phone === void 0 ? void 0 : phone.country_code)
|
|
102
102
|
countryCode = findCountryByIddPrefix(settingData.countries, phone.country_code);
|
|
103
103
|
if (!businessCountryIso2 && ipCountryIso2 && settingData.appConfig.scope === 'auth') {
|
|
104
|
+
thunkApi.dispatch(storeIsBusinessCountryPassed(false));
|
|
104
105
|
thunkApi.dispatch(handleSetCountryByIso2(ipCountryIso2));
|
|
105
106
|
businessCountryIso2 = ipCountryIso2;
|
|
106
107
|
}
|
|
@@ -108,38 +109,26 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('auth/retrieveLeadId
|
|
|
108
109
|
thunkApi.dispatch(handleCurrentActiveScreen('AUTH_BUSINESS_COUNTRY_STEP'));
|
|
109
110
|
return [2, { data: data, countryCode: countryCode }];
|
|
110
111
|
}
|
|
111
|
-
if (!(data === null || data === void 0 ? void 0 : data.identification) && phone) {
|
|
112
|
-
thunkApi.dispatch(handleCurrentActiveScreen('AUTH_MOBILE_STEP'));
|
|
113
|
-
return [2, { data: data, countryCode: countryCode }];
|
|
114
|
-
}
|
|
115
|
-
if (country_code && !businessCountryIso2) {
|
|
116
|
-
thunkApi.dispatch(handleSetCountryByIso2(data.country_code));
|
|
117
|
-
if (!isSA(data.country_code))
|
|
118
|
-
thunkApi.dispatch(handleCurrentActiveScreen('AUTH_MOBILE_STEP'));
|
|
119
|
-
return [2, { data: data, countryCode: countryCode }];
|
|
120
|
-
}
|
|
121
|
-
if (!isSA(businessCountryIso2)) {
|
|
122
|
-
thunkApi.dispatch(handleCurrentActiveScreen('AUTH_MOBILE_STEP'));
|
|
123
|
-
return [2, { data: data, countryCode: countryCode }];
|
|
124
|
-
}
|
|
125
112
|
return [2, { data: data, countryCode: countryCode }];
|
|
126
113
|
}
|
|
127
114
|
});
|
|
128
115
|
}); });
|
|
129
116
|
export var createMobileAuth = createAsyncThunk('auth/createMobileAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
130
|
-
var _a, settings, auth, requestBody, data;
|
|
131
|
-
var _b, _c;
|
|
132
|
-
return __generator(this, function (
|
|
133
|
-
switch (
|
|
117
|
+
var _a, settings, auth, isStartWithZero, mobileNumber, requestBody, data;
|
|
118
|
+
var _b, _c, _d;
|
|
119
|
+
return __generator(this, function (_e) {
|
|
120
|
+
switch (_e.label) {
|
|
134
121
|
case 0:
|
|
135
122
|
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
123
|
+
isStartWithZero = (_b = params.mobile) === null || _b === void 0 ? void 0 : _b.startsWith('0');
|
|
124
|
+
mobileNumber = isStartWithZero ? params.mobile.slice(1) : params.mobile;
|
|
136
125
|
requestBody = {
|
|
137
126
|
country: settings.data.businessCountry.iso2,
|
|
138
127
|
scope: settings.data.appConfig.scope,
|
|
139
128
|
lang: settings.data.language,
|
|
140
129
|
lead_id: auth.data.leadId,
|
|
141
130
|
user_credentail: {
|
|
142
|
-
phone:
|
|
131
|
+
phone: mobileNumber || '',
|
|
143
132
|
code: params.countryCode.idd_prefix.toString()
|
|
144
133
|
},
|
|
145
134
|
sign_in: false,
|
|
@@ -149,26 +138,29 @@ export var createMobileAuth = createAsyncThunk('auth/createMobileAuth', function
|
|
|
149
138
|
};
|
|
150
139
|
return [4, API.authService.createAuth(requestBody)];
|
|
151
140
|
case 1:
|
|
152
|
-
data =
|
|
141
|
+
data = _e.sent();
|
|
153
142
|
thunkApi.dispatch(handleNextScreenStep());
|
|
154
|
-
(
|
|
143
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody.user_credentail);
|
|
155
144
|
return [2, { response: data, formData: params }];
|
|
156
145
|
}
|
|
157
146
|
});
|
|
158
147
|
}); });
|
|
159
148
|
export var resendMobileAuthOTP = createAsyncThunk('auth/resendMobileAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
160
|
-
var _a, settings, auth, requestBody, data;
|
|
161
|
-
|
|
162
|
-
|
|
149
|
+
var _a, settings, auth, isStartWithZero, mobileNumber, requestBody, data;
|
|
150
|
+
var _b;
|
|
151
|
+
return __generator(this, function (_c) {
|
|
152
|
+
switch (_c.label) {
|
|
163
153
|
case 0:
|
|
164
154
|
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
155
|
+
isStartWithZero = (_b = params.mobile) === null || _b === void 0 ? void 0 : _b.startsWith('0');
|
|
156
|
+
mobileNumber = isStartWithZero ? params.mobile.slice(1) : params.mobile;
|
|
165
157
|
requestBody = {
|
|
166
158
|
country: settings.data.businessCountry.iso2,
|
|
167
159
|
scope: settings.data.appConfig.scope,
|
|
168
160
|
lang: settings.data.language,
|
|
169
161
|
lead_id: auth.data.leadId,
|
|
170
162
|
user_credentail: {
|
|
171
|
-
phone:
|
|
163
|
+
phone: mobileNumber,
|
|
172
164
|
code: params.countryCode.idd_prefix.toString()
|
|
173
165
|
},
|
|
174
166
|
sign_in: false,
|
|
@@ -178,20 +170,20 @@ export var resendMobileAuthOTP = createAsyncThunk('auth/resendMobileAuthOTP', fu
|
|
|
178
170
|
};
|
|
179
171
|
return [4, API.authService.createAuth(requestBody)];
|
|
180
172
|
case 1:
|
|
181
|
-
data =
|
|
173
|
+
data = _c.sent();
|
|
182
174
|
return [2, { response: data, formData: params }];
|
|
183
175
|
}
|
|
184
176
|
});
|
|
185
177
|
}); });
|
|
186
178
|
export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
187
|
-
var _a, settings, auth, _b, responseData, leadId, _c, auth_token, device_token, service_name, scope, payload, data;
|
|
179
|
+
var _a, settings, auth, _b, responseData, leadId, _c, auth_token, device_token, service_name, auth_type, sign_in, scope, payload, data;
|
|
188
180
|
var _d, _e, _f, _g;
|
|
189
181
|
return __generator(this, function (_h) {
|
|
190
182
|
switch (_h.label) {
|
|
191
183
|
case 0:
|
|
192
184
|
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
193
185
|
_b = auth.data || {}, responseData = _b.responseData, leadId = _b.leadId;
|
|
194
|
-
_c = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.authResponse) !== null && _d !== void 0 ? _d : {}, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name;
|
|
186
|
+
_c = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.authResponse) !== null && _d !== void 0 ? _d : {}, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name, auth_type = _c.auth_type, sign_in = _c.sign_in;
|
|
195
187
|
if (!auth_token)
|
|
196
188
|
throw new Error('Auth token is missing');
|
|
197
189
|
scope = settings.data.appConfig.scope;
|
|
@@ -199,10 +191,10 @@ export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (
|
|
|
199
191
|
auth_token: auth_token,
|
|
200
192
|
lead_id: leadId,
|
|
201
193
|
data: params.otp,
|
|
202
|
-
auth_type:
|
|
194
|
+
auth_type: auth_type,
|
|
203
195
|
device_token: device_token,
|
|
204
196
|
service_name: service_name,
|
|
205
|
-
sign_in:
|
|
197
|
+
sign_in: sign_in,
|
|
206
198
|
step_name: AUTH_STEP_NAMES.VERIFY_AUTH_MOBILE,
|
|
207
199
|
encryption_contract: ['data']
|
|
208
200
|
};
|
|
@@ -211,6 +203,11 @@ export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (
|
|
|
211
203
|
data = (_h.sent()).data;
|
|
212
204
|
if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
|
|
213
205
|
throw new Error(data.errors[0].description);
|
|
206
|
+
sendCustomEventToGTM({
|
|
207
|
+
event: 'Send Event',
|
|
208
|
+
event_category: 'User Registration Flow',
|
|
209
|
+
event_action: 'First OTP Success'
|
|
210
|
+
});
|
|
214
211
|
if (scope === 'merchant') {
|
|
215
212
|
openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
|
|
216
213
|
return [2, data];
|
|
@@ -221,92 +218,120 @@ export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (
|
|
|
221
218
|
}
|
|
222
219
|
});
|
|
223
220
|
}); });
|
|
224
|
-
export var
|
|
225
|
-
var _a, settings, auth,
|
|
221
|
+
export var createEmailAuth = createAsyncThunk('auth/createEmailAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
222
|
+
var _a, settings, auth, requestBody, data, screen;
|
|
226
223
|
var _b, _c;
|
|
227
224
|
return __generator(this, function (_d) {
|
|
228
225
|
switch (_d.label) {
|
|
229
226
|
case 0:
|
|
230
227
|
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
231
|
-
dob = params.dob, nid = params.nid;
|
|
232
|
-
nidType = nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
|
|
233
|
-
countryCode = settings.data.businessCountry.iso2;
|
|
234
228
|
requestBody = {
|
|
235
|
-
country:
|
|
229
|
+
country: settings.data.businessCountry.iso2,
|
|
236
230
|
scope: settings.data.appConfig.scope,
|
|
237
231
|
lang: settings.data.language,
|
|
238
232
|
lead_id: auth.data.leadId,
|
|
239
233
|
user_credentail: {
|
|
240
|
-
|
|
241
|
-
identification_id_type: nidType,
|
|
242
|
-
date_of_birth: dob,
|
|
243
|
-
country_code: countryCode
|
|
234
|
+
email: params.email || ''
|
|
244
235
|
},
|
|
245
|
-
sign_in:
|
|
246
|
-
is_lead:
|
|
247
|
-
step_name: AUTH_STEP_NAMES.
|
|
248
|
-
encryption_contract: [
|
|
249
|
-
'user_credentail.country_code',
|
|
250
|
-
'user_credentail.identification_id',
|
|
251
|
-
'user_credentail.identification_id_type',
|
|
252
|
-
'user_credentail.date_of_birth'
|
|
253
|
-
]
|
|
236
|
+
sign_in: true,
|
|
237
|
+
is_lead: false,
|
|
238
|
+
step_name: AUTH_STEP_NAMES.CREATE_AUTH_EMAIL,
|
|
239
|
+
encryption_contract: ['user_credentail.email']
|
|
254
240
|
};
|
|
255
241
|
return [4, API.authService.createAuth(requestBody)];
|
|
256
242
|
case 1:
|
|
257
243
|
data = _d.sent();
|
|
258
|
-
|
|
244
|
+
screen = 'AUTH_PASSWORD_STEP';
|
|
245
|
+
if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.RESET_PASSWORD)
|
|
246
|
+
screen = 'AUTH_RESET_PASSWORD_MESSAGE_STEP';
|
|
247
|
+
if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.EMAIL_OTP)
|
|
248
|
+
screen = 'AUTH_OTP_STEP';
|
|
249
|
+
thunkApi.dispatch(handleNextScreenStep(screen));
|
|
259
250
|
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody.user_credentail);
|
|
260
251
|
return [2, { response: data, formData: params }];
|
|
261
252
|
}
|
|
262
253
|
});
|
|
263
254
|
}); });
|
|
264
|
-
export var
|
|
265
|
-
var _a, settings, auth,
|
|
255
|
+
export var verifyEmailPassword = createAsyncThunk('auth/verifyEmailPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
256
|
+
var _a, settings, auth, _b, responseData, leadId, _c, auth_token, device_token, service_name, auth_type, sign_in, scope, payload, data;
|
|
257
|
+
var _d, _e, _f, _g;
|
|
258
|
+
return __generator(this, function (_h) {
|
|
259
|
+
switch (_h.label) {
|
|
260
|
+
case 0:
|
|
261
|
+
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
262
|
+
_b = auth.data || {}, responseData = _b.responseData, leadId = _b.leadId;
|
|
263
|
+
_c = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.authResponse) !== null && _d !== void 0 ? _d : {}, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name, auth_type = _c.auth_type, sign_in = _c.sign_in;
|
|
264
|
+
if (!auth_token)
|
|
265
|
+
throw new Error('Auth token is missing');
|
|
266
|
+
scope = settings.data.appConfig.scope;
|
|
267
|
+
payload = {
|
|
268
|
+
auth_token: auth_token,
|
|
269
|
+
lead_id: leadId,
|
|
270
|
+
data: params.password,
|
|
271
|
+
auth_type: auth_type,
|
|
272
|
+
device_token: device_token,
|
|
273
|
+
service_name: service_name,
|
|
274
|
+
sign_in: sign_in,
|
|
275
|
+
is_lead: false,
|
|
276
|
+
step_name: AUTH_STEP_NAMES.VERIFY_AUTH_EMAIL,
|
|
277
|
+
encryption_contract: ['data']
|
|
278
|
+
};
|
|
279
|
+
return [4, API.authService.verifyAuth(payload)];
|
|
280
|
+
case 1:
|
|
281
|
+
data = (_h.sent()).data;
|
|
282
|
+
if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
|
|
283
|
+
throw new Error(data.errors[0].description);
|
|
284
|
+
if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.MOBILE_OTP) {
|
|
285
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_OTP_STEP')); });
|
|
286
|
+
return [2, data];
|
|
287
|
+
}
|
|
288
|
+
if (scope === 'merchant') {
|
|
289
|
+
openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
|
|
290
|
+
return [2, data];
|
|
291
|
+
}
|
|
292
|
+
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
|
|
293
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_PREPARING_DATA_STEP')); });
|
|
294
|
+
return [2, data];
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
}); });
|
|
298
|
+
export var resendEmailAuthOTP = createAsyncThunk('auth/resendEmailAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
299
|
+
var _a, settings, auth, requestBody, data;
|
|
266
300
|
return __generator(this, function (_b) {
|
|
267
301
|
switch (_b.label) {
|
|
268
302
|
case 0:
|
|
269
303
|
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
270
|
-
dob = params.dob, nid = params.nid;
|
|
271
|
-
nidType = nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
|
|
272
|
-
countryCode = settings.data.businessCountry.iso2;
|
|
273
304
|
requestBody = {
|
|
274
|
-
country:
|
|
305
|
+
country: settings.data.businessCountry.iso2,
|
|
275
306
|
scope: settings.data.appConfig.scope,
|
|
276
307
|
lang: settings.data.language,
|
|
277
308
|
lead_id: auth.data.leadId,
|
|
278
309
|
user_credentail: {
|
|
279
|
-
|
|
280
|
-
identification_id_type: nidType,
|
|
281
|
-
date_of_birth: dob,
|
|
282
|
-
country_code: countryCode
|
|
310
|
+
email: params.email || ''
|
|
283
311
|
},
|
|
284
|
-
sign_in:
|
|
285
|
-
is_lead:
|
|
286
|
-
step_name: AUTH_STEP_NAMES.
|
|
287
|
-
encryption_contract: [
|
|
288
|
-
'user_credentail.country_code',
|
|
289
|
-
'user_credentail.identification_id',
|
|
290
|
-
'user_credentail.identification_id_type',
|
|
291
|
-
'user_credentail.date_of_birth'
|
|
292
|
-
]
|
|
312
|
+
sign_in: true,
|
|
313
|
+
is_lead: false,
|
|
314
|
+
step_name: AUTH_STEP_NAMES.CREATE_AUTH_EMAIL,
|
|
315
|
+
encryption_contract: ['user_credentail.email']
|
|
293
316
|
};
|
|
294
317
|
return [4, API.authService.createAuth(requestBody)];
|
|
295
318
|
case 1:
|
|
296
319
|
data = _b.sent();
|
|
320
|
+
if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.PASSWORD)
|
|
321
|
+
thunkApi.dispatch(handlePrevScreenStep('AUTH_PASSWORD_STEP'));
|
|
297
322
|
return [2, { response: data, formData: params }];
|
|
298
323
|
}
|
|
299
324
|
});
|
|
300
325
|
}); });
|
|
301
|
-
export var
|
|
302
|
-
var _a, settings, auth, _b, responseData, leadId, _c, auth_token, device_token, service_name, scope, payload, data;
|
|
326
|
+
export var verifyEmailOtp = createAsyncThunk('auth/verifyEmailOtp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
327
|
+
var _a, settings, auth, _b, responseData, leadId, _c, auth_token, device_token, service_name, auth_type, sign_in, scope, payload, data, stepName;
|
|
303
328
|
var _d, _e, _f, _g;
|
|
304
329
|
return __generator(this, function (_h) {
|
|
305
330
|
switch (_h.label) {
|
|
306
331
|
case 0:
|
|
307
332
|
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
308
333
|
_b = auth.data || {}, responseData = _b.responseData, leadId = _b.leadId;
|
|
309
|
-
_c = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.authResponse) !== null && _d !== void 0 ? _d : {}, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name;
|
|
334
|
+
_c = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.authResponse) !== null && _d !== void 0 ? _d : {}, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name, auth_type = _c.auth_type, sign_in = _c.sign_in;
|
|
310
335
|
if (!auth_token)
|
|
311
336
|
throw new Error('Auth token is missing');
|
|
312
337
|
scope = settings.data.appConfig.scope;
|
|
@@ -314,11 +339,12 @@ export var verifyNIDOtp = createAsyncThunk('auth/verifyNIDOtp', function (params
|
|
|
314
339
|
auth_token: auth_token,
|
|
315
340
|
lead_id: leadId,
|
|
316
341
|
data: params.otp,
|
|
317
|
-
auth_type:
|
|
342
|
+
auth_type: auth_type,
|
|
318
343
|
device_token: device_token,
|
|
319
|
-
service_name: service_name
|
|
320
|
-
sign_in:
|
|
321
|
-
|
|
344
|
+
service_name: service_name,
|
|
345
|
+
sign_in: sign_in,
|
|
346
|
+
is_lead: false,
|
|
347
|
+
step_name: AUTH_STEP_NAMES.VERIFY_AUTH_MOBILE,
|
|
322
348
|
encryption_contract: ['data']
|
|
323
349
|
};
|
|
324
350
|
return [4, API.authService.verifyAuth(payload)];
|
|
@@ -326,28 +352,156 @@ export var verifyNIDOtp = createAsyncThunk('auth/verifyNIDOtp', function (params
|
|
|
326
352
|
data = (_h.sent()).data;
|
|
327
353
|
if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
|
|
328
354
|
throw new Error(data.errors[0].description);
|
|
355
|
+
sendCustomEventToGTM({
|
|
356
|
+
event: 'Send Event',
|
|
357
|
+
event_category: 'User Registration Flow',
|
|
358
|
+
event_action: 'First OTP Success'
|
|
359
|
+
});
|
|
329
360
|
if (scope === 'merchant') {
|
|
330
361
|
openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
|
|
331
362
|
return [2, data];
|
|
332
363
|
}
|
|
364
|
+
stepName = 'AUTH_PREPARING_DATA_STEP';
|
|
365
|
+
if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.MIGRATION)
|
|
366
|
+
stepName = 'AUTH_MIGRATING_DATA_STEP';
|
|
333
367
|
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
|
|
334
|
-
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep(
|
|
368
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep(stepName)); });
|
|
335
369
|
return [2, data];
|
|
336
370
|
}
|
|
337
371
|
});
|
|
338
372
|
}); });
|
|
373
|
+
export var createNafathAuth = createAsyncThunk('auth/createNafathAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
374
|
+
var _a, settings, auth, requestBody, data;
|
|
375
|
+
var _b, _c;
|
|
376
|
+
return __generator(this, function (_d) {
|
|
377
|
+
switch (_d.label) {
|
|
378
|
+
case 0:
|
|
379
|
+
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
380
|
+
requestBody = {
|
|
381
|
+
country: settings.data.businessCountry.iso2,
|
|
382
|
+
scope: settings.data.appConfig.scope,
|
|
383
|
+
lang: settings.data.language,
|
|
384
|
+
lead_id: auth.data.leadId,
|
|
385
|
+
user_credentail: {
|
|
386
|
+
identification_id: params.nid,
|
|
387
|
+
identification_id_type: IDENTIFICATION_TYPE.NAFATH,
|
|
388
|
+
country_code: settings.data.businessCountry.iso2
|
|
389
|
+
},
|
|
390
|
+
sign_in: false,
|
|
391
|
+
is_lead: true,
|
|
392
|
+
step_name: AUTH_STEP_NAMES.CREATE_AUTH_NID,
|
|
393
|
+
encryption_contract: ['user_credentail.country_code', 'user_credentail.identification_id', 'user_credentail.identification_id_type']
|
|
394
|
+
};
|
|
395
|
+
return [4, API.authService.createAuthKitNID(requestBody)];
|
|
396
|
+
case 1:
|
|
397
|
+
data = _d.sent();
|
|
398
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
399
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
|
|
400
|
+
return [2, { response: data, formData: params }];
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
}); });
|
|
404
|
+
export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
405
|
+
var _a, settings, auth, authResponse, expiry, scope, interval, maxCalls, _loop_1, count, state_1;
|
|
406
|
+
var _b, _c, _d, _e, _f;
|
|
407
|
+
return __generator(this, function (_g) {
|
|
408
|
+
switch (_g.label) {
|
|
409
|
+
case 0:
|
|
410
|
+
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
411
|
+
authResponse = (auth.data.responseData || {}).authResponse;
|
|
412
|
+
expiry = (authResponse === null || authResponse === void 0 ? void 0 : authResponse.expiry) || 120;
|
|
413
|
+
scope = settings.data.appConfig.scope;
|
|
414
|
+
interval = 3;
|
|
415
|
+
maxCalls = Math.floor(expiry / interval);
|
|
416
|
+
_loop_1 = function (count) {
|
|
417
|
+
var data, isSuccess, isFailed, screen_1;
|
|
418
|
+
return __generator(this, function (_h) {
|
|
419
|
+
switch (_h.label) {
|
|
420
|
+
case 0:
|
|
421
|
+
if (thunkApi.signal.aborted) {
|
|
422
|
+
return [2, "break"];
|
|
423
|
+
}
|
|
424
|
+
return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token)];
|
|
425
|
+
case 1:
|
|
426
|
+
data = _h.sent();
|
|
427
|
+
isSuccess = ((_b = data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
428
|
+
isFailed = ((_c = data === null || data === void 0 ? void 0 : data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'failed';
|
|
429
|
+
if (isFailed) {
|
|
430
|
+
(_d = params.onFailure) === null || _d === void 0 ? void 0 : _d.call(params);
|
|
431
|
+
return [2, { value: data }];
|
|
432
|
+
}
|
|
433
|
+
if (isSuccess) {
|
|
434
|
+
if (scope === 'merchant') {
|
|
435
|
+
openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
|
|
436
|
+
return [2, { value: data }];
|
|
437
|
+
}
|
|
438
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
|
|
439
|
+
screen_1 = data.step_name === COLLECT_DOB_INFO_NAFATH ? 'AUTH_DOB_STEP' : 'AUTH_PREPARING_DATA_STEP';
|
|
440
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep(screen_1)); });
|
|
441
|
+
return [2, { value: data }];
|
|
442
|
+
}
|
|
443
|
+
return [4, sleep(interval * 1000)];
|
|
444
|
+
case 2:
|
|
445
|
+
_h.sent();
|
|
446
|
+
return [2];
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
};
|
|
450
|
+
count = 1;
|
|
451
|
+
_g.label = 1;
|
|
452
|
+
case 1:
|
|
453
|
+
if (!(count <= maxCalls)) return [3, 4];
|
|
454
|
+
return [5, _loop_1(count)];
|
|
455
|
+
case 2:
|
|
456
|
+
state_1 = _g.sent();
|
|
457
|
+
if (typeof state_1 === "object")
|
|
458
|
+
return [2, state_1.value];
|
|
459
|
+
if (state_1 === "break")
|
|
460
|
+
return [3, 4];
|
|
461
|
+
_g.label = 3;
|
|
462
|
+
case 3:
|
|
463
|
+
count++;
|
|
464
|
+
return [3, 1];
|
|
465
|
+
case 4: throw new Error(NAFATH_VERIFICATION_FAILED);
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
}); });
|
|
469
|
+
export var updateLeadDOB = createAsyncThunk('auth/updateLeadDOB', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
470
|
+
var _a, settings, auth, leadId, requestBody, data;
|
|
471
|
+
var _b, _c, _d, _e;
|
|
472
|
+
return __generator(this, function (_f) {
|
|
473
|
+
switch (_f.label) {
|
|
474
|
+
case 0:
|
|
475
|
+
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
476
|
+
leadId = ((_c = (_b = auth.data.responseData) === null || _b === void 0 ? void 0 : _b.authResponse) === null || _c === void 0 ? void 0 : _c.lead_id) || '';
|
|
477
|
+
requestBody = {
|
|
478
|
+
id: leadId,
|
|
479
|
+
date_of_birth: params.dob,
|
|
480
|
+
step_name: AUTH_STEP_NAMES.UPDATE_DOB_INFO,
|
|
481
|
+
encryption_contract: ['date_of_birth']
|
|
482
|
+
};
|
|
483
|
+
return [4, API.leadService.updateLead(requestBody)];
|
|
484
|
+
case 1:
|
|
485
|
+
data = _f.sent();
|
|
486
|
+
thunkApi.dispatch(handleNextScreenStep());
|
|
487
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
|
|
488
|
+
return [2, { data: data, formData: params }];
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
}); });
|
|
339
492
|
export var createCivilIdAuth = createAsyncThunk('auth/createCivilAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
340
|
-
var settings, countryCode, requestBody, data;
|
|
341
|
-
var
|
|
342
|
-
return __generator(this, function (
|
|
343
|
-
switch (
|
|
493
|
+
var _a, settings, auth, countryCode, requestBody, data;
|
|
494
|
+
var _b, _c;
|
|
495
|
+
return __generator(this, function (_d) {
|
|
496
|
+
switch (_d.label) {
|
|
344
497
|
case 0:
|
|
345
|
-
|
|
498
|
+
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
346
499
|
countryCode = settings.data.businessCountry.iso2;
|
|
347
500
|
requestBody = {
|
|
348
501
|
country: settings.data.businessCountry.iso2,
|
|
349
502
|
scope: settings.data.appConfig.scope,
|
|
350
503
|
lang: settings.data.language,
|
|
504
|
+
lead_id: auth.data.leadId,
|
|
351
505
|
user_credentail: {
|
|
352
506
|
identification_id: params.civilId,
|
|
353
507
|
country_code: countryCode
|
|
@@ -359,9 +513,9 @@ export var createCivilIdAuth = createAsyncThunk('auth/createCivilAuth', function
|
|
|
359
513
|
};
|
|
360
514
|
return [4, API.authService.createAuth(requestBody)];
|
|
361
515
|
case 1:
|
|
362
|
-
data =
|
|
516
|
+
data = _d.sent();
|
|
363
517
|
thunkApi.dispatch(handleNextScreenStep());
|
|
364
|
-
(
|
|
518
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody.user_credentail);
|
|
365
519
|
return [2, { response: data, formData: params }];
|
|
366
520
|
}
|
|
367
521
|
});
|
|
@@ -409,17 +563,69 @@ export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, th
|
|
|
409
563
|
}
|
|
410
564
|
});
|
|
411
565
|
}); });
|
|
566
|
+
export var checkMigrationStatus = createAsyncThunk('auth/checkMigrationStatus', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
567
|
+
var auth, jobId, authId, migrationData, checkStatusRecursive;
|
|
568
|
+
var _a, _b, _c, _d;
|
|
569
|
+
return __generator(this, function (_e) {
|
|
570
|
+
switch (_e.label) {
|
|
571
|
+
case 0:
|
|
572
|
+
auth = thunkApi.getState().auth;
|
|
573
|
+
jobId = (_b = (_a = auth.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse) === null || _b === void 0 ? void 0 : _b.job_id;
|
|
574
|
+
authId = (_d = (_c = auth.data.responseData) === null || _c === void 0 ? void 0 : _c.authResponse) === null || _d === void 0 ? void 0 : _d.id;
|
|
575
|
+
migrationData = undefined;
|
|
576
|
+
checkStatusRecursive = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
577
|
+
var data;
|
|
578
|
+
return __generator(this, function (_a) {
|
|
579
|
+
switch (_a.label) {
|
|
580
|
+
case 0: return [4, API.accountService.checkMigrationStatus(jobId)];
|
|
581
|
+
case 1:
|
|
582
|
+
data = _a.sent();
|
|
583
|
+
migrationData = data;
|
|
584
|
+
if (!((data === null || data === void 0 ? void 0 : data.status) === MigrationStatus.IN_PROGRESS)) return [3, 4];
|
|
585
|
+
return [4, sleep(3000)];
|
|
586
|
+
case 2:
|
|
587
|
+
_a.sent();
|
|
588
|
+
return [4, checkStatusRecursive()];
|
|
589
|
+
case 3:
|
|
590
|
+
_a.sent();
|
|
591
|
+
return [2];
|
|
592
|
+
case 4:
|
|
593
|
+
if ((data === null || data === void 0 ? void 0 : data.status) === MigrationStatus.FAILED) {
|
|
594
|
+
throw new Error('please_try_again_after_few_minutes');
|
|
595
|
+
}
|
|
596
|
+
_a.label = 5;
|
|
597
|
+
case 5:
|
|
598
|
+
sendCustomEventToGTM({
|
|
599
|
+
event: 'Send Event',
|
|
600
|
+
event_category: 'User Registration Flow',
|
|
601
|
+
event_action: 'Migration Completed'
|
|
602
|
+
});
|
|
603
|
+
return [4, thunkApi.dispatch(confirmInfo({ authId: authId }))];
|
|
604
|
+
case 6:
|
|
605
|
+
_a.sent();
|
|
606
|
+
return [2];
|
|
607
|
+
}
|
|
608
|
+
});
|
|
609
|
+
}); };
|
|
610
|
+
return [4, checkStatusRecursive()];
|
|
611
|
+
case 1:
|
|
612
|
+
_e.sent();
|
|
613
|
+
return [2, migrationData];
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
}); });
|
|
412
617
|
export var checkAccountAvailability = createAsyncThunk('auth/checkAccountAvailability', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
413
|
-
var _a, settings, auth, authConfigData, isDataHasIndividualOnly, data, authId, accountData, _b, step_name, brands, entities, brandList, entityList, isExistingUser;
|
|
618
|
+
var _a, settings, auth, authConfigData, authDataHasValue, isDataHasIndividualOnly, data, authId, accountData, _b, step_name, brands, entities, brandList, entityList, isExistingUser;
|
|
414
619
|
var _c;
|
|
415
620
|
return __generator(this, function (_d) {
|
|
416
621
|
switch (_d.label) {
|
|
417
622
|
case 0:
|
|
418
623
|
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
419
624
|
authConfigData = settings.data.appConfig.data;
|
|
625
|
+
authDataHasValue = authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length;
|
|
420
626
|
isDataHasIndividualOnly = (authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length) === 1 && authConfigData.includes('individual');
|
|
421
627
|
data = (_c = auth.data.responseData) === null || _c === void 0 ? void 0 : _c.authResponse;
|
|
422
|
-
authId = data
|
|
628
|
+
authId = (data || {}).id;
|
|
423
629
|
return [4, API.accountService.checkAccountAvailability(data === null || data === void 0 ? void 0 : data.individual_id)];
|
|
424
630
|
case 1:
|
|
425
631
|
accountData = _d.sent();
|
|
@@ -433,7 +639,7 @@ export var checkAccountAvailability = createAsyncThunk('auth/checkAccountAvailab
|
|
|
433
639
|
_d.sent();
|
|
434
640
|
return [2, { brandList: brandList, entityList: entityList }];
|
|
435
641
|
case 3:
|
|
436
|
-
if (isExistingUser &&
|
|
642
|
+
if (isExistingUser && authDataHasValue && brandList.length && entityList.length) {
|
|
437
643
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_AUTHENTICATION_LIST_STEP')); });
|
|
438
644
|
return [2, { brandList: brandList, entityList: entityList }];
|
|
439
645
|
}
|
|
@@ -449,20 +655,22 @@ export var checkAccountAvailability = createAsyncThunk('auth/checkAccountAvailab
|
|
|
449
655
|
export var getMerchantList = createAsyncThunk('auth/getMerchantList', function (_a, thunkApi) {
|
|
450
656
|
var brandInfo = _a.brandInfo, entityInfo = _a.entityInfo;
|
|
451
657
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
452
|
-
var settings, payload, merchants, list;
|
|
453
|
-
|
|
454
|
-
|
|
658
|
+
var _b, settings, auth, platforms, payment_provider, isScopeAuthentication, leadId, payload, merchants, list;
|
|
659
|
+
var _c, _d, _e, _f, _g, _h, _j, _k;
|
|
660
|
+
return __generator(this, function (_l) {
|
|
661
|
+
switch (_l.label) {
|
|
455
662
|
case 0:
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
663
|
+
_b = thunkApi.getState(), settings = _b.settings, auth = _b.auth;
|
|
664
|
+
platforms = (_e = (_d = (_c = auth.data.responseData) === null || _c === void 0 ? void 0 : _c.leadResponse) === null || _d === void 0 ? void 0 : _d.platforms) !== null && _e !== void 0 ? _e : settings.data.appConfig.platforms;
|
|
665
|
+
payment_provider = (_h = (_g = (_f = auth.data.responseData) === null || _f === void 0 ? void 0 : _f.leadResponse) === null || _g === void 0 ? void 0 : _g.payment_provider) !== null && _h !== void 0 ? _h : settings.data.appConfig.paymentProvider;
|
|
666
|
+
isScopeAuthentication = settings.data.appConfig.scope === SCOPE_AUTH;
|
|
667
|
+
leadId = (_k = (_j = auth.data.responseData) === null || _j === void 0 ? void 0 : _j.authResponse) === null || _k === void 0 ? void 0 : _k.lead_id;
|
|
668
|
+
payload = __assign({ business_entity_id: (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) || '', brand_id: (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.id) || '', create_if_not_present: true, platforms: platforms, payment_provider: payment_provider }, (isScopeAuthentication && {
|
|
669
|
+
lead_id: leadId
|
|
670
|
+
}));
|
|
463
671
|
return [4, API.entityService.getMerchantListUsingEntityId(payload)];
|
|
464
672
|
case 1:
|
|
465
|
-
merchants = (
|
|
673
|
+
merchants = (_l.sent()).merchants;
|
|
466
674
|
list = merchants || [];
|
|
467
675
|
if ((list === null || list === void 0 ? void 0 : list.length) > 1) {
|
|
468
676
|
thunkApi.dispatch(handleNextScreenStep('AUTH_MERCHANT_LIST_STEP'));
|
|
@@ -506,16 +714,16 @@ export var createEntity = createAsyncThunk('auth/createEntity', function (params
|
|
|
506
714
|
export var confirmInfo = createAsyncThunk('auth/confirmInfo', function (_a, thunkApi) {
|
|
507
715
|
var brandInfo = _a.brandInfo, entityInfo = _a.entityInfo, merchantInfo = _a.merchantInfo, authId = _a.authId;
|
|
508
716
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
509
|
-
var _b, auth, settings, authResponse, _c, postURL, redirectUrl, bi, authenticationId, body, data, urlQueryStart;
|
|
510
|
-
var _d, _e, _f;
|
|
511
|
-
return __generator(this, function (
|
|
512
|
-
switch (
|
|
717
|
+
var _b, auth, settings, authResponse, _c, postURL, redirectUrl, showBoard, bi, authenticationId, body, data, urlQueryStart;
|
|
718
|
+
var _d, _e, _f, _g, _h, _j;
|
|
719
|
+
return __generator(this, function (_k) {
|
|
720
|
+
switch (_k.label) {
|
|
513
721
|
case 0:
|
|
514
722
|
_b = thunkApi.getState(), auth = _b.auth, settings = _b.settings;
|
|
515
723
|
authResponse = ((_d = auth.data.responseData) !== null && _d !== void 0 ? _d : {}).authResponse;
|
|
516
|
-
_c = settings.data.appConfig, postURL = _c.postURL, redirectUrl = _c.redirectUrl;
|
|
724
|
+
_c = settings.data.appConfig, postURL = _c.postURL, redirectUrl = _c.redirectUrl, showBoard = _c.showBoard;
|
|
517
725
|
bi = settings.data.deviceInfo.browser.browser_id;
|
|
518
|
-
authenticationId = authId
|
|
726
|
+
authenticationId = (_e = authId !== null && authId !== void 0 ? authId : authResponse === null || authResponse === void 0 ? void 0 : authResponse.id) !== null && _e !== void 0 ? _e : '';
|
|
519
727
|
body = {
|
|
520
728
|
post_url: postURL || '',
|
|
521
729
|
authentication_id: authenticationId,
|
|
@@ -527,8 +735,13 @@ export var confirmInfo = createAsyncThunk('auth/confirmInfo', function (_a, thun
|
|
|
527
735
|
};
|
|
528
736
|
return [4, API.operatorService.confirm(body)];
|
|
529
737
|
case 1:
|
|
530
|
-
data =
|
|
531
|
-
(
|
|
738
|
+
data = _k.sent();
|
|
739
|
+
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, data);
|
|
740
|
+
if (showBoard && (merchantInfo === null || merchantInfo === void 0 ? void 0 : merchantInfo.board_id)) {
|
|
741
|
+
settings.data.appConfig.onFlowCompleted({ auth_id: authenticationId, bi: bi });
|
|
742
|
+
(_j = (_h = settings.data.appConfig).onSwitchToBoard) === null || _j === void 0 ? void 0 : _j.call(_h, (merchantInfo === null || merchantInfo === void 0 ? void 0 : merchantInfo.board_id) || '', authenticationId);
|
|
743
|
+
return [2];
|
|
744
|
+
}
|
|
532
745
|
if (authenticationId) {
|
|
533
746
|
if (settings.data.appConfig.mode === 'popup') {
|
|
534
747
|
settings.data.appConfig.onFlowCompleted({ auth_id: authenticationId, bi: bi });
|
|
@@ -546,28 +759,41 @@ export var confirmInfo = createAsyncThunk('auth/confirmInfo', function (_a, thun
|
|
|
546
759
|
});
|
|
547
760
|
});
|
|
548
761
|
export var onSignUp = createAsyncThunk('auth/onSignUp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
549
|
-
var _a, auth, settings, authResponse, _b, appConfig,
|
|
550
|
-
var _c, _d, _e
|
|
551
|
-
return __generator(this, function (
|
|
552
|
-
switch (
|
|
762
|
+
var _a, auth, settings, responseData, authResponse, _b, appConfig, language, boardMaturity, scope, postURL, authData, dialogEdgeFormat, redirectUrl, body, data, connectUrl;
|
|
763
|
+
var _c, _d, _e;
|
|
764
|
+
return __generator(this, function (_f) {
|
|
765
|
+
switch (_f.label) {
|
|
553
766
|
case 0:
|
|
554
767
|
_a = thunkApi.getState(), auth = _a.auth, settings = _a.settings;
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
768
|
+
responseData = auth.data.responseData;
|
|
769
|
+
authResponse = (responseData !== null && responseData !== void 0 ? responseData : {}).authResponse;
|
|
770
|
+
_b = settings.data, appConfig = _b.appConfig, language = _b.language;
|
|
771
|
+
boardMaturity = appConfig.boardMaturity, scope = appConfig.scope, postURL = appConfig.postURL, authData = appConfig.data, dialogEdgeFormat = appConfig.dialogEdgeFormat, redirectUrl = appConfig.redirectUrl;
|
|
772
|
+
body = __assign(__assign({ scope: scope, data: authData, lead: {
|
|
773
|
+
id: authResponse === null || authResponse === void 0 ? void 0 : authResponse.lead_id
|
|
774
|
+
}, board: {
|
|
775
|
+
display: true,
|
|
776
|
+
editable: boardMaturity
|
|
777
|
+
}, interface: {
|
|
778
|
+
locale: language,
|
|
779
|
+
edges: dialogEdgeFormat
|
|
780
|
+
} }, (redirectUrl && {
|
|
781
|
+
post: {
|
|
782
|
+
url: redirectUrl
|
|
783
|
+
}
|
|
784
|
+
})), (postURL && {
|
|
559
785
|
post: {
|
|
560
786
|
url: postURL
|
|
561
787
|
}
|
|
562
788
|
}));
|
|
563
789
|
return [4, API.authService.generateConfigToken(body)];
|
|
564
790
|
case 1:
|
|
565
|
-
data =
|
|
566
|
-
(
|
|
567
|
-
|
|
568
|
-
if (!
|
|
791
|
+
data = _f.sent();
|
|
792
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, data);
|
|
793
|
+
connectUrl = (_e = data === null || data === void 0 ? void 0 : data.connect) === null || _e === void 0 ? void 0 : _e.url;
|
|
794
|
+
if (!connectUrl)
|
|
569
795
|
throw new Error('Internal server error');
|
|
570
|
-
window.open(
|
|
796
|
+
window.open(connectUrl, '_self');
|
|
571
797
|
return [2];
|
|
572
798
|
}
|
|
573
799
|
});
|
|
@@ -578,6 +804,7 @@ var initialState = {
|
|
|
578
804
|
customLoading: false,
|
|
579
805
|
data: {
|
|
580
806
|
isStartFromBusinessCountry: false,
|
|
807
|
+
isBusinessCountryPassed: true,
|
|
581
808
|
flowName: FlowsTypes.AUTH,
|
|
582
809
|
mobileData: {
|
|
583
810
|
countryCode: defaultCountry,
|
|
@@ -592,10 +819,19 @@ var initialState = {
|
|
|
592
819
|
civilIdData: {
|
|
593
820
|
civilId: ''
|
|
594
821
|
},
|
|
822
|
+
emailData: {
|
|
823
|
+
email: ''
|
|
824
|
+
},
|
|
825
|
+
dobData: {
|
|
826
|
+
dob: ''
|
|
827
|
+
},
|
|
595
828
|
otpData: {
|
|
596
829
|
otp: '',
|
|
597
830
|
authFor: AuthForType.MOBILE
|
|
598
831
|
},
|
|
832
|
+
passwordData: {
|
|
833
|
+
password: ''
|
|
834
|
+
},
|
|
599
835
|
authenticationData: {
|
|
600
836
|
brandInfo: undefined,
|
|
601
837
|
entityInfo: undefined
|
|
@@ -621,33 +857,20 @@ export var authSlice = createSlice({
|
|
|
621
857
|
storeIsStartFromBusinessCountry: function (state, action) {
|
|
622
858
|
state.data.isStartFromBusinessCountry = action.payload;
|
|
623
859
|
},
|
|
860
|
+
storeIsBusinessCountryPassed: function (state, action) {
|
|
861
|
+
state.data.isBusinessCountryPassed = action.payload;
|
|
862
|
+
},
|
|
624
863
|
resetStore: function (state) {
|
|
625
864
|
state.data = __assign(__assign({}, state.data), { responseData: undefined });
|
|
626
865
|
},
|
|
627
866
|
resetOTPValue: function (state) {
|
|
628
867
|
state.data.otpData.otp = '';
|
|
629
868
|
},
|
|
869
|
+
resetPasswordValue: function (state) {
|
|
870
|
+
state.data.passwordData.password = '';
|
|
871
|
+
},
|
|
630
872
|
resetAuthenticationScreen: function (state) {
|
|
631
873
|
state.data.authenticationData = __assign(__assign({}, state.data.authenticationData), initialState.data.authenticationData);
|
|
632
|
-
},
|
|
633
|
-
storeCustomerInfo: function (state, action) {
|
|
634
|
-
var _a;
|
|
635
|
-
var _b = action.payload, customer = _b.customer, countries = _b.countries;
|
|
636
|
-
var address = customer.address, identification = customer.identification, nationality = customer.nationality, phone = customer.phone, name = customer.name, birth = customer.birth, email = customer.email, primary = customer.primary;
|
|
637
|
-
var _c = identification || {}, number = _c.number, type = _c.type;
|
|
638
|
-
var _d = (phone || [])[0], mobile = _d.number, country_code = _d.country_code;
|
|
639
|
-
var countryInfo = (_a = findCountryByIddPrefix(countries, country_code)) !== null && _a !== void 0 ? _a : defaultCountry;
|
|
640
|
-
state.data.nidData = {
|
|
641
|
-
nid: number,
|
|
642
|
-
dob: birth === null || birth === void 0 ? void 0 : birth.date
|
|
643
|
-
};
|
|
644
|
-
state.data.civilIdData = {
|
|
645
|
-
civilId: number
|
|
646
|
-
};
|
|
647
|
-
state.data.mobileData = {
|
|
648
|
-
mobile: mobile,
|
|
649
|
-
countryCode: countryInfo
|
|
650
|
-
};
|
|
651
874
|
}
|
|
652
875
|
},
|
|
653
876
|
extraReducers: function (builder) {
|
|
@@ -676,13 +899,16 @@ export var authSlice = createSlice({
|
|
|
676
899
|
state.data.nidData.nid = identification === null || identification === void 0 ? void 0 : identification.id;
|
|
677
900
|
if (date_of_birth)
|
|
678
901
|
state.data.nidData.dob = date_of_birth;
|
|
679
|
-
var
|
|
902
|
+
var _c = contact || {}, phone = _c.phone, email = _c.email;
|
|
680
903
|
if (phone) {
|
|
681
904
|
state.data.mobileData.mobile = phone === null || phone === void 0 ? void 0 : phone.number;
|
|
682
905
|
}
|
|
683
906
|
if (countryCode) {
|
|
684
907
|
state.data.mobileData.countryCode = countryCode;
|
|
685
908
|
}
|
|
909
|
+
if (email) {
|
|
910
|
+
state.data.emailData.email = email;
|
|
911
|
+
}
|
|
686
912
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { leadResponse: data });
|
|
687
913
|
})
|
|
688
914
|
.addCase(retrieveLeadIdentityByIdAsync.rejected, function (state, action) {
|
|
@@ -728,42 +954,102 @@ export var authSlice = createSlice({
|
|
|
728
954
|
state.loading = false;
|
|
729
955
|
state.error = action.error.message;
|
|
730
956
|
})
|
|
731
|
-
.addCase(
|
|
957
|
+
.addCase(createEmailAuth.pending, function (state) {
|
|
732
958
|
state.loading = true;
|
|
733
959
|
state.error = null;
|
|
734
960
|
})
|
|
735
|
-
.addCase(
|
|
961
|
+
.addCase(createEmailAuth.fulfilled, function (state, action) {
|
|
736
962
|
state.loading = false;
|
|
737
|
-
state.data.
|
|
738
|
-
state.data.otpData.authFor = AuthForType.
|
|
963
|
+
state.data.emailData = action.payload.formData;
|
|
964
|
+
state.data.otpData.authFor = AuthForType.EMAIL;
|
|
739
965
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
|
|
740
966
|
})
|
|
741
|
-
.addCase(
|
|
967
|
+
.addCase(createEmailAuth.rejected, function (state, action) {
|
|
968
|
+
state.loading = false;
|
|
969
|
+
state.error = action.error.message;
|
|
970
|
+
})
|
|
971
|
+
.addCase(verifyEmailPassword.pending, function (state) {
|
|
972
|
+
state.loading = true;
|
|
973
|
+
state.error = null;
|
|
974
|
+
})
|
|
975
|
+
.addCase(verifyEmailPassword.fulfilled, function (state, action) {
|
|
976
|
+
var _a;
|
|
977
|
+
state.loading = false;
|
|
978
|
+
var data = action.payload;
|
|
979
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
|
|
980
|
+
})
|
|
981
|
+
.addCase(verifyEmailPassword.rejected, function (state, action) {
|
|
982
|
+
state.loading = false;
|
|
983
|
+
state.error = action.error.message;
|
|
984
|
+
})
|
|
985
|
+
.addCase(resendEmailAuthOTP.pending, function (state) {
|
|
986
|
+
state.error = null;
|
|
987
|
+
})
|
|
988
|
+
.addCase(resendEmailAuthOTP.fulfilled, function (state, action) {
|
|
989
|
+
state.data.emailData = action.payload.formData;
|
|
990
|
+
state.data.otpData.authFor = AuthForType.EMAIL;
|
|
991
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
|
|
992
|
+
})
|
|
993
|
+
.addCase(resendEmailAuthOTP.rejected, function (state, action) {
|
|
994
|
+
state.error = action.error.message;
|
|
995
|
+
})
|
|
996
|
+
.addCase(verifyEmailOtp.pending, function (state) {
|
|
997
|
+
state.loading = true;
|
|
998
|
+
state.error = null;
|
|
999
|
+
})
|
|
1000
|
+
.addCase(verifyEmailOtp.fulfilled, function (state, action) {
|
|
1001
|
+
var _a;
|
|
1002
|
+
state.loading = false;
|
|
1003
|
+
var data = action.payload;
|
|
1004
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
|
|
1005
|
+
})
|
|
1006
|
+
.addCase(verifyEmailOtp.rejected, function (state, action) {
|
|
742
1007
|
state.loading = false;
|
|
743
1008
|
state.error = action.error.message;
|
|
744
1009
|
})
|
|
745
|
-
.addCase(
|
|
1010
|
+
.addCase(createNafathAuth.pending, function (state) {
|
|
1011
|
+
state.loading = true;
|
|
746
1012
|
state.error = null;
|
|
747
1013
|
})
|
|
748
|
-
.addCase(
|
|
1014
|
+
.addCase(createNafathAuth.fulfilled, function (state, action) {
|
|
1015
|
+
state.loading = false;
|
|
749
1016
|
state.data.nidData = action.payload.formData;
|
|
750
1017
|
state.data.otpData.authFor = AuthForType.NATIONAL_ID;
|
|
751
1018
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
|
|
752
1019
|
})
|
|
753
|
-
.addCase(
|
|
1020
|
+
.addCase(createNafathAuth.rejected, function (state, action) {
|
|
1021
|
+
state.loading = false;
|
|
754
1022
|
state.error = action.error.message;
|
|
755
1023
|
})
|
|
756
|
-
.addCase(
|
|
1024
|
+
.addCase(verifyNafath.pending, function (state) {
|
|
757
1025
|
state.loading = true;
|
|
758
1026
|
state.error = null;
|
|
759
1027
|
})
|
|
760
|
-
.addCase(
|
|
1028
|
+
.addCase(verifyNafath.fulfilled, function (state, action) {
|
|
761
1029
|
var _a;
|
|
762
1030
|
state.loading = false;
|
|
763
1031
|
var data = action.payload;
|
|
764
1032
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
|
|
765
1033
|
})
|
|
766
|
-
.addCase(
|
|
1034
|
+
.addCase(verifyNafath.rejected, function (state, action) {
|
|
1035
|
+
state.loading = false;
|
|
1036
|
+
var error = action.error.message;
|
|
1037
|
+
if (error !== 'Aborted') {
|
|
1038
|
+
state.error = error;
|
|
1039
|
+
}
|
|
1040
|
+
})
|
|
1041
|
+
.addCase(updateLeadDOB.pending, function (state, action) {
|
|
1042
|
+
state.loading = true;
|
|
1043
|
+
state.error = null;
|
|
1044
|
+
})
|
|
1045
|
+
.addCase(updateLeadDOB.fulfilled, function (state, action) {
|
|
1046
|
+
var _a;
|
|
1047
|
+
state.loading = false;
|
|
1048
|
+
var _b = action.payload, data = _b.data, formData = _b.formData;
|
|
1049
|
+
state.data.dobData = formData;
|
|
1050
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { leadResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.leadResponse), data) });
|
|
1051
|
+
})
|
|
1052
|
+
.addCase(updateLeadDOB.rejected, function (state, action) {
|
|
767
1053
|
state.loading = false;
|
|
768
1054
|
state.error = action.error.message;
|
|
769
1055
|
})
|
|
@@ -814,6 +1100,19 @@ export var authSlice = createSlice({
|
|
|
814
1100
|
.addCase(checkAccountAvailability.rejected, function (state, action) {
|
|
815
1101
|
state.loading = false;
|
|
816
1102
|
state.error = action.error.message;
|
|
1103
|
+
})
|
|
1104
|
+
.addCase(checkMigrationStatus.pending, function (state) {
|
|
1105
|
+
state.loading = true;
|
|
1106
|
+
state.error = null;
|
|
1107
|
+
})
|
|
1108
|
+
.addCase(checkMigrationStatus.fulfilled, function (state, action) {
|
|
1109
|
+
state.error = null;
|
|
1110
|
+
state.loading = false;
|
|
1111
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { migrationData: action.payload });
|
|
1112
|
+
})
|
|
1113
|
+
.addCase(checkMigrationStatus.rejected, function (state, action) {
|
|
1114
|
+
state.loading = false;
|
|
1115
|
+
state.error = action.error.message;
|
|
817
1116
|
})
|
|
818
1117
|
.addCase(getMerchantList.pending, function (state) {
|
|
819
1118
|
state.loading = true;
|
|
@@ -880,6 +1179,6 @@ export var authSlice = createSlice({
|
|
|
880
1179
|
});
|
|
881
1180
|
}
|
|
882
1181
|
});
|
|
883
|
-
export var clearError = (_a = authSlice.actions, _a.clearError), resetStore = _a.resetStore, setMobileCountryCode = _a.setMobileCountryCode, setLeadId = _a.setLeadId, resetOTPValue = _a.resetOTPValue, storeIsStartFromBusinessCountry = _a.storeIsStartFromBusinessCountry, resetAuthenticationScreen = _a.resetAuthenticationScreen,
|
|
1182
|
+
export var clearError = (_a = authSlice.actions, _a.clearError), resetStore = _a.resetStore, setMobileCountryCode = _a.setMobileCountryCode, setLeadId = _a.setLeadId, resetOTPValue = _a.resetOTPValue, storeIsStartFromBusinessCountry = _a.storeIsStartFromBusinessCountry, resetAuthenticationScreen = _a.resetAuthenticationScreen, storeIsBusinessCountryPassed = _a.storeIsBusinessCountryPassed, resetPasswordValue = _a.resetPasswordValue;
|
|
884
1183
|
export default authSlice.reducer;
|
|
885
1184
|
export var authSelector = function (state) { return state.auth; };
|