@tap-payments/auth-jsconnect 1.0.94-test → 1.0.95-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 (67) hide show
  1. package/build/@types/app.d.ts +2 -2
  2. package/build/api/auth.d.ts +22 -3
  3. package/build/api/axios.d.ts +2 -2
  4. package/build/api/axios.js +62 -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 +7 -8
  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 +6 -15
  16. package/build/app/settings.js +82 -142
  17. package/build/components/AnimationFlow/AnimationFlow.d.ts +2 -1
  18. package/build/components/AnimationFlow/AnimationFlow.js +2 -2
  19. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  20. package/build/components/AnimationFlow/BottomSheet.js +16 -4
  21. package/build/constants/app.d.ts +6 -0
  22. package/build/constants/app.js +16 -4
  23. package/build/features/app/bank/bankStore.js +3 -3
  24. package/build/features/app/business/businessStore.js +5 -5
  25. package/build/features/app/connect/connectStore.js +9 -7
  26. package/build/features/app/individual/individualStore.d.ts +2 -2
  27. package/build/features/app/individual/individualStore.js +5 -5
  28. package/build/features/app/password/passwordStore.d.ts +29 -1
  29. package/build/features/app/password/passwordStore.js +181 -7
  30. package/build/features/app/tax/taxStore.js +4 -4
  31. package/build/features/bank/Bank.js +4 -4
  32. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -3
  33. package/build/features/business/Business.js +4 -4
  34. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
  35. package/build/features/connect/Connect.js +1 -1
  36. package/build/features/featuresScreens.js +5 -0
  37. package/build/features/individual/Individual.js +4 -4
  38. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -3
  39. package/build/features/password/Password.js +12 -6
  40. package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -2
  41. package/build/features/password/screens/OTP/OTP.d.ts +8 -0
  42. package/build/features/password/screens/OTP/OTP.js +78 -0
  43. package/build/features/password/screens/OTP/OTPInput.d.ts +5 -0
  44. package/build/features/password/screens/OTP/OTPInput.js +46 -0
  45. package/build/features/password/screens/OTP/index.d.ts +3 -0
  46. package/build/features/password/screens/OTP/index.js +2 -0
  47. package/build/features/password/screens/OTP/validation.d.ts +8 -0
  48. package/build/features/password/screens/OTP/validation.js +4 -0
  49. package/build/features/password/screens/Success/Success.js +8 -2
  50. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -4
  51. package/build/features/password/screens/Verify/OTPInput.d.ts +2 -2
  52. package/build/features/password/screens/Verify/OTPInput.js +1 -1
  53. package/build/features/shared/Button/FlowsButtons.d.ts +8 -2
  54. package/build/features/shared/Button/FlowsButtons.js +94 -6
  55. package/build/features/shared/Button/SuccessButton.js +17 -13
  56. package/build/features/tax/Tax.js +3 -3
  57. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -3
  58. package/build/hooks/useAppConfig.d.ts +1 -4
  59. package/build/hooks/useAppConfig.js +13 -113
  60. package/build/hooks/useAppTheme.js +3 -2
  61. package/build/theme/theme.d.ts +1 -1
  62. package/build/theme/theme.js +1 -2
  63. package/build/utils/array.d.ts +3 -0
  64. package/build/utils/array.js +10 -0
  65. package/build/utils/string.d.ts +1 -0
  66. package/build/utils/string.js +4 -0
  67. package/package.json +1 -1
@@ -1,3 +1,14 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
13
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
14
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -36,79 +47,78 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
47
  };
37
48
  var _a;
38
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
39
- import { getStoredData, storeData, isArray, findItem, getBrowserInfo, getFingerPrint } from '../utils';
50
+ import { getStoredData, storeData, isArray, findItem, getBrowserInfo, getFingerPrint, sortCountries, findCountryByIso2, getRequestHeaders, encryptString } from '../utils';
40
51
  import { defaultCountry, DefaultDeviceInfo, LOCAL_STORAGE_KEYS } from '../constants';
41
52
  import i18n from '../i18n';
42
53
  import { updateLocale } from '../utils/locale';
