@tap-payments/auth-jsconnect 1.0.91-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 (134) hide show
  1. package/README.md +58 -52
  2. package/build/@types/app.d.ts +11 -2
  3. package/build/@types/app.js +9 -0
  4. package/build/@types/form.d.ts +2 -0
  5. package/build/api/auth.d.ts +22 -3
  6. package/build/api/axios.d.ts +2 -0
  7. package/build/api/axios.js +64 -0
  8. package/build/api/country.d.ts +1 -2
  9. package/build/api/country.js +7 -8
  10. package/build/api/firebase.d.ts +1 -1
  11. package/build/api/firebase.js +5 -2
  12. package/build/api/index.d.ts +7 -8
  13. package/build/api/ip.d.ts +1 -1
  14. package/build/api/ip.js +5 -2
  15. package/build/api/lead.d.ts +2 -0
  16. package/build/api/operator.d.ts +1 -1
  17. package/build/api/operator.js +60 -4
  18. package/build/app/rootReducer.d.ts +0 -1
  19. package/build/app/rootReducer.js +1 -3
  20. package/build/app/settings.d.ts +9 -12
  21. package/build/app/settings.js +87 -111
  22. package/build/app/store.d.ts +0 -2
  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/components/AnimationFlow/Loader.js +1 -1
  28. package/build/constants/app.d.ts +6 -1
  29. package/build/constants/app.js +16 -12
  30. package/build/features/app/bank/bankStore.d.ts +5 -1
  31. package/build/features/app/bank/bankStore.js +41 -4
  32. package/build/features/app/business/businessStore.d.ts +5 -7
  33. package/build/features/app/business/businessStore.js +44 -46
  34. package/build/features/app/connect/connectStore.d.ts +2 -7
  35. package/build/features/app/connect/connectStore.js +23 -55
  36. package/build/features/app/individual/individualStore.d.ts +6 -7
  37. package/build/features/app/individual/individualStore.js +55 -50
  38. package/build/features/app/password/passwordStore.d.ts +34 -2
  39. package/build/features/app/password/passwordStore.js +218 -8
  40. package/build/features/app/tax/taxStore.d.ts +5 -1
  41. package/build/features/app/tax/taxStore.js +43 -6
  42. package/build/features/bank/Bank.js +8 -7
  43. package/build/features/bank/screens/BankDetails/BankDetails.js +2 -1
  44. package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +3 -0
  45. package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +67 -0
  46. package/build/features/bank/screens/BankDetails/validation.d.ts +3 -0
  47. package/build/features/bank/screens/BankDetails/validation.js +2 -1
  48. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -4
  49. package/build/features/bank/screens/Verify/OTPInput.d.ts +3 -1
  50. package/build/features/bank/screens/Verify/OTPInput.js +6 -1
  51. package/build/features/bank/screens/Verify/Verify.js +3 -2
  52. package/build/features/business/Business.js +9 -11
  53. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -5
  54. package/build/features/business/screens/Verify/OTPInput.d.ts +3 -1
  55. package/build/features/business/screens/Verify/OTPInput.js +6 -1
  56. package/build/features/business/screens/Verify/Verify.js +3 -2
  57. package/build/features/connect/Connect.js +7 -9
  58. package/build/features/connect/screens/Merchant/BrandName.js +3 -2
  59. package/build/features/connect/screens/Mobile/Mobile.js +1 -1
  60. package/build/features/featuresScreens.d.ts +0 -1
  61. package/build/features/featuresScreens.js +5 -7
  62. package/build/features/individual/Individual.js +9 -11
  63. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +4 -2
  64. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -4
  65. package/build/features/individual/screens/Verify/OTPInput.d.ts +3 -1
  66. package/build/features/individual/screens/Verify/OTPInput.js +6 -1
  67. package/build/features/individual/screens/Verify/Verify.js +3 -2
  68. package/build/features/password/Password.js +16 -9
  69. package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -2
  70. package/build/features/password/screens/OTP/OTP.d.ts +8 -0
  71. package/build/features/password/screens/OTP/OTP.js +78 -0
  72. package/build/features/password/screens/OTP/OTPInput.d.ts +5 -0
  73. package/build/features/password/screens/OTP/OTPInput.js +46 -0
  74. package/build/features/password/screens/OTP/index.d.ts +3 -0
  75. package/build/features/password/screens/OTP/index.js +2 -0
  76. package/build/features/password/screens/OTP/validation.d.ts +8 -0
  77. package/build/features/password/screens/OTP/validation.js +4 -0
  78. package/build/features/password/screens/Success/Success.js +8 -2
  79. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -5
  80. package/build/features/password/screens/Verify/OTPInput.d.ts +3 -1
  81. package/build/features/password/screens/Verify/OTPInput.js +6 -1
  82. package/build/features/password/screens/Verify/Verify.js +3 -2
  83. package/build/features/shared/Background/Background.js +3 -2
  84. package/build/features/shared/Background/LogoBackground.d.ts +1 -4
  85. package/build/features/shared/Background/LogoBackground.js +4 -32
  86. package/build/features/shared/Button/AbsherButton.js +3 -8
  87. package/build/features/shared/Button/EmailProvidersButtons.js +2 -1
  88. package/build/features/shared/Button/FlowsButtons.d.ts +10 -1
  89. package/build/features/shared/Button/FlowsButtons.js +100 -7
  90. package/build/features/shared/Button/MobileButton.js +3 -8
  91. package/build/features/shared/Button/SuccessButton.js +17 -13
  92. package/build/features/shared/Footer/Footer.js +2 -3
  93. package/build/features/shared/OTP/OTP.d.ts +2 -1
  94. package/build/features/shared/OTP/OTP.js +10 -2
  95. package/build/features/tax/Tax.js +7 -6
  96. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -4
  97. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +3 -0
  98. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +66 -0
  99. package/build/features/tax/screens/TaxDetails/TaxDetails.js +5 -2
  100. package/build/features/tax/screens/TaxDetails/VATId.js +13 -2
  101. package/build/features/tax/screens/TaxDetails/validation.d.ts +3 -0
  102. package/build/features/tax/screens/TaxDetails/validation.js +2 -1
  103. package/build/features/tax/screens/Verify/OTPInput.d.ts +3 -1
  104. package/build/features/tax/screens/Verify/OTPInput.js +6 -1
  105. package/build/features/tax/screens/Verify/Verify.js +3 -2
  106. package/build/hooks/index.d.ts +1 -0
  107. package/build/hooks/index.js +1 -0
  108. package/build/hooks/useAppConfig.d.ts +1 -4
  109. package/build/hooks/useAppConfig.js +13 -110
  110. package/build/hooks/useAppDispatch.d.ts +0 -1
  111. package/build/hooks/useAppTheme.js +3 -2
  112. package/build/hooks/useErrorListener.d.ts +1 -1
  113. package/build/hooks/useErrorListener.js +4 -6
  114. package/build/hooks/useStepStartedListener.d.ts +1 -0
  115. package/build/hooks/useStepStartedListener.js +10 -0
  116. package/build/index.d.ts +2 -3
  117. package/build/index.js +2 -5
  118. package/build/theme/theme.d.ts +1 -1
  119. package/build/theme/theme.js +1 -2
  120. package/build/utils/array.d.ts +3 -0
  121. package/build/utils/array.js +10 -0
  122. package/build/utils/string.d.ts +2 -0
  123. package/build/utils/string.js +23 -0
  124. package/package.json +127 -127
  125. package/build/features/Landing/Landing.d.ts +0 -7
  126. package/build/features/Landing/Landing.js +0 -55
  127. package/build/features/Landing/index.d.ts +0 -1
  128. package/build/features/Landing/index.js +0 -1
  129. package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.d.ts +0 -5
  130. package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.js +0 -41
  131. package/build/features/Landing/screens/VerifyAndRedirect/index.d.ts +0 -2
  132. package/build/features/Landing/screens/VerifyAndRedirect/index.js +0 -2
  133. package/build/features/app/landing/landingStore.d.ts +0 -22
  134. package/build/features/app/landing/landingStore.js +0 -103
