@odynn/awayz-core 0.10.32 → 0.10.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 (53) hide show
  1. package/dist/{TripsService-BwBvXdDC.js → TripsService-DtjkgWX5.js} +6 -6
  2. package/dist/assets/_styles5.css +1 -1
  3. package/dist/assets/_styles6.css +1 -1
  4. package/dist/assets/noRetryInstance.css +1 -0
  5. package/dist/components/Bookings/FlightBooking/FlightBooking.js +1 -1
  6. package/dist/components/Bookings/HotelBooking/HotelBooking.js +1 -1
  7. package/dist/components/CashValue/CashValue.js +13 -15
  8. package/dist/components/CashValue/CashValue.stories.js +15 -15
  9. package/dist/components/ClientPointsValue/ClientPointsValue.js +18 -20
  10. package/dist/components/Modal/Modal.js +1 -1
  11. package/dist/components/Tooltip/Tooltip.js +1 -1
  12. package/dist/components/Wallet/Card/Card.stories.js +14 -15
  13. package/dist/configs/awayzUrl.js +12 -0
  14. package/dist/context/AwayzContext.js +1 -0
  15. package/dist/hooks/useAwayzAuth/useAwayzAuth.js +98 -104
  16. package/dist/hooks/useBookingManagement/useBookingManagement.js +4 -6
  17. package/dist/hooks/useBookingManagement/useBookingManagement.test.js +2 -4
  18. package/dist/hooks/useFeatureFlags.js +1 -1
  19. package/dist/hooks/useSearchLimit.js +1 -1
  20. package/dist/hooks/useTripManagement/useTripManagement.js +5 -7
  21. package/dist/hooks/useTripManagement/useTripManagement.test.js +3 -5
  22. package/dist/hooks/useWallet/useWallet.js +29 -31
  23. package/dist/hooks/useWallet/useWallet.test.js +2 -4
  24. package/dist/keys-C7jV6nZg.js +5 -0
  25. package/dist/lib/configs/awayzConfig.d.ts +3 -2
  26. package/dist/lib/configs/awayzUrl.d.ts +4 -0
  27. package/dist/lib/context/AwayzContext.d.ts +1 -0
  28. package/dist/lib/hooks/useAwayzAuth/useAwayzAuth.d.ts +1 -0
  29. package/dist/lib/main.d.ts +1 -1
  30. package/dist/lib/services/account/AccountService.d.ts +2 -1
  31. package/dist/main.js +27 -28
  32. package/dist/{AccountService-B582vLTc.js → noRetryInstance-BbgLI6--.js} +721 -699
  33. package/dist/providers/AwayzProvider.js +14 -17
  34. package/dist/services/account/AccountService.js +2 -2
  35. package/dist/services/bookings/BookingService.js +3 -3
  36. package/dist/services/currency/CurrencyService.js +14 -16
  37. package/dist/services/features/featureService.js +1 -1
  38. package/dist/services/index.js +12 -13
  39. package/dist/services/instance.js +3 -3
  40. package/dist/services/instanceConfig.js +21 -11
  41. package/dist/services/noRetryInstance.js +2 -9
  42. package/dist/services/preferences/PreferencesService.js +1 -1
  43. package/dist/services/rewards/RewardsService.js +1 -1
  44. package/dist/services/trips/TripsService.js +2 -2
  45. package/dist/services/wallet/WalletService.js +1 -1
  46. package/dist/utils/clientPoints.js +4 -6
  47. package/package.json +1 -1
  48. package/dist/assets/_styles7.css +0 -1
  49. package/dist/configs/baseUrl.js +0 -11
  50. package/dist/configs/gatewayBaseUrl.js +0 -8
  51. package/dist/keys-BcBfU51M.js +0 -5
  52. package/dist/lib/configs/baseUrl.d.ts +0 -3
  53. package/dist/lib/configs/gatewayBaseUrl.d.ts +0 -2
