@tap-payments/auth-jsconnect 2.9.1-development → 2.9.2-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/api/auth.d.ts +15 -1
- package/build/api/index.d.ts +3 -3
- package/build/features/app/kyc/kycStore.js +18 -27
- package/package.json +1 -1
package/build/api/auth.d.ts
CHANGED
|
@@ -47,6 +47,20 @@ export type CreateNafathAuthBody = {
|
|
|
47
47
|
board_id?: string;
|
|
48
48
|
user_id?: string;
|
|
49
49
|
};
|
|
50
|
+
export type CreateKYCAuthBody = {
|
|
51
|
+
country: string;
|
|
52
|
+
scope: string;
|
|
53
|
+
auth_type?: number;
|
|
54
|
+
email_url?: string;
|
|
55
|
+
sign_in?: boolean;
|
|
56
|
+
is_lead?: boolean;
|
|
57
|
+
step_name?: string;
|
|
58
|
+
encryption_contract: Array<string>;
|
|
59
|
+
lang?: LanguageMode;
|
|
60
|
+
lead_id?: string;
|
|
61
|
+
board_id?: string;
|
|
62
|
+
user_id?: string;
|
|
63
|
+
};
|
|
50
64
|
export type VerifyAuthBody = {
|
|
51
65
|
auth_token: string;
|
|
52
66
|
auth_type: number;
|
|
@@ -104,7 +118,7 @@ export type getExpressTokenVerifyParams = {
|
|
|
104
118
|
};
|
|
105
119
|
export type ConfigBody = Pick<ConfigInfo, 'scope' | 'data' | 'lead' | 'board' | 'interface' | 'redirect' | 'post'>;
|
|
106
120
|
declare const authService: {
|
|
107
|
-
createAuth: (data: CreateAuthBody, config?: AxiosRequestConfig) => Promise<any>;
|
|
121
|
+
createAuth: (data: CreateAuthBody | CreateKYCAuthBody, config?: AxiosRequestConfig) => Promise<any>;
|
|
108
122
|
verifyAuth: (data: VerifyAuthBody | VerifyOperationAuthBody, config?: AxiosRequestConfig) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
109
123
|
createPassword: (data: CreatePasswordBody) => Promise<any>;
|
|
110
124
|
verifyExpressAuth: (data: VerifyAuthExpressOTPBody) => Promise<any>;
|
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 } from './auth';
|
|
3
|
+
import { CreateAuthBody, VerifyAuthBody, CreatePasswordBody, VerifyOperationAuthBody, ResetPasswordVerifyAuthBody, VerifyAuthExpressOTPBody, ConfigBody, CreateNafathAuthBody, CreateKYCAuthBody } 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';
|
|
@@ -30,7 +30,7 @@ declare const API: {
|
|
|
30
30
|
getCurrency: (countryCode: string) => Promise<any>;
|
|
31
31
|
};
|
|
32
32
|
authService: {
|
|
33
|
-
createAuth: (data: CreateAuthBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
33
|
+
createAuth: (data: CreateAuthBody | CreateKYCAuthBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<any>;
|
|
34
34
|
verifyAuth: (data: VerifyAuthBody | VerifyOperationAuthBody, config?: import("axios").AxiosRequestConfig<any> | undefined) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
35
35
|
createPassword: (data: CreatePasswordBody) => Promise<any>;
|
|
36
36
|
verifyExpressAuth: (data: VerifyAuthExpressOTPBody) => Promise<any>;
|
|
@@ -164,6 +164,6 @@ declare const API: {
|
|
|
164
164
|
getInitialData: (body: InitBody) => Promise<any>;
|
|
165
165
|
};
|
|
166
166
|
};
|
|
167
|
-
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 };
|
|
167
|
+
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 };
|
|
168
168
|
export { setAxiosGlobalHeaders, removeAxiosGlobalHeaders, axiosInstance, getAxiosHeaders };
|
|
169
169
|
export default API;
|
|
@@ -49,7 +49,7 @@ var _a;
|
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
50
|
import { handlePublicKey, handleSetCountryByIso2 } from '../../../app/settings';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
|
-
import { CONNECT_FLOWS,
|
|
52
|
+
import { CONNECT_FLOWS, KYC_STEP_NAMES } from '../../../constants';
|
|
53
53
|
import API from '../../../api';
|
|
54
54
|
import { sendCustomEventToGTM, sleep } from '../../../utils';
|
|
55
55
|
export var verifyTokenApi = createAsyncThunk('kyc/verifyTokenApi', function (_a, thunkApi) {
|
|
@@ -98,65 +98,56 @@ export var verifyTokenApi = createAsyncThunk('kyc/verifyTokenApi', function (_a,
|
|
|
98
98
|
});
|
|
99
99
|
});
|
|
100
100
|
export var createPaciAuth = createAsyncThunk('kyc/createPaciAuth', function (user, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
101
|
-
var _a, settings, kyc, verifyTokenData,
|
|
102
|
-
var
|
|
103
|
-
return __generator(this, function (
|
|
104
|
-
switch (
|
|
101
|
+
var _a, settings, kyc, verifyTokenData, id, requestBody, data, nextScreen;
|
|
102
|
+
var _b, _c;
|
|
103
|
+
return __generator(this, function (_d) {
|
|
104
|
+
switch (_d.label) {
|
|
105
105
|
case 0:
|
|
106
106
|
_a = thunkApi.getState(), settings = _a.settings, kyc = _a.kyc;
|
|
107
107
|
verifyTokenData = (kyc.data.responseData || {}).verifyTokenData;
|
|
108
|
-
|
|
108
|
+
id = (user || {}).id;
|
|
109
109
|
requestBody = {
|
|
110
110
|
country: settings.data.businessCountry.iso2,
|
|
111
111
|
lang: settings.data.language,
|
|
112
|
-
user_credentail: {
|
|
113
|
-
identification_id: identification === null || identification === void 0 ? void 0 : identification.id,
|
|
114
|
-
country_code: 'KW'
|
|
115
|
-
},
|
|
116
112
|
is_lead: false,
|
|
117
113
|
scope: 'auth',
|
|
118
114
|
board_id: verifyTokenData === null || verifyTokenData === void 0 ? void 0 : verifyTokenData.boardId,
|
|
119
115
|
user_id: id,
|
|
120
116
|
step_name: KYC_STEP_NAMES.KYC_CREATE_PACI,
|
|
121
|
-
encryption_contract: [
|
|
117
|
+
encryption_contract: []
|
|
122
118
|
};
|
|
123
119
|
return [4, API.authService.createAuth(requestBody)];
|
|
124
120
|
case 1:
|
|
125
|
-
data =
|
|
126
|
-
(
|
|
121
|
+
data = _d.sent();
|
|
122
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, { id: id });
|
|
127
123
|
nextScreen = CONNECT_FLOWS.kyc.verifyPACI;
|
|
128
124
|
return [2, { data: data, nextScreen: nextScreen }];
|
|
129
125
|
}
|
|
130
126
|
});
|
|
131
127
|
}); });
|
|
132
128
|
export var createNafathAuth = createAsyncThunk('kyc/createNafathAuth', function (user, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
133
|
-
var _a, settings, kyc, verifyTokenData,
|
|
134
|
-
var
|
|
135
|
-
return __generator(this, function (
|
|
136
|
-
switch (
|
|
129
|
+
var _a, settings, kyc, verifyTokenData, id, requestBody, data, nextScreen;
|
|
130
|
+
var _b, _c;
|
|
131
|
+
return __generator(this, function (_d) {
|
|
132
|
+
switch (_d.label) {
|
|
137
133
|
case 0:
|
|
138
134
|
_a = thunkApi.getState(), settings = _a.settings, kyc = _a.kyc;
|
|
139
135
|
verifyTokenData = (kyc.data.responseData || {}).verifyTokenData;
|
|
140
|
-
|
|
136
|
+
id = (user || {}).id;
|
|
141
137
|
requestBody = {
|
|
142
138
|
country: settings.data.businessCountry.iso2,
|
|
143
139
|
lang: settings.data.language,
|
|
144
|
-
user_credentail: {
|
|
145
|
-
identification_id: identification === null || identification === void 0 ? void 0 : identification.id,
|
|
146
|
-
identification_id_type: IDENTIFICATION_TYPE.NAFATH,
|
|
147
|
-
country_code: settings.data.businessCountry.iso2
|
|
148
|
-
},
|
|
149
140
|
is_lead: false,
|
|
150
141
|
scope: 'auth',
|
|
151
142
|
board_id: verifyTokenData === null || verifyTokenData === void 0 ? void 0 : verifyTokenData.boardId,
|
|
152
143
|
user_id: id,
|
|
153
144
|
step_name: KYC_STEP_NAMES.KYC_CREATE_NAFATH,
|
|
154
|
-
encryption_contract: [
|
|
145
|
+
encryption_contract: []
|
|
155
146
|
};
|
|
156
|
-
return [4, API.authService.
|
|
147
|
+
return [4, API.authService.createAuth(requestBody)];
|
|
157
148
|
case 1:
|
|
158
|
-
data =
|
|
159
|
-
(
|
|
149
|
+
data = _d.sent();
|
|
150
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
|
|
160
151
|
nextScreen = CONNECT_FLOWS.kyc.verifyNafath;
|
|
161
152
|
return [2, { data: data, nextScreen: nextScreen }];
|
|
162
153
|
}
|