@odynn/awayz-core 0.6.15 → 0.6.16
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,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var r = (n, e, a) =>
|
|
1
|
+
var _ = Object.defineProperty;
|
|
2
|
+
var p = (n, e, a) => e in n ? _(n, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[e] = a;
|
|
3
|
+
var r = (n, e, a) => p(n, typeof e != "symbol" ? e + "" : e, a);
|
|
4
4
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
5
5
|
import { c, a as l } from "../../AccountService-Cu1fDg5B.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { EBookingEndpoints as d } from "../../configs/endpoints.js";
|
|
8
|
-
const
|
|
8
|
+
const g = (n) => {
|
|
9
9
|
const e = /P((\d+)D)?T((\d+)H)?((\d+)M)?/, a = n.match(e);
|
|
10
10
|
if (a) {
|
|
11
11
|
const o = a[2] ? `${a[2]}d ` : "", t = a[4] ? `${a[4]}h ` : "", s = a[6] ? `${a[6]}m` : "";
|
|
@@ -13,7 +13,7 @@ const p = (n) => {
|
|
|
13
13
|
} else
|
|
14
14
|
return n;
|
|
15
15
|
};
|
|
16
|
-
class
|
|
16
|
+
class f {
|
|
17
17
|
constructor() {
|
|
18
18
|
r(this, "getHotelBooking", async (e) => {
|
|
19
19
|
var s;
|
|
@@ -22,19 +22,33 @@ class g {
|
|
|
22
22
|
), o = a.data.accommodation.rooms[0].rates[0];
|
|
23
23
|
return {
|
|
24
24
|
id: a.data._id,
|
|
25
|
+
//
|
|
25
26
|
totalAmount: parseFloat(o.total_amount),
|
|
27
|
+
//
|
|
26
28
|
feeAmount: parseFloat(o.fee_amount),
|
|
29
|
+
//
|
|
27
30
|
taxAmount: parseFloat(o.tax_amount),
|
|
31
|
+
//
|
|
28
32
|
baseAmount: parseFloat(o.base_amount),
|
|
33
|
+
//
|
|
29
34
|
cancelledAt: a.data.cancelled_at,
|
|
35
|
+
//
|
|
30
36
|
totalCurrency: o.total_currency,
|
|
37
|
+
//
|
|
31
38
|
baseCurrency: o.base_currency,
|
|
39
|
+
//
|
|
32
40
|
feeCurrency: o.fee_currency,
|
|
41
|
+
//
|
|
33
42
|
taxCurrency: o.tax_currency,
|
|
43
|
+
//
|
|
34
44
|
status: a.data.status,
|
|
45
|
+
//
|
|
35
46
|
description: a.data.accommodation.description,
|
|
47
|
+
//
|
|
36
48
|
name: a.data.accommodation.name,
|
|
49
|
+
//
|
|
37
50
|
reference: a.data.reference,
|
|
51
|
+
//
|
|
38
52
|
address: {
|
|
39
53
|
lineOne: a.data.accommodation.location.address.line_one,
|
|
40
54
|
cityName: a.data.accommodation.location.address.city_name,
|
|
@@ -51,11 +65,14 @@ class g {
|
|
|
51
65
|
longitude: a.data.accommodation.location.geographic_coordinates.longitude
|
|
52
66
|
},
|
|
53
67
|
images: a.data.accommodation.photos.map((i) => i.url),
|
|
54
|
-
guests: a.data.guests.map((i,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
guests: a.data.guests.map((i, u) => {
|
|
69
|
+
var m;
|
|
70
|
+
return {
|
|
71
|
+
familyName: i.family_name,
|
|
72
|
+
givenName: i.given_name,
|
|
73
|
+
type: (m = a.data.guest_types[u]) == null ? void 0 : m.type
|
|
74
|
+
};
|
|
75
|
+
}),
|
|
59
76
|
numberOfRooms: (s = a.data.rooms) == null ? void 0 : s.length,
|
|
60
77
|
cancellationTimeline: o.cancellation_timeline.map(
|
|
61
78
|
(i) => ({
|
|
@@ -117,7 +134,7 @@ class g {
|
|
|
117
134
|
arrivingAt: t.segments.getLast().arriving_at,
|
|
118
135
|
numberOfStops: t.segments.length - 1,
|
|
119
136
|
reference: a.data.booking_reference,
|
|
120
|
-
durationInMinutes:
|
|
137
|
+
durationInMinutes: g(t.duration),
|
|
121
138
|
origin: l(t.origin),
|
|
122
139
|
destination: l(t.destination)
|
|
123
140
|
})),
|
|
@@ -160,7 +177,7 @@ class g {
|
|
|
160
177
|
});
|
|
161
178
|
}
|
|
162
179
|
}
|
|
163
|
-
const
|
|
180
|
+
const C = new f();
|
|
164
181
|
export {
|
|
165
|
-
|
|
182
|
+
C as BookingService
|
|
166
183
|
};
|