@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
package/README.md CHANGED
@@ -59,9 +59,6 @@ const App = () => {
59
59
  onStepCompleted={(name, data) => {
60
60
  console.log(name, data)
61
61
  }}
62
- onStepError={(name, error) => {
63
- console.log(name, error)
64
- }}
65
62
  onStepStarted={(name) => {
66
63
  console.log(name)
67
64
  }}
@@ -86,42 +83,51 @@ const App = () => {
86
83
  <body>
87
84
  <div id="root"></div>
88
85
  <script>
89
- const { renderConnectLib } = window.TapAuth
90
- renderConnectLib(
91
- {
92
- open: true,
93
- merchantDomain: window.location.origin,
94
- publicKey: "pk_test_lat64TEDSvHrUOYAxVRe28PQ",
95
- appInfo: {
96
- identifier: "tap_connect_demo",
97
- name: "Tap Connect Demo",
98
- version: "V2.0.0"
99
- },
100
- businessCountryCode: "SA",
101
- language: "en",
102
- onError: (error) => {
103
- alert(JSON.stringify({ error }))
104
- },
105
- onFlowCompleted: (data) => {
106
- console.log(data)
107
- },
108
- onReady: () => {
109
- console.log("ready!")
110
- },
111
- onStepCompleted: (name, data) => {
112
- console.log(name, data)
86
+ const { renderConnectLib, unmountConnectLib } = window.TapAuth
87
+ const startConnect = () => {
88
+ renderConnectLib(
89
+ {
90
+ open: true,
91
+ merchantDomain: window.location.origin,
92
+ publicKey: "pk_test_lat64TEDSvHrUOYAxVRe28PQ",
93
+ appInfo: {
94
+ identifier: "tap_connect_demo",
95
+ name: "Tap Connect Demo",
96
+ version: "V2.0.0"
97
+ },
98
+ businessCountryCode: "SA",
99
+ language: "en",
100
+ onError: (error) => {
101
+ alert(JSON.stringify({ error }))
102
+ },
103
+ onFlowCompleted: (data) => {
104
+ console.log(data)
105
+ },
106
+ onReady: () => {
107
+ console.log("ready!")
108
+ },
109
+ onStepCompleted: (name, data) => {
110
+ console.log(name, data)
111
+ },
112
+ onStepError: (name, error) => {
113
+ console.log(name, error)
114
+ },
115
+ onStepStarted: (name) => {
116
+ console.log(name)
117
+ },
118
+ scope: []
113
119
  },
114
- onStepError: (name, error) => {
115
- console.log(name, error)
116
- },
117
- onStepStarted: (name) => {
118
- console.log(name)
119
- },
120
- scope: []
121
- },
122
- "root"
123
- )
120
+
121
+ "root"
122
+ )
123
+ }
124
+ const stopConnect = () => {
125
+ unmountConnectLib("root")
126
+ }
127
+
124
128
  </script>
129
+ <button onclick="startConnect()">Start</button>
130
+ <button onclick="stopConnect()">Stop</button>
125
131
  </body>
126
132
  </html>
127
133
  ```
@@ -129,6 +135,7 @@ const App = () => {
129
135
  ```
130
136
 
131
137
  ## Connect
138
+ - Help our merchants to create a account with Tap Payments
132
139
 
133
140
  ## Business
134
141
 
@@ -144,18 +151,17 @@ const App = () => {
144
151
 
145
152
  ## Properties
146
153
 
147
- | name | functionality |
148
- | ------------------------------ | --------------------------- |
149
- | open `required` | BadRequest |
150
- | merchantDomain `required` | Unauthorized |
151
- | publicKey `required` | PaymentRequired |
152
- | appInfo `required` | Forbidden |
153
- | businessCountryCode `required` | NotFound |
154
- | language `required` | MethodNotAllowed |
155
- | onError `required` | NotAcceptable |
156
- | onFlowCompleted `required` | ProxyAuthenticationRequired |
157
- | onReady `required` | RequestTimeout |
158
- | onStepCompleted `required` | Conflict |
159
- | onStepError `required` | Gone |
160
- | onStepStarted `required` | LengthRequired |
161
- | scope `required` | UnsupportedMediaType |
154
+ | name | description |
155
+ | ----------------------------------------- | ----------------------------------------------------------------------- |
156
+ | open `required` - `boolean` | open/close the library |
157
+ | merchantDomain `required` - `string` | domain name `https://expamle.com` |
158
+ | publicKey `required` - `string` | merchant public key |
159
+ | appInfo `required` | it's an object from type `AppInfo` |
160
+ | businessCountryCode `required` - `string` | merchant country code and it should be the ISO2 of the country |
161
+ | language `required` - `string` | it can be `en`or `ar` |
162
+ | onError `required` - `function` | callback function will call in case of any error happened |
163
+ | onFlowCompleted `required` - `function` | callback function will called after completing the flow |
164
+ | onReady `required` - `function` | callback function will call after loading library configuration |
165
+ | onStepError `required` - `function` | callback function will call in case if any error happened in the screen |
166
+ | onStepStarted `required` - `function` | callback function will call in the begging of each step |
167
+ | scope `required` - `array` | it's an array include merchant scope |
@@ -102,6 +102,7 @@ interface LibCallbacks {
102
102
  onError: (err: any) => void;
103
103
  onStepCompleted?: (name: string, info: any) => void;
104
104
  onReady?: () => void;
105
+ onStepStarted?: (name: string) => void;
105
106
  }
106
107
  export interface LibConfig extends LibCallbacks {
107
108
  publicKey: string;
@@ -142,14 +143,14 @@ export interface Entry {
142
143
  version: string;
143
144
  }
144
145
  export interface DeviceInfo {
145
- source: 'browser|app';
146
+ source: 'browser' | 'app';
146
147
  device: DeviceDetails;
147
148
  browser: BrowserDetails;
148
149
  app: AppInfo & {
149
150
  language?: string;
150
151
  };
151
152
  connection: Connection;
152
- entry: Entry;
153
+ entry?: Entry;
153
154
  }
154
155
  export interface LocalProps {
155
156
  [country: string]: {
@@ -174,4 +175,12 @@ export declare type BrandInfo = {
174
175
  website: string;
175
176
  social: Array<string>;
176
177
  };
178
+ export declare enum FlowsTypes {
179
+ CONNECT = "connect",
180
+ BANK = "bank",
181
+ BUSINESS = "business",
182
+ INDIVIDUAL = "individual",
183
+ PASSWORD = "password",
184
+ TAX = "tax"
185
+ }
177
186
  export {};
@@ -9,3 +9,12 @@ export var BusinessType;
9
9
  BusinessType["CR"] = "company";
10
10
  BusinessType["FL"] = "freelancer";
11
11
  })(BusinessType || (BusinessType = {}));
12
+ export var FlowsTypes;
13
+ (function (FlowsTypes) {
14
+ FlowsTypes["CONNECT"] = "connect";
15
+ FlowsTypes["BANK"] = "bank";
16
+ FlowsTypes["BUSINESS"] = "business";
17
+ FlowsTypes["INDIVIDUAL"] = "individual";
18
+ FlowsTypes["PASSWORD"] = "password";
19
+ FlowsTypes["TAX"] = "tax";
20
+ })(FlowsTypes || (FlowsTypes = {}));
@@ -49,9 +49,11 @@ export declare type BankFormValues = {
49
49
  iban: string;
50
50
  beneficiaryName: string;
51
51
  bankName: string;
52
+ confirmPolicy: boolean;
52
53
  };
53
54
  export declare type TaxFormValues = {
54
55
  vatId: string;
56
+ confirmPolicy: false;
55
57
  };
56
58
  export declare type IndividualExtraFormValues = {
57
59
  sourceIncome: SourceOfIncome | undefined;
@@ -1,4 +1,5 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
+ import { LanguageMode } from '../@types';
2
3
  export declare type MobileCredential = {
3
4
  code: string;
4
5
  phone: string;
@@ -14,9 +15,12 @@ export declare type IDCredential = {
14
15
  };
15
16
  export declare type CreateAuthBody = {
16
17
  user_credentail: MobileCredential | EmailCredential | IDCredential;
17
- sign_in: boolean;
18
- step_name: string;
18
+ auth_type?: number;
19
+ email_url?: string;
20
+ sign_in?: boolean;
21
+ step_name?: string;
19
22
  encryption_contract: Array<string>;
23
+ lang?: LanguageMode;
20
24
  };
21
25
  export declare type VerifyAuthBody = {
22
26
  auth_token: string;
@@ -31,6 +35,21 @@ export declare type VerifyAuthBody = {
31
35
  remember_me?: boolean;
32
36
  scopes?: Array<string>;
33
37
  };
38
+ export declare type VerifyOperationAuthBody = {
39
+ auth_token: string;
40
+ auth_type: number;
41
+ };
42
+ export declare type ResetPasswordCredential = {
43
+ otp: string;
44
+ new_password: string;
45
+ };
46
+ export declare type ResetPasswordVerifyAuthBody = {
47
+ auth_token: string;
48
+ auth_type: number;
49
+ step_name: string;
50
+ user_credentail: ResetPasswordCredential;
51
+ encryption_contract: Array<string>;
52
+ };
34
53
  export declare type CreatePasswordBody = {
35
54
  password: string;
36
55
  signup_token?: string;
@@ -39,7 +58,7 @@ export declare type CreatePasswordBody = {
39
58
  };
40
59
  declare const authService: {
41
60
  createAuth: (data: CreateAuthBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
42
- verifyAuth: (data: VerifyAuthBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
61
+ verifyAuth: (data: VerifyAuthBody | VerifyOperationAuthBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
43
62
  createPassword: (data: CreatePasswordBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
44
63
  };
45
64
  export { authService };
@@ -1,4 +1,6 @@
1
+ import { AxiosRequestConfig } from 'axios';
1
2
  declare const instance: import("axios").AxiosInstance;
2
3
  export declare const setAxiosGlobalHeaders: (headers: Record<string, string>) => void;
3
4
  export declare const removeAxiosGlobalHeaders: (arr: Array<string>) => void;
5
+ export declare const httpClient: (config: AxiosRequestConfig) => Promise<any>;
4
6
  export default instance;
@@ -1,3 +1,39 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (_) try {
17
+ 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;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
1
37
  import axios from 'axios';
2
38
  import { get, set } from 'lodash-es';
3
39
  import { ENCRYPTION_FLAG } from '../constants';
@@ -33,11 +69,39 @@ var encryptionContractTransformer = function (config) {
33
69
  export var setAxiosGlobalHeaders = function (headers) {
34
70
  Object.keys(headers).forEach(function (key) {
35
71
  instance.defaults.headers.common[key] = headers[key];
72
+ axios.defaults.headers.common[key] = headers[key];
36
73
  });
37
74
  };
38
75
  export var removeAxiosGlobalHeaders = function (arr) {
39
76
  arr.forEach(function (key) {
40
77
  delete instance.defaults.headers.common[key];
78
+ delete axios.defaults.headers.common[key];
41
79
  });
42
80
  };
81
+ export var httpClient = function (config) { return __awaiter(void 0, void 0, void 0, function () {
82
+ var data, _a, description, error, err_1, response, data, _b, description, error;
83
+ return __generator(this, function (_c) {
84
+ switch (_c.label) {
85
+ case 0:
86
+ _c.trys.push([0, 2, , 3]);
87
+ return [4, instance(config)];
88
+ case 1:
89
+ data = (_c.sent()).data;
90
+ _a = (data.errors || [{}])[0], description = _a.description, error = _a.error;
91
+ if (description || error) {
92
+ throw new Error(description, error);
93
+ }
94
+ return [2, data];
95
+ case 2:
96
+ err_1 = _c.sent();
97
+ response = err_1.response;
98
+ data = (response || {}).data;
99
+ if (typeof data === 'string')
100
+ throw new Error(data);
101
+ _b = ((data === null || data === void 0 ? void 0 : data.errors) || [{}])[0], description = _b.description, error = _b.error;
102
+ throw new Error(description || error || 'Internal server error');
103
+ case 3: return [2];
104
+ }
105
+ });
106
+ }); };
43
107
  export default instance;
@@ -1,5 +1,4 @@
1
1
  declare const countryService: {
2
- getBusinessCountries: () => Promise<import("axios").AxiosResponse<any, any>>;
3
- getAllCountries: () => Promise<import("axios").AxiosResponse<any, any>>;
2
+ getCountries: () => Promise<any>;
4
3
  };
5
4
  export { countryService };
@@ -1,13 +1,12 @@
1
- import axios from 'axios';
1
+ import { httpClient } from './axios';
2
2
  import { ENDPOINT_PATHS } from '../constants';
3
- var getBusinessCountries = function () {
4
- return axios.get(ENDPOINT_PATHS.BUSINESS_COUNTRIES);
5
- };
6
- var getAllCountries = function () {
7
- return axios.post(ENDPOINT_PATHS.COUNTRIES);
3
+ var getCountries = function () {
4
+ return httpClient({
5
+ method: 'post',
6
+ url: ENDPOINT_PATHS.COUNTRIES
7
+ });
8
8
  };
9
9
  var countryService = {
10
- getBusinessCountries: getBusinessCountries,
11
- getAllCountries: getAllCountries
10
+ getCountries: getCountries
12
11
  };
13
12
  export { countryService };
@@ -1,4 +1,4 @@
1
1
  declare const firebaseService: {
2
- getLocale: () => Promise<import("axios").AxiosResponse<any, any>>;
2
+ getLocale: () => Promise<any>;
3
3
  };
4
4
  export { firebaseService };
@@ -1,7 +1,10 @@
1
- import axios from 'axios';
2
1
  import { ENDPOINT_PATHS } from '../constants';
2
+ import { httpClient } from './axios';
3
3
  var getLocale = function () {
4
- return axios.get(ENDPOINT_PATHS.FIREBASE_URL);
4
+ return httpClient({
5
+ method: 'get',
6
+ url: ENDPOINT_PATHS.FIREBASE_URL
7
+ });
5
8
  };
6
9
  var firebaseService = {
7
10
  getLocale: getLocale
@@ -1,6 +1,6 @@
1
1
  import axiosInstance, { setAxiosGlobalHeaders, removeAxiosGlobalHeaders } from './axios';
2
2
  import { ValidateOperatorBody } from './operator';
3
- import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody } from './auth';
3
+ import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody } from './auth';
4
4
  import { UpdateLeadBody, LeadVerifyBody, CreateLeadBody, LeadOTPVerifyBody, LeadIdentityUpdateBody } from './lead';
5
5
  import { CheckEmailBody, CheckBrandBody } from './availabilityServices';
6
6
  import { EntityInfoBody, EntityBankUpdateBody } from './entity';
@@ -8,18 +8,17 @@ import { CreateAccountBody } from './account';
8
8
  import { BrandListBody } from './individual';
9
9
  declare const API: {
10
10
  ipService: {
11
- getIP: () => Promise<import("axios").AxiosResponse<any, any>>;
11
+ getIP: () => Promise<any>;
12
12
  };
13
13
  operatorService: {
14
- validateOperator: (body: ValidateOperatorBody) => Promise<import("axios").AxiosResponse<any, any>>;
14
+ validateOperator: (body: ValidateOperatorBody) => Promise<any>;
15
15
  };
16
16
  countryService: {
17
- getBusinessCountries: () => Promise<import("axios").AxiosResponse<any, any>>;
18
- getAllCountries: () => Promise<import("axios").AxiosResponse<any, any>>;
17
+ getCountries: () => Promise<any>;
19
18
  };
20
19
  authService: {
21
20
  createAuth: (data: CreateAuthBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
22
- verifyAuth: (data: VerifyAuthBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
21
+ verifyAuth: (data: VerifyAuthBody | VerifyOperationAuthBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
23
22
  createPassword: (data: CreatePasswordBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
24
23
  };
25
24
  leadService: {
@@ -43,7 +42,7 @@ declare const API: {
43
42
  checkIbanBank: (data: import("./availabilityServices").CheckIBanBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
44
43
  };
45
44
  firebaseService: {
46
- getLocale: () => Promise<import("axios").AxiosResponse<any, any>>;
45
+ getLocale: () => Promise<any>;
47
46
  };
48
47
  accountService: {
49
48
  createAccount: (data: CreateAccountBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -60,6 +59,6 @@ declare const API: {
60
59
  getBrandList: (data: BrandListBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
61
60
  };
62
61
  };
63
- export type { ValidateOperatorBody, CreateAuthBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody };
62
+ export type { ValidateOperatorBody, CreateAuthBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody };
64
63
  export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance };
65
64
  export default API;
package/build/api/ip.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  declare const ipService: {
2
- getIP: () => Promise<import("axios").AxiosResponse<any, any>>;
2
+ getIP: () => Promise<any>;
3
3
  };
4
4
  export { ipService };
package/build/api/ip.js CHANGED
@@ -1,7 +1,10 @@
1
1
  import { ENDPOINT_PATHS } from '../constants';
2
- import instance from './axios';
2
+ import { httpClient } from './axios';
3
3
  var getIP = function () {
4
- return instance.get(ENDPOINT_PATHS.IP);
4
+ return httpClient({
5
+ method: 'get',
6
+ url: ENDPOINT_PATHS.IP
7
+ });
5
8
  };
6
9
  var ipService = {
7
10
  getIP: getIP
@@ -1,4 +1,5 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
+ import { LanguageMode } from '../@types';
2
3
  declare type Name = {
3
4
  title?: string;
4
5
  first?: string;
@@ -60,6 +61,7 @@ export declare type UpdateLeadBody = {
60
61
  name: string;
61
62
  url: string;
62
63
  }[];
64
+ lang?: LanguageMode;
63
65
  };
64
66
  export declare type LeadVerifyBody = {
65
67
  verify_token: string;
@@ -7,6 +7,6 @@ export declare type ValidateOperatorBody = {
7
7
  connect_pkey?: string;
8
8
  };
9
9
  declare const operatorService: {
10
- validateOperator: (body: ValidateOperatorBody) => Promise<import("axios").AxiosResponse<any, any>>;
10
+ validateOperator: (body: ValidateOperatorBody) => Promise<any>;
11
11
  };
12
12
  export { operatorService };
@@ -1,8 +1,64 @@
1
- import { ENDPOINT_PATHS } from '../constants';
2
- import instance from './axios';
3
- var validateOperator = function (body) {
4
- return instance.post(ENDPOINT_PATHS.OPERATOR, body);
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (_) try {
17
+ 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;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
5
36
  };
37
+ import { ENDPOINT_PATHS } from '../constants';
38
+ import { httpClient } from './axios';
39
+ var validateOperator = function (body) { return __awaiter(void 0, void 0, void 0, function () {
40
+ var data, error_1;
41
+ return __generator(this, function (_a) {
42
+ switch (_a.label) {
43
+ case 0:
44
+ _a.trys.push([0, 2, , 3]);
45
+ return [4, httpClient({
46
+ method: 'post',
47
+ url: ENDPOINT_PATHS.OPERATOR,
48
+ data: body
49
+ })];
50
+ case 1:
51
+ data = _a.sent();
52
+ if (data !== 'valid')
53
+ throw new Error('invalid operator');
54
+ return [2, data];
55
+ case 2:
56
+ error_1 = _a.sent();
57
+ throw new Error(error_1);
58
+ case 3: return [2];
59
+ }
60
+ });
61
+ }); };
6
62
  var operatorService = {
7
63
  validateOperator: validateOperator
8
64
  };
@@ -6,6 +6,5 @@ declare const rootReducer: {
6
6
  tax: import("redux").Reducer<import("../features/app/tax/taxStore").TaxState, import("redux").AnyAction>;
7
7
  individual: import("redux").Reducer<import("../features/app/individual/individualStore").IndividualState, import("redux").AnyAction>;
8
8
  password: import("redux").Reducer<import("../features/app/password/passwordStore").PasswordState, import("redux").AnyAction>;
9
- landing: import("redux").Reducer<import("../features/app/landing/landingStore").LandingState, import("redux").AnyAction>;
10
9
  };
11
10
  export default rootReducer;
@@ -5,7 +5,6 @@ import bank from '../features/app/bank/bankStore';
5
5
  import tax from '../features/app/tax/taxStore';
6
6
  import individual from '../features/app/individual/individualStore';
7
7
  import password from '../features/app/password/passwordStore';
8
- import landing from '../features/app/landing/landingStore';
9
8
  var rootReducer = {
10
9
  settings: settings,
11
10
  connect: connect,
@@ -13,7 +12,6 @@ var rootReducer = {
13
12
  bank: bank,
14
13
  tax: tax,
15
14
  individual: individual,
16
- password: password,
17
- landing: landing
15
+ password: password
18
16
  };
19
17
  export default rootReducer;
@@ -1,16 +1,11 @@
1
1
  import { RootState } from './store';
2
- import { ActionState, LanguageMode, SharedState, ThemeMode, ScreenStepNavigation, DeviceInfo, AppInfo, LibConfig } from '../@types';
3
- import { ValidateOperatorBody } from '../api';
4
- export declare const getClientIp: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
5
- export declare const getBrowserFingerPrint: import("@reduxjs/toolkit").AsyncThunk<{
6
- fingerPrint: import("@fingerprintjs/fingerprintjs").GetResult;
7
- client: import("device-detector-js/dist/parsers/client").ClientResult;
8
- device: import("device-detector-js/dist/parsers/device").DeviceResult;
9
- os: import("device-detector-js/dist/parsers/operating-system").Result;
10
- appInfo: AppInfo;
11
- }, AppInfo, {}>;
12
- export declare const getOperator: import("@reduxjs/toolkit").AsyncThunk<any, ValidateOperatorBody, {}>;
13
- export declare const getLocale: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
2
+ import { ActionState, LanguageMode, SharedState, ThemeMode, ScreenStepNavigation, DeviceInfo, LibConfig, CountryCode } from '../@types';
3
+ export declare const fetchAppSettingsSync: import("@reduxjs/toolkit").AsyncThunk<{
4
+ countries: CountryCode[];
5
+ businessCountry: CountryCode;
6
+ locale: any;
7
+ deviceInfo: DeviceInfo;
8
+ }, void, {}>;
14
9
  export interface SettingsData {
15
10
  skin: ThemeMode;
16
11
  language: LanguageMode;
@@ -20,6 +15,8 @@ export interface SettingsData {
20
15
  appConfig: LibConfig;
21
16
  open: boolean;
22
17
  isTapOrigin: boolean;
18
+ businessCountry: CountryCode;
19
+ countries: Array<CountryCode>;
23
20
  }
24
21
  export interface SettingsState extends SharedState<SettingsData> {
25
22
  }