@tap-payments/auth-jsconnect 1.0.94-test → 1.0.97-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.
Files changed (88) hide show
  1. package/build/@types/app.d.ts +7 -2
  2. package/build/@types/form.d.ts +2 -1
  3. package/build/api/auth.d.ts +22 -3
  4. package/build/api/axios.d.ts +2 -2
  5. package/build/api/axios.js +62 -0
  6. package/build/api/country.d.ts +1 -2
  7. package/build/api/country.js +7 -8
  8. package/build/api/data.d.ts +1 -0
  9. package/build/api/data.js +9 -2
  10. package/build/api/entity.d.ts +3 -1
  11. package/build/api/entity.js +11 -2
  12. package/build/api/firebase.d.ts +1 -1
  13. package/build/api/firebase.js +5 -2
  14. package/build/api/index.d.ts +10 -9
  15. package/build/api/ip.d.ts +1 -1
  16. package/build/api/ip.js +5 -2
  17. package/build/api/lead.d.ts +4 -1
  18. package/build/api/lead.js +14 -2
  19. package/build/api/operator.d.ts +1 -1
  20. package/build/api/operator.js +60 -4
  21. package/build/app/settings.d.ts +6 -15
  22. package/build/app/settings.js +82 -142
  23. package/build/components/AnimationFlow/AnimationFlow.d.ts +2 -1
  24. package/build/components/AnimationFlow/AnimationFlow.js +2 -2
  25. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  26. package/build/components/AnimationFlow/BottomSheet.js +16 -4
  27. package/build/constants/api.d.ts +2 -1
  28. package/build/constants/api.js +5 -3
  29. package/build/constants/app.d.ts +6 -0
  30. package/build/constants/app.js +16 -4
  31. package/build/features/app/bank/bankStore.js +6 -4
  32. package/build/features/app/business/businessStore.d.ts +2 -4
  33. package/build/features/app/business/businessStore.js +66 -22
  34. package/build/features/app/connect/connectStore.d.ts +5 -10
  35. package/build/features/app/connect/connectStore.js +121 -27
  36. package/build/features/app/individual/individualStore.d.ts +3 -2
  37. package/build/features/app/individual/individualStore.js +27 -22
  38. package/build/features/app/password/passwordStore.d.ts +29 -1
  39. package/build/features/app/password/passwordStore.js +184 -8
  40. package/build/features/app/tax/taxStore.js +7 -5
  41. package/build/features/bank/Bank.js +4 -4
  42. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -4
  43. package/build/features/business/Business.js +4 -4
  44. package/build/features/business/screens/IDBOD/IDBOD.js +1 -1
  45. package/build/features/business/screens/OTP/OTPInput.js +3 -9
  46. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +17 -6
  47. package/build/features/connect/Connect.js +1 -1
  48. package/build/features/connect/screens/Mobile/Mobile.js +1 -1
  49. package/build/features/connect/screens/NID/NID.js +1 -1
  50. package/build/features/connect/screens/OTP/OTPInput.js +3 -13
  51. package/build/features/featuresScreens.js +5 -0
  52. package/build/features/individual/Individual.js +4 -4
  53. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +7 -1
  54. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +10 -0
  55. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +89 -0
  56. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +3 -0
  57. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +1 -0
  58. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -4
  59. package/build/features/password/Password.js +12 -6
  60. package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -2
  61. package/build/features/password/screens/OTP/OTP.d.ts +8 -0
  62. package/build/features/password/screens/OTP/OTP.js +78 -0
  63. package/build/features/password/screens/OTP/OTPInput.d.ts +5 -0
  64. package/build/features/password/screens/OTP/OTPInput.js +46 -0
  65. package/build/features/password/screens/OTP/index.d.ts +3 -0
  66. package/build/features/password/screens/OTP/index.js +2 -0
  67. package/build/features/password/screens/OTP/validation.d.ts +8 -0
  68. package/build/features/password/screens/OTP/validation.js +4 -0
  69. package/build/features/password/screens/Success/Success.js +8 -2
  70. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +17 -5
  71. package/build/features/password/screens/Verify/OTPInput.d.ts +2 -2
  72. package/build/features/password/screens/Verify/OTPInput.js +1 -1
  73. package/build/features/shared/Button/FlowsButtons.d.ts +8 -2
  74. package/build/features/shared/Button/FlowsButtons.js +94 -6
  75. package/build/features/shared/Button/SuccessButton.js +17 -13
  76. package/build/features/tax/Tax.js +3 -3
  77. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -4
  78. package/build/hooks/useAppConfig.d.ts +1 -4
  79. package/build/hooks/useAppConfig.js +13 -113
  80. package/build/hooks/useAppTheme.js +3 -2
  81. package/build/index.css +4 -0
  82. package/build/theme/theme.d.ts +1 -1
  83. package/build/theme/theme.js +1 -2
  84. package/build/utils/array.d.ts +3 -0
  85. package/build/utils/array.js +10 -0
  86. package/build/utils/string.d.ts +1 -0
  87. package/build/utils/string.js +4 -0
  88. package/package.json +1 -1
