@tap-payments/auth-jsconnect 2.0.1 → 2.0.4

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 (76) hide show
  1. package/build/@types/app.d.ts +5 -0
  2. package/build/@types/form.d.ts +2 -1
  3. package/build/api/auth.d.ts +20 -3
  4. package/build/api/axios.js +8 -9
  5. package/build/api/data.d.ts +1 -0
  6. package/build/api/data.js +9 -2
  7. package/build/api/entity.d.ts +5 -1
  8. package/build/api/entity.js +11 -2
  9. package/build/api/index.d.ts +6 -4
  10. package/build/api/lead.d.ts +2 -1
  11. package/build/api/lead.js +14 -2
  12. package/build/components/AnimationFlow/AnimationFlow.d.ts +2 -1
  13. package/build/components/AnimationFlow/AnimationFlow.js +2 -2
  14. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  15. package/build/components/AnimationFlow/BottomSheet.js +16 -4
  16. package/build/constants/api.d.ts +2 -1
  17. package/build/constants/api.js +5 -3
  18. package/build/constants/app.d.ts +5 -0
  19. package/build/constants/app.js +21 -5
  20. package/build/features/app/bank/bankStore.js +17 -10
  21. package/build/features/app/business/businessStore.d.ts +3 -5
  22. package/build/features/app/business/businessStore.js +140 -48
  23. package/build/features/app/connect/connectStore.d.ts +5 -10
  24. package/build/features/app/connect/connectStore.js +117 -25
  25. package/build/features/app/individual/individualStore.d.ts +3 -2
  26. package/build/features/app/individual/individualStore.js +42 -30
  27. package/build/features/app/password/passwordStore.d.ts +29 -1
  28. package/build/features/app/password/passwordStore.js +194 -14
  29. package/build/features/app/tax/taxStore.js +19 -12
  30. package/build/features/bank/Bank.js +3 -4
  31. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -4
  32. package/build/features/business/Business.js +3 -4
  33. package/build/features/business/screens/Activities/Activities.js +1 -1
  34. package/build/features/business/screens/IDBOD/IDBOD.js +1 -1
  35. package/build/features/business/screens/OTP/OTPInput.js +3 -9
  36. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +17 -6
  37. package/build/features/connect/Connect.js +1 -1
  38. package/build/features/connect/screens/Mobile/Mobile.js +2 -2
  39. package/build/features/connect/screens/Mobile/MobileNumber.js +1 -1
  40. package/build/features/connect/screens/NID/IDNumber.js +1 -1
  41. package/build/features/connect/screens/NID/NID.js +2 -2
  42. package/build/features/connect/screens/OTP/OTPInput.js +3 -13
  43. package/build/features/featuresScreens.js +5 -0
  44. package/build/features/individual/Individual.js +3 -4
  45. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +7 -1
  46. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +10 -0
  47. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +89 -0
  48. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +3 -0
  49. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +1 -0
  50. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -4
  51. package/build/features/password/Password.js +11 -6
  52. package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -2
  53. package/build/features/password/screens/OTP/OTP.d.ts +8 -0
  54. package/build/features/password/screens/OTP/OTP.js +78 -0
  55. package/build/features/password/screens/OTP/OTPInput.d.ts +5 -0
  56. package/build/features/password/screens/OTP/OTPInput.js +46 -0
  57. package/build/features/password/screens/OTP/index.d.ts +3 -0
  58. package/build/features/password/screens/OTP/index.js +2 -0
  59. package/build/features/password/screens/OTP/validation.d.ts +8 -0
  60. package/build/features/password/screens/OTP/validation.js +4 -0
  61. package/build/features/password/screens/Success/Success.js +8 -2
  62. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +17 -5
  63. package/build/features/password/screens/Verify/OTPInput.d.ts +2 -2
  64. package/build/features/password/screens/Verify/OTPInput.js +1 -1
  65. package/build/features/shared/Button/FlowsButtons.d.ts +8 -2
  66. package/build/features/shared/Button/FlowsButtons.js +92 -5
  67. package/build/features/shared/Button/SuccessButton.js +17 -13
  68. package/build/features/tax/Tax.js +3 -4
  69. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -4
  70. package/build/hooks/useAppTheme.js +3 -2
  71. package/build/index.css +4 -0
  72. package/build/theme/theme.d.ts +1 -1
  73. package/build/theme/theme.js +1 -2
  74. package/build/utils/string.d.ts +1 -0
  75. package/build/utils/string.js +4 -0
  76. package/package.json +1 -1
