@odynn/awayz-core 0.5.0 → 0.5.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.
- package/dist/components/Bookings/FlightBooking/FlightBooking.js +65 -205
- package/dist/components/Bookings/HotelBooking/HotelBooking.js +1 -1
- package/dist/components/CashValue/CashValue.js +431 -418
- package/dist/components/CashValue/CashValue.stories.js +17 -16
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Wallet/Card/Card.js +1 -1
- package/dist/components/Wallet/Card/Card.stories.js +7 -6
- package/dist/hooks/useBookingManagement/useBookingManagement.js +7 -6
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +2 -1
- package/dist/hooks/useTripManagement/useTripManagement.js +3 -2
- package/dist/hooks/useTripManagement/useTripManagement.test.js +1 -0
- package/dist/hooks/useWallet/useWallet.js +8 -7
- package/dist/hooks/useWallet/useWallet.test.js +1 -0
- package/dist/{index-agnspg2e.js → index-CDh8vAM_.js} +2 -2
- package/dist/lib/components/CashValue/CashValue.d.ts +5 -1
- package/dist/lib/components/CashValue/CashValue.stories.d.ts +1 -1
- package/dist/lib/hooks/useBookingManagement/mocks/HotelBooking200.json.d.ts +1 -1
- package/dist/providers/AwayzProvider.js +6 -5
- package/dist/services/bookings/BookingService.js +26 -25
- package/dist/services/currency/CurrencyService.js +7 -6
- package/package.json +1 -1
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var c = (
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var _ = (n, e, a) => e in n ? u(n, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[e] = a;
|
|
3
|
+
var c = (n, e, a) => _(n, typeof e != "symbol" ? e + "" : e, a);
|
|
4
4
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
5
|
-
import { c as i, b as
|
|
5
|
+
import { c as i, b as m } from "../../AccountService-CtMwRIoL.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { EBookingEndpoints as d } from "../../configs/endpoints.js";
|
|
8
|
-
const
|
|
9
|
-
const e = /P((\d+)D)?T((\d+)H)?((\d+)M)?/, a =
|
|
8
|
+
const p = (n) => {
|
|
9
|
+
const e = /P((\d+)D)?T((\d+)H)?((\d+)M)?/, a = n.match(e);
|
|
10
10
|
if (a) {
|
|
11
|
-
const o = a[2] ? `${a[2]}d ` : "", t = a[4] ? `${a[4]}h ` : "",
|
|
12
|
-
return `${o}${t}${
|
|
11
|
+
const o = a[2] ? `${a[2]}d ` : "", t = a[4] ? `${a[4]}h ` : "", s = a[6] ? `${a[6]}m` : "";
|
|
12
|
+
return `${o}${t}${s}`.trim();
|
|
13
13
|
} else
|
|
14
|
-
return
|
|
14
|
+
return n;
|
|
15
15
|
};
|
|
16
|
-
class
|
|
16
|
+
class g {
|
|
17
17
|
constructor() {
|
|
18
18
|
c(this, "getHotelBooking", async (e) => {
|
|
19
|
+
var s;
|
|
19
20
|
const { data: a } = await i.get(
|
|
20
21
|
`${d.USER_HOTEL_BOOKINGS}/${e}`
|
|
21
22
|
), o = a.data.accommodation.rooms[0].rates[0];
|
|
@@ -49,18 +50,18 @@ class p {
|
|
|
49
50
|
latitude: a.data.accommodation.location.geographic_coordinates.latitude,
|
|
50
51
|
longitude: a.data.accommodation.location.geographic_coordinates.longitude
|
|
51
52
|
},
|
|
52
|
-
images: a.data.accommodation.photos.map((
|
|
53
|
-
guests: a.data.guests.map((
|
|
54
|
-
familyName:
|
|
55
|
-
givenName:
|
|
56
|
-
type: a.data.guest_types[
|
|
53
|
+
images: a.data.accommodation.photos.map((r) => r.url),
|
|
54
|
+
guests: a.data.guests.map((r, l) => ({
|
|
55
|
+
familyName: r.family_name,
|
|
56
|
+
givenName: r.given_name,
|
|
57
|
+
type: a.data.guest_types[l].type
|
|
57
58
|
})),
|
|
58
|
-
numberOfRooms: a.data.rooms,
|
|
59
|
+
numberOfRooms: (s = a.data.rooms) == null ? void 0 : s.length,
|
|
59
60
|
cancellationTimeline: o.cancellation_timeline.map(
|
|
60
|
-
(
|
|
61
|
-
refundAmount: parseFloat(
|
|
62
|
-
currency:
|
|
63
|
-
before:
|
|
61
|
+
(r) => ({
|
|
62
|
+
refundAmount: parseFloat(r.refund_amount),
|
|
63
|
+
currency: r.currency,
|
|
64
|
+
before: r.before
|
|
64
65
|
})
|
|
65
66
|
)
|
|
66
67
|
};
|
|
@@ -116,9 +117,9 @@ class p {
|
|
|
116
117
|
arrivingAt: t.segments.getLast().arriving_at,
|
|
117
118
|
numberOfStops: t.segments.length - 1,
|
|
118
119
|
reference: a.data.booking_reference,
|
|
119
|
-
durationInMinutes:
|
|
120
|
-
origin:
|
|
121
|
-
destination:
|
|
120
|
+
durationInMinutes: p(t.duration),
|
|
121
|
+
origin: m(t.origin),
|
|
122
|
+
destination: m(t.destination)
|
|
122
123
|
})),
|
|
123
124
|
availableActions: a.data.available_actions
|
|
124
125
|
};
|
|
@@ -143,7 +144,7 @@ class p {
|
|
|
143
144
|
});
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
|
-
const
|
|
147
|
+
const A = new g();
|
|
147
148
|
export {
|
|
148
|
-
|
|
149
|
+
A as BookingService
|
|
149
150
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';var
|
|
2
|
-
var m = (t, r, e) => r in t ?
|
|
1
|
+
import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';var y = Object.defineProperty;
|
|
2
|
+
var m = (t, r, e) => r in t ? y(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
3
|
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-CtMwRIoL.js";
|
|
@@ -12,6 +12,7 @@ import "@tanstack/react-query";
|
|
|
12
12
|
import "../noRetryInstance.js";
|
|
13
13
|
/* empty css */
|
|
14
14
|
/* empty css */
|
|
15
|
+
import "react-i18next";
|
|
15
16
|
/* empty css */
|
|
16
17
|
/* empty css */
|
|
17
18
|
/* empty css */
|
|
@@ -28,12 +29,12 @@ class d {
|
|
|
28
29
|
});
|
|
29
30
|
if (!c)
|
|
30
31
|
throw new Error("Failed to fetch user data");
|
|
31
|
-
const { userRegion: i, preferences: u } = o, { data:
|
|
32
|
+
const { userRegion: i, preferences: u } = o, { data: p } = await s.post(a.CURRENCY_CONVERSION, {
|
|
32
33
|
target_currency: e ?? u.currency ?? i.currency,
|
|
33
34
|
base_currency: r
|
|
34
35
|
});
|
|
35
36
|
if (c)
|
|
36
|
-
return
|
|
37
|
+
return p.data.conversion_rate;
|
|
37
38
|
} catch (c) {
|
|
38
39
|
console.error(c);
|
|
39
40
|
}
|
|
@@ -67,7 +68,7 @@ class d {
|
|
|
67
68
|
});
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
|
-
const
|
|
71
|
+
const F = new d();
|
|
71
72
|
export {
|
|
72
|
-
|
|
73
|
+
F as CurrencyService
|
|
73
74
|
};
|