@@ -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,60 +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';
40
- import { DefaultDeviceInfo, LOCAL_STORAGE_KEYS } from '../constants';
50
+ import { getStoredData, storeData, isArray, findItem, getBrowserInfo, getFingerPrint, sortCountries, findCountryByIso2, getRequestHeaders, encryptString } from '../utils';
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 getClientIp = createAsyncThunk('getClientIp', function () { return __awaiter(void 0, void 0, void 0, function () {
45
- var data;
46
- return __generator(this, function (_a) {
47
- switch (_a.label) {
48
- case 0: return [4, API.ipService.getIP()];
49
- case 1:
50
- data = (_a.sent()).data;
51
- return [2, data];
52
- }
53
- });
54
- }); });
55
- export var getBrowserFingerPrint = createAsyncThunk('getBrowserFingerPrint', function (params) { return __awaiter(void 0, void 0, void 0, function () {
56
- var _a, client, device, os, fingerPrint;
57
- return __generator(this, function (_b) {
58
- switch (_b.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) {
59
59
  case 0:
60
- _a = getBrowserInfo(), client = _a.client, device = _a.device, os = _a.os;
61
- return [4, getFingerPrint()];
62
- case 1:
63
- fingerPrint = _b.sent();
64
- return [2, { fingerPrint: fingerPrint, client: client, device: device, os: os, appInfo: params }];
65
- }
66
- });
67
- }); });
68
- export var getOperator = createAsyncThunk('getOperator', function (params) { return __awaiter(void 0, void 0, void 0, function () {
69
- var data;
70
- return __generator(this, function (_a) {
71
- switch (_a.label) {
72
- case 0: return [4, API.operatorService.validateOperator(params)];
73
- case 1:
74
- data = (_a.sent()).data;
75
- return [2, data];
76
- }
77
- });
78
- }); });
79
- export var getLocale = createAsyncThunk('getLocale', function () { return __awaiter(void 0, void 0, void 0, function () {
80
- var data;
81
- return __generator(this, function (_a) {
82
- switch (_a.label) {
83
- case 0: return [4, API.firebaseService.getLocale()];
60
+ settings = thunkApi.getState().settings;
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
+ ])];
84
69
  case 1:
85
- data = (_a.sent()).data;
86
- 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 }];
87
116
  }
88
117
  });
