@tap-payments/auth-jsconnect 2.6.3-test → 2.6.4-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/app.d.ts +4 -0
- package/build/app/settings.d.ts +5 -1
- package/build/app/settings.js +43 -4
- package/build/features/app/bank/bankStore.d.ts +1 -0
- package/build/features/app/bank/bankStore.js +28 -1
- package/build/features/app/brand/brandStore.d.ts +1 -0
- package/build/features/app/brand/brandStore.js +28 -1
- package/build/features/app/connectExpress/connectExpressStore.d.ts +1 -7
- package/build/features/app/connectExpress/connectExpressStore.js +44 -71
- package/build/features/app/entity/entityStore.d.ts +1 -0
- package/build/features/app/entity/entityStore.js +28 -1
- package/build/features/app/individual/individualStore.d.ts +1 -0
- package/build/features/app/individual/individualStore.js +28 -1
- package/build/features/app/password/passwordStore.d.ts +1 -0
- package/build/features/app/password/passwordStore.js +28 -1
- package/build/features/app/tax/taxStore.d.ts +1 -0
- package/build/features/app/tax/taxStore.js +28 -1
- package/build/features/bank/Bank.d.ts +1 -0
- package/build/features/bank/Bank.js +4 -4
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
- package/build/features/brand/Brand.d.ts +1 -0
- package/build/features/brand/Brand.js +4 -4
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
- package/build/features/connectExpress/ConnectExpress.d.ts +0 -1
- package/build/features/connectExpress/ConnectExpress.js +6 -13
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +2 -0
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -1
- package/build/features/entity/Entity.d.ts +1 -0
- package/build/features/entity/Entity.js +4 -4
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
- package/build/features/individual/Individual.d.ts +1 -0
- package/build/features/individual/Individual.js +4 -4
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
- package/build/features/password/Password.d.ts +1 -0
- package/build/features/password/Password.js +16 -4
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
- package/build/features/tax/Tax.d.ts +1 -0
- package/build/features/tax/Tax.js +4 -4
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -5
- package/build/hooks/useAppConfig.js +4 -3
- package/package.json +1 -1
package/build/@types/app.d.ts
CHANGED
|
@@ -216,6 +216,10 @@ export interface LibConfig extends LibCallbacks {
|
|
|
216
216
|
appInfo: AppInfo;
|
|
217
217
|
businessCountryCode: string;
|
|
218
218
|
scope: string;
|
|
219
|
+
postURL?: string;
|
|
220
|
+
redirectUrl?: string;
|
|
221
|
+
data?: Array<string>;
|
|
222
|
+
authId?: string;
|
|
219
223
|
boardMaturity?: boolean;
|
|
220
224
|
}
|
|
221
225
|
export interface OSDetails {
|
package/build/app/settings.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ interface SettingParams {
|
|
|
9
9
|
onVerifyConfigTokenSuccess?: (data: ConfigExpressTokenParams) => Promise<void>;
|
|
10
10
|
}
|
|
11
11
|
export declare const fetchAppSettingsSync: import("@reduxjs/toolkit").AsyncThunk<any, SettingParams, {}>;
|
|
12
|
+
export declare const onCloseComplete: import("@reduxjs/toolkit").AsyncThunk<void, string, {}>;
|
|
12
13
|
export interface SettingsData {
|
|
13
14
|
skin: ThemeMode;
|
|
14
15
|
language: LanguageMode;
|
|
@@ -27,8 +28,11 @@ export interface SettingsData {
|
|
|
27
28
|
isHijri: boolean;
|
|
28
29
|
}
|
|
29
30
|
export interface SettingsState extends SharedState<SettingsData> {
|
|
31
|
+
internalLoading: boolean;
|
|
30
32
|
}
|
|
31
33
|
export declare const settingsSlice: import("@reduxjs/toolkit").Slice<SettingsState, {
|
|
34
|
+
storeAuthId: (state: import("immer/dist/internal").WritableDraft<SettingsState>, action: ActionState<string>) => void;
|
|
35
|
+
updateInternalLoading: (state: import("immer/dist/internal").WritableDraft<SettingsState>, action: ActionState<boolean>) => void;
|
|
32
36
|
handelBoardMaturity: (state: import("immer/dist/internal").WritableDraft<SettingsState>, action: ActionState<boolean>) => void;
|
|
33
37
|
handleIsTapOrigin: (state: import("immer/dist/internal").WritableDraft<SettingsState>, action: ActionState<boolean>) => void;
|
|
34
38
|
handleOpen: (state: import("immer/dist/internal").WritableDraft<SettingsState>, action: ActionState<boolean>) => void;
|
|
@@ -43,7 +47,7 @@ export declare const settingsSlice: import("@reduxjs/toolkit").Slice<SettingsSta
|
|
|
43
47
|
handleSetAppConfig: (state: SettingsState, action: ActionState<LibConfig>) => void;
|
|
44
48
|
handleSetCountryByIso2: (state: SettingsState, action: ActionState<string>) => void;
|
|
45
49
|
}, "settings">;
|
|
46
|
-
export declare const handleSkin: import("@reduxjs/toolkit").ActionCreatorWithPayload<ThemeMode, string>, handleLanguage: import("@reduxjs/toolkit").ActionCreatorWithPayload<LanguageMode, string>, handleActiveFlowScreens: import("@reduxjs/toolkit").ActionCreatorWithPayload<ScreenStepNavigation[], string>, handleNextScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>, handlePrevScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>, handleCurrentActiveScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, handleSetAppConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<LibConfig, string>, handleOpen: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, handleSetCountryByIso2: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, handleIsTapOrigin: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, handelBoardMaturity: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, handlePublicKey: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, handleSwitchCalender: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>;
|
|
50
|
+
export declare const storeAuthId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, updateInternalLoading: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, handleSkin: import("@reduxjs/toolkit").ActionCreatorWithPayload<ThemeMode, string>, handleLanguage: import("@reduxjs/toolkit").ActionCreatorWithPayload<LanguageMode, string>, handleActiveFlowScreens: import("@reduxjs/toolkit").ActionCreatorWithPayload<ScreenStepNavigation[], string>, handleNextScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>, handlePrevScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>, handleCurrentActiveScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, handleSetAppConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<LibConfig, string>, handleOpen: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, handleSetCountryByIso2: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, handleIsTapOrigin: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, handelBoardMaturity: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, handlePublicKey: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, handleSwitchCalender: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>;
|
|
47
51
|
declare const _default: import("redux").Reducer<SettingsState, import("redux").AnyAction>;
|
|
48
52
|
export default _default;
|
|
49
53
|
export declare const settingsSelector: (state: RootState) => SettingsState;
|
package/build/app/settings.js
CHANGED
|
@@ -53,7 +53,7 @@ import i18n from '../i18n';
|
|
|
53
53
|
import { updateLocale } from '../utils/locale';
|
|
54
54
|
import API, { getAxiosHeaders, setAxiosGlobalHeaders } from '../api';
|
|
55
55
|
export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
-
var settings, _a, appConfig, language, _b, client, device, os, disableLocale, maturity, disableCountries, configToken, onVerifyConfigTokenSuccess, _c, visitorId, locale, configInfo, matureData, lang, initPayload, _d, country_list, ip_info, merchant, operator, config, list, _e, ip, latitude, longitude, domain, language_1, country, scope, public_key, maturity_1, board_maturity, deviceInfo, isValidOperator, countries, countryCode, isKWOrSA, businessCountry;
|
|
56
|
+
var settings, _a, appConfig, language, _b, client, device, os, disableLocale, maturity, disableCountries, configToken, onVerifyConfigTokenSuccess, _c, visitorId, locale, configInfo, matureData, lang, initPayload, _d, country_list, ip_info, merchant, operator, config, list, _e, ip, latitude, longitude, domain, language_1, country, scope, public_key, maturity_1, board_maturity, post, platform_redirect_url, data, deviceInfo, isValidOperator, countries, countryCode, isKWOrSA, businessCountry;
|
|
57
57
|
return __generator(this, function (_f) {
|
|
58
58
|
switch (_f.label) {
|
|
59
59
|
case 0:
|
|
@@ -81,8 +81,8 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
81
81
|
list = (country_list || { list: [] }).list;
|
|
82
82
|
_e = ip_info || {}, ip = _e.ip, latitude = _e.latitude, longitude = _e.longitude;
|
|
83
83
|
if (config) {
|
|
84
|
-
domain = config.domain, language_1 = config.language, country = config.country, scope = config.scope, public_key = config.public_key, maturity_1 = config.maturity, board_maturity = config.board_maturity;
|
|
85
|
-
configInfo = __assign(__assign(__assign(__assign(__assign(__assign({}, configInfo), (domain && { merchantDomain: domain })), (language_1 && { language: language_1 })), (country && { businessCountryCode: country })), (scope && { scope: scope })), (public_key && { publicKey: public_key }));
|
|
84
|
+
domain = config.domain, language_1 = config.language, country = config.country, scope = config.scope, public_key = config.public_key, maturity_1 = config.maturity, board_maturity = config.board_maturity, post = config.post, platform_redirect_url = config.platform_redirect_url, data = config.data;
|
|
85
|
+
configInfo = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, configInfo), (domain && { merchantDomain: domain })), (language_1 && { language: language_1 })), (country && { businessCountryCode: country })), (scope && { scope: scope })), (public_key && { publicKey: public_key })), ((post === null || post === void 0 ? void 0 : post.url) && { postURL: post === null || post === void 0 ? void 0 : post.url })), (platform_redirect_url && { redirectUrl: platform_redirect_url })), (data && { data: data }));
|
|
86
86
|
if (typeof maturity_1 === 'boolean')
|
|
87
87
|
matureData = maturity_1 ? 'full' : 'express';
|
|
88
88
|
thunkApi.dispatch(handleSetAppConfig(configInfo));
|
|
@@ -145,9 +145,39 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
}); });
|
|
148
|
+
export var onCloseComplete = createAsyncThunk('settings/onCloseComplete', function (merchantId, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
149
|
+
var settings, _a, postURL, redirectUrl, authId, bi, list, id, body, data, urlQueryStart;
|
|
150
|
+
var _b, _c, _d, _e;
|
|
151
|
+
return __generator(this, function (_f) {
|
|
152
|
+
switch (_f.label) {
|
|
153
|
+
case 0:
|
|
154
|
+
settings = thunkApi.getState().settings;
|
|
155
|
+
_a = settings.data.appConfig, postURL = _a.postURL, redirectUrl = _a.redirectUrl, authId = _a.authId;
|
|
156
|
+
bi = settings.data.deviceInfo.browser.browser_id;
|
|
157
|
+
return [4, API.entityService.getTerminalListUsingMerchantId(merchantId)];
|
|
158
|
+
case 1:
|
|
159
|
+
list = (_f.sent()).list;
|
|
160
|
+
id = ((_c = (_b = list === null || list === void 0 ? void 0 : list[0]) === null || _b === void 0 ? void 0 : _b.operator) === null || _c === void 0 ? void 0 : _c.id) || '';
|
|
161
|
+
body = {
|
|
162
|
+
id: id,
|
|
163
|
+
post_url: postURL || ''
|
|
164
|
+
};
|
|
165
|
+
return [4, API.operatorService.updateOperator(body)];
|
|
166
|
+
case 2:
|
|
167
|
+
data = _f.sent();
|
|
168
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, data);
|
|
169
|
+
if (authId && redirectUrl) {
|
|
170
|
+
urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
171
|
+
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|
|
172
|
+
}
|
|
173
|
+
return [2];
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}); });
|
|
148
177
|
var initialState = {
|
|
149
178
|
error: null,
|
|
150
179
|
loading: true,
|
|
180
|
+
internalLoading: true,
|
|
151
181
|
data: {
|
|
152
182
|
boardMaturity: true,
|
|
153
183
|
open: true,
|
|
@@ -169,6 +199,12 @@ export var settingsSlice = createSlice({
|
|
|
169
199
|
name: 'settings',
|
|
170
200
|
initialState: initialState,
|
|
171
201
|
reducers: {
|
|
202
|
+
storeAuthId: function (state, action) {
|
|
203
|
+
state.data.appConfig.authId = action.payload;
|
|
204
|
+
},
|
|
205
|
+
updateInternalLoading: function (state, action) {
|
|
206
|
+
state.internalLoading = action.payload;
|
|
207
|
+
},
|
|
172
208
|
handelBoardMaturity: function (state, action) {
|
|
173
209
|
state.data.boardMaturity = action.payload;
|
|
174
210
|
},
|
|
@@ -279,6 +315,7 @@ export var settingsSlice = createSlice({
|
|
|
279
315
|
extraReducers: function (builder) {
|
|
280
316
|
builder.addCase(fetchAppSettingsSync.pending, function (state) {
|
|
281
317
|
state.loading = true;
|
|
318
|
+
state.internalLoading = false;
|
|
282
319
|
state.error = null;
|
|
283
320
|
});
|
|
284
321
|
builder.addCase(fetchAppSettingsSync.fulfilled, function (state, action) {
|
|
@@ -293,15 +330,17 @@ export var settingsSlice = createSlice({
|
|
|
293
330
|
if (locale)
|
|
294
331
|
updateLocale(locale, businessCountry.iso2);
|
|
295
332
|
state.loading = false;
|
|
333
|
+
state.internalLoading = false;
|
|
296
334
|
if (state.data.appConfig.onReady)
|
|
297
335
|
state.data.appConfig.onReady();
|
|
298
336
|
});
|
|
299
337
|
builder.addCase(fetchAppSettingsSync.rejected, function (state, action) {
|
|
300
338
|
state.loading = false;
|
|
339
|
+
state.internalLoading = false;
|
|
301
340
|
state.error = action.error.message;
|
|
302
341
|
});
|
|
303
342
|
}
|
|
304
343
|
});
|
|
305
|
-
export var
|
|
344
|
+
export var storeAuthId = (_a = settingsSlice.actions, _a.storeAuthId), updateInternalLoading = _a.updateInternalLoading, handleSkin = _a.handleSkin, handleLanguage = _a.handleLanguage, handleActiveFlowScreens = _a.handleActiveFlowScreens, handleNextScreenStep = _a.handleNextScreenStep, handlePrevScreenStep = _a.handlePrevScreenStep, handleCurrentActiveScreen = _a.handleCurrentActiveScreen, handleSetAppConfig = _a.handleSetAppConfig, handleOpen = _a.handleOpen, handleSetCountryByIso2 = _a.handleSetCountryByIso2, handleIsTapOrigin = _a.handleIsTapOrigin, handelBoardMaturity = _a.handelBoardMaturity, handlePublicKey = _a.handlePublicKey, handleSwitchCalender = _a.handleSwitchCalender;
|
|
306
345
|
export default settingsSlice.reducer;
|
|
307
346
|
export var settingsSelector = function (state) { return state.settings; };
|
|
@@ -50,6 +50,7 @@ export declare const updateBoardSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
50
50
|
response: any;
|
|
51
51
|
formData: void;
|
|
52
52
|
} | undefined, void, {}>;
|
|
53
|
+
export declare const onCloseCompleteBank: import("@reduxjs/toolkit").AsyncThunk<void, void, {}>;
|
|
53
54
|
declare type VerifyData = {
|
|
54
55
|
token: string;
|
|
55
56
|
};
|
|
@@ -49,7 +49,7 @@ var _a;
|
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
50
|
import API from '../../../api';
|
|
51
51
|
import { DocumentPurpose, FlowsTypes } from '../../../@types';
|
|
52
|
-
import { handleCurrentActiveScreen, handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
|
|
52
|
+
import { handleCurrentActiveScreen, handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
53
53
|
import { BANK_STEP_NAMES } from '../../../constants';
|
|
54
54
|
import { hasNoneEditableValue, isStringHasOneAsterisk, retrieveIndividualData, sleep } from '../../../utils';
|
|
55
55
|
export var verifyLeadToken = createAsyncThunk('bankVerifyLeadToken', function (_a, thunkApi) {
|
|
@@ -310,6 +310,21 @@ export var updateBoardSuccess = createAsyncThunk('updateBoardBankSuccess', funct
|
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
312
|
}); });
|
|
313
|
+
export var onCloseCompleteBank = createAsyncThunk('bank/onCloseCompleteBank', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
314
|
+
var bank, id;
|
|
315
|
+
var _a;
|
|
316
|
+
return __generator(this, function (_b) {
|
|
317
|
+
switch (_b.label) {
|
|
318
|
+
case 0:
|
|
319
|
+
bank = thunkApi.getState().bank;
|
|
320
|
+
id = (((_a = bank.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.merchant) || {}).id;
|
|
321
|
+
return [4, thunkApi.dispatch(onCloseComplete(id))];
|
|
322
|
+
case 1:
|
|
323
|
+
_b.sent();
|
|
324
|
+
return [2];
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
}); });
|
|
313
328
|
var initialState = {
|
|
314
329
|
error: null,
|
|
315
330
|
loading: false,
|
|
@@ -495,6 +510,18 @@ export var bankSlice = createSlice({
|
|
|
495
510
|
if (action.error.message === 'Aborted')
|
|
496
511
|
return;
|
|
497
512
|
state.error = action.error.message;
|
|
513
|
+
})
|
|
514
|
+
.addCase(onCloseCompleteBank.pending, function (state) {
|
|
515
|
+
state.loading = true;
|
|
516
|
+
state.error = null;
|
|
517
|
+
})
|
|
518
|
+
.addCase(onCloseCompleteBank.fulfilled, function (state) {
|
|
519
|
+
state.loading = false;
|
|
520
|
+
state.error = null;
|
|
521
|
+
})
|
|
522
|
+
.addCase(onCloseCompleteBank.rejected, function (state, action) {
|
|
523
|
+
state.loading = false;
|
|
524
|
+
state.error = action.error.message;
|
|
498
525
|
});
|
|
499
526
|
}
|
|
500
527
|
});
|
|
@@ -94,6 +94,7 @@ export declare const updateBoardSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
94
94
|
response: any;
|
|
95
95
|
formData: void;
|
|
96
96
|
} | undefined, void, {}>;
|
|
97
|
+
export declare const onCloseCompleteBrand: import("@reduxjs/toolkit").AsyncThunk<void, void, {}>;
|
|
97
98
|
declare type VerifyData = {
|
|
98
99
|
token: string;
|
|
99
100
|
};
|
|
@@ -60,7 +60,7 @@ var _a;
|
|
|
60
60
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
61
61
|
import API from '../../../api';
|
|
62
62
|
import { FlowsTypes } from '../../../@types';
|
|
63
|
-
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
|
|
63
|
+
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
64
64
|
import { BRAND_STEP_NAMES } from '../../../constants';
|
|
65
65
|
import { hasNoneEditableValue, isKW, isTwitter, isWebsite, mapSalesChannel, retrieveIndividualData, sleep } from '../../../utils';
|
|
66
66
|
export var verifyLeadToken = createAsyncThunk('brandVerifyLeadToken', function (_a, thunkApi) {
|
|
@@ -549,6 +549,21 @@ export var updateBoardSuccess = createAsyncThunk('updateBoardBrandSuccess', func
|
|
|
549
549
|
}
|
|
550
550
|
});
|
|
551
551
|
}); });
|
|
552
|
+
export var onCloseCompleteBrand = createAsyncThunk('brand/onCloseCompleteBrand', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
553
|
+
var brand, id;
|
|
554
|
+
var _a;
|
|
555
|
+
return __generator(this, function (_b) {
|
|
556
|
+
switch (_b.label) {
|
|
557
|
+
case 0:
|
|
558
|
+
brand = thunkApi.getState().brand;
|
|
559
|
+
id = (((_a = brand.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.merchant) || {}).id;
|
|
560
|
+
return [4, thunkApi.dispatch(onCloseComplete(id))];
|
|
561
|
+
case 1:
|
|
562
|
+
_b.sent();
|
|
563
|
+
return [2];
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
}); });
|
|
552
567
|
var initialState = {
|
|
553
568
|
error: null,
|
|
554
569
|
loading: false,
|
|
@@ -844,6 +859,18 @@ export var brandSlice = createSlice({
|
|
|
844
859
|
.addCase(updateBoardSuccess.rejected, function (state, action) {
|
|
845
860
|
state.loading = false;
|
|
846
861
|
state.error = action.error.message;
|
|
862
|
+
})
|
|
863
|
+
.addCase(onCloseCompleteBrand.pending, function (state) {
|
|
864
|
+
state.loading = true;
|
|
865
|
+
state.error = null;
|
|
866
|
+
})
|
|
867
|
+
.addCase(onCloseCompleteBrand.fulfilled, function (state) {
|
|
868
|
+
state.loading = false;
|
|
869
|
+
state.error = null;
|
|
870
|
+
})
|
|
871
|
+
.addCase(onCloseCompleteBrand.rejected, function (state, action) {
|
|
872
|
+
state.loading = false;
|
|
873
|
+
state.error = action.error.message;
|
|
847
874
|
});
|
|
848
875
|
}
|
|
849
876
|
});
|
|
@@ -108,7 +108,6 @@ interface ResponseData {
|
|
|
108
108
|
export interface ConnectExpressData {
|
|
109
109
|
isLeadIdPassed: boolean;
|
|
110
110
|
showBoard: boolean;
|
|
111
|
-
postURL: string;
|
|
112
111
|
mobileData: MobileFormValues;
|
|
113
112
|
nidData: NIDFormValues;
|
|
114
113
|
civilIdData: CivilFormValues;
|
|
@@ -119,8 +118,6 @@ export interface ConnectExpressData {
|
|
|
119
118
|
leadId?: string;
|
|
120
119
|
individualData: IndividualFormValues;
|
|
121
120
|
businessData: BusinessDataFormValues;
|
|
122
|
-
redirectUrl: string;
|
|
123
|
-
authData: Array<string>;
|
|
124
121
|
authenticationData: AuthenticationListFormValues;
|
|
125
122
|
}
|
|
126
123
|
export interface ConnectExpressState extends SharedState<ConnectExpressData & ResponseData> {
|
|
@@ -131,8 +128,6 @@ export interface ConnectExpressState extends SharedState<ConnectExpressData & Re
|
|
|
131
128
|
export declare const connectSlice: import("@reduxjs/toolkit").Slice<ConnectExpressState, {
|
|
132
129
|
setLeadId(state: ConnectExpressState, action: ActionState<string>): void;
|
|
133
130
|
setShowBoard(state: ConnectExpressState, action: ActionState<boolean>): void;
|
|
134
|
-
setRedirectUrl: (state: ConnectExpressState, action: ActionState<string>) => void;
|
|
135
|
-
setAuthData: (state: ConnectExpressState, action: ActionState<Array<string>>) => void;
|
|
136
131
|
setIsLeadIdPassed: (state: ConnectExpressState, action: ActionState<boolean>) => void;
|
|
137
132
|
clearError: (state: ConnectExpressState) => void;
|
|
138
133
|
setError(state: ConnectExpressState, action: ActionState<string>): void;
|
|
@@ -141,11 +136,10 @@ export declare const connectSlice: import("@reduxjs/toolkit").Slice<ConnectExpre
|
|
|
141
136
|
resetNIDScreen: (state: ConnectExpressState) => void;
|
|
142
137
|
resetCivilScreen: (state: ConnectExpressState) => void;
|
|
143
138
|
resetOTPValue: (state: ConnectExpressState) => void;
|
|
144
|
-
setPostUrl: (state: ConnectExpressState, action: ActionState<string>) => void;
|
|
145
139
|
resetStore: (state: ConnectExpressState) => void;
|
|
146
140
|
resetIndividualScreen: (state: ConnectExpressState) => void;
|
|
147
141
|
}, "connectExpress/store">;
|
|
148
|
-
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setIsLeadIdPassed: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, resetOTPValue: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetCivilScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setError: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>,
|
|
142
|
+
export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setIsLeadIdPassed: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetMobileScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<CountryCode, string>, resetOTPValue: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetNIDScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetCivilScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, setError: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, setLeadId: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, setShowBoard: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, resetIndividualScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
149
143
|
declare const _default: import("redux").Reducer<ConnectExpressState, import("redux").AnyAction>;
|
|
150
144
|
export default _default;
|
|
151
145
|
export declare const connectExpressSelector: (state: RootState) => ConnectExpressState;
|
|
@@ -56,7 +56,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
56
56
|
};
|
|
57
57
|
var _a;
|
|
58
58
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
59
|
-
import { handleNextScreenStep, handleCurrentActiveScreen, handleOpen, handleSetCountryByIso2 } from '../../../app/settings';
|
|
59
|
+
import { handleNextScreenStep, handleCurrentActiveScreen, handleOpen, handleSetCountryByIso2, onCloseComplete, storeAuthId } from '../../../app/settings';
|
|
60
60
|
import { FlowsTypes, AuthForType, BusinessType, LicenseType } from '../../../@types';
|
|
61
61
|
import API from '../../../api';
|
|
62
62
|
import { CONNECT_EXPRESS_STEP_NAMES, IDENTIFICATION_TYPE, OTHER_CR_LICENSE, OTHER_FL_LICENSE, SCOPE_AUTH } from '../../../constants';
|
|
@@ -367,20 +367,20 @@ export var createCivilIdAuthAsync = createAsyncThunk('connectExpress/createCivil
|
|
|
367
367
|
});
|
|
368
368
|
}); });
|
|
369
369
|
export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileOtpAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
370
|
-
var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, mobileData, _c, auth_token, device_token, service_name,
|
|
371
|
-
var
|
|
372
|
-
return __generator(this, function (
|
|
373
|
-
switch (
|
|
370
|
+
var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, mobileData, _c, auth_token, device_token, service_name, _d, scope, redirectUrl, authData, isScopeAuthentication, bi, isDataHasOperator, payload, data, authId, urlQueryStart, _e, brandList, entityList, isSaudi, next;
|
|
371
|
+
var _f, _g;
|
|
372
|
+
return __generator(this, function (_h) {
|
|
373
|
+
switch (_h.label) {
|
|
374
374
|
case 0:
|
|
375
375
|
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
376
376
|
_b = connectExpress.data || {}, responseData = _b.responseData, leadId = _b.leadId, isLeadIdPassed = _b.isLeadIdPassed, mobileData = _b.mobileData;
|
|
377
377
|
if (!(responseData === null || responseData === void 0 ? void 0 : responseData.authData))
|
|
378
378
|
throw new Error('Auth data is missing');
|
|
379
379
|
_c = responseData.authData, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name;
|
|
380
|
-
|
|
381
|
-
|
|
380
|
+
_d = settings.data.appConfig, scope = _d.scope, redirectUrl = _d.redirectUrl, authData = _d.data;
|
|
381
|
+
isScopeAuthentication = scope === SCOPE_AUTH;
|
|
382
382
|
bi = settings.data.deviceInfo.browser.browser_id;
|
|
383
|
-
isDataHasOperator =
|
|
383
|
+
isDataHasOperator = authData === null || authData === void 0 ? void 0 : authData.includes('operator');
|
|
384
384
|
payload = {
|
|
385
385
|
auth_token: auth_token,
|
|
386
386
|
lead_id: leadId,
|
|
@@ -395,9 +395,10 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
|
|
|
395
395
|
};
|
|
396
396
|
return [4, API.authService.verifyExpressAuth(payload)];
|
|
397
397
|
case 1:
|
|
398
|
-
data =
|
|
399
|
-
(
|
|
398
|
+
data = _h.sent();
|
|
399
|
+
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
|
|
400
400
|
authId = data.auth.id;
|
|
401
|
+
thunkApi.dispatch(storeAuthId(authId));
|
|
401
402
|
if (isScopeAuthentication && redirectUrl && !data.new_user && !isDataHasOperator && authId) {
|
|
402
403
|
urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
403
404
|
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|
|
@@ -406,15 +407,15 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
|
|
|
406
407
|
if (!(isScopeAuthentication && redirectUrl && !data.new_user && isDataHasOperator)) return [3, 3];
|
|
407
408
|
return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
|
|
408
409
|
case 2:
|
|
409
|
-
|
|
410
|
+
_e = _h.sent(), brandList = _e.brandList, entityList = _e.entityList;
|
|
410
411
|
if (brandList.length && entityList.length) {
|
|
411
412
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP')); });
|
|
412
413
|
return [2, data];
|
|
413
414
|
}
|
|
414
|
-
|
|
415
|
+
_h.label = 3;
|
|
415
416
|
case 3: return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead_id)).unwrap()];
|
|
416
417
|
case 4:
|
|
417
|
-
|
|
418
|
+
_h.sent();
|
|
418
419
|
isSaudi = isSA(settings.data.businessCountry.iso2);
|
|
419
420
|
next = isSaudi ? 'CONNECT_EXPRESS_NID_MISSED_STEP' : 'CONNECT_EXPRESS_CIVIL_ID_MISSED_STEP';
|
|
420
421
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep(next)); });
|
|
@@ -423,20 +424,20 @@ export var verifyMobileOtpAsync = createAsyncThunk('connectExpress/verifyMobileO
|
|
|
423
424
|
});
|
|
424
425
|
}); });
|
|
425
426
|
export var verifyNIDOtpAsync = createAsyncThunk('connectExpress/verifyNIDOtpAsync', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
426
|
-
var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, nidData, _c, auth_token, device_token, service_name,
|
|
427
|
-
var
|
|
428
|
-
return __generator(this, function (
|
|
429
|
-
switch (
|
|
427
|
+
var _a, settings, connectExpress, _b, responseData, leadId, isLeadIdPassed, nidData, _c, auth_token, device_token, service_name, _d, scope, redirectUrl, authData, isScopeAuthentication, bi, isDataHasOperator, payload, data, authId, urlQueryStart, _e, brandList, entityList, stepName, needToCollectMoreInfo, creatingAccount;
|
|
428
|
+
var _f, _g;
|
|
429
|
+
return __generator(this, function (_h) {
|
|
430
|
+
switch (_h.label) {
|
|
430
431
|
case 0:
|
|
431
432
|
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
432
433
|
_b = connectExpress.data || {}, responseData = _b.responseData, leadId = _b.leadId, isLeadIdPassed = _b.isLeadIdPassed, nidData = _b.nidData;
|
|
433
434
|
if (!(responseData === null || responseData === void 0 ? void 0 : responseData.authData))
|
|
434
435
|
throw new Error('Auth data is missing');
|
|
435
436
|
_c = responseData.authData, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name;
|
|
436
|
-
|
|
437
|
-
|
|
437
|
+
_d = settings.data.appConfig, scope = _d.scope, redirectUrl = _d.redirectUrl, authData = _d.data;
|
|
438
|
+
isScopeAuthentication = scope === SCOPE_AUTH;
|
|
438
439
|
bi = settings.data.deviceInfo.browser.browser_id;
|
|
439
|
-
isDataHasOperator =
|
|
440
|
+
isDataHasOperator = authData === null || authData === void 0 ? void 0 : authData.includes('operator');
|
|
440
441
|
payload = {
|
|
441
442
|
auth_token: auth_token,
|
|
442
443
|
lead_id: leadId,
|
|
@@ -451,9 +452,10 @@ export var verifyNIDOtpAsync = createAsyncThunk('connectExpress/verifyNIDOtpAsyn
|
|
|
451
452
|
};
|
|
452
453
|
return [4, API.authService.verifyExpressAuth(payload)];
|
|
453
454
|
case 1:
|
|
454
|
-
data =
|
|
455
|
-
(
|
|
455
|
+
data = _h.sent();
|
|
456
|
+
(_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
|
|
456
457
|
authId = data.auth.id;
|
|
458
|
+
thunkApi.dispatch(storeAuthId(authId));
|
|
457
459
|
if (isScopeAuthentication && redirectUrl && !data.new_user && !isDataHasOperator && authId) {
|
|
458
460
|
urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
459
461
|
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|
|
@@ -462,15 +464,15 @@ export var verifyNIDOtpAsync = createAsyncThunk('connectExpress/verifyNIDOtpAsyn
|
|
|
462
464
|
if (!(isScopeAuthentication && redirectUrl && !data.new_user && isDataHasOperator)) return [3, 3];
|
|
463
465
|
return [4, thunkApi.dispatch(retrieveAuthenticationListAsync({ individualId: data.individual_id })).unwrap()];
|
|
464
466
|
case 2:
|
|
465
|
-
|
|
467
|
+
_e = _h.sent(), brandList = _e.brandList, entityList = _e.entityList;
|
|
466
468
|
if (brandList.length && entityList.length) {
|
|
467
469
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP')); });
|
|
468
470
|
return [2, data];
|
|
469
471
|
}
|
|
470
|
-
|
|
472
|
+
_h.label = 3;
|
|
471
473
|
case 3: return [4, thunkApi.dispatch(getLeadByIdAsync(data.lead.id)).unwrap()];
|
|
472
474
|
case 4:
|
|
473
|
-
|
|
475
|
+
_h.sent();
|
|
474
476
|
stepName = data.step_name;
|
|
475
477
|
needToCollectMoreInfo = stepName === 'collect_info';
|
|
476
478
|
creatingAccount = stepName === 'create_account';
|
|
@@ -704,16 +706,16 @@ export var checkBrandNameAvailabilityAsync = createAsyncThunk('connectExpress/ch
|
|
|
704
706
|
});
|
|
705
707
|
});
|
|
706
708
|
export var createAccountAsync = createAsyncThunk('connectExpress/createAccountAsync', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
707
|
-
var _a, connectExpress, settings, _b,
|
|
709
|
+
var _a, connectExpress, settings, _b, responseData, showBoard, body, data, _c, boardInfo, boardData;
|
|
708
710
|
var _d, _e, _f, _g, _h, _j;
|
|
709
711
|
return __generator(this, function (_k) {
|
|
710
712
|
switch (_k.label) {
|
|
711
713
|
case 0:
|
|
712
714
|
_a = thunkApi.getState(), connectExpress = _a.connectExpress, settings = _a.settings;
|
|
713
|
-
_b = connectExpress.data,
|
|
715
|
+
_b = connectExpress.data, responseData = _b.responseData, showBoard = _b.showBoard;
|
|
714
716
|
body = {
|
|
715
717
|
lead_id: responseData === null || responseData === void 0 ? void 0 : responseData.leadData.id,
|
|
716
|
-
post_url: postURL
|
|
718
|
+
post_url: settings.data.appConfig.postURL || ''
|
|
717
719
|
};
|
|
718
720
|
return [4, API.accountService.expressCreateAccount(body)];
|
|
719
721
|
case 1:
|
|
@@ -821,25 +823,25 @@ export var updateLeadBusinessDataAsync = createAsyncThunk('updateLeadBusinessDat
|
|
|
821
823
|
export var updateOperatorInfoAsync = createAsyncThunk('connectExpress/updateOperatorInfoAsync', function (_a, thunkApi) {
|
|
822
824
|
var terminalInfo = _a.terminalInfo;
|
|
823
825
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
824
|
-
var _b, connectExpress, settings, _c, postURL,
|
|
826
|
+
var _b, connectExpress, settings, responseData, _c, postURL, redirectUrl, bi, body, data, authId, urlQueryStart;
|
|
825
827
|
var _d, _e, _f, _g, _h;
|
|
826
828
|
return __generator(this, function (_j) {
|
|
827
829
|
switch (_j.label) {
|
|
828
830
|
case 0:
|
|
829
831
|
_b = thunkApi.getState(), connectExpress = _b.connectExpress, settings = _b.settings;
|
|
830
|
-
|
|
831
|
-
|
|
832
|
+
responseData = connectExpress.data.responseData;
|
|
833
|
+
_c = settings.data.appConfig, postURL = _c.postURL, redirectUrl = _c.redirectUrl;
|
|
832
834
|
bi = settings.data.deviceInfo.browser.browser_id;
|
|
833
835
|
body = {
|
|
834
836
|
id: ((_d = terminalInfo === null || terminalInfo === void 0 ? void 0 : terminalInfo.operator) === null || _d === void 0 ? void 0 : _d.id) || '',
|
|
835
|
-
post_url: postURL
|
|
837
|
+
post_url: postURL || ''
|
|
836
838
|
};
|
|
837
839
|
return [4, API.operatorService.updateOperator(body)];
|
|
838
840
|
case 1:
|
|
839
841
|
data = _j.sent();
|
|
840
842
|
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, data);
|
|
841
843
|
authId = (_h = (_g = responseData === null || responseData === void 0 ? void 0 : responseData.authData) === null || _g === void 0 ? void 0 : _g.auth) === null || _h === void 0 ? void 0 : _h.id;
|
|
842
|
-
if (authId) {
|
|
844
|
+
if (authId && redirectUrl) {
|
|
843
845
|
urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
844
846
|
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|
|
845
847
|
}
|
|
@@ -849,33 +851,16 @@ export var updateOperatorInfoAsync = createAsyncThunk('connectExpress/updateOper
|
|
|
849
851
|
});
|
|
850
852
|
});
|
|
851
853
|
export var onCloseCompleteAsync = createAsyncThunk('connectExpress/onCloseCompleteAsync', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
852
|
-
var
|
|
853
|
-
var
|
|
854
|
-
return __generator(this, function (
|
|
855
|
-
switch (
|
|
854
|
+
var connectExpress, id;
|
|
855
|
+
var _a, _b;
|
|
856
|
+
return __generator(this, function (_c) {
|
|
857
|
+
switch (_c.label) {
|
|
856
858
|
case 0:
|
|
857
|
-
|
|
858
|
-
_b = connectExpress.data
|
|
859
|
-
|
|
860
|
-
bi = settings.data.deviceInfo.browser.browser_id;
|
|
861
|
-
merchant = ((responseData === null || responseData === void 0 ? void 0 : responseData.boardData) || {}).merchant;
|
|
862
|
-
return [4, thunkApi.dispatch(getTerminalListAsync(merchant === null || merchant === void 0 ? void 0 : merchant.id)).unwrap()];
|
|
859
|
+
connectExpress = thunkApi.getState().connectExpress;
|
|
860
|
+
id = (((_b = (_a = connectExpress.data.responseData) === null || _a === void 0 ? void 0 : _a.boardData) === null || _b === void 0 ? void 0 : _b.merchant) || {}).id;
|
|
861
|
+
return [4, thunkApi.dispatch(onCloseComplete(id))];
|
|
863
862
|
case 1:
|
|
864
|
-
|
|
865
|
-
id = ((_d = (_c = list === null || list === void 0 ? void 0 : list[0]) === null || _c === void 0 ? void 0 : _c.operator) === null || _d === void 0 ? void 0 : _d.id) || '';
|
|
866
|
-
body = {
|
|
867
|
-
id: id,
|
|
868
|
-
post_url: postURL
|
|
869
|
-
};
|
|
870
|
-
return [4, API.operatorService.updateOperator(body)];
|
|
871
|
-
case 2:
|
|
872
|
-
data = _j.sent();
|
|
873
|
-
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, data);
|
|
874
|
-
authId = (_h = (_g = responseData === null || responseData === void 0 ? void 0 : responseData.authData) === null || _g === void 0 ? void 0 : _g.auth) === null || _h === void 0 ? void 0 : _h.id;
|
|
875
|
-
if (authId) {
|
|
876
|
-
urlQueryStart = redirectUrl.includes('?') ? '&' : '?';
|
|
877
|
-
window.open("".concat(redirectUrl).concat(urlQueryStart, "authentication_id=").concat(authId, "&bi=").concat(bi), '_self');
|
|
878
|
-
}
|
|
863
|
+
_c.sent();
|
|
879
864
|
return [2];
|
|
880
865
|
}
|
|
881
866
|
});
|
|
@@ -889,9 +874,6 @@ var initialState = {
|
|
|
889
874
|
data: {
|
|
890
875
|
showBoard: true,
|
|
891
876
|
isLeadIdPassed: false,
|
|
892
|
-
postURL: '',
|
|
893
|
-
redirectUrl: '',
|
|
894
|
-
authData: [],
|
|
895
877
|
flowName: FlowsTypes.CONNECT_EXPRESS,
|
|
896
878
|
mobileData: {
|
|
897
879
|
countryCode: defaultCountry,
|
|
@@ -939,12 +921,6 @@ export var connectSlice = createSlice({
|
|
|
939
921
|
setShowBoard: function (state, action) {
|
|
940
922
|
state.data.showBoard = action.payload;
|
|
941
923
|
},
|
|
942
|
-
setRedirectUrl: function (state, action) {
|
|
943
|
-
state.data.redirectUrl = action.payload;
|
|
944
|
-
},
|
|
945
|
-
setAuthData: function (state, action) {
|
|
946
|
-
state.data.authData = action.payload;
|
|
947
|
-
},
|
|
948
924
|
setIsLeadIdPassed: function (state, action) {
|
|
949
925
|
state.data.isLeadIdPassed = action.payload;
|
|
950
926
|
},
|
|
@@ -969,9 +945,6 @@ export var connectSlice = createSlice({
|
|
|
969
945
|
resetOTPValue: function (state) {
|
|
970
946
|
state.data.otpData.otp = '';
|
|
971
947
|
},
|
|
972
|
-
setPostUrl: function (state, action) {
|
|
973
|
-
state.data.postURL = action.payload;
|
|
974
|
-
},
|
|
975
948
|
resetStore: function (state) {
|
|
976
949
|
state.data = __assign(__assign({}, state.data), { responseData: undefined });
|
|
977
950
|
},
|
|
@@ -1391,6 +1364,6 @@ export var connectSlice = createSlice({
|
|
|
1391
1364
|
});
|
|
1392
1365
|
}
|
|
1393
1366
|
});
|
|
1394
|
-
export var clearError = (_a = connectSlice.actions, _a.clearError), stopLoader = _a.stopLoader, setIsLeadIdPassed = _a.setIsLeadIdPassed, resetMobileScreen = _a.resetMobileScreen, resetOTPValue = _a.resetOTPValue, resetNIDScreen = _a.resetNIDScreen, resetCivilScreen = _a.resetCivilScreen, resetStore = _a.resetStore, setError = _a.setError,
|
|
1367
|
+
export var clearError = (_a = connectSlice.actions, _a.clearError), stopLoader = _a.stopLoader, setIsLeadIdPassed = _a.setIsLeadIdPassed, resetMobileScreen = _a.resetMobileScreen, resetOTPValue = _a.resetOTPValue, resetNIDScreen = _a.resetNIDScreen, resetCivilScreen = _a.resetCivilScreen, resetStore = _a.resetStore, setError = _a.setError, setLeadId = _a.setLeadId, setShowBoard = _a.setShowBoard, resetIndividualScreen = _a.resetIndividualScreen;
|
|
1395
1368
|
export default connectSlice.reducer;
|
|
1396
1369
|
export var connectExpressSelector = function (state) { return state.connectExpress; };
|
|
@@ -61,6 +61,7 @@ export declare const updateBoardSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
61
61
|
response: any;
|
|
62
62
|
formData: void;
|
|
63
63
|
} | undefined, void, {}>;
|
|
64
|
+
export declare const onCloseCompleteEntity: import("@reduxjs/toolkit").AsyncThunk<void, void, {}>;
|
|
64
65
|
declare type VerifyData = {
|
|
65
66
|
token: string;
|
|
66
67
|
};
|
|
@@ -60,7 +60,7 @@ var _a;
|
|
|
60
60
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
61
61
|
import API from '../../../api';
|
|
62
62
|
import { BusinessType, DocumentPurpose, FlowsTypes, LicenseType } from '../../../@types';
|
|
63
|
-
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
|
|
63
|
+
import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
64
64
|
import { ENTITY_STEP_NAMES } from '../../../constants';
|
|
65
65
|
import moment from 'moment';
|
|
66
66
|
import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedValue, hasNoneEditableValue, sleep, formatNumberAsCurrency, removeAllCharsFromNumber, retrieveIndividualData } from '../../../utils';
|
|
@@ -452,6 +452,21 @@ export var updateBoardSuccess = createAsyncThunk('updateBoardEntitySuccess', fun
|
|
|
452
452
|
}
|
|
453
453
|
});
|
|
454
454
|
}); });
|
|
455
|
+
export var onCloseCompleteEntity = createAsyncThunk('entity/onCloseCompleteEntity', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
456
|
+
var entity, id;
|
|
457
|
+
var _a;
|
|
458
|
+
return __generator(this, function (_b) {
|
|
459
|
+
switch (_b.label) {
|
|
460
|
+
case 0:
|
|
461
|
+
entity = thunkApi.getState().entity;
|
|
462
|
+
id = (((_a = entity.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.merchant) || {}).id;
|
|
463
|
+
return [4, thunkApi.dispatch(onCloseComplete(id))];
|
|
464
|
+
case 1:
|
|
465
|
+
_b.sent();
|
|
466
|
+
return [2];
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
}); });
|
|
455
470
|
var initialState = {
|
|
456
471
|
error: null,
|
|
457
472
|
loading: false,
|
|
@@ -739,6 +754,18 @@ export var entitySlice = createSlice({
|
|
|
739
754
|
.addCase(updateBoardSuccess.rejected, function (state, action) {
|
|
740
755
|
state.loading = false;
|
|
741
756
|
state.error = action.error.message;
|
|
757
|
+
})
|
|
758
|
+
.addCase(onCloseCompleteEntity.pending, function (state) {
|
|
759
|
+
state.loading = true;
|
|
760
|
+
state.error = null;
|
|
761
|
+
})
|
|
762
|
+
.addCase(onCloseCompleteEntity.fulfilled, function (state) {
|
|
763
|
+
state.loading = false;
|
|
764
|
+
state.error = null;
|
|
765
|
+
})
|
|
766
|
+
.addCase(onCloseCompleteEntity.rejected, function (state, action) {
|
|
767
|
+
state.loading = false;
|
|
768
|
+
state.error = action.error.message;
|
|
742
769
|
});
|
|
743
770
|
}
|
|
744
771
|
});
|