@tap-payments/auth-jsconnect 2.8.20-test → 2.8.22-test

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.
@@ -46,7 +46,6 @@ export declare const verifyBankLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
46
46
  rejectedMeta?: unknown;
47
47
  }>;
48
48
  export declare const retrieveBoardStatus: import("@reduxjs/toolkit").AsyncThunk<{
49
- data: any;
50
49
  flows: any;
51
50
  }, void, {
52
51
  state?: unknown;
@@ -165,52 +165,47 @@ export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (p
165
165
  });
166
166
  }); });
167
167
  export var retrieveBoardStatus = createAsyncThunk('bank/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
168
- var bank, _a, board_id, board_info_id, _b, boardInfoData, data, _c, id, type;
169
- var _d;
170
- return __generator(this, function (_e) {
171
- switch (_e.label) {
168
+ var bank, _a, board_id, board_info_id, recipient, _b, id, type, data;
169
+ return __generator(this, function (_c) {
170
+ switch (_c.label) {
172
171
  case 0:
173
172
  bank = thunkApi.getState().bank;
174
- _a = bank.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id;
173
+ _a = bank.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id, recipient = _a.recipient;
175
174
  if (!board_id || !board_info_id)
176
175
  throw new Error('Internal server error');
176
+ _b = recipient || {}, id = _b.id, type = _b.type;
177
177
  return [4, Promise.all([
178
- API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
179
- API.boardService.retrieveBoardInfoStatus(board_id)
178
+ API.boardService.retrieveBoardInfoStatus(board_id),
179
+ thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
180
180
  ])];
181
181
  case 1:
182
- _b = _e.sent(), boardInfoData = _b[0], data = _b[1];
183
- _c = ((_d = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _d === void 0 ? void 0 : _d.recipient) || {}, id = _c.id, type = _c.type;
184
- return [4, thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()];
185
- case 2:
186
- _e.sent();
182
+ data = (_c.sent())[0];
187
183
  thunkApi.dispatch(handlePrevScreenStep());
188
- return [2, { data: boardInfoData, flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
184
+ return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
189
185
  }
190
186
  });
191
187
  }); });
192
188
  export var retrieveBoardDetails = createAsyncThunk('bank/retrieveBoardDetails', function (_a) {
193
189
  var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
194
190
  return __awaiter(void 0, void 0, void 0, function () {
195
- var data, individualData, serviceCallBack, data_state;
196
- var _b, _c, _d;
197
- return __generator(this, function (_e) {
198
- switch (_e.label) {
191
+ var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
192
+ var _c, _d, _e;
193
+ return __generator(this, function (_f) {
194
+ switch (_f.label) {
199
195
  case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
200
196
  case 1:
201
- data = _e.sent();
197
+ data = _f.sent();
202
198
  individualData = data === null || data === void 0 ? void 0 : data.user;
203
- if (!(((_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.id) !== id)) return [3, 3];
199
+ boardData = data;
200
+ if (!(((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.id) !== id)) return [3, 3];
204
201
  serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
205
202
  return [4, retrieveIndividualData(type, data, serviceCallBack)];
206
203
  case 2:
207
- individualData = _e.sent();
208
- _e.label = 3;
209
- case 3:
210
- data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? data === null || data === void 0 ? void 0 : data.individuals : individualData) || {}).data_state;
211
- return [2, __assign(__assign(__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: (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.names, business: data === null || data === void 0 ? void 0 : data.business, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_d = data === null || data === void 0 ? void 0 : data.user) === null || _d === void 0 ? void 0 : _d.contact }), (individualData && { user: individualData })), (data_state && {
212
- individuals: __assign(__assign({}, data === null || data === void 0 ? void 0 : data.individuals), { data_state: data_state })
213
- }))];
204
+ _b = _f.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
205
+ individualData = individualRes;
206
+ boardData = boardRes;
207
+ _f.label = 3;
208
+ 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, business: boardData === null || boardData === void 0 ? void 0 : boardData.business, 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 })];
214
209
  }
215
210
  });
216
211
  });
@@ -465,8 +460,8 @@ export var bankSlice = createSlice({
465
460
  .addCase(retrieveBoardStatus.fulfilled, function (state, action) {
466
461
  state.error = null;
467
462
  state.loading = false;
468
- var _a = action.payload, flows = _a.flows, data = _a.data;
469
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, notification: data === null || data === void 0 ? void 0 : data.notification });
463
+ var flows = action.payload.flows;
464
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
470
465
  })
471
466
  .addCase(retrieveBoardStatus.rejected, function (state, action) {
472
467
  state.error = action.error.message;
@@ -64,7 +64,6 @@ export declare const retrieveSegmentDataList: import("@reduxjs/toolkit").AsyncTh
64
64
  rejectedMeta?: unknown;
65
65
  }>;
66
66
  export declare const retrieveBoardStatus: import("@reduxjs/toolkit").AsyncThunk<{
67
- data: any;
68
67
  flows: any;
69
68
  }, void, {
70
69
  state?: unknown;
@@ -214,52 +214,47 @@ export var retrieveSegmentDataList = createAsyncThunk('brandRetrieveSegmentDataL
214
214
  });
215
215
  }); });