89
118
  }); });
90
119
  var initialState = {
91
120
  error: null,
92
- loading: false,
121
+ loading: true,
93
122
  data: {
94
123
  open: true,
95
124
  isTapOrigin: true,
@@ -98,7 +127,9 @@ var initialState = {
98
127
  featureScreensNavigation: [],
99
128
  activeScreen: {},
100
129
  deviceInfo: DefaultDeviceInfo,
101
- appConfig: {}
130
+ appConfig: {},
131
+ businessCountry: defaultCountry,
132
+ countries: []
102
133
  }
103
134
  };
104
135
  export var settingsSlice = createSlice({
@@ -186,74 +217,19 @@ export var settingsSlice = createSlice({
186
217
  }
187
218
  },
188
219
  extraReducers: function (builder) {
189
- builder
190
- .addCase(getClientIp.pending, function (state) {
191
- state.error = null;
192
- state.loading = true;
193
- })
194
- .addCase(getClientIp.fulfilled, function (state, action) {
195
- state.error = null;
196
- state.loading = false;
197
- var _a = action.payload, ip = _a.ip, latitude = _a.latitude, longitude = _a.longitude;
198
- state.data.deviceInfo.connection.ip = ip;
199
- state.data.deviceInfo.connection.latitude = latitude;
200
- state.data.deviceInfo.connection.longitude = longitude;
201
- })
202
- .addCase(getClientIp.rejected, function (state, action) {
203
- state.error = action.error.message;
204
- state.loading = false;
205
- })
206
- .addCase(getBrowserFingerPrint.pending, function (state) {
207
- state.loading = true;
208
- state.error = null;
209
- })
210
- .addCase(getBrowserFingerPrint.fulfilled, function (state, action) {
211
- state.loading = false;
212
- state.error = null;
213
- var _a = action.payload, appInfo = _a.appInfo, client = _a.client, device = _a.device, fingerPrint = _a.fingerPrint, os = _a.os;
214
- state.data.deviceInfo.app.language = state.data.appConfig.language || 'en';
215
- state.data.deviceInfo.app.name = appInfo.name;
216
- state.data.deviceInfo.app.version = appInfo.version || '2.0.0';
217
- state.data.deviceInfo.app.identifier = appInfo.identifier || 'auth-connect-demo';
218
- state.data.deviceInfo.browser.browser_id = fingerPrint === null || fingerPrint === void 0 ? void 0 : fingerPrint.visitorId;
219
- state.data.deviceInfo.browser.name = (client === null || client === void 0 ? void 0 : client.name) || '';
220
- state.data.deviceInfo.browser.user_agent = window.navigator.userAgent;
221
- state.data.deviceInfo.browser.version = (client === null || client === void 0 ? void 0 : client.version) || '';
222
- state.data.deviceInfo.device.brand = (device === null || device === void 0 ? void 0 : device.brand) || '';
223
- state.data.deviceInfo.device.model = (device === null || device === void 0 ? void 0 : device.model) || '';
224
- state.data.deviceInfo.device.os.name = (os === null || os === void 0 ? void 0 : os.name) || '';
225
- state.data.deviceInfo.device.os.version = (os === null || os === void 0 ? void 0 : os.version) || '';
226
- state.data.deviceInfo.device.type = (device === null || device === void 0 ? void 0 : device.type) || '';
227
- })
228
- .addCase(getBrowserFingerPrint.rejected, function (state, action) {
229
- state.loading = false;
230
- state.loading = false;
231
- state.error = action.error.message;
232
- })
233
- .addCase(getOperator.pending, function (state) {
234
- state.error = null;
220
+ builder.addCase(fetchAppSettingsSync.pending, function (state) {
235
221
  state.loading = true;
236
- })
237
- .addCase(getOperator.fulfilled, function (state, action) {
238
- state.loading = false;
239
- if (action.payload === 'valid') {
240
- state.error = null;
241
- }
242
- })
243
- .addCase(getOperator.rejected, function (state, action) {
244
- state.error = action.error.message;
245
- state.loading = false;
246
- })
247
- .addCase(getLocale.pending, function (state) {
248
222
  state.error = null;
249
- state.loading = true;
250
- })
251
- .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);
252
230
  state.loading = false;
253
- state.error = null;
254
- updateLocale(action.payload, state.data.appConfig.businessCountryCode);
255
- })
256
- .addCase(getLocale.rejected, function (state, action) {
231
+ });
232
+ builder.addCase(fetchAppSettingsSync.rejected, function (state, action) {
257
233
  state.loading = false;
258
234
  state.error = action.error.message;
259
235
  });
@@ -7,7 +7,6 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
7
7
  tax: import("../features/app/tax/taxStore").TaxState;
8
8
  individual: import("../features/app/individual/individualStore").IndividualState;
9
9
  password: import("../features/app/password/passwordStore").PasswordState;
10
- landing: import("../features/app/landing/landingStore").LandingState;
11
10
  }, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("redux-thunk").ThunkMiddleware<{
12
11
  settings: import("./settings").SettingsState;
13
12
  connect: import("../features/app/connect/connectStore").ConnectState;
@@ -16,7 +15,6 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
16
15
  tax: import("../features/app/tax/taxStore").TaxState;
17
16
  individual: import("../features/app/individual/individualStore").IndividualState;
18
17
  password: import("../features/app/password/passwordStore").PasswordState;
19
- landing: import("../features/app/landing/landingStore").LandingState;
20
18
  }, import("redux").AnyAction, undefined>]>>;
21
19
  export declare type AppDispatch = typeof store.dispatch;
22
20
  export declare type RootState = ReturnType<typeof store.getState>;
@@ -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 + 40 : 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 })));
@@ -12,5 +12,5 @@ var BoxStyled = styled(Box)(function () { return ({
12
12
  zIndex: 2
13
13
  }); });
