@tap-payments/auth-jsconnect 2.7.5-test → 2.7.5
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 +44 -4
- package/build/@types/app.js +16 -0
- package/build/@types/config.d.ts +14 -0
- package/build/@types/form.d.ts +11 -1
- package/build/@types/redux.d.ts +1 -0
- package/build/api/account.d.ts +4 -1
- package/build/api/account.js +15 -1
- package/build/api/auth.d.ts +35 -20
- package/build/api/auth.js +1 -1
- package/build/api/axios.js +1 -2
- package/build/api/data.d.ts +4 -17
- package/build/api/data.js +5 -45
- package/build/api/entity.d.ts +3 -2
- package/build/api/entity.js +12 -4
- package/build/api/firebase.js +68 -8
- package/build/api/index.d.ts +14 -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 +2 -1
- package/build/app/settings.js +51 -21
- 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 -5
- package/build/components/AnimationFlow/AnimationFlow.js +5 -5
- package/build/components/AnimationFlow/BottomSheet.d.ts +5 -2
- package/build/components/AnimationFlow/BottomSheet.js +43 -14
- package/build/components/AnimationFlow/Dialog.d.ts +4 -3
- 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 +74 -8
- package/build/features/app/auth/authStore.js +495 -149
- 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 +64 -15
- package/build/features/app/business/businessStore.js +442 -234
- package/build/features/app/connect/connectStore.d.ts +69 -14
- package/build/features/app/connect/connectStore.js +355 -120
- package/build/features/app/connectExpress/connectExpressStore.d.ts +89 -45
- package/build/features/app/connectExpress/connectExpressStore.js +668 -375
- 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 +121 -0
- package/build/features/app/kyc/kycStore.js +432 -0
- package/build/features/app/password/passwordStore.d.ts +42 -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 +40 -15
- 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 +4 -26
- 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 +8 -35
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +48 -11
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +3 -3
- 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 +5 -18
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +2 -7
- 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 +2 -2
- package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +4 -2
- package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
- package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +1 -1
- 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 +4 -26
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +12 -37
- 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 +13 -19
- 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 +2 -0
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +103 -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 +16 -9
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/connect/screens/CivilID/CivilID.js +6 -1
- package/build/features/connect/screens/DOB/DOB.d.ts +5 -0
- 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 +2 -0
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +104 -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 +62 -39
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +4 -26
- 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 +4 -26
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +2 -7
- 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/DOB/DOB.d.ts +5 -0
- 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 +2 -0
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +106 -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 +2 -7
- 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 +2 -2
- 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 +8 -35
- package/build/features/entity/screens/EntityName/EntityTypeList.js +2 -3
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +1 -1
- package/build/features/entity/screens/EntityName/ExpiryDate.js +13 -8
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +1 -1
- 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 +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +44 -11
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +4 -26
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +5 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +4 -26
- 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 +2 -2
- 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 +4 -26
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +1 -1
- 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 +10 -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 +7 -23
- package/build/features/shared/Address/InputSelect.d.ts +7 -23
- 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 +7 -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 +1 -0
- package/build/features/shared/Containers/FeatureContainer.js +5 -3
- 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 +2 -7
- package/build/features/shared/UploadFile/UploadFile.d.ts +2 -7
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +2 -7
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +2 -7
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +2 -7
- 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 +1 -1
- package/build/hooks/useAppConfig.js +4 -3
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/hooks/useAppTheme.js +4 -3
- 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/auth/screens/NID/DOB.d.ts +0 -6
- 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/connectExpress/screens/NID/DOB.d.ts +0 -6
- package/build/features/shared/Button/AbsherButton.d.ts +0 -7
- /package/build/features/{connect/screens/NID → auth/screens/DOB}/DOB.d.ts +0 -0
|
@@ -59,9 +59,9 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
|
59
59
|
import { handleNextScreenStep, handleCurrentActiveScreen, handleOpen, handleSetCountryByIso2, onCloseComplete, storeAuthId } from '../../../app/settings';
|
|
60
60
|
import { FlowsTypes, AuthForType, BusinessType, LicenseType } from '../../../@types';
|
|
61
61
|
import API from '../../../api';
|
|
62
|
-
import { ADD_NEW_ENTITY, CONNECT_EXPRESS_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_FL_LICENSE, SCOPE_AUTH } from '../../../constants';
|
|
62
|
+
import { ADD_NEW_ENTITY, COLLECT_DOB_INFO_NAFATH, CONNECT_EXPRESS_STEP_NAMES, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_FL_LICENSE, SCOPE_AUTH } from '../../../constants';
|
|
63
63
|
import { defaultCountry } from '../../../constants';
|
|
64
|
-
import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA, isKW, isOtherThanKWOrSA } from '../../../utils';
|
|
64
|
+
import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA, isKW, isOtherThanKWOrSA, sendCustomEventToGTM, sendCustomDimension, getMetaData, isNetworkError } from '../../../utils';
|
|
65
65
|
export var updateBusinessCountryAsync = createAsyncThunk('connectExpress/updateBusinessCountryAsync', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
66
|
var connectExpress, payload, data;
|
|
67
67
|
return __generator(this, function (_a) {
|
|
@@ -81,25 +81,25 @@ export var updateBusinessCountryAsync = createAsyncThunk('connectExpress/updateB
|
|
|
81
81
|
});
|
|
82
82
|
}); });
|
|
83
83
|
export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retrieveLeadIdentityByIdAsync', function (leadId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
84
|
-
var
|
|
85
|
-
var _d, _e, _f, _g
|
|
86
|
-
return __generator(this, function (
|
|
87
|
-
switch (
|
|
84
|
+
var settings, countryCode, showBoard, data, _a, country_code, contact, phone, status, board_id, board_info_id, isRegistered, screen_1, _b, boardInfo, boardData, error_1;
|
|
85
|
+
var _c, _d, _e, _f, _g;
|
|
86
|
+
return __generator(this, function (_h) {
|
|
87
|
+
switch (_h.label) {
|
|
88
88
|
case 0:
|
|
89
|
-
|
|
89
|
+
settings = thunkApi.getState().settings;
|
|
90
90
|
countryCode = settings.data.businessCountry;
|
|
91
|
-
showBoard =
|
|
91
|
+
showBoard = settings.data.appConfig.showBoard;
|
|
92
92
|
return [4, API.leadService.retrieveLeadIdentity(leadId)];
|
|
93
93
|
case 1:
|
|
94
|
-
data =
|
|
95
|
-
|
|
94
|
+
data = _h.sent();
|
|
95
|
+
_a = data || {}, country_code = _a.country_code, contact = _a.contact;
|
|
96
96
|
if (country_code)
|
|
97
97
|
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
98
98
|
phone = (contact || {}).phone;
|
|
99
99
|
if (phone === null || phone === void 0 ? void 0 : phone.country_code)
|
|
100
100
|
countryCode = findCountryByIddPrefix(settings.data.countries, phone.country_code);
|
|
101
101
|
status = data.status, board_id = data.board_id, board_info_id = data.board_info_id;
|
|
102
|
-
if (!
|
|
102
|
+
if (!country_code && !((_c = settings.data.businessCountry) === null || _c === void 0 ? void 0 : _c.iso2)) {
|
|
103
103
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
|
|
104
104
|
return [2, { data: data, countryCode: countryCode }];
|
|
105
105
|
}
|
|
@@ -108,21 +108,26 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
|
|
|
108
108
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
|
|
109
109
|
return [2, { data: data, countryCode: countryCode }];
|
|
110
110
|
}
|
|
111
|
-
if (!isRegistered &&
|
|
112
|
-
|
|
113
|
-
if (
|
|
114
|
-
|
|
111
|
+
if (!isRegistered && country_code) {
|
|
112
|
+
screen_1 = 'CONNECT_EXPRESS_NID_STEP';
|
|
113
|
+
if (!isSA(data.country_code))
|
|
114
|
+
screen_1 = 'CONNECT_EXPRESS_MOBILE_STEP';
|
|
115
|
+
thunkApi.dispatch(handleCurrentActiveScreen(screen_1));
|
|
115
116
|
return [2, { data: data, countryCode: countryCode }];
|
|
116
117
|
}
|
|
117
|
-
if (!isRegistered && (
|
|
118
|
+
if (!isRegistered && !isSA(settings.data.businessCountry.iso2)) {
|
|
118
119
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
|
|
119
120
|
return [2, { data: data, countryCode: countryCode }];
|
|
120
121
|
}
|
|
121
|
-
if (
|
|
122
|
-
thunkApi.dispatch(
|
|
122
|
+
if (!isRegistered && isSA(settings.data.businessCountry.iso2)) {
|
|
123
|
+
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_NID_STEP'));
|
|
124
|
+
return [2, { data: data, countryCode: countryCode }];
|
|
125
|
+
}
|
|
126
|
+
if ((_d = data === null || data === void 0 ? void 0 : data.identification) === null || _d === void 0 ? void 0 : _d.authentication_id) {
|
|
127
|
+
thunkApi.dispatch(storeAuthId((_e = data === null || data === void 0 ? void 0 : data.identification) === null || _e === void 0 ? void 0 : _e.authentication_id));
|
|
123
128
|
}
|
|
124
129
|
if (isRegistered && !showBoard) {
|
|
125
|
-
(
|
|
130
|
+
(_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, data);
|
|
126
131
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP'));
|
|
127
132
|
return [2, { data: data, countryCode: countryCode }];
|
|
128
133
|
}
|
|
@@ -131,19 +136,19 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('expressConnect/retr
|
|
|
131
136
|
return [2, { data: data, countryCode: countryCode }];
|
|
132
137
|
}
|
|
133
138
|
if (!(isRegistered && board_id && board_info_id)) return [3, 5];
|
|
134
|
-
|
|
139
|
+
_h.label = 2;
|
|
135
140
|
case 2:
|
|
136
|
-
|
|
141
|
+
_h.trys.push([2, 4, , 5]);
|
|
137
142
|
return [4, Promise.all([
|
|
138
143
|
API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
|
|
139
144
|
API.boardService.retrieveBoardDetails(board_id)
|
|
140
145
|
])];
|
|
141
146
|
case 3:
|
|
142
|
-
|
|
147
|
+
_b = _h.sent(), boardInfo = _b[0], boardData = _b[1];
|
|
143
148
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP'));
|
|
144
149
|
return [2, { data: data, countryCode: countryCode, boardInfo: boardInfo, boardData: boardData }];
|
|
145
150
|
case 4:
|
|
146
|
-
error_1 =
|
|
151
|
+
error_1 = _h.sent();
|
|
147
152
|
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP'));
|
|
148
153
|
return [2, { data: data, countryCode: countryCode }];
|
|
149
154
|
case 5: return [2, { data: data, countryCode: countryCode }];
|
|
@@ -216,24 +221,26 @@ export var retrieveAuthenticationListAsync = createAsyncThunk('connectExpress/re
|
|
|
216
221
|
export var getMerchantListAsync = createAsyncThunk('connectExpress/getMerchantListAsync', function (_a, thunkApi) {
|
|
217
222
|
var brandInfo = _a.brandInfo, entityInfo = _a.entityInfo;
|
|
218
223
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
219
|
-
var _b, settings, connectExpress, platforms, payment_provider, payload, merchants, list;
|
|
220
|
-
var _c, _d, _e, _f, _g, _h;
|
|
221
|
-
return __generator(this, function (
|
|
222
|
-
switch (
|
|
224
|
+
var _b, settings, connectExpress, leadId, platforms, payment_provider, payload, merchants, list;
|
|
225
|
+
var _c, _d, _e, _f, _g, _h, _j, _k;
|
|
226
|
+
return __generator(this, function (_l) {
|
|
227
|
+
switch (_l.label) {
|
|
223
228
|
case 0:
|
|
224
229
|
_b = thunkApi.getState(), settings = _b.settings, connectExpress = _b.connectExpress;
|
|
225
|
-
|
|
226
|
-
|
|
230
|
+
leadId = (_d = (_c = connectExpress.data.responseData) === null || _c === void 0 ? void 0 : _c.authData) === null || _d === void 0 ? void 0 : _d.lead_id;
|
|
231
|
+
platforms = (_g = (_f = (_e = connectExpress.data.responseData) === null || _e === void 0 ? void 0 : _e.leadData) === null || _f === void 0 ? void 0 : _f.platforms) !== null && _g !== void 0 ? _g : settings.data.appConfig.platforms;
|
|
232
|
+
payment_provider = (_k = (_j = (_h = connectExpress.data.responseData) === null || _h === void 0 ? void 0 : _h.leadData) === null || _j === void 0 ? void 0 : _j.payment_provider) !== null && _k !== void 0 ? _k : settings.data.appConfig.paymentProvider;
|
|
227
233
|
payload = {
|
|
228
234
|
business_entity_id: (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) || '',
|
|
229
235
|
brand_id: (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.id) || '',
|
|
236
|
+
lead_id: leadId || '',
|
|
230
237
|
create_if_not_present: true,
|
|
231
238
|
platforms: platforms,
|
|
232
239
|
payment_provider: payment_provider
|
|
233
240
|
};
|
|
234
241
|
return [4, API.entityService.getMerchantListUsingEntityId(payload)];
|
|
235
242
|
case 1:
|
|
236
|
-
merchants = (
|
|
243
|
+
merchants = (_l.sent()).merchants;
|
|
237
244
|
list = merchants || [];
|
|
238
245
|
if ((list === null || list === void 0 ? void 0 : list.length) > 1) {
|
|
239
246
|
thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTH_MERCHANT_LIST_STEP'));
|
|
@@ -246,19 +253,21 @@ export var getMerchantListAsync = createAsyncThunk('connectExpress/getMerchantLi
|
|
|
246
253
|
});
|
|
247
254
|
});
|
|
248
255
|
export var createMobileAuthAsync = createAsyncThunk('connectExpress/createMobileAuthAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
249
|
-
var _a, settings, connectExpress, requestBody, data;
|
|
250
|
-
var _b, _c;
|
|
251
|
-
return __generator(this, function (
|
|
252
|
-
switch (
|
|
256
|
+
var _a, settings, connectExpress, isStartWithZero, mobileNumber, requestBody, data;
|
|
257
|
+
var _b, _c, _d;
|
|
258
|
+
return __generator(this, function (_e) {
|
|
259
|
+
switch (_e.label) {
|
|
253
260
|
case 0:
|
|
254
261
|
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
262
|
+
isStartWithZero = (_b = params.mobile) === null || _b === void 0 ? void 0 : _b.startsWith('0');
|
|
263
|
+
mobileNumber = isStartWithZero ? params.mobile.slice(1) : params.mobile;
|
|
255
264
|
requestBody = {
|
|
256
265
|
country: settings.data.businessCountry.iso2,
|
|
257
266
|
scope: settings.data.appConfig.scope,
|
|
258
267
|
lang: settings.data.language,
|
|
259
268
|
lead_id: connectExpress.data.leadId,
|
|
260
269
|
user_credentail: {
|
|
261
|
-
phone:
|
|
270
|
+
phone: mobileNumber,
|
|
262
271
|
code: params.countryCode.idd_prefix.toString()
|
|
263
272
|
},
|
|
264
273
|
sign_in: false,
|
|
@@ -268,26 +277,29 @@ export var createMobileAuthAsync = createAsyncThunk('connectExpress/createMobile
|
|
|
268
277
|
};
|
|
269
278
|
return [4, API.authService.createExpressAuth(requestBody)];
|
|
270
279
|
case 1:
|
|
271
|
-
data =
|
|
280
|
+
data = _e.sent();
|
|
272
281
|
thunkApi.dispatch(handleNextScreenStep());
|
|
273
|
-
(
|
|
282
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody.user_credentail);
|
|
274
283
|
return [2, { response: data, formData: params }];
|
|
275
284
|
}
|
|
276
285
|
});
|
|
277
286
|
}); });
|
|
278
287
|
export var resendMobileAuthOTP = createAsyncThunk('connectExpress/resendMobileAuthOTPExpress', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
279
|
-
var _a, settings, connectExpress, requestBody, data;
|
|
280
|
-
|
|
281
|
-
|
|
288
|
+
var _a, settings, connectExpress, isStartWithZero, mobileNumber, requestBody, data;
|
|
289
|
+
var _b;
|
|
290
|
+
return __generator(this, function (_c) {
|
|
291
|
+
switch (_c.label) {
|
|
282
292
|
case 0:
|
|
283
293
|
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
294
|
+
isStartWithZero = (_b = params.mobile) === null || _b === void 0 ? void 0 : _b.startsWith('0');
|
|
295
|
+
mobileNumber = isStartWithZero ? params.mobile.slice(1) : params.mobile;
|
|
284
296
|
requestBody = {
|
|
285
297
|
country: settings.data.businessCountry.iso2,
|
|
286
298
|
scope: settings.data.appConfig.scope,
|
|
287
299
|
lang: settings.data.language,
|
|
288
300
|
lead_id: connectExpress.data.leadId,
|
|
289
301
|
user_credentail: {
|
|
290
|
-
phone:
|
|
302
|
+
phone: mobileNumber,
|
|
291
303
|
code: params.countryCode.idd_prefix.toString()
|
|
292
304
|
},
|
|
293
305
|
sign_in: false,
|
|
@@ -297,85 +309,137 @@ export var resendMobileAuthOTP = createAsyncThunk('connectExpress/resendMobileAu
|
|
|
297
309
|
};
|
|
298
310
|
return [4, API.authService.createExpressAuth(requestBody)];
|
|
299
311
|
case 1:
|
|
300
|
-
data =
|
|
312
|
+
data = _c.sent();
|
|
301
313
|
return [2, { response: data, formData: params }];
|
|
302
314
|
}
|
|
303
315
|
});
|
|
304
316
|
}); });
|
|
305
|
-
export var
|
|
306
|
-
var _a, settings, connectExpress,
|
|
317
|
+
export var createNafathAuth = createAsyncThunk('connectExpress/createNafathAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
318
|
+
var _a, settings, connectExpress, requestBody, data;
|
|
307
319
|
var _b, _c;
|
|
308
320
|
return __generator(this, function (_d) {
|
|
309
321
|
switch (_d.label) {
|
|
310
322
|
case 0:
|
|
311
323
|
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
312
|
-
dob = params.dob, nid = params.nid;
|
|
313
|
-
nidType = nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
|
|
314
|
-
countryCode = settings.data.businessCountry.iso2;
|
|
315
324
|
requestBody = {
|
|
316
|
-
country:
|
|
325
|
+
country: settings.data.businessCountry.iso2,
|
|
317
326
|
scope: settings.data.appConfig.scope,
|
|
318
327
|
lang: settings.data.language,
|
|
319
328
|
lead_id: connectExpress.data.leadId,
|
|
320
329
|
user_credentail: {
|
|
321
|
-
identification_id: nid,
|
|
322
|
-
identification_id_type:
|
|
323
|
-
|
|
324
|
-
country_code: countryCode
|
|
330
|
+
identification_id: params.nid,
|
|
331
|
+
identification_id_type: IDENTIFICATION_TYPE.NAFATH,
|
|
332
|
+
country_code: settings.data.businessCountry.iso2
|
|
325
333
|
},
|
|
326
334
|
sign_in: false,
|
|
327
335
|
is_lead: true,
|
|
328
336
|
step_name: CONNECT_EXPRESS_STEP_NAMES.CREATE_AUTH_NID,
|
|
329
|
-
encryption_contract: [
|
|
330
|
-
'user_credentail.country_code',
|
|
331
|
-
'user_credentail.identification_id',
|
|
332
|
-
'user_credentail.identification_id_type',
|
|
333
|
-
'user_credentail.date_of_birth'
|
|
334
|
-
]
|
|
337
|
+
encryption_contract: ['user_credentail.country_code', 'user_credentail.identification_id', 'user_credentail.identification_id_type']
|
|
335
338
|
};
|
|
336
|
-
return [4, API.authService.
|
|
339
|
+
return [4, API.authService.createAuthKitNID(requestBody)];
|
|
337
340
|
case 1:
|
|
338
341
|
data = _d.sent();
|
|
339
342
|
thunkApi.dispatch(handleNextScreenStep());
|
|
340
|
-
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody
|
|
341
|
-
return [2, { response: data, formData: params }];
|
|
343
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
|
|
344
|
+
return [2, { response: data, formData: __assign(__assign({}, params), { type: IDENTIFICATION_TYPE.NAFATH }) }];
|
|
342
345
|
}
|
|
343
346
|
});
|
|
344
347
|
}); });
|
|
345
|
-
export var
|
|
346
|
-
var _a, settings, connectExpress,
|
|
347
|
-
|
|
348
|
-
|
|
348
|
+
export var verifyNafathAsync = createAsyncThunk('connectExpress/verifyNafathAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
349
|
+
var _a, settings, connectExpress, authData, _b, scope, redirectUrl, authConfigData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, expiry, interval, maxCalls, count, data, error_2, isSuccess, isFailed, authId, leadId, urlQueryStart, _c, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount, askDobInfo;
|
|
350
|
+
var _d, _e, _f, _g, _h, _j, _k, _l;
|
|
351
|
+
return __generator(this, function (_m) {
|
|
352
|
+
switch (_m.label) {
|
|
349
353
|
case 0:
|
|
350
354
|
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
date_of_birth: dob,
|
|
363
|
-
country_code: countryCode
|
|
364
|
-
},
|
|
365
|
-
sign_in: false,
|
|
366
|
-
is_lead: true,
|
|
367
|
-
step_name: CONNECT_EXPRESS_STEP_NAMES.CREATE_AUTH_NID,
|
|
368
|
-
encryption_contract: [
|
|
369
|
-
'user_credentail.country_code',
|
|
370
|
-
'user_credentail.identification_id',
|
|
371
|
-
'user_credentail.identification_id_type',
|
|
372
|
-
'user_credentail.date_of_birth'
|
|
373
|
-
]
|
|
374
|
-
};
|
|
375
|
-
return [4, API.authService.createExpressAuth(requestBody)];
|
|
355
|
+
authData = (connectExpress.data.responseData || {}).authData;
|
|
356
|
+
_b = settings.data.appConfig, scope = _b.scope, redirectUrl = _b.redirectUrl, authConfigData = _b.data;
|
|
357
|
+
isScopeAuthentication = scope === SCOPE_AUTH;
|
|
358
|
+
bi = settings.data.deviceInfo.browser.browser_id;
|
|
359
|
+
isDataHasIndividualOnly = (authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length) === 1 && authConfigData.includes('individual');
|
|
360
|
+
authDataHasValue = authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length;
|
|
361
|
+
expiry = (authData === null || authData === void 0 ? void 0 : authData.expiry) || 120;
|
|
362
|
+
interval = 3;
|
|
363
|
+
maxCalls = Math.floor(expiry / interval);
|
|
364
|
+
count = 1;
|
|
365
|
+
_m.label = 1;
|
|
376
366
|
case 1:
|
|
377
|
-
|
|
378
|
-
|
|
367
|
+
if (!(count <= maxCalls)) return [3, 12];
|
|
368
|
+
if (thunkApi.signal.aborted) {
|
|
369
|
+
return [3, 12];
|
|
370
|
+
}
|
|
371
|
+
data = undefined;
|
|
372
|
+
_m.label = 2;
|
|
373
|
+
case 2:
|
|
374
|
+
_m.trys.push([2, 4, , 5]);
|
|
375
|
+
return [4, API.authService.getVerifyExpressAuth(authData === null || authData === void 0 ? void 0 : authData.auth_token)];
|
|
376
|
+
case 3:
|
|
377
|
+
data = _m.sent();
|
|
378
|
+
return [3, 5];
|
|
379
|
+
case 4:
|
|
380
|
+
error_2 = _m.sent();
|
|
381
|
+
if (!isNetworkError(error_2.message)) {
|
|
382
|
+
throw new Error(error_2);
|
|
383
|
+
}
|
|
384
|
+
return [3, 5];
|
|
385
|
+
case 5:
|
|
386
|
+
isSuccess = ((_e = (_d = data.auth) === null || _d === void 0 ? void 0 : _d.status) === null || _e === void 0 ? void 0 : _e.toLowerCase()) === 'success';
|
|
387
|
+
isFailed = ((_g = (_f = data.auth) === null || _f === void 0 ? void 0 : _f.status) === null || _g === void 0 ? void 0 : _g.toLowerCase()) === 'failed';
|
|
388
|
+
if (isFailed) {
|
|
389
|
+
(_h = params.onFailure) === null || _h === void 0 ? void 0 : _h.call(params);
|
|
390
|
+
return [2, { data: data }];
|
|
391
|
+
}
|
|
392
|
+
if (!isSuccess) return [3, 9];
|
|
393
|
+
authId = (_j = data.auth) === null || _j === void 0 ? void 0 : _j.id;
|
|
394
|
+
leadId = (_k = data.auth) === null || _k === void 0 ? void 0 : _k.lead_id;
|
|
395
|
+
thunkApi.dispatch(storeAuthId(authId));
|
|
396
|
+
if (isScopeAuthentication && !data.new_user && isDataHasIndividualOnly && authId) {
|
|
397
|
+
if (settings.data.appConfig.mode === 'popup') {
|
|
398
|
+
settings.data.appConfig.onFlowCompleted({ auth_id: authId, bi: bi });
|
|
399
|
+
thunkApi.dispatch(handleOpen(false));
|
|
400
|
+
return [2, { data: data }];
|
|
401
|
+
}
|
|
402
|
+
if (redirectUrl) {
|
|
403
|
+
urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
404
|
+
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|
|
405
|
+
return [2, { data: data }];
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 7];
|
|
409
|
+
return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
|
|
410
|
+
case 6:
|
|
411
|
+
_c = _m.sent(), brandList = _c.brandList, entityList = _c.entityList;
|
|
412
|
+
if (brandList.length && entityList.length) {
|
|
413
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP')); });
|
|
414
|
+
return [2, { data: data }];
|
|
415
|
+
}
|
|
416
|
+
_m.label = 7;
|
|
417
|
+
case 7: return [4, thunkApi.dispatch(getLeadByIdAsync(leadId)).unwrap()];
|
|
418
|
+
case 8:
|
|
419
|
+
_m.sent();
|
|
420
|
+
stepName = data.step_name;
|
|
421
|
+
needToCollectMoreInfo = stepName === 'collect_info';
|
|
422
|
+
creatingAccount = stepName === 'create_account';
|
|
423
|
+
askDobInfo = stepName === COLLECT_DOB_INFO_NAFATH;
|
|
424
|
+
(_l = params.onSuccess) === null || _l === void 0 ? void 0 : _l.call(params);
|
|
425
|
+
if (askDobInfo) {
|
|
426
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP')); });
|
|
427
|
+
}
|
|
428
|
+
if (creatingAccount) {
|
|
429
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
|
|
430
|
+
}
|
|
431
|
+
if (needToCollectMoreInfo) {
|
|
432
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP')); });
|
|
433
|
+
}
|
|
434
|
+
return [2, { data: data, isNextScreenIsDob: askDobInfo }];
|
|
435
|
+
case 9: return [4, sleep(interval * 1000)];
|
|
436
|
+
case 10:
|
|
437
|
+
_m.sent();
|
|
438
|
+
_m.label = 11;
|
|
439
|
+
case 11:
|
|
440
|
+
count++;
|
|
441
|
+
return [3, 1];
|
|
442
|
+
case 12: throw new Error(NAFATH_VERIFICATION_FAILED);
|
|
379
443
|
}
|
|
380
444
|
});
|
|
381
445
|
}); });
|
|
@@ -412,7 +476,7 @@ export var createCivilIdAuthAsync = createAsyncThunk('connectExpress/createCivil
|
|
|
412
476
|
});
|
|
413
477
|
}); });
|
|
414
478
|
export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileOtpAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
415
|
-
var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, mobileData, _c, auth_token, device_token, service_name, _d, scope, redirectUrl, authData, isScopeAuthentication, bi, isDataHasIndividualOnly, payload, data, authId, urlQueryStart, _e, brandList, entityList, isKuwait, next;
|
|
479
|
+
var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, mobileData, _c, auth_token, device_token, service_name, _d, scope, redirectUrl, authData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, payload, data, authId, urlQueryStart, _e, brandList, entityList, isKuwait, next;
|
|
416
480
|
var _f, _g;
|
|
417
481
|
return __generator(this, function (_h) {
|
|
418
482
|
switch (_h.label) {
|
|
@@ -426,6 +490,7 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
|
|
|
426
490
|
isScopeAuthentication = scope === SCOPE_AUTH;
|
|
427
491
|
bi = settings.data.deviceInfo.browser.browser_id;
|
|
428
492
|
isDataHasIndividualOnly = (authData === null || authData === void 0 ? void 0 : authData.length) === 1 && authData.includes('individual');
|
|
493
|
+
authDataHasValue = authData === null || authData === void 0 ? void 0 : authData.length;
|
|
429
494
|
payload = {
|
|
430
495
|
auth_token: auth_token,
|
|
431
496
|
lead_id: leadId,
|
|
@@ -441,6 +506,11 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
|
|
|
441
506
|
return [4, API.authService.verifyExpressAuth(payload)];
|
|
442
507
|
case 1:
|
|
443
508
|
data = _h.sent();
|
|
509
|
+
sendCustomEventToGTM({
|
|
510
|
+
event: 'Send Event',
|
|
511
|
+
event_category: 'User Registration Flow',
|
|
512
|
+
event_action: 'First OTP Success'
|
|
513
|
+
});
|
|
444
514
|
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
|
|
445
515
|
authId = data.auth.id;
|
|
446
516
|
thunkApi.dispatch(storeAuthId(authId));
|
|
@@ -456,7 +526,7 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
|
|
|
456
526
|
return [2, data];
|
|
457
527
|
}
|
|
458
528
|
}
|
|
459
|
-
if (!(isScopeAuthentication && !data.new_user &&
|
|
529
|
+
if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 3];
|
|
460
530
|
return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
|
|
461
531
|
case 2:
|
|
462
532
|
_e = _h.sent(), brandList = _e.brandList, entityList = _e.entityList;
|
|
@@ -477,78 +547,8 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
|
|
|
477
547
|
}
|
|
478
548
|
});
|
|
479
549
|
}); });
|
|
480
|
-
export var verifyNIDOtpAsync = createAsyncThunk('connectExpress/verifyNIDOtpAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
481
|
-
var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, nidData, _c, auth_token, device_token, service_name, _d, scope, redirectUrl, authData, isScopeAuthentication, bi, isDataHasIndividualOnly, payload, data, authId, urlQueryStart, _e, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
|
|
482
|
-
var _f, _g;
|
|
483
|
-
return __generator(this, function (_h) {
|
|
484
|
-
switch (_h.label) {
|
|
485
|
-
case 0:
|
|
486
|
-
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
487
|
-
_b = connectExpress.data || {}, responseData = _b.responseData, leadId = _b.leadId, isLeadIdPassed = _b.isLeadIdPassed, nidData = _b.nidData;
|
|
488
|
-
if (!(responseData === null || responseData === void 0 ? void 0 : responseData.authData))
|
|
489
|
-
throw new Error('Auth data is missing');
|
|
490
|
-
_c = responseData.authData, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name;
|
|
491
|
-
_d = settings.data.appConfig, scope = _d.scope, redirectUrl = _d.redirectUrl, authData = _d.data;
|
|
492
|
-
isScopeAuthentication = scope === SCOPE_AUTH;
|
|
493
|
-
bi = settings.data.deviceInfo.browser.browser_id;
|
|
494
|
-
isDataHasIndividualOnly = (authData === null || authData === void 0 ? void 0 : authData.length) === 1 && authData.includes('individual');
|
|
495
|
-
payload = {
|
|
496
|
-
auth_token: auth_token,
|
|
497
|
-
lead_id: leadId,
|
|
498
|
-
data: params.otp,
|
|
499
|
-
auth_type: 2,
|
|
500
|
-
device_token: device_token,
|
|
501
|
-
service_name: service_name || 'ABSHER',
|
|
502
|
-
sign_in: false,
|
|
503
|
-
terms: isLeadIdPassed && nidData.termAndConditionChecked ? ['general'] : undefined,
|
|
504
|
-
step_name: CONNECT_EXPRESS_STEP_NAMES.VERIFY_AUTH_NID,
|
|
505
|
-
encryption_contract: ['data']
|
|
506
|
-
};
|
|
507
|
-
return [4, API.authService.verifyExpressAuth(payload)];
|
|
508
|
-
case 1:
|
|
509
|
-
data = _h.sent();
|
|
510
|
-
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
|
|
511
|
-
authId = data.auth.id;
|
|
512
|
-
thunkApi.dispatch(storeAuthId(authId));
|
|
513
|
-
if (isScopeAuthentication && !data.new_user && isDataHasIndividualOnly && authId) {
|
|
514
|
-
if (settings.data.appConfig.mode === 'popup') {
|
|
515
|
-
settings.data.appConfig.onFlowCompleted({ auth_id: authId, bi: bi });
|
|
516
|
-
thunkApi.dispatch(handleOpen(false));
|
|
517
|
-
return [2, data];
|
|
518
|
-
}
|
|
519
|
-
if (redirectUrl) {
|
|
520
|
-
urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
521
|
-
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|
|
522
|
-
return [2, data];
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
if (!(isScopeAuthentication && !data.new_user && !isDataHasIndividualOnly)) return [3, 3];
|
|
526
|
-
return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
|
|
527
|
-
case 2:
|
|
528
|
-
_e = _h.sent(), brandList = _e.brandList, entityList = _e.entityList;
|
|
529
|
-
if (brandList.length && entityList.length) {
|
|
530
|
-
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP')); });
|
|
531
|
-
return [2, data];
|
|
532
|
-
}
|
|
533
|
-
_h.label = 3;
|
|
534
|
-
case 3: return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead.id)).unwrap()];
|
|
535
|
-
case 4:
|
|
536
|
-
_h.sent();
|
|
537
|
-
stepName = data.step_name;
|
|
538
|
-
needToCollectMoreInfo = stepName === 'collect_info';
|
|
539
|
-
creatingAccount = stepName === 'create_account';
|
|
540
|
-
if (creatingAccount) {
|
|
541
|
-
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
|
|
542
|
-
}
|
|
543
|
-
if (needToCollectMoreInfo) {
|
|
544
|
-
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP')); });
|
|
545
|
-
}
|
|
546
|
-
return [2, data];
|
|
547
|
-
}
|
|
548
|
-
});
|
|
549
|
-
}); });
|
|
550
550
|
export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
551
|
-
var _a, settings, connectExpress, authData, _b, scope, redirectUrl, authConfigData, isScopeAuthentication, bi, isDataHasIndividualOnly, expiry, interval, maxCalls, count, data, isSuccess, authId, urlQueryStart, _c, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
|
|
551
|
+
var _a, settings, connectExpress, authData, _b, scope, redirectUrl, authConfigData, isScopeAuthentication, bi, isDataHasIndividualOnly, authDataHasValue, expiry, interval, maxCalls, count, data, error_3, isSuccess, authId, urlQueryStart, _c, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
|
|
552
552
|
var _d, _e, _f;
|
|
553
553
|
return __generator(this, function (_g) {
|
|
554
554
|
switch (_g.label) {
|
|
@@ -558,22 +558,35 @@ export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync',
|
|
|
558
558
|
_b = settings.data.appConfig, scope = _b.scope, redirectUrl = _b.redirectUrl, authConfigData = _b.data;
|
|
559
559
|
isScopeAuthentication = scope === SCOPE_AUTH;
|
|
560
560
|
bi = settings.data.deviceInfo.browser.browser_id;
|
|
561
|
-
isDataHasIndividualOnly = (authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length) === 1 &&
|
|
561
|
+
isDataHasIndividualOnly = (authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length) === 1 && authConfigData.includes('individual');
|
|
562
|
+
authDataHasValue = authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length;
|
|
562
563
|
expiry = (authData === null || authData === void 0 ? void 0 : authData.expiry) || 120;
|
|
563
564
|
interval = 3;
|
|
564
565
|
maxCalls = Math.floor(expiry / interval);
|
|
565
566
|
count = 1;
|
|
566
567
|
_g.label = 1;
|
|
567
568
|
case 1:
|
|
568
|
-
if (!(count <= maxCalls)) return [3,
|
|
569
|
+
if (!(count <= maxCalls)) return [3, 12];
|
|
569
570
|
if (thunkApi.signal.aborted) {
|
|
570
|
-
return [3,
|
|
571
|
+
return [3, 12];
|
|
571
572
|
}
|
|
572
|
-
|
|
573
|
+
data = undefined;
|
|
574
|
+
_g.label = 2;
|
|
573
575
|
case 2:
|
|
576
|
+
_g.trys.push([2, 4, , 5]);
|
|
577
|
+
return [4, API.authService.getVerifyExpressAuth(authData === null || authData === void 0 ? void 0 : authData.auth_token)];
|
|
578
|
+
case 3:
|
|
574
579
|
data = _g.sent();
|
|
580
|
+
return [3, 5];
|
|
581
|
+
case 4:
|
|
582
|
+
error_3 = _g.sent();
|
|
583
|
+
if (!isNetworkError(error_3.message)) {
|
|
584
|
+
throw new Error(error_3);
|
|
585
|
+
}
|
|
586
|
+
return [3, 5];
|
|
587
|
+
case 5:
|
|
575
588
|
isSuccess = ((_e = (_d = data.auth) === null || _d === void 0 ? void 0 : _d.status) === null || _e === void 0 ? void 0 : _e.toLowerCase()) === 'success';
|
|
576
|
-
if (!isSuccess) return [3,
|
|
589
|
+
if (!isSuccess) return [3, 9];
|
|
577
590
|
authId = data.auth.id;
|
|
578
591
|
thunkApi.dispatch(storeAuthId(authId));
|
|
579
592
|
if (isScopeAuthentication && !data.new_user && isDataHasIndividualOnly && authId) {
|
|
@@ -588,17 +601,17 @@ export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync',
|
|
|
588
601
|
return [2, data];
|
|
589
602
|
}
|
|
590
603
|
}
|
|
591
|
-
if (!(isScopeAuthentication && !data.new_user &&
|
|
604
|
+
if (!(isScopeAuthentication && !data.new_user && authDataHasValue)) return [3, 7];
|
|
592
605
|
return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
|
|
593
|
-
case
|
|
606
|
+
case 6:
|
|
594
607
|
_c = _g.sent(), brandList = _c.brandList, entityList = _c.entityList;
|
|
595
608
|
if (brandList.length && entityList.length) {
|
|
596
609
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP')); });
|
|
597
610
|
return [2, data];
|
|
598
611
|
}
|
|
599
|
-
_g.label =
|
|
600
|
-
case
|
|
601
|
-
case
|
|
612
|
+
_g.label = 7;
|
|
613
|
+
case 7: return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead.id)).unwrap()];
|
|
614
|
+
case 8:
|
|
602
615
|
_g.sent();
|
|
603
616
|
stepName = data.step_name;
|
|
604
617
|
needToCollectMoreInfo = stepName === 'collect_info';
|
|
@@ -611,14 +624,14 @@ export var verifyPACIAsync = createAsyncThunk('connectExpress/verifyPACIAsync',
|
|
|
611
624
|
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP')); });
|
|
612
625
|
}
|
|
613
626
|
return [2, data];
|
|
614
|
-
case
|
|
615
|
-
case
|
|
627
|
+
case 9: return [4, sleep(interval * 1000)];
|
|
628
|
+
case 10:
|
|
616
629
|
_g.sent();
|
|
617
|
-
_g.label =
|
|
618
|
-
case
|
|
630
|
+
_g.label = 11;
|
|
631
|
+
case 11:
|
|
619
632
|
count++;
|
|
620
633
|
return [3, 1];
|
|
621
|
-
case
|
|
634
|
+
case 12: throw new Error('paci_verification_failed');
|
|
622
635
|
}
|
|
623
636
|
});
|
|
624
637
|
}); });
|
|
@@ -650,28 +663,29 @@ export var createCivilIDAuthIdentityAsync = createAsyncThunk('connectExpress/cre
|
|
|
650
663
|
}
|
|
651
664
|
});
|
|
652
665
|
}); });
|
|
653
|
-
export var
|
|
654
|
-
var _a, settings, connectExpress,
|
|
666
|
+
export var createNIDNafathAuthIdentityAsync = createAsyncThunk('connectExpress/createNIDNafathAuthIdentityAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
667
|
+
var _a, settings, connectExpress, nid, dob, nidType, countryCode, authData, requestBody, data;
|
|
655
668
|
var _b, _c, _d;
|
|
656
669
|
return __generator(this, function (_e) {
|
|
657
670
|
switch (_e.label) {
|
|
658
671
|
case 0:
|
|
659
672
|
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
660
|
-
|
|
661
|
-
nidType =
|
|
673
|
+
nid = params.nid, dob = params.dob;
|
|
674
|
+
nidType = IDENTIFICATION_TYPE.NAFATH;
|
|
662
675
|
countryCode = settings.data.businessCountry.iso2;
|
|
663
676
|
if (isOtherThanKWOrSA(countryCode)) {
|
|
664
677
|
nidType = IDENTIFICATION_TYPE.NID;
|
|
665
678
|
}
|
|
679
|
+
authData = (_b = connectExpress.data.responseData) === null || _b === void 0 ? void 0 : _b.authData;
|
|
666
680
|
requestBody = {
|
|
667
|
-
id:
|
|
681
|
+
id: authData === null || authData === void 0 ? void 0 : authData.lead_id,
|
|
668
682
|
identification: {
|
|
669
683
|
id: nid,
|
|
670
684
|
issued_country_code: countryCode,
|
|
671
685
|
type: nidType
|
|
672
686
|
},
|
|
687
|
+
date_of_birth: nidType === IDENTIFICATION_TYPE.NAFATH ? undefined : dob,
|
|
673
688
|
country_code: countryCode,
|
|
674
|
-
date_of_birth: dob,
|
|
675
689
|
step_name: CONNECT_EXPRESS_STEP_NAMES.IDENTITY_AUTH,
|
|
676
690
|
encryption_contract: ['identification.issued_country_code', 'identification.id', 'identification.type', 'date_of_birth']
|
|
677
691
|
};
|
|
@@ -679,7 +693,7 @@ export var createNIDAuthIdentityAsync = createAsyncThunk('connectExpress/createN
|
|
|
679
693
|
case 1:
|
|
680
694
|
data = _e.sent();
|
|
681
695
|
if (!((data === null || data === void 0 ? void 0 : data.verify_token) !== 'null')) return [3, 2];
|
|
682
|
-
thunkApi.dispatch(handleNextScreenStep('
|
|
696
|
+
thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_IDENTITY_VERIFY_NAFATH_STEP'));
|
|
683
697
|
return [3, 4];
|
|
684
698
|
case 2:
|
|
685
699
|
if (!isOtherThanKWOrSA(countryCode)) return [3, 4];
|
|
@@ -689,84 +703,85 @@ export var createNIDAuthIdentityAsync = createAsyncThunk('connectExpress/createN
|
|
|
689
703
|
thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP'));
|
|
690
704
|
_e.label = 4;
|
|
691
705
|
case 4:
|
|
692
|
-
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody
|
|
693
|
-
return [2, { response: { verify_token: data.verify_token }, formData: params }];
|
|
706
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody);
|
|
707
|
+
return [2, { response: { random: data.random, expiry: data.expiry, verify_token: data.verify_token }, formData: params }];
|
|
694
708
|
}
|
|
695
709
|
});
|
|
696
710
|
}); });
|
|
697
|
-
export var
|
|
698
|
-
var
|
|
699
|
-
var _b;
|
|
700
|
-
return __generator(this, function (
|
|
701
|
-
switch (
|
|
702
|
-
case 0:
|
|
703
|
-
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
704
|
-
dob = params.dob, nid = params.nid;
|
|
705
|
-
nidType = nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
|
|
706
|
-
countryCode = settings.data.businessCountry.iso2;
|
|
707
|
-
if (isOtherThanKWOrSA(countryCode)) {
|
|
708
|
-
nidType = IDENTIFICATION_TYPE.NID;
|
|
709
|
-
}
|
|
710
|
-
requestBody = {
|
|
711
|
-
id: (_b = connectExpress.data.responseData) === null || _b === void 0 ? void 0 : _b.authData.lead_id,
|
|
712
|
-
identification: {
|
|
713
|
-
id: nid,
|
|
714
|
-
issued_country_code: countryCode,
|
|
715
|
-
type: nidType
|
|
716
|
-
},
|
|
717
|
-
country_code: countryCode,
|
|
718
|
-
date_of_birth: dob,
|
|
719
|
-
step_name: CONNECT_EXPRESS_STEP_NAMES.IDENTITY_AUTH,
|
|
720
|
-
encryption_contract: ['identification.issued_country_code', 'identification.id', 'identification.type', 'date_of_birth']
|
|
721
|
-
};
|
|
722
|
-
return [4, API.leadService.updateLead(requestBody)];
|
|
723
|
-
case 1:
|
|
724
|
-
data = _c.sent();
|
|
725
|
-
return [2, { response: { verify_token: data.verify_token }, formData: params }];
|
|
726
|
-
}
|
|
727
|
-
});
|
|
728
|
-
}); });
|
|
729
|
-
export var verifyNIDOtpLeadIdentityAsync = createAsyncThunk('connectExpress/verifyNIDOtpLeadIdentityAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
730
|
-
var _a, settings, connectExpress, _b, responseData, leadId, verify_token, payload, data, needToCollectMoreInfo, creatingAccount;
|
|
731
|
-
var _c, _d;
|
|
732
|
-
return __generator(this, function (_e) {
|
|
733
|
-
switch (_e.label) {
|
|
711
|
+
export var verifyNafathIdentityAsync = createAsyncThunk('connectExpress/verifyNafathIdentityAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
712
|
+
var connectExpress, authData, expiry, interval, maxCalls, count, data, error_4, isSuccess, isFailed, needToCollectMoreInfo, creatingAccount, askDobInfo, collectPhoneOwnershipScreen;
|
|
713
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
714
|
+
return __generator(this, function (_h) {
|
|
715
|
+
switch (_h.label) {
|
|
734
716
|
case 0:
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
lead_id: leadId,
|
|
743
|
-
data: params.otp,
|
|
744
|
-
service_name: 'absher',
|
|
745
|
-
sign_in: false,
|
|
746
|
-
step_name: CONNECT_EXPRESS_STEP_NAMES.VERIFY_IDENTITY_AUTH,
|
|
747
|
-
encryption_contract: ['data']
|
|
748
|
-
};
|
|
749
|
-
return [4, API.authService.verifyExpressLeadIdentity(payload)];
|
|
717
|
+
connectExpress = thunkApi.getState().connectExpress;
|
|
718
|
+
authData = (connectExpress.data.responseData || {}).authData;
|
|
719
|
+
expiry = (authData === null || authData === void 0 ? void 0 : authData.expiry) || 120;
|
|
720
|
+
interval = 3;
|
|
721
|
+
maxCalls = Math.floor(expiry / interval);
|
|
722
|
+
count = 1;
|
|
723
|
+
_h.label = 1;
|
|
750
724
|
case 1:
|
|
751
|
-
|
|
752
|
-
|
|
725
|
+
if (!(count <= maxCalls)) return [3, 10];
|
|
726
|
+
if (thunkApi.signal.aborted) {
|
|
727
|
+
return [3, 10];
|
|
728
|
+
}
|
|
729
|
+
data = undefined;
|
|
730
|
+
_h.label = 2;
|
|
753
731
|
case 2:
|
|
754
|
-
|
|
755
|
-
|
|
732
|
+
_h.trys.push([2, 4, , 5]);
|
|
733
|
+
return [4, API.authService.getExpressTokenVerify({ token: authData === null || authData === void 0 ? void 0 : authData.verify_token, leadId: authData === null || authData === void 0 ? void 0 : authData.lead_id })];
|
|
734
|
+
case 3:
|
|
735
|
+
data = _h.sent();
|
|
736
|
+
return [3, 5];
|
|
737
|
+
case 4:
|
|
738
|
+
error_4 = _h.sent();
|
|
739
|
+
if (!isNetworkError(error_4.message)) {
|
|
740
|
+
throw new Error(error_4);
|
|
741
|
+
}
|
|
742
|
+
return [3, 5];
|
|
743
|
+
case 5:
|
|
744
|
+
isSuccess = ((_b = (_a = data.auth) === null || _a === void 0 ? void 0 : _a.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
745
|
+
isFailed = ((_d = (_c = data.auth) === null || _c === void 0 ? void 0 : _c.status) === null || _d === void 0 ? void 0 : _d.toLowerCase()) === 'failed';
|
|
746
|
+
if (isFailed) {
|
|
747
|
+
(_e = params.onFailure) === null || _e === void 0 ? void 0 : _e.call(params);
|
|
748
|
+
return [2, { data: data }];
|
|
749
|
+
}
|
|
750
|
+
if (!isSuccess) return [3, 7];
|
|
751
|
+
return [4, thunkApi.dispatch(getLeadByIdAsync((_f = data.auth) === null || _f === void 0 ? void 0 : _f.lead_id)).unwrap()];
|
|
752
|
+
case 6:
|
|
753
|
+
_h.sent();
|
|
756
754
|
needToCollectMoreInfo = data.step_name === 'collect_info';
|
|
757
755
|
creatingAccount = data.step_name === 'create_account';
|
|
756
|
+
askDobInfo = data.step_name === COLLECT_DOB_INFO_NAFATH;
|
|
757
|
+
collectPhoneOwnershipScreen = data.step_name === CONNECT_EXPRESS_STEP_NAMES.COLLECT_MOBILE_OWNERSHIP;
|
|
758
|
+
(_g = params.onSuccess) === null || _g === void 0 ? void 0 : _g.call(params);
|
|
759
|
+
if (collectPhoneOwnershipScreen) {
|
|
760
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('COLLECT_MOBILE_OWNERSHIP')); });
|
|
761
|
+
}
|
|
762
|
+
if (askDobInfo) {
|
|
763
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP')); });
|
|
764
|
+
}
|
|
758
765
|
if (creatingAccount) {
|
|
759
766
|
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
|
|
760
767
|
}
|
|
761
768
|
if (needToCollectMoreInfo) {
|
|
762
769
|
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP')); });
|
|
763
770
|
}
|
|
764
|
-
return [2, data];
|
|
771
|
+
return [2, { data: data, isNextScreenIsDob: askDobInfo }];
|
|
772
|
+
case 7: return [4, sleep(interval * 1000)];
|
|
773
|
+
case 8:
|
|
774
|
+
_h.sent();
|
|
775
|
+
_h.label = 9;
|
|
776
|
+
case 9:
|
|
777
|
+
count++;
|
|
778
|
+
return [3, 1];
|
|
779
|
+
case 10: throw new Error(NAFATH_VERIFICATION_FAILED);
|
|
765
780
|
}
|
|
766
781
|
});
|
|
767
782
|
}); });
|
|
768
|
-
export var verifyPaciLeadIdentityAsync = createAsyncThunk('connectExpress/
|
|
769
|
-
var connectExpress, authData, expiry, interval, maxCalls, count, data, isSuccess, needToCollectMoreInfo, creatingAccount;
|
|
783
|
+
export var verifyPaciLeadIdentityAsync = createAsyncThunk('connectExpress/verifyPaciLeadIdentityAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
784
|
+
var connectExpress, authData, expiry, interval, maxCalls, count, data, error_5, isSuccess, needToCollectMoreInfo, creatingAccount;
|
|
770
785
|
var _a, _b, _c;
|
|
771
786
|
return __generator(this, function (_d) {
|
|
772
787
|
switch (_d.label) {
|
|
@@ -779,17 +794,29 @@ export var verifyPaciLeadIdentityAsync = createAsyncThunk('connectExpress/verify
|
|
|
779
794
|
count = 1;
|
|
780
795
|
_d.label = 1;
|
|
781
796
|
case 1:
|
|
782
|
-
if (!(count <= maxCalls)) return [3,
|
|
797
|
+
if (!(count <= maxCalls)) return [3, 10];
|
|
783
798
|
if (thunkApi.signal.aborted) {
|
|
784
|
-
return [3,
|
|
799
|
+
return [3, 10];
|
|
785
800
|
}
|
|
786
|
-
|
|
801
|
+
data = undefined;
|
|
802
|
+
_d.label = 2;
|
|
787
803
|
case 2:
|
|
804
|
+
_d.trys.push([2, 4, , 5]);
|
|
805
|
+
return [4, API.authService.getExpressTokenVerify({ token: authData === null || authData === void 0 ? void 0 : authData.verify_token, leadId: authData === null || authData === void 0 ? void 0 : authData.lead_id })];
|
|
806
|
+
case 3:
|
|
788
807
|
data = _d.sent();
|
|
808
|
+
return [3, 5];
|
|
809
|
+
case 4:
|
|
810
|
+
error_5 = _d.sent();
|
|
811
|
+
if (!isNetworkError(error_5.message)) {
|
|
812
|
+
throw new Error(error_5);
|
|
813
|
+
}
|
|
814
|
+
return [3, 5];
|
|
815
|
+
case 5:
|
|
789
816
|
isSuccess = ((_b = (_a = data.auth) === null || _a === void 0 ? void 0 : _a.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
|
|
790
|
-
if (!isSuccess) return [3,
|
|
817
|
+
if (!isSuccess) return [3, 7];
|
|
791
818
|
return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead.id)).unwrap()];
|
|
792
|
-
case
|
|
819
|
+
case 6:
|
|
793
820
|
_d.sent();
|
|
794
821
|
needToCollectMoreInfo = data.step_name === 'collect_info';
|
|
795
822
|
creatingAccount = data.step_name === 'create_account';
|
|
@@ -801,14 +828,14 @@ export var verifyPaciLeadIdentityAsync = createAsyncThunk('connectExpress/verify
|
|
|
801
828
|
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP')); });
|
|
802
829
|
}
|
|
803
830
|
return [2, data];
|
|
804
|
-
case
|
|
805
|
-
case
|
|
831
|
+
case 7: return [4, sleep(interval * 1000)];
|
|
832
|
+
case 8:
|
|
806
833
|
_d.sent();
|
|
807
|
-
_d.label =
|
|
808
|
-
case
|
|
834
|
+
_d.label = 9;
|
|
835
|
+
case 9:
|
|
809
836
|
count++;
|
|
810
837
|
return [3, 1];
|
|
811
|
-
case
|
|
838
|
+
case 10: throw new Error('nafath_verification_failed');
|
|
812
839
|
}
|
|
813
840
|
});
|
|
814
841
|
}); });
|
|
@@ -862,53 +889,113 @@ export var checkBrandNameAvailabilityAsync = createAsyncThunk('connectExpress/ch
|
|
|
862
889
|
});
|
|
863
890
|
});
|
|
864
891
|
});
|
|
865
|
-
export var createAccountAsync = createAsyncThunk('connectExpress/createAccountAsync', function (
|
|
866
|
-
var
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
892
|
+
export var createAccountAsync = createAsyncThunk('connectExpress/createAccountAsync', function (_a, thunkApi) {
|
|
893
|
+
var isRetry = _a.isRetry;
|
|
894
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
895
|
+
var _b, connectExpress, settings, responseData, _c, postURL, scope, redirectUrl, mode, showBoard, notification, platforms, payment_provider, leadId, authId, bi, leadData, accountData, data, body, data, urlQueryStart;
|
|
896
|
+
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
897
|
+
return __generator(this, function (_v) {
|
|
898
|
+
switch (_v.label) {
|
|
899
|
+
case 0:
|
|
900
|
+
_b = thunkApi.getState(), connectExpress = _b.connectExpress, settings = _b.settings;
|
|
901
|
+
responseData = connectExpress.data.responseData;
|
|
902
|
+
_c = settings.data.appConfig, postURL = _c.postURL, scope = _c.scope, redirectUrl = _c.redirectUrl, mode = _c.mode, showBoard = _c.showBoard, notification = _c.notification;
|
|
903
|
+
platforms = (_e = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.leadData) === null || _d === void 0 ? void 0 : _d.platforms) !== null && _e !== void 0 ? _e : settings.data.appConfig.platforms;
|
|
904
|
+
payment_provider = (_g = (_f = responseData === null || responseData === void 0 ? void 0 : responseData.leadData) === null || _f === void 0 ? void 0 : _f.payment_provider) !== null && _g !== void 0 ? _g : settings.data.appConfig.paymentProvider;
|
|
905
|
+
leadId = (_h = responseData === null || responseData === void 0 ? void 0 : responseData.leadData) === null || _h === void 0 ? void 0 : _h.id;
|
|
906
|
+
authId = (_k = (_j = responseData === null || responseData === void 0 ? void 0 : responseData.authData) === null || _j === void 0 ? void 0 : _j.auth) === null || _k === void 0 ? void 0 : _k.id;
|
|
907
|
+
bi = settings.data.deviceInfo.browser.browser_id;
|
|
908
|
+
accountData = undefined;
|
|
909
|
+
if (!isRetry) return [3, 2];
|
|
910
|
+
return [4, thunkApi.dispatch(getLeadByIdAsync(leadId)).unwrap()];
|
|
911
|
+
case 1:
|
|
912
|
+
data = (_v.sent()).data;
|
|
913
|
+
if (data === null || data === void 0 ? void 0 : data.board_id) {
|
|
914
|
+
leadData = data;
|
|
915
|
+
accountData = data;
|
|
916
|
+
}
|
|
917
|
+
_v.label = 2;
|
|
918
|
+
case 2:
|
|
919
|
+
body = {
|
|
920
|
+
lead_id: leadId,
|
|
921
|
+
post_url: scope === SCOPE_AUTH ? '' : postURL || '',
|
|
922
|
+
platforms: platforms,
|
|
923
|
+
payment_provider: payment_provider,
|
|
924
|
+
notification: notification
|
|
925
|
+
};
|
|
926
|
+
if (!!(leadData === null || leadData === void 0 ? void 0 : leadData.board_id)) return [3, 4];
|
|
927
|
+
return [4, API.accountService.expressCreateAccount(body)];
|
|
928
|
+
case 3:
|
|
929
|
+
accountData = _v.sent();
|
|
930
|
+
_v.label = 4;
|
|
931
|
+
case 4:
|
|
932
|
+
sendCustomEventToGTM({
|
|
933
|
+
event: 'Send Event',
|
|
934
|
+
event_category: 'User Registration Flow',
|
|
935
|
+
event_action: 'Registration Completed',
|
|
936
|
+
event_label: 'Product Type',
|
|
937
|
+
event_value: leadId
|
|
938
|
+
});
|
|
939
|
+
sendCustomDimension({
|
|
940
|
+
event: 'PageView',
|
|
941
|
+
lead_ID: leadId
|
|
942
|
+
});
|
|
943
|
+
(_m = (_l = settings.data.appConfig).onCreated) === null || _m === void 0 ? void 0 : _m.call(_l, accountData);
|
|
944
|
+
(_p = (_o = settings.data.appConfig).onFlowCompleted) === null || _p === void 0 ? void 0 : _p.call(_o, accountData);
|
|
945
|
+
(_r = (_q = settings.data.appConfig).onStepCompleted) === null || _r === void 0 ? void 0 : _r.call(_q, settings.data.activeScreen.name, accountData);
|
|
946
|
+
if (showBoard) {
|
|
947
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
948
|
+
return [2, { accountData: accountData }];
|
|
949
|
+
}
|
|
950
|
+
if (!(scope === SCOPE_AUTH)) return [3, 8];
|
|
951
|
+
if (!!(leadData === null || leadData === void 0 ? void 0 : leadData.board_id)) return [3, 6];
|
|
952
|
+
return [4, thunkApi.dispatch(getLeadByIdAsync(leadId)).unwrap()];
|
|
953
|
+
case 5:
|
|
954
|
+
data = (_v.sent()).data;
|
|
955
|
+
leadData = data;
|
|
956
|
+
_v.label = 6;
|
|
957
|
+
case 6: return [4, thunkApi.dispatch(onCloseComplete({ merchantId: (_s = leadData === null || leadData === void 0 ? void 0 : leadData.merchant) === null || _s === void 0 ? void 0 : _s.id, brandId: (_t = leadData === null || leadData === void 0 ? void 0 : leadData.brand) === null || _t === void 0 ? void 0 : _t.id, entityId: (_u = leadData === null || leadData === void 0 ? void 0 : leadData.entity) === null || _u === void 0 ? void 0 : _u.id }))];
|
|
958
|
+
case 7:
|
|
959
|
+
_v.sent();
|
|
960
|
+
return [2, { accountData: accountData }];
|
|
961
|
+
case 8:
|
|
962
|
+
if (redirectUrl && mode === 'page') {
|
|
963
|
+
urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
964
|
+
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|
|
965
|
+
return [2, { accountData: accountData }];
|
|
966
|
+
}
|
|
967
|
+
thunkApi.dispatch(handleOpen(false));
|
|
968
|
+
return [2];
|
|
969
|
+
}
|
|
970
|
+
});
|
|
971
|
+
});
|
|
972
|
+
});
|
|
973
|
+
export var retrieveDetailsAfterCreateAccountAsync = createAsyncThunk('connectExpress/retrieveDetailsAfterCreateAccountAsync', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
974
|
+
var connectExpress, _a, accountData, leadData, leadResData, data, board_id, board_info_id, _b, boardInfo, boardData;
|
|
975
|
+
var _c, _d;
|
|
976
|
+
return __generator(this, function (_e) {
|
|
977
|
+
switch (_e.label) {
|
|
870
978
|
case 0:
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
authId = (_k = (_j = responseData === null || responseData === void 0 ? void 0 : responseData.authData) === null || _j === void 0 ? void 0 : _j.auth) === null || _k === void 0 ? void 0 : _k.id;
|
|
877
|
-
bi = settings.data.deviceInfo.browser.browser_id;
|
|
878
|
-
body = {
|
|
879
|
-
lead_id: responseData === null || responseData === void 0 ? void 0 : responseData.leadData.id,
|
|
880
|
-
post_url: scope === SCOPE_AUTH ? '' : postURL || '',
|
|
881
|
-
platforms: platforms,
|
|
882
|
-
payment_provider: payment_provider
|
|
883
|
-
};
|
|
884
|
-
return [4, API.accountService.expressCreateAccount(body)];
|
|
979
|
+
connectExpress = thunkApi.getState().connectExpress;
|
|
980
|
+
_a = connectExpress.data.responseData || {}, accountData = _a.accountData, leadData = _a.leadData;
|
|
981
|
+
leadResData = undefined;
|
|
982
|
+
if (!!(leadData === null || leadData === void 0 ? void 0 : leadData.board_id)) return [3, 2];
|
|
983
|
+
return [4, thunkApi.dispatch(getLeadByIdAsync(leadData === null || leadData === void 0 ? void 0 : leadData.id)).unwrap()];
|
|
885
984
|
case 1:
|
|
886
|
-
data =
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
(_r = (_q = settings.data.appConfig).onStepCompleted) === null || _r === void 0 ? void 0 : _r.call(_q, settings.data.activeScreen.name, data);
|
|
890
|
-
if (!showBoard) return [3, 4];
|
|
891
|
-
return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead.id)).unwrap()];
|
|
985
|
+
data = (_e.sent()).data;
|
|
986
|
+
leadResData = data;
|
|
987
|
+
_e.label = 2;
|
|
892
988
|
case 2:
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
board_info_id = (_t = data.board_info_id) !== null && _t !== void 0 ? _t : leadData.board_info_id;
|
|
989
|
+
board_id = (_c = accountData === null || accountData === void 0 ? void 0 : accountData.board_id) !== null && _c !== void 0 ? _c : leadResData === null || leadResData === void 0 ? void 0 : leadResData.board_id;
|
|
990
|
+
board_info_id = (_d = accountData === null || accountData === void 0 ? void 0 : accountData.board_info_id) !== null && _d !== void 0 ? _d : leadResData === null || leadResData === void 0 ? void 0 : leadResData.board_info_id;
|
|
896
991
|
return [4, Promise.all([
|
|
897
992
|
API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
|
|
898
993
|
API.boardService.retrieveBoardDetails(board_id)
|
|
899
994
|
])];
|
|
900
995
|
case 3:
|
|
901
|
-
|
|
996
|
+
_b = _e.sent(), boardInfo = _b[0], boardData = _b[1];
|
|
902
997
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
|
|
903
|
-
return [2, { boardInfo: boardInfo, boardData: boardData
|
|
904
|
-
case 4:
|
|
905
|
-
if (redirectUrl && mode === 'page') {
|
|
906
|
-
urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
907
|
-
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|
|
908
|
-
return [2, { account: data }];
|
|
909
|
-
}
|
|
910
|
-
thunkApi.dispatch(handleOpen(false));
|
|
911
|
-
return [2];
|
|
998
|
+
return [2, { boardInfo: boardInfo, boardData: boardData }];
|
|
912
999
|
}
|
|
913
1000
|
});
|
|
914
1001
|
}); });
|
|
@@ -941,10 +1028,41 @@ export var createEntity = createAsyncThunk('connectExpress/createEntity', functi
|
|
|
941
1028
|
}
|
|
942
1029
|
});
|
|
943
1030
|
}); });
|
|
1031
|
+
export var updateLeadDOBAsync = createAsyncThunk('connectExpress/updateLeadDOBAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1032
|
+
var _a, settings, connectExpress, id, dob, payload, data, needToCollectMoreInfo, creatingAccount;
|
|
1033
|
+
var _b, _c, _d;
|
|
1034
|
+
return __generator(this, function (_e) {
|
|
1035
|
+
switch (_e.label) {
|
|
1036
|
+
case 0:
|
|
1037
|
+
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
1038
|
+
id = (((_b = connectExpress.data.responseData) === null || _b === void 0 ? void 0 : _b.leadData) || {}).id;
|
|
1039
|
+
dob = params.dob;
|
|
1040
|
+
payload = {
|
|
1041
|
+
id: id || '',
|
|
1042
|
+
date_of_birth: dob,
|
|
1043
|
+
step_name: CONNECT_EXPRESS_STEP_NAMES.UPDATE_LEAD_DOB,
|
|
1044
|
+
encryption_contract: ['date_of_birth']
|
|
1045
|
+
};
|
|
1046
|
+
return [4, API.leadService.updateLeadExpress(payload)];
|
|
1047
|
+
case 1:
|
|
1048
|
+
data = _e.sent();
|
|
1049
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
|
|
1050
|
+
needToCollectMoreInfo = data.step_name === 'collect_info';
|
|
1051
|
+
creatingAccount = data.step_name === 'create_account';
|
|
1052
|
+
if (creatingAccount) {
|
|
1053
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
|
|
1054
|
+
}
|
|
1055
|
+
if (needToCollectMoreInfo) {
|
|
1056
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP')); });
|
|
1057
|
+
}
|
|
1058
|
+
return [2, { response: data, formData: params }];
|
|
1059
|
+
}
|
|
1060
|
+
});
|
|
1061
|
+
}); });
|
|
944
1062
|
export var updateLeadIndividualAsync = createAsyncThunk('connectExpress/updateLeadIndividualAsync', function (_a, thunkApi) {
|
|
945
1063
|
var formData = _a.formData, originalFormData = _a.originalFormData;
|
|
946
1064
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
947
|
-
var _b, settings, connectExpress, id, countryCode, name, email, mobile, phoneCountry, isContactAvailable, payload, data, needToCollectMoreInfo, creatingAccount, isSaudi;
|
|
1065
|
+
var _b, settings, connectExpress, id, countryCode, name, email, mobile, phoneCountry, isContactAvailable, payload, data, needToCollectMoreInfo, creatingAccount, collectPhoneOwnershipScreen, isSaudi;
|
|
948
1066
|
var _c, _d, _e, _f, _g;
|
|
949
1067
|
return __generator(this, function (_h) {
|
|
950
1068
|
switch (_h.label) {
|
|
@@ -956,13 +1074,17 @@ export var updateLeadIndividualAsync = createAsyncThunk('connectExpress/updateLe
|
|
|
956
1074
|
isContactAvailable = email || mobile;
|
|
957
1075
|
payload = __assign(__assign({ id: id || '', country_code: (_e = settings.data.businessCountry) === null || _e === void 0 ? void 0 : _e.iso2, name: getIndividualName(name) }, (isContactAvailable && {
|
|
958
1076
|
contact: __assign({ email: email }, (mobile && { phone: { country_code: phoneCountry, number: mobile } }))
|
|
959
|
-
})), { step_name: CONNECT_EXPRESS_STEP_NAMES.UPDATE_LEAD_INDIVIDUAL, encryption_contract: ['name.first', 'name.middle', 'name.last', 'contact.email', 'contact.phone.country_code', 'contact.phone.number'] });
|
|
1077
|
+
})), { metadata: getMetaData(), step_name: CONNECT_EXPRESS_STEP_NAMES.UPDATE_LEAD_INDIVIDUAL, encryption_contract: ['name.first', 'name.middle', 'name.last', 'contact.email', 'contact.phone.country_code', 'contact.phone.number'] });
|
|
960
1078
|
return [4, API.leadService.updateLeadExpress(payload)];
|
|
961
1079
|
case 1:
|
|
962
1080
|
data = _h.sent();
|
|
963
1081
|
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, formData);
|
|
964
1082
|
needToCollectMoreInfo = data.step_name === 'collect_info';
|
|
965
1083
|
creatingAccount = data.step_name === 'create_account';
|
|
1084
|
+
collectPhoneOwnershipScreen = data.step_name === CONNECT_EXPRESS_STEP_NAMES.COLLECT_MOBILE_OWNERSHIP;
|
|
1085
|
+
if (collectPhoneOwnershipScreen) {
|
|
1086
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('COLLECT_MOBILE_OWNERSHIP')); });
|
|
1087
|
+
}
|
|
966
1088
|
if (creatingAccount) {
|
|
967
1089
|
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
|
|
968
1090
|
}
|
|
@@ -1022,19 +1144,119 @@ export var updateLeadBusinessDataAsync = createAsyncThunk('updateLeadBusinessDat
|
|
|
1022
1144
|
});
|
|
1023
1145
|
});
|
|
1024
1146
|
});
|
|
1147
|
+
export var updateLeadMobile = createAsyncThunk('connect/updateLeadMobile', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1148
|
+
var _a, settings, connectExpress, id, startWithNID, payload, leadResponse, needToCollectMoreInfo, creatingAccount, askDobInfo, collectPhoneOwnershipScreen;
|
|
1149
|
+
var _b, _c, _d;
|
|
1150
|
+
return __generator(this, function (_e) {
|
|
1151
|
+
switch (_e.label) {
|
|
1152
|
+
case 0:
|
|
1153
|
+
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
1154
|
+
id = (((_b = connectExpress.data.responseData) === null || _b === void 0 ? void 0 : _b.leadData) || {}).id;
|
|
1155
|
+
startWithNID = connectExpress.data.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
1156
|
+
payload = {
|
|
1157
|
+
id: id || '',
|
|
1158
|
+
contact: {
|
|
1159
|
+
phone: {
|
|
1160
|
+
country_code: params.countryCode.idd_prefix.toString(),
|
|
1161
|
+
number: params.mobile
|
|
1162
|
+
}
|
|
1163
|
+
},
|
|
1164
|
+
step_name: CONNECT_EXPRESS_STEP_NAMES.COLLECT_MOBILE_OWNERSHIP,
|
|
1165
|
+
encryption_contract: ['contact.phone.country_code', 'contact.phone.number']
|
|
1166
|
+
};
|
|
1167
|
+
return [4, API.leadService.updateLeadExpress(payload)];
|
|
1168
|
+
case 1:
|
|
1169
|
+
leadResponse = _e.sent();
|
|
1170
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
|
|
1171
|
+
needToCollectMoreInfo = leadResponse.step_name === 'collect_info';
|
|
1172
|
+
creatingAccount = leadResponse.step_name === 'create_account';
|
|
1173
|
+
askDobInfo = leadResponse.step_name === COLLECT_DOB_INFO_NAFATH;
|
|
1174
|
+
collectPhoneOwnershipScreen = leadResponse.step_name === CONNECT_EXPRESS_STEP_NAMES.COLLECT_MOBILE_OWNERSHIP;
|
|
1175
|
+
if (collectPhoneOwnershipScreen) {
|
|
1176
|
+
throw new Error("The new mobile number doesn't match the national ID, please update the mobile to the correct one");
|
|
1177
|
+
}
|
|
1178
|
+
if (askDobInfo) {
|
|
1179
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP')); });
|
|
1180
|
+
}
|
|
1181
|
+
if (creatingAccount) {
|
|
1182
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
|
|
1183
|
+
}
|
|
1184
|
+
if (!needToCollectMoreInfo) return [3, 5];
|
|
1185
|
+
if (!startWithNID) return [3, 4];
|
|
1186
|
+
if (!isSA(settings.data.businessCountry.iso2)) return [3, 3];
|
|
1187
|
+
return [4, thunkApi.dispatch(retrieveEntityListAsync(leadResponse.lead.id)).unwrap()];
|
|
1188
|
+
case 2:
|
|
1189
|
+
_e.sent();
|
|
1190
|
+
_e.label = 3;
|
|
1191
|
+
case 3:
|
|
1192
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP')); });
|
|
1193
|
+
return [3, 5];
|
|
1194
|
+
case 4:
|
|
1195
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP')); });
|
|
1196
|
+
_e.label = 5;
|
|
1197
|
+
case 5: return [2, { leadResponse: leadResponse, formData: params }];
|
|
1198
|
+
}
|
|
1199
|
+
});
|
|
1200
|
+
}); });
|
|
1201
|
+
export var skipUpdateLeadMobile = createAsyncThunk('connect/skipUpdateLeadMobile', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1202
|
+
var _a, settings, connectExpress, id, startWithNID, payload, leadResponse, needToCollectMoreInfo, creatingAccount, askDobInfo;
|
|
1203
|
+
var _b, _c, _d;
|
|
1204
|
+
return __generator(this, function (_e) {
|
|
1205
|
+
switch (_e.label) {
|
|
1206
|
+
case 0:
|
|
1207
|
+
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
1208
|
+
id = (((_b = connectExpress.data.responseData) === null || _b === void 0 ? void 0 : _b.leadData) || {}).id;
|
|
1209
|
+
startWithNID = connectExpress.data.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
1210
|
+
payload = {
|
|
1211
|
+
id: id || '',
|
|
1212
|
+
step_name: CONNECT_EXPRESS_STEP_NAMES.COLLECT_MOBILE_OWNERSHIP_SKIPPED,
|
|
1213
|
+
encryption_contract: []
|
|
1214
|
+
};
|
|
1215
|
+
return [4, API.leadService.updateLeadExpress(payload)];
|
|
1216
|
+
case 1:
|
|
1217
|
+
leadResponse = _e.sent();
|
|
1218
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, {});
|
|
1219
|
+
needToCollectMoreInfo = leadResponse.step_name === 'collect_info';
|
|
1220
|
+
creatingAccount = leadResponse.step_name === 'create_account';
|
|
1221
|
+
askDobInfo = leadResponse.step_name === COLLECT_DOB_INFO_NAFATH;
|
|
1222
|
+
if (askDobInfo) {
|
|
1223
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP')); });
|
|
1224
|
+
}
|
|
1225
|
+
if (creatingAccount) {
|
|
1226
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP')); });
|
|
1227
|
+
}
|
|
1228
|
+
if (!needToCollectMoreInfo) return [3, 5];
|
|
1229
|
+
if (!startWithNID) return [3, 4];
|
|
1230
|
+
if (!isSA(settings.data.businessCountry.iso2)) return [3, 3];
|
|
1231
|
+
return [4, thunkApi.dispatch(retrieveEntityListAsync(leadResponse.lead.id)).unwrap()];
|
|
1232
|
+
case 2:
|
|
1233
|
+
_e.sent();
|
|
1234
|
+
_e.label = 3;
|
|
1235
|
+
case 3:
|
|
1236
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP')); });
|
|
1237
|
+
return [3, 5];
|
|
1238
|
+
case 4:
|
|
1239
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP')); });
|
|
1240
|
+
_e.label = 5;
|
|
1241
|
+
case 5: return [2, { leadResponse: leadResponse }];
|
|
1242
|
+
}
|
|
1243
|
+
});
|
|
1244
|
+
}); });
|
|
1025
1245
|
export var confirmInfo = createAsyncThunk('connectExpress/confirmInfo', function (_a, thunkApi) {
|
|
1026
1246
|
var brandInfo = _a.brandInfo, entityInfo = _a.entityInfo, merchantInfo = _a.merchantInfo;
|
|
1027
1247
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
1028
|
-
var _b, connectExpress, settings, responseData, _c, postURL, redirectUrl, bi, authId, body, data, urlQueryStart;
|
|
1029
|
-
var
|
|
1030
|
-
return __generator(this, function (
|
|
1031
|
-
switch (
|
|
1248
|
+
var _b, connectExpress, settings, responseData, _c, appConfig, deviceInfo, activeScreen, postURL, redirectUrl, showBoard, bi, authId, leadId, body, data, _d, board_id, board_info_id, _e, boardInfo, boardData, urlQueryStart;
|
|
1249
|
+
var _f, _g, _h, _j, _k;
|
|
1250
|
+
return __generator(this, function (_l) {
|
|
1251
|
+
switch (_l.label) {
|
|
1032
1252
|
case 0:
|
|
1033
1253
|
_b = thunkApi.getState(), connectExpress = _b.connectExpress, settings = _b.settings;
|
|
1034
1254
|
responseData = connectExpress.data.responseData;
|
|
1035
|
-
_c = settings.data.appConfig,
|
|
1036
|
-
|
|
1037
|
-
|
|
1255
|
+
_c = settings.data, appConfig = _c.appConfig, deviceInfo = _c.deviceInfo, activeScreen = _c.activeScreen;
|
|
1256
|
+
postURL = appConfig.postURL, redirectUrl = appConfig.redirectUrl, showBoard = appConfig.showBoard;
|
|
1257
|
+
bi = deviceInfo.browser.browser_id;
|
|
1258
|
+
authId = (_g = (_f = responseData === null || responseData === void 0 ? void 0 : responseData.authData) === null || _f === void 0 ? void 0 : _f.auth) === null || _g === void 0 ? void 0 : _g.id;
|
|
1259
|
+
leadId = (_j = (_h = responseData === null || responseData === void 0 ? void 0 : responseData.authData) === null || _h === void 0 ? void 0 : _h.lead) === null || _j === void 0 ? void 0 : _j.id;
|
|
1038
1260
|
body = {
|
|
1039
1261
|
post_url: postURL || '',
|
|
1040
1262
|
authentication_id: authId,
|
|
@@ -1042,14 +1264,28 @@ export var confirmInfo = createAsyncThunk('connectExpress/confirmInfo', function
|
|
|
1042
1264
|
brand_id: (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.id) || '',
|
|
1043
1265
|
merchant_id: (merchantInfo === null || merchantInfo === void 0 ? void 0 : merchantInfo.id) || '',
|
|
1044
1266
|
entity_id: (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) || '',
|
|
1045
|
-
data:
|
|
1267
|
+
data: appConfig.data || []
|
|
1046
1268
|
};
|
|
1047
1269
|
return [4, API.operatorService.confirm(body)];
|
|
1048
1270
|
case 1:
|
|
1049
|
-
data =
|
|
1050
|
-
(
|
|
1271
|
+
data = _l.sent();
|
|
1272
|
+
(_k = appConfig.onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(appConfig, activeScreen.name, data);
|
|
1273
|
+
_d = merchantInfo || {}, board_id = _d.board_id, board_info_id = _d.board_info_id;
|
|
1274
|
+
if (!(showBoard && board_id && board_info_id)) return [3, 4];
|
|
1275
|
+
return [4, Promise.all([
|
|
1276
|
+
API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
|
|
1277
|
+
API.boardService.retrieveBoardDetails(board_id)
|
|
1278
|
+
])];
|
|
1279
|
+
case 2:
|
|
1280
|
+
_e = _l.sent(), boardInfo = _e[0], boardData = _e[1];
|
|
1281
|
+
return [4, thunkApi.dispatch(getLeadByIdAsync(leadId))];
|
|
1282
|
+
case 3:
|
|
1283
|
+
_l.sent();
|
|
1284
|
+
thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP'));
|
|
1285
|
+
return [2, { boardInfo: boardInfo, boardData: boardData, confirmData: data }];
|
|
1286
|
+
case 4:
|
|
1051
1287
|
if (authId) {
|
|
1052
|
-
if (
|
|
1288
|
+
if (appConfig.mode === 'popup') {
|
|
1053
1289
|
settings.data.appConfig.onFlowCompleted({ auth_id: authId, bi: bi });
|
|
1054
1290
|
thunkApi.dispatch(handleOpen(false));
|
|
1055
1291
|
return [2];
|
|
@@ -1065,16 +1301,34 @@ export var confirmInfo = createAsyncThunk('connectExpress/confirmInfo', function
|
|
|
1065
1301
|
});
|
|
1066
1302
|
});
|
|
1067
1303
|
export var onCloseCompleteAsync = createAsyncThunk('connectExpress/onCloseCompleteAsync', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1068
|
-
var connectExpress,
|
|
1069
|
-
var
|
|
1070
|
-
return __generator(this, function (
|
|
1071
|
-
switch (
|
|
1304
|
+
var _a, connectExpress, settings, _b, boardData, authData, confirmData, _c, appConfig, deviceInfo, activeScreen, _d, merchant, brand, entity, authId, redirectUrl, bi, urlQueryStart;
|
|
1305
|
+
var _e, _f, _g;
|
|
1306
|
+
return __generator(this, function (_h) {
|
|
1307
|
+
switch (_h.label) {
|
|
1072
1308
|
case 0:
|
|
1073
|
-
|
|
1074
|
-
|
|
1309
|
+
_a = thunkApi.getState(), connectExpress = _a.connectExpress, settings = _a.settings;
|
|
1310
|
+
_b = connectExpress.data.responseData || {}, boardData = _b.boardData, authData = _b.authData, confirmData = _b.confirmData;
|
|
1311
|
+
_c = settings.data, appConfig = _c.appConfig, deviceInfo = _c.deviceInfo, activeScreen = _c.activeScreen;
|
|
1312
|
+
_d = boardData || {}, merchant = _d.merchant, brand = _d.brand, entity = _d.entity;
|
|
1313
|
+
authId = (_e = authData === null || authData === void 0 ? void 0 : authData.auth) === null || _e === void 0 ? void 0 : _e.id;
|
|
1314
|
+
redirectUrl = appConfig.redirectUrl;
|
|
1315
|
+
bi = deviceInfo.browser.browser_id;
|
|
1316
|
+
if (confirmData && authId) {
|
|
1317
|
+
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, activeScreen.name, confirmData);
|
|
1318
|
+
if (settings.data.appConfig.mode === 'popup') {
|
|
1319
|
+
settings.data.appConfig.onFlowCompleted({ auth_id: authId, bi: bi });
|
|
1320
|
+
thunkApi.dispatch(handleOpen(false));
|
|
1321
|
+
return [2];
|
|
1322
|
+
}
|
|
1323
|
+
if (redirectUrl) {
|
|
1324
|
+
urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
1325
|
+
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|
|
1326
|
+
}
|
|
1327
|
+
return [2];
|
|
1328
|
+
}
|
|
1075
1329
|
return [4, thunkApi.dispatch(onCloseComplete({ merchantId: merchant === null || merchant === void 0 ? void 0 : merchant.id, brandId: brand === null || brand === void 0 ? void 0 : brand.id, entityId: entity === null || entity === void 0 ? void 0 : entity.id }))];
|
|
1076
1330
|
case 1:
|
|
1077
|
-
|
|
1331
|
+
_h.sent();
|
|
1078
1332
|
return [2];
|
|
1079
1333
|
}
|
|
1080
1334
|
});
|
|
@@ -1084,7 +1338,6 @@ var initialState = {
|
|
|
1084
1338
|
loading: false,
|
|
1085
1339
|
customLoading: false,
|
|
1086
1340
|
data: {
|
|
1087
|
-
showBoard: true,
|
|
1088
1341
|
isLeadIdPassed: false,
|
|
1089
1342
|
isStartFromBusinessCountry: false,
|
|
1090
1343
|
flowName: FlowsTypes.CONNECT_EXPRESS,
|
|
@@ -1095,7 +1348,6 @@ var initialState = {
|
|
|
1095
1348
|
},
|
|
1096
1349
|
nidData: {
|
|
1097
1350
|
nid: '',
|
|
1098
|
-
dob: '',
|
|
1099
1351
|
termAndConditionChecked: false
|
|
1100
1352
|
},
|
|
1101
1353
|
civilIdData: {
|
|
@@ -1105,6 +1357,9 @@ var initialState = {
|
|
|
1105
1357
|
otp: '',
|
|
1106
1358
|
authFor: AuthForType.MOBILE
|
|
1107
1359
|
},
|
|
1360
|
+
dobData: {
|
|
1361
|
+
dob: ''
|
|
1362
|
+
},
|
|
1108
1363
|
individualData: {
|
|
1109
1364
|
name: '',
|
|
1110
1365
|
email: '',
|
|
@@ -1132,9 +1387,6 @@ export var connectSlice = createSlice({
|
|
|
1132
1387
|
setLeadId: function (state, action) {
|
|
1133
1388
|
state.data.leadId = action.payload;
|
|
1134
1389
|
},
|
|
1135
|
-
setShowBoard: function (state, action) {
|
|
1136
|
-
state.data.showBoard = action.payload;
|
|
1137
|
-
},
|
|
1138
1390
|
storeIsStartFromBusinessCountry: function (state, action) {
|
|
1139
1391
|
state.data.isStartFromBusinessCountry = action.payload;
|
|
1140
1392
|
},
|
|
@@ -1170,7 +1422,8 @@ export var connectSlice = createSlice({
|
|
|
1170
1422
|
state.data.otpData.otp = '';
|
|
1171
1423
|
},
|
|
1172
1424
|
resetStore: function (state) {
|
|
1173
|
-
|
|
1425
|
+
var _a;
|
|
1426
|
+
state.data = __assign(__assign({}, state.data), { responseData: { leadData: (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.leadData } });
|
|
1174
1427
|
},
|
|
1175
1428
|
resetIndividualScreen: function (state) {
|
|
1176
1429
|
state.data.individualData = initialState.data.individualData;
|
|
@@ -1186,11 +1439,9 @@ export var connectSlice = createSlice({
|
|
|
1186
1439
|
state.customLoading = false;
|
|
1187
1440
|
var _a = action.payload, data = _a.data, countryCode = _a.countryCode, boardInfo = _a.boardInfo, boardData = _a.boardData;
|
|
1188
1441
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { leadData: data, boardInfo: boardInfo, boardData: boardData });
|
|
1189
|
-
var _b = data || {}, identification = _b.identification,
|
|
1442
|
+
var _b = data || {}, identification = _b.identification, contact = _b.contact, terms_conditions_accepted = _b.terms_conditions_accepted;
|
|
1190
1443
|
if (identification === null || identification === void 0 ? void 0 : identification.id)
|
|
1191
1444
|
state.data.nidData.nid = identification === null || identification === void 0 ? void 0 : identification.id;
|
|
1192
|
-
if (date_of_birth)
|
|
1193
|
-
state.data.nidData.dob = date_of_birth;
|
|
1194
1445
|
var phone = (contact || {}).phone;
|
|
1195
1446
|
if (phone) {
|
|
1196
1447
|
state.data.mobileData.mobile = phone === null || phone === void 0 ? void 0 : phone.number;
|
|
@@ -1214,11 +1465,9 @@ export var connectSlice = createSlice({
|
|
|
1214
1465
|
state.loading = false;
|
|
1215
1466
|
var _c = action.payload, data = _c.data, countryCode = _c.countryCode;
|
|
1216
1467
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { leadData: data });
|
|
1217
|
-
var _d = data || {}, name = _d.name, contact = _d.contact, brand = _d.brand, identification = _d.identification,
|
|
1468
|
+
var _d = data || {}, name = _d.name, contact = _d.contact, brand = _d.brand, identification = _d.identification, terms_conditions_accepted = _d.terms_conditions_accepted;
|
|
1218
1469
|
if (identification === null || identification === void 0 ? void 0 : identification.id)
|
|
1219
1470
|
state.data.nidData.nid = identification === null || identification === void 0 ? void 0 : identification.id;
|
|
1220
|
-
if (date_of_birth)
|
|
1221
|
-
state.data.nidData.dob = date_of_birth;
|
|
1222
1471
|
var fullName = concatenateObjectValues(name, ['first', 'middle', 'last']);
|
|
1223
1472
|
if (!!fullName) {
|
|
1224
1473
|
var capitalizedName = capitalizeTheFirstLetterOfEachWord(fullName);
|
|
@@ -1265,29 +1514,20 @@ export var connectSlice = createSlice({
|
|
|
1265
1514
|
.addCase(resendMobileAuthOTP.rejected, function (state, action) {
|
|
1266
1515
|
state.error = action.error.message;
|
|
1267
1516
|
})
|
|
1268
|
-
.addCase(
|
|
1269
|
-
state.loading = true;
|
|
1270
|
-
state.error = null;
|
|
1271
|
-
})
|
|
1272
|
-
.addCase(createNIDAuthAsync.fulfilled, function (state, action) {
|
|
1517
|
+
.addCase(createNafathAuth.fulfilled, function (state, action) {
|
|
1273
1518
|
state.loading = false;
|
|
1274
|
-
state.
|
|
1519
|
+
state.error = null;
|
|
1520
|
+
var _a = action.payload, formData = _a.formData, response = _a.response;
|
|
1521
|
+
state.data.nidData = formData;
|
|
1522
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { authData: response });
|
|
1275
1523
|
state.data.otpData.authFor = AuthForType.NATIONAL_ID;
|
|
1276
|
-
state.data.responseData = __assign(__assign({}, state.data.responseData), { authData: action.payload.response });
|
|
1277
1524
|
})
|
|
1278
|
-
.addCase(
|
|
1279
|
-
state.loading =
|
|
1280
|
-
state.error = action.error.message;
|
|
1281
|
-
})
|
|
1282
|
-
.addCase(resendNIDAuthOTP.pending, function (state) {
|
|
1525
|
+
.addCase(createNafathAuth.pending, function (state) {
|
|
1526
|
+
state.loading = true;
|
|
1283
1527
|
state.error = null;
|
|
1284
1528
|
})
|
|
1285
|
-
.addCase(
|
|
1286
|
-
state.
|
|
1287
|
-
state.data.otpData.authFor = AuthForType.NATIONAL_ID;
|
|
1288
|
-
state.data.responseData = __assign(__assign({}, state.data.responseData), { authData: action.payload.response });
|
|
1289
|
-
})
|
|
1290
|
-
.addCase(resendNIDAuthOTP.rejected, function (state, action) {
|
|
1529
|
+
.addCase(createNafathAuth.rejected, function (state, action) {
|
|
1530
|
+
state.loading = false;
|
|
1291
1531
|
state.error = action.error.message;
|
|
1292
1532
|
})
|
|
1293
1533
|
.addCase(createCivilIdAuthAsync.pending, function (state) {
|
|
@@ -1319,32 +1559,20 @@ export var connectSlice = createSlice({
|
|
|
1319
1559
|
state.loading = false;
|
|
1320
1560
|
state.error = action.error.message;
|
|
1321
1561
|
})
|
|
1322
|
-
.addCase(
|
|
1562
|
+
.addCase(createNIDNafathAuthIdentityAsync.pending, function (state) {
|
|
1323
1563
|
state.loading = true;
|
|
1324
1564
|
state.error = null;
|
|
1325
1565
|
})
|
|
1326
|
-
.addCase(
|
|
1566
|
+
.addCase(createNIDNafathAuthIdentityAsync.fulfilled, function (state, action) {
|
|
1327
1567
|
var _a;
|
|
1328
1568
|
state.loading = false;
|
|
1329
1569
|
state.data.nidData = action.payload.formData;
|
|
1330
1570
|
state.data.otpData.authFor = AuthForType.NATIONAL_ID_MISSED;
|
|
1331
1571
|
state.data.responseData = __assign(__assign({}, state.data.responseData), { authData: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authData), action.payload.response) });
|
|
1332
1572
|
})
|
|
1333
|
-
.addCase(
|
|
1573
|
+
.addCase(createNIDNafathAuthIdentityAsync.rejected, function (state, action) {
|
|
1334
1574
|
state.loading = false;
|
|
1335
1575
|
state.error = action.error.message;
|
|
1336
|
-
})
|
|
1337
|
-
.addCase(resendNIDAuthIdentityOTP.pending, function (state) {
|
|
1338
|
-
state.error = null;
|
|
1339
|
-
})
|
|
1340
|
-
.addCase(resendNIDAuthIdentityOTP.fulfilled, function (state, action) {
|
|
1341
|
-
var _a;
|
|
1342
|
-
state.data.nidData = action.payload.formData;
|
|
1343
|
-
state.data.otpData.authFor = AuthForType.NATIONAL_ID_MISSED;
|
|
1344
|
-
state.data.responseData = __assign(__assign({}, state.data.responseData), { authData: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authData), action.payload.response) });
|
|
1345
|
-
})
|
|
1346
|
-
.addCase(resendNIDAuthIdentityOTP.rejected, function (state, action) {
|
|
1347
|
-
state.error = action.error.message;
|
|
1348
1576
|
})
|
|
1349
1577
|
.addCase(verifyMobileOtpAsync.pending, function (state) {
|
|
1350
1578
|
state.loading = true;
|
|
@@ -1359,18 +1587,23 @@ export var connectSlice = createSlice({
|
|
|
1359
1587
|
state.loading = false;
|
|
1360
1588
|
state.error = action.error.message;
|
|
1361
1589
|
})
|
|
1362
|
-
.addCase(
|
|
1590
|
+
.addCase(verifyNafathAsync.pending, function (state) {
|
|
1363
1591
|
state.loading = true;
|
|
1364
1592
|
state.error = null;
|
|
1365
1593
|
})
|
|
1366
|
-
.addCase(
|
|
1594
|
+
.addCase(verifyNafathAsync.fulfilled, function (state, action) {
|
|
1367
1595
|
var _a;
|
|
1368
1596
|
state.loading = false;
|
|
1369
|
-
|
|
1597
|
+
var _b = action.payload, data = _b.data, isNextScreenIsDob = _b.isNextScreenIsDob;
|
|
1598
|
+
state.data.individualData.isPrevDob = isNextScreenIsDob || false;
|
|
1599
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { authData: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authData), data) });
|
|
1370
1600
|
})
|
|
1371
|
-
.addCase(
|
|
1601
|
+
.addCase(verifyNafathAsync.rejected, function (state, action) {
|
|
1372
1602
|
state.loading = false;
|
|
1373
|
-
|
|
1603
|
+
var error = action.error.message;
|
|
1604
|
+
if (error !== 'Aborted') {
|
|
1605
|
+
state.error = error;
|
|
1606
|
+
}
|
|
1374
1607
|
})
|
|
1375
1608
|
.addCase(verifyPACIAsync.pending, function (state) {
|
|
1376
1609
|
state.loading = true;
|
|
@@ -1388,19 +1621,24 @@ export var connectSlice = createSlice({
|
|
|
1388
1621
|
state.error = error;
|
|
1389
1622
|
}
|
|
1390
1623
|
})
|
|
1391
|
-
.addCase(
|
|
1624
|
+
.addCase(verifyNafathIdentityAsync.pending, function (state) {
|
|
1392
1625
|
state.loading = true;
|
|
1393
1626
|
state.error = null;
|
|
1394
1627
|
})
|
|
1395
|
-
.addCase(
|
|
1396
|
-
var _a, _b
|
|
1628
|
+
.addCase(verifyNafathIdentityAsync.fulfilled, function (state, action) {
|
|
1629
|
+
var _a, _b;
|
|
1397
1630
|
state.loading = false;
|
|
1631
|
+
var _c = action.payload, data = _c.data, isNextScreenIsDob = _c.isNextScreenIsDob;
|
|
1398
1632
|
var auth = (((_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authData) || {}).auth;
|
|
1399
|
-
state.data.
|
|
1633
|
+
state.data.individualData.isPrevDob = isNextScreenIsDob || false;
|
|
1634
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { authData: __assign(__assign(__assign({}, (_b = state.data.responseData) === null || _b === void 0 ? void 0 : _b.authData), data), { auth: __assign(__assign({}, data === null || data === void 0 ? void 0 : data.auth), { id: auth === null || auth === void 0 ? void 0 : auth.id }) }) });
|
|
1400
1635
|
})
|
|
1401
|
-
.addCase(
|
|
1636
|
+
.addCase(verifyNafathIdentityAsync.rejected, function (state, action) {
|
|
1402
1637
|
state.loading = false;
|
|
1403
|
-
|
|
1638
|
+
var error = action.error.message;
|
|
1639
|
+
if (error !== 'Aborted') {
|
|
1640
|
+
state.error = error;
|
|
1641
|
+
}
|
|
1404
1642
|
})
|
|
1405
1643
|
.addCase(verifyPaciLeadIdentityAsync.pending, function (state) {
|
|
1406
1644
|
state.loading = true;
|
|
@@ -1511,6 +1749,20 @@ export var connectSlice = createSlice({
|
|
|
1511
1749
|
if (action.error.message === 'Aborted')
|
|
1512
1750
|
return;
|
|
1513
1751
|
state.error = action.error.message;
|
|
1752
|
+
})
|
|
1753
|
+
.addCase(updateLeadDOBAsync.fulfilled, function (state, action) {
|
|
1754
|
+
state.loading = false;
|
|
1755
|
+
state.error = null;
|
|
1756
|
+
state.data.dobData = action.payload.formData;
|
|
1757
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { dobData: action.payload.response });
|
|
1758
|
+
})
|
|
1759
|
+
.addCase(updateLeadDOBAsync.pending, function (state) {
|
|
1760
|
+
state.loading = true;
|
|
1761
|
+
state.error = null;
|
|
1762
|
+
})
|
|
1763
|
+
.addCase(updateLeadDOBAsync.rejected, function (state, action) {
|
|
1764
|
+
state.loading = false;
|
|
1765
|
+
state.error = action.error.message;
|
|
1514
1766
|
})
|
|
1515
1767
|
.addCase(updateLeadIndividualAsync.fulfilled, function (state, action) {
|
|
1516
1768
|
var _a, _b;
|
|
@@ -1541,6 +1793,33 @@ export var connectSlice = createSlice({
|
|
|
1541
1793
|
.addCase(updateLeadBusinessDataAsync.rejected, function (state, action) {
|
|
1542
1794
|
state.loading = false;
|
|
1543
1795
|
state.error = action.error.message;
|
|
1796
|
+
})
|
|
1797
|
+
.addCase(updateLeadMobile.fulfilled, function (state, action) {
|
|
1798
|
+
state.loading = false;
|
|
1799
|
+
state.error = null;
|
|
1800
|
+
state.data.individualData.mobile = action.payload.formData.mobile;
|
|
1801
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { individualData: action.payload.leadResponse });
|
|
1802
|
+
})
|
|
1803
|
+
.addCase(updateLeadMobile.pending, function (state) {
|
|
1804
|
+
state.loading = true;
|
|
1805
|
+
state.error = null;
|
|
1806
|
+
})
|
|
1807
|
+
.addCase(updateLeadMobile.rejected, function (state, action) {
|
|
1808
|
+
state.loading = false;
|
|
1809
|
+
state.error = action.error.message;
|
|
1810
|
+
})
|
|
1811
|
+
.addCase(skipUpdateLeadMobile.fulfilled, function (state, action) {
|
|
1812
|
+
state.loading = false;
|
|
1813
|
+
state.error = null;
|
|
1814
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { individualData: action.payload.leadResponse });
|
|
1815
|
+
})
|
|
1816
|
+
.addCase(skipUpdateLeadMobile.pending, function (state) {
|
|
1817
|
+
state.loading = true;
|
|
1818
|
+
state.error = null;
|
|
1819
|
+
})
|
|
1820
|
+
.addCase(skipUpdateLeadMobile.rejected, function (state, action) {
|
|
1821
|
+
state.loading = false;
|
|
1822
|
+
state.error = action.error.message;
|
|
1544
1823
|
})
|
|
1545
1824
|
.addCase(createAccountAsync.pending, function (state) {
|
|
1546
1825
|
state.loading = true;
|
|
@@ -1553,6 +1832,19 @@ export var connectSlice = createSlice({
|
|
|
1553
1832
|
.addCase(createAccountAsync.rejected, function (state, action) {
|
|
1554
1833
|
state.loading = false;
|
|
1555
1834
|
state.error = action.error.message;
|
|
1835
|
+
})
|
|
1836
|
+
.addCase(retrieveDetailsAfterCreateAccountAsync.pending, function (state) {
|
|
1837
|
+
state.loading = true;
|
|
1838
|
+
state.error = null;
|
|
1839
|
+
})
|
|
1840
|
+
.addCase(retrieveDetailsAfterCreateAccountAsync.fulfilled, function (state, action) {
|
|
1841
|
+
state.loading = false;
|
|
1842
|
+
state.error = null;
|
|
1843
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), action.payload);
|
|
1844
|
+
})
|
|
1845
|
+
.addCase(retrieveDetailsAfterCreateAccountAsync.rejected, function (state, action) {
|
|
1846
|
+
state.loading = false;
|
|
1847
|
+
state.error = action.error.message;
|
|
1556
1848
|
})
|
|
1557
1849
|
.addCase(getMerchantListAsync.pending, function (state) {
|
|
1558
1850
|
state.loading = true;
|
|
@@ -1578,10 +1870,11 @@ export var connectSlice = createSlice({
|
|
|
1578
1870
|
state.loading = true;
|
|
1579
1871
|
state.error = null;
|
|
1580
1872
|
})
|
|
1581
|
-
.addCase(confirmInfo.fulfilled, function (state) {
|
|
1873
|
+
.addCase(confirmInfo.fulfilled, function (state, action) {
|
|
1582
1874
|
state.loading = false;
|
|
1583
1875
|
state.error = null;
|
|
1584
|
-
|
|
1876
|
+
var _a = action.payload || {}, boardInfo = _a.boardInfo, boardData = _a.boardData, confirmData = _a.confirmData;
|
|
1877
|
+
state.data.responseData = __assign(__assign({}, state.data.responseData), { boardInfo: boardInfo, boardData: boardData, confirmData: confirmData });
|
|
1585
1878
|
})
|
|
1586
1879
|
.addCase(confirmInfo.rejected, function (state, action) {
|
|
1587
1880
|
state.loading = false;
|
|
@@ -1635,6 +1928,6 @@ export var connectSlice = createSlice({
|
|
|
1635
1928
|
});
|
|
1636
1929
|
}
|
|
1637
1930
|
});
|
|
1638
|
-
export var clearError = (_a = connectSlice.actions, _a.clearError), stopLoader = _a.stopLoader, setIsLeadIdPassed = _a.setIsLeadIdPassed, resetMobileScreen = _a.resetMobileScreen, resetOTPValue = _a.resetOTPValue, resetNIDScreen = _a.resetNIDScreen, resetCivilScreen = _a.resetCivilScreen, resetStore = _a.resetStore, setError = _a.setError, setLeadId = _a.setLeadId,
|
|
1931
|
+
export var clearError = (_a = connectSlice.actions, _a.clearError), stopLoader = _a.stopLoader, setIsLeadIdPassed = _a.setIsLeadIdPassed, resetMobileScreen = _a.resetMobileScreen, resetOTPValue = _a.resetOTPValue, resetNIDScreen = _a.resetNIDScreen, resetCivilScreen = _a.resetCivilScreen, resetStore = _a.resetStore, setError = _a.setError, setLeadId = _a.setLeadId, resetIndividualScreen = _a.resetIndividualScreen, setDefaultCountryCode = _a.setDefaultCountryCode, storeIsStartFromBusinessCountry = _a.storeIsStartFromBusinessCountry, resetAuthenticationScreen = _a.resetAuthenticationScreen;
|
|
1639
1932
|
export default connectSlice.reducer;
|
|
1640
1933
|
export var connectExpressSelector = function (state) { return state.connectExpress; };
|