@@ -3,20 +3,18 @@ import "react/jsx-runtime";
3
3
  import "../../arrayExtensions-DlcBOj5a.js";
4
4
  import "react";
5
5
  import "react-i18next";
6
- import '../../assets/_styles4.css';import '../../assets/_styles5.css';import '../../assets/_styles7.css';import '../../assets/_styles6.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles3.css';/* empty css */
6
+ import '../../assets/_styles4.css';import '../../assets/_styles6.css';import '../../assets/_styles5.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles3.css';/* empty css */
7
7
  /* empty css */
8
8
  /* empty css */
9
9
  import "@tanstack/react-query";
10
10
  import "../../configs/awayzClient.js";
11
- import { c as l } from "../../AccountService-B582vLTc.js";
11
+ import { c as l } from "../../noRetryInstance-BbgLI6--.js";
12
12
  /* empty css */
13
13
  /* empty css */
14
14
  import "../../index-Cv-wvFlM.js";
15
- /* empty css */
16
15
  import "../../context/AwayzContext.js";
17
16
  import { useWallet as t } from "./useWallet.js";
18
17
  /* empty css */
19
- import "../../services/noRetryInstance.js";
20
18
  import { renderHook as s, waitFor as i } from "../../tests/TestWrapper.js";
21
19
  import { d as m, v as c, b as p, t as n, g as o } from "../../vi.2VT5v0um-lKoi8TEt.js";