@@ -25,8 +25,32 @@ export declare const updateLeadSuccess: import("@reduxjs/toolkit").AsyncThunk<{
25
25
  response: any;
26
26
  formData: void;
27
27
  } | undefined, void, {}>;
28
+ export declare const verifyOperationToken: import("@reduxjs/toolkit").AsyncThunk<{
29
+ data: any;
30
+ token: string;
31
+ leadId: string;
32
+ }, {
33
+ token: string;
34
+ leadId: string;
35
+ }, {}>;
36
+ export declare const resendOperationOTP: import("@reduxjs/toolkit").AsyncThunk<{
37
+ data: any;
38
+ }, void, {}>;
39
+ export declare const resetPassword: import("@reduxjs/toolkit").AsyncThunk<{
40
+ data: any;
41
+ formData: {
42
+ password: string;
43
+ confirmPassword: string;
44
+ responseBody?: {
45
+ [key: string]: any;
46
+ } | undefined;
47
+ otp: string;
48
+ };
49
+ }, OTPFormValues, {}>;
50
+ export declare const retrieveLead: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
28
51
  declare type VerifyData = {
29
52
  token: string;
53
+ operationType?: string;
30
54
  };
31
55
  export interface PasswordData {
32
56
  verify: ResponseData & VerifyData;
@@ -40,8 +64,12 @@ export declare const passwordSlice: import("@reduxjs/toolkit").Slice<PasswordSta
40
64
  clearError: (state: PasswordState) => void;
41
65
  stopLoader: (state: PasswordState) => void;
42
66
  resetOTPScreen: (state: PasswordState) => void;
67
+ storePasswordScreen: (state: PasswordState, action: {
68
+ payload: any;
69
+ type: string;
70
+ }) => void;
43
71
  }, "password/store">;
44
- export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
72
+ export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, storePasswordScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
45
73
  declare const _default: import("redux").Reducer<PasswordState, import("redux").AnyAction>;
46
74
  export default _default;
47
75
  export declare const passwordSelector: (state: RootState) => PasswordState;
@@ -49,10 +49,10 @@ var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import API from '../../../api';
51
51
  import { FlowsTypes } from '../../../@types';
52
- import { hasKey, removeRequestHeaders } from '../../../utils';
52
+ import { hasKey } from '../../../utils';
53
53
  import { handleNextScreenStep } from '../../../app/settings';
54
- import { PASSWORD_STEP_NAMES } from '../../../constants';
55
- export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
54
+ import { PASSWORD_OPERATION_TYPE, PASSWORD_STEP_NAMES } from '../../../constants';
55
+ export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
56
56
  var payload, data, leadResponse, _a, steps, entity, hasCompleted;
57
57
  return __generator(this, function (_b) {
58
58
  switch (_b.label) {
@@ -166,14 +166,14 @@ export var createPassword = createAsyncThunk('createPassword', function (params,
166
166
  case 1:
167
167
  data = (_f.sent()).data;
168
168
  if (!data.errors) {
169
- thunkApi.dispatch(handleNextScreenStep());
169
+ thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP'));
170
170
  (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
171
171
  }
172
172
  return [2, { data: data, formData: params }];
173
173
  }
174
174
  });
175
175
  }); });
