@odynn/awayz-core 0.9.34 → 0.10.0
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/{TripsService-k5PnDpcP.js → TripsService-fNtCUyxa.js} +1 -1
- package/dist/assets/_styles.css +1 -1
- package/dist/assets/_styles2.css +1 -1
- package/dist/assets/_styles3.css +1 -1
- package/dist/assets/_styles4.css +1 -1
- package/dist/assets/_styles5.css +1 -1
- package/dist/assets/_styles6.css +1 -1
- package/dist/components/Bookings/FlightBooking/FlightBooking.js +4 -3
- package/dist/components/Bookings/HotelBooking/HotelBooking.js +30 -22
- package/dist/components/CashValue/CashValue.js +3 -3
- package/dist/components/CashValue/CashValue.stories.js +3 -3
- package/dist/components/ClientPointsValue/ClientPointsValue.js +3 -3
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Wallet/Card/Card.js +1 -1
- package/dist/components/Wallet/Card/Card.stories.js +3 -3
- package/dist/hooks/index.js +4 -2
- package/dist/hooks/useAwayzAuth/useAwayzAuth.js +10 -9
- package/dist/hooks/useBookingManagement/useBookingManagement.js +100 -87
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +17 -16
- package/dist/hooks/useBookingManagement/useBookingManagement.types.js +4 -1
- package/dist/hooks/useFeatureFlags.js +1 -1
- package/dist/hooks/useSearchLimit.js +1 -1
- package/dist/hooks/useTripManagement/useTripManagement.js +4 -4
- package/dist/hooks/useTripManagement/useTripManagement.test.js +4 -4
- package/dist/hooks/useWallet/useWallet.js +3 -3
- package/dist/hooks/useWallet/useWallet.test.js +3 -3
- package/dist/keys-BcBfU51M.js +5 -0
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/useBookingManagement/useBookingManagement.types.d.ts +29 -8
- package/dist/lib/services/bookings/BookingService.types.d.ts +16 -0
- package/dist/main.js +28 -26
- package/dist/{noRetryInstance-Bit3xLkY.js → noRetryInstance-C4bqpBc7.js} +17 -16
- package/dist/providers/AwayzProvider.js +6 -5
- package/dist/services/account/AccountService.js +2 -2
- package/dist/services/bookings/BookingService.js +69 -60
- package/dist/services/currency/CurrencyService.js +3 -3
- package/dist/services/features/featureService.js +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/instance.js +2 -2
- package/dist/services/instanceConfig.js +11 -10
- package/dist/services/noRetryInstance.js +1 -1
- package/dist/services/preferences/PreferencesService.js +1 -1
- package/dist/services/rewards/RewardsService.js +1 -1
- package/dist/services/trips/TripsService.js +2 -2
- package/dist/services/wallet/WalletService.js +1 -1
- package/dist/utils/clientPoints.js +3 -3
- package/package.json +1 -1
- package/dist/_styles.flight-booking-CaUgKcMC.js +0 -5
|
@@ -4,3 +4,4 @@ import { useSearchLimit } from './useSearchLimit';
|
|
|
4
4
|
import { useTripManagement } from './useTripManagement/useTripManagement';
|
|
5
5
|
import { useWallet } from './useWallet/useWallet';
|
|
6
6
|
export { useAwayzContext, useBookingManagement, useSearchLimit, useTripManagement, useWallet };
|
|
7
|
+
export { ECancelStatus } from './useBookingManagement/useBookingManagement.types';
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { IFlightBookingDetails, IHotelBookingDetails, IPointsAsCash } from '../../services/bookings/BookingService.types';
|
|
2
|
+
export declare enum ECancelStatus {
|
|
3
|
+
IDLE = "idle",
|
|
4
|
+
PENDING = "pending",
|
|
5
|
+
SUCCESS = "success",
|
|
6
|
+
/** Booking was cancelled but the points refund step failed */
|
|
7
|
+
POINTS_REFUND_FAILED = "points_refund_failed",
|
|
8
|
+
CANCEL_FAILED = "cancel_failed"
|
|
9
|
+
}
|
|
2
10
|
export interface IUseBookingManagement {
|
|
3
11
|
/**
|
|
4
12
|
* The booking details, which can be either hotel or flight booking details
|
|
@@ -39,26 +47,39 @@ export interface IUseBookingManagement {
|
|
|
39
47
|
*/
|
|
40
48
|
cancelBooking: () => void;
|
|
41
49
|
/**
|
|
42
|
-
*
|
|
50
|
+
* The current status of the cancellation flow.
|
|
51
|
+
* Transitions: IDLE → PENDING → SUCCESS | CANCEL_FAILED | POINTS_REFUND_FAILED
|
|
43
52
|
*/
|
|
44
|
-
|
|
53
|
+
cancelStatus: ECancelStatus;
|
|
54
|
+
/**
|
|
55
|
+
* Resets cancelStatus back to IDLE. Call this when the consumer has finished
|
|
56
|
+
* handling the terminal state (e.g. when the cancel modal is dismissed).
|
|
57
|
+
*/
|
|
58
|
+
resetCancelStatus: () => void;
|
|
59
|
+
/**
|
|
60
|
+
* The error object if cancelStatus is CANCEL_FAILED (booking cancellation failed)
|
|
61
|
+
*/
|
|
62
|
+
cancelBookingError: Error | null;
|
|
63
|
+
/**
|
|
64
|
+
* The error object if cancelStatus is POINTS_REFUND_FAILED (points refund step failed)
|
|
65
|
+
*/
|
|
66
|
+
pointsRefundError: Error | null;
|
|
45
67
|
/**
|
|
46
68
|
* Indicates if the cancel booking request is pending
|
|
47
69
|
*/
|
|
48
70
|
isCancellingBooking: boolean;
|
|
49
71
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @deprecated Use `isCancellingBooking` instead
|
|
72
|
+
* @deprecated Use `isCancellingBooking` instead (fixed spelling)
|
|
52
73
|
*/
|
|
53
74
|
isCancelingBooking: boolean;
|
|
54
75
|
/**
|
|
55
|
-
*
|
|
76
|
+
* @deprecated Use `cancelStatus === ECancelStatus.SUCCESS` instead
|
|
56
77
|
*/
|
|
57
|
-
|
|
78
|
+
isCancelBookingSuccess: boolean;
|
|
58
79
|
/**
|
|
59
|
-
*
|
|
80
|
+
* @deprecated Use `cancelStatus === ECancelStatus.CANCEL_FAILED` instead
|
|
60
81
|
*/
|
|
61
|
-
|
|
82
|
+
isCancelBookingError: boolean;
|
|
62
83
|
/**
|
|
63
84
|
* Function to handle airline initiated changes
|
|
64
85
|
* This is **ONLY** used for flight bookings
|
|
@@ -50,6 +50,14 @@ export interface IBed {
|
|
|
50
50
|
type: string;
|
|
51
51
|
count: number;
|
|
52
52
|
}
|
|
53
|
+
export interface IPointsAsCashRefund {
|
|
54
|
+
pointsRefunded: number;
|
|
55
|
+
cashRefunded: {
|
|
56
|
+
amount: number;
|
|
57
|
+
currency: string;
|
|
58
|
+
};
|
|
59
|
+
refundPercentage: number;
|
|
60
|
+
}
|
|
53
61
|
export interface IPointsAsCash {
|
|
54
62
|
authCode: string;
|
|
55
63
|
points: number;
|
|
@@ -60,6 +68,7 @@ export interface IPointsAsCash {
|
|
|
60
68
|
amount: number;
|
|
61
69
|
currency: string;
|
|
62
70
|
};
|
|
71
|
+
refund?: IPointsAsCashRefund;
|
|
63
72
|
statusHistory: {
|
|
64
73
|
status: string;
|
|
65
74
|
timestamp: string;
|
|
@@ -81,6 +90,12 @@ export interface IFlightConditions {
|
|
|
81
90
|
refundBeforeDeparture: IFlightConditionDetails;
|
|
82
91
|
changeBeforeDeparture: IFlightConditionDetails;
|
|
83
92
|
}
|
|
93
|
+
export interface IFlightCancellationDetails {
|
|
94
|
+
refundAmount: number;
|
|
95
|
+
refundCurrency: string;
|
|
96
|
+
refundTo: string;
|
|
97
|
+
confirmedAt: string;
|
|
98
|
+
}
|
|
84
99
|
export interface IFlightBookingDetails {
|
|
85
100
|
id: string;
|
|
86
101
|
flightOfferId: string;
|
|
@@ -92,6 +107,7 @@ export interface IFlightBookingDetails {
|
|
|
92
107
|
currency: string;
|
|
93
108
|
status: string;
|
|
94
109
|
cancelledAt?: string;
|
|
110
|
+
cancellationDetails?: IFlightCancellationDetails;
|
|
95
111
|
conditions: IFlightConditions;
|
|
96
112
|
class: string;
|
|
97
113
|
passengers: {
|
package/dist/main.js
CHANGED
|
@@ -11,45 +11,47 @@ import { useBookingManagement as B } from "./hooks/useBookingManagement/useBooki
|
|
|
11
11
|
import { useSearchLimit as d } from "./hooks/useSearchLimit.js";
|
|
12
12
|
import { ETripStatus as A, useTripManagement as T } from "./hooks/useTripManagement/useTripManagement.js";
|
|
13
13
|
import { useWallet as P } from "./hooks/useWallet/useWallet.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
14
|
+
import { ECancelStatus as z } from "./hooks/useBookingManagement/useBookingManagement.types.js";
|
|
15
|
+
import { AwayzProvider as D } from "./providers/AwayzProvider.js";
|
|
16
|
+
import { CurrencyService as O } from "./services/currency/CurrencyService.js";
|
|
17
|
+
import { c as V, a as H, g as L, i as N } from "./noRetryInstance-C4bqpBc7.js";
|
|
18
|
+
import { RewardsService as W } from "./services/rewards/RewardsService.js";
|
|
19
|
+
import { EBookingType as j } from "./services/trips/TripService.types.js";
|
|
20
|
+
import { EAuthFlow as G } from "./types/EAuthFlow.js";
|
|
21
|
+
import { convertCashToClientPoints as K } from "./utils/clientPoints.js";
|
|
22
|
+
import { getCurrency as X } from "./utils/currency.js";
|
|
23
|
+
import { EAmountsDisplayFeature as Z, EBookingPaymentMethod as _, EFlightBookingOptionsDisplayFeature as $, useFeatureFlags as oo } from "./hooks/useFeatureFlags.js";
|
|
24
|
+
import { getBaseUrl as ro } from "./configs/baseUrl.js";
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
D as AwayzProvider,
|
|
26
27
|
u as Card,
|
|
27
28
|
i as CashValue,
|
|
28
29
|
x as ClientPointsValue,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
O as CurrencyService,
|
|
31
|
+
Z as EAmountsDisplayFeature,
|
|
32
|
+
G as EAuthFlow,
|
|
33
|
+
_ as EBookingPaymentMethod,
|
|
34
|
+
j as EBookingType,
|
|
35
|
+
z as ECancelStatus,
|
|
36
|
+
$ as EFlightBookingOptionsDisplayFeature,
|
|
35
37
|
m as EInvalidAmountDisplayOption,
|
|
36
38
|
s as EToolTipPosition,
|
|
37
39
|
A as ETripStatus,
|
|
38
40
|
r as FlightBooking,
|
|
39
41
|
a as HotelBooking,
|
|
40
|
-
|
|
42
|
+
W as RewardsService,
|
|
41
43
|
c as awayzClient,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
V as clientInstance,
|
|
45
|
+
H as clientNoRetryInstance,
|
|
46
|
+
K as convertCashToClientPoints,
|
|
45
47
|
C as defaultAwayzConfig,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
L as gatewayInstance,
|
|
49
|
+
ro as getBaseUrl,
|
|
50
|
+
X as getCurrency,
|
|
51
|
+
N as instance,
|
|
50
52
|
h as useAwayzContext,
|
|
51
53
|
B as useBookingManagement,
|
|
52
|
-
|
|
54
|
+
oo as useFeatureFlags,
|
|
53
55
|
d as useSearchLimit,
|
|
54
56
|
T as useTripManagement,
|
|
55
57
|
P as useWallet
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import './assets/
|
|
1
|
+
import './assets/_styles4.css';import './assets/_styles6.css';import './assets/_styles5.css';import './assets/_styles2.css';import './assets/_styles.css';import './assets/_styles3.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 I = (e, t, n) => ht(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import "./arrayExtensions-DlcBOj5a.js";
|
|
5
|
-
import { a as U } from "./
|
|
5
|
+
import { a as U } from "./keys-BcBfU51M.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";
|
|
@@ -11,6 +11,7 @@ import "@tanstack/react-query";
|
|
|
11
11
|
import "react/jsx-runtime";
|
|
12
12
|
import "react-i18next";
|
|
13
13
|
/* empty css */
|
|
14
|
+
/* empty css */
|
|
14
15
|
/* empty css */
|
|
15
16
|
import { awayzClient as $ } from "./configs/awayzClient.js";
|
|
16
17
|
/* empty css */
|
|
@@ -1715,22 +1716,22 @@ g.getAdapter = at.getAdapter;
|
|
|
1715
1716
|
g.HttpStatusCode = Ee;
|
|
1716
1717
|
g.default = g;
|
|
1717
1718
|
const {
|
|
1718
|
-
Axios:
|
|
1719
|
+
Axios: Pr,
|
|
1719
1720
|
AxiosError: Zn,
|
|
1720
|
-
CanceledError:
|
|
1721
|
-
isCancel:
|
|
1722
|
-
CancelToken:
|
|
1723
|
-
VERSION:
|
|
1724
|
-
all:
|
|
1725
|
-
Cancel:
|
|
1726
|
-
isAxiosError:
|
|
1727
|
-
spread:
|
|
1728
|
-
toFormData:
|
|
1729
|
-
AxiosHeaders:
|
|
1721
|
+
CanceledError: kr,
|
|
1722
|
+
isCancel: Fr,
|
|
1723
|
+
CancelToken: Dr,
|
|
1724
|
+
VERSION: Br,
|
|
1725
|
+
all: qr,
|
|
1726
|
+
Cancel: Hr,
|
|
1727
|
+
isAxiosError: Mr,
|
|
1728
|
+
spread: jr,
|
|
1729
|
+
toFormData: zr,
|
|
1730
|
+
AxiosHeaders: Gr,
|
|
1730
1731
|
HttpStatusCode: F,
|
|
1731
|
-
formToJSON:
|
|
1732
|
-
getAdapter:
|
|
1733
|
-
mergeConfig:
|
|
1732
|
+
formToJSON: $r,
|
|
1733
|
+
getAdapter: Kr,
|
|
1734
|
+
mergeConfig: Vr
|
|
1734
1735
|
} = g, ft = (e) => (e.baseURL = He(), e.headers.Authorization = localStorage.getItem(U.TOKEN), e.headers["client-id"] = localStorage.getItem(U.CLIENT_ID), e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e }), Qn = (e) => (e.baseURL = mt(), e.headers.Authorization = localStorage.getItem(U.TOKEN), e.headers["client-id"] = localStorage.getItem(U.CLIENT_ID), e.headers["Api-Version"] = "1.0", e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e }), De = (e, t, n) => {
|
|
1735
1736
|
for (const r of e)
|
|
1736
1737
|
t ? r.rej(t) : r.res(n);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { QueryClientProvider as l } from "@tanstack/react-query";
|
|
3
3
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
4
|
-
import { a as r } from "../
|
|
4
|
+
import { a as r } from "../keys-BcBfU51M.js";
|
|
5
5
|
import { useEffect as i } from "react";
|
|
6
6
|
import { setCustomBaseUrl as u, setBaseUrl as d } from "../configs/baseUrl.js";
|
|
7
7
|
import { defaultAwayzConfig as p } from "../configs/defaultAwayzConfig.js";
|
|
@@ -9,16 +9,17 @@ import { setGatewayBaseUrl as h } from "../configs/gatewayBaseUrl.js";
|
|
|
9
9
|
import { AwayzContext as w } from "../context/AwayzContext.js";
|
|
10
10
|
import { useAwayzAuth as n } from "../hooks/useAwayzAuth/useAwayzAuth.js";
|
|
11
11
|
import "react-i18next";
|
|
12
|
-
import '../assets/
|
|
12
|
+
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 */
|
|
13
|
+
/* empty css */
|
|
13
14
|
/* empty css */
|
|
14
15
|
import { awayzClient as y } from "../configs/awayzClient.js";
|
|
15
|
-
import "../noRetryInstance-
|
|
16
|
+
import "../noRetryInstance-C4bqpBc7.js";
|
|
16
17
|
/* empty css */
|
|
17
18
|
/* empty css */
|
|
18
19
|
import "../index-Cv-wvFlM.js";
|
|
19
20
|
/* empty css */
|
|
20
21
|
import { useFeatureFlags as A } from "../hooks/useFeatureFlags.js";
|
|
21
|
-
const
|
|
22
|
+
const _ = ({ children: t, config: e }) => /* @__PURE__ */ o(l, { client: y, children: /* @__PURE__ */ o(F, { config: e, children: t }) }), F = ({ children: t, config: e }) => {
|
|
22
23
|
const a = n({
|
|
23
24
|
authFlow: e.authFlow,
|
|
24
25
|
onSuccess: e.onAuthSuccess,
|
|
@@ -49,5 +50,5 @@ const N = ({ children: t, config: e }) => /* @__PURE__ */ o(l, { client: y, chil
|
|
|
49
50
|
);
|
|
50
51
|
};
|
|
51
52
|
export {
|
|
52
|
-
|
|
53
|
+
_ as AwayzProvider
|
|
53
54
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
2
|
-
import { A as e } from "../../noRetryInstance-
|
|
3
|
-
import "../../
|
|
2
|
+
import { A as e } from "../../noRetryInstance-C4bqpBc7.js";
|
|
3
|
+
import "../../keys-BcBfU51M.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "../../configs/awayzClient.js";
|
|
6
6
|
import "../../configs/endpoints.js";
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
var g = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
2
|
+
var f = (c, t, a) => t in c ? g(c, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : c[t] = a;
|
|
3
|
+
var r = (c, t, a) => f(c, typeof t != "symbol" ? t + "" : t, a);
|
|
4
4
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
5
|
-
import { c as
|
|
5
|
+
import { c as l, b as _, g as p } from "../../noRetryInstance-C4bqpBc7.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { EBookingEndpoints as i } from "../../configs/endpoints.js";
|
|
8
|
-
const
|
|
9
|
-
const t = /P((\d+)D)?T((\d+)H)?((\d+)M)?/, a =
|
|
8
|
+
const y = (c) => {
|
|
9
|
+
const t = /P((\d+)D)?T((\d+)H)?((\d+)M)?/, a = c.match(t);
|
|
10
10
|
if (a) {
|
|
11
|
-
const
|
|
12
|
-
return `${
|
|
11
|
+
const n = a[2] ? `${a[2]}d ` : "", d = a[4] ? `${a[4]}h ` : "", s = a[6] ? `${a[6]}m` : "";
|
|
12
|
+
return `${n}${d}${s}`.trim();
|
|
13
13
|
} else
|
|
14
|
-
return
|
|
14
|
+
return c;
|
|
15
15
|
};
|
|
16
16
|
class h {
|
|
17
17
|
constructor() {
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
const { data: a } = await
|
|
18
|
+
r(this, "getHotelBooking", async (t) => {
|
|
19
|
+
var s, e;
|
|
20
|
+
const { data: a } = await l.get(
|
|
21
21
|
`${i.USER_HOTEL_BOOKINGS}/${t}`
|
|
22
|
-
),
|
|
22
|
+
), n = a.data.accommodation.rooms[0].rates[0];
|
|
23
23
|
return {
|
|
24
24
|
id: a.data._id,
|
|
25
25
|
rateId: a.data.rate_id,
|
|
26
26
|
quoteId: a.data.quote_id,
|
|
27
27
|
bookingId: a.data.id,
|
|
28
|
-
totalAmount: parseFloat(
|
|
29
|
-
feeAmount: parseFloat(
|
|
30
|
-
taxAmount: parseFloat(
|
|
31
|
-
baseAmount: parseFloat(
|
|
28
|
+
totalAmount: parseFloat(n.total_amount),
|
|
29
|
+
feeAmount: parseFloat(n.fee_amount),
|
|
30
|
+
taxAmount: parseFloat(n.tax_amount),
|
|
31
|
+
baseAmount: parseFloat(n.base_amount),
|
|
32
32
|
cancelledAt: a.data.cancelled_at,
|
|
33
|
-
totalCurrency:
|
|
34
|
-
baseCurrency:
|
|
35
|
-
feeCurrency:
|
|
36
|
-
taxCurrency:
|
|
33
|
+
totalCurrency: n.total_currency,
|
|
34
|
+
baseCurrency: n.base_currency,
|
|
35
|
+
feeCurrency: n.fee_currency,
|
|
36
|
+
taxCurrency: n.tax_currency,
|
|
37
37
|
status: a.data.status,
|
|
38
38
|
description: a.data.accommodation.description,
|
|
39
39
|
name: a.data.accommodation.name,
|
|
@@ -53,39 +53,40 @@ class h {
|
|
|
53
53
|
latitude: a.data.accommodation.location.geographic_coordinates.latitude,
|
|
54
54
|
longitude: a.data.accommodation.location.geographic_coordinates.longitude
|
|
55
55
|
},
|
|
56
|
-
images: a.data.accommodation.photos.map((
|
|
57
|
-
guests: a.data.guests.map((
|
|
58
|
-
var
|
|
56
|
+
images: a.data.accommodation.photos.map((o) => o.url),
|
|
57
|
+
guests: a.data.guests.map((o, m) => {
|
|
58
|
+
var u;
|
|
59
59
|
return {
|
|
60
|
-
familyName:
|
|
61
|
-
givenName:
|
|
62
|
-
type: (
|
|
60
|
+
familyName: o.family_name,
|
|
61
|
+
givenName: o.given_name,
|
|
62
|
+
type: (u = a.data.guest_types[m]) == null ? void 0 : u.type
|
|
63
63
|
};
|
|
64
64
|
}),
|
|
65
|
-
numberOfRooms: (
|
|
66
|
-
cancellationTimeline:
|
|
67
|
-
(
|
|
68
|
-
refundAmount: parseFloat(
|
|
69
|
-
currency:
|
|
70
|
-
before:
|
|
65
|
+
numberOfRooms: (s = a.data.rooms) == null ? void 0 : s.length,
|
|
66
|
+
cancellationTimeline: n.cancellation_timeline.map(
|
|
67
|
+
(o) => ({
|
|
68
|
+
refundAmount: parseFloat(o.refund_amount),
|
|
69
|
+
currency: o.currency,
|
|
70
|
+
before: o.before
|
|
71
71
|
})
|
|
72
72
|
),
|
|
73
|
-
rooms: (
|
|
73
|
+
rooms: (e = a.data.rooms) == null ? void 0 : e.map((o) => {
|
|
74
74
|
var m;
|
|
75
75
|
return {
|
|
76
|
-
beds: (m =
|
|
77
|
-
type:
|
|
78
|
-
count:
|
|
76
|
+
beds: (m = o.beds) == null ? void 0 : m.map((u) => ({
|
|
77
|
+
type: u.type,
|
|
78
|
+
count: u.count
|
|
79
79
|
})),
|
|
80
|
-
totalAmount: parseFloat(
|
|
81
|
-
name:
|
|
80
|
+
totalAmount: parseFloat(o.total_amount),
|
|
81
|
+
name: o.name
|
|
82
82
|
};
|
|
83
83
|
}),
|
|
84
84
|
createdAt: a.data.created_at
|
|
85
85
|
};
|
|
86
86
|
});
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
r(this, "getFlightBooking", async (t) => {
|
|
88
|
+
var d, s;
|
|
89
|
+
const { data: a } = await l.get(
|
|
89
90
|
`${i.USER_FLIGHT_BOOKINGS}/${t}`
|
|
90
91
|
);
|
|
91
92
|
return {
|
|
@@ -112,11 +113,11 @@ class h {
|
|
|
112
113
|
penaltyCurrency: a.data.conditions.refund_before_departure.penalty_currency
|
|
113
114
|
}
|
|
114
115
|
},
|
|
115
|
-
class: a.data.slices[0].fare_brand_name,
|
|
116
|
+
class: (d = a.data.slices[0]) == null ? void 0 : d.fare_brand_name,
|
|
116
117
|
flightOfferId: a.data.offer_id,
|
|
117
118
|
orderId: a.data.order_id,
|
|
118
119
|
cancelledAt: a.data.cancelled_at,
|
|
119
|
-
airlines: a.data.slices[0].segments.map((e) => ({
|
|
120
|
+
airlines: (((s = a.data.slices[0]) == null ? void 0 : s.segments) ?? []).map((e) => ({
|
|
120
121
|
name: e.operating_carrier.name,
|
|
121
122
|
code: e.operating_carrier.iata_code,
|
|
122
123
|
logo: e.operating_carrier.logo_symbol_url
|
|
@@ -136,49 +137,57 @@ class h {
|
|
|
136
137
|
arrivingAt: e.segments.getLast().arriving_at,
|
|
137
138
|
numberOfStops: e.segments.length - 1,
|
|
138
139
|
reference: a.data.booking_reference,
|
|
139
|
-
durationInMinutes:
|
|
140
|
-
origin:
|
|
141
|
-
destination:
|
|
142
|
-
segments:
|
|
140
|
+
durationInMinutes: y(e.duration),
|
|
141
|
+
origin: _(e.origin),
|
|
142
|
+
destination: _(e.destination),
|
|
143
|
+
segments: _(e.segments)
|
|
143
144
|
})),
|
|
144
145
|
availableActions: a.data.available_actions,
|
|
145
|
-
airlineInitiatedChanges:
|
|
146
|
+
airlineInitiatedChanges: _(a.data.airline_initiated_changes) || [],
|
|
147
|
+
cancellationDetails: a.data.cancellation_details ? {
|
|
148
|
+
refundAmount: parseFloat(
|
|
149
|
+
a.data.cancellation_details.refund_amount
|
|
150
|
+
),
|
|
151
|
+
refundCurrency: a.data.cancellation_details.refund_currency,
|
|
152
|
+
refundTo: a.data.cancellation_details.refund_to,
|
|
153
|
+
confirmedAt: a.data.cancellation_details.confirmed_at
|
|
154
|
+
} : void 0
|
|
146
155
|
};
|
|
147
156
|
});
|
|
148
|
-
|
|
149
|
-
const { data: a } = await
|
|
157
|
+
r(this, "initiateCancelFlightBooking", async (t) => {
|
|
158
|
+
const { data: a } = await l.put(
|
|
150
159
|
`${i.INITIATE_FLIGHT_CANCEL}/${t}`
|
|
151
160
|
);
|
|
152
161
|
return a.success;
|
|
153
162
|
});
|
|
154
|
-
|
|
155
|
-
const { data: a } = await
|
|
163
|
+
r(this, "confirmCancelFlightBooking", async (t) => {
|
|
164
|
+
const { data: a } = await l.put(
|
|
156
165
|
`${i.CONFIRM_FLIGHT_CANCEL}/${t}`
|
|
157
166
|
);
|
|
158
167
|
return a.success;
|
|
159
168
|
});
|
|
160
|
-
|
|
161
|
-
const { data: a } = await
|
|
169
|
+
r(this, "cancelHotelBooking", async (t) => {
|
|
170
|
+
const { data: a } = await l.post(
|
|
162
171
|
`${i.CANCEL_HOTEL_BOOKING}/${t}`
|
|
163
172
|
);
|
|
164
173
|
return a.success;
|
|
165
174
|
});
|
|
166
|
-
|
|
175
|
+
r(this, "actionAirlineChanges", async ({
|
|
167
176
|
bookingId: t,
|
|
168
177
|
acceptChanges: a,
|
|
169
|
-
aicId:
|
|
178
|
+
aicId: n
|
|
170
179
|
}) => {
|
|
171
|
-
const { data:
|
|
180
|
+
const { data: d } = await l.post(
|
|
172
181
|
i.ACTION_AIRLINE_CHANGES,
|
|
173
182
|
{
|
|
174
183
|
booking_id: t,
|
|
175
184
|
action_taken: a ? "accepted" : "cancelled",
|
|
176
|
-
aic_id:
|
|
185
|
+
aic_id: n
|
|
177
186
|
}
|
|
178
187
|
);
|
|
179
|
-
return
|
|
188
|
+
return d.success;
|
|
180
189
|
});
|
|
181
|
-
|
|
190
|
+
r(this, "cancelPointsBooking", async (t) => {
|
|
182
191
|
const { data: a } = await p.post(
|
|
183
192
|
`${i.REFUND_POINTS_BOOKING}`,
|
|
184
193
|
{
|
|
@@ -187,7 +196,7 @@ class h {
|
|
|
187
196
|
);
|
|
188
197
|
return a.success;
|
|
189
198
|
});
|
|
190
|
-
|
|
199
|
+
r(this, "getPointsAsCash", async (t) => {
|
|
191
200
|
const { data: a } = await p.get(
|
|
192
201
|
`${i.BOOKING_POINTS_AS_CASH}/${t}`
|
|
193
202
|
);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import '../../assets/
|
|
1
|
+
import '../../assets/_styles4.css';import '../../assets/_styles6.css';import '../../assets/_styles5.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';import '../../assets/_styles3.css';var f = Object.defineProperty;
|
|
2
2
|
var l = (c, r, t) => r in c ? f(c, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[r] = t;
|
|
3
3
|
var o = (c, r, t) => l(c, typeof r != "symbol" ? r + "" : r, t);
|
|
4
4
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
5
|
-
import { A as i, E as u, c as y } from "../../noRetryInstance-
|
|
5
|
+
import { A as i, E as u, c as y } from "../../noRetryInstance-C4bqpBc7.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { ECurrencyEndpoints as p } from "../../configs/endpoints.js";
|
|
8
8
|
import "react/jsx-runtime";
|
|
9
9
|
import "react-i18next";
|
|
10
10
|
/* empty css */
|
|
11
|
-
|
|
11
|
+
/* empty css */
|
|
12
12
|
/* empty css */
|
|
13
13
|
import "@tanstack/react-query";
|
|
14
14
|
/* empty css */
|
package/dist/services/index.js
CHANGED
|
@@ -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-
|
|
2
|
+
import { c as t, a as o, g as c, i as s } from "../noRetryInstance-C4bqpBc7.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 "../
|
|
2
|
+
import "../keys-BcBfU51M.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { c as r, g as s, i as c } from "../noRetryInstance-
|
|
4
|
+
import { c as r, g as s, i as c } from "../noRetryInstance-C4bqpBc7.js";
|
|
5
5
|
import "../configs/baseUrl.js";
|
|
6
6
|
export {
|
|
7
7
|
r as clientInstance,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
2
|
-
import "../
|
|
2
|
+
import "../keys-BcBfU51M.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { m as
|
|
4
|
+
import { m as j, k, l as q, h as w, j as A, n as D, p as E } from "../noRetryInstance-C4bqpBc7.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
10
|
import "react-i18next";
|
|
11
|
-
import '../assets/
|
|
11
|
+
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 */
|
|
12
|
+
/* empty css */
|
|
12
13
|
/* empty css */
|
|
13
14
|
/* empty css */
|
|
14
15
|
/* empty css */
|
|
@@ -18,11 +19,11 @@ import "../context/AwayzContext.js";
|
|
|
18
19
|
import "../configs/awayzClient.js";
|
|
19
20
|
import "../types/EAuthFlow.js";
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
j as authFailurePostMessage,
|
|
23
|
+
k as delay,
|
|
24
|
+
q as executeWithDelay,
|
|
25
|
+
w as getClientConfig,
|
|
26
|
+
A as getGatewayConfig,
|
|
27
|
+
D as handleAxiosError,
|
|
28
|
+
E as processFailedRequests
|
|
28
29
|
};
|
|
@@ -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-
|
|
5
|
+
import { c as i } from "../../noRetryInstance-C4bqpBc7.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-
|
|
5
|
+
import { c as o, b as c } from "../../noRetryInstance-C4bqpBc7.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-
|
|
3
|
-
import { T } from "../../TripsService-
|
|
2
|
+
import "../../noRetryInstance-C4bqpBc7.js";
|
|
3
|
+
import { T } from "../../TripsService-fNtCUyxa.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "../../configs/defaultAwayzConfig.js";
|
|
6
6
|
import "../../configs/endpoints.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-
|
|
5
|
+
import { c as e, b as c, g as A } from "../../noRetryInstance-C4bqpBc7.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { EWalletEndpoints as s } from "../../configs/endpoints.js";
|
|
8
8
|
class u {
|