@odynn/awayz-core 0.9.7 → 0.9.9

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.
Files changed (32) hide show
  1. package/dist/{TripsService-ByimRRRe.js → TripsService-n1_Fh5P6.js} +1 -1
  2. package/dist/components/CashValue/CashValue.js +1 -1
  3. package/dist/components/CashValue/CashValue.stories.js +1 -1
  4. package/dist/components/ClientPointsValue/ClientPointsValue.js +1 -1
  5. package/dist/components/Wallet/Card/Card.stories.js +1 -1
  6. package/dist/hooks/useAwayzAuth/useAwayzAuth.js +1 -1
  7. package/dist/hooks/useBookingManagement/useBookingManagement.js +70 -82
  8. package/dist/hooks/useBookingManagement/useBookingManagement.test.js +1 -1
  9. package/dist/hooks/useFeatureFlags.js +1 -1
  10. package/dist/hooks/useSearchLimit.js +1 -1
  11. package/dist/hooks/useTripManagement/useTripManagement.js +2 -2
  12. package/dist/hooks/useTripManagement/useTripManagement.test.js +2 -2
  13. package/dist/hooks/useWallet/useWallet.js +1 -1
  14. package/dist/hooks/useWallet/useWallet.test.js +1 -1
  15. package/dist/lib/services/bookings/BookingService.d.ts +2 -2
  16. package/dist/lib/services/bookings/BookingService.types.d.ts +0 -9
  17. package/dist/main.js +1 -1
  18. package/dist/{noRetryInstance-oiHCni_Z.js → noRetryInstance-C2dRPIQf.js} +26 -25
  19. package/dist/providers/AwayzProvider.js +1 -1
  20. package/dist/services/account/AccountService.js +1 -1
  21. package/dist/services/bookings/BookingService.js +31 -36
  22. package/dist/services/currency/CurrencyService.js +1 -1
  23. package/dist/services/features/featureService.js +1 -1
  24. package/dist/services/index.js +1 -1
  25. package/dist/services/instance.js +1 -1
  26. package/dist/services/instanceConfig.js +1 -1
  27. package/dist/services/noRetryInstance.js +1 -1
  28. package/dist/services/preferences/PreferencesService.js +1 -1
  29. package/dist/services/rewards/RewardsService.js +1 -1
  30. package/dist/services/trips/TripsService.js +2 -2
  31. package/dist/services/wallet/WalletService.js +1 -1
  32. package/package.json +1 -1
@@ -2,7 +2,7 @@ var m = Object.defineProperty;
2
2
  var g = (r, e, s) => e in r ? m(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s;
3
3
  var t = (r, e, s) => g(r, typeof e != "symbol" ? e + "" : e, s);
4
4
  import "./arrayExtensions-DlcBOj5a.js";
5
- import { c as n, f as p, b as c, r as T } from "./noRetryInstance-oiHCni_Z.js";
5
+ import { c as n, f as p, b as c, r as T } from "./noRetryInstance-C2dRPIQf.js";
6
6
  import "react";
7
7
  import { EMyTripsEndpoints as i } from "./configs/endpoints.js";
8
8
  import { EBookingType as l } from "./services/trips/TripService.types.js";
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as l } from "react/jsx-runtime";
2
2
  import { useQuery as E } from "@tanstack/react-query";
3
3
  import "../../arrayExtensions-DlcBOj5a.js";
4
4
  import { g as R, a as N, b as u } from "../../cashUtils-sBirmFfL.js";
5
- import { E as _ } from "../../noRetryInstance-oiHCni_Z.js";
5
+ import { E as _ } from "../../noRetryInstance-C2dRPIQf.js";
6
6
  import { useMemo as S } from "react";
7
7
  import { a as f } from "../../index-C8p5kinH.js";
8
8
  import "react-i18next";
@@ -9,7 +9,7 @@ import { CashValue as n } from "./CashValue.js";
9
9
  import { EToolTipPosition as t, EInvalidAmountDisplayOption as o } from "./CashValueTypes.js";
10
10
  import "@tanstack/react-query";
11
11
  import "../../context/AwayzContext.js";
12
- import "../../noRetryInstance-oiHCni_Z.js";
12
+ import "../../noRetryInstance-C2dRPIQf.js";
13
13
  import "../../configs/awayzClient.js";
14
14
  /* empty css */
15
15
  import { AwayzProvider as a } from "../../providers/AwayzProvider.js";
@@ -1,7 +1,7 @@
1
1
  import { jsxs as p } from "react/jsx-runtime";
2
2
  import { useQuery as m } from "@tanstack/react-query";
3
3
  import "../../arrayExtensions-DlcBOj5a.js";
4
- import { E as u } from "../../noRetryInstance-oiHCni_Z.js";
4
+ import { E as u } from "../../noRetryInstance-C2dRPIQf.js";
5
5
  import { useMemo as y } from "react";
6
6
  import { useAwayzContext as f } from "../../hooks/useAwayzContext.js";
7
7
  import "react-i18next";
@@ -7,7 +7,7 @@ import "../../../_styles.flight-booking-DEUJthTJ.js";
7
7
  /* empty css */
8
8
  import "@tanstack/react-query";
9
9
  import "../../../configs/awayzClient.js";
10
- import "../../../noRetryInstance-oiHCni_Z.js";
10
+ import "../../../noRetryInstance-C2dRPIQf.js";
11
11
  /* empty css */
12
12
  import "../../../context/AwayzContext.js";
13
13
  import { Card as a } from "./Card.js";
