@odynn/awayz-core 0.5.13 → 0.6.0

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 (30) hide show
  1. package/dist/{AccountService-BXmufsEA.js → AccountService-CoynF2Xc.js} +2 -2
  2. package/dist/{TripsService-DmFzLQDt.js → TripsService-41qvbwrn.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 +3 -3
  13. package/dist/hooks/useWallet/useWallet.test.js +1 -1
  14. package/dist/lib/services/rewards/RewardsService.d.ts +2 -1
  15. package/dist/lib/services/rewards/RewardsService.types.d.ts +7 -0
  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 +1 -1
  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 +1 -1
  24. package/dist/services/noRetryInstance.js +1 -1
  25. package/dist/services/preferences/PreferencesService.js +1 -1
  26. package/dist/services/rewards/RewardsService.js +13 -11
  27. package/dist/services/rewards/RewardsService.types.js +1 -0
  28. package/dist/services/trips/TripsService.js +2 -2
  29. package/dist/services/wallet/WalletService.js +1 -1
  30. package/package.json +1 -1
@@ -2030,8 +2030,8 @@ const Be = new nr();
2030
2030
  export {
2031
2031
  Be as A,
2032
2032
  $ as E,
2033
- mt as a,
2034
- F as b,
2033
+ F as a,
2034
+ mt as b,
2035
2035
  C as c,
2036
2036
  w as d,
2037
2037
  Vn as e,
@@ -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-BXmufsEA.js";
4
+ import { c as n, f as p, a as o, r as T } from "./AccountService-CoynF2Xc.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 ot, c as A, b as q, d as ve, e as st, f as it, g as G, o a
5
5
  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
- import { E as wt } from "../../AccountService-BXmufsEA.js";
8
+ import { E as wt } from "../../AccountService-CoynF2Xc.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-BXmufsEA.js";
8
+ import "../../AccountService-CoynF2Xc.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-BXmufsEA.js";
8
+ import "../../../AccountService-CoynF2Xc.js";
9
9
  import "../../../configs/awayzClient.js";
10
10
  import { EAuthFlow as e } from "../../../types/EAuthFlow.js";
11
11
  import "../../../services/noRetryInstance.js";
@@ -1,5 +1,5 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
- import { e as v, A as o, E as K } from "../../AccountService-BXmufsEA.js";
2
+ import { e as v, A as o, E as K } from "../../AccountService-CoynF2Xc.js";
3
3
  import { E as n } from "../../keys-DcSEucOc.js";
4
4
  import { useState as d, useCallback as O, useEffect as S } from "react";
5
5
  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-BXmufsEA.js";
3
+ import { E as o } from "../../AccountService-CoynF2Xc.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  import "../../context/AwayzContext.js";
@@ -1,5 +1,5 @@
1
1
  import { EBookingEndpoints as i } from "../../configs/endpoints.js";
2
- import { c } from "../../AccountService-BXmufsEA.js";
2
+ import { c } from "../../AccountService-CoynF2Xc.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-BXmufsEA.js";
3
+ import { E as m, A as c, a as f } from "../AccountService-CoynF2Xc.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-BXmufsEA.js";
3
+ import { E as e } from "../../AccountService-CoynF2Xc.js";
4
4
  import "react";
5
- import { T as t } from "../../TripsService-DmFzLQDt.js";
5
+ import { T as t } from "../../TripsService-41qvbwrn.js";
6
6
  import "react/jsx-runtime";
7
7
  import "../../context/AwayzContext.js";
8
8
  import { awayzClient as o } from "../../configs/awayzClient.js";
@@ -1,12 +1,12 @@
1
1
  import { h as p } from "../../arrayExtensions-DlcBOj5a.js";
2
- import { D as f } from "../../TripsService-DmFzLQDt.js";
2
+ import { D as f } from "../../TripsService-41qvbwrn.js";
3
3
  import "react";
4
4
  import { renderHook as o, waitFor as i } from "../../tests/TestWrapper.js";
5
5
  import { EMyTripsEndpoints as d } from "../../configs/endpoints.js";
6
6
  import "react/jsx-runtime";
7
7
  import "../../context/AwayzContext.js";
8
8
  import "../../configs/awayzClient.js";
9
- import { c } from "../../AccountService-BXmufsEA.js";
9
+ import { c } from "../../AccountService-CoynF2Xc.js";
10
10
  import "@tanstack/react-query";
11
11
  import { useTripManagement as n } from "./useTripManagement.js";
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-BXmufsEA.js";
3
+ import { E as t, b as u } from "../../AccountService-CoynF2Xc.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  import "../../context/AwayzContext.js";
@@ -14,7 +14,7 @@ import "react-i18next";
14
14
  /* empty css */
15
15
  /* empty css */
16
16
  import { WalletService as o } from "../../services/wallet/WalletService.js";
17
- const b = () => {
17
+ const I = () => {
18
18
  const { user: r } = w(), { data: e } = n({
19
19
  queryKey: [t.PROGRAMS],
20
20
  queryFn: o.getAwards,
@@ -123,5 +123,5 @@ const b = () => {
123
123
  };
124
124
  };
125
125
  export {
126
- b as useWallet
126
+ I as useWallet
127
127
  };
@@ -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-BXmufsEA.js";
7
+ import { c as l } from "../../AccountService-CoynF2Xc.js";
8
8
  import "@tanstack/react-query";
9
9
  import { useWallet as t } from "./useWallet.js";
10
10
  import "../../services/noRetryInstance.js";
@@ -1,3 +1,4 @@
1
+ import { ICentPerPoint } from './RewardsService.types';
1
2
  declare class _RewardsService {
2
3
  /**
3
4
  * Fetches the cents-per-point value for a given rewards program.
@@ -21,7 +22,7 @@ declare class _RewardsService {
21
22
  * },
22
23
  * }
23
24
  */
24
- getPointsPerCent: (name: string) => Promise<any>;
25
+ getCentPerPoint: (name: string) => Promise<ICentPerPoint>;
25
26
  }
26
27
  export declare const RewardsService: _RewardsService;
27
28
  export {};
@@ -0,0 +1,7 @@
1
+ export interface ICentPerPoint {
2
+ id: string;
3
+ name: string;
4
+ region: string;
5
+ currency: string;
6
+ valueCents: number;
7
+ }
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-BXmufsEA.js";
9
+ import { c as w, i as A } from "./AccountService-CoynF2Xc.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-BXmufsEA.js";
9
+ import "../AccountService-CoynF2Xc.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-BXmufsEA.js";
2
+ import { A as e } from "../../AccountService-CoynF2Xc.js";
3
3
  import "../../keys-DcSEucOc.js";
4
4
  import "react";
5
5
  import "../../configs/endpoints.js";
@@ -2,7 +2,7 @@ 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
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-BXmufsEA.js";
5
+ import { c, a as l } from "../../AccountService-CoynF2Xc.js";
6
6
  import "react";
7
7
  import { EBookingEndpoints as d } from "../../configs/endpoints.js";
8
8
  const p = (n) => {
@@ -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-BXmufsEA.js";
5
+ import { A as C, E, c as s } from "../../AccountService-CoynF2Xc.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-BXmufsEA.js";
1
+ import { c as o, i as t } from "../AccountService-CoynF2Xc.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-BXmufsEA.js";
4
+ import { c as p, i as a } from "../AccountService-CoynF2Xc.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-BXmufsEA.js";
1
+ import { l, j as m, k as g, g as h, h as u, p as d } from "../AccountService-CoynF2Xc.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-BXmufsEA.js";
1
+ import { d as t, g as r, h as n } from "../AccountService-CoynF2Xc.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-BXmufsEA.js";
5
+ import { c as i } from "../../AccountService-CoynF2Xc.js";
6
6
  class E {
7
7
  constructor() {
8
8
  n(this, "setCurrency", async (e) => {
@@ -1,9 +1,11 @@
1
1
  var s = Object.defineProperty;
2
- var n = (t, e, a) => e in t ? s(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
3
- var r = (t, e, a) => n(t, typeof e != "symbol" ? e + "" : e, a);
4
- import { ERewardsEndpoints as c } from "../../configs/endpoints.js";
5
- import { c as o } from "../../AccountService-BXmufsEA.js";
6
- class i {
2
+ var n = (a, e, t) => e in a ? s(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
+ var r = (a, e, t) => n(a, typeof e != "symbol" ? e + "" : e, t);
4
+ import "../../arrayExtensions-DlcBOj5a.js";
5
+ import { c as o, a as c } from "../../AccountService-CoynF2Xc.js";
6
+ import "react";
7
+ import { ERewardsEndpoints as i } from "../../configs/endpoints.js";
8
+ class m {
7
9
  constructor() {
8
10
  /**
9
11
  * Fetches the cents-per-point value for a given rewards program.
@@ -27,20 +29,20 @@ class i {
27
29
  * },
28
30
  * }
29
31
  */
30
- r(this, "getPointsPerCent", async (e) => {
31
- const { data: a } = await o.get(
32
- c.POINTS_PER_CENT,
32
+ r(this, "getCentPerPoint", async (e) => {
33
+ const { data: t } = await o.get(
34
+ i.POINTS_PER_CENT,
33
35
  {
34
36
  params: {
35
37
  name: e
36
38
  }
37
39
  }
38
40
  );
39
- return a.data.value_cents || 0;
41
+ return c(t.data);
40
42
  });
41
43
  }
42
44
  }
43
- const w = new i();
45
+ const P = new m();
44
46
  export {
45
- w as RewardsService
47
+ P as RewardsService
46
48
  };
@@ -1,8 +1,8 @@
1
- import "../../AccountService-BXmufsEA.js";
1
+ import "../../AccountService-CoynF2Xc.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-DmFzLQDt.js";
5
+ import { T as s } from "../../TripsService-41qvbwrn.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-BXmufsEA.js";
5
+ import { c as s, a as c } from "../../AccountService-CoynF2Xc.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.13",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"