@odynn/awayz-core 0.6.21 → 0.6.22

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 (29) hide show
  1. package/dist/{AccountService-Cj9L15P-.js → AccountService-Cu1fDg5B.js} +16 -17
  2. package/dist/{TripsService-DDN_-m62.js → TripsService-D-0263l6.js} +1 -1
  3. package/dist/components/CashValue/CashValue.js +1 -1
  4. package/dist/components/CashValue/CashValue.stories.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 +1 -1
  8. package/dist/hooks/useBookingManagement/useBookingManagement.test.js +1 -1
  9. package/dist/hooks/useSearchLimit.js +1 -1
  10. package/dist/hooks/useTripManagement/useTripManagement.js +2 -2
  11. package/dist/hooks/useTripManagement/useTripManagement.test.js +2 -2
  12. package/dist/hooks/useWallet/useWallet.js +11 -11
  13. package/dist/hooks/useWallet/useWallet.test.js +1 -1
  14. package/dist/lib/services/account/AccountServices.types.d.ts +0 -1
  15. package/dist/lib/services/bookings/BookingService.types.d.ts +0 -5
  16. package/dist/main.js +1 -1
  17. package/dist/providers/AwayzProvider.js +1 -1
  18. package/dist/services/account/AccountService.js +1 -1
  19. package/dist/services/bookings/BookingService.js +20 -25
  20. package/dist/services/currency/CurrencyService.js +1 -1
  21. package/dist/services/index.js +1 -1
  22. package/dist/services/instance.js +1 -1
  23. package/dist/services/instanceConfig.js +2 -2
  24. package/dist/services/noRetryInstance.js +1 -1
  25. package/dist/services/preferences/PreferencesService.js +1 -1
  26. package/dist/services/rewards/RewardsService.js +1 -1
  27. package/dist/services/trips/TripsService.js +2 -2
  28. package/dist/services/wallet/WalletService.js +41 -32
  29. package/package.json +1 -1
@@ -1050,10 +1050,10 @@ const rt = (e) => {
1050
1050
  config: e,
1051
1051
  request: p
1052
1052
  };