@@ -1,6 +1,6 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
2
  import { c as P } from "../../cashUtils-sBirmFfL.js";
3
- import { e as M, A as l, E as N } from "../../noRetryInstance-oiHCni_Z.js";
3
+ import { e as M, A as l, E as N } from "../../noRetryInstance-C2dRPIQf.js";
4
4
  import { a as i } from "../../_styles.flight-booking-DEUJthTJ.js";
5
5
  import { useState as f, useCallback as I, useEffect as S } from "react";
6
6
  import { awayzClient as O } from "../../configs/awayzClient.js";
@@ -1,6 +1,6 @@
1
1
  import { useQuery as u, useMutation as m } from "@tanstack/react-query";
2
2
  import "../../arrayExtensions-DlcBOj5a.js";
3
- import { E as a } from "../../noRetryInstance-oiHCni_Z.js";
3
+ import { E as s } from "../../noRetryInstance-C2dRPIQf.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  import "react-i18next";
@@ -10,129 +10,117 @@ import "../../_styles.flight-booking-DEUJthTJ.js";
10
10
  import { awayzClient as k } from "../../configs/awayzClient.js";
11
11
  /* empty css */
12
12
  import "../../context/AwayzContext.js";
13
- import { EBookingType as o } from "../../services/trips/TripService.types.js";
13
+ import { EBookingType as t } from "../../services/trips/TripService.types.js";
14
14
  /* empty css */
15
15
  import { BookingService as e } from "../../services/bookings/BookingService.js";