14
14
  export default function FlowLoading() {
15
- return (_jsx(BoxStyled, { children: _jsx(Loader, { svgStyle: { width: 60, height: 60 }, innerColor: 'white', outerColor: 'white', toggleAnimation: true }) }));
15
+ return (_jsx(BoxStyled, { children: _jsx(Loader, { style: { width: 60, height: 60 }, svgStyle: { width: 60, height: 60 }, innerColor: 'white', outerColor: 'white', toggleAnimation: true }) }));
16
16
  }
@@ -18,7 +18,6 @@ export declare const INDIVIDUAL_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
18
18
  export declare const PASSWORD_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
19
19
  export declare const BANK_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
20
20
  export declare const TAX_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
21
- export declare const LANDING_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
22
21
  export declare const DefaultDeviceInfo: {
23
22
  source: string;
24
23
  device: {
@@ -81,6 +80,7 @@ export declare const CONNECT_STEP_NAMES: {
81
80
  CONNECT_SUCCESS: string;
82
81
  };
83
82
  export declare const BUSINESS_STEP_NAMES: {
83
+ BUSINESS_INFO: string;
84
84
  PHONE_AUTH: string;
85
85
  IDENTITY_AUTH: string;
86
86
  IDENTITY_VERIFY_AUTH: string;
@@ -110,6 +110,7 @@ export declare const PASSWORD_STEP_NAMES: {
110
110
  PHONE_AUTH: string;
111
111
  PASSWORD_CREATE: string;
112
112
  PASSWORD_SUCCESS: string;
113
+ RESET_PASSWORD: string;
113
114
  };
114
115
  export declare const RSA_FRONTEND_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgC9kH1SQvjbXAUXd0PbrDUG8P\nLhRig9pJNBmdQBZjihuaxfkzYu6ToMbIMAfmYgVgQw338/y7aQ8X3m03CXNIlkxo\nOwxKCA8ymKsZQptXJn9IxlPO7yjoFgTFBrpmTgvcC4XO1uoUYTAPq3szK8kj4zgT\nucWG1hSKsOdRU7sl/wIDAQAB\n-----END PUBLIC KEY-----";
115
116
  export declare const ENCRYPTION_FLAG = "encryption_contract";
@@ -136,3 +137,7 @@ export declare const OTHER_CR_LICENSE: {
136
137
  };
137
138
  type: BusinessType;
138
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 = [
@@ -210,14 +216,6 @@ export var TAX_SCREENS_NAVIGATION = [
210
216
  order: 4
211
217
  }
212
218
  ];
213
- export var LANDING_SCREENS_NAVIGATION = [
214
- {
215
- name: 'LANDING_VERIFY_AND_REDIRECT_STEP',
216
- next: '',
217
- prev: '',
218
- order: 1
219
- }
220
- ];
221
219
  export var DefaultDeviceInfo = {
222
220
  source: 'browser',
223
221
  device: {
@@ -280,6 +278,7 @@ export var CONNECT_STEP_NAMES = {
280
278
  CONNECT_SUCCESS: 'connect_completed'
281
279
  };
282
280
  export var BUSINESS_STEP_NAMES = {
281
+ BUSINESS_INFO: 'business_info',
283
282
  PHONE_AUTH: 'business_phone_auth',
284
283
  IDENTITY_AUTH: 'business_identity_auth',
285
284
  IDENTITY_VERIFY_AUTH: 'business_identity_auth_verify',
@@ -308,7 +307,8 @@ export var PASSWORD_STEP_NAMES = {
308
307
  PASSWORD_INFO: 'password_info',
309
308
  PHONE_AUTH: 'password_phone_auth',
310
309
  PASSWORD_CREATE: 'password_create',
311
- PASSWORD_SUCCESS: 'password_completed'
310
+ PASSWORD_SUCCESS: 'password_completed',
311
+ RESET_PASSWORD: 'reset_password'
312
312
  };
313
313
  export var RSA_FRONTEND_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgC9kH1SQvjbXAUXd0PbrDUG8P\nLhRig9pJNBmdQBZjihuaxfkzYu6ToMbIMAfmYgVgQw338/y7aQ8X3m03CXNIlkxo\nOwxKCA8ymKsZQptXJn9IxlPO7yjoFgTFBrpmTgvcC4XO1uoUYTAPq3szK8kj4zgT\nucWG1hSKsOdRU7sl/wIDAQAB\n-----END PUBLIC KEY-----";
314
314
  export var ENCRYPTION_FLAG = 'encryption_contract';
@@ -335,3 +335,7 @@ export var OTHER_CR_LICENSE = {
335
335
  },
336
336
  type: BusinessType.CR
337
337
  };
338
+ export var PASSWORD_OPERATION_TYPE = {
339
+ SET_PASSWORD: 'set_password',
340
+ RESET_PASSWORD: 'reset_password'
341
+ };
@@ -1,11 +1,14 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { BankFormValues, OTPFormValues, ResponseData, SharedState } from '../../../@types';
2
+ import { BankFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
3
3
  import { CancelToken } from 'axios';
4
4
  export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
5
5
  data: any;
6
6
  leadData: any;
7
7
  token: string;
8
8
  }, string, {}>;
9
+ export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
10
+ data: any;
11
+ }, void, {}>;
9
12
  export declare const verifyBankLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
10
13
  data: any;
11
14
  formData: OTPFormValues;
@@ -35,6 +38,7 @@ export interface BankData {
35
38
  verify: ResponseData & VerifyData;
36
39
  otpData: OTPFormValues & ResponseData;
37
40
  bankData: BankFormValues & ResponseData;
41
+ flowName: FlowsTypes;
38
42
  }
39
43
  export interface BankState extends SharedState<BankData> {
40
44
  }
@@ -48,10 +48,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
48
48
  var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import API from '../../../api';
51
- import { hasKey, removeRequestHeaders } from '../../../utils';
51
+ import { FlowsTypes } from '../../../@types';
52
+ import { hasKey } from '../../../utils';
52
53
  import { handleNextScreenStep } from '../../../app/settings';
53
54
  import { BANK_STEP_NAMES } from '../../../constants';
54
- 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 () {
55
56
  var payload, data, leadResponse, _a, steps, entity, hasCompleted;
56
57
  return __generator(this, function (_b) {
57
58
  switch (_b.label) {
@@ -85,6 +86,23 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
85
86
  }
86
87
  });
87
88
  }); });
89
+ export var resendOTP = createAsyncThunk('resendOTPBank', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
90
+ var bank, payload, data;
91
+ return __generator(this, function (_a) {
92
+ switch (_a.label) {
93
+ case 0:
94
+ bank = thunkApi.getState().bank;
95
+ payload = {
96
+ service_name: 'tap_email',
97
+ verify_token: bank.data.verify.token
98
+ };
99
+ return [4, API.leadService.verifyLeadToken(payload)];
100
+ case 1:
101
+ data = (_a.sent()).data;
102
+ return [2, { data: data }];
103
+ }
104
+ });
105
+ }); });
88
106
  export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