176
- export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
176
+ export var updateLeadSuccess = createAsyncThunk('passwordUpdateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
177
177
  var _a, settings, password, id, payload, data;
178
178
  var _b, _c, _d, _e, _f;
179
179
  return __generator(this, function (_g) {
@@ -184,6 +184,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
184
184
  if (!id)
185
185
  return [2];
186
186
  payload = {
187
+ lang: settings.data.language,
187
188
  step_name: PASSWORD_STEP_NAMES.PASSWORD_SUCCESS,
188
189
  id: id,
189
190
  encryption_contract: []
@@ -191,13 +192,104 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
191
192
  return [4, API.leadService.updateLead(payload)];
192
193
  case 1:
193
194
  data = (_g.sent()).data;
195
+ if (!!data.errors) return [3, 3];
194
196
  return [4, thunkApi.dispatch(retrieveEntityInfo((_b = data.entity) === null || _b === void 0 ? void 0 : _b.id))];
195
197
  case 2:
196
198
  _g.sent();
197
199
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
198
200
  (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
199
201
  thunkApi.dispatch(handleNextScreenStep());
200
- return [2, { response: data, formData: params }];
202
+ _g.label = 3;
203
+ case 3: return [2, { response: data, formData: params }];
204
+ }
205
+ });
206
+ }); });
207
+ export var verifyOperationToken = createAsyncThunk('verifyOperationToken', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
208
+ var token, leadId, payload, data;
209
+ var _a, _b;
210
+ return __generator(this, function (_c) {
211
+ switch (_c.label) {
212
+ case 0:
213
+ token = params.token, leadId = params.leadId;
214
+ payload = {
215
+ auth_type: 7,
216
+ auth_token: token
217
+ };
218
+ return [4, API.authService.verifyAuth(payload)];
219
+ case 1:
220
+ data = (_c.sent()).data;
221
+ thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
222
+ if ((data === null || data === void 0 ? void 0 : data.errors) || (data === null || data === void 0 ? void 0 : data.mw_error)) {
223
+ alert((_b = (_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.description);
224
+ }
225
+ return [2, { data: data, token: token, leadId: leadId }];
226
+ }
227
+ });
228
+ }); });
229
+ export var resendOperationOTP = createAsyncThunk('resendOperationOTPPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
230
+ var password, payload, data;
231
+ return __generator(this, function (_a) {
232
+ switch (_a.label) {
233
+ case 0:
234
+ password = thunkApi.getState().password;
235
+ payload = {
236
+ auth_type: 7,
237
+ auth_token: password.data.verify.token
238
+ };
239
+ return [4, API.authService.verifyAuth(payload)];
240
+ case 1:
241
+ data = (_a.sent()).data;
242
+ return [2, { data: data }];
243
+ }
244
+ });
245
+ }); });
246
+ export var resetPassword = createAsyncThunk('resetPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
247
+ var _a, password, settings, responseBody, passwordData, payload, data;
248
+ var _b, _c;
249
+ return __generator(this, function (_d) {
250
+ switch (_d.label) {
251
+ case 0:
252
+ _a = thunkApi.getState(), password = _a.password, settings = _a.settings;
253
+ responseBody = password.data.verify.responseBody;
254
+ passwordData = password.data.passwordData;
255
+ payload = {
256
+ auth_type: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_type,
257
+ auth_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token,
258
+ step_name: PASSWORD_STEP_NAMES.RESET_PASSWORD,
259
+ user_credentail: {
260
+ otp: params.otp,
261
+ new_password: passwordData.password
262
+ },
263
+ encryption_contract: ['user_credentail.otp', 'user_credentail.new_password']
264
+ };
265
+ return [4, API.authService.verifyAuth(payload)];
266
+ case 1:
267
+ data = (_d.sent()).data;
268
+ if (!(data === null || data === void 0 ? void 0 : data.errors)) {
269
+ thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP'));
270
+ (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, payload);
271
+ }
272
+ return [2, { data: data, formData: __assign(__assign({}, params), passwordData) }];
273
+ }
274
+ });
275
+ }); });
276
+ export var retrieveLead = createAsyncThunk('retrieveLeadPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
277
+ var _a, password, settings, id, data;
278
+ var _b, _c, _d, _e;
279
+ return __generator(this, function (_f) {
280
+ switch (_f.label) {
281
+ case 0:
282
+ _a = thunkApi.getState(), password = _a.password, settings = _a.settings;
283
+ id = (password.data.verify.responseBody || { id: '' }).id;
284
+ return [4, API.leadService.retrieveLead(id)];
285
+ case 1:
286
+ data = (_f.sent()).data;
287
+ if (!(data === null || data === void 0 ? void 0 : data.errors)) {
288
+ thunkApi.dispatch(handleNextScreenStep());
289
+ (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, { id: id });
290
+ (_e = (_d = settings.data.appConfig).onFlowCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, { data: data });
291
+ }
292
+ return [2, data];
201
293
  }
202
294
  });
203
295
  }); });
