@tap-payments/auth-jsconnect 2.8.62-beta → 2.8.62-development
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/redux.d.ts +1 -0
- package/build/api/entity.d.ts +2 -2
- package/build/api/entity.js +12 -4
- package/build/api/index.d.ts +2 -2
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +0 -1
- package/build/constants/api.js +0 -2
- package/build/constants/app.d.ts +0 -2
- package/build/constants/app.js +0 -2
- package/build/features/app/bank/bankStore.d.ts +13 -19
- package/build/features/app/bank/bankStore.js +183 -165
- package/build/features/app/board/boardStore.js +16 -10
- package/build/features/app/brand/brandStore.d.ts +16 -31
- package/build/features/app/brand/brandStore.js +243 -239
- package/build/features/app/business/businessStore.js +7 -1
- package/build/features/app/entity/entityStore.d.ts +20 -34
- package/build/features/app/entity/entityStore.js +204 -249
- package/build/features/app/individual/individualStore.d.ts +17 -36
- package/build/features/app/individual/individualStore.js +221 -270
- package/build/features/app/password/passwordStore.d.ts +19 -25
- package/build/features/app/password/passwordStore.js +170 -216
- package/build/features/app/tax/taxStore.d.ts +13 -7
- package/build/features/app/tax/taxStore.js +168 -147
- package/build/features/bank/screens/BankDetails/BankDetails.js +17 -4
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +48 -11
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +22 -4
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +22 -6
- package/build/features/business/screens/Activities/Activities.js +9 -1
- package/build/features/business/screens/Customers/Customers.js +9 -1
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +33 -9
- package/build/features/entity/screens/EntityName/EntityName.js +31 -14
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +43 -10
- package/build/features/individual/screens/IndividualList/IndividualList.js +7 -0
- package/build/features/individual/screens/IndividualList/UserList.js +3 -3
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +73 -18
- package/build/features/password/Password.js +1 -1
- package/build/features/shared/Button/FlowsButtons.js +7 -1
- package/build/features/signIn/SignIn.js +10 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useFormDirtyCheck.d.ts +10 -0
- package/build/hooks/useFormDirtyCheck.js +66 -0
- package/build/utils/common.js +4 -4
- package/package.json +2 -2
|
@@ -55,10 +55,10 @@ import { retrieveIndividualData, sleep } from '../../../utils';
|
|
|
55
55
|
export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', function (_a, thunkApi) {
|
|
56
56
|
var token = _a.token, isInternally = _a.isInternally;
|
|
57
57
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
-
var payload, data,
|
|
59
|
-
var
|
|
60
|
-
return __generator(this, function (
|
|
61
|
-
switch (
|
|
58
|
+
var payload, data, _b, config, board_info_password_status, country_code, board_id, countryIso2, publicKey, data_1;
|
|
59
|
+
var _c, _d;
|
|
60
|
+
return __generator(this, function (_e) {
|
|
61
|
+
switch (_e.label) {
|
|
62
62
|
case 0:
|
|
63
63
|
payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
|
|
64
64
|
notification: {
|
|
@@ -67,63 +67,36 @@ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', functio
|
|
|
67
67
|
}));
|
|
68
68
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
69
69
|
case 1:
|
|
70
|
-
data = (
|
|
71
|
-
|
|
72
|
-
if (((_e = data === null || data === void 0 ? void 0 : data.errors) === null || _e === void 0 ? void 0 : _e.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
70
|
+
data = (_e.sent()).data;
|
|
71
|
+
if (((_c = data === null || data === void 0 ? void 0 : data.errors) === null || _c === void 0 ? void 0 : _c.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
73
72
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
74
73
|
if (isInternally)
|
|
75
74
|
data.step_name = PASSWORD_STEP_NAMES.PASSWORD_INFO;
|
|
76
|
-
_b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.board_id
|
|
75
|
+
_b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.board_id;
|
|
76
|
+
countryIso2 = country_code;
|
|
77
|
+
if (countryIso2)
|
|
78
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
77
79
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
78
|
-
if (publicKey)
|
|
80
|
+
if (publicKey)
|
|
79
81
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
80
|
-
|
|
81
|
-
if (country_code) {
|
|
82
|
-
countryIso2 = country_code;
|
|
83
|
-
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
84
|
-
}
|
|
85
|
-
if (!board_id) return [3, 7];
|
|
86
|
-
if (!board_info_id) return [3, 3];
|
|
87
|
-
return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
|
|
88
|
-
case 2:
|
|
89
|
-
boardInfoData = _l.sent();
|
|
90
|
-
_l.label = 3;
|
|
91
|
-
case 3: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
|
|
92
|
-
case 4:
|
|
93
|
-
boardStatusData = _l.sent();
|
|
82
|
+
if (!!country_code) return [3, 3];
|
|
94
83
|
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
95
|
-
case
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
case
|
|
101
|
-
_d = _l.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
|
|
102
|
-
boardData = boardRes;
|
|
103
|
-
individualData = individualRes;
|
|
104
|
-
_l.label = 7;
|
|
105
|
-
case 7:
|
|
106
|
-
if (!country_code && ((_g = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _g === void 0 ? void 0 : _g.country)) {
|
|
107
|
-
countryIso2 = boardData.entity.country;
|
|
108
|
-
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
109
|
-
}
|
|
110
|
-
info = (boardStatusData || {}).info;
|
|
111
|
-
hasPasswordCompleted = ((_h = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'password'; })) === null || _h === void 0 ? void 0 : _h.status) === 'completed';
|
|
84
|
+
case 2:
|
|
85
|
+
data_1 = _e.sent();
|
|
86
|
+
if ((_d = data_1 === null || data_1 === void 0 ? void 0 : data_1.entity) === null || _d === void 0 ? void 0 : _d.country)
|
|
87
|
+
thunkApi.dispatch(handleSetCountryByIso2(data_1.entity.country));
|
|
88
|
+
_e.label = 3;
|
|
89
|
+
case 3:
|
|
112
90
|
if (data.step_name === PASSWORD_STEP_NAMES.PHONE_AUTH) {
|
|
113
91
|
thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_VERIFY_STEP'));
|
|
114
92
|
}
|
|
115
|
-
else if (
|
|
93
|
+
else if (board_info_password_status === 'completed') {
|
|
116
94
|
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
117
95
|
}
|
|
118
96
|
else if (data.step_name === PASSWORD_STEP_NAMES.PASSWORD_INFO) {
|
|
119
97
|
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
120
98
|
}
|
|
121
|
-
return [2, {
|
|
122
|
-
data: data,
|
|
123
|
-
individualData: individualData,
|
|
124
|
-
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: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.names, contact: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.contact, business: boardData === null || boardData === void 0 ? void 0 : boardData.business, notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification }),
|
|
125
|
-
token: token
|
|
126
|
-
}];
|
|
99
|
+
return [2, { data: data, token: token }];
|
|
127
100
|
}
|
|
128
101
|
});
|
|
129
102
|
});
|
|
@@ -145,54 +118,74 @@ export var resendOTP = createAsyncThunk('resendOTPPassword', function (params, t
|
|
|
145
118
|
}
|
|
146
119
|
});
|
|
147
120
|
}); });
|
|
148
|
-
export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails', function (
|
|
149
|
-
var
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
121
|
+
export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails', function (_a) {
|
|
122
|
+
var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
|
|
123
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
124
|
+
var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
|
|
125
|
+
var _c, _d, _e;
|
|
126
|
+
return __generator(this, function (_f) {
|
|
127
|
+
switch (_f.label) {
|
|
128
|
+
case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
129
|
+
case 1:
|
|
130
|
+
data = _f.sent();
|
|
131
|
+
individualData = data === null || data === void 0 ? void 0 : data.user;
|
|
132
|
+
boardData = data;
|
|
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, board_status: boardData === null || boardData === void 0 ? void 0 : boardData.status })];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
160
144
|
});
|
|
161
|
-
});
|
|
145
|
+
});
|
|
162
146
|
export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
163
|
-
var _a, password, settings, responseBody, payload, data,
|
|
164
|
-
var
|
|
165
|
-
return __generator(this, function (
|
|
166
|
-
switch (
|
|
147
|
+
var _a, password, settings, responseBody, payload, data, _b, config, board_info_password_status, country_code, board_id, countryIso2, publicKey, data_2;
|
|
148
|
+
var _c, _d, _e, _f, _g;
|
|
149
|
+
return __generator(this, function (_h) {
|
|
150
|
+
switch (_h.label) {
|
|
167
151
|
case 0:
|
|
168
152
|
_a = thunkApi.getState(), password = _a.password, settings = _a.settings;
|
|
169
153
|
responseBody = password.data.verify.responseBody;
|
|
170
154
|
payload = {
|
|
171
155
|
data: params.otp,
|
|
172
|
-
service_name: (
|
|
156
|
+
service_name: (_c = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _c === void 0 ? void 0 : _c.service_name,
|
|
173
157
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
174
158
|
step_name: PASSWORD_STEP_NAMES.PHONE_AUTH,
|
|
175
159
|
encryption_contract: ['data']
|
|
176
160
|
};
|
|
177
161
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
178
162
|
case 1:
|
|
179
|
-
data = (
|
|
180
|
-
if (
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
(
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return [
|
|
163
|
+
data = (_h.sent()).data;
|
|
164
|
+
if ((_d = data === null || data === void 0 ? void 0 : data.errors) === null || _d === void 0 ? void 0 : _d.length)
|
|
165
|
+
throw new Error(data.errors[0].description);
|
|
166
|
+
_b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.board_id;
|
|
167
|
+
countryIso2 = country_code;
|
|
168
|
+
if (countryIso2)
|
|
169
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
170
|
+
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
171
|
+
if (publicKey)
|
|
172
|
+
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
173
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, { otp: params.otp });
|
|
174
|
+
if (!(board_info_password_status === 'completed')) return [3, 2];
|
|
175
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
176
|
+
return [3, 5];
|
|
177
|
+
case 2:
|
|
178
|
+
if (!!country_code) return [3, 4];
|
|
179
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
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) }];
|
|
196
189
|
}
|
|
197
190
|
});
|
|
198
191
|
}); });
|
|
@@ -219,38 +212,39 @@ export var createPassword = createAsyncThunk('createPassword', function (params,
|
|
|
219
212
|
});
|
|
220
213
|
}); });
|
|
221
214
|
export var updateBoardSuccess = createAsyncThunk('passwordUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
222
|
-
var _a, settings, password, _b,
|
|
223
|
-
var
|
|
224
|
-
return __generator(this, function (
|
|
225
|
-
switch (
|
|
215
|
+
var _a, settings, password, _b, board_id, infoId, _c, showBoard, mode, payload, data, _d, id, type, boardInfoStatusData;
|
|
216
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
217
|
+
return __generator(this, function (_p) {
|
|
218
|
+
switch (_p.label) {
|
|
226
219
|
case 0:
|
|
227
220
|
_a = thunkApi.getState(), settings = _a.settings, password = _a.password;
|
|
228
|
-
_b = password.data.verify.responseBody || {},
|
|
221
|
+
_b = password.data.verify.responseBody || {}, board_id = _b.board_id, infoId = _b.board_info_id;
|
|
229
222
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
230
|
-
if (!
|
|
223
|
+
if (!board_id)
|
|
231
224
|
return [2];
|
|
232
225
|
payload = {
|
|
233
226
|
lang: settings.data.language,
|
|
234
227
|
step_name: PASSWORD_STEP_NAMES.PASSWORD_SUCCESS
|
|
235
228
|
};
|
|
236
|
-
return [4, API.boardService.updateBoardInfo(__assign({ id:
|
|
229
|
+
return [4, API.boardService.updateBoardInfo(__assign({ id: board_id, infoId: infoId }, payload))];
|
|
237
230
|
case 1:
|
|
238
|
-
data =
|
|
231
|
+
data = _p.sent();
|
|
239
232
|
if (!showBoard && mode === 'content') {
|
|
240
|
-
(
|
|
241
|
-
(
|
|
242
|
-
return [2, {
|
|
233
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
|
|
234
|
+
(_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
|
|
235
|
+
return [2, { data: data }];
|
|
243
236
|
}
|
|
244
|
-
|
|
237
|
+
_d = ((_j = data === null || data === void 0 ? void 0 : data.notification) === null || _j === void 0 ? void 0 : _j.recipient) || {}, id = _d.id, type = _d.type;
|
|
238
|
+
return [4, Promise.all([
|
|
239
|
+
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
240
|
+
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
241
|
+
])];
|
|
245
242
|
case 2:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
_m.sent();
|
|
250
|
-
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, {});
|
|
251
|
-
(_l = (_k = settings.data.appConfig).onFlowCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, { data: data });
|
|
243
|
+
boardInfoStatusData = (_p.sent())[0];
|
|
244
|
+
(_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, {});
|
|
245
|
+
(_o = (_m = settings.data.appConfig).onFlowCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, { data: data });
|
|
252
246
|
thunkApi.dispatch(handleNextScreenStep());
|
|
253
|
-
return [2, { data: data, flows: (
|
|
247
|
+
return [2, { data: data, flows: (boardInfoStatusData === null || boardInfoStatusData === void 0 ? void 0 : boardInfoStatusData.info) || [] }];
|
|
254
248
|
}
|
|
255
249
|
});
|
|
256
250
|
}); });
|
|
@@ -264,7 +258,10 @@ export var retrieveBoardStatus = createAsyncThunk('password/retrieveBoardStatus'
|
|
|
264
258
|
if (!board_id || !board_info_id)
|
|
265
259
|
throw new Error('Internal server error');
|
|
266
260
|
_b = recipient || {}, id = _b.id, type = _b.type;
|
|
267
|
-
return [4, Promise.all([
|
|
261
|
+
return [4, Promise.all([
|
|
262
|
+
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
263
|
+
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
264
|
+
])];
|
|
268
265
|
case 1:
|
|
269
266
|
data = (_c.sent())[0];
|
|
270
267
|
thunkApi.dispatch(handlePrevScreenStep());
|
|
@@ -273,54 +270,43 @@ export var retrieveBoardStatus = createAsyncThunk('password/retrieveBoardStatus'
|
|
|
273
270
|
});
|
|
274
271
|
}); });
|
|
275
272
|
export var verifyOperationToken = createAsyncThunk('verifyOperationToken', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
276
|
-
var token, boardId, boardInfoId,
|
|
277
|
-
var
|
|
278
|
-
return __generator(this, function (
|
|
279
|
-
switch (
|
|
273
|
+
var token, boardId, boardInfoId, userId, userType, payload, data, countryIso2, publicKey, data_3;
|
|
274
|
+
var _a, _b, _c;
|
|
275
|
+
return __generator(this, function (_d) {
|
|
276
|
+
switch (_d.label) {
|
|
280
277
|
case 0:
|
|
281
|
-
token = params.token, boardId = params.boardId, boardInfoId = params.boardInfoId;
|
|
282
|
-
boardData = undefined;
|
|
278
|
+
token = params.token, boardId = params.boardId, boardInfoId = params.boardInfoId, userId = params.userId, userType = params.userType;
|
|
283
279
|
payload = {
|
|
284
280
|
auth_type: 7,
|
|
285
281
|
auth_token: token
|
|
286
282
|
};
|
|
287
283
|
return [4, API.authService.verifyAuth(payload)];
|
|
288
284
|
case 1:
|
|
289
|
-
data = (
|
|
290
|
-
if (
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
285
|
+
data = (_d.sent()).data;
|
|
286
|
+
if ((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a.length)
|
|
287
|
+
throw new Error(data.errors[0].description);
|
|
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];
|
|
294
295
|
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
296
|
+
case 2:
|
|
297
|
+
data_3 = _d.sent();
|
|
298
|
+
if ((_c = data_3 === null || data_3 === void 0 ? void 0 : data_3.entity) === null || _c === void 0 ? void 0 : _c.country)
|
|
299
|
+
thunkApi.dispatch(handleSetCountryByIso2(data_3.entity.country));
|
|
300
|
+
_d.label = 3;
|
|
295
301
|
case 3:
|
|
296
|
-
boardData = _g.sent();
|
|
297
|
-
if ((_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.country)
|
|
298
|
-
thunkApi.dispatch(handleSetCountryByIso2(boardData.entity.country));
|
|
299
|
-
if (!boardInfoId) return [3, 5];
|
|
300
|
-
return [4, API.boardService.retrieveBoardInfo({ id: boardId, infoId: boardInfoId })];
|
|
301
|
-
case 4:
|
|
302
|
-
boardInfoData = _g.sent();
|
|
303
|
-
_g.label = 5;
|
|
304
|
-
case 5:
|
|
305
|
-
_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;
|
|
306
|
-
serviceCallBack = function () { return API.individualService.retrieveIndividual(id_2, type_2); };
|
|
307
|
-
return [4, retrieveIndividualData(type_2, boardData, serviceCallBack)];
|
|
308
|
-
case 6:
|
|
309
|
-
_b = _g.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
|
|
310
|
-
boardData = boardRes;
|
|
311
|
-
individualData = individualRes;
|
|
312
|
-
_g.label = 7;
|
|
313
|
-
case 7:
|
|
314
302
|
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
315
|
-
return [2, {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
flows: (boardStatusData === null || boardStatusData === void 0 ? void 0 : boardStatusData.info) || []
|
|
323
|
-
}];
|
|
303
|
+
return [2, __assign({ data: data, token: token, boardId: boardId, boardInfoId: boardInfoId }, (userId &&
|
|
304
|
+
userType && {
|
|
305
|
+
recipient: {
|
|
306
|
+
id: userId,
|
|
307
|
+
type: userType
|
|
308
|
+
}
|
|
309
|
+
}))];
|
|
324
310
|
}
|
|
325
311
|
});
|
|
326
312
|
}); });
|
|
@@ -374,29 +360,30 @@ export var resetPassword = createAsyncThunk('resetPassword', function (params, t
|
|
|
374
360
|
});
|
|
375
361
|
}); });
|
|
376
362
|
export var retrieveBoardResetPasswordSuccess = createAsyncThunk('retrieveBoardResetPasswordSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
377
|
-
var _a, password, settings, _b,
|
|
378
|
-
var
|
|
379
|
-
return __generator(this, function (
|
|
380
|
-
switch (
|
|
363
|
+
var _a, password, settings, _b, board_id, boardResponse, recipient, _c, showBoard, mode, _d, id, type, data;
|
|
364
|
+
var _e, _f, _g, _h, _j, _k, _l, _m;
|
|
365
|
+
return __generator(this, function (_o) {
|
|
366
|
+
switch (_o.label) {
|
|
381
367
|
case 0:
|
|
382
368
|
_a = thunkApi.getState(), password = _a.password, settings = _a.settings;
|
|
383
|
-
_b = password.data.verify.responseBody || { board_id: '' },
|
|
369
|
+
_b = password.data.verify.responseBody || { board_id: '' }, board_id = _b.board_id, boardResponse = _b.boardResponse, recipient = _b.recipient;
|
|
384
370
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
385
371
|
if (!showBoard && mode === 'content') {
|
|
386
|
-
(
|
|
387
|
-
(
|
|
388
|
-
return [2, { id:
|
|
372
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
|
|
373
|
+
(_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: boardResponse });
|
|
374
|
+
return [2, { id: board_id, flows: [] }];
|
|
389
375
|
}
|
|
390
|
-
|
|
376
|
+
_d = recipient || {}, id = _d.id, type = _d.type;
|
|
377
|
+
return [4, Promise.all([
|
|
378
|
+
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
379
|
+
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
380
|
+
])];
|
|
391
381
|
case 1:
|
|
392
|
-
|
|
393
|
-
return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
|
|
394
|
-
case 2:
|
|
395
|
-
_m.sent();
|
|
382
|
+
data = (_o.sent())[0];
|
|
396
383
|
thunkApi.dispatch(handleNextScreenStep());
|
|
397
|
-
(
|
|
398
|
-
(
|
|
399
|
-
return [2, { id:
|
|
384
|
+
(_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, { id: id });
|
|
385
|
+
(_m = (_l = settings.data.appConfig).onFlowCompleted) === null || _m === void 0 ? void 0 : _m.call(_l, board_id);
|
|
386
|
+
return [2, { id: board_id, flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
400
387
|
}
|
|
401
388
|
});
|
|
402
389
|
}); });
|
|
@@ -451,17 +438,11 @@ export var passwordSlice = createSlice({
|
|
|
451
438
|
extraReducers: function (builder) {
|
|
452
439
|
builder
|
|
453
440
|
.addCase(verifyLeadToken.fulfilled, function (state, action) {
|
|
454
|
-
var _a;
|
|
455
441
|
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.SET_PASSWORD;
|
|
456
442
|
state.error = null;
|
|
457
443
|
state.customLoading = false;
|
|
458
|
-
var
|
|
459
|
-
|
|
460
|
-
if (description) {
|
|
461
|
-
state.error = description;
|
|
462
|
-
return;
|
|
463
|
-
}
|
|
464
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: data.id });
|
|
444
|
+
var _a = action.payload, data = _a.data, token = _a.token;
|
|
445
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: data.id });
|
|
465
446
|
state.data.verify.token = token;
|
|
466
447
|
})
|
|
467
448
|
.addCase(verifyLeadToken.pending, function (state) {
|
|
@@ -494,17 +475,12 @@ export var passwordSlice = createSlice({
|
|
|
494
475
|
state.error = null;
|
|
495
476
|
})
|
|
496
477
|
.addCase(verifyPasswordLeadOTP.fulfilled, function (state, action) {
|
|
497
|
-
var _a;
|
|
498
478
|
state.loading = false;
|
|
499
479
|
state.error = null;
|
|
500
|
-
var
|
|
501
|
-
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
502
|
-
if (description) {
|
|
503
|
-
state.error = description;
|
|
504
|
-
return;
|
|
505
|
-
}
|
|
480
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
506
481
|
state.data.otpData = formData;
|
|
507
482
|
state.data.otpData.responseBody = data;
|
|
483
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: data.id });
|
|
508
484
|
})
|
|
509
485
|
.addCase(verifyPasswordLeadOTP.rejected, function (state, action) {
|
|
510
486
|
state.loading = false;
|
|
@@ -538,7 +514,7 @@ export var passwordSlice = createSlice({
|
|
|
538
514
|
.addCase(retrieveBoardDetails.fulfilled, function (state, action) {
|
|
539
515
|
state.error = null;
|
|
540
516
|
state.loading = false;
|
|
541
|
-
var data =
|
|
517
|
+
var data = action.payload || {};
|
|
542
518
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
543
519
|
})
|
|
544
520
|
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
@@ -546,15 +522,11 @@ export var passwordSlice = createSlice({
|
|
|
546
522
|
state.loading = false;
|
|
547
523
|
})
|
|
548
524
|
.addCase(updateBoardSuccess.fulfilled, function (state, action) {
|
|
525
|
+
var _a;
|
|
549
526
|
state.loading = false;
|
|
550
527
|
state.error = null;
|
|
551
|
-
var
|
|
552
|
-
|
|
553
|
-
var _a = state.data.verify.responseBody || {}, individuals = _a.individuals, individualData = _a.individualData;
|
|
554
|
-
var data_state = (individualData || {}).data_state;
|
|
555
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
|
|
556
|
-
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
557
|
-
}));
|
|
528
|
+
var _b = action.payload || {}, flows = _b.flows, data = _b.data;
|
|
529
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, recipient: (_a = data === null || data === void 0 ? void 0 : data.notification) === null || _a === void 0 ? void 0 : _a.recipient });
|
|
558
530
|
})
|
|
559
531
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
560
532
|
state.loading = true;
|
|
@@ -563,20 +535,27 @@ export var passwordSlice = createSlice({
|
|
|
563
535
|
.addCase(updateBoardSuccess.rejected, function (state, action) {
|
|
564
536
|
state.loading = false;
|
|
565
537
|
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;
|
|
566
552
|
})
|
|
567
553
|
.addCase(verifyOperationToken.fulfilled, function (state, action) {
|
|
568
|
-
var _a;
|
|
569
554
|
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.RESET_PASSWORD;
|
|
570
555
|
state.error = null;
|
|
571
556
|
state.customLoading = false;
|
|
572
|
-
var
|
|
573
|
-
state.data.verify.responseBody = __assign(__assign(__assign({},
|
|
574
|
-
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
575
|
-
if (description) {
|
|
576
|
-
state.error = description;
|
|
577
|
-
return;
|
|
578
|
-
}
|
|
579
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: boardId, board_info_id: boardInfoId, flows: flows });
|
|
557
|
+
var _a = action.payload, data = _a.data, token = _a.token, boardId = _a.boardId, boardInfoId = _a.boardInfoId, recipient = _a.recipient;
|
|
558
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: boardId, board_info_id: boardInfoId }), (recipient && { recipient: recipient }));
|
|
580
559
|
state.data.verify.token = token;
|
|
581
560
|
})
|
|
582
561
|
.addCase(verifyOperationToken.pending, function (state) {
|
|
@@ -605,16 +584,10 @@ export var passwordSlice = createSlice({
|
|
|
605
584
|
state.error = action.error.message;
|
|
606
585
|
})
|
|
607
586
|
.addCase(resetPassword.fulfilled, function (state, action) {
|
|
608
|
-
var _a;
|
|
609
587
|
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.RESET_PASSWORD;
|
|
610
588
|
state.error = null;
|
|
611
589
|
state.loading = false;
|
|
612
|
-
var
|
|
613
|
-
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
614
|
-
if (description) {
|
|
615
|
-
state.error = description;
|
|
616
|
-
return;
|
|
617
|
-
}
|
|
590
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
618
591
|
state.data.passwordData = formData;
|
|
619
592
|
state.data.passwordData.responseBody = data;
|
|
620
593
|
})
|
|
@@ -629,13 +602,8 @@ export var passwordSlice = createSlice({
|
|
|
629
602
|
.addCase(retrieveBoardResetPasswordSuccess.fulfilled, function (state, action) {
|
|
630
603
|
state.loading = false;
|
|
631
604
|
state.error = null;
|
|
632
|
-
var
|
|
633
|
-
|
|
634
|
-
var _a = state.data.verify.responseBody || {}, individuals = _a.individuals, individualData = _a.individualData;
|
|
635
|
-
var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
|
|
636
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
|
|
637
|
-
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
638
|
-
}));
|
|
605
|
+
var flows = (action.payload || {}).flows;
|
|
606
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
|
|
639
607
|
})
|
|
640
608
|
.addCase(retrieveBoardResetPasswordSuccess.pending, function (state) {
|
|
641
609
|
state.loading = true;
|
|
@@ -656,20 +624,6 @@ export var passwordSlice = createSlice({
|
|
|
656
624
|
.addCase(onCloseCompletePassword.rejected, function (state, action) {
|
|
657
625
|
state.loading = false;
|
|
658
626
|
state.error = action.error.message;
|
|
659
|
-
})
|
|
660
|
-
.addCase(retrieveBoardStatus.pending, function (state) {
|
|
661
|
-
state.error = null;
|
|
662
|
-
state.loading = true;
|
|
663
|
-
})
|
|
664
|
-
.addCase(retrieveBoardStatus.fulfilled, function (state, action) {
|
|
665
|
-
state.error = null;
|
|
666
|
-
state.loading = false;
|
|
667
|
-
var flows = action.payload.flows;
|
|
668
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
|
|
669
|
-
})
|
|
670
|
-
.addCase(retrieveBoardStatus.rejected, function (state, action) {
|
|
671
|
-
state.error = action.error.message;
|
|
672
|
-
state.loading = false;
|
|
673
627
|
});
|
|
674
628
|
}
|
|
675
629
|
});
|
|
@@ -6,8 +6,7 @@ interface VerifyLeadTokenProps {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
8
8
|
data: any;
|
|
9
|
-
|
|
10
|
-
boardResponse: any;
|
|
9
|
+
entityData: any;
|
|
11
10
|
token: string;
|
|
12
11
|
}, VerifyLeadTokenProps, {
|
|
13
12
|
state?: unknown;
|
|
@@ -43,9 +42,12 @@ export declare const retrieveBoardStatus: import("@reduxjs/toolkit").AsyncThunk<
|
|
|
43
42
|
fulfilledMeta?: unknown;
|
|
44
43
|
rejectedMeta?: unknown;
|
|
45
44
|
}>;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
type RetrieveBoardProps = {
|
|
46
|
+
boardId: string;
|
|
47
|
+
individualId: string;
|
|
48
|
+
individualType: string;
|
|
49
|
+
};
|
|
50
|
+
export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<any, RetrieveBoardProps, {
|
|
49
51
|
state?: unknown;
|
|
50
52
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
51
53
|
extra?: unknown;
|
|
@@ -57,6 +59,7 @@ export declare const retrieveEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
57
59
|
}>;
|
|
58
60
|
export declare const verifyTaxLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
59
61
|
data: any;
|
|
62
|
+
entityData: any;
|
|
60
63
|
formData: OTPFormValues;
|
|
61
64
|
}, OTPFormValues, {
|
|
62
65
|
state?: unknown;
|
|
@@ -82,8 +85,11 @@ export declare const updateTaxInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
82
85
|
rejectedMeta?: unknown;
|
|
83
86
|
}>;
|
|
84
87
|
export declare const updateLeadSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
data: any;
|
|
89
|
+
flows?: undefined;
|
|
90
|
+
} | {
|
|
91
|
+
data: any;
|
|
92
|
+
flows: any;
|
|
87
93
|
} | undefined, void, {
|
|
88
94
|
state?: unknown;
|
|
89
95
|
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|