@voyantjs/flights-react 0.21.0
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/client.d.ts +16 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +75 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +12 -0
- package/dist/hooks/use-aircraft.d.ts +17 -0
- package/dist/hooks/use-aircraft.d.ts.map +1 -0
- package/dist/hooks/use-aircraft.js +18 -0
- package/dist/hooks/use-airlines.d.ts +18 -0
- package/dist/hooks/use-airlines.d.ts.map +1 -0
- package/dist/hooks/use-airlines.js +18 -0
- package/dist/hooks/use-airport-search.d.ts +28 -0
- package/dist/hooks/use-airport-search.d.ts.map +1 -0
- package/dist/hooks/use-airport-search.js +23 -0
- package/dist/hooks/use-airports.d.ts +21 -0
- package/dist/hooks/use-airports.d.ts.map +1 -0
- package/dist/hooks/use-airports.js +17 -0
- package/dist/hooks/use-flight-ancillaries.d.ts +63 -0
- package/dist/hooks/use-flight-ancillaries.d.ts.map +1 -0
- package/dist/hooks/use-flight-ancillaries.js +24 -0
- package/dist/hooks/use-flight-book.d.ts +139 -0
- package/dist/hooks/use-flight-book.d.ts.map +1 -0
- package/dist/hooks/use-flight-book.js +24 -0
- package/dist/hooks/use-flight-offer.d.ts +106 -0
- package/dist/hooks/use-flight-offer.d.ts.map +1 -0
- package/dist/hooks/use-flight-offer.js +20 -0
- package/dist/hooks/use-flight-order.d.ts +286 -0
- package/dist/hooks/use-flight-order.d.ts.map +1 -0
- package/dist/hooks/use-flight-order.js +38 -0
- package/dist/hooks/use-flight-orders.d.ts +147 -0
- package/dist/hooks/use-flight-orders.d.ts.map +1 -0
- package/dist/hooks/use-flight-orders.js +31 -0
- package/dist/hooks/use-flight-search.d.ts +110 -0
- package/dist/hooks/use-flight-search.d.ts.map +1 -0
- package/dist/hooks/use-flight-search.js +18 -0
- package/dist/hooks/use-flight-seat-map.d.ts +49 -0
- package/dist/hooks/use-flight-seat-map.d.ts.map +1 -0
- package/dist/hooks/use-flight-seat-map.js +23 -0
- package/dist/hooks/use-saved-payment-methods.d.ts +23 -0
- package/dist/hooks/use-saved-payment-methods.d.ts.map +1 -0
- package/dist/hooks/use-saved-payment-methods.js +20 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +1 -0
- package/dist/query-keys.d.ts +42 -0
- package/dist/query-keys.d.ts.map +1 -0
- package/dist/query-keys.js +22 -0
- package/dist/query-options.d.ts +827 -0
- package/dist/query-options.d.ts.map +1 -0
- package/dist/query-options.js +58 -0
- package/dist/schemas.d.ts +1658 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +295 -0
- package/package.json +85 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { FlightSearchRequest } from "@voyantjs/flights/contract/types";
|
|
2
|
+
export interface UseFlightSearchOptions {
|
|
3
|
+
/** Disable the query — useful while the form is incomplete. */
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
/** TanStack Query stale time, milliseconds. Default 30s. */
|
|
6
|
+
staleTime?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* POST `/v1/admin/flights/search`. Re-runs whenever the request changes.
|
|
10
|
+
* Disabled by default until the form is complete (no slices, etc.) — pass
|
|
11
|
+
* `enabled: true` once the request is ready to fire.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useFlightSearch(request: FlightSearchRequest, options?: UseFlightSearchOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
14
|
+
offers: {
|
|
15
|
+
offerId: string;
|
|
16
|
+
source: string;
|
|
17
|
+
itineraries: {
|
|
18
|
+
segments: {
|
|
19
|
+
segmentId: string;
|
|
20
|
+
carrierCode: string;
|
|
21
|
+
flightNumber: string;
|
|
22
|
+
departure: {
|
|
23
|
+
iataCode: string;
|
|
24
|
+
at: string;
|
|
25
|
+
terminal?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
arrival: {
|
|
28
|
+
iataCode: string;
|
|
29
|
+
at: string;
|
|
30
|
+
terminal?: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
cabin: "economy" | "premium_economy" | "business" | "first";
|
|
33
|
+
operatingCarrierCode?: string | undefined;
|
|
34
|
+
operatingFlightNumber?: string | undefined;
|
|
35
|
+
duration?: string | undefined;
|
|
36
|
+
aircraft?: string | undefined;
|
|
37
|
+
fareClass?: string | undefined;
|
|
38
|
+
fareBasis?: string | undefined;
|
|
39
|
+
status?: string | undefined;
|
|
40
|
+
providerData?: Record<string, unknown> | undefined;
|
|
41
|
+
}[];
|
|
42
|
+
duration?: string | undefined;
|
|
43
|
+
}[];
|
|
44
|
+
fareBreakdowns: {
|
|
45
|
+
passengerType: "adult" | "child" | "infant" | "senior" | "youth";
|
|
46
|
+
passengerCount: number;
|
|
47
|
+
baseFare: {
|
|
48
|
+
amount: string;
|
|
49
|
+
currency: string;
|
|
50
|
+
};
|
|
51
|
+
taxes: {
|
|
52
|
+
amount: string;
|
|
53
|
+
currency: string;
|
|
54
|
+
};
|
|
55
|
+
total: {
|
|
56
|
+
amount: string;
|
|
57
|
+
currency: string;
|
|
58
|
+
};
|
|
59
|
+
fees?: {
|
|
60
|
+
amount: string;
|
|
61
|
+
currency: string;
|
|
62
|
+
} | undefined;
|
|
63
|
+
fareFamily?: string | undefined;
|
|
64
|
+
}[];
|
|
65
|
+
totalPrice: {
|
|
66
|
+
amount: string;
|
|
67
|
+
currency: string;
|
|
68
|
+
};
|
|
69
|
+
validatingCarrier?: string | undefined;
|
|
70
|
+
expiresAt?: string | undefined;
|
|
71
|
+
lastTicketingDate?: string | undefined;
|
|
72
|
+
instantTicketing?: boolean | undefined;
|
|
73
|
+
fareBundles?: {
|
|
74
|
+
id: string;
|
|
75
|
+
label: string;
|
|
76
|
+
tier: "basic" | "standard" | "plus" | "premium";
|
|
77
|
+
priceDelta: {
|
|
78
|
+
amount: string;
|
|
79
|
+
currency: string;
|
|
80
|
+
};
|
|
81
|
+
inclusions: {
|
|
82
|
+
cabinBag?: {
|
|
83
|
+
included: boolean;
|
|
84
|
+
weightKg?: number | undefined;
|
|
85
|
+
} | undefined;
|
|
86
|
+
checkedBag?: {
|
|
87
|
+
included: boolean;
|
|
88
|
+
pieces?: number | undefined;
|
|
89
|
+
weightKg?: number | undefined;
|
|
90
|
+
} | undefined;
|
|
91
|
+
seatSelection?: "standard" | "none" | "free" | undefined;
|
|
92
|
+
priorityBoarding?: boolean | undefined;
|
|
93
|
+
loungeAccess?: boolean | undefined;
|
|
94
|
+
refundable?: boolean | undefined;
|
|
95
|
+
changeable?: boolean | undefined;
|
|
96
|
+
notes?: string[] | undefined;
|
|
97
|
+
};
|
|
98
|
+
recommended?: boolean | undefined;
|
|
99
|
+
providerData?: Record<string, unknown> | undefined;
|
|
100
|
+
}[] | undefined;
|
|
101
|
+
providerData?: Record<string, unknown> | undefined;
|
|
102
|
+
}[];
|
|
103
|
+
pagination?: {
|
|
104
|
+
total: number;
|
|
105
|
+
hasMore: boolean;
|
|
106
|
+
cursor?: string | undefined;
|
|
107
|
+
} | undefined;
|
|
108
|
+
providerData?: Record<string, unknown> | undefined;
|
|
109
|
+
}, Error>;
|
|
110
|
+
//# sourceMappingURL=use-flight-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-flight-search.d.ts","sourceRoot":"","sources":["../../src/hooks/use-flight-search.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAK3E,MAAM,WAAW,sBAAsB;IACrC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,mBAAmB,EAC5B,OAAO,GAAE,sBAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UASrC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantFlightsContext } from "../provider.js";
|
|
4
|
+
import { getFlightSearchQueryOptions } from "../query-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* POST `/v1/admin/flights/search`. Re-runs whenever the request changes.
|
|
7
|
+
* Disabled by default until the form is complete (no slices, etc.) — pass
|
|
8
|
+
* `enabled: true` once the request is ready to fire.
|
|
9
|
+
*/
|
|
10
|
+
export function useFlightSearch(request, options = {}) {
|
|
11
|
+
const client = useVoyantFlightsContext();
|
|
12
|
+
const { enabled = false, staleTime = 30_000 } = options;
|
|
13
|
+
return useQuery({
|
|
14
|
+
...getFlightSearchQueryOptions(client, request),
|
|
15
|
+
enabled: enabled && request.slices.length > 0 && request.passengers.adults > 0,
|
|
16
|
+
staleTime,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { FlightOffer } from "@voyantjs/flights/contract/types";
|
|
2
|
+
export interface UseFlightSeatMapOptions {
|
|
3
|
+
/** Disable the query — useful before the offer is re-priced or the user enters the seats step. */
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
/** TanStack Query stale time, milliseconds. Default 5 minutes. */
|
|
6
|
+
staleTime?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* POST `/v1/admin/flights/seatmap` — fetches the seat map for one segment
|
|
10
|
+
* of an offer. Maps are per-segment because layouts differ by aircraft and
|
|
11
|
+
* cabin (a multi-stop itinerary may use different equipment per leg).
|
|
12
|
+
*
|
|
13
|
+
* Default `enabled = false` so callers gate fetching on the user actually
|
|
14
|
+
* entering the seat selection step. When the connector doesn't declare
|
|
15
|
+
* `flight/seatmap`, the API returns 501 — propagated as a query error.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useFlightSeatMap(input: {
|
|
18
|
+
offerId: string;
|
|
19
|
+
segmentId: string;
|
|
20
|
+
offer?: FlightOffer;
|
|
21
|
+
} | null, options?: UseFlightSeatMapOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
22
|
+
seatMap: {
|
|
23
|
+
segmentId: string;
|
|
24
|
+
cabin: "economy" | "premium_economy" | "business" | "first";
|
|
25
|
+
columnLayout: (string | null)[];
|
|
26
|
+
rows: {
|
|
27
|
+
row: number;
|
|
28
|
+
seats: {
|
|
29
|
+
seatNumber: string;
|
|
30
|
+
row: number;
|
|
31
|
+
column: string;
|
|
32
|
+
status: "available" | "blocked" | "unavailable" | "selected";
|
|
33
|
+
category: "standard" | "premium" | "preferred" | "extra_legroom" | "exit_row" | "bulkhead";
|
|
34
|
+
price?: {
|
|
35
|
+
amount: string;
|
|
36
|
+
currency: string;
|
|
37
|
+
} | undefined;
|
|
38
|
+
notes?: string | undefined;
|
|
39
|
+
window?: boolean | undefined;
|
|
40
|
+
aisle?: boolean | undefined;
|
|
41
|
+
providerData?: Record<string, unknown> | undefined;
|
|
42
|
+
}[];
|
|
43
|
+
}[];
|
|
44
|
+
aircraft?: string | undefined;
|
|
45
|
+
providerData?: Record<string, unknown> | undefined;
|
|
46
|
+
};
|
|
47
|
+
validUntil?: string | undefined;
|
|
48
|
+
}, Error>;
|
|
49
|
+
//# sourceMappingURL=use-flight-seat-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-flight-seat-map.d.ts","sourceRoot":"","sources":["../../src/hooks/use-flight-seat-map.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAKnE,MAAM,WAAW,uBAAuB;IACtC,kGAAkG;IAClG,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,WAAW,CAAA;CAAE,GAAG,IAAI,EACzE,OAAO,GAAE,uBAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;UAUtC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantFlightsContext } from "../provider.js";
|
|
4
|
+
import { getFlightSeatMapQueryOptions } from "../query-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* POST `/v1/admin/flights/seatmap` — fetches the seat map for one segment
|
|
7
|
+
* of an offer. Maps are per-segment because layouts differ by aircraft and
|
|
8
|
+
* cabin (a multi-stop itinerary may use different equipment per leg).
|
|
9
|
+
*
|
|
10
|
+
* Default `enabled = false` so callers gate fetching on the user actually
|
|
11
|
+
* entering the seat selection step. When the connector doesn't declare
|
|
12
|
+
* `flight/seatmap`, the API returns 501 — propagated as a query error.
|
|
13
|
+
*/
|
|
14
|
+
export function useFlightSeatMap(input, options = {}) {
|
|
15
|
+
const client = useVoyantFlightsContext();
|
|
16
|
+
const { enabled = false, staleTime = 5 * 60_000 } = options;
|
|
17
|
+
const safeInput = input ?? { offerId: "", segmentId: "" };
|
|
18
|
+
return useQuery({
|
|
19
|
+
...getFlightSeatMapQueryOptions(client, safeInput),
|
|
20
|
+
enabled: enabled && !!input?.offerId && !!input?.segmentId,
|
|
21
|
+
staleTime,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface UseSavedPaymentMethodsOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
staleTime?: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* GET `/v1/crm/people/:personId/payment-methods` — list a person's saved
|
|
7
|
+
* payment methods. Backed by the CRM `person_payment_methods` table.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useSavedPaymentMethods(personId: string | null | undefined, options?: UseSavedPaymentMethodsOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
10
|
+
data: {
|
|
11
|
+
id: string;
|
|
12
|
+
brand: "visa" | "mastercard" | "amex" | "revolut" | "bank_transfer";
|
|
13
|
+
last4: string | null;
|
|
14
|
+
processorToken: string;
|
|
15
|
+
isDefault: boolean;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
personId?: string | undefined;
|
|
18
|
+
holderName?: string | null | undefined;
|
|
19
|
+
expMonth?: number | null | undefined;
|
|
20
|
+
expYear?: number | null | undefined;
|
|
21
|
+
}[];
|
|
22
|
+
}, Error>;
|
|
23
|
+
//# sourceMappingURL=use-saved-payment-methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-saved-payment-methods.d.ts","sourceRoot":"","sources":["../../src/hooks/use-saved-payment-methods.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,OAAO,GAAE,6BAAkC;;;;;;;;;;;;;UAe5C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { fetchWithValidation } from "../client.js";
|
|
4
|
+
import { useVoyantFlightsContext } from "../provider.js";
|
|
5
|
+
import { flightsQueryKeys } from "../query-keys.js";
|
|
6
|
+
import { savedPaymentMethodListResponseSchema, } from "../schemas.js";
|
|
7
|
+
/**
|
|
8
|
+
* GET `/v1/crm/people/:personId/payment-methods` — list a person's saved
|
|
9
|
+
* payment methods. Backed by the CRM `person_payment_methods` table.
|
|
10
|
+
*/
|
|
11
|
+
export function useSavedPaymentMethods(personId, options = {}) {
|
|
12
|
+
const client = useVoyantFlightsContext();
|
|
13
|
+
const { enabled = true, staleTime = 30_000 } = options;
|
|
14
|
+
return useQuery({
|
|
15
|
+
queryKey: flightsQueryKeys.savedPaymentMethods(personId ?? ""),
|
|
16
|
+
queryFn: () => fetchWithValidation(`/v1/crm/people/${encodeURIComponent(personId ?? "")}/payment-methods`, savedPaymentMethodListResponseSchema, client),
|
|
17
|
+
enabled: enabled && !!personId,
|
|
18
|
+
staleTime,
|
|
19
|
+
});
|
|
20
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { defaultFetcher, type FetchWithValidationOptions, fetchWithValidation, VoyantApiError, type VoyantFetcher, } from "./client.js";
|
|
2
|
+
export * from "./hooks/index.js";
|
|
3
|
+
export { useVoyantFlightsContext, type VoyantFlightsContextValue, VoyantFlightsProvider, type VoyantFlightsProviderProps, } from "./provider.js";
|
|
4
|
+
export { type AirportSearchFilters, type FlightOrderPaymentStatus, type FlightOrdersListFilters, flightsQueryKeys, } from "./query-keys.js";
|
|
5
|
+
export { getAircraftQueryOptions, getAirlinesQueryOptions, getAirportsQueryOptions, getFlightAncillariesQueryOptions, getFlightSearchQueryOptions, getFlightSeatMapQueryOptions, } from "./query-options.js";
|
|
6
|
+
export * from "./schemas.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,KAAK,0BAA0B,EAC/B,mBAAmB,EACnB,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AACpB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,uBAAuB,EACvB,KAAK,yBAAyB,EAC9B,qBAAqB,EACrB,KAAK,0BAA0B,GAChC,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,gBAAgB,GACjB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,gCAAgC,EAChC,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,oBAAoB,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { defaultFetcher, fetchWithValidation, VoyantApiError, } from "./client.js";
|
|
2
|
+
export * from "./hooks/index.js";
|
|
3
|
+
export { useVoyantFlightsContext, VoyantFlightsProvider, } from "./provider.js";
|
|
4
|
+
export { flightsQueryKeys, } from "./query-keys.js";
|
|
5
|
+
export { getAircraftQueryOptions, getAirlinesQueryOptions, getAirportsQueryOptions, getFlightAncillariesQueryOptions, getFlightSearchQueryOptions, getFlightSeatMapQueryOptions, } from "./query-options.js";
|
|
6
|
+
export * from "./schemas.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { useVoyantReactContext as useVoyantFlightsContext, type VoyantReactContextValue as VoyantFlightsContextValue, VoyantReactProvider as VoyantFlightsProvider, type VoyantReactProviderProps as VoyantFlightsProviderProps, } from "@voyantjs/react";
|
|
2
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,IAAI,uBAAuB,EAChD,KAAK,uBAAuB,IAAI,yBAAyB,EACzD,mBAAmB,IAAI,qBAAqB,EAC5C,KAAK,wBAAwB,IAAI,0BAA0B,GAC5D,MAAM,iBAAiB,CAAA"}
|
package/dist/provider.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useVoyantReactContext as useVoyantFlightsContext, VoyantReactProvider as VoyantFlightsProvider, } from "@voyantjs/react";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { FlightOrderStatus, FlightSearchRequest } from "@voyantjs/flights/contract/types";
|
|
2
|
+
export interface AirportSearchFilters {
|
|
3
|
+
q?: string | undefined;
|
|
4
|
+
limit?: number | undefined;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* `paymentStatus` mirrors the finance `payment_session` statuses, plus
|
|
8
|
+
* `"none"` for orders the operator hasn't created a session for yet.
|
|
9
|
+
* Sent operator-side; the underlying flight adapter stays unaware of
|
|
10
|
+
* payments.
|
|
11
|
+
*/
|
|
12
|
+
export type FlightOrderPaymentStatus = "none" | "pending" | "requires_redirect" | "processing" | "authorized" | "paid" | "failed" | "cancelled" | "expired";
|
|
13
|
+
export interface FlightOrdersListFilters {
|
|
14
|
+
cursor?: string | undefined;
|
|
15
|
+
limit?: number | undefined;
|
|
16
|
+
search?: string | undefined;
|
|
17
|
+
status?: FlightOrderStatus[] | undefined;
|
|
18
|
+
paymentStatus?: FlightOrderPaymentStatus[] | undefined;
|
|
19
|
+
}
|
|
20
|
+
export declare const flightsQueryKeys: {
|
|
21
|
+
readonly all: readonly ["voyant", "flights"];
|
|
22
|
+
readonly search: () => readonly ["voyant", "flights", "search"];
|
|
23
|
+
readonly searchRequest: (request: FlightSearchRequest) => readonly ["voyant", "flights", "search", FlightSearchRequest];
|
|
24
|
+
readonly offer: () => readonly ["voyant", "flights", "offer"];
|
|
25
|
+
readonly offerDetail: (offerId: string) => readonly ["voyant", "flights", "offer", "detail", string];
|
|
26
|
+
readonly ancillaries: () => readonly ["voyant", "flights", "ancillaries"];
|
|
27
|
+
readonly ancillariesForOffer: (offerId: string) => readonly ["voyant", "flights", "ancillaries", string];
|
|
28
|
+
readonly seatMap: () => readonly ["voyant", "flights", "seatmap"];
|
|
29
|
+
readonly seatMapForSegment: (offerId: string, segmentId: string) => readonly ["voyant", "flights", "seatmap", string, string];
|
|
30
|
+
/** Saved payment methods are CRM-adjacent but currently expose via the operator template route. */
|
|
31
|
+
readonly savedPaymentMethods: (personId: string) => readonly ["voyant", "flights", "saved-payment-methods", string];
|
|
32
|
+
readonly order: () => readonly ["voyant", "flights", "order"];
|
|
33
|
+
readonly orderDetail: (orderId: string) => readonly ["voyant", "flights", "order", "detail", string];
|
|
34
|
+
readonly orderList: (filters: FlightOrdersListFilters) => readonly ["voyant", "flights", "order", "list", FlightOrdersListFilters];
|
|
35
|
+
readonly reference: () => readonly ["voyant", "flights", "reference"];
|
|
36
|
+
readonly airlines: () => readonly ["voyant", "flights", "reference", "airlines"];
|
|
37
|
+
readonly airports: (filters: AirportSearchFilters) => readonly ["voyant", "flights", "reference", "airports", AirportSearchFilters];
|
|
38
|
+
readonly airline: (iataCode: string) => readonly ["voyant", "flights", "reference", "airline", string];
|
|
39
|
+
readonly airport: (iataCode: string) => readonly ["voyant", "flights", "reference", "airport", string];
|
|
40
|
+
readonly aircraft: () => readonly ["voyant", "flights", "reference", "aircraft"];
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=query-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-keys.d.ts","sourceRoot":"","sources":["../src/query-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAE9F,MAAM,WAAW,oBAAoB;IACnC,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC3B;AAED;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAChC,MAAM,GACN,SAAS,GACT,mBAAmB,GACnB,YAAY,GACZ,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,WAAW,GACX,SAAS,CAAA;AAEb,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,MAAM,CAAC,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAA;IACxC,aAAa,CAAC,EAAE,wBAAwB,EAAE,GAAG,SAAS,CAAA;CACvD;AAED,eAAO,MAAM,gBAAgB;;;sCAIF,mBAAmB;;oCAGrB,MAAM;;4CAGE,MAAM;;0CAGR,MAAM,aAAa,MAAM;IAGtD,mGAAmG;6CACnE,MAAM;;oCAIf,MAAM;kCACR,uBAAuB;;;iCAKxB,oBAAoB;iCAEpB,MAAM;iCACN,MAAM;;CAElB,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const flightsQueryKeys = {
|
|
2
|
+
all: ["voyant", "flights"],
|
|
3
|
+
search: () => [...flightsQueryKeys.all, "search"],
|
|
4
|
+
searchRequest: (request) => [...flightsQueryKeys.search(), request],
|
|
5
|
+
offer: () => [...flightsQueryKeys.all, "offer"],
|
|
6
|
+
offerDetail: (offerId) => [...flightsQueryKeys.offer(), "detail", offerId],
|
|
7
|
+
ancillaries: () => [...flightsQueryKeys.all, "ancillaries"],
|
|
8
|
+
ancillariesForOffer: (offerId) => [...flightsQueryKeys.ancillaries(), offerId],
|
|
9
|
+
seatMap: () => [...flightsQueryKeys.all, "seatmap"],
|
|
10
|
+
seatMapForSegment: (offerId, segmentId) => [...flightsQueryKeys.seatMap(), offerId, segmentId],
|
|
11
|
+
/** Saved payment methods are CRM-adjacent but currently expose via the operator template route. */
|
|
12
|
+
savedPaymentMethods: (personId) => [...flightsQueryKeys.all, "saved-payment-methods", personId],
|
|
13
|
+
order: () => [...flightsQueryKeys.all, "order"],
|
|
14
|
+
orderDetail: (orderId) => [...flightsQueryKeys.order(), "detail", orderId],
|
|
15
|
+
orderList: (filters) => [...flightsQueryKeys.order(), "list", filters],
|
|
16
|
+
reference: () => [...flightsQueryKeys.all, "reference"],
|
|
17
|
+
airlines: () => [...flightsQueryKeys.reference(), "airlines"],
|
|
18
|
+
airports: (filters) => [...flightsQueryKeys.reference(), "airports", filters],
|
|
19
|
+
airline: (iataCode) => [...flightsQueryKeys.reference(), "airline", iataCode],
|
|
20
|
+
airport: (iataCode) => [...flightsQueryKeys.reference(), "airport", iataCode],
|
|
21
|
+
aircraft: () => [...flightsQueryKeys.reference(), "aircraft"],
|
|
22
|
+
};
|