@tap-payments/auth-jsconnect 2.0.7 → 2.0.9

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 (84) hide show
  1. package/build/@types/form.d.ts +4 -0
  2. package/build/@types/redux.d.ts +0 -1
  3. package/build/api/entity.d.ts +4 -3
  4. package/build/api/entity.js +8 -1
  5. package/build/api/index.d.ts +2 -0
  6. package/build/api/individual.d.ts +1 -0
  7. package/build/api/individual.js +9 -2
  8. package/build/app/rootReducer.d.ts +1 -0
  9. package/build/app/rootReducer.js +3 -1
  10. package/build/app/store.d.ts +2 -0
  11. package/build/assets/locales/ar.json +2 -1
  12. package/build/assets/locales/en.json +2 -1
  13. package/build/components/FileInput/DragAndDrop.js +1 -2
  14. package/build/constants/app.d.ts +9 -0
  15. package/build/constants/app.js +36 -0
  16. package/build/constants/validation.d.ts +2 -0
  17. package/build/constants/validation.js +2 -0
  18. package/build/features/app/bank/bankStore.d.ts +1 -1
  19. package/build/features/app/bank/bankStore.js +23 -42
  20. package/build/features/app/business/businessStore.d.ts +5 -3
  21. package/build/features/app/business/businessStore.js +55 -31
  22. package/build/features/app/connect/connectStore.d.ts +2 -1
  23. package/build/features/app/connect/connectStore.js +78 -47
  24. package/build/features/app/individual/individualStore.d.ts +9 -2
  25. package/build/features/app/individual/individualStore.js +80 -41
  26. package/build/features/app/password/passwordStore.d.ts +1 -0
  27. package/build/features/app/password/passwordStore.js +3 -7
  28. package/build/features/app/signIn/signInStore.d.ts +33 -0
  29. package/build/features/app/signIn/signInStore.js +389 -0
  30. package/build/features/app/tax/taxStore.d.ts +1 -0
  31. package/build/features/bank/screens/BankDetails/BankStatement.js +6 -17
  32. package/build/features/bank/screens/BankDetails/validation.d.ts +3 -0
  33. package/build/features/bank/screens/BankDetails/validation.js +11 -1
  34. package/build/features/business/screens/Activities/ActivitiesList.d.ts +1 -1
  35. package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
  36. package/build/features/connect/screens/Merchant/Merchant.js +3 -2
  37. package/build/features/connect/screens/Merchant/validation.js +1 -1
  38. package/build/features/featuresScreens.d.ts +1 -0
  39. package/build/features/featuresScreens.js +22 -0
  40. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +19 -5
  41. package/build/features/shared/UploadFile/UploadFile.d.ts +2 -2
  42. package/build/features/shared/UploadFile/UploadFile.js +13 -13
  43. package/build/features/signIn/SignIn.d.ts +7 -0
  44. package/build/features/signIn/SignIn.js +49 -0
  45. package/build/features/signIn/index.d.ts +1 -0
  46. package/build/features/signIn/index.js +1 -0
  47. package/build/features/signIn/screens/Email/Email.d.ts +5 -0
  48. package/build/features/signIn/screens/Email/Email.js +95 -0
  49. package/build/features/signIn/screens/Email/EmailField.d.ts +5 -0
  50. package/build/features/signIn/screens/Email/EmailField.js +55 -0
  51. package/build/features/signIn/screens/Email/index.d.ts +3 -0
  52. package/build/features/signIn/screens/Email/index.js +2 -0
  53. package/build/features/signIn/screens/Email/validation.d.ts +8 -0
  54. package/build/features/signIn/screens/Email/validation.js +5 -0
  55. package/build/features/signIn/screens/Mobile/Mobile.d.ts +5 -0
  56. package/build/features/signIn/screens/Mobile/Mobile.js +106 -0
  57. package/build/features/signIn/screens/Mobile/MobileNumber.d.ts +11 -0
  58. package/build/features/signIn/screens/Mobile/MobileNumber.js +151 -0
  59. package/build/features/signIn/screens/Mobile/index.d.ts +3 -0
  60. package/build/features/signIn/screens/Mobile/index.js +2 -0
  61. package/build/features/signIn/screens/Mobile/validation.d.ts +8 -0
  62. package/build/features/signIn/screens/Mobile/validation.js +28 -0
  63. package/build/features/signIn/screens/OTP/OTP.d.ts +5 -0
  64. package/build/features/signIn/screens/OTP/OTP.js +80 -0
  65. package/build/features/signIn/screens/OTP/OTPInput.d.ts +5 -0
  66. package/build/features/signIn/screens/OTP/OTPInput.js +53 -0
  67. package/build/features/signIn/screens/OTP/index.d.ts +3 -0
  68. package/build/features/signIn/screens/OTP/index.js +2 -0
  69. package/build/features/signIn/screens/OTP/validation.d.ts +8 -0
  70. package/build/features/signIn/screens/OTP/validation.js +4 -0
  71. package/build/features/signIn/screens/Password/Password.d.ts +5 -0
  72. package/build/features/signIn/screens/Password/Password.js +54 -0
  73. package/build/features/signIn/screens/Password/PasswordInput.d.ts +5 -0
  74. package/build/features/signIn/screens/Password/PasswordInput.js +28 -0
  75. package/build/features/signIn/screens/Password/index.d.ts +3 -0
  76. package/build/features/signIn/screens/Password/index.js +2 -0
  77. package/build/features/signIn/screens/Password/validation.d.ts +8 -0
  78. package/build/features/signIn/screens/Password/validation.js +4 -0
  79. package/build/hooks/useAppDispatch.d.ts +1 -0
  80. package/build/index.d.ts +3 -2
  81. package/build/index.js +5 -2
  82. package/build/utils/string.d.ts +1 -0
  83. package/build/utils/string.js +4 -0
  84. package/package.json +1 -1
