@odynn/awayz-core 0.9.33 → 0.9.34

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 (39) hide show
  1. package/dist/{TripsService-CJxjOcrR.js → TripsService-k5PnDpcP.js} +1 -1
  2. package/dist/{cashUtils-DB_r0g-F.js → cashUtils-DnCt66eB.js} +8 -9
  3. package/dist/components/CashValue/CashValue.js +2 -2
  4. package/dist/components/CashValue/CashValue.stories.js +1 -1
  5. package/dist/components/ClientPointsValue/ClientPointsValue.js +1 -1
  6. package/dist/components/Wallet/Card/Card.stories.js +1 -1
  7. package/dist/configs/endpoints.js +1 -1
  8. package/dist/hooks/useAwayzAuth/useAwayzAuth.js +2 -2
  9. package/dist/hooks/useBookingManagement/useBookingManagement.js +1 -1
  10. package/dist/hooks/useBookingManagement/useBookingManagement.test.js +1 -1
  11. package/dist/hooks/useFeatureFlags.js +1 -1
  12. package/dist/hooks/useSearchLimit.js +1 -1
  13. package/dist/hooks/useTripManagement/useTripManagement.js +2 -2
  14. package/dist/hooks/useTripManagement/useTripManagement.test.js +2 -2
  15. package/dist/hooks/useWallet/useWallet.js +1 -1
  16. package/dist/hooks/useWallet/useWallet.test.js +1 -1
  17. package/dist/lib/configs/endpoints.d.ts +2 -1
  18. package/dist/lib/services/account/AccountService.d.ts +2 -1
  19. package/dist/lib/services/account/AccountServices.types.d.ts +22 -0
  20. package/dist/main.js +1 -1
  21. package/dist/{noRetryInstance-DKhe8ju0.js → noRetryInstance-Bit3xLkY.js} +121 -117
  22. package/dist/providers/AwayzProvider.js +1 -1
  23. package/dist/services/account/AccountService.js +1 -1
  24. package/dist/services/bookings/BookingService.js +1 -1
  25. package/dist/services/currency/CurrencyService.js +34 -31
  26. package/dist/services/features/featureService.js +1 -1
  27. package/dist/services/index.js +1 -1
  28. package/dist/services/instance.js +1 -1
  29. package/dist/services/instanceConfig.js +1 -1
  30. package/dist/services/noRetryInstance.js +1 -1
  31. package/dist/services/preferences/PreferencesService.js +1 -1
  32. package/dist/services/rewards/RewardsService.js +1 -1
  33. package/dist/services/trips/TripsService.js +2 -2
  34. package/dist/services/wallet/WalletService.js +1 -1
  35. package/dist/utils/clientPoints.js +1 -1
  36. package/package.json +3 -2
  37. package/dist/index-BlYZu1Ej.js +0 -5
  38. package/dist/lib/components/CashValue/CashValue.stories.d.ts +0 -38
  39. package/dist/lib/components/Wallet/Card/Card.stories.d.ts +0 -14
