@odynn/awayz-core 0.6.12 → 0.6.13

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.
@@ -1,11 +1,11 @@
1
- var l = Object.defineProperty;
2
- var g = (r, e, s) => e in r ? l(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s;
1
+ var m = Object.defineProperty;
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
5
  import { c as n, f as p, a as c, r as T } from "./AccountService-DGz0jGwx.js";
6
6
  import "react";
7
7
  import { EMyTripsEndpoints as i } from "./configs/endpoints.js";
8
- import { EBookingType as m } from "./services/trips/TripService.types.js";
8
+ import { EBookingType as l } from "./services/trips/TripService.types.js";
9
9
  import { DEFAULT_LOGO as y } from "./configs/defaultAwayzConfig.js";
10
10
  const b = "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/";
11
11
  class f {
@@ -96,7 +96,7 @@ const u = (r) => r.map(
96
96
  reference: e.booking_reference,
97
97
  startDate: e.departure_date,
98
98
  endDate: e.arrival_date,
99
- bookingType: m.FLIGHT,
99
+ bookingType: l.FLIGHT,
100
100
  airlines: e.slices.map((s) => {
101
101
  var a;
102
102
  return {
@@ -125,10 +125,10 @@ const u = (r) => r.map(
125
125
  reference: e.reference,
126
126
  startDate: e.check_in_date,
127
127
  endDate: e.check_out_date,
128
- bookingType: m.HOTEL,
128
+ bookingType: l.HOTEL,
129
129
  name: e.rooms[0].name,
130
130
  image: e.images[0],
131
- guests: e.number_of_guests,
131
+ guests: e.guests.length,
132
132
  address: Object.values(e.address).filter((s) => s).map((s) => s.trim()).join(", "),
133
133
  rooms: e.rooms.length,
134
134
  bookingId: e.booking_id,
@@ -1,33 +1,33 @@
1
- const c = (r, t) => {
1
+ const o = "USD", a = (r, t) => {
2
2
  var e = new Intl.NumberFormat("en-US", {
3
3
  style: "currency",
4
- currency: t ?? "USD"
4
+ currency: t ?? o
5
5
  });
6
6
  if (!r) return e.format(0);
7
7
  const n = parseFloat(r.toString());
8
8
  return e.format(n);
9
- }, a = (r, t) => {
9
+ }, m = (r, t) => {
10
10
  var e = new Intl.NumberFormat("en-US", {
11
11
  style: "currency",
12
- currency: t ?? "USD"
12
+ currency: t ?? o
13
13
  });
14
14
  return e.format(Math.round(r)).toString().split(".")[0];
15
- }, m = (r, t, e = 0) => {
15
+ }, i = (r, t, e = 0) => {
16
16
  const n = parseFloat((r == null ? void 0 : r.toString()) || "0");
17
17
  return new Intl.NumberFormat("en-US", {
18
18
  style: "currency",
19
- currency: t ?? "USD",
19
+ currency: t ?? o,
20
20
  maximumFractionDigits: e
21
21
  }).format(isNaN(n) ? 0 : n);
22
- }, i = (r, t = "en") => 0 .toLocaleString(t, {
22
+ }, u = (r, t = "en") => 0 .toLocaleString(t, {
23
23
  style: "currency",
24
24
  currency: r,
25
25
  minimumFractionDigits: 0,
26
26
  maximumFractionDigits: 0
27
27
  }).replace(/\d/g, "").trim();
28
28
  export {
29
- a,
30
- c as b,
31
- m as c,
32
- i as g
29
+ m as a,
30
+ a as b,
31
+ i as c,
32
+ u as g
33
33
  };
@@ -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 { a as Et, b as ue, c as j } from "../../cashUtils-BMWAlTGM.js";
8
+ import { a as Et, b as ue, c as j } from "../../cashUtils-BDa0CVyi.js";
9
9
  import { E as wt } from "../../AccountService-DGz0jGwx.js";
10
10
  import { b as pe } from "../../index-CDh8vAM_.js";
11
11
  import { EInvalidAmountDisplayOption as S, EToolTipPosition as Pt } from "./CashValueTypes.js";
@@ -1,13 +1,14 @@
1
- const o = "https://awayz.com/favicon.ico", t = {
1
+ const e = "https://awayz.com/favicon.ico", t = {
2
2
  testMode: !1,
3
3
  externalInventory: !1,
4
4
  flightsConfig: {
5
5
  streamTimeoutPingCount: 3,
6
6
  streamTimeoutTotalSeconds: 180
7
7
  },
8
- logoFallbackImageUrl: o
8
+ logoFallbackImageUrl: e,
9
+ useDuffel: !0
9
10
  };
10
11
  export {
11
- o as DEFAULT_LOGO,
12
+ e as DEFAULT_LOGO,
12
13
  t as defaultAwayzConfig
13
14
  };
@@ -1,5 +1,5 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
- import { g as P } from "../../cashUtils-BMWAlTGM.js";
2
+ import { g as P } from "../../cashUtils-BDa0CVyi.js";
3
3
  import { e as q, A as l, E as K } from "../../AccountService-DGz0jGwx.js";
4
4
  import { a as c } from "../../keys-D66VvSIm.js";
5
5
  import { useState as f, useCallback as O, useEffect as S } from "react";
@@ -2,7 +2,7 @@ import { useQuery as p, useMutation as s } from "@tanstack/react-query";
2
2
  import { h as m } from "../../arrayExtensions-DlcBOj5a.js";
3
3
  import { E as e } from "../../AccountService-DGz0jGwx.js";
4
4
  import "react";
5
- import { T as t } from "../../TripsService-DrPrX2_z.js";
5
+ import { T as t } from "../../TripsService-B5dp_HNZ.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,5 +1,5 @@
1
1
  import { h as p } from "../../arrayExtensions-DlcBOj5a.js";
2
- import { D as f } from "../../TripsService-DrPrX2_z.js";
2
+ import { D as f } from "../../TripsService-B5dp_HNZ.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";
@@ -62,4 +62,9 @@ export interface IAwayzConfig {
62
62
  * A URL to an image that will be used as a fallback logo in case flight/hotel logos fail to load.
63
63
  */
64
64
  logoFallbackImageUrl?: string;
65
+ /**
66
+ * Specifies if duffel is used for cash bookings
67
+ * @default true
68
+ */
69
+ useDuffel?: boolean;
65
70
  }
@@ -1,6 +1,6 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
2
  import "../../AccountService-DGz0jGwx.js";
3
- import { T } from "../../TripsService-DrPrX2_z.js";
3
+ import { T } from "../../TripsService-B5dp_HNZ.js";
4
4
  import "react";
5
5
  import "../../configs/endpoints.js";
6
6
  import "./TripService.types.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odynn/awayz-core",
3
- "version": "0.6.12",
3
+ "version": "0.6.13",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"