1053
- tt(function(B) {
1054
- n(B), m();
1055
- }, function(B) {
1056
- r(B), m();
1053
+ tt(function(D) {
1054
+ n(D), m();
1055
+ }, function(D) {
1056
+ r(D), m();
1057
1057
  }, A), p = null;
1058
1058
  }
1059
1059
  "onloadend" in p ? p.onloadend = S : p.onreadystatechange = function() {
@@ -1235,11 +1235,11 @@ const Hn = async (e) => {
1235
1235
  duplex: "half"
1236
1236
  }), F;
1237
1237
  if (a.isFormData(r) && (F = A.headers.get("content-type")) && l.setContentType(F), A.body) {
1238
- const [B, W] = Ne(
1238
+ const [D, W] = Ne(
1239
1239
  p,
1240
1240
  Q(Ce(f))
1241
1241
  );
1242
- r = Ue(A.body, Ie, B, W);
1242
+ r = Ue(A.body, Ie, D, W);
1243
1243
  }
1244
1244
  }
1245
1245
  a.isString(d) || (d = d ? "include" : "omit");
@@ -1260,12 +1260,12 @@ const Hn = async (e) => {
1260
1260
  ["status", "statusText", "headers"].forEach((ge) => {
1261
1261
  A[ge] = w[ge];
1262
1262
  });
1263
- const F = a.toFiniteNumber(w.headers.get("content-length")), [B, W] = c && Ne(
1263
+ const F = a.toFiniteNumber(w.headers.get("content-length")), [D, W] = c && Ne(
1264
1264
  F,
1265
1265
  Q(Ce(c), !0)
1266
1266
  ) || [];
1267
1267
  w = new Response(
1268
- Ue(w.body, Ie, B, () => {
1268
+ Ue(w.body, Ie, D, () => {
1269
1269
  W && W(), m && m();
1270
1270
  }),
1271
1271
  A
@@ -1719,7 +1719,7 @@ const {
1719
1719
  spread: Tr,
1720
1720
  toFormData: br,
1721
1721
  AxiosHeaders: Or,
1722
- HttpStatusCode: D,
1722
+ HttpStatusCode: B,
1723
1723
  formToJSON: Ar,
1724
1724
  getAdapter: _r,
1725
1725
  mergeConfig: Nr
@@ -1742,10 +1742,10 @@ const {
1742
1742
  );
1743
1743
  }, Yn = async (e, t, n, r, s) => {
1744
1744
  var f, u, l;
1745
- const o = t.config, i = localStorage.getItem(x.REFRESH_TOKEN), c = ((f = t.response) == null ? void 0 : f.status) || D.InternalServerError;
1745
+ const o = t.config, i = localStorage.getItem(x.REFRESH_TOKEN), c = ((f = t.response) == null ? void 0 : f.status) || B.InternalServerError;
1746
1746
  if (!o || o.__retries === n)
1747
1747
  throw t;
1748
- 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) {
1748
+ if (c === B.Unauthorized && o.url !== b.REFRESH_EMBED_TOKEN && o.url !== b.REFRESH_TOKEN && o.url !== b.SIGN_IN && o.url !== b.SIGN_UP) {
1749
1749
  if (!i)
1750
1750
  throw De(
1751
1751
  "refresh_token",
@@ -1764,12 +1764,11 @@ const {
1764
1764
  return (l = o.url) != null && l.includes(b.EXCHANGE_TOKEN) && "id_token" in R && (o.data = JSON.stringify({ idToken: R.id_token })), r = !1, o.headers && (o.headers.Authorization = `Bearer ${R.token}`), Fe(e, null, R.token), s(o);
1765
1765
  }
1766
1766
  if ([
1767
- D.BadRequest,
1768
- D.Unauthorized,
1769
- D.Forbidden,
1770
- D.InternalServerError,
1771
- D.Conflict,
1772
- D.NotFound
1767
+ B.Unauthorized,
1768
+ B.Forbidden,
1769
+ B.InternalServerError,
1770
+ B.Conflict,
1771
+ B.NotFound
1773
1772
  ].includes(c) || (o.__retries || (o.__retries = 0), o.__retries += 1, o.__retries > n))
1774
1773
  throw t;
1775
1774
  return Xn(
@@ -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, a as c, r as T } from "./AccountService-Cj9L15P-.js";
5
+ import { c as n, f as p, a as c, r as T } from "./AccountService-Cu1fDg5B.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";
@@ -6,7 +6,7 @@ import { r as yt, R as gt } from "../../index-Cv-wvFlM.js";
6
6
  import { useQuery as Ct } from "@tanstack/react-query";
7
7
  import "../../arrayExtensions-DlcBOj5a.js";
8
8
  import { a as Et, b as ue, c as j } from "../../cashUtils-BDa0CVyi.js";
9
- import { E as wt } from "../../AccountService-Cj9L15P-.js";
9
+ import { E as wt } from "../../AccountService-Cu1fDg5B.js";
10
10
  import { c as pe } from "../../index-c5toY3Pm.js";
11
11
  import { EInvalidAmountDisplayOption as S, EToolTipPosition as Pt } from "./CashValueTypes.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 */
@@ -11,7 +11,7 @@ import "react-i18next";
11
11
  import "../../configs/awayzClient.js";
12
12
  import "../../context/AwayzContext.js";
13
13
  import "@tanstack/react-query";
14
- import "../../AccountService-Cj9L15P-.js";
14
+ import "../../AccountService-Cu1fDg5B.js";
15
15
  import { AwayzProvider as a } from "../../providers/AwayzProvider.js";
16
16
  import "../../services/noRetryInstance.js";
17
17
  import { EAuthFlow as i } from "../../types/EAuthFlow.js";
@@ -4,7 +4,7 @@ import "@tanstack/react-query";
4
4
  import "../../../arrayExtensions-DlcBOj5a.js";
5
5
  import "react";
6
6
  import "../../../configs/awayzClient.js";
7
- import "../../../AccountService-Cj9L15P-.js";
7
+ import "../../../AccountService-Cu1fDg5B.js";
8
8
  import '../../../assets/_styles4.css';import '../../../assets/_styles3.css';import '../../../assets/_styles2.css';import '../../../assets/_styles5.css';/* empty css */
9
9
  import "react-i18next";
10
10
  /* empty css */
@@ -1,6 +1,6 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
2
  import { g as P } from "../../cashUtils-BDa0CVyi.js";
3
- import { e as H, A as l, E as K } from "../../AccountService-Cj9L15P-.js";
3
+ import { e as H, A as l, E as K } from "../../AccountService-Cu1fDg5B.js";
4
4
  import { a as u } from "../../keys-D66VvSIm.js";
5
5
  import { useState as f, useCallback as O, useEffect as S } from "react";
6
6
  import { awayzClient as R } from "../../configs/awayzClient.js";
@@ -1,6 +1,6 @@
1
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-Cj9L15P-.js";
3
+ import { E as o } from "../../AccountService-Cu1fDg5B.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  import { awayzClient as v } from "../../configs/awayzClient.js";
@@ -1,5 +1,5 @@
1
1
  import { EBookingEndpoints as i } from "../../configs/endpoints.js";
2
- import { c } from "../../AccountService-Cj9L15P-.js";
2
+ import { c } from "../../AccountService-Cu1fDg5B.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, a as f } from "../AccountService-Cj9L15P-.js";
3
+ import { E as m, A as c, a as f } from "../AccountService-Cu1fDg5B.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-Cj9L15P-.js";
3
+ import { E as e } from "../../AccountService-Cu1fDg5B.js";
4
4
  import "react";
5
- import { T as t } from "../../TripsService-DDN_-m62.js";
5
+ import { T as t } from "../../TripsService-D-0263l6.js";
6
6
  import "react/jsx-runtime";
7
7
  import { awayzClient as o } from "../../configs/awayzClient.js";
8
8
  import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles5.css';/* empty css */
@@ -1,12 +1,12 @@
1
1
  import { h as p } from "../../arrayExtensions-DlcBOj5a.js";
2
- import { D as f } from "../../TripsService-DDN_-m62.js";
2
+ import { D as f } from "../../TripsService-D-0263l6.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";
6
6
  import "react/jsx-runtime";
7
7
  import "@tanstack/react-query";
8
8
  import "../../configs/awayzClient.js";
9
- import { c as d } from "../../AccountService-Cj9L15P-.js";
9
+ import { c as d } from "../../AccountService-Cu1fDg5B.js";
10
10
  import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles5.css';/* empty css */
11
11
  /* empty css */
12
12
  import "react-i18next";
@@ -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 e, b as u } from "../../AccountService-Cj9L15P-.js";
3
+ import { E as e, b as u } from "../../AccountService-Cu1fDg5B.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  import { awayzClient as s } from "../../configs/awayzClient.js";
@@ -19,7 +19,7 @@ const W = () => {
19
19
  queryKey: [e.PROGRAMS],
20
20
  queryFn: o.getAwards,
21
21
  placeholderData: []
22
- }), { data: c } = n({
22
+ }), { data: l } = n({
23
23
  queryKey: [e.USER_PROGRAMS, r == null ? void 0 : r.id],
24
24
  queryFn: () => r != null && r.id ? o.getUserAwards(r.id) : [],
25
25
  placeholderData: [],
@@ -29,11 +29,11 @@ const W = () => {
29
29
  queryFn: () => r != null && r.id ? o.getLinkedUserAwards(r.id) : [],
30
30
  placeholderData: [],
31
31
  enabled: !!(r != null && r.id)
32
- }), { data: P } = n({
32
+ }), { data: A } = n({
33
33
  queryKey: [e.BANKS],
34
34
  queryFn: o.getBanks,
35
35
  placeholderData: []
36
- }), { data: A } = n({
36
+ }), { data: P } = n({
37
37
  queryKey: [e.CARDS],
38
38
  queryFn: o.getCards,
39
39
  placeholderData: []
@@ -64,14 +64,14 @@ const W = () => {
64
64
  queryKey: [e.LINKED_USER_PROGRAMS]
65
65
  });
66
66
  }
67
- }), { mutate: C } = i({
67
+ }), { mutateAsync: C } = i({
68
68
  mutationFn: async (a) => {
69
- const { mainProgram: d, awardsAmount: m } = a, l = t == null ? void 0 : t.find(
69
+ const { mainProgram: d, awardsAmount: m } = a, c = t == null ? void 0 : t.find(
70
70
  (q) => q.mainProgram === d
71
71
  );
72
- if (!l)
72
+ if (!c)
73
73
  throw new Error("Program not found");
74
- await o.setAwardPoints(l.mainProgram, m);
74
+ await o.setAwardPoints(c.mainProgram, m);
75
75
  },
76
76
  onSuccess: () => {
77
77
  [
@@ -104,7 +104,7 @@ const W = () => {
104
104
  return {
105
105
  // Program Management
106
106
  allPrograms: t || [],
107
- userPrograms: c || [],
107
+ userPrograms: l || [],
108
108
  linkedUserPrograms: y || [],
109
109
  hotelPrograms: (t == null ? void 0 : t.filter(
110
110
  (a) => a.category.includes(u.HOTEL)
@@ -119,8 +119,8 @@ const W = () => {
119
119
  addAwardProgram: g,
120
120
  removeAwardProgram: p,
121
121
  // Card Management
122
- banks: P || [],
123
- allCards: A || [],
122
+ banks: A || [],
123
+ allCards: P || [],
124
124
  userCards: R || [],
125
125
  addCards: E,
126
126
  removeCards: K,
@@ -4,7 +4,7 @@ import "@tanstack/react-query";
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
5
  import "react";
6
6
  import "../../configs/awayzClient.js";
7
- import { c as l } from "../../AccountService-Cj9L15P-.js";
7
+ import { c as l } from "../../AccountService-Cu1fDg5B.js";
8
8
  import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles5.css';/* empty css */
9
9
  /* empty css */
10
10
  import "react-i18next";
@@ -11,7 +11,6 @@ export interface IUser {
11
11
  userRegion: IRegion;
12
12
  account: IAccount;
13
13
  preferences: IUserPreferences;
14
- isSocialUser: boolean;
15
14
  }
16
15
  export interface IUserPreferences {
17
16
  currency: string;
@@ -36,11 +36,6 @@ export interface IHotelBookingDetails {
36
36
  checkinAfterTime: string;
37
37
  coordinates: ICoordinates;
38
38
  cancellationTimeline: ICancellationTimeline[];
39
- pointsAsCash?: {
40
- authCode: string;
41
- points: number;
42
- pointsValue: number;
43
- };
44
39
  }
45
40
  export interface ICancellationTimeline {
46
41
  refundAmount: number;
package/dist/main.js CHANGED
@@ -11,7 +11,7 @@ import { useSearchLimit as B } from "./hooks/useSearchLimit.js";
11
11
  import { useTripManagement as k } from "./hooks/useTripManagement/useTripManagement.js";
12
12
  import { useWallet as z } from "./hooks/useWallet/useWallet.js";
13
13
  import { AwayzProvider as T } from "./providers/AwayzProvider.js";
14
- import { c as S, i as F } from "./AccountService-Cj9L15P-.js";
14
+ import { c as S, i as F } from "./AccountService-Cu1fDg5B.js";
15
15
  import { clientNoRetryInstance as P } from "./services/noRetryInstance.js";
16
16
  import { CurrencyService as D } from "./services/currency/CurrencyService.js";
17
17
  import { EBookingType as L } from "./services/trips/TripService.types.js";
@@ -8,7 +8,7 @@ import { defaultAwayzConfig as u } from "../configs/defaultAwayzConfig.js";
8
8
  import { AwayzContext as p } from "../context/AwayzContext.js";
9
9
  import { useAwayzAuth as d } from "../hooks/useAwayzAuth/useAwayzAuth.js";
10
10
  import { awayzClient as h } from "../configs/awayzClient.js";
11
- import "../AccountService-Cj9L15P-.js";
11
+ import "../AccountService-Cu1fDg5B.js";
12
12
  import '../assets/_styles4.css';import '../assets/_styles3.css';import '../assets/_styles2.css';import '../assets/_styles.css';import '../assets/_styles5.css';/* empty css */
13
13
  /* empty css */
14
14
  import "react-i18next";
@@ -1,5 +1,5 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
- import { A as e } from "../../AccountService-Cj9L15P-.js";
2
+ import { A as e } from "../../AccountService-Cu1fDg5B.js";
3
3
  import "../../keys-D66VvSIm.js";
4
4
  import "react";
5
5
  import "../../configs/awayzClient.js";
@@ -1,8 +1,8 @@
1
- var u = Object.defineProperty;
2
- var p = (n, e, a) => e in n ? u(n, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[e] = a;
3
- var c = (n, e, a) => p(n, typeof e != "symbol" ? e + "" : e, a);
1
+ var _ = Object.defineProperty;
2
+ var p = (n, e, a) => e in n ? _(n, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[e] = a;
3
+ var r = (n, e, a) => p(n, typeof e != "symbol" ? e + "" : e, a);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { c as r, a as l } from "../../AccountService-Cj9L15P-.js";
5
+ import { c, a as l } from "../../AccountService-Cu1fDg5B.js";
6
6
  import "react";
7
7
  import { EBookingEndpoints as d } from "../../configs/endpoints.js";
8
8
  const g = (n) => {
@@ -15,9 +15,9 @@ const g = (n) => {
15
15
  };
16
16
  class f {
17
17
  constructor() {
18
- c(this, "getHotelBooking", async (e) => {
18
+ r(this, "getHotelBooking", async (e) => {
19
19
  var s;
20
- const { data: a } = await r.get(
20
+ const { data: a } = await c.get(
21
21
  `${d.USER_HOTEL_BOOKINGS}/${e}`
22
22
  ), o = a.data.accommodation.rooms[0].rates[0];
23
23
  return {
@@ -51,12 +51,12 @@ class f {
51
51
  longitude: a.data.accommodation.location.geographic_coordinates.longitude
52
52
  },
53
53
  images: a.data.accommodation.photos.map((i) => i.url),
54
- guests: a.data.guests.map((i, m) => {
55
- var _;
54
+ guests: a.data.guests.map((i, u) => {
55
+ var m;
56
56
  return {
57
57
  familyName: i.family_name,
58
58
  givenName: i.given_name,
59
- type: (_ = a.data.guest_types[m]) == null ? void 0 : _.type
59
+ type: (m = a.data.guest_types[u]) == null ? void 0 : m.type
60
60
  };
61
61
  }),
62
62
  numberOfRooms: (s = a.data.rooms) == null ? void 0 : s.length,
@@ -66,16 +66,11 @@ class f {
66
66
  currency: i.currency,
67
67
  before: i.before
68
68
  })
69
- ),
70
- pointsAsCash: a.data.points_as_cash ? {
71
- authCode: a.data.points_as_cash.auth_code,
72
- points: a.data.points_as_cash.points,
73
- pointsValue: a.data.points_as_cash.points_value
74
- } : void 0
69
+ )
75
70
  };
76
71
  });
77
- c(this, "getFlightBooking", async (e) => {
78
- const { data: a } = await r.get(
72
+ r(this, "getFlightBooking", async (e) => {
73
+ const { data: a } = await c.get(
79
74
  `${d.USER_FLIGHT_BOOKINGS}/${e}`
80
75
  );
81
76
  return {
@@ -133,30 +128,30 @@ class f {
133
128
  airlineInitiatedChanges: l(a.data.airline_initiated_changes) || []
134
129
  };
135
130
  });
136
- c(this, "initiateCancelFlightBooking", async (e) => {
137
- const { data: a } = await r.put(
131
+ r(this, "initiateCancelFlightBooking", async (e) => {
132
+ const { data: a } = await c.put(
138
133
  `${d.INITIATE_FLIGHT_CANCEL}/${e}`
139
134
  );
140
135
  return a.success;
141
136
  });
142
- c(this, "confirmCancelFlightBooking", async (e) => {
143
- const { data: a } = await r.put(
137
+ r(this, "confirmCancelFlightBooking", async (e) => {
138
+ const { data: a } = await c.put(
144
139
  `${d.CONFIRM_FLIGHT_CANCEL}/${e}`
145
140
  );
146
141
  return a.success;
147
142
  });
148
- c(this, "cancelHotelBooking", async (e) => {
149
- const { data: a } = await r.post(
143
+ r(this, "cancelHotelBooking", async (e) => {
144
+ const { data: a } = await c.post(
150
145
  `${d.CANCEL_HOTEL_BOOKING}/${e}`
151
146
  );
152
147
  return a.success;
153
148
  });
154
- c(this, "actionAirlineChanges", async ({
149
+ r(this, "actionAirlineChanges", async ({
155
150
  bookingId: e,
156
151
  acceptChanges: a,
157
152
  aicId: o
158
153
  }) => {
159
- const { data: t } = await r.post(
154
+ const { data: t } = await c.post(
160
155
  d.ACTION_AIRLINE_CHANGES,
161
156
  {
162
157
  booking_id: e,
@@ -2,7 +2,7 @@ import '../../assets/_styles4.css';import '../../assets/_styles3.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-Cj9L15P-.js";
5
+ import { A as C, E, c as s } from "../../AccountService-Cu1fDg5B.js";
6
6
  import "react";
7
7
  import { ECurrencyEndpoints as i } from "../../configs/endpoints.js";
8
8
  import "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { c as o, i as t } from "../AccountService-Cj9L15P-.js";
1
+ import { c as o, i as t } from "../AccountService-Cu1fDg5B.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-D66VvSIm.js";
3
3
  import "react";
4
- import { c as p, i as a } from "../AccountService-Cj9L15P-.js";
4
+ import { c as p, i as a } from "../AccountService-Cu1fDg5B.js";
5
5
  import "../configs/baseUrl.js";
6
6
  export {
7
7
  p as clientInstance,
@@ -1,8 +1,8 @@
1
+ import { l, j as m, k as g, g as h, h as u, p as d } from "../AccountService-Cu1fDg5B.js";
2
+ import "../configs/baseUrl.js";
1
3
  import "../arrayExtensions-DlcBOj5a.js";
2
4
  import "../keys-D66VvSIm.js";
3
5
  import "react";
4
- import { l, j as m, k as g, g as h, h as u, p as d } from "../AccountService-Cj9L15P-.js";
5
- import "../configs/baseUrl.js";
6
6
  import "../configs/endpoints.js";
7
7
  import "../types/EAuthFlow.js";
8
8
  export {
@@ -1,4 +1,4 @@
1
- import { d as t, g as r, h as n } from "../AccountService-Cj9L15P-.js";
1
+ import { d as t, g as r, h as n } from "../AccountService-Cu1fDg5B.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-Cj9L15P-.js";
5
+ import { c as i } from "../../AccountService-Cu1fDg5B.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 = (a, e, t) => e in a ? s(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
3
  var r = (a, e, t) => n(a, typeof e != "symbol" ? e + "" : e, t);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { c as o, a as c } from "../../AccountService-Cj9L15P-.js";
5
+ import { c as o, a as c } from "../../AccountService-Cu1fDg5B.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 "../../AccountService-Cj9L15P-.js";
3
- import { T } from "../../TripsService-DDN_-m62.js";
2
+ import "../../AccountService-Cu1fDg5B.js";
3
+ import { T } from "../../TripsService-D-0263l6.js";
4
4
  import "react";
5
5
  import "../../configs/endpoints.js";
6
6
  import "./TripService.types.js";
@@ -1,25 +1,25 @@
1
- var o = Object.defineProperty;
2
- var i = (d, a, t) => a in d ? o(d, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[a] = t;
3
- var r = (d, a, t) => i(d, typeof a != "symbol" ? a + "" : a, t);
1
+ var i = Object.defineProperty;
2
+ var u = (d, a, t) => a in d ? i(d, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[a] = t;
3
+ var r = (d, a, t) => u(d, typeof a != "symbol" ? a + "" : a, t);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { c as s, a as c } from "../../AccountService-Cj9L15P-.js";
5
+ import { c as e, a as c } from "../../AccountService-Cu1fDg5B.js";
6
6
  import "react";
7
- import { EWalletEndpoints as e } from "../../configs/endpoints.js";
8
- class A {
7
+ import { EWalletEndpoints as s } from "../../configs/endpoints.js";
8
+ class w {
9
9
  constructor() {
10
10
  r(this, "getAwards", async () => {
11
11
  const {
12
12
  data: { data: a }
13
- } = await s.get(
14
- e.USER_AWARDS
13
+ } = await e.get(
14
+ s.USER_AWARDS
15
15
  );
16
16
  return c(a);
17
17
  });
18
18
  r(this, "getUserAwards", async (a, t) => {
19
19
  const {
20
20
  data: { data: n }
21
- } = await s.get(
22
- e.USER_AWARDS,
21
+ } = await e.get(
22
+ s.USER_AWARDS,
23
23
  {
24
24
  params: {
25
25
  user_id: a,
@@ -32,8 +32,8 @@ class A {
32
32
  r(this, "getLinkedUserAwards", async (a, t) => {
33
33
  const {
34
34
  data: { data: n }
35
- } = await s.get(
36
- e.LINKED_USER_AWARDS,
35
+ } = await e.get(
36
+ s.LINKED_USER_AWARDS,
37
37
  {
38
38
  params: {
39
39
  user_id: a,
@@ -44,14 +44,14 @@ class A {
44
44
  return c(n);
45
45
  });
46
46
  r(this, "addAwardProgram", async (a, t = 0) => {
47
- const { data: n } = await s.post(e.USER_AWARDS, {
47
+ const { data: n } = await e.post(s.USER_AWARDS, {
48
48
  main_program: a,
49
49
  amount: t
50
50
  });
51
51
  return n;
52
52
  });
53
53
  r(this, "removeAwardProgram", async (a) => {
54
- const { data: t } = await s.delete(e.USER_AWARDS, {
54
+ const { data: t } = await e.delete(s.USER_AWARDS, {
55
55
  data: {
56
56
  name: a
57
57
  }
@@ -59,33 +59,42 @@ class A {
59
59
  return t;
60
60
  });
61
61
  r(this, "setAwardPoints", async (a, t) => {
62
- const { data: n } = await s.put(e.USER_AWARDS, {
63
- main_program: a,
64
- amount: t
65
- });
66
- return n;
62
+ var n;
63
+ try {
64
+ const { data: o } = await e.put(s.USER_AWARDS, {
65
+ main_program: a,
66
+ amount: t
67
+ });
68
+ return o;
69
+ } catch (o) {
70
+ throw console.error("Error updating award points:", o), o.response ? new Error(
71
+ `Failed to update award points: ${((n = o.response.data) == null ? void 0 : n.message) || o.response.statusText}`
72
+ ) : o.request ? new Error(
73
+ "No response from server. Please check your connection."
74
+ ) : new Error(`Unexpected error: ${o.message}`);
75
+ }
67
76
  });
68
77
  r(this, "getBanks", async () => {
69
- const { data: a } = await s.get(
70
- e.BANKS
78
+ const { data: a } = await e.get(
79
+ s.BANKS
71
80
  );
72
81
  return a.success ? a.data.map((t) => c(t)) : [];
73
82
  });
74
83
  r(this, "getCards", async () => {
75
- const { data: a } = await s.get(
76
- e.CARDS
84
+ const { data: a } = await e.get(
85
+ s.CARDS
77
86
  );
78
87
  return a.success ? a.data.map((t) => c(t)) : [];
79
88
  });
80
89
  r(this, "getUserCards", async () => {
81
- const { data: a } = await s.get(
82
- e.USER_CARDS
90
+ const { data: a } = await e.get(
91
+ s.USER_CARDS
83
92
  );
84
93
  return a.success ? a.data.map((t) => c(t)) : [];
85
94
  });
86
95
  r(this, "addCardsToWallet", async (a) => {
87
- const { data: t } = await s.post(
88
- e.ADD_USER_CARDS,
96
+ const { data: t } = await e.post(
97
+ s.ADD_USER_CARDS,
89
98
  {
90
99
  card_ids: a
91
100
  }
@@ -93,8 +102,8 @@ class A {
93
102
  return t;
94
103
  });
95
104
  r(this, "removeCardsFromWallet", async (a) => {
96
- const { data: t } = await s.post(
97
- e.REMOVE_USER_CARDS,
105
+ const { data: t } = await e.post(
106
+ s.REMOVE_USER_CARDS,
98
107
  {
99
108
  card_ids: a
100
109
  }
@@ -102,12 +111,12 @@ class A {
102
111
  return t;
103
112
  });
104
113
  r(this, "getPointsAsCash", async () => {
105
- const { data: a } = await s.get(e.POINTS_AS_CASH);
114
+ const { data: a } = await e.get(s.POINTS_AS_CASH);
106
115
  return a.success ? c(a.data) : { availablePoints: 0, valuePerPoint: 0, currency: "" };
107
116
  });
108
117
  }
109
118
  }
110
- const l = new A();
119
+ const g = new w();
111
120
  export {
112
- l as WalletService
121
+ g as WalletService
113
122
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odynn/awayz-core",
3
- "version": "0.6.21",
3
+ "version": "0.6.22",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"