@odynn/awayz-core 0.10.32 → 0.10.35
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/dist/{TripsService-BwBvXdDC.js → TripsService-C6HJZJwL.js} +6 -6
- package/dist/assets/_styles5.css +1 -1
- package/dist/assets/_styles6.css +1 -1
- package/dist/assets/noRetryInstance.css +1 -0
- package/dist/components/Bookings/FlightBooking/FlightBooking.js +1 -1
- package/dist/components/Bookings/HotelBooking/HotelBooking.js +1 -1
- package/dist/components/CashValue/CashValue.js +13 -15
- package/dist/components/CashValue/CashValue.stories.js +15 -15
- package/dist/components/ClientPointsValue/ClientPointsValue.js +18 -20
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Wallet/Card/Card.stories.js +14 -15
- package/dist/configs/awayzUrl.js +12 -0
- package/dist/context/AwayzContext.js +1 -0
- package/dist/hooks/useAwayzAuth/useAwayzAuth.js +102 -108
- package/dist/hooks/useBookingManagement/useBookingManagement.js +4 -6
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +2 -4
- package/dist/hooks/useFeatureFlags.js +1 -1
- package/dist/hooks/useSearchLimit.js +1 -1
- package/dist/hooks/useTripManagement/useTripManagement.js +5 -7
- package/dist/hooks/useTripManagement/useTripManagement.test.js +3 -5
- package/dist/hooks/useWallet/useWallet.js +29 -31
- package/dist/hooks/useWallet/useWallet.test.js +2 -4
- package/dist/keys-C7jV6nZg.js +5 -0
- package/dist/lib/configs/awayzConfig.d.ts +3 -2
- package/dist/lib/configs/awayzUrl.d.ts +4 -0
- package/dist/lib/context/AwayzContext.d.ts +1 -0
- package/dist/lib/hooks/useAwayzAuth/useAwayzAuth.d.ts +1 -0
- package/dist/lib/main.d.ts +1 -1
- package/dist/lib/services/account/AccountService.d.ts +2 -1
- package/dist/lib/services/bookings/BookingService.types.d.ts +16 -0
- package/dist/main.js +27 -28
- package/dist/{AccountService-B582vLTc.js → noRetryInstance-C0lN2R80.js} +734 -710
- package/dist/providers/AwayzProvider.js +14 -17
- package/dist/services/account/AccountService.js +2 -2
- package/dist/services/bookings/BookingService.js +70 -62
- package/dist/services/currency/CurrencyService.js +14 -16
- package/dist/services/features/featureService.js +1 -1
- package/dist/services/index.js +12 -13
- package/dist/services/instance.js +3 -3
- package/dist/services/instanceConfig.js +21 -11
- package/dist/services/noRetryInstance.js +2 -9
- package/dist/services/preferences/PreferencesService.js +1 -1
- package/dist/services/rewards/RewardsService.js +1 -1
- package/dist/services/trips/TripsService.js +2 -2
- package/dist/services/wallet/WalletService.js +1 -1
- package/dist/utils/clientPoints.js +4 -6
- package/package.json +1 -1
- package/dist/assets/_styles7.css +0 -1
- package/dist/configs/baseUrl.js +0 -11
- package/dist/configs/gatewayBaseUrl.js +0 -8
- package/dist/keys-BcBfU51M.js +0 -5
- package/dist/lib/configs/baseUrl.d.ts +0 -3
- package/dist/lib/configs/gatewayBaseUrl.d.ts +0 -2
|
@@ -1,42 +1,39 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { QueryClientProvider as l } from "@tanstack/react-query";
|
|
3
3
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
4
|
-
import { a as r } from "../keys-
|
|
4
|
+
import { a as r } from "../keys-C7jV6nZg.js";
|
|
5
5
|
import { useEffect as i } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { setBaseUrl as u, setGatewayBaseUrl as p } from "../configs/awayzUrl.js";
|
|
7
7
|
import { defaultAwayzConfig as d } from "../configs/defaultAwayzConfig.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { useAwayzAuth as n } from "../hooks/useAwayzAuth/useAwayzAuth.js";
|
|
8
|
+
import { AwayzContext as n } from "../context/AwayzContext.js";
|
|
9
|
+
import { useAwayzAuth as h } from "../hooks/useAwayzAuth/useAwayzAuth.js";
|
|
11
10
|
import "react-i18next";
|
|
12
|
-
import '../assets/_styles4.css';import '../assets/
|
|
11
|
+
import '../assets/_styles4.css';import '../assets/_styles6.css';import '../assets/_styles5.css';import '../assets/_styles2.css';import '../assets/_styles.css';import '../assets/_styles3.css';/* empty css */
|
|
13
12
|
/* empty css */
|
|
14
13
|
/* empty css */
|
|
15
|
-
import { awayzClient as
|
|
16
|
-
import "../
|
|
14
|
+
import { awayzClient as w } from "../configs/awayzClient.js";
|
|
15
|
+
import "../noRetryInstance-C0lN2R80.js";
|
|
17
16
|
/* empty css */
|
|
18
17
|
/* empty css */
|
|
19
18
|
import "../index-Cv-wvFlM.js";
|
|
20
|
-
/* empty css */
|
|
21
19
|
/* empty css */
|
|
22
|
-
import "../
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const a = n({
|
|
20
|
+
import { useFeatureFlags as y } from "../hooks/useFeatureFlags.js";
|
|
21
|
+
const M = ({ children: t, config: e }) => /* @__PURE__ */ o(l, { client: w, children: /* @__PURE__ */ o(A, { config: e, children: t }) }), A = ({ children: t, config: e }) => {
|
|
22
|
+
const a = h({
|
|
26
23
|
authFlow: e.authFlow,
|
|
27
24
|
onSuccess: e.onAuthSuccess,
|
|
28
25
|
onError: e.onAuthFailure,
|
|
29
26
|
trustedOrigins: e.trustedOrigins,
|
|
30
27
|
isTestMode: e.testMode
|
|
31
|
-
}), { featureFlags: s, loaded: m } =
|
|
28
|
+
}), { featureFlags: s, loaded: m } = y();
|
|
32
29
|
return i(() => {
|
|
33
30
|
if (!e.clientId) {
|
|
34
31
|
console.error("You need to provide a client ID to the AwayzProvider");
|
|
35
32
|
return;
|
|
36
33
|
}
|
|
37
|
-
localStorage.setItem(r.CLIENT_ID, e.clientId), localStorage.setItem(r.AUTH_FLOW, e.authFlow), e.debugRefreshToken && e.testMode && (localStorage.setItem(r.REFRESH_TOKEN, e.debugRefreshToken), localStorage.setItem(r.TOKEN, e.debugRefreshToken)),
|
|
34
|
+
localStorage.setItem(r.CLIENT_ID, e.clientId), localStorage.setItem(r.AUTH_FLOW, e.authFlow), e.debugRefreshToken && e.testMode && (localStorage.setItem(r.REFRESH_TOKEN, e.debugRefreshToken), localStorage.setItem(r.TOKEN, e.debugRefreshToken)), u(e.baseUrl), p(e.gatewayBaseUrl);
|
|
38
35
|
}, [e]), /* @__PURE__ */ o(
|
|
39
|
-
|
|
36
|
+
n.Provider,
|
|
40
37
|
{
|
|
41
38
|
value: {
|
|
42
39
|
...a,
|
|
@@ -52,5 +49,5 @@ const H = ({ children: t, config: e }) => /* @__PURE__ */ o(l, { client: y, chil
|
|
|
52
49
|
);
|
|
53
50
|
};
|
|
54
51
|
export {
|
|
55
|
-
|
|
52
|
+
M as AwayzProvider
|
|
56
53
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import { A as a } from "../../
|
|
4
|
-
import "../../keys-
|
|
3
|
+
import { A as a } from "../../noRetryInstance-C0lN2R80.js";
|
|
4
|
+
import "../../keys-C7jV6nZg.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "../../configs/awayzClient.js";
|
|
7
7
|
import "../../configs/endpoints.js";
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
var g = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
2
|
+
var y = (r, t, a) => t in r ? g(r, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : r[t] = a;
|
|
3
|
+
var i = (r, t, a) => y(r, typeof t != "symbol" ? t + "" : t, a);
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
6
|
-
import { t as
|
|
7
|
-
import { c as l,
|
|
6
|
+
import { t as f } from "../../numberUtils-B4wd-SGR.js";
|
|
7
|
+
import { c as l, b as m, g as p } from "../../noRetryInstance-C0lN2R80.js";
|
|
8
8
|
import "react";
|
|
9
|
-
import { EBookingEndpoints as
|
|
9
|
+
import { EBookingEndpoints as c } from "../../configs/endpoints.js";
|
|
10
10
|
const h = (r) => {
|
|
11
11
|
const t = /P((\d+)D)?T((\d+)H)?((\d+)M)?/, a = r.match(t);
|
|
12
12
|
if (a) {
|
|
13
|
-
const
|
|
14
|
-
return `${
|
|
13
|
+
const o = a[2] ? `${a[2]}d ` : "", d = a[4] ? `${a[4]}h ` : "", s = a[6] ? `${a[6]}m` : "";
|
|
14
|
+
return `${o}${d}${s}`.trim();
|
|
15
15
|
} else
|
|
16
16
|
return r;
|
|
17
17
|
};
|
|
18
|
-
class
|
|
18
|
+
class b {
|
|
19
19
|
constructor() {
|
|
20
|
-
|
|
20
|
+
i(this, "getHotelBooking", async (t) => {
|
|
21
21
|
var s, e;
|
|
22
22
|
const { data: a } = await l.get(
|
|
23
|
-
`${
|
|
24
|
-
),
|
|
23
|
+
`${c.USER_HOTEL_BOOKINGS}/${t}`
|
|
24
|
+
), o = a.data.accommodation.rooms[0].rates[0];
|
|
25
25
|
return {
|
|
26
26
|
id: a.data._id,
|
|
27
27
|
rateId: a.data.rate_id,
|
|
28
28
|
quoteId: a.data.quote_id,
|
|
29
29
|
bookingId: a.data.id,
|
|
30
|
-
totalAmount: parseFloat(
|
|
31
|
-
feeAmount: parseFloat(
|
|
32
|
-
taxAmount: parseFloat(
|
|
33
|
-
baseAmount: parseFloat(
|
|
30
|
+
totalAmount: parseFloat(o.total_amount),
|
|
31
|
+
feeAmount: parseFloat(o.fee_amount),
|
|
32
|
+
taxAmount: parseFloat(o.tax_amount),
|
|
33
|
+
baseAmount: parseFloat(o.base_amount),
|
|
34
34
|
cancelledAt: a.data.cancelled_at,
|
|
35
|
-
totalCurrency:
|
|
36
|
-
baseCurrency:
|
|
37
|
-
feeCurrency:
|
|
38
|
-
taxCurrency:
|
|
35
|
+
totalCurrency: o.total_currency,
|
|
36
|
+
baseCurrency: o.base_currency,
|
|
37
|
+
feeCurrency: o.fee_currency,
|
|
38
|
+
taxCurrency: o.tax_currency,
|
|
39
39
|
status: a.data.status,
|
|
40
40
|
description: a.data.accommodation.description,
|
|
41
41
|
name: a.data.accommodation.name,
|
|
@@ -55,41 +55,49 @@ class A {
|
|
|
55
55
|
latitude: a.data.accommodation.location.geographic_coordinates.latitude,
|
|
56
56
|
longitude: a.data.accommodation.location.geographic_coordinates.longitude
|
|
57
57
|
},
|
|
58
|
-
images: a.data.accommodation.photos.map((
|
|
59
|
-
guests: a.data.guests.map((
|
|
60
|
-
var
|
|
58
|
+
images: a.data.accommodation.photos.map((n) => n.url),
|
|
59
|
+
guests: a.data.guests.map((n, _) => {
|
|
60
|
+
var u;
|
|
61
61
|
return {
|
|
62
|
-
familyName:
|
|
63
|
-
givenName:
|
|
64
|
-
type: (
|
|
62
|
+
familyName: n.family_name,
|
|
63
|
+
givenName: n.given_name,
|
|
64
|
+
type: (u = a.data.guest_types[_]) == null ? void 0 : u.type
|
|
65
65
|
};
|
|
66
66
|
}),
|
|
67
67
|
numberOfRooms: (s = a.data.rooms) == null ? void 0 : s.length,
|
|
68
|
-
cancellationTimeline:
|
|
69
|
-
(
|
|
70
|
-
refundAmount: parseFloat(
|
|
71
|
-
currency:
|
|
72
|
-
before:
|
|
68
|
+
cancellationTimeline: o.cancellation_timeline.map(
|
|
69
|
+
(n) => ({
|
|
70
|
+
refundAmount: parseFloat(n.refund_amount),
|
|
71
|
+
currency: n.currency,
|
|
72
|
+
before: n.before
|
|
73
73
|
})
|
|
74
74
|
),
|
|
75
|
-
rooms: (e = a.data.rooms) == null ? void 0 : e.map((
|
|
75
|
+
rooms: (e = a.data.rooms) == null ? void 0 : e.map((n) => {
|
|
76
76
|
var _;
|
|
77
77
|
return {
|
|
78
|
-
beds: (_ =
|
|
79
|
-
type:
|
|
80
|
-
count:
|
|
78
|
+
beds: (_ = n.beds) == null ? void 0 : _.map((u) => ({
|
|
79
|
+
type: u.type,
|
|
80
|
+
count: u.count
|
|
81
81
|
})),
|
|
82
|
-
totalAmount: parseFloat(
|
|
83
|
-
name:
|
|
82
|
+
totalAmount: parseFloat(n.total_amount),
|
|
83
|
+
name: n.name
|
|
84
84
|
};
|
|
85
85
|
}),
|
|
86
|
-
createdAt: a.data.created_at
|
|
86
|
+
createdAt: a.data.created_at,
|
|
87
|
+
conditions: a.data.rooms[0].conditions,
|
|
88
|
+
loyaltyProgram: {
|
|
89
|
+
loyaltyProgrammeAccountNumber: a.data.loyalty_programme_account_number,
|
|
90
|
+
supportedLoyaltyProgramme: a.data.supported_loyalty_programme
|
|
91
|
+
},
|
|
92
|
+
amenities: a.data.accommodation.amenities,
|
|
93
|
+
phoneNumber: a.data.phone_number,
|
|
94
|
+
email: a.data.email
|
|
87
95
|
};
|
|
88
96
|
});
|
|
89
|
-
|
|
97
|
+
i(this, "getFlightBooking", async (t) => {
|
|
90
98
|
var d, s;
|
|
91
99
|
const { data: a } = await l.get(
|
|
92
|
-
`${
|
|
100
|
+
`${c.USER_FLIGHT_BOOKINGS}/${t}`
|
|
93
101
|
);
|
|
94
102
|
return {
|
|
95
103
|
id: a.data._id,
|
|
@@ -140,12 +148,12 @@ class A {
|
|
|
140
148
|
numberOfStops: e.segments.length - 1,
|
|
141
149
|
reference: a.data.booking_reference,
|
|
142
150
|
durationInMinutes: h(e.duration),
|
|
143
|
-
origin:
|
|
144
|
-
destination:
|
|
145
|
-
segments:
|
|
151
|
+
origin: m(e.origin),
|
|
152
|
+
destination: m(e.destination),
|
|
153
|
+
segments: m(e.segments)
|
|
146
154
|
})),
|
|
147
155
|
availableActions: a.data.available_actions,
|
|
148
|
-
airlineInitiatedChanges:
|
|
156
|
+
airlineInitiatedChanges: m(a.data.airline_initiated_changes) || [],
|
|
149
157
|
cancellationDetails: a.data.cancellation_details ? {
|
|
150
158
|
refundAmount: parseFloat(
|
|
151
159
|
a.data.cancellation_details.refund_amount
|
|
@@ -154,61 +162,61 @@ class A {
|
|
|
154
162
|
refundTo: a.data.cancellation_details.refund_to,
|
|
155
163
|
confirmedAt: a.data.cancellation_details.confirmed_at
|
|
156
164
|
} : void 0,
|
|
157
|
-
services:
|
|
165
|
+
services: m(a.data.services),
|
|
158
166
|
createdAt: a.data.created_at
|
|
159
167
|
};
|
|
160
168
|
});
|
|
161
|
-
|
|
169
|
+
i(this, "initiateCancelFlightBooking", async (t) => {
|
|
162
170
|
const { data: a } = await l.put(
|
|
163
|
-
`${
|
|
171
|
+
`${c.INITIATE_FLIGHT_CANCEL}/${t}`
|
|
164
172
|
);
|
|
165
173
|
if (!a.success)
|
|
166
174
|
throw new Error("Failed to initiate cancellation");
|
|
167
|
-
const
|
|
175
|
+
const o = m(a.data);
|
|
168
176
|
return {
|
|
169
|
-
...
|
|
170
|
-
refundAmount:
|
|
177
|
+
...o,
|
|
178
|
+
refundAmount: f(o.refundAmount)
|
|
171
179
|
};
|
|
172
180
|
});
|
|
173
|
-
|
|
181
|
+
i(this, "confirmCancelFlightBooking", async (t) => {
|
|
174
182
|
const { data: a } = await l.put(
|
|
175
|
-
`${
|
|
183
|
+
`${c.CONFIRM_FLIGHT_CANCEL}/${t}`
|
|
176
184
|
);
|
|
177
185
|
return a.success;
|
|
178
186
|
});
|
|
179
|
-
|
|
187
|
+
i(this, "cancelHotelBooking", async (t) => {
|
|
180
188
|
const { data: a } = await l.post(
|
|
181
|
-
`${
|
|
189
|
+
`${c.CANCEL_HOTEL_BOOKING}/${t}`
|
|
182
190
|
);
|
|
183
191
|
return a.success;
|
|
184
192
|
});
|
|
185
|
-
|
|
193
|
+
i(this, "actionAirlineChanges", async ({
|
|
186
194
|
bookingId: t,
|
|
187
195
|
acceptChanges: a,
|
|
188
|
-
aicId:
|
|
196
|
+
aicId: o
|
|
189
197
|
}) => {
|
|
190
198
|
const { data: d } = await l.post(
|
|
191
|
-
|
|
199
|
+
c.ACTION_AIRLINE_CHANGES,
|
|
192
200
|
{
|
|
193
201
|
booking_id: t,
|
|
194
202
|
action_taken: a ? "accepted" : "cancelled",
|
|
195
|
-
aic_id:
|
|
203
|
+
aic_id: o
|
|
196
204
|
}
|
|
197
205
|
);
|
|
198
206
|
return d.success;
|
|
199
207
|
});
|
|
200
|
-
|
|
208
|
+
i(this, "cancelPointsBooking", async (t) => {
|
|
201
209
|
const { data: a } = await p.post(
|
|
202
|
-
`${
|
|
210
|
+
`${c.REFUND_POINTS_BOOKING}`,
|
|
203
211
|
{
|
|
204
212
|
bookingId: t
|
|
205
213
|
}
|
|
206
214
|
);
|
|
207
215
|
return a.success;
|
|
208
216
|
});
|
|
209
|
-
|
|
217
|
+
i(this, "getPointsAsCash", async (t) => {
|
|
210
218
|
const { data: a } = await p.get(
|
|
211
|
-
`${
|
|
219
|
+
`${c.BOOKING_POINTS_AS_CASH}/${t}`
|
|
212
220
|
);
|
|
213
221
|
return !a.success || !a.data ? null : {
|
|
214
222
|
...a.data,
|
|
@@ -217,7 +225,7 @@ class A {
|
|
|
217
225
|
});
|
|
218
226
|
}
|
|
219
227
|
}
|
|
220
|
-
const $ = new
|
|
228
|
+
const $ = new b();
|
|
221
229
|
export {
|
|
222
230
|
$ as BookingService
|
|
223
231
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import '../../assets/_styles4.css';import '../../assets/
|
|
1
|
+
import '../../assets/_styles4.css';import '../../assets/_styles6.css';import '../../assets/_styles5.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles3.css';var f = Object.defineProperty;
|
|
2
2
|
var l = (c, r, t) => r in c ? f(c, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[r] = t;
|
|
3
|
-
var
|
|
3
|
+
var o = (c, r, t) => l(c, typeof r != "symbol" ? r + "" : r, t);
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
6
|
-
import { A as i, E as u, c as
|
|
6
|
+
import { A as i, E as u, c as y } from "../../noRetryInstance-C0lN2R80.js";
|
|
7
7
|
import "react";
|
|
8
|
-
import { ECurrencyEndpoints as
|
|
8
|
+
import { ECurrencyEndpoints as p } from "../../configs/endpoints.js";
|
|
9
9
|
import "react-i18next";
|
|
10
10
|
/* empty css */
|
|
11
11
|
/* empty css */
|
|
@@ -14,18 +14,16 @@ import "@tanstack/react-query";
|
|
|
14
14
|
/* empty css */
|
|
15
15
|
/* empty css */
|
|
16
16
|
import "../../index-Cv-wvFlM.js";
|
|
17
|
-
/* empty css */
|
|
18
17
|
import "../../context/AwayzContext.js";
|
|
19
18
|
/* empty css */
|
|
20
19
|
import { awayzClient as m } from "../../configs/awayzClient.js";
|
|
21
|
-
import "../noRetryInstance.js";
|
|
22
20
|
class d {
|
|
23
21
|
constructor() {
|
|
24
|
-
|
|
22
|
+
o(this, "convertCurrency", async ({
|
|
25
23
|
baseCurrency: r,
|
|
26
24
|
targetCurrency: t
|
|
27
25
|
}) => {
|
|
28
|
-
var
|
|
26
|
+
var n;
|
|
29
27
|
try {
|
|
30
28
|
const { success: e, data: C } = await m.ensureQueryData({
|
|
31
29
|
queryKey: [u.CHECK_USER],
|
|
@@ -36,12 +34,12 @@ class d {
|
|
|
36
34
|
});
|
|
37
35
|
if (!e || !a)
|
|
38
36
|
throw new Error("Failed to fetch user data");
|
|
39
|
-
const { userRegion: E, preferences: _ } = C, { data: s } = await
|
|
37
|
+
const { userRegion: E, preferences: _ } = C, { data: s } = await y.post(p.CURRENCY_CONVERSION, {
|
|
40
38
|
target_currency: t ?? _.currency ?? E.currency,
|
|
41
39
|
base_currency: r
|
|
42
40
|
});
|
|
43
41
|
if (e && s.data)
|
|
44
|
-
return s.data.conversion_rate * (1 + (((
|
|
42
|
+
return s.data.conversion_rate * (1 + (((n = a.pointsAsCash) == null ? void 0 : n.exchangeRateBuffer) ?? 0));
|
|
45
43
|
} catch (e) {
|
|
46
44
|
console.error(e);
|
|
47
45
|
}
|
|
@@ -55,16 +53,16 @@ class d {
|
|
|
55
53
|
* @parm amount the amount to be converted from the base to the target currency
|
|
56
54
|
* @returns the converted amount
|
|
57
55
|
*/
|
|
58
|
-
|
|
56
|
+
o(this, "convertToCurrency", async ({
|
|
59
57
|
baseCurrency: r,
|
|
60
58
|
targetCurrency: t,
|
|
61
|
-
amount:
|
|
59
|
+
amount: n
|
|
62
60
|
}) => {
|
|
63
61
|
try {
|
|
64
|
-
const { data: e } = await
|
|
62
|
+
const { data: e } = await y.post(p.CURRENCY_CONVERSION, {
|
|
65
63
|
target_currency: t,
|
|
66
64
|
base_currency: r,
|
|
67
|
-
amount:
|
|
65
|
+
amount: n
|
|
68
66
|
});
|
|
69
67
|
if (e.success)
|
|
70
68
|
return e.data.conversion_result;
|
|
@@ -75,7 +73,7 @@ class d {
|
|
|
75
73
|
});
|
|
76
74
|
}
|
|
77
75
|
}
|
|
78
|
-
const
|
|
76
|
+
const b = new d();
|
|
79
77
|
export {
|
|
80
|
-
|
|
78
|
+
b as CurrencyService
|
|
81
79
|
};
|
package/dist/services/index.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { A as o, c as t, g as
|
|
2
|
-
import { ESource as
|
|
3
|
-
import { CurrencyService as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { EBookingType as g } from "./trips/TripService.types.js";
|
|
1
|
+
import { A as o, c, a as t, g as a, i as n } from "../noRetryInstance-C0lN2R80.js";
|
|
2
|
+
import { ESource as i } from "./account/AccountServices.types.js";
|
|
3
|
+
import { CurrencyService as f } from "./currency/CurrencyService.js";
|
|
4
|
+
import { RewardsService as x } from "./rewards/RewardsService.js";
|
|
5
|
+
import { EBookingType as S } from "./trips/TripService.types.js";
|
|
7
6
|
export {
|
|
8
7
|
o as AccountService,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
f as CurrencyService,
|
|
9
|
+
S as EBookingType,
|
|
10
|
+
i as ESource,
|
|
11
|
+
x as RewardsService,
|
|
12
|
+
c as clientInstance,
|
|
13
|
+
t as clientNoRetryInstance,
|
|
14
|
+
a as gatewayInstance,
|
|
16
15
|
n as instance
|
|
17
16
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import "../keys-
|
|
3
|
+
import "../keys-C7jV6nZg.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { c as m, g as p, i as s } from "../
|
|
6
|
-
import "../configs/
|
|
5
|
+
import { c as m, g as p, i as s } from "../noRetryInstance-C0lN2R80.js";
|
|
6
|
+
import "../configs/awayzUrl.js";
|
|
7
7
|
export {
|
|
8
8
|
m as clientInstance,
|
|
9
9
|
p as gatewayInstance,
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import "../keys-
|
|
3
|
+
import "../keys-C7jV6nZg.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import {
|
|
6
|
-
import "../configs/
|
|
5
|
+
import { m as c, k as F, l as j, h as k, j as q, n as w, p as A } from "../noRetryInstance-C0lN2R80.js";
|
|
6
|
+
import "../configs/awayzUrl.js";
|
|
7
7
|
import "../configs/endpoints.js";
|
|
8
|
-
import "
|
|
8
|
+
import "react-i18next";
|
|
9
|
+
import '../assets/_styles4.css';import '../assets/_styles6.css';import '../assets/_styles5.css';import '../assets/_styles2.css';import '../assets/_styles.css';import '../assets/_styles3.css';/* empty css */
|
|
10
|
+
/* empty css */
|
|
11
|
+
/* empty css */
|
|
12
|
+
import "@tanstack/react-query";
|
|
13
|
+
/* empty css */
|
|
14
|
+
/* empty css */
|
|
15
|
+
import "../index-Cv-wvFlM.js";
|
|
16
|
+
import "../context/AwayzContext.js";
|
|
17
|
+
/* empty css */
|
|
18
|
+
import "../configs/awayzClient.js";
|
|
9
19
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
c as authFailurePostMessage,
|
|
21
|
+
F as delay,
|
|
22
|
+
j as executeWithDelay,
|
|
23
|
+
k as getClientConfig,
|
|
24
|
+
q as getGatewayConfig,
|
|
25
|
+
w as handleAxiosError,
|
|
26
|
+
A as processFailedRequests
|
|
17
27
|
};
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const r = t.create();
|
|
3
|
-
r.interceptors.request.use((e) => (e = s(e), e));
|
|
4
|
-
const o = 1;
|
|
5
|
-
r.interceptors.response.use(
|
|
6
|
-
null,
|
|
7
|
-
(e) => n(e, o, r)
|
|
8
|
-
);
|
|
1
|
+
import { a } from "../noRetryInstance-C0lN2R80.js";
|
|
9
2
|
export {
|
|
10
|
-
|
|
3
|
+
a as clientNoRetryInstance
|
|
11
4
|
};
|
|
@@ -2,7 +2,7 @@ var a = Object.defineProperty;
|
|
|
2
2
|
var o = (s, e, r) => e in s ? a(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r;
|
|
3
3
|
var n = (s, e, r) => o(s, typeof e != "symbol" ? e + "" : e, r);
|
|
4
4
|
import { EPreferencesEndpoints as u } from "../../configs/endpoints.js";
|
|
5
|
-
import { c as i } from "../../
|
|
5
|
+
import { c as i } from "../../noRetryInstance-C0lN2R80.js";
|
|
6
6
|
class E {
|
|
7
7
|
constructor() {
|
|
8
8
|
n(this, "setCurrency", async (e) => {
|
|
@@ -3,7 +3,7 @@ var o = (t, e, a) => e in t ? s(t, e, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var r = (t, e, a) => o(t, typeof e != "symbol" ? e + "" : e, a);
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
6
|
-
import { c as n,
|
|
6
|
+
import { c as n, b as i } from "../../noRetryInstance-C0lN2R80.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import { ERewardsEndpoints as c } from "../../configs/endpoints.js";
|
|
9
9
|
class m {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import "../../
|
|
4
|
-
import { T as a } from "../../TripsService-
|
|
3
|
+
import "../../noRetryInstance-C0lN2R80.js";
|
|
4
|
+
import { T as a } from "../../TripsService-C6HJZJwL.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "../../configs/defaultAwayzConfig.js";
|
|
7
7
|
import "../../configs/endpoints.js";
|
|
@@ -3,7 +3,7 @@ var i = (o, a, t) => a in o ? d(o, a, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var r = (o, a, t) => i(o, typeof a != "symbol" ? a + "" : a, t);
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
6
|
-
import { c as e,
|
|
6
|
+
import { c as e, b as c, g as A } from "../../noRetryInstance-C0lN2R80.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import { EWalletEndpoints as s } from "../../configs/endpoints.js";
|
|
9
9
|
class u {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import { E as m } from "../
|
|
3
|
+
import { E as m } from "../noRetryInstance-C0lN2R80.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-i18next";
|
|
6
|
-
import '../assets/_styles4.css';import '../assets/
|
|
6
|
+
import '../assets/_styles4.css';import '../assets/_styles6.css';import '../assets/_styles5.css';import '../assets/_styles2.css';import '../assets/_styles.css';import '../assets/_styles3.css';/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
/* empty css */
|
|
9
9
|
import "@tanstack/react-query";
|
|
@@ -11,12 +11,10 @@ import { CurrencyService as n } from "../services/currency/CurrencyService.js";
|
|
|
11
11
|
/* empty css */
|
|
12
12
|
/* empty css */
|
|
13
13
|
import "../index-Cv-wvFlM.js";
|
|
14
|
-
/* empty css */
|
|
15
14
|
import "../context/AwayzContext.js";
|
|
16
15
|
import { awayzClient as a } from "../configs/awayzClient.js";
|
|
17
16
|
/* empty css */
|
|
18
|
-
|
|
19
|
-
const Q = async ({
|
|
17
|
+
const w = async ({
|
|
20
18
|
cashAmount: o,
|
|
21
19
|
currency: e,
|
|
22
20
|
pointsAsCash: r
|
|
@@ -35,5 +33,5 @@ const Q = async ({
|
|
|
35
33
|
return Math.round(i / r.valuePerPoint);
|
|
36
34
|
};
|
|
37
35
|
export {
|
|
38
|
-
|
|
36
|
+
w as convertCashToClientPoints
|
|
39
37
|
};
|
package/package.json
CHANGED
package/dist/assets/_styles7.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.modal-backdrop{position:fixed;top:60px;left:0;bottom:0;right:0;z-index:400;background-color:var(--opaque-background, rgba(249, 253, 255, .5843137255));transition:all .2s ease-in-out;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);display:flex;align-items:center;justify-content:center}.modal-backdrop.hidden{background-color:transparent;pointer-events:none;-webkit-backdrop-filter:blur(0);backdrop-filter:blur(0)}.modal-backdrop.hidden .modal-content{scale:.8;opacity:0}.modal-backdrop .modal-content{transition:all .2s ease-in-out;background-color:var(--foreground, #fff);border-radius:.5rem;border:1px solid var(--border, #e7eef3);position:relative}.modal-backdrop .modal-content .divider{width:100%;border:1px solid var(--border, #e7eef3);transform:scaleY(.5);margin:0}.modal-backdrop .modal-content .close-btn{height:30px;width:30px;border-radius:.5rem;border:1px solid var(--border, #e7eef3);display:flex;align-items:center;justify-content:center;position:absolute;top:1rem;right:1rem;transition:all .3s ease-in-out;cursor:pointer}.modal-backdrop .modal-content .close-btn:hover{background-color:var(--border, #e7eef3)}@media screen and (max-width: 768px){.modal-backdrop .modal-content{width:100%;max-height:80dvh;height:fit-content;position:absolute;bottom:0;overflow-y:auto;border-radius:1rem 1rem 0 0}}.modal-backdrop.padding .modal-content{padding:1rem}
|
package/dist/configs/baseUrl.js
DELETED
package/dist/keys-BcBfU51M.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var T = /* @__PURE__ */ ((_) => (_.TOKEN = "token", _.REFRESH_TOKEN = "refreshToken", _.CLIENT_ID = "clientId", _.AUTH_FLOW = "authFlow", _.OVERRIDE_TOKEN_EXCHANGE_ENDPOINT = "overrideExchangeTokenEndpoint", _))(T || {}), d = /* @__PURE__ */ ((_) => (_.ISO = "dates:iso", _.DISPLAY_SHORT = "dates:displayShort", _.DISPLAY_MEDIUM = "dates:displayMedium", _.DISPLAY_LONG = "dates:displayLong", _.DISPLAY_FULL = "dates:displayFull", _.DISPLAY_SHORT_WITH_YEAR = "dates:displayShortWithYear", _.DISPLAY_MEDIUM_WITH_YEAR = "dates:displayMediumWithYear", _.DISPLAY_LONG_WITH_YEAR = "dates:displayLongWithYear", _.DISPLAY_FULL_WITH_YEAR = "dates:displayFullWithYear", _.DATE_TIME_SHORT = "dates:dateTimeShort", _.DATE_TIME_MEDIUM = "dates:dateTimeMedium", _.DATE_TIME_LONG = "dates:dateTimeLong", _.DATE_TIME_FULL = "dates:dateTimeFull", _.DATE_TIME_SHORT_WITH_YEAR = "dates:dateTimeShortWithYear", _.DATE_TIME_MEDIUM_WITH_YEAR = "dates:dateTimeMediumWithYear", _.DATE_TIME_LONG_WITH_YEAR = "dates:dateTimeLongWithYear", _.DATE_TIME_FULL_WITH_YEAR = "dates:dateTimeFullWithYear", _.TIME_ONLY = "dates:timeOnly", _.TIME_WITH_SECONDS = "dates:timeWithSeconds", _))(d || {});
|
|
2
|
-
export {
|
|
3
|
-
d as E,
|
|
4
|
-
T as a
|
|
5
|
-
};
|