89
107
  var _a, bank, settings, responseBody, payload, data, steps, hasCompleted;
90
108
  var _b, _c, _d, _e;
@@ -193,6 +211,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadBankSuccess', functio
193
211
  if (!id)
194
212
  return [2];
195
213
  payload = {
214
+ lang: settings.data.language,
196
215
  step_name: BANK_STEP_NAMES.BANK_SUCCESS,
197
216
  id: id,
198
217
  encryption_contract: []
@@ -215,6 +234,7 @@ var initialState = {
215
234
  loading: false,
216
235
  customLoading: false,
217
236
  data: {
237
+ flowName: FlowsTypes.BANK,
218
238
  verify: {
219
239
  token: ''
220
240
  },
@@ -224,7 +244,8 @@ var initialState = {
224
244
  bankData: {
225
245
  iban: '',
226
246
  beneficiaryName: '',
227
- bankName: ''
247
+ bankName: '',
248
+ confirmPolicy: false
228
249
  }
229
250
  }
230
251
  };
@@ -264,6 +285,23 @@ export var bankSlice = createSlice({
264
285
  .addCase(verifyLeadToken.rejected, function (state, action) {
265
286
  state.error = action.error.message;
266
287
  state.customLoading = false;
288
+ })
289
+ .addCase(resendOTP.pending, function (state) {
290
+ state.error = null;
291
+ })
292
+ .addCase(resendOTP.fulfilled, function (state, action) {
293
+ var _a;
294
+ state.error = null;
295
+ var data = action.payload.data;
296
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
297
+ if (description) {
298
+ state.error = description;
299
+ return;
300
+ }
301
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
302
+ })
303
+ .addCase(resendOTP.rejected, function (state, action) {
304
+ state.error = action.error.message;
267
305
  })
268
306
  .addCase(verifyBankLeadOTP.pending, function (state) {
269
307
  state.loading = true;
@@ -318,7 +356,6 @@ export var bankSlice = createSlice({
318
356
  }
319
357
  var flows = response.flows, steps = response.steps;
320
358
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps });
321
- removeRequestHeaders();
322
359
  })
323
360
  .addCase(updateLeadSuccess.pending, function (state) {
324
361
  state.loading = true;
@@ -1,14 +1,13 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, CountryCode, NIDFormValues, OTPFormValues, ResponseData, SharedState } 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;
10
6
  token: string;
11
7
  }, string, {}>;
8
+ export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
9
+ data: any;
10
+ }, void, {}>;
12
11
  export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
13
12
  data: any;
14
13
  formData: {
@@ -70,8 +69,6 @@ declare type VerifyData = {
70
69
  };
71
70
  export interface BusinessData {
72
71
  verify: ResponseData & VerifyData;
73
- businessCountry: CountryCode;
74
- countries: CountryCode[];
75
72
  otpData: OTPFormValues & ResponseData & {
76
73
  isNID: boolean;
77
74
  };
@@ -81,6 +78,7 @@ export interface BusinessData {
81
78
  businessTypeData: BusinessTypeFormValues & ResponseData;
82
79
  activitiesData: ActivitiesFormValues & ResponseData;
83
80
  customersData: CustomersFormValues & ResponseData;
81
+ flowName: FlowsTypes;
84
82
  }
85
83
  export interface BusinessState extends SharedState<BusinessData> {
86
84
  }