@odynn/awayz-core 0.5.8 → 0.5.10

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.
@@ -1783,7 +1783,16 @@ C.interceptors.request.use((e) => (e = Vn(e), e));
1783
1783
  const Qn = 3;
1784
1784
  let er = !1;
1785
1785
  const tr = [];
1786
- C.interceptors.response.use(null, (e) => Yn(tr, e, Qn, er, C));
1786
+ C.interceptors.response.use(
1787
+ null,
1788
+ (e) => Yn(
1789
+ tr,
1790
+ e,
1791
+ Qn,
1792
+ er,
1793
+ C
1794
+ )
1795
+ );
1787
1796
  class nr {
1788
1797
  constructor() {
1789
1798
  /**
@@ -1,7 +1,7 @@
1
1
  var _ = Object.defineProperty;
2
2
  var g = (a, e, s) => e in a ? _(a, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[e] = s;
3
3
  var r = (a, e, s) => g(a, typeof e != "symbol" ? e + "" : e, s);
4
- import { c as n, f as p, b as o, r as T } from "./AccountService-CtMwRIoL.js";
4
+ import { c as n, f as p, b as o, r as T } from "./AccountService-C-V8tiGr.js";
5
5
  import { EBookingType as m } from "./services/trips/TripService.types.js";
6
6
  import { EMyTripsEndpoints as i } from "./configs/endpoints.js";
7
7
  import "./arrayExtensions-DlcBOj5a.js";
@@ -5,7 +5,7 @@ import { u as D, a as nt, c as A, b as q, d as he, e as ot, f as st, g as G, o a
5
5
  import { r as mt, R as yt } from "../../index-Cv-wvFlM.js";
6
6
  import { useQuery as gt } from "@tanstack/react-query";
7
7
  import "../../arrayExtensions-DlcBOj5a.js";
8
- import { E as Ct } from "../../AccountService-CtMwRIoL.js";
8
+ import { E as Ct } from "../../AccountService-C-V8tiGr.js";
9
9
  import { b as de } from "../../index-CDh8vAM_.js";
10
10
  import "../../context/AwayzContext.js";
11
11
  import "../../configs/awayzClient.js";
@@ -5,7 +5,7 @@ import "react";
5
5
  import "../../context/AwayzContext.js";
6
6
  import "@tanstack/react-query";
7
7
  import "../../arrayExtensions-DlcBOj5a.js";
8
- import "../../AccountService-CtMwRIoL.js";
8
+ import "../../AccountService-C-V8tiGr.js";
9
9
  import "../../configs/awayzClient.js";
10
10
  import { EAuthFlow as i } from "../../types/EAuthFlow.js";
11
11
  import "../../services/noRetryInstance.js";
@@ -5,7 +5,7 @@ import "react";
5
5
  import "../../../context/AwayzContext.js";
6
6
  import "@tanstack/react-query";
7
7
  import "../../../arrayExtensions-DlcBOj5a.js";
8
- import "../../../AccountService-CtMwRIoL.js";
8
+ import "../../../AccountService-C-V8tiGr.js";
9
9
  import "../../../configs/awayzClient.js";
10
10
  import { EAuthFlow as e } from "../../../types/EAuthFlow.js";
11
11
  import "../../../services/noRetryInstance.js";
@@ -1,41 +1,41 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
- import { e as v, A as o, E as K } from "../../AccountService-CtMwRIoL.js";
2
+ import { e as v, A as o, E as K } from "../../AccountService-C-V8tiGr.js";
3
3
  import { E as n } from "../../keys-DcSEucOc.js";
4
- import { useState as E, useCallback as O, useEffect as w } from "react";
4
+ import { useState as d, useCallback as O, useEffect as S } from "react";
5
5
  import { awayzClient as R } from "../../configs/awayzClient.js";
6
6
  import { PreferencesService as C } from "../../services/preferences/PreferencesService.js";
7
7
  import { EAuthFlow as h } from "../../types/EAuthFlow.js";
8
- const P = (t, r) => {
9
- var g, y;
10
- let c = "", m = r;
11
- typeof r == "string" ? c = r : r instanceof v ? (c = r.message, m = {
8
+ const P = (s, r) => {
9
+ var f, m;
10
+ let c = "", E = r;
11
+ typeof r == "string" ? c = r : r instanceof v ? (c = r.message, E = {
12
12
  message: r.message,
13
13
  cause: r.cause,
14
14
  status: r.status,
15
- data: (g = r == null ? void 0 : r.response) == null ? void 0 : g.data
16
- }) : c = r.message, (y = window.parent) == null || y.postMessage(
15
+ data: (f = r == null ? void 0 : r.response) == null ? void 0 : f.data
16
+ }) : c = r.message, (m = window.parent) == null || m.postMessage(
17
17
  {
18
18
  type: "auth_error",
19
- details: { message: c, action: t, info: m }
19
+ details: { message: c, action: s, info: E }
20
20
  },
21
21
  "*"
22
22
  );
23
- }, Y = (t) => {
24
- const [r, c] = E(!0), [m, g] = E(!1), [y, A] = E(), [d, T] = E(), [I, N] = E([]), S = O(
25
- async (s) => {
26
- t != null && t.onSuccess && (t == null || t.onSuccess(s)), t != null && t.onSuccessAsync && await (t == null ? void 0 : t.onSuccessAsync(s)), c(!1), g(!0), A(s.token), T(s.user), R.invalidateQueries();
23
+ }, $ = (s) => {
24
+ const [r, c] = d(!0), [E, f] = d(!1), [m, A] = d(), [g, T] = d(), [I, F] = d([]), y = O(
25
+ async (t) => {
26
+ s != null && s.onSuccess && (s == null || s.onSuccess(t)), s != null && s.onSuccessAsync && await (s == null ? void 0 : s.onSuccessAsync(t)), c(!1), f(!0), A(t.token), T(t.user), R.invalidateQueries();
27
27
  },
28
- [t]
28
+ [s]
29
29
  ), i = O(
30
- async (s, e) => {
31
- if (t.authFlow !== h.POST_MESSAGE)
32
- return P(e ?? "exchange_token", s);
33
- t != null && t.onError && (t == null || t.onError(s)), t != null && t.onErrorAsync && await (t == null ? void 0 : t.onErrorAsync(s)), c(!1);
30
+ async (t, e) => {
31
+ if (s.authFlow !== h.POST_MESSAGE)
32
+ return P(e ?? "exchange_token", t);
33
+ s != null && s.onError && (s == null || s.onError(t)), s != null && s.onErrorAsync && await (s == null ? void 0 : s.onErrorAsync(t)), c(!1);
34
34
  },
35
- [t]
36
- ), k = async (s) => {
35
+ [s]
36
+ ), k = async (t) => {
37
37
  try {
38
- const { success: e, data: a, message: u } = await o.authenticateWithToken(s);
38
+ const { success: e, data: a, message: u } = await o.authenticateWithToken(t);
39
39
  if (!e) {
40
40
  i(u);
41
41
  return;
@@ -44,13 +44,13 @@ const P = (t, r) => {
44
44
  i("no awayz token returned after exchanging id token");
45
45
  return;
46
46
  }
47
- localStorage.setItem(n.TOKEN, a.token), await S(a);
48
- const { data: f, ...l } = await o.getRequestLimit();
49
- if (!l.success) {
50
- console.error({ reqLimitError: l });
47
+ localStorage.setItem(n.TOKEN, a.token), await y(a);
48
+ const { data: l, ...w } = await o.getRequestLimit();
49
+ if (!w.success) {
50
+ console.error({ reqLimitError: w });
51
51
  return;
52
52
  }
53
- f == null || f.forEach(
53
+ l == null || l.forEach(
54
54
  (U) => window.parent.postMessage(
55
55
  {
56
56
  type: "request_limit",
@@ -64,123 +64,110 @@ const P = (t, r) => {
64
64
  } finally {
65
65
  c(!1);
66
66
  }
67
- }, F = async () => {
67
+ }, N = async () => {
68
68
  try {
69
- const { success: s, data: e } = await R.ensureQueryData({
69
+ const { success: t, data: e } = await R.ensureQueryData({
70
70
  queryKey: [K.CHECK_USER],
71
71
  queryFn: o.checkUser
72
72
  });
73
- if (!s) {
73
+ if (!t) {
74
74
  i(e);
75
75
  return;
76
76
  }
77
- await S({
77
+ await y({
78
78
  user: e,
79
79
  token: localStorage.getItem(n.TOKEN)
80
80
  });
81
- } catch (s) {
82
- i(s);
81
+ } catch (t) {
82
+ i(t);
83
83
  } finally {
84
84
  c(!1);
85
85
  }
86
86
  };
87
- w(() => {
88
- if (t.authFlow !== h.STANDARD) return;
89
- const s = localStorage.getItem(n.TOKEN), e = localStorage.getItem(n.REFRESH_TOKEN);
90
- s && e ? F() : c(!1);
87
+ S(() => {
88
+ if (s.authFlow !== h.STANDARD) return;
89
+ localStorage.getItem(n.TOKEN) ? N() : c(!1);
91
90
  }, []);
92
91
  const _ = async () => {
93
- const s = await o.getRegions();
94
- N(s);
92
+ const t = await o.getRegions();
93
+ F(t);
95
94
  };
96
- return w(() => {
95
+ return S(() => {
97
96
  _();
98
- }, []), w(() => {
99
- if (t.authFlow !== h.QUERY) return;
97
+ }, []), S(() => {
98
+ if (s.authFlow !== h.QUERY) return;
100
99
  const e = new URLSearchParams(window.location.search).get(n.TOKEN);
101
100
  e && k(e);
102
- }, []), w(() => {
103
- if (t.authFlow !== h.POST_MESSAGE) return;
104
- const s = async (e) => {
105
- var f;
101
+ }, []), S(() => {
102
+ if (s.authFlow !== h.POST_MESSAGE) return;
103
+ const t = async (e) => {
104
+ var l;
106
105
  if (e.data.type !== "auth") return;
107
- const a = (f = e.data) == null ? void 0 : f.idToken, u = e.data.refreshToken;
106
+ const a = (l = e.data) == null ? void 0 : l.idToken, u = e.data.refreshToken;
108
107
  if (!a) {
109
- const l = `received message ${JSON.stringify(
108
+ const w = `received message ${JSON.stringify(
110
109
  e.data
111
110
  )}
112
111
  no idToken in body`;
113
- i(l);
114
- return;
115
- }
116
- if (!u) {
117
- const l = `received message: ${JSON.stringify(
118
- e.data
119
- )}
120
- no refreshToken in body`;
121
- i(
122
- l,
123
- "refresh_token"
124
- /* REFRESH */
125
- );
112
+ i(w);
126
113
  return;
127
114
  }
