@odynn/awayz-core 0.10.34 → 0.10.35
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-DtjkgWX5.js → TripsService-C6HJZJwL.js} +1 -1
- package/dist/components/CashValue/CashValue.js +1 -1
- package/dist/components/CashValue/CashValue.stories.js +1 -1
- package/dist/components/ClientPointsValue/ClientPointsValue.js +1 -1
- package/dist/components/Wallet/Card/Card.stories.js +1 -1
- package/dist/hooks/useAwayzAuth/useAwayzAuth.js +53 -53
- package/dist/hooks/useBookingManagement/useBookingManagement.js +1 -1
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +1 -1
- package/dist/hooks/useFeatureFlags.js +1 -1
- package/dist/hooks/useSearchLimit.js +1 -1
- package/dist/hooks/useTripManagement/useTripManagement.js +2 -2
- package/dist/hooks/useTripManagement/useTripManagement.test.js +2 -2
- package/dist/hooks/useWallet/useWallet.js +1 -1
- package/dist/hooks/useWallet/useWallet.test.js +1 -1
- package/dist/lib/services/bookings/BookingService.types.d.ts +16 -0
- package/dist/main.js +1 -1
- package/dist/{noRetryInstance-BbgLI6--.js → noRetryInstance-C0lN2R80.js} +36 -34
- package/dist/providers/AwayzProvider.js +1 -1
- package/dist/services/account/AccountService.js +1 -1
- package/dist/services/bookings/BookingService.js +68 -60
- package/dist/services/currency/CurrencyService.js +1 -1
- package/dist/services/features/featureService.js +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/instance.js +1 -1
- package/dist/services/instanceConfig.js +1 -1
- 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 +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ var f = (s, e, a) => e in s ? v(s, e, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var n = (s, e, a) => f(s, typeof e != "symbol" ? e + "" : e, a);
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "./arrayExtensions-DlcBOj5a.js";
|
|
6
|
-
import { c as i, f as u, b as d, r as D } from "./noRetryInstance-
|
|
6
|
+
import { c as i, f as u, b as d, r as D } from "./noRetryInstance-C0lN2R80.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import { DEFAULT_LOGO as S } from "./configs/defaultAwayzConfig.js";
|
|
9
9
|
import { EMyTripsEndpoints as o } from "./configs/endpoints.js";
|
|
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
|
2
2
|
import { useQuery as _ } from "@tanstack/react-query";
|
|
3
3
|
import { g as u, a as S, b as f } from "../../cashUtils-DyxlHnod.js";
|
|
4
4
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
5
|
-
import { E as T } from "../../noRetryInstance-
|
|
5
|
+
import { E as T } from "../../noRetryInstance-C0lN2R80.js";
|
|
6
6
|
import { useMemo as I } from "react";
|
|
7
7
|
import { a as v } 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-
|
|
12
|
+
import "../../noRetryInstance-C0lN2R80.js";
|
|
13
13
|
import "../../configs/awayzClient.js";
|
|
14
14
|
import { EAuthFlow as a } from "../../types/EAuthFlow.js";
|
|
15
15
|
/* empty css */
|
|
@@ -2,7 +2,7 @@ import { jsxs as u } from "react/jsx-runtime";
|
|
|
2
2
|
import { useQuery as c } from "@tanstack/react-query";
|
|
3
3
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
4
4
|
import { c as p } from "../../numberUtils-B4wd-SGR.js";
|
|
5
|
-
import { E as f } from "../../noRetryInstance-
|
|
5
|
+
import { E as f } from "../../noRetryInstance-C0lN2R80.js";
|
|
6
6
|
import { useMemo as C } from "react";
|
|
7
7
|
import { useAwayzContext as l } from "../../hooks/useAwayzContext.js";
|
|
8
8
|
import "react-i18next";
|
|
@@ -8,7 +8,7 @@ import '../../../assets/_styles6.css';import '../../../assets/_styles5.css';impo
|
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "../../../configs/awayzClient.js";
|
|
10
10
|
import { EAuthFlow as a } from "../../../types/EAuthFlow.js";
|
|
11
|
-
import "../../../noRetryInstance-
|
|
11
|
+
import "../../../noRetryInstance-C0lN2R80.js";
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
14
|
import "../../../index-Cv-wvFlM.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { c as q } from "../../cashUtils-DyxlHnod.js";
|
|
2
2
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import { e as x, A as f, E as K } from "../../noRetryInstance-
|
|
3
|
+
import { e as x, A as f, E as K } from "../../noRetryInstance-C0lN2R80.js";
|
|
4
4
|
import { a } from "../../keys-C7jV6nZg.js";
|
|
5
|
-
import { useState as m, useCallback as v, useEffect as
|
|
6
|
-
import { awayzClient as
|
|
5
|
+
import { useState as m, useCallback as v, useEffect as k } from "react";
|
|
6
|
+
import { awayzClient as C } from "../../configs/awayzClient.js";
|
|
7
7
|
import { PreferencesService as G } from "../../services/preferences/PreferencesService.js";
|
|
8
8
|
import "@tanstack/react-query";
|
|
9
9
|
import "react/jsx-runtime";
|
|
@@ -16,46 +16,46 @@ import '../../assets/_styles4.css';import '../../assets/_styles6.css';import '..
|
|
|
16
16
|
import "../../index-Cv-wvFlM.js";
|
|
17
17
|
import "../../context/AwayzContext.js";
|
|
18
18
|
/* empty css */
|
|
19
|
-
import { EAuthFlow as
|
|
20
|
-
const
|
|
21
|
-
var d,
|
|
22
|
-
let i = "",
|
|
23
|
-
typeof o == "string" ? i = o : o instanceof x ? (i = o.message,
|
|
19
|
+
import { EAuthFlow as R } from "../../types/EAuthFlow.js";
|
|
20
|
+
const V = (t, o) => {
|
|
21
|
+
var d, T;
|
|
22
|
+
let i = "", w = o;
|
|
23
|
+
typeof o == "string" ? i = o : o instanceof x ? (i = o.message, w = {
|
|
24
24
|
message: o.message,
|
|
25
25
|
cause: o.cause,
|
|
26
26
|
status: o.status,
|
|
27
27
|
data: (d = o == null ? void 0 : o.response) == null ? void 0 : d.data
|
|
28
|
-
}) : i = o.message, (
|
|
28
|
+
}) : i = o.message, (T = window.parent) == null || T.postMessage(
|
|
29
29
|
{
|
|
30
30
|
type: "auth_error",
|
|
31
|
-
details: { message: i, action: t, info:
|
|
31
|
+
details: { message: i, action: t, info: w }
|
|
32
32
|
},
|
|
33
33
|
"*"
|
|
34
34
|
);
|
|
35
35
|
}, ge = (t) => {
|
|
36
|
-
const [o, i] = m(!0), [
|
|
36
|
+
const [o, i] = m(!0), [w, d] = m(!1), [T, A] = m(), [u, h] = m(), [_, O] = m(!1), [p, F] = m([]), [P, M] = m([]), E = v(
|
|
37
37
|
async (s) => {
|
|
38
|
-
s.token && localStorage.setItem(a.TOKEN, s.token), s.refreshToken && localStorage.setItem(a.REFRESH_TOKEN, s.refreshToken), t != null && t.onSuccess && (t == null || t.onSuccess(s)), t != null && t.onSuccessAsync && await (t == null ? void 0 : t.onSuccessAsync(s)), i(!1),
|
|
38
|
+
s.token && localStorage.setItem(a.TOKEN, s.token), s.refreshToken && localStorage.setItem(a.REFRESH_TOKEN, s.refreshToken), t != null && t.onSuccess && (t == null || t.onSuccess(s)), t != null && t.onSuccessAsync && await (t == null ? void 0 : t.onSuccessAsync(s)), i(!1), O(!1), d(!0), A(s.token), h(s.user), C.invalidateQueries();
|
|
39
39
|
},
|
|
40
40
|
[t]
|
|
41
41
|
), l = v(
|
|
42
42
|
async (s, e) => {
|
|
43
|
-
if (t.authFlow ===
|
|
44
|
-
|
|
43
|
+
if (t.authFlow === R.POST_MESSAGE) {
|
|
44
|
+
V(e ?? "exchange_token", s), i(!1);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
t != null && t.onError && (t == null || t.onError(s)), t != null && t.onErrorAsync && await (t == null ? void 0 : t.onErrorAsync(s)), i(!1);
|
|
48
48
|
},
|
|
49
49
|
[t]
|
|
50
|
-
),
|
|
50
|
+
), I = async (s, e, r) => {
|
|
51
51
|
try {
|
|
52
|
-
const { success: n, data: c, message:
|
|
52
|
+
const { success: n, data: c, message: y } = await f.authenticateWithToken(
|
|
53
53
|
s,
|
|
54
54
|
e,
|
|
55
55
|
r
|
|
56
56
|
);
|
|
57
57
|
if (!n) {
|
|
58
|
-
l(
|
|
58
|
+
l(y);
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
if (!(c != null && c.token)) {
|
|
@@ -63,16 +63,16 @@ const Q = (t, o) => {
|
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
localStorage.setItem(a.TOKEN, c.token), await E(c);
|
|
66
|
-
const { data: g, ...
|
|
67
|
-
if (!
|
|
68
|
-
console.error({ reqLimitError:
|
|
66
|
+
const { data: g, ...S } = await f.getRequestLimit();
|
|
67
|
+
if (!S.success) {
|
|
68
|
+
console.error({ reqLimitError: S });
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
g == null || g.forEach(
|
|
72
|
-
(
|
|
72
|
+
(N) => window.parent.postMessage(
|
|
73
73
|
{
|
|
74
74
|
type: "request_limit",
|
|
75
|
-
limit:
|
|
75
|
+
limit: N
|
|
76
76
|
},
|
|
77
77
|
"*"
|
|
78
78
|
)
|
|
@@ -82,9 +82,9 @@ const Q = (t, o) => {
|
|
|
82
82
|
} finally {
|
|
83
83
|
i(!1);
|
|
84
84
|
}
|
|
85
|
-
},
|
|
85
|
+
}, H = async () => {
|
|
86
86
|
try {
|
|
87
|
-
const { success: s, data: e } = await
|
|
87
|
+
const { success: s, data: e } = await C.ensureQueryData({
|
|
88
88
|
queryKey: [K.CHECK_USER],
|
|
89
89
|
queryFn: f.checkUser
|
|
90
90
|
});
|
|
@@ -102,40 +102,40 @@ const Q = (t, o) => {
|
|
|
102
102
|
i(!1);
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
-
|
|
106
|
-
if (t.authFlow !==
|
|
107
|
-
localStorage.getItem(a.TOKEN) ?
|
|
105
|
+
k(() => {
|
|
106
|
+
if (t.authFlow !== R.STANDARD) return;
|
|
107
|
+
localStorage.getItem(a.TOKEN) ? H() : i(!1);
|
|
108
108
|
}, []);
|
|
109
|
-
const
|
|
109
|
+
const U = async () => {
|
|
110
110
|
const s = await f.getRegions();
|
|
111
|
-
|
|
111
|
+
F(s);
|
|
112
112
|
const e = s.map((c) => c.currency), n = Array.from(new Set(e)).map((c) => ({
|
|
113
113
|
code: c,
|
|
114
114
|
symbol: q(c) || c
|
|
115
115
|
}));
|
|
116
|
-
|
|
116
|
+
M(n);
|
|
117
117
|
};
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
-
}, []),
|
|
121
|
-
if (t.authFlow !==
|
|
118
|
+
return k(() => {
|
|
119
|
+
U();
|
|
120
|
+
}, []), k(() => {
|
|
121
|
+
if (t.authFlow !== R.QUERY) return;
|
|
122
122
|
const s = new URLSearchParams(window.location.search), e = s.get(a.TOKEN), r = s.get(a.REFRESH_TOKEN), n = (t.isTestMode ? s.get(a.OVERRIDE_TOKEN_EXCHANGE_ENDPOINT) : void 0) || void 0;
|
|
123
|
-
e &&
|
|
124
|
-
}, []),
|
|
125
|
-
if (t.authFlow !==
|
|
123
|
+
e && I(e, r ?? "", n);
|
|
124
|
+
}, []), k(() => {
|
|
125
|
+
if (t.authFlow !== R.POST_MESSAGE) return;
|
|
126
126
|
const s = async (e) => {
|
|
127
|
-
var
|
|
127
|
+
var S;
|
|
128
128
|
if (e.data.type !== "auth") return;
|
|
129
|
-
const r = (
|
|
130
|
-
if (localStorage.setItem(a.OVERRIDE_PAC_ENDPOINT,
|
|
131
|
-
const
|
|
129
|
+
const r = (S = e.data) == null ? void 0 : S.idToken, n = e.data.refreshToken, c = t.isTestMode ? e.data.overrideTokenExchangeEndpoint : void 0, y = t.isTestMode ? e.data.overridePACEndpoint : void 0, g = typeof y == "string" && y.trim() ? y.trim() : void 0;
|
|
130
|
+
if (g ? localStorage.setItem(a.OVERRIDE_PAC_ENDPOINT, g) : localStorage.removeItem(a.OVERRIDE_PAC_ENDPOINT), !r) {
|
|
131
|
+
const N = `received message ${JSON.stringify(
|
|
132
132
|
e.data
|
|
133
133
|
)}
|
|
134
134
|
no idToken in body`;
|
|
135
|
-
l(
|
|
135
|
+
l(N);
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
|
-
localStorage.setItem(a.REFRESH_TOKEN, n), await
|
|
138
|
+
localStorage.setItem(a.REFRESH_TOKEN, n), await I(r, n, c);
|
|
139
139
|
};
|
|
140
140
|
return window.addEventListener("message", s), window.parent && window.parent.postMessage(
|
|
141
141
|
{
|
|
@@ -148,16 +148,16 @@ const Q = (t, o) => {
|
|
|
148
148
|
};
|
|
149
149
|
}, []), {
|
|
150
150
|
isAuthenticating: o,
|
|
151
|
-
isAuthenticated:
|
|
152
|
-
isMfaPending:
|
|
153
|
-
token:
|
|
151
|
+
isAuthenticated: w,
|
|
152
|
+
isMfaPending: _,
|
|
153
|
+
token: T,
|
|
154
154
|
user: u,
|
|
155
|
-
supportedRegions:
|
|
156
|
-
supportedCurrencies:
|
|
155
|
+
supportedRegions: p,
|
|
156
|
+
supportedCurrencies: P,
|
|
157
157
|
signIn: async (s) => {
|
|
158
158
|
i(!0);
|
|
159
159
|
const e = await f.login(s);
|
|
160
|
-
return e.success ? (localStorage.removeItem(a.TOKEN), localStorage.removeItem(a.REFRESH_TOKEN),
|
|
160
|
+
return e.success ? (localStorage.removeItem(a.TOKEN), localStorage.removeItem(a.REFRESH_TOKEN), A(void 0), d(!1), h(e.data.user), O(!0), i(!1), { success: !0, message: "OTP sent to email" }) : (i(!1), l(e.message), { success: !1, message: e.message });
|
|
161
161
|
},
|
|
162
162
|
signUp: async (s) => {
|
|
163
163
|
var r;
|
|
@@ -171,7 +171,7 @@ const Q = (t, o) => {
|
|
|
171
171
|
return e;
|
|
172
172
|
},
|
|
173
173
|
signOut: () => {
|
|
174
|
-
localStorage.removeItem(a.TOKEN), localStorage.removeItem(a.REFRESH_TOKEN), d(!1),
|
|
174
|
+
localStorage.removeItem(a.TOKEN), localStorage.removeItem(a.REFRESH_TOKEN), d(!1), O(!1), A(void 0), h(void 0);
|
|
175
175
|
},
|
|
176
176
|
continueWithGoogle: async (s, e) => {
|
|
177
177
|
var n;
|
|
@@ -189,7 +189,7 @@ const Q = (t, o) => {
|
|
|
189
189
|
},
|
|
190
190
|
resendVerificationEmail: async (s) => (await f.resendVerificationEmail(s)).success,
|
|
191
191
|
setTokens: (s, e) => {
|
|
192
|
-
localStorage.setItem(a.TOKEN, s), localStorage.setItem(a.REFRESH_TOKEN, e),
|
|
192
|
+
localStorage.setItem(a.TOKEN, s), localStorage.setItem(a.REFRESH_TOKEN, e), I(s, e);
|
|
193
193
|
},
|
|
194
194
|
setPreferredCurrency: async (s) => {
|
|
195
195
|
const e = await G.setCurrency(s);
|
|
@@ -203,7 +203,7 @@ const Q = (t, o) => {
|
|
|
203
203
|
currency: e.data.currency || u.preferences.currency
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
|
|
206
|
+
h(r), C.invalidateQueries({
|
|
207
207
|
queryKey: [K.CHECK_USER]
|
|
208
208
|
});
|
|
209
209
|
}
|
|
@@ -223,6 +223,6 @@ const Q = (t, o) => {
|
|
|
223
223
|
};
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
V as authFailurePostMessage,
|
|
227
227
|
ge as useAwayzAuth
|
|
228
228
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useQuery as S, useMutation as E } from "@tanstack/react-query";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
4
|
-
import { E as a } from "../../noRetryInstance-
|
|
4
|
+
import { E as a } from "../../noRetryInstance-C0lN2R80.js";
|
|
5
5
|
import { useState as j } from "react";
|
|
6
6
|
import "react-i18next";
|
|
7
7
|
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 */
|
|
@@ -3,7 +3,7 @@ import "react/jsx-runtime";
|
|
|
3
3
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "../../configs/awayzClient.js";
|
|
6
|
-
import { c } from "../../noRetryInstance-
|
|
6
|
+
import { c } from "../../noRetryInstance-C0lN2R80.js";
|
|
7
7
|
import "react-i18next";
|
|
8
8
|
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 */
|
|
9
9
|
/* empty css */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useQuery as U } from "@tanstack/react-query";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
4
|
-
import { E as N, t as F } from "../noRetryInstance-
|
|
4
|
+
import { E as N, t as F } from "../noRetryInstance-C0lN2R80.js";
|
|
5
5
|
import { useMemo as r } from "react";
|
|
6
6
|
import { FeatureService as e } from "../services/features/featureService.js";
|
|
7
7
|
const L = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useQuery as u } from "@tanstack/react-query";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
4
|
-
import { E as m, A as c, b as f } from "../noRetryInstance-
|
|
4
|
+
import { E as m, A as c, b as f } from "../noRetryInstance-C0lN2R80.js";
|
|
5
5
|
import { useEffect as d } from "react";
|
|
6
6
|
import { useAwayzContext as y } from "./useAwayzContext.js";
|
|
7
7
|
var s = /* @__PURE__ */ ((r) => (r.HOTEL = "Hotel", r.FLIGHT = "Flight", r))(s || {});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useQuery as u, useMutation as p } from "@tanstack/react-query";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import { h as m } from "../../arrayExtensions-DlcBOj5a.js";
|
|
4
|
-
import { E as e } from "../../noRetryInstance-
|
|
4
|
+
import { E as e } from "../../noRetryInstance-C0lN2R80.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "react-i18next";
|
|
7
7
|
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,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-
|
|
16
|
+
import { T as n } from "../../TripsService-C6HJZJwL.js";
|
|
17
17
|
const b = ({
|
|
18
18
|
tripId: t,
|
|
19
19
|
tripDetails: s
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import { h as p } from "../../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import { D as f } from "../../TripsService-
|
|
3
|
+
import { D as f } from "../../TripsService-C6HJZJwL.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { renderHook as o, waitFor as i } from "../../tests/TestWrapper.js";
|
|
6
6
|
import { EMyTripsEndpoints as c } from "../../configs/endpoints.js";
|
|
@@ -10,7 +10,7 @@ import '../../assets/_styles4.css';import '../../assets/_styles6.css';import '..
|
|
|
10
10
|
/* empty css */
|
|
11
11
|
import "@tanstack/react-query";
|
|
12
12
|
import "../../configs/awayzClient.js";
|
|
13
|
-
import { c as d } from "../../noRetryInstance-
|
|
13
|
+
import { c as d } from "../../noRetryInstance-C0lN2R80.js";
|
|
14
14
|
/* empty css */
|
|
15
15
|
/* empty css */
|
|
16
16
|
import "../../index-Cv-wvFlM.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useQuery as s, useMutation as i } from "@tanstack/react-query";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
4
|
-
import { E as a, d as l } from "../../noRetryInstance-
|
|
4
|
+
import { E as a, d as l } from "../../noRetryInstance-C0lN2R80.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "react-i18next";
|
|
7
7
|
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 */
|
|
@@ -8,7 +8,7 @@ import '../../assets/_styles4.css';import '../../assets/_styles6.css';import '..
|
|
|
8
8
|
/* empty css */
|
|
9
9
|
import "@tanstack/react-query";
|
|
10
10
|
import "../../configs/awayzClient.js";
|
|
11
|
-
import { c as l } from "../../noRetryInstance-
|
|
11
|
+
import { c as l } from "../../noRetryInstance-C0lN2R80.js";
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
14
|
import "../../index-Cv-wvFlM.js";
|
|
@@ -45,6 +45,22 @@ export interface IHotelBookingDetails {
|
|
|
45
45
|
name: string;
|
|
46
46
|
}[];
|
|
47
47
|
createdAt: string;
|
|
48
|
+
conditions: ICondition[];
|
|
49
|
+
loyaltyProgram: {
|
|
50
|
+
supportedLoyaltyProgramme: string;
|
|
51
|
+
loyaltyProgrammeAccountNumber: string;
|
|
52
|
+
};
|
|
53
|
+
amenities: IAmenities[];
|
|
54
|
+
phoneNumber: string;
|
|
55
|
+
email: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ICondition {
|
|
58
|
+
title: string;
|
|
59
|
+
description: string;
|
|
60
|
+
}
|
|
61
|
+
export interface IAmenities {
|
|
62
|
+
description: string;
|
|
63
|
+
type: string;
|
|
48
64
|
}
|
|
49
65
|
export interface IBed {
|
|
50
66
|
type: string;
|
package/dist/main.js
CHANGED
|
@@ -13,7 +13,7 @@ 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, a as H, g as L, i as N } from "./noRetryInstance-
|
|
16
|
+
import { A as R, c as V, a as H, g as L, i as N } from "./noRetryInstance-C0lN2R80.js";
|
|
17
17
|
import { ESource as U } from "./services/account/AccountServices.types.js";
|
|
18
18
|
import { CurrencyService as b } from "./services/currency/CurrencyService.js";
|
|
19
19
|
import { RewardsService as q } from "./services/rewards/RewardsService.js";
|
|
@@ -59,7 +59,7 @@ const Tt = se("string"), I = se("function"), je = se("number"), re = (e) => e !=
|
|
|
59
59
|
let t;
|
|
60
60
|
return e && (typeof FormData == "function" && e instanceof FormData || I(e.append) && ((t = ne(e)) === "formdata" || // detect form-data instance
|
|
61
61
|
t === "object" && I(e.toString) && e.toString() === "[object FormData]"));
|
|
62
|
-
}, kt = x("URLSearchParams"), [Ut, xt,
|
|
62
|
+
}, kt = x("URLSearchParams"), [Ut, xt, Pt, Lt] = ["ReadableStream", "Request", "Response", "Headers"].map(x), Ft = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
63
63
|
function V(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
64
64
|
if (e === null || typeof e > "u")
|
|
65
65
|
return;
|
|
@@ -210,8 +210,8 @@ const Qt = (e) => {
|
|
|
210
210
|
isPlainObject: X,
|
|
211
211
|
isReadableStream: Ut,
|
|
212
212
|
isRequest: xt,
|
|
213
|
-
isResponse:
|
|
214
|
-
isHeaders:
|
|
213
|
+
isResponse: Pt,
|
|
214
|
+
isHeaders: Lt,
|
|
215
215
|
isUndefined: K,
|
|
216
216
|
isDate: Ot,
|
|
217
217
|
isFile: At,
|
|
@@ -351,10 +351,10 @@ function oe(e, t, n) {
|
|
|
351
351
|
if (a.endsWith(E, "{}"))
|
|
352
352
|
E = s ? E : E.slice(0, -2), p = JSON.stringify(p);
|
|
353
353
|
else if (a.isArray(p) && on(p) || (a.isFileList(p) || a.endsWith(E, "[]")) && (S = a.toArray(p)))
|
|
354
|
-
return E = Je(E), S.forEach(function(b,
|
|
354
|
+
return E = Je(E), S.forEach(function(b, L) {
|
|
355
355
|
!(a.isUndefined(b) || b === null) && t.append(
|
|
356
356
|
// eslint-disable-next-line no-nested-ternary
|
|
357
|
-
i === !0 ? Oe([E],
|
|
357
|
+
i === !0 ? Oe([E], L, o) : i === null ? E : E + "[]",
|
|
358
358
|
l(b)
|
|
359
359
|
);
|
|
360
360
|
}), !1;
|
|
@@ -941,12 +941,12 @@ const Q = (e, t, n = 3) => {
|
|
|
941
941
|
function xn(e) {
|
|
942
942
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
943
943
|
}
|
|
944
|
-
function
|
|
944
|
+
function Pn(e, t) {
|
|
945
945
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
946
946
|
}
|
|
947
947
|
function tt(e, t, n) {
|
|
948
948
|
let s = !xn(t);
|
|
949
|
-
return e && (s || n == !1) ?
|
|
949
|
+
return e && (s || n == !1) ? Pn(e, t) : t;
|
|
950
950
|
}
|
|
951
951
|
const ke = (e) => e instanceof k ? { ...e } : e;
|
|
952
952
|
function j(e, t) {
|
|
@@ -1034,7 +1034,7 @@ const nt = (e) => {
|
|
|
1034
1034
|
l && i.set(r, l);
|
|
1035
1035
|
}
|
|
1036
1036
|
return t;
|
|
1037
|
-
},
|
|
1037
|
+
}, Ln = typeof XMLHttpRequest < "u", Fn = Ln && function(e) {
|
|
1038
1038
|
return new Promise(function(n, s) {
|
|
1039
1039
|
const r = nt(e);
|
|
1040
1040
|
let o = r.data;
|
|
@@ -1071,16 +1071,16 @@ const nt = (e) => {
|
|
|
1071
1071
|
}, h.onerror = function() {
|
|
1072
1072
|
s(new m("Network Error", m.ERR_NETWORK, e, h)), h = null;
|
|
1073
1073
|
}, h.ontimeout = function() {
|
|
1074
|
-
let
|
|
1074
|
+
let L = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
|
|
1075
1075
|
const N = r.transitional || Ye;
|
|
1076
|
-
r.timeoutErrorMessage && (
|
|
1077
|
-
|
|
1076
|
+
r.timeoutErrorMessage && (L = r.timeoutErrorMessage), s(new m(
|
|
1077
|
+
L,
|
|
1078
1078
|
N.clarifyTimeoutError ? m.ETIMEDOUT : m.ECONNABORTED,
|
|
1079
1079
|
e,
|
|
1080
1080
|
h
|
|
1081
1081
|
)), h = null;
|
|
1082
|
-
}, o === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(i.toJSON(), function(
|
|
1083
|
-
h.setRequestHeader(N,
|
|
1082
|
+
}, o === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(i.toJSON(), function(L, N) {
|
|
1083
|
+
h.setRequestHeader(N, L);
|
|
1084
1084
|
}), a.isUndefined(r.withCredentials) || (h.withCredentials = !!r.withCredentials), c && c !== "json" && (h.responseType = r.responseType), l && ([R, p] = Q(l, !0), h.addEventListener("progress", R)), u && h.upload && ([d, w] = Q(u), h.upload.addEventListener("progress", d), h.upload.addEventListener("loadend", w)), (r.cancelToken || r.signal) && (f = (b) => {
|
|
1085
1085
|
h && (s(!b || b.type ? new v(null, e, h) : b), h.abort(), h = null);
|
|
1086
1086
|
}, r.cancelToken && r.cancelToken.subscribe(f), r.signal && (r.signal.aborted ? f() : r.signal.addEventListener("abort", f)));
|
|
@@ -1280,10 +1280,10 @@ const Gn = async (e) => {
|
|
|
1280
1280
|
);
|
|
1281
1281
|
}
|
|
1282
1282
|
l = l || "text";
|
|
1283
|
-
let
|
|
1283
|
+
let L = await ee[a.findKey(ee, l) || "text"](y, e);
|
|
1284
1284
|
return !b && E && E(), await new Promise((N, D) => {
|
|
1285
1285
|
et(N, D, {
|
|
1286
|
-
data:
|
|
1286
|
+
data: L,
|
|
1287
1287
|
headers: k.from(y.headers),
|
|
1288
1288
|
status: y.status,
|
|
1289
1289
|
statusText: y.statusText,
|
|
@@ -1313,7 +1313,7 @@ a.forEach(me, (e, t) => {
|
|
|
1313
1313
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1314
1314
|
}
|
|
1315
1315
|
});
|
|
1316
|
-
const
|
|
1316
|
+
const Pe = (e) => `- ${e}`, $n = (e) => a.isFunction(e) || e === null || e === !1, ot = {
|
|
1317
1317
|
getAdapter: (e) => {
|
|
1318
1318
|
e = a.isArray(e) ? e : [e];
|
|
1319
1319
|
const { length: t } = e;
|
|
@@ -1333,8 +1333,8 @@ const Le = (e) => `- ${e}`, $n = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1333
1333
|
([c, u]) => `adapter ${c} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1334
1334
|
);
|
|
1335
1335
|
let i = t ? o.length > 1 ? `since :
|
|
1336
|
-
` + o.map(
|
|
1337
|
-
`) : " " +
|
|
1336
|
+
` + o.map(Pe).join(`
|
|
1337
|
+
`) : " " + Pe(o[0]) : "as no adapter specified";
|
|
1338
1338
|
throw new m(
|
|
1339
1339
|
"There is no suitable adapter to dispatch the request " + i,
|
|
1340
1340
|
"ERR_NOT_SUPPORT"
|
|
@@ -1348,7 +1348,7 @@ function le(e) {
|
|
|
1348
1348
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1349
1349
|
throw new v(null, e);
|
|
1350
1350
|
}
|
|
1351
|
-
function
|
|
1351
|
+
function Le(e) {
|
|
1352
1352
|
return le(e), e.headers = k.from(e.headers), e.data = ue.call(
|
|
1353
1353
|
e,
|
|
1354
1354
|
e.transformRequest
|
|
@@ -1414,7 +1414,7 @@ function Kn(e, t, n) {
|
|
|
1414
1414
|
const Z = {
|
|
1415
1415
|
assertOptions: Kn,
|
|
1416
1416
|
validators: ae
|
|
1417
|
-
},
|
|
1417
|
+
}, P = Z.validators;
|
|
1418
1418
|
let M = class {
|
|
1419
1419
|
constructor(t) {
|
|
1420
1420
|
this.defaults = t || {}, this.interceptors = {
|
|
@@ -1451,17 +1451,17 @@ let M = class {
|
|
|
1451
1451
|
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = j(this.defaults, n);
|
|
1452
1452
|
const { transitional: s, paramsSerializer: r, headers: o } = n;
|
|
1453
1453
|
s !== void 0 && Z.assertOptions(s, {
|
|
1454
|
-
silentJSONParsing:
|
|
1455
|
-
forcedJSONParsing:
|
|
1456
|
-
clarifyTimeoutError:
|
|
1454
|
+
silentJSONParsing: P.transitional(P.boolean),
|
|
1455
|
+
forcedJSONParsing: P.transitional(P.boolean),
|
|
1456
|
+
clarifyTimeoutError: P.transitional(P.boolean)
|
|
1457
1457
|
}, !1), r != null && (a.isFunction(r) ? n.paramsSerializer = {
|
|
1458
1458
|
serialize: r
|
|
1459
1459
|
} : Z.assertOptions(r, {
|
|
1460
|
-
encode:
|
|
1461
|
-
serialize:
|
|
1460
|
+
encode: P.function,
|
|
1461
|
+
serialize: P.function
|
|
1462
1462
|
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Z.assertOptions(n, {
|
|
1463
|
-
baseUrl:
|
|
1464
|
-
withXsrfToken:
|
|
1463
|
+
baseUrl: P.spelling("baseURL"),
|
|
1464
|
+
withXsrfToken: P.spelling("withXSRFToken")
|
|
1465
1465
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1466
1466
|
let i = o && a.merge(
|
|
1467
1467
|
o.common,
|
|
@@ -1484,7 +1484,7 @@ let M = class {
|
|
|
1484
1484
|
});
|
|
1485
1485
|
let f, d = 0, R;
|
|
1486
1486
|
if (!u) {
|
|
1487
|
-
const p = [
|
|
1487
|
+
const p = [Le.bind(this), void 0];
|
|
1488
1488
|
for (p.unshift.apply(p, c), p.push.apply(p, l), R = p.length, f = Promise.resolve(n); d < R; )
|
|
1489
1489
|
f = f.then(p[d++], p[d++]);
|
|
1490
1490
|
return f;
|
|
@@ -1501,7 +1501,7 @@ let M = class {
|
|
|
1501
1501
|
}
|
|
1502
1502
|
}
|
|
1503
1503
|
try {
|
|
1504
|
-
f =
|
|
1504
|
+
f = Le.call(this, w);
|
|
1505
1505
|
} catch (p) {
|
|
1506
1506
|
return Promise.reject(p);
|
|
1507
1507
|
}
|
|
@@ -1722,8 +1722,8 @@ const {
|
|
|
1722
1722
|
CancelToken: ks,
|
|
1723
1723
|
VERSION: Us,
|
|
1724
1724
|
all: xs,
|
|
1725
|
-
Cancel:
|
|
1726
|
-
isAxiosError:
|
|
1725
|
+
Cancel: Ps,
|
|
1726
|
+
isAxiosError: Ls,
|
|
1727
1727
|
spread: Fs,
|
|
1728
1728
|
toFormData: Ds,
|
|
1729
1729
|
AxiosHeaders: Bs,
|
|
@@ -1731,9 +1731,11 @@ const {
|
|
|
1731
1731
|
formToJSON: qs,
|
|
1732
1732
|
getAdapter: Hs,
|
|
1733
1733
|
mergeConfig: Ms
|
|
1734
|
-
} = g, ut = (e) => (e.baseURL = Be(), e.headers.Authorization = localStorage.getItem(C.TOKEN), e.headers["client-id"] = localStorage.getItem(C.CLIENT_ID), e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e }), Yn = (e) =>
|
|
1735
|
-
C.
|
|
1736
|
-
|
|
1734
|
+
} = g, ut = (e) => (e.baseURL = Be(), e.headers.Authorization = localStorage.getItem(C.TOKEN), e.headers["client-id"] = localStorage.getItem(C.CLIENT_ID), e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e }), Yn = (e) => {
|
|
1735
|
+
e.baseURL = pt(), e.headers.Authorization = localStorage.getItem(C.TOKEN), e.headers["client-id"] = localStorage.getItem(C.CLIENT_ID);
|
|
1736
|
+
const t = localStorage.getItem(C.OVERRIDE_PAC_ENDPOINT);
|
|
1737
|
+
return t && (e.headers["x-override-url"] = t), e.headers["Api-Version"] = "1.0", e.metadata = { startTime: /* @__PURE__ */ new Date() }, { ...e };
|
|
1738
|
+
}, js = (e, t, n) => {
|
|
1737
1739
|
for (const s of e)
|
|
1738
1740
|
t ? s.rej(t) : s.res(n);
|
|
1739
1741
|
}, Zn = async (e) => new Promise((t, n) => {
|
|
@@ -12,7 +12,7 @@ import '../assets/_styles4.css';import '../assets/_styles6.css';import '../asset
|
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
14
|
import { awayzClient as w } from "../configs/awayzClient.js";
|
|
15
|
-
import "../noRetryInstance-
|
|
15
|
+
import "../noRetryInstance-C0lN2R80.js";
|
|
16
16
|
/* empty css */
|
|
17
17
|
/* empty css */
|
|
18
18
|
import "../index-Cv-wvFlM.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import { A as a } from "../../noRetryInstance-
|
|
3
|
+
import { A as a } from "../../noRetryInstance-C0lN2R80.js";
|
|
4
4
|
import "../../keys-C7jV6nZg.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "../../configs/awayzClient.js";
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
var g = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
2
|
+
var y = (r, t, a) => t in r ? g(r, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : r[t] = a;
|
|
3
|
+
var i = (r, t, a) => y(r, typeof t != "symbol" ? t + "" : t, a);
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
6
|
-
import { t as
|
|
7
|
-
import { c as l, b as
|
|
6
|
+
import { t as f } from "../../numberUtils-B4wd-SGR.js";
|
|
7
|
+
import { c as l, b as m, g as p } from "../../noRetryInstance-C0lN2R80.js";
|
|
8
8
|
import "react";
|
|
9
|
-
import { EBookingEndpoints as
|
|
9
|
+
import { EBookingEndpoints as c } from "../../configs/endpoints.js";
|
|
10
10
|
const h = (r) => {
|
|
11
11
|
const t = /P((\d+)D)?T((\d+)H)?((\d+)M)?/, a = r.match(t);
|
|
12
12
|
if (a) {
|
|
13
|
-
const
|
|
14
|
-
return `${
|
|
13
|
+
const o = a[2] ? `${a[2]}d ` : "", d = a[4] ? `${a[4]}h ` : "", s = a[6] ? `${a[6]}m` : "";
|
|
14
|
+
return `${o}${d}${s}`.trim();
|
|
15
15
|
} else
|
|
16
16
|
return r;
|
|
17
17
|
};
|
|
18
18
|
class b {
|
|
19
19
|
constructor() {
|
|
20
|
-
|
|
20
|
+
i(this, "getHotelBooking", async (t) => {
|
|
21
21
|
var s, e;
|
|
22
22
|
const { data: a } = await l.get(
|
|
23
|
-
`${
|
|
24
|
-
),
|
|
23
|
+
`${c.USER_HOTEL_BOOKINGS}/${t}`
|
|
24
|
+
), o = a.data.accommodation.rooms[0].rates[0];
|
|
25
25
|
return {
|
|
26
26
|
id: a.data._id,
|
|
27
27
|
rateId: a.data.rate_id,
|
|
28
28
|
quoteId: a.data.quote_id,
|
|
29
29
|
bookingId: a.data.id,
|
|
30
|
-
totalAmount: parseFloat(
|
|
31
|
-
feeAmount: parseFloat(
|
|
32
|
-
taxAmount: parseFloat(
|
|
33
|
-
baseAmount: parseFloat(
|
|
30
|
+
totalAmount: parseFloat(o.total_amount),
|
|
31
|
+
feeAmount: parseFloat(o.fee_amount),
|
|
32
|
+
taxAmount: parseFloat(o.tax_amount),
|
|
33
|
+
baseAmount: parseFloat(o.base_amount),
|
|
34
34
|
cancelledAt: a.data.cancelled_at,
|
|
35
|
-
totalCurrency:
|
|
36
|
-
baseCurrency:
|
|
37
|
-
feeCurrency:
|
|
38
|
-
taxCurrency:
|
|
35
|
+
totalCurrency: o.total_currency,
|
|
36
|
+
baseCurrency: o.base_currency,
|
|
37
|
+
feeCurrency: o.fee_currency,
|
|
38
|
+
taxCurrency: o.tax_currency,
|
|
39
39
|
status: a.data.status,
|
|
40
40
|
description: a.data.accommodation.description,
|
|
41
41
|
name: a.data.accommodation.name,
|
|
@@ -55,41 +55,49 @@ class b {
|
|
|
55
55
|
latitude: a.data.accommodation.location.geographic_coordinates.latitude,
|
|
56
56
|
longitude: a.data.accommodation.location.geographic_coordinates.longitude
|
|
57
57
|
},
|
|
58
|
-
images: a.data.accommodation.photos.map((
|
|
59
|
-
guests: a.data.guests.map((
|
|
60
|
-
var
|
|
58
|
+
images: a.data.accommodation.photos.map((n) => n.url),
|
|
59
|
+
guests: a.data.guests.map((n, _) => {
|
|
60
|
+
var u;
|
|
61
61
|
return {
|
|
62
|
-
familyName:
|
|
63
|
-
givenName:
|
|
64
|
-
type: (
|
|
62
|
+
familyName: n.family_name,
|
|
63
|
+
givenName: n.given_name,
|
|
64
|
+
type: (u = a.data.guest_types[_]) == null ? void 0 : u.type
|
|
65
65
|
};
|
|
66
66
|
}),
|
|
67
67
|
numberOfRooms: (s = a.data.rooms) == null ? void 0 : s.length,
|
|
68
|
-
cancellationTimeline:
|
|
69
|
-
(
|
|
70
|
-
refundAmount: parseFloat(
|
|
71
|
-
currency:
|
|
72
|
-
before:
|
|
68
|
+
cancellationTimeline: o.cancellation_timeline.map(
|
|
69
|
+
(n) => ({
|
|
70
|
+
refundAmount: parseFloat(n.refund_amount),
|
|
71
|
+
currency: n.currency,
|
|
72
|
+
before: n.before
|
|
73
73
|
})
|
|
74
74
|
),
|
|
75
|
-
rooms: (e = a.data.rooms) == null ? void 0 : e.map((
|
|
75
|
+
rooms: (e = a.data.rooms) == null ? void 0 : e.map((n) => {
|
|
76
76
|
var _;
|
|
77
77
|
return {
|
|
78
|
-
beds: (_ =
|
|
79
|
-
type:
|
|
80
|
-
count:
|
|
78
|
+
beds: (_ = n.beds) == null ? void 0 : _.map((u) => ({
|
|
79
|
+
type: u.type,
|
|
80
|
+
count: u.count
|
|
81
81
|
})),
|
|
82
|
-
totalAmount: parseFloat(
|
|
83
|
-
name:
|
|
82
|
+
totalAmount: parseFloat(n.total_amount),
|
|
83
|
+
name: n.name
|
|
84
84
|
};
|
|
85
85
|
}),
|
|
86
|
-
createdAt: a.data.created_at
|
|
86
|
+
createdAt: a.data.created_at,
|
|
87
|
+
conditions: a.data.rooms[0].conditions,
|
|
88
|
+
loyaltyProgram: {
|
|
89
|
+
loyaltyProgrammeAccountNumber: a.data.loyalty_programme_account_number,
|
|
90
|
+
supportedLoyaltyProgramme: a.data.supported_loyalty_programme
|
|
91
|
+
},
|
|
92
|
+
amenities: a.data.accommodation.amenities,
|
|
93
|
+
phoneNumber: a.data.phone_number,
|
|
94
|
+
email: a.data.email
|
|
87
95
|
};
|
|
88
96
|
});
|
|
89
|
-
|
|
97
|
+
i(this, "getFlightBooking", async (t) => {
|
|
90
98
|
var d, s;
|
|
91
99
|
const { data: a } = await l.get(
|
|
92
|
-
`${
|
|
100
|
+
`${c.USER_FLIGHT_BOOKINGS}/${t}`
|
|
93
101
|
);
|
|
94
102
|
return {
|
|
95
103
|
id: a.data._id,
|
|
@@ -140,12 +148,12 @@ class b {
|
|
|
140
148
|
numberOfStops: e.segments.length - 1,
|
|
141
149
|
reference: a.data.booking_reference,
|
|
142
150
|
durationInMinutes: h(e.duration),
|
|
143
|
-
origin:
|
|
144
|
-
destination:
|
|
145
|
-
segments:
|
|
151
|
+
origin: m(e.origin),
|
|
152
|
+
destination: m(e.destination),
|
|
153
|
+
segments: m(e.segments)
|
|
146
154
|
})),
|
|
147
155
|
availableActions: a.data.available_actions,
|
|
148
|
-
airlineInitiatedChanges:
|
|
156
|
+
airlineInitiatedChanges: m(a.data.airline_initiated_changes) || [],
|
|
149
157
|
cancellationDetails: a.data.cancellation_details ? {
|
|
150
158
|
refundAmount: parseFloat(
|
|
151
159
|
a.data.cancellation_details.refund_amount
|
|
@@ -154,61 +162,61 @@ class b {
|
|
|
154
162
|
refundTo: a.data.cancellation_details.refund_to,
|
|
155
163
|
confirmedAt: a.data.cancellation_details.confirmed_at
|
|
156
164
|
} : void 0,
|
|
157
|
-
services:
|
|
165
|
+
services: m(a.data.services),
|
|
158
166
|
createdAt: a.data.created_at
|
|
159
167
|
};
|
|
160
168
|
});
|
|
161
|
-
|
|
169
|
+
i(this, "initiateCancelFlightBooking", async (t) => {
|
|
162
170
|
const { data: a } = await l.put(
|
|
163
|
-
`${
|
|
171
|
+
`${c.INITIATE_FLIGHT_CANCEL}/${t}`
|
|
164
172
|
);
|
|
165
173
|
if (!a.success)
|
|
166
174
|
throw new Error("Failed to initiate cancellation");
|
|
167
|
-
const
|
|
175
|
+
const o = m(a.data);
|
|
168
176
|
return {
|
|
169
|
-
...
|
|
170
|
-
refundAmount:
|
|
177
|
+
...o,
|
|
178
|
+
refundAmount: f(o.refundAmount)
|
|
171
179
|
};
|
|
172
180
|
});
|
|
173
|
-
|
|
181
|
+
i(this, "confirmCancelFlightBooking", async (t) => {
|
|
174
182
|
const { data: a } = await l.put(
|
|
175
|
-
`${
|
|
183
|
+
`${c.CONFIRM_FLIGHT_CANCEL}/${t}`
|
|
176
184
|
);
|
|
177
185
|
return a.success;
|
|
178
186
|
});
|
|
179
|
-
|
|
187
|
+
i(this, "cancelHotelBooking", async (t) => {
|
|
180
188
|
const { data: a } = await l.post(
|
|
181
|
-
`${
|
|
189
|
+
`${c.CANCEL_HOTEL_BOOKING}/${t}`
|
|
182
190
|
);
|
|
183
191
|
return a.success;
|
|
184
192
|
});
|
|
185
|
-
|
|
193
|
+
i(this, "actionAirlineChanges", async ({
|
|
186
194
|
bookingId: t,
|
|
187
195
|
acceptChanges: a,
|
|
188
|
-
aicId:
|
|
196
|
+
aicId: o
|
|
189
197
|
}) => {
|
|
190
198
|
const { data: d } = await l.post(
|
|
191
|
-
|
|
199
|
+
c.ACTION_AIRLINE_CHANGES,
|
|
192
200
|
{
|
|
193
201
|
booking_id: t,
|
|
194
202
|
action_taken: a ? "accepted" : "cancelled",
|
|
195
|
-
aic_id:
|
|
203
|
+
aic_id: o
|
|
196
204
|
}
|
|
197
205
|
);
|
|
198
206
|
return d.success;
|
|
199
207
|
});
|
|
200
|
-
|
|
208
|
+
i(this, "cancelPointsBooking", async (t) => {
|
|
201
209
|
const { data: a } = await p.post(
|
|
202
|
-
`${
|
|
210
|
+
`${c.REFUND_POINTS_BOOKING}`,
|
|
203
211
|
{
|
|
204
212
|
bookingId: t
|
|
205
213
|
}
|
|
206
214
|
);
|
|
207
215
|
return a.success;
|
|
208
216
|
});
|
|
209
|
-
|
|
217
|
+
i(this, "getPointsAsCash", async (t) => {
|
|
210
218
|
const { data: a } = await p.get(
|
|
211
|
-
`${
|
|
219
|
+
`${c.BOOKING_POINTS_AS_CASH}/${t}`
|
|
212
220
|
);
|
|
213
221
|
return !a.success || !a.data ? null : {
|
|
214
222
|
...a.data,
|
|
@@ -3,7 +3,7 @@ var l = (c, r, t) => r in c ? f(c, r, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var o = (c, r, t) => l(c, typeof r != "symbol" ? r + "" : r, t);
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
6
|
-
import { A as i, E as u, c as y } from "../../noRetryInstance-
|
|
6
|
+
import { A as i, E as u, c as y } from "../../noRetryInstance-C0lN2R80.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import { ECurrencyEndpoints as p } from "../../configs/endpoints.js";
|
|
9
9
|
import "react-i18next";
|
package/dist/services/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as o, c, a as t, g as a, i as n } from "../noRetryInstance-
|
|
1
|
+
import { A as o, c, a as t, g as a, i as n } from "../noRetryInstance-C0lN2R80.js";
|
|
2
2
|
import { ESource as i } from "./account/AccountServices.types.js";
|
|
3
3
|
import { CurrencyService as f } from "./currency/CurrencyService.js";
|
|
4
4
|
import { RewardsService as x } from "./rewards/RewardsService.js";
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
3
3
|
import "../keys-C7jV6nZg.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { c as m, g as p, i as s } from "../noRetryInstance-
|
|
5
|
+
import { c as m, g as p, i as s } from "../noRetryInstance-C0lN2R80.js";
|
|
6
6
|
import "../configs/awayzUrl.js";
|
|
7
7
|
export {
|
|
8
8
|
m as clientInstance,
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
3
3
|
import "../keys-C7jV6nZg.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { m as c, k as F, l as j, h as k, j as q, n as w, p as A } from "../noRetryInstance-
|
|
5
|
+
import { m as c, k as F, l as j, h as k, j as q, n as w, p as A } from "../noRetryInstance-C0lN2R80.js";
|
|
6
6
|
import "../configs/awayzUrl.js";
|
|
7
7
|
import "../configs/endpoints.js";
|
|
8
8
|
import "react-i18next";
|
|
@@ -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-C0lN2R80.js";
|
|
6
6
|
class E {
|
|
7
7
|
constructor() {
|
|
8
8
|
n(this, "setCurrency", async (e) => {
|
|
@@ -3,7 +3,7 @@ var o = (t, e, a) => e in t ? s(t, e, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var r = (t, e, a) => o(t, typeof e != "symbol" ? e + "" : e, a);
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
6
|
-
import { c as n, b as i } from "../../noRetryInstance-
|
|
6
|
+
import { c as n, b as i } from "../../noRetryInstance-C0lN2R80.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import { ERewardsEndpoints as c } from "../../configs/endpoints.js";
|
|
9
9
|
class m {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import "../../noRetryInstance-
|
|
4
|
-
import { T as a } from "../../TripsService-
|
|
3
|
+
import "../../noRetryInstance-C0lN2R80.js";
|
|
4
|
+
import { T as a } from "../../TripsService-C6HJZJwL.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "../../configs/defaultAwayzConfig.js";
|
|
7
7
|
import "../../configs/endpoints.js";
|
|
@@ -3,7 +3,7 @@ var i = (o, a, t) => a in o ? d(o, a, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var r = (o, a, t) => i(o, typeof a != "symbol" ? a + "" : a, t);
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
6
|
-
import { c as e, b as c, g as A } from "../../noRetryInstance-
|
|
6
|
+
import { c as e, b as c, g as A } from "../../noRetryInstance-C0lN2R80.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import { EWalletEndpoints as s } from "../../configs/endpoints.js";
|
|
9
9
|
class u {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import { E as m } from "../noRetryInstance-
|
|
3
|
+
import { E as m } from "../noRetryInstance-C0lN2R80.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-i18next";
|
|
6
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 */
|