43
- import API from '../api';
44
- export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
45
- var settings, countriesBody, countries, businessCountry;
46
- return __generator(this, function (_a) {
47
- switch (_a.label) {
54
+ import API, { setAxiosGlobalHeaders } from '../api';
55
+ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
56
+ var settings, _a, appConfig, language, _b, client, device, os, _c, visitorId, _d, ip, latitude, longitude, locale, list, operatorData, deviceInfo, countries, businessCountry;
57
+ return __generator(this, function (_e) {
58
+ switch (_e.label) {
48
59
  case 0:
49
60
  settings = thunkApi.getState().settings;
50
- return [4, API.countryService.getAllCountries()];
61
+ _a = settings.data, appConfig = _a.appConfig, language = _a.language;
62
+ _b = getBrowserInfo(), client = _b.client, device = _b.device, os = _b.os;
63
+ return [4, Promise.all([
64
+ getFingerPrint(),
65
+ API.ipService.getIP(),
66
+ API.firebaseService.getLocale(),
67
+ API.countryService.getCountries()
68
+ ])];
51
69
  case 1:
52
- countriesBody = (_a.sent()).data;
53
- countries = ((countriesBody === null || countriesBody === void 0 ? void 0 : countriesBody.list) || [])
54
- .slice()
55
- .sort(function (cOne, cTwo) { return cOne.name.english.localeCompare(cTwo.name.english); });
56
- businessCountry = countries.find(function (country) {
57
- return [country.iso2, country.iso3].includes(settings.data.appConfig.businessCountryCode.toUpperCase());
58
- });
59
- return [2, { businessCountry: businessCountry, countries: countries }];
60
- }
61
- });
62
- }); });
63
- export var getClientIp = createAsyncThunk('getClientIp', function () { return __awaiter(void 0, void 0, void 0, function () {
64
- var data;
65
- return __generator(this, function (_a) {
66
- switch (_a.label) {
67
- case 0: return [4, API.ipService.getIP()];
68
- case 1:
69
- data = (_a.sent()).data;
70
- return [2, data];
71
- }
72
- });
73
- }); });
74
- export var getBrowserFingerPrint = createAsyncThunk('getBrowserFingerPrint', function (params) { return __awaiter(void 0, void 0, void 0, function () {
75
- var _a, client, device, os, fingerPrint;
76
- return __generator(this, function (_b) {
77
- switch (_b.label) {
78
- case 0:
79
- _a = getBrowserInfo(), client = _a.client, device = _a.device, os = _a.os;
80
- return [4, getFingerPrint()];
81
- case 1:
82
- fingerPrint = _b.sent();
83
- return [2, { fingerPrint: fingerPrint, client: client, device: device, os: os, appInfo: params }];
84
- }
85
- });
86
- }); });
87
- export var getOperator = createAsyncThunk('getOperator', function (params) { return __awaiter(void 0, void 0, void 0, function () {
88
- var data;
89
- return __generator(this, function (_a) {
90
- switch (_a.label) {
91
- case 0: return [4, API.operatorService.validateOperator(params)];
92
- case 1:
93
- data = (_a.sent()).data;
94
- return [2, data];
95
- }
96
- });
97
- }); });
98
- export var getLocale = createAsyncThunk('getLocale', function () { return __awaiter(void 0, void 0, void 0, function () {
99
- var data;
100
- return __generator(this, function (_a) {
101
- switch (_a.label) {
102
- case 0: return [4, API.firebaseService.getLocale()];
103
- case 1:
104
- data = (_a.sent()).data;
105
- return [2, data];
70
+ _c = _e.sent(), visitorId = _c[0].visitorId, _d = _c[1], ip = _d.ip, latitude = _d.latitude, longitude = _d.longitude, locale = _c[2], list = _c[3].list;
71
+ operatorData = {
72
+ type: 'website',
73
+ app_client_version: 'js-auth-connect',
74
+ requirer_browser: "".concat(client === null || client === void 0 ? void 0 : client.name, " , ").concat(client === null || client === void 0 ? void 0 : client.version),
75
+ os: "".concat(os === null || os === void 0 ? void 0 : os.name, " , ").concat(os === null || os === void 0 ? void 0 : os.version),
76
+ locale: language
77
+ };
78
+ deviceInfo = {
79
+ app: {
80
+ language: appConfig.language || 'en',
81
+ name: appConfig.appInfo.name,
82
+ identifier: appConfig.appInfo.identifier || 'auth-connect',
83
+ version: appConfig.appInfo.version || '2.0.0'
84
+ },
85
+ browser: {
86
+ browser_id: visitorId,
87
+ name: (client === null || client === void 0 ? void 0 : client.name) || '',
88
+ user_agent: window.navigator.userAgent,
89
+ version: (client === null || client === void 0 ? void 0 : client.version) || ''
90
+ },
91
+ device: {
92
+ name: '',
93
+ brand: (device === null || device === void 0 ? void 0 : device.brand) || '',
94
+ model: (device === null || device === void 0 ? void 0 : device.model) || '',
95
+ type: (device === null || device === void 0 ? void 0 : device.type) || '',
96
+ os: {
97
+ name: (os === null || os === void 0 ? void 0 : os.name) || '',
98
+ version: (os === null || os === void 0 ? void 0 : os.version) || ''
99
+ }
100
+ },
101
+ connection: {
102
+ ip: ip,
103
+ latitude: latitude,
104
+ longitude: longitude,
105
+ mac: ''
106
+ },
107
+ source: 'browser'
108
+ };
109
+ setAxiosGlobalHeaders(__assign(__assign({}, getRequestHeaders(deviceInfo)), { authorization: encryptString(appConfig.publicKey), mdn: encryptString(window.location.origin) }));
110
+ return [4, API.operatorService.validateOperator(operatorData)];
111
+ case 2:
112
+ _e.sent();
113
+ countries = sortCountries(list);
114
+ businessCountry = findCountryByIso2(countries, appConfig.businessCountryCode) || defaultCountry;
115
+ return [2, { countries: countries, businessCountry: businessCountry, locale: locale, deviceInfo: deviceInfo }];
106
116
  }
107
117
  });
108
118
  }); });
