@odynn/awayz-core 0.3.1 → 0.3.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.
- package/dist/components/Bookings/FlightBooking/FlightBooking.js +7 -6
- package/dist/components/Bookings/HotelBooking/HotelBooking.js +4 -3
- package/dist/components/CashValue/CashValue.js +7 -4
- package/dist/components/CashValue/CashValue.stories.js +17 -14
- package/dist/components/Menu/Menu.js +5 -4
- package/dist/components/index.js +9 -5
- package/dist/configs/baseUrl.js +8 -5
- package/dist/hooks/useBookingManagement/useBookingManagement.js +18 -15
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +10 -7
- package/dist/hooks/useTripManagement/useTripManagement.js +12 -9
- package/dist/hooks/useTripManagement/useTripManagement.test.js +5 -2
- package/dist/hooks/useWallet/useWallet.js +17 -14
- package/dist/hooks/useWallet/useWallet.test.js +11 -8
- package/dist/lib/components/index.d.ts +2 -0
- package/dist/lib/configs/awayzConfig.d.ts +4 -0
- package/dist/lib/configs/baseUrl.d.ts +1 -0
- package/dist/lib/services/index.d.ts +1 -0
- package/dist/lib/services/trips/TripService.types.d.ts +1 -64
- package/dist/main.js +30 -24
- package/dist/providers/AwayzProvider.js +19 -16
- package/dist/services/currency/CurrencyService.js +10 -7
- package/dist/services/index.js +9 -7
- package/dist/services/trips/TripService.types.js +2 -7
- package/package.json +1 -1
- /package/dist/assets/{FlightBooking.css → _styles2.css} +0 -0
- /package/dist/assets/{Menu.css → _styles3.css} +0 -0
- /package/dist/assets/{HotelBooking.css → _styles4.css} +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { F as g } from "../../../index-COgXcb6p.js";
|
|
3
|
+
import '../../../assets/_styles2.css';/* empty css */
|
|
3
4
|
import { h as n } from "../../../arrayExtensions-DlcBOj5a.js";
|
|
4
5
|
import { E as t } from "../../../DateFormats-DZD30Nea.js";
|
|
5
6
|
import "react";
|
|
6
7
|
import f from "../../Menu/Menu.js";
|
|
7
|
-
|
|
8
|
+
const j = ({
|
|
8
9
|
airlines: c,
|
|
9
10
|
departure: d,
|
|
10
11
|
arrival: l,
|
|
11
|
-
bookingRef:
|
|
12
|
+
bookingRef: h,
|
|
12
13
|
flightClass: p,
|
|
13
14
|
numberOfPassengers: v,
|
|
14
15
|
cancelledAt: s,
|
|
@@ -16,7 +17,7 @@ import '../../../assets/FlightBooking.css';const b = ({
|
|
|
16
17
|
onClick: N,
|
|
17
18
|
contextOptions: r = []
|
|
18
19
|
}) => {
|
|
19
|
-
var
|
|
20
|
+
var m;
|
|
20
21
|
return /* @__PURE__ */ e("div", { className: "selected-flight-card", onClick: N, children: /* @__PURE__ */ i("div", { className: "content", children: [
|
|
21
22
|
/* @__PURE__ */ i("div", { className: "top-section", children: [
|
|
22
23
|
/* @__PURE__ */ i("div", { className: "header", children: [
|
|
@@ -59,7 +60,7 @@ import '../../../assets/FlightBooking.css';const b = ({
|
|
|
59
60
|
s && /* @__PURE__ */ e("div", { className: "cancelled-notice", children: /* @__PURE__ */ i("p", { children: [
|
|
60
61
|
"Cancelled:",
|
|
61
62
|
" ",
|
|
62
|
-
(
|
|
63
|
+
(m = n(s)) == null ? void 0 : m.format(
|
|
63
64
|
t.USStringDateFormat
|
|
64
65
|
)
|
|
65
66
|
] }) }),
|
|
@@ -68,7 +69,7 @@ import '../../../assets/FlightBooking.css';const b = ({
|
|
|
68
69
|
/* @__PURE__ */ i("div", { className: "bottom-header", children: [
|
|
69
70
|
/* @__PURE__ */ e("p", { children: "Booking Confirmation" }),
|
|
70
71
|
" ",
|
|
71
|
-
/* @__PURE__ */ e("div", { className: "id-and-icon", children: /* @__PURE__ */ e("span", { children:
|
|
72
|
+
/* @__PURE__ */ e("div", { className: "id-and-icon", children: /* @__PURE__ */ e("span", { children: h }) })
|
|
72
73
|
] }),
|
|
73
74
|
/* @__PURE__ */ i("div", { className: "bottom-section-details", children: [
|
|
74
75
|
/* @__PURE__ */ i("div", { children: [
|
|
@@ -84,5 +85,5 @@ import '../../../assets/FlightBooking.css';const b = ({
|
|
|
84
85
|
] }) });
|
|
85
86
|
};
|
|
86
87
|
export {
|
|
87
|
-
|
|
88
|
+
j as FlightBooking
|
|
88
89
|
};
|
|
@@ -3,12 +3,13 @@ import { G as g } from "../../../index-COgXcb6p.js";
|
|
|
3
3
|
import { h as k } from "../../../arrayExtensions-DlcBOj5a.js";
|
|
4
4
|
import { E as N } from "../../../DateFormats-DZD30Nea.js";
|
|
5
5
|
import "react";
|
|
6
|
+
import '../../../assets/_styles4.css';/* empty css */
|
|
6
7
|
import u from "../../Menu/Menu.js";
|
|
7
|
-
|
|
8
|
+
const c = (r, o, t = o + "s") => r === 1 ? o : t;
|
|
8
9
|
function $(r) {
|
|
9
10
|
return g({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z" }, child: [] }, { tag: "circle", attr: { cx: "12", cy: "10", r: "3" }, child: [] }] })(r);
|
|
10
11
|
}
|
|
11
|
-
const
|
|
12
|
+
const B = ({
|
|
12
13
|
hotelName: r,
|
|
13
14
|
address: o,
|
|
14
15
|
hotelImage: t,
|
|
@@ -71,5 +72,5 @@ const y = ({
|
|
|
71
72
|
] });
|
|
72
73
|
};
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
B as HotelBooking
|
|
75
76
|
};
|
|
@@ -7,12 +7,15 @@ import "../../arrayExtensions-DlcBOj5a.js";
|
|
|
7
7
|
import { E as gt } from "../../AccountService-Ct4hShV-.js";
|
|
8
8
|
import { useQuery as wt } from "@tanstack/react-query";
|
|
9
9
|
import { CurrencyService as Ct } from "../../services/currency/CurrencyService.js";
|
|
10
|
-
import '../../assets/_styles.css';/* empty css */
|
|
10
|
+
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
|
|
11
11
|
import "../../context/AwayzContext.js";
|
|
12
12
|
import "../../configs/awayzClient.js";
|
|
13
13
|
import { useAwayzContext as Et } from "../../hooks/useAwayzContext.js";
|
|
14
14
|
import "../../services/noRetryInstance.js";
|
|
15
15
|
import { EInvalidAmountDisplayOption as M, EToolTipPosition as Pt } from "./CashValueTypes.js";
|
|
16
|
+
/* empty css */
|
|
17
|
+
/* empty css */
|
|
18
|
+
/* empty css */
|
|
16
19
|
const j = (e, t) => {
|
|
17
20
|
var r = new Intl.NumberFormat("en-US", {
|
|
18
21
|
style: "currency",
|
|
@@ -466,7 +469,7 @@ var Qt = Object.freeze({
|
|
|
466
469
|
)
|
|
467
470
|
);
|
|
468
471
|
_e.displayName = Jt;
|
|
469
|
-
var er = _e, [V,
|
|
472
|
+
var er = _e, [V, Br] = he("Tooltip", [
|
|
470
473
|
Pe
|
|
471
474
|
]), Y = Pe(), Le = "TooltipProvider", tr = 700, X = "tooltip.open", [rr, J] = V(Le), Ie = (e) => {
|
|
472
475
|
const {
|
|
@@ -777,7 +780,7 @@ function vr(e) {
|
|
|
777
780
|
return r.pop(), t.length === 1 && r.length === 1 && t[0].x === r[0].x && t[0].y === r[0].y ? t : t.concat(r);
|
|
778
781
|
}
|
|
779
782
|
var mr = Ie, yr = Me, gr = He, wr = ke, Cr = Fe, Er = Be;
|
|
780
|
-
const Pr = 1e3 * 60 * 60,
|
|
783
|
+
const Pr = 1e3 * 60 * 60, Ur = ({
|
|
781
784
|
amount: e,
|
|
782
785
|
currency: t,
|
|
783
786
|
position: r = Pt.RIGHT,
|
|
@@ -865,6 +868,6 @@ const Pr = 1e3 * 60 * 60, $r = ({
|
|
|
865
868
|
) })
|
|
866
869
|
] }) });
|
|
867
870
|
export {
|
|
868
|
-
|
|
871
|
+
Ur as CashValue,
|
|
869
872
|
Pr as CurrencyCallStaleTimeMs
|
|
870
873
|
};
|
|
@@ -7,10 +7,13 @@ import "../../arrayExtensions-DlcBOj5a.js";
|
|
|
7
7
|
import "../../AccountService-Ct4hShV-.js";
|
|
8
8
|
import "../../configs/awayzClient.js";
|
|
9
9
|
import "@tanstack/react-query";
|
|
10
|
-
import { EAuthFlow as
|
|
10
|
+
import { EAuthFlow as i } from "../../types/EAuthFlow.js";
|
|
11
11
|
import "../../services/noRetryInstance.js";
|
|
12
12
|
import { EToolTipPosition as t, EInvalidAmountDisplayOption as o } from "./CashValueTypes.js";
|
|
13
|
-
|
|
13
|
+
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';/* empty css */
|
|
14
|
+
/* empty css */
|
|
15
|
+
/* empty css */
|
|
16
|
+
const b = {
|
|
14
17
|
title: "Core/Cash Value",
|
|
15
18
|
component: n,
|
|
16
19
|
parameters: {
|
|
@@ -42,7 +45,7 @@ const v = {
|
|
|
42
45
|
a,
|
|
43
46
|
{
|
|
44
47
|
config: {
|
|
45
|
-
authFlow:
|
|
48
|
+
authFlow: i.STANDARD,
|
|
46
49
|
clientId: void 0,
|
|
47
50
|
trustedOrigins: ["*"],
|
|
48
51
|
testMode: !0,
|
|
@@ -52,32 +55,32 @@ const v = {
|
|
|
52
55
|
}
|
|
53
56
|
)
|
|
54
57
|
]
|
|
55
|
-
},
|
|
58
|
+
}, h = {
|
|
56
59
|
name: "Euro to Dollar Cash Value",
|
|
57
60
|
args: {
|
|
58
61
|
amount: 100,
|
|
59
62
|
currency: "EUR"
|
|
60
63
|
}
|
|
61
|
-
},
|
|
64
|
+
}, R = {
|
|
62
65
|
name: "Invalid Amount",
|
|
63
66
|
args: {
|
|
64
67
|
amount: "invalid",
|
|
65
68
|
currency: "EUR"
|
|
66
69
|
}
|
|
67
|
-
},
|
|
70
|
+
}, j = {
|
|
68
71
|
name: "Zero Amount with Display as Zero",
|
|
69
72
|
args: {
|
|
70
73
|
amount: 0,
|
|
71
74
|
zeroDisplayOption: o.DISPLAY_AS_ZERO,
|
|
72
75
|
currency: "EUR"
|
|
73
76
|
}
|
|
74
|
-
},
|
|
77
|
+
}, C = {
|
|
75
78
|
name: "Negative Amount",
|
|
76
79
|
args: {
|
|
77
80
|
amount: -100,
|
|
78
81
|
currency: "EUR"
|
|
79
82
|
}
|
|
80
|
-
},
|
|
83
|
+
}, T = {
|
|
81
84
|
name: "Custom Zero Amount",
|
|
82
85
|
args: {
|
|
83
86
|
amount: 0,
|
|
@@ -87,10 +90,10 @@ const v = {
|
|
|
87
90
|
}
|
|
88
91
|
};
|
|
89
92
|
export {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
T as CustomZeroAmount,
|
|
94
|
+
h as Default,
|
|
95
|
+
R as InvalidAmount,
|
|
96
|
+
C as NegativeAmount,
|
|
97
|
+
j as ZeroAmount,
|
|
98
|
+
b as default
|
|
96
99
|
};
|
|
@@ -3,7 +3,8 @@ import * as a from "react";
|
|
|
3
3
|
import Z, { useState as or } from "react";
|
|
4
4
|
import { r as ie, d as me, u as T, a as ar, c as R, b as U, e as ir, f as cr, g as Ue, o as sr, s as ur, h as lr, i as dr, j as fr, k as pr, l as vr, m as mr, n as oe, p as Qe, P as Oe, t as hr, v as gr } from "../../index-COgXcb6p.js";
|
|
5
5
|
import { r as br, R as yr } from "../../index-Cv-wvFlM.js";
|
|
6
|
-
import '../../assets/
|
|
6
|
+
import '../../assets/_styles3.css';/* empty css */
|
|
7
|
+
// @__NO_SIDE_EFFECTS__
|
|
7
8
|
function ht(e) {
|
|
8
9
|
const t = /* @__PURE__ */ Cr(e), n = a.forwardRef((r, o) => {
|
|
9
10
|
const { children: i, ...s } = r, c = a.Children.toArray(i), p = c.find(Sr);
|
|
@@ -2128,7 +2129,7 @@ var pi = [
|
|
|
2128
2129
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(p, { ...c, ref: i });
|
|
2129
2130
|
});
|
|
2130
2131
|
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
2131
|
-
}, {}), Ce = "Menubar", [ze, vi, mi] = Je(Ce), [Kn,
|
|
2132
|
+
}, {}), Ce = "Menubar", [ze, vi, mi] = Je(Ce), [Kn, qi] = me(Ce, [
|
|
2132
2133
|
mi,
|
|
2133
2134
|
Ne
|
|
2134
2135
|
]), A = wa(), Vn = Ne(), [hi, dt] = Kn(Ce), Gn = a.forwardRef(
|
|
@@ -2436,7 +2437,7 @@ function $i(e, t) {
|
|
|
2436
2437
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
2437
2438
|
}
|
|
2438
2439
|
var Bi = Gn, Wi = Hn, Ki = jn, xt = Yn, Vi = Xn, Ot = zn, Gi = qn, Ui = Qn, Hi = Jn;
|
|
2439
|
-
const
|
|
2440
|
+
const Qi = ({ options: e }) => /* @__PURE__ */ f(Bi, { className: "menubar-root", children: /* @__PURE__ */ Fe(Wi, { children: [
|
|
2440
2441
|
/* @__PURE__ */ f(Ki, { className: "menubar-trigger", children: /* @__PURE__ */ f(hr, {}) }),
|
|
2441
2442
|
/* @__PURE__ */ f(xt, { children: /* @__PURE__ */ f(
|
|
2442
2443
|
Vi,
|
|
@@ -2487,5 +2488,5 @@ const qi = ({ options: e }) => /* @__PURE__ */ f(Bi, { className: "menubar-root"
|
|
|
2487
2488
|
) })
|
|
2488
2489
|
] }) });
|
|
2489
2490
|
export {
|
|
2490
|
-
|
|
2491
|
+
Qi as default
|
|
2491
2492
|
};
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { CashValue as
|
|
2
|
-
import { EInvalidAmountDisplayOption as
|
|
1
|
+
import { CashValue as t } from "./CashValue/CashValue.js";
|
|
2
|
+
import { EInvalidAmountDisplayOption as p, EToolTipPosition as e } from "./CashValue/CashValueTypes.js";
|
|
3
|
+
import { FlightBooking as n } from "./Bookings/FlightBooking/FlightBooking.js";
|
|
4
|
+
import { HotelBooking as a } from "./Bookings/HotelBooking/HotelBooking.js";
|
|
3
5
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
t as CashValue,
|
|
7
|
+
p as EInvalidAmountDisplayOption,
|
|
8
|
+
e as EToolTipPosition,
|
|
9
|
+
n as FlightBooking,
|
|
10
|
+
a as HotelBooking
|
|
7
11
|
};
|
package/dist/configs/baseUrl.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
let
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
let s = "";
|
|
2
|
+
const e = () => s, n = (t) => {
|
|
3
|
+
s = t ? "https://appdev.odynn.info:3003" : "https://app.odynn.info";
|
|
4
|
+
}, o = (t) => {
|
|
5
|
+
s = t;
|
|
4
6
|
};
|
|
5
7
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
e as getBaseUrl,
|
|
9
|
+
n as setBaseUrl,
|
|
10
|
+
o as setCustomBaseUrl
|
|
8
11
|
};
|
|
@@ -8,18 +8,21 @@ import "react/jsx-runtime";
|
|
|
8
8
|
import "../../context/AwayzContext.js";
|
|
9
9
|
import { awayzClient as s } from "../../configs/awayzClient.js";
|
|
10
10
|
import "../../services/noRetryInstance.js";
|
|
11
|
-
import '../../assets/_styles.css';/* empty css */
|
|
12
|
-
|
|
11
|
+
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
|
|
12
|
+
/* empty css */
|
|
13
|
+
/* empty css */
|
|
14
|
+
/* empty css */
|
|
15
|
+
const j = (r, t) => {
|
|
13
16
|
const {
|
|
14
17
|
data: l,
|
|
15
18
|
isError: c,
|
|
16
|
-
error:
|
|
19
|
+
error: m
|
|
17
20
|
} = n({
|
|
18
21
|
queryKey: [o.BOOKING, r, t],
|
|
19
22
|
queryFn: () => e.getHotelBooking(r),
|
|
20
23
|
enabled: t === i.HOTEL && !!r
|
|
21
24
|
}), {
|
|
22
|
-
data:
|
|
25
|
+
data: u,
|
|
23
26
|
isError: B,
|
|
24
27
|
error: E
|
|
25
28
|
} = n({
|
|
@@ -44,9 +47,9 @@ const x = (r, t) => {
|
|
|
44
47
|
}
|
|
45
48
|
}), {
|
|
46
49
|
mutate: h,
|
|
47
|
-
isPending:
|
|
48
|
-
isError:
|
|
49
|
-
error:
|
|
50
|
+
isPending: p,
|
|
51
|
+
isError: C,
|
|
52
|
+
error: H
|
|
50
53
|
} = a({
|
|
51
54
|
mutationFn: async () => {
|
|
52
55
|
if (t === i.FLIGHT)
|
|
@@ -59,21 +62,21 @@ const x = (r, t) => {
|
|
|
59
62
|
queryKey: [o.BOOKING, r, t]
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
|
-
}),
|
|
65
|
+
}), K = c || B, y = m || E;
|
|
63
66
|
return {
|
|
64
|
-
details: t === i.HOTEL ? l :
|
|
65
|
-
isError:
|
|
66
|
-
error:
|
|
67
|
+
details: t === i.HOTEL ? l : u,
|
|
68
|
+
isError: K,
|
|
69
|
+
error: y,
|
|
67
70
|
initiateCancellation: g,
|
|
68
71
|
isInitiatingCancellation: f,
|
|
69
72
|
isInitiateCancellationError: F,
|
|
70
73
|
initiateCancellationError: O,
|
|
71
74
|
cancelBooking: h,
|
|
72
|
-
isCancelingBooking:
|
|
73
|
-
isCancelBookingError:
|
|
74
|
-
cancelBookingError:
|
|
75
|
+
isCancelingBooking: p,
|
|
76
|
+
isCancelBookingError: C,
|
|
77
|
+
cancelBookingError: H
|
|
75
78
|
};
|
|
76
79
|
};
|
|
77
80
|
export {
|
|
78
|
-
|
|
81
|
+
j as useBookingManagement
|
|
79
82
|
};
|
|
@@ -10,10 +10,13 @@ import "react/jsx-runtime";
|
|
|
10
10
|
import "../../context/AwayzContext.js";
|
|
11
11
|
import "@tanstack/react-query";
|
|
12
12
|
import { EBookingType as l } from "../../services/trips/TripService.types.js";
|
|
13
|
-
import '../../assets/_styles.css';/* empty css */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
|
|
14
|
+
/* empty css */
|
|
15
|
+
/* empty css */
|
|
16
|
+
/* empty css */
|
|
17
|
+
import { d, v as p, t as _, g as t } from "../../vi.ClIskdbk-k6t29WRA.js";
|
|
18
|
+
const s = "Hotel booking found", u = !0, m = { _id: "67f6c1dbbbc4c3c745210abb", user_id: "67d82b1c52c4a4dbe4e640c0", status: "availability confirmed", accommodation_id: "acc_0000AWPt1SGInbu4X9MWOg", number_of_guests: 2, rate_id: "rat_0000AsvJMj2fyryIptLP72", quote_id: "quo_0000AsvJOwZ3PPyHaFBszA", base_amount: "159.08", base_currency: "EUR", tax_amount: null, tax_currency: "EUR", fee_amount: "0.00", fee_currency: "EUR", total_amount: "159.08", total_currency: "EUR", check_in_date: "2025-04-29", check_out_date: "2025-04-30", images: ["https://travelport.leonardocontentcloud.com/imageRepo/7/0/141/226/276/VIENR_7187550009_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/311/VIENR_7830110131_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/406/VIENR_7831079802_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/413/VIENR_7830110068_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/603/VIENR_7836605121_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/617/VIENR_7836587109_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/623/VIENR_7836596533_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/141/226/280/VIENR_7187549817_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/589/VIENR_7836587064_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/365/VIENR_7830109308_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/152/865/319/VIENR_8279893960_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/152/865/342/VIENR_8279862750_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/303/VIENR_7830110109_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/423/VIENR_7830110088_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/152/865/325/VIENR_8279819269_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/152/865/307/VIENR_8279804316_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/152/865/312/VIENR_8279860525_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/152/865/334/VIENR_8279819315_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/153/641/860/VIENR_8454780814_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/155/931/795/VIENR_8549019991_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/339/VIENR_7830109664_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/386/VIENR_7830109180_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/444/VIENR_7830109282_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/393/VIENR_7830109711_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/331/VIENR_7830109210_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/454/VIENR_7830109964_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/345/VIENR_7831125904_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/294/VIENR_7830109970_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/358/VIENR_7830109736_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/464/VIENR_7830109689_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/319/VIENR_7830109259_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/399/VIENR_7830109928_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/599/VIENR_7836606896_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/609/VIENR_7830109997_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/585/VIENR_7836587084_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/581/VIENR_7836611335_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/433/VIENR_7830109875_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/634/VIENR_7836608919_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/325/VIENR_7830110062_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/629/VIENR_7836587030_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/373/VIENR_7830109903_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/595/VIENR_7836596445_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/7/0/164/563/809/VIENR_8953587933_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/3/0/183/490/977/VIENR_9897245093_H.jpg", "https://travelport.leonardocontentcloud.com/imageRepo/2/0/184/483/935/VIENR_8953599865_H.jpg"], rooms: [{ beds: [], photo: [], total_amount: "159.08", name: "Standard Room When You Arrive At The Hotel We Will Do Our Best To Meet Your Room Type" }], address: { line_one: "RECHTE WIENZEILE 87", city_name: "VIENNA", postal_code: "1050 ", country_code: "AT", region: null }, guests: [], created_at: "2025-04-09T18:52:11.461Z", updated_at: "2025-04-09T18:52:11.461Z", __v: 0 }, g = {
|
|
19
|
+
message: s,
|
|
17
20
|
success: u,
|
|
18
21
|
data: m
|
|
19
22
|
}, y = { _id: "6811290ef16af25943018944", flight_offer_id: "off_0000AtaoutgusFy7zHL7pJ", user_id: "67d82b1c52c4a4dbe4e640c0", status: "flight confirmed", available_actions: ["cancel", "change", "update"], total_currency: "USD", arrival_date: "2025-05-28T21:46:00.000Z", base_amount: "196.19", extras_amount: "0.00", extras_currency: "USD", base_currency: "USD", conditions: { refund_before_departure: { penalty_currency: null, penalty_amount: null, allowed: !1 }, change_before_departure: { penalty_currency: "GBP", penalty_amount: "30.00", allowed: !0 } }, departure_date: "2025-05-28T18:54:00.000Z", passengers: [{ id: "pas_0000AtaoutTnf1TdKbCeNV", type: null }], slices: [{ carriers: { marketing: ["Duffel Airways"], operating: ["Duffel Airways"] }, id: "sli_0000AtaoutgusFy7zHL7pI", origin: "JFK", destination: "LAX", fare_brand_name: null }], tax_amount: "35.31", tax_currency: "USD", total_amount: "231.50", type: "instant", synced_at: "2025-04-29T19:31:52Z", order_id: "ord_0000AtapDdwhJRoTNzMZrU", booking_reference: "4LGE5O", cancelled_at: null, payment_status: { paid_at: "2025-04-29T19:31:52Z", price_guarantee_expires_at: null, payment_required_by: null, awaiting_payment: !1 }, documents: [{ passenger_ids: ["pas_0000AtaoutTnf1TdKbCeNV"], unique_identifier: "1", type: "electronic_ticket" }], services: [], createdAt: "2025-04-29T19:31:26.348Z", updatedAt: "2025-04-29T19:31:52.467Z", __v: 0, data: { void_window_ends_at: null, documents: [{ passenger_ids: ["pas_0000AtaoutTnf1TdKbCeNV"], unique_identifier: "1", type: "electronic_ticket" }], synced_at: "2025-04-29T19:31:52Z", available_actions: ["update"], airline_initiated_changes: [], cancellation: null, tax_currency: "USD", base_currency: "USD", base_amount: "196.19", tax_amount: "35.31", total_currency: "USD", offer_id: "off_0000AtaoutgusFy7zHL7pJ", booking_reference: "4LGE5O", created_at: "2025-04-29T19:31:52.316759Z", payment_status: { paid_at: "2025-04-29T19:31:52Z", price_guarantee_expires_at: null, payment_required_by: null, awaiting_payment: !1 }, live_mode: !1, total_amount: "231.50", slices: [{ destination_type: "airport", origin_type: "airport", fare_brand_name: "Basic", segments: [{ origin_terminal: "2", destination_terminal: "1", aircraft: { iata_code: "773", name: "Boeing 777-300", id: "arc_00009VMF8AhXSSRnQDI6HE" }, departing_at: "2025-05-28T20:54:00", arriving_at: "2025-05-28T23:46:00", operating_carrier: { logo_symbol_url: "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/ZZ.svg", logo_lockup_url: null, conditions_of_carriage_url: "https://duffelairways.com/dummy-url/conditions-of-carriage", iata_code: "ZZ", name: "Duffel Airways", id: "arl_00009VME7D6ivUu8dn35WK" }, marketing_carrier: { logo_symbol_url: "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/ZZ.svg", logo_lockup_url: null, conditions_of_carriage_url: "https://duffelairways.com/dummy-url/conditions-of-carriage", iata_code: "ZZ", name: "Duffel Airways", id: "arl_00009VME7D6ivUu8dn35WK" }, stops: [], operating_carrier_flight_number: "2682", marketing_carrier_flight_number: "2682", distance: "3974.2717774447433", passengers: [{ baggages: [{ quantity: 1, type: "checked" }, { quantity: 1, type: "carry_on" }], cabin_class_marketing_name: "Economy", passenger_id: "pas_0000AtaoutTnf1TdKbCeNV", seat: null, cabin_class: "economy" }], duration: "PT5H52M", destination: { city_name: "Los Angeles", icao_code: "KLAX", iata_country_code: "US", iata_code: "LAX", iata_city_code: "LAX", latitude: 33.942045, longitude: -118.408263, city: { city_name: null, icao_code: null, iata_country_code: "US", iata_code: "LAX", iata_city_code: "LAX", latitude: null, longitude: null, time_zone: null, type: "city", name: "Los Angeles", id: "cit_lax_us" }, time_zone: "America/Los_Angeles", type: "airport", name: "Los Angeles International Airport", id: "arp_lax_us" }, origin: { city_name: "New York", icao_code: "KJFK", iata_country_code: "US", iata_code: "JFK", iata_city_code: "NYC", latitude: 40.640556, longitude: -73.778519, city: { city_name: null, icao_code: null, iata_country_code: "US", iata_code: "NYC", iata_city_code: "NYC", latitude: null, longitude: null, time_zone: null, type: "city", name: "New York", id: "cit_nyc_us" }, time_zone: "America/New_York", type: "airport", name: "John F. Kennedy International Airport", id: "arp_jfk_us" }, id: "seg_0000AtaoutgusFy7zHL7pH" }], conditions: { change_before_departure: { penalty_currency: "GBP", penalty_amount: "30.00", allowed: !0 } }, duration: "PT5H52M", destination: { city_name: "Los Angeles", icao_code: "KLAX", iata_country_code: "US", iata_code: "LAX", iata_city_code: "LAX", latitude: 33.942045, longitude: -118.408263, city: { city_name: null, icao_code: null, iata_country_code: "US", iata_code: "LAX", iata_city_code: "LAX", latitude: null, longitude: null, time_zone: null, type: "city", name: "Los Angeles", id: "cit_lax_us" }, time_zone: "America/Los_Angeles", type: "airport", name: "Los Angeles International Airport", id: "arp_lax_us" }, origin: { city_name: "New York", icao_code: "KJFK", iata_country_code: "US", iata_code: "JFK", iata_city_code: "NYC", latitude: 40.640556, longitude: -73.778519, city: { city_name: null, icao_code: null, iata_country_code: "US", iata_code: "NYC", iata_city_code: "NYC", latitude: null, longitude: null, time_zone: null, type: "city", name: "New York", id: "cit_nyc_us" }, time_zone: "America/New_York", type: "airport", name: "John F. Kennedy International Airport", id: "arp_jfk_us" }, id: "sli_0000AtaoutgusFy7zHL7pI" }], passengers: [{ born_on: "2007-04-29", loyalty_programme_accounts: [], family_name: "Botha", given_name: "Adriaan", gender: "m", infant_passenger_id: null, phone_number: "+12345642342", user_id: null, email: "adriaan.botha@typedev.co.za", title: "mr", type: "adult", id: "pas_0000AtaoutTnf1TdKbCeNV" }], conditions: { refund_before_departure: { penalty_currency: null, penalty_amount: null, allowed: !1 }, change_before_departure: { penalty_currency: "GBP", penalty_amount: "30.00", allowed: !0 } }, cancelled_at: null, changes: [], content: "managed", services: [], users: ["icu_0000Asbm8q0FlWOhf0fDUm"], metadata: null, type: "instant", owner: { logo_symbol_url: "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/ZZ.svg", logo_lockup_url: null, conditions_of_carriage_url: "https://duffelairways.com/dummy-url/conditions-of-carriage", iata_code: "ZZ", name: "Duffel Airways", id: "arl_00009VME7D6ivUu8dn35WK" }, id: "ord_0000AtapDdwhJRoTNzMZrU" } }, f = "Flight booking found", R = !0, h = {
|
|
@@ -22,13 +25,13 @@ const p = "Hotel booking found", u = !0, m = { _id: "67f6c1dbbbc4c3c745210abb",
|
|
|
22
25
|
success: R
|
|
23
26
|
};
|
|
24
27
|
d("useBookingManagement", () => {
|
|
25
|
-
|
|
28
|
+
p.mocked(o.get).mockImplementation((e) => e.includes(a.USER_HOTEL_BOOKINGS) ? Promise.resolve({
|
|
26
29
|
data: g
|
|
27
30
|
}) : e.includes(a.USER_FLIGHT_BOOKINGS) ? Promise.resolve({
|
|
28
31
|
data: h
|
|
29
|
-
}) : Promise.resolve({ data: {} })),
|
|
32
|
+
}) : Promise.resolve({ data: {} })), p.mocked(o.post).mockImplementation((e) => e.includes(a.CANCEL_HOTEL_BOOKING) ? Promise.resolve({
|
|
30
33
|
data: { success: !0 }
|
|
31
|
-
}) : Promise.resolve({ data: {} })),
|
|
34
|
+
}) : Promise.resolve({ data: {} })), p.mocked(o.put).mockImplementation(() => Promise.resolve({ data: { success: !0 } })), d("Hotel Booking Management", () => {
|
|
32
35
|
_("Can fetch hotel booking by id", async () => {
|
|
33
36
|
const { result: e } = r(
|
|
34
37
|
() => i("67f6c1dbbbc4c3c745210abb", l.HOTEL)
|
|
@@ -7,7 +7,10 @@ import "react/jsx-runtime";
|
|
|
7
7
|
import "../../context/AwayzContext.js";
|
|
8
8
|
import { awayzClient as t } from "../../configs/awayzClient.js";
|
|
9
9
|
import "../../services/noRetryInstance.js";
|
|
10
|
-
import '../../assets/_styles.css';/* empty css */
|
|
10
|
+
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
|
|
11
|
+
/* empty css */
|
|
12
|
+
/* empty css */
|
|
13
|
+
/* empty css */
|
|
11
14
|
const U = ({
|
|
12
15
|
tripId: s,
|
|
13
16
|
tripDetails: a
|
|
@@ -16,7 +19,7 @@ const U = ({
|
|
|
16
19
|
throw new Error("Trip ID is required");
|
|
17
20
|
if (!a || Object.keys(a).length === 0)
|
|
18
21
|
throw new Error("Trip details must be provided for update");
|
|
19
|
-
},
|
|
22
|
+
}, J = () => {
|
|
20
23
|
const { data: s = [] } = d({
|
|
21
24
|
queryKey: [
|
|
22
25
|
e.TRIPS,
|
|
@@ -41,9 +44,9 @@ const U = ({
|
|
|
41
44
|
queryKey: [e.UNCATEGORISED_BOOKINGS],
|
|
42
45
|
queryFn: () => o.getUncategorisedBookings()
|
|
43
46
|
}), {
|
|
44
|
-
mutate:
|
|
45
|
-
isPending:
|
|
46
|
-
isError:
|
|
47
|
+
mutate: m,
|
|
48
|
+
isPending: y,
|
|
49
|
+
isError: g,
|
|
47
50
|
error: E
|
|
48
51
|
} = p({
|
|
49
52
|
mutationFn: async ({ tripId: r, tripDetails: i }) => (U({ tripId: r, tripDetails: i }), await o.updateTrip(r, i)),
|
|
@@ -169,9 +172,9 @@ const U = ({
|
|
|
169
172
|
isCreateTripPending: w,
|
|
170
173
|
isCreateTripError: q,
|
|
171
174
|
createTripError: S,
|
|
172
|
-
updateTrip:
|
|
173
|
-
isUpdateTripPending:
|
|
174
|
-
isUpdateTripError:
|
|
175
|
+
updateTrip: m,
|
|
176
|
+
isUpdateTripPending: y,
|
|
177
|
+
isUpdateTripError: g,
|
|
175
178
|
updateTripError: E,
|
|
176
179
|
deleteTrip: P,
|
|
177
180
|
isDeleteTripPending: f,
|
|
@@ -185,6 +188,6 @@ const U = ({
|
|
|
185
188
|
};
|
|
186
189
|
};
|
|
187
190
|
export {
|
|
188
|
-
|
|
191
|
+
J as useTripManagement,
|
|
189
192
|
U as validateUpdateTripArgs
|
|
190
193
|
};
|
|
@@ -9,9 +9,12 @@ import { EMyTripsEndpoints as p } from "../../configs/endpoints.js";
|
|
|
9
9
|
import "../../configs/awayzClient.js";
|
|
10
10
|
import "@tanstack/react-query";
|
|
11
11
|
import "../../services/noRetryInstance.js";
|
|
12
|
-
import '../../assets/_styles.css';/* empty css */
|
|
13
|
-
import { UncategorisedBookings200 as D, PastTrip200 as B, UpcomingTrip200 as I, UpdatedTrip200 as T } from "./mocks/index.js";
|
|
14
12
|
import { EBookingType as k } from "../../services/trips/TripService.types.js";
|
|
13
|
+
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
|
|
14
|
+
/* empty css */
|
|
15
|
+
/* empty css */
|
|
16
|
+
/* empty css */
|
|
17
|
+
import { UncategorisedBookings200 as D, PastTrip200 as B, UpcomingTrip200 as I, UpdatedTrip200 as T } from "./mocks/index.js";
|
|
15
18
|
import { d as u, v as l, b, t as s, g as e } from "../../vi.ClIskdbk-k6t29WRA.js";
|
|
16
19
|
let m = {
|
|
17
20
|
past: [...B.data],
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { useQuery as a, useMutation as d } from "@tanstack/react-query";
|
|
2
2
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import { E as o, a as
|
|
3
|
+
import { E as o, a as m } from "../../AccountService-Ct4hShV-.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { WalletService as t } from "../../services/wallet/WalletService.js";
|
|
6
6
|
import "react/jsx-runtime";
|
|
7
7
|
import "../../context/AwayzContext.js";
|
|
8
8
|
import { awayzClient as f } from "../../configs/awayzClient.js";
|
|
9
9
|
import "../../services/noRetryInstance.js";
|
|
10
|
-
import '../../assets/_styles.css';/* empty css */
|
|
11
|
-
|
|
10
|
+
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
|
|
11
|
+
/* empty css */
|
|
12
|
+
/* empty css */
|
|
13
|
+
/* empty css */
|
|
14
|
+
const b = () => {
|
|
12
15
|
const { data: r } = a({
|
|
13
16
|
queryKey: [o.PROGRAMS],
|
|
14
17
|
queryFn: t.getAwards,
|
|
@@ -25,40 +28,40 @@ const k = () => {
|
|
|
25
28
|
queryKey: [o.USER_CARDS],
|
|
26
29
|
queryFn: t.getUserCards,
|
|
27
30
|
placeholderData: []
|
|
28
|
-
}), { mutate:
|
|
31
|
+
}), { mutate: p } = d({
|
|
29
32
|
mutationFn: async (e) => {
|
|
30
|
-
const { programId: n, awardsAmount: i } = e,
|
|
31
|
-
if (!
|
|
33
|
+
const { programId: n, awardsAmount: i } = e, s = r == null ? void 0 : r.find((g) => g.id === n);
|
|
34
|
+
if (!s)
|
|
32
35
|
throw new Error("Program not found");
|
|
33
|
-
await t.setAwardPoints(
|
|
36
|
+
await t.setAwardPoints(s.mainProgram, i);
|
|
34
37
|
},
|
|
35
38
|
onSuccess: () => {
|
|
36
39
|
f.invalidateQueries({
|
|
37
40
|
queryKey: [o.PROGRAMS]
|
|
38
41
|
});
|
|
39
42
|
}
|
|
40
|
-
}),
|
|
43
|
+
}), c = (e) => {
|
|
41
44
|
const n = r == null ? void 0 : r.find((i) => i.id === e);
|
|
42
45
|
return n || null;
|
|
43
46
|
};
|
|
44
47
|
return {
|
|
45
48
|
allPrograms: r || [],
|
|
46
49
|
hotelPrograms: (r == null ? void 0 : r.filter(
|
|
47
|
-
(e) => e.category ===
|
|
50
|
+
(e) => e.category === m.HOTEL
|
|
48
51
|
)) || [],
|
|
49
52
|
airlinePrograms: (r == null ? void 0 : r.filter(
|
|
50
|
-
(e) => e.category ===
|
|
53
|
+
(e) => e.category === m.AIRLINE
|
|
51
54
|
)) || [],
|
|
52
55
|
bankPrograms: (r == null ? void 0 : r.filter(
|
|
53
|
-
(e) => e.category ===
|
|
56
|
+
(e) => e.category === m.BANK
|
|
54
57
|
)) || [],
|
|
55
|
-
updatePoints:
|
|
56
|
-
getProgramById:
|
|
58
|
+
updatePoints: p,
|
|
59
|
+
getProgramById: c,
|
|
57
60
|
banks: u || [],
|
|
58
61
|
allCards: l || [],
|
|
59
62
|
userCards: y || []
|
|
60
63
|
};
|
|
61
64
|
};
|
|
62
65
|
export {
|
|
63
|
-
|
|
66
|
+
b as useWallet
|
|
64
67
|
};
|
|
@@ -9,18 +9,21 @@ import { EWalletEndpoints as d } from "../../configs/endpoints.js";
|
|
|
9
9
|
import "../../configs/awayzClient.js";
|
|
10
10
|
import "@tanstack/react-query";
|
|
11
11
|
import "../../services/noRetryInstance.js";
|
|
12
|
-
import '../../assets/_styles.css';/* empty css */
|
|
12
|
+
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';/* empty css */
|
|
13
|
+
/* empty css */
|
|
14
|
+
/* empty css */
|
|
15
|
+
/* empty css */
|
|
13
16
|
import { d as c, v as n, t as m, g as a } from "../../vi.ClIskdbk-k6t29WRA.js";
|
|
14
|
-
const
|
|
15
|
-
data:
|
|
16
|
-
success:
|
|
17
|
+
const p = [{ _id: "682c5c6f91cb31217e4bf851", name: "IHG Rewards Club Premier", signupBonus: 14e4, cashBonus: 0, minimumSpend: 3e3, daysToSpend: 90, annual_fee: 89, annualFeeWaived: !0, cashPerks: 0, bank: { name: "Chase" }, rewards_currency: "IHG Rewards Club", bisCard: !1, chargeCard: !1, cardFamily: 22, websiteUrl: "https://yourbestcreditcards.com/card/ihg-rewards-club-premier-credit-card?ccid=ccref", network: { name: "Visa" }, _modified: "2022-09-02T00:29:39.722Z", colour: "#C8C8C8", region: "US", faredrop_card_id: "ihg-rewards-premier-credit-card", alternateRegions: [], card_id: "IHGcard", user_id: "680b71a42475d482dbd24c7e", active_card: !0 }], u = !0, l = {
|
|
18
|
+
data: p,
|
|
19
|
+
success: u
|
|
17
20
|
};
|
|
18
21
|
c("useWallet", () => {
|
|
19
|
-
n.mocked(i.get).mockImplementation((
|
|
20
|
-
const { result:
|
|
22
|
+
n.mocked(i.get).mockImplementation((r) => r === d.USER_CARDS ? Promise.resolve({ data: l }) : Promise.resolve({ data: {} })), m("Retrieves user cards", async () => {
|
|
23
|
+
const { result: r } = t(() => o());
|
|
21
24
|
await s(() => {
|
|
22
|
-
var
|
|
23
|
-
a(
|
|
25
|
+
var e;
|
|
26
|
+
a(r.current.userCards).toBeDefined(), a((e = r.current.userCards) == null ? void 0 : e.length).toBeGreaterThan(0);
|
|
24
27
|
});
|
|
25
28
|
});
|
|
26
29
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { CashValue } from './CashValue/CashValue';
|
|
2
2
|
export { EToolTipPosition } from './CashValue/CashValueTypes';
|
|
3
3
|
export * from './CashValue/CashValueTypes';
|
|
4
|
+
export { FlightBooking } from './Bookings/FlightBooking/FlightBooking';
|
|
5
|
+
export { HotelBooking } from './Bookings/HotelBooking/HotelBooking';
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { IPassenger
|
|
1
|
+
import { IPassenger } from '@type-op/shared';
|
|
2
2
|
import { Moment } from 'moment';
|
|
3
|
-
export declare const UncategorizedTrips: {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
};
|
|
7
3
|
export declare enum EBookingType {
|
|
8
4
|
HOTEL = "hotel",
|
|
9
5
|
FLIGHT = "flight"
|
|
@@ -63,62 +59,3 @@ export interface IUncategorizedBookings {
|
|
|
63
59
|
flightBookings: IFlightBooking[];
|
|
64
60
|
hotelBookings: IHotelBooking[];
|
|
65
61
|
}
|
|
66
|
-
interface IOwner {
|
|
67
|
-
logo_symbol_url: string;
|
|
68
|
-
logo_lockup_url: string | null;
|
|
69
|
-
conditions_of_carriage_url: string | null;
|
|
70
|
-
iata_code: string;
|
|
71
|
-
name: string;
|
|
72
|
-
id: string;
|
|
73
|
-
}
|
|
74
|
-
export interface IFlightBookingResponse {
|
|
75
|
-
_id: string;
|
|
76
|
-
_created: string;
|
|
77
|
-
payment_intent_id: string;
|
|
78
|
-
status: string;
|
|
79
|
-
flight_offer_id: string;
|
|
80
|
-
user_id: string;
|
|
81
|
-
credit_card_fees: string;
|
|
82
|
-
total_amount_with_fees: string;
|
|
83
|
-
total_amount_without_fees: string;
|
|
84
|
-
_modified: string;
|
|
85
|
-
arrival_date: string;
|
|
86
|
-
available_actions: string[];
|
|
87
|
-
base_amount: string;
|
|
88
|
-
base_currency: string;
|
|
89
|
-
booking_reference: string;
|
|
90
|
-
content: string;
|
|
91
|
-
created_at: string;
|
|
92
|
-
departure_date: string;
|
|
93
|
-
metadata: {
|
|
94
|
-
payment_intent_id: string;
|
|
95
|
-
};
|
|
96
|
-
order_id: string;
|
|
97
|
-
passengers: IPassenger[];
|
|
98
|
-
slices: ISlice[];
|
|
99
|
-
tax_amount: string;
|
|
100
|
-
tax_currency: string;
|
|
101
|
-
total_amount: string;
|
|
102
|
-
total_currency: string;
|
|
103
|
-
type: string;
|
|
104
|
-
documents: any[];
|
|
105
|
-
synced_at: string;
|
|
106
|
-
airline_initiated_changes: any[];
|
|
107
|
-
cancellation: any;
|
|
108
|
-
live_mode: boolean;
|
|
109
|
-
cancelled_at: string | null;
|
|
110
|
-
changes: any[];
|
|
111
|
-
services: any[];
|
|
112
|
-
owner: IOwner;
|
|
113
|
-
id: string;
|
|
114
|
-
}
|
|
115
|
-
export interface ICreateComponentKeyArgs {
|
|
116
|
-
bookingId?: string;
|
|
117
|
-
orderId?: string;
|
|
118
|
-
}
|
|
119
|
-
export interface ICreateComponentKeyResponse {
|
|
120
|
-
success: boolean;
|
|
121
|
-
message: string;
|
|
122
|
-
data: string;
|
|
123
|
-
}
|
|
124
|
-
export {};
|
package/dist/main.js
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
import { AwayzProvider as
|
|
2
|
-
import { useAwayzContext as
|
|
3
|
-
import { useSearchLimit as
|
|
1
|
+
import { AwayzProvider as r } from "./providers/AwayzProvider.js";
|
|
2
|
+
import { useAwayzContext as p } from "./hooks/useAwayzContext.js";
|
|
3
|
+
import { useSearchLimit as a } from "./hooks/useSearchLimit.js";
|
|
4
4
|
import { useWallet as m } from "./hooks/useWallet/useWallet.js";
|
|
5
|
-
import { useTripManagement as
|
|
5
|
+
import { useTripManagement as f, validateUpdateTripArgs as l } from "./hooks/useTripManagement/useTripManagement.js";
|
|
6
6
|
import { EAuthFlow as c } from "./types/EAuthFlow.js";
|
|
7
|
-
import { c as
|
|
8
|
-
import { clientNoRetryInstance as
|
|
9
|
-
import { CurrencyService as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
7
|
+
import { c as g, i as y } from "./AccountService-Ct4hShV-.js";
|
|
8
|
+
import { clientNoRetryInstance as T } from "./services/noRetryInstance.js";
|
|
9
|
+
import { CurrencyService as h } from "./services/currency/CurrencyService.js";
|
|
10
|
+
import { EBookingType as w } from "./services/trips/TripService.types.js";
|
|
11
|
+
import { awayzClient as C } from "./configs/awayzClient.js";
|
|
12
|
+
import { CashValue as k } from "./components/CashValue/CashValue.js";
|
|
13
|
+
import { EInvalidAmountDisplayOption as I, EToolTipPosition as F } from "./components/CashValue/CashValueTypes.js";
|
|
14
|
+
import { FlightBooking as S } from "./components/Bookings/FlightBooking/FlightBooking.js";
|
|
15
|
+
import { HotelBooking as D } from "./components/Bookings/HotelBooking/HotelBooking.js";
|
|
16
|
+
import { getBaseUrl as L } from "./configs/baseUrl.js";
|
|
14
17
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
r as AwayzProvider,
|
|
19
|
+
k as CashValue,
|
|
20
|
+
h as CurrencyService,
|
|
18
21
|
c as EAuthFlow,
|
|
22
|
+
w as EBookingType,
|
|
19
23
|
I as EInvalidAmountDisplayOption,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
F as EToolTipPosition,
|
|
25
|
+
S as FlightBooking,
|
|
26
|
+
D as HotelBooking,
|
|
27
|
+
C as awayzClient,
|
|
28
|
+
g as clientInstance,
|
|
29
|
+
T as clientNoRetryInstance,
|
|
30
|
+
L as getBaseUrl,
|
|
31
|
+
y as instance,
|
|
32
|
+
p as useAwayzContext,
|
|
33
|
+
a as useSearchLimit,
|
|
34
|
+
f as useTripManagement,
|
|
29
35
|
m as useWallet,
|
|
30
|
-
|
|
36
|
+
l as validateUpdateTripArgs
|
|
31
37
|
};
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useEffect as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as a } from "react";
|
|
3
3
|
import { AwayzContext as m } from "../context/AwayzContext.js";
|
|
4
4
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
5
|
-
import { e as
|
|
5
|
+
import { e as r } from "../AccountService-Ct4hShV-.js";
|
|
6
6
|
import { useAwayzAuth as l } from "../hooks/useAwayzAuth/useAwayzAuth.js";
|
|
7
|
-
import { setBaseUrl as u } from "../configs/baseUrl.js";
|
|
8
|
-
import { QueryClientProvider as
|
|
9
|
-
import { awayzClient as
|
|
7
|
+
import { setCustomBaseUrl as i, setBaseUrl as u } from "../configs/baseUrl.js";
|
|
8
|
+
import { QueryClientProvider as d } from "@tanstack/react-query";
|
|
9
|
+
import { awayzClient as p } from "../configs/awayzClient.js";
|
|
10
10
|
import "../services/noRetryInstance.js";
|
|
11
|
-
import '../assets/_styles.css';/* empty css */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
import '../assets/_styles4.css';import '../assets/_styles3.css';import '../assets/_styles2.css';import '../assets/_styles.css';/* empty css */
|
|
12
|
+
/* empty css */
|
|
13
|
+
/* empty css */
|
|
14
|
+
/* empty css */
|
|
15
|
+
import { defaultAwayzConfig as h } from "../configs/defaultAwayzConfig.js";
|
|
16
|
+
const U = ({ children: o, config: e }) => {
|
|
17
|
+
const s = l({
|
|
15
18
|
authFlow: e.authFlow,
|
|
16
19
|
onSuccess: e.onAuthSuccess,
|
|
17
20
|
onError: e.onAuthFailure,
|
|
18
21
|
trustedOrigins: e.trustedOrigins
|
|
19
22
|
});
|
|
20
|
-
return
|
|
23
|
+
return a(() => {
|
|
21
24
|
if (!e.clientId) {
|
|
22
25
|
console.error("You need to provide a client ID to the AwayzProvider");
|
|
23
26
|
return;
|
|
24
27
|
}
|
|
25
|
-
localStorage.setItem(
|
|
26
|
-
}, [e]), /* @__PURE__ */
|
|
28
|
+
localStorage.setItem(r.CLIENT_ID, e.clientId), localStorage.setItem(r.AUTH_FLOW, e.authFlow), e.debugRefreshToken && e.testMode && (localStorage.setItem(r.REFRESH_TOKEN, e.debugRefreshToken), localStorage.setItem(r.TOKEN, e.debugRefreshToken)), e.overrideBaseUrl ? i(e.overrideBaseUrl) : u(e.testMode ?? !1);
|
|
29
|
+
}, [e]), /* @__PURE__ */ t(d, { client: p, children: /* @__PURE__ */ t(
|
|
27
30
|
m.Provider,
|
|
28
31
|
{
|
|
29
32
|
value: {
|
|
30
|
-
...
|
|
33
|
+
...s,
|
|
31
34
|
config: {
|
|
32
|
-
...
|
|
35
|
+
...h,
|
|
33
36
|
...e
|
|
34
37
|
}
|
|
35
38
|
},
|
|
@@ -38,5 +41,5 @@ const F = ({ children: o, config: e }) => {
|
|
|
38
41
|
) });
|
|
39
42
|
};
|
|
40
43
|
export {
|
|
41
|
-
|
|
44
|
+
U as AwayzProvider
|
|
42
45
|
};
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import '../../assets/_styles.css';var u = Object.defineProperty;
|
|
1
|
+
import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';import '../../assets/_styles.css';var u = Object.defineProperty;
|
|
2
2
|
var y = (t, r, e) => r in t ? u(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
3
|
var n = (t, r, e) => y(t, typeof r != "symbol" ? r + "" : r, e);
|
|
4
4
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
5
|
-
import { A as p, E as
|
|
5
|
+
import { A as p, E as m, c as a } from "../../AccountService-Ct4hShV-.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { ECurrencyEndpoints as s } from "../../configs/endpoints.js";
|
|
8
8
|
import "react/jsx-runtime";
|
|
9
9
|
import "../../context/AwayzContext.js";
|
|
10
|
-
import { awayzClient as
|
|
10
|
+
import { awayzClient as C } from "../../configs/awayzClient.js";
|
|
11
11
|
import "@tanstack/react-query";
|
|
12
12
|
import "../noRetryInstance.js";
|
|
13
13
|
/* empty css */
|
|
14
|
+
/* empty css */
|
|
15
|
+
/* empty css */
|
|
16
|
+
/* empty css */
|
|
14
17
|
class E {
|
|
15
18
|
constructor() {
|
|
16
19
|
n(this, "convertCurrency", async ({
|
|
17
20
|
baseCurrency: r
|
|
18
21
|
}) => {
|
|
19
22
|
try {
|
|
20
|
-
const { success: e, data: o } = await
|
|
21
|
-
queryKey: [
|
|
23
|
+
const { success: e, data: o } = await C.ensureQueryData({
|
|
24
|
+
queryKey: [m.CHECK_USER],
|
|
22
25
|
queryFn: p.checkUser
|
|
23
26
|
});
|
|
24
27
|
if (!e)
|
|
@@ -62,7 +65,7 @@ class E {
|
|
|
62
65
|
});
|
|
63
66
|
}
|
|
64
67
|
}
|
|
65
|
-
const
|
|
68
|
+
const K = new E();
|
|
66
69
|
export {
|
|
67
|
-
|
|
70
|
+
K as CurrencyService
|
|
68
71
|
};
|
package/dist/services/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { clientNoRetryInstance as
|
|
3
|
-
import { CurrencyService as
|
|
1
|
+
import { c as o, i as n } from "../AccountService-Ct4hShV-.js";
|
|
2
|
+
import { clientNoRetryInstance as c } from "./noRetryInstance.js";
|
|
3
|
+
import { CurrencyService as a } from "./currency/CurrencyService.js";
|
|
4
|
+
import { EBookingType as s } from "./trips/TripService.types.js";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
o as
|
|
8
|
-
|
|
6
|
+
a as CurrencyService,
|
|
7
|
+
s as EBookingType,
|
|
8
|
+
o as clientInstance,
|
|
9
|
+
c as clientNoRetryInstance,
|
|
10
|
+
n as instance
|
|
9
11
|
};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
id: "uncategorized",
|
|
3
|
-
name: "Uncategorized Trips"
|
|
4
|
-
};
|
|
5
|
-
var r = /* @__PURE__ */ ((e) => (e.HOTEL = "hotel", e.FLIGHT = "flight", e))(r || {});
|
|
1
|
+
var t = /* @__PURE__ */ ((r) => (r.HOTEL = "hotel", r.FLIGHT = "flight", r))(t || {});
|
|
6
2
|
export {
|
|
7
|
-
|
|
8
|
-
t as UncategorizedTrips
|
|
3
|
+
t as EBookingType
|
|
9
4
|
};
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|