@odynn/awayz-hotels 0.12.4 → 0.12.5
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,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var E = (i, a, s) => a in i ?
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var E = (i, a, s) => a in i ? y(i, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[a] = s;
|
|
3
3
|
var n = (i, a, s) => E(i, typeof a != "symbol" ? a + "" : a, s);
|
|
4
|
-
import { clientInstance as
|
|
4
|
+
import { clientInstance as p, clientNoRetryInstance as C } from "@odynn/awayz-core";
|
|
5
5
|
import { s as T } from "../../stringUtils-BmTiWFHF.js";
|
|
6
6
|
import "../../moment-BGjjqtLQ.js";
|
|
7
7
|
import "../../arrayExtensions-CFEBYUok.js";
|
|
8
|
-
import { c as
|
|
8
|
+
import { c as _ } from "../../objectUtils-Br6N9tQs.js";
|
|
9
9
|
import { E as m } from "../../DateFormats-DZD30Nea.js";
|
|
10
10
|
import "react";
|
|
11
11
|
import { EHotelEndpoints as l } from "../../configs/endpoints.js";
|
|
@@ -16,7 +16,7 @@ class v {
|
|
|
16
16
|
constructor() {
|
|
17
17
|
n(this, "getLocations", async (a) => {
|
|
18
18
|
try {
|
|
19
|
-
const { data: s } = await
|
|
19
|
+
const { data: s } = await p.get(
|
|
20
20
|
l.GET_LOCATIONS,
|
|
21
21
|
{
|
|
22
22
|
params: {
|
|
@@ -34,12 +34,12 @@ class v {
|
|
|
34
34
|
success: !0,
|
|
35
35
|
data: s.data.cities.map(
|
|
36
36
|
(e) => {
|
|
37
|
-
const { search_id: c, search_type: r, description: d, coordinates: g, city:
|
|
37
|
+
const { search_id: c, search_type: r, description: d, coordinates: g, city: f } = e, u = {
|
|
38
38
|
searchId: c,
|
|
39
39
|
searchType: r,
|
|
40
40
|
description: d,
|
|
41
41
|
coordinates: g,
|
|
42
|
-
city:
|
|
42
|
+
city: f
|
|
43
43
|
};
|
|
44
44
|
return o(e) ? (u.country = {
|
|
45
45
|
code: e.country_code,
|
|
@@ -60,12 +60,12 @@ class v {
|
|
|
60
60
|
n(this, "searchByCoords", async (a) => {
|
|
61
61
|
var s, o;
|
|
62
62
|
try {
|
|
63
|
-
const { data: t } = await
|
|
63
|
+
const { data: t } = await p.post(l.SEARCH_HOTELS, {
|
|
64
64
|
...a
|
|
65
65
|
});
|
|
66
66
|
return t != null && t.success ? {
|
|
67
67
|
success: !0,
|
|
68
|
-
data:
|
|
68
|
+
data: _(
|
|
69
69
|
(s = t.data) == null ? void 0 : s.hotels.map((c) => ({
|
|
70
70
|
...c,
|
|
71
71
|
amenities: c.amenities.map((r) => typeof r == "string" ? {
|
|
@@ -88,13 +88,19 @@ class v {
|
|
|
88
88
|
n(this, "searchByHotelId", async (a) => {
|
|
89
89
|
var s, o;
|
|
90
90
|
try {
|
|
91
|
-
const { data: t } = await
|
|
91
|
+
const { data: t } = await p.post(l.GET_HOTEL_DATA, {
|
|
92
92
|
...a
|
|
93
93
|
});
|
|
94
94
|
return t != null && t.success ? {
|
|
95
95
|
success: !0,
|
|
96
|
-
data:
|
|
97
|
-
(s = t.data) == null ? void 0 : s.hotels
|
|
96
|
+
data: _(
|
|
97
|
+
(s = t.data) == null ? void 0 : s.hotels.map((c) => ({
|
|
98
|
+
...c,
|
|
99
|
+
amenities: c.amenities.map((r) => typeof r == "string" ? {
|
|
100
|
+
description: r,
|
|
101
|
+
type: r.toLowerCase().replace(/\s/g, "_")
|
|
102
|
+
} : r)
|
|
103
|
+
}))
|
|
98
104
|
)
|
|
99
105
|
} : {
|
|
100
106
|
success: !1,
|
|
@@ -109,7 +115,7 @@ class v {
|
|
|
109
115
|
});
|
|
110
116
|
n(this, "getTransferPartners", async (a) => {
|
|
111
117
|
try {
|
|
112
|
-
const { data: s } = await
|
|
118
|
+
const { data: s } = await p.get(
|
|
113
119
|
l.GET_TRANSFER_PARTNERS,
|
|
114
120
|
{
|
|
115
121
|
params: {
|
|
@@ -117,7 +123,7 @@ class v {
|
|
|
117
123
|
}
|
|
118
124
|
}
|
|
119
125
|
);
|
|
120
|
-
return
|
|
126
|
+
return _(s.data);
|
|
121
127
|
} catch {
|
|
122
128
|
return [];
|
|
123
129
|
}
|
|
@@ -138,7 +144,7 @@ class v {
|
|
|
138
144
|
), c = ((t = e.data) == null ? void 0 : t.length) > 0 ? e.data[0] : null;
|
|
139
145
|
return {
|
|
140
146
|
success: e.success,
|
|
141
|
-
data: c == null ? null :
|
|
147
|
+
data: c == null ? null : _(c)
|
|
142
148
|
};
|
|
143
149
|
} catch (e) {
|
|
144
150
|
const c = e;
|
|
@@ -166,7 +172,7 @@ class v {
|
|
|
166
172
|
],
|
|
167
173
|
days: s,
|
|
168
174
|
cash_or_points: ["cash", "points"]
|
|
169
|
-
}, { data: t } = await
|
|
175
|
+
}, { data: t } = await p.post(
|
|
170
176
|
l.GET_BEST_CHECKOUT,
|
|
171
177
|
o
|
|
172
178
|
), e = t.data[0];
|