@@ -0,0 +1,389 @@
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
+ };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (_) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ var _a;
49
+ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
+ import API from '../../../api';
51
+ import { defaultCountry, SignIn_STEP_NAMES } from '../../../constants';
52
+ import { handleNextScreenStep, handleOpen } from '../../../app/settings';
53
+ var redirection = function (type) {
54
+ if (type === 1)
55
+ return handleNextScreenStep('SIGIN_PASSWORD_STEP');
56
+ return handleNextScreenStep('SIGIN_OTP_STEP');
57
+ };
58
+ export var createMobileAuth = createAsyncThunk('signIn/createMobileAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
59
+ var settings, requestBody, data;
60
+ var _a, _b, _c, _d;
61
+ return __generator(this, function (_e) {
62
+ switch (_e.label) {
63
+ case 0:
64
+ settings = thunkApi.getState().settings;
65
+ requestBody = {
66
+ lang: settings.data.language,
67
+ user_credentail: {
68
+ phone: params.mobile || '',
69
+ code: (_b = (_a = params.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix) === null || _b === void 0 ? void 0 : _b.toString()
70
+ },
71
+ sign_in: true,
72
+ step_name: SignIn_STEP_NAMES.CREATE_AUTH_MOBILE,
73
+ encryption_contract: ['user_credentail.phone', 'user_credentail.code']
74
+ };
75
+ return [4, API.authService.createAuth(requestBody)];
76
+ case 1:
77
+ data = (_e.sent()).data;
78
+ if (!data.errors) {
79
+ thunkApi.dispatch(redirection(data === null || data === void 0 ? void 0 : data.auth_type));
80
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody.user_credentail);
81
+ }
82
+ return [2, { data: data, formData: params }];
83
+ }
84
+ });
85
+ }); });
86
+ export var resendOTPMobile = createAsyncThunk('signIn/resendOTPMobile', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
87
+ var _a, settings, signIn, authData, requestBody, data;
88
+ var _b, _c;
89
+ return __generator(this, function (_d) {
90
+ switch (_d.label) {
91
+ case 0:
92
+ _a = thunkApi.getState(), settings = _a.settings, signIn = _a.signIn;
93
+ authData = signIn.data.auth;
94
+ requestBody = {
95
+ lang: settings.data.language,
96
+ user_credentail: {
97
+ phone: authData.mobile || '',
98
+ code: ((_c = (_b = authData.countryCode) === null || _b === void 0 ? void 0 : _b.idd_prefix) === null || _c === void 0 ? void 0 : _c.toString()) || ''
99
+ },
100
+ sign_in: true,
101
+ step_name: SignIn_STEP_NAMES.CREATE_AUTH_MOBILE,
102
+ encryption_contract: ['user_credentail.phone', 'user_credentail.code']
103
+ };
104
+ return [4, API.authService.createAuth(requestBody)];
105
+ case 1:
106
+ data = (_d.sent()).data;
107
+ return [2, data];
108
+ }
109
+ });
110
+ }); });
111
+ export var createEmailAuth = createAsyncThunk('signIn/createEmailAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
112
+ var settings, requestBody, data;
113
+ var _a, _b;
114
+ return __generator(this, function (_c) {
115
+ switch (_c.label) {
116
+ case 0:
117
+ settings = thunkApi.getState().settings;
118
+ requestBody = {
119
+ lang: settings.data.language,
120
+ user_credentail: {
121
+ email: params.email || ''
122
+ },
123
+ sign_in: true,
124
+ step_name: SignIn_STEP_NAMES.CREATE_AUTH_EMAIL,
125
+ encryption_contract: ['user_credentail.email']
126
+ };
127
+ return [4, API.authService.createAuth(requestBody)];
128
+ case 1:
129
+ data = (_c.sent()).data;
130
+ if (!data.errors) {
131
+ thunkApi.dispatch(redirection(data === null || data === void 0 ? void 0 : data.auth_type));
132
+ (_b = (_a = settings.data.appConfig).onStepCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, settings.data.activeScreen.name, requestBody.user_credentail);
133
+ }
134
+ return [2, { data: data, formData: params }];
135
+ }
136
+ });
137
+ }); });
138
+ export var resendOTPEmail = createAsyncThunk('signIn/resendOTPEmail', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
139
+ var _a, settings, signIn, authData, requestBody, data;
140
+ return __generator(this, function (_b) {
141
+ switch (_b.label) {
142
+ case 0:
143
+ _a = thunkApi.getState(), settings = _a.settings, signIn = _a.signIn;
144
+ authData = signIn.data.auth;
145
+ requestBody = {
146
+ lang: settings.data.language,
147
+ user_credentail: {
148
+ email: authData.email || ''
149
+ },
150
+ sign_in: true,
151
+ step_name: SignIn_STEP_NAMES.CREATE_AUTH_EMAIL,
152
+ encryption_contract: ['user_credentail.email']
153
+ };
154
+ return [4, API.authService.createAuth(requestBody)];
155
+ case 1:
156
+ data = (_b.sent()).data;
157
+ return [2, data];
158
+ }
159
+ });
160
+ }); });
161
+ export var verifyAuthOTP = createAsyncThunk('signIn/verifyAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
162
+ var _a, signIn, settings, mobile, responseBody, requestBody, data;
163
+ var _b, _c, _d, _e;
164
+ return __generator(this, function (_f) {
165
+ switch (_f.label) {
166
+ case 0:
167
+ _a = thunkApi.getState(), signIn = _a.signIn, settings = _a.settings;
168
+ mobile = signIn.data.auth.mobile;
169
+ responseBody = signIn.data.passwordData.responseBody;
170
+ requestBody = {
171
+ data: params.otp,
172
+ auth_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token,
173
+ auth_type: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_type,
174
+ device_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.device_token,
175
+ service_name: responseBody === null || responseBody === void 0 ? void 0 : responseBody.service_name,
176
+ new_user: responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user,
177
+ sign_in: responseBody === null || responseBody === void 0 ? void 0 : responseBody.sign_in,
178
+ remember_me: responseBody === null || responseBody === void 0 ? void 0 : responseBody.remember_me,
179
+ scopes: responseBody === null || responseBody === void 0 ? void 0 : responseBody.scopes,
180
+ step_name: mobile ? SignIn_STEP_NAMES.VERIFY_AUTH_MOBILE_OTP : SignIn_STEP_NAMES.VERIFY_AUTH_EMAIL_OTP,
181
+ encryption_contract: ['data']
182
+ };
183
+ return [4, API.authService.verifyAuth(requestBody)];
184
+ case 1:
185
+ data = (_f.sent()).data;
186
+ if (!data.errors) {
187
+ (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, { otp: params.otp });
188
+ thunkApi.dispatch(handleOpen(false));
189
+ (_e = (_d = settings.data.appConfig).onFlowCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, data);
190
+ }
191
+ return [2, { data: data, formData: params }];
192
+ }
193
+ });
194
+ }); });
195
+ export var verifyAuthPassword = createAsyncThunk('signIn/verifyAuthPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
196
+ var _a, signIn, settings, _b, responseBody, mobile, requestBody, data;
197
+ var _c, _d, _e, _f;
198
+ return __generator(this, function (_g) {
199
+ switch (_g.label) {
200
+ case 0:
201
+ _a = thunkApi.getState(), signIn = _a.signIn, settings = _a.settings;
202
+ _b = signIn.data.auth, responseBody = _b.responseBody, mobile = _b.mobile;
203
+ requestBody = {
204
+ data: params.password,
205
+ auth_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token,
206
+ auth_type: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_type,
207
+ device_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.device_token,
208
+ service_name: responseBody === null || responseBody === void 0 ? void 0 : responseBody.service_name,
209
+ new_user: responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user,
210
+ sign_in: responseBody === null || responseBody === void 0 ? void 0 : responseBody.sign_in,
211
+ remember_me: responseBody === null || responseBody === void 0 ? void 0 : responseBody.remember_me,
212
+ scopes: responseBody === null || responseBody === void 0 ? void 0 : responseBody.scopes,
213
+ step_name: mobile ? SignIn_STEP_NAMES.VERIFY_AUTH_MOBILE : SignIn_STEP_NAMES.VERIFY_AUTH_EMAIL,
214
+ encryption_contract: ['data']
215
+ };
216
+ return [4, API.authService.verifyAuth(requestBody)];
217
+ case 1:
218
+ data = (_g.sent()).data;
219
+ if (!data.errors) {
220
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.password });
221
+ if ((data === null || data === void 0 ? void 0 : data.status) === 'pending') {
222
+ thunkApi.dispatch(handleNextScreenStep('SIGIN_OTP_STEP'));
223
+ }
224
+ else {
225
+ thunkApi.dispatch(handleOpen(false));
226
+ (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, data);
227
+ }
228
+ }
229
+ return [2, data];
230
+ }
231
+ });
232
+ }); });
233
+ var initialState = {
234
+ error: null,
235
+ loading: false,
236
+ data: {
237
+ auth: {
238
+ countryCode: defaultCountry,
239
+ mobile: null,
240
+ email: null
241
+ },
242
+ otpData: {
243
+ otp: ''
244
+ },
245
+ passwordData: {
246
+ password: ''
247
+ }
248
+ }
249
+ };
250
+ export var signInSlice = createSlice({
251
+ name: 'signIsn/store',
252
+ initialState: initialState,
253
+ reducers: {
254
+ clearError: function (state) {
255
+ state.error = null;
256
+ },
257
+ stopLoader: function (state) {
258
+ state.loading = false;
259
+ },
260
+ resetOTPScreen: function (state) {
261
+ state.data.otpData.otp = '';
262
+ }
263
+ },
264
+ extraReducers: function (builder) {
265
+ builder
266
+ .addCase(createMobileAuth.pending, function (state) {
267
+ state.loading = true;
268
+ state.error = null;
269
+ })
270
+ .addCase(createMobileAuth.fulfilled, function (state, action) {
271
+ var _a;
272
+ state.loading = false;
273
+ state.error = null;
274
+ var _b = action.payload, data = _b.data, formData = _b.formData;
275
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
276
+ if (description) {
277
+ state.error = description;
278
+ return;
279
+ }
280
+ state.data.auth = __assign(__assign({}, formData), { email: null, responseBody: data });
281
+ })
282
+ .addCase(createMobileAuth.rejected, function (state, action) {
283
+ state.loading = false;
284
+ state.error = action.error.message;
285
+ })
286
+ .addCase(resendOTPMobile.pending, function (state) {
287
+ state.loading = true;
288
+ state.error = null;
289
+ })
290
+ .addCase(resendOTPMobile.fulfilled, function (state, action) {
291
+ var _a;
292
+ state.loading = false;
293
+ state.error = null;
294
+ var data = action.payload;
295
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
296
+ if (description) {
297
+ state.error = description;
298
+ return;
299
+ }
300
+ state.data.auth.responseBody = data;
301
+ })
302
+ .addCase(resendOTPMobile.rejected, function (state, action) {
303
+ state.loading = false;
304
+ state.error = action.error.message;
305
+ })
306
+ .addCase(createEmailAuth.pending, function (state) {
307
+ state.loading = true;
308
+ state.error = null;
309
+ })
310
+ .addCase(createEmailAuth.fulfilled, function (state, action) {
311
+ var _a;
312
+ state.loading = false;
313
+ state.error = null;
314
+ var _b = action.payload, data = _b.data, formData = _b.formData;
315
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
316
+ if (description) {
317
+ state.error = description;
318
+ return;
319
+ }
320
+ state.data.auth = __assign(__assign(__assign({}, state.data.auth), formData), { mobile: null, responseBody: data });
321
+ })
322
+ .addCase(createEmailAuth.rejected, function (state, action) {
323
+ state.loading = false;
324
+ state.error = action.error.message;
325
+ })
326
+ .addCase(resendOTPEmail.pending, function (state) {
327
+ state.loading = true;
328
+ state.error = null;
329
+ })
330
+ .addCase(resendOTPEmail.fulfilled, function (state, action) {
331
+ var _a;
332
+ state.loading = false;
333
+ state.error = null;
334
+ var data = action.payload;
335
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
336
+ if (description) {
337
+ state.error = description;
338
+ return;
339
+ }
340
+ state.data.auth.responseBody = data;
341
+ })
342
+ .addCase(resendOTPEmail.rejected, function (state, action) {
343
+ state.loading = false;
344
+ state.error = action.error.message;
345
+ })
346
+ .addCase(verifyAuthOTP.pending, function (state) {
347
+ state.loading = true;
348
+ state.error = null;
349
+ })
350
+ .addCase(verifyAuthOTP.fulfilled, function (state, action) {
351
+ var _a;
352
+ state.loading = false;
353
+ state.error = null;
354
+ var data = action.payload.data;
355
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
356
+ if (description) {
357
+ state.error = description;
358
+ return;
359
+ }
360
+ })
361
+ .addCase(verifyAuthOTP.rejected, function (state, action) {
362
+ state.loading = false;
363
+ state.error = action.error.message;
364
+ })
365
+ .addCase(verifyAuthPassword.pending, function (state) {
366
+ state.loading = true;
367
+ state.error = null;
368
+ })
369
+ .addCase(verifyAuthPassword.fulfilled, function (state, action) {
370
+ var _a;
371
+ state.loading = false;
372
+ state.error = null;
373
+ var data = action.payload;
374
+ var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
375
+ if (description) {
376
+ state.error = description;
377
+ return;
378
+ }
379
+ state.data.passwordData.responseBody = data;
380
+ })
381
+ .addCase(verifyAuthPassword.rejected, function (state, action) {
382
+ state.loading = false;
383
+ state.error = action.error.message;
384
+ });
385
+ }
386
+ });
387
+ export var clearError = (_a = signInSlice.actions, _a.clearError), stopLoader = _a.stopLoader, resetOTPScreen = _a.resetOTPScreen;
388
+ export default signInSlice.reducer;
389
+ export var signInSelector = function (state) { return state.signIn; };
@@ -33,6 +33,7 @@ export interface TaxData {
33
33
  flowName: FlowsTypes;
34
34
  }