@@ -230,12 +322,16 @@ export var passwordSlice = createSlice({
230
322
  },
231
323
  resetOTPScreen: function (state) {
232
324
  state.data.otpData.otp = '';
325
+ },
326
+ storePasswordScreen: function (state, action) {
327
+ state.data.passwordData = action.payload;
233
328
  }
234
329
  },
235
330
  extraReducers: function (builder) {
236
331
  builder
237
332
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
238
333
  var _a;
334
+ state.data.verify.operationType = PASSWORD_OPERATION_TYPE.SET_PASSWORD;
239
335
  state.error = null;
240
336
  state.customLoading = false;
241
337
  var _b = action.payload, data = _b.data, token = _b.token, leadData = _b.leadData;
@@ -346,7 +442,6 @@ export var passwordSlice = createSlice({
346
442
  }
347
443
  var flows = response.flows, steps = response.steps;
348
444
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps });
349
- removeRequestHeaders();
350
445
  })
351
446
  .addCase(updateLeadSuccess.pending, function (state) {
352
447
  state.loading = true;
@@ -355,9 +450,90 @@ export var passwordSlice = createSlice({
355
450
  .addCase(updateLeadSuccess.rejected, function (state, action) {
356
451
  state.loading = false;
357
452
  state.error = action.error.message;
453
+ })
454
+ .addCase(verifyOperationToken.fulfilled, function (state, action) {
455
+ var _a;
456
+ state.data.verify.operationType = PASSWORD_OPERATION_TYPE.RESET_PASSWORD;
457
+ state.error = null;
458
+ state.customLoading = false;
459
+ var _b = action.payload, data = _b.data, token = _b.token, leadId = _b.leadId;
460
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
461
+ if (description) {
462
+ state.error = description;
463
+ return;
464
+ }
465
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { id: leadId });
466
+ state.data.verify.token = token;
467
+ })
468
+ .addCase(verifyOperationToken.pending, function (state) {
469
+ state.customLoading = true;
470
+ state.error = null;
471
+ })
472
+ .addCase(verifyOperationToken.rejected, function (state, action) {
473
+ state.error = action.error.message;
474
+ state.customLoading = false;
475
+ })
476
+ .addCase(resendOperationOTP.pending, function (state) {
477
+ state.error = null;
478
+ })
479
+ .addCase(resendOperationOTP.fulfilled, function (state, action) {
480
+ var _a;
481
+ state.error = null;
482
+ var data = action.payload.data;
483
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
484
+ if (description) {
485
+ state.error = description;
486
+ return;
487
+ }
488
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
489
+ })
490
+ .addCase(resendOperationOTP.rejected, function (state, action) {
491
+ state.error = action.error.message;
492
+ })
493
+ .addCase(resetPassword.fulfilled, function (state, action) {
494
+ var _a;
495
+ state.data.verify.operationType = PASSWORD_OPERATION_TYPE.RESET_PASSWORD;
496
+ state.error = null;
497
+ state.loading = false;
498
+ var _b = action.payload, data = _b.data, formData = _b.formData;
499
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
500
+ if (description) {
501
+ state.error = description;
502
+ return;
503
+ }
504
+ state.data.passwordData = formData;
505
+ state.data.passwordData.responseBody = data;
506
+ })
507
+ .addCase(resetPassword.pending, function (state) {
508
+ state.loading = true;
509
+ state.error = null;
510
+ })
511
+ .addCase(resetPassword.rejected, function (state, action) {
512
+ state.error = action.error.message;
513
+ state.loading = false;
514
+ })
515
+ .addCase(retrieveLead.fulfilled, function (state, action) {
516
+ var _a;
517
+ state.loading = false;
518
+ state.error = null;
519
+ var data = action.payload;
520
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
521
+ if (description) {
522
+ state.error = description;
523
+ return;
524
+ }
525
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
526
+ })
527
+ .addCase(retrieveLead.pending, function (state) {
528
+ state.loading = true;
529
+ state.error = null;
530
+ })
531
+ .addCase(retrieveLead.rejected, function (state, action) {
532
+ state.loading = false;
533
+ state.error = action.error.message;
358
534
  });
359
535
  }
360
536
  });