16
- const b = (r, t) => {
16
+ const b = (r, o) => {
17
17
  const {
18
- data: s,
19
- isError: g,
20
- error: d
18
+ data: c,
19
+ isError: B,
20
+ error: p
21
21
  } = u({
22
- queryKey: [a.BOOKING, r, o.HOTEL],
22
+ queryKey: [s.BOOKING, r, t.HOTEL],
23
23
  queryFn: () => e.getHotelBooking(r),
24
- enabled: t === o.HOTEL && !!r
24
+ enabled: o === t.HOTEL && !!r
25
25
  }), {
26
- data: n,
27
- isError: B,
28
- error: f
26
+ data: i,
27
+ isError: f,
28
+ error: F
29
29
  } = u({
30
- queryKey: [a.BOOKING, r, o.FLIGHT],
30
+ queryKey: [s.BOOKING, r, t.FLIGHT],
31
31
  queryFn: () => e.getFlightBooking(r),
32
- enabled: t === o.FLIGHT && !!r
33
- }), { data: i, isLoading: F } = u({
34
- queryKey: [a.BOOKING, r],
32
+ enabled: o === t.FLIGHT && !!r
33
+ }), { data: a, isLoading: O } = u({
34
+ queryKey: [s.BOOKING, r],
35
35
  queryFn: () => e.getPointsAsCash(r),
36
36
  enabled: !!r
37
37
  }), {
38
- mutate: O,
39
- isPending: A,
38
+ mutate: d,
39
+ isPending: w,
40
40
  isError: y,
41
41
  error: H,
42
- isSuccess: L
42
+ isSuccess: A
43
43
  } = m({
44
44
  mutationFn: async () => {
45
- if (i)
46
- throw new Error("Not supported for bookings made with Points as Cash");
47
- if (t === o.FLIGHT)
45
+ if (o === t.FLIGHT)
48
46
  return e.initiateCancelFlightBooking(r);
49
- throw new Error("Not supported for hotel bookings");
47
+ throw a ? new Error("Not supported for bookings made with Points as Cash") : new Error("Not supported for hotel bookings");
50
48
  },
51
49
  onSuccess: () => {
52
- c();
50
+ l();
53
51
  }
54
52
  }), {
55
53
  mutate: G,
56
- isPending: C,
57
- isError: S,
58
- error: w,
59
- isSuccess: I
54
+ isPending: E,
55
+ isError: L,
56
+ error: S,
57
+ isSuccess: K
60
58
  } = m({
61
59
  mutationFn: async () => {
62
- if (t === o.FLIGHT)
63
- return i && n && await e.cancelPointsBooking({
64
- confirmationCode: i.confirmationCode,
65
- orderId: n.orderId,
66
- provider: i.provider,
67
- type: o.FLIGHT,
68
- pointsAmount: i.points,
69
- cashAmount: i.cashValue.amount
70
- }), e.confirmCancelFlightBooking(r);
71
- if (t === o.HOTEL)
72
- return i && s && await e.cancelPointsBooking({
73
- confirmationCode: i.confirmationCode,
74
- orderId: s.bookingId,
75
- provider: i.provider,
76
- type: o.HOTEL,
77
- pointsAmount: i.points,
78
- cashAmount: i.cashValue.amount
79
- }), e.cancelHotelBooking(r);
60
+ if (o === t.FLIGHT) {
61
+ const n = await e.confirmCancelFlightBooking(r);
62
+ return a && i && n && await e.cancelPointsBooking(i.id), n;
63
+ }
64
+ if (o === t.HOTEL) {
65
+ const n = await e.cancelHotelBooking(r);
66
+ return a && c && n && await e.cancelPointsBooking(c.id), n;
67
+ }
80
68
  },
81
69
  onSuccess: () => {
82
- c();
70
+ l();
83
71
  }
84
72
  }), {
85
- mutate: K,
86
- isPending: P,
87
- isError: N,
88
- error: v
73
+ mutate: P,
74
+ isPending: N,
75
+ isError: q,
76
+ error: T
89
77
  } = m({
90
- mutationFn: async (l) => {
91
- var h, p;
92
- const E = (p = (h = n == null ? void 0 : n.airlineInitiatedChanges) == null ? void 0 : h.filter(
78
+ mutationFn: async (n) => {
79
+ var g, h;
80
+ const C = (h = (g = i == null ? void 0 : i.airlineInitiatedChanges) == null ? void 0 : g.filter(
93
81
  (Q) => !Q.actionTaken
94
- )) == null ? void 0 : p[0];
95
- if (t === o.FLIGHT && (n != null && n.airlineInitiatedChanges) && E)
82
+ )) == null ? void 0 : h[0];
83
+ if (o === t.FLIGHT && (i != null && i.airlineInitiatedChanges) && C)
96
84
  return e.actionAirlineChanges({
97
85
  bookingId: r,
98
- acceptChanges: l,
99
- aicId: E.id
86
+ acceptChanges: n,
87
+ aicId: C.id
100
88
  });
101
89
  throw new Error("Not supported for hotel bookings");
102
90
  },
103
91
  onSuccess: () => {
104
- c();
92
+ l();
105
93
  }
106
- }), c = () => {
94
+ }), l = () => {
107
95
  [
108
- [a.BOOKING, r, t],
109
- [a.TRIPS],
110
- [a.UNCATEGORISED_BOOKINGS]
111
- ].forEach((l) => {
112
- k.invalidateQueries({ queryKey: l });
96
+ [s.BOOKING, r, o],
97
+ [s.TRIPS],
98
+ [s.UNCATEGORISED_BOOKINGS]
99
+ ].forEach((n) => {
100
+ k.invalidateQueries({ queryKey: n });
113
101
  });
114
- }, T = g || B, q = d || f;
102
+ }, I = B || f, v = p || F;
115
103
  return {
116
- details: t === o.HOTEL ? s : n,
117
- isError: T,
118
- error: q,
119
- initiateCancellation: O,
120
- isInitiatingCancellation: A,
104
+ details: o === t.HOTEL ? c : i,
105
+ isError: I,
106
+ error: v,
107
+ initiateCancellation: d,
108
+ isInitiatingCancellation: w,
121
109
  isInitiateCancellationError: y,
122
110
  initiateCancellationError: H,
123
- isInitiateCancellationSuccess: L,
111
+ isInitiateCancellationSuccess: A,
124
112
  cancelBooking: G,
125
- isCancellingBooking: C,
126
- isCancelingBooking: C,
127
- isCancelBookingError: S,
128
- cancelBookingError: w,
129
- isCancelBookingSuccess: I,
130
- actionAirlineChanges: K,
131
- isActionAirlineChangesPending: P,
132
- isActionAirlineChangesError: N,
133
- actionAirlineChangesError: v,
134
- pointsAsCashDetails: i,
135
- isLoadingPointsAsCash: F
113
+ isCancellingBooking: E,
114
+ isCancelingBooking: E,
115
+ isCancelBookingError: L,
116
+ cancelBookingError: S,
117
+ isCancelBookingSuccess: K,
118
+ actionAirlineChanges: P,
119
+ isActionAirlineChangesPending: N,
120
+ isActionAirlineChangesError: q,
121
+ actionAirlineChangesError: T,
122
+ pointsAsCashDetails: a,
123
+ isLoadingPointsAsCash: O
136
124
  };
137
125
  };
138
126
  export {
@@ -7,7 +7,7 @@ import '../../assets/_styles3.css';import '../../assets/_styles4.css';import '..
7
7
  import "../../_styles.flight-booking-DEUJthTJ.js";
8
8
  /* empty css */
9
9
  import "@tanstack/react-query";
10
- import { c } from "../../noRetryInstance-oiHCni_Z.js";
10
+ import { c } from "../../noRetryInstance-C2dRPIQf.js";
11
11
  /* empty css */
12
12
  import "../../context/AwayzContext.js";
13
13
  import { useBookingManagement as t } from "./useBookingManagement.js";
@@ -1,6 +1,6 @@
1
1
  import { useQuery as U } from "@tanstack/react-query";
2
2
  import "../arrayExtensions-DlcBOj5a.js";
3
- import { E as O, t as F } from "../noRetryInstance-oiHCni_Z.js";
3
+ import { E as O, t as F } from "../noRetryInstance-C2dRPIQf.js";
4
4
  import "react";
5
5
  import { FeatureService as t } from "../services/features/featureService.js";
6
6
  const L = [
@@ -1,6 +1,6 @@
1
1
  import { useQuery as u } from "@tanstack/react-query";
2
2
  import "../arrayExtensions-DlcBOj5a.js";
3
- import { E as m, A as c, b as f } from "../noRetryInstance-oiHCni_Z.js";
3
+ import { E as m, A as c, b as f } from "../noRetryInstance-C2dRPIQf.js";
4
4
  import { useEffect as d } from "react";
5
5
  import { useAwayzContext as y } from "./useAwayzContext.js";
6
6
  var i = /* @__PURE__ */ ((r) => (r.HOTEL = "Hotel", r.FLIGHT = "Flight", r))(i || {});
@@ -1,6 +1,6 @@
1
1
  import { useQuery as p, useMutation as u } from "@tanstack/react-query";
2
2
  import { h as m } from "../../arrayExtensions-DlcBOj5a.js";
3
- import { E as e } from "../../noRetryInstance-oiHCni_Z.js";
3
+ import { E as e } from "../../noRetryInstance-C2dRPIQf.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  import "react-i18next";
@@ -11,7 +11,7 @@ import { awayzClient as o } from "../../configs/awayzClient.js";
11
11
  /* empty css */
12
12
  import "../../context/AwayzContext.js";
13
13
  /* empty css */
14
- import { T as n } from "../../TripsService-ByimRRRe.js";
14
+ import { T as n } from "../../TripsService-n1_Fh5P6.js";
15
15
  const b = ({
16
16
  tripId: t,
17
17
  tripDetails: s
@@ -1,5 +1,5 @@
1
1
  import { h as p } from "../../arrayExtensions-DlcBOj5a.js";
2
- import { D as f } from "../../TripsService-ByimRRRe.js";
2
+ import { D as f } from "../../TripsService-n1_Fh5P6.js";
3
3
  import "react";
4
4
  import { renderHook as o, waitFor as i } from "../../tests/TestWrapper.js";
5
5
  import { EMyTripsEndpoints as c } from "../../configs/endpoints.js";
@@ -10,7 +10,7 @@ import "../../_styles.flight-booking-DEUJthTJ.js";
10
10
  /* empty css */
11
11
  import "@tanstack/react-query";
12
12
  import "../../configs/awayzClient.js";
13
- import { c as d } from "../../noRetryInstance-oiHCni_Z.js";
13
+ import { c as d } from "../../noRetryInstance-C2dRPIQf.js";
14
14
  /* empty css */
15
15
  import "../../context/AwayzContext.js";
16
16
  import { EBookingType as m } from "../../services/trips/TripService.types.js";
@@ -1,6 +1,6 @@
1
1
  import { useQuery as n, useMutation as s } from "@tanstack/react-query";
2
2
  import "../../arrayExtensions-DlcBOj5a.js";
3
- import { E as a, d as m } from "../../noRetryInstance-oiHCni_Z.js";
3
+ import { E as a, d as m } from "../../noRetryInstance-C2dRPIQf.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  import "react-i18next";
@@ -8,7 +8,7 @@ import "../../_styles.flight-booking-DEUJthTJ.js";
8
8
  /* empty css */
9
9
  import "@tanstack/react-query";
10
10
  import "../../configs/awayzClient.js";
11
- import { c as l } from "../../noRetryInstance-oiHCni_Z.js";
11
+ import { c as l } from "../../noRetryInstance-C2dRPIQf.js";
12
12
  /* empty css */
13
13
  import "../../context/AwayzContext.js";
14
14
  import { useWallet as t } from "./useWallet.js";
@@ -1,4 +1,4 @@
1
- import { IActionAirlineChangesRequest, ICancelPointsBookingArgs, IFlightBookingDetails, IHotelBookingDetails, IPointsAsCash } from './BookingService.types';
1
+ import { IActionAirlineChangesRequest, IFlightBookingDetails, IHotelBookingDetails, IPointsAsCash } from './BookingService.types';
2
2
  declare class _BookingService {
3
3
  getHotelBooking: (bookingId: string) => Promise<IHotelBookingDetails>;
4
4
  getFlightBooking: (bookingId: string) => Promise<IFlightBookingDetails>;
@@ -6,7 +6,7 @@ declare class _BookingService {
6
6
  confirmCancelFlightBooking: (bookingId: string) => Promise<any>;
7
7
  cancelHotelBooking: (bookingId: string) => Promise<any>;
8
8
  actionAirlineChanges: ({ bookingId, acceptChanges, aicId }: IActionAirlineChangesRequest) => Promise<any>;
9
- cancelPointsBooking: (args: ICancelPointsBookingArgs) => Promise<any>;
9
+ cancelPointsBooking: (bookingId: string) => Promise<any>;
10
10
  getPointsAsCash: (bookingId: string) => Promise<IPointsAsCash>;
11
11
  }
12
12
  export declare const BookingService: _BookingService;
@@ -1,5 +1,4 @@
1
1
  import { IAirport, ICoordinates, ISlice } from '@type-op/shared';
2
- import { EBookingType } from '../trips/TripService.types';
3
2
  export interface IGuest {
4
3
  familyName: string;
5
4
  givenName: string;
@@ -134,11 +133,3 @@ export interface IAirlineInitiatedChanges {
134
133
  added: ISlice[];
135
134
  removed: ISlice[];
136
135
  }
137
- export interface ICancelPointsBookingArgs {
138
- confirmationCode: string;
139
- orderId: string;
140
- provider: string;
141
- type: EBookingType;
142
- pointsAmount: number;
143
- cashAmount: number;
144
- }
package/dist/main.js CHANGED
@@ -13,7 +13,7 @@ import { ETripStatus as h, useTripManagement as k } from "./hooks/useTripManagem
13
13
  import { useWallet as z } from "./hooks/useWallet/useWallet.js";
14
14
  import { AwayzProvider as S } from "./providers/AwayzProvider.js";
15
15
  import { CurrencyService as D } from "./services/currency/CurrencyService.js";
16
- import { c as R, a as V, g as H, i as L } from "./noRetryInstance-oiHCni_Z.js";
16
+ import { c as R, a as V, g as H, i as L } from "./noRetryInstance-C2dRPIQf.js";
17
17
  import { RewardsService as O } from "./services/rewards/RewardsService.js";
18
18
  import { EBookingType as W } from "./services/trips/TripService.types.js";
19
19
  import { EAuthFlow as j } from "./types/EAuthFlow.js";
@@ -17,9 +17,9 @@ import { awayzClient as $ } from "./configs/awayzClient.js";
17
17
  import "./context/AwayzContext.js";
18
18
  /* empty css */
19
19
  import { EAuthFlow as Et } from "./types/EAuthFlow.js";
20
- const P = (e) => Array.isArray(e) ? e.map((t) => P(t)) : typeof e == "object" && e !== null ? Object.keys(e).reduce((t, n) => {
20
+ const F = (e) => Array.isArray(e) ? e.map((t) => F(t)) : typeof e == "object" && e !== null ? Object.keys(e).reduce((t, n) => {
21
21
  const r = gt(n);
22
- return t[r] = P(e[n]), t;
22
+ return t[r] = F(e[n]), t;
23
23
  }, {}) : e;
24
24
  function Rt(e) {
25
25
  return e.replace(/([A-Z])/g, "_$1").toLowerCase();
@@ -1239,8 +1239,8 @@ const $n = async (e) => {
1239
1239
  method: "POST",
1240
1240
  body: r,
1241
1241
  duplex: "half"
1242
- }), F;
1243
- if (a.isFormData(r) && (F = A.headers.get("content-type")) && l.setContentType(F), A.body) {
1242
+ }), D;
1243
+ if (a.isFormData(r) && (D = A.headers.get("content-type")) && l.setContentType(D), A.body) {
1244
1244
  const [B, W] = Ce(
1245
1245
  p,
1246
1246
  Q(Ie(f))
@@ -1266,8 +1266,8 @@ const $n = async (e) => {
1266
1266
  ["status", "statusText", "headers"].forEach((we) => {
1267
1267
  A[we] = w[we];
1268
1268
  });
1269
- const F = a.toFiniteNumber(w.headers.get("content-length")), [B, W] = c && Ce(
1270
- F,
1269
+ const D = a.toFiniteNumber(w.headers.get("content-length")), [B, W] = c && Ce(
1270
+ D,
1271
1271
  Q(Ie(c), !0)
1272
1272
  ) || [];
1273
1273
  w = new Response(
@@ -1279,8 +1279,8 @@ const $n = async (e) => {
1279
1279
  }
1280
1280
  u = u || "text";
1281
1281
  let k = await ee[a.findKey(ee, u) || "text"](w, e);
1282
- return !T && m && m(), await new Promise((A, F) => {
1283
- nt(A, F, {
1282
+ return !T && m && m(), await new Promise((A, D) => {
1283
+ nt(A, D, {
1284
1284
  data: k,
1285
1285
  headers: N.from(w.headers),
1286
1286
  status: w.status,
@@ -1725,7 +1725,7 @@ const {
1725
1725
  spread: qr,
1726
1726
  toFormData: Hr,
1727
1727
  AxiosHeaders: Mr,
1728
- HttpStatusCode: D,
1728
+ HttpStatusCode: P,
1729
1729
  formToJSON: jr,
1730
1730
  getAdapter: zr,
1731
1731
  mergeConfig: Gr
@@ -1748,10 +1748,10 @@ const {
1748
1748
  );
1749
1749
  }, dt = async (e, t, n, r, s) => {
1750
1750
  var f, u, l;
1751
- const o = t.config, i = localStorage.getItem(I.REFRESH_TOKEN), c = ((f = t.response) == null ? void 0 : f.status) || D.InternalServerError;
1751
+ const o = t.config, i = localStorage.getItem(I.REFRESH_TOKEN), c = ((f = t.response) == null ? void 0 : f.status) || P.InternalServerError;
1752
1752
  if (!o || o.__retries === n)
1753
1753
  throw t;
1754
- if (c === D.Unauthorized && o.url !== b.REFRESH_EMBED_TOKEN && o.url !== b.REFRESH_TOKEN && o.url !== b.SIGN_IN && o.url !== b.SIGN_UP) {
1754
+ if (c === P.Unauthorized && o.url !== b.REFRESH_EMBED_TOKEN && o.url !== b.REFRESH_TOKEN && o.url !== b.SIGN_IN && o.url !== b.SIGN_UP) {
1755
1755
  if (!i)
1756
1756
  throw Be(
1757
1757
  "refresh_token",
@@ -1770,12 +1770,13 @@ const {
1770
1770
  return (l = o.url) != null && l.includes(b.EXCHANGE_TOKEN) && "id_token" in S && (o.data = JSON.stringify({ idToken: S.id_token })), r = !1, o.headers && (o.headers.Authorization = `Bearer ${S.token}`), De(e, null, S.token), s(o);
1771
1771
  }
1772
1772
  if ([
1773
- D.BadRequest,
1774
- D.Unauthorized,
1775
- D.Forbidden,
1776
- D.InternalServerError,
1777
- D.Conflict,
1778
- D.NotFound
1773
+ P.BadRequest,
1774
+ P.Unauthorized,
1775
+ P.Forbidden,
1776
+ P.InternalServerError,
1777
+ P.Conflict,
1778
+ P.NotFound,
1779
+ P.UnprocessableEntity
1779
1780
  ].includes(c) || (o.__retries || (o.__retries = 0), o.__retries += 1, o.__retries > n))
1780
1781
  throw t;
1781
1782
  return tr(
@@ -1819,10 +1820,10 @@ class ar {
1819
1820
  }), c = await $.ensureQueryData({
1820
1821
  queryKey: [j.USER_REGIONS],
1821
1822
  queryFn: this.getRegions
1822
- }), f = P(i.data), u = (n = i.data) == null ? void 0 : n.accessToken;
1823
+ }), f = F(i.data), u = (n = i.data) == null ? void 0 : n.accessToken;
1823
1824
  return localStorage.setItem(I.TOKEN, u), {
1824
1825
  success: !0,
1825
- data: P({
1826
+ data: F({
1826
1827
  ...i.data,
1827
1828
  token: u,
1828
1829
  user: {
@@ -1861,7 +1862,7 @@ class ar {
1861
1862
  }), f = await $.ensureQueryData({
1862
1863
  queryKey: [j.USER_REGIONS],
1863
1864
  queryFn: this.getRegions
1864
- }), u = P(c.data), l = (n = c.data) == null ? void 0 : n.tokens.accessToken;
1865
+ }), u = F(c.data), l = (n = c.data) == null ? void 0 : n.tokens.accessToken;
1865
1866
  return localStorage.setItem(I.TOKEN, l), {
1866
1867
  success: !0,
1867
1868
  data: {
@@ -1891,7 +1892,7 @@ class ar {
1891
1892
  }), u = await $.ensureQueryData({
1892
1893
  queryKey: [j.USER_REGIONS],
1893
1894
  queryFn: this.getRegions
1894
- }), l = P(f.data), d = (r = f.data) == null ? void 0 : r.tokens.accessToken;
1895
+ }), l = F(f.data), d = (r = f.data) == null ? void 0 : r.tokens.accessToken;
1895
1896
  return localStorage.setItem(I.TOKEN, d), {
1896
1897
  success: !0,
1897
1898
  data: {
@@ -1950,7 +1951,7 @@ class ar {
1950
1951
  ), f = await $.ensureQueryData({
1951
1952
  queryKey: [j.USER_REGIONS],
1952
1953
  queryFn: this.getRegions
1953
- }), u = P(c.data);
1954
+ }), u = F(c.data);
1954
1955
  return {
1955
1956
  success: !0,
1956
1957
  data: {
@@ -1988,7 +1989,7 @@ class ar {
1988
1989
  };
1989
1990
  return {
1990
1991
  success: !0,
1991
- data: P(r)
1992
+ data: F(r)
1992
1993
  };
1993
1994
  } catch (t) {
1994
1995
  console.error(t);
@@ -2067,7 +2068,7 @@ class ar {
2067
2068
  U(this, "getRegions", async () => {
2068
2069
  var n;
2069
2070
  const t = await C.get(b.REGIONS);
2070
- return P((n = t.data) == null ? void 0 : n.data);
2071
+ return F((n = t.data) == null ? void 0 : n.data);
2071
2072
  });
2072
2073
  }
2073
2074
  }
@@ -2081,7 +2082,7 @@ export {
2081
2082
  qe as A,
2082
2083
  j as E,
2083
2084
  Re as a,
2084
- P as b,
2085
+ F as b,
2085
2086
  C as c,
2086
2087
  yt as d,
2087
2088
  Zn as e,
@@ -12,7 +12,7 @@ import "react-i18next";
12
12
  import '../assets/_styles3.css';import '../assets/_styles4.css';import '../assets/_styles.css';import '../assets/_styles2.css';/* empty css */
13
13
  /* empty css */
14
14
  import { awayzClient as y } from "../configs/awayzClient.js";
15
- import "../noRetryInstance-oiHCni_Z.js";
15
+ import "../noRetryInstance-C2dRPIQf.js";
16
16
  /* empty css */
17
17
  /* empty css */
18
18
  import { useFeatureFlags as A } from "../hooks/useFeatureFlags.js";
@@ -1,5 +1,5 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
- import { A as e } from "../../noRetryInstance-oiHCni_Z.js";
2
+ import { A as e } from "../../noRetryInstance-C2dRPIQf.js";
3
3
  import "../../_styles.flight-booking-DEUJthTJ.js";
4
4
  import "react";
5
5
  import "../../configs/awayzClient.js";
@@ -1,24 +1,24 @@
1
1
  var g = Object.defineProperty;
2
2
  var y = (r, t, a) => t in r ? g(r, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : r[t] = a;
3
- var i = (r, t, a) => y(r, typeof t != "symbol" ? t + "" : t, a);
3
+ var c = (r, t, a) => y(r, typeof t != "symbol" ? t + "" : t, a);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { c as d, b as l, g as p } from "../../noRetryInstance-oiHCni_Z.js";
5
+ import { c as d, b as u, g as p } from "../../noRetryInstance-C2dRPIQf.js";
6
6
  import "react";
7
- import { EBookingEndpoints as c } from "../../configs/endpoints.js";
7
+ import { EBookingEndpoints as i } from "../../configs/endpoints.js";
8
8
  const f = (r) => {
9
9
  const t = /P((\d+)D)?T((\d+)H)?((\d+)M)?/, a = r.match(t);
10
10
  if (a) {
11
- const o = a[2] ? `${a[2]}d ` : "", e = a[4] ? `${a[4]}h ` : "", m = a[6] ? `${a[6]}m` : "";
12
- return `${o}${e}${m}`.trim();
11
+ const o = a[2] ? `${a[2]}d ` : "", e = a[4] ? `${a[4]}h ` : "", l = a[6] ? `${a[6]}m` : "";
12
+ return `${o}${e}${l}`.trim();
13
13
  } else
14
14
  return r;
15
15
  };
16
16
  class h {
17
17
  constructor() {
18
- i(this, "getHotelBooking", async (t) => {
19
- var m, _;
18
+ c(this, "getHotelBooking", async (t) => {
19
+ var l, _;
20
20
  const { data: a } = await d.get(
21
- `${c.USER_HOTEL_BOOKINGS}/${t}`
21
+ `${i.USER_HOTEL_BOOKINGS}/${t}`
22
22
  ), o = a.data.accommodation.rooms[0].rates[0];
23
23
  return {
24
24
  id: a.data._id,
@@ -54,15 +54,15 @@ class h {
54
54
  longitude: a.data.accommodation.location.geographic_coordinates.longitude
55
55
  },
56
56
  images: a.data.accommodation.photos.map((n) => n.url),
57
- guests: a.data.guests.map((n, u) => {
57
+ guests: a.data.guests.map((n, m) => {
58
58
  var s;
59
59
  return {
60
60
  familyName: n.family_name,
61
61
  givenName: n.given_name,
62
- type: (s = a.data.guest_types[u]) == null ? void 0 : s.type
62
+ type: (s = a.data.guest_types[m]) == null ? void 0 : s.type
63
63
  };
64
64
  }),
65
- numberOfRooms: (m = a.data.rooms) == null ? void 0 : m.length,
65
+ numberOfRooms: (l = a.data.rooms) == null ? void 0 : l.length,
66
66
  cancellationTimeline: o.cancellation_timeline.map(
67
67
  (n) => ({
68
68
  refundAmount: parseFloat(n.refund_amount),
@@ -71,9 +71,9 @@ class h {
71
71
  })
72
72
  ),
73
73
  rooms: (_ = a.data.rooms) == null ? void 0 : _.map((n) => {
74
- var u;
74
+ var m;
75
75
  return {
76
- beds: (u = n.beds) == null ? void 0 : u.map((s) => ({
76
+ beds: (m = n.beds) == null ? void 0 : m.map((s) => ({
77
77
  type: s.type,
78
78
  count: s.count
79
79
  })),
@@ -84,9 +84,9 @@ class h {
84
84
  createdAt: a.data.created_at
85
85
  };
86
86
  });
87
- i(this, "getFlightBooking", async (t) => {
87
+ c(this, "getFlightBooking", async (t) => {
88
88
  const { data: a } = await d.get(
89
- `${c.USER_FLIGHT_BOOKINGS}/${t}`
89
+ `${i.USER_FLIGHT_BOOKINGS}/${t}`
90
90
  );
91
91
  return {
92
92
  id: a.data._id,
@@ -137,38 +137,38 @@ class h {
137
137
  numberOfStops: e.segments.length - 1,
138
138
  reference: a.data.booking_reference,
139
139
  durationInMinutes: f(e.duration),
140
- origin: l(e.origin),
141
- destination: l(e.destination)
140
+ origin: u(e.origin),
141
+ destination: u(e.destination)
142
142
  })),
143
143
  availableActions: a.data.available_actions,
144
- airlineInitiatedChanges: l(a.data.airline_initiated_changes) || []
144
+ airlineInitiatedChanges: u(a.data.airline_initiated_changes) || []
145
145
  };
146
146
  });
147
- i(this, "initiateCancelFlightBooking", async (t) => {
147
+ c(this, "initiateCancelFlightBooking", async (t) => {
148
148
  const { data: a } = await d.put(
149
- `${c.INITIATE_FLIGHT_CANCEL}/${t}`
149
+ `${i.INITIATE_FLIGHT_CANCEL}/${t}`
150
150
  );
151
151
  return a.success;
152
152
  });
153
- i(this, "confirmCancelFlightBooking", async (t) => {
153
+ c(this, "confirmCancelFlightBooking", async (t) => {
154
154
  const { data: a } = await d.put(
155
- `${c.CONFIRM_FLIGHT_CANCEL}/${t}`
155
+ `${i.CONFIRM_FLIGHT_CANCEL}/${t}`
156
156
  );
157
157
  return a.success;
158
158
  });
159
- i(this, "cancelHotelBooking", async (t) => {
159
+ c(this, "cancelHotelBooking", async (t) => {
160
160
  const { data: a } = await d.post(
161
- `${c.CANCEL_HOTEL_BOOKING}/${t}`
161
+ `${i.CANCEL_HOTEL_BOOKING}/${t}`
162
162
  );
163
163
  return a.success;
164
164
  });
165
- i(this, "actionAirlineChanges", async ({
165
+ c(this, "actionAirlineChanges", async ({
166
166
  bookingId: t,
167
167
  acceptChanges: a,
168
168
  aicId: o
169
169
  }) => {
170
170
  const { data: e } = await d.post(
171
- c.ACTION_AIRLINE_CHANGES,
171
+ i.ACTION_AIRLINE_CHANGES,
172
172
  {
173
173
  booking_id: t,
174
174
  action_taken: a ? "accepted" : "cancelled",
@@ -177,23 +177,18 @@ class h {
177
177
  );
178
178
  return e.success;
179
179
  });
180
- i(this, "cancelPointsBooking", async (t) => {
180
+ c(this, "cancelPointsBooking", async (t) => {
181
181
  const { data: a } = await p.post(
182
- `${c.REFUND_POINTS_BOOKING}`,
182
+ `${i.REFUND_POINTS_BOOKING}`,
183
183
  {
184
- confirmationCode: t.confirmationCode,
185
- orderId: t.orderId,
186
- provider: t.provider,
187
- type: t.type,
188
- pointsAmount: t.pointsAmount,
189
- cashAmount: t.cashAmount
184
+ bookingId: t
190
185
  }
191
186
  );
192
187
  return a.success;
193
188
  });
194
- i(this, "getPointsAsCash", async (t) => {
189
+ c(this, "getPointsAsCash", async (t) => {
195
190
  const { data: a } = await p.get(
196
- `${c.BOOKING_POINTS_AS_CASH}/${t}`
191
+ `${i.BOOKING_POINTS_AS_CASH}/${t}`
197
192
  );
198
193
  return {
199
194
  ...a.data,
@@ -2,7 +2,7 @@ import '../../assets/_styles3.css';import '../../assets/_styles4.css';import '..
2
2
  var m = (t, r, e) => r in t ? p(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
- import { A as C, E, c as s } from "../../noRetryInstance-oiHCni_Z.js";
5
+ import { A as C, E, c as s } from "../../noRetryInstance-C2dRPIQf.js";
6
6
  import "react";
7
7
  import { ECurrencyEndpoints as i } from "../../configs/endpoints.js";
8
8
  import "react/jsx-runtime";
@@ -1,5 +1,5 @@
1
1
  import { EAuthEndpoints as a } from "../../configs/endpoints.js";
2
- import { c as o } from "../../noRetryInstance-oiHCni_Z.js";
2
+ import { c as o } from "../../noRetryInstance-C2dRPIQf.js";
3
3
  class i {
4
4
  static async getFeatures() {
5
5
  try {
@@ -1,5 +1,5 @@
1
1
  import { CurrencyService as a } from "./currency/CurrencyService.js";
2
- import { c as t, a as o, g as c, i as s } from "../noRetryInstance-oiHCni_Z.js";
2
+ import { c as t, a as o, g as c, i as s } from "../noRetryInstance-C2dRPIQf.js";
3
3
  import { RewardsService as p } from "./rewards/RewardsService.js";
4
4
  import { EBookingType as m } from "./trips/TripService.types.js";
5
5
  export {
@@ -1,7 +1,7 @@
1
1
  import "../arrayExtensions-DlcBOj5a.js";
2
2
  import "../_styles.flight-booking-DEUJthTJ.js";
3
3
  import "react";
4
- import { c as r, g as s, i as c } from "../noRetryInstance-oiHCni_Z.js";
4
+ import { c as r, g as s, i as c } from "../noRetryInstance-C2dRPIQf.js";
5
5
  import "../configs/baseUrl.js";
6
6
  export {
7
7
  r as clientInstance,
@@ -1,7 +1,7 @@
1
1
  import "../arrayExtensions-DlcBOj5a.js";
2
2
  import "../_styles.flight-booking-DEUJthTJ.js";
3
3
  import "react";
4
- import { m as C, k as c, l as F, h as j, j as k, n as q, p as w } from "../noRetryInstance-oiHCni_Z.js";
4
+ import { m as C, k as c, l as F, h as j, j as k, n as q, p as w } from "../noRetryInstance-C2dRPIQf.js";
5
5
  import "../configs/baseUrl.js";
6
6
  import "../configs/endpoints.js";
7
7
  import "../configs/gatewayBaseUrl.js";
@@ -1,4 +1,4 @@
1
- import { a } from "../noRetryInstance-oiHCni_Z.js";
1
+ import { a } from "../noRetryInstance-C2dRPIQf.js";
2
2
  export {
3
3
  a as clientNoRetryInstance
4
4
  };
@@ -2,7 +2,7 @@ var a = Object.defineProperty;
2
2
  var o = (s, e, r) => e in s ? a(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r;
3
3
  var n = (s, e, r) => o(s, typeof e != "symbol" ? e + "" : e, r);
4
4
  import { EPreferencesEndpoints as u } from "../../configs/endpoints.js";
5
- import { c as i } from "../../noRetryInstance-oiHCni_Z.js";
5
+ import { c as i } from "../../noRetryInstance-C2dRPIQf.js";
6
6
  class E {
7
7
  constructor() {
8
8
  n(this, "setCurrency", async (e) => {
@@ -2,7 +2,7 @@ var s = Object.defineProperty;
2
2
  var n = (t, e, a) => e in t ? s(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
3
3
  var r = (t, e, a) => n(t, typeof e != "symbol" ? e + "" : e, a);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { c as o, b as c } from "../../noRetryInstance-oiHCni_Z.js";
5
+ import { c as o, b as c } from "../../noRetryInstance-C2dRPIQf.js";
6
6
  import "react";
7
7
  import { ERewardsEndpoints as i } from "../../configs/endpoints.js";
8
8
  class m {
@@ -1,6 +1,6 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
- import "../../noRetryInstance-oiHCni_Z.js";
3
- import { T } from "../../TripsService-ByimRRRe.js";
2
+ import "../../noRetryInstance-C2dRPIQf.js";
3
+ import { T } from "../../TripsService-n1_Fh5P6.js";
4
4
  import "react";
5
5
  import "../../configs/endpoints.js";
6
6
  import "./TripService.types.js";
@@ -2,7 +2,7 @@ var o = Object.defineProperty;
2
2
  var i = (d, a, t) => a in d ? o(d, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[a] = t;
3
3
  var r = (d, a, t) => i(d, typeof a != "symbol" ? a + "" : a, t);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { c as e, b as c, g as A } from "../../noRetryInstance-oiHCni_Z.js";
5
+ import { c as e, b as c, g as A } from "../../noRetryInstance-C2dRPIQf.js";
6
6
  import "react";
7
7
  import { EWalletEndpoints as s } from "../../configs/endpoints.js";
8
8
  class u {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odynn/awayz-core",
3
- "version": "0.9.7",
3
+ "version": "0.9.9",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"