@@ -2,7 +2,7 @@ var v = Object.defineProperty;
2
2
  var f = (r, e, a) => e in r ? v(r, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : r[e] = a;
3
3
  var n = (r, e, a) => f(r, typeof e != "symbol" ? e + "" : e, a);
4
4
  import "./arrayExtensions-DlcBOj5a.js";
5
- import { c as i, f as u, b as d, r as D } from "./noRetryInstance-DKhe8ju0.js";
5
+ import { c as i, f as u, b as d, r as D } from "./noRetryInstance-Bit3xLkY.js";
6
6
  import "react";
7
7
  import { DEFAULT_LOGO as S } from "./configs/defaultAwayzConfig.js";
8
8
  import { EMyTripsEndpoints as o } from "./configs/endpoints.js";
@@ -1,5 +1,4 @@
1
- import { D as o } from "./index-BlYZu1Ej.js";
2
- const c = (r, t) => {
1
+ const o = "USD", a = (r, t) => {
3
2
  var e = new Intl.NumberFormat("en-US", {
4
3
  style: "currency",
5
4
  currency: t ?? o
@@ -7,28 +6,28 @@ const c = (r, t) => {
7
6
  if (!r) return e.format(0);
8
7
  const n = parseFloat(r.toString());
9
8
  return e.format(n);
10
- }, i = (r, t) => {
9
+ }, m = (r, t) => {
11
10
  var e = new Intl.NumberFormat("en-US", {
12
11
  style: "currency",
13
12
  currency: t ?? o
14
13
  });
15
14
  return e.format(Math.round(r)).toString().split(".")[0];
16
- }, u = (r, t, e = 0) => {
15
+ }, i = (r, t, e = 0) => {
17
16
  const n = parseFloat((r == null ? void 0 : r.toString()) || "0");
18
17
  return new Intl.NumberFormat("en-US", {
19
18
  style: "currency",
20
19
  currency: t ?? o,
21
20
  maximumFractionDigits: e
22
21
  }).format(isNaN(n) ? 0 : n);
23
- }, y = (r, t = "en") => 0 .toLocaleString(t, {
22
+ }, u = (r, t = "en") => 0 .toLocaleString(t, {
24
23
  style: "currency",
25
24
  currency: r,
26
25
  minimumFractionDigits: 0,
27
26
  maximumFractionDigits: 0
28
27
  }).replace(/\d/g, "").trim();
29
28
  export {
30
- i as a,
31
- c as b,
32
- y as c,
33
- u as g
29
+ m as a,
30
+ a as b,
31
+ u as c,
32
+ i as g
34
33
  };
@@ -1,8 +1,8 @@
1
1
  import { jsx as r, jsxs as l } from "react/jsx-runtime";
2
2
  import { useQuery as R } from "@tanstack/react-query";
3
3
  import "../../arrayExtensions-DlcBOj5a.js";
4
- import { g as m, a as _, b as N } from "../../cashUtils-DB_r0g-F.js";
5
- import { E as S } from "../../noRetryInstance-DKhe8ju0.js";
4
+ import { g as m, a as _, b as N } from "../../cashUtils-DnCt66eB.js";
5
+ import { E as S } from "../../noRetryInstance-Bit3xLkY.js";
6
6
  import { useMemo as T } from "react";
7
7
  import { a as f } from "../../index-C8p5kinH.js";
8
8
  import "react-i18next";
@@ -9,7 +9,7 @@ import { CashValue as n } from "./CashValue.js";
9
9
  import { EToolTipPosition as t, EInvalidAmountDisplayOption as o } from "./CashValueTypes.js";
10
10
  import "@tanstack/react-query";
11
11
  import "../../context/AwayzContext.js";
12
- import "../../noRetryInstance-DKhe8ju0.js";
12
+ import "../../noRetryInstance-Bit3xLkY.js";
13
13
  import "../../configs/awayzClient.js";
14
14
  /* empty css */
15
15
  import { AwayzProvider as a } from "../../providers/AwayzProvider.js";
@@ -1,7 +1,7 @@
1
1
  import { jsxs as c } from "react/jsx-runtime";
2
2
  import { useQuery as p } from "@tanstack/react-query";
3
3
  import "../../arrayExtensions-DlcBOj5a.js";
4
- import { E as u } from "../../noRetryInstance-DKhe8ju0.js";
4
+ import { E as u } from "../../noRetryInstance-Bit3xLkY.js";
5
5
  import { useMemo as f } from "react";
6
6
  import { useAwayzContext as l } from "../../hooks/useAwayzContext.js";
7
7
  import "react-i18next";
@@ -7,7 +7,7 @@ import "../../../_styles.flight-booking-CaUgKcMC.js";
7
7
  /* empty css */
8
8
  import "@tanstack/react-query";
9
9
  import "../../../configs/awayzClient.js";
10
- import "../../../noRetryInstance-DKhe8ju0.js";
10
+ import "../../../noRetryInstance-Bit3xLkY.js";
11
11
  /* empty css */
12
12
  /* empty css */
13
13
  import "../../../index-Cv-wvFlM.js";
@@ -1,4 +1,4 @@
1
- var r = /* @__PURE__ */ ((e) => (e.SIGN_IN = "auth/user-login", e.SIGN_UP = "auth/sign-up", e.GOOGLE_AUTH = "/auth/google-user", e.ME = "user", e.RESEND_VERIFICATION_EMAIL = "auth/resend-verification-email", e.UPDATE_USER_DETAILS = "account/update/user", e.CONFIRM_EMAIL = "account/verifyAccount", e.FORGOT_PASSWORD = "email/sendVeri", e.RESEND_OTP = "email/sendForgotPasswordVerification", e.RESET_PASSWORD = "account/updateUserPassword", e.REQUEST_LIMIT = "user/request-limit", e.APPLE_SOCIAL_SIGN_UP = "tp/apple/get/user", e.GOOGLE_SOCIAL_SIGN_UP = "tp/google/get/user", e.UPDATE_USER = "account/details/addUserDetails", e.ACKNOWLEDGEMENT = "account/update/userAcknowledgement", e.REGIONS = "user/region", e.UPDATE_USER_REGION = "/account/update/userRegion", e.UPDATE_PASSENGER_DETAILS = "/account/awayz", e.REFRESH_TOKEN = "auth/refresh-token", e.EXCHANGE_TOKEN = "user/exchange-token", e.REFRESH_EMBED_TOKEN = "user/refresh-token", e.OAUTH_INITIATE = "user/oauth2/initiate", e.OAUTH_CALLBACK = "user/oauth2/callback", e.FEATURES = "/user/features", e))(r || {}), a = /* @__PURE__ */ ((e) => (e.CURRENCY_CONVERSION = "currency/convert", e))(a || {}), _ = /* @__PURE__ */ ((e) => (e.USER_AWARDS = "user/rewards", e.LINKED_USER_AWARDS = "user/rewards/user-linked", e.USER_CARDS = "user/cards", e.ADD_USER_CARDS = "user/cards/add", e.REMOVE_USER_CARDS = "user/cards/remove", e.BANKS = "banks", e.CARDS = "cards", e.POINTS_AS_CASH = "/points-as-cash/available-points", e))(_ || {}), S = /* @__PURE__ */ ((e) => (e.TRIPS = "user/trips", e.ADD_BOOKING = "user/trips/add-booking-to-trip", e.REMOVE_BOOKING = "user/trips/remove-booking-from-trip", e.UNCATEGORISED_BOOKINGS = "/user/trips/get-uncategorized-bookings", e))(S || {}), O = /* @__PURE__ */ ((e) => (e.USER_HOTEL_BOOKINGS = "/user/bookings/hotels", e.USER_FLIGHT_BOOKINGS = "/user/bookings/flights", e.INITIATE_FLIGHT_CANCEL = "/duffel/flights/initiate-order-cancellation", e.CONFIRM_FLIGHT_CANCEL = "/duffel/flights/confirm-order-cancellation", e.CANCEL_HOTEL_BOOKING = "/duffel/hotels/cancel", e.ACTION_AIRLINE_CHANGES = "/user/bookings/flights/action-airline-initiated-changes", e.REFUND_POINTS_BOOKING = "/points-as-cash/refund-booking", e.BOOKING_POINTS_AS_CASH = "/points-as-cash", e))(O || {}), I = /* @__PURE__ */ ((e) => (e.POINTS_PER_CENT = "/user/rewards/points-per-cent", e))(I || {}), N = /* @__PURE__ */ ((e) => (e.USER_PREFERENCES = "/user/user-preferences", e))(N || {});
1
+ var r = /* @__PURE__ */ ((e) => (e.SIGN_IN = "auth/user-login", e.SIGN_UP = "auth/sign-up", e.GOOGLE_AUTH = "/auth/google-user", e.ME = "user", e.RESEND_VERIFICATION_EMAIL = "auth/resend-verification-email", e.UPDATE_USER_DETAILS = "account/update/user", e.CONFIRM_EMAIL = "account/verifyAccount", e.FORGOT_PASSWORD = "email/sendVeri", e.RESEND_OTP = "email/sendForgotPasswordVerification", e.RESET_PASSWORD = "account/updateUserPassword", e.REQUEST_LIMIT = "user/request-limit", e.APPLE_SOCIAL_SIGN_UP = "tp/apple/get/user", e.GOOGLE_SOCIAL_SIGN_UP = "tp/google/get/user", e.UPDATE_USER = "account/details/addUserDetails", e.ACKNOWLEDGEMENT = "account/update/userAcknowledgement", e.REGIONS = "user/region", e.UPDATE_USER_REGION = "/account/update/userRegion", e.UPDATE_PASSENGER_DETAILS = "/account/awayz", e.REFRESH_TOKEN = "auth/refresh-token", e.EXCHANGE_TOKEN = "user/exchange-token", e.REFRESH_EMBED_TOKEN = "user/refresh-token", e.OAUTH_INITIATE = "user/oauth2/initiate", e.OAUTH_CALLBACK = "user/oauth2/callback", e.FEATURES = "/user/features", e.CLIENT = "/clients/embed-data", e))(r || {}), a = /* @__PURE__ */ ((e) => (e.CURRENCY_CONVERSION = "currency/convert", e))(a || {}), _ = /* @__PURE__ */ ((e) => (e.USER_AWARDS = "user/rewards", e.LINKED_USER_AWARDS = "user/rewards/user-linked", e.USER_CARDS = "user/cards", e.ADD_USER_CARDS = "user/cards/add", e.REMOVE_USER_CARDS = "user/cards/remove", e.BANKS = "banks", e.CARDS = "cards", e.POINTS_AS_CASH = "/points-as-cash/available-points", e))(_ || {}), S = /* @__PURE__ */ ((e) => (e.TRIPS = "user/trips", e.ADD_BOOKING = "user/trips/add-booking-to-trip", e.REMOVE_BOOKING = "user/trips/remove-booking-from-trip", e.UNCATEGORISED_BOOKINGS = "/user/trips/get-uncategorized-bookings", e))(S || {}), O = /* @__PURE__ */ ((e) => (e.USER_HOTEL_BOOKINGS = "/user/bookings/hotels", e.USER_FLIGHT_BOOKINGS = "/user/bookings/flights", e.INITIATE_FLIGHT_CANCEL = "/duffel/flights/initiate-order-cancellation", e.CONFIRM_FLIGHT_CANCEL = "/duffel/flights/confirm-order-cancellation", e.CANCEL_HOTEL_BOOKING = "/duffel/hotels/cancel", e.ACTION_AIRLINE_CHANGES = "/user/bookings/flights/action-airline-initiated-changes", e.REFUND_POINTS_BOOKING = "/points-as-cash/refund-booking", e.BOOKING_POINTS_AS_CASH = "/points-as-cash", e))(O || {}), I = /* @__PURE__ */ ((e) => (e.POINTS_PER_CENT = "/user/rewards/points-per-cent", e))(I || {}), N = /* @__PURE__ */ ((e) => (e.USER_PREFERENCES = "/user/user-preferences", e))(N || {});
2
2
  export {
3
3
  r as EAuthEndpoints,
4
4
  O as EBookingEndpoints,
@@ -1,6 +1,6 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
- import { c as M } from "../../cashUtils-DB_r0g-F.js";
3
- import { e as P, A as l, E as N } from "../../noRetryInstance-DKhe8ju0.js";
2
+ import { c as M } from "../../cashUtils-DnCt66eB.js";
3
+ import { e as P, A as l, E as N } from "../../noRetryInstance-Bit3xLkY.js";
4
4
  import { a as o } from "../../_styles.flight-booking-CaUgKcMC.js";
5
5
  import { useState as f, useCallback as I, useEffect as h } from "react";
6
6
  import { awayzClient as O } from "../../configs/awayzClient.js";
@@ -1,6 +1,6 @@
1
1
  import { useQuery as m, useMutation as c } from "@tanstack/react-query";
2
2
  import "../../arrayExtensions-DlcBOj5a.js";
3
- import { E as o } from "../../noRetryInstance-DKhe8ju0.js";
3
+ import { E as o } from "../../noRetryInstance-Bit3xLkY.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  import "react-i18next";
@@ -10,7 +10,7 @@ import "@tanstack/react-query";
10
10
  /* empty css */
11
11
  /* empty css */
12
12
  import "../../index-Cv-wvFlM.js";
13
- import { c } from "../../noRetryInstance-DKhe8ju0.js";
13
+ import { c } from "../../noRetryInstance-Bit3xLkY.js";
14
14
  import "../../context/AwayzContext.js";
15
15
  import { useBookingManagement as t } from "./useBookingManagement.js";
16
16
  import "../../configs/awayzClient.js";
@@ -1,6 +1,6 @@
1
1
  import { useQuery as U } from "@tanstack/react-query";
2
2
  import "../arrayExtensions-DlcBOj5a.js";
3
- import { E as e, t as F } from "../noRetryInstance-DKhe8ju0.js";
3
+ import { E as e, t as F } from "../noRetryInstance-Bit3xLkY.js";
4
4
  import "react";
5
5
  import { FeatureService as N } from "../services/features/featureService.js";
6
6
  const L = [
@@ -1,6 +1,6 @@
1
1
  import { useQuery as u } from "@tanstack/react-query";
2
2
  import "../arrayExtensions-DlcBOj5a.js";
3
- import { E as m, A as c, b as f } from "../noRetryInstance-DKhe8ju0.js";
3
+ import { E as m, A as c, b as f } from "../noRetryInstance-Bit3xLkY.js";
4
4
  import { useEffect as d } from "react";
5
5
  import { useAwayzContext as y } from "./useAwayzContext.js";
6
6
  var i = /* @__PURE__ */ ((r) => (r.HOTEL = "Hotel", r.FLIGHT = "Flight", r))(i || {});
@@ -1,6 +1,6 @@
1
1
  import { useQuery as u, useMutation as p } from "@tanstack/react-query";
2
2
  import { h as m } from "../../arrayExtensions-DlcBOj5a.js";
3
- import { E as e } from "../../noRetryInstance-DKhe8ju0.js";
3
+ import { E as e } from "../../noRetryInstance-Bit3xLkY.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  import "react-i18next";
@@ -13,7 +13,7 @@ import { awayzClient as o } from "../../configs/awayzClient.js";
13
13
  import "../../index-Cv-wvFlM.js";
14
14
  import "../../context/AwayzContext.js";
15
15
  /* empty css */
16
- import { T as n } from "../../TripsService-CJxjOcrR.js";
16
+ import { T as n } from "../../TripsService-k5PnDpcP.js";
17
17
  const b = ({
18
18
  tripId: t,
19
19
  tripDetails: s
@@ -1,5 +1,5 @@
1
1
  import { h as p } from "../../arrayExtensions-DlcBOj5a.js";
2
- import { D as f } from "../../TripsService-CJxjOcrR.js";
2
+ import { D as f } from "../../TripsService-k5PnDpcP.js";
3
3
  import "react";
4
4
  import { renderHook as o, waitFor as i } from "../../tests/TestWrapper.js";
5
5
  import { EMyTripsEndpoints as c } from "../../configs/endpoints.js";
@@ -10,7 +10,7 @@ import "../../_styles.flight-booking-CaUgKcMC.js";
10
10
  /* empty css */
11
11
  import "@tanstack/react-query";
12
12
  import "../../configs/awayzClient.js";
13
- import { c as d } from "../../noRetryInstance-DKhe8ju0.js";
13
+ import { c as d } from "../../noRetryInstance-Bit3xLkY.js";
14
14
  /* empty css */
15
15
  /* empty css */
16
16
  import "../../index-Cv-wvFlM.js";
@@ -1,6 +1,6 @@
1
1
  import { useQuery as n, useMutation as s } from "@tanstack/react-query";
2
2
  import "../../arrayExtensions-DlcBOj5a.js";
3
- import { E as a, d as m } from "../../noRetryInstance-DKhe8ju0.js";
3
+ import { E as a, d as m } from "../../noRetryInstance-Bit3xLkY.js";
4
4
  import "react";
5
5
  import "react/jsx-runtime";
6
6
  import "react-i18next";
@@ -8,7 +8,7 @@ import "../../_styles.flight-booking-CaUgKcMC.js";
8
8
  /* empty css */
9
9
  import "@tanstack/react-query";
10
10
  import "../../configs/awayzClient.js";
11
- import { c as l } from "../../noRetryInstance-DKhe8ju0.js";
11
+ import { c as l } from "../../noRetryInstance-Bit3xLkY.js";
12
12
  /* empty css */
13
13
  /* empty css */
14
14
  import "../../index-Cv-wvFlM.js";
@@ -22,7 +22,8 @@ export declare enum EAuthEndpoints {
22
22
  REFRESH_EMBED_TOKEN = "user/refresh-token",
23
23
  OAUTH_INITIATE = "user/oauth2/initiate",
24
24
  OAUTH_CALLBACK = "user/oauth2/callback",
25
- FEATURES = "/user/features"
25
+ FEATURES = "/user/features",
26
+ CLIENT = "/clients/embed-data"
26
27
  }
27
28
  export declare enum ECurrencyEndpoints {
28
29
  CURRENCY_CONVERSION = "currency/convert"
@@ -1,6 +1,6 @@
1
1
  import { TServiceResponse } from '@type-op/shared';
2
2
  import { ISignInParams, ISignUpParams } from '../../types/auth';
3
- import { IAuthData, IRegion, IResendVerificationEmailParams, ISearchLimitResponse, IUser } from './AccountServices.types';
3
+ import { IAuthData, IClientDetails, IRegion, IResendVerificationEmailParams, ISearchLimitResponse, IUser } from './AccountServices.types';
4
4
  export interface IClientUser {
5
5
  _id: string;
6
6
  email_address: string;
@@ -98,6 +98,7 @@ declare class _AccountService {
98
98
  * @returns A promise that resolves to a service response containing the available regions.
99
99
  */
100
100
  getRegions: () => Promise<IRegion[]>;
101
+ getClientDetails: () => Promise<IClientDetails>;
101
102
  }
102
103
  export declare const AccountService: _AccountService;
103
104
  export {};
@@ -176,4 +176,26 @@ export interface ISearchLimitResponse {
176
176
  number_of_calls: number;
177
177
  remaining_calls: number;
178
178
  }
179
+ export interface IClientDetails {
180
+ name: string;
181
+ preferredName: string;
182
+ supportEmail: string;
183
+ logo: string;
184
+ copyrightText: string;
185
+ termsDocument: string;
186
+ domain: string;
187
+ faviconUrl?: string;
188
+ googleClientId?: string;
189
+ colourConfiguration: {
190
+ [key: string]: string;
191
+ };
192
+ mapboxUrl?: string;
193
+ supportsDuffel: boolean;
194
+ businessAddress: string;
195
+ pointsAsCash?: {
196
+ baseUrl: string;
197
+ partialPaymentMinPoints: number;
198
+ exchangeRateBuffer: number;
199
+ };
200
+ }
179
201
  export {};
package/dist/main.js CHANGED
@@ -13,7 +13,7 @@ import { ETripStatus as A, useTripManagement as T } from "./hooks/useTripManagem
13
13
  import { useWallet as P } from "./hooks/useWallet/useWallet.js";
14
14
  import { AwayzProvider as I } from "./providers/AwayzProvider.js";
15
15
  import { CurrencyService as D } from "./services/currency/CurrencyService.js";
16
- import { c as O, a as R, g as V, i as H } from "./noRetryInstance-DKhe8ju0.js";
16
+ import { c as O, a as R, g as V, i as H } from "./noRetryInstance-Bit3xLkY.js";
17
17
  import { RewardsService as N } from "./services/rewards/RewardsService.js";
18
18
  import { EBookingType as W } from "./services/trips/TripService.types.js";
19
19
  import { EAuthFlow as j } from "./types/EAuthFlow.js";