@tap-payments/auth-jsconnect 2.8.51-development → 2.8.52-beta
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 +0 -1
- package/build/@types/form.d.ts +0 -1
- package/build/@types/redux.d.ts +0 -1
- package/build/api/axios.js +1 -2
- package/build/api/entity.d.ts +2 -2
- package/build/api/entity.js +4 -12
- package/build/api/index.d.ts +2 -2
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +2 -0
- package/build/constants/app.js +2 -0
- package/build/features/app/auth/authStore.js +23 -2
- package/build/features/app/bank/bankStore.d.ts +18 -13
- package/build/features/app/bank/bankStore.js +165 -184
- package/build/features/app/board/boardStore.js +30 -52
- package/build/features/app/brand/brandStore.d.ts +33 -16
- package/build/features/app/brand/brandStore.js +242 -239
- package/build/features/app/business/businessStore.d.ts +5 -0
- package/build/features/app/business/businessStore.js +87 -76
- package/build/features/app/connectExpress/connectExpressStore.d.ts +6 -15
- package/build/features/app/connectExpress/connectExpressStore.js +68 -107
- package/build/features/app/entity/entityStore.d.ts +36 -20
- package/build/features/app/entity/entityStore.js +246 -196
- package/build/features/app/individual/individualStore.d.ts +38 -22
- package/build/features/app/individual/individualStore.js +266 -263
- package/build/features/app/password/passwordStore.d.ts +23 -40
- package/build/features/app/password/passwordStore.js +233 -226
- package/build/features/app/tax/taxStore.d.ts +7 -13
- package/build/features/app/tax/taxStore.js +147 -168
- package/build/features/auth/Auth.js +5 -1
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +1 -13
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +26 -4
- package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +1 -7
- package/build/features/auth/screens/OTP/OTP.js +6 -1
- package/build/features/auth/screens/OTP/OTPInput.js +11 -0
- package/build/features/bank/Bank.d.ts +0 -1
- package/build/features/bank/Bank.js +4 -7
- package/build/features/bank/screens/BankDetails/BankDetails.js +5 -18
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/bank/screens/Verify/Verify.js +5 -5
- package/build/features/board/Board.js +4 -8
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -3
- package/build/features/brand/Brand.d.ts +0 -1
- package/build/features/brand/Brand.js +4 -7
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +35 -8
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +12 -49
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +3 -3
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -6
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +18 -5
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +7 -2
- 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 +5 -23
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +7 -23
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/brand/screens/Verify/Verify.js +1 -1
- package/build/features/business/Business.js +4 -9
- package/build/features/business/screens/Activities/Activities.js +3 -12
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +2 -2
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +1 -1
- package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +1 -1
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -10
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +26 -4
- package/build/features/business/screens/CivilID/CivilID.js +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +36 -9
- package/build/features/business/screens/Customers/Customers.js +3 -12
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -6
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +18 -5
- package/build/features/business/screens/IDBOD/IDBOD.js +2 -10
- package/build/features/business/screens/OTP/OTP.js +1 -1
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -14
- package/build/features/business/screens/Verify/Verify.js +3 -13
- package/build/features/connect/Connect.js +4 -5
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +2 -9
- package/build/features/connect/screens/CivilID/CivilID.js +7 -2
- package/build/features/connect/screens/Individual/Email.js +1 -3
- package/build/features/connect/screens/Individual/Individual.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +3 -3
- package/build/features/connect/screens/Merchant/Merchant.js +1 -1
- package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
- package/build/features/connect/screens/Mobile/Mobile.js +8 -11
- package/build/features/connect/screens/NID/NID.js +1 -1
- package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
- package/build/features/connectExpress/ConnectExpress.js +18 -5
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +2 -5
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +1 -6
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +0 -3
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +0 -10
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +1 -7
- package/build/features/connectExpress/screens/CivilID/CivilID.js +7 -2
- package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +9 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +26 -4
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +7 -2
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +9 -2
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +24 -14
- package/build/features/connectExpress/screens/IdentityOTP/OTP.js +8 -7
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +7 -5
- package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -9
- package/build/features/connectExpress/screens/NID/NID.js +7 -2
- package/build/features/connectExpress/screens/NID/TAC.d.ts +7 -2
- package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
- package/build/features/connectExpress/screens/OTP/OTP.js +6 -1
- package/build/features/connectExpress/screens/OTP/OTPInput.js +11 -1
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/Entity.d.ts +0 -1
- package/build/features/entity/Entity.js +4 -7
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +2 -2
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -8
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -8
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +10 -34
- package/build/features/entity/screens/EntityName/EntityName.js +15 -32
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +35 -8
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +1 -1
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +1 -1
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/screens/Verify/Verify.js +1 -1
- package/build/features/featuresScreens.js +7 -67
- package/build/features/individual/Individual.d.ts +0 -1
- package/build/features/individual/Individual.js +4 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +14 -54
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +26 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -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 +5 -18
- package/build/features/individual/screens/IndividualList/UserList.js +9 -13
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +26 -4
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +1 -1
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +20 -76
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/individual/screens/Verify/Verify.js +1 -1
- package/build/features/password/Password.d.ts +0 -1
- package/build/features/password/Password.js +28 -75
- package/build/features/password/screens/CreatePassword/CreatePassword.js +4 -8
- package/build/features/password/screens/OTP/OTP.js +1 -1
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/password/screens/Verify/Verify.js +5 -5
- package/build/features/shared/Address/CountryList.d.ts +23 -7
- package/build/features/shared/Address/InputSelect.d.ts +23 -7
- package/build/features/shared/Button/FlowsButtons.js +3 -13
- package/build/features/shared/Containers/FeatureContainer.d.ts +0 -1
- package/build/features/shared/Containers/FeatureContainer.js +3 -3
- package/build/features/shared/Input/Input.d.ts +2 -2
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +1 -5
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -3
- package/build/features/shared/UploadFile/FileUpload.d.ts +7 -2
- package/build/features/shared/UploadFile/UploadFile.d.ts +7 -2
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +7 -2
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +7 -2
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +7 -2
- package/build/features/signIn/SignIn.js +3 -12
- package/build/features/tax/Tax.d.ts +0 -1
- package/build/features/tax/Tax.js +4 -7
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -7
- package/build/features/tax/screens/Verify/Verify.js +5 -5
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/useVerifyToken.d.ts +2 -5
- package/build/hooks/useVerifyToken.js +5 -10
- package/build/utils/common.js +4 -4
- package/build/utils/locale.js +1 -2
- package/build/utils/string.d.ts +2 -5
- package/build/utils/string.js +5 -34
- package/package.json +2 -2
- package/build/features/bank/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/bank/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/bank/screens/OperatorError/index.d.ts +0 -3
- package/build/features/bank/screens/OperatorError/index.js +0 -2
- package/build/features/board/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/board/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/board/screens/OperatorError/index.d.ts +0 -3
- package/build/features/board/screens/OperatorError/index.js +0 -2
- package/build/features/brand/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/brand/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/brand/screens/OperatorError/index.d.ts +0 -3
- package/build/features/brand/screens/OperatorError/index.js +0 -2
- package/build/features/business/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/business/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/business/screens/OperatorError/index.d.ts +0 -3
- package/build/features/business/screens/OperatorError/index.js +0 -2
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +0 -9
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +0 -90
- package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/connectExpress/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/connectExpress/screens/OperatorError/index.d.ts +0 -3
- package/build/features/connectExpress/screens/OperatorError/index.js +0 -2
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -5
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +0 -34
- package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +0 -2
- package/build/features/connectExpress/screens/PrepareDataLoading/index.js +0 -2
- package/build/features/entity/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/entity/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/entity/screens/OperatorError/index.d.ts +0 -3
- package/build/features/entity/screens/OperatorError/index.js +0 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +0 -14
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +0 -76
- package/build/features/individual/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/individual/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/individual/screens/OperatorError/index.d.ts +0 -3
- package/build/features/individual/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/password/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/password/screens/OperatorError/index.d.ts +0 -3
- package/build/features/password/screens/OperatorError/index.js +0 -2
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -4
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +0 -10
- package/build/features/password/screens/PrepareDataLoading/index.d.ts +0 -2
- package/build/features/password/screens/PrepareDataLoading/index.js +0 -2
- package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/signIn/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/signIn/screens/OperatorError/index.d.ts +0 -3
- package/build/features/signIn/screens/OperatorError/index.js +0 -2
- package/build/features/tax/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/tax/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/tax/screens/OperatorError/index.d.ts +0 -3
- package/build/features/tax/screens/OperatorError/index.js +0 -2
- package/build/hooks/useFormDirtyCheck.d.ts +0 -10
- package/build/hooks/useFormDirtyCheck.js +0 -66
|
@@ -49,58 +49,79 @@ var _a;
|
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
50
|
import API from '../../../api';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
|
-
import { handleCurrentActiveScreen, handleNextScreenStep,
|
|
52
|
+
import { handleCurrentActiveScreen, handleNextScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
53
53
|
import { PASSWORD_OPERATION_TYPE, PASSWORD_STEP_NAMES } from '../../../constants';
|
|
54
|
-
import { retrieveIndividualData
|
|
55
|
-
export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', function (
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
54
|
+
import { retrieveIndividualData } from '../../../utils';
|
|
55
|
+
export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
+
var payload, data, boardStatusData, boardInfoData, boardData, individualData, countryIso2, _a, board_id, board_info_id, config, country_code, publicKey, _b, id_1, type_1, serviceCallBack, _c, boardRes, individualRes, info, hasPasswordCompleted;
|
|
57
|
+
var _d, _e, _f, _g, _h;
|
|
58
|
+
return __generator(this, function (_j) {
|
|
59
|
+
switch (_j.label) {
|
|
60
|
+
case 0:
|
|
61
|
+
payload = {
|
|
62
|
+
service_name: 'tap_email',
|
|
63
|
+
verify_token: token
|
|
64
|
+
};
|
|
65
|
+
return [4, API.leadService.verifyLeadToken(payload)];
|
|
66
|
+
case 1:
|
|
67
|
+
data = (_j.sent()).data;
|
|
68
|
+
countryIso2 = undefined;
|
|
69
|
+
if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 8];
|
|
70
|
+
_a = data || {}, board_id = _a.id, board_info_id = _a.board_info_id, config = _a.config, country_code = _a.country_code;
|
|
71
|
+
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
72
|
+
if (publicKey) {
|
|
73
|
+
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
74
|
+
}
|
|
75
|
+
if (country_code) {
|
|
76
76
|
countryIso2 = country_code;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
77
|
+
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
78
|
+
}
|
|
79
|
+
if (!board_id) return [3, 7];
|
|
80
|
+
if (!board_info_id) return [3, 3];
|
|
81
|
+
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
82
|
+
case 2:
|
|
83
|
+
boardInfoData = _j.sent();
|
|
84
|
+
_j.label = 3;
|
|
85
|
+
case 3: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
86
|
+
case 4:
|
|
87
|
+
boardStatusData = _j.sent();
|
|
88
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
89
|
+
case 5:
|
|
90
|
+
boardData = _j.sent();
|
|
91
|
+
_b = ((_d = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _d === void 0 ? void 0 : _d.recipient) || {}, id_1 = _b.id, type_1 = _b.type;
|
|
92
|
+
serviceCallBack = function () { return API.individualService.retrieveIndividual(id_1, type_1); };
|
|
93
|
+
return [4, retrieveIndividualData(type_1, boardData, serviceCallBack)];
|
|
94
|
+
case 6:
|
|
95
|
+
_c = _j.sent(), boardRes = _c.boardRes, individualRes = _c.individualRes;
|
|
96
|
+
boardData = boardRes;
|
|
97
|
+
individualData = individualRes;
|
|
98
|
+
_j.label = 7;
|
|
99
|
+
case 7:
|
|
100
|
+
if (!country_code && ((_e = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _e === void 0 ? void 0 : _e.country)) {
|
|
101
|
+
countryIso2 = boardData.entity.country;
|
|
102
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
103
|
+
}
|
|
104
|
+
info = (boardStatusData || {}).info;
|
|
105
|
+
hasPasswordCompleted = ((_f = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'password'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
|
|
106
|
+
if (data.step_name === PASSWORD_STEP_NAMES.PHONE_AUTH) {
|
|
107
|
+
thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_VERIFY_STEP'));
|
|
108
|
+
}
|
|
109
|
+
else if (hasPasswordCompleted) {
|
|
110
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
111
|
+
}
|
|
112
|
+
else if (data.step_name === PASSWORD_STEP_NAMES.PASSWORD_INFO) {
|
|
113
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
114
|
+
}
|
|
115
|
+
_j.label = 8;
|
|
116
|
+
case 8: return [2, {
|
|
117
|
+
data: data,
|
|
118
|
+
individualData: individualData,
|
|
119
|
+
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { flows: (boardStatusData === null || boardStatusData === void 0 ? void 0 : boardStatusData.info) || [], user: boardData === null || boardData === void 0 ? void 0 : boardData.user, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, name: (_g = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _g === void 0 ? void 0 : _g.names, contact: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.contact, business: boardData === null || boardData === void 0 ? void 0 : boardData.business, notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification }),
|
|
120
|
+
token: token
|
|
121
|
+
}];
|
|
122
|
+
}
|
|
102
123
|
});
|
|
103
|
-
});
|
|
124
|
+
}); });
|
|
104
125
|
export var resendOTP = createAsyncThunk('resendOTPPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
105
126
|
var password, payload, data;
|
|
106
127
|
return __generator(this, function (_a) {
|
|
@@ -118,74 +139,54 @@ export var resendOTP = createAsyncThunk('resendOTPPassword', function (params, t
|
|
|
118
139
|
}
|
|
119
140
|
});
|
|
120
141
|
}); });
|
|
121
|
-
export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails', function (
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (!(((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.id) !== id && id)) return [3, 3];
|
|
134
|
-
serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
|
|
135
|
-
return [4, retrieveIndividualData(type, data, serviceCallBack)];
|
|
136
|
-
case 2:
|
|
137
|
-
_b = _f.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
|
|
138
|
-
individualData = individualRes;
|
|
139
|
-
boardData = boardRes;
|
|
140
|
-
_f.label = 3;
|
|
141
|
-
case 3: return [2, __assign(__assign({}, boardData), { brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact, user: individualData })];
|
|
142
|
-
}
|
|
143
|
-
});
|
|
142
|
+
export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
143
|
+
var data;
|
|
144
|
+
var _a, _b;
|
|
145
|
+
return __generator(this, function (_c) {
|
|
146
|
+
switch (_c.label) {
|
|
147
|
+
case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
148
|
+
case 1:
|
|
149
|
+
data = _c.sent();
|
|
150
|
+
return [2, {
|
|
151
|
+
data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact })
|
|
152
|
+
}];
|
|
153
|
+
}
|
|
144
154
|
});
|
|
145
|
-
});
|
|
155
|
+
}); });
|
|
146
156
|
export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
147
|
-
var _a, password, settings, responseBody, payload, data,
|
|
148
|
-
var _c, _d, _e, _f
|
|
149
|
-
return __generator(this, function (
|
|
150
|
-
switch (
|
|
157
|
+
var _a, password, settings, responseBody, payload, data, publicKey, flows, hasPasswordCompleted;
|
|
158
|
+
var _b, _c, _d, _e, _f;
|
|
159
|
+
return __generator(this, function (_g) {
|
|
160
|
+
switch (_g.label) {
|
|
151
161
|
case 0:
|
|
152
162
|
_a = thunkApi.getState(), password = _a.password, settings = _a.settings;
|
|
153
163
|
responseBody = password.data.verify.responseBody;
|
|
154
164
|
payload = {
|
|
155
165
|
data: params.otp,
|
|
156
|
-
service_name: (
|
|
166
|
+
service_name: (_b = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _b === void 0 ? void 0 : _b.service_name,
|
|
157
167
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
158
168
|
step_name: PASSWORD_STEP_NAMES.PHONE_AUTH,
|
|
159
169
|
encryption_contract: ['data']
|
|
160
170
|
};
|
|
161
171
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
162
172
|
case 1:
|
|
163
|
-
data = (
|
|
164
|
-
if (
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
return [
|
|
180
|
-
case 3:
|
|
181
|
-
data_2 = _h.sent();
|
|
182
|
-
if ((_g = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _g === void 0 ? void 0 : _g.country)
|
|
183
|
-
thunkApi.dispatch(handleSetCountryByIso2(data_2.entity.country));
|
|
184
|
-
_h.label = 4;
|
|
185
|
-
case 4:
|
|
186
|
-
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
187
|
-
_h.label = 5;
|
|
188
|
-
case 5: return [2, { data: data, formData: __assign({}, params) }];
|
|
173
|
+
data = (_g.sent()).data;
|
|
174
|
+
if (!data.errors) {
|
|
175
|
+
publicKey = (_c = data === null || data === void 0 ? void 0 : data.config) === null || _c === void 0 ? void 0 : _c.public_key;
|
|
176
|
+
if (publicKey) {
|
|
177
|
+
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
178
|
+
}
|
|
179
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
|
|
180
|
+
flows = (responseBody || {}).flows;
|
|
181
|
+
hasPasswordCompleted = ((_f = flows === null || flows === void 0 ? void 0 : flows.find(function (flow) { return flow.name === 'password'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
|
|
182
|
+
if (hasPasswordCompleted) {
|
|
183
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return [2, { data: data, formData: __assign({}, params) }];
|
|
189
190
|
}
|
|
190
191
|
});
|
|
191
192
|
}); });
|
|
@@ -205,108 +206,98 @@ export var createPassword = createAsyncThunk('createPassword', function (params,
|
|
|
205
206
|
return [4, API.authService.createPassword(requestBody)];
|
|
206
207
|
case 1:
|
|
207
208
|
data = _f.sent();
|
|
208
|
-
|
|
209
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP'));
|
|
209
210
|
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
|
|
210
211
|
return [2, { data: data, formData: params }];
|
|
211
212
|
}
|
|
212
213
|
});
|
|
213
214
|
}); });
|
|
214
215
|
export var updateBoardSuccess = createAsyncThunk('passwordUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
215
|
-
var _a, settings, password, _b,
|
|
216
|
-
var _e, _f, _g, _h, _j, _k, _l
|
|
217
|
-
return __generator(this, function (
|
|
218
|
-
switch (
|
|
216
|
+
var _a, settings, password, _b, id, infoId, _c, showBoard, mode, payload, data, boardInfoData;
|
|
217
|
+
var _d, _e, _f, _g, _h, _j, _k, _l;
|
|
218
|
+
return __generator(this, function (_m) {
|
|
219
|
+
switch (_m.label) {
|
|
219
220
|
case 0:
|
|
220
221
|
_a = thunkApi.getState(), settings = _a.settings, password = _a.password;
|
|
221
|
-
_b = password.data.verify.responseBody || {},
|
|
222
|
+
_b = password.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id;
|
|
222
223
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
223
|
-
if (!
|
|
224
|
+
if (!id)
|
|
224
225
|
return [2];
|
|
225
226
|
payload = {
|
|
226
227
|
lang: settings.data.language,
|
|
227
|
-
step_name: PASSWORD_STEP_NAMES.PASSWORD_SUCCESS
|
|
228
|
+
step_name: PASSWORD_STEP_NAMES.PASSWORD_SUCCESS,
|
|
229
|
+
id: id
|
|
228
230
|
};
|
|
229
|
-
return [4, API.boardService.updateBoardInfo(__assign({ id:
|
|
231
|
+
return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
|
|
230
232
|
case 1:
|
|
231
|
-
data =
|
|
233
|
+
data = _m.sent();
|
|
232
234
|
if (!showBoard && mode === 'content') {
|
|
233
|
-
(
|
|
234
|
-
(
|
|
235
|
-
return [2, {
|
|
235
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
|
|
236
|
+
(_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: data });
|
|
237
|
+
return [2, { response: __assign({}, data), formData: params }];
|
|
236
238
|
}
|
|
237
|
-
|
|
238
|
-
return [4, Promise.all([
|
|
239
|
-
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
240
|
-
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
241
|
-
])];
|
|
239
|
+
return [4, API.boardService.retrieveBoardInfoStatus(id)];
|
|
242
240
|
case 2:
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
241
|
+
boardInfoData = _m.sent();
|
|
242
|
+
return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
|
|
243
|
+
case 3:
|
|
244
|
+
_m.sent();
|
|
245
|
+
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, {});
|
|
246
|
+
(_l = (_k = settings.data.appConfig).onFlowCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, { data: data });
|
|
246
247
|
thunkApi.dispatch(handleNextScreenStep());
|
|
247
|
-
return [2, {
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
}); });
|
|
251
|
-
export var retrieveBoardStatus = createAsyncThunk('password/retrieveBoardStatus', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
252
|
-
var password, _a, board_id, board_info_id, recipient, _b, id, type, data;
|
|
253
|
-
return __generator(this, function (_c) {
|
|
254
|
-
switch (_c.label) {
|
|
255
|
-
case 0:
|
|
256
|
-
password = thunkApi.getState().password;
|
|
257
|
-
_a = password.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id, recipient = _a.recipient;
|
|
258
|
-
if (!board_id || !board_info_id)
|
|
259
|
-
throw new Error('Internal server error');
|
|
260
|
-
_b = recipient || {}, id = _b.id, type = _b.type;
|
|
261
|
-
return [4, Promise.all([
|
|
262
|
-
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
263
|
-
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
264
|
-
])];
|
|
265
|
-
case 1:
|
|
266
|
-
data = (_c.sent())[0];
|
|
267
|
-
thunkApi.dispatch(handlePrevScreenStep());
|
|
268
|
-
return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
248
|
+
return [2, { response: __assign(__assign({}, data), { flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [] }), formData: params }];
|
|
269
249
|
}
|
|
270
250
|
});
|
|
271
251
|
}); });
|
|
272
252
|
export var verifyOperationToken = createAsyncThunk('verifyOperationToken', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
273
|
-
var token, boardId, boardInfoId,
|
|
274
|
-
var
|
|
275
|
-
return __generator(this, function (
|
|
276
|
-
switch (
|
|
253
|
+
var token, boardId, boardInfoId, boardInfoData, boardStatusData, individualData, boardData, payload, data, _a, id_2, type_2, serviceCallBack, _b, boardRes, individualRes;
|
|
254
|
+
var _c, _d, _e, _f;
|
|
255
|
+
return __generator(this, function (_g) {
|
|
256
|
+
switch (_g.label) {
|
|
277
257
|
case 0:
|
|
278
|
-
token = params.token, boardId = params.boardId, boardInfoId = params.boardInfoId
|
|
258
|
+
token = params.token, boardId = params.boardId, boardInfoId = params.boardInfoId;
|
|
259
|
+
boardData = undefined;
|
|
279
260
|
payload = {
|
|
280
261
|
auth_type: 7,
|
|
281
262
|
auth_token: token
|
|
282
263
|
};
|
|
283
264
|
return [4, API.authService.verifyAuth(payload)];
|
|
284
265
|
case 1:
|
|
285
|
-
data = (
|
|
286
|
-
if (
|
|
287
|
-
|
|
288
|
-
countryIso2 = data === null || data === void 0 ? void 0 : data.country;
|
|
289
|
-
if (countryIso2)
|
|
290
|
-
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
291
|
-
publicKey = (_b = data === null || data === void 0 ? void 0 : data.config) === null || _b === void 0 ? void 0 : _b.public_key;
|
|
292
|
-
if (publicKey)
|
|
293
|
-
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
294
|
-
if (!!(data === null || data === void 0 ? void 0 : data.country)) return [3, 3];
|
|
295
|
-
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
266
|
+
data = (_g.sent()).data;
|
|
267
|
+
if (!boardId) return [3, 7];
|
|
268
|
+
return [4, API.boardService.retrieveBoardInfoStatus(boardId)];
|
|
296
269
|
case 2:
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
thunkApi.dispatch(handleSetCountryByIso2(data_3.entity.country));
|
|
300
|
-
_d.label = 3;
|
|
270
|
+
boardStatusData = _g.sent();
|
|
271
|
+
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
301
272
|
case 3:
|
|
273
|
+
boardData = _g.sent();
|
|
274
|
+
if ((_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.country)
|
|
275
|
+
thunkApi.dispatch(handleSetCountryByIso2(boardData.entity.country));
|
|
276
|
+
if (!boardInfoId) return [3, 5];
|
|
277
|
+
return [4, API.boardService.retrieveBoardInfo({ id: boardId, infoId: boardInfoId })];
|
|
278
|
+
case 4:
|
|
279
|
+
boardInfoData = _g.sent();
|
|
280
|
+
_g.label = 5;
|
|
281
|
+
case 5:
|
|
282
|
+
_a = ((_d = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _d === void 0 ? void 0 : _d.recipient) || {}, id_2 = _a.id, type_2 = _a.type;
|
|
283
|
+
serviceCallBack = function () { return API.individualService.retrieveIndividual(id_2, type_2); };
|
|
284
|
+
return [4, retrieveIndividualData(type_2, boardData, serviceCallBack)];
|
|
285
|
+
case 6:
|
|
286
|
+
_b = _g.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
|
|
287
|
+
boardData = boardRes;
|
|
288
|
+
individualData = individualRes;
|
|
289
|
+
_g.label = 7;
|
|
290
|
+
case 7:
|
|
302
291
|
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
303
|
-
return [2,
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
292
|
+
return [2, {
|
|
293
|
+
data: data,
|
|
294
|
+
token: token,
|
|
295
|
+
boardId: boardId,
|
|
296
|
+
boardInfoId: boardInfoId,
|
|
297
|
+
individualData: individualData,
|
|
298
|
+
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { user: boardData === null || boardData === void 0 ? void 0 : boardData.user, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, name: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.names, contact: (_f = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _f === void 0 ? void 0 : _f.contact, business: boardData === null || boardData === void 0 ? void 0 : boardData.business, notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification }),
|
|
299
|
+
flows: (boardStatusData === null || boardStatusData === void 0 ? void 0 : boardStatusData.info) || []
|
|
300
|
+
}];
|
|
310
301
|
}
|
|
311
302
|
});
|
|
312
303
|
}); });
|
|
@@ -329,9 +320,9 @@ export var resendOperationOTP = createAsyncThunk('resendOperationOTPPassword', f
|
|
|
329
320
|
}); });
|
|
330
321
|
export var resetPassword = createAsyncThunk('resetPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
331
322
|
var _a, password, settings, responseBody, passwordData, payload, data;
|
|
332
|
-
var _b, _c
|
|
333
|
-
return __generator(this, function (
|
|
334
|
-
switch (
|
|
323
|
+
var _b, _c;
|
|
324
|
+
return __generator(this, function (_d) {
|
|
325
|
+
switch (_d.label) {
|
|
335
326
|
case 0:
|
|
336
327
|
_a = thunkApi.getState(), password = _a.password, settings = _a.settings;
|
|
337
328
|
responseBody = password.data.verify.responseBody;
|
|
@@ -348,42 +339,39 @@ export var resetPassword = createAsyncThunk('resetPassword', function (params, t
|
|
|
348
339
|
};
|
|
349
340
|
return [4, API.authService.verifyAuth(payload)];
|
|
350
341
|
case 1:
|
|
351
|
-
data = (
|
|
352
|
-
if ((_b = data === null || data === void 0 ? void 0 : data.errors) === null || _b === void 0 ? void 0 : _b.length)
|
|
353
|
-
throw new Error(data.errors[0].description);
|
|
342
|
+
data = (_d.sent()).data;
|
|
354
343
|
if (!(data === null || data === void 0 ? void 0 : data.errors)) {
|
|
355
|
-
|
|
356
|
-
(
|
|
344
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP'));
|
|
345
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, payload);
|
|
357
346
|
}
|
|
358
347
|
return [2, { data: data, formData: __assign(__assign({}, params), passwordData) }];
|
|
359
348
|
}
|
|
360
349
|
});
|
|
361
350
|
}); });
|
|
362
351
|
export var retrieveBoardResetPasswordSuccess = createAsyncThunk('retrieveBoardResetPasswordSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
363
|
-
var _a, password, settings, _b,
|
|
364
|
-
var _e, _f, _g, _h, _j, _k, _l
|
|
365
|
-
return __generator(this, function (
|
|
366
|
-
switch (
|
|
352
|
+
var _a, password, settings, _b, id, boardResponse, _c, showBoard, mode, boardInfoData;
|
|
353
|
+
var _d, _e, _f, _g, _h, _j, _k, _l;
|
|
354
|
+
return __generator(this, function (_m) {
|
|
355
|
+
switch (_m.label) {
|
|
367
356
|
case 0:
|
|
368
357
|
_a = thunkApi.getState(), password = _a.password, settings = _a.settings;
|
|
369
|
-
_b = password.data.verify.responseBody || { board_id: '' },
|
|
358
|
+
_b = password.data.verify.responseBody || { board_id: '' }, id = _b.board_id, boardResponse = _b.boardResponse;
|
|
370
359
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
371
360
|
if (!showBoard && mode === 'content') {
|
|
372
|
-
(
|
|
373
|
-
(
|
|
374
|
-
return [2, { id:
|
|
361
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
|
|
362
|
+
(_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: boardResponse });
|
|
363
|
+
return [2, { id: id, response: {} }];
|
|
375
364
|
}
|
|
376
|
-
|
|
377
|
-
return [4, Promise.all([
|
|
378
|
-
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
379
|
-
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
380
|
-
])];
|
|
365
|
+
return [4, API.boardService.retrieveBoardInfoStatus(id)];
|
|
381
366
|
case 1:
|
|
382
|
-
|
|
367
|
+
boardInfoData = _m.sent();
|
|
368
|
+
return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
|
|
369
|
+
case 2:
|
|
370
|
+
_m.sent();
|
|
383
371
|
thunkApi.dispatch(handleNextScreenStep());
|
|
384
|
-
(
|
|
385
|
-
(
|
|
386
|
-
return [2, { id:
|
|
372
|
+
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, { id: id });
|
|
373
|
+
(_l = (_k = settings.data.appConfig).onFlowCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, id);
|
|
374
|
+
return [2, { id: id, response: { flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [] } }];
|
|
387
375
|
}
|
|
388
376
|
});
|
|
389
377
|
}); });
|
|
@@ -438,11 +426,17 @@ export var passwordSlice = createSlice({
|
|
|
438
426
|
extraReducers: function (builder) {
|
|
439
427
|
builder
|
|
440
428
|
.addCase(verifyLeadToken.fulfilled, function (state, action) {
|
|
429
|
+
var _a;
|
|
441
430
|
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.SET_PASSWORD;
|
|
442
431
|
state.error = null;
|
|
443
432
|
state.customLoading = false;
|
|
444
|
-
var
|
|
445
|
-
|
|
433
|
+
var _b = action.payload, data = _b.data, token = _b.token, boardResponse = _b.boardResponse;
|
|
434
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
435
|
+
if (description) {
|
|
436
|
+
state.error = description;
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: data.id });
|
|
446
440
|
state.data.verify.token = token;
|
|
447
441
|
})
|
|
448
442
|
.addCase(verifyLeadToken.pending, function (state) {
|
|
@@ -475,12 +469,17 @@ export var passwordSlice = createSlice({
|
|
|
475
469
|
state.error = null;
|
|
476
470
|
})
|
|
477
471
|
.addCase(verifyPasswordLeadOTP.fulfilled, function (state, action) {
|
|
472
|
+
var _a;
|
|
478
473
|
state.loading = false;
|
|
479
474
|
state.error = null;
|
|
480
|
-
var
|
|
475
|
+
var _b = action.payload, data = _b.data, formData = _b.formData;
|
|
476
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
477
|
+
if (description) {
|
|
478
|
+
state.error = description;
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
481
|
state.data.otpData = formData;
|
|
482
482
|
state.data.otpData.responseBody = data;
|
|
483
|
-
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: data.id });
|
|
484
483
|
})
|
|
485
484
|
.addCase(verifyPasswordLeadOTP.rejected, function (state, action) {
|
|
486
485
|
state.loading = false;
|
|
@@ -514,7 +513,7 @@ export var passwordSlice = createSlice({
|
|
|
514
513
|
.addCase(retrieveBoardDetails.fulfilled, function (state, action) {
|
|
515
514
|
state.error = null;
|
|
516
515
|
state.loading = false;
|
|
517
|
-
var data = action.payload || {};
|
|
516
|
+
var data = (action.payload || {}).data;
|
|
518
517
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
519
518
|
})
|
|
520
519
|
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
@@ -522,11 +521,15 @@ export var passwordSlice = createSlice({
|
|
|
522
521
|
state.loading = false;
|
|
523
522
|
})
|
|
524
523
|
.addCase(updateBoardSuccess.fulfilled, function (state, action) {
|
|
525
|
-
var _a;
|
|
526
524
|
state.loading = false;
|
|
527
525
|
state.error = null;
|
|
528
|
-
var
|
|
529
|
-
|
|
526
|
+
var response = (action.payload || {}).response;
|
|
527
|
+
var flows = response.flows;
|
|
528
|
+
var _a = state.data.verify.responseBody || {}, individuals = _a.individuals, individualData = _a.individualData;
|
|
529
|
+
var data_state = (individualData || {}).data_state;
|
|
530
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
|
|
531
|
+
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
532
|
+
}));
|
|
530
533
|
})
|
|
531
534
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
532
535
|
state.loading = true;
|
|
@@ -535,27 +538,20 @@ export var passwordSlice = createSlice({
|
|
|
535
538
|
.addCase(updateBoardSuccess.rejected, function (state, action) {
|
|
536
539
|
state.loading = false;
|
|
537
540
|
state.error = action.error.message;
|
|
538
|
-
})
|
|
539
|
-
.addCase(retrieveBoardStatus.pending, function (state) {
|
|
540
|
-
state.error = null;
|
|
541
|
-
state.loading = true;
|
|
542
|
-
})
|
|
543
|
-
.addCase(retrieveBoardStatus.fulfilled, function (state, action) {
|
|
544
|
-
state.error = null;
|
|
545
|
-
state.loading = false;
|
|
546
|
-
var flows = (action.payload || {}).flows;
|
|
547
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
|
|
548
|
-
})
|
|
549
|
-
.addCase(retrieveBoardStatus.rejected, function (state, action) {
|
|
550
|
-
state.error = action.error.message;
|
|
551
|
-
state.loading = false;
|
|
552
541
|
})
|
|
553
542
|
.addCase(verifyOperationToken.fulfilled, function (state, action) {
|
|
543
|
+
var _a;
|
|
554
544
|
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.RESET_PASSWORD;
|
|
555
545
|
state.error = null;
|
|
556
546
|
state.customLoading = false;
|
|
557
|
-
var
|
|
558
|
-
state.data.verify.responseBody = __assign(__assign(__assign(
|
|
547
|
+
var _b = action.payload, data = _b.data, token = _b.token, boardId = _b.boardId, flows = _b.flows, boardResponse = _b.boardResponse, boardInfoId = _b.boardInfoId;
|
|
548
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, boardResponse), state.data.verify.responseBody), { board_id: boardId, board_info_id: boardInfoId, flows: flows });
|
|
549
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
550
|
+
if (description) {
|
|
551
|
+
state.error = description;
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: boardId, board_info_id: boardInfoId, flows: flows });
|
|
559
555
|
state.data.verify.token = token;
|
|
560
556
|
})
|
|
561
557
|
.addCase(verifyOperationToken.pending, function (state) {
|
|
@@ -584,10 +580,16 @@ export var passwordSlice = createSlice({
|
|
|
584
580
|
state.error = action.error.message;
|
|
585
581
|
})
|
|
586
582
|
.addCase(resetPassword.fulfilled, function (state, action) {
|
|
583
|
+
var _a;
|
|
587
584
|
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.RESET_PASSWORD;
|
|
588
585
|
state.error = null;
|
|
589
586
|
state.loading = false;
|
|
590
|
-
var
|
|
587
|
+
var _b = action.payload, data = _b.data, formData = _b.formData;
|
|
588
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
589
|
+
if (description) {
|
|
590
|
+
state.error = description;
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
591
593
|
state.data.passwordData = formData;
|
|
592
594
|
state.data.passwordData.responseBody = data;
|
|
593
595
|
})
|
|
@@ -602,8 +604,13 @@ export var passwordSlice = createSlice({
|
|
|
602
604
|
.addCase(retrieveBoardResetPasswordSuccess.fulfilled, function (state, action) {
|
|
603
605
|
state.loading = false;
|
|
604
606
|
state.error = null;
|
|
605
|
-
var
|
|
606
|
-
|
|
607
|
+
var response = (action.payload || {}).response;
|
|
608
|
+
var flows = response.flows;
|
|
609
|
+
var _a = state.data.verify.responseBody || {}, individuals = _a.individuals, individualData = _a.individualData;
|
|
610
|
+
var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
|
|
611
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
|
|
612
|
+
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
613
|
+
}));
|
|
607
614
|
})
|
|
608
615
|
.addCase(retrieveBoardResetPasswordSuccess.pending, function (state) {
|
|
609
616
|
state.loading = true;
|