@odynn/awayz-core 0.9.23 → 0.9.25

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.
@@ -30,21 +30,21 @@ class O {
30
30
  );
31
31
  if (!(a != null && a.success))
32
32
  return [];
33
- const s = a.data.map((c) => ({
33
+ const t = a.data.map((c) => ({
34
34
  ...c,
35
35
  flightBookings: T(c.flight_bookings ?? []),
36
36
  hotelBookings: b(c.hotel_bookings ?? [])
37
37
  }));
38
- return d(s);
38
+ return d(t);
39
39
  });
40
40
  n(this, "updateTrip", async (e, a) => {
41
- const { data: s } = await i.put(
41
+ const { data: t } = await i.put(
42
42
  `${o.TRIPS}/${e}`,
43
43
  D(u(a))
44
44
  );
45
- return s != null && s.success ? {
45
+ return t != null && t.success ? {
46
46
  success: !0,
47
- data: d(s.data),
47
+ data: d(t.data),
48
48
  message: "Trip updated successfully."
49
49
  } : {
50
50
  success: !1,
@@ -69,30 +69,30 @@ class O {
69
69
  hotelBookings: []
70
70
  };
71
71
  });
72
- n(this, "addBookingToTrip", async (e, a, s) => {
73
- const { data: t } = await i.put(o.ADD_BOOKING, {
72
+ n(this, "addBookingToTrip", async (e, a, t) => {
73
+ const { data: s } = await i.put(o.ADD_BOOKING, {
74
74
  trip_id: e,
75
75
  booking_id: a,
76
- booking_type: s
76
+ booking_type: t
77
77
  });
78
- return t.success;
78
+ return s.success;
79
79
  });
80
- n(this, "removeBookingFromTrip", async (e, a, s) => {
81
- const { data: t } = await i.put(
80
+ n(this, "removeBookingFromTrip", async (e, a, t) => {
81
+ const { data: s } = await i.put(
82
82
  o.REMOVE_BOOKING,
83
83
  u({
84
84
  trip_id: e,
85
85
  booking_id: a,
86
- booking_type: s
86
+ booking_type: t
87
87
  })
88
88
  );
89
- return t.success;
89
+ return s.success;
90
90
  });
91
91
  }
92
92
  }
93
93
  const T = (r) => r.map((e) => {
94
94
  var c, l, _, g;
95
- const a = e.slices.length > 1, s = e.slices[0], t = a ? e.slices.getLast() : void 0;
95
+ const a = e.slices.length > 1, t = e.slices[0], s = a ? e.slices.getLast() : void 0;
96
96
  return d({
97
97
  id: e._id,
98
98
  reference: e.booking_reference,
@@ -107,24 +107,24 @@ const T = (r) => r.map((e) => {
107
107
  };
108
108
  }),
109
109
  arrival: {
110
- airportCode: s.destination,
110
+ airportCode: t.destination,
111
111
  location: ""
112
112
  },
113
113
  departure: {
114
- airportCode: s.origin,
114
+ airportCode: t.origin,
115
115
  location: ""
116
116
  },
117
- class: s.fare_brand_name,
117
+ class: t.fare_brand_name,
118
118
  passengers: e.passengers.length,
119
119
  hasAirlineChanges: !1,
120
120
  orderId: e.order_id,
121
121
  type: e.type,
122
122
  cancelledAt: e.cancelled_at,
123
123
  isRoundTrip: a,
124
- outboundArrivalDate: (l = (c = s.segments) == null ? void 0 : c.getLast()) == null ? void 0 : l.arriving_at,
125
- inboundDepartureDate: t ? (g = (_ = t.segments) == null ? void 0 : _[0]) == null ? void 0 : g.departing_at : void 0,
126
- inboundDeparture: t ? { airportCode: t.origin, location: "" } : void 0,
127
- inboundArrival: t ? { airportCode: t.destination, location: "" } : void 0
124
+ outboundArrivalDate: t.arriving_at ?? ((l = (c = t.segments) == null ? void 0 : c.getLast()) == null ? void 0 : l.arriving_at),
125
+ inboundDepartureDate: s ? s.departing_at ?? ((g = (_ = s.segments) == null ? void 0 : _[0]) == null ? void 0 : g.departing_at) : void 0,
126
+ inboundDeparture: s ? { airportCode: s.origin, location: "" } : void 0,
127
+ inboundArrival: s ? { airportCode: s.destination, location: "" } : void 0
128
128
  });
129
129
  }), b = (r) => r.map(
130
130
  (e) => d({
@@ -1 +1 @@
1
- @import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.selected-flight-card{--cutout-top: 180px;width:380px;padding:1px;border-radius:.5rem;position:relative;overflow:hidden;background:linear-gradient(90deg,transparent 0%,transparent 10%,var(--border, #e7eef3) 10%,var(--border, #e7eef3) 90%,transparent 90%,transparent 100%);animation:fade-in .3s ease-in-out both;transition:all .2s ease-in-out;cursor:pointer}.selected-flight-card:nth-child(1){animation-delay:.1s}.selected-flight-card:nth-child(2){animation-delay:.2s}.selected-flight-card:nth-child(3){animation-delay:.3s}.selected-flight-card:nth-child(4){animation-delay:.4s}.selected-flight-card:nth-child(5){animation-delay:.5s}.selected-flight-card:nth-child(6){animation-delay:.6s}.selected-flight-card:nth-child(7){animation-delay:.7s}.selected-flight-card:nth-child(8){animation-delay:.8s}.selected-flight-card:nth-child(9){animation-delay:.9s}.selected-flight-card:nth-child(10){animation-delay:1s}.selected-flight-card:hover{filter:drop-shadow(0px 0px 20px rgba(2,66,109,.1))}.selected-flight-card:before{content:"";position:absolute;box-sizing:content-box;aspect-ratio:1;height:30px;width:30px;border-radius:100%;border:14rem solid var(--border, #e7eef3);top:var(--cutout-top);left:0;transform:translate(-50%,-50%)}.selected-flight-card:after{content:"";position:absolute;box-sizing:content-box;aspect-ratio:1;height:30px;width:30px;border-radius:100%;border:14rem solid var(--border, #e7eef3);top:var(--cutout-top);right:0;transform:translate(50%,-50%)}.selected-flight-card .cancelled-notice{background-color:rgba(var(--warning, #ff7f2f),.1);font-weight:600;padding:.25rem;border-radius:.5rem;border:2px solid var(--warning, #ff7f2f);color:var(--warning, #ff7f2f);font-size:.8rem;text-align:center;width:fit-content}.selected-flight-card .content{overflow:hidden;padding:1rem;padding-bottom:0;border-radius:.4rem;width:100%;margin:0 auto;position:relative;height:100%;z-index:1;display:flex;flex-direction:column;gap:1rem;background:linear-gradient(90deg,transparent 0%,transparent 10%,var(--foreground, #fff) 10%,var(--foreground, #fff) 90%,transparent 90%,transparent 100%)}.selected-flight-card .content *{z-index:2}.selected-flight-card .content:before{content:"";position:absolute;box-sizing:content-box;aspect-ratio:1;height:31px;width:31px;border-radius:100%;border:14rem solid var(--foreground, #fff);top:calc(var(--cutout-top) - 1px);left:-1.5px;transform:translate(-50%,-50%)}.selected-flight-card .content:after{content:"";position:absolute;box-sizing:content-box;aspect-ratio:1;height:31px;width:31px;border-radius:100%;border:14rem solid var(--foreground, #fff);top:calc(var(--cutout-top) - 1px);right:-1px;transform:translate(49.99%,-50%)}.selected-flight-card .top-section{flex:1;min-height:calc(var(--cutout-top) - 1rem - 20px)}.selected-flight-card .top-section .header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem}.selected-flight-card .top-section .header>div{display:flex;align-items:center;gap:.5rem}.selected-flight-card .top-section .header .airline-logo,.selected-flight-card .top-section .header .airline-logo img{max-height:20px}.selected-flight-card .top-section .header .id-and-icon{display:flex;align-items:center;gap:1rem}.selected-flight-card .top-section .header .id-and-icon>span{font-weight:700}.selected-flight-card .top-section .header .id-and-icon .context-button{display:flex;border:1px solid var(--border, #e7eef3);border-radius:.5rem;padding:.5rem;color:var(--text-light, rgba(37, 46, 52, .2509803922));cursor:pointer}.selected-flight-card .top-section .header .id-and-icon .context-button:hover{background-color:var(--border, #e7eef3)}.selected-flight-card .top-section .flight{display:flex;align-items:center;font-size:1.8rem;position:relative;justify-content:space-between}.selected-flight-card .top-section .flight *{z-index:2}.selected-flight-card .top-section .flight .flight-trail{margin:5px 0;height:2px;background:repeating-linear-gradient(90deg,var(--border, #e7eef3) 0 20px,rgba(0,0,0,0) 0 30px);width:80%;position:absolute;left:50%;transform:translate(-50%);z-index:1}.selected-flight-card .top-section .flight svg{fill:#d8e3ea}.selected-flight-card .top-section .flight>p{font-weight:600;background-color:var(--foreground, #fff)}.selected-flight-card .top-section .flight .departure-title{padding-right:.5rem}.selected-flight-card .top-section .flight .arrival-title{padding-left:.5rem}.selected-flight-card .top-section .flight-details .destination span{font-size:1rem;font-weight:400}.selected-flight-card .top-section .flight-details .destination span:last-child{text-align:right}.selected-flight-card .top-section .flight-details .time p{color:var(--text-light, rgba(37, 46, 52, .2509803922))}.selected-flight-card .top-section .flight-details .destination,.selected-flight-card .top-section .flight-details .time{display:flex;justify-content:space-between}.selected-flight-card .top-section .leg-separator{margin:.5rem 0;border-top:1px solid var(--border, #e7eef3)}.selected-flight-card.round-trip .content{gap:.5rem}.selected-flight-card.round-trip .top-section .header{margin-bottom:.5rem}.selected-flight-card.round-trip .top-section .flight{font-size:1.2rem}.selected-flight-card.round-trip .top-section .flight svg{font-size:1.6rem}.selected-flight-card.round-trip .top-section .flight-details .destination span{font-size:.8rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.selected-flight-card.round-trip .top-section .flight-details .time p{font-size:.8rem}.selected-flight-card.round-trip .top-section .leg-separator{margin:.25rem 0}.selected-flight-card .mid-section{height:10px}.selected-flight-card .mid-section .dashes{position:absolute;top:calc(var(--cutout-top) - 1px);left:20px;right:20px;border:dashed 2px var(--border, #e7eef3)}.selected-flight-card .bottom-section{display:flex;flex-direction:column;gap:1rem;font-size:.8rem}.selected-flight-card .bottom-section .bottom-header{display:flex;justify-content:space-between;border:1px solid var(--border, #e7eef3);border-radius:.5rem;padding:.5rem}.selected-flight-card .bottom-section .bottom-header .id-and-icon{display:flex;gap:1rem}.selected-flight-card .bottom-section .bottom-header .id-and-icon>span{font-weight:700}.selected-flight-card .bottom-section .bottom-header .id-and-icon .copy-icon{font-size:larger}.selected-flight-card .bottom-section .bottom-section-details{display:flex;gap:1rem}.selected-flight-card .bottom-section .bottom-section-details>div{display:flex;width:50%;justify-content:space-between;margin-bottom:1rem;border:1px solid var(--border, #e7eef3);border-radius:.5rem;padding:.5rem}.selected-flight-card .bottom-section .bottom-section-details>div>span{font-weight:700}
1
+ @import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";*{font-family:Inter,sans-serif!important;margin:0;padding:0;box-sizing:border-box}:root{font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.selected-flight-card{--cutout-top: 180px;width:380px;padding:1px;border-radius:.5rem;position:relative;overflow:hidden;background:linear-gradient(90deg,transparent 0%,transparent 10%,var(--border, #e7eef3) 10%,var(--border, #e7eef3) 90%,transparent 90%,transparent 100%);animation:fade-in .3s ease-in-out both;transition:all .2s ease-in-out;cursor:pointer}.selected-flight-card:nth-child(1){animation-delay:.1s}.selected-flight-card:nth-child(2){animation-delay:.2s}.selected-flight-card:nth-child(3){animation-delay:.3s}.selected-flight-card:nth-child(4){animation-delay:.4s}.selected-flight-card:nth-child(5){animation-delay:.5s}.selected-flight-card:nth-child(6){animation-delay:.6s}.selected-flight-card:nth-child(7){animation-delay:.7s}.selected-flight-card:nth-child(8){animation-delay:.8s}.selected-flight-card:nth-child(9){animation-delay:.9s}.selected-flight-card:nth-child(10){animation-delay:1s}.selected-flight-card:hover{filter:drop-shadow(0px 0px 20px rgba(2,66,109,.1))}.selected-flight-card:before{content:"";position:absolute;box-sizing:content-box;aspect-ratio:1;height:30px;width:30px;border-radius:100%;border:14rem solid var(--border, #e7eef3);top:var(--cutout-top);left:0;transform:translate(-50%,-50%)}.selected-flight-card:after{content:"";position:absolute;box-sizing:content-box;aspect-ratio:1;height:30px;width:30px;border-radius:100%;border:14rem solid var(--border, #e7eef3);top:var(--cutout-top);right:0;transform:translate(50%,-50%)}.selected-flight-card .cancelled-notice{background-color:rgba(var(--warning, #ff7f2f),.1);font-weight:600;padding:.25rem;border-radius:.5rem;border:2px solid var(--warning, #ff7f2f);color:var(--warning, #ff7f2f);font-size:.8rem;text-align:center;width:fit-content}.selected-flight-card .content{overflow:hidden;padding:1rem;padding-bottom:0;border-radius:.4rem;width:100%;margin:0 auto;position:relative;height:100%;z-index:1;display:flex;flex-direction:column;gap:1rem;background:linear-gradient(90deg,transparent 0%,transparent 10%,var(--foreground, #fff) 10%,var(--foreground, #fff) 90%,transparent 90%,transparent 100%)}.selected-flight-card .content *{z-index:2}.selected-flight-card .content:before{content:"";position:absolute;box-sizing:content-box;aspect-ratio:1;height:31px;width:31px;border-radius:100%;border:14rem solid var(--foreground, #fff);top:calc(var(--cutout-top) - 1px);left:-1.5px;transform:translate(-50%,-50%)}.selected-flight-card .content:after{content:"";position:absolute;box-sizing:content-box;aspect-ratio:1;height:31px;width:31px;border-radius:100%;border:14rem solid var(--foreground, #fff);top:calc(var(--cutout-top) - 1px);right:-1px;transform:translate(49.99%,-50%)}.selected-flight-card .top-section{flex:1;min-height:calc(var(--cutout-top) - 1rem - 20px)}.selected-flight-card .top-section .header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem}.selected-flight-card .top-section .header>div{display:flex;align-items:center;gap:.5rem}.selected-flight-card .top-section .header .airline-logo,.selected-flight-card .top-section .header .airline-logo img{max-height:20px}.selected-flight-card .top-section .header .id-and-icon{display:flex;align-items:center;gap:1rem}.selected-flight-card .top-section .header .id-and-icon>span{font-weight:700}.selected-flight-card .top-section .header .id-and-icon .context-button{display:flex;border:1px solid var(--border, #e7eef3);border-radius:.5rem;padding:.5rem;color:var(--text-light, rgba(37, 46, 52, .2509803922));cursor:pointer}.selected-flight-card .top-section .header .id-and-icon .context-button:hover{background-color:var(--border, #e7eef3)}.selected-flight-card .top-section .flight{display:flex;align-items:center;font-size:1.8rem;position:relative;justify-content:space-between}.selected-flight-card .top-section .flight *{z-index:2}.selected-flight-card .top-section .flight .flight-trail{margin:5px 0;height:2px;background:repeating-linear-gradient(90deg,var(--border, #e7eef3) 0 20px,rgba(0,0,0,0) 0 30px);width:80%;position:absolute;left:50%;transform:translate(-50%);z-index:1}.selected-flight-card .top-section .flight svg{fill:#d8e3ea}.selected-flight-card .top-section .flight>p{font-weight:600;background-color:var(--foreground, #fff)}.selected-flight-card .top-section .flight .departure-title{flex:1;padding-right:.5rem}.selected-flight-card .top-section .flight .arrival-title{flex:1;padding-left:.5rem;text-align:right}.selected-flight-card .top-section .flight-details .destination span{font-size:1rem;font-weight:400}.selected-flight-card .top-section .flight-details .destination span:last-child{text-align:right}.selected-flight-card .top-section .flight-details .time p{color:var(--text-light, rgba(37, 46, 52, .2509803922))}.selected-flight-card .top-section .flight-details .destination,.selected-flight-card .top-section .flight-details .time{display:flex;justify-content:space-between}.selected-flight-card .top-section .leg-separator{margin:.5rem 0;border-top:1px solid var(--border, #e7eef3)}.selected-flight-card.round-trip .content{gap:.5rem}.selected-flight-card.round-trip .top-section .header{margin-bottom:.5rem}.selected-flight-card.round-trip .top-section .flight{font-size:1.2rem}.selected-flight-card.round-trip .top-section .flight svg{font-size:1.6rem}.selected-flight-card.round-trip .top-section .flight-details .destination span{font-size:.8rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.selected-flight-card.round-trip .top-section .flight-details .time p{font-size:.8rem}.selected-flight-card.round-trip .top-section .leg-separator{margin:.25rem 0}.selected-flight-card .mid-section{height:10px}.selected-flight-card .mid-section .dashes{position:absolute;top:calc(var(--cutout-top) - 1px);left:20px;right:20px;border:dashed 2px var(--border, #e7eef3)}.selected-flight-card .bottom-section{display:flex;flex-direction:column;gap:1rem;font-size:.8rem}.selected-flight-card .bottom-section .bottom-header{display:flex;justify-content:space-between;border:1px solid var(--border, #e7eef3);border-radius:.5rem;padding:.5rem}.selected-flight-card .bottom-section .bottom-header .id-and-icon{display:flex;gap:1rem}.selected-flight-card .bottom-section .bottom-header .id-and-icon>span{font-weight:700}.selected-flight-card .bottom-section .bottom-header .id-and-icon .copy-icon{font-size:larger}.selected-flight-card .bottom-section .bottom-section-details{display:flex;gap:1rem}.selected-flight-card .bottom-section .bottom-section-details>div{display:flex;width:50%;justify-content:space-between;margin-bottom:1rem;border:1px solid var(--border, #e7eef3);border-radius:.5rem;padding:.5rem}.selected-flight-card .bottom-section .bottom-section-details>div>span{font-weight:700}
@@ -13,7 +13,7 @@ import { awayzClient as o } from "../../configs/awayzClient.js";
13
13
  import "../../index-Cv-wvFlM.js";
14
14
  import "../../context/AwayzContext.js";
15
15
  /* empty css */
16
- import { T as n } from "../../TripsService-GImsS17_.js";
16
+ import { T as n } from "../../TripsService-CJxjOcrR.js";
17
17
  const b = ({
18
18
  tripId: t,
19
19
  tripDetails: s
@@ -1,5 +1,5 @@
1
1
  import { h as p } from "../../arrayExtensions-DlcBOj5a.js";
2
- import { D as f } from "../../TripsService-GImsS17_.js";
2
+ import { D as f } from "../../TripsService-CJxjOcrR.js";
3
3
  import "react";
4
4
  import { renderHook as o, waitFor as i } from "../../tests/TestWrapper.js";
5
5
  import { EMyTripsEndpoints as c } from "../../configs/endpoints.js";
@@ -1,6 +1,6 @@
1
1
  import "../../arrayExtensions-DlcBOj5a.js";
2
2
  import "../../noRetryInstance-DKhe8ju0.js";
3
- import { T } from "../../TripsService-GImsS17_.js";
3
+ import { T } from "../../TripsService-CJxjOcrR.js";
4
4
  import "react";
5
5
  import "../../configs/defaultAwayzConfig.js";
6
6
  import "../../configs/endpoints.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odynn/awayz-core",
3
- "version": "0.9.23",
3
+ "version": "0.9.25",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"