@tap-payments/auth-jsconnect 2.12.9 → 2.12.10-sandbox
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/README.md +29 -0
- package/build/@types/app.d.ts +3 -0
- package/build/@types/app.js +1 -0
- package/build/@types/config.d.ts +2 -0
- package/build/@types/form.d.ts +1 -0
- package/build/api/document.d.ts +1 -1
- package/build/app/settings.d.ts +2 -1
- package/build/app/settings.js +8 -5
- package/build/assets/locales/ar.json +13 -10
- package/build/assets/locales/en.json +8 -7
- package/build/components/Slide/Slide.d.ts +1 -1
- package/build/constants/api.d.ts +1 -3
- package/build/constants/api.js +6 -4
- package/build/constants/app.d.ts +0 -1
- package/build/constants/app.js +0 -1
- package/build/features/app/brand/brandStore.js +5 -2
- package/build/features/app/connectExpress/connectExpressStore.js +21 -19
- package/build/features/app/entity/entityStore.js +56 -35
- package/build/features/auth/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
- package/build/features/bank/screens/BankDetails/BankDetails.js +1 -1
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +2 -2
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +1 -1
- 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/business/screens/Customers/RefundPolicy.d.ts +1 -1
- package/build/features/connectExpress/ConnectExpress.js +6 -5
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +9 -9
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +2 -2
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +5 -4
- 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/CollectIndividualInfo/CollectIndividualInfo.js +8 -8
- package/build/features/connectExpress/screens/NIDMissed/NID.js +5 -6
- package/build/features/connectExpress/screens/OTP/OTP.js +7 -8
- package/build/features/connectExpress/screens/OTP/OTPInput.js +5 -8
- package/build/features/entity/screens/EntityName/EntityDocumentUpload.d.ts +12 -0
- package/build/features/entity/screens/EntityName/{LicenseCertificate.js → EntityDocumentUpload.js} +10 -15
- package/build/features/entity/screens/EntityName/EntityName.js +10 -4
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +2 -2
- package/build/features/entity/screens/EntityName/validation.d.ts +9 -0
- package/build/features/entity/screens/EntityName/validation.js +3 -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 +2 -2
- package/build/features/shared/Address/InputSelect.d.ts +2 -2
- package/build/features/shared/Containers/FeatureContainer.d.ts +1 -1
- package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
- package/build/features/shared/Input/Input.d.ts +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/useIsEmailAuth.d.ts +1 -0
- package/build/hooks/useIsEmailAuth.js +11 -0
- package/build/utils/array.d.ts +1 -1
- package/build/utils/array.js +3 -2
- package/build/utils/common.js +4 -5
- package/build/utils/string.d.ts +2 -2
- package/build/utils/string.js +12 -1
- package/package.json +2 -2
- package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +0 -9
package/build/hooks/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './useSetFromDefaultValues';
|
|
|
15
15
|
export * from './useCountUp';
|
|
16
16
|
export * from './useCountDown';
|
|
17
17
|
export * from './useCountry';
|
|
18
|
+
export * from './useIsEmailAuth';
|
|
18
19
|
export * from './useVerifyToken';
|
|
19
20
|
export * from './useFormReadOnly';
|
|
20
21
|
export * from './useDataNoneEditable';
|
package/build/hooks/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from './useSetFromDefaultValues';
|
|
|
15
15
|
export * from './useCountUp';
|
|
16
16
|
export * from './useCountDown';
|
|
17
17
|
export * from './useCountry';
|
|
18
|
+
export * from './useIsEmailAuth';
|
|
18
19
|
export * from './useVerifyToken';
|
|
19
20
|
export * from './useFormReadOnly';
|
|
20
21
|
export * from './useDataNoneEditable';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsEmailAuth: () => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useAppSelector } from './useAppSelector';
|
|
3
|
+
import { settingsSelector } from '../app/settings';
|
|
4
|
+
import { getFlowStartScreen } from '../utils';
|
|
5
|
+
export var useIsEmailAuth = function () {
|
|
6
|
+
var _a;
|
|
7
|
+
var settingsData = useAppSelector(settingsSelector).data;
|
|
8
|
+
var countryIso2 = (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2;
|
|
9
|
+
var flowStart = settingsData.flowStart;
|
|
10
|
+
return useMemo(function () { return getFlowStartScreen(flowStart, countryIso2) === 'CONNECT_EXPRESS_EMAIL_STEP'; }, [countryIso2, flowStart]);
|
|
11
|
+
};
|
package/build/utils/array.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export declare const fixBrandList: (items: Array<{
|
|
|
62
62
|
}[];
|
|
63
63
|
export declare const findFirstId: (items: Array<SaleChannel>) => string;
|
|
64
64
|
export declare const sortActivitiesByName: (items: Array<ActivityParams>, path: string) => ActivityParams[];
|
|
65
|
-
export declare const getFileDetailsFromDocument: (documents: Array<any>, purpose: string) => any;
|
|
65
|
+
export declare const getFileDetailsFromDocument: (documents: Array<any>, purpose: string | Array<string>) => any;
|
|
66
66
|
export declare const getRecentDocumentBasedOnPurpose: (documents: Array<any>, purpose: string) => any;
|
|
67
67
|
export declare const findInArrayOrSubArray: (items: Array<any>, value: string | number) => null;
|
|
68
68
|
export declare const groupSectionWithSelectedActivitiesAtBeginning: (sections: Array<ActivitiesIsIc>, selectedActivities: Array<Activity>) => ActivitiesIsIc[];
|
package/build/utils/array.js
CHANGED
|
@@ -191,8 +191,9 @@ export var sortActivitiesByName = function (items, path) {
|
|
|
191
191
|
export var getFileDetailsFromDocument = function (documents, purpose) {
|
|
192
192
|
if ((documents || []).length === 0)
|
|
193
193
|
return [];
|
|
194
|
+
var purposes = Array.isArray(purpose) ? purpose : [purpose];
|
|
194
195
|
return documents.reduce(function (acc, document) {
|
|
195
|
-
var fileDetails = (document.file_details || []).filter(function (file) { return
|
|
196
|
+
var fileDetails = (document.file_details || []).filter(function (file) { return purposes.includes(file.purpose); });
|
|
196
197
|
return acc.concat(fileDetails.map(function (f) { return (__assign(__assign({}, f), { docId: document.id })); }));
|
|
197
198
|
}, []);
|
|
198
199
|
};
|
|
@@ -200,7 +201,7 @@ export var getRecentDocumentBasedOnPurpose = function (documents, purpose) {
|
|
|
200
201
|
if ((documents || []).length === 0)
|
|
201
202
|
return [];
|
|
202
203
|
var filteredByPurpose = documents.filter(function (doc) {
|
|
203
|
-
return
|
|
204
|
+
return doc.type === purpose;
|
|
204
205
|
});
|
|
205
206
|
if ((filteredByPurpose || []).length > 0) {
|
|
206
207
|
return filteredByPurpose.sort(function (a, b) { return b.created - a.created; })[0];
|
package/build/utils/common.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { axiosInstance } from '../api';
|
|
2
|
-
import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_PROD_URL } from '../constants';
|
|
2
|
+
import { ENDPOINT_PATHS, REGION_BASE_URLS, CONNECT_SANDBOX_URL, CONNECT_PROD_URL } from '../constants';
|
|
3
3
|
import { objectHasValues } from './object';
|
|
4
|
-
import { isDisasterRecoveryEnv, isSA } from './string';
|
|
5
4
|
export var sleep = function (milliseconds) {
|
|
6
5
|
if (milliseconds === void 0) { milliseconds = 1000; }
|
|
7
6
|
return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
|
|
@@ -15,13 +14,13 @@ export var dangerousMessage = function (message, callBack) {
|
|
|
15
14
|
export var setBaseUrl = function (publicKey, region) {
|
|
16
15
|
if (region === void 0) { region = ''; }
|
|
17
16
|
var isProd = publicKey.includes('pk_live');
|
|
18
|
-
var _a = region.split('-'), country = _a[0], envType = _a[1];
|
|
19
17
|
if (!isProd) {
|
|
20
18
|
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
|
|
21
19
|
return;
|
|
22
20
|
}
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
var regionKey = (region || '').trim().toLowerCase();
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(REGION_BASE_URLS, regionKey)) {
|
|
23
|
+
axiosInstance.defaults.baseURL = REGION_BASE_URLS[regionKey];
|
|
25
24
|
}
|
|
26
25
|
else {
|
|
27
26
|
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.PRODUCTION_BASE_URL;
|
package/build/utils/string.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeviceInfo, License, User } from '../@types';
|
|
1
|
+
import { DeviceInfo, FlowStart, License, User } from '../@types';
|
|
2
2
|
export declare const maskPhone: (str?: string) => string;
|
|
3
3
|
export declare const shortenString: (str: string, length: number) => string;
|
|
4
4
|
export declare const maskID: (str: string) => string;
|
|
@@ -49,6 +49,7 @@ export declare const isKW: (flag: string) => boolean;
|
|
|
49
49
|
export declare const isSA: (flag: string | undefined) => boolean;
|
|
50
50
|
export declare const isOtherThanKWOrSA: (flag: string) => boolean;
|
|
51
51
|
export declare const isQA: (flag: string | undefined) => boolean;
|
|
52
|
+
export declare const getFlowStartScreen: (flowStart: FlowStart | undefined, countryIso2: string | undefined) => string | undefined;
|
|
52
53
|
export declare const isKWOrSA: (flag: string) => boolean;
|
|
53
54
|
export declare const isLinkedIn: (flag: string) => boolean;
|
|
54
55
|
export declare const isTwitter: (flag: string) => boolean;
|
|
@@ -80,4 +81,3 @@ export declare const getCurrencyByCountryIso2: (countryCode?: string) => string;
|
|
|
80
81
|
export declare const getMobileNumberLen: (initialLen: number, number: string) => number;
|
|
81
82
|
export declare const getWebsiteLink: (isAr: boolean, countryCode: string, path: string) => string;
|
|
82
83
|
export declare function formatCode(code: string, chunkSize?: number, delimiter?: string): string;
|
|
83
|
-
export declare const isDisasterRecoveryEnv: (type?: string) => boolean;
|
package/build/utils/string.js
CHANGED
|
@@ -229,6 +229,18 @@ export var isQA = function (flag) {
|
|
|
229
229
|
return false;
|
|
230
230
|
return ['qa', 'qat'].includes(flag.toLowerCase());
|
|
231
231
|
};
|
|
232
|
+
export var getFlowStartScreen = function (flowStart, countryIso2) {
|
|
233
|
+
if (!flowStart || !countryIso2)
|
|
234
|
+
return undefined;
|
|
235
|
+
var value = flowStart[countryIso2.toUpperCase()];
|
|
236
|
+
if (value === 'phone')
|
|
237
|
+
return 'CONNECT_EXPRESS_MOBILE_STEP';
|
|
238
|
+
if (value === 'email' && isQA(countryIso2))
|
|
239
|
+
return 'CONNECT_EXPRESS_EMAIL_STEP';
|
|
240
|
+
if (value === 'id' && isSA(countryIso2))
|
|
241
|
+
return 'CONNECT_EXPRESS_NID_STEP';
|
|
242
|
+
return undefined;
|
|
243
|
+
};
|
|
232
244
|
export var isKWOrSA = function (flag) {
|
|
233
245
|
return isKW(flag) || isSA(flag);
|
|
234
246
|
};
|
|
@@ -360,4 +372,3 @@ export function formatCode(code, chunkSize, delimiter) {
|
|
|
360
372
|
if (delimiter === void 0) { delimiter = ' - '; }
|
|
361
373
|
return ((_a = code.match(new RegExp(".{1,".concat(chunkSize, "}"), 'g'))) === null || _a === void 0 ? void 0 : _a.join(delimiter)) || code;
|
|
362
374
|
}
|
|
363
|
-
export var isDisasterRecoveryEnv = function (type) { return type === 'dr'; };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.10-sandbox",
|
|
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"
|
|
24
|
+
"push": "npm publish --access public --tag sandbox"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [],
|
|
27
27
|
"author": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FileDetails } from '../../../../@types';
|
|
3
|
-
interface LicenseCertificateProps {
|
|
4
|
-
show: boolean;
|
|
5
|
-
readOnly?: boolean;
|
|
6
|
-
defaultFiles?: Array<FileDetails>;
|
|
7
|
-
}
|
|
8
|
-
declare const LicenseCertificate: ({ show, readOnly, defaultFiles }: LicenseCertificateProps) => JSX.Element;
|
|
9
|
-
export default LicenseCertificate;
|