35
35
  export interface TaxState extends SharedState<TaxData> {
36
+ customLoading?: boolean;
36
37
  }
37
38
  export declare const taxSlice: import("@reduxjs/toolkit").Slice<TaxState, {
38
39
  clearError: (state: TaxState) => void;
@@ -1,12 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import React from 'react';
3
2
  import { styled } from '@mui/material/styles';
4
3
  import { ScreenContainer } from '../../../../features/shared/Containers';
5
4
  import { useTranslation } from 'react-i18next';
6
5
  import { useController, useFormContext } from 'react-hook-form';
7
6
  import UploadFile from '../../../../features/shared/UploadFile';
8
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
9
- import { bankSelector, uploadBankStatement } from '../../../../features/app/bank/bankStore';
10
7
  var FeatureStyled = styled(ScreenContainer)(function (_a) {
11
8
  var theme = _a.theme;
12
9
  return ({
@@ -14,25 +11,17 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
14
11
  });
15
12
  });
16
13
  var BankStatement = function () {
17
- var _a, _b;
18
- var dispatch = useAppDispatch();
19
- var data = useAppSelector(bankSelector).data;
14
+ var _a;
20
15
  var t = useTranslation().t;
21
16
  var control = useFormContext().control;
22
- var bankStatementControl = useController({ name: 'bankStatementId', control: control });
23
- var error = (_a = bankStatementControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
24
- var uploading = data.bankData.uploading;
17
+ var bankStatementFileControl = useController({ name: 'bankStatementFile', control: control });
18
+ var error = (_a = bankStatementFileControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
25
19
  var handleBankStatementChange = function (file) {
26
- dispatch(uploadBankStatement(file));
20
+ bankStatementFileControl.field.onChange(file);
27
21
  };
28
22
  var handleReset = function () {
29
- bankStatementControl.field.onChange('');
23
+ bankStatementFileControl.field.onChange(null);
30
24
  };
31
- React.useEffect(function () {
32
- var _a, _b;
33
- if ((_a = data.bankData.responseBody) === null || _a === void 0 ? void 0 : _a.fileId)
34
- bankStatementControl.field.onChange((_b = data.bankData.responseBody) === null || _b === void 0 ? void 0 : _b.fileId);
35
- }, [(_b = data.bankData.responseBody) === null || _b === void 0 ? void 0 : _b.fileId]);
36
- return (_jsx(FeatureStyled, { children: _jsx(UploadFile, { label: t('title_bank_statement'), dragTitle: t('drag_and_drop'), uploadTitle: t('title_upload_file'), onFileUploaded: handleBankStatementChange, loading: uploading, onReset: handleReset, error: error && t(error) }) }));
25
+ return (_jsx(FeatureStyled, { children: _jsx(UploadFile, { label: t('title_bank_statement'), dragTitle: t('drag_and_drop'), uploadTitle: t('title_upload_file'), onFileUploaded: handleBankStatementChange, isSubmitting: bankStatementFileControl.formState.isSubmitted, onReset: handleReset, error: error && t(error) }) }));
37
26
  };
38
27
  export default BankStatement;
@@ -4,17 +4,20 @@ export declare const BankValidation: yup.ObjectSchema<import("yup/lib/object").A
4
4
  bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
5
5
  beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
6
  bankStatementId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
7
+ bankStatementFile: any;
7
8
  confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
8
9
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
9
10
  iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
10
11
  bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
11
12
  beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
12
13
  bankStatementId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
14
+ bankStatementFile: any;
13
15
  confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
14
16
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
15
17
  iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
16
18
  bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
17
19
  beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
18
20
  bankStatementId: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
21
+ bankStatementFile: any;
19
22
  confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
20
23
  }>>>;
@@ -1,4 +1,4 @@
1
- import { REGEX_BENEFICIARY_NAME } from '../../../../constants';
1
+ import { REGEX_BENEFICIARY_NAME, VALID_FILE_FORMATS } from '../../../../constants';
2
2
  import * as yup from 'yup';
3
3
  export var BankValidation = yup.object().shape({
4
4
  iban: yup
@@ -13,5 +13,15 @@ export var BankValidation = yup.object().shape({
13
13
  .matches(REGEX_BENEFICIARY_NAME, 'beneficiary_name_invalid')
14
14
  .required('beneficiary_name_required'),
15
15
  bankStatementId: yup.string().optional(),
16
+ bankStatementFile: yup
17
+ .mixed()
18
+ .test({
19
+ test: function (value) {
20
+ if (!!value)
21
+ return VALID_FILE_FORMATS.includes(value === null || value === void 0 ? void 0 : value.type) ? true : this.createError({ message: 'alert_file_upload' });
22
+ return true;
23
+ }
24
+ })
25
+ .optional(),
16
26
  confirmPolicy: yup.boolean().required('alert_bank_confirm').isTrue('alert_bank_confirm')
17
27
  });
@@ -20,7 +20,7 @@ export declare const InputStyled: import("@emotion/styled").StyledComponent<Pick
20
20
  export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<{
21
21
  children?: React.ReactNode;
22
22
  classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
23
- color?: "inherit" | "disabled" | "error" | "primary" | "secondary" | "action" | "info" | "success" | "warning" | undefined;
23
+ color?: "inherit" | "disabled" | "error" | "info" | "primary" | "secondary" | "action" | "success" | "warning" | undefined;
24
24
  fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
25
25
  htmlColor?: string | undefined;
26
26
  inheritViewBox?: boolean | undefined;
@@ -35,7 +35,7 @@ export declare const NameContainer: import("@emotion/styled").StyledComponent<im
35
35
  export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<{
36
36
  children?: React.ReactNode;
37
37
  classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
38
- color?: "inherit" | "disabled" | "error" | "primary" | "secondary" | "action" | "info" | "success" | "warning" | undefined;
38
+ color?: "inherit" | "disabled" | "error" | "info" | "primary" | "secondary" | "action" | "success" | "warning" | undefined;
39
39
  fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
40
40
  htmlColor?: string | undefined;
41
41
  inheritViewBox?: boolean | undefined;
@@ -49,7 +49,7 @@ export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<
49
49
  export declare const RemainingCheck: import("@emotion/styled").StyledComponent<{
50
50
  children?: React.ReactNode;
51
51
  classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
52
- color?: "inherit" | "disabled" | "error" | "primary" | "secondary" | "action" | "info" | "success" | "warning" | undefined;
52
+ color?: "inherit" | "disabled" | "error" | "info" | "primary" | "secondary" | "action" | "success" | "warning" | undefined;
53
53
  fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
54
54
  htmlColor?: string | undefined;
55
55
  inheritViewBox?: boolean | undefined;
@@ -71,7 +71,7 @@ var Merchant = function (_a) {
71
71
  methods.setError('brandName', { message: 'Profile Name already exists' });
72
72
  }, [responseBody]);
73
73
  React.useEffect(function () {
74
- var _a, _b, _c, _d;
74
+ var _a, _b, _c, _d, _e;
75
75
  if (isNewUser === true) {
76
76
  setUserType(ValidationOptions.NEW_USER);
77
77
  }
@@ -89,7 +89,8 @@ var Merchant = function (_a) {
89
89
  methods.clearErrors();
90
90
  var twitter = ((_b = (_a = formDataSelectedBrand === null || formDataSelectedBrand === void 0 ? void 0 : formDataSelectedBrand.social) === null || _a === void 0 ? void 0 : _a.find(function (item) { return item.includes('twitter.com'); })) === null || _b === void 0 ? void 0 : _b.replaceAll("".concat(TWITTER_URL, "/"), '')) || '';
91
91
  var instagram = ((_d = (_c = formDataSelectedBrand === null || formDataSelectedBrand === void 0 ? void 0 : formDataSelectedBrand.social) === null || _c === void 0 ? void 0 : _c.find(function (item) { return item.includes('instagram.com'); })) === null || _d === void 0 ? void 0 : _d.replaceAll("".concat(INSTAGRAM_URL, "/"), '')) || '';
92
- var sites_1 = __assign(__assign({}, links), { website: formDataSelectedBrand === null || formDataSelectedBrand === void 0 ? void 0 : formDataSelectedBrand.website, twitter: twitter, instagram: instagram });
92
+ var website = (_e = formDataSelectedBrand === null || formDataSelectedBrand === void 0 ? void 0 : formDataSelectedBrand.website) === null || _e === void 0 ? void 0 : _e.replaceAll(/(https|http):\/\//g, '');
93
+ var sites_1 = __assign(__assign({}, links), { website: website, twitter: twitter, instagram: instagram });
93
94
  setTimeout(function () { return methods.setValue('links', sites_1, { shouldValidate: true }); }, 100);
94
95
  }
95
96
  }, [formDataSelectedBrand, isNewUser]);
@@ -17,7 +17,7 @@ export var MerchantValidationSchema = function (userType) {
17
17
  var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
18
18
  if (length === 0)
19
19
  return true;
20
- return !(value === null || value === void 0 ? void 0 : value.match(REGEX_BRAND_NAME))
20
+ return !(value === null || value === void 0 ? void 0 : value.match(REGEX_BRAND_NAME)) || (value === null || value === void 0 ? void 0 : value.length) < 3
21
21
  ? this.createError({ message: 'enter_brand_name_english_chars_numbers_space' })
22
22
  : true;
23
23
  }
@@ -5,3 +5,4 @@ export declare const passwordFeatureScreens: Array<FeatureScreenStep>;
5
5
  export declare const individualFeatureScreens: Array<FeatureScreenStep>;
6
6
  export declare const bankFeatureScreens: Array<FeatureScreenStep>;
7
7
  export declare const taxFeatureScreens: Array<FeatureScreenStep>;
8
+ export declare const signInFeatureScreens: Array<FeatureScreenStep>;
@@ -34,6 +34,10 @@ import TaxDetailsPage from './tax/screens/TaxDetails';
34
34
  import TaxSuccessPage from './tax/screens/Success';
35
35
  import TaxSuccessWithFlowPage from './tax/screens/SuccessWithFlowButtons';
36
36
  import TaxResetPasswordSuccessPage from './tax/screens/ResetPasswordSuccess';
37
+ import SignInMobilePage from './signIn/screens/Mobile';
38
+ import SignInEmailPage from './signIn/screens/Email';
39
+ import SignInOTPPage from './signIn/screens/OTP';
40
+ import SignInPasswordPage from './signIn/screens/Password';
37
41
  export var connectFeatureScreens = [
38
42
  {
39
43
  name: 'CONNECT_NID_STEP',
@@ -169,3 +173,21 @@ export var taxFeatureScreens = [
169
173
  },
170
174
  { name: 'TAX_RESET_PASSWORD_SUCCESS', element: TaxResetPasswordSuccessPage }
171
175
  ];
176
+ export var signInFeatureScreens = [
177
+ {
178
+ name: 'SIGIN_MOBILE_STEP',
179
+ element: SignInMobilePage
180
+ },
181
+ {
182
+ name: 'SIGIN_EMAIL_STEP',
183
+ element: SignInEmailPage
184
+ },
185
+ {
186
+ name: 'SIGIN_OTP_STEP',
187
+ element: SignInOTPPage
188
+ },
189
+ {
190
+ name: 'SIGIN_PASSWORD_STEP',
191
+ element: SignInPasswordPage
192
+ }
193
+ ];
@@ -45,13 +45,14 @@ var AdditionalIndividualInfo = function (_a) {
45
45
  var _b = useAppSelector(individualSelector), data = _b.data, loading = _b.loading, error = _b.error;
46
46
  var settingsData = useAppSelector(settingsSelector).data;
47
47
  var countries = settingsData.countries;
48
+ var _c = data.individualData || {}, sourceIncome = _c.sourceIncome, monthlyIncome = _c.monthlyIncome, employerLocation = _c.employerLocation, occupation = _c.occupation, isPEP = _c.isPEP, isInfluencer = _c.isInfluencer;
48
49
  var methods = useForm({
49
50
  resolver: yupResolver(IndividualInfoValidationSchema),
50
51
  defaultValues: data.individualData,
51
52
  mode: 'onChange'
52
53
  });
53
- var _c = React.useState(), listActive = _c[0], setListActive = _c[1];
54
- var _d = React.useState(false), employerFieldsActive = _d[0], setEmployerFieldsActive = _d[1];
54
+ var _d = React.useState(), listActive = _d[0], setListActive = _d[1];
55
+ var _e = React.useState(false), employerFieldsActive = _e[0], setEmployerFieldsActive = _e[1];
55
56
  React.useEffect(function () {
56
57
  var _a, _b;
57
58
  if (((_b = (_a = methods.getValues('sourceIncome')) === null || _a === void 0 ? void 0 : _a.name_en) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'salary')
@@ -61,10 +62,23 @@ var AdditionalIndividualInfo = function (_a) {
61
62
  }
62
63
  }, [methods.watch('sourceIncome')]);
63
64
  React.useEffect(function () {
64
- if (data.individualData.employerLocation) {
65
- methods.setValue('employerLocation', data.individualData.employerLocation);
65
+ if (!!sourceIncome) {
66
+ methods.setValue('sourceIncome', sourceIncome);
66
67
  }
67
- }, [data.individualData.employerLocation]);
68
+ if (!!monthlyIncome) {
69
+ methods.setValue('monthlyIncome', monthlyIncome);
70
+ }
71
+ if (!!employerLocation) {
72
+ methods.setValue('employerLocation', employerLocation);
73
+ }
74
+ if (!!occupation) {
75
+ methods.setValue('occupation', occupation);
76
+ }
77
+ if (isPEP !== undefined)
78
+ methods.setValue('isPEP', isPEP);
79
+ if (isInfluencer !== undefined)
80
+ methods.setValue('isInfluencer', isInfluencer);
81
+ }, [data.individualData]);
68
82
  var onSubmit = function (data) {
69
83
  dispatch(updateIndividualInfo(data));
70
84
  };
@@ -13,9 +13,9 @@ interface UploadFileProps {
13
13
  dragTitle: string;
14
14
  uploadTitle: string;
15
15
  error?: string;
16
- loading?: boolean;
16
+ isSubmitting?: boolean;
17
17
  onFileUploaded: (file: File) => void;
18
18
  onReset: () => void;
19
19
  }
20
- declare const UploadFile: ({ label, required, dragTitle, uploadTitle, loading, error, onFileUploaded, onReset }: UploadFileProps) => JSX.Element;
20
+ declare const UploadFile: ({ label, required, dragTitle, uploadTitle, isSubmitting, error, onFileUploaded, onReset }: UploadFileProps) => JSX.Element;
21
21
  export default UploadFile;