@tap-payments/auth-jsconnect 1.0.89 → 1.0.93-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 (117) hide show
  1. package/README.md +86 -135
  2. package/build/@types/app.d.ts +9 -0
  3. package/build/@types/app.js +9 -0
  4. package/build/@types/form.d.ts +2 -0
  5. package/build/api/availabilityServices.d.ts +2 -0
  6. package/build/api/axios.js +1 -2
  7. package/build/api/index.d.ts +2 -2
  8. package/build/api/index.js +2 -2
  9. package/build/app/rootReducer.d.ts +0 -1
  10. package/build/app/rootReducer.js +1 -3
  11. package/build/app/store.d.ts +0 -2
  12. package/build/components/AnimationFlow/BottomSheet.js +1 -1
  13. package/build/components/Button/Button.d.ts +6 -1
  14. package/build/components/Button/Button.js +61 -23
  15. package/build/components/Footer/Footer.d.ts +0 -2
  16. package/build/components/Footer/Footer.js +0 -1
  17. package/build/constants/api.d.ts +3 -1
  18. package/build/constants/api.js +6 -2
  19. package/build/constants/app.d.ts +0 -1
  20. package/build/constants/app.js +0 -8
  21. package/build/features/app/bank/bankStore.d.ts +5 -1
  22. package/build/features/app/bank/bankStore.js +38 -1
  23. package/build/features/app/business/businessStore.d.ts +5 -1
  24. package/build/features/app/business/businessStore.js +40 -5
  25. package/build/features/app/connect/connectStore.d.ts +2 -1
  26. package/build/features/app/connect/connectStore.js +19 -8
  27. package/build/features/app/individual/individualStore.d.ts +5 -1
  28. package/build/features/app/individual/individualStore.js +36 -0
  29. package/build/features/app/password/passwordStore.d.ts +5 -1
  30. package/build/features/app/password/passwordStore.js +37 -1
  31. package/build/features/app/tax/taxStore.d.ts +5 -1
  32. package/build/features/app/tax/taxStore.js +39 -2
  33. package/build/features/bank/Bank.js +9 -4
  34. package/build/features/bank/screens/BankDetails/BankDetails.js +6 -1
  35. package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +3 -0
  36. package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +67 -0
  37. package/build/features/bank/screens/BankDetails/validation.d.ts +3 -0
  38. package/build/features/bank/screens/BankDetails/validation.js +2 -1
  39. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  40. package/build/features/bank/screens/Verify/OTPInput.d.ts +3 -1
  41. package/build/features/bank/screens/Verify/OTPInput.js +6 -1
  42. package/build/features/bank/screens/Verify/Verify.js +3 -2
  43. package/build/features/business/Business.js +9 -4
  44. package/build/features/business/screens/Activities/ActivitiesList.d.ts +1 -1
  45. package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
  46. package/build/features/business/screens/Customers/RefundPolicy.d.ts +1 -1
  47. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -1
  48. package/build/features/business/screens/Verify/OTPInput.d.ts +3 -1
  49. package/build/features/business/screens/Verify/OTPInput.js +6 -1
  50. package/build/features/business/screens/Verify/Verify.js +3 -2
  51. package/build/features/connect/Connect.js +5 -3
  52. package/build/features/connect/screens/Mobile/Mobile.js +1 -1
  53. package/build/features/connect/screens/NID/NID.js +1 -1
  54. package/build/features/featuresScreens.d.ts +0 -1
  55. package/build/features/featuresScreens.js +0 -7
  56. package/build/features/individual/Individual.js +9 -4
  57. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +3 -3
  58. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  59. package/build/features/individual/screens/Verify/OTPInput.d.ts +3 -1
  60. package/build/features/individual/screens/Verify/OTPInput.js +6 -1
  61. package/build/features/individual/screens/Verify/Verify.js +3 -2
  62. package/build/features/password/Password.js +9 -4
  63. package/build/features/password/screens/CreatePassword/CreatePassword.js +5 -1
  64. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  65. package/build/features/password/screens/Verify/OTPInput.d.ts +3 -1
  66. package/build/features/password/screens/Verify/OTPInput.js +6 -1
  67. package/build/features/password/screens/Verify/Verify.js +3 -2
  68. package/build/features/shared/AcceptancePayouts/AcceptancePayouts.js +1 -1
  69. package/build/features/shared/Background/Background.js +3 -3
  70. package/build/features/shared/Background/LogoBackground.js +1 -4
  71. package/build/features/shared/Button/AbsherButton.d.ts +1 -2
  72. package/build/features/shared/Button/AbsherButton.js +5 -32
  73. package/build/features/shared/Button/EmailProvidersButtons.js +13 -48
  74. package/build/features/shared/Button/FlowsButtons.d.ts +4 -1
  75. package/build/features/shared/Button/FlowsButtons.js +51 -46
  76. package/build/features/shared/Button/MobileButton.d.ts +1 -2
  77. package/build/features/shared/Button/MobileButton.js +3 -29
  78. package/build/features/shared/Button/SuccessButton.js +18 -16
  79. package/build/features/shared/Footer/Footer.js +1 -1
  80. package/build/features/shared/OTP/OTP.d.ts +2 -1
  81. package/build/features/shared/OTP/OTP.js +10 -2
  82. package/build/features/tax/Tax.js +9 -4
  83. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  84. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +3 -0
  85. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +66 -0
  86. package/build/features/tax/screens/TaxDetails/TaxDetails.js +9 -2
  87. package/build/features/tax/screens/TaxDetails/VATId.js +13 -2
  88. package/build/features/tax/screens/TaxDetails/validation.d.ts +3 -0
  89. package/build/features/tax/screens/TaxDetails/validation.js +2 -1
  90. package/build/features/tax/screens/Verify/OTPInput.d.ts +3 -1
  91. package/build/features/tax/screens/Verify/OTPInput.js +6 -1
  92. package/build/features/tax/screens/Verify/Verify.js +3 -2
  93. package/build/hooks/index.d.ts +1 -0
  94. package/build/hooks/index.js +1 -0
  95. package/build/hooks/useAppConfig.js +11 -1
  96. package/build/hooks/useAppDispatch.d.ts +0 -1
  97. package/build/hooks/useErrorListener.d.ts +1 -1
  98. package/build/hooks/useErrorListener.js +4 -6
  99. package/build/hooks/useStepStartedListener.d.ts +1 -0
  100. package/build/hooks/useStepStartedListener.js +10 -0
  101. package/build/index.d.ts +2 -3
  102. package/build/index.js +2 -5
  103. package/build/theme/theme.js +10 -0
  104. package/build/utils/locale.js +2 -2
  105. package/build/utils/string.d.ts +3 -1
  106. package/build/utils/string.js +35 -2
  107. package/package.json +127 -126
  108. package/build/features/Landing/Landing.d.ts +0 -7
  109. package/build/features/Landing/Landing.js +0 -55
  110. package/build/features/Landing/index.d.ts +0 -1
  111. package/build/features/Landing/index.js +0 -1
  112. package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.d.ts +0 -5
  113. package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.js +0 -41
  114. package/build/features/Landing/screens/VerifyAndRedirect/index.d.ts +0 -2
  115. package/build/features/Landing/screens/VerifyAndRedirect/index.js +0 -2
  116. package/build/features/app/landing/landingStore.d.ts +0 -22
  117. 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
  }}
