@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 f = Object.defineProperty;
2
- var E = (i, a, s) => a in i ? f(i, a, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[a] = s;
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 _, clientNoRetryInstance as C } from "@odynn/awayz-core";
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 p } from "../../objectUtils-Br6N9tQs.js";
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 _.get(
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: y } = e, u = {
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: y
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 _.post(l.SEARCH_HOTELS, {
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: p(
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 _.post(l.GET_HOTEL_DATA, {
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: p(
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 _.get(
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 p(s.data);
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 : p(c)
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 _.post(
175
+ }, { data: t } = await p.post(
170
176
  l.GET_BEST_CHECKOUT,
171
177
  o
172
178
  ), e = t.data[0];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@odynn/awayz-hotels",
3
3
  "private": false,
4
- "version": "0.12.4",
4
+ "version": "0.12.5",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"