@odynn/awayz-hotels 0.6.5 → 0.6.7

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,5 +1,7 @@
1
+ import { EAvailabilityAlertStatus as S } from "./EAvailabilityAlert.js";
1
2
  var A = /* @__PURE__ */ ((a) => (a.ASCENDING = "ASC", a.DESCENDING = "DESC", a))(A || {}), C = /* @__PURE__ */ ((a) => (a.CASH = "Cash", a.POINTS = "Points", a.STAR_RATING = "Star Rating", a.BOOKABLE = "Bookable", a))(C || {});
2
3
  export {
4
+ S as EAvailabilityAlertStatus,
3
5
  C as EHotelSortOption,
4
6
  A as ESortingOrder
5
7
  };
@@ -0,0 +1,43 @@
1
+ import { awayzClient as i } from "@odynn/awayz-core";
2
+ import { useQuery as m, useMutation as y } from "@tanstack/react-query";
3
+ import "../../moment-BGjjqtLQ.js";
4
+ import "../../arrayExtensions-CFEBYUok.js";
5
+ import { E as e } from "../../enums-DxmoBOKL.js";
6
+ import "react";
7
+ import { AvailabilityAlertsService as r } from "../../services/availabilityAlerts/AvailabilityAlertsService.js";
8
+ const E = () => {
9
+ const {
10
+ data: a = [],
11
+ error: o,
12
+ isPending: n
13
+ } = m({
14
+ queryKey: [e.ALERT_NOTIFICATIONS],
15
+ queryFn: () => r.getAlertNotifications()
16
+ }), {
17
+ mutate: u,
18
+ error: l,
19
+ isPending: A
20
+ } = y({
21
+ mutationFn: async (t) => {
22
+ await r.updateAvailabilityAlert(t);
23
+ },
24
+ onSuccess: () => {
25
+ i.invalidateQueries({
26
+ queryKey: [e.AVAILABILITY_ALERTS]
27
+ }), i.invalidateQueries({
28
+ queryKey: [e.ALERT_NOTIFICATIONS]
29
+ });
30
+ }
31
+ });
32
+ return {
33
+ availabilityAlertNotifications: a,
34
+ updateAcknowledgement: (t, s = !0) => u({ alertId: t, acknowledged: s }),
35
+ mutateError: l,
36
+ mutatePending: A,
37
+ fetchError: o,
38
+ fetchPending: n
39
+ };
40
+ };
41
+ export {
42
+ E as useAvailabilityAlertNotifications
43
+ };
@@ -30,4 +30,4 @@ export declare enum EHotelSortOption {
30
30
  STAR_RATING = "Star Rating",
31
31
  BOOKABLE = "Bookable"
32
32
  }
33
- export type { EAvailabilityAlertStatus } from './EAvailabilityAlert';
33
+ export { EAvailabilityAlertStatus } from './EAvailabilityAlert';
@@ -0,0 +1,8 @@
1
+ export declare const useAvailabilityAlertNotifications: () => {
2
+ availabilityAlertNotifications: import('../useAvailabilityAlerts/useAvailabilityAlerts.types').IAvailabilityAlertNotification[];
3
+ updateAcknowledgement: (alertId: string, acknowledged?: boolean) => void;
4
+ mutateError: Error | null;
5
+ mutatePending: boolean;
6
+ fetchError: Error | null;
7
+ fetchPending: boolean;
8
+ };
@@ -12,6 +12,7 @@ export interface IAvailabilityAlert {
12
12
  hotelDescription: string;
13
13
  numberOfGuests: number;
14
14
  numberOfRooms: number;
15
+ archived: boolean;
15
16
  }
16
17
  export interface ICreateAvailabilityAlertRequest {
17
18
  checkin: string;
package/dist/main.js CHANGED
@@ -1,24 +1,26 @@
1
- import { ESearchType as r } from "./services/hotel/HotelService.types.js";
1
+ import { ESearchType as t } from "./services/hotel/HotelService.types.js";
2
2
  import { HotelResult as l } from "./components/HotelResult/HotelResult.js";
3
- import { HotelResults as p } from "./components/HotelResults/HotelResults.js";
4
- import { Legend as i } from "./components/Legend/Legend.js";
3
+ import { HotelResults as a } from "./components/HotelResults/HotelResults.js";
4
+ import { Legend as p } from "./components/Legend/Legend.js";
5
5
  import { useHotelSearch as s } from "./hooks/useHotelSearch/useHotelSearch.js";
6
6
  import { useLocationSearch as u } from "./hooks/useLocationSearch/useLocationSearch.js";
7
7
  import { useHotelDetails as d } from "./hooks/useHotelDetails/useHotelDetails.js";
8
8
  import { useHotelSort as c } from "./hooks/useHotelSort/useHotelSort.js";
9
9
  import { useAvailabilityAlerts as h } from "./hooks/useAvailabilityAlerts/useAvailabilityAlerts.js";
10
- import { EHotelSortOption as y, ESortingOrder as E } from "./enums/index.js";
11
- import { defaultLocationSortOrder as T, defaultSimilarityThreshold as g, duffelTestHotelLocation as A } from "./configs/defaults.js";
10
+ import { EHotelSortOption as A, ESortingOrder as E } from "./enums/index.js";
11
+ import { defaultLocationSortOrder as O, defaultSimilarityThreshold as T, duffelTestHotelLocation as b } from "./configs/defaults.js";
12
+ import { EAvailabilityAlertStatus as v } from "./enums/EAvailabilityAlert.js";
12
13
  export {
13
- y as EHotelSortOption,
14
- r as ESearchType,
14
+ v as EAvailabilityAlertStatus,
15
+ A as EHotelSortOption,
16
+ t as ESearchType,
15
17
  E as ESortingOrder,
16
18
  l as HotelResult,
17
- p as HotelResults,
18
- i as Legend,
19
- T as defaultLocationSortOrder,
20
- g as defaultSimilarityThreshold,
21
- A as duffelTestHotelLocation,
19
+ a as HotelResults,
20
+ p as Legend,
21
+ O as defaultLocationSortOrder,
22
+ T as defaultSimilarityThreshold,
23
+ b as duffelTestHotelLocation,
22
24
  h as useAvailabilityAlerts,
23
25
  d as useHotelDetails,
24
26
  s as useHotelSearch,
@@ -10,9 +10,7 @@ import { EHotelEndpoints as _ } from "../../configs/endpoints.js";
10
10
  class n {
11
11
  constructor() {
12
12
  l(this, "getMyActiveAlerts", async () => {
13
- const { data: a } = await m.get(
14
- _.AVAILABILITY_ALERTS
15
- );
13
+ const { data: a } = await m.get(_.AVAILABILITY_ALERTS);
16
14
  return a.success ? a.data.map(
17
15
  (e) => {
18
16
  var s, o;
@@ -28,7 +26,8 @@ class n {
28
26
  hotelGroup: e.alert_params.hotel_group,
29
27
  hotelStatus: e.alert_params.hotel_status.toLowerCase(),
30
28
  numberOfGuests: (s = e.alert_params) == null ? void 0 : s.number_of_guests,
31
- numberOfRooms: (o = e.alert_params) == null ? void 0 : o.number_of_rooms
29
+ numberOfRooms: (o = e.alert_params) == null ? void 0 : o.number_of_rooms,
30
+ archived: e.archived
32
31
  };
33
32
  }
34
33
  ) : [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@odynn/awayz-hotels",
3
3
  "private": false,
4
- "version": "0.6.5",
4
+ "version": "0.6.7",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"