@odynn/awayz-hotels 0.13.2 → 0.13.3
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/lib/main.d.ts
CHANGED
|
@@ -9,4 +9,5 @@ export * from './configs';
|
|
|
9
9
|
export * from './enums';
|
|
10
10
|
export * from './hooks';
|
|
11
11
|
export { mapAccommodationResponse, mapRateResponse } from './services/booking/BookingService.mappers';
|
|
12
|
+
export { getHotelRatingInfo } from './utilities/hotelUtils/hotelUtils';
|
|
12
13
|
export type { checkNthNightFree, IAirlineProgram, IHotelDetails, IPointsAsCash, IRate, IRoom };
|
|
@@ -6,6 +6,11 @@ export declare enum EBookingType {
|
|
|
6
6
|
}
|
|
7
7
|
declare class _BookingService {
|
|
8
8
|
getAvailableRooms: ({ checkinDate, checkoutDate, accommodationId, rooms, guests }: IGetAvailableRoomsProps) => Promise<{
|
|
9
|
+
cheapestRate: number;
|
|
10
|
+
currency: string;
|
|
11
|
+
availableRooms: never[];
|
|
12
|
+
accommodation: null;
|
|
13
|
+
} | {
|
|
9
14
|
cheapestRate: number;
|
|
10
15
|
currency: string;
|
|
11
16
|
availableRooms: IRoom[];
|
package/dist/main.js
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
import { ESearchType as t } from "./services/hotel/HotelService.types.js";
|
|
2
2
|
import { HotelResult as l } from "./components/HotelResult/HotelResult.js";
|
|
3
3
|
import { HotelResults as i } from "./components/HotelResults/HotelResults.js";
|
|
4
|
-
import { Legend as
|
|
4
|
+
import { Legend as p } from "./components/Legend/Legend.js";
|
|
5
5
|
import { Ratings as s } from "./components/Banners/Ratings/Ratings.js";
|
|
6
|
-
import { defaultLocationSortOrder as
|
|
7
|
-
import { EHotelSortOption as d, ESortingOrder as
|
|
6
|
+
import { defaultLocationSortOrder as n, defaultSimilarityThreshold as u, duffelTestHotelLocation as c } from "./configs/defaults.js";
|
|
7
|
+
import { EHotelSortOption as d, ESortingOrder as H } from "./enums/index.js";
|
|
8
8
|
import { useAvailabilityAlertNotifications as R } from "./hooks/useAvailabilityAlertNotifications/useAvailabilityAlertNotifications.js";
|
|
9
|
-
import { useAvailabilityAlerts as
|
|
10
|
-
import { useHotelDetails as
|
|
11
|
-
import { useHotelSearch as
|
|
9
|
+
import { useAvailabilityAlerts as h } from "./hooks/useAvailabilityAlerts/useAvailabilityAlerts.js";
|
|
10
|
+
import { useHotelDetails as E } from "./hooks/useHotelDetails/useHotelDetails.js";
|
|
11
|
+
import { useHotelSearch as b } from "./hooks/useHotelSearch/useHotelSearch.js";
|
|
12
12
|
import { useHotelSort as O } from "./hooks/useHotelSort/useHotelSort.js";
|
|
13
13
|
import { useLocationSearch as D } from "./hooks/useLocationSearch/useLocationSearch.js";
|
|
14
|
-
import { mapAccommodationResponse as
|
|
15
|
-
import {
|
|
14
|
+
import { mapAccommodationResponse as N, mapRateResponse as j } from "./services/booking/BookingService.mappers.js";
|
|
15
|
+
import { getHotelRatingInfo as q } from "./utilities/hotelUtils/hotelUtils.js";
|
|
16
|
+
import { EAvailabilityAlertStatus as z } from "./enums/EAvailabilityAlert.js";
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
+
z as EAvailabilityAlertStatus,
|
|
18
19
|
d as EHotelSortOption,
|
|
19
20
|
t as ESearchType,
|
|
20
|
-
|
|
21
|
+
H as ESortingOrder,
|
|
21
22
|
l as HotelResult,
|
|
22
23
|
i as HotelResults,
|
|
23
|
-
|
|
24
|
+
p as Legend,
|
|
24
25
|
s as Ratings,
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
n as defaultLocationSortOrder,
|
|
27
|
+
u as defaultSimilarityThreshold,
|
|
27
28
|
c as duffelTestHotelLocation,
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
q as getHotelRatingInfo,
|
|
30
|
+
N as mapAccommodationResponse,
|
|
31
|
+
j as mapRateResponse,
|
|
30
32
|
R as useAvailabilityAlertNotifications,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
h as useAvailabilityAlerts,
|
|
34
|
+
E as useHotelDetails,
|
|
35
|
+
b as useHotelSearch,
|
|
34
36
|
O as useHotelSort,
|
|
35
37
|
D as useLocationSearch
|
|
36
38
|
};
|
|
@@ -1,45 +1,54 @@
|
|
|
1
1
|
var p = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { clientInstance as
|
|
2
|
+
var d = (o, t, e) => t in o ? p(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
3
|
+
var c = (o, t, e) => d(o, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { clientInstance as f } from "@odynn/awayz-core";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
6
|
import "../../moment-BGjjqtLQ.js";
|
|
7
7
|
import "../../arrayExtensions-CFEBYUok.js";
|
|
8
8
|
import { E as m } from "../../DateFormats-DZD30Nea.js";
|
|
9
9
|
import "react";
|
|
10
|
-
import { EDuffelEndpoints as
|
|
11
|
-
import { mapRoomResponse as h, mapAccommodationResponse as
|
|
12
|
-
var
|
|
13
|
-
class
|
|
10
|
+
import { EDuffelEndpoints as u } from "../../configs/endpoints.js";
|
|
11
|
+
import { mapRoomResponse as h, mapAccommodationResponse as R } from "./BookingService.mappers.js";
|
|
12
|
+
var v = /* @__PURE__ */ ((o) => (o.Hotel = "awayz_hotel_booking_id", o.Flight = "awayz_flight_booking_id", o.Offer = "flight_offer_id", o))(v || {});
|
|
13
|
+
class g {
|
|
14
14
|
constructor() {
|
|
15
|
-
|
|
15
|
+
c(this, "getAvailableRooms", async ({
|
|
16
16
|
checkinDate: t,
|
|
17
|
-
checkoutDate:
|
|
18
|
-
accommodationId:
|
|
19
|
-
rooms:
|
|
17
|
+
checkoutDate: e,
|
|
18
|
+
accommodationId: i,
|
|
19
|
+
rooms: n,
|
|
20
20
|
guests: s
|
|
21
21
|
}) => {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
var r;
|
|
23
|
+
const { data: _ } = await f.post(
|
|
24
|
+
u.AVAILABLE_ROOMS,
|
|
24
25
|
{
|
|
25
26
|
check_in_date: t.format(m.ServerDate),
|
|
26
|
-
check_out_date:
|
|
27
|
-
accommodation_ids: [
|
|
28
|
-
rooms:
|
|
27
|
+
check_out_date: e.format(m.ServerDate),
|
|
28
|
+
accommodation_ids: [i],
|
|
29
|
+
rooms: n,
|
|
29
30
|
guests: s
|
|
30
31
|
}
|
|
31
|
-
),
|
|
32
|
+
), a = _.data.results.getFirst();
|
|
33
|
+
if (!a)
|
|
34
|
+
return {
|
|
35
|
+
cheapestRate: 0,
|
|
36
|
+
currency: "",
|
|
37
|
+
availableRooms: [],
|
|
38
|
+
accommodation: null
|
|
39
|
+
};
|
|
40
|
+
const l = (r = a == null ? void 0 : a.accommodation) == null ? void 0 : r.rooms.map(h);
|
|
32
41
|
return {
|
|
33
|
-
cheapestRate: parseFloat(
|
|
34
|
-
currency:
|
|
35
|
-
availableRooms:
|
|
36
|
-
accommodation:
|
|
42
|
+
cheapestRate: parseFloat(a.cheapest_rate_total_amount),
|
|
43
|
+
currency: a.cheapest_rate_currency,
|
|
44
|
+
availableRooms: l,
|
|
45
|
+
accommodation: R(a.accommodation)
|
|
37
46
|
};
|
|
38
47
|
});
|
|
39
48
|
}
|
|
40
49
|
}
|
|
41
|
-
const
|
|
50
|
+
const O = new g();
|
|
42
51
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
52
|
+
O as BookingService,
|
|
53
|
+
v as EBookingType
|
|
45
54
|
};
|