22
20
  const _ = !0, v = [{ _id: "AAAviatorBis", name: "AAdvantage Aviator Business", signupBonus: 7e4, cashBonus: 0, minimumSpend: 2e3, daysToSpend: 90, annual_fee: 95, annualFeeWaived: !1, cashPerks: 0, bank: { name: "Barclays" }, rewards_currency: "American Airlines Miles", bisCard: !0, chargeCard: !1, cardFamily: 0, websiteUrl: "https://frequentmiler.com/AviatorBiz/#Goto", network: { name: "Mastercard" }, _modified: "2022-08-30T00:24:55.568Z", colour: "#1A3251", region: "US", faredrop_card_id: "", alternateRegions: [], logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/barclays-white.svg" }, { _id: "AARed", name: "AAdvantage Aviator Red", signupBonus: 6e4, cashBonus: 0, minimumSpend: 0, daysToSpend: 30, annual_fee: 99, annualFeeWaived: !0, cashPerks: 0, bank: { name: "Barclays" }, rewards_currency: "American Airlines Miles", bisCard: !1, chargeCard: !1, cardFamily: 1, websiteUrl: "https://frequentmiler.com/AviatorRed/#Goto", network: { name: "Mastercard" }, colour: "#1A3251", region: "US", faredrop_card_id: "", alternateRegions: [], logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/barclays-white.svg" }, { _id: "AASilver", name: "AAdvantage Aviator Silver", signupBonus: 0, cashBonus: 0, minimumSpend: 0, daysToSpend: 0, annual_fee: 195, annualFeeWaived: !1, cashPerks: 75, bank: { name: "Barclays" }, rewards_currency: "American Airlines Miles", bisCard: !1, chargeCard: !1, cardFamily: 1, websiteUrl: "https://frequentmiler.boardingarea.com/AviatorSilver/#Goto", network: { name: "Mastercard" }, _modified: "2022-08-30T00:27:10.347Z", updatedAt: "2022-10-26T06:55:01.187Z", colour: "#C8C8C8", region: "US", faredrop_card_id: "", alternateRegions: [], logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/barclays-black.svg" }, { _id: "AFKLMcard", name: "Air France KLM Card", signupBonus: 7e4, cashBonus: 0, minimumSpend: 2e3, daysToSpend: 90, annual_fee: 89, annualFeeWaived: !1, cashPerks: 150, bank: { name: "BofA" }, rewards_currency: "Flying Blue Miles", bisCard: !1, chargeCard: !1, cardFamily: 6, websiteUrl: "https://frequentmiler.com/AFKLM/#Goto", network: { name: "Mastercard" }, _modified: "2022-08-30T00:41:10.038Z", colour: "#1A3251", region: "US", faredrop_card_id: "", alternateRegions: [], logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/bofa-white.svg" }, { _id: "ASBis", name: "Alaska Airlines Visa Business", signupBonus: 7e4, cashBonus: 0, minimumSpend: 4e3, daysToSpend: 90, annual_fee: 75, annualFeeWaived: !1, cashPerks: 0, bank: { name: "BofA" }, rewards_currency: "Alaska MileagePlan", bisCard: !0, chargeCard: !1, cardFamily: 10, websiteUrl: "https://frequentmiler.com/ASbiz/#Goto", network: { name: "Visa" }, _modified: "2022-08-30T00:41:42.408Z", colour: "#1A3251", region: "US", faredrop_card_id: "", alternateRegions: [], logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/bofa-white.svg" }, { _id: "AltReserve", name: "Altitude Reserve", signupBonus: 5e4, cashBonus: 0, minimumSpend: 4500, daysToSpend: 90, annual_fee: 400, annualFeeWaived: !1, cashPerks: 0, bank: { name: "US Bank" }, rewards_currency: "Altitude Reserve Points", bisCard: !1, chargeCard: !1, cardFamily: 28, websiteUrl: "https://frequentmiler.com/USBAR/#Goto", network: { name: "Visa" }, colour: "#3767A2", region: "US", faredrop_card_id: "", points_as_cash_conversion_ratio: 0.015, updatedAt: "2024-10-18T14:47:25.187Z", alternateRegions: [], logoUrl: "https://s3.us-east-1.amazonaws.com/awayz/card_logos/us-bank-white.svg" }], y = {
@@ -0,0 +1,5 @@
1
+ var T = /* @__PURE__ */ ((_) => (_.TOKEN = "token", _.REFRESH_TOKEN = "refreshToken", _.CLIENT_ID = "clientId", _.AUTH_FLOW = "authFlow", _.OVERRIDE_TOKEN_EXCHANGE_ENDPOINT = "overrideExchangeTokenEndpoint", _.OVERRIDE_PAC_ENDPOINT = "overridePACEndpoint", _))(T || {}), d = /* @__PURE__ */ ((_) => (_.ISO = "dates:iso", _.DISPLAY_SHORT = "dates:displayShort", _.DISPLAY_MEDIUM = "dates:displayMedium", _.DISPLAY_LONG = "dates:displayLong", _.DISPLAY_FULL = "dates:displayFull", _.DISPLAY_SHORT_WITH_YEAR = "dates:displayShortWithYear", _.DISPLAY_MEDIUM_WITH_YEAR = "dates:displayMediumWithYear", _.DISPLAY_LONG_WITH_YEAR = "dates:displayLongWithYear", _.DISPLAY_FULL_WITH_YEAR = "dates:displayFullWithYear", _.DATE_TIME_SHORT = "dates:dateTimeShort", _.DATE_TIME_MEDIUM = "dates:dateTimeMedium", _.DATE_TIME_LONG = "dates:dateTimeLong", _.DATE_TIME_FULL = "dates:dateTimeFull", _.DATE_TIME_SHORT_WITH_YEAR = "dates:dateTimeShortWithYear", _.DATE_TIME_MEDIUM_WITH_YEAR = "dates:dateTimeMediumWithYear", _.DATE_TIME_LONG_WITH_YEAR = "dates:dateTimeLongWithYear", _.DATE_TIME_FULL_WITH_YEAR = "dates:dateTimeFullWithYear", _.TIME_ONLY = "dates:timeOnly", _.TIME_WITH_SECONDS = "dates:timeWithSeconds", _))(d || {});
2
+ export {
3
+ d as E,
4
+ T as a
5
+ };
@@ -56,9 +56,10 @@ export interface IAwayzConfig {
56
56
  */
57
57
  onAuthSuccess?: (authData: IAuthData) => void;
58
58
  /**
59
- * Allow overriding the base URL for the Awayz API.
59
+ * Remove hardcode API url from components and use env
60
+ * Application using the components can pass in the env
60
61
  */
61
- overrideBaseUrl?: string;
62
+ baseUrl: string;
62
63
  /**
63
64
  * API Gateway for microservices hosted in AWS. Will replace all base urls for node api
64
65
  */
@@ -0,0 +1,4 @@
1
+ export declare const getBaseUrl: () => string;
2
+ export declare const getGatewayBaseUrl: () => string;
3
+ export declare const setBaseUrl: (envUrl: string) => void;
4
+ export declare const setGatewayBaseUrl: (envUrl: string) => void;
@@ -9,6 +9,7 @@ export interface IAwayzContext {
9
9
  user?: IUser;
10
10
  isAuthenticated: boolean;
11
11
  isAuthenticating: boolean;
12
+ isMfaPending: boolean;
12
13
  featureFlags: FeatureFlags;
13
14
  featureFlagsLoaded: boolean;
14
15
  supportedRegions: IRegion[];
@@ -10,6 +10,7 @@ export declare const authFailurePostMessage: (action: ETokenType, error: any) =>
10
10
  export declare const useAwayzAuth: (options: TEmbeddedAuthOptions) => {
11
11
  isAuthenticating: boolean;
12
12
  isAuthenticated: boolean;
13
+ isMfaPending: boolean;
13
14
  token: string | undefined;
14
15
  user: IUser | undefined;
15
16
  supportedRegions: IRegion[];
@@ -6,4 +6,4 @@ export * from './services';
6
6
  export * from './types';
7
7
  export * from './utils';
8
8
  export * from './hooks/useFeatureFlags';
9
- export { getBaseUrl } from './configs/baseUrl';
9
+ export { getBaseUrl } from './configs/awayzUrl';
@@ -62,9 +62,10 @@ declare class _AccountService {
62
62
  *
63
63
  * @param idToken - The ID token to authenticate with.
64
64
  * @param refreshToken - The refresh token for user
65
+ * @param overrideExchangeTokenUrl - An optional URL to override the default exchange token endpoint, used for testing purposes.
65
66
  * @returns A promise that resolves to a service response containing authentication data.
66
67
  */
67
- authenticateWithToken: (idToken: string, refreshToken: string, exchangeTokenEndPoint?: string) => Promise<TServiceResponse<IAuthData>>;
68
+ authenticateWithToken: (idToken: string, refreshToken: string, overrideExchangeTokenUrl?: string) => Promise<TServiceResponse<IAuthData>>;
68
69
  /**
69
70
  * If token is available in local storage, check if it is valid and return user details
70
71
  *
package/dist/main.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { FlightBooking as r } from "./components/Bookings/FlightBooking/FlightBooking.js";
2
2
  import { HotelBooking as a } from "./components/Bookings/HotelBooking/HotelBooking.js";
3
3
  import { CashValue as m } from "./components/CashValue/CashValue.js";
4
- import { EInvalidAmountDisplayOption as i, EToolTipPosition as f } from "./components/CashValue/CashValueTypes.js";
4
+ import { EInvalidAmountDisplayOption as i, EToolTipPosition as s } from "./components/CashValue/CashValueTypes.js";
5
5
  import { ClientPointsValue as x } from "./components/ClientPointsValue/ClientPointsValue.js";
6
6
  import { Card as u } from "./components/Wallet/Card/Card.js";
7
7
  import { awayzClient as g } from "./configs/awayzClient.js";
@@ -13,49 +13,48 @@ import { ETripStatus as d, useTripManagement as v } from "./hooks/useTripManagem
13
13
  import { useWallet as k } from "./hooks/useWallet/useWallet.js";
14
14
  import { ECancelStatus as z } from "./hooks/useBookingManagement/useBookingManagement.types.js";
15
15
  import { AwayzProvider as M } from "./providers/AwayzProvider.js";
16
- import { A as R, c as V, g as H, i as L } from "./AccountService-B582vLTc.js";
17
- import { ESource as O } from "./services/account/AccountServices.types.js";
18
- import { CurrencyService as W } from "./services/currency/CurrencyService.js";
19
- import { clientNoRetryInstance as j } from "./services/noRetryInstance.js";
20
- import { RewardsService as G } from "./services/rewards/RewardsService.js";
21
- import { EBookingType as K } from "./services/trips/TripService.types.js";
22
- import { EAuthFlow as X } from "./types/EAuthFlow.js";
23
- import { convertCashToClientPoints as Z } from "./utils/clientPoints.js";
24
- import { getCurrency as $ } from "./utils/currency.js";
25
- import { EAmountsDisplayFeature as eo, EBookingPaymentMethod as ro, EThemeFeatureFlag as to, useFeatureFlags as ao } from "./hooks/useFeatureFlags.js";
26
- import { getBaseUrl as mo } from "./configs/baseUrl.js";
16
+ import { A as R, c as V, a as H, g as L, i as N } from "./noRetryInstance-BbgLI6--.js";
17
+ import { ESource as U } from "./services/account/AccountServices.types.js";
18
+ import { CurrencyService as b } from "./services/currency/CurrencyService.js";
19
+ import { RewardsService as q } from "./services/rewards/RewardsService.js";
20
+ import { EBookingType as J } from "./services/trips/TripService.types.js";
21
+ import { EAuthFlow as Q } from "./types/EAuthFlow.js";
22
+ import { convertCashToClientPoints as Y } from "./utils/clientPoints.js";
23
+ import { getCurrency as _ } from "./utils/currency.js";
24
+ import { EAmountsDisplayFeature as ee, EBookingPaymentMethod as oe, EThemeFeatureFlag as re, useFeatureFlags as te } from "./hooks/useFeatureFlags.js";
25
+ import { getBaseUrl as ne } from "./configs/awayzUrl.js";
27
26
  export {
28
27
  R as AccountService,
29
28
  M as AwayzProvider,
30
29
  u as Card,
31
30
  m as CashValue,
32
31
  x as ClientPointsValue,
33
- W as CurrencyService,
34
- eo as EAmountsDisplayFeature,
35
- X as EAuthFlow,
36
- ro as EBookingPaymentMethod,
37
- K as EBookingType,
32
+ b as CurrencyService,
33
+ ee as EAmountsDisplayFeature,
34
+ Q as EAuthFlow,
35
+ oe as EBookingPaymentMethod,
36
+ J as EBookingType,
38
37
  z as ECancelStatus,
39
38
  i as EInvalidAmountDisplayOption,
40
- O as ESource,
41
- to as EThemeFeatureFlag,
42
- f as EToolTipPosition,
39
+ U as ESource,
40
+ re as EThemeFeatureFlag,
41
+ s as EToolTipPosition,
43
42
  d as ETripStatus,
44
43
  r as FlightBooking,
45
44
  a as HotelBooking,
46
- G as RewardsService,
45
+ q as RewardsService,
47
46
  g as awayzClient,
48
47
  V as clientInstance,
49
- j as clientNoRetryInstance,
50
- Z as convertCashToClientPoints,
48
+ H as clientNoRetryInstance,
49
+ Y as convertCashToClientPoints,
51
50
  C as defaultAwayzConfig,
52
- H as gatewayInstance,
53
- mo as getBaseUrl,
54
- $ as getCurrency,
55
- L as instance,
51
+ L as gatewayInstance,
52
+ ne as getBaseUrl,
53
+ _ as getCurrency,
54
+ N as instance,
56
55
  A as useAwayzContext,
57
56
  w as useBookingManagement,
58
- ao as useFeatureFlags,
57
+ te as useFeatureFlags,
59
58
  S as useSearchLimit,
60
59
  v as useTripManagement,
61
60
  k as useWallet