@@ -71,146 +68,100 @@ const App = () => {
71
68
  }
72
69
  ```
73
70
 
74
- ## ErrorObject
75
-
76
- - `statusCode`: the status code of the error. `required`
77
- - `message`: the error message. `required`
78
- - `description`: the error description. `optional`
79
- - `help`: the error url that can help the client to fix the api issue e.g
80
- (<https://your-domain.example/integration/fixes/auth-api>) `optional`
81
- - `invalidParams`: the errors of request in case you need to validate the
82
- request data. `optional`
83
-
84
- - `message`: the error message. `required`
85
- - `param`: the error parameter name e.g (email, password, name, etc). `optional`
86
- - `location`: the location of parameter key. `required`
87
-
88
- - `errorKey`: the error key and the main purpose we can use it for localization part
89
- and in this case we will have a generic errors we can catch any error message
90
- by key `for example:` we can store local.en.json and local.en.json includes
91
-
92
- ```json
93
- { "bad_request": "invalid user request data" }
94
- ```
71
+ ### Vanilla JS
95
72
 
96
- and local.ar.json includes
97
-
98
- ```json
99
- { "bad_request": "بايانات غير صحيحة" }
100
- ```
101
-
102
- and the both files located in the
103
- frontend so by using the response `errorKey` we can localize the error message
104
- easily. `optional`
105
-
106
- ## HttpError
73
+ ```js
74
+ <!DOCTYPE html>
75
+ <html lang="en">
76
+ <head>
77
+ <meta charset="utf-8" />
78
+ <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no" />
79
+ <title>Auth-JsConnect</title>
80
+ <script src="https://auth-jsconnect.b-cdn.net/build-1.0.90-test/main.js"></script>
81
+ <link href="https://auth-jsconnect.b-cdn.net/build-1.0.90-test/main.css" rel="stylesheet" />
82
+ </head>
83
+ <body>
84
+ <div id="root"></div>
85
+ <script>
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: []
119
+ },
120
+
121
+ "root"
122
+ )
123
+ }
124
+ const stopConnect = () => {
125
+ unmountConnectLib("root")
126
+ }
127
+
128
+ </script>
129
+ <button onclick="startConnect()">Start</button>
130
+ <button onclick="stopConnect()">Stop</button>
131
+ </body>
132
+ </html>
133
+ ```
107
134
 
108
- ### Initializer
135
+ ```
109
136
 
