@odynn/awayz-core 0.9.1 → 0.9.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.
|
@@ -49,7 +49,7 @@ const $ = (n, t) => {
|
|
|
49
49
|
}
|
|
50
50
|
}), {
|
|
51
51
|
mutate: I,
|
|
52
|
-
isPending:
|
|
52
|
+
isPending: m,
|
|
53
53
|
isError: y,
|
|
54
54
|
error: G,
|
|
55
55
|
isSuccess: L
|
|
@@ -62,7 +62,7 @@ const $ = (n, t) => {
|
|
|
62
62
|
provider: r.pointsAsCash.provider,
|
|
63
63
|
type: o.FLIGHT,
|
|
64
64
|
pointsAmount: r.pointsAsCash.points,
|
|
65
|
-
cashAmount: r.pointsAsCash.cashValue
|
|
65
|
+
cashAmount: r.pointsAsCash.cashValue.amount
|
|
66
66
|
}), e.confirmCancelFlightBooking(n);
|
|
67
67
|
if (t === o.HOTEL)
|
|
68
68
|
return i != null && i.pointsAsCash && await e.cancelPointsBooking({
|
|
@@ -71,7 +71,7 @@ const $ = (n, t) => {
|
|
|
71
71
|
provider: i.pointsAsCash.provider,
|
|
72
72
|
type: o.HOTEL,
|
|
73
73
|
pointsAmount: i.pointsAsCash.points,
|
|
74
|
-
cashAmount: i.pointsAsCash.cashValue
|
|
74
|
+
cashAmount: i.pointsAsCash.cashValue.amount
|
|
75
75
|
}), e.cancelHotelBooking(n);
|
|
76
76
|
},
|
|
77
77
|
onSuccess: () => {
|
|
@@ -84,15 +84,15 @@ const $ = (n, t) => {
|
|
|
84
84
|
error: K
|
|
85
85
|
} = u({
|
|
86
86
|
mutationFn: async (c) => {
|
|
87
|
-
var
|
|
88
|
-
const
|
|
87
|
+
var C, l;
|
|
88
|
+
const p = (l = (C = r == null ? void 0 : r.airlineInitiatedChanges) == null ? void 0 : C.filter(
|
|
89
89
|
(T) => !T.actionTaken
|
|
90
90
|
)) == null ? void 0 : l[0];
|
|
91
|
-
if (t === o.FLIGHT && (r != null && r.airlineInitiatedChanges) &&
|
|
91
|
+
if (t === o.FLIGHT && (r != null && r.airlineInitiatedChanges) && p)
|
|
92
92
|
return e.actionAirlineChanges({
|
|
93
93
|
bookingId: n,
|
|
94
94
|
acceptChanges: c,
|
|
95
|
-
aicId:
|
|
95
|
+
aicId: p.id
|
|
96
96
|
});
|
|
97
97
|
throw new Error("Not supported for hotel bookings");
|
|
98
98
|
},
|
|
@@ -118,8 +118,8 @@ const $ = (n, t) => {
|
|
|
118
118
|
initiateCancellationError: H,
|
|
119
119
|
isInitiateCancellationSuccess: O,
|
|
120
120
|
cancelBooking: I,
|
|
121
|
-
isCancellingBooking:
|
|
122
|
-
isCancelingBooking:
|
|
121
|
+
isCancellingBooking: m,
|
|
122
|
+
isCancelingBooking: m,
|
|
123
123
|
isCancelBookingError: y,
|
|
124
124
|
cancelBookingError: G,
|
|
125
125
|
isCancelBookingSuccess: L,
|
|
@@ -28,55 +28,52 @@ const L = [
|
|
|
28
28
|
"SHOW_FOOTER_FEATURE",
|
|
29
29
|
"SHOW_AVAILABILITY_ALERTS_FEATURE",
|
|
30
30
|
"USE_POINTS_AS_CASH_FEATURE",
|
|
31
|
-
"HEADER_NAVIGATION_FEATURE",
|
|
32
31
|
"SHOW_FLIGHTS_TRANSFER_PARTNER_FEATURE",
|
|
33
32
|
"HOTEL_POINTS_ONLY_FEATURE",
|
|
34
33
|
"FREE_HOTEL_NIGHTS_FEATURE",
|
|
35
34
|
"HOTEL_DISPLAY_BEST_VALUE_FEATURE",
|
|
36
35
|
"HOTEL_DISPLAY_POINTS_BREAKDOWN_FEATURE",
|
|
37
|
-
"USE_TAB_NAVIGATION",
|
|
38
36
|
"TAB_NAVIGATION_FEATURE",
|
|
39
37
|
"ADD_AIRLINE_HEALTH_PAGE_FEATURE",
|
|
40
38
|
"SHOW_NAVIGATION_POPUP_FEATURE",
|
|
41
39
|
"SHOW_ONLY_BOOKABLE_FEATURE"
|
|
42
40
|
], S = [
|
|
43
|
-
"HOTEL_DETAILS_FEATURE",
|
|
44
41
|
"WALLET_PROGRAM_TYPES_FEATURES",
|
|
45
42
|
"HOTEL_FILTERS_FEATURES",
|
|
46
43
|
"FLIGHT_FILTERS_FEATURES",
|
|
47
44
|
"WALLET_FEATURES"
|
|
48
45
|
];
|
|
49
46
|
var r = /* @__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))(r || {});
|
|
50
|
-
const
|
|
47
|
+
const H = () => {
|
|
51
48
|
const { data: E, isSuccess: R } = U({
|
|
52
49
|
queryKey: [O.FEATURES, "new"],
|
|
53
50
|
queryFn: t.getFeatureFlags,
|
|
54
51
|
staleTime: 1 / 0
|
|
55
52
|
}), I = R && E ? (() => {
|
|
56
|
-
const
|
|
53
|
+
const A = {};
|
|
57
54
|
return L.forEach((T) => {
|
|
58
|
-
const
|
|
55
|
+
const _ = F(
|
|
59
56
|
T.toLowerCase()
|
|
60
57
|
);
|
|
61
|
-
E[T] !== void 0 && (_
|
|
58
|
+
E[T] !== void 0 && (A[_] = E[T]);
|
|
62
59
|
}), e.forEach((T) => {
|
|
63
|
-
const
|
|
60
|
+
const _ = F(
|
|
64
61
|
T.toLowerCase()
|
|
65
62
|
);
|
|
66
|
-
E[T] !== void 0 && (_
|
|
63
|
+
E[T] !== void 0 && (A[_] = E[T]);
|
|
67
64
|
}), S.forEach((T) => {
|
|
68
|
-
const
|
|
65
|
+
const _ = F(
|
|
69
66
|
T.toLowerCase()
|
|
70
67
|
);
|
|
71
|
-
E[T] !== void 0 && (_
|
|
72
|
-
}),
|
|
68
|
+
E[T] !== void 0 && (A[_] = E[T]);
|
|
69
|
+
}), A;
|
|
73
70
|
})() : null;
|
|
74
71
|
if (R && E) {
|
|
75
72
|
const T = [
|
|
76
73
|
...L,
|
|
77
74
|
...e,
|
|
78
75
|
...S
|
|
79
|
-
].filter((
|
|
76
|
+
].filter((_) => E[_] === void 0);
|
|
80
77
|
T.length > 0 && console.error("Missing feature flags:", T);
|
|
81
78
|
}
|
|
82
79
|
return {
|
|
@@ -86,5 +83,5 @@ const n = () => {
|
|
|
86
83
|
};
|
|
87
84
|
export {
|
|
88
85
|
r as EAmountsDisplayFeature,
|
|
89
|
-
|
|
86
|
+
H as useFeatureFlags
|
|
90
87
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}` ? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}` : Lowercase<S>;
|
|
2
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", "AMOUNTS_DISPLAY_FEATURE"];
|
|
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", "
|
|
4
|
-
declare const ListFeatureFlag: readonly ["
|
|
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", "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"];
|
|
4
|
+
declare const ListFeatureFlag: readonly ["WALLET_PROGRAM_TYPES_FEATURES", "HOTEL_FILTERS_FEATURES", "FLIGHT_FILTERS_FEATURES", "WALLET_FEATURES"];
|
|
5
5
|
export type FeatureFlags = StringFeatureFlags & BooleanFeatureFlags & ListFeatureFlags;
|
|
6
6
|
type StringFeatureFlags = {
|
|
7
7
|
[K in (typeof StringFeatureFlag)[number] as CamelCase<K>]: string;
|
|
@@ -58,7 +58,10 @@ export interface IPointsAsCash {
|
|
|
58
58
|
pointsValue: number;
|
|
59
59
|
confirmationCode: string;
|
|
60
60
|
provider: string;
|
|
61
|
-
cashValue:
|
|
61
|
+
cashValue: {
|
|
62
|
+
amount: number;
|
|
63
|
+
currency: string;
|
|
64
|
+
};
|
|
62
65
|
}
|
|
63
66
|
export interface ICancellationTimeline {
|
|
64
67
|
refundAmount: number;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odynn/awayz-core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
8
8
|
"main": "dist/main.js",
|
|
9
|
-
"types": "./dist/
|
|
9
|
+
"types": "./dist/main.d.ts",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"NOTE: Please run tests from the root\"",
|
|
12
12
|
"build": "tsc -b && vite build",
|