@tap-payments/auth-jsconnect 2.8.86-sandbox → 2.8.88-beta
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/lead.d.ts +8 -3
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +1 -0
- package/build/constants/app.js +1 -0
- package/build/features/app/auth/authStore.js +16 -14
- package/build/features/app/connect/connectStore.js +2 -1
- package/build/features/app/connectExpress/connectExpressStore.js +10 -9
- package/build/features/app/individual/individualStore.js +1 -0
- package/build/utils/common.d.ts +1 -0
- package/build/utils/common.js +16 -3
- package/build/utils/object.d.ts +1 -0
- package/build/utils/object.js +3 -0
- package/package.json +2 -2
package/build/api/lead.d.ts
CHANGED
|
@@ -22,6 +22,13 @@ type BrandTitle = {
|
|
|
22
22
|
ar?: string;
|
|
23
23
|
zh?: string;
|
|
24
24
|
};
|
|
25
|
+
type MetaData = {
|
|
26
|
+
utm_source?: string;
|
|
27
|
+
utm_medium?: string;
|
|
28
|
+
utm_campaign?: string;
|
|
29
|
+
utm_term?: string;
|
|
30
|
+
utm_content?: string;
|
|
31
|
+
};
|
|
25
32
|
type BrandContent = {
|
|
26
33
|
tag_line?: BrandTitle;
|
|
27
34
|
about?: BrandTitle;
|
|
@@ -49,9 +56,7 @@ export type UpdateLeadBody = {
|
|
|
49
56
|
business_type?: string;
|
|
50
57
|
country_code?: string;
|
|
51
58
|
brand?: BrandInfo;
|
|
52
|
-
metadata?:
|
|
53
|
-
check: string;
|
|
54
|
-
};
|
|
59
|
+
metadata?: MetaData;
|
|
55
60
|
note?: string;
|
|
56
61
|
source?: {
|
|
57
62
|
business_id?: string;
|
package/build/constants/api.d.ts
CHANGED
package/build/constants/api.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var SANDBOX_BASE_URL = 'https://connect-mw.sandbox.tap.company/middleware';
|
|
2
2
|
var PRODUCTION_BASE_URL = 'https://connect-mw.tap.company/middleware';
|
|
3
3
|
var DEV_BASE_URL = 'https://connect-mw.dev.tap.company/middleware';
|
|
4
|
+
var BETA_BASE_URL = 'https://connect-mw.beta.tap.company/middleware';
|
|
4
5
|
var API_BUSINESS_COUNTRIES = 'https://godata.sandbox.tap.company/api/v1/business/country/list';
|
|
5
6
|
var API_COUNTRIES = 'https://utilities.tap.company/api/v1/country/list';
|
|
6
7
|
var CURRENCY_PATH = 'https://utilities.tap.company/api/v1/currency/iso';
|
|
@@ -69,6 +70,7 @@ export var ENDPOINT_PATHS = {
|
|
|
69
70
|
SANDBOX_BASE_URL: SANDBOX_BASE_URL,
|
|
70
71
|
PRODUCTION_BASE_URL: PRODUCTION_BASE_URL,
|
|
71
72
|
DEV_BASE_URL: DEV_BASE_URL,
|
|
73
|
+
BETA_BASE_URL: BETA_BASE_URL,
|
|
72
74
|
BUSINESS_COUNTRIES: API_BUSINESS_COUNTRIES,
|
|
73
75
|
COUNTRIES: API_COUNTRIES,
|
|
74
76
|
IP: IP_PATH,
|
package/build/constants/app.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ScreenStepNavigation, BusinessType } from '../@types';
|
|
2
2
|
export declare const CONNECT_DEV_URL = "https://connect.dev.tap.company";
|
|
3
3
|
export declare const CONNECT_SANDBOX_URL = "https://connect.sandbox.tap.company";
|
|
4
|
+
export declare const CONNECT_BETA_URL = "https://connect.beta.tap.company";
|
|
4
5
|
export declare const CONNECT_PROD_URL = "https://connect.tap.company";
|
|
5
6
|
export declare const CLIENT_ORIGIN: string;
|
|
6
7
|
export declare const TAP_WEBSITE = "https://www.tap.company/";
|
package/build/constants/app.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BusinessType } from '../@types';
|
|
2
2
|
export var CONNECT_DEV_URL = 'https://connect.dev.tap.company';
|
|
3
3
|
export var CONNECT_SANDBOX_URL = 'https://connect.sandbox.tap.company';
|
|
4
|
+
export var CONNECT_BETA_URL = 'https://connect.beta.tap.company';
|
|
4
5
|
export var CONNECT_PROD_URL = 'https://connect.tap.company';
|
|
5
6
|
export var CLIENT_ORIGIN = window.location.origin;
|
|
6
7
|
export var TAP_WEBSITE = 'https://www.tap.company/';
|
|
@@ -366,16 +366,17 @@ export var verifyEmailOtp = createAsyncThunk('auth/verifyEmailOtp', function (pa
|
|
|
366
366
|
});
|
|
367
367
|
}); });
|
|
368
368
|
export var createNafathAuth = createAsyncThunk('auth/createNafathAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
369
|
-
var settings, requestBody, data;
|
|
370
|
-
var
|
|
371
|
-
return __generator(this, function (
|
|
372
|
-
switch (
|
|
369
|
+
var _a, settings, auth, requestBody, data;
|
|
370
|
+
var _b, _c;
|
|
371
|
+
return __generator(this, function (_d) {
|
|
372
|
+
switch (_d.label) {
|
|
373
373
|
case 0:
|
|
374
|
-
|
|
374
|
+
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
375
375
|
requestBody = {
|
|
376
376
|
country: settings.data.businessCountry.iso2,
|
|
377
377
|
scope: settings.data.appConfig.scope,
|
|
378
378
|
lang: settings.data.language,
|
|
379
|
+
lead_id: auth.data.leadId,
|
|
379
380
|
user_credentail: {
|
|
380
381
|
identification_id: params.nid,
|
|
381
382
|
identification_id_type: IDENTIFICATION_TYPE.NAFATH,
|
|
@@ -388,9 +389,9 @@ export var createNafathAuth = createAsyncThunk('auth/createNafathAuth', function
|
|
|
388
389
|
};
|
|
389
390
|
return [4, API.authService.createAuthKitNID(requestBody)];
|
|
390
391
|
case 1:
|
|
391
|
-
data =
|
|
392
|
+
data = _d.sent();
|
|
392
393
|
thunkApi.dispatch(handleNextScreenStep());
|
|
393
|
-
(
|
|
394
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
|
|
394
395
|
return [2, { response: data, formData: params }];
|
|
395
396
|
}
|
|
396
397
|
});
|
|
@@ -444,17 +445,18 @@ export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params
|
|
|
444
445
|
});
|
|
445
446
|
}); });
|
|
446
447
|
export var createCivilIdAuth = createAsyncThunk('auth/createCivilAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
447
|
-
var settings, countryCode, requestBody, data;
|
|
448
|
-
var
|
|
449
|
-
return __generator(this, function (
|
|
450
|
-
switch (
|
|
448
|
+
var _a, settings, auth, countryCode, requestBody, data;
|
|
449
|
+
var _b, _c;
|
|
450
|
+
return __generator(this, function (_d) {
|
|
451
|
+
switch (_d.label) {
|
|
451
452
|
case 0:
|
|
452
|
-
|
|
453
|
+
_a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
|
|
453
454
|
countryCode = settings.data.businessCountry.iso2;
|
|
454
455
|
requestBody = {
|
|
455
456
|
country: settings.data.businessCountry.iso2,
|
|
456
457
|
scope: settings.data.appConfig.scope,
|
|
457
458
|
lang: settings.data.language,
|
|
459
|
+
lead_id: auth.data.leadId,
|
|
458
460
|
user_credentail: {
|
|
459
461
|
identification_id: params.civilId,
|
|
460
462
|
country_code: countryCode
|
|
@@ -466,9 +468,9 @@ export var createCivilIdAuth = createAsyncThunk('auth/createCivilAuth', function
|
|
|
466
468
|
};
|
|
467
469
|
return [4, API.authService.createAuth(requestBody)];
|
|
468
470
|
case 1:
|
|
469
|
-
data =
|
|
471
|
+
data = _d.sent();
|
|
470
472
|
thunkApi.dispatch(handleNextScreenStep());
|
|
471
|
-
(
|
|
473
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody.user_credentail);
|
|
472
474
|
return [2, { response: data, formData: params }];
|
|
473
475
|
}
|
|
474
476
|
});
|
|
@@ -71,7 +71,7 @@ import { handleCurrentActiveScreen, handleNextScreenStep, handleSetCountryByIso2
|
|
|
71
71
|
import { CONNECT_STEP_NAMES, defaultCountry, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, OTHER_BRAND } from '../../../constants';
|
|
72
72
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
73
73
|
import { AuthForType, FlowsTypes } from '../../../@types';
|
|
74
|
-
import { capitalizeTheFirstLetterOfEachWord, concatenateObjectValues, findCountryByIddPrefix, fixBrandList, isTwitter, getIndividualName, isWebsite, sleep, sendCustomEventToGTM, isOtherThanKWOrSA, isKW, findCountryByIso2 } from '../../../utils';
|
|
74
|
+
import { capitalizeTheFirstLetterOfEachWord, concatenateObjectValues, findCountryByIddPrefix, fixBrandList, isTwitter, getIndividualName, isWebsite, sleep, sendCustomEventToGTM, isOtherThanKWOrSA, isKW, findCountryByIso2, getMetaData } from '../../../utils';
|
|
75
75
|
export var updateBusinessCountry = createAsyncThunk('connect/updateBusinessCountry', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
76
76
|
var connect, payload, data;
|
|
77
77
|
return __generator(this, function (_a) {
|
|
@@ -457,6 +457,7 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
|
|
|
457
457
|
country_code: (_d = settings.data.businessCountry) === null || _d === void 0 ? void 0 : _d.iso2,
|
|
458
458
|
name: getIndividualName(params.name),
|
|
459
459
|
contact: __assign({ email: params.email }, (params.mobile && { phone: { country_code: phoneCountry, number: params.mobile } })),
|
|
460
|
+
metadata: getMetaData(),
|
|
460
461
|
step_name: CONNECT_STEP_NAMES.UPDATE_LEAD_INDIVIDUAL,
|
|
461
462
|
encryption_contract: ['name.first', 'name.middle', 'name.last', 'contact.email', 'contact.phone.country_code', 'contact.phone.number']
|
|
462
463
|
};
|
|
@@ -61,7 +61,7 @@ import { FlowsTypes, AuthForType, BusinessType, LicenseType } from '../../../@ty
|
|
|
61
61
|
import API from '../../../api';
|
|
62
62
|
import { ADD_NEW_ENTITY, CONNECT_EXPRESS_STEP_NAMES, IDENTIFICATION_TYPE, NAFATH_VERIFICATION_FAILED, OTHER_CR_LICENSE, OTHER_FL_LICENSE, SCOPE_AUTH } from '../../../constants';
|
|
63
63
|
import { defaultCountry } from '../../../constants';
|
|
64
|
-
import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA, isKW, isOtherThanKWOrSA, sendCustomEventToGTM, sendCustomDimension } from '../../../utils';
|
|
64
|
+
import { getIndividualName, capitalizeTheFirstLetterOfEachWord, sleep, findCountryByIddPrefix, concatenateObjectValues, isSA, isKW, isOtherThanKWOrSA, sendCustomEventToGTM, sendCustomDimension, getMetaData } from '../../../utils';
|
|
65
65
|
export var updateBusinessCountryAsync = createAsyncThunk('connectExpress/updateBusinessCountryAsync', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
66
|
var connectExpress, payload, data;
|
|
67
67
|
return __generator(this, function (_a) {
|
|
@@ -310,16 +310,17 @@ export var resendMobileAuthOTP = createAsyncThunk('connectExpress/resendMobileAu
|
|
|
310
310
|
});
|
|
311
311
|
}); });
|
|
312
312
|
export var createNafathAuth = createAsyncThunk('connectExpress/createNafathAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
313
|
-
var settings, requestBody, data;
|
|
314
|
-
var
|
|
315
|
-
return __generator(this, function (
|
|
316
|
-
switch (
|
|
313
|
+
var _a, settings, connectExpress, requestBody, data;
|
|
314
|
+
var _b, _c;
|
|
315
|
+
return __generator(this, function (_d) {
|
|
316
|
+
switch (_d.label) {
|
|
317
317
|
case 0:
|
|
318
|
-
|
|
318
|
+
_a = thunkApi.getState(), settings = _a.settings, connectExpress = _a.connectExpress;
|
|
319
319
|
requestBody = {
|
|
320
320
|
country: settings.data.businessCountry.iso2,
|
|
321
321
|
scope: settings.data.appConfig.scope,
|
|
322
322
|
lang: settings.data.language,
|
|
323
|
+
lead_id: connectExpress.data.leadId,
|
|
323
324
|
user_credentail: {
|
|
324
325
|
identification_id: params.nid,
|
|
325
326
|
identification_id_type: IDENTIFICATION_TYPE.NAFATH,
|
|
@@ -332,9 +333,9 @@ export var createNafathAuth = createAsyncThunk('connectExpress/createNafathAuth'
|
|
|
332
333
|
};
|
|
333
334
|
return [4, API.authService.createAuthKitNID(requestBody)];
|
|
334
335
|
case 1:
|
|
335
|
-
data =
|
|
336
|
+
data = _d.sent();
|
|
336
337
|
thunkApi.dispatch(handleNextScreenStep());
|
|
337
|
-
(
|
|
338
|
+
(_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
|
|
338
339
|
return [2, { response: data, formData: __assign(__assign({}, params), { type: IDENTIFICATION_TYPE.NAFATH }) }];
|
|
339
340
|
}
|
|
340
341
|
});
|
|
@@ -976,7 +977,7 @@ export var updateLeadIndividualAsync = createAsyncThunk('connectExpress/updateLe
|
|
|
976
977
|
isContactAvailable = email || mobile;
|
|
977
978
|
payload = __assign(__assign({ id: id || '', country_code: (_e = settings.data.businessCountry) === null || _e === void 0 ? void 0 : _e.iso2, name: getIndividualName(name) }, (isContactAvailable && {
|
|
978
979
|
contact: __assign({ email: email }, (mobile && { phone: { country_code: phoneCountry, number: mobile } }))
|
|
979
|
-
})), { step_name: CONNECT_EXPRESS_STEP_NAMES.UPDATE_LEAD_INDIVIDUAL, encryption_contract: ['name.first', 'name.middle', 'name.last', 'contact.email', 'contact.phone.country_code', 'contact.phone.number'] });
|
|
980
|
+
})), { metadata: getMetaData(), step_name: CONNECT_EXPRESS_STEP_NAMES.UPDATE_LEAD_INDIVIDUAL, encryption_contract: ['name.first', 'name.middle', 'name.last', 'contact.email', 'contact.phone.country_code', 'contact.phone.number'] });
|
|
980
981
|
return [4, API.leadService.updateLeadExpress(payload)];
|
|
981
982
|
case 1:
|
|
982
983
|
data = _h.sent();
|
|
@@ -1175,6 +1175,7 @@ export var individualSlice = createSlice({
|
|
|
1175
1175
|
state.data.individualData.isAuthorized = is_authorized;
|
|
1176
1176
|
})
|
|
1177
1177
|
.addCase(retrieveIndividualInfo.rejected, function (state, action) {
|
|
1178
|
+
state.addOrRequestDetailLoading = false;
|
|
1178
1179
|
state.error = action.error.message;
|
|
1179
1180
|
})
|
|
1180
1181
|
.addCase(getIndividualList.pending, function (state) {
|
package/build/utils/common.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export declare const dangerousMessage: (message: string, callBack?: Function) =>
|
|
|
3
3
|
export declare const setBaseUrl: (publicKey: string) => void;
|
|
4
4
|
export declare const updateLocationUrlWithCountry: (countryIso2: string) => void;
|
|
5
5
|
export declare const openConnect: (pk: string, countryCode?: string) => void;
|
|
6
|
+
export declare function getMetaData(): Record<string, string> | undefined;
|
package/build/utils/common.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { axiosInstance } from '../api';
|
|
2
|
-
import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL,
|
|
2
|
+
import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_BETA_URL } from '../constants';
|
|
3
|
+
import { objectHasValues } from './object';
|
|
3
4
|
export var sleep = function (milliseconds) {
|
|
4
5
|
if (milliseconds === void 0) { milliseconds = 1000; }
|
|
5
6
|
return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
|
|
@@ -13,7 +14,7 @@ export var dangerousMessage = function (message, callBack) {
|
|
|
13
14
|
export var setBaseUrl = function (publicKey) {
|
|
14
15
|
var isProd = publicKey.includes('pk_live');
|
|
15
16
|
if (isProd) {
|
|
16
|
-
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.
|
|
17
|
+
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.BETA_BASE_URL;
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
20
|
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
|
|
@@ -35,9 +36,21 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
|
|
|
35
36
|
window.history.replaceState({}, '', newUrl);
|
|
36
37
|
};
|
|
37
38
|
export var openConnect = function (pk, countryCode) {
|
|
38
|
-
var newUrl = new URL(pk.includes('pk_live') ?
|
|
39
|
+
var newUrl = new URL(pk.includes('pk_live') ? CONNECT_BETA_URL : CONNECT_SANDBOX_URL);
|
|
39
40
|
if (countryCode) {
|
|
40
41
|
newUrl.pathname = "/".concat(countryCode.toLowerCase());
|
|
41
42
|
}
|
|
42
43
|
window.open("".concat(newUrl), '_self', '_blank');
|
|
43
44
|
};
|
|
45
|
+
export function getMetaData() {
|
|
46
|
+
var urlObj = new URL(window.location.href);
|
|
47
|
+
var paramsToExtract = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'];
|
|
48
|
+
var meta_data = {};
|
|
49
|
+
paramsToExtract.forEach(function (param) {
|
|
50
|
+
var value = urlObj.searchParams.get(param);
|
|
51
|
+
if (value !== null && value !== '') {
|
|
52
|
+
meta_data[param] = value;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return objectHasValues(meta_data) ? meta_data : undefined;
|
|
56
|
+
}
|
package/build/utils/object.d.ts
CHANGED
|
@@ -8,3 +8,4 @@ export declare const hasNoneEditableValue: (obj: any, path: string) => boolean;
|
|
|
8
8
|
export declare const hasEditableValue: (obj: any, path: string) => boolean;
|
|
9
9
|
export declare const hasVerifiedValue: (obj: any, path: string) => boolean;
|
|
10
10
|
export declare function deepCopy(obj: any): any;
|
|
11
|
+
export declare function objectHasValues(obj: Record<string, any>): boolean;
|
package/build/utils/object.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.88-beta",
|
|
4
4
|
"description": "connect library, auth",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"copy:files": "copyfiles -u 1 src/**/*.css build/",
|
|
22
22
|
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
23
23
|
"ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
|
|
24
|
-
"push": "npm publish --access public --tag
|
|
24
|
+
"push": "npm publish --access public --tag beta"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [],
|
|
27
27
|
"author": {
|