@odynn/awayz-core 0.10.1 → 0.10.3
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/hooks/useFeatureFlags.js +34 -29
- package/dist/lib/hooks/useFeatureFlags.d.ts +6 -1
- package/dist/main.js +14 -13
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useQuery as U } from "@tanstack/react-query";
|
|
2
2
|
import "../arrayExtensions-DlcBOj5a.js";
|
|
3
|
-
import { E as
|
|
4
|
-
import "react";
|
|
3
|
+
import { E as r, t as F } from "../noRetryInstance-C4bqpBc7.js";
|
|
4
|
+
import { useMemo as e } from "react";
|
|
5
5
|
import { FeatureService as N } from "../services/features/featureService.js";
|
|
6
6
|
const L = [
|
|
7
7
|
"DEFAULT_CURRENCY_FEATURE",
|
|
@@ -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,31 +54,34 @@ const L = [
|
|
|
53
54
|
"FLIGHT_FILTERS_FEATURES",
|
|
54
55
|
"WALLET_FEATURES"
|
|
55
56
|
];
|
|
56
|
-
var
|
|
57
|
-
const
|
|
57
|
+
var H = /* @__PURE__ */ ((E) => (E.DEFAULT = "default", E.FULL_VCC_PARTIAL_ENABLED = "Full VCC - Partial Enabled", E.FULL_VCC_PARTIAL_DISABLED = "Full VCC - Partial Disabled", E))(H || {}), t = /* @__PURE__ */ ((E) => (E.LIGHT = "light", E.DARK = "dark", E.USER = "user", E))(t || {}), s = /* @__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))(s || {}), a = /* @__PURE__ */ ((E) => (E.RESULT = "result", E.SHEET = "sheet", E))(a || {});
|
|
58
|
+
const i = () => {
|
|
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
|
-
}), O =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
63
|
+
}), O = e(
|
|
64
|
+
() => R && E ? (() => {
|
|
65
|
+
const T = {};
|
|
66
|
+
return L.forEach((_) => {
|
|
67
|
+
const A = F(
|
|
68
|
+
_.toLowerCase()
|
|
69
|
+
);
|
|
70
|
+
E[_] !== void 0 && (T[A] = E[_]);
|
|
71
|
+
}), S.forEach((_) => {
|
|
72
|
+
const A = F(
|
|
73
|
+
_.toLowerCase()
|
|
74
|
+
);
|
|
75
|
+
E[_] !== void 0 && (T[A] = E[_]);
|
|
76
|
+
}), I.forEach((_) => {
|
|
77
|
+
const A = F(
|
|
78
|
+
_.toLowerCase()
|
|
79
|
+
);
|
|
80
|
+
E[_] !== void 0 && (T[A] = E[_]);
|
|
81
|
+
}), T;
|
|
82
|
+
})() : null,
|
|
83
|
+
[R, E]
|
|
84
|
+
);
|
|
81
85
|
if (R && E) {
|
|
82
86
|
const _ = [
|
|
83
87
|
...L,
|
|
@@ -92,8 +96,9 @@ const l = () => {
|
|
|
92
96
|
};
|
|
93
97
|
};
|
|
94
98
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
s as EAmountsDisplayFeature,
|
|
100
|
+
H as EBookingPaymentMethod,
|
|
101
|
+
a as EFlightBookingOptionsDisplayFeature,
|
|
102
|
+
t as EThemeFeatureFlag,
|
|
103
|
+
i as useFeatureFlags
|
|
99
104
|
};
|
|
@@ -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;
|
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
|
};
|