216
216
  export var retrieveBoardStatus = createAsyncThunk('brand/retrieveBoardStatus', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
217
- var brand, _a, board_id, board_info_id, _b, boardInfoData, data, _c, id, type;
218
- var _d;
219
- return __generator(this, function (_e) {
220
- switch (_e.label) {
217
+ var brand, _a, board_id, board_info_id, recipient, _b, id, type, data;
218
+ return __generator(this, function (_c) {
219
+ switch (_c.label) {
221
220
  case 0:
222
221
  brand = thunkApi.getState().brand;
223
- _a = brand.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id;
222
+ _a = brand.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id, recipient = _a.recipient;
224
223
  if (!board_id || !board_info_id)
225
224
  throw new Error('Internal server error');
225
+ _b = recipient || {}, id = _b.id, type = _b.type;
226
226
  return [4, Promise.all([
227
- API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
228
- API.boardService.retrieveBoardInfoStatus(board_id)
227
+ API.boardService.retrieveBoardInfoStatus(board_id),
228
+ thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
229
229
  ])];
230
230
  case 1:
231
- _b = _e.sent(), boardInfoData = _b[0], data = _b[1];
232
- _c = ((_d = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _d === void 0 ? void 0 : _d.recipient) || {}, id = _c.id, type = _c.type;
233
- return [4, thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()];
234
- case 2:
235
- _e.sent();
231
+ data = (_c.sent())[0];
236
232
  thunkApi.dispatch(handlePrevScreenStep());
237
- return [2, { data: boardInfoData, flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
233
+ return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
238
234
  }
239
235
  });
240
236
  }); });
241
- export var retrieveBoardDetails = createAsyncThunk('brand/retrieveBrandInfo', function (_a) {
237
+ export var retrieveBoardDetails = createAsyncThunk('brand/retrieveBoardDetails', function (_a) {
242
238
  var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
243
239
  return __awaiter(void 0, void 0, void 0, function () {
244
- var data, individualData, serviceCallBack, data_state;
245
- var _b, _c, _d;
246
- return __generator(this, function (_e) {
247
- switch (_e.label) {
240
+ var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
241
+ var _c, _d, _e;
242
+ return __generator(this, function (_f) {
243
+ switch (_f.label) {
248
244
  case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
249
245
  case 1:
250
- data = _e.sent();
246
+ data = _f.sent();
251
247
  individualData = data === null || data === void 0 ? void 0 : data.user;
252
- if (!(((_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.id) !== id)) return [3, 3];
248
+ boardData = data;
249
+ if (!(((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.id) !== id)) return [3, 3];
253
250
  serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
254
251
  return [4, retrieveIndividualData(type, data, serviceCallBack)];
255
252
  case 2:
256
- individualData = _e.sent();
257
- _e.label = 3;
258
- case 3:
259
- data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? data === null || data === void 0 ? void 0 : data.individuals : individualData) || {}).data_state;
260
- return [2, __assign(__assign(__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: (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.names, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_d = data === null || data === void 0 ? void 0 : data.user) === null || _d === void 0 ? void 0 : _d.contact }), (individualData && { user: individualData })), (data_state && {
261
- individuals: __assign(__assign({}, data === null || data === void 0 ? void 0 : data.individuals), { data_state: data_state })
262
- }))];
253
+ _b = _f.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
254
+ individualData = individualRes;
255
+ boardData = boardRes;
256
+ _f.label = 3;
257
+ 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 })];
263
258
  }
264
259
  });
265
260
  });
@@ -827,8 +822,8 @@ export var brandSlice = createSlice({
827
822
  .addCase(retrieveBoardStatus.fulfilled, function (state, action) {
828
823
  state.error = null;
829
824
  state.loading = false;
830
- var _a = action.payload || {}, flows = _a.flows, data = _a.data;
831
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, notification: data === null || data === void 0 ? void 0 : data.notification });
825
+ var flows = (action.payload || {}).flows;
826
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
832
827
  })
833
828
  .addCase(retrieveBoardStatus.rejected, function (state, action) {
834
829
  state.error = action.error.message;
@@ -47,7 +47,6 @@ export declare const verifyEntityLeadOTP: import("@reduxjs/toolkit").AsyncThunk<
47
47
  rejectedMeta?: unknown;
48
48
  }>;
49
49
  export declare const retrieveBoardStatus: import("@reduxjs/toolkit").AsyncThunk<{
50
- data: any;
51
50
  flows: any;
52
51
  }, void, {
53
52
  state?: unknown;
@@ -179,52 +179,47 @@ export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', functio
179
179
  });
180
180
  }); });
181
181
  export var retrieveBoardStatus = createAsyncThunk('entity/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
182
- var entity, _a, board_id, board_info_id, _b, boardInfoData, data, _c, id, type;
183
- var _d;
184
- return __generator(this, function (_e) {
185
- switch (_e.label) {
182
+ var entity, _a, board_id, board_info_id, recipient, _b, id, type, data;
183
+ return __generator(this, function (_c) {
184
+ switch (_c.label) {
186
185
  case 0:
187
186
  entity = thunkApi.getState().entity;
188
- _a = entity.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id;
187
+ _a = entity.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id, recipient = _a.recipient;
189
188
  if (!board_id || !board_info_id)
190
189
  throw new Error('Internal server error');
190
+ _b = recipient || {}, id = _b.id, type = _b.type;
191
191
  return [4, Promise.all([
192
- API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
193
- API.boardService.retrieveBoardInfoStatus(board_id)
192
+ API.boardService.retrieveBoardInfoStatus(board_id),
193
+ thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
194
194
  ])];
195
195
  case 1:
196
- _b = _e.sent(), boardInfoData = _b[0], data = _b[1];
197
- _c = ((_d = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _d === void 0 ? void 0 : _d.recipient) || {}, id = _c.id, type = _c.type;
198
- return [4, thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()];
199
- case 2:
200
- _e.sent();
196
+ data = (_c.sent())[0];
201
197
  thunkApi.dispatch(handlePrevScreenStep());
202
- return [2, { data: boardInfoData, flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
198
+ return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
203
199
  }
204
200
  });
205
201
  }); });
206
202
  export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', function (_a) {
207
203
  var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
208
204
  return __awaiter(void 0, void 0, void 0, function () {
209
- var data, individualData, serviceCallBack, data_state;
210
- var _b, _c, _d;
211
- return __generator(this, function (_e) {
212
- switch (_e.label) {
205
+ var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
206
+ var _c, _d, _e;
207
+ return __generator(this, function (_f) {
208
+ switch (_f.label) {
213
209
  case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
214
210
  case 1:
215
- data = _e.sent();
211
+ data = _f.sent();
216
212
  individualData = data === null || data === void 0 ? void 0 : data.user;
217
- if (!(((_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.id) !== id)) return [3, 3];
213
+ boardData = data;
214
+ if (!(((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.id) !== id)) return [3, 3];
218
215
  serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
219
216
  return [4, retrieveIndividualData(type, data, serviceCallBack)];
220
217
  case 2:
221
- individualData = _e.sent();
222
- _e.label = 3;
223
- case 3:
224
- data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? data === null || data === void 0 ? void 0 : data.individuals : individualData) || {}).data_state;
225
- return [2, __assign(__assign(__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: (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.names, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_d = data === null || data === void 0 ? void 0 : data.user) === null || _d === void 0 ? void 0 : _d.contact }), (individualData && { user: individualData })), (data_state && {
226
- individuals: __assign(__assign({}, data === null || data === void 0 ? void 0 : data.individuals), { data_state: data_state })
227
- }))];
218
+ _b = _f.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
219
+ individualData = individualRes;
220
+ boardData = boardRes;
221
+ _f.label = 3;
222
+ 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 })];
228
223
  }
229
224
  });
230
225
  });
@@ -571,7 +566,7 @@ export var entitySlice = createSlice({
571
566
  var _d = action.payload, data = _d.data, entity = _d.entityData, entityTypes = _d.entityTypes, formData = _d.formData;
572
567
  state.data.otpData = formData;
573
568
  state.data.otpData.responseBody = data;
574
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity: entity, entityTypes: entityTypes });
569
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { entity: entity, entityTypes: entityTypes });
575
570
  var _e = entity || {}, license = _e.license, type = _e.type, capital = _e.capital, activities = _e.activities, legal_name = _e.legal_name;
576
571
  var legalName = legal_name;
577
572
  var licenseNumber = license === null || license === void 0 ? void 0 : license.number;
@@ -672,8 +667,8 @@ export var entitySlice = createSlice({
672
667
  .addCase(retrieveBoardStatus.fulfilled, function (state, action) {
673
668
  state.error = null;
674
669
  state.loading = false;
675
- var _a = action.payload || {}, flows = _a.flows, data = _a.data;
676
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, notification: data === null || data === void 0 ? void 0 : data.notification });
670
+ var flows = (action.payload || {}).flows;
671
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
677
672
  })
678
673
  .addCase(retrieveBoardStatus.rejected, function (state, action) {
679
674
  state.error = action.error.message;
@@ -31,7 +31,6 @@ export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
31
31
  rejectedMeta?: unknown;
32
32
  }>;
33
33
  export declare const retrieveBoardStatus: import("@reduxjs/toolkit").AsyncThunk<{
34
- data: any;
35
34
  flows: any;
36
35
  }, void, {
37
36
  state?: unknown;
@@ -119,52 +119,47 @@ export var resendOTP = createAsyncThunk('resendOTPTax', function (params, thunkA
119
119
  });
120
120
  }); });
