@tap-payments/auth-jsconnect 2.0.0 → 2.0.3

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 (49) hide show
  1. package/build/@types/app.d.ts +2 -2
  2. package/build/api/auth.d.ts +2 -0
  3. package/build/api/axios.d.ts +2 -0
  4. package/build/api/axios.js +65 -0
  5. package/build/api/country.d.ts +1 -2
  6. package/build/api/country.js +7 -8
  7. package/build/api/firebase.d.ts +1 -1
  8. package/build/api/firebase.js +5 -2
  9. package/build/api/index.d.ts +4 -5
  10. package/build/api/ip.d.ts +1 -1
  11. package/build/api/ip.js +5 -2
  12. package/build/api/lead.d.ts +2 -0
  13. package/build/api/operator.d.ts +1 -1
  14. package/build/api/operator.js +60 -4
  15. package/build/app/settings.d.ts +9 -12
  16. package/build/app/settings.js +87 -111
  17. package/build/components/AnimationFlow/Loader.js +1 -1
  18. package/build/components/DatePicker/customStyle.css +86 -86
  19. package/build/constants/app.d.ts +1 -0
  20. package/build/constants/app.js +1 -0
  21. package/build/features/app/bank/bankStore.js +2 -2
  22. package/build/features/app/business/businessStore.d.ts +1 -7
  23. package/build/features/app/business/businessStore.js +4 -41
  24. package/build/features/app/connect/connectStore.d.ts +1 -7
  25. package/build/features/app/connect/connectStore.js +11 -45
  26. package/build/features/app/individual/individualStore.d.ts +1 -6
  27. package/build/features/app/individual/individualStore.js +15 -46
  28. package/build/features/app/password/passwordStore.js +2 -2
  29. package/build/features/app/tax/taxStore.js +2 -2
  30. package/build/features/bank/Bank.js +3 -3
  31. package/build/features/business/Business.js +4 -7
  32. package/build/features/connect/Connect.js +3 -7
  33. package/build/features/connect/screens/Merchant/BrandName.js +3 -2
  34. package/build/features/connect/screens/Mobile/Mobile.js +1 -1
  35. package/build/features/individual/Individual.js +4 -7
  36. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +4 -2
  37. package/build/features/password/Password.js +3 -3
  38. package/build/features/shared/Background/Background.js +3 -2
  39. package/build/features/shared/Background/LogoBackground.d.ts +1 -4
  40. package/build/features/shared/Background/LogoBackground.js +4 -32
  41. package/build/features/shared/Button/FlowsButtons.js +3 -2
  42. package/build/features/shared/Footer/Footer.js +2 -3
  43. package/build/features/tax/Tax.js +3 -3
  44. package/build/hooks/useAppConfig.d.ts +1 -4
  45. package/build/hooks/useAppConfig.js +13 -110
  46. package/build/index.css +135 -135
  47. package/build/utils/array.d.ts +3 -0
  48. package/build/utils/array.js +10 -0
  49. package/package.json +1 -1
