@odynn/awayz-core 0.10.34 → 0.10.36
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-C_TStOtx.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 +95 -82
- 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-wA6BVsyM.js} +411 -409
- 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
|
@@ -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-wA6BVsyM.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-wA6BVsyM.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-wA6BVsyM.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-wA6BVsyM.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-wA6BVsyM.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-wA6BVsyM.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-wA6BVsyM.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-wA6BVsyM.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-wA6BVsyM.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-wA6BVsyM.js";
|
|
4
|
+
import { T as a } from "../../TripsService-C_TStOtx.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-wA6BVsyM.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-wA6BVsyM.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 */
|