121
121
  export var retrieveBoardStatus = createAsyncThunk('tax/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
122
- var tax, _a, board_id, board_info_id, _b, boardInfoData, data, _c, id, type;
123
- var _d;
124
- return __generator(this, function (_e) {
125
- switch (_e.label) {
122
+ var tax, _a, board_id, board_info_id, recipient, _b, id, type, data;
123
+ return __generator(this, function (_c) {
124
+ switch (_c.label) {
126
125
  case 0:
127
126
  tax = thunkApi.getState().tax;
128
- _a = tax.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id;
127
+ _a = tax.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id, recipient = _a.recipient;
129
128
  if (!board_id || !board_info_id)
130
129
  throw new Error('Internal server error');
130
+ _b = recipient || {}, id = _b.id, type = _b.type;
131
131
  return [4, Promise.all([
132
- API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id }),
133
- API.boardService.retrieveBoardInfoStatus(board_id)
132
+ API.boardService.retrieveBoardInfoStatus(board_id),
133
+ thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
134
134
  ])];
135
135
  case 1:
136
- _b = _e.sent(), boardInfoData = _b[0], data = _b[1];
137
- _c = ((_d = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _d === void 0 ? void 0 : _d.recipient) || {}, id = _c.id, type = _c.type;
138
- return [4, thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()];
139
- case 2:
140
- _e.sent();
136
+ data = (_c.sent())[0];
141
137
  thunkApi.dispatch(handlePrevScreenStep());
142
- return [2, { data: boardInfoData, flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
138
+ return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
143
139
  }
144
140
  });
145
141
  }); });
146
142
  export var retrieveBoardDetails = createAsyncThunk('tax/retrieveBrandInfo', function (_a) {
147
143
  var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
148
144
  return __awaiter(void 0, void 0, void 0, function () {
149
- var data, individualData, serviceCallBack, data_state;
150
- var _b, _c, _d, _e;
151
- return __generator(this, function (_f) {
152
- switch (_f.label) {
145
+ var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
146
+ var _c, _d, _e, _f;
147
+ return __generator(this, function (_g) {
148
+ switch (_g.label) {
153
149
  case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
154
150
  case 1:
155
- data = _f.sent();
151
+ data = _g.sent();
156
152
  individualData = data === null || data === void 0 ? void 0 : data.user;
157
- if (!(((_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.id) !== id)) return [3, 3];
153
+ boardData = data;
154
+ if (!(((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.id) !== id)) return [3, 3];
158
155
  serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
159
156
  return [4, retrieveIndividualData(type, data, serviceCallBack)];
160
157
  case 2:
161
- individualData = _f.sent();
162
- _f.label = 3;
163
- case 3:
164
- data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? data === null || data === void 0 ? void 0 : data.individuals : individualData) || {}).data_state;
165
- return [2, __assign(__assign(__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: (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.names, vatID: (_d = data === null || data === void 0 ? void 0 : data.entity) === null || _d === void 0 ? void 0 : _d.vat_id, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_e = data === null || data === void 0 ? void 0 : data.user) === null || _e === void 0 ? void 0 : _e.contact }), (individualData && { user: individualData })), (data_state && {
166
- individuals: __assign(__assign({}, data === null || data === void 0 ? void 0 : data.individuals), { data_state: data_state })
167
- }))];
158
+ _b = _g.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
159
+ individualData = individualRes;
160
+ boardData = boardRes;
161
+ _g.label = 3;
162
+ 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, vatID: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _e === void 0 ? void 0 : _e.vat_id, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, contact: (_f = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _f === void 0 ? void 0 : _f.contact, user: individualData })];
168
163
  }
169
164
  });
170
165
  });
@@ -443,8 +438,8 @@ export var taxSlice = createSlice({
443
438
  .addCase(retrieveBoardStatus.fulfilled, function (state, action) {
444
439
  state.error = null;
445
440
  state.loading = false;
446
- var _a = action.payload, flows = _a.flows, data = _a.data;
447
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, notification: data === null || data === void 0 ? void 0 : data.notification });
441
+ var flows = action.payload.flows;
442
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
448
443
  })
449
444
  .addCase(retrieveBoardStatus.rejected, function (state, action) {
450
445
  state.error = action.error.message;
@@ -47,10 +47,12 @@ var FormStyled = styled(Form)(function () { return ({
47
47
  flexDirection: 'column'
48
48
  }); });
49
49
  var OTP = function () {
50
+ var _a;
50
51
  var dispatch = useAppDispatch();
51
- var _a = useAppSelector(authSelector), data = _a.data, loading = _a.loading, error = _a.error;
52
+ var _b = useAppSelector(authSelector), data = _b.data, loading = _b.loading, error = _b.error;
52
53
  var t = useTranslation().t;
53
54
  var isAr = useLanguage().isAr;
55
+ var _c = ((_a = data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse) || {}, auth_type = _c.auth_type, email = _c.email, mobile = _c.mobile;
54
56
  var methods = useForm({
55
57
  resolver: yupResolver(OTPValidation),
56
58
  defaultValues: data.otpData,
@@ -59,25 +61,27 @@ var OTP = function () {
59
61
  var isNidAuth = data.otpData.authFor === AuthForType.NATIONAL_ID;
60
62
  var isEmailAuth = data.otpData.authFor === AuthForType.EMAIL;
61
63
  var getNumber = function () {
62
- var _a, _b;
64
+ var _a;
63
65
  if (isNidAuth)
64
66
  return maskID(data.nidData.nid);
65
67
  if (isEmailAuth) {
66
- var _c = ((_a = data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse) || {}, auth_type = _c.auth_type, email = _c.email, mobile = _c.mobile;
67
68
  if (auth_type === AuthTypeNumber.MOBILE_OTP && mobile)
68
69
  return mobile;
69
70
  if (auth_type === AuthTypeNumber.EMAIL_OTP && email)
70
71
  return email;
71
72
  return maskEmail(data.emailData.email);
72
73
  }
73
- var phone = data.mobileData.mobile ? ((_b = data.mobileData.countryCode) === null || _b === void 0 ? void 0 : _b.idd_prefix) + data.mobileData.mobile : '';
74
+ var phone = data.mobileData.mobile ? ((_a = data.mobileData.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix) + data.mobileData.mobile : '';
74
75
  return maskPhone(phone);
75
76
  };
76
77
  var getTitle = function () {
77
78
  if (isNidAuth)
78
79
  return t('opt_nid_sent_title', { provider: 'ABSHER' });
79
- if (isEmailAuth)
80
- return t('otp_email_sent_title');
80
+ if (isEmailAuth) {
81
+ if (auth_type === AuthTypeNumber.EMAIL_OTP)
82
+ return t('otp_email_sent_title');
83
+ return t('ide_opt_sent_title');
84
+ }
81
85
  return t('ide_opt_sent_title');
82
86
  };
83
87
  React.useEffect(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.8.20-test",
3
+ "version": "2.8.22-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",