@odynn/awayz-core 0.6.0 → 0.6.2
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.
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o = {
|
|
2
2
|
testMode: !1,
|
|
3
3
|
externalInventory: !1,
|
|
4
4
|
flightsConfig: {
|
|
5
5
|
streamTimeoutPingCount: 3,
|
|
6
6
|
streamTimeoutTotalSeconds: 180
|
|
7
|
-
}
|
|
7
|
+
},
|
|
8
|
+
logoFallbackImageUrl: "https://awayz.com/favicon.ico"
|
|
8
9
|
};
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
o as defaultAwayzConfig
|
|
11
12
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IAuthData } from '../services/account/AccountServices.types';
|
|
1
2
|
import { EAuthFlow } from '../types';
|
|
2
3
|
export interface IAwayzConfig {
|
|
3
4
|
/**
|
|
@@ -52,9 +53,13 @@ export interface IAwayzConfig {
|
|
|
52
53
|
/**
|
|
53
54
|
* Gets called when the authentication flow succeeded
|
|
54
55
|
*/
|
|
55
|
-
onAuthSuccess?: () => void;
|
|
56
|
+
onAuthSuccess?: (authData: IAuthData) => void;
|
|
56
57
|
/**
|
|
57
58
|
* Allow overriding the base URL for the Awayz API.
|
|
58
59
|
*/
|
|
59
60
|
overrideBaseUrl?: string;
|
|
61
|
+
/**
|
|
62
|
+
* A URL to an image that will be used as a fallback logo in case flight/hotel logos fail to load.
|
|
63
|
+
*/
|
|
64
|
+
logoFallbackImageUrl?: string;
|
|
60
65
|
}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
externalInventory: boolean;
|
|
4
|
-
flightsConfig: {
|
|
5
|
-
streamTimeoutPingCount: number;
|
|
6
|
-
streamTimeoutTotalSeconds: number;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
1
|
+
import { IAwayzConfig } from './awayzConfig';
|
|
2
|
+
export declare const defaultAwayzConfig: Partial<IAwayzConfig>;
|
|
@@ -4,7 +4,7 @@ var n = (t, r, e) => m(t, typeof r != "symbol" ? r + "" : r, e);
|
|
|
4
4
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
5
5
|
import { A as C, E, c as s } from "../../AccountService-CoynF2Xc.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import { ECurrencyEndpoints as
|
|
7
|
+
import { ECurrencyEndpoints as i } from "../../configs/endpoints.js";
|
|
8
8
|
import "react/jsx-runtime";
|
|
9
9
|
import "../../context/AwayzContext.js";
|
|
10
10
|
import { awayzClient as _ } from "../../configs/awayzClient.js";
|
|
@@ -29,12 +29,12 @@ class d {
|
|
|
29
29
|
});
|
|
30
30
|
if (!c)
|
|
31
31
|
throw new Error("Failed to fetch user data");
|
|
32
|
-
const { userRegion:
|
|
33
|
-
target_currency: e ??
|
|
32
|
+
const { userRegion: u, preferences: p } = o, { data: a } = await s.post(i.CURRENCY_CONVERSION, {
|
|
33
|
+
target_currency: e ?? p.currency ?? u.currency,
|
|
34
34
|
base_currency: r
|
|
35
35
|
});
|
|
36
|
-
if (c)
|
|
37
|
-
return
|
|
36
|
+
if (c && a.data)
|
|
37
|
+
return a.data.conversion_rate;
|
|
38
38
|
} catch (c) {
|
|
39
39
|
console.error(c);
|
|
40
40
|
}
|
|
@@ -54,7 +54,7 @@ class d {
|
|
|
54
54
|
amount: c
|
|
55
55
|
}) => {
|
|
56
56
|
try {
|
|
57
|
-
const { data: o } = await s.post(
|
|
57
|
+
const { data: o } = await s.post(i.CURRENCY_CONVERSION, {
|
|
58
58
|
target_currency: e,
|
|
59
59
|
base_currency: r,
|
|
60
60
|
amount: c
|