109
119
  var initialState = {
110
120
  error: null,
111
- loading: false,
121
+ loading: true,
112
122
  data: {
113
123
  open: true,
114
124
  isTapOrigin: true,
@@ -207,89 +217,19 @@ export var settingsSlice = createSlice({
207
217
  }
208
218
  },
209
219
  extraReducers: function (builder) {
210
- builder
211
- .addCase(getCountries.fulfilled, function (state, action) {
212
- state.error = null;
213
- state.loading = false;
214
- var _a = action.payload, countries = _a.countries, businessCountry = _a.businessCountry;
215
- state.data.countries = countries;
216
- state.data.businessCountry = businessCountry || defaultCountry;
217
- })
218
- .addCase(getCountries.pending, function (state) {
219
- state.error = null;
220
+ builder.addCase(fetchAppSettingsSync.pending, function (state) {
220
221
  state.loading = true;
221
- })
222
- .addCase(getCountries.rejected, function (state, action) {
223
- state.error = action.error.message;
224
- state.loading = false;
225
- })
226
- .addCase(getClientIp.pending, function (state) {
227
222
  state.error = null;
228
- state.loading = true;
229
- })
230
- .addCase(getClientIp.fulfilled, function (state, action) {
231
- state.error = null;
232
- state.loading = false;
233
- var _a = action.payload, ip = _a.ip, latitude = _a.latitude, longitude = _a.longitude;
234
- state.data.deviceInfo.connection.ip = ip;
235
- state.data.deviceInfo.connection.latitude = latitude;
236
- state.data.deviceInfo.connection.longitude = longitude;
237
- })
238
- .addCase(getClientIp.rejected, function (state, action) {
239
- state.error = action.error.message;
240
- state.loading = false;
241
- })
242
- .addCase(getBrowserFingerPrint.pending, function (state) {
243
- state.loading = true;
244
- state.error = null;
245
- })
246
- .addCase(getBrowserFingerPrint.fulfilled, function (state, action) {
247
- state.loading = false;
248
- state.error = null;
249
- var _a = action.payload, appInfo = _a.appInfo, client = _a.client, device = _a.device, fingerPrint = _a.fingerPrint, os = _a.os;
250
- state.data.deviceInfo.app.language = state.data.appConfig.language || 'en';
251
- state.data.deviceInfo.app.name = appInfo.name;
252
- state.data.deviceInfo.app.version = appInfo.version || '2.0.0';
253
- state.data.deviceInfo.app.identifier = appInfo.identifier || 'auth-connect-demo';
254
- state.data.deviceInfo.browser.browser_id = fingerPrint === null || fingerPrint === void 0 ? void 0 : fingerPrint.visitorId;
255
- state.data.deviceInfo.browser.name = (client === null || client === void 0 ? void 0 : client.name) || '';
256
- state.data.deviceInfo.browser.user_agent = window.navigator.userAgent;
257
- state.data.deviceInfo.browser.version = (client === null || client === void 0 ? void 0 : client.version) || '';
258
- state.data.deviceInfo.device.brand = (device === null || device === void 0 ? void 0 : device.brand) || '';
259
- state.data.deviceInfo.device.model = (device === null || device === void 0 ? void 0 : device.model) || '';
260
- state.data.deviceInfo.device.os.name = (os === null || os === void 0 ? void 0 : os.name) || '';
261
- state.data.deviceInfo.device.os.version = (os === null || os === void 0 ? void 0 : os.version) || '';
262
- state.data.deviceInfo.device.type = (device === null || device === void 0 ? void 0 : device.type) || '';
263
- })
264
- .addCase(getBrowserFingerPrint.rejected, function (state, action) {
265
- state.loading = false;
266
- state.loading = false;
267
- state.error = action.error.message;
268
- })
269
- .addCase(getOperator.pending, function (state) {
270
- state.error = null;
271
- state.loading = true;
272
- })
273
- .addCase(getOperator.fulfilled, function (state, action) {
274
- state.loading = false;
275
- if (action.payload === 'valid') {
276
- state.error = null;
277
- }
278
- })
279
- .addCase(getOperator.rejected, function (state, action) {
280
- state.error = action.error.message;
281
- state.loading = false;
282
- })
283
- .addCase(getLocale.pending, function (state) {
284
- state.error = null;
285
- state.loading = true;
286
- })
287
- .addCase(getLocale.fulfilled, function (state, action) {
223
+ });
224
+ builder.addCase(fetchAppSettingsSync.fulfilled, function (state, action) {
225
+ var _a = action.payload, businessCountry = _a.businessCountry, countries = _a.countries, locale = _a.locale, deviceInfo = _a.deviceInfo;
226
+ state.data.countries = countries;
227
+ state.data.businessCountry = businessCountry;
228
+ state.data.deviceInfo = deviceInfo;
229
+ updateLocale(locale, businessCountry.iso2);
288
230
  state.loading = false;
289
- state.error = null;
290
- updateLocale(action.payload, state.data.appConfig.businessCountryCode);
291
- })
292
- .addCase(getLocale.rejected, function (state, action) {
231
+ });
232
+ builder.addCase(fetchAppSettingsSync.rejected, function (state, action) {
293
233
  state.loading = false;
294
234
  state.error = action.error.message;
295
235
  });
@@ -8,5 +8,6 @@ export interface AnimationFlowProps {
8
8
  breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
9
9
  loading?: boolean;
10
10
  error?: string | null;
11
+ screenId?: string;
11
12
  }
12
- export default function AnimationFlow({ open, children, breakpoint, type, footer, loading, error, isTapOrigin }: AnimationFlowProps): JSX.Element;
13
+ export default function AnimationFlow({ open, children, breakpoint, type, footer, loading, error, isTapOrigin, screenId }: AnimationFlowProps): JSX.Element;
@@ -17,7 +17,7 @@ import BottomSheet from './BottomSheet';
17
17
  import Loader from './Loader';
18
18
  import Error from './Error';
19
19
  export default function AnimationFlow(_a) {
20
- var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, footer = _a.footer, loading = _a.loading, error = _a.error, isTapOrigin = _a.isTapOrigin;
20
+ var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, footer = _a.footer, loading = _a.loading, error = _a.error, isTapOrigin = _a.isTapOrigin, screenId = _a.screenId;
21
21
  var theme = useTheme();
22
22
  var matches = useMediaQuery(theme.breakpoints.down(breakpoint || 'sm'));
23
23
  if (loading) {
@@ -32,5 +32,5 @@ export default function AnimationFlow(_a) {
32
32
  if (type === 'BOTTOMSHEET') {
33
33
  return _jsx(BottomSheet, __assign({ open: open }, { children: children }));
34
34
  }
35
- return matches ? (_jsx(BottomSheet, __assign({ open: open }, { children: children }))) : (_jsx(Dialog, __assign({ open: open, footer: footer, isTapOrigin: isTapOrigin }, { children: children })));
35
+ return matches ? (_jsx(BottomSheet, __assign({ open: open, screenId: screenId }, { children: children }))) : (_jsx(Dialog, __assign({ open: open, footer: footer, isTapOrigin: isTapOrigin }, { children: children })));
36
36
  }
@@ -4,6 +4,7 @@ import 'react-spring-bottom-sheet/dist/style.css';
4
4
  export interface BottomSheetProps extends MainBottomSheetProps {
5
5
  children: React.ReactNode;
6
6
  open: boolean;
7
+ screenId?: string;
7
8
  }
8
- declare const _default: React.MemoExoticComponent<({ open, children, ...rest }: BottomSheetProps) => JSX.Element>;
9
+ declare const _default: React.MemoExoticComponent<({ open, children, screenId, ...rest }: BottomSheetProps) => JSX.Element>;
9
10
  export default _default;
@@ -59,13 +59,25 @@ var BottomSheetStyled = styled(BottomSheet)(function (_a) {
59
59
  });
60
60
  });
61
61
  var BottomSheetComponent = function (_a) {
62
- var open = _a.open, children = _a.children, rest = __rest(_a, ["open", "children"]);
62
+ var open = _a.open, children = _a.children, screenId = _a.screenId, rest = __rest(_a, ["open", "children", "screenId"]);
63
+ var sheetRef = React.useRef(null);
63
64
  var getMinHeight = function (maxHeight) {
64
- var element = document.getElementById('main-feature-container');
65
- var height = element ? element.clientHeight : 0;
65
+ var el = document.getElementById('main-feature-container');
66
+ var height = el ? el.clientHeight : 0;
66
67
  return height || maxHeight * 0.7;
67
68
  };
68
- return (_jsx(BottomSheetStyled, __assign({ open: open, snapPoints: function (_a) {
69
+ React.useEffect(function () {
70
+ if (sheetRef.current && screenId) {
71
+ setTimeout(function () {
72
+ var _a, _b;
73
+ (_b = (_a = sheetRef === null || sheetRef === void 0 ? void 0 : sheetRef.current) === null || _a === void 0 ? void 0 : _a.snapTo) === null || _b === void 0 ? void 0 : _b.call(_a, function (_a) {
74
+ var maxHeight = _a.maxHeight;
75
+ return getMinHeight(maxHeight);
76
+ });
77
+ }, 500);
78
+ }
79
+ }, [screenId]);
80
+ return (_jsx(BottomSheetStyled, __assign({ ref: sheetRef, open: open, snapPoints: function (_a) {
69
81
  var maxHeight = _a.maxHeight;
70
82
  return [getMinHeight(maxHeight), maxHeight * 0.95];
71
83
  } }, rest, { children: children })));
@@ -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;
@@ -109,6 +110,7 @@ export declare const PASSWORD_STEP_NAMES: {
109
110
  PHONE_AUTH: string;
110
111
  PASSWORD_CREATE: string;
111
112
  PASSWORD_SUCCESS: string;
113
+ RESET_PASSWORD: string;
112
114
  };
113
115
  export declare const RSA_FRONTEND_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgC9kH1SQvjbXAUXd0PbrDUG8P\nLhRig9pJNBmdQBZjihuaxfkzYu6ToMbIMAfmYgVgQw338/y7aQ8X3m03CXNIlkxo\nOwxKCA8ymKsZQptXJn9IxlPO7yjoFgTFBrpmTgvcC4XO1uoUYTAPq3szK8kj4zgT\nucWG1hSKsOdRU7sl/wIDAQAB\n-----END PUBLIC KEY-----";
114
116
  export declare const ENCRYPTION_FLAG = "encryption_contract";
@@ -135,3 +137,7 @@ export declare const OTHER_CR_LICENSE: {
135
137
  };
136
138
  type: BusinessType;
137
139
  };
140
+ export declare const PASSWORD_OPERATION_TYPE: {
141
+ SET_PASSWORD: string;
142
+ RESET_PASSWORD: string;
143
+ };
@@ -141,21 +141,27 @@ export var PASSWORD_SCREENS_NAVIGATION = [
141
141
  },
142
142
  {
143
143
  name: 'PASSWORD_CREATE_PASSWORD_STEP',
144
- next: 'PASSWORD_SUCCESS_STEP',
144
+ next: ['PASSWORD_SUCCESS_STEP', 'PASSWORD_RESET_PASSWORD_OTP_STEP'],
145
145
  prev: '',
146
146
  order: 2
147
147
  },
148
+ {
149
+ name: 'PASSWORD_RESET_PASSWORD_OTP_STEP',
150
+ next: 'PASSWORD_SUCCESS_STEP',
151
+ prev: 'PASSWORD_CREATE_PASSWORD_STEP',
152
+ order: 3
153
+ },
148
154
  {
149
155
  name: 'PASSWORD_SUCCESS_STEP',
150
156
  next: 'PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
151
157
  prev: 'PASSWORD_CREATE_PASSWORD_STEP',
152
- order: 3
158
+ order: 4
153
159
  },
154
160
  {
155
161
  name: 'PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
156
162
  next: '',
157
163
  prev: '',
158
- order: 4
164
+ order: 5
159
165
  }
160
166
  ];
161
167
  export var BANK_SCREENS_NAVIGATION = [
@@ -272,6 +278,7 @@ export var CONNECT_STEP_NAMES = {
272
278
  CONNECT_SUCCESS: 'connect_completed'
273
279
  };
274
280
  export var BUSINESS_STEP_NAMES = {
281
+ BUSINESS_INFO: 'business_info',
275
282
  PHONE_AUTH: 'business_phone_auth',
276
283
  IDENTITY_AUTH: 'business_identity_auth',
277
284
  IDENTITY_VERIFY_AUTH: 'business_identity_auth_verify',
@@ -300,7 +307,8 @@ export var PASSWORD_STEP_NAMES = {
300
307
  PASSWORD_INFO: 'password_info',
301
308
  PHONE_AUTH: 'password_phone_auth',
302
309
  PASSWORD_CREATE: 'password_create',
303
- PASSWORD_SUCCESS: 'password_completed'
310
+ PASSWORD_SUCCESS: 'password_completed',
311
+ RESET_PASSWORD: 'reset_password'
304
312
  };
305
313
  export var RSA_FRONTEND_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgC9kH1SQvjbXAUXd0PbrDUG8P\nLhRig9pJNBmdQBZjihuaxfkzYu6ToMbIMAfmYgVgQw338/y7aQ8X3m03CXNIlkxo\nOwxKCA8ymKsZQptXJn9IxlPO7yjoFgTFBrpmTgvcC4XO1uoUYTAPq3szK8kj4zgT\nucWG1hSKsOdRU7sl/wIDAQAB\n-----END PUBLIC KEY-----";
306
314
  export var ENCRYPTION_FLAG = 'encryption_contract';
@@ -327,3 +335,7 @@ export var OTHER_CR_LICENSE = {
327
335
  },
328
336
  type: BusinessType.CR
329
337
  };
338
+ export var PASSWORD_OPERATION_TYPE = {
339
+ SET_PASSWORD: 'set_password',
340
+ RESET_PASSWORD: 'reset_password'
341
+ };
@@ -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 { BANK_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('bankVerifyLeadToken', 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) {
@@ -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;
@@ -60,9 +60,9 @@ import moment from 'moment';
60
60
  import API from '../../../api';
61
61
  import { BusinessType, FlowsTypes } from '../../../@types';
62
62
  import { BUSINESS_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../constants';
63
- import { convertNumbers2English, getFlowUrl, hasKey, removeRequestHeaders } from '../../../utils';
63
+ import { convertNumbers2English, getFlowUrl, hasKey } from '../../../utils';
64
64
  import { handleNextScreenStep } from '../../../app/settings';
65
- export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
65
+ export var verifyLeadToken = createAsyncThunk('businessVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
66
66
  var payload, data, leadResponse;
67
67
  return __generator(this, function (_a) {
68
68
  switch (_a.label) {
@@ -311,7 +311,7 @@ export var updateActivitiesInfo = createAsyncThunk('updateActivitiesInfo', funct
311
311
  }
312
312
  });
313
313
  }); });
314
- export var retrieveDataList = createAsyncThunk('retrieveDataList', function () { return __awaiter(void 0, void 0, void 0, function () {
314
+ export var retrieveDataList = createAsyncThunk('bankRetrieveDataList', function () { return __awaiter(void 0, void 0, void 0, function () {
315
315
  var _a, customerBases, expectedSales, expectedCustomerSales;
316
316
  return __generator(this, function (_b) {
317
317
  switch (_b.label) {
@@ -365,7 +365,7 @@ export var updateCustomersInfo = createAsyncThunk('updateCustomersInfo', functio
365
365
  }
366
366
  });
367
367
  }); });
368
- export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
368
+ export var updateLeadSuccess = createAsyncThunk('businessUpdateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
369
369
  var _a, settings, business, _b, steps, id, flowCompleted, payload, data;
370
370
  var _c, _d, _e, _f, _g;
371
371
  return __generator(this, function (_h) {
@@ -377,6 +377,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
377
377
  if (flowCompleted || !id)
378
378
  return [2];
379
379
  payload = {
380
+ lang: settings.data.language,
380
381
  step_name: BUSINESS_STEP_NAMES.BUSINESS_SUCCESS,
381
382
  id: id,
382
383
  flows: [
@@ -771,7 +772,6 @@ export var businessSlice = createSlice({
771
772
  return;
772
773
  }
773
774
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
774
- removeRequestHeaders();
775
775
  })
776
776
  .addCase(updateLeadSuccess.pending, function (state) {
777
777
  state.loading = true;
@@ -61,7 +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';
64
+ import { getIndividualName, getFlowUrl, capitalizeTheFirstLetterOfEachWord } from '../../../utils';
65
65
  export var createMobileAuth = createAsyncThunk('createMobileAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
66
66
  var settings, requestBody, data;
67
67
  var _a, _b;
@@ -70,6 +70,7 @@ export var createMobileAuth = createAsyncThunk('createMobileAuth', function (par
70
70
  case 0:
71
71
  settings = thunkApi.getState().settings;
72
72
  requestBody = {
73
+ lang: settings.data.language,
73
74
  user_credentail: {
74
75
  phone: params.mobile || '',
75
76
  code: params.countryCode.idd_prefix.toString()
@@ -98,6 +99,7 @@ export var createNIDAuth = createAsyncThunk('createNIDAuth', function (params, t
98
99
  _a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
99
100
  identification_id_type = params.nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
100
101
  requestBody = {
102
+ lang: settings.data.language,
101
103
  user_credentail: {
102
104
  identification_id: params.nid,
103
105
  identification_id_type: identification_id_type,
@@ -184,11 +186,11 @@ export var retrieveLead = createAsyncThunk('retrieveLead', function (params, thu
184
186
  });
185
187
  }); });
186
188
  export var createLead = createAsyncThunk('createLead', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
187
- var _a, connect, settings, businessCountry, payload, brandPayload, _b, brandResponse, data;
188
- return __generator(this, function (_c) {
189
- switch (_c.label) {
189
+ var settings, businessCountry, payload, brandPayload, _a, brandResponse, data;
190
+ return __generator(this, function (_b) {
191
+ switch (_b.label) {
190
192
  case 0:
191
- _a = thunkApi.getState(), connect = _a.connect, settings = _a.settings;
193
+ settings = thunkApi.getState().settings;
192
194
  businessCountry = settings.data.businessCountry;
193
195
  payload = {
194
196
  individual_id: params.individualId,
@@ -202,7 +204,7 @@ export var createLead = createAsyncThunk('createLead', function (params, thunkAp
202
204
  API.leadService.createLead(payload)
203
205
  ])];
204
206
  case 1:
205
- _b = _c.sent(), brandResponse = _b[0].data, data = _b[1].data;
207
+ _a = _b.sent(), brandResponse = _a[0].data, data = _a[1].data;
206
208
  if (!data.errors) {
207
209
  thunkApi.dispatch(handleNextScreenStep(params.stepName));
208
210
  }
@@ -347,6 +349,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
347
349
  isExistingUser = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user) === false;
348
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;
349
351
  payload = {
352
+ lang: settings.data.language,
350
353
  step_name: CONNECT_STEP_NAMES.CONNECT_SUCCESS,
351
354
  flows: [
352
355
  {
@@ -637,7 +640,6 @@ export var connectSlice = createSlice({
637
640
  state.error = description;
638
641
  return;
639
642
  }
640
- removeRequestHeaders();
641
643
  })
642
644
  .addCase(updateLeadSuccess.pending, function (state) {
643
645
  state.loading = true;
@@ -1,5 +1,5 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { CountryCode, FlowsTypes, IndividualExtraFormValues, OTPFormValues, ResponseData, SharedState } from '../../../@types';
2
+ import { FlowsTypes, IndividualExtraFormValues, OTPFormValues, ResponseData, SharedState } from '../../../@types';
3
3
  export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
4
4
  data: any;
5
5
  leadData: any;
@@ -12,7 +12,7 @@ export declare const retrieveDataList: import("@reduxjs/toolkit").AsyncThunk<{
12
12
  sourceIncome: any;
13
13
  monthlyIncome: any;
14
14
  countryCode: string;
15
- countries: CountryCode[];
15
+ countries: import("../../../@types").CountryCode[];
16
16
  }, string, {}>;
17
17
  export declare const retrieveEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
18
18
  data: any;
@@ -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 { INDIVIDUAl_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('individualVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
56
56
  var payload, data, leadResponse, _a, steps, entity, hasTaxCompleted;
57
57
  var _b, _c;
58
58
  return __generator(this, function (_d) {
@@ -106,7 +106,7 @@ export var resendOTP = createAsyncThunk('resendOTPIndividual', function (params,
106
106
  }
107
107
  });
108
108
  }); });
109
- export var retrieveDataList = createAsyncThunk('retrieveDataList', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
109
+ export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
110
110
  var settings, _a, sourceIncome, monthlyIncome, countries;
111
111
  return __generator(this, function (_b) {
112
112
  switch (_b.label) {
@@ -205,7 +205,7 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
205
205
  }
206
206
  });
207
207
  }); });
208
- export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
208
+ export var updateLeadSuccess = createAsyncThunk('individualUpdateLeadSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
209
209
  var _a, settings, individual, id, payload, data;
210
210
  var _b, _c, _d, _e, _f;
211
211
  return __generator(this, function (_g) {
@@ -216,6 +216,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
216
216
  if (!id)
217
217
  return [2];
218
218
  payload = {
219
+ lang: settings.data.language,
219
220
  step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS,
220
221
  id: id,
221
222
  encryption_contract: []
@@ -407,7 +408,6 @@ export var individualSlice = createSlice({
407
408
  }
408
409
  var flows = response.flows, steps = response.steps;
409
410
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps });
410
- removeRequestHeaders();
411
411
  })
412
412
  .addCase(updateLeadSuccess.pending, function (state) {
413
413
  state.loading = true;