@tap-payments/auth-jsconnect 2.10.21-development → 2.11.0-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/@types/app.d.ts
CHANGED
package/build/app/settings.js
CHANGED
|
@@ -112,7 +112,7 @@ export var fetchAppSettingsSync = createAsyncThunk('fetchAppSettingsSync', funct
|
|
|
112
112
|
thunkApi.dispatch(handleLanguage(lang));
|
|
113
113
|
if (configInfo.publicKey) {
|
|
114
114
|
if (configToken) {
|
|
115
|
-
setBaseUrl(configInfo.publicKey, appConfig.
|
|
115
|
+
setBaseUrl(configInfo.publicKey, appConfig.region);
|
|
116
116
|
}
|
|
117
117
|
thunkApi.dispatch(handlePublicKey(configInfo.publicKey));
|
|
118
118
|
}
|
|
@@ -362,7 +362,6 @@ export var settingsSlice = createSlice({
|
|
|
362
362
|
if (state.data.locale && country.iso2)
|
|
363
363
|
updateLocale(state.data.locale, country.iso2);
|
|
364
364
|
state.data.businessCountry = country;
|
|
365
|
-
setBaseUrl(state.data.appConfig.publicKey, country.iso2);
|
|
366
365
|
}
|
|
367
366
|
}
|
|
368
367
|
},
|
|
@@ -48,7 +48,7 @@ export var useAppConfig = function (_a) {
|
|
|
48
48
|
if (!disableSettingFetching && !configToken)
|
|
49
49
|
removeRequestHeaders();
|
|
50
50
|
checkDomain();
|
|
51
|
-
setBaseUrl(publicKey, rest.
|
|
51
|
+
setBaseUrl(publicKey, rest.region);
|
|
52
52
|
setAppConfig();
|
|
53
53
|
if (typeof boardMaturity === 'boolean')
|
|
54
54
|
dispatch(handelBoardMaturity(boardMaturity));
|
package/build/utils/common.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const sleep: (milliseconds?: number) => Promise<unknown>;
|
|
2
2
|
export declare const dangerousMessage: (message: string, callBack?: Function) => void;
|
|
3
|
-
export declare const setBaseUrl: (publicKey: string,
|
|
3
|
+
export declare const setBaseUrl: (publicKey: string, region?: string) => void;
|
|
4
4
|
export declare const updateLocationUrlWithCountry: (countryIso2: string) => void;
|
|
5
5
|
export declare const openConnect: (pk: string, countryCode?: string) => void;
|
|
6
6
|
export declare function getMetaData(): Record<string, string> | undefined;
|
package/build/utils/common.js
CHANGED
|
@@ -12,11 +12,10 @@ export var dangerousMessage = function (message, callBack) {
|
|
|
12
12
|
}
|
|
13
13
|
callBack === null || callBack === void 0 ? void 0 : callBack({ message: message });
|
|
14
14
|
};
|
|
15
|
-
export var setBaseUrl = function (publicKey,
|
|
16
|
-
if (countryCode === void 0) { countryCode = ''; }
|
|
15
|
+
export var setBaseUrl = function (publicKey, region) {
|
|
17
16
|
var isProd = publicKey.includes('pk_live');
|
|
18
17
|
if (isProd) {
|
|
19
|
-
axiosInstance.defaults.baseURL = isSA(
|
|
18
|
+
axiosInstance.defaults.baseURL = isSA(region) ? ENDPOINT_PATHS.PRODUCTION_BASE_URL_SA : ENDPOINT_PATHS.PRODUCTION_BASE_URL;
|
|
20
19
|
return;
|
|
21
20
|
}
|
|
22
21
|
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
|
package/build/utils/string.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export declare const getBaseUrl: () => string;
|
|
|
46
46
|
export declare const getScreenNameBasedOnFlow: (flow: string, isAuthorizedUser?: boolean, isOtherThanSAOrKWCountry?: boolean, terminalStepName?: string) => string;
|
|
47
47
|
export declare const getEighteenYearsAgo: () => string;
|
|
48
48
|
export declare const isKW: (flag: string) => boolean;
|
|
49
|
-
export declare const isSA: (flag: string) => boolean;
|
|
49
|
+
export declare const isSA: (flag: string | undefined) => boolean;
|
|
50
50
|
export declare const isOtherThanKWOrSA: (flag: string) => boolean;
|
|
51
51
|
export declare const isKWOrSA: (flag: string) => boolean;
|
|
52
52
|
export declare const isLinkedIn: (flag: string) => boolean;
|
package/build/utils/string.js
CHANGED
|
@@ -217,7 +217,9 @@ export var isKW = function (flag) {
|
|
|
217
217
|
return ['kw', 'kwd'].includes(flag === null || flag === void 0 ? void 0 : flag.toLowerCase());
|
|
218
218
|
};
|
|
219
219
|
export var isSA = function (flag) {
|
|
220
|
-
|
|
220
|
+
if (!flag)
|
|
221
|
+
return false;
|
|
222
|
+
return ['sa', 'sau'].includes(flag.toLowerCase());
|
|
221
223
|
};
|
|
222
224
|
export var isOtherThanKWOrSA = function (flag) {
|
|
223
225
|
return !isKW(flag) && !isSA(flag);
|