128
115
  localStorage.setItem(n.REFRESH_TOKEN, u), await k(a);
129
116
  };
130
- return window.addEventListener("message", s), window.parent && window.parent.postMessage(
117
+ return window.addEventListener("message", t), window.parent && window.parent.postMessage(
131
118
  {
132
119
  type: "ready"
133
120
  /* READY */
134
121
  },
135
122
  "*"
136
123
  ), () => {
137
- window.removeEventListener("message", s);
124
+ window.removeEventListener("message", t);
138
125
  };
139
126
  }, []), {
140
127
  isAuthenticating: r,
141
- isAuthenticated: m,
142
- token: y,
143
- user: d,
128
+ isAuthenticated: E,
129
+ token: m,
130
+ user: g,
144
131
  supportedRegions: I,
145
- signIn: async (s) => {
132
+ signIn: async (t) => {
146
133
  var a;
147
- const e = await o.login(s);
134
+ const e = await o.login(t);
148
135
  if (!e.success)
149
136
  i(e.message);
150
137
  else {
151
138
  const u = (a = e.data) == null ? void 0 : a.refreshToken;
152
- localStorage.setItem(n.REFRESH_TOKEN, u), await S(e.data);
139
+ localStorage.setItem(n.REFRESH_TOKEN, u), await y(e.data);
153
140
  }
154
141
  return e;
155
142
  },
156
- signUp: async (s) => {
143
+ signUp: async (t) => {
157
144
  var a;
158
- const e = await o.signUp(s);
145
+ const e = await o.signUp(t);
159
146
  if (!e.success)
160
147
  i(e.message);
161
148
  else {
162
149
  const u = (a = e.data) == null ? void 0 : a.refreshToken;
163
- localStorage.setItem(n.REFRESH_TOKEN, u), await S(e.data);
150
+ localStorage.setItem(n.REFRESH_TOKEN, u), await y(e.data);
164
151
  }
165
152
  return e;
166
153
  },
167
154
  signOut: () => {
168
- localStorage.removeItem(n.TOKEN), localStorage.removeItem(n.REFRESH_TOKEN), g(!1), A(void 0), T(void 0);
155
+ localStorage.removeItem(n.TOKEN), localStorage.removeItem(n.REFRESH_TOKEN), f(!1), A(void 0), T(void 0);
169
156
  },
170
- resendVerificationEmail: async (s) => (await o.resendVerificationEmail(s)).success,
171
- setTokens: (s, e) => {
172
- localStorage.setItem(n.TOKEN, s), localStorage.setItem(n.REFRESH_TOKEN, e), k(s);
157
+ resendVerificationEmail: async (t) => (await o.resendVerificationEmail(t)).success,
158
+ setTokens: (t, e) => {
159
+ localStorage.setItem(n.TOKEN, t), localStorage.setItem(n.REFRESH_TOKEN, e), k(t);
173
160
  },
174
- setPreferredCurrency: async (s) => {
175
- const e = await C.setCurrency(s);
161
+ setPreferredCurrency: async (t) => {
162
+ const e = await C.setCurrency(t);
176
163
  if (!e.success || !e.data)
177
164
  return console.error("Failed to set preferred currency:", e), !1;
178
- if (d) {
165
+ if (g) {
179
166
  const a = {
180
- ...d,
167
+ ...g,
181
168
  preferences: {
182
- ...d.preferences,
183
- currency: e.data.currency || d.preferences.currency
169
+ ...g.preferences,
170
+ currency: e.data.currency || g.preferences.currency
184
171
  }
185
172
  };
186
173
  T(a), R.invalidateQueries({
@@ -193,5 +180,5 @@ const P = (t, r) => {
193
180
  };
194
181
  export {
195
182
  P as authFailurePostMessage,
196
- Y as useAwayzAuth
183
+ $ as useAwayzAuth
197
184
  };
@@ -1,10 +1,10 @@
1
- import { useQuery as u, useMutation as c } from "@tanstack/react-query";
1
+ import { useQuery as g, useMutation as c } from "@tanstack/react-query";
2
2
  import "../../arrayExtensions-DlcBOj5a.js";
3
- import { E as o } from "../../AccountService-CtMwRIoL.js";
3
+ import { E as o } from "../../AccountService-C-V8tiGr.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  import "../../context/AwayzContext.js";
7
- import { awayzClient as q } from "../../configs/awayzClient.js";
7
+ import { awayzClient as v } from "../../configs/awayzClient.js";
8
8
  import { EBookingType as i } from "../../services/trips/TripService.types.js";
9
9
  import "../../services/noRetryInstance.js";
10
10
  import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
@@ -13,67 +13,71 @@ import "react-i18next";
13
13
  /* empty css */
14
14
  /* empty css */
15
15
  /* empty css */
16
- import { BookingService as n } from "../../services/bookings/BookingService.js";
17
- const W = (r, e) => {
16
+ import { BookingService as t } from "../../services/bookings/BookingService.js";
17
+ const D = (r, e) => {
18
18
  const {
19
- data: m,
20
- isError: E,
21
- error: g
22
- } = u({
19
+ data: C,
20
+ isError: B,
21
+ error: h
22
+ } = g({
23
23
  queryKey: [o.BOOKING, r, i.HOTEL],
24
- queryFn: () => n.getHotelBooking(r),
24
+ queryFn: () => t.getHotelBooking(r),
25
25
  enabled: e === i.HOTEL && !!r
26
26
  }), {
27
- data: t,
28
- isError: B,
29
- error: C
30
- } = u({
27
+ data: n,
28
+ isError: p,
29
+ error: F
30
+ } = g({
31
31
  queryKey: [o.BOOKING, r, i.FLIGHT],
32
- queryFn: () => n.getFlightBooking(r),
32
+ queryFn: () => t.getFlightBooking(r),
33
33
  enabled: e === i.FLIGHT && !!r
34
34
  }), {
35
- mutate: h,
36
- isPending: p,
37
- isError: F,
38
- error: f,
39
- isSuccess: O
35
+ mutate: O,
36
+ isPending: f,
37
+ isError: H,
38
+ error: S,
39
+ isSuccess: G
40
40
  } = c({
41
41
  mutationFn: async () => {
42
42
  if (e === i.FLIGHT)
43
- return n.initiateCancelFlightBooking(r);
43
+ return t.initiateCancelFlightBooking(r);
44
44
  throw new Error("Not supported for hotel bookings");
45
45
  },
46
46
  onSuccess: () => {
47
47
  a();
48
48
  }
49
49
  }), {
50
- mutate: H,
50
+ mutate: y,
51
51
  isPending: l,
52
- isError: S,
53
- error: G,
54
- isSuccess: y
52
+ isError: L,
53
+ error: A,
54
+ isSuccess: K
55
55
  } = c({
56
56
  mutationFn: async () => {
57
57
  if (e === i.FLIGHT)
58
- return n.confirmCancelFlightBooking(r);
58
+ return t.confirmCancelFlightBooking(r);
59
59
  if (e === i.HOTEL)
60
- return n.cancelHotelBooking(r);
60
+ return t.cancelHotelBooking(r);
61
61
  },
62
62
  onSuccess: () => {
63
63
  a();
64
64
  }
65
65
  }), {
66
- mutate: L,
67
- isPending: A,
68
- isError: K,
69
- error: d
66
+ mutate: d,
67
+ isPending: I,
68
+ isError: N,
69
+ error: T
70
70
  } = c({
71
71
  mutationFn: async (s) => {
72
- if (e === i.FLIGHT && (t != null && t.airlineInitiatedChanges))
73
- return n.actionAirlineChanges({
72
+ var m, E;
73
+ const u = (E = (m = n == null ? void 0 : n.airlineInitiatedChanges) == null ? void 0 : m.filter(
74
+ (P) => !P.actionTaken
75
+ )) == null ? void 0 : E[0];
76
+ if (e === i.FLIGHT && (n != null && n.airlineInitiatedChanges) && u)
77
+ return t.actionAirlineChanges({
74
78
  bookingId: r,
75
79
  acceptChanges: s,
76
- aicId: t.airlineInitiatedChanges[0].id
80
+ aicId: u.id
77
81
  });
78
82
  throw new Error("Not supported for hotel bookings");
79
83
  },
@@ -86,30 +90,30 @@ const W = (r, e) => {
86
90
  [o.TRIPS],
87
91
  [o.UNCATEGORISED_BOOKINGS]
88
92
  ].forEach((s) => {
89
- q.invalidateQueries({ queryKey: s });
93
+ v.invalidateQueries({ queryKey: s });
90
94
  });
91
- }, I = E || B, N = g || C;
95
+ }, q = B || p, w = h || F;
92
96
  return {
93
- details: e === i.HOTEL ? m : t,
94
- isError: I,
95
- error: N,
96
- initiateCancellation: h,
97
- isInitiatingCancellation: p,
98
- isInitiateCancellationError: F,
99
- initiateCancellationError: f,
100
- isInitiateCancellationSuccess: O,
101
- cancelBooking: H,
97
+ details: e === i.HOTEL ? C : n,
98
+ isError: q,
99
+ error: w,
100
+ initiateCancellation: O,
101
+ isInitiatingCancellation: f,
102
+ isInitiateCancellationError: H,
103
+ initiateCancellationError: S,
104
+ isInitiateCancellationSuccess: G,
105
+ cancelBooking: y,
102
106
  isCancellingBooking: l,
103
107
  isCancelingBooking: l,
104
- isCancelBookingError: S,
105
- cancelBookingError: G,
106
- isCancelBookingSuccess: y,
107
- actionAirlineChanges: L,
108
- isActionAirlineChangesPending: A,
109
- isActionAirlineChangesError: K,
110
- actionAirlineChangesError: d
108
+ isCancelBookingError: L,
109
+ cancelBookingError: A,
110
+ isCancelBookingSuccess: K,
111
+ actionAirlineChanges: d,
112
+ isActionAirlineChangesPending: I,
113
+ isActionAirlineChangesError: N,
114
+ actionAirlineChangesError: T
111
115
  };
112
116
  };
113
117
  export {
114
- W as useBookingManagement
118
+ D as useBookingManagement
115
119
  };
@@ -1,5 +1,5 @@
1
1
  import { EBookingEndpoints as i } from "../../configs/endpoints.js";
2
- import { c } from "../../AccountService-CtMwRIoL.js";
2
+ import { c } from "../../AccountService-C-V8tiGr.js";
3
3
  import "../../services/noRetryInstance.js";
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
5
  import "react";
@@ -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 "../AccountService-CtMwRIoL.js";
3
+ import { E as m, A as c, b as f } from "../AccountService-C-V8tiGr.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,8 +1,8 @@
1
1
  import { useQuery as p, useMutation as s } from "@tanstack/react-query";
2
2
  import { h as m } from "../../arrayExtensions-DlcBOj5a.js";
3
- import { E as e } from "../../AccountService-CtMwRIoL.js";
3
+ import { E as e } from "../../AccountService-C-V8tiGr.js";
4
4
  import "react";
5
- import { T as t } from "../../TripsService-B9VUFRE1.js";
5
+ import { T as t } from "../../TripsService-Be2PKzKx.js";
6
6
  import "react/jsx-runtime";
7
7
  import "../../context/AwayzContext.js";
8
8
  import { awayzClient as o } from "../../configs/awayzClient.js";
@@ -4,9 +4,9 @@ import { useTripManagement as n } from "./useTripManagement.js";
4
4
  import "react/jsx-runtime";
5
5
  import "react";
6
6
  import "../../context/AwayzContext.js";
7
- import { D as f } from "../../TripsService-B9VUFRE1.js";
7
+ import { D as f } from "../../TripsService-Be2PKzKx.js";
8
8
  import "../../configs/awayzClient.js";
9
- import { c } from "../../AccountService-CtMwRIoL.js";
9
+ import { c } from "../../AccountService-C-V8tiGr.js";
10
10
  import { EMyTripsEndpoints as d } from "../../configs/endpoints.js";
11
11
  import "@tanstack/react-query";
12
12
  import { EBookingType as m } from "../../services/trips/TripService.types.js";
@@ -1,6 +1,6 @@
1
1
  import { useQuery as n, useMutation as i } from "@tanstack/react-query";
2
2
  import "../../arrayExtensions-DlcBOj5a.js";
3
- import { E as t, a as u } from "../../AccountService-CtMwRIoL.js";
3
+ import { E as t, a as u } from "../../AccountService-C-V8tiGr.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  import "../../context/AwayzContext.js";
@@ -4,7 +4,7 @@ import "react";
4
4
  import "../../context/AwayzContext.js";
5
5
  import "../../arrayExtensions-DlcBOj5a.js";
6
6
  import "../../configs/awayzClient.js";
7
- import { c as l } from "../../AccountService-CtMwRIoL.js";
7
+ import { c as l } from "../../AccountService-C-V8tiGr.js";
8
8
  import "@tanstack/react-query";
9
9
  import { useWallet as t } from "./useWallet.js";
10
10
  import "../../services/noRetryInstance.js";
package/dist/main.js CHANGED
@@ -6,7 +6,7 @@ import { useTripManagement as f, validateUpdateTripArgs as s } from "./hooks/use
6
6
  import { useBookingManagement as c } from "./hooks/useBookingManagement/useBookingManagement.js";
7
7
  import { EAuthFlow as y } from "./types/EAuthFlow.js";
8
8
  import { EHotelCurrencyOption as d, currencySymbols as C } from "./types/ECurrency.js";
9
- import { c as w, i as A } from "./AccountService-CtMwRIoL.js";
9
+ import { c as w, i as A } from "./AccountService-C-V8tiGr.js";
10
10
  import { clientNoRetryInstance as E } from "./services/noRetryInstance.js";
11
11
  import { CurrencyService as h } from "./services/currency/CurrencyService.js";
12
12
  import { EBookingType as S } from "./services/trips/TripService.types.js";
@@ -6,7 +6,7 @@ import { E as r } from "../keys-DcSEucOc.js";
6
6
  import { useAwayzAuth as l } from "../hooks/useAwayzAuth/useAwayzAuth.js";
7
7
  import { setCustomBaseUrl as i, setBaseUrl as u } from "../configs/baseUrl.js";
8
8
  import { QueryClientProvider as p } from "@tanstack/react-query";
9
- import "../AccountService-CtMwRIoL.js";
9
+ import "../AccountService-C-V8tiGr.js";
10
10
  import { awayzClient as d } from "../configs/awayzClient.js";
11
11
  import "../services/noRetryInstance.js";
12
12
  import '../assets/_styles5.css';import '../assets/_styles4.css';import '../assets/_styles3.css';import '../assets/_styles2.css';import '../assets/_styles.css';/* empty css */
@@ -1,5 +1,5 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
- import { A as e } from "../../AccountService-CtMwRIoL.js";
2
+ import { A as e } from "../../AccountService-C-V8tiGr.js";
3
3
  import "../../keys-DcSEucOc.js";
4
4
  import "react";
5
5
  import "../../configs/endpoints.js";
@@ -1,8 +1,8 @@
1
1
  var u = Object.defineProperty;
2
2
  var _ = (n, e, a) => e in n ? u(n, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[e] = a;
3
- var i = (n, e, a) => _(n, typeof e != "symbol" ? e + "" : e, a);
3
+ var r = (n, e, a) => _(n, typeof e != "symbol" ? e + "" : e, a);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { c, b as l } from "../../AccountService-CtMwRIoL.js";
5
+ import { c, b as l } from "../../AccountService-C-V8tiGr.js";
6
6
  import "react";
7
7
  import { EBookingEndpoints as d } from "../../configs/endpoints.js";
8
8
  const p = (n) => {
@@ -15,7 +15,7 @@ const p = (n) => {
15
15
  };
16
16
  class g {
17
17
  constructor() {
18
- i(this, "getHotelBooking", async (e) => {
18
+ r(this, "getHotelBooking", async (e) => {
19
19
  var s;
20
20
  const { data: a } = await c.get(
21
21
  `${d.USER_HOTEL_BOOKINGS}/${e}`
@@ -50,23 +50,23 @@ class g {
50
50
  latitude: a.data.accommodation.location.geographic_coordinates.latitude,
51
51
  longitude: a.data.accommodation.location.geographic_coordinates.longitude
52
52
  },
53
- images: a.data.accommodation.photos.map((r) => r.url),
54
- guests: a.data.guests.map((r, m) => ({
55
- familyName: r.family_name,
56
- givenName: r.given_name,
53
+ images: a.data.accommodation.photos.map((i) => i.url),
54
+ guests: a.data.guests.map((i, m) => ({
55
+ familyName: i.family_name,
56
+ givenName: i.given_name,
57
57
  type: a.data.guest_types[m].type
58
58
  })),
59
59
  numberOfRooms: (s = a.data.rooms) == null ? void 0 : s.length,
60
60
  cancellationTimeline: o.cancellation_timeline.map(
61
- (r) => ({
62
- refundAmount: parseFloat(r.refund_amount),
63
- currency: r.currency,
64
- before: r.before
61
+ (i) => ({
62
+ refundAmount: parseFloat(i.refund_amount),
63
+ currency: i.currency,
64
+ before: i.before
65
65
  })
66
66
  )
67
67
  };
68
68
  });
69
- i(this, "getFlightBooking", async (e) => {
69
+ r(this, "getFlightBooking", async (e) => {
70
70
  const { data: a } = await c.get(
71
71
  `${d.USER_FLIGHT_BOOKINGS}/${e}`
72
72
  );
@@ -125,25 +125,25 @@ class g {
125
125
  airlineInitiatedChanges: l(a.data.airline_initiated_changes) || []
126
126
  };
127
127
  });
128
- i(this, "initiateCancelFlightBooking", async (e) => {
128
+ r(this, "initiateCancelFlightBooking", async (e) => {
129
129
  const { data: a } = await c.put(
130
130
  `${d.INITIATE_FLIGHT_CANCEL}/${e}`
131
131
  );
132
132
  return a.success;
133
133
  });
134
- i(this, "confirmCancelFlightBooking", async (e) => {
134
+ r(this, "confirmCancelFlightBooking", async (e) => {
135
135
  const { data: a } = await c.put(
136
136
  `${d.CONFIRM_FLIGHT_CANCEL}/${e}`
137
137
  );
138
138
  return a.success;
139
139
  });
140
- i(this, "cancelHotelBooking", async (e) => {
140
+ r(this, "cancelHotelBooking", async (e) => {
141
141
  const { data: a } = await c.post(
142
142
  `${d.CANCEL_HOTEL_BOOKING}/${e}`
143
143
  );
144
144
  return a.success;
145
145
  });
146
- i(this, "actionAirlineChanges", async ({
146
+ r(this, "actionAirlineChanges", async ({
147
147
  bookingId: e,
148
148
  acceptChanges: a,
149
149
  aicId: o
@@ -152,7 +152,7 @@ class g {
152
152
  d.ACTION_AIRLINE_CHANGES,
153
153
  {
154
154
  booking_id: e,
155
- action_taken: a ? "accept" : "reject",
155
+ action_taken: a ? "accept" : "cancel",
156
156
  aic_id: o
157
157
  }
158
158
  );
@@ -2,7 +2,7 @@ import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '..
2
2
  var m = (t, r, e) => r in t ? y(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 "../../AccountService-CtMwRIoL.js";
5
+ import { A as C, E, c as s } from "../../AccountService-C-V8tiGr.js";
6
6
  import "react";
7
7
  import { ECurrencyEndpoints as a } from "../../configs/endpoints.js";
8
8
  import "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { c as o, i as t } from "../AccountService-CtMwRIoL.js";
1
+ import { c as o, i as t } from "../AccountService-C-V8tiGr.js";
2
2
  import { clientNoRetryInstance as c } from "./noRetryInstance.js";
3
3
  import { CurrencyService as a } from "./currency/CurrencyService.js";
4
4
  import { EBookingType as s } from "./trips/TripService.types.js";
@@ -1,7 +1,7 @@
1
1
  import "../arrayExtensions-DlcBOj5a.js";
2
2
  import "../keys-DcSEucOc.js";
3
3
  import "react";
4
- import { c as p, i as a } from "../AccountService-CtMwRIoL.js";
4
+ import { c as p, i as a } from "../AccountService-C-V8tiGr.js";
5
5
  import "../configs/baseUrl.js";
6
6
  export {
7
7
  p as clientInstance,
@@ -1,4 +1,4 @@
1
- import { l, j as m, k as g, g as h, h as u, p as d } from "../AccountService-CtMwRIoL.js";
1
+ import { l, j as m, k as g, g as h, h as u, p as d } from "../AccountService-C-V8tiGr.js";
2
2
  import "../configs/baseUrl.js";
3
3
  import "../arrayExtensions-DlcBOj5a.js";
4
4
  import "../keys-DcSEucOc.js";
@@ -1,4 +1,4 @@
1
- import { d as t, g as r, h as n } from "../AccountService-CtMwRIoL.js";
1
+ import { d as t, g as r, h as n } from "../AccountService-C-V8tiGr.js";
2
2
  const s = t.create();
3
3
  s.interceptors.request.use((e) => (e = r(e), e));
4
4
  const o = 1;
@@ -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 "../../AccountService-CtMwRIoL.js";
5
+ import { c as i } from "../../AccountService-C-V8tiGr.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 { ERewardsEndpoints as c } from "../../configs/endpoints.js";
5
- import { c as o } from "../../AccountService-CtMwRIoL.js";
5
+ import { c as o } from "../../AccountService-C-V8tiGr.js";
6
6
  class i {
7
7
  constructor() {
8
8
  /**
@@ -1,8 +1,8 @@
1
- import "../../AccountService-CtMwRIoL.js";
1
+ import "../../AccountService-C-V8tiGr.js";
2
2
  import "./TripService.types.js";
3
3
  import "../../configs/endpoints.js";
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { T as s } from "../../TripsService-B9VUFRE1.js";
5
+ import { T as s } from "../../TripsService-Be2PKzKx.js";
6
6
  import "react";
7
7
  export {
8
8
  s as TripsService
@@ -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 s, b as c } from "../../AccountService-CtMwRIoL.js";
5
+ import { c as s, b as c } from "../../AccountService-C-V8tiGr.js";
6
6
  import "react";
7
7
  import { EWalletEndpoints as e } from "../../configs/endpoints.js";
8
8
  class A {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odynn/awayz-core",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"