@tap-payments/auth-jsconnect 1.0.88 → 1.0.90-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 (202) hide show
  1. package/README.md +161 -0
  2. package/build/api/account.js +1 -1
  3. package/build/api/auth.js +1 -1
  4. package/build/api/availabilityServices.d.ts +2 -0
  5. package/build/api/availabilityServices.js +1 -1
  6. package/build/api/axios.js +2 -3
  7. package/build/api/country.js +1 -1
  8. package/build/api/data.js +1 -1
  9. package/build/api/entity.js +1 -1
  10. package/build/api/firebase.js +1 -1
  11. package/build/api/index.d.ts +2 -2
  12. package/build/api/index.js +2 -2
  13. package/build/api/individual.js +1 -1
  14. package/build/api/ip.js +1 -1
  15. package/build/api/lead.js +1 -1
  16. package/build/api/operator.js +1 -1
  17. package/build/app/rootReducer.d.ts +7 -7
  18. package/build/app/rootReducer.js +7 -7
  19. package/build/app/settings.d.ts +3 -3
  20. package/build/app/settings.js +5 -5
  21. package/build/components/AnimationFlow/Dialog.js +2 -2
  22. package/build/components/Button/Button.d.ts +6 -1
  23. package/build/components/Button/Button.js +61 -23
  24. package/build/components/DatePicker/DatePicker.js +3 -3
  25. package/build/components/Footer/Footer.js +3 -3
  26. package/build/components/Input/Input.js +2 -2
  27. package/build/components/OTPTimer/OTPTimer.js +1 -1
  28. package/build/components/Providers/ThemeProvider.d.ts +1 -1
  29. package/build/components/SimpleList/SimpleList.js +1 -1
  30. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +1 -1
  31. package/build/components/SocialMediaGroup/SocialMediaGroup.js +2 -2
  32. package/build/constants/api.d.ts +3 -1
  33. package/build/constants/api.js +6 -2
  34. package/build/constants/app.d.ts +2 -5
  35. package/build/constants/app.js +2 -5
  36. package/build/features/Landing/Landing.d.ts +1 -1
  37. package/build/features/Landing/Landing.js +8 -8
  38. package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.js +6 -6
  39. package/build/features/app/bank/bankStore.d.ts +2 -2
  40. package/build/features/app/bank/bankStore.js +38 -28
  41. package/build/features/app/business/businessStore.d.ts +4 -4
  42. package/build/features/app/business/businessStore.js +17 -17
  43. package/build/features/app/connect/connectStore.d.ts +2 -2
  44. package/build/features/app/connect/connectStore.js +18 -9
  45. package/build/features/app/individual/individualStore.d.ts +4 -3
  46. package/build/features/app/individual/individualStore.js +55 -46
  47. package/build/features/app/landing/landingStore.d.ts +2 -2
  48. package/build/features/app/landing/landingStore.js +1 -1
  49. package/build/features/app/password/passwordStore.d.ts +2 -2
  50. package/build/features/app/password/passwordStore.js +35 -25
  51. package/build/features/app/tax/taxStore.d.ts +2 -2
  52. package/build/features/app/tax/taxStore.js +27 -17
  53. package/build/features/bank/Bank.d.ts +1 -1
  54. package/build/features/bank/Bank.js +14 -10
  55. package/build/features/bank/screens/BankDetails/BankDetails.js +11 -7
  56. package/build/features/bank/screens/BankDetails/BankName.js +8 -8
  57. package/build/features/bank/screens/BankDetails/Beneficiary.js +7 -7
  58. package/build/features/bank/screens/BankDetails/IBAN.js +8 -8
  59. package/build/features/bank/screens/BankDetails/validation.js +1 -1
  60. package/build/features/bank/screens/Success/Success.js +3 -3
  61. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +8 -8
  62. package/build/features/bank/screens/Verify/OTPInput.js +2 -2
  63. package/build/features/bank/screens/Verify/Verify.js +9 -9
  64. package/build/features/business/Business.d.ts +1 -1
  65. package/build/features/business/Business.js +14 -10
  66. package/build/features/business/screens/Activities/Activities.js +7 -7
  67. package/build/features/business/screens/Activities/ActivitiesList.d.ts +2 -2
  68. package/build/features/business/screens/Activities/ActivitiesList.js +9 -9
  69. package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
  70. package/build/features/business/screens/Activities/SalesChannels.d.ts +1 -1
  71. package/build/features/business/screens/Activities/SalesChannels.js +7 -7
  72. package/build/features/business/screens/BusinessType/BusinessType.js +8 -8
  73. package/build/features/business/screens/BusinessType/LicenseList.js +10 -10
  74. package/build/features/business/screens/BusinessType/LicenseNumber.js +8 -8
  75. package/build/features/business/screens/BusinessType/SelectType.js +6 -6
  76. package/build/features/business/screens/BusinessType/validation.js +2 -2
  77. package/build/features/business/screens/Customers/CustomerLocations.d.ts +3 -3
  78. package/build/features/business/screens/Customers/CustomerLocations.js +8 -8
  79. package/build/features/business/screens/Customers/Customers.js +8 -8
  80. package/build/features/business/screens/Customers/ExpectedCustomers.js +6 -6
  81. package/build/features/business/screens/Customers/ExpectedSalesRange.js +7 -7
  82. package/build/features/business/screens/Customers/RefundPolicy.d.ts +1 -1
  83. package/build/features/business/screens/Customers/RefundPolicy.js +7 -7
  84. package/build/features/business/screens/Customers/TransactionPolicy.js +5 -5
  85. package/build/features/business/screens/IDBOD/DOB.js +5 -5
  86. package/build/features/business/screens/IDBOD/ID.js +6 -6
  87. package/build/features/business/screens/IDBOD/IDBOD.js +6 -6
  88. package/build/features/business/screens/OTP/OTP.js +9 -9
  89. package/build/features/business/screens/OTP/OTPInput.js +4 -4
  90. package/build/features/business/screens/Success/Success.js +3 -3
  91. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +8 -8
  92. package/build/features/business/screens/Verify/OTPInput.js +2 -2
  93. package/build/features/business/screens/Verify/Verify.js +9 -9
  94. package/build/features/connect/Connect.d.ts +1 -1
  95. package/build/features/connect/Connect.js +10 -10
  96. package/build/features/connect/screens/Individual/Email.js +7 -7
  97. package/build/features/connect/screens/Individual/Individual.js +9 -9
  98. package/build/features/connect/screens/Individual/MobileNumber.d.ts +1 -1
  99. package/build/features/connect/screens/Individual/MobileNumber.js +11 -11
  100. package/build/features/connect/screens/Individual/Name.js +6 -6
  101. package/build/features/connect/screens/Individual/validation.js +1 -1
  102. package/build/features/connect/screens/Merchant/BrandList.d.ts +1 -1
  103. package/build/features/connect/screens/Merchant/BrandList.js +8 -8
  104. package/build/features/connect/screens/Merchant/BrandName.js +10 -10
  105. package/build/features/connect/screens/Merchant/Merchant.js +7 -7
  106. package/build/features/connect/screens/Merchant/SocialMedia.js +9 -9
  107. package/build/features/connect/screens/Merchant/TAC.js +7 -7
  108. package/build/features/connect/screens/Merchant/validation.js +1 -1
  109. package/build/features/connect/screens/Mobile/Mobile.js +9 -9
  110. package/build/features/connect/screens/Mobile/MobileNumber.d.ts +1 -1
  111. package/build/features/connect/screens/Mobile/MobileNumber.js +12 -12
  112. package/build/features/connect/screens/Mobile/Title.js +2 -2
  113. package/build/features/connect/screens/NID/DOB.js +5 -5
  114. package/build/features/connect/screens/NID/IDNumber.js +8 -8
  115. package/build/features/connect/screens/NID/NID.js +8 -8
  116. package/build/features/connect/screens/OTP/OTP.js +9 -9
  117. package/build/features/connect/screens/OTP/OTPInput.js +4 -4
  118. package/build/features/connect/screens/ThankYou/ThankYou.js +3 -3
  119. package/build/features/featuresScreens.d.ts +1 -1
  120. package/build/features/featuresScreens.js +31 -31
  121. package/build/features/individual/Individual.d.ts +1 -1
  122. package/build/features/individual/Individual.js +14 -10
  123. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +10 -10
  124. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.d.ts +1 -1
  125. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.js +8 -8
  126. package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +6 -6
  127. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +6 -6
  128. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +1 -1
  129. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +9 -9
  130. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +6 -6
  131. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +1 -1
  132. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +8 -8
  133. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -1
  134. package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.js +6 -6
  135. package/build/features/individual/screens/ShowIndividualInfo/info.js +1 -1
  136. package/build/features/individual/screens/Success/Success.js +3 -3
  137. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +8 -8
  138. package/build/features/individual/screens/Verify/OTPInput.js +2 -2
  139. package/build/features/individual/screens/Verify/Verify.js +9 -9
  140. package/build/features/password/Password.d.ts +1 -1
  141. package/build/features/password/Password.js +14 -10
  142. package/build/features/password/screens/CreatePassword/ConditionText.js +1 -1
  143. package/build/features/password/screens/CreatePassword/ConfirmPassword.js +3 -3
  144. package/build/features/password/screens/CreatePassword/CreatePassword.js +11 -7
  145. package/build/features/password/screens/CreatePassword/Password.js +6 -6
  146. package/build/features/password/screens/Success/Success.js +3 -3
  147. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +8 -8
  148. package/build/features/password/screens/Verify/OTPInput.js +2 -2
  149. package/build/features/password/screens/Verify/Verify.js +9 -9
  150. package/build/features/shared/AcceptancePayouts/AcceptancePayouts.js +5 -5
  151. package/build/features/shared/Background/Background.js +3 -3
  152. package/build/features/shared/Background/LogoBackground.js +3 -3
  153. package/build/features/shared/Button/AbsherButton.d.ts +1 -1
  154. package/build/features/shared/Button/AbsherButton.js +14 -36
  155. package/build/features/shared/Button/Button.d.ts +1 -1
  156. package/build/features/shared/Button/Button.js +7 -7
  157. package/build/features/shared/Button/EmailProvidersButtons.d.ts +1 -1
  158. package/build/features/shared/Button/EmailProvidersButtons.js +15 -51
  159. package/build/features/shared/Button/FlowsButtons.d.ts +1 -1
  160. package/build/features/shared/Button/FlowsButtons.js +45 -45
  161. package/build/features/shared/Button/MobileButton.d.ts +1 -1
  162. package/build/features/shared/Button/MobileButton.js +12 -33
  163. package/build/features/shared/Button/SuccessButton.js +17 -15
  164. package/build/features/shared/Footer/Footer.js +6 -6
  165. package/build/features/shared/Input/Input.d.ts +1 -1
  166. package/build/features/shared/Input/Input.js +2 -2
  167. package/build/features/shared/OTP/OTP.d.ts +1 -1
  168. package/build/features/shared/OTP/OTP.js +3 -3
  169. package/build/features/shared/Search/Search.js +1 -1
  170. package/build/features/shared/SearchIcon/SearchIcon.js +2 -2
  171. package/build/features/shared/SuccessScreen/SuccessScreen.js +5 -5
  172. package/build/features/tax/Tax.d.ts +1 -1
  173. package/build/features/tax/Tax.js +14 -10
  174. package/build/features/tax/screens/Success/Success.js +3 -3
  175. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +8 -8
  176. package/build/features/tax/screens/TaxDetails/TaxDetails.js +10 -6
  177. package/build/features/tax/screens/TaxDetails/VATId.js +6 -6
  178. package/build/features/tax/screens/Verify/OTPInput.js +2 -2
  179. package/build/features/tax/screens/Verify/Verify.js +9 -9
  180. package/build/hooks/useAppConfig.d.ts +1 -1
  181. package/build/hooks/useAppConfig.js +13 -3
  182. package/build/hooks/useAppSelector.d.ts +1 -1
  183. package/build/hooks/useAppTheme.d.ts +1 -1
  184. package/build/hooks/useAppTheme.js +3 -3
  185. package/build/hooks/useErrorListener.js +2 -2
  186. package/build/hooks/useLanguage.js +1 -1
  187. package/build/hooks/useRedirectionListener.js +1 -1
  188. package/build/i18n.js +1 -1
  189. package/build/index.d.ts +7 -7
  190. package/build/index.js +7 -7
  191. package/build/theme/theme.d.ts +1 -1
  192. package/build/theme/theme.js +10 -0
  193. package/build/utils/locale.d.ts +1 -1
  194. package/build/utils/locale.js +3 -3
  195. package/build/utils/object.d.ts +1 -0
  196. package/build/utils/object.js +5 -0
  197. package/build/utils/rsa.js +1 -1
  198. package/build/utils/string.d.ts +3 -2
  199. package/build/utils/string.js +18 -4
  200. package/package.json +127 -126
  201. package/build/components/DatePicker/customStyle.css +0 -86
  202. package/build/index.css +0 -135