110
- it's a middleware should be used in the top of your app or at lest before your
111
- routes that include `HttpError`
137
+ ## Connect
138
+ - Help our merchants to create a account with Tap Payments
112
139
 
113
- ```js
114
- // in the beginning of your app (important)
115
- app.use(HttpError.initializer)
116
- // OR
117
- app.use((req, res, next) => {
118
- HttpError.initializer(req, res, next)
119
- })
120
- ```
140
+ ## Business
121
141
 
122
- ### Handler
142
+ ## Password
123
143
 
124
- it's a middleware and it will handle all the errors returned by
125
- `HttpError` functions and it will send it back to the client but if the error
126
- not belong ot the lib it will pass it using next fun
144
+ ## Individual
127
145
 
128
- ```js
129
- // in the end of your app (important)
130
- app.use(HttpError.handler)
131
- // OR
132
- app.use((err, req, res, next) => {
133
- HttpError.handler(err, req, res, next)
134
- })
135
- ```
146
+ ## Bank
136
147
 
137
- ### customError
138
-
139
- it's a helper function can help you to create your custom error.
140
-
141
- ### HttpError.{{ any function from the next list }}
142
-
143
- - they are helper functions allow you to send sepecific error to the client
144
-
145
- - `attrs` error object to customize your error response `optional`
146
- - `message`: the error message. `required`
147
- - `errorKey`: the error key. `optional`
148
- - `help`: the error help location/url. `optional`
149
- - `description`: the error description `optional`
150
- - `invalidParams`: the request parameters errors `optional`
151
-
152
- | status code | function name |
153
- | ----------- | ----------------------------- |
154
- | 400 | BadRequest |
155
- | 401 | Unauthorized |
156
- | 402 | PaymentRequired |
157
- | 403 | Forbidden |
158
- | 404 | NotFound |
159
- | 405 | MethodNotAllowed |
160
- | 406 | NotAcceptable |
161
- | 407 | ProxyAuthenticationRequired |
162
- | 408 | RequestTimeout |
163
- | 409 | Conflict |
164
- | 410 | Gone |
165
- | 411 | LengthRequired |
166
- | 412 | PreconditionFailed |
167
- | 413 | PayloadTooLarge |
168
- | 414 | URITooLong |
169
- | 415 | UnsupportedMediaType |
170
- | 416 | RangeNotSatisfiable |
171
- | 417 | ExpectationFailed |
172
- | 418 | ImATeapot |
173
- | 421 | MisdirectedRequest |
174
- | 422 | UnprocessableEntity |
175
- | 423 | Locked |
176
- | 424 | FailedDependency |
177
- | 425 | TooEarly |
178
- | 426 | UpgradeRequired |
179
- | 428 | PreconditionRequired |
180
- | 429 | TooManyRequests |
181
- | 431 | RequestHeaderFieldsTooLarge |
182
- | 451 | UnavailableForLegalReasons |
183
- | 500 | InternalServerError |
184
- | 501 | NotImplemented |
185
- | 502 | BadGateway |
186
- | 503 | ServiceUnavailable |
187
- | 504 | GatewayTimeout |
188
- | 505 | HTTPVersionNotSupported |
189
- | 506 | VariantAlsoNegotiates |
190
- | 507 | InsufficientStorage |
191
- | 508 | LoopDetected |
192
- | 509 | BandwidthLimitExceeded |
193
- | 510 | NotExtended |
194
- | 511 | NetworkAuthenticationRequired |
195
-
196
- ---
197
-
198
- ## RequestValidator
199
-
200
- it's a middleware should be used after validating the request
201
- body/parameter/query using `express-validator` library
148
+ ## Tax
202
149
 
