@odynn/awayz-core 0.10.0 → 0.10.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,6 +1,6 @@
|
|
|
1
1
|
import { useQuery as U } from "@tanstack/react-query";
|
|
2
2
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import { E as
|
|
3
|
+
import { E as r, t as F } from "../noRetryInstance-C4bqpBc7.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { FeatureService as N } from "../services/features/featureService.js";
|
|
6
6
|
const L = [
|
|
@@ -19,7 +19,8 @@ const L = [
|
|
|
19
19
|
"NAVIGATION_FEATURE",
|
|
20
20
|
"BOOKING_PAYMENT_METHOD_FEATURE",
|
|
21
21
|
"AMOUNTS_DISPLAY_FEATURE",
|
|
22
|
-
"FLIGHT_BOOKING_OPTIONS_DISPLAY_FEATURE"
|
|
22
|
+
"FLIGHT_BOOKING_OPTIONS_DISPLAY_FEATURE",
|
|
23
|
+
"THEME_FEATURE"
|
|
23
24
|
], S = [
|
|
24
25
|
"CURRENCY_FILTER_FEATURE",
|
|
25
26
|
"FREE_HOTEL_NIGHTS_FEATURE",
|
|
@@ -53,10 +54,10 @@ const L = [
|
|
|
53
54
|
"FLIGHT_FILTERS_FEATURES",
|
|
54
55
|
"WALLET_FEATURES"
|
|
55
56
|
];
|
|
56
|
-
var
|
|
57
|
+
var e = /* @__PURE__ */ ((E) => (E.DEFAULT = "default", E.FULL_VCC_PARTIAL_ENABLED = "Full VCC - Partial Enabled", E.FULL_VCC_PARTIAL_DISABLED = "Full VCC - Partial Disabled", E))(e || {}), H = /* @__PURE__ */ ((E) => (E.LIGHT = "light", E.DARK = "dark", E.USER = "user", E))(H || {}), t = /* @__PURE__ */ ((E) => (E.CASH_ONLY = "Cash Only", E.CASH_AND_TRAVEL_PARTNER_POINTS = "Cash And Travel Partner Points", E.CASH_AND_CLIENT_POINTS = "Cash And Client Points", E))(t || {}), s = /* @__PURE__ */ ((E) => (E.RESULT = "result", E.SHEET = "sheet", E))(s || {});
|
|
57
58
|
const l = () => {
|
|
58
59
|
const { data: E, isSuccess: R } = U({
|
|
59
|
-
queryKey: [
|
|
60
|
+
queryKey: [r.FEATURES, "new"],
|
|
60
61
|
queryFn: N.getFeatureFlags,
|
|
61
62
|
staleTime: 1 / 0
|
|
62
63
|
}), O = R && E ? (() => {
|
|
@@ -93,7 +94,8 @@ const l = () => {
|
|
|
93
94
|
};
|
|
94
95
|
export {
|
|
95
96
|
t as EAmountsDisplayFeature,
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
e as EBookingPaymentMethod,
|
|
98
|
+
s as EFlightBookingOptionsDisplayFeature,
|
|
99
|
+
H as EThemeFeatureFlag,
|
|
98
100
|
l as useFeatureFlags
|
|
99
101
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}` ? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}` : Lowercase<S>;
|
|
2
|
-
declare const StringFeatureFlag: readonly ["DEFAULT_CURRENCY_FEATURE", "TOTAL_DISPLAY_FEATURE", "HOTEL_DETAILS_LAYOUT_FEATURE", "TRIP_MANAGEMENT_FEATURE", "FLIGHT_FILTER_LAYOUT_FEATURE", "WALLET_MANAGEMENT_FEATURE", "WALLET_PROGRAM_TYPES_FEATURES", "FLIGHT_PAGINATION_FEATURE", "AVAILABILITY_ALERTS_DISPLAY_FEATURE", "PAYMENT_TYPE_FEATURE", "HOTEL_DETAILS_FEATURES", "SEARCH_RADIUS_POSITION_FEATURE", "NAVIGATION_FEATURE", "BOOKING_PAYMENT_METHOD_FEATURE", "AMOUNTS_DISPLAY_FEATURE", "FLIGHT_BOOKING_OPTIONS_DISPLAY_FEATURE"];
|
|
2
|
+
declare const StringFeatureFlag: readonly ["DEFAULT_CURRENCY_FEATURE", "TOTAL_DISPLAY_FEATURE", "HOTEL_DETAILS_LAYOUT_FEATURE", "TRIP_MANAGEMENT_FEATURE", "FLIGHT_FILTER_LAYOUT_FEATURE", "WALLET_MANAGEMENT_FEATURE", "WALLET_PROGRAM_TYPES_FEATURES", "FLIGHT_PAGINATION_FEATURE", "AVAILABILITY_ALERTS_DISPLAY_FEATURE", "PAYMENT_TYPE_FEATURE", "HOTEL_DETAILS_FEATURES", "SEARCH_RADIUS_POSITION_FEATURE", "NAVIGATION_FEATURE", "BOOKING_PAYMENT_METHOD_FEATURE", "AMOUNTS_DISPLAY_FEATURE", "FLIGHT_BOOKING_OPTIONS_DISPLAY_FEATURE", "THEME_FEATURE"];
|
|
3
3
|
declare const BooleanFeatureFlag: readonly ["CURRENCY_FILTER_FEATURE", "FREE_HOTEL_NIGHTS_FEATURE", "SHOW_BOOKABLE_FEATURE", "FILTER_PRESETS_FEATURE", "SPLIT_HOTEL_CHAINS_FEATURE", "FLIGHT_SHOW_ANIMATION_FEATURE", "SHOW_FOOTER_FEATURE", "SHOW_AVAILABILITY_ALERTS_FEATURE", "USE_POINTS_AS_CASH_FEATURE", "HAS_HEADER_FEATURE", "SHOW_FLIGHTS_TRANSFER_PARTNER_FEATURE", "HOTEL_POINTS_ONLY_FEATURE", "FREE_HOTEL_NIGHTS_FEATURE", "HOTEL_DISPLAY_BEST_VALUE_FEATURE", "HOTEL_DISPLAY_POINTS_BREAKDOWN_FEATURE", "TAB_NAVIGATION_FEATURE", "ADD_AIRLINE_HEALTH_PAGE_FEATURE", "SHOW_NAVIGATION_POPUP_FEATURE", "SHOW_ONLY_BOOKABLE_FEATURE", "CASH_BOOKING_FEATURE", "DISABLE_FREE_USER_CASH_BOOKING_FEATURE", "ENABLE_EASY_SUPPORT_BOT_FEATURE", "SHOW_ONLY_BOOKABLE_FEATURE", "HIDE_FLIGHT_SEARCH_CONTAINER_FEATURE", "HIDE_HOTEL_SEARCH_CONTAINER_FEATURE", "EXTERNAL_INVENTORY_FEATURE"];
|
|
4
4
|
declare const ListFeatureFlag: readonly ["WALLET_PROGRAM_TYPES_FEATURES", "HOTEL_FILTERS_FEATURES", "FLIGHT_FILTERS_FEATURES", "WALLET_FEATURES"];
|
|
5
5
|
export declare enum EBookingPaymentMethod {
|
|
@@ -7,6 +7,11 @@ export declare enum EBookingPaymentMethod {
|
|
|
7
7
|
FULL_VCC_PARTIAL_ENABLED = "Full VCC - Partial Enabled",
|
|
8
8
|
FULL_VCC_PARTIAL_DISABLED = "Full VCC - Partial Disabled"
|
|
9
9
|
}
|
|
10
|
+
export declare enum EThemeFeatureFlag {
|
|
11
|
+
LIGHT = "light",
|
|
12
|
+
DARK = "dark",
|
|
13
|
+
USER = "user"
|
|
14
|
+
}
|
|
10
15
|
export type FeatureFlags = StringFeatureFlags & BooleanFeatureFlags & ListFeatureFlags;
|
|
11
16
|
type StringFeatureFlags = {
|
|
12
17
|
[K in (typeof StringFeatureFlag)[number] as CamelCase<K>]: string;
|
|
@@ -128,6 +128,7 @@ export interface IFlightBookingDetails {
|
|
|
128
128
|
flights: IFlight[];
|
|
129
129
|
availableActions: string[];
|
|
130
130
|
airlineInitiatedChanges: IAirlineInitiatedChanges[];
|
|
131
|
+
services: IConfirmedFlightService[];
|
|
131
132
|
}
|
|
132
133
|
export interface IFlight {
|
|
133
134
|
origin: IAirport;
|
|
@@ -156,3 +157,20 @@ export interface IAirlineInitiatedChanges {
|
|
|
156
157
|
added: ISlice[];
|
|
157
158
|
removed: ISlice[];
|
|
158
159
|
}
|
|
160
|
+
export interface IConfirmedFlightService {
|
|
161
|
+
segmentIds: string[];
|
|
162
|
+
passengerIds: string[];
|
|
163
|
+
totalCurrency: string;
|
|
164
|
+
quantity: number;
|
|
165
|
+
metadata?: IFlightServiceMetadata;
|
|
166
|
+
totalAmount: string;
|
|
167
|
+
type: string;
|
|
168
|
+
id: string;
|
|
169
|
+
}
|
|
170
|
+
export interface IFlightServiceMetadata {
|
|
171
|
+
disclosures: string[];
|
|
172
|
+
designator: string;
|
|
173
|
+
name: any;
|
|
174
|
+
type: string;
|
|
175
|
+
maximumWeightKg: number;
|
|
176
|
+
}
|
package/dist/main.js
CHANGED
|
@@ -6,10 +6,10 @@ import { ClientPointsValue as x } from "./components/ClientPointsValue/ClientPoi
|
|
|
6
6
|
import { Card as u } from "./components/Wallet/Card/Card.js";
|
|
7
7
|
import { awayzClient as c } from "./configs/awayzClient.js";
|
|
8
8
|
import { defaultAwayzConfig as C } from "./configs/defaultAwayzConfig.js";
|
|
9
|
-
import { useAwayzContext as
|
|
10
|
-
import { useBookingManagement as
|
|
11
|
-
import { useSearchLimit as
|
|
12
|
-
import { ETripStatus as
|
|
9
|
+
import { useAwayzContext as F } from "./hooks/useAwayzContext.js";
|
|
10
|
+
import { useBookingManagement as w } from "./hooks/useBookingManagement/useBookingManagement.js";
|
|
11
|
+
import { useSearchLimit as T } from "./hooks/useSearchLimit.js";
|
|
12
|
+
import { ETripStatus as k, useTripManagement as A } from "./hooks/useTripManagement/useTripManagement.js";
|
|
13
13
|
import { useWallet as P } from "./hooks/useWallet/useWallet.js";
|
|
14
14
|
import { ECancelStatus as z } from "./hooks/useBookingManagement/useBookingManagement.types.js";
|
|
15
15
|
import { AwayzProvider as D } from "./providers/AwayzProvider.js";
|
|
@@ -20,8 +20,8 @@ import { EBookingType as j } from "./services/trips/TripService.types.js";
|
|
|
20
20
|
import { EAuthFlow as G } from "./types/EAuthFlow.js";
|
|
21
21
|
import { convertCashToClientPoints as K } from "./utils/clientPoints.js";
|
|
22
22
|
import { getCurrency as X } from "./utils/currency.js";
|
|
23
|
-
import { EAmountsDisplayFeature as Z, EBookingPaymentMethod as _, EFlightBookingOptionsDisplayFeature as $,
|
|
24
|
-
import { getBaseUrl as
|
|
23
|
+
import { EAmountsDisplayFeature as Z, EBookingPaymentMethod as _, EFlightBookingOptionsDisplayFeature as $, EThemeFeatureFlag as oo, useFeatureFlags as eo } from "./hooks/useFeatureFlags.js";
|
|
24
|
+
import { getBaseUrl as to } from "./configs/baseUrl.js";
|
|
25
25
|
export {
|
|
26
26
|
D as AwayzProvider,
|
|
27
27
|
u as Card,
|
|
@@ -35,8 +35,9 @@ export {
|
|
|
35
35
|
z as ECancelStatus,
|
|
36
36
|
$ as EFlightBookingOptionsDisplayFeature,
|
|
37
37
|
m as EInvalidAmountDisplayOption,
|
|
38
|
+
oo as EThemeFeatureFlag,
|
|
38
39
|
s as EToolTipPosition,
|
|
39
|
-
|
|
40
|
+
k as ETripStatus,
|
|
40
41
|
r as FlightBooking,
|
|
41
42
|
a as HotelBooking,
|
|
42
43
|
W as RewardsService,
|
|
@@ -46,13 +47,13 @@ export {
|
|
|
46
47
|
K as convertCashToClientPoints,
|
|
47
48
|
C as defaultAwayzConfig,
|
|
48
49
|
L as gatewayInstance,
|
|
49
|
-
|
|
50
|
+
to as getBaseUrl,
|
|
50
51
|
X as getCurrency,
|
|
51
52
|
N as instance,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
F as useAwayzContext,
|
|
54
|
+
w as useBookingManagement,
|
|
55
|
+
eo as useFeatureFlags,
|
|
56
|
+
T as useSearchLimit,
|
|
57
|
+
A as useTripManagement,
|
|
57
58
|
P as useWallet
|
|
58
59
|
};
|
|
@@ -2,7 +2,7 @@ var g = Object.defineProperty;
|
|
|
2
2
|
var f = (c, t, a) => t in c ? g(c, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : c[t] = a;
|
|
3
3
|
var r = (c, t, a) => f(c, typeof t != "symbol" ? t + "" : t, a);
|
|
4
4
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
5
|
-
import { c as l, b as
|
|
5
|
+
import { c as l, b as m, g as p } from "../../noRetryInstance-C4bqpBc7.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { EBookingEndpoints as i } from "../../configs/endpoints.js";
|
|
8
8
|
const y = (c) => {
|
|
@@ -54,12 +54,12 @@ class h {
|
|
|
54
54
|
longitude: a.data.accommodation.location.geographic_coordinates.longitude
|
|
55
55
|
},
|
|
56
56
|
images: a.data.accommodation.photos.map((o) => o.url),
|
|
57
|
-
guests: a.data.guests.map((o,
|
|
57
|
+
guests: a.data.guests.map((o, _) => {
|
|
58
58
|
var u;
|
|
59
59
|
return {
|
|
60
60
|
familyName: o.family_name,
|
|
61
61
|
givenName: o.given_name,
|
|
62
|
-
type: (u = a.data.guest_types[
|
|
62
|
+
type: (u = a.data.guest_types[_]) == null ? void 0 : u.type
|
|
63
63
|
};
|
|
64
64
|
}),
|
|
65
65
|
numberOfRooms: (s = a.data.rooms) == null ? void 0 : s.length,
|
|
@@ -71,9 +71,9 @@ class h {
|
|
|
71
71
|
})
|
|
72
72
|
),
|
|
73
73
|
rooms: (e = a.data.rooms) == null ? void 0 : e.map((o) => {
|
|
74
|
-
var
|
|
74
|
+
var _;
|
|
75
75
|
return {
|
|
76
|
-
beds: (
|
|
76
|
+
beds: (_ = o.beds) == null ? void 0 : _.map((u) => ({
|
|
77
77
|
type: u.type,
|
|
78
78
|
count: u.count
|
|
79
79
|
})),
|
|
@@ -138,12 +138,12 @@ class h {
|
|
|
138
138
|
numberOfStops: e.segments.length - 1,
|
|
139
139
|
reference: a.data.booking_reference,
|
|
140
140
|
durationInMinutes: y(e.duration),
|
|
141
|
-
origin:
|
|
142
|
-
destination:
|
|
143
|
-
segments:
|
|
141
|
+
origin: m(e.origin),
|
|
142
|
+
destination: m(e.destination),
|
|
143
|
+
segments: m(e.segments)
|
|
144
144
|
})),
|
|
145
145
|
availableActions: a.data.available_actions,
|
|
146
|
-
airlineInitiatedChanges:
|
|
146
|
+
airlineInitiatedChanges: m(a.data.airline_initiated_changes) || [],
|
|
147
147
|
cancellationDetails: a.data.cancellation_details ? {
|
|
148
148
|
refundAmount: parseFloat(
|
|
149
149
|
a.data.cancellation_details.refund_amount
|
|
@@ -151,7 +151,8 @@ class h {
|
|
|
151
151
|
refundCurrency: a.data.cancellation_details.refund_currency,
|
|
152
152
|
refundTo: a.data.cancellation_details.refund_to,
|
|
153
153
|
confirmedAt: a.data.cancellation_details.confirmed_at
|
|
154
|
-
} : void 0
|
|
154
|
+
} : void 0,
|
|
155
|
+
services: m(a.data.services)
|
|
155
156
|
};
|
|
156
157
|
});
|
|
157
158
|
r(this, "initiateCancelFlightBooking", async (t) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odynn/awayz-core",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"@types/node": "^22.10.7",
|
|
30
30
|
"@types/react": "^18.3.18",
|
|
31
31
|
"@types/react-dom": "^18.3.5",
|
|
32
|
+
"@type-op/shared": "^1.0.0",
|
|
32
33
|
"@vitejs/plugin-react": "^4.3.4",
|
|
33
34
|
"axios": "^1.7.9",
|
|
34
35
|
"eslint": "^9.17.0",
|