@odynn/awayz-hotels 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.
- package/dist/enums-D9aZqf8G.js +4 -0
- package/dist/hooks/useAvailabilityAlertNotifications/useAvailabilityAlertNotifications.js +1 -1
- package/dist/hooks/useAvailabilityAlerts/useAvailabilityAlerts.js +1 -1
- package/dist/hooks/useHotelSearch/useHotelSearch.js +12 -10
- package/dist/hooks/useLocationSearch/useLocationSearch.js +1 -1
- package/dist/lib/hooks/useHotelSearch/useHotelSearch.types.d.ts +12 -0
- package/dist/lib/services/hotel/HotelService.types.d.ts +1 -0
- package/dist/services/hotel/HotelService.js +1 -2
- package/package.json +1 -1
- package/dist/enums-DxmoBOKL.js +0 -4
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var R = /* @__PURE__ */ ((S) => (S.LOCATIONS = "LOCATIONS", S.CHECK_USER = "CHECK_USER", S.USER_REGIONS = "USER_REGIONS", S.CONVERT_CURRENCY = "CONVERT_CURRENCY", S.CLIENT_COMPONENT_KEY = "CLIENT_COMPONENT_KEY", S.SEARCH_LIMIT = "SEARCH_LIMIT", S.PROGRAMS = "PROGRAMS", S.USER_PROGRAMS = "USER_PROGRAMS", S.LINKED_USER_PROGRAMS = "LINKED_USER_PROGRAMS", S.BANKS = "BANKS", S.CARDS = "CARDS", S.USER_CARDS = "USER_CARDS", S.TRIPS = "TRIPS", S.UNCATEGORISED_BOOKINGS = "UNCATEGORISED_BOOKINGS", S.BOOKING = "BOOKING", S.VALUE_CENTS = "VALUE_CENTS", S.AVAILABILITY_ALERTS = "AVAILABILITY_ALERTS", S.ALERT_NOTIFICATIONS = "ALERT_NOTIFICATIONS", S.POINTS_AS_CASH = "POINTS_AS_CASH", S))(R || {});
|
|
2
|
+
export {
|
|
3
|
+
R as E
|
|
4
|
+
};
|
|
@@ -2,7 +2,7 @@ import { awayzClient as i } from "@odynn/awayz-core";
|
|
|
2
2
|
import { useQuery as m, useMutation as y } from "@tanstack/react-query";
|
|
3
3
|
import "../../moment-BGjjqtLQ.js";
|
|
4
4
|
import "../../arrayExtensions-CFEBYUok.js";
|
|
5
|
-
import { E as e } from "../../enums-
|
|
5
|
+
import { E as e } from "../../enums-D9aZqf8G.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { AvailabilityAlertsService as r } from "../../services/availabilityAlerts/AvailabilityAlertsService.js";
|
|
8
8
|
const E = () => {
|
|
@@ -3,7 +3,7 @@ import { useQuery as f, useMutation as p } from "@tanstack/react-query";
|
|
|
3
3
|
import "../../moment-BGjjqtLQ.js";
|
|
4
4
|
import "../../arrayExtensions-CFEBYUok.js";
|
|
5
5
|
import { c as b } from "../../objectUtils-DOsrxUF7.js";
|
|
6
|
-
import { E as u } from "../../enums-
|
|
6
|
+
import { E as u } from "../../enums-D9aZqf8G.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import { AvailabilityAlertsService as w } from "../../services/availabilityAlerts/AvailabilityAlertsService.js";
|
|
9
9
|
const h = ({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useAwayzContext as P, useWallet as T, awayzClient as d } from "@odynn/awayz-core";
|
|
2
2
|
import { useMutation as m } from "@tanstack/react-query";
|
|
3
3
|
import { g as B } from "../../dateUtils-C1hKW8MF.js";
|
|
4
|
-
import { E as
|
|
4
|
+
import { E as f } from "../../enums-D9aZqf8G.js";
|
|
5
5
|
import "../../arrayExtensions-CFEBYUok.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { h as a } from "../../moment-BGjjqtLQ.js";
|
|
8
8
|
import { HotelChains as s } from "../../definitions/HotelChains.js";
|
|
9
|
-
import { HotelService as
|
|
9
|
+
import { HotelService as p } from "../../services/hotel/HotelService.js";
|
|
10
10
|
import { ESearchType as k } from "../../services/hotel/HotelService.types.js";
|
|
11
11
|
import G from "../../stores/useHotelsStore.js";
|
|
12
12
|
import { checkNthNightFree as x } from "../../utilities/hotelUtils/freeNightUtils.js";
|
|
@@ -34,7 +34,7 @@ const A = (t) => {
|
|
|
34
34
|
throw new Error(
|
|
35
35
|
`Invalid hotel group: ${t.hotelGroup}. Please use one of the following: ${s.toList().join(", ")}`
|
|
36
36
|
);
|
|
37
|
-
},
|
|
37
|
+
}, g = () => {
|
|
38
38
|
const { setHotels: t, hotels: i, setSearchParams: l } = G(), { config: u } = P(), { userCards: y } = T(), {
|
|
39
39
|
mutate: D,
|
|
40
40
|
isPending: w,
|
|
@@ -62,10 +62,11 @@ const A = (t) => {
|
|
|
62
62
|
range_type: e.rangeType || "mi",
|
|
63
63
|
hotel_groups: e.hotelGroups || s.toList(),
|
|
64
64
|
type: e.searchType || k.CITY,
|
|
65
|
-
external_inventory: (u == null ? void 0 : u.externalInventory) || !1
|
|
65
|
+
external_inventory: (u == null ? void 0 : u.externalInventory) || !1,
|
|
66
|
+
use_duffel: e.useDuffel ?? !0
|
|
66
67
|
};
|
|
67
68
|
return {
|
|
68
|
-
...await
|
|
69
|
+
...await p.searchByCoords(o),
|
|
69
70
|
checkinDate: e.checkinDate,
|
|
70
71
|
checkoutDate: e.checkoutDate
|
|
71
72
|
};
|
|
@@ -84,7 +85,7 @@ const A = (t) => {
|
|
|
84
85
|
}
|
|
85
86
|
},
|
|
86
87
|
onSettled: () => {
|
|
87
|
-
d.invalidateQueries({ queryKey: [
|
|
88
|
+
d.invalidateQueries({ queryKey: [f.SEARCH_LIMIT] });
|
|
88
89
|
}
|
|
89
90
|
});
|
|
90
91
|
function C(e, o) {
|
|
@@ -121,8 +122,9 @@ const A = (t) => {
|
|
|
121
122
|
range_type: "km",
|
|
122
123
|
hotel_groups: [e.hotelGroup],
|
|
123
124
|
type: k.HOTEL,
|
|
124
|
-
external_inventory: !1
|
|
125
|
-
|
|
125
|
+
external_inventory: !1,
|
|
126
|
+
use_duffel: e.useDuffel ?? !0
|
|
127
|
+
}, r = await p.searchByCoords(o);
|
|
126
128
|
if (!r.success)
|
|
127
129
|
throw new Error(r.message || "Hotel search failed");
|
|
128
130
|
const n = 0.8;
|
|
@@ -134,7 +136,7 @@ const A = (t) => {
|
|
|
134
136
|
t(e);
|
|
135
137
|
},
|
|
136
138
|
onSettled: () => {
|
|
137
|
-
d.invalidateQueries({ queryKey: [
|
|
139
|
+
d.invalidateQueries({ queryKey: [f.SEARCH_LIMIT] });
|
|
138
140
|
}
|
|
139
141
|
});
|
|
140
142
|
return {
|
|
@@ -149,7 +151,7 @@ const A = (t) => {
|
|
|
149
151
|
};
|
|
150
152
|
};
|
|
151
153
|
export {
|
|
152
|
-
|
|
154
|
+
g as useHotelSearch,
|
|
153
155
|
A as validateSearchByCoordsArgs,
|
|
154
156
|
N as validateSearchByHotelIdArgs
|
|
155
157
|
};
|
|
@@ -2,7 +2,7 @@ import { useQuery as u } from "@tanstack/react-query";
|
|
|
2
2
|
import { HotelService as l } from "../../services/hotel/HotelService.js";
|
|
3
3
|
import "../../moment-BGjjqtLQ.js";
|
|
4
4
|
import "../../arrayExtensions-CFEBYUok.js";
|
|
5
|
-
import { E as d } from "../../enums-
|
|
5
|
+
import { E as d } from "../../enums-D9aZqf8G.js";
|
|
6
6
|
import { useState as f, useEffect as L } from "react";
|
|
7
7
|
import { defaultSimilarityThreshold as p, defaultLocationSortOrder as y, duffelTestHotelLocation as T } from "../../configs/defaults.js";
|
|
8
8
|
import { sortLocationResults as E } from "../../utilities/hotelUtils/hotelUtils.js";
|
|
@@ -31,6 +31,12 @@ export interface ISearchByCoordsParams extends ISearchByParams {
|
|
|
31
31
|
* @type ESearchType
|
|
32
32
|
*/
|
|
33
33
|
searchType?: ESearchType;
|
|
34
|
+
/**
|
|
35
|
+
* Optional use duffel
|
|
36
|
+
* @default 'True'
|
|
37
|
+
* @type boolean
|
|
38
|
+
*/
|
|
39
|
+
useDuffel?: boolean;
|
|
34
40
|
}
|
|
35
41
|
export interface ISearchByHotelIdParams extends ISearchByParams {
|
|
36
42
|
/**
|
|
@@ -49,6 +55,12 @@ export interface ISearchByHotelIdParams extends ISearchByParams {
|
|
|
49
55
|
* @type string
|
|
50
56
|
*/
|
|
51
57
|
hotelName: string;
|
|
58
|
+
/**
|
|
59
|
+
* Optional use duffel
|
|
60
|
+
* @default 'True'
|
|
61
|
+
* @type boolean
|
|
62
|
+
*/
|
|
63
|
+
useDuffel?: boolean;
|
|
52
64
|
}
|
|
53
65
|
interface ISearchByParams {
|
|
54
66
|
/**
|
package/package.json
CHANGED
package/dist/enums-DxmoBOKL.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var S = /* @__PURE__ */ ((R) => (R.LOCATIONS = "LOCATIONS", R.CHECK_USER = "CHECK_USER", R.USER_REGIONS = "USER_REGIONS", R.CONVERT_CURRENCY = "CONVERT_CURRENCY", R.CLIENT_COMPONENT_KEY = "CLIENT_COMPONENT_KEY", R.SEARCH_LIMIT = "SEARCH_LIMIT", R.PROGRAMS = "PROGRAMS", R.USER_PROGRAMS = "USER_PROGRAMS", R.LINKED_USER_PROGRAMS = "LINKED_USER_PROGRAMS", R.BANKS = "BANKS", R.CARDS = "CARDS", R.USER_CARDS = "USER_CARDS", R.TRIPS = "TRIPS", R.UNCATEGORISED_BOOKINGS = "UNCATEGORISED_BOOKINGS", R.BOOKING = "BOOKING", R.VALUE_CENTS = "VALUE_CENTS", R.AVAILABILITY_ALERTS = "AVAILABILITY_ALERTS", R.ALERT_NOTIFICATIONS = "ALERT_NOTIFICATIONS", R))(S || {});
|
|
2
|
-
export {
|
|
3
|
-
S as E
|
|
4
|
-
};
|