@tap-payments/auth-jsconnect 2.0.8 → 2.0.10
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.
- package/build/@types/app.d.ts +2 -1
- package/build/@types/form.d.ts +3 -0
- package/build/@types/redux.d.ts +0 -1
- package/build/api/axios.d.ts +1 -0
- package/build/api/axios.js +3 -0
- package/build/api/entity.d.ts +1 -0
- package/build/api/entity.js +8 -1
- package/build/api/index.d.ts +3 -2
- package/build/api/index.js +2 -2
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +3 -1
- package/build/app/store.d.ts +2 -0
- package/build/assets/locales/ar.json +2 -1
- package/build/assets/locales/en.json +2 -1
- package/build/components/FileInput/DragAndDrop.js +1 -1
- package/build/constants/app.d.ts +9 -0
- package/build/constants/app.js +34 -0
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/bank/bankStore.d.ts +1 -0
- package/build/features/app/business/businessStore.d.ts +5 -3
- package/build/features/app/business/businessStore.js +34 -21
- package/build/features/app/connect/connectStore.d.ts +2 -1
- package/build/features/app/connect/connectStore.js +69 -38
- package/build/features/app/individual/individualStore.d.ts +1 -0
- package/build/features/app/individual/individualStore.js +1 -1
- package/build/features/app/password/passwordStore.d.ts +1 -0
- package/build/features/app/signIn/signInStore.d.ts +33 -0
- package/build/features/app/signIn/signInStore.js +390 -0
- package/build/features/app/tax/taxStore.d.ts +1 -0
- package/build/features/connect/screens/Merchant/validation.js +1 -1
- package/build/features/featuresScreens.d.ts +1 -0
- package/build/features/featuresScreens.js +22 -0
- package/build/features/shared/UploadFile/UploadFile.js +8 -7
- package/build/features/signIn/SignIn.d.ts +7 -0
- package/build/features/signIn/SignIn.js +49 -0
- package/build/features/signIn/index.d.ts +1 -0
- package/build/features/signIn/index.js +1 -0
- package/build/features/signIn/screens/Email/Email.d.ts +5 -0
- package/build/features/signIn/screens/Email/Email.js +95 -0
- package/build/features/signIn/screens/Email/EmailField.d.ts +5 -0
- package/build/features/signIn/screens/Email/EmailField.js +55 -0
- package/build/features/signIn/screens/Email/index.d.ts +3 -0
- package/build/features/signIn/screens/Email/index.js +2 -0
- package/build/features/signIn/screens/Email/validation.d.ts +8 -0
- package/build/features/signIn/screens/Email/validation.js +5 -0
- package/build/features/signIn/screens/Mobile/Mobile.d.ts +5 -0
- package/build/features/signIn/screens/Mobile/Mobile.js +106 -0
- package/build/features/signIn/screens/Mobile/MobileNumber.d.ts +11 -0
- package/build/features/signIn/screens/Mobile/MobileNumber.js +151 -0
- package/build/features/signIn/screens/Mobile/index.d.ts +3 -0
- package/build/features/signIn/screens/Mobile/index.js +2 -0
- package/build/features/signIn/screens/Mobile/validation.d.ts +8 -0
- package/build/features/signIn/screens/Mobile/validation.js +28 -0
- package/build/features/signIn/screens/OTP/OTP.d.ts +5 -0
- package/build/features/signIn/screens/OTP/OTP.js +80 -0
- package/build/features/signIn/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/signIn/screens/OTP/OTPInput.js +53 -0
- package/build/features/signIn/screens/OTP/index.d.ts +3 -0
- package/build/features/signIn/screens/OTP/index.js +2 -0
- package/build/features/signIn/screens/OTP/validation.d.ts +8 -0
- package/build/features/signIn/screens/OTP/validation.js +4 -0
- package/build/features/signIn/screens/Password/Password.d.ts +5 -0
- package/build/features/signIn/screens/Password/Password.js +54 -0
- package/build/features/signIn/screens/Password/PasswordInput.d.ts +5 -0
- package/build/features/signIn/screens/Password/PasswordInput.js +28 -0
- package/build/features/signIn/screens/Password/index.d.ts +3 -0
- package/build/features/signIn/screens/Password/index.js +2 -0
- package/build/features/signIn/screens/Password/validation.d.ts +8 -0
- package/build/features/signIn/screens/Password/validation.js +4 -0
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/index.d.ts +3 -2
- package/build/index.js +5 -2
- package/build/utils/string.d.ts +1 -0
- package/build/utils/string.js +4 -0
- package/package.json +1 -1
package/build/@types/app.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { AxiosRequestHeaders } from 'axios';
|
|
2
3
|
import { LanguageMode } from './theme';
|
|
3
4
|
export interface CountryCode {
|
|
4
5
|
created: number;
|
|
@@ -103,7 +104,7 @@ export interface AppInfo {
|
|
|
103
104
|
version?: string;
|
|
104
105
|
}
|
|
105
106
|
interface LibCallbacks {
|
|
106
|
-
onFlowCompleted: (res: object) => void;
|
|
107
|
+
onFlowCompleted: (res: object, headers?: AxiosRequestHeaders) => void;
|
|
107
108
|
onError: (err: any) => void;
|
|
108
109
|
onStepCompleted?: (name: string, info: any) => void;
|
|
109
110
|
onReady?: () => void;
|
package/build/@types/form.d.ts
CHANGED
package/build/@types/redux.d.ts
CHANGED
package/build/api/axios.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ import { AxiosRequestConfig } from 'axios';
|
|
|
2
2
|
declare const instance: import("axios").AxiosInstance;
|
|
3
3
|
export declare const setAxiosGlobalHeaders: (headers: Record<string, string>) => void;
|
|
4
4
|
export declare const removeAxiosGlobalHeaders: (arr: Array<string>) => void;
|
|
5
|
+
export declare const getAxiosHeaders: () => import("axios").AxiosRequestHeaders;
|
|
5
6
|
export declare const httpClient: (config: AxiosRequestConfig) => Promise<any>;
|
|
6
7
|
export default instance;
|
package/build/api/axios.js
CHANGED
|
@@ -78,6 +78,9 @@ export var removeAxiosGlobalHeaders = function (arr) {
|
|
|
78
78
|
delete axios.defaults.headers.common[key];
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
|
+
export var getAxiosHeaders = function () {
|
|
82
|
+
return instance.defaults.headers.common;
|
|
83
|
+
};
|
|
81
84
|
export var httpClient = function (config) { return __awaiter(void 0, void 0, void 0, function () {
|
|
82
85
|
var data, _a, description, error, err_1, response, data, _b, description, error;
|
|
83
86
|
return __generator(this, function (_c) {
|
package/build/api/entity.d.ts
CHANGED
|
@@ -50,5 +50,6 @@ declare const entityService: {
|
|
|
50
50
|
retrieveEntityInfo: (entity_id: string, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
51
51
|
updateIndividualInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
|
|
52
52
|
uploadFileInfo: (data: UploadFileBody) => Promise<any>;
|
|
53
|
+
retrieveBusinessInfo: (entity_id: string) => Promise<any>;
|
|
53
54
|
};
|
|
54
55
|
export { entityService };
|
package/build/api/entity.js
CHANGED
|
@@ -41,12 +41,19 @@ var updateIndividualInfo = function (_a) {
|
|
|
41
41
|
data: data
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
|
+
var retrieveBusinessInfo = function (entity_id) {
|
|
45
|
+
return httpClient({
|
|
46
|
+
method: 'get',
|
|
47
|
+
url: "".concat(ENDPOINT_PATHS.ENTITY, "/").concat(entity_id, "/info")
|
|
48
|
+
});
|
|
49
|
+
};
|
|
44
50
|
var entityService = {
|
|
45
51
|
createEntityInfo: createEntityInfo,
|
|
46
52
|
updateEntityInfo: updateEntityInfo,
|
|
47
53
|
createBankAccount: createBankAccount,
|
|
48
54
|
retrieveEntityInfo: retrieveEntityInfo,
|
|
49
55
|
updateIndividualInfo: updateIndividualInfo,
|
|
50
|
-
uploadFileInfo: uploadFileInfo
|
|
56
|
+
uploadFileInfo: uploadFileInfo,
|
|
57
|
+
retrieveBusinessInfo: retrieveBusinessInfo
|
|
51
58
|
};
|
|
52
59
|
export { entityService };
|
package/build/api/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import axiosInstance, { setAxiosGlobalHeaders, removeAxiosGlobalHeaders } from './axios';
|
|
1
|
+
import axiosInstance, { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, getAxiosHeaders } from './axios';
|
|
2
2
|
import { ValidateOperatorBody } from './operator';
|
|
3
3
|
import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody } from './auth';
|
|
4
4
|
import { UpdateLeadBody, LeadVerifyBody, CreateLeadBody, LeadOTPVerifyBody, LeadIdentityUpdateBody } from './lead';
|
|
@@ -37,6 +37,7 @@ declare const API: {
|
|
|
37
37
|
retrieveEntityInfo: (entity_id: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
38
38
|
updateIndividualInfo: ({ id, ...data }: EntityInfoBody) => Promise<any>;
|
|
39
39
|
uploadFileInfo: (data: import("./entity").UploadFileBody) => Promise<any>;
|
|
40
|
+
retrieveBusinessInfo: (entity_id: string) => Promise<any>;
|
|
40
41
|
};
|
|
41
42
|
availabilityServices: {
|
|
42
43
|
checkEmail: (data: CheckEmailBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -64,5 +65,5 @@ declare const API: {
|
|
|
64
65
|
};
|
|
65
66
|
};
|
|
66
67
|
export type { ValidateOperatorBody, CreateAuthBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody };
|
|
67
|
-
export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance };
|
|
68
|
+
export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
|
|
68
69
|
export default API;
|
package/build/api/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import axiosInstance, { setAxiosGlobalHeaders, removeAxiosGlobalHeaders } from './axios';
|
|
1
|
+
import axiosInstance, { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, getAxiosHeaders } 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, axiosInstance };
|
|
26
|
+
export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
|
|
27
27
|
export default API;
|
|
@@ -6,5 +6,6 @@ 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
|
+
signIn: import("redux").Reducer<import("../features/app/signIn/signInStore").SignInState, import("redux").AnyAction>;
|
|
9
10
|
};
|
|
10
11
|
export default rootReducer;
|
package/build/app/rootReducer.js
CHANGED
|
@@ -5,6 +5,7 @@ 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 signIn from '../features/app/signIn/signInStore';
|
|
8
9
|
var rootReducer = {
|
|
9
10
|
settings: settings,
|
|
10
11
|
connect: connect,
|
|
@@ -12,6 +13,7 @@ var rootReducer = {
|
|
|
12
13
|
bank: bank,
|
|
13
14
|
tax: tax,
|
|
14
15
|
individual: individual,
|
|
15
|
-
password: password
|
|
16
|
+
password: password,
|
|
17
|
+
signIn: signIn
|
|
16
18
|
};
|
|
17
19
|
export default rootReducer;
|
package/build/app/store.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ 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
|
+
signIn: import("../features/app/signIn/signInStore").SignInState;
|
|
10
11
|
}, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("redux-thunk").ThunkMiddleware<{
|
|
11
12
|
settings: import("./settings").SettingsState;
|
|
12
13
|
connect: import("../features/app/connect/connectStore").ConnectState;
|
|
@@ -15,6 +16,7 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
15
16
|
tax: import("../features/app/tax/taxStore").TaxState;
|
|
16
17
|
individual: import("../features/app/individual/individualStore").IndividualState;
|
|
17
18
|
password: import("../features/app/password/passwordStore").PasswordState;
|
|
19
|
+
signIn: import("../features/app/signIn/signInStore").SignInState;
|
|
18
20
|
}, import("redux").AnyAction, undefined>]>>;
|
|
19
21
|
export declare type AppDispatch = typeof store.dispatch;
|
|
20
22
|
export declare type RootState = ReturnType<typeof store.getState>;
|
|
@@ -243,5 +243,6 @@
|
|
|
243
243
|
"bank": "bank",
|
|
244
244
|
"reset_password_success_title": "لقد ارسلنا رسالة بريدية إليك",
|
|
245
245
|
"reset_password_success_description": "تحقق من بريدك الإلكتروني لإعادة تعيين كلمة المرور الخاصة بك.",
|
|
246
|
-
"license_name_label": "اسم الرخصة"
|
|
246
|
+
"license_name_label": "اسم الرخصة",
|
|
247
|
+
"email_button_label": "تواصل مع البريد الإلكتروني"
|
|
247
248
|
}
|
|
@@ -263,5 +263,6 @@
|
|
|
263
263
|
"bank": "bank",
|
|
264
264
|
"reset_password_success_title": "We sent you an email",
|
|
265
265
|
"reset_password_success_description": "Check your email to reset your password.",
|
|
266
|
-
"license_name_label": "License Name"
|
|
266
|
+
"license_name_label": "License Name",
|
|
267
|
+
"email_button_label": "Continue with Email"
|
|
267
268
|
}
|
|
@@ -27,7 +27,7 @@ var DragAndDrop = function (_a) {
|
|
|
27
27
|
var _b = useDropzone({
|
|
28
28
|
maxFiles: 1,
|
|
29
29
|
noKeyboard: true,
|
|
30
|
-
noClick:
|
|
30
|
+
noClick: false,
|
|
31
31
|
multiple: false,
|
|
32
32
|
onDrop: function (files) {
|
|
33
33
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(files === null || files === void 0 ? void 0 : files[0]);
|
package/build/constants/app.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ 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 SigIn_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
|
|
21
22
|
export declare const DefaultDeviceInfo: {
|
|
22
23
|
source: string;
|
|
23
24
|
device: {
|
|
@@ -79,6 +80,14 @@ export declare const CONNECT_STEP_NAMES: {
|
|
|
79
80
|
VERIFY_AUTH_PASSWORD: string;
|
|
80
81
|
CONNECT_SUCCESS: string;
|
|
81
82
|
};
|
|
83
|
+
export declare const SignIn_STEP_NAMES: {
|
|
84
|
+
CREATE_AUTH_MOBILE: string;
|
|
85
|
+
VERIFY_AUTH_MOBILE: string;
|
|
86
|
+
CREATE_AUTH_EMAIL: string;
|
|
87
|
+
VERIFY_AUTH_EMAIL: string;
|
|
88
|
+
VERIFY_AUTH_MOBILE_OTP: string;
|
|
89
|
+
VERIFY_AUTH_EMAIL_OTP: string;
|
|
90
|
+
};
|
|
82
91
|
export declare const BUSINESS_STEP_NAMES: {
|
|
83
92
|
BUSINESS_INFO: string;
|
|
84
93
|
PHONE_AUTH: string;
|
package/build/constants/app.js
CHANGED
|
@@ -253,6 +253,32 @@ export var TAX_SCREENS_NAVIGATION = [
|
|
|
253
253
|
order: 5
|
|
254
254
|
}
|
|
255
255
|
];
|
|
256
|
+
export var SigIn_SCREENS_NAVIGATION = [
|
|
257
|
+
{
|
|
258
|
+
name: 'SIGIN_MOBILE_STEP',
|
|
259
|
+
next: ['SIGIN_OTP_STEP', 'SIGIN_PASSWORD_STEP'],
|
|
260
|
+
prev: 'SIGIN_EMAIL_STEP',
|
|
261
|
+
order: 1
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: 'SIGIN_EMAIL_STEP',
|
|
265
|
+
next: ['SIGIN_OTP_STEP', 'SIGIN_PASSWORD_STEP'],
|
|
266
|
+
prev: 'SIGIN_MOBILE_STEP',
|
|
267
|
+
order: 1
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: 'SIGIN_PASSWORD_STEP',
|
|
271
|
+
next: 'SIGIN_OTP_STEP',
|
|
272
|
+
prev: ['SIGIN_MOBILE_STEP', 'SIGIN_EMAIL_STEP'],
|
|
273
|
+
order: 2
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
name: 'SIGIN_OTP_STEP',
|
|
277
|
+
next: '',
|
|
278
|
+
prev: ['SIGIN_MOBILE_STEP', 'SIGIN_EMAIL_STEP'],
|
|
279
|
+
order: 3
|
|
280
|
+
}
|
|
281
|
+
];
|
|
256
282
|
export var DefaultDeviceInfo = {
|
|
257
283
|
source: 'browser',
|
|
258
284
|
device: {
|
|
@@ -314,6 +340,14 @@ export var CONNECT_STEP_NAMES = {
|
|
|
314
340
|
VERIFY_AUTH_PASSWORD: 'connect_verify_auth_password',
|
|
315
341
|
CONNECT_SUCCESS: 'connect_completed'
|
|
316
342
|
};
|
|
343
|
+
export var SignIn_STEP_NAMES = {
|
|
344
|
+
CREATE_AUTH_MOBILE: 'signIn_create_auth_mobile',
|
|
345
|
+
VERIFY_AUTH_MOBILE: 'signIn_verify_auth_mobile',
|
|
346
|
+
CREATE_AUTH_EMAIL: 'signIn_create_auth_email',
|
|
347
|
+
VERIFY_AUTH_EMAIL: 'signIn_verify_auth_email',
|
|
348
|
+
VERIFY_AUTH_MOBILE_OTP: 'signIn_verify_auth_mobile_otp',
|
|
349
|
+
VERIFY_AUTH_EMAIL_OTP: 'signIn_verify_auth_email_otp'
|
|
350
|
+
};
|
|
317
351
|
export var BUSINESS_STEP_NAMES = {
|
|
318
352
|
BUSINESS_INFO: 'business_info',
|
|
319
353
|
PHONE_AUTH: 'business_phone_auth',
|
|
@@ -11,3 +11,4 @@ export var REGEX_FULL_NAME = /^([a-zA-Z]{2,}\s{1}[a-zA-Z]{1,}|[a-zA-Z]+\s{1}[a-z
|
|
|
11
11
|
export var REGEX_WEBSITE = /^[a-zA-Z0-9]+([\-\.]{1}[a-zA-Z0-9]+)*\.[a-zA-Z]{2,63}(:[0-9]{1,5})?(\/.*)?$/;
|
|
12
12
|
export var REGEX_BENEFICIARY_NAME = /^([\u0600-\u065F\u066A-\u06EF\u06FA-\u06FFa-zA-Z\s])*$/g;
|
|
13
13
|
export var REGEX_BRAND_NAME = /(.*[a-zA-Z0-9]){3}/g;
|
|
14
|
+
export var EMAIL_MAX_LENGTH = 50;
|
|
@@ -41,6 +41,7 @@ export interface BankData {
|
|
|
41
41
|
flowName: FlowsTypes;
|
|
42
42
|
}
|
|
43
43
|
export interface BankState extends SharedState<BankData> {
|
|
44
|
+
customLoading?: boolean;
|
|
44
45
|
}
|
|
45
46
|
export declare const bankSlice: import("@reduxjs/toolkit").Slice<BankState, {
|
|
46
47
|
clearError: (state: BankState) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootState } from '../../../app/store';
|
|
2
|
-
import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes } from '../../../@types';
|
|
2
|
+
import { ActivitiesFormValues, CustomersFormValues, BusinessTypeFormValues, NIDFormValues, OTPFormValues, ResponseData, SharedState, FlowsTypes, Activity, SalesChannel } from '../../../@types';
|
|
3
3
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
4
|
data: any;
|
|
5
5
|
leadData: any;
|
|
@@ -14,6 +14,7 @@ export declare const verifyLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
14
14
|
isNID: boolean;
|
|
15
15
|
otp: string;
|
|
16
16
|
};
|
|
17
|
+
entityInfo: any;
|
|
17
18
|
}, OTPFormValues, {}>;
|
|
18
19
|
export declare const updateLeadIdentity: import("@reduxjs/toolkit").AsyncThunk<{
|
|
19
20
|
data: any;
|
|
@@ -41,8 +42,8 @@ export declare const createAccount: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
41
42
|
export declare const updateActivitiesInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
42
43
|
data: any;
|
|
43
44
|
formData: {
|
|
44
|
-
activities:
|
|
45
|
-
salesChannels:
|
|
45
|
+
activities: Activity[] | undefined;
|
|
46
|
+
salesChannels: SalesChannel[];
|
|
46
47
|
operationStartDate: string;
|
|
47
48
|
};
|
|
48
49
|
}, ActivitiesFormValues, {}>;
|
|
@@ -79,6 +80,7 @@ export interface BusinessData {
|
|
|
79
80
|
flowName: FlowsTypes;
|
|
80
81
|
}
|
|
81
82
|
export interface BusinessState extends SharedState<BusinessData> {
|
|
83
|
+
customLoading?: boolean;
|
|
82
84
|
}
|
|
83
85
|
export declare const businessSlice: import("@reduxjs/toolkit").Slice<BusinessState, {
|
|
84
86
|
clearError: (state: BusinessState) => void;
|
|
@@ -108,32 +108,33 @@ export var resendOTP = createAsyncThunk('resendOTPBusiness', function (params, t
|
|
|
108
108
|
});
|
|
109
109
|
}); });
|
|
110
110
|
export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
111
|
-
var _a, business, settings, isNID, responseBody, verifyResponse, stepName, payload, data, steps, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted;
|
|
112
|
-
var _b, _c, _d, _e;
|
|
113
|
-
return __generator(this, function (
|
|
114
|
-
switch (
|
|
111
|
+
var _a, business, settings, isNID, responseBody, verifyResponse, stepName, entityID, payload, data, steps, hasBusinessCompleted, hasBusinessCRInfoCompleted, hasBusinessCRActivitiesCompleted, hasBusinessCustomersCompleted, entityInfo;
|
|
112
|
+
var _b, _c, _d, _e, _f, _g;
|
|
113
|
+
return __generator(this, function (_h) {
|
|
114
|
+
switch (_h.label) {
|
|
115
115
|
case 0:
|
|
116
116
|
_a = thunkApi.getState(), business = _a.business, settings = _a.settings;
|
|
117
117
|
isNID = business.data.otpData.isNID;
|
|
118
118
|
responseBody = (isNID ? business.data.nidData : business.data.verify).responseBody;
|
|
119
119
|
verifyResponse = business.data.verify.responseBody;
|
|
120
120
|
stepName = isNID ? BUSINESS_STEP_NAMES.IDENTITY_VERIFY_AUTH : BUSINESS_STEP_NAMES.PHONE_AUTH;
|
|
121
|
+
entityID = (_c = (_b = business.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.id;
|
|
121
122
|
payload = {
|
|
122
123
|
data: params.otp,
|
|
123
|
-
service_name: (
|
|
124
|
+
service_name: (_d = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _d === void 0 ? void 0 : _d.service_name,
|
|
124
125
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
125
126
|
step_name: stepName,
|
|
126
127
|
encryption_contract: ['data']
|
|
127
128
|
};
|
|
128
129
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
129
130
|
case 1:
|
|
130
|
-
data = (
|
|
131
|
+
data = (_h.sent()).data;
|
|
131
132
|
if (!!data.errors) return [3, 11];
|
|
132
133
|
thunkApi.dispatch(updateStepName(stepName));
|
|
133
134
|
return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
|
|
134
135
|
case 2:
|
|
135
|
-
|
|
136
|
-
(
|
|
136
|
+
_h.sent();
|
|
137
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, { otp: params.otp });
|
|
137
138
|
steps = responseBody === null || responseBody === void 0 ? void 0 : responseBody.steps;
|
|
138
139
|
hasBusinessCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_SUCCESS);
|
|
139
140
|
hasBusinessCRInfoCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CR_INFO);
|
|
@@ -144,9 +145,9 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
144
145
|
return [3, 11];
|
|
145
146
|
case 3:
|
|
146
147
|
if (!hasBusinessCompleted) return [3, 5];
|
|
147
|
-
return [4, thunkApi.dispatch(retrieveEntityInfo((
|
|
148
|
+
return [4, thunkApi.dispatch(retrieveEntityInfo((_g = verifyResponse === null || verifyResponse === void 0 ? void 0 : verifyResponse.entity) === null || _g === void 0 ? void 0 : _g.id))];
|
|
148
149
|
case 4:
|
|
149
|
-
|
|
150
|
+
_h.sent();
|
|
150
151
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
151
152
|
return [3, 11];
|
|
152
153
|
case 5:
|
|
@@ -159,6 +160,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
159
160
|
return [3, 11];
|
|
160
161
|
case 7:
|
|
161
162
|
if (!hasBusinessCRActivitiesCompleted) return [3, 8];
|
|
163
|
+
thunkApi.dispatch(retrieveChannels());
|
|
162
164
|
thunkApi.dispatch(retrieveDataList());
|
|
163
165
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
|
|
164
166
|
return [3, 11];
|
|
@@ -166,13 +168,16 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
|
|
|
166
168
|
if (!hasBusinessCRInfoCompleted) return [3, 10];
|
|
167
169
|
return [4, thunkApi.dispatch(retrieveChannels())];
|
|
168
170
|
case 9:
|
|
169
|
-
|
|
171
|
+
_h.sent();
|
|
170
172
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP'));
|
|
171
173
|
return [3, 11];
|
|
172
174
|
case 10:
|
|
173
175
|
thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
|
|
174
|
-
|
|
175
|
-
case 11: return [
|
|
176
|
+
_h.label = 11;
|
|
177
|
+
case 11: return [4, API.entityService.retrieveBusinessInfo(entityID)];
|
|
178
|
+
case 12:
|
|
179
|
+
entityInfo = _h.sent();
|
|
180
|
+
return [2, { data: data, formData: __assign(__assign({}, params), { isNID: isNID }), entityInfo: entityInfo }];
|
|
176
181
|
}
|
|
177
182
|
});
|
|
178
183
|
}); });
|
|
@@ -582,10 +587,10 @@ export var businessSlice = createSlice({
|
|
|
582
587
|
state.error = null;
|
|
583
588
|
})
|
|
584
589
|
.addCase(verifyLeadOTP.fulfilled, function (state, action) {
|
|
585
|
-
var _a, _b, _c;
|
|
590
|
+
var _a, _b, _c, _d;
|
|
586
591
|
state.loading = false;
|
|
587
592
|
state.error = null;
|
|
588
|
-
var
|
|
593
|
+
var _e = action.payload, data = _e.data, formData = _e.formData, entityInfo = _e.entityInfo;
|
|
589
594
|
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
590
595
|
if (description) {
|
|
591
596
|
state.error = description;
|
|
@@ -593,21 +598,29 @@ export var businessSlice = createSlice({
|
|
|
593
598
|
}
|
|
594
599
|
state.data.otpData = formData;
|
|
595
600
|
state.data.otpData.responseBody = data;
|
|
596
|
-
var
|
|
597
|
-
var issuingDate = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
|
|
601
|
+
var _f = state.data.verify.responseBody || {}, entity = _f.entity, entity_activities = _f.entity_activities, business_type = _f.business_type;
|
|
602
|
+
var issuingDate = entityInfo ? entityInfo.business_operation_start_at : (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
|
|
598
603
|
if (!!issuingDate) {
|
|
599
604
|
var formattedDate = moment(issuingDate).format('YYYY-MM-DD');
|
|
600
605
|
state.data.activitiesData.operationStartDate = convertNumbers2English(formattedDate);
|
|
601
606
|
}
|
|
607
|
+
var channels = (_c = state.data.businessTypeData.responseBody) === null || _c === void 0 ? void 0 : _c.channelList;
|
|
608
|
+
var selectedChannels = (channels === null || channels === void 0 ? void 0 : channels.filter(function (channel) {
|
|
609
|
+
return entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.channel_services.find(function (storedChannel) { return channel.name_en.toLowerCase() === storedChannel.toLowerCase(); });
|
|
610
|
+
})) || [channels === null || channels === void 0 ? void 0 : channels[0]];
|
|
611
|
+
if ((selectedChannels === null || selectedChannels === void 0 ? void 0 : selectedChannels.length) > 0)
|
|
612
|
+
state.data.activitiesData.salesChannels = selectedChannels;
|
|
602
613
|
var activities = entity_activities || [];
|
|
603
|
-
var selectedActivity = activities === null || activities === void 0 ? void 0 : activities
|
|
604
|
-
|
|
605
|
-
|
|
614
|
+
var selectedActivity = (activities === null || activities === void 0 ? void 0 : activities.filter(function (activity) {
|
|
615
|
+
return entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.activities.find(function (value) { var _a; return ((_a = activity.en) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === value.toLowerCase(); });
|
|
616
|
+
})) || [activities === null || activities === void 0 ? void 0 : activities[0]];
|
|
617
|
+
if ((selectedActivity === null || selectedActivity === void 0 ? void 0 : selectedActivity.length) > 0)
|
|
618
|
+
state.data.activitiesData.activities = selectedActivity;
|
|
606
619
|
state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { entity_id: entity === null || entity === void 0 ? void 0 : entity.id, activities: activities });
|
|
607
620
|
if (!!(entity === null || entity === void 0 ? void 0 : entity.license)) {
|
|
608
621
|
state.data.businessTypeData.selectedLicense = {
|
|
609
622
|
legal_name: entity === null || entity === void 0 ? void 0 : entity.legal_name,
|
|
610
|
-
license: { number: (
|
|
623
|
+
license: { number: (_d = entity === null || entity === void 0 ? void 0 : entity.license) === null || _d === void 0 ? void 0 : _d.number },
|
|
611
624
|
type: business_type
|
|
612
625
|
};
|
|
613
626
|
}
|
|
@@ -31,7 +31,6 @@ export declare const retrieveLead: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
31
31
|
}, {}>;
|
|
32
32
|
export declare const createLead: import("@reduxjs/toolkit").AsyncThunk<{
|
|
33
33
|
response: any;
|
|
34
|
-
brandResponse: any;
|
|
35
34
|
formData: {
|
|
36
35
|
individualId: string;
|
|
37
36
|
stepName: string;
|
|
@@ -40,6 +39,7 @@ export declare const createLead: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
40
39
|
individualId: string;
|
|
41
40
|
stepName: string;
|
|
42
41
|
}, {}>;
|
|
42
|
+
export declare const retrieveBrandList: import("@reduxjs/toolkit").AsyncThunk<any, string, {}>;
|
|
43
43
|
export declare const updateLeadIndividual: import("@reduxjs/toolkit").AsyncThunk<{
|
|
44
44
|
response: any;
|
|
45
45
|
formData: IndividualFormValues;
|
|
@@ -83,6 +83,7 @@ export interface ConnectData {
|
|
|
83
83
|
flowName: FlowsTypes;
|
|
84
84
|
}
|
|
85
85
|
export interface ConnectState extends SharedState<ConnectData> {
|
|
86
|
+
customLoading?: boolean;
|
|
86
87
|
}
|
|
87
88
|
export declare const connectSlice: import("@reduxjs/toolkit").Slice<ConnectState, {
|
|
88
89
|
clearError: (state: ConnectState) => void;
|