203
- ```js
204
- import { body } from 'express-validator'
205
- import { RequestValidator } from 'http-error-handling'
206
- import express, { NextFunction, Request, Response } from 'express'
207
- let app = express()
208
- //sample API
209
- app.get('/validate', body('email').isEmail(), RequestValidator, (req: Request, res: Response, next: NextFunction) => {
210
- return res.send(req.body)
211
- })
212
150
  ```
213
151
 
214
- ## License
215
-
216
- [MIT](LICENSE)
152
+ ## Properties
153
+
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;
@@ -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,9 +1,11 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
  export declare type CheckEmailBody = {
3
3
  email: string | null;
4
+ encryption_contract: Array<string>;
4
5
  };
5
6
  export declare type CheckBrandBody = {
6
7
  profile_name: string;
8
+ encryption_contract: Array<string>;
7
9
  };
8
10
  export declare type CheckIBanBody = {
9
11
  iban_number: string;
@@ -1,9 +1,8 @@
1
1
  import axios from 'axios';
2
2
  import { get, set } from 'lodash-es';
3
- import { ENCRYPTION_FLAG, ENDPOINT_PATHS } from '../constants';
3
+ import { ENCRYPTION_FLAG } from '../constants';
4
4
  import { encryptString } from '../utils';
5
5
  var instance = axios.create({
6
- baseURL: ENDPOINT_PATHS.BASE_URL,
7
6
  headers: {
8
7
  'Content-Type': 'application/json',
9
8
  'Access-Control-Allow-Headers': true
@@ -1,4 +1,4 @@
1
- import { setAxiosGlobalHeaders, removeAxiosGlobalHeaders } from './axios';
1
+ import axiosInstance, { setAxiosGlobalHeaders, removeAxiosGlobalHeaders } from './axios';
2
2
  import { ValidateOperatorBody } from './operator';
3
3
  import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody } from './auth';
4
4
  import { UpdateLeadBody, LeadVerifyBody, CreateLeadBody, LeadOTPVerifyBody, LeadIdentityUpdateBody } from './lead';
@@ -61,5 +61,5 @@ declare const API: {
61
61
  };
62
62
  };
63
63
  export type { ValidateOperatorBody, CreateAuthBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody };
64
- export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders };
64
+ export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance };
65
65
  export default API;
@@ -1,4 +1,4 @@
1
- import { setAxiosGlobalHeaders, removeAxiosGlobalHeaders } from './axios';
1
+ import axiosInstance, { setAxiosGlobalHeaders, removeAxiosGlobalHeaders } from './axios';
2
2
  import { ipService } from './ip';
3
3
  import { operatorService } from './operator';
4
4
  import { countryService } from './country';
@@ -23,5 +23,5 @@ var API = {
23
23
  dataService: dataService,
24
24
  individualService: individualService
25
25
  };
26
- export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders };
26
+ export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance };
27
27
  export default API;
@@ -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;
@@ -7,7 +7,6 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
7
7
  tax: import("../features/app/tax/taxStore").TaxState;
8
8
  individual: import("../features/app/individual/individualStore").IndividualState;
9
9
  password: import("../features/app/password/passwordStore").PasswordState;