@@ -90,6 +90,11 @@ export interface SourceOfIncome {
90
90
  name_ar: string;
91
91
  name_en: string;
92
92
  }
93
+ export interface Occupation {
94
+ id: string;
95
+ name_ar: string;
96
+ name_en: string;
97
+ }
93
98
  export interface MonthlyIncome extends SourceOfIncome {
94
99
  }
95
100
  export interface AppInfo {
@@ -1,4 +1,4 @@
1
- import { Activity, BrandInfo, CountryCode, CustomerLocation, ExpectedCustomer, ExpectedSaleRange, License, MonthlyIncome, SalesChannel, SourceOfIncome } from './app';
1
+ import { Activity, BrandInfo, CountryCode, CustomerLocation, ExpectedCustomer, ExpectedSaleRange, License, MonthlyIncome, Occupation, SalesChannel, SourceOfIncome } from './app';
2
2
  export declare type MobileFormValues = {
3
3
  mobile: string | null;
4
4
  countryCode: CountryCode;
@@ -56,6 +56,7 @@ export declare type TaxFormValues = {
56
56
  confirmPolicy: false;
57
57
  };
58
58
  export declare type IndividualExtraFormValues = {
59
+ occupation: Occupation | undefined;
59
60
  sourceIncome: SourceOfIncome | undefined;
60
61
  monthlyIncome: MonthlyIncome | undefined;
61
62
  employerName: string;
@@ -15,8 +15,10 @@ export declare type IDCredential = {
15
15
  };
16
16
  export declare type CreateAuthBody = {
17
17
  user_credentail: MobileCredential | EmailCredential | IDCredential;
18
- sign_in: boolean;
19
- step_name: string;
18
+ auth_type?: number;
19
+ email_url?: string;
20
+ sign_in?: boolean;
21
+ step_name?: string;
20
22
  encryption_contract: Array<string>;
21
23
  lang?: LanguageMode;
22
24
  };
@@ -33,6 +35,21 @@ export declare type VerifyAuthBody = {
33
35
  remember_me?: boolean;
34
36
  scopes?: Array<string>;
35
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
+ };
36
53
  export declare type CreatePasswordBody = {
37
54
  password: string;
38
55
  signup_token?: string;
@@ -41,7 +58,7 @@ export declare type CreatePasswordBody = {
41
58
  };
42
59
  declare const authService: {
43
60
  createAuth: (data: CreateAuthBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
44
- verifyAuth: (data: VerifyAuthBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
61
+ verifyAuth: (data: VerifyAuthBody | VerifyOperationAuthBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
45
62
  createPassword: (data: CreatePasswordBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
46
63
  };
47
64
  export { authService };
@@ -79,8 +79,7 @@ export var removeAxiosGlobalHeaders = function (arr) {
79
79
  });
80
80
  };
81
81
  export var httpClient = function (config) { return __awaiter(void 0, void 0, void 0, function () {
82
- var data, description, error_1, response, data, description;
83
- var _a, _b;
82
+ var data, _a, description, error, err_1, response, data, _b, description, error;
84
83
  return __generator(this, function (_c) {
85
84
  switch (_c.label) {
86
85
  case 0:
@@ -88,19 +87,19 @@ export var httpClient = function (config) { return __awaiter(void 0, void 0, voi
88
87
  return [4, instance(config)];
89
88
  case 1:
90
89
  data = (_c.sent()).data;
91
- if (data.errors && Array.isArray(data.errors)) {
92
- description = ((_a = data.errors) === null || _a === void 0 ? void 0 : _a[0]).description;
93
- throw new Error(description);
90
+ _a = (data.errors || [{}])[0], description = _a.description, error = _a.error;
91
+ if (description || error) {
92
+ throw new Error(description, error);
94
93
  }
95
94
  return [2, data];
96
95
  case 2:
97
- error_1 = _c.sent();
98
- response = error_1.response;
96
+ err_1 = _c.sent();
97
+ response = err_1.response;
99
98
  data = (response || {}).data;
100
99
  if (typeof data === 'string')
101
100
  throw new Error(data);
102
- description = (((_b = data.errors) === null || _b === void 0 ? void 0 : _b[0]) || {}).description;
103
- throw new Error(description || 'Something went wrong');
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');
104
103
  case 3: return [2];
105
104
  }
106
105
  });
@@ -5,5 +5,6 @@ declare const dataService: {
5
5
  getExpectedCustomerSales: () => Promise<import("axios").AxiosResponse<any, any>>;
6
6
  getSourceOfIncome: () => Promise<import("axios").AxiosResponse<any, any>>;
7
7
  getMonthlyIncome: (countryCode: string) => Promise<import("axios").AxiosResponse<any, any>>;
8
+ getOccupation: () => Promise<any>;
8
9
  };
9
10
  export { dataService };
package/build/api/data.js CHANGED
@@ -1,4 +1,4 @@
1
- import instance from './axios';
1
+ import instance, { httpClient } from './axios';
2
2
  import { ENDPOINT_PATHS } from '../constants';
3
3
  var getChannelsOfServices = function () {
4
4
  return instance.get("".concat(ENDPOINT_PATHS.CHANNEL));
@@ -18,12 +18,19 @@ var getSourceOfIncome = function () {
18
18
  var getMonthlyIncome = function (countryCode) {
19
19
  return instance.get("".concat(ENDPOINT_PATHS.MONTHLY_INCOME, "/").concat(countryCode));
20
20
  };
21
+ var getOccupation = function () {
22
+ return httpClient({
23
+ method: 'get',
24
+ url: "".concat(ENDPOINT_PATHS.OCCUPATION)
25
+ });
26
+ };
21
27
  var dataService = {
22
28
  getChannelsOfServices: getChannelsOfServices,
23
29
  getCustomerBases: getCustomerBases,
24
30
  getExpectedSales: getExpectedSales,
25
31
  getExpectedCustomerSales: getExpectedCustomerSales,
26
32
  getSourceOfIncome: getSourceOfIncome,
27
- getMonthlyIncome: getMonthlyIncome
33
+ getMonthlyIncome: getMonthlyIncome,
34
+ getOccupation: getOccupation
28
35
  };
29
36
  export { dataService };
@@ -12,11 +12,13 @@ export declare type EntityInfoBody = {
12
12
  agree_chargeback?: boolean;
13
13
  agree_refund?: boolean;
14
14
  employer_name?: string;
15
- employer_city?: string | null;
15
+ employer_country?: string | null;
16
16
  source_income?: Array<string | undefined>;
17
17
  actual_income?: string;
18
18
  is_relative_PEP?: boolean | null;
19
19
  is_influencer?: boolean | null;
20
+ is_vat_acknowledged?: boolean;
21
+ occupation?: string;
20
22
  step_name: string;
21
23
  encryption_contract?: Array<string>;
22
24
  };
@@ -30,6 +32,7 @@ export declare type EntityBankUpdateBody = {
30
32
  swift_code?: string;
31
33
  account_number?: string;
32
34
  };
35
+ is_acknowledged: boolean;
33
36
  step_name: string;
34
37
  encryption_contract?: Array<string>;
35
38
  };
@@ -38,5 +41,6 @@ declare const entityService: {
38
41
  updateEntityInfo: ({ id, ...data }: EntityInfoBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
39
42
  createBankAccount: (data: EntityBankUpdateBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
40
43
  retrieveEntityInfo: (entity_id: string, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
44
+ updateIndividualInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
41
45
  };
42
46
  export { entityService };
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { ENDPOINT_PATHS } from '../constants';
13
- import instance from './axios';
13
+ import instance, { httpClient } from './axios';
14
14
  var retrieveEntityInfo = function (entity_id, config) {
15
15
  return instance.get("".concat(ENDPOINT_PATHS.ENTITY, "/").concat(entity_id), config);
16
16
  };
@@ -25,10 +25,19 @@ var updateEntityInfo = function (_a, config) {
25
25
  var createBankAccount = function (data, config) {
26
26
  return instance.post("".concat(ENDPOINT_PATHS.BANK), data, config);
27
27
  };
28
+ var updateIndividualInfo = function (_a) {
29
+ var id = _a.id, data = __rest(_a, ["id"]);
30
+ return httpClient({
31
+ method: 'put',
32
+ url: "".concat(ENDPOINT_PATHS.INDIVIDUAL, "/").concat(id, "/info"),
33
+ data: data
34
+ });
35
+ };
28
36
  var entityService = {
29
37
  createEntityInfo: createEntityInfo,
30
38
  updateEntityInfo: updateEntityInfo,
31
39
  createBankAccount: createBankAccount,
32
- retrieveEntityInfo: retrieveEntityInfo
40
+ retrieveEntityInfo: retrieveEntityInfo,
41
+ updateIndividualInfo: updateIndividualInfo
33
42
  };
34
43
  export { entityService };
@@ -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';
@@ -18,7 +18,7 @@ declare const API: {
18
18
  };
19
19
  authService: {
20
20
  createAuth: (data: CreateAuthBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
21
- 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>>;
22
22
  createPassword: (data: CreatePasswordBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
23
23
  };
24
24
  leadService: {
@@ -27,7 +27,7 @@ declare const API: {
27
27
  retrieveLead: (leadId: string) => Promise<import("axios").AxiosResponse<any, any>>;
28
28
  verifyLeadToken: (data: LeadVerifyBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
29
29
  verifyLeadOTP: (data: LeadOTPVerifyBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
30
- updateLeadIdentity: (data: LeadIdentityUpdateBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
30
+ updateLeadIdentity: ({ id, ...data }: LeadIdentityUpdateBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
31
31
  retrieveEntityList: (leadId: string) => Promise<import("axios").AxiosResponse<any, any>>;
32
32
  };
33
33
  entityService: {
@@ -35,6 +35,7 @@ declare const API: {
35
35
  updateEntityInfo: ({ id, ...data }: EntityInfoBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
36
36
  createBankAccount: (data: EntityBankUpdateBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
37
37
  retrieveEntityInfo: (entity_id: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
38
+ updateIndividualInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
38
39
  };
39
40
  availabilityServices: {
40
41
  checkEmail: (data: CheckEmailBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -54,11 +55,12 @@ declare const API: {
54
55
  getExpectedCustomerSales: () => Promise<import("axios").AxiosResponse<any, any>>;
55
56
  getSourceOfIncome: () => Promise<import("axios").AxiosResponse<any, any>>;
56
57
  getMonthlyIncome: (countryCode: string) => Promise<import("axios").AxiosResponse<any, any>>;
58
+ getOccupation: () => Promise<any>;
57
59
  };
58
60
  individualService: {
59
61
  getBrandList: (data: BrandListBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
60
62
  };
61
63
  };
62
- export type { ValidateOperatorBody, CreateAuthBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody };
64
+ export type { ValidateOperatorBody, CreateAuthBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody };
63
65
  export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance };
64
66
  export default API;
@@ -77,6 +77,7 @@ export declare type CreateLeadBody = {
77
77
  country_code: string;
78
78
  };
79
79
  export declare type LeadIdentityUpdateBody = {
80
+ id: string;
80
81
  country_code: string;
81
82
  identification_id: string;
82
83
  identification_id_type: string;
@@ -90,7 +91,7 @@ declare const leadService: {
90
91
  retrieveLead: (leadId: string) => Promise<import("axios").AxiosResponse<any, any>>;
91
92
  verifyLeadToken: (data: LeadVerifyBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
92
93
  verifyLeadOTP: (data: LeadOTPVerifyBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
93
- updateLeadIdentity: (data: LeadIdentityUpdateBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
94
+ updateLeadIdentity: ({ id, ...data }: LeadIdentityUpdateBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
94
95
  retrieveEntityList: (leadId: string) => Promise<import("axios").AxiosResponse<any, any>>;
95
96
  };
96
97
  export { leadService };
package/build/api/lead.js CHANGED
@@ -1,3 +1,14 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import instance from './axios';
2
13
  import { ENDPOINT_PATHS } from '../constants';
3
14
  var createLead = function (data, config) {
@@ -15,8 +26,9 @@ var verifyLeadToken = function (data, config) {
15
26
  var verifyLeadOTP = function (data, config) {
16
27
  return instance.put("".concat(ENDPOINT_PATHS.LEAD_IDENTITY_VERIFY), data, config);
17
28
  };
18
- var updateLeadIdentity = function (data, config) {
19
- return instance.put("".concat(ENDPOINT_PATHS.LEAD_IDENTITY), data, config);
29
+ var updateLeadIdentity = function (_a, config) {
30
+ var id = _a.id, data = __rest(_a, ["id"]);
31
+ return instance.put("".concat(ENDPOINT_PATHS.LEAD, "/").concat(id, "/identity"), data, config);
20
32
  };
21
33
  var retrieveEntityList = function (leadId) {
22
34
  return instance.get("".concat(ENDPOINT_PATHS.RETRIEVE_ENTITY_LIST, "/").concat(leadId));
@@ -8,5 +8,6 @@ export interface AnimationFlowProps {
8
8
  breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
9
9
  loading?: boolean;
10
10
  error?: string | null;
11
+ screenId?: string;
11
12
  }
12
- export default function AnimationFlow({ open, children, breakpoint, type, footer, loading, error, isTapOrigin }: AnimationFlowProps): JSX.Element;
13
+ export default function AnimationFlow({ open, children, breakpoint, type, footer, loading, error, isTapOrigin, screenId }: AnimationFlowProps): JSX.Element;
@@ -17,7 +17,7 @@ import BottomSheet from './BottomSheet';
17
17
  import Loader from './Loader';
18
18
  import Error from './Error';
19
19
  export default function AnimationFlow(_a) {
20
- var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, footer = _a.footer, loading = _a.loading, error = _a.error, isTapOrigin = _a.isTapOrigin;
20
+ var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, footer = _a.footer, loading = _a.loading, error = _a.error, isTapOrigin = _a.isTapOrigin, screenId = _a.screenId;
21
21
  var theme = useTheme();
22
22
  var matches = useMediaQuery(theme.breakpoints.down(breakpoint || 'sm'));
23
23
  if (loading) {
@@ -32,5 +32,5 @@ export default function AnimationFlow(_a) {
32
32
  if (type === 'BOTTOMSHEET') {
33
33
  return _jsx(BottomSheet, __assign({ open: open }, { children: children }));
34
34
  }
35
- return matches ? (_jsx(BottomSheet, __assign({ open: open }, { children: children }))) : (_jsx(Dialog, __assign({ open: open, footer: footer, isTapOrigin: isTapOrigin }, { children: children })));
35
+ return matches ? (_jsx(BottomSheet, __assign({ open: open, screenId: screenId }, { children: children }))) : (_jsx(Dialog, __assign({ open: open, footer: footer, isTapOrigin: isTapOrigin }, { children: children })));
36
36
  }
@@ -4,6 +4,7 @@ import 'react-spring-bottom-sheet/dist/style.css';
4
4
  export interface BottomSheetProps extends MainBottomSheetProps {
5
5
  children: React.ReactNode;
6
6
  open: boolean;
7
+ screenId?: string;
7
8
  }
8
- declare const _default: React.MemoExoticComponent<({ open, children, ...rest }: BottomSheetProps) => JSX.Element>;
9
+ declare const _default: React.MemoExoticComponent<({ open, children, screenId, ...rest }: BottomSheetProps) => JSX.Element>;
9
10
  export default _default;
@@ -59,13 +59,25 @@ var BottomSheetStyled = styled(BottomSheet)(function (_a) {
59
59
  });
60
60
  });
61
61
  var BottomSheetComponent = function (_a) {
62
- var open = _a.open, children = _a.children, rest = __rest(_a, ["open", "children"]);
62
+ var open = _a.open, children = _a.children, screenId = _a.screenId, rest = __rest(_a, ["open", "children", "screenId"]);
63
+ var sheetRef = React.useRef(null);
63
64
  var getMinHeight = function (maxHeight) {
64
- var element = document.getElementById('main-feature-container');
65
- var height = element ? element.clientHeight : 0;
65
+ var el = document.getElementById('main-feature-container');
66
+ var height = el ? el.clientHeight : 0;
66
67
  return height || maxHeight * 0.7;
67
68
  };
68
- return (_jsx(BottomSheetStyled, __assign({ open: open, snapPoints: function (_a) {
69
+ React.useEffect(function () {
70
+ if (sheetRef.current && screenId) {
71
+ setTimeout(function () {
72
+ var _a, _b;
73
+ (_b = (_a = sheetRef === null || sheetRef === void 0 ? void 0 : sheetRef.current) === null || _a === void 0 ? void 0 : _a.snapTo) === null || _b === void 0 ? void 0 : _b.call(_a, function (_a) {
74
+ var maxHeight = _a.maxHeight;
75
+ return getMinHeight(maxHeight);
76
+ });
77
+ }, 500);
78
+ }
79
+ }, [screenId]);
80
+ return (_jsx(BottomSheetStyled, __assign({ ref: sheetRef, open: open, snapPoints: function (_a) {
69
81
  var maxHeight = _a.maxHeight;
70
82
  return [getMinHeight(maxHeight), maxHeight * 0.95];
71
83
  } }, rest, { children: children })));
@@ -8,7 +8,6 @@ export declare const ENDPOINT_PATHS: {
8
8
  OPERATOR: string;
9
9
  AUTH: string;
10
10
  LEAD: string;
11
- LEAD_IDENTITY: string;
12
11
  LEAD_IDENTITY_VERIFY: string;
13
12
  RETRIEVE_ENTITY_LIST: string;
14
13
  ENTITY: string;
@@ -26,4 +25,6 @@ export declare const ENDPOINT_PATHS: {
26
25
  BANK: string;
27
26
  IBAN_BANK: string;
28
27
  BRAND_LIST: string;
28
+ OCCUPATION: string;
29
+ INDIVIDUAL: string;
29
30
  };
@@ -7,10 +7,10 @@ var IP_PATH = '/ip';
7
7
  var OPERATOR_PATH = '/operator';
8
8
  var AUTH_PATH = '/auth';
9
9
  var LEAD_PATH = '/lead';
10
- var LEAD_IDENTITY_PATH = '/lead/identity';
11
10
  var LEAD_IDENTITY_VERIFY_PATH = 'lead/identity/verify';
12
11
  var RETRIEVE_ENTITY_LIST_PATH = '/lead/entity/list';
13
12
  var ENTITY_PATH = '/entity';
13
+ var INDIVIDUAL_PATH = '/individual';
14
14
  var BANK_PATH = '/entity/bankaccount';
15
15
  var IBAN_PATH = '/iban';
16
16
  var CHECK_EMAIL = '/lead/identity/emailcheck';
@@ -23,6 +23,7 @@ var EXPECTED_CUSTOMERS_PATH = '/v2/expectedCustomers';
23
23
  var SIGNUP_PATH = '/signup';
24
24
  var SOURCE_INCOME_PATH = '/v2/sourceOfIncome';
25
25
  var MONTHLY_INCOME_PATH = '/v2/monthlyIncome';
26
+ var OCCUPATION_PATH = '/v2/occupation';
26
27
  var BRAND_LIST_PATH = '/brand/list';
27
28
  var FIREBASE_URL = 'https://goconnect-195cd-default-rtdb.asia-southeast1.firebasedatabase.app/locale.json';
28
29
  export var ENDPOINT_PATHS = {
@@ -35,7 +36,6 @@ export var ENDPOINT_PATHS = {
35
36
  OPERATOR: OPERATOR_PATH,
36
37
  AUTH: AUTH_PATH,
37
38
  LEAD: LEAD_PATH,
38
- LEAD_IDENTITY: LEAD_IDENTITY_PATH,
39
39
  LEAD_IDENTITY_VERIFY: LEAD_IDENTITY_VERIFY_PATH,
40
40
  RETRIEVE_ENTITY_LIST: RETRIEVE_ENTITY_LIST_PATH,
41
41
  ENTITY: ENTITY_PATH,
@@ -52,5 +52,7 @@ export var ENDPOINT_PATHS = {
52
52
  MONTHLY_INCOME: MONTHLY_INCOME_PATH,
53
53
  BANK: BANK_PATH,
54
54
  IBAN_BANK: IBAN_PATH,
55
- BRAND_LIST: BRAND_LIST_PATH
55
+ BRAND_LIST: BRAND_LIST_PATH,
56
+ OCCUPATION: OCCUPATION_PATH,
57
+ INDIVIDUAL: INDIVIDUAL_PATH
56
58
  };
@@ -110,6 +110,7 @@ export declare const PASSWORD_STEP_NAMES: {
110
110
  PHONE_AUTH: string;
111
111
  PASSWORD_CREATE: string;
112
112
  PASSWORD_SUCCESS: string;
113
+ RESET_PASSWORD: string;
113
114
  };
114
115
  export declare const RSA_FRONTEND_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgC9kH1SQvjbXAUXd0PbrDUG8P\nLhRig9pJNBmdQBZjihuaxfkzYu6ToMbIMAfmYgVgQw338/y7aQ8X3m03CXNIlkxo\nOwxKCA8ymKsZQptXJn9IxlPO7yjoFgTFBrpmTgvcC4XO1uoUYTAPq3szK8kj4zgT\nucWG1hSKsOdRU7sl/wIDAQAB\n-----END PUBLIC KEY-----";
115
116
  export declare const ENCRYPTION_FLAG = "encryption_contract";
@@ -136,3 +137,7 @@ export declare const OTHER_CR_LICENSE: {
136
137
  };
137
138
  type: BusinessType;
138
139
  };
140
+ export declare const PASSWORD_OPERATION_TYPE: {
141
+ SET_PASSWORD: string;
142
+ RESET_PASSWORD: string;
143
+ };
@@ -53,7 +53,12 @@ export var CONNECT_SCREENS_NAVIGATION = [
53
53
  export var BUSINESS_SCREENS_NAVIGATION = [
54
54
  {
55
55
  name: 'BUSINESS_VERIFY_STEP',
56
- next: ['BUSINESS_IDBOD_STEP', 'BUSINESS_BUSINESS_TYPE_STEP', 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'],
56
+ next: [
57
+ 'BUSINESS_IDBOD_STEP',
58
+ 'BUSINESS_BUSINESS_TYPE_STEP',
59
+ 'BUSINESS_ACTIVITIES_STEP',
60
+ 'BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'
61
+ ],
57
62
  prev: '',
58
63
  order: 1
59
64
  },
@@ -141,21 +146,27 @@ export var PASSWORD_SCREENS_NAVIGATION = [
141
146
  },
142
147
  {
143
148
  name: 'PASSWORD_CREATE_PASSWORD_STEP',
144
- next: 'PASSWORD_SUCCESS_STEP',
149
+ next: ['PASSWORD_SUCCESS_STEP', 'PASSWORD_RESET_PASSWORD_OTP_STEP'],
145
150
  prev: '',
146
151
  order: 2
147
152
  },
153
+ {
154
+ name: 'PASSWORD_RESET_PASSWORD_OTP_STEP',
155
+ next: 'PASSWORD_SUCCESS_STEP',
156
+ prev: 'PASSWORD_CREATE_PASSWORD_STEP',
157
+ order: 3
158
+ },
148
159
  {
149
160
  name: 'PASSWORD_SUCCESS_STEP',
150
161
  next: 'PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
151
162
  prev: 'PASSWORD_CREATE_PASSWORD_STEP',
152
- order: 3
163
+ order: 4
153
164
  },
154
165
  {
155
166
  name: 'PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP',
156
167
  next: '',
157
168
  prev: '',
158
- order: 4
169
+ order: 5
159
170
  }
160
171
  ];
161
172
  export var BANK_SCREENS_NAVIGATION = [
@@ -301,7 +312,8 @@ export var PASSWORD_STEP_NAMES = {
301
312
  PASSWORD_INFO: 'password_info',
302
313
  PHONE_AUTH: 'password_phone_auth',
303
314
  PASSWORD_CREATE: 'password_create',
304
- PASSWORD_SUCCESS: 'password_completed'
315
+ PASSWORD_SUCCESS: 'password_completed',
316
+ RESET_PASSWORD: 'reset_password'
305
317
  };
306
318
  export var RSA_FRONTEND_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgC9kH1SQvjbXAUXd0PbrDUG8P\nLhRig9pJNBmdQBZjihuaxfkzYu6ToMbIMAfmYgVgQw338/y7aQ8X3m03CXNIlkxo\nOwxKCA8ymKsZQptXJn9IxlPO7yjoFgTFBrpmTgvcC4XO1uoUYTAPq3szK8kj4zgT\nucWG1hSKsOdRU7sl/wIDAQAB\n-----END PUBLIC KEY-----";
307
319
  export var ENCRYPTION_FLAG = 'encryption_contract';
@@ -328,3 +340,7 @@ export var OTHER_CR_LICENSE = {
328
340
  },
329
341
  type: BusinessType.CR
330
342
  };
343
+ export var PASSWORD_OPERATION_TYPE = {
344
+ SET_PASSWORD: 'set_password',
345
+ RESET_PASSWORD: 'reset_password'
346
+ };
@@ -50,9 +50,9 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import API from '../../../api';
51
51
  import { FlowsTypes } from '../../../@types';
52
52
  import { hasKey } from '../../../utils';
53
- import { handleNextScreenStep } from '../../../app/settings';
53
+ import { handleCurrentActiveScreen, handleNextScreenStep } from '../../../app/settings';
54
54
  import { BANK_STEP_NAMES } from '../../../constants';
55
- export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
55
+ export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
56
56
  var payload, data, leadResponse, _a, steps, entity, hasCompleted;
57
57
  return __generator(this, function (_b) {
58
58
  switch (_b.label) {
@@ -65,24 +65,28 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
65
65
  case 1:
66
66
  data = (_b.sent()).data;
67
67
  leadResponse = undefined;
68
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 5];
68
+ if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 6];
69
69
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
70
70
  case 2:
71
71
  leadResponse = _b.sent();
72
72
  _a = leadResponse.data, steps = _a.steps, entity = _a.entity;
73
73
  hasCompleted = hasKey(steps, BANK_STEP_NAMES.BANK_SUCCESS);
74
- if (!hasCompleted) return [3, 4];
75
- return [4, thunkApi.dispatch(retrieveEntityInfo(entity === null || entity === void 0 ? void 0 : entity.id))];
74
+ if (!(data.step_name === BANK_STEP_NAMES.PHONE_AUTH)) return [3, 3];
75
+ thunkApi.dispatch(handleCurrentActiveScreen('BANK_VERIFY_STEP'));
76
+ return [3, 6];
76
77
  case 3:
78
+ if (!hasCompleted) return [3, 5];
79
+ return [4, thunkApi.dispatch(retrieveEntityInfo(entity === null || entity === void 0 ? void 0 : entity.id))];
80
+ case 4:
77
81
  _b.sent();
78
82
  thunkApi.dispatch(handleNextScreenStep('BANK_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
79
- return [3, 5];
80
- case 4:
83
+ return [3, 6];
84
+ case 5:
81
85
  if (data.step_name === BANK_STEP_NAMES.BANK_INFO) {
82
86
  thunkApi.dispatch(handleNextScreenStep('BANK_BANK_DETAILS_STEP'));
83
87
  }
84
- _b.label = 5;
85
- case 5: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
88
+ _b.label = 6;
89
+ case 6: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
86
90
  }
87
91
  });
88
92
  }); });
@@ -161,6 +165,7 @@ export var createBankAccount = createAsyncThunk('createBankAccount', function (p
161
165
  bank_name = params.bankName;
162
166
  requestBody = {
163
167
  wallet_id: (_b = bank.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.merchant_wallet_id,
168
+ is_acknowledged: params.confirmPolicy,
164
169
  bank_account: {
165
170
  iban: iban,
166
171
  beneficiary_name: beneficiaryName,
@@ -219,13 +224,15 @@ export var updateLeadSuccess = createAsyncThunk('updateLeadBankSuccess', functio
219
224
  return [4, API.leadService.updateLead(payload)];
220
225
  case 1:
221
226
  data = (_g.sent()).data;
227
+ if (!!data.errors) return [3, 3];
222
228
  return [4, thunkApi.dispatch(retrieveEntityInfo((_b = data.entity) === null || _b === void 0 ? void 0 : _b.id))];
223
229
  case 2:
224
230
  _g.sent();
225
231
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, params);
226
232
  (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
227
233
  thunkApi.dispatch(handleNextScreenStep());
228
- return [2, { response: data, formData: params }];
234
+ _g.label = 3;
235
+ case 3: return [2, { response: data, formData: params }];
229
236
  }
230
237
  });
231
238
  }); });
@@ -21,11 +21,10 @@ export declare const updateLeadIdentity: import("@reduxjs/toolkit").AsyncThunk<{
21
21
  type: string;
22
22
  nid: string;
23
23
  dob: string;
24
- isResend: boolean;
25
24
  };
26
- }, NIDFormValues & {
27
- isResend: boolean;
28
- }, {}>;
25
+ }, NIDFormValues, {}>;
26
+ export declare const resendOTPLeadIdentity: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
27
+ export declare const retrieveChannels: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
29
28
  export declare const retrieveEntityList: import("@reduxjs/toolkit").AsyncThunk<any, {
30
29
  leadId: string;
31
30
  }, {}>;
@@ -38,7 +37,6 @@ export declare const updateLeadBusinessType: import("@reduxjs/toolkit").AsyncThu
38
37
  }, BusinessTypeFormValues, {}>;
39
38
  export declare const createAccount: import("@reduxjs/toolkit").AsyncThunk<{
40
39
  data: any;
41
- channelsData: any;
42
40
  }, void, {}>;
43
41
  export declare const updateActivitiesInfo: import("@reduxjs/toolkit").AsyncThunk<{
44
42
  data: any;