@odynn/awayz-core 0.6.45 → 0.6.48

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 (45) hide show
  1. package/dist/Combination-Bx3lWLOq.js +2291 -0
  2. package/dist/{TripsService-CUPnO2tz.js → TripsService-DywrB9bi.js} +1 -1
  3. package/dist/{_styles.flight-booking-BhlwjkAV.js → _styles.flight-booking-DEUJthTJ.js} +1 -1
  4. package/dist/assets/_styles4.css +1 -1
  5. package/dist/assets/_styles5.css +1 -0
  6. package/dist/assets/noRetryInstance.css +1 -1
  7. package/dist/{cashUtils-BDa0CVyi.js → cashUtils-sBirmFfL.js} +4 -4
  8. package/dist/components/Bookings/FlightBooking/FlightBooking.js +2 -2
  9. package/dist/components/Bookings/HotelBooking/HotelBooking.js +7 -7
  10. package/dist/components/CashValue/CashValue.js +77 -841
  11. package/dist/components/CashValue/CashValue.stories.js +2 -2
  12. package/dist/components/Menu/Menu.js +812 -1529
  13. package/dist/components/Tooltip/Tooltip.js +1502 -0
  14. package/dist/components/Wallet/Card/Card.js +3 -3
  15. package/dist/components/Wallet/Card/Card.stories.js +10 -9
  16. package/dist/hooks/useAwayzAuth/useAwayzAuth.js +79 -77
  17. package/dist/hooks/useBookingManagement/useBookingManagement.js +12 -11
  18. package/dist/hooks/useBookingManagement/useBookingManagement.test.js +4 -3
  19. package/dist/hooks/useFeatureFlags.js +1 -1
  20. package/dist/hooks/useSearchLimit.js +1 -1
  21. package/dist/hooks/useTripManagement/useTripManagement.js +7 -6
  22. package/dist/hooks/useTripManagement/useTripManagement.test.js +5 -4
  23. package/dist/hooks/useWallet/useWallet.js +6 -5
  24. package/dist/hooks/useWallet/useWallet.test.js +4 -3
  25. package/dist/{index-c5toY3Pm.js → index-Bt2pq2GP.js} +4 -4
  26. package/dist/lib/components/Tooltip/Tooltip.d.ts +8 -0
  27. package/dist/lib/services/account/AccountService.d.ts +2 -1
  28. package/dist/lib/services/bookings/BookingService.types.d.ts +1 -0
  29. package/dist/main.js +1 -1
  30. package/dist/{noRetryInstance-BMCc2uw4.js → noRetryInstance-Y6wcm2ZM.js} +32 -29
  31. package/dist/providers/AwayzProvider.js +8 -7
  32. package/dist/services/account/AccountService.js +2 -2
  33. package/dist/services/bookings/BookingService.js +3 -2
  34. package/dist/services/currency/CurrencyService.js +6 -5
  35. package/dist/services/features/featureService.js +1 -1
  36. package/dist/services/index.js +1 -1
  37. package/dist/services/instance.js +2 -2
  38. package/dist/services/instanceConfig.js +11 -10
  39. package/dist/services/noRetryInstance.js +1 -1
  40. package/dist/services/preferences/PreferencesService.js +1 -1
  41. package/dist/services/rewards/RewardsService.js +1 -1
  42. package/dist/services/trips/TripsService.js +2 -2
  43. package/dist/services/wallet/WalletService.js +1 -1
  44. package/package.json +2 -1
  45. package/dist/index-BC-KTkxU.js +0 -1571