@@ -1,4 +1,4 @@
1
- import { ScreenStepNavigation, BusinessType } from '../@types';
1
+ import { ScreenStepNavigation, BusinessType } from '@types';
2
2
  export declare const CLIENT_ORIGIN: string;
3
3
  export declare const LOCAL_STORAGE_KEYS: {
4
4
  themeMode: string;
@@ -92,25 +92,22 @@ export declare const BUSINESS_STEP_NAMES: {
92
92
  };
93
93
  export declare const BANK_STEP_NAMES: {
94
94
  PHONE_AUTH: string;
95
- IDENTITY_AUTH: string;
96
95
  BANK_INFO: string;
97
96
  BANK_SUCCESS: string;
98
97
  };
99
98
  export declare const TAX_STEP_NAMES: {
100
99
  PHONE_AUTH: string;
101
- IDENTITY_AUTH: string;
102
100
  TAX_INFO: string;
103
101
  TAX_SUCCESS: string;
104
102
  };
105
103
  export declare const INDIVIDUAl_STEP_NAMES: {
106
104
  PHONE_AUTH: string;
107
- IDENTITY_AUTH: string;
108
105
  INDIVIDUAl_INFO: string;
109
106
  INDIVIDUAl_SUCCESS: string;
110
107
  };
111
108
  export declare const PASSWORD_STEP_NAMES: {
109
+ PASSWORD_INFO: string;
112
110
  PHONE_AUTH: string;
113
- IDENTITY_AUTH: string;
114
111
  PASSWORD_CREATE: string;
115
112
  PASSWORD_SUCCESS: string;
116
113
  };
@@ -1,4 +1,4 @@
1
- import { BusinessType } from '../@types';
1
+ import { BusinessType } from '@types';
2
2
  export var CLIENT_ORIGIN = window.location.origin;
3
3
  export var LOCAL_STORAGE_KEYS = {
4
4
  themeMode: 'themeMode',
@@ -291,25 +291,22 @@ export var BUSINESS_STEP_NAMES = {
291
291
  };
292
292
  export var BANK_STEP_NAMES = {
293
293
  PHONE_AUTH: 'bank_phone_auth',
294
- IDENTITY_AUTH: 'bank_identity_auth',
295
294
  BANK_INFO: 'bank_info',
296
295
  BANK_SUCCESS: 'bank_completed'
297
296
  };
298
297
  export var TAX_STEP_NAMES = {
299
298
  PHONE_AUTH: 'tax_phone_auth',
300
- IDENTITY_AUTH: 'tax_identity_auth',
301
299
  TAX_INFO: 'tax_info',
302
300
  TAX_SUCCESS: 'tax_completed'
303
301
  };
304
302
  export var INDIVIDUAl_STEP_NAMES = {
305
303
  PHONE_AUTH: 'individual_phone_auth',
306
- IDENTITY_AUTH: 'individual_identity_auth',
307
304
  INDIVIDUAl_INFO: 'individual_info',
308
305
  INDIVIDUAl_SUCCESS: 'individual_completed'
309
306
  };
310
307
  export var PASSWORD_STEP_NAMES = {
308
+ PASSWORD_INFO: 'password_info',
311
309
  PHONE_AUTH: 'password_phone_auth',
312
- IDENTITY_AUTH: 'password_identity_auth',
313
310
  PASSWORD_CREATE: 'password_create',
314
311
  PASSWORD_SUCCESS: 'password_completed'
315
312
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { LibConfig } from '../../@types';
2
+ import { LibConfig } from '@src/@types';
3
3
  export interface LandingProps extends LibConfig {
4
4
  }
5
5
  export declare function LandingLib(props: LandingProps): JSX.Element;
@@ -11,15 +11,15 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import React, { memo, useEffect } from 'react';
14
- import { useAppTheme, useAppDispatch, useAppSelector, useErrorListener, useAppConfig } from '../../hooks';
15
- import { settingsSelector } from '../../app/settings';
16
- import { store } from '../../app/store';
17
- import { ReduxProvider, ThemeProvider } from '../../components/Providers';
18
- import Collapse from '../../components/Collapse';
19
- import { getParameterByName, reactElement } from '../../utils';
20
- import { LANDING_SCREENS_NAVIGATION } from '../../constants';
14
+ import { useAppTheme, useAppDispatch, useAppSelector, useErrorListener, useAppConfig } from '@hooks';
15
+ import { settingsSelector } from '@app/settings';
16
+ import { store } from '@app/store';
17
+ import { ReduxProvider, ThemeProvider } from '@components/Providers';
18
+ import Collapse from '@components/Collapse';
19
+ import { getParameterByName, reactElement } from '@utils';
20
+ import { LANDING_SCREENS_NAVIGATION } from '@constants';
21
21
  import { landingFeatureScreens } from '../featuresScreens';
22
- import { verifyAuthToken } from '../app/landing/landingStore';
22
+ import { verifyAuthToken } from '@features/app/landing/landingStore';
23
23
  var Landing = memo(function (props) {
24
24
  var open = React.useState(true)[0];
25
25
  var theme = useAppTheme().theme;
@@ -2,12 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import Box from '@mui/material/Box/Box';
4
4
  import { styled } from '@mui/material/styles';
5
- import { settingsSelector } from '../../../../app/settings';
6
- import { landingSelector } from '../../../app/landing/landingStore';
7
- import { useAppSelector } from '../../../../hooks';
8
- import Loader from '../../../../components/AnimationFlow/Loader';
9
- import Error from '../../../../components/AnimationFlow/Error';
10
- import { getParameterByName } from '../../../../utils';
5
+ import { settingsSelector } from '@app/settings';
6
+ import { landingSelector } from '@features/app/landing/landingStore';
7
+ import { useAppSelector } from '@hooks';
8
+ import Loader from '@components/AnimationFlow/Loader';
9
+ import Error from '@components/AnimationFlow/Error';
10
+ import { getParameterByName } from '@utils';
11
11
  var ScreenContainerStyled = styled(Box)(function (_a) {
12
12
  var theme = _a.theme;
13
13
  return ({
@@ -1,5 +1,5 @@
1
- import { RootState } from '../../../app/store';
2
- import { BankFormValues, OTPFormValues, ResponseData, SharedState } from '../../../@types';
1
+ import { RootState } from '@store';
2
+ import { BankFormValues, 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;
@@ -47,14 +47,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  };
48
48
  var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
- import API from '../../../api';
51
- import { removeRequestHeaders } from '../../../utils';
52
- import { handleNextScreenStep } from '../../../app/settings';
53
- import { BANK_STEP_NAMES } from '../../../constants';
50
+ import API from '@api';
51
+ import { hasKey, removeRequestHeaders } from '@utils';
52
+ import { handleNextScreenStep } from '@app/settings';
53
+ import { BANK_STEP_NAMES } from '@src/constants';
54
54
  export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
55
- var payload, data, leadResponse;
56
- return __generator(this, function (_a) {
57
- switch (_a.label) {
55
+ var payload, data, leadResponse, _a, steps, entity, hasCompleted;
56
+ return __generator(this, function (_b) {
57
+ switch (_b.label) {
58
58
  case 0:
59
59
  payload = {
60
60
  service_name: 'tap_email',
@@ -62,22 +62,31 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
62
62
  };
63
63
  return [4, API.leadService.verifyLeadToken(payload)];
64
64
  case 1:
65
- data = (_a.sent()).data;
65
+ data = (_b.sent()).data;
66
66
  leadResponse = undefined;
67
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 3];
67
+ if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 5];
68
68
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
69
69
  case 2:
70
- leadResponse = _a.sent();
71
- if (data.step_name === BANK_STEP_NAMES.IDENTITY_AUTH) {
72
- thunkApi.dispatch(handleNextScreenStep());
70
+ leadResponse = _b.sent();
71
+ _a = leadResponse.data, steps = _a.steps, entity = _a.entity;
72
+ hasCompleted = hasKey(steps, BANK_STEP_NAMES.BANK_SUCCESS);
73
+ if (!hasCompleted) return [3, 4];
74
+ return [4, thunkApi.dispatch(retrieveEntityInfo(entity === null || entity === void 0 ? void 0 : entity.id))];
75
+ case 3:
76
+ _b.sent();
77
+ thunkApi.dispatch(handleNextScreenStep('BANK_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
78
+ return [3, 5];
79
+ case 4:
80
+ if (data.step_name === BANK_STEP_NAMES.BANK_INFO) {
81
+ thunkApi.dispatch(handleNextScreenStep('BANK_BANK_DETAILS_STEP'));
73
82
  }
74
- _a.label = 3;
75
- case 3: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
83
+ _b.label = 5;
84
+ case 5: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
76
85
  }
77
86
  });
78
87
  }); });
79
88
  export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
80
- var _a, bank, settings, responseBody, payload, data, steps, hasBankCompleted;
89
+ var _a, bank, settings, responseBody, payload, data, steps, hasCompleted;
81
90
  var _b, _c, _d, _e;
82
91
  return __generator(this, function (_f) {
83
92
  switch (_f.label) {
@@ -97,8 +106,8 @@ export var verifyBankLeadOTP = createAsyncThunk('verifyBankLeadOTP', function (p
97
106
  if (!!data.errors) return [3, 4];
98
107
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
99
108
  steps = responseBody === null || responseBody === void 0 ? void 0 : responseBody.steps;
100
- hasBankCompleted = Object.keys(steps).find(function (key) { return key === BANK_STEP_NAMES.BANK_SUCCESS; });
101
- if (!hasBankCompleted) return [3, 3];
109
+ hasCompleted = hasKey(steps, BANK_STEP_NAMES.BANK_SUCCESS);
110
+ if (!hasCompleted) return [3, 3];
102
111
  return [4, thunkApi.dispatch(retrieveEntityInfo((_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.entity) === null || _e === void 0 ? void 0 : _e.id))];
103
112
  case 2:
104
113
  _f.sent();
@@ -175,9 +184,9 @@ export var checkIbanBank = createAsyncThunk('checkIbanBank', function (_a) {
175
184
  });
176
185
  export var updateLeadSuccess = createAsyncThunk('updateLeadBankSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
177
186
  var _a, settings, bank, id, payload, data;
178
- var _b, _c, _d, _e, _f, _g;
179
- return __generator(this, function (_h) {
180
- switch (_h.label) {
187
+ var _b, _c, _d, _e, _f;
188
+ return __generator(this, function (_g) {
189
+ switch (_g.label) {
181
190
  case 0:
182
191
  _a = thunkApi.getState(), settings = _a.settings, bank = _a.bank;
183
192
  id = (bank.data.verify.responseBody || {}).id;
@@ -185,17 +194,17 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadBankSuccess', functio
185
194
  return [2];
186
195
  payload = {
187
196
  step_name: BANK_STEP_NAMES.BANK_SUCCESS,
188
- id: ((_b = bank.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.id) || '',
197
+ id: id,
189
198
  encryption_contract: []
190
199
  };
191
200
  return [4, API.leadService.updateLead(payload)];
192
201
  case 1:
193
- data = (_h.sent()).data;
194
- return [4, thunkApi.dispatch(retrieveEntityInfo((_c = data.entity) === null || _c === void 0 ? void 0 : _c.id))];
202
+ data = (_g.sent()).data;
203
+ return [4, thunkApi.dispatch(retrieveEntityInfo((_b = data.entity) === null || _b === void 0 ? void 0 : _b.id))];
195
204
  case 2:
196
- _h.sent();
197
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, params);
198
- (_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: data });
205
+ _g.sent();
206
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
207
+ (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
199
208
  thunkApi.dispatch(handleNextScreenStep());
200
209
  return [2, { response: data, formData: params }];
201
210
  }
@@ -249,7 +258,7 @@ export var bankSlice = createSlice({
249
258
  state.error = description;
250
259
  return;
251
260
  }
252
- state.data.verify.responseBody = __assign(__assign({}, data), leadData);
261
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), leadData), state.data.verify.responseBody);
253
262
  state.data.verify.token = token;
254
263
  })
255
264
  .addCase(verifyLeadToken.rejected, function (state, action) {
@@ -307,7 +316,8 @@ export var bankSlice = createSlice({
307
316
  state.error = description;
308
317
  return;
309
318
  }
310
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
319
+ var flows = response.flows, steps = response.steps;
320
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps });
311
321
  removeRequestHeaders();
312
322
  })
313
323
  .addCase(updateLeadSuccess.pending, function (state) {
@@ -1,5 +1,5 @@
1
- import { RootState } from '../../../app/store';
2
- import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, CountryCode, NIDFormValues, OTPFormValues, ResponseData, SharedState } from '../../../@types';
1
+ import { RootState } from '@store';
2
+ import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, CountryCode, NIDFormValues, OTPFormValues, ResponseData, SharedState } from '@types';
3
3
  export declare const getCountries: import("@reduxjs/toolkit").AsyncThunk<{
4
4
  businessCountry: any;
5
5
  countries: any;
@@ -44,8 +44,8 @@ export declare const createAccount: import("@reduxjs/toolkit").AsyncThunk<{
44
44
  export declare const updateActivitiesInfo: import("@reduxjs/toolkit").AsyncThunk<{
45
45
  data: any;
46
46
  formData: {
47
- activities: import("../../../@types").Activity[] | undefined;
48
- salesChannels: import("../../../@types").SalesChannel[];
47
+ activities: import("@types").Activity[] | undefined;
48
+ salesChannels: import("@types").SalesChannel[];
49
49
  operationStartDate: string;
50
50
  };
51
51
  }, ActivitiesFormValues, {}>;
@@ -57,11 +57,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
57
57
  var _a;
58
58
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
59
59
  import moment from 'moment';
60
- import API from '../../../api';
61
- import { BusinessType } from '../../../@types';
62
- import { BUSINESS_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '../../../constants';
63
- import { convertNumbers2English, getFlowUrl, removeRequestHeaders } from '../../../utils';
64
- import { handleNextScreenStep } from '../../../app/settings';
60
+ import API from '@api';
61
+ import { BusinessType } from '@types';
62
+ import { BUSINESS_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_FL_LICENSE } from '@constants';
63
+ import { convertNumbers2English, getFlowUrl, hasKey, removeRequestHeaders } from '@utils';
64
+ import { handleNextScreenStep } from '@app/settings';
65
65
  export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
66
66
  var settings, countriesBody, businessCountry;
67
67
  return __generator(this, function (_a) {
@@ -133,8 +133,8 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
133
133
  case 2:
134
134
  _f.sent();
135
135
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
136
- steps = (responseBody === null || responseBody === void 0 ? void 0 : responseBody.steps) || [];
137
- hasBusinessCompleted = Object.keys(steps).find(function (key) { return key === BUSINESS_STEP_NAMES.BUSINESS_SUCCESS; });
136
+ steps = responseBody === null || responseBody === void 0 ? void 0 : responseBody.steps;
137
+ hasBusinessCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_SUCCESS);
138
138
  if (!isNID) return [3, 3];
139
139
  thunkApi.dispatch(handleNextScreenStep());
140
140
  return [3, 6];
@@ -294,7 +294,8 @@ export var updateActivitiesInfo = createAsyncThunk('updateActivitiesInfo', funct
294
294
  activities: activities,
295
295
  channel_services: channel,
296
296
  business_operation_start_at: params.operationStartDate,
297
- step_name: stepName
297
+ step_name: stepName,
298
+ encryption_contract: ['business_operation_start_at']
298
299
  };
299
300
  return [4, API.entityService.createEntityInfo(requestBody)];
300
301
  case 1:
@@ -348,7 +349,8 @@ export var updateCustomersInfo = createAsyncThunk('updateCustomersInfo', functio
348
349
  yearly_sales_range: ((_d = params.expectedSale) === null || _d === void 0 ? void 0 : _d.id) || '',
349
350
  agree_refund: params.refundPolicy,
350
351
  agree_chargeback: params.transactionPolicy,
351
- step_name: stepName
352
+ step_name: stepName,
353
+ encryption_contract: ['customers_base[0]', 'customers_served_monthly', 'yearly_sales_range']
352
354
  };
353
355
  return [4, API.entityService.updateEntityInfo(requestBody)];
354
356
  case 1:
@@ -379,19 +381,19 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
379
381
  flows: [
380
382
  {
381
383
  name: 'tax',
382
- url: getFlowUrl('/tax')
384
+ url: getFlowUrl('/tax', settings.data.language)
383
385
  },
384
386
  {
385
387
  name: 'bank',
386
- url: getFlowUrl('/bank')
388
+ url: getFlowUrl('/bank', settings.data.language)
387
389
  },
388
390
  {
389
391
  name: 'individual',
390
- url: getFlowUrl('/individual')
392
+ url: getFlowUrl('/individual', settings.data.language)
391
393
  },
392
394
  {
393
395
  name: 'password',
394
- url: getFlowUrl('/password')
396
+ url: getFlowUrl('/password', settings.data.language)
395
397
  }
396
398
  ],
397
399
  encryption_contract: []
@@ -541,10 +543,8 @@ export var businessSlice = createSlice({
541
543
  state.error = action.error.message;
542
544
  })
543
545
  .addCase(updateLeadIdentity.pending, function (state, action) {
544
- var _a, _b;
545
- if ((_a = action.meta.arg) === null || _a === void 0 ? void 0 : _a.isResend)
546
- state.customLoading = true;
547
- if (!((_b = action.meta.arg) === null || _b === void 0 ? void 0 : _b.isResend))
546
+ var _a;
547
+ if (!((_a = action.meta.arg) === null || _a === void 0 ? void 0 : _a.isResend))
548
548
  state.loading = true;
549
549
  state.error = null;
550
550
  })
@@ -1,5 +1,5 @@
1
- import { RootState } from '../../../app/store';
2
- import { ResponseData, CountryCode, MobileFormValues, NIDFormValues, OTPFormValues, IndividualFormValues, SharedState, BrandFormValues } from '../../../@types';
1
+ import { RootState } from '@app/store';
2
+ import { ResponseData, CountryCode, MobileFormValues, NIDFormValues, OTPFormValues, IndividualFormValues, SharedState, BrandFormValues } from '@types';
3
3
  import { CancelToken } from 'axios';
4
4
  export declare const getCountries: import("@reduxjs/toolkit").AsyncThunk<{
5
5
  businessCountry: any;
@@ -56,11 +56,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
56
56
  };
57
57
  var _a;
58
58
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
59
- import { handleNextScreenStep } from '../../../app/settings';
60
- import API from '../../../api';
61
- import { CONNECT_STEP_NAMES, IDENTIFICATION_TYPE, INSTAGRAM_URL, OTHER_BRAND, TWITTER_URL } from '../../../constants';
62
- import { defaultCountry } from '../../../constants';
63
- import { getIndividualName, getFlowUrl, capitalizeTheFirstLetterOfEachWord, removeRequestHeaders } from '../../../utils';
59
+ import { handleNextScreenStep } from '@app/settings';
60
+ import API from '@api';
61
+ import { CONNECT_STEP_NAMES, IDENTIFICATION_TYPE, INSTAGRAM_URL, OTHER_BRAND, TWITTER_URL } from '@constants';
62
+ import { defaultCountry } from '@constants';
63
+ import { getIndividualName, getFlowUrl, capitalizeTheFirstLetterOfEachWord, removeRequestHeaders } from '@utils';
64
64
  export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
65
65
  var settings, countriesBody, businessCountry;
66
66
  return __generator(this, function (_a) {
@@ -290,7 +290,14 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
290
290
  id: (isExistingUser ? (_h = brandData.responseBody) === null || _h === void 0 ? void 0 : _h.lead_id : (_j = otpData.responseBody) === null || _j === void 0 ? void 0 : _j.lead_id) || '',
291
291
  terms_conditions_accepted: params.termAndConditionChecked,
292
292
  step_name: CONNECT_STEP_NAMES.UPDATE_LEAD_MERCHANT,
293
- encryption_contract: ['brand.name.en', 'brand.name.ar', 'brand.name.zh']
293
+ encryption_contract: [
294
+ 'brand.name.en',
295
+ 'brand.name.ar',
296
+ 'brand.name.zh',
297
+ 'brand.website',
298
+ 'brand.social[0]',
299
+ 'brand.social[1]'
300
+ ]
294
301
  };
295
302
  return [4, API.leadService.updateLead(payload)];
296
303
  case 1:
@@ -311,7 +318,8 @@ export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', f
311
318
  switch (_b.label) {
312
319
  case 0:
313
320
  requestBody = {
314
- email: email
321
+ email: email,
322
+ encryption_contract: ['email']
315
323
  };
316
324
  return [4, API.availabilityServices.checkEmail(requestBody, { cancelToken: cancelToken })];
317
325
  case 1:
@@ -332,7 +340,8 @@ export var checkBrandNameAvailability = createAsyncThunk('checkBrandNameAvailabi
332
340
  switch (_b.label) {
333
341
  case 0:
334
342
  requestBody = {
335
- profile_name: name
343
+ profile_name: name,
344
+ encryption_contract: ['profile_name']
336
345
  };
337
346
  return [4, API.availabilityServices.checkBrand(requestBody, { cancelToken: cancelToken })];
338
347
  case 1:
@@ -362,7 +371,7 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadSuccess', function (p
362
371
  flows: [
363
372
  {
364
373
  name: 'business',
365
- url: getFlowUrl('/business')
374
+ url: getFlowUrl('/business', settings.data.language)
366
375
  }
367
376
  ],
368
377
  id: leadId,
@@ -1,5 +1,5 @@
1
- import { RootState } from '../../../app/store';
2
- import { CountryCode, IndividualExtraFormValues, OTPFormValues, ResponseData, SharedState } from '../../../@types';
1
+ import { RootState } from '@store';
2
+ import { CountryCode, IndividualExtraFormValues, OTPFormValues, ResponseData, SharedState } from '@types';
3
3
  export declare const getCountries: import("@reduxjs/toolkit").AsyncThunk<{
4
4
  businessCountry: any;
5
5
  countries: any;
@@ -12,7 +12,8 @@ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
12
12
  export declare const retrieveDataList: import("@reduxjs/toolkit").AsyncThunk<{
13
13
  sourceIncome: any;
14
14
  monthlyIncome: any;
15
- }, void, {}>;
15
+ countryCode: string;
16
+ }, string, {}>;
16
17
  export declare const retrieveEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
17
18
  data: any;
18
19
  }, string, {}>;