361
- export var clearError = (_a = passwordSlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen;
537
+ export var clearError = (_a = passwordSlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen, storePasswordScreen = _a.storePasswordScreen;
362
538
  export default passwordSlice.reducer;
363
539
  export var passwordSelector = function (state) { return state.password; };
@@ -49,10 +49,10 @@ var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import API from '../../../api';
51
51
  import { FlowsTypes } from '../../../@types';
52
- import { hasKey, removeRequestHeaders } from '../../../utils';
52
+ import { hasKey } from '../../../utils';
53
53
  import { handleNextScreenStep } from '../../../app/settings';
54
54
  import { TAX_STEP_NAMES } from '../../../constants';
55
- export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
55
+ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
56
56
  var payload, data, leadResponse, _a, steps, entity, hasTaxCompleted;
57
57
  return __generator(this, function (_b) {
58
58
  switch (_b.label) {
@@ -172,7 +172,7 @@ export var updateTaxInfo = createAsyncThunk('updateTaxInfo', function (params, t
172
172
  }
173
173
  });
174
174
  }); });
175
- export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
175
+ export var updateLeadSuccess = createAsyncThunk('taxUpdateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
176
176
  var _a, settings, tax, id, payload, data;
177
177
  var _b, _c, _d, _e, _f;
178
178
  return __generator(this, function (_g) {
@@ -183,6 +183,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
183
183
  if (!id)
184
184
  return [2];
185
185
  payload = {
186
+ lang: settings.data.language,
186
187
  step_name: TAX_STEP_NAMES.TAX_SUCCESS,
187
188
  id: id,
188
189
  encryption_contract: []
@@ -190,13 +191,15 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
190
191
  return [4, API.leadService.updateLead(payload)];
191
192
  case 1:
192
193
  data = (_g.sent()).data;
194
+ if (!!data.errors) return [3, 3];
193
195
  return [4, thunkApi.dispatch(retrieveEntityInfo((_b = data.entity) === null || _b === void 0 ? void 0 : _b.id))];
194
196
  case 2:
195
197
  _g.sent();
196
198
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
197
199
  (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
198
200
  thunkApi.dispatch(handleNextScreenStep());
199
- return [2, { response: data, formData: params }];
201
+ _g.label = 3;
202
+ case 3: return [2, { response: data, formData: params }];
200
203
  }
201
204
  });
202
205
  }); });
@@ -345,7 +348,6 @@ export var taxSlice = createSlice({
345
348
  }
346
349
  var flows = response.flows, steps = response.steps;
347
350
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps });
348
- removeRequestHeaders();
349
351
  })