@@ -1,86 +1,86 @@
1
- .date_picker_input {
2
- cursor: pointer;
3
- }
4
-
5
- .react-calendar {
6
- width: 100%;
7
- border: none;
8
- padding: 15px 0px 15px 0px;
9
- }
10
-
11
- .react-calendar__navigation {
12
- display: flex;
13
- position: relative;
14
- }
15
- .react-calendar__navigation__label__labelText {
16
- font-family: 'Lato', 'Roboto';
17
- }
18
- .react-calendar__navigation button:enabled:hover,
19
- .react-calendar__navigation button:enabled:focus {
20
- background-color: #ffffff;
21
- }
22
- .react-calendar__navigation__prev-button {
23
- top: 20px;
24
- left: 86px;
25
- }
26
-
27
- .react-calendar__navigation__next-button {
28
- top: 0px;
29
- left: 86px;
30
- }
31
-
32
- .react-calendar__navigation__prev2-button {
33
- top: 20px;
34
- right: 13px;
35
- }
36
-
37
- .react-calendar__navigation__next2-button {
38
- top: 0px;
39
- right: 13px;
40
- }
41
-
42
- .react-calendar__navigation__arrow {
43
- background-color: transparent !important;
44
- }
45
-
46
- abbr[title] {
47
- text-decoration: none;
48
- font-weight: 400;
49
- color: #abaeb6;
50
- }
51
-
52
- .react-calendar__tile {
53
- transition: all 0.5s ease;
54
- }
55
-
56
- .react-calendar__tile:enabled:hover,
57
- .react-calendar__tile:enabled:focus {
58
- background-color: transparent;
59
- }
60
-
61
- .react-calendar__tile:enabled:hover {
62
- background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
63
- }
64
-
65
- .react-calendar__month-view__days__day--weekend,
66
- .react-calendar__tile {
67
- color: #3a4154;
68
- }
69
- .react-calendar__tile--hasActive {
70
- background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
71
- }
72
-
73
- .react-calendar__tile--active,
74
- .react-calendar__tile--active:enabled:hover,
75
- .react-calendar__tile--active:enabled:focus {
76
- background-color: transparent;
77
- background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%);
78
- color: #ffffff;
79
- }
80
- .react-calendar__tile--now {
81
- background-color: transparent;
82
- }
83
- .react-calendar__navigation button:disabled {
84
- background-color: #ffffff;
85
- color: #3a4154;
86
- }
1
+ .date_picker_input {
2
+ cursor: pointer;
3
+ }
4
+
5
+ .react-calendar {
6
+ width: 100%;
7
+ border: none;
8
+ padding: 15px 0px 15px 0px;
9
+ }
10
+
11
+ .react-calendar__navigation {
12
+ display: flex;
13
+ position: relative;
14
+ }
15
+ .react-calendar__navigation__label__labelText {
16
+ font-family: 'Lato', 'Roboto';
17
+ }
18
+ .react-calendar__navigation button:enabled:hover,
19
+ .react-calendar__navigation button:enabled:focus {
20
+ background-color: #ffffff;
21
+ }
22
+ .react-calendar__navigation__prev-button {
23
+ top: 20px;
24
+ left: 86px;
25
+ }
26
+
27
+ .react-calendar__navigation__next-button {
28
+ top: 0px;
29
+ left: 86px;
30
+ }
31
+
32
+ .react-calendar__navigation__prev2-button {
33
+ top: 20px;
34
+ right: 13px;
35
+ }
36
+
37
+ .react-calendar__navigation__next2-button {
38
+ top: 0px;
39
+ right: 13px;
40
+ }
41
+
42
+ .react-calendar__navigation__arrow {
43
+ background-color: transparent !important;
44
+ }
45
+
46
+ abbr[title] {
47
+ text-decoration: none;
48
+ font-weight: 400;
49
+ color: #abaeb6;
50
+ }
51
+
52
+ .react-calendar__tile {
53
+ transition: all 0.5s ease;
54
+ }
55
+
56
+ .react-calendar__tile:enabled:hover,
57
+ .react-calendar__tile:enabled:focus {
58
+ background-color: transparent;
59
+ }
60
+
61
+ .react-calendar__tile:enabled:hover {
62
+ background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
63
+ }
64
+
65
+ .react-calendar__month-view__days__day--weekend,
66
+ .react-calendar__tile {
67
+ color: #3a4154;
68
+ }
69
+ .react-calendar__tile--hasActive {
70
+ background: radial-gradient(circle closest-side, #fafafa 0%, #fafafa 98%, rgba(0, 0, 0, 0) 100%);
71
+ }
72
+
73
+ .react-calendar__tile--active,
74
+ .react-calendar__tile--active:enabled:hover,
75
+ .react-calendar__tile--active:enabled:focus {
76
+ background-color: transparent;
77
+ background: radial-gradient(circle closest-side, #3a4154 0%, #3a4154 98%, rgba(0, 0, 0, 0) 100%);
78
+ color: #ffffff;
79
+ }
80
+ .react-calendar__tile--now {
81
+ background-color: transparent;
82
+ }
83
+ .react-calendar__navigation button:disabled {
84
+ background-color: #ffffff;
85
+ color: #3a4154;
86
+ }
@@ -80,6 +80,7 @@ export declare const CONNECT_STEP_NAMES: {
80
80
  CONNECT_SUCCESS: string;
81
81
  };
82
82
  export declare const BUSINESS_STEP_NAMES: {
83
+ BUSINESS_INFO: string;
83
84
  PHONE_AUTH: string;
84
85
  IDENTITY_AUTH: string;
85
86
  IDENTITY_VERIFY_AUTH: string;
@@ -272,6 +272,7 @@ export var CONNECT_STEP_NAMES = {
272
272
  CONNECT_SUCCESS: 'connect_completed'
273
273
  };
274
274
  export var BUSINESS_STEP_NAMES = {
275
+ BUSINESS_INFO: 'business_info',
275
276
  PHONE_AUTH: 'business_phone_auth',
276
277
  IDENTITY_AUTH: 'business_identity_auth',
277
278
  IDENTITY_VERIFY_AUTH: 'business_identity_auth_verify',
@@ -49,7 +49,7 @@ 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 { BANK_STEP_NAMES } from '../../../constants';
55
55
  export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
@@ -211,6 +211,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadBankSuccess', functio
211
211
  if (!id)
212
212
  return [2];
213
213
  payload = {
214
+ lang: settings.data.language,
214
215
  step_name: BANK_STEP_NAMES.BANK_SUCCESS,
215
216
  id: id,
216
217
  encryption_contract: []
@@ -355,7 +356,6 @@ export var bankSlice = createSlice({
355
356
  }
356
357
  var flows = response.flows, steps = response.steps;
357
358
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps });
358
- removeRequestHeaders();
359
359
  })
360
360
  .addCase(updateLeadSuccess.pending, function (state) {
361
361
  state.loading = true;
@@ -1,9 +1,5 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, CountryCode, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes } from '../../../@types';
3
- export declare const getCountries: import("@reduxjs/toolkit").AsyncThunk<{
4
- businessCountry: any;
5
- countries: any;
6
- }, void, {}>;
2
+ import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes } from '../../../@types';
7
3
  export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
8
4
  data: any;
9
5
  leadData: any;
@@ -73,8 +69,6 @@ declare type VerifyData = {
73
69
  };
74
70
  export interface BusinessData {
75
71
  verify: ResponseData & VerifyData;
76
- businessCountry: CountryCode;
77
- countries: CountryCode[];
78
72
  otpData: OTPFormValues & ResponseData & {
79
73
  isNID: boolean;
80
74
  };
@@ -59,25 +59,9 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
59
59
  import moment from 'moment';
60
60
  import API from '../../../api';
61
61
  import { BusinessType, FlowsTypes } from '../../../@types';
62
- import { BUSINESS_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../constants';
63
- import { convertNumbers2English, getFlowUrl, hasKey, removeRequestHeaders } from '../../../utils';
62
+ import { BUSINESS_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../constants';
63
+ import { convertNumbers2English, getFlowUrl, hasKey } from '../../../utils';
64
64
  import { handleNextScreenStep } from '../../../app/settings';
65
- export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
66
- var settings, countriesBody, businessCountry;
67
- return __generator(this, function (_a) {
68
- switch (_a.label) {
69
- case 0:
70
- settings = thunkApi.getState().settings;
71
- return [4, API.countryService.getAllCountries()];
72
- case 1:
73
- countriesBody = (_a.sent()).data;
74
- businessCountry = (countriesBody.list || []).find(function (country) {
75
- return [country.iso2, country.iso3].includes(settings.data.appConfig.businessCountryCode.toUpperCase());
76
- });
77
- return [2, { businessCountry: businessCountry, countries: (countriesBody === null || countriesBody === void 0 ? void 0 : countriesBody.list) || [] }];
78
- }
79
- });
80
- }); });
81
65
  export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
82
66
  var payload, data, leadResponse;
83
67
  return __generator(this, function (_a) {
@@ -191,7 +175,7 @@ export var updateLeadIdentity = createAsyncThunk('updateLeadIdentity', function
191
175
  identification_id: params.nid,
192
176
  identification_id_type: identification_id_type,
193
177
  date_of_birth: params.dob,
194
- country_code: business.data.businessCountry.iso2,
178
+ country_code: settings.data.businessCountry.iso2,
195
179
  step_name: stepName,
196
180
  encryption_contract: ['country_code', 'identification_id', 'identification_id_type', 'date_of_birth']
197
181
  };
@@ -393,6 +377,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
393
377
  if (flowCompleted || !id)
394
378
  return [2];
395
379
  payload = {
380
+ lang: settings.data.language,
396
381
  step_name: BUSINESS_STEP_NAMES.BUSINESS_SUCCESS,
397
382
  id: id,
398
383
  flows: [
@@ -453,8 +438,6 @@ var initialState = {
453
438
  customLoading: false,
454
439
  data: {
455
440
  flowName: FlowsTypes.BUSINESS,
456
- businessCountry: defaultCountry,
457
- countries: [],
458
441
  verify: {
459
442
  token: ''
460
443
  },
@@ -500,23 +483,6 @@ export var businessSlice = createSlice({
500
483
  },
501
484
  extraReducers: function (builder) {
502
485
  builder
503
- .addCase(getCountries.fulfilled, function (state, action) {
504
- state.error = null;
505
- state.customLoading = false;
506
- var _a = action.payload, businessCountry = _a.businessCountry, countries = _a.countries;
507
- state.data.countries = countries
508
- .slice()
509
- .sort(function (cOne, cTwo) { return cOne.name.english.localeCompare(cTwo.name.english); });
510
- state.data.businessCountry = businessCountry || defaultCountry;
511
- })
512
- .addCase(getCountries.pending, function (state) {
513
- state.error = null;
514
- state.customLoading = true;
515
- })
516
- .addCase(getCountries.rejected, function (state, action) {
517
- state.error = action.error.message;
518
- state.customLoading = false;
519
- })
520
486
  .addCase(verifyLeadToken.pending, function (state) {
521
487
  state.error = null;
522
488
  state.customLoading = true;
@@ -586,7 +552,6 @@ export var businessSlice = createSlice({
586
552
  .addCase(updateLeadIdentity.fulfilled, function (state, action) {
587
553
  var _a;
588
554
  state.loading = false;
589
- state.customLoading = false;
590
555
  state.error = null;
591
556
  var _b = action.payload, data = _b.data, formData = _b.formData;
592
557
  var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
@@ -601,7 +566,6 @@ export var businessSlice = createSlice({
601
566
  })
602
567
  .addCase(updateLeadIdentity.rejected, function (state, action) {
603
568
  state.loading = false;
604
- state.customLoading = false;
605
569
  state.error = action.error.message;
606
570
  })
607
571
  .addCase(retrieveEntityList.pending, function (state) {
@@ -808,7 +772,6 @@ export var businessSlice = createSlice({
808
772
  return;
809
773
  }
810
774
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
811
- removeRequestHeaders();
812
775
  })
813
776
  .addCase(updateLeadSuccess.pending, function (state) {
814
777
  state.loading = true;
@@ -1,10 +1,6 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { ResponseData, CountryCode, MobileFormValues, NIDFormValues, OTPFormValues, IndividualFormValues, SharedState, BrandFormValues, FlowsTypes } from '../../../@types';
2
+ import { ResponseData, MobileFormValues, NIDFormValues, OTPFormValues, IndividualFormValues, SharedState, BrandFormValues, FlowsTypes } from '../../../@types';
3
3
  import { CancelToken } from 'axios';
4
- export declare const getCountries: import("@reduxjs/toolkit").AsyncThunk<{
5
- businessCountry: any;
6
- countries: any;
7
- }, void, {}>;
8
4
  export declare const createMobileAuth: import("@reduxjs/toolkit").AsyncThunk<{
9
5
  response: any;
10
6
  formData: MobileFormValues & {
@@ -80,8 +76,6 @@ export declare const updateLeadSuccess: import("@reduxjs/toolkit").AsyncThunk<{
80
76
  formData: void;
81
77
  }, void, {}>;
82
78
  export interface ConnectData {
83
- countries: Array<CountryCode>;
84
- businessCountry: CountryCode;
85
79
  mobileData: (MobileFormValues | undefined) & ResponseData;
86
80
  nidData: NIDFormValues & ResponseData & {
87
81
  type: string;
@@ -61,23 +61,7 @@ import { FlowsTypes } from '../../../@types';
61
61
  import API from '../../../api';
62
62
  import { CONNECT_STEP_NAMES, IDENTIFICATION_TYPE, INSTAGRAM_URL, OTHER_BRAND, TWITTER_URL } from '../../../constants';
63
63
  import { defaultCountry } from '../../../constants';
64
- import { getIndividualName, getFlowUrl, capitalizeTheFirstLetterOfEachWord, removeRequestHeaders } from '../../../utils';
65
- export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
66
- var settings, countriesBody, businessCountry;
67
- return __generator(this, function (_a) {
68
- switch (_a.label) {
69
- case 0:
70
- settings = thunkApi.getState().settings;
71
- return [4, API.countryService.getAllCountries()];
72
- case 1:
73
- countriesBody = (_a.sent()).data;
74
- businessCountry = (countriesBody.list || []).find(function (country) {
75
- return [country.iso2, country.iso3].includes(settings.data.appConfig.businessCountryCode.toUpperCase());
76
- });
77
- return [2, { businessCountry: businessCountry, countries: countriesBody.list }];
78
- }
79
- });
80
- }); });
64
+ import { getIndividualName, getFlowUrl, capitalizeTheFirstLetterOfEachWord } from '../../../utils';
81
65
  export var createMobileAuth = createAsyncThunk('createMobileAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
82
66
  var settings, requestBody, data;
83
67
  var _a, _b;
@@ -86,6 +70,7 @@ export var createMobileAuth = createAsyncThunk('createMobileAuth', function (par
86
70
  case 0:
87
71
  settings = thunkApi.getState().settings;
88
72
  requestBody = {
73
+ lang: settings.data.language,
89
74
  user_credentail: {
90
75
  phone: params.mobile || '',
91
76
  code: params.countryCode.idd_prefix.toString()
@@ -114,11 +99,12 @@ export var createNIDAuth = createAsyncThunk('createNIDAuth', function (params, t
114
99
  _a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
115
100
  identification_id_type = params.nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
116
101
  requestBody = {
102
+ lang: settings.data.language,
117
103
  user_credentail: {
118
104
  identification_id: params.nid,
119
105
  identification_id_type: identification_id_type,
120
106
  date_of_birth: params.dob,
121
- country_code: connect.data.businessCountry.iso2
107
+ country_code: settings.data.businessCountry.iso2
122
108
  },
123
109
  sign_in: false,
124
110
  step_name: CONNECT_STEP_NAMES.CREATE_AUTH_NID,
@@ -200,12 +186,12 @@ export var retrieveLead = createAsyncThunk('retrieveLead', function (params, thu
200
186
  });
201
187
  }); });
202
188
  export var createLead = createAsyncThunk('createLead', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
203
- var connect, businessCountry, payload, brandPayload, _a, brandResponse, data;
204
- return __generator(this, function (_b) {
205
- switch (_b.label) {
189
+ var _a, connect, settings, businessCountry, payload, brandPayload, _b, brandResponse, data;
190
+ return __generator(this, function (_c) {
191
+ switch (_c.label) {
206
192
  case 0:
207
- connect = thunkApi.getState().connect;
208
- businessCountry = connect.data.businessCountry;
193
+ _a = thunkApi.getState(), connect = _a.connect, settings = _a.settings;
194
+ businessCountry = settings.data.businessCountry;
209
195
  payload = {
210
196
  individual_id: params.individualId,
211
197
  country_code: businessCountry.iso2
@@ -218,7 +204,7 @@ export var createLead = createAsyncThunk('createLead', function (params, thunkAp
218
204
  API.leadService.createLead(payload)
219
205
  ])];
220
206
  case 1:
221
- _a = _b.sent(), brandResponse = _a[0].data, data = _a[1].data;
207
+ _b = _c.sent(), brandResponse = _b[0].data, data = _b[1].data;
222
208
  if (!data.errors) {
223
209
  thunkApi.dispatch(handleNextScreenStep(params.stepName));
224
210
  }
@@ -363,6 +349,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
363
349
  isExistingUser = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user) === false;
364
350
  leadId = isExistingUser ? (_c = brandData.responseBody) === null || _c === void 0 ? void 0 : _c.lead_id : (_d = otpData.responseBody) === null || _d === void 0 ? void 0 : _d.lead_id;
365
351
  payload = {
352
+ lang: settings.data.language,
366
353
  step_name: CONNECT_STEP_NAMES.CONNECT_SUCCESS,
367
354
  flows: [
368
355
  {
@@ -388,8 +375,6 @@ var initialState = {
388
375
  customLoading: false,
389
376
  data: {
390
377
  flowName: FlowsTypes.CONNECT,
391
- businessCountry: defaultCountry,
392
- countries: [],
393
378
  mobileData: {
394
379
  countryCode: defaultCountry,
395
380
  mobile: null
@@ -449,24 +434,6 @@ export var connectSlice = createSlice({
449
434
  },
450
435
  extraReducers: function (builder) {
451
436
  builder
452
- .addCase(getCountries.fulfilled, function (state, action) {
453
- state.error = null;
454
- state.customLoading = false;
455
- var _a = action.payload, countries = _a.countries, businessCountry = _a.businessCountry;
456
- state.data.countries = countries
457
- .slice()
458
- .sort(function (cOne, cTwo) { return cOne.name.english.localeCompare(cTwo.name.english); });
459
- state.data.businessCountry = businessCountry || defaultCountry;
460
- state.data.mobileData.countryCode = businessCountry || defaultCountry;
461
- })
462
- .addCase(getCountries.pending, function (state) {
463
- state.error = null;
464
- state.customLoading = true;
465
- })
466
- .addCase(getCountries.rejected, function (state, action) {
467
- state.error = action.error.message;
468
- state.customLoading = false;
469
- })
470
437
  .addCase(createMobileAuth.fulfilled, function (state, action) {
471
438
  var _a;
472
439
  state.loading = false;
@@ -673,7 +640,6 @@ export var connectSlice = createSlice({
673
640
  state.error = description;
674
641
  return;
675
642
  }
676
- removeRequestHeaders();
677
643
  })
678
644
  .addCase(updateLeadSuccess.pending, function (state) {
679
645
  state.loading = true;
@@ -1,9 +1,5 @@
1
1
  import { RootState } from '../../../app/store';
2
2
  import { CountryCode, FlowsTypes, IndividualExtraFormValues, OTPFormValues, ResponseData, SharedState } from '../../../@types';
3
- export declare const getCountries: import("@reduxjs/toolkit").AsyncThunk<{
4
- businessCountry: any;
5
- countries: any;
6
- }, void, {}>;
7
3
  export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
8
4
  data: any;
9
5
  leadData: any;
@@ -16,6 +12,7 @@ export declare const retrieveDataList: import("@reduxjs/toolkit").AsyncThunk<{
16
12
  sourceIncome: any;
17
13
  monthlyIncome: any;
18
14
  countryCode: string;
15
+ countries: CountryCode[];
19
16
  }, string, {}>;
20
17
  export declare const retrieveEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
21
18
  data: any;
@@ -38,8 +35,6 @@ declare type VerifyData = {
38
35
  token: string;
39
36
  };
40
37
  export interface IndividualData {
41
- businessCountry: CountryCode;
42
- countries: Array<CountryCode>;
43
38
  verify: ResponseData & VerifyData;
44
39
  otpData: OTPFormValues & ResponseData;
45
40
  individualData: IndividualExtraFormValues & ResponseData;
@@ -49,25 +49,9 @@ 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 { defaultCountry, INDIVIDUAl_STEP_NAMES } from '../../../constants';
55
- export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
56
- var settings, countriesBody, businessCountry;
57
- return __generator(this, function (_a) {
58
- switch (_a.label) {
59
- case 0:
60
- settings = thunkApi.getState().settings;
61
- return [4, API.countryService.getAllCountries()];
62
- case 1:
63
- countriesBody = (_a.sent()).data;
64
- businessCountry = (countriesBody.list || []).find(function (country) {
65
- return [country.iso2, country.iso3].includes(settings.data.appConfig.businessCountryCode.toUpperCase());
66
- });
67
- return [2, { businessCountry: businessCountry, countries: countriesBody.list }];
68
- }
69
- });
70
- }); });
54
+ import { INDIVIDUAl_STEP_NAMES } from '../../../constants';
71
55
  export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
72
56
  var payload, data, leadResponse, _a, steps, entity, hasTaxCompleted;
73
57
  var _b, _c;
@@ -123,19 +107,23 @@ export var resendOTP = createAsyncThunk('resendOTPIndividual', function (params,
123
107
  });
124
108
  }); });
125
109
  export var retrieveDataList = createAsyncThunk('retrieveDataList', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
126
- var _a, sourceIncome, monthlyIncome;
110
+ var settings, _a, sourceIncome, monthlyIncome, countries;
127
111
  return __generator(this, function (_b) {
128
112
  switch (_b.label) {
129
- case 0: return [4, Promise.all([
130
- API.dataService.getSourceOfIncome(),
131
- API.dataService.getMonthlyIncome(countryCode)
132
- ])];
113
+ case 0:
114
+ settings = thunkApi.getState().settings;
115
+ return [4, Promise.all([
116
+ API.dataService.getSourceOfIncome(),
117
+ API.dataService.getMonthlyIncome(countryCode)
118
+ ])];
133
119
  case 1:
134
120
  _a = _b.sent(), sourceIncome = _a[0].data, monthlyIncome = _a[1].data;
121
+ countries = settings.data.countries;
135
122
  return [2, {
136
123
  sourceIncome: sourceIncome,
137
124
  monthlyIncome: monthlyIncome,
138
- countryCode: countryCode
125
+ countryCode: countryCode,
126
+ countries: countries
139
127
  }];
140
128
  }
141
129
  });
@@ -228,6 +216,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
228
216
  if (!id)
229
217
  return [2];
230
218
  payload = {
219
+ lang: settings.data.language,
231
220
  step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS,
232
221
  id: id,
233
222
  encryption_contract: []
@@ -250,8 +239,6 @@ var initialState = {
250
239
  loading: false,
251
240
  data: {
252
241
  flowName: FlowsTypes.INDIVIDUAL,
253
- countries: [],
254
- businessCountry: defaultCountry,
255
242
  verify: {
256
243
  token: ''
257
244
  },
@@ -284,23 +271,6 @@ export var individualSlice = createSlice({
284
271
  },
285
272
  extraReducers: function (builder) {
286
273
  builder
287
- .addCase(getCountries.fulfilled, function (state, action) {
288
- state.error = null;
289
- state.customLoading = false;
290
- var _a = action.payload, countries = _a.countries, businessCountry = _a.businessCountry;
291
- state.data.countries = countries
292
- .slice()
293
- .sort(function (cOne, cTwo) { return cOne.name.english.localeCompare(cTwo.name.english); });
294
- state.data.businessCountry = businessCountry || defaultCountry;
295
- })
296
- .addCase(getCountries.pending, function (state) {
297
- state.error = null;
298
- state.customLoading = true;
299
- })
300
- .addCase(getCountries.rejected, function (state, action) {
301
- state.error = action.error.message;
302
- state.customLoading = false;
303
- })
304
274
  .addCase(verifyLeadToken.pending, function (state) {
305
275
  state.error = null;
306
276
  state.customLoading = true;
@@ -367,7 +337,7 @@ export var individualSlice = createSlice({
367
337
  .addCase(retrieveDataList.fulfilled, function (state, action) {
368
338
  state.loading = false;
369
339
  state.error = null;
370
- var _a = action.payload, sourceIncome = _a.sourceIncome, monthlyIncome = _a.monthlyIncome, countryCode = _a.countryCode;
340
+ var _a = action.payload, sourceIncome = _a.sourceIncome, monthlyIncome = _a.monthlyIncome, countryCode = _a.countryCode, countries = _a.countries;
371
341
  var data = state.data.individualData.responseBody;
372
342
  state.data.individualData.responseBody = __assign(__assign({}, data), { sourceIncomeList: sourceIncome || [], monthlyIncomeList: monthlyIncome || [] });
373
343
  var selectedSourceIncome = sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome[0];
@@ -377,7 +347,7 @@ export var individualSlice = createSlice({
377
347
  if (!!selectedMonthlyIncome)
378
348
  state.data.individualData.monthlyIncome = selectedMonthlyIncome;
379
349
  if (!!countryCode) {
380
- var employerLocation = state.data.countries.find(function (country) { return country.iso2 === countryCode; });
350
+ var employerLocation = countries.find(function (country) { return country.iso2 === countryCode; });
381
351
  state.data.individualData.employerLocation = employerLocation;
382
352
  }
383
353
  })
@@ -438,7 +408,6 @@ export var individualSlice = createSlice({
438
408
  }
439
409
  var flows = response.flows, steps = response.steps;
440
410
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps });
441
- removeRequestHeaders();
442
411
  })
443
412
  .addCase(updateLeadSuccess.pending, function (state) {
444
413
  state.loading = true;
@@ -49,7 +49,7 @@ 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 { PASSWORD_STEP_NAMES } from '../../../constants';
55
55
  export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
@@ -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: []
@@ -346,7 +347,6 @@ export var passwordSlice = createSlice({
346
347
  }
347
348
  var flows = response.flows, steps = response.steps;
348
349
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps });
349
- removeRequestHeaders();
350
350
  })
351
351
  .addCase(updateLeadSuccess.pending, function (state) {
352
352
  state.loading = true;