@tap-payments/auth-jsconnect 2.11.26-development → 2.11.28-development
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 +1 -0
- package/build/api/auth.d.ts +2 -1
- package/build/api/axios.js +9 -1
- package/build/api/index.d.ts +3 -3
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +2 -0
- package/build/app/session.d.ts +17 -0
- package/build/app/session.js +28 -0
- package/build/app/settings.js +1 -1
- package/build/app/store.d.ts +2 -0
- package/build/assets/locales/ar.json +4 -1
- package/build/assets/locales/en.json +4 -1
- package/build/constants/app.d.ts +4 -0
- package/build/constants/app.js +37 -12
- package/build/constants/flows.d.ts +10 -22
- package/build/constants/flows.js +10 -23
- package/build/features/app/connect/connectStore.d.ts +6 -0
- package/build/features/app/connect/connectStore.js +95 -0
- package/build/features/app/connectExpress/connectExpressStore.d.ts +4 -0
- package/build/features/app/connectExpress/connectExpressStore.js +94 -0
- package/build/features/app/kyc/kycStore.d.ts +5 -5
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +2 -2
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +2 -2
- package/build/features/business/screens/BusinessType/UnifiedNumber.d.ts +2 -2
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
- package/build/features/connect/Connect.js +3 -2
- package/build/features/connect/screens/OTPSessionExpired/OTPInput.d.ts +5 -0
- package/build/features/connect/screens/OTPSessionExpired/OTPInput.js +58 -0
- package/build/features/connect/screens/OTPSessionExpired/OTPSessionExpired.d.ts +3 -0
- package/build/features/connect/screens/OTPSessionExpired/OTPSessionExpired.js +86 -0
- package/build/features/connect/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/connect/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/connect/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/connect/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/connectExpress/ConnectExpress.js +3 -2
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.d.ts +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/UnifiedNumber.d.ts +2 -2
- package/build/features/connectExpress/screens/OTPSessionExpired/OTPInput.d.ts +3 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/OTPInput.js +58 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/OTPSessionExpired.d.ts +5 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/OTPSessionExpired.js +85 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/index.d.ts +2 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/index.js +2 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/OTPSessionExpired/validation.js +4 -0
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +2 -2
- package/build/features/featuresScreens.js +10 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +2 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -2
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -2
- package/build/features/shared/Address/CountryList.d.ts +1 -1
- package/build/features/shared/Address/InputSelect.d.ts +1 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +1 -1
- package/build/features/terminal/screens/shared/styles.d.ts +1 -1
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/hooks/useSessionExpiryHandler.d.ts +8 -0
- package/build/hooks/useSessionExpiryHandler.js +71 -0
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/package.json +1 -1
package/build/@types/app.d.ts
CHANGED
package/build/api/auth.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export declare type CreateAuthBody = {
|
|
|
47
47
|
user_id?: string;
|
|
48
48
|
login?: boolean;
|
|
49
49
|
};
|
|
50
|
+
export declare type CreateAuthSessionExpiredBody = Omit<CreateAuthBody, 'user_credentail'>;
|
|
50
51
|
export declare type CreateNafathAuthBody = {
|
|
51
52
|
country: string;
|
|
52
53
|
scope: string;
|
|
@@ -140,7 +141,7 @@ declare const authService: {
|
|
|
140
141
|
getVerifyAuth: (token: string, config?: AxiosRequestConfig) => Promise<any>;
|
|
141
142
|
getTokenVerify: (token: string, config?: AxiosRequestConfig) => Promise<any>;
|
|
142
143
|
createAuthKitNID: (data: CreateAuthBody) => Promise<any>;
|
|
143
|
-
createExpressAuth: (data: CreateAuthBody, config?: AxiosRequestConfig) => Promise<any>;
|
|
144
|
+
createExpressAuth: (data: CreateAuthBody | CreateAuthSessionExpiredBody, config?: AxiosRequestConfig) => Promise<any>;
|
|
144
145
|
verifyExpressLeadIdentity: (data: VerifyAuthExpressOTPBody) => Promise<any>;
|
|
145
146
|
createExpressLeadIdentityAuth: (data: CreateAuthBody) => Promise<any>;
|
|
146
147
|
getVerifyExpressAuth: (token: string, config?: AxiosRequestConfig) => Promise<any>;
|
package/build/api/axios.js
CHANGED
|
@@ -47,7 +47,15 @@ var instance = axios.create({
|
|
|
47
47
|
instance.interceptors.request.use(function (config) {
|
|
48
48
|
return encryptionContractTransformer(config);
|
|
49
49
|
}, function (error) { return Promise.reject(error); });
|
|
50
|
-
instance.interceptors.response.use(function (response) {
|
|
50
|
+
instance.interceptors.response.use(function (response) {
|
|
51
|
+
var _a, _b, _c;
|
|
52
|
+
var errors = (_a = response.data) === null || _a === void 0 ? void 0 : _a.errors;
|
|
53
|
+
if (((_b = errors === null || errors === void 0 ? void 0 : errors[0]) === null || _b === void 0 ? void 0 : _b.code) === '7014')
|
|
54
|
+
throw new Error('session_expired');
|
|
55
|
+
if (((_c = errors === null || errors === void 0 ? void 0 : errors[0]) === null || _c === void 0 ? void 0 : _c.code) === '7013')
|
|
56
|
+
throw new Error('session_invalid');
|
|
57
|
+
return response;
|
|
58
|
+
}, function (error) {
|
|
51
59
|
return Promise.reject(error);
|
|
52
60
|
});
|
|
53
61
|
var encryptionContractTransformer = function (config) {
|
package/build/api/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axiosInstance, { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, getAxiosHeaders } from './axios';
|
|
2
2
|
import { ValidateOperatorBody, ConfirmBody } from './operator';
|
|
3
|
-
import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, VerifyAuthExpressOTPBody, ConfigBody, CreateNafathAuthBody, CreateKYCAuthBody } from './auth';
|
|
3
|
+
import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, VerifyAuthExpressOTPBody, ConfigBody, CreateNafathAuthBody, CreateKYCAuthBody, CreateAuthSessionExpiredBody } from './auth';
|
|
4
4
|
import { UpdateLeadBody, LeadVerifyBody, CreateLeadBody, LeadOTPVerifyBody, LeadIdentityUpdateBody, ExpressLeadVerifyBody } from './lead';
|
|
5
5
|
import { CheckEmailBody, CheckBrandBody } from './availabilityServices';
|
|
6
6
|
import { EntityInfoBody, EntityBankUpdateBody, BankDocumentInfo, UpdateEntityBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, UpdateEntityAOAFileBody, RemoveEntityActivity, MerchantListBody, CreateEntityBody } from './entity';
|
|
@@ -39,7 +39,7 @@ declare const API: {
|
|
|
39
39
|
getVerifyAuth: (token: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
40
40
|
getTokenVerify: (token: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
41
41
|
createAuthKitNID: (data: CreateAuthBody) => Promise<any>;
|
|
42
|
-
createExpressAuth: (data: CreateAuthBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
42
|
+
createExpressAuth: (data: CreateAuthBody | CreateAuthSessionExpiredBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
43
43
|
verifyExpressLeadIdentity: (data: VerifyAuthExpressOTPBody) => Promise<any>;
|
|
44
44
|
createExpressLeadIdentityAuth: (data: CreateAuthBody) => Promise<any>;
|
|
45
45
|
getVerifyExpressAuth: (token: string, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
@@ -172,6 +172,6 @@ declare const API: {
|
|
|
172
172
|
retrievePOSDevices: (merchants: string[]) => Promise<any>;
|
|
173
173
|
};
|
|
174
174
|
};
|
|
175
|
-
export type { ValidateOperatorBody, CreateAuthBody, ExpressCreateAccountBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, UpdateBoardBody, UpdateBrandBody, DataElementBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, VerifyAuthExpressOTPBody, UpdateIndividualBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, BankDocumentInfo, GetUserListBody, GetIndividualListBody, RequestEmailBody, DocumentBody, UpdateEntityAOAFileBody, InitBody, RemoveBrandActivity, RemoveEntityActivity, UpdateIndividualWithTypeBody, UpdateMultipleIndividualBody, ExpressLeadVerifyBody, ConfirmBody, ConfigBody, MerchantListBody, CreateEntityBody, CreateNafathAuthBody, GetUserListSegmentBody, CreateKYCAuthBody, GenerateAuthLinkNewTerminalProps, UnlinkTerminalDeviceProps, LinkTerminalDeviceProps };
|
|
175
|
+
export type { ValidateOperatorBody, CreateAuthBody, ExpressCreateAccountBody, VerifyAuthBody, CreateLeadBody, UpdateLeadBody, LeadVerifyBody, LeadOTPVerifyBody, CheckEmailBody, CheckBrandBody, LeadIdentityUpdateBody, EntityInfoBody, CreateAccountBody, EntityBankUpdateBody, CreatePasswordBody, BrandListBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, UpdateBoardBody, UpdateBrandBody, DataElementBody, UploadFileBody, UpdateEntityBody, DocumentUpdateBody, DocumentInfo, VerifyAuthExpressOTPBody, UpdateIndividualBody, UpdateEntityActivityBody, UpdateEntityCapitalBody, BankDocumentInfo, GetUserListBody, GetIndividualListBody, RequestEmailBody, DocumentBody, UpdateEntityAOAFileBody, InitBody, RemoveBrandActivity, RemoveEntityActivity, UpdateIndividualWithTypeBody, UpdateMultipleIndividualBody, ExpressLeadVerifyBody, ConfirmBody, ConfigBody, MerchantListBody, CreateEntityBody, CreateNafathAuthBody, GetUserListSegmentBody, CreateKYCAuthBody, GenerateAuthLinkNewTerminalProps, UnlinkTerminalDeviceProps, LinkTerminalDeviceProps, CreateAuthSessionExpiredBody };
|
|
176
176
|
export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders, setAuthSessionToGlobalHeaders };
|
|
177
177
|
export default API;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const rootReducer: {
|
|
2
|
+
session: import("redux").Reducer<import("./session").SessionState, import("redux").AnyAction>;
|
|
2
3
|
settings: import("redux").Reducer<import("./settings").SettingsState, import("redux").AnyAction>;
|
|
3
4
|
connect: import("redux").Reducer<import("../features/app/connect/connectStore").ConnectState, import("redux").AnyAction>;
|
|
4
5
|
business: import("redux").Reducer<import("../features/app/business/businessStore").BusinessState, import("redux").AnyAction>;
|
package/build/app/rootReducer.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import session from './session';
|
|
1
2
|
import settings from './settings';
|
|
2
3
|
import connect from '../features/app/connect/connectStore';
|
|
3
4
|
import business from '../features/app/business/businessStore';
|
|
@@ -14,6 +15,7 @@ import auth from '../features/app/auth/authStore';
|
|
|
14
15
|
import kyc from '../features/app/kyc/kycStore';
|
|
15
16
|
import terminal from '../features/app/terminal/terminalStore';
|
|
16
17
|
var rootReducer = {
|
|
18
|
+
session: session,
|
|
17
19
|
settings: settings,
|
|
18
20
|
connect: connect,
|
|
19
21
|
business: business,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RootState } from './store';
|
|
2
|
+
import { ActionState, SharedState } from '../@types';
|
|
3
|
+
export interface SessionData {
|
|
4
|
+
isExpired: boolean;
|
|
5
|
+
nextScreen: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SessionState extends SharedState<SessionData> {
|
|
8
|
+
}
|
|
9
|
+
export declare const sessionSlice: import("@reduxjs/toolkit").Slice<SessionState, {
|
|
10
|
+
setSessionExpired: (state: SessionState) => void;
|
|
11
|
+
setNextScreen: (state: SessionState, action: ActionState<string>) => void;
|
|
12
|
+
resetSession: (state: SessionState) => void;
|
|
13
|
+
}, "session">;
|
|
14
|
+
export declare const setSessionExpired: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setNextScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, resetSession: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
15
|
+
declare const _default: import("redux").Reducer<SessionState, import("redux").AnyAction>;
|
|
16
|
+
export default _default;
|
|
17
|
+
export declare const sessionSelector: (state: RootState) => SessionState;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
3
|
+
var initialState = {
|
|
4
|
+
error: null,
|
|
5
|
+
loading: false,
|
|
6
|
+
data: {
|
|
7
|
+
isExpired: false,
|
|
8
|
+
nextScreen: ''
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export var sessionSlice = createSlice({
|
|
12
|
+
name: 'session',
|
|
13
|
+
initialState: initialState,
|
|
14
|
+
reducers: {
|
|
15
|
+
setSessionExpired: function (state) {
|
|
16
|
+
state.data.isExpired = true;
|
|
17
|
+
},
|
|
18
|
+
setNextScreen: function (state, action) {
|
|
19
|
+
state.data.nextScreen = action.payload;
|
|
20
|
+
},
|
|
21
|
+
resetSession: function (state) {
|
|
22
|
+
state.data.isExpired = false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export var setSessionExpired = (_a = sessionSlice.actions, _a.setSessionExpired), setNextScreen = _a.setNextScreen, resetSession = _a.resetSession;
|
|
27
|
+
export default sessionSlice.reducer;
|
|
28
|
+
export var sessionSelector = function (state) { return state.session; };
|
package/build/app/settings.js
CHANGED
|
@@ -100,7 +100,7 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
100
100
|
_e = _f, country_list = _e.country_list, ip_info = _e.ip_info, merchant = _e.merchant, operator = _e.operator, config = _e.config;
|
|
101
101
|
list = __spreadArray([], ((country_list === null || country_list === void 0 ? void 0 : country_list.list) || []), true);
|
|
102
102
|
_g = ip_info || {}, ip = _g.ip, latitude = _g.latitude, longitude = _g.longitude, country_code = _g.country_code;
|
|
103
|
-
countries = sortCountries(list);
|
|
103
|
+
countries = sortCountries(list.filter(function (c) { return c.idd_prefix; }));
|
|
104
104
|
if (config) {
|
|
105
105
|
_h = config, operator_1 = _h.operator, scope = _h.scope, data = _h.data, lead = _h.lead, board = _h.board, interfaceData = _h.interface, redirect = _h.redirect, post = _h.post, platforms = _h.platforms, payment_provider = _h.payment_provider;
|
|
106
106
|
_j = interfaceData || {}, locale_1 = _j.locale, edges = _j.edges;
|
package/build/app/store.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ThunkAction, Action } from '@reduxjs/toolkit';
|
|
2
2
|
export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
3
|
+
session: import("./session").SessionState;
|
|
3
4
|
settings: import("./settings").SettingsState;
|
|
4
5
|
connect: import("../features/app/connect/connectStore").ConnectState;
|
|
5
6
|
business: import("../features/app/business/businessStore").BusinessState;
|
|
@@ -16,6 +17,7 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
16
17
|
kyc: import("../features/app/kyc/kycStore").KYCDataState;
|
|
17
18
|
terminal: import("../features/app/terminal/terminalStore").TerminalDataState;
|
|
18
19
|
}, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<{
|
|
20
|
+
session: import("./session").SessionState;
|
|
19
21
|
settings: import("./settings").SettingsState;
|
|
20
22
|
connect: import("../features/app/connect/connectStore").ConnectState;
|
|
21
23
|
business: import("../features/app/business/businessStore").BusinessState;
|
|
@@ -680,5 +680,8 @@
|
|
|
680
680
|
"year": "السنة",
|
|
681
681
|
"yes": "نعم",
|
|
682
682
|
"your_brand_details": "تفاصيل علامتك التجارية",
|
|
683
|
-
"يرجى التحقق من اسم تطبيق ابل": ""
|
|
683
|
+
"يرجى التحقق من اسم تطبيق ابل": "",
|
|
684
|
+
"session_expired_otp": "Session expired. Please verify your phone number to continue.",
|
|
685
|
+
"code_sent_to": "Code sent to ",
|
|
686
|
+
"session_invalid": "Session Invalid"
|
|
684
687
|
}
|
|
@@ -707,5 +707,8 @@
|
|
|
707
707
|
"website_label": "Website",
|
|
708
708
|
"year": "Year",
|
|
709
709
|
"yes": "Yes",
|
|
710
|
-
"your_brand_details": "Your brand details"
|
|
710
|
+
"your_brand_details": "Your brand details",
|
|
711
|
+
"session_expired_otp": "Session expired. Please verify your phone number to continue.",
|
|
712
|
+
"code_sent_to": "Code sent to ",
|
|
713
|
+
"session_invalid": "Session Invalid"
|
|
711
714
|
}
|
package/build/constants/app.d.ts
CHANGED
|
@@ -111,6 +111,8 @@ export declare const CONNECT_STEP_NAMES: {
|
|
|
111
111
|
CONNECT_MOBILE_OWNERSHIP: string;
|
|
112
112
|
CONNECT_MOBILE_OWNERSHIP_SKIPPED: string;
|
|
113
113
|
CONNECT_SUCCESS: string;
|
|
114
|
+
CREATE_AUTH_SESSION_EXPIRED: string;
|
|
115
|
+
VERIFY_AUTH_SESSION_EXPIRED: string;
|
|
114
116
|
};
|
|
115
117
|
export declare const AUTH_STEP_NAMES: {
|
|
116
118
|
CREATE_AUTH_MOBILE: string;
|
|
@@ -142,6 +144,8 @@ export declare const CONNECT_EXPRESS_STEP_NAMES: {
|
|
|
142
144
|
COLLECT_MOBILE_OWNERSHIP: string;
|
|
143
145
|
COLLECT_MOBILE_OWNERSHIP_SKIPPED: string;
|
|
144
146
|
VERIFY_AUTH_MOBILE_OTP: string;
|
|
147
|
+
CREATE_AUTH_SESSION_EXPIRED: string;
|
|
148
|
+
VERIFY_AUTH_SESSION_EXPIRED: string;
|
|
145
149
|
};
|
|
146
150
|
export declare const SignIn_STEP_NAMES: {
|
|
147
151
|
CREATE_AUTH_MOBILE: string;
|
package/build/constants/app.js
CHANGED
|
@@ -66,19 +66,22 @@ export var CONNECT_SCREENS_NAVIGATION = [
|
|
|
66
66
|
name: 'CONNECT_VERIFY_PACI_STEP',
|
|
67
67
|
next: 'CONNECT_INDIVIDUAL_STEP',
|
|
68
68
|
prev: 'CONNECT_CIVIL_ID_STEP',
|
|
69
|
-
order: 2
|
|
69
|
+
order: 2,
|
|
70
|
+
back: 'CONNECT_CIVIL_ID_STEP'
|
|
70
71
|
},
|
|
71
72
|
{
|
|
72
73
|
name: 'CONNECT_VERIFY_NAFATH_STEP',
|
|
73
74
|
next: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_DOB_STEP'],
|
|
74
75
|
prev: 'CONNECT_NID_STEP',
|
|
75
|
-
order: 2
|
|
76
|
+
order: 2,
|
|
77
|
+
back: 'CONNECT_NID_STEP'
|
|
76
78
|
},
|
|
77
79
|
{
|
|
78
80
|
name: 'CONNECT_OTP_STEP',
|
|
79
81
|
next: ['CONNECT_INDIVIDUAL_STEP', 'CONNECT_OTP_VERIFY_SECURITY_ERROR_STEP'],
|
|
80
82
|
prev: ['CONNECT_MOBILE_STEP', 'CONNECT_NID_STEP'],
|
|
81
|
-
order: 2
|
|
83
|
+
order: 2,
|
|
84
|
+
back: 'CONNECT_MOBILE_STEP'
|
|
82
85
|
},
|
|
83
86
|
{
|
|
84
87
|
name: 'CONNECT_DOB_STEP',
|
|
@@ -120,7 +123,13 @@ export var CONNECT_SCREENS_NAVIGATION = [
|
|
|
120
123
|
name: 'CONNECT_OTP_VERIFY_SECURITY_ERROR_STEP',
|
|
121
124
|
next: '',
|
|
122
125
|
prev: '',
|
|
123
|
-
order:
|
|
126
|
+
order: 7
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'CONNECT_SESSION_EXPIRED_OTP_STEP',
|
|
130
|
+
next: '',
|
|
131
|
+
prev: '',
|
|
132
|
+
order: 8
|
|
124
133
|
}
|
|
125
134
|
];
|
|
126
135
|
export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
@@ -163,7 +172,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
163
172
|
'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
|
|
164
173
|
],
|
|
165
174
|
prev: 'CONNECT_EXPRESS_NID_STEP',
|
|
166
|
-
order: 2
|
|
175
|
+
order: 2,
|
|
176
|
+
back: 'CONNECT_EXPRESS_NID_STEP'
|
|
167
177
|
},
|
|
168
178
|
{
|
|
169
179
|
name: 'CONNECT_EXPRESS_VERIFY_PACI_STEP',
|
|
@@ -173,7 +183,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
173
183
|
'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
|
|
174
184
|
],
|
|
175
185
|
prev: 'CONNECT_EXPRESS_CIVIL_ID_STEP',
|
|
176
|
-
order: 2
|
|
186
|
+
order: 2,
|
|
187
|
+
back: 'CONNECT_EXPRESS_CIVIL_ID_STEP'
|
|
177
188
|
},
|
|
178
189
|
{
|
|
179
190
|
name: 'CONNECT_EXPRESS_OTP_STEP',
|
|
@@ -186,7 +197,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
186
197
|
'CONNECT_EXPRESS_OTP_VERIFY_SECURITY_ERROR_STEP'
|
|
187
198
|
],
|
|
188
199
|
prev: 'CONNECT_EXPRESS_MOBILE_STEP',
|
|
189
|
-
order: 2
|
|
200
|
+
order: 2,
|
|
201
|
+
back: 'CONNECT_EXPRESS_MOBILE_STEP'
|
|
190
202
|
},
|
|
191
203
|
{
|
|
192
204
|
name: 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP',
|
|
@@ -210,7 +222,8 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
210
222
|
name: 'CONNECT_EXPRESS_AUTH_ACCOUNT_CREATED_STEP',
|
|
211
223
|
next: 'CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP',
|
|
212
224
|
prev: 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP',
|
|
213
|
-
order: 4
|
|
225
|
+
order: 4,
|
|
226
|
+
back: 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP'
|
|
214
227
|
},
|
|
215
228
|
{
|
|
216
229
|
name: 'CONNECT_EXPRESS_AUTH_MERCHANT_LIST_STEP',
|
|
@@ -227,13 +240,15 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
227
240
|
'COLLECT_MOBILE_OWNERSHIP'
|
|
228
241
|
],
|
|
229
242
|
prev: 'CONNECT_EXPRESS_NID_MISSED_STEP',
|
|
230
|
-
order: 4
|
|
243
|
+
order: 4,
|
|
244
|
+
back: 'CONNECT_EXPRESS_NID_MISSED_STEP'
|
|
231
245
|
},
|
|
232
246
|
{
|
|
233
247
|
name: 'CONNECT_EXPRESS_VERIFY_PACI_IDENTITY_STEP',
|
|
234
248
|
next: ['CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP', 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP'],
|
|
235
249
|
prev: 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP',
|
|
236
|
-
order: 4
|
|
250
|
+
order: 4,
|
|
251
|
+
back: 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP'
|
|
237
252
|
},
|
|
238
253
|
{
|
|
239
254
|
name: 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP',
|
|
@@ -322,6 +337,12 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
|
|
|
322
337
|
next: '',
|
|
323
338
|
prev: '',
|
|
324
339
|
order: 12
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
name: 'CONNECT_EXPRESS_SESSION_EXPIRED_OTP_STEP',
|
|
343
|
+
next: '',
|
|
344
|
+
prev: '',
|
|
345
|
+
order: 13
|
|
325
346
|
}
|
|
326
347
|
];
|
|
327
348
|
export var AUTH_SCREENS_NAVIGATION = [
|
|
@@ -1204,7 +1225,9 @@ export var CONNECT_STEP_NAMES = {
|
|
|
1204
1225
|
VERIFY_AUTH_PASSWORD: 'connect_verify_auth_password',
|
|
1205
1226
|
CONNECT_MOBILE_OWNERSHIP: 'collect_owner_phone',
|
|
1206
1227
|
CONNECT_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped',
|
|
1207
|
-
CONNECT_SUCCESS: 'connect_completed'
|
|
1228
|
+
CONNECT_SUCCESS: 'connect_completed',
|
|
1229
|
+
CREATE_AUTH_SESSION_EXPIRED: 'connect_create_auth_session_expired',
|
|
1230
|
+
VERIFY_AUTH_SESSION_EXPIRED: 'connect_verify_auth_session_expired'
|
|
1208
1231
|
};
|
|
1209
1232
|
export var AUTH_STEP_NAMES = {
|
|
1210
1233
|
CREATE_AUTH_MOBILE: 'auth_create_auth_mobile',
|
|
@@ -1235,7 +1258,9 @@ export var CONNECT_EXPRESS_STEP_NAMES = {
|
|
|
1235
1258
|
CONNECT_EXPRESS_SUCCESS: 'connect_express_completed',
|
|
1236
1259
|
COLLECT_MOBILE_OWNERSHIP: 'collect_owner_phone',
|
|
1237
1260
|
COLLECT_MOBILE_OWNERSHIP_SKIPPED: 'collect_owner_phone_skipped',
|
|
1238
|
-
VERIFY_AUTH_MOBILE_OTP: 'connect_express_auth_mobile'
|
|
1261
|
+
VERIFY_AUTH_MOBILE_OTP: 'connect_express_auth_mobile',
|
|
1262
|
+
CREATE_AUTH_SESSION_EXPIRED: 'connect_express_create_auth_session_expired',
|
|
1263
|
+
VERIFY_AUTH_SESSION_EXPIRED: 'connect_express_verify_auth_session_expired'
|
|
1239
1264
|
};
|
|
1240
1265
|
export var SignIn_STEP_NAMES = {
|
|
1241
1266
|
CREATE_AUTH_MOBILE: 'signIn_create_auth_mobile',
|
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
export declare enum KYC_FLOWS {
|
|
2
|
-
loadingData = "KYC_LOADING_DATA_STEP",
|
|
3
|
-
alreadySubmitted = "ALREADY_SUBMITTED",
|
|
4
|
-
tokenError = "TOKEN_ERROR_STEP",
|
|
5
|
-
verify = "KYC_VERIFY_STEP",
|
|
6
|
-
terms = "KYC_TERMS_STEP",
|
|
7
|
-
users = "KYC_USERS_STEP",
|
|
8
|
-
operatorError = "KYC_OPERATOR_ERROR_STEP",
|
|
9
|
-
verifyPACI = "KYC_VERIFY_PACI_STEP",
|
|
10
|
-
verifyNafath = "KYC_VERIFY_NAFATH_STEP",
|
|
11
|
-
success = "KYC_SUCCESS_STEP"
|
|
12
|
-
}
|
|
13
1
|
export declare const CONNECT_FLOWS: {
|
|
14
2
|
kyc: {
|
|
15
|
-
loadingData:
|
|
16
|
-
alreadySubmitted:
|
|
17
|
-
tokenError:
|
|
18
|
-
verify:
|
|
19
|
-
terms:
|
|
20
|
-
users:
|
|
21
|
-
operatorError:
|
|
22
|
-
verifyPACI:
|
|
23
|
-
verifyNafath:
|
|
24
|
-
success:
|
|
3
|
+
loadingData: string;
|
|
4
|
+
alreadySubmitted: string;
|
|
5
|
+
tokenError: string;
|
|
6
|
+
verify: string;
|
|
7
|
+
terms: string;
|
|
8
|
+
users: string;
|
|
9
|
+
operatorError: string;
|
|
10
|
+
verifyPACI: string;
|
|
11
|
+
verifyNafath: string;
|
|
12
|
+
success: string;
|
|
25
13
|
};
|
|
26
14
|
terminal: {
|
|
27
15
|
loadingData: string;
|
package/build/constants/flows.js
CHANGED
|
@@ -1,28 +1,15 @@
|
|
|
1
|
-
export var KYC_FLOWS;
|
|
2
|
-
(function (KYC_FLOWS) {
|
|
3
|
-
KYC_FLOWS["loadingData"] = "KYC_LOADING_DATA_STEP";
|
|
4
|
-
KYC_FLOWS["alreadySubmitted"] = "ALREADY_SUBMITTED";
|
|
5
|
-
KYC_FLOWS["tokenError"] = "TOKEN_ERROR_STEP";
|
|
6
|
-
KYC_FLOWS["verify"] = "KYC_VERIFY_STEP";
|
|
7
|
-
KYC_FLOWS["terms"] = "KYC_TERMS_STEP";
|
|
8
|
-
KYC_FLOWS["users"] = "KYC_USERS_STEP";
|
|
9
|
-
KYC_FLOWS["operatorError"] = "KYC_OPERATOR_ERROR_STEP";
|
|
10
|
-
KYC_FLOWS["verifyPACI"] = "KYC_VERIFY_PACI_STEP";
|
|
11
|
-
KYC_FLOWS["verifyNafath"] = "KYC_VERIFY_NAFATH_STEP";
|
|
12
|
-
KYC_FLOWS["success"] = "KYC_SUCCESS_STEP";
|
|
13
|
-
})(KYC_FLOWS || (KYC_FLOWS = {}));
|
|
14
1
|
export var CONNECT_FLOWS = {
|
|
15
2
|
kyc: {
|
|
16
|
-
loadingData:
|
|
17
|
-
alreadySubmitted:
|
|
18
|
-
tokenError:
|
|
19
|
-
verify:
|
|
20
|
-
terms:
|
|
21
|
-
users:
|
|
22
|
-
operatorError:
|
|
23
|
-
verifyPACI:
|
|
24
|
-
verifyNafath:
|
|
25
|
-
success:
|
|
3
|
+
loadingData: 'KYC_LOADING_DATA_STEP',
|
|
4
|
+
alreadySubmitted: 'ALREADY_SUBMITTED',
|
|
5
|
+
tokenError: 'TOKEN_ERROR_STEP',
|
|
6
|
+
verify: 'KYC_VERIFY_STEP',
|
|
7
|
+
terms: 'KYC_TERMS_STEP',
|
|
8
|
+
users: 'KYC_USERS_STEP',
|
|
9
|
+
operatorError: 'KYC_OPERATOR_ERROR_STEP',
|
|
10
|
+
verifyPACI: 'KYC_VERIFY_PACI_STEP',
|
|
11
|
+
verifyNafath: 'KYC_VERIFY_NAFATH_STEP',
|
|
12
|
+
success: 'KYC_SUCCESS_STEP'
|
|
26
13
|
},
|
|
27
14
|
terminal: {
|
|
28
15
|
loadingData: 'TERMINAL_LOADING_DATA_STEP',
|
|
@@ -25,6 +25,12 @@ export declare const verifyAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
25
25
|
leadResponse: any;
|
|
26
26
|
countryCode: CountryCode;
|
|
27
27
|
}, OTPFormValues, {}>;
|
|
28
|
+
export declare const createAuthSessionExpired: import("@reduxjs/toolkit").AsyncThunk<{
|
|
29
|
+
response: any;
|
|
30
|
+
}, boolean, {}>;
|
|
31
|
+
export declare const verifySessionExpiredOtp: import("@reduxjs/toolkit").AsyncThunk<{
|
|
32
|
+
data: any;
|
|
33
|
+
}, OTPFormValues, {}>;
|
|
28
34
|
interface verifyPACIParams {
|
|
29
35
|
onSuccess?: () => void;
|
|
30
36
|
}
|
|
@@ -286,6 +286,70 @@ export var verifyAuth = createAsyncThunk('connect/verifyAuth', function (params,
|
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
288
|
}); });
|
|
289
|
+
export var createAuthSessionExpired = createAsyncThunk('createAuthSessionExpiredAsync', function (redirect, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
290
|
+
var settings, requestBody, data;
|
|
291
|
+
var _a, _b;
|
|
292
|
+
return __generator(this, function (_c) {
|
|
293
|
+
switch (_c.label) {
|
|
294
|
+
case 0:
|
|
295
|
+
settings = thunkApi.getState().settings;
|
|
296
|
+
requestBody = {
|
|
297
|
+
country: settings.data.businessCountry.iso2,
|
|
298
|
+
scope: settings.data.appConfig.scope,
|
|
299
|
+
lang: settings.data.language,
|
|
300
|
+
sign_in: false,
|
|
301
|
+
is_lead: true,
|
|
302
|
+
step_name: CONNECT_STEP_NAMES.CREATE_AUTH_SESSION_EXPIRED,
|
|
303
|
+
encryption_contract: []
|
|
304
|
+
};
|
|
305
|
+
return [4, API.authService.createAuth(requestBody)];
|
|
306
|
+
case 1:
|
|
307
|
+
data = _c.sent();
|
|
308
|
+
if (redirect)
|
|
309
|
+
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_SESSION_EXPIRED_OTP_STEP'));
|
|
310
|
+
(_b = (_a = settings.data.appConfig).onStepCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, settings.data.activeScreen.name, requestBody);
|
|
311
|
+
return [2, { response: data }];
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
}); });
|
|
315
|
+
export var verifySessionExpiredOtp = createAsyncThunk('connect/verifySessionExpiredOtp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
316
|
+
var _a, connect, settings, session, responseBody, payload, data;
|
|
317
|
+
var _b, _c;
|
|
318
|
+
return __generator(this, function (_d) {
|
|
319
|
+
switch (_d.label) {
|
|
320
|
+
case 0:
|
|
321
|
+
_a = thunkApi.getState(), connect = _a.connect, settings = _a.settings, session = _a.session;
|
|
322
|
+
responseBody = connect.data.mobileData.responseBody;
|
|
323
|
+
payload = {
|
|
324
|
+
data: params.otp,
|
|
325
|
+
auth_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token,
|
|
326
|
+
auth_type: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_type,
|
|
327
|
+
device_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.device_token,
|
|
328
|
+
service_name: responseBody === null || responseBody === void 0 ? void 0 : responseBody.service_name,
|
|
329
|
+
sign_in: responseBody === null || responseBody === void 0 ? void 0 : responseBody.sign_in,
|
|
330
|
+
remember_me: responseBody === null || responseBody === void 0 ? void 0 : responseBody.remember_me,
|
|
331
|
+
step_name: CONNECT_STEP_NAMES.VERIFY_AUTH_SESSION_EXPIRED,
|
|
332
|
+
encryption_contract: ['data']
|
|
333
|
+
};
|
|
334
|
+
return [4, API.authService.verifyAuth(payload).catch(function (err) {
|
|
335
|
+
if (isAuthenticationVerificationFailed(err === null || err === void 0 ? void 0 : err.message))
|
|
336
|
+
thunkApi.dispatch(handleCurrentActiveScreen('CONNECT_OTP_VERIFY_SECURITY_ERROR_STEP'));
|
|
337
|
+
throw new Error(err === null || err === void 0 ? void 0 : err.message);
|
|
338
|
+
})];
|
|
339
|
+
case 1:
|
|
340
|
+
data = _d.sent();
|
|
341
|
+
setAuthSessionToGlobalHeaders(data === null || data === void 0 ? void 0 : data.auth_session);
|
|
342
|
+
sendCustomEventToGTM({
|
|
343
|
+
event: 'Send Event',
|
|
344
|
+
event_category: 'User Registration Flow',
|
|
345
|
+
event_action: 'Session Expired - OTP Success'
|
|
346
|
+
});
|
|
347
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, { otp: params.otp });
|
|
348
|
+
thunkApi.dispatch(handleCurrentActiveScreen(session.data.nextScreen));
|
|
349
|
+
return [2, { data: data }];
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
}); });
|
|
289
353
|
export var verifyPACI = createAsyncThunk('connect/verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
290
354
|
var _a, settings, connect, responseBody, expiry, interval, maxCalls, count, authResponse, error_1, isSuccess, lead_id, leadResponse, countryCode, channels, brand, err_3, brands, err_4, phone;
|
|
291
355
|
var _b, _c, _d, _e, _f;
|
|
@@ -1145,6 +1209,37 @@ export var connectSlice = createSlice({
|
|
|
1145
1209
|
state.loading = false;
|
|
1146
1210
|
if (!isAuthenticationVerificationFailed(message))
|
|
1147
1211
|
state.error = message;
|
|
1212
|
+
})
|
|
1213
|
+
.addCase(createAuthSessionExpired.fulfilled, function (state, action) {
|
|
1214
|
+
state.loading = false;
|
|
1215
|
+
state.error = null;
|
|
1216
|
+
var response = action.payload.response;
|
|
1217
|
+
state.data.mobileData.responseBody = response;
|
|
1218
|
+
state.data.otpData.authFor = AuthForType.MOBILE;
|
|
1219
|
+
})
|
|
1220
|
+
.addCase(createAuthSessionExpired.pending, function (state) {
|
|
1221
|
+
state.loading = true;
|
|
1222
|
+
state.error = null;
|
|
1223
|
+
})
|
|
1224
|
+
.addCase(createAuthSessionExpired.rejected, function (state, action) {
|
|
1225
|
+
state.loading = false;
|
|
1226
|
+
state.error = action.error.message;
|
|
1227
|
+
})
|
|
1228
|
+
.addCase(verifySessionExpiredOtp.fulfilled, function (state, action) {
|
|
1229
|
+
state.loading = false;
|
|
1230
|
+
state.error = null;
|
|
1231
|
+
var data = action.payload.data;
|
|
1232
|
+
state.data.otpData.responseBody = __assign({}, data);
|
|
1233
|
+
})
|
|
1234
|
+
.addCase(verifySessionExpiredOtp.pending, function (state) {
|
|
1235
|
+
state.loading = true;
|
|
1236
|
+
state.error = null;
|
|
1237
|
+
})
|
|
1238
|
+
.addCase(verifySessionExpiredOtp.rejected, function (state, _a) {
|
|
1239
|
+
var message = _a.error.message;
|
|
1240
|
+
state.loading = false;
|
|
1241
|
+
if (!isAuthenticationVerificationFailed(message))
|
|
1242
|
+
state.error = message;
|
|
1148
1243
|
})
|
|
1149
1244
|
.addCase(updateLeadDOB.fulfilled, function (state, action) {
|
|
1150
1245
|
state.loading = false;
|
|
@@ -37,6 +37,10 @@ export declare const resendMobileAuthOTP: import("@reduxjs/toolkit").AsyncThunk<
|
|
|
37
37
|
response: any;
|
|
38
38
|
formData: MobileFormValues;
|
|
39
39
|
}, MobileFormValues, {}>;
|
|
40
|
+
export declare const createAuthSessionExpiredAsync: import("@reduxjs/toolkit").AsyncThunk<{
|
|
41
|
+
data: any;
|
|
42
|
+
}, boolean, {}>;
|
|
43
|
+
export declare const verifySessionExpiredOtpAsync: import("@reduxjs/toolkit").AsyncThunk<any, OTPFormValues, {}>;
|
|
40
44
|
export declare const createNafathAuth: import("@reduxjs/toolkit").AsyncThunk<{
|
|
41
45
|
response: any;
|
|
42
46
|
formData: {
|