@voyantjs/bookings-react 0.20.0 → 0.21.1
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/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use-booking-cancel-mutation.d.ts +24 -1
- package/dist/hooks/use-booking-cancel-mutation.d.ts.map +1 -1
- package/dist/hooks/use-booking-convert-mutation.d.ts +24 -1
- package/dist/hooks/use-booking-convert-mutation.d.ts.map +1 -1
- package/dist/hooks/use-booking-dual-create-mutation.d.ts +104 -2
- package/dist/hooks/use-booking-dual-create-mutation.d.ts.map +1 -1
- package/dist/hooks/use-booking-group.d.ts +24 -1
- package/dist/hooks/use-booking-group.d.ts.map +1 -1
- package/dist/hooks/use-booking-mutation.d.ts +49 -3
- package/dist/hooks/use-booking-mutation.d.ts.map +1 -1
- package/dist/hooks/use-booking-quick-create-mutation.d.ts +52 -1
- package/dist/hooks/use-booking-quick-create-mutation.d.ts.map +1 -1
- package/dist/hooks/use-booking-status-mutation.d.ts +48 -2
- package/dist/hooks/use-booking-status-mutation.d.ts.map +1 -1
- package/dist/hooks/use-booking.d.ts +24 -1
- package/dist/hooks/use-booking.d.ts.map +1 -1
- package/dist/hooks/use-bookings.d.ts +24 -1
- package/dist/hooks/use-bookings.d.ts.map +1 -1
- package/dist/hooks/use-public-booking-session-flow-mutation.d.ts +1 -1
- package/dist/hooks/use-public-booking-session.d.ts +1 -1
- package/dist/hooks/use-reveal-traveler.d.ts +45 -0
- package/dist/hooks/use-reveal-traveler.d.ts.map +1 -0
- package/dist/hooks/use-reveal-traveler.js +18 -0
- package/dist/query-options.d.ts +423 -16
- package/dist/query-options.d.ts.map +1 -1
- package/dist/query-options.js +18 -1
- package/dist/schemas.d.ts +286 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +42 -0
- package/dist/status-presentation.d.ts +1 -1
- package/dist/status-presentation.d.ts.map +1 -1
- package/dist/status-presentation.js +1 -0
- package/package.json +5 -5
|
@@ -5,7 +5,7 @@ export declare function useBooking(id: string | null | undefined, options?: UseB
|
|
|
5
5
|
data: {
|
|
6
6
|
id: string;
|
|
7
7
|
bookingNumber: string;
|
|
8
|
-
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
8
|
+
status: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
9
9
|
personId: string | null;
|
|
10
10
|
organizationId: string | null;
|
|
11
11
|
sellCurrency: string;
|
|
@@ -18,6 +18,29 @@ export declare function useBooking(id: string | null | undefined, options?: UseB
|
|
|
18
18
|
internalNotes: string | null;
|
|
19
19
|
createdAt: string;
|
|
20
20
|
updatedAt: string;
|
|
21
|
+
startsAt?: string | null | undefined;
|
|
22
|
+
endsAt?: string | null | undefined;
|
|
23
|
+
communicationLanguage?: string | null | undefined;
|
|
24
|
+
contactFirstName?: string | null | undefined;
|
|
25
|
+
contactLastName?: string | null | undefined;
|
|
26
|
+
contactEmail?: string | null | undefined;
|
|
27
|
+
contactPhone?: string | null | undefined;
|
|
28
|
+
contactPreferredLanguage?: string | null | undefined;
|
|
29
|
+
contactCountry?: string | null | undefined;
|
|
30
|
+
contactRegion?: string | null | undefined;
|
|
31
|
+
contactCity?: string | null | undefined;
|
|
32
|
+
contactAddressLine1?: string | null | undefined;
|
|
33
|
+
contactPostalCode?: string | null | undefined;
|
|
34
|
+
customerPaymentPolicy?: {
|
|
35
|
+
deposit: {
|
|
36
|
+
kind: "none" | "percent" | "fixed_cents";
|
|
37
|
+
percent?: number | undefined;
|
|
38
|
+
amountCents?: number | undefined;
|
|
39
|
+
};
|
|
40
|
+
minDaysBeforeDepartureForDeposit: number;
|
|
41
|
+
balanceDueDaysBeforeDeparture: number;
|
|
42
|
+
balanceDueMinDaysFromNow: number;
|
|
43
|
+
} | null | undefined;
|
|
21
44
|
};
|
|
22
45
|
}, Error>;
|
|
23
46
|
//# sourceMappingURL=use-booking.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-booking.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,GAAE,iBAAsB
|
|
1
|
+
{"version":3,"file":"use-booking.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,GAAE,iBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAQxF"}
|
|
@@ -6,7 +6,7 @@ export declare function useBookings(options?: UseBookingsOptions): import("@tans
|
|
|
6
6
|
data: {
|
|
7
7
|
id: string;
|
|
8
8
|
bookingNumber: string;
|
|
9
|
-
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
9
|
+
status: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
10
10
|
personId: string | null;
|
|
11
11
|
organizationId: string | null;
|
|
12
12
|
sellCurrency: string;
|
|
@@ -19,6 +19,29 @@ export declare function useBookings(options?: UseBookingsOptions): import("@tans
|
|
|
19
19
|
internalNotes: string | null;
|
|
20
20
|
createdAt: string;
|
|
21
21
|
updatedAt: string;
|
|
22
|
+
startsAt?: string | null | undefined;
|
|
23
|
+
endsAt?: string | null | undefined;
|
|
24
|
+
communicationLanguage?: string | null | undefined;
|
|
25
|
+
contactFirstName?: string | null | undefined;
|
|
26
|
+
contactLastName?: string | null | undefined;
|
|
27
|
+
contactEmail?: string | null | undefined;
|
|
28
|
+
contactPhone?: string | null | undefined;
|
|
29
|
+
contactPreferredLanguage?: string | null | undefined;
|
|
30
|
+
contactCountry?: string | null | undefined;
|
|
31
|
+
contactRegion?: string | null | undefined;
|
|
32
|
+
contactCity?: string | null | undefined;
|
|
33
|
+
contactAddressLine1?: string | null | undefined;
|
|
34
|
+
contactPostalCode?: string | null | undefined;
|
|
35
|
+
customerPaymentPolicy?: {
|
|
36
|
+
deposit: {
|
|
37
|
+
kind: "none" | "percent" | "fixed_cents";
|
|
38
|
+
percent?: number | undefined;
|
|
39
|
+
amountCents?: number | undefined;
|
|
40
|
+
};
|
|
41
|
+
minDaysBeforeDepartureForDeposit: number;
|
|
42
|
+
balanceDueDaysBeforeDeparture: number;
|
|
43
|
+
balanceDueMinDaysFromNow: number;
|
|
44
|
+
} | null | undefined;
|
|
22
45
|
}[];
|
|
23
46
|
total: number;
|
|
24
47
|
limit: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-bookings.d.ts","sourceRoot":"","sources":["../../src/hooks/use-bookings.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAG3D,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB
|
|
1
|
+
{"version":3,"file":"use-bookings.d.ts","sourceRoot":"","sources":["../../src/hooks/use-bookings.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAG3D,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAQ3D"}
|
|
@@ -41,7 +41,7 @@ export declare function usePublicBookingSessionFlowMutation(sessionId: string):
|
|
|
41
41
|
session: {
|
|
42
42
|
sessionId: string;
|
|
43
43
|
bookingNumber: string;
|
|
44
|
-
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
44
|
+
status: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
45
45
|
externalBookingRef: string | null;
|
|
46
46
|
communicationLanguage: string | null;
|
|
47
47
|
sellCurrency: string;
|
|
@@ -5,7 +5,7 @@ export declare function usePublicBookingSession(sessionId: string | null | undef
|
|
|
5
5
|
data: {
|
|
6
6
|
sessionId: string;
|
|
7
7
|
bookingNumber: string;
|
|
8
|
-
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
8
|
+
status: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
9
9
|
externalBookingRef: string | null;
|
|
10
10
|
communicationLanguage: string | null;
|
|
11
11
|
sellCurrency: string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface UseRevealTravelerOptions {
|
|
2
|
+
/**
|
|
3
|
+
* When false, the reveal request is skipped — keeps the eye-button
|
|
4
|
+
* default-off behaviour. Toggle to true when the user clicks reveal.
|
|
5
|
+
*/
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Lazily fetch an unmasked traveler row. Authorization is server-side;
|
|
10
|
+
* the response is the full traveler with email/phone/firstName/lastName
|
|
11
|
+
* in the clear. Every reveal hits the audit log on the backend, so the
|
|
12
|
+
* `staleTime: 0` in the query options is intentional — re-mounting the
|
|
13
|
+
* row should re-log.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useRevealTraveler(bookingId: string | null | undefined, travelerId: string | null | undefined, options: UseRevealTravelerOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
16
|
+
data: {
|
|
17
|
+
id: string;
|
|
18
|
+
bookingId: string;
|
|
19
|
+
participantType: string;
|
|
20
|
+
firstName: string;
|
|
21
|
+
lastName: string;
|
|
22
|
+
email: string | null;
|
|
23
|
+
phone: string | null;
|
|
24
|
+
specialRequests: string | null;
|
|
25
|
+
isPrimary: boolean;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
travelDetails: {
|
|
28
|
+
travelerId: string;
|
|
29
|
+
nationality: string | null;
|
|
30
|
+
passportNumber: string | null;
|
|
31
|
+
passportExpiry: string | null;
|
|
32
|
+
dateOfBirth: string | null;
|
|
33
|
+
dietaryRequirements: string | null;
|
|
34
|
+
accessibilityNeeds: string | null;
|
|
35
|
+
isLeadTraveler: boolean;
|
|
36
|
+
createdAt: string;
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
} | null;
|
|
39
|
+
travelerCategory?: string | null | undefined;
|
|
40
|
+
preferredLanguage?: string | null | undefined;
|
|
41
|
+
notes?: string | null | undefined;
|
|
42
|
+
updatedAt?: string | undefined;
|
|
43
|
+
};
|
|
44
|
+
}, Error>;
|
|
45
|
+
//# sourceMappingURL=use-reveal-traveler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-reveal-traveler.d.ts","sourceRoot":"","sources":["../../src/hooks/use-reveal-traveler.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACrC,OAAO,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAOlC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getTravelerRevealQueryOptions } from "../query-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Lazily fetch an unmasked traveler row. Authorization is server-side;
|
|
7
|
+
* the response is the full traveler with email/phone/firstName/lastName
|
|
8
|
+
* in the clear. Every reveal hits the audit log on the backend, so the
|
|
9
|
+
* `staleTime: 0` in the query options is intentional — re-mounting the
|
|
10
|
+
* row should re-log.
|
|
11
|
+
*/
|
|
12
|
+
export function useRevealTraveler(bookingId, travelerId, options) {
|
|
13
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
14
|
+
return useQuery({
|
|
15
|
+
...getTravelerRevealQueryOptions({ baseUrl, fetcher }, bookingId, travelerId),
|
|
16
|
+
enabled: options.enabled && Boolean(bookingId) && Boolean(travelerId),
|
|
17
|
+
});
|
|
18
|
+
}
|