10
- landing: import("../features/app/landing/landingStore").LandingState;
11
10
  }, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("redux-thunk").ThunkMiddleware<{
12
11
  settings: import("./settings").SettingsState;
13
12
  connect: import("../features/app/connect/connectStore").ConnectState;
@@ -16,7 +15,6 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
16
15
  tax: import("../features/app/tax/taxStore").TaxState;
17
16
  individual: import("../features/app/individual/individualStore").IndividualState;
18
17
  password: import("../features/app/password/passwordStore").PasswordState;
19
- landing: import("../features/app/landing/landingStore").LandingState;
20
18
  }, import("redux").AnyAction, undefined>]>>;
21
19
  export declare type AppDispatch = typeof store.dispatch;
22
20
  export declare type RootState = ReturnType<typeof store.getState>;
@@ -62,7 +62,7 @@ var BottomSheetComponent = function (_a) {
62
62
  var open = _a.open, children = _a.children, rest = __rest(_a, ["open", "children"]);
63
63
  var getMinHeight = function (maxHeight) {
64
64
  var element = document.getElementById('main-feature-container');
65
- var height = element ? element.clientHeight + 40 : 0;
65
+ var height = element ? element.clientHeight : 0;
66
66
  return height || maxHeight * 0.7;
67
67
  };
68
68
  return (_jsx(BottomSheetStyled, __assign({ open: open, snapPoints: function (_a) {
@@ -1,9 +1,14 @@
1
1
  import * as React from 'react';
2
2
  import { ButtonProps as MUIButtonProps } from '@mui/material/Button';
3
+ export interface ButtonStyledProps {
4
+ touched?: boolean;
5
+ outLineColor?: string;
6
+ }
3
7
  export interface ButtonProps extends MUIButtonProps {
8
+ outLineColor?: string;
4
9
  }
5
10
  declare const _default: React.MemoExoticComponent<{
6
- ({ children, startIcon, endIcon, ...rest }: ButtonProps): JSX.Element;
11
+ ({ children, startIcon, outLineColor, endIcon, ...rest }: ButtonProps): JSX.Element;
7
12
  defaultProps: {};
8
13
  }>;
9
14
  export default _default;
@@ -24,11 +24,33 @@ import { jsx as _jsx } from "react/jsx-runtime";
24
24
  import * as React from 'react';
25
25
  import Button from '@mui/material/Button';
26
26
  import { styled, alpha } from '@mui/material/styles';
27
- var ButtonStyled = styled(Button)(function (_a) {
28
- var theme = _a.theme;
27
+ var ButtonStyled = styled(Button, {
28
+ shouldForwardProp: function (prop) { return !['outLineColor', 'touched'].includes(prop.toString()); }
29
+ })(function (_a) {
30
+ var _b;
31
+ var theme = _a.theme, touched = _a.touched, outLineColor = _a.outLineColor;
29
32
  return ({
30
- color: theme.palette.common.white,
31
- backgroundColor: theme.palette.primary.main,
33
+ '&.MuiButton-contained': {
34
+ color: theme.palette.common.white,
35
+ backgroundColor: theme.palette.primary.main,
36
+ '&:hover': {
37
+ backgroundColor: theme.palette.primary.main
38
+ },
39
+ '&:active': {
40
+ backgroundColor: theme.palette.primary.main
41
+ },
42
+ ':disabled': {
43
+ backgroundColor: alpha(theme.palette.primary.main, 0.3),
44
+ borderColor: alpha(theme.palette.primary.main, 0.2),
45
+ color: theme.palette.common.white
46
+ },
47
+ '& .MuiButton-endIcon': {
48
+ margin: theme.spacing(0)
49
+ },
50
+ '& .MuiButton-startIcon': {
51
+ margin: theme.spacing(0)
52
+ }
53
+ },
32
54
  minHeight: theme.spacing(5.5),
33
55
  maxHeight: theme.spacing(5.5),
34
56
  borderRadius: theme.spacing(4.1),
@@ -36,28 +58,44 @@ var ButtonStyled = styled(Button)(function (_a) {
36
58
  lineHeight: 1.7,
37
59
  display: 'flex',
38
60
  justifyContent: 'space-between',
39
- '&:hover': {
40
- backgroundColor: theme.palette.primary.main
41
- },
42
- '&:active': {
43
- backgroundColor: theme.palette.primary.main
44
- },
45
- ':disabled': {
46
- backgroundColor: alpha(theme.palette.primary.main, 0.3),
47
- borderColor: alpha(theme.palette.primary.main, 0.2),
48
- color: theme.palette.common.white
49
- },
50
- '& .MuiButton-endIcon': {
51
- margin: theme.spacing(0)
52
- },
53
- '& .MuiButton-startIcon': {
54
- margin: theme.spacing(0)
55
- }
61
+ paddingInlineStart: theme.spacing(0.75),
62
+ textTransform: 'none',
63
+ '&.MuiButton-outlined': (_b = {
64
+ backgroundColor: theme.palette.common.white,
65
+ border: "1px solid ".concat(!!outLineColor ? outLineColor : theme.palette.primary.main),
66
+ color: !!outLineColor ? outLineColor : theme.palette.primary.main,
67
+ '&:hover': {
68
+ backgroundColor: !!outLineColor ? outLineColor : theme.palette.primary.main,
69
+ color: theme.palette.common.white,
70
+ img: {
71
+ filter: 'brightness(0) invert(1)'
72
+ }
73
+ }
74
+ },
75
+ _b[theme.breakpoints.down('sm')] = {
76
+ '&:hover': {
77
+ backgroundColor: touched
78
+ ? !!outLineColor
79
+ ? outLineColor
80
+ : theme.palette.primary.main
81
+ : theme.palette.common.white,
82
+ color: touched ? theme.palette.common.white : !!outLineColor ? outLineColor : theme.palette.primary.main,
83
+ img: {
84
+ filter: touched ? 'brightness(0) invert(1)' : 'none'
85
+ }
86
+ }
87
+ },
88
+ _b['&:disabled'] = {
89
+ backgroundColor: theme.palette.common.white,
90
+ color: alpha(!!outLineColor ? outLineColor : theme.palette.primary.main, 0.3)
91
+ },
92
+ _b)
56
93
  });
57
94
  });
58
95
  var ButtonComponent = function (_a) {
59
- var children = _a.children, startIcon = _a.startIcon, endIcon = _a.endIcon, rest = __rest(_a, ["children", "startIcon", "endIcon"]);
60
- return (_jsx(ButtonStyled, __assign({ startIcon: startIcon || _jsx("span", {}), endIcon: endIcon || _jsx("span", {}), disableFocusRipple: true, disableElevation: true, disableRipple: true, disableTouchRipple: true, fullWidth: true }, rest, { children: children })));
96
+ var children = _a.children, startIcon = _a.startIcon, outLineColor = _a.outLineColor, endIcon = _a.endIcon, rest = __rest(_a, ["children", "startIcon", "outLineColor", "endIcon"]);
97
+ var _b = React.useState(false), isTouched = _b[0], setIsTouched = _b[1];
98
+ return (_jsx(ButtonStyled, __assign({ onTouchStart: function () { return setIsTouched(true); }, touched: isTouched, outLineColor: outLineColor, variant: 'contained', startIcon: startIcon || _jsx("span", {}), endIcon: endIcon || _jsx("span", {}), disableFocusRipple: true, disableElevation: true, disableRipple: true, disableTouchRipple: true, fullWidth: true }, rest, { children: children })));
61
99
  };
62
100
  ButtonComponent.defaultProps = {};
63
101
  export default React.memo(ButtonComponent);
@@ -2,7 +2,6 @@ import * as React from 'react';
2
2
  import { BoxProps } from '@mui/material/Box';
3
3
  export interface FooterProps extends BoxProps {
4
4
  onSwitchLanguage: () => void;
5
- followUsTitle?: string;
6
5
  language?: string;
7
6
  countryName: string;
8
7
  countryFlag: string;
@@ -10,7 +9,6 @@ export interface FooterProps extends BoxProps {
10
9
  declare const _default: React.MemoExoticComponent<{
11
10
  ({ language, countryName, countryFlag, onSwitchLanguage, ...rest }: FooterProps): JSX.Element;
12
11
  defaultProps: {
13
- followUsTitle: string;
14
12
  language: string;
15
13
  };
16
14
  }>;
@@ -57,7 +57,6 @@ var FooterComponent = function (_a) {
57
57
  return (_jsxs(FooterStyled, __assign({}, rest, { children: [_jsx(IconStyled, { src: countryFlag }), _jsxs(TextStyled, { children: [" ", countryName, " "] }), _jsx(TextStyled, { children: " | " }), _jsx(LanguageTextStyled, __assign({ isAr: isAr, onClick: onSwitchLanguage }, { children: language }))] })));
58
58
  };
59
59
  FooterComponent.defaultProps = {
60
- followUsTitle: 'follow_us',
61
60
  language: 'language'
62
61
  };
63
62
  export default React.memo(FooterComponent);
@@ -1,5 +1,7 @@
1
1
  export declare const ENDPOINT_PATHS: {
2
- BASE_URL: string;
2
+ SANDBOX_BASE_URL: string;
3
+ PRODUCTION_BASE_URL: string;
4
+ DEV_BASE_URL: string;
3
5
  BUSINESS_COUNTRIES: string;
4
6
  COUNTRIES: string;
5
7
  IP: string;
@@ -1,4 +1,6 @@
1
- var API_BASE_URL = 'https://connect-mw.sandbox.tap.company/middleware';
1
+ var SANDBOX_BASE_URL = 'https://connect-mw.sandbox.tap.company/middleware';
2
+ var PRODUCTION_BASE_URL = 'https://connect-mw.tap.company/middleware';
3
+ var DEV_BASE_URL = 'https://connect-mw.dev.tap.company/middleware';
2
4
  var API_BUSINESS_COUNTRIES = 'https://godata.sandbox.tap.company/api/v1/business/country/list';
3
5
  var API_COUNTRIES = 'https://utilities.tap.company/api/v1/country/list';
4
6
  var IP_PATH = '/ip';
@@ -24,7 +26,9 @@ var MONTHLY_INCOME_PATH = '/v2/monthlyIncome';
24
26
  var BRAND_LIST_PATH = '/brand/list';
25
27
  var FIREBASE_URL = 'https://goconnect-195cd-default-rtdb.asia-southeast1.firebasedatabase.app/locale.json';
26
28
  export var ENDPOINT_PATHS = {
27
- BASE_URL: API_BASE_URL,
29
+ SANDBOX_BASE_URL: SANDBOX_BASE_URL,
30
+ PRODUCTION_BASE_URL: PRODUCTION_BASE_URL,
31
+ DEV_BASE_URL: DEV_BASE_URL,
28
32
  BUSINESS_COUNTRIES: API_BUSINESS_COUNTRIES,
29
33
  COUNTRIES: API_COUNTRIES,
30
34
  IP: IP_PATH,
@@ -18,7 +18,6 @@ export declare const INDIVIDUAL_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
18
18
  export declare const PASSWORD_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
19
19
  export declare const BANK_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
20
20
  export declare const TAX_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
21
- export declare const LANDING_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
22
21
  export declare const DefaultDeviceInfo: {
23
22
  source: string;
24
23
  device: {
@@ -210,14 +210,6 @@ export var TAX_SCREENS_NAVIGATION = [
210
210
  order: 4
211
211
  }
212
212
  ];
213
- export var LANDING_SCREENS_NAVIGATION = [
214
- {
215
- name: 'LANDING_VERIFY_AND_REDIRECT_STEP',
216
- next: '',
217
- prev: '',
218
- order: 1
219
- }
220
- ];
221
213
  export var DefaultDeviceInfo = {
222
214
  source: 'browser',
223
215
  device: {
@@ -1,11 +1,14 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { BankFormValues, OTPFormValues, ResponseData, SharedState } from '../../../@types';
2
+ import { BankFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
3
3
  import { CancelToken } from 'axios';
4
4
  export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
5
5
  data: any;
6
6
  leadData: any;
7
7
  token: string;
8
8
  }, string, {}>;
9
+ export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
10
+ data: any;
11
+ }, void, {}>;
9
12
  export declare const verifyBankLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
10
13
  data: any;
11
14
  formData: OTPFormValues;
@@ -35,6 +38,7 @@ export interface BankData {
35
38
  verify: ResponseData & VerifyData;
36
39
  otpData: OTPFormValues & ResponseData;
37
40
  bankData: BankFormValues & ResponseData;
41
+ flowName: FlowsTypes;
38
42
  }
39
43
  export interface BankState extends SharedState<BankData> {
40
44
  }