@@ -1,8 +1,8 @@
1
- import './assets/_styles3.css';import './assets/_styles2.css';import './assets/_styles.css';import './assets/noRetryInstance.css';var pt = Object.defineProperty;
1
+ import './assets/_styles3.css';import './assets/_styles2.css';import './assets/_styles.css';import './assets/_styles4.css';import './assets/noRetryInstance.css';var pt = Object.defineProperty;
2
2
  var ht = (e, t, n) => t in e ? pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var U = (e, t, n) => ht(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import "./arrayExtensions-DlcBOj5a.js";
5
- import { a as I } from "./_styles.flight-booking-BhlwjkAV.js";
5
+ import { a as I } from "./_styles.flight-booking-DEUJthTJ.js";
6
6
  import "react";
7
7
  import { getBaseUrl as He } from "./configs/baseUrl.js";
8
8
  import { EAuthEndpoints as b } from "./configs/endpoints.js";
@@ -10,6 +10,7 @@ import { getGatewayBaseUrl as mt } from "./configs/gatewayBaseUrl.js";
10
10
  import "@tanstack/react-query";
11
11
  import "react/jsx-runtime";
12
12
  import { awayzClient as $ } from "./configs/awayzClient.js";
13
+ /* empty css */
13
14
  /* empty css */
14
15
  import "react-i18next";
15
16
  /* empty css */
@@ -1712,22 +1713,22 @@ g.getAdapter = at.getAdapter;
1712
1713
  g.HttpStatusCode = Ee;
1713
1714
  g.default = g;
1714
1715
  const {
1715
- Axios: Ir,
1716
+ Axios: Ur,
1716
1717
  AxiosError: Zn,
1717
- CanceledError: Ur,
1718
- isCancel: xr,
1719
- CancelToken: Lr,
1720
- VERSION: kr,
1721
- all: Pr,
1722
- Cancel: Fr,
1723
- isAxiosError: Dr,
1724
- spread: Br,
1725
- toFormData: qr,
1726
- AxiosHeaders: Hr,
1718
+ CanceledError: xr,
1719
+ isCancel: Lr,
1720
+ CancelToken: kr,
1721
+ VERSION: Pr,
1722
+ all: Fr,
1723
+ Cancel: Dr,
1724
+ isAxiosError: Br,
1725
+ spread: qr,
1726
+ toFormData: Hr,
1727
+ AxiosHeaders: Mr,
1727
1728
  HttpStatusCode: D,
1728
- formToJSON: Mr,
1729
- getAdapter: jr,
1730
- mergeConfig: zr
1729
+ formToJSON: jr,
1730
+ getAdapter: zr,
1731
+ mergeConfig: Gr
1731
1732
  } = g, ft = (e) => (e.baseURL = He(), e.headers.Authorization = localStorage.getItem(I.TOKEN), e.headers["client-id"] = localStorage.getItem(I.CLIENT_ID), e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e }), Qn = (e) => (e.baseURL = mt(), e.headers.Authorization = localStorage.getItem(I.TOKEN), e.headers["client-id"] = localStorage.getItem(I.CLIENT_ID), e.headers["Api-Version"] = "1.0", e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e }), De = (e, t, n) => {
1732
1733
  for (const r of e)
1733
1734
  t ? r.rej(t) : r.res(n);
@@ -1933,37 +1934,39 @@ class ar {
1933
1934
  * Authenticates a user using an ID token.
1934
1935
  *
1935
1936
  * @param idToken - The ID token to authenticate with.
1937
+ * @param refreshToken - The refresh token for user
1936
1938
  * @returns A promise that resolves to a service response containing authentication data.
1937
1939
  */
1938
- U(this, "authenticateWithToken", async (t, n) => {
1939
- var r, s, o;
1940
+ U(this, "authenticateWithToken", async (t, n, r) => {
1941
+ var s, o, i;
1940
1942
  try {
1941
- const { data: i } = await C.post(
1943
+ const { data: c } = await C.post(
1942
1944
  b.EXCHANGE_TOKEN,
1943
1945
  St({
1944
1946
  idToken: t,
1945
- exchangeTokenEndPoint: n
1947
+ refreshToken: n,
1948
+ exchangeTokenEndPoint: r
1946
1949
  })
1947
- ), c = await $.ensureQueryData({
1950
+ ), f = await $.ensureQueryData({
1948
1951
  queryKey: [j.USER_REGIONS],
1949
1952
  queryFn: this.getRegions
1950
- }), f = P(i.data);
1953
+ }), u = P(c.data);
1951
1954
  return {
1952
1955
  success: !0,
1953
1956
  data: {
1954
- ...f,
1957
+ ...u,
1955
1958
  user: {
1956
- ...f.user,
1957
- userRegion: c.find(
1958
- (u) => u.code === i.data.user.user_region
1959
+ ...u.user,
1960
+ userRegion: f.find(
1961
+ (l) => l.code === c.data.user.user_region
1959
1962
  )
1960
1963
  }
1961
1964
  }
1962
1965
  };
1963
- } catch (i) {
1964
- return console.error(i), {
1966
+ } catch (c) {
1967
+ return console.error(c), {
1965
1968
  success: !1,
1966
- message: ((s = (r = i.response) == null ? void 0 : r.data) == null ? void 0 : s.message) || ((o = i == null ? void 0 : i.response) == null ? void 0 : o.data) || i.message || "error exchanging token"
1969
+ message: ((o = (s = c.response) == null ? void 0 : s.data) == null ? void 0 : o.message) || ((i = c == null ? void 0 : c.response) == null ? void 0 : i.data) || c.message || "error exchanging token"
1967
1970
  };
1968
1971
  }
1969
1972
  });
@@ -1,21 +1,22 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { QueryClientProvider as m } from "@tanstack/react-query";
3
3
  import "../arrayExtensions-DlcBOj5a.js";
4
- import { a as r } from "../_styles.flight-booking-BhlwjkAV.js";
4
+ import { a as r } from "../_styles.flight-booking-DEUJthTJ.js";
5
5
  import { useEffect as u } from "react";
6
- import { setCustomBaseUrl as d, setBaseUrl as i } from "../configs/baseUrl.js";
6
+ import { setCustomBaseUrl as i, setBaseUrl as d } from "../configs/baseUrl.js";
7
7
  import { defaultAwayzConfig as p } from "../configs/defaultAwayzConfig.js";
8
8
  import { setGatewayBaseUrl as h } from "../configs/gatewayBaseUrl.js";
9
9
  import { AwayzContext as w } from "../context/AwayzContext.js";
10
10
  import { useAwayzAuth as y } from "../hooks/useAwayzAuth/useAwayzAuth.js";
11
11
  import A from "../hooks/useFeatureFlags.js";
12
12
  import { awayzClient as F } from "../configs/awayzClient.js";
13
- import "../noRetryInstance-BMCc2uw4.js";
14
- import '../assets/_styles3.css';import '../assets/_styles2.css';import '../assets/_styles.css';/* empty css */
13
+ import "../noRetryInstance-Y6wcm2ZM.js";
14
+ import '../assets/_styles3.css';import '../assets/_styles2.css';import '../assets/_styles.css';import '../assets/_styles4.css';/* empty css */
15
+ /* empty css */
15
16
  import "react-i18next";
16
17
  /* empty css */
17
18
  /* empty css */
18
- const x = ({ children: o, config: e }) => {
19
+ const K = ({ children: o, config: e }) => {
19
20
  const a = y({
20
21
  authFlow: e.authFlow,
21
22
  onSuccess: e.onAuthSuccess,
@@ -28,7 +29,7 @@ const x = ({ children: o, config: e }) => {
28
29
  console.error("You need to provide a client ID to the AwayzProvider");
29
30
  return;
30
31
  }
31
- localStorage.setItem(r.CLIENT_ID, e.clientId), localStorage.setItem(r.AUTH_FLOW, e.authFlow), e.debugRefreshToken && e.testMode && (localStorage.setItem(r.REFRESH_TOKEN, e.debugRefreshToken), localStorage.setItem(r.TOKEN, e.debugRefreshToken)), e.overrideBaseUrl ? d(e.overrideBaseUrl) : i(e.testMode ?? !1), h(e.gatewayBaseUrl);
32
+ localStorage.setItem(r.CLIENT_ID, e.clientId), localStorage.setItem(r.AUTH_FLOW, e.authFlow), e.debugRefreshToken && e.testMode && (localStorage.setItem(r.REFRESH_TOKEN, e.debugRefreshToken), localStorage.setItem(r.TOKEN, e.debugRefreshToken)), e.overrideBaseUrl ? i(e.overrideBaseUrl) : d(e.testMode ?? !1), h(e.gatewayBaseUrl);
32
33
  }, [e]), /* @__PURE__ */ t(m, { client: F, children: /* @__PURE__ */ t(
33
34
  w.Provider,
34
35
  {
@@ -46,5 +47,5 @@ const x = ({ children: o, config: e }) => {
46
47
  ) });
47
48
  };
48
49
  export {
49
- x as AwayzProvider
50
+ K as AwayzProvider
50
51
  };
@@ -1,6 +1,6 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
- import { A as e } from "../../noRetryInstance-BMCc2uw4.js";
3
- import "../../_styles.flight-booking-BhlwjkAV.js";
2
+ import { A as e } from "../../noRetryInstance-Y6wcm2ZM.js";
3
+ import "../../_styles.flight-booking-DEUJthTJ.js";
4
4
  import "react";
5
5
  import "../../configs/awayzClient.js";
6
6
  import "../../configs/endpoints.js";
@@ -2,7 +2,7 @@ var p = Object.defineProperty;
2
2
  var g = (i, t, a) => t in i ? p(i, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : i[t] = a;
3
3
  var c = (i, t, a) => g(i, typeof t != "symbol" ? t + "" : t, a);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { c as r, b as l, g as h } from "../../noRetryInstance-BMCc2uw4.js";
5
+ import { c as r, b as l, g as h } from "../../noRetryInstance-Y6wcm2ZM.js";
6
6
  import "react";
7
7
  import { EBookingEndpoints as d } from "../../configs/endpoints.js";
8
8
  const f = (i) => {
@@ -88,7 +88,8 @@ class y {
88
88
  totalAmount: parseFloat(n.total_amount),
89
89
  name: n.name
90
90
  };
91
- })
91
+ }),
92
+ createdAt: a.data.created_at
92
93
  };
93
94
  });
94
95
  c(this, "getFlightBooking", async (t) => {
@@ -1,16 +1,17 @@
1
- import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';var p = Object.defineProperty;
1
+ import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles4.css';var p = Object.defineProperty;
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-BMCc2uw4.js";
5
+ import { A as C, E, c as s } from "../../noRetryInstance-Y6wcm2ZM.js";
6
6
  import "react";
7
7
  import { ECurrencyEndpoints as i } from "../../configs/endpoints.js";
8
8
  import "react/jsx-runtime";
9
9
  import "@tanstack/react-query";
10
+ /* empty css */
10
11
  /* empty css */
11
12
  import "react-i18next";
12
13
  /* empty css */
13
- import "../../_styles.flight-booking-BhlwjkAV.js";
14
+ import "../../_styles.flight-booking-DEUJthTJ.js";
14
15
  /* empty css */
15
16
  import { awayzClient as _ } from "../../configs/awayzClient.js";
16
17
  import "../../context/AwayzContext.js";
@@ -66,7 +67,7 @@ class d {
66
67
  });
67
68
  }
68
69
  }
69
- const q = new d();
70
+ const A = new d();
70
71
  export {
71
- q as CurrencyService
72
+ A as CurrencyService
72
73
  };
@@ -1,5 +1,5 @@
1
1
  import { EAuthEndpoints as a } from "../../configs/endpoints.js";
2
- import { c as o } from "../../noRetryInstance-BMCc2uw4.js";
2
+ import { c as o } from "../../noRetryInstance-Y6wcm2ZM.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-BMCc2uw4.js";
2
+ import { c as t, a as o, g as c, i as s } from "../noRetryInstance-Y6wcm2ZM.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
- import "../_styles.flight-booking-BhlwjkAV.js";
2
+ import "../_styles.flight-booking-DEUJthTJ.js";
3
3
  import "react";
4
- import { c as r, g as s, i as c } from "../noRetryInstance-BMCc2uw4.js";
4
+ import { c as r, g as s, i as c } from "../noRetryInstance-Y6wcm2ZM.js";
5
5
  import "../configs/baseUrl.js";
6
6
  export {
7
7
  r as clientInstance,
@@ -1,13 +1,14 @@
1
1
  import "../arrayExtensions-DlcBOj5a.js";
2
- import "../_styles.flight-booking-BhlwjkAV.js";
2
+ import "../_styles.flight-booking-DEUJthTJ.js";
3
3
  import "react";
4
- import { m as y, k as C, l as c, h as F, j, n as k, p as q } from "../noRetryInstance-BMCc2uw4.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-Y6wcm2ZM.js";
5
5
  import "../configs/baseUrl.js";
6
6
  import "../configs/endpoints.js";
7
7
  import "../configs/gatewayBaseUrl.js";
8
8
  import "@tanstack/react-query";
9
9
  import "react/jsx-runtime";
10
- import '../assets/_styles3.css';import '../assets/_styles2.css';import '../assets/_styles.css';/* empty css */
10
+ import '../assets/_styles3.css';import '../assets/_styles2.css';import '../assets/_styles.css';import '../assets/_styles4.css';/* empty css */
11
+ /* empty css */
11
12
  import "react-i18next";
12
13
  /* empty css */
13
14
  /* empty css */
@@ -15,11 +16,11 @@ import "../configs/awayzClient.js";
15
16
  import "../context/AwayzContext.js";
16
17
  import "../types/EAuthFlow.js";
17
18
  export {
18
- y as authFailurePostMessage,
19
- C as delay,
20
- c as executeWithDelay,
21
- F as getClientConfig,
22
- j as getGatewayConfig,
23
- k as handleAxiosError,
24
- q as processFailedRequests
19
+ C as authFailurePostMessage,
20
+ c as delay,
21
+ F as executeWithDelay,
22
+ j as getClientConfig,
23
+ k as getGatewayConfig,
24
+ q as handleAxiosError,
25
+ w as processFailedRequests
25
26
  };
@@ -1,4 +1,4 @@
1
- import { a } from "../noRetryInstance-BMCc2uw4.js";
1
+ import { a } from "../noRetryInstance-Y6wcm2ZM.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-BMCc2uw4.js";
5
+ import { c as i } from "../../noRetryInstance-Y6wcm2ZM.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-BMCc2uw4.js";
5
+ import { c as o, b as c } from "../../noRetryInstance-Y6wcm2ZM.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-BMCc2uw4.js";
3
- import { T } from "../../TripsService-CUPnO2tz.js";
2
+ import "../../noRetryInstance-Y6wcm2ZM.js";
3
+ import { T } from "../../TripsService-DywrB9bi.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-BMCc2uw4.js";
5
+ import { c as e, b as c, g as A } from "../../noRetryInstance-Y6wcm2ZM.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.6.45",
3
+ "version": "0.6.48",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -42,6 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@radix-ui/react-menubar": "^1.1.15",
45
+ "@radix-ui/react-popover": "^1.1.15",
45
46
  "@radix-ui/react-tooltip": "^1.1.8",
46
47
  "vite-plugin-lib-inject-css": "^2.2.1"
47
48
  }