@odynn/awayz-core 0.5.0 → 0.5.2

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,21 +1,22 @@
1
- var l = Object.defineProperty;
2
- var u = (r, e, a) => e in r ? l(r, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : r[e] = a;
3
- var c = (r, e, a) => u(r, typeof e != "symbol" ? e + "" : e, a);
1
+ var u = Object.defineProperty;
2
+ var _ = (n, e, a) => e in n ? u(n, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[e] = a;
3
+ var c = (n, e, a) => _(n, typeof e != "symbol" ? e + "" : e, a);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
- import { c as i, b as s } from "../../AccountService-CtMwRIoL.js";
5
+ import { c as i, b as m } from "../../AccountService-CtMwRIoL.js";
6
6
  import "react";
7
7
  import { EBookingEndpoints as d } from "../../configs/endpoints.js";
8
- const _ = (r) => {
9
- const e = /P((\d+)D)?T((\d+)H)?((\d+)M)?/, a = r.match(e);
8
+ const p = (n) => {
9
+ const e = /P((\d+)D)?T((\d+)H)?((\d+)M)?/, a = n.match(e);
10
10
  if (a) {
11
- const o = a[2] ? `${a[2]}d ` : "", t = a[4] ? `${a[4]}h ` : "", n = a[6] ? `${a[6]}m` : "";
12
- return `${o}${t}${n}`.trim();
11
+ const o = a[2] ? `${a[2]}d ` : "", t = a[4] ? `${a[4]}h ` : "", s = a[6] ? `${a[6]}m` : "";
12
+ return `${o}${t}${s}`.trim();
13
13
  } else
14
- return r;
14
+ return n;
15
15
  };
16
- class p {
16
+ class g {
17
17
  constructor() {
18
18
  c(this, "getHotelBooking", async (e) => {
19
+ var s;
19
20
  const { data: a } = await i.get(
20
21
  `${d.USER_HOTEL_BOOKINGS}/${e}`
21
22
  ), o = a.data.accommodation.rooms[0].rates[0];
@@ -49,18 +50,18 @@ class p {
49
50
  latitude: a.data.accommodation.location.geographic_coordinates.latitude,
50
51
  longitude: a.data.accommodation.location.geographic_coordinates.longitude
51
52
  },
52
- images: a.data.accommodation.photos.map((n) => n.url),
53
- guests: a.data.guests.map((n, m) => ({
54
- familyName: n.family_name,
55
- givenName: n.given_name,
56
- type: a.data.guest_types[m].type
53
+ images: a.data.accommodation.photos.map((r) => r.url),
54
+ guests: a.data.guests.map((r, l) => ({
55
+ familyName: r.family_name,
56
+ givenName: r.given_name,
57
+ type: a.data.guest_types[l].type
57
58
  })),
58
- numberOfRooms: a.data.rooms,
59
+ numberOfRooms: (s = a.data.rooms) == null ? void 0 : s.length,
59
60
  cancellationTimeline: o.cancellation_timeline.map(
60
- (n) => ({
61
- refundAmount: parseFloat(n.refund_amount),
62
- currency: n.currency,
63
- before: n.before
61
+ (r) => ({
62
+ refundAmount: parseFloat(r.refund_amount),
63
+ currency: r.currency,
64
+ before: r.before
64
65
  })
65
66
  )
66
67
  };
@@ -116,9 +117,9 @@ class p {
116
117
  arrivingAt: t.segments.getLast().arriving_at,
117
118
  numberOfStops: t.segments.length - 1,
118
119
  reference: a.data.booking_reference,
119
- durationInMinutes: _(t.duration),
120
- origin: s(t.origin),
121
- destination: s(t.destination)
120
+ durationInMinutes: p(t.duration),
121
+ origin: m(t.origin),
122
+ destination: m(t.destination)
122
123
  })),
123
124
  availableActions: a.data.available_actions
124
125
  };
@@ -143,7 +144,7 @@ class p {
143
144
  });
144
145
  }
145
146
  }
146
- const k = new p();
147
+ const A = new g();
147
148
  export {
148
- k as BookingService
149
+ A as BookingService
149
150
  };
@@ -1,5 +1,5 @@
1
- import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';var p = Object.defineProperty;
2
- var m = (t, r, e) => r in t ? p(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
1
+ import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';var y = Object.defineProperty;
2
+ var m = (t, r, e) => r in t ? y(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
3
  var n = (t, r, e) => m(t, typeof r != "symbol" ? r + "" : r, e);
4
4
  import "../../arrayExtensions-DlcBOj5a.js";
5
5
  import { A as C, E, c as s } from "../../AccountService-CtMwRIoL.js";
@@ -12,6 +12,7 @@ import "@tanstack/react-query";
12
12
  import "../noRetryInstance.js";
13
13
  /* empty css */
14
14
  /* empty css */
15
+ import "react-i18next";
15
16
  /* empty css */
16
17
  /* empty css */
17
18
  /* empty css */
@@ -28,12 +29,12 @@ class d {
28
29
  });
29
30
  if (!c)
30
31
  throw new Error("Failed to fetch user data");
31
- const { userRegion: i, preferences: u } = o, { data: y } = await s.post(a.CURRENCY_CONVERSION, {
32
+ const { userRegion: i, preferences: u } = o, { data: p } = await s.post(a.CURRENCY_CONVERSION, {
32
33
  target_currency: e ?? u.currency ?? i.currency,
33
34
  base_currency: r
34
35
  });
35
36
  if (c)
36
- return y.data.conversion_rate;
37
+ return p.data.conversion_rate;
37
38
  } catch (c) {
38
39
  console.error(c);
39
40
  }
@@ -67,7 +68,7 @@ class d {
67
68
  });
68
69
  }
69
70
  }
70
- const A = new d();
71
+ const F = new d();
71
72
  export {
72
- A as CurrencyService
73
+ F as CurrencyService
73
74
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odynn/awayz-core",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"