@odynn/awayz-core 0.10.22 → 0.10.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var g = Object.defineProperty;
|
|
2
2
|
var f = (r, t, a) => t in r ? g(r, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : r[t] = a;
|
|
3
|
-
var
|
|
3
|
+
var c = (r, t, a) => f(r, typeof t != "symbol" ? t + "" : t, a);
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
6
6
|
import { t as y } from "../../numberUtils-B4wd-SGR.js";
|
|
7
7
|
import { c as l, b as u, g as p } from "../../noRetryInstance-DNLgOg0E.js";
|
|
8
8
|
import "react";
|
|
9
|
-
import { EBookingEndpoints as
|
|
9
|
+
import { EBookingEndpoints as i } 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) {
|
|
@@ -17,10 +17,10 @@ const h = (r) => {
|
|
|
17
17
|
};
|
|
18
18
|
class b {
|
|
19
19
|
constructor() {
|
|
20
|
-
|
|
20
|
+
c(this, "getHotelBooking", async (t) => {
|
|
21
21
|
var s, e;
|
|
22
22
|
const { data: a } = await l.get(
|
|
23
|
-
`${
|
|
23
|
+
`${i.USER_HOTEL_BOOKINGS}/${t}`
|
|
24
24
|
), n = a.data.accommodation.rooms[0].rates[0];
|
|
25
25
|
return {
|
|
26
26
|
id: a.data._id,
|
|
@@ -86,10 +86,10 @@ class b {
|
|
|
86
86
|
createdAt: a.data.created_at
|
|
87
87
|
};
|
|
88
88
|
});
|
|
89
|
-
|
|
89
|
+
c(this, "getFlightBooking", async (t) => {
|
|
90
90
|
var d, s;
|
|
91
91
|
const { data: a } = await l.get(
|
|
92
|
-
`${
|
|
92
|
+
`${i.USER_FLIGHT_BOOKINGS}/${t}`
|
|
93
93
|
);
|
|
94
94
|
return {
|
|
95
95
|
id: a.data._id,
|
|
@@ -154,12 +154,13 @@ class b {
|
|
|
154
154
|
refundTo: a.data.cancellation_details.refund_to,
|
|
155
155
|
confirmedAt: a.data.cancellation_details.confirmed_at
|
|
156
156
|
} : void 0,
|
|
157
|
-
services: u(a.data.services)
|
|
157
|
+
services: u(a.data.services),
|
|
158
|
+
createdAt: a.data.created_at
|
|
158
159
|
};
|
|
159
160
|
});
|
|
160
|
-
|
|
161
|
+
c(this, "initiateCancelFlightBooking", async (t) => {
|
|
161
162
|
const { data: a } = await l.put(
|
|
162
|
-
`${
|
|
163
|
+
`${i.INITIATE_FLIGHT_CANCEL}/${t}`
|
|
163
164
|
);
|
|
164
165
|
if (!a.success)
|
|
165
166
|
throw new Error("Failed to initiate cancellation");
|
|
@@ -169,25 +170,25 @@ class b {
|
|
|
169
170
|
refundAmount: y(n.refundAmount)
|
|
170
171
|
};
|
|
171
172
|
});
|
|
172
|
-
|
|
173
|
+
c(this, "confirmCancelFlightBooking", async (t) => {
|
|
173
174
|
const { data: a } = await l.put(
|
|
174
|
-
`${
|
|
175
|
+
`${i.CONFIRM_FLIGHT_CANCEL}/${t}`
|
|
175
176
|
);
|
|
176
177
|
return a.success;
|
|
177
178
|
});
|
|
178
|
-
|
|
179
|
+
c(this, "cancelHotelBooking", async (t) => {
|
|
179
180
|
const { data: a } = await l.post(
|
|
180
|
-
`${
|
|
181
|
+
`${i.CANCEL_HOTEL_BOOKING}/${t}`
|
|
181
182
|
);
|
|
182
183
|
return a.success;
|
|
183
184
|
});
|
|
184
|
-
|
|
185
|
+
c(this, "actionAirlineChanges", async ({
|
|
185
186
|
bookingId: t,
|
|
186
187
|
acceptChanges: a,
|
|
187
188
|
aicId: n
|
|
188
189
|
}) => {
|
|
189
190
|
const { data: d } = await l.post(
|
|
190
|
-
|
|
191
|
+
i.ACTION_AIRLINE_CHANGES,
|
|
191
192
|
{
|
|
192
193
|
booking_id: t,
|
|
193
194
|
action_taken: a ? "accepted" : "cancelled",
|
|
@@ -196,18 +197,18 @@ class b {
|
|
|
196
197
|
);
|
|
197
198
|
return d.success;
|
|
198
199
|
});
|
|
199
|
-
|
|
200
|
+
c(this, "cancelPointsBooking", async (t) => {
|
|
200
201
|
const { data: a } = await p.post(
|
|
201
|
-
`${
|
|
202
|
+
`${i.REFUND_POINTS_BOOKING}`,
|
|
202
203
|
{
|
|
203
204
|
bookingId: t
|
|
204
205
|
}
|
|
205
206
|
);
|
|
206
207
|
return a.success;
|
|
207
208
|
});
|
|
208
|
-
|
|
209
|
+
c(this, "getPointsAsCash", async (t) => {
|
|
209
210
|
const { data: a } = await p.get(
|
|
210
|
-
`${
|
|
211
|
+
`${i.BOOKING_POINTS_AS_CASH}/${t}`
|
|
211
212
|
);
|
|
212
213
|
return {
|
|
213
214
|
...a.data,
|