@odynn/awayz-core 0.6.6 → 0.6.7
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.
- package/dist/{AccountService-DSlN1q1q.js → AccountService-CPWv4uJS.js} +1 -1
- package/dist/{TripsService-BWc1KjO6.js → TripsService-CCdhF5uK.js} +2 -2
- package/dist/{_commonjsHelpers-MdHo5S7N.js → _commonjsHelpers-B52_cu2H.js} +2 -2
- package/dist/{arrayExtensions-DlcBOj5a.js → arrayExtensions--Llcg40q.js} +1 -1
- package/dist/components/Bookings/FlightBooking/FlightBooking.js +1 -1
- package/dist/components/Bookings/HotelBooking/HotelBooking.js +1 -1
- package/dist/components/CashValue/CashValue.js +8 -7
- package/dist/components/CashValue/CashValue.stories.js +2 -2
- package/dist/components/Menu/Menu.js +2 -2
- package/dist/components/Wallet/Card/Card.js +1 -1
- package/dist/components/Wallet/Card/Card.stories.js +2 -2
- package/dist/context/AwayzContext.js +1 -0
- package/dist/currency-symbol-map-RM3-TVyB.js +211 -0
- package/dist/hooks/useAwayzAuth/useAwayzAuth.js +102 -95
- package/dist/hooks/useBookingManagement/useBookingManagement.js +5 -4
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +3 -2
- package/dist/hooks/useSearchLimit.js +2 -2
- package/dist/hooks/useTripManagement/useTripManagement.js +14 -13
- package/dist/hooks/useTripManagement/useTripManagement.test.js +24 -22
- package/dist/hooks/useWallet/useWallet.js +9 -8
- package/dist/hooks/useWallet/useWallet.test.js +3 -2
- package/dist/{index-Cv-wvFlM.js → index-B7QVGqcx.js} +1 -1
- package/dist/{index-BC-KTkxU.js → index-C135U4OR.js} +1 -1
- package/dist/lib/context/AwayzContext.d.ts +2 -0
- package/dist/lib/hooks/useAwayzAuth/useAwayzAuth.d.ts +2 -0
- package/dist/lib/services/currency/CurrencyService.types.d.ts +4 -0
- package/dist/lib/types/index.d.ts +0 -1
- package/dist/main.js +33 -36
- package/dist/providers/AwayzProvider.js +2 -2
- package/dist/services/account/AccountService.js +2 -2
- package/dist/services/bookings/BookingService.js +2 -2
- package/dist/services/currency/CurrencyService.js +5 -4
- package/dist/services/index.js +1 -1
- package/dist/services/instance.js +2 -2
- package/dist/services/instanceConfig.js +2 -2
- package/dist/services/noRetryInstance.js +1 -1
- package/dist/services/preferences/PreferencesService.js +1 -1
- package/dist/services/rewards/RewardsService.js +2 -2
- package/dist/services/trips/TripsService.js +3 -3
- package/dist/services/wallet/WalletService.js +2 -2
- package/dist/tests/TestWrapper.js +2 -2
- package/dist/types/index.js +2 -5
- package/package.json +2 -1
- package/dist/lib/types/ECurrency.d.ts +0 -32
- package/dist/types/ECurrency.js +0 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery as g, useMutation as c } from "@tanstack/react-query";
|
|
2
|
-
import "../../arrayExtensions
|
|
3
|
-
import { E as o } from "../../AccountService-
|
|
2
|
+
import "../../arrayExtensions--Llcg40q.js";
|
|
3
|
+
import { E as o } from "../../AccountService-CPWv4uJS.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
6
|
import { awayzClient as v } from "../../configs/awayzClient.js";
|
|
@@ -12,9 +12,10 @@ import "react-i18next";
|
|
|
12
12
|
/* empty css */
|
|
13
13
|
import "../../context/AwayzContext.js";
|
|
14
14
|
import { EBookingType as i } from "../../services/trips/TripService.types.js";
|
|
15
|
+
import "../../currency-symbol-map-RM3-TVyB.js";
|
|
15
16
|
import "../../services/noRetryInstance.js";
|
|
16
17
|
import { BookingService as t } from "../../services/bookings/BookingService.js";
|
|
17
|
-
const
|
|
18
|
+
const b = (r, e) => {
|
|
18
19
|
const {
|
|
19
20
|
data: C,
|
|
20
21
|
isError: B,
|
|
@@ -115,5 +116,5 @@ const D = (r, e) => {
|
|
|
115
116
|
};
|
|
116
117
|
};
|
|
117
118
|
export {
|
|
118
|
-
|
|
119
|
+
b as useBookingManagement
|
|
119
120
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EBookingEndpoints as i } from "../../configs/endpoints.js";
|
|
2
|
-
import { c } from "../../AccountService-
|
|
2
|
+
import { c } from "../../AccountService-CPWv4uJS.js";
|
|
3
3
|
import "../../services/noRetryInstance.js";
|
|
4
|
-
import "../../arrayExtensions
|
|
4
|
+
import "../../arrayExtensions--Llcg40q.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "react/jsx-runtime";
|
|
7
7
|
import "@tanstack/react-query";
|
|
@@ -15,6 +15,7 @@ import "../../configs/awayzClient.js";
|
|
|
15
15
|
import "../../context/AwayzContext.js";
|
|
16
16
|
import { useBookingManagement as t } from "./useBookingManagement.js";
|
|
17
17
|
import { EBookingType as r } from "../../services/trips/TripService.types.js";
|
|
18
|
+
import "../../currency-symbol-map-RM3-TVyB.js";
|
|
18
19
|
import { renderHook as a, waitFor as n } from "../../tests/TestWrapper.js";
|
|
19
20
|
import { d as s, v as u, t as l, g as e } from "../../vi.ClIskdbk-k6t29WRA.js";
|
|
20
21
|
const d = { _id: "6811290ef16af25943018944", order_id: "ord_0000AvQk8IXqiCE2o20e00", user_id: "67d82b1c52c4a4dbe4e640c0", void_window_ends_at: null, documents: [{ passenger_ids: ["pas_0000AvQjcLZRvVQivKWRxi"], unique_identifier: "1", type: "electronic_ticket" }], synced_at: "2025-06-23T18:32:48Z", available_actions: ["cancel", "change", "update"], airline_initiated_changes: [], cancellation: null, tax_currency: "USD", base_currency: "USD", base_amount: "77.49", tax_amount: "13.94", total_currency: "USD", offer_id: "off_0000AvQjcLqSuF2bm6U2U7", booking_reference: "GHNRHO", created_at: "2025-06-23T18:31:58.211428Z", payment_status: { paid_at: "2025-06-23T18:31:58Z", price_guarantee_expires_at: null, payment_required_by: null, awaiting_payment: !1 }, live_mode: !1, total_amount: "91.43", slices: [{ destination_type: "airport", origin_type: "airport", fare_brand_name: "Basic", segments: [{ origin_terminal: "2", destination_terminal: "1", aircraft: { iata_code: "773", name: "Boeing 777-300", id: "arc_00009VMF8AhXSSRnQDI6HE" }, departing_at: "2025-07-30T22:27:00", arriving_at: "2025-07-31T00:24:00", operating_carrier: { logo_symbol_url: "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/ZZ.svg", logo_lockup_url: null, conditions_of_carriage_url: "https://duffelairways.com/dummy-url/conditions-of-carriage", iata_code: "ZZ", name: "Duffel Airways", id: "arl_00009VME7D6ivUu8dn35WK" }, marketing_carrier: { logo_symbol_url: "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/ZZ.svg", logo_lockup_url: null, conditions_of_carriage_url: "https://duffelairways.com/dummy-url/conditions-of-carriage", iata_code: "ZZ", name: "Duffel Airways", id: "arl_00009VME7D6ivUu8dn35WK" }, stops: [], operating_carrier_flight_number: "9596", marketing_carrier_flight_number: "9596", distance: "1034.9960998474376", passengers: [{ baggages: [{ quantity: 1, type: "checked" }, { quantity: 1, type: "carry_on" }], cabin_class_marketing_name: "Economy", passenger_id: "pas_0000AvQjcLZRvVQivKWRxi", seat: null, cabin_class: "economy" }], duration: "PT1H57M", destination: { icao_code: "LFPG", iata_country_code: "FR", iata_city_code: "PAR", city_name: "Paris", iata_code: "CDG", latitude: 49.011244, longitude: 2.548962, city: { icao_code: null, iata_country_code: "FR", iata_city_code: "PAR", city_name: null, iata_code: "PAR", latitude: null, longitude: null, time_zone: null, type: "city", name: "Paris", id: "cit_par_fr" }, time_zone: "Europe/Paris", type: "airport", name: "Paris Charles de Gaulle Airport", id: "arp_cdg_fr" }, origin: { icao_code: "LOWW", iata_country_code: "AT", iata_city_code: "VIE", city_name: "Vienna", iata_code: "VIE", latitude: 48.113065, longitude: 16.568137, city: null, time_zone: "Europe/Vienna", type: "airport", name: "Vienna International Airport", id: "arp_vie_at" }, id: "seg_0000AvQjcLqSuF2bm6U2U5" }], conditions: { change_before_departure: { penalty_currency: "GBP", penalty_amount: "10.00", allowed: !0 } }, duration: "PT1H57M", destination: { icao_code: "LFPG", iata_country_code: "FR", iata_city_code: "PAR", city_name: "Paris", iata_code: "CDG", latitude: 49.011244, longitude: 2.548962, city: { icao_code: null, iata_country_code: "FR", iata_city_code: "PAR", city_name: null, iata_code: "PAR", latitude: null, longitude: null, time_zone: null, type: "city", name: "Paris", id: "cit_par_fr" }, time_zone: "Europe/Paris", type: "airport", name: "Paris Charles de Gaulle Airport", id: "arp_cdg_fr" }, origin: { icao_code: "LOWW", iata_country_code: "AT", iata_city_code: "VIE", city_name: "Vienna", iata_code: "VIE", latitude: 48.113065, longitude: 16.568137, city: null, time_zone: "Europe/Vienna", type: "airport", name: "Vienna International Airport", id: "arp_vie_at" }, id: "sli_0000AvQjcLqSuF2bm6U2U6" }], passengers: [{ born_on: "2007-04-29", loyalty_programme_accounts: [], family_name: "Botha", given_name: "Adriaan", gender: "m", infant_passenger_id: null, phone_number: "+12345642342", user_id: null, email: "adriaan.botha@typedev.co.za", title: "mr", type: "adult", id: "pas_0000AvQjcLZRvVQivKWRxi" }], conditions: { refund_before_departure: { penalty_currency: null, penalty_amount: null, allowed: !1 }, change_before_departure: { penalty_currency: "GBP", penalty_amount: "10.00", allowed: !0 } }, cancelled_at: null, changes: [], content: "managed", services: [], users: ["icu_0000Asbm8q0FlWOhf0fDUm"], metadata: null, type: "instant", owner: { logo_symbol_url: "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/ZZ.svg", logo_lockup_url: null, conditions_of_carriage_url: "https://duffelairways.com/dummy-url/conditions-of-carriage", iata_code: "ZZ", name: "Duffel Airways", id: "arl_00009VME7D6ivUu8dn35WK" }, id: "ord_0000AvQk8IXqiCE2o20e00", status: "flight confirmed" }, m = "Flight booking found", g = !0, _ = { internalRequestId: "f6b54196-4d33-434d-9800-d9dc72a074ab" }, h = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery as u } from "@tanstack/react-query";
|
|
2
|
-
import "../arrayExtensions
|
|
3
|
-
import { E as m, A as c, a as f } from "../AccountService-
|
|
2
|
+
import "../arrayExtensions--Llcg40q.js";
|
|
3
|
+
import { E as m, A as c, a as f } from "../AccountService-CPWv4uJS.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
|
-
import { useQuery as
|
|
2
|
-
import { h as m } from "../../arrayExtensions
|
|
3
|
-
import { E as e } from "../../AccountService-
|
|
1
|
+
import { useQuery as u, useMutation as s } from "@tanstack/react-query";
|
|
2
|
+
import { h as m } from "../../arrayExtensions--Llcg40q.js";
|
|
3
|
+
import { E as e } from "../../AccountService-CPWv4uJS.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { T as t } from "../../TripsService-
|
|
5
|
+
import { T as t } from "../../TripsService-CCdhF5uK.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 */
|
|
@@ -12,17 +12,18 @@ import "react-i18next";
|
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
14
|
import "../../context/AwayzContext.js";
|
|
15
|
+
import "../../currency-symbol-map-RM3-TVyB.js";
|
|
15
16
|
import "../../services/noRetryInstance.js";
|
|
16
17
|
const b = ({
|
|
17
|
-
tripId:
|
|
18
|
+
tripId: p,
|
|
18
19
|
tripDetails: a
|
|
19
20
|
}) => {
|
|
20
|
-
if (!
|
|
21
|
+
if (!p)
|
|
21
22
|
throw new Error("Trip ID is required");
|
|
22
23
|
if (!a || Object.keys(a).length === 0)
|
|
23
24
|
throw new Error("Trip details must be provided for update");
|
|
24
|
-
},
|
|
25
|
-
const { data:
|
|
25
|
+
}, ir = () => {
|
|
26
|
+
const { data: p = [] } = u({
|
|
26
27
|
queryKey: [
|
|
27
28
|
e.TRIPS,
|
|
28
29
|
"past"
|
|
@@ -32,7 +33,7 @@ const b = ({
|
|
|
32
33
|
"past"
|
|
33
34
|
/* PAST */
|
|
34
35
|
)
|
|
35
|
-
}), { data: a = [] } =
|
|
36
|
+
}), { data: a = [] } = u({
|
|
36
37
|
queryKey: [
|
|
37
38
|
e.TRIPS,
|
|
38
39
|
"upcoming"
|
|
@@ -42,7 +43,7 @@ const b = ({
|
|
|
42
43
|
"upcoming"
|
|
43
44
|
/* UPCOMING */
|
|
44
45
|
)
|
|
45
|
-
}), { data: n } =
|
|
46
|
+
}), { data: n } = u({
|
|
46
47
|
queryKey: [e.UNCATEGORISED_BOOKINGS],
|
|
47
48
|
queryFn: () => t.getUncategorisedBookings()
|
|
48
49
|
}), {
|
|
@@ -200,14 +201,14 @@ const b = ({
|
|
|
200
201
|
queryKey: [e.UNCATEGORISED_BOOKINGS]
|
|
201
202
|
});
|
|
202
203
|
}
|
|
203
|
-
}), N = [...
|
|
204
|
+
}), N = [...p, ...a], d = (n == null ? void 0 : n.flightBookings) || [], T = (n == null ? void 0 : n.hotelBookings) || [], A = [
|
|
204
205
|
...d,
|
|
205
206
|
...T
|
|
206
207
|
].sort((r, i) => m(r.startDate).diff(m(i.startDate)));
|
|
207
208
|
return {
|
|
208
209
|
// Trips
|
|
209
210
|
allTrips: N,
|
|
210
|
-
pastTrips:
|
|
211
|
+
pastTrips: p,
|
|
211
212
|
upcomingTrips: a,
|
|
212
213
|
// Bookings
|
|
213
214
|
allUncategorisedBookings: A,
|
|
@@ -241,6 +242,6 @@ const b = ({
|
|
|
241
242
|
};
|
|
242
243
|
};
|
|
243
244
|
export {
|
|
244
|
-
|
|
245
|
+
ir as useTripManagement,
|
|
245
246
|
b as validateUpdateTripArgs
|
|
246
247
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { h as p } from "../../arrayExtensions
|
|
2
|
-
import { D as f } from "../../TripsService-
|
|
1
|
+
import { h as p } from "../../arrayExtensions--Llcg40q.js";
|
|
2
|
+
import { D as f } from "../../TripsService-CCdhF5uK.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { renderHook as o, waitFor as i } from "../../tests/TestWrapper.js";
|
|
5
|
-
import { EMyTripsEndpoints as
|
|
5
|
+
import { EMyTripsEndpoints as c } from "../../configs/endpoints.js";
|
|
6
6
|
import "react/jsx-runtime";
|
|
7
7
|
import "@tanstack/react-query";
|
|
8
|
-
import { c } from "../../AccountService-
|
|
8
|
+
import { c as d } from "../../AccountService-CPWv4uJS.js";
|
|
9
9
|
import "../../configs/awayzClient.js";
|
|
10
10
|
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles5.css';/* empty css */
|
|
11
11
|
/* empty css */
|
|
@@ -16,6 +16,7 @@ import "react-i18next";
|
|
|
16
16
|
import "../../context/AwayzContext.js";
|
|
17
17
|
import { EBookingType as m } from "../../services/trips/TripService.types.js";
|
|
18
18
|
import { useTripManagement as n } from "./useTripManagement.js";
|
|
19
|
+
import "../../currency-symbol-map-RM3-TVyB.js";
|
|
19
20
|
import "../../services/noRetryInstance.js";
|
|
20
21
|
import { UncategorisedBookings200 as y, PastTrip200 as B, UpcomingTrip200 as b, UpdatedTrip200 as k } from "./mocks/index.js";
|
|
21
22
|
import { d as u, v as T, b as D, t as s, g as e } from "../../vi.ClIskdbk-k6t29WRA.js";
|
|
@@ -24,17 +25,17 @@ let g = {
|
|
|
24
25
|
upcoming: [...b.data].concat(k.data)
|
|
25
26
|
};
|
|
26
27
|
u("useTripManagement", () => {
|
|
27
|
-
T.mocked(
|
|
28
|
+
T.mocked(d.get).mockImplementation((t, r) => {
|
|
28
29
|
var a, l;
|
|
29
|
-
return t ===
|
|
30
|
+
return t === c.UNCATEGORISED_BOOKINGS ? Promise.resolve({
|
|
30
31
|
data: y
|
|
31
32
|
}) : ((a = r == null ? void 0 : r.params) == null ? void 0 : a.status) === "past" ? Promise.resolve({
|
|
32
33
|
data: { ...B, data: g.past }
|
|
33
34
|
}) : ((l = r == null ? void 0 : r.params) == null ? void 0 : l.status) === "upcoming" ? Promise.resolve({
|
|
34
35
|
data: { ...b, data: g.upcoming }
|
|
35
36
|
}) : Promise.resolve({ data: {} });
|
|
36
|
-
}), T.mocked(
|
|
37
|
-
if (t === `${
|
|
37
|
+
}), T.mocked(d.put).mockImplementation((t) => {
|
|
38
|
+
if (t === `${c.TRIPS}/67fd23bc3a7cbcd0a8757cdc`) {
|
|
38
39
|
const r = {
|
|
39
40
|
...k.data,
|
|
40
41
|
name: "Updated Trip"
|
|
@@ -47,7 +48,7 @@ u("useTripManagement", () => {
|
|
|
47
48
|
data: k
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
|
-
return t ===
|
|
51
|
+
return t === c.ADD_BOOKING ? Promise.resolve({
|
|
51
52
|
data: { success: !0, message: "Booking added to trip successfully" }
|
|
52
53
|
}) : Promise.resolve({ data: {} });
|
|
53
54
|
}), D(() => {
|
|
@@ -82,18 +83,19 @@ u("useTripManagement", () => {
|
|
|
82
83
|
name: l.carriers.operating[0]
|
|
83
84
|
})),
|
|
84
85
|
arrival: {
|
|
85
|
-
airportCode: a.slices
|
|
86
|
+
airportCode: a.slices.getLast().destination,
|
|
86
87
|
location: ""
|
|
87
88
|
},
|
|
88
89
|
departure: {
|
|
89
|
-
airportCode: a.slices.
|
|
90
|
+
airportCode: a.slices[0].origin,
|
|
90
91
|
location: ""
|
|
91
92
|
},
|
|
92
93
|
class: a.slices[0].fare_brand_name,
|
|
93
94
|
passengers: a.passengers.length,
|
|
94
95
|
hasAirlineChanges: !1,
|
|
95
96
|
orderId: a.order_id,
|
|
96
|
-
type: a.type
|
|
97
|
+
type: a.type,
|
|
98
|
+
cancelledAt: a.cancelled_at
|
|
97
99
|
});
|
|
98
100
|
});
|
|
99
101
|
}), s("Has correct hotel booking structure", async () => {
|
|
@@ -140,8 +142,8 @@ u("useTripManagement", () => {
|
|
|
140
142
|
endDate: p().add(2, "days").format("YYYY-MM-DD")
|
|
141
143
|
}, { result: r } = o(() => n());
|
|
142
144
|
r.current.createTrip(t), await i(() => {
|
|
143
|
-
e(
|
|
144
|
-
|
|
145
|
+
e(d.post).toHaveBeenCalledWith(
|
|
146
|
+
c.TRIPS,
|
|
145
147
|
e.objectContaining({
|
|
146
148
|
name: t.name,
|
|
147
149
|
start_date: t.startDate,
|
|
@@ -154,8 +156,8 @@ u("useTripManagement", () => {
|
|
|
154
156
|
s("Can successfully delete a trip", async () => {
|
|
155
157
|
const t = "12345", { result: r } = o(() => n());
|
|
156
158
|
r.current.deleteTrip(t), await i(() => {
|
|
157
|
-
e(
|
|
158
|
-
`${
|
|
159
|
+
e(d.delete).toHaveBeenCalledWith(
|
|
160
|
+
`${c.TRIPS}/${t}`
|
|
159
161
|
);
|
|
160
162
|
});
|
|
161
163
|
});
|
|
@@ -192,8 +194,8 @@ u("useTripManagement", () => {
|
|
|
192
194
|
name: "Updated Trip"
|
|
193
195
|
}
|
|
194
196
|
}), await i(() => {
|
|
195
|
-
e(
|
|
196
|
-
`${
|
|
197
|
+
e(d.put).toHaveBeenCalledWith(
|
|
198
|
+
`${c.TRIPS}/${r}`,
|
|
197
199
|
e.objectContaining({
|
|
198
200
|
name: "Updated Trip"
|
|
199
201
|
})
|
|
@@ -227,8 +229,8 @@ u("useTripManagement", () => {
|
|
|
227
229
|
tripId: a.id,
|
|
228
230
|
booking: r
|
|
229
231
|
}), await i(() => {
|
|
230
|
-
e(
|
|
231
|
-
|
|
232
|
+
e(d.put).toHaveBeenCalledWith(
|
|
233
|
+
c.ADD_BOOKING,
|
|
232
234
|
e.objectContaining({
|
|
233
235
|
trip_id: a.id,
|
|
234
236
|
booking_id: r.id,
|
|
@@ -242,8 +244,8 @@ u("useTripManagement", () => {
|
|
|
242
244
|
tripId: a.id,
|
|
243
245
|
booking: r
|
|
244
246
|
}), await i(() => {
|
|
245
|
-
e(
|
|
246
|
-
|
|
247
|
+
e(d.put).toHaveBeenCalledWith(
|
|
248
|
+
c.ADD_BOOKING,
|
|
247
249
|
e.objectContaining({
|
|
248
250
|
trip_id: a.id,
|
|
249
251
|
booking_id: r.id,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useQuery as n, useMutation as i } from "@tanstack/react-query";
|
|
2
|
-
import "../../arrayExtensions
|
|
3
|
-
import { E as t, b as u } from "../../AccountService-
|
|
2
|
+
import "../../arrayExtensions--Llcg40q.js";
|
|
3
|
+
import { E as t, b as u } from "../../AccountService-CPWv4uJS.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
6
|
import { awayzClient as s } from "../../configs/awayzClient.js";
|
|
@@ -12,9 +12,10 @@ import "react-i18next";
|
|
|
12
12
|
/* empty css */
|
|
13
13
|
import { useAwayzContext as w } from "../useAwayzContext.js";
|
|
14
14
|
import "../../context/AwayzContext.js";
|
|
15
|
+
import "../../currency-symbol-map-RM3-TVyB.js";
|
|
15
16
|
import "../../services/noRetryInstance.js";
|
|
16
17
|
import { WalletService as o } from "../../services/wallet/WalletService.js";
|
|
17
|
-
const
|
|
18
|
+
const W = () => {
|
|
18
19
|
const { user: r } = w(), { data: e } = n({
|
|
19
20
|
queryKey: [t.PROGRAMS],
|
|
20
21
|
queryFn: o.getAwards,
|
|
@@ -51,7 +52,7 @@ const I = () => {
|
|
|
51
52
|
queryKey: [t.LINKED_USER_PROGRAMS]
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
|
-
}), { mutate:
|
|
55
|
+
}), { mutate: p } = i({
|
|
55
56
|
mutationFn: async (a) => {
|
|
56
57
|
await o.removeAwardProgram(a);
|
|
57
58
|
},
|
|
@@ -60,7 +61,7 @@ const I = () => {
|
|
|
60
61
|
queryKey: [t.LINKED_USER_PROGRAMS]
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
|
-
}), { mutate:
|
|
64
|
+
}), { mutate: P } = i({
|
|
64
65
|
mutationFn: async (a) => {
|
|
65
66
|
const { mainProgram: m, awardsAmount: d } = a, c = e == null ? void 0 : e.find(
|
|
66
67
|
(C) => C.mainProgram === m
|
|
@@ -111,9 +112,9 @@ const I = () => {
|
|
|
111
112
|
bankPrograms: (e == null ? void 0 : e.filter(
|
|
112
113
|
(a) => a.category.includes(u.BANK)
|
|
113
114
|
)) || [],
|
|
114
|
-
updatePoints:
|
|
115
|
+
updatePoints: P,
|
|
115
116
|
addAwardProgram: S,
|
|
116
|
-
removeAwardProgram:
|
|
117
|
+
removeAwardProgram: p,
|
|
117
118
|
// Car Management
|
|
118
119
|
banks: R || [],
|
|
119
120
|
allCards: g || [],
|
|
@@ -123,5 +124,5 @@ const I = () => {
|
|
|
123
124
|
};
|
|
124
125
|
};
|
|
125
126
|
export {
|
|
126
|
-
|
|
127
|
+
W as useWallet
|
|
127
128
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EWalletEndpoints as r } from "../../configs/endpoints.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "@tanstack/react-query";
|
|
4
|
-
import "../../arrayExtensions
|
|
4
|
+
import "../../arrayExtensions--Llcg40q.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { c as l } from "../../AccountService-
|
|
6
|
+
import { c as l } from "../../AccountService-CPWv4uJS.js";
|
|
7
7
|
import "../../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 */
|
|
9
9
|
/* empty css */
|
|
@@ -13,6 +13,7 @@ import "react-i18next";
|
|
|
13
13
|
/* empty css */
|
|
14
14
|
import "../../context/AwayzContext.js";
|
|
15
15
|
import { useWallet as t } from "./useWallet.js";
|
|
16
|
+
import "../../currency-symbol-map-RM3-TVyB.js";
|
|
16
17
|
import "../../services/noRetryInstance.js";
|
|
17
18
|
import { renderHook as s, waitFor as i } from "../../tests/TestWrapper.js";
|
|
18
19
|
import { d as m, v as c, b as p, t as n, g as o } from "../../vi.ClIskdbk-k6t29WRA.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as p from "react";
|
|
2
2
|
import { useLayoutEffect as qt, useEffect as Kt } from "react";
|
|
3
3
|
import { jsx as Xt } from "react/jsx-runtime";
|
|
4
|
-
import { r as Gt } from "./index-
|
|
4
|
+
import { r as Gt } from "./index-B7QVGqcx.js";
|
|
5
5
|
function en(t, e, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
6
6
|
return function(i) {
|
|
7
7
|
if (t == null || t(i), n === !1 || !i.defaultPrevented)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IAwayzConfig } from '../configs/awayzConfig';
|
|
2
2
|
import { IRegion, IResendVerificationEmailParams, IUser } from '../services/account/AccountServices.types';
|
|
3
|
+
import { ISupportedCurrency } from '../services/currency/CurrencyService.types';
|
|
3
4
|
import { ISignInParams, ISignUpParams, TAuthResponse } from '../types/auth';
|
|
4
5
|
export interface IAwayzContext {
|
|
5
6
|
config?: IAwayzConfig;
|
|
@@ -8,6 +9,7 @@ export interface IAwayzContext {
|
|
|
8
9
|
isAuthenticated: boolean;
|
|
9
10
|
isAuthenticating: boolean;
|
|
10
11
|
supportedRegions: IRegion[];
|
|
12
|
+
supportedCurrencies: ISupportedCurrency[];
|
|
11
13
|
signIn: (params: ISignInParams) => Promise<TAuthResponse>;
|
|
12
14
|
signUp: (params: ISignUpParams) => Promise<TAuthResponse>;
|
|
13
15
|
signOut: () => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IAuthData, IRegion, IResendVerificationEmailParams, IUser } from '../../services/account/AccountServices.types';
|
|
2
|
+
import { ISupportedCurrency } from '../../services/currency/CurrencyService.types';
|
|
2
3
|
import { ISignInParams, ISignUpParams } from '../../types/auth';
|
|
3
4
|
import { TEmbeddedAuthOptions } from './useAwayzAuth.types';
|
|
4
5
|
declare enum ETokenType {
|
|
@@ -12,6 +13,7 @@ export declare const useAwayzAuth: (options: TEmbeddedAuthOptions) => {
|
|
|
12
13
|
token: string | undefined;
|
|
13
14
|
user: IUser | undefined;
|
|
14
15
|
supportedRegions: IRegion[];
|
|
16
|
+
supportedCurrencies: ISupportedCurrency[];
|
|
15
17
|
signIn: (params: ISignInParams) => Promise<{
|
|
16
18
|
success: boolean;
|
|
17
19
|
data: IAuthData;
|
package/dist/main.js
CHANGED
|
@@ -1,47 +1,44 @@
|
|
|
1
|
-
import { CashValue as
|
|
2
|
-
import { EInvalidAmountDisplayOption as
|
|
3
|
-
import { Card as
|
|
1
|
+
import { CashValue as r } from "./components/CashValue/CashValue.js";
|
|
2
|
+
import { EInvalidAmountDisplayOption as p, EToolTipPosition as a } from "./components/CashValue/CashValueTypes.js";
|
|
3
|
+
import { Card as n } from "./components/Wallet/Card/Card.js";
|
|
4
4
|
import { FlightBooking as f } from "./components/Bookings/FlightBooking/FlightBooking.js";
|
|
5
|
-
import { HotelBooking as
|
|
5
|
+
import { HotelBooking as s } from "./components/Bookings/HotelBooking/HotelBooking.js";
|
|
6
6
|
import { awayzClient as c } from "./configs/awayzClient.js";
|
|
7
|
-
import { defaultAwayzConfig as
|
|
8
|
-
import { useAwayzContext as
|
|
7
|
+
import { defaultAwayzConfig as g } from "./configs/defaultAwayzConfig.js";
|
|
8
|
+
import { useAwayzContext as w } from "./hooks/useAwayzContext.js";
|
|
9
9
|
import { useBookingManagement as d } from "./hooks/useBookingManagement/useBookingManagement.js";
|
|
10
10
|
import { useSearchLimit as B } from "./hooks/useSearchLimit.js";
|
|
11
|
-
import { useTripManagement as
|
|
12
|
-
import { useWallet as
|
|
13
|
-
import { AwayzProvider as
|
|
14
|
-
import { c as
|
|
15
|
-
import { clientNoRetryInstance as
|
|
16
|
-
import { CurrencyService as
|
|
17
|
-
import { EBookingType as
|
|
18
|
-
import { RewardsService as
|
|
19
|
-
import { EAuthFlow as
|
|
20
|
-
import {
|
|
21
|
-
import { getBaseUrl as G } from "./configs/baseUrl.js";
|
|
11
|
+
import { useTripManagement as k } from "./hooks/useTripManagement/useTripManagement.js";
|
|
12
|
+
import { useWallet as z } from "./hooks/useWallet/useWallet.js";
|
|
13
|
+
import { AwayzProvider as T } from "./providers/AwayzProvider.js";
|
|
14
|
+
import { c as S, i as F } from "./AccountService-CPWv4uJS.js";
|
|
15
|
+
import { clientNoRetryInstance as P } from "./services/noRetryInstance.js";
|
|
16
|
+
import { CurrencyService as D } from "./services/currency/CurrencyService.js";
|
|
17
|
+
import { EBookingType as L } from "./services/trips/TripService.types.js";
|
|
18
|
+
import { RewardsService as O } from "./services/rewards/RewardsService.js";
|
|
19
|
+
import { EAuthFlow as V } from "./types/EAuthFlow.js";
|
|
20
|
+
import { getBaseUrl as b } from "./configs/baseUrl.js";
|
|
22
21
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
p as EToolTipPosition,
|
|
22
|
+
T as AwayzProvider,
|
|
23
|
+
n as Card,
|
|
24
|
+
r as CashValue,
|
|
25
|
+
D as CurrencyService,
|
|
26
|
+
V as EAuthFlow,
|
|
27
|
+
L as EBookingType,
|
|
28
|
+
p as EInvalidAmountDisplayOption,
|
|
29
|
+
a as EToolTipPosition,
|
|
32
30
|
f as FlightBooking,
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
s as HotelBooking,
|
|
32
|
+
O as RewardsService,
|
|
35
33
|
c as awayzClient,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
G as getBaseUrl,
|
|
34
|
+
S as clientInstance,
|
|
35
|
+
P as clientNoRetryInstance,
|
|
36
|
+
g as defaultAwayzConfig,
|
|
37
|
+
b as getBaseUrl,
|
|
41
38
|
F as instance,
|
|
42
|
-
|
|
39
|
+
w as useAwayzContext,
|
|
43
40
|
d as useBookingManagement,
|
|
44
41
|
B as useSearchLimit,
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
k as useTripManagement,
|
|
43
|
+
z as useWallet
|
|
47
44
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as m } from "react";
|
|
3
3
|
import { AwayzContext as a } from "../context/AwayzContext.js";
|
|
4
|
-
import "../arrayExtensions
|
|
4
|
+
import "../arrayExtensions--Llcg40q.js";
|
|
5
5
|
import { a as r } from "../keys-D66VvSIm.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-
|
|
9
|
+
import "../AccountService-CPWv4uJS.js";
|
|
10
10
|
import { awayzClient as d } from "../configs/awayzClient.js";
|
|
11
11
|
import '../assets/_styles4.css';import '../assets/_styles3.css';import '../assets/_styles2.css';import '../assets/_styles.css';import '../assets/_styles5.css';/* empty css */
|
|
12
12
|
/* empty css */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../arrayExtensions
|
|
2
|
-
import { A as e } from "../../AccountService-
|
|
1
|
+
import "../../arrayExtensions--Llcg40q.js";
|
|
2
|
+
import { A as e } from "../../AccountService-CPWv4uJS.js";
|
|
3
3
|
import "../../keys-D66VvSIm.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "../../configs/endpoints.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
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
|
-
import "../../arrayExtensions
|
|
5
|
-
import { c, a as l } from "../../AccountService-
|
|
4
|
+
import "../../arrayExtensions--Llcg40q.js";
|
|
5
|
+
import { c, a as l } from "../../AccountService-CPWv4uJS.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { EBookingEndpoints as d } from "../../configs/endpoints.js";
|
|
8
8
|
const p = (n) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles5.css';var y = Object.defineProperty;
|
|
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
|
-
import "../../arrayExtensions
|
|
5
|
-
import { A as C, E, c as s } from "../../AccountService-
|
|
4
|
+
import "../../arrayExtensions--Llcg40q.js";
|
|
5
|
+
import { A as C, E, c as s } from "../../AccountService-CPWv4uJS.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { ECurrencyEndpoints as i } from "../../configs/endpoints.js";
|
|
8
8
|
import "react/jsx-runtime";
|
|
@@ -15,6 +15,7 @@ import "react-i18next";
|
|
|
15
15
|
/* empty css */
|
|
16
16
|
import { awayzClient as _ } from "../../configs/awayzClient.js";
|
|
17
17
|
import "../../context/AwayzContext.js";
|
|
18
|
+
import "../../currency-symbol-map-RM3-TVyB.js";
|
|
18
19
|
import "../noRetryInstance.js";
|
|
19
20
|
class d {
|
|
20
21
|
constructor() {
|
|
@@ -68,7 +69,7 @@ class d {
|
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
|
-
const
|
|
72
|
+
const Q = new d();
|
|
72
73
|
export {
|
|
73
|
-
|
|
74
|
+
Q as CurrencyService
|
|
74
75
|
};
|
package/dist/services/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as o, i as t } from "../AccountService-
|
|
1
|
+
import { c as o, i as t } from "../AccountService-CPWv4uJS.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
|
-
import "../arrayExtensions
|
|
1
|
+
import "../arrayExtensions--Llcg40q.js";
|
|
2
2
|
import "../keys-D66VvSIm.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { c as p, i as a } from "../AccountService-
|
|
4
|
+
import { c as p, i as a } from "../AccountService-CPWv4uJS.js";
|
|
5
5
|
import "../configs/baseUrl.js";
|
|
6
6
|
export {
|
|
7
7
|
p as clientInstance,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l, j as m, k as g, g as h, h as u, p as d } from "../AccountService-
|
|
1
|
+
import { l, j as m, k as g, g as h, h as u, p as d } from "../AccountService-CPWv4uJS.js";
|
|
2
2
|
import "../configs/baseUrl.js";
|
|
3
|
-
import "../arrayExtensions
|
|
3
|
+
import "../arrayExtensions--Llcg40q.js";
|
|
4
4
|
import "../keys-D66VvSIm.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "../configs/endpoints.js";
|
|
@@ -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-
|
|
5
|
+
import { c as i } from "../../AccountService-CPWv4uJS.js";
|
|
6
6
|
class E {
|
|
7
7
|
constructor() {
|
|
8
8
|
n(this, "setCurrency", async (e) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var s = Object.defineProperty;
|
|
2
2
|
var n = (a, e, t) => e in a ? s(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
3
|
var r = (a, e, t) => n(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import "../../arrayExtensions
|
|
5
|
-
import { c as o, a as c } from "../../AccountService-
|
|
4
|
+
import "../../arrayExtensions--Llcg40q.js";
|
|
5
|
+
import { c as o, a as c } from "../../AccountService-CPWv4uJS.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { ERewardsEndpoints as i } from "../../configs/endpoints.js";
|
|
8
8
|
class m {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../../arrayExtensions
|
|
2
|
-
import "../../AccountService-
|
|
3
|
-
import { T as s } from "../../TripsService-
|
|
1
|
+
import "../../arrayExtensions--Llcg40q.js";
|
|
2
|
+
import "../../AccountService-CPWv4uJS.js";
|
|
3
|
+
import { T as s } from "../../TripsService-CCdhF5uK.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "../../configs/endpoints.js";
|
|
6
6
|
import "./TripService.types.js";
|