350
352
  .addCase(updateLeadSuccess.pending, function (state) {
351
353
  state.loading = true;
@@ -29,7 +29,7 @@ var Bank = memo(function (props) {
29
29
  var dispatch = useAppDispatch();
30
30
  var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
31
31
  var _b = useAppSelector(bankSelector), customLoading = _b.customLoading, bankError = _b.error;
32
- var loading = useAppConfig(__assign({ navigation: BANK_SCREENS_NAVIGATION }, props)).loading;
32
+ useAppConfig(__assign({ navigation: BANK_SCREENS_NAVIGATION }, props));
33
33
  useErrorListener(bankError || error);
34
34
  useStepStartedListener();
35
35
  var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
@@ -44,10 +44,10 @@ var Bank = memo(function (props) {
44
44
  dispatch(verifyLeadToken(token));
45
45
  };
46
46
  useEffect(function () {
47
- if (!loading)
47
+ if (!settingLoading)
48
48
  verifyToken();
49
- }, [loading]);
50
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: bankFeatureScreens.map(function (_a, index) {
49
+ }, [settingLoading]);
50
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: bankFeatureScreens.map(function (_a, index) {
51
51
  var Element = _a.element, name = _a.name;
52
52
  var isActive = activeScreen.name === name;
53
53
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -14,14 +14,15 @@ import React, { memo, useEffect, useState } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
- import { ICONS_NAMES } from '../../../../constants';
17
+ import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
18
  import { useAppSelector, useLanguage } from '../../../../hooks';
19
- import { allAreTruthy, showLastFour } from '../../../../utils';
19
+ import { allAreTruthy, getResetFlowUrl, showLastFour } from '../../../../utils';
20
20
  import { bankSelector } from '../../../app/bank/bankStore';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
23
23
  import Container from '../../../shared/Containers/ScreenContainer';
24
24
  import AcceptancePayouts from '../../../shared/AcceptancePayouts';
25
+ import { settingsSelector } from '../../../../app/settings';
25
26
  var TitleStyled = styled(Text)(function (_a) {
26
27
  var _b;
27
28
  var theme = _a.theme;
@@ -57,10 +58,16 @@ var SuccessWithFlowButtons = function () {
57
58
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
58
59
  var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
59
60
  var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
61
+ var settings = useAppSelector(settingsSelector);
62
+ var _h = data.verify.responseBody || { contact: {}, id: '' }, contact = _h.contact, id = _h.id;
63
+ var email = (contact || { email: '' }).email;
64
+ var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
60
65
  var reMapFlowData = function (flows) {
61
66
  if (flows === void 0) { flows = []; }
62
67
  var images = ICONS_NAMES;
63
- var mappedFlows = flows.map(function (_a) {
68
+ var mappedFlows = flows
69
+ .filter(function (item) { return item.name; })
70
+ .map(function (_a) {
64
71
  var name = _a.name, url = _a.url, status = _a.status;
65
72
  var type = status === 'initiated' ? 'pending' : 'completed';
66
73
  var title = t("".concat(name, "_flow_").concat(type), {
@@ -79,6 +86,7 @@ var SuccessWithFlowButtons = function () {
79
86
  var hoverSrc = "".concat(name, "_white_icon");
80
87
  return {
81
88
  name: name,
89
+ status: status,
82
90
  title: title,
83
91
  href: url,
84
92
  src: images[src],
@@ -96,6 +104,10 @@ var SuccessWithFlowButtons = function () {
96
104
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
97
105
  reMapFlowData(flows);
98
106
  }, [flows, isAr]);
99
- return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, flowName: data.flowName }) })] }));
107
+ return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
108
+ flowName: data.flowName,
109
+ email: email,
110
+ emailUrl: url
111
+ } }) })] }));
100
112
  };
101
113
  export default memo(SuccessWithFlowButtons);
@@ -29,7 +29,7 @@ var Business = memo(function (props) {
29
29
  var dispatch = useAppDispatch();
30
30
  var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
31
31
  var _b = useAppSelector(businessSelector), customLoading = _b.customLoading, businessError = _b.error;
32
- var loading = useAppConfig(__assign({ navigation: BUSINESS_SCREENS_NAVIGATION }, props)).loading;
32
+ useAppConfig(__assign({ navigation: BUSINESS_SCREENS_NAVIGATION }, props));
33
33
  useErrorListener(businessError || error);
34
34
  useStepStartedListener();
35
35
  var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
@@ -44,10 +44,10 @@ var Business = memo(function (props) {
44
44
  dispatch(verifyLeadToken(token));
45
45
  };
46
46
  useEffect(function () {
47
- if (!loading)
47
+ if (!settingLoading)
48
48
  verifyToken();
49
- }, [loading]);
50
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
49
+ }, [settingLoading]);
50
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
51
51
  var Element = _a.element, name = _a.name;
52
52
  var isActive = activeScreen.name === name;
53
53
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -44,7 +44,7 @@ var IDBOD = function (_a) {
44
44
  dispatch(clearError());
45
45
  }, [methods.formState.isValid]);
