@tap-payments/auth-jsconnect 2.8.87-development → 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/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +2 -0
- package/build/constants/app.js +2 -0
- package/build/features/app/connect/connectStore.js +2 -1
- package/build/features/app/connectExpress/connectExpressStore.js +3 -3
- package/build/features/app/individual/individualStore.js +1 -0
- package/build/utils/common.d.ts +1 -0
- package/build/utils/common.js +17 -4
- 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;
|
|
@@ -33,7 +33,7 @@ var StyledTooltip = styled(function (_a) {
|
|
|
33
33
|
var _b;
|
|
34
34
|
var theme = _a.theme;
|
|
35
35
|
return (_b = {},
|
|
36
|
-
_b["& .".concat(tooltipClasses.tooltip)] = __assign(__assign({ color: alpha(theme.palette.text.primary, 0.5), width: 'fit-content', maxHeight: 'fit-content' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight, backgroundColor: theme.palette.secondary.light, border: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) }),
|
|
36
|
+
_b["& .".concat(tooltipClasses.tooltip)] = __assign(__assign({ color: alpha(theme.palette.text.primary, 0.5), width: 'fit-content', maxHeight: 'fit-content' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightLight, backgroundColor: theme.palette.secondary.light, border: "1px solid ".concat(alpha(theme.palette.divider, 0.8)), zIndex: 2147483647 }),
|
|
37
37
|
_b);
|
|
38
38
|
});
|
|
39
39
|
var TextStyled = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
|
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,5 +1,7 @@
|
|
|
1
1
|
import { ScreenStepNavigation, BusinessType } from '../@types';
|
|
2
2
|
export declare const CONNECT_DEV_URL = "https://connect.dev.tap.company";
|
|
3
|
+
export declare const CONNECT_SANDBOX_URL = "https://connect.sandbox.tap.company";
|
|
4
|
+
export declare const CONNECT_BETA_URL = "https://connect.beta.tap.company";
|
|
3
5
|
export declare const CONNECT_PROD_URL = "https://connect.tap.company";
|
|
4
6
|
export declare const CLIENT_ORIGIN: string;
|
|
5
7
|
export declare const TAP_WEBSITE = "https://www.tap.company/";
|
package/build/constants/app.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BusinessType } from '../@types';
|
|
2
2
|
export var CONNECT_DEV_URL = 'https://connect.dev.tap.company';
|
|
3
|
+
export var CONNECT_SANDBOX_URL = 'https://connect.sandbox.tap.company';
|
|
4
|
+
export var CONNECT_BETA_URL = 'https://connect.beta.tap.company';
|
|
3
5
|
export var CONNECT_PROD_URL = 'https://connect.tap.company';
|
|
4
6
|
export var CLIENT_ORIGIN = window.location.origin;
|
|
5
7
|
export var TAP_WEBSITE = 'https://www.tap.company/';
|
|
@@ -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) {
|
|
@@ -770,7 +770,7 @@ export var verifyPaciLeadIdentityAsync = createAsyncThunk('connectExpress/verify
|
|
|
770
770
|
case 6:
|
|
771
771
|
count++;
|
|
772
772
|
return [3, 1];
|
|
773
|
-
case 7: throw new Error('
|
|
773
|
+
case 7: throw new Error('nafath_verification_failed');
|
|
774
774
|
}
|
|
775
775
|
});
|
|
776
776
|
}); });
|
|
@@ -977,7 +977,7 @@ export var updateLeadIndividualAsync = createAsyncThunk('connectExpress/updateLe
|
|
|
977
977
|
isContactAvailable = email || mobile;
|
|
978
978
|
payload = __assign(__assign({ id: id || '', country_code: (_e = settings.data.businessCountry) === null || _e === void 0 ? void 0 : _e.iso2, name: getIndividualName(name) }, (isContactAvailable && {
|
|
979
979
|
contact: __assign({ email: email }, (mobile && { phone: { country_code: phoneCountry, number: mobile } }))
|
|
980
|
-
})), { 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'] });
|
|
981
981
|
return [4, API.leadService.updateLeadExpress(payload)];
|
|
982
982
|
case 1:
|
|
983
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,
|
|
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,10 +14,10 @@ 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
|
-
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.
|
|
20
|
+
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
|
|
20
21
|
};
|
|
21
22
|
export var updateLocationUrlWithCountry = function (countryIso2) {
|
|
22
23
|
var country = countryIso2.toLowerCase();
|
|
@@ -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": {
|