46
46
  var onSubmit = function (data) {
47
- dispatch(updateLeadIdentity(__assign(__assign({}, data), { isResend: false })));
47
+ dispatch(updateLeadIdentity(data));
48
48
  };
49
49
  var handleCollapseOpenClose = function (flag) {
50
50
  setCollapse(flag);
@@ -17,8 +17,8 @@ import Box from '@mui/material/Box/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { businessSelector, updateLeadIdentity } from '../../../app/business/businessStore';
21
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
20
+ import { resendOTPLeadIdentity } from '../../../app/business/businessStore';
21
+ import { useAppDispatch } from '../../../../hooks';
22
22
  var BoxStyled = styled(Box)(function (_a) {
23
23
  var theme = _a.theme;
24
24
  return ({
@@ -32,19 +32,13 @@ var OTPInput = function (_a) {
32
32
  var t = useTranslation().t;
33
33
  var dispatch = useAppDispatch();
34
34
  var otpControl = useController({ name: 'otp', control: control });
35
- var data = useAppSelector(businessSelector).data;
36
- var nidData = data.nidData;
37
35
  var handleOnOTPChange = function (otp) {
38
36
  otpControl.field.onChange(otp);
39
37
  };
40
38
  var handleOnResendOTP = function () {
41
39
  if (otpControl.field.value)
42
40
  setValue('otp', '', { shouldValidate: true });
43
- var params = {
44
- nid: nidData.nid,
45
- dob: nidData.dob
46
- };
47
- dispatch(updateLeadIdentity(__assign(__assign({}, params), { isResend: true })));
41
+ dispatch(resendOTPLeadIdentity());
48
42
  };
49
43
  var otpValue = otpControl.field.value;
50
44
  return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
@@ -14,14 +14,15 @@ import React, { memo, useEffect, useState } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
- import { ICONS_NAMES } from '../../../../constants';
18
- import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
17
+ import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
+ import { useAppSelector, useLanguage } from '../../../../hooks';
19
19
  import { businessSelector } from '../../../app/business/businessStore';
20
- import { allAreTruthy, showLastFour } from '../../../../utils';
20
+ import { allAreTruthy, getResetFlowUrl, showLastFour } from '../../../../utils';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
23
23
  import Container from '../../../shared/Containers/ScreenContainer';
24
24
  import AcceptancePayouts from '../../../shared/AcceptancePayouts';
25
+ import { settingsSelector } from '../../../../app/settings';
25
26
  var TitleStyled = styled(Text)(function (_a) {
26
27
  var _b;
27
28
  var theme = _a.theme;
@@ -46,7 +47,6 @@ var SuccessWithFlowButtons = function () {
46
47
  var _a, _b, _c;
47
48
  var t = useTranslation().t;
48
49
  var isAr = useLanguage().isAr;
49
- var dispatch = useAppDispatch();
50
50
  var _d = React.useState(false), isAcceptance = _d[0], setIsAcceptance = _d[1];
51
51
  var _e = React.useState(false), isPayout = _e[0], setIsPayout = _e[1];
52
52
  var data = useAppSelector(businessSelector).data;
@@ -58,10 +58,16 @@ var SuccessWithFlowButtons = function () {
58
58
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
59
59
  var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
60
60
  var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
61
+ var settings = useAppSelector(settingsSelector);
62
+ var _h = data.verify.responseBody || { contact: {}, id: '' }, contact = _h.contact, id = _h.id;
63
+ var email = (contact || { email: '' }).email;
64
+ var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
61
65
  var reMapFlowData = function (flows) {
62
66
  if (flows === void 0) { flows = []; }
63
67
  var images = ICONS_NAMES;
64
- var mappedFlows = flows.map(function (_a) {
68
+ var mappedFlows = flows
69
+ .filter(function (item) { return item.name; })
70
+ .map(function (_a) {
65
71
  var name = _a.name, url = _a.url, status = _a.status;
66
72
  var type = status === 'initiated' ? 'pending' : 'completed';
67
73
  var title = t("".concat(name, "_flow_").concat(type), {
@@ -80,6 +86,7 @@ var SuccessWithFlowButtons = function () {
80
86
  var hoverSrc = "".concat(name, "_white_icon");
81
87
  return {
82
88
  name: name,
89
+ status: status,
83
90
  title: title,
84
91
  href: url,
85
92
  src: images[src],
@@ -97,6 +104,10 @@ var SuccessWithFlowButtons = function () {
97
104
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
98
105
  reMapFlowData(flows);
99
106
  }, [flows, isAr]);
100
- return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, flowName: data.flowName }) })] }));
107
+ return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
108
+ flowName: data.flowName,
109
+ email: email,
110
+ emailUrl: url
111
+ } }) })] }));
101
112
  };
102
113
  export default memo(SuccessWithFlowButtons);
@@ -32,7 +32,7 @@ var Connect = memo(function (props) {
32
32
  useErrorListener(connectError || error);
33
33
  useStepStartedListener();
34
34
  var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
35
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
35
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
36
36
  var Element = _a.element, name = _a.name;
37
37
  var isActive = activeScreen.name === name;
38
38
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -96,7 +96,7 @@ var Mobile = function (_a) {
96
96
  dispatch(clearError());
97
97
  }, [methods.formState.isValid]);
98
98
  var onSubmit = function (formData) {
99
- dispatch(createMobileAuth(__assign(__assign({}, formData), { isResend: false })));
99
+ dispatch(createMobileAuth(formData));
100
100
  };
101
101
  var onBack = function () {
102
102
  dispatch(handlePrevScreenStep());
@@ -72,7 +72,7 @@ var NID = function (_a) {
72
72
  handleClearError();
73
73
  }, [methods.formState.isValid]);
74
74
  var onSubmit = function (data) {
75
- dispatch(createNIDAuth(__assign(__assign({}, data), { isResend: false })));
75
+ dispatch(createNIDAuth(data));
76
76
  };
77
77
  var handleCollapseOpenClose = function (flag) {
78
78
  setCollapse(flag);
@@ -17,7 +17,7 @@ import Box from '@mui/material/Box/Box';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import OTPField from '../../../shared/OTP';
19
19
  import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
- import { connectSelector, createMobileAuth, createNIDAuth } from '../../../app/connect/connectStore';
20
+ import { connectSelector, resendOTPMobile, resendOTPNID } from '../../../app/connect/connectStore';
21
21
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
22
22
  var BoxStyled = styled(Box)(function (_a) {
23
23
  var theme = _a.theme;
@@ -33,8 +33,6 @@ var OTPInput = function (_a) {
33
33
  var dispatch = useAppDispatch();
34
34
  var otpControl = useController({ name: 'otp', control: control });
35
35
  var data = useAppSelector(connectSelector).data;
36
- var mobileData = data.mobileData;
37
- var nidData = data.nidData;
38
36
  var isAbsher = data.otpData.isAbsher;
39
37
  var handleOnOTPChange = function (otp) {
40
38
  otpControl.field.onChange(otp);
@@ -42,20 +40,12 @@ var OTPInput = function (_a) {
42
40
  var handleOnResendOTP = function () {
43
41
  if (otpControl.field.value)
44
42
  setValue('otp', '', { shouldValidate: true });
45
- var params = {
46
- countryCode: mobileData.countryCode,
47
- mobile: mobileData.mobile
48
- };
49
- dispatch(createMobileAuth(__assign(__assign({}, params), { isResend: true })));
43
+ dispatch(resendOTPMobile());
50
44
  };
51
45
  var handleOnResendAbsherOTP = function () {
52
46
  if (otpControl.field.value)
53
47
  setValue('otp', '', { shouldValidate: true });
54
- var params = {
55
- nid: nidData.nid,
56
- dob: nidData.dob
57
- };
58
- dispatch(createNIDAuth(__assign(__assign({}, params), { isResend: true })));
48
+ dispatch(resendOTPNID());
59
49
  };
60
50
  var otpValue = otpControl.field.value;
61
51
  return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: isAbsher ? handleOnResendAbsherOTP : handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));