@voyantjs/bookings-react 0.2.0 → 0.3.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/LICENSE +109 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +5 -0
- package/dist/hooks/use-booking-activity.d.ts +15 -0
- package/dist/hooks/use-booking-activity.d.ts.map +1 -0
- package/dist/hooks/use-booking-activity.js +12 -0
- package/dist/hooks/use-booking-note-mutation.d.ts +11 -0
- package/dist/hooks/use-booking-note-mutation.d.ts.map +1 -0
- package/dist/hooks/use-booking-note-mutation.js +24 -0
- package/dist/hooks/use-booking-notes.d.ts +13 -0
- package/dist/hooks/use-booking-notes.d.ts.map +1 -0
- package/dist/hooks/use-booking-notes.js +12 -0
- package/dist/hooks/use-booking.d.ts.map +1 -1
- package/dist/hooks/use-booking.js +2 -5
- package/dist/hooks/use-bookings.d.ts +1 -1
- package/dist/hooks/use-bookings.d.ts.map +1 -1
- package/dist/hooks/use-bookings.js +2 -20
- package/dist/hooks/use-passengers.d.ts.map +1 -1
- package/dist/hooks/use-passengers.js +2 -8
- package/dist/hooks/use-supplier-status-mutation.d.ts +46 -0
- package/dist/hooks/use-supplier-status-mutation.d.ts.map +1 -0
- package/dist/hooks/use-supplier-status-mutation.js +39 -0
- package/dist/hooks/use-supplier-statuses.d.ts +20 -0
- package/dist/hooks/use-supplier-statuses.d.ts.map +1 -0
- package/dist/hooks/use-supplier-statuses.js +12 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/provider.d.ts +1 -13
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +1 -16
- package/dist/query-options.d.ts +396 -0
- package/dist/query-options.d.ts.map +1 -0
- package/dist/query-options.js +59 -0
- package/dist/schemas.d.ts +3 -3
- package/package.json +42 -46
package/LICENSE
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, Apache 2.0 Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 PixelMakers Studio SRL
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly
|
|
28
|
+
display and redistribute the Software for any Permitted Purpose identified
|
|
29
|
+
below.
|
|
30
|
+
|
|
31
|
+
### Permitted Purpose
|
|
32
|
+
|
|
33
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing
|
|
34
|
+
Use means making the Software available to others in a commercial product or
|
|
35
|
+
service that:
|
|
36
|
+
|
|
37
|
+
1. substitutes for the Software;
|
|
38
|
+
|
|
39
|
+
2. substitutes for any other product or service we offer using the Software
|
|
40
|
+
that exists as of the date we make the Software available; or
|
|
41
|
+
|
|
42
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
43
|
+
|
|
44
|
+
Permitted Purposes specifically include using the Software:
|
|
45
|
+
|
|
46
|
+
1. for your internal use and access;
|
|
47
|
+
|
|
48
|
+
2. for non-commercial education;
|
|
49
|
+
|
|
50
|
+
3. for non-commercial research; and
|
|
51
|
+
|
|
52
|
+
4. in connection with professional services that you provide to a licensee
|
|
53
|
+
using the Software in accordance with these Terms and Conditions.
|
|
54
|
+
|
|
55
|
+
### Patents
|
|
56
|
+
|
|
57
|
+
To the extent your use for a Permitted Purpose would necessarily infringe
|
|
58
|
+
our patents, the license grant above includes a license under our patents.
|
|
59
|
+
If you make a claim against any party that the Software infringes or
|
|
60
|
+
contributes to the infringement of any patent, then your patent license to
|
|
61
|
+
the Software ends immediately.
|
|
62
|
+
|
|
63
|
+
### Redistribution
|
|
64
|
+
|
|
65
|
+
The Terms and Conditions apply to all copies, modifications and derivatives
|
|
66
|
+
of the Software.
|
|
67
|
+
|
|
68
|
+
If you redistribute any copies, modifications or derivatives of the
|
|
69
|
+
Software, you must include a copy of or a link to these Terms and Conditions
|
|
70
|
+
and not remove any copyright notices provided in or with the Software.
|
|
71
|
+
|
|
72
|
+
### Disclaimer
|
|
73
|
+
|
|
74
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS
|
|
75
|
+
OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A
|
|
76
|
+
PARTICULAR PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
77
|
+
|
|
78
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO
|
|
79
|
+
THE SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
|
|
80
|
+
DAMAGES, EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
81
|
+
|
|
82
|
+
### Trademarks
|
|
83
|
+
|
|
84
|
+
Except for displaying the License Details and identifying us as the origin
|
|
85
|
+
of the Software, you have no right under these Terms and Conditions to use
|
|
86
|
+
our trademarks, trade names, service marks or product names.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Grant of Future License
|
|
91
|
+
|
|
92
|
+
We hereby irrevocably grant you an additional license to use the Software
|
|
93
|
+
under the Apache License, Version 2.0 that is effective on the second
|
|
94
|
+
anniversary of the date we make the Software available. On or after that
|
|
95
|
+
date, you may use the Software under the Apache License, Version 2.0, in
|
|
96
|
+
which case the following will apply:
|
|
97
|
+
|
|
98
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
99
|
+
use this file except in compliance with the License.
|
|
100
|
+
|
|
101
|
+
You may obtain a copy of the License at
|
|
102
|
+
|
|
103
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
104
|
+
|
|
105
|
+
Unless required by applicable law or agreed to in writing, software
|
|
106
|
+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
107
|
+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
108
|
+
License for the specific language governing permissions and limitations
|
|
109
|
+
under the License.
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export { type UseBookingOptions, useBooking } from "./use-booking.js";
|
|
2
|
+
export { type UseBookingActivityOptions, useBookingActivity } from "./use-booking-activity.js";
|
|
2
3
|
export { type CreateBookingInput, type UpdateBookingInput, useBookingMutation, } from "./use-booking-mutation.js";
|
|
4
|
+
export { type CreateBookingNoteInput, useBookingNoteMutation, } from "./use-booking-note-mutation.js";
|
|
5
|
+
export { type UseBookingNotesOptions, useBookingNotes } from "./use-booking-notes.js";
|
|
3
6
|
export { type UpdateBookingStatusInput, useBookingStatusMutation, } from "./use-booking-status-mutation.js";
|
|
4
7
|
export { type UseBookingsOptions, useBookings } from "./use-bookings.js";
|
|
5
8
|
export { type CreatePassengerInput, type UpdatePassengerInput, usePassengerMutation, } from "./use-passenger-mutation.js";
|
|
6
9
|
export { type UsePassengersOptions, usePassengers } from "./use-passengers.js";
|
|
10
|
+
export { type CreateSupplierStatusInput, type UpdateSupplierStatusInput, useSupplierStatusMutation, } from "./use-supplier-status-mutation.js";
|
|
11
|
+
export { type UseSupplierStatusesOptions, useSupplierStatuses } from "./use-supplier-statuses.js";
|
|
7
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,kBAAkB,GACnB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,KAAK,wBAAwB,EAC7B,wBAAwB,GACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,oBAAoB,GACrB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,KAAK,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,EAAE,KAAK,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9F,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,kBAAkB,GACnB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,KAAK,sBAAsB,EAC3B,sBAAsB,GACvB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,KAAK,sBAAsB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACrF,OAAO,EACL,KAAK,wBAAwB,EAC7B,wBAAwB,GACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,oBAAoB,GACrB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,KAAK,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC9E,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,yBAAyB,GAC1B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,KAAK,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export { useBooking } from "./use-booking.js";
|
|
2
|
+
export { useBookingActivity } from "./use-booking-activity.js";
|
|
2
3
|
export { useBookingMutation, } from "./use-booking-mutation.js";
|
|
4
|
+
export { useBookingNoteMutation, } from "./use-booking-note-mutation.js";
|
|
5
|
+
export { useBookingNotes } from "./use-booking-notes.js";
|
|
3
6
|
export { useBookingStatusMutation, } from "./use-booking-status-mutation.js";
|
|
4
7
|
export { useBookings } from "./use-bookings.js";
|
|
5
8
|
export { usePassengerMutation, } from "./use-passenger-mutation.js";
|
|
6
9
|
export { usePassengers } from "./use-passengers.js";
|
|
10
|
+
export { useSupplierStatusMutation, } from "./use-supplier-status-mutation.js";
|
|
11
|
+
export { useSupplierStatuses } from "./use-supplier-statuses.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface UseBookingActivityOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useBookingActivity(bookingId: string | null | undefined, options?: UseBookingActivityOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
bookingId: string;
|
|
8
|
+
actorId: string | null;
|
|
9
|
+
activityType: string;
|
|
10
|
+
description: string;
|
|
11
|
+
metadata: Record<string, unknown> | null;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
}[];
|
|
14
|
+
}, Error>;
|
|
15
|
+
//# sourceMappingURL=use-booking-activity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-booking-activity.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-activity.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,yBAA8B;;;;;;;;;;UASxC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getBookingActivityQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useBookingActivity(bookingId, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getBookingActivityQueryOptions({ baseUrl, fetcher }, bookingId),
|
|
10
|
+
enabled: enabled && Boolean(bookingId),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface CreateBookingNoteInput {
|
|
2
|
+
content: string;
|
|
3
|
+
}
|
|
4
|
+
export declare function useBookingNoteMutation(bookingId: string): import("@tanstack/react-query").UseMutationResult<{
|
|
5
|
+
id: string;
|
|
6
|
+
bookingId: string;
|
|
7
|
+
authorId: string;
|
|
8
|
+
content: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
}, Error, CreateBookingNoteInput, unknown>;
|
|
11
|
+
//# sourceMappingURL=use-booking-note-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-booking-note-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-note-mutation.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAA;CAChB;AAMD,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM;;;;;;2CAmBvD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { fetchWithValidation } from "../client.js";
|
|
5
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
6
|
+
import { bookingsQueryKeys } from "../query-keys.js";
|
|
7
|
+
import { bookingNoteRecordSchema } from "../schemas.js";
|
|
8
|
+
const bookingNoteSingleResponse = z.object({
|
|
9
|
+
data: bookingNoteRecordSchema,
|
|
10
|
+
});
|
|
11
|
+
export function useBookingNoteMutation(bookingId) {
|
|
12
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
13
|
+
const queryClient = useQueryClient();
|
|
14
|
+
return useMutation({
|
|
15
|
+
mutationFn: async (input) => {
|
|
16
|
+
const { data } = await fetchWithValidation(`/v1/bookings/${bookingId}/notes`, bookingNoteSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
17
|
+
return data;
|
|
18
|
+
},
|
|
19
|
+
onSuccess: () => {
|
|
20
|
+
void queryClient.invalidateQueries({ queryKey: bookingsQueryKeys.notes(bookingId) });
|
|
21
|
+
void queryClient.invalidateQueries({ queryKey: bookingsQueryKeys.activity(bookingId) });
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface UseBookingNotesOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useBookingNotes(bookingId: string | null | undefined, options?: UseBookingNotesOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
bookingId: string;
|
|
8
|
+
authorId: string;
|
|
9
|
+
content: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
}[];
|
|
12
|
+
}, Error>;
|
|
13
|
+
//# sourceMappingURL=use-booking-notes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-booking-notes.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking-notes.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,sBAA2B;;;;;;;;UASrC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getBookingNotesQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useBookingNotes(bookingId, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getBookingNotesQueryOptions({ baseUrl, fetcher }, bookingId),
|
|
10
|
+
enabled: enabled && Boolean(bookingId),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-booking.d.ts","sourceRoot":"","sources":["../../src/hooks/use-booking.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useQuery } from "@tanstack/react-query";
|
|
3
|
-
import { fetchWithValidation } from "../client.js";
|
|
4
3
|
import { useVoyantBookingsContext } from "../provider.js";
|
|
5
|
-
import {
|
|
6
|
-
import { bookingSingleResponse } from "../schemas.js";
|
|
4
|
+
import { getBookingQueryOptions } from "../query-options.js";
|
|
7
5
|
export function useBooking(id, options = {}) {
|
|
8
6
|
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
9
7
|
const { enabled = true } = options;
|
|
10
8
|
return useQuery({
|
|
11
|
-
|
|
12
|
-
queryFn: () => fetchWithValidation(`/v1/bookings/${id}`, bookingSingleResponse, { baseUrl, fetcher }),
|
|
9
|
+
...getBookingQueryOptions({ baseUrl, fetcher }, id),
|
|
13
10
|
enabled: enabled && Boolean(id),
|
|
14
11
|
});
|
|
15
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-bookings.d.ts","sourceRoot":"","sources":["../../src/hooks/use-bookings.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -1,30 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useQuery } from "@tanstack/react-query";
|
|
3
|
-
import { fetchWithValidation } from "../client.js";
|
|
4
3
|
import { useVoyantBookingsContext } from "../provider.js";
|
|
5
|
-
import {
|
|
6
|
-
import { bookingListResponse } from "../schemas.js";
|
|
4
|
+
import { getBookingsQueryOptions } from "../query-options.js";
|
|
7
5
|
export function useBookings(options = {}) {
|
|
8
6
|
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
9
7
|
const { enabled = true, ...filters } = options;
|
|
10
8
|
return useQuery({
|
|
11
|
-
|
|
12
|
-
queryFn: () => {
|
|
13
|
-
const params = new URLSearchParams();
|
|
14
|
-
if (filters.status)
|
|
15
|
-
params.set("status", filters.status);
|
|
16
|
-
if (filters.search)
|
|
17
|
-
params.set("search", filters.search);
|
|
18
|
-
if (filters.limit !== undefined)
|
|
19
|
-
params.set("limit", String(filters.limit));
|
|
20
|
-
if (filters.offset !== undefined)
|
|
21
|
-
params.set("offset", String(filters.offset));
|
|
22
|
-
const qs = params.toString();
|
|
23
|
-
return fetchWithValidation(`/v1/bookings${qs ? `?${qs}` : ""}`, bookingListResponse, {
|
|
24
|
-
baseUrl,
|
|
25
|
-
fetcher,
|
|
26
|
-
});
|
|
27
|
-
},
|
|
9
|
+
...getBookingsQueryOptions({ baseUrl, fetcher }, filters),
|
|
28
10
|
enabled,
|
|
29
11
|
});
|
|
30
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-passengers.d.ts","sourceRoot":"","sources":["../../src/hooks/use-passengers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-passengers.d.ts","sourceRoot":"","sources":["../../src/hooks/use-passengers.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,oBAAyB;;;;;;;;;;;;;UASnC"}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useQuery } from "@tanstack/react-query";
|
|
3
|
-
import { fetchWithValidation } from "../client.js";
|
|
4
3
|
import { useVoyantBookingsContext } from "../provider.js";
|
|
5
|
-
import {
|
|
6
|
-
import { bookingPassengersResponse } from "../schemas.js";
|
|
4
|
+
import { getPassengersQueryOptions } from "../query-options.js";
|
|
7
5
|
export function usePassengers(bookingId, options = {}) {
|
|
8
6
|
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
9
7
|
const { enabled = true } = options;
|
|
10
8
|
return useQuery({
|
|
11
|
-
|
|
12
|
-
queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/passengers`, bookingPassengersResponse, {
|
|
13
|
-
baseUrl,
|
|
14
|
-
fetcher,
|
|
15
|
-
}),
|
|
9
|
+
...getPassengersQueryOptions({ baseUrl, fetcher }, bookingId),
|
|
16
10
|
enabled: enabled && Boolean(bookingId),
|
|
17
11
|
});
|
|
18
12
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface CreateSupplierStatusInput {
|
|
2
|
+
supplierServiceId?: string | null;
|
|
3
|
+
serviceName: string;
|
|
4
|
+
status?: "pending" | "confirmed" | "rejected" | "cancelled";
|
|
5
|
+
supplierReference?: string | null;
|
|
6
|
+
costCurrency: string;
|
|
7
|
+
costAmountCents: number;
|
|
8
|
+
notes?: string | null;
|
|
9
|
+
}
|
|
10
|
+
export type UpdateSupplierStatusInput = Partial<CreateSupplierStatusInput> & {
|
|
11
|
+
confirmedAt?: string | null;
|
|
12
|
+
};
|
|
13
|
+
export declare function useSupplierStatusMutation(bookingId: string): {
|
|
14
|
+
create: import("@tanstack/react-query").UseMutationResult<{
|
|
15
|
+
id: string;
|
|
16
|
+
bookingId: string;
|
|
17
|
+
supplierServiceId: string | null;
|
|
18
|
+
serviceName: string;
|
|
19
|
+
status: "pending" | "confirmed" | "cancelled" | "rejected";
|
|
20
|
+
supplierReference: string | null;
|
|
21
|
+
costCurrency: string;
|
|
22
|
+
costAmountCents: number;
|
|
23
|
+
notes: string | null;
|
|
24
|
+
confirmedAt: string | null;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}, Error, CreateSupplierStatusInput, unknown>;
|
|
28
|
+
update: import("@tanstack/react-query").UseMutationResult<{
|
|
29
|
+
id: string;
|
|
30
|
+
bookingId: string;
|
|
31
|
+
supplierServiceId: string | null;
|
|
32
|
+
serviceName: string;
|
|
33
|
+
status: "pending" | "confirmed" | "cancelled" | "rejected";
|
|
34
|
+
supplierReference: string | null;
|
|
35
|
+
costCurrency: string;
|
|
36
|
+
costAmountCents: number;
|
|
37
|
+
notes: string | null;
|
|
38
|
+
confirmedAt: string | null;
|
|
39
|
+
createdAt: string;
|
|
40
|
+
updatedAt: string;
|
|
41
|
+
}, Error, {
|
|
42
|
+
id: string;
|
|
43
|
+
input: UpdateSupplierStatusInput;
|
|
44
|
+
}, unknown>;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=use-supplier-status-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-supplier-status-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-supplier-status-mutation.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,yBAAyB;IACxC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CAAA;IAC3D,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC,GAAG;IAC3E,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B,CAAA;AAMD,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAuBf,MAAM;eAAS,yBAAyB;;EAkBnF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { fetchWithValidation } from "../client.js";
|
|
5
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
6
|
+
import { bookingsQueryKeys } from "../query-keys.js";
|
|
7
|
+
import { bookingSupplierStatusRecordSchema } from "../schemas.js";
|
|
8
|
+
const bookingSupplierStatusSingleResponse = z.object({
|
|
9
|
+
data: bookingSupplierStatusRecordSchema,
|
|
10
|
+
});
|
|
11
|
+
export function useSupplierStatusMutation(bookingId) {
|
|
12
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
13
|
+
const queryClient = useQueryClient();
|
|
14
|
+
const create = useMutation({
|
|
15
|
+
mutationFn: async (input) => {
|
|
16
|
+
const { data } = await fetchWithValidation(`/v1/bookings/${bookingId}/supplier-statuses`, bookingSupplierStatusSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
17
|
+
return data;
|
|
18
|
+
},
|
|
19
|
+
onSuccess: () => {
|
|
20
|
+
void queryClient.invalidateQueries({
|
|
21
|
+
queryKey: bookingsQueryKeys.supplierStatuses(bookingId),
|
|
22
|
+
});
|
|
23
|
+
void queryClient.invalidateQueries({ queryKey: bookingsQueryKeys.activity(bookingId) });
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const update = useMutation({
|
|
27
|
+
mutationFn: async ({ id, input }) => {
|
|
28
|
+
const { data } = await fetchWithValidation(`/v1/bookings/${bookingId}/supplier-statuses/${id}`, bookingSupplierStatusSingleResponse, { baseUrl, fetcher }, { method: "PATCH", body: JSON.stringify(input) });
|
|
29
|
+
return data;
|
|
30
|
+
},
|
|
31
|
+
onSuccess: () => {
|
|
32
|
+
void queryClient.invalidateQueries({
|
|
33
|
+
queryKey: bookingsQueryKeys.supplierStatuses(bookingId),
|
|
34
|
+
});
|
|
35
|
+
void queryClient.invalidateQueries({ queryKey: bookingsQueryKeys.activity(bookingId) });
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
return { create, update };
|
|
39
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface UseSupplierStatusesOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useSupplierStatuses(bookingId: string | null | undefined, options?: UseSupplierStatusesOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
bookingId: string;
|
|
8
|
+
supplierServiceId: string | null;
|
|
9
|
+
serviceName: string;
|
|
10
|
+
status: "pending" | "confirmed" | "cancelled" | "rejected";
|
|
11
|
+
supplierReference: string | null;
|
|
12
|
+
costCurrency: string;
|
|
13
|
+
costAmountCents: number;
|
|
14
|
+
notes: string | null;
|
|
15
|
+
confirmedAt: string | null;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
}[];
|
|
19
|
+
}, Error>;
|
|
20
|
+
//# sourceMappingURL=use-supplier-statuses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-supplier-statuses.d.ts","sourceRoot":"","sources":["../../src/hooks/use-supplier-statuses.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,0BAA+B;;;;;;;;;;;;;;;UASzC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantBookingsContext } from "../provider.js";
|
|
4
|
+
import { getSupplierStatusesQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useSupplierStatuses(bookingId, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantBookingsContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getSupplierStatusesQueryOptions({ baseUrl, fetcher }, bookingId),
|
|
10
|
+
enabled: enabled && Boolean(bookingId),
|
|
11
|
+
});
|
|
12
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export { defaultFetcher, fetchWithValidation, VoyantApiError, type VoyantFetcher
|
|
|
2
2
|
export * from "./hooks/index.js";
|
|
3
3
|
export { useVoyantBookingsContext, type VoyantBookingsContextValue, VoyantBookingsProvider, type VoyantBookingsProviderProps, } from "./provider.js";
|
|
4
4
|
export { bookingsQueryKeys } from "./query-keys.js";
|
|
5
|
+
export { getBookingActivityQueryOptions, getBookingNotesQueryOptions, getBookingQueryOptions, getBookingsQueryOptions, getPassengersQueryOptions, getSupplierStatusesQueryOptions, } from "./query-options.js";
|
|
5
6
|
export * from "./schemas.js";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AACpB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,wBAAwB,EACxB,KAAK,0BAA0B,EAC/B,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AACpB,cAAc,kBAAkB,CAAA;AAChC,OAAO,EACL,wBAAwB,EACxB,KAAK,0BAA0B,EAC/B,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,+BAA+B,GAChC,MAAM,oBAAoB,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -2,4 +2,5 @@ export { defaultFetcher, fetchWithValidation, VoyantApiError, } from "./client.j
|
|
|
2
2
|
export * from "./hooks/index.js";
|
|
3
3
|
export { useVoyantBookingsContext, VoyantBookingsProvider, } from "./provider.js";
|
|
4
4
|
export { bookingsQueryKeys } from "./query-keys.js";
|
|
5
|
+
export { getBookingActivityQueryOptions, getBookingNotesQueryOptions, getBookingQueryOptions, getBookingsQueryOptions, getPassengersQueryOptions, getSupplierStatusesQueryOptions, } from "./query-options.js";
|
|
5
6
|
export * from "./schemas.js";
|
package/dist/provider.d.ts
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { type VoyantFetcher } from "./client.js";
|
|
3
|
-
export interface VoyantBookingsContextValue {
|
|
4
|
-
baseUrl: string;
|
|
5
|
-
fetcher: VoyantFetcher;
|
|
6
|
-
}
|
|
7
|
-
export interface VoyantBookingsProviderProps {
|
|
8
|
-
baseUrl: string;
|
|
9
|
-
fetcher?: VoyantFetcher;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
}
|
|
12
|
-
export declare function VoyantBookingsProvider({ baseUrl, fetcher, children, }: VoyantBookingsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare function useVoyantBookingsContext(): VoyantBookingsContextValue;
|
|
1
|
+
export { useVoyantReactContext as useVoyantBookingsContext, type VoyantReactContextValue as VoyantBookingsContextValue, VoyantReactProvider as VoyantBookingsProvider, type VoyantReactProviderProps as VoyantBookingsProviderProps, } from "@voyantjs/react";
|
|
14
2
|
//# sourceMappingURL=provider.d.ts.map
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,IAAI,wBAAwB,EACjD,KAAK,uBAAuB,IAAI,0BAA0B,EAC1D,mBAAmB,IAAI,sBAAsB,EAC7C,KAAK,wBAAwB,IAAI,2BAA2B,GAC7D,MAAM,iBAAiB,CAAA"}
|
package/dist/provider.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useContext, useMemo } from "react";
|
|
4
|
-
import { defaultFetcher } from "./client.js";
|
|
5
|
-
const VoyantBookingsContext = createContext(null);
|
|
6
|
-
export function VoyantBookingsProvider({ baseUrl, fetcher, children, }) {
|
|
7
|
-
const value = useMemo(() => ({ baseUrl, fetcher: fetcher ?? defaultFetcher }), [baseUrl, fetcher]);
|
|
8
|
-
return _jsx(VoyantBookingsContext.Provider, { value: value, children: children });
|
|
9
|
-
}
|
|
10
|
-
export function useVoyantBookingsContext() {
|
|
11
|
-
const context = useContext(VoyantBookingsContext);
|
|
12
|
-
if (!context) {
|
|
13
|
-
throw new Error('useVoyantBookingsContext must be used inside <VoyantBookingsProvider>. Wrap your app with <VoyantBookingsProvider baseUrl="/api" />.');
|
|
14
|
-
}
|
|
15
|
-
return context;
|
|
16
|
-
}
|
|
1
|
+
export { useVoyantReactContext as useVoyantBookingsContext, VoyantReactProvider as VoyantBookingsProvider, } from "@voyantjs/react";
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { type FetchWithValidationOptions } from "./client.js";
|
|
2
|
+
import type { UseBookingOptions } from "./hooks/use-booking.js";
|
|
3
|
+
import type { UseBookingActivityOptions } from "./hooks/use-booking-activity.js";
|
|
4
|
+
import type { UseBookingNotesOptions } from "./hooks/use-booking-notes.js";
|
|
5
|
+
import type { UseBookingsOptions } from "./hooks/use-bookings.js";
|
|
6
|
+
import type { UsePassengersOptions } from "./hooks/use-passengers.js";
|
|
7
|
+
import type { UseSupplierStatusesOptions } from "./hooks/use-supplier-statuses.js";
|
|
8
|
+
export declare function getBookingsQueryOptions(client: FetchWithValidationOptions, options?: UseBookingsOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
9
|
+
data: {
|
|
10
|
+
id: string;
|
|
11
|
+
bookingNumber: string;
|
|
12
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
13
|
+
personId: string | null;
|
|
14
|
+
organizationId: string | null;
|
|
15
|
+
sellCurrency: string;
|
|
16
|
+
sellAmountCents: number | null;
|
|
17
|
+
costAmountCents: number | null;
|
|
18
|
+
marginPercent: number | null;
|
|
19
|
+
startDate: string | null;
|
|
20
|
+
endDate: string | null;
|
|
21
|
+
pax: number | null;
|
|
22
|
+
internalNotes: string | null;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
}[];
|
|
26
|
+
total: number;
|
|
27
|
+
limit: number;
|
|
28
|
+
offset: number;
|
|
29
|
+
}, Error, {
|
|
30
|
+
data: {
|
|
31
|
+
id: string;
|
|
32
|
+
bookingNumber: string;
|
|
33
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
34
|
+
personId: string | null;
|
|
35
|
+
organizationId: string | null;
|
|
36
|
+
sellCurrency: string;
|
|
37
|
+
sellAmountCents: number | null;
|
|
38
|
+
costAmountCents: number | null;
|
|
39
|
+
marginPercent: number | null;
|
|
40
|
+
startDate: string | null;
|
|
41
|
+
endDate: string | null;
|
|
42
|
+
pax: number | null;
|
|
43
|
+
internalNotes: string | null;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
updatedAt: string;
|
|
46
|
+
}[];
|
|
47
|
+
total: number;
|
|
48
|
+
limit: number;
|
|
49
|
+
offset: number;
|
|
50
|
+
}, readonly ["voyant", "bookings", "bookings", "list", import("./query-keys.js").BookingsListFilters]>, "queryFn"> & {
|
|
51
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
52
|
+
data: {
|
|
53
|
+
id: string;
|
|
54
|
+
bookingNumber: string;
|
|
55
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
56
|
+
personId: string | null;
|
|
57
|
+
organizationId: string | null;
|
|
58
|
+
sellCurrency: string;
|
|
59
|
+
sellAmountCents: number | null;
|
|
60
|
+
costAmountCents: number | null;
|
|
61
|
+
marginPercent: number | null;
|
|
62
|
+
startDate: string | null;
|
|
63
|
+
endDate: string | null;
|
|
64
|
+
pax: number | null;
|
|
65
|
+
internalNotes: string | null;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
updatedAt: string;
|
|
68
|
+
}[];
|
|
69
|
+
total: number;
|
|
70
|
+
limit: number;
|
|
71
|
+
offset: number;
|
|
72
|
+
}, readonly ["voyant", "bookings", "bookings", "list", import("./query-keys.js").BookingsListFilters], never> | undefined;
|
|
73
|
+
} & {
|
|
74
|
+
queryKey: readonly ["voyant", "bookings", "bookings", "list", import("./query-keys.js").BookingsListFilters] & {
|
|
75
|
+
[dataTagSymbol]: {
|
|
76
|
+
data: {
|
|
77
|
+
id: string;
|
|
78
|
+
bookingNumber: string;
|
|
79
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
80
|
+
personId: string | null;
|
|
81
|
+
organizationId: string | null;
|
|
82
|
+
sellCurrency: string;
|
|
83
|
+
sellAmountCents: number | null;
|
|
84
|
+
costAmountCents: number | null;
|
|
85
|
+
marginPercent: number | null;
|
|
86
|
+
startDate: string | null;
|
|
87
|
+
endDate: string | null;
|
|
88
|
+
pax: number | null;
|
|
89
|
+
internalNotes: string | null;
|
|
90
|
+
createdAt: string;
|
|
91
|
+
updatedAt: string;
|
|
92
|
+
}[];
|
|
93
|
+
total: number;
|
|
94
|
+
limit: number;
|
|
95
|
+
offset: number;
|
|
96
|
+
};
|
|
97
|
+
[dataTagErrorSymbol]: Error;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
export declare function getBookingQueryOptions(client: FetchWithValidationOptions, id: string | null | undefined, options?: UseBookingOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
101
|
+
data: {
|
|
102
|
+
id: string;
|
|
103
|
+
bookingNumber: string;
|
|
104
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
105
|
+
personId: string | null;
|
|
106
|
+
organizationId: string | null;
|
|
107
|
+
sellCurrency: string;
|
|
108
|
+
sellAmountCents: number | null;
|
|
109
|
+
costAmountCents: number | null;
|
|
110
|
+
marginPercent: number | null;
|
|
111
|
+
startDate: string | null;
|
|
112
|
+
endDate: string | null;
|
|
113
|
+
pax: number | null;
|
|
114
|
+
internalNotes: string | null;
|
|
115
|
+
createdAt: string;
|
|
116
|
+
updatedAt: string;
|
|
117
|
+
};
|
|
118
|
+
}, Error, {
|
|
119
|
+
data: {
|
|
120
|
+
id: string;
|
|
121
|
+
bookingNumber: string;
|
|
122
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
123
|
+
personId: string | null;
|
|
124
|
+
organizationId: string | null;
|
|
125
|
+
sellCurrency: string;
|
|
126
|
+
sellAmountCents: number | null;
|
|
127
|
+
costAmountCents: number | null;
|
|
128
|
+
marginPercent: number | null;
|
|
129
|
+
startDate: string | null;
|
|
130
|
+
endDate: string | null;
|
|
131
|
+
pax: number | null;
|
|
132
|
+
internalNotes: string | null;
|
|
133
|
+
createdAt: string;
|
|
134
|
+
updatedAt: string;
|
|
135
|
+
};
|
|
136
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string]>, "queryFn"> & {
|
|
137
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
138
|
+
data: {
|
|
139
|
+
id: string;
|
|
140
|
+
bookingNumber: string;
|
|
141
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
142
|
+
personId: string | null;
|
|
143
|
+
organizationId: string | null;
|
|
144
|
+
sellCurrency: string;
|
|
145
|
+
sellAmountCents: number | null;
|
|
146
|
+
costAmountCents: number | null;
|
|
147
|
+
marginPercent: number | null;
|
|
148
|
+
startDate: string | null;
|
|
149
|
+
endDate: string | null;
|
|
150
|
+
pax: number | null;
|
|
151
|
+
internalNotes: string | null;
|
|
152
|
+
createdAt: string;
|
|
153
|
+
updatedAt: string;
|
|
154
|
+
};
|
|
155
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string], never> | undefined;
|
|
156
|
+
} & {
|
|
157
|
+
queryKey: readonly ["voyant", "bookings", "bookings", "detail", string] & {
|
|
158
|
+
[dataTagSymbol]: {
|
|
159
|
+
data: {
|
|
160
|
+
id: string;
|
|
161
|
+
bookingNumber: string;
|
|
162
|
+
status: "draft" | "on_hold" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
|
|
163
|
+
personId: string | null;
|
|
164
|
+
organizationId: string | null;
|
|
165
|
+
sellCurrency: string;
|
|
166
|
+
sellAmountCents: number | null;
|
|
167
|
+
costAmountCents: number | null;
|
|
168
|
+
marginPercent: number | null;
|
|
169
|
+
startDate: string | null;
|
|
170
|
+
endDate: string | null;
|
|
171
|
+
pax: number | null;
|
|
172
|
+
internalNotes: string | null;
|
|
173
|
+
createdAt: string;
|
|
174
|
+
updatedAt: string;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
[dataTagErrorSymbol]: Error;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
export declare function getPassengersQueryOptions(client: FetchWithValidationOptions, bookingId: string | null | undefined, options?: UsePassengersOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
181
|
+
data: {
|
|
182
|
+
id: string;
|
|
183
|
+
bookingId: string;
|
|
184
|
+
firstName: string;
|
|
185
|
+
lastName: string;
|
|
186
|
+
email: string | null;
|
|
187
|
+
phone: string | null;
|
|
188
|
+
specialRequests: string | null;
|
|
189
|
+
createdAt: string;
|
|
190
|
+
isLeadPassenger?: boolean | null | undefined;
|
|
191
|
+
updatedAt?: string | undefined;
|
|
192
|
+
}[];
|
|
193
|
+
}, Error, {
|
|
194
|
+
data: {
|
|
195
|
+
id: string;
|
|
196
|
+
bookingId: string;
|
|
197
|
+
firstName: string;
|
|
198
|
+
lastName: string;
|
|
199
|
+
email: string | null;
|
|
200
|
+
phone: string | null;
|
|
201
|
+
specialRequests: string | null;
|
|
202
|
+
createdAt: string;
|
|
203
|
+
isLeadPassenger?: boolean | null | undefined;
|
|
204
|
+
updatedAt?: string | undefined;
|
|
205
|
+
}[];
|
|
206
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "passengers"]>, "queryFn"> & {
|
|
207
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
208
|
+
data: {
|
|
209
|
+
id: string;
|
|
210
|
+
bookingId: string;
|
|
211
|
+
firstName: string;
|
|
212
|
+
lastName: string;
|
|
213
|
+
email: string | null;
|
|
214
|
+
phone: string | null;
|
|
215
|
+
specialRequests: string | null;
|
|
216
|
+
createdAt: string;
|
|
217
|
+
isLeadPassenger?: boolean | null | undefined;
|
|
218
|
+
updatedAt?: string | undefined;
|
|
219
|
+
}[];
|
|
220
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "passengers"], never> | undefined;
|
|
221
|
+
} & {
|
|
222
|
+
queryKey: readonly ["voyant", "bookings", "bookings", "detail", string, "passengers"] & {
|
|
223
|
+
[dataTagSymbol]: {
|
|
224
|
+
data: {
|
|
225
|
+
id: string;
|
|
226
|
+
bookingId: string;
|
|
227
|
+
firstName: string;
|
|
228
|
+
lastName: string;
|
|
229
|
+
email: string | null;
|
|
230
|
+
phone: string | null;
|
|
231
|
+
specialRequests: string | null;
|
|
232
|
+
createdAt: string;
|
|
233
|
+
isLeadPassenger?: boolean | null | undefined;
|
|
234
|
+
updatedAt?: string | undefined;
|
|
235
|
+
}[];
|
|
236
|
+
};
|
|
237
|
+
[dataTagErrorSymbol]: Error;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
export declare function getSupplierStatusesQueryOptions(client: FetchWithValidationOptions, bookingId: string | null | undefined, options?: UseSupplierStatusesOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
241
|
+
data: {
|
|
242
|
+
id: string;
|
|
243
|
+
bookingId: string;
|
|
244
|
+
supplierServiceId: string | null;
|
|
245
|
+
serviceName: string;
|
|
246
|
+
status: "pending" | "confirmed" | "cancelled" | "rejected";
|
|
247
|
+
supplierReference: string | null;
|
|
248
|
+
costCurrency: string;
|
|
249
|
+
costAmountCents: number;
|
|
250
|
+
notes: string | null;
|
|
251
|
+
confirmedAt: string | null;
|
|
252
|
+
createdAt: string;
|
|
253
|
+
updatedAt: string;
|
|
254
|
+
}[];
|
|
255
|
+
}, Error, {
|
|
256
|
+
data: {
|
|
257
|
+
id: string;
|
|
258
|
+
bookingId: string;
|
|
259
|
+
supplierServiceId: string | null;
|
|
260
|
+
serviceName: string;
|
|
261
|
+
status: "pending" | "confirmed" | "cancelled" | "rejected";
|
|
262
|
+
supplierReference: string | null;
|
|
263
|
+
costCurrency: string;
|
|
264
|
+
costAmountCents: number;
|
|
265
|
+
notes: string | null;
|
|
266
|
+
confirmedAt: string | null;
|
|
267
|
+
createdAt: string;
|
|
268
|
+
updatedAt: string;
|
|
269
|
+
}[];
|
|
270
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "supplier-statuses"]>, "queryFn"> & {
|
|
271
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
272
|
+
data: {
|
|
273
|
+
id: string;
|
|
274
|
+
bookingId: string;
|
|
275
|
+
supplierServiceId: string | null;
|
|
276
|
+
serviceName: string;
|
|
277
|
+
status: "pending" | "confirmed" | "cancelled" | "rejected";
|
|
278
|
+
supplierReference: string | null;
|
|
279
|
+
costCurrency: string;
|
|
280
|
+
costAmountCents: number;
|
|
281
|
+
notes: string | null;
|
|
282
|
+
confirmedAt: string | null;
|
|
283
|
+
createdAt: string;
|
|
284
|
+
updatedAt: string;
|
|
285
|
+
}[];
|
|
286
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "supplier-statuses"], never> | undefined;
|
|
287
|
+
} & {
|
|
288
|
+
queryKey: readonly ["voyant", "bookings", "bookings", "detail", string, "supplier-statuses"] & {
|
|
289
|
+
[dataTagSymbol]: {
|
|
290
|
+
data: {
|
|
291
|
+
id: string;
|
|
292
|
+
bookingId: string;
|
|
293
|
+
supplierServiceId: string | null;
|
|
294
|
+
serviceName: string;
|
|
295
|
+
status: "pending" | "confirmed" | "cancelled" | "rejected";
|
|
296
|
+
supplierReference: string | null;
|
|
297
|
+
costCurrency: string;
|
|
298
|
+
costAmountCents: number;
|
|
299
|
+
notes: string | null;
|
|
300
|
+
confirmedAt: string | null;
|
|
301
|
+
createdAt: string;
|
|
302
|
+
updatedAt: string;
|
|
303
|
+
}[];
|
|
304
|
+
};
|
|
305
|
+
[dataTagErrorSymbol]: Error;
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
export declare function getBookingActivityQueryOptions(client: FetchWithValidationOptions, bookingId: string | null | undefined, options?: UseBookingActivityOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
309
|
+
data: {
|
|
310
|
+
id: string;
|
|
311
|
+
bookingId: string;
|
|
312
|
+
actorId: string | null;
|
|
313
|
+
activityType: string;
|
|
314
|
+
description: string;
|
|
315
|
+
metadata: Record<string, unknown> | null;
|
|
316
|
+
createdAt: string;
|
|
317
|
+
}[];
|
|
318
|
+
}, Error, {
|
|
319
|
+
data: {
|
|
320
|
+
id: string;
|
|
321
|
+
bookingId: string;
|
|
322
|
+
actorId: string | null;
|
|
323
|
+
activityType: string;
|
|
324
|
+
description: string;
|
|
325
|
+
metadata: Record<string, unknown> | null;
|
|
326
|
+
createdAt: string;
|
|
327
|
+
}[];
|
|
328
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "activity"]>, "queryFn"> & {
|
|
329
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
330
|
+
data: {
|
|
331
|
+
id: string;
|
|
332
|
+
bookingId: string;
|
|
333
|
+
actorId: string | null;
|
|
334
|
+
activityType: string;
|
|
335
|
+
description: string;
|
|
336
|
+
metadata: Record<string, unknown> | null;
|
|
337
|
+
createdAt: string;
|
|
338
|
+
}[];
|
|
339
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "activity"], never> | undefined;
|
|
340
|
+
} & {
|
|
341
|
+
queryKey: readonly ["voyant", "bookings", "bookings", "detail", string, "activity"] & {
|
|
342
|
+
[dataTagSymbol]: {
|
|
343
|
+
data: {
|
|
344
|
+
id: string;
|
|
345
|
+
bookingId: string;
|
|
346
|
+
actorId: string | null;
|
|
347
|
+
activityType: string;
|
|
348
|
+
description: string;
|
|
349
|
+
metadata: Record<string, unknown> | null;
|
|
350
|
+
createdAt: string;
|
|
351
|
+
}[];
|
|
352
|
+
};
|
|
353
|
+
[dataTagErrorSymbol]: Error;
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
export declare function getBookingNotesQueryOptions(client: FetchWithValidationOptions, bookingId: string | null | undefined, options?: UseBookingNotesOptions): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
357
|
+
data: {
|
|
358
|
+
id: string;
|
|
359
|
+
bookingId: string;
|
|
360
|
+
authorId: string;
|
|
361
|
+
content: string;
|
|
362
|
+
createdAt: string;
|
|
363
|
+
}[];
|
|
364
|
+
}, Error, {
|
|
365
|
+
data: {
|
|
366
|
+
id: string;
|
|
367
|
+
bookingId: string;
|
|
368
|
+
authorId: string;
|
|
369
|
+
content: string;
|
|
370
|
+
createdAt: string;
|
|
371
|
+
}[];
|
|
372
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "notes"]>, "queryFn"> & {
|
|
373
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
374
|
+
data: {
|
|
375
|
+
id: string;
|
|
376
|
+
bookingId: string;
|
|
377
|
+
authorId: string;
|
|
378
|
+
content: string;
|
|
379
|
+
createdAt: string;
|
|
380
|
+
}[];
|
|
381
|
+
}, readonly ["voyant", "bookings", "bookings", "detail", string, "notes"], never> | undefined;
|
|
382
|
+
} & {
|
|
383
|
+
queryKey: readonly ["voyant", "bookings", "bookings", "detail", string, "notes"] & {
|
|
384
|
+
[dataTagSymbol]: {
|
|
385
|
+
data: {
|
|
386
|
+
id: string;
|
|
387
|
+
bookingId: string;
|
|
388
|
+
authorId: string;
|
|
389
|
+
content: string;
|
|
390
|
+
createdAt: string;
|
|
391
|
+
}[];
|
|
392
|
+
};
|
|
393
|
+
[dataTagErrorSymbol]: Error;
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
//# sourceMappingURL=query-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-options.d.ts","sourceRoot":"","sources":["../src/query-options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,0BAA0B,EAAuB,MAAM,aAAa,CAAA;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAA;AAWlF,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,0BAA0B,EAClC,OAAO,GAAE,kBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBjC;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,0BAA0B,EAClC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7B,OAAO,GAAE,iBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQhC;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,0BAA0B,EAClC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,oBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAanC;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,0BAA0B,EAClC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,0BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAazC;AAED,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,0BAA0B,EAClC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,yBAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASxC;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,0BAA0B,EAClC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,GAAE,sBAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASrC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { queryOptions } from "@tanstack/react-query";
|
|
3
|
+
import { fetchWithValidation } from "./client.js";
|
|
4
|
+
import { bookingsQueryKeys } from "./query-keys.js";
|
|
5
|
+
import { bookingActivityResponse, bookingListResponse, bookingNotesResponse, bookingPassengersResponse, bookingSingleResponse, bookingSupplierStatusesResponse, } from "./schemas.js";
|
|
6
|
+
export function getBookingsQueryOptions(client, options = {}) {
|
|
7
|
+
const { enabled: _enabled = true, ...filters } = options;
|
|
8
|
+
return queryOptions({
|
|
9
|
+
queryKey: bookingsQueryKeys.bookingsList(filters),
|
|
10
|
+
queryFn: () => {
|
|
11
|
+
const params = new URLSearchParams();
|
|
12
|
+
if (filters.status)
|
|
13
|
+
params.set("status", filters.status);
|
|
14
|
+
if (filters.search)
|
|
15
|
+
params.set("search", filters.search);
|
|
16
|
+
if (filters.limit !== undefined)
|
|
17
|
+
params.set("limit", String(filters.limit));
|
|
18
|
+
if (filters.offset !== undefined)
|
|
19
|
+
params.set("offset", String(filters.offset));
|
|
20
|
+
const qs = params.toString();
|
|
21
|
+
return fetchWithValidation(`/v1/bookings${qs ? `?${qs}` : ""}`, bookingListResponse, client);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export function getBookingQueryOptions(client, id, options = {}) {
|
|
26
|
+
const { enabled: _enabled = true } = options;
|
|
27
|
+
return queryOptions({
|
|
28
|
+
queryKey: bookingsQueryKeys.booking(id ?? ""),
|
|
29
|
+
queryFn: () => fetchWithValidation(`/v1/bookings/${id}`, bookingSingleResponse, client),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
export function getPassengersQueryOptions(client, bookingId, options = {}) {
|
|
33
|
+
const { enabled: _enabled = true } = options;
|
|
34
|
+
return queryOptions({
|
|
35
|
+
queryKey: bookingsQueryKeys.passengers(bookingId ?? ""),
|
|
36
|
+
queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/passengers`, bookingPassengersResponse, client),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export function getSupplierStatusesQueryOptions(client, bookingId, options = {}) {
|
|
40
|
+
const { enabled: _enabled = true } = options;
|
|
41
|
+
return queryOptions({
|
|
42
|
+
queryKey: bookingsQueryKeys.supplierStatuses(bookingId ?? ""),
|
|
43
|
+
queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/supplier-statuses`, bookingSupplierStatusesResponse, client),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export function getBookingActivityQueryOptions(client, bookingId, options = {}) {
|
|
47
|
+
const { enabled: _enabled = true } = options;
|
|
48
|
+
return queryOptions({
|
|
49
|
+
queryKey: bookingsQueryKeys.activity(bookingId ?? ""),
|
|
50
|
+
queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/activity`, bookingActivityResponse, client),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
export function getBookingNotesQueryOptions(client, bookingId, options = {}) {
|
|
54
|
+
const { enabled: _enabled = true } = options;
|
|
55
|
+
return queryOptions({
|
|
56
|
+
queryKey: bookingsQueryKeys.notes(bookingId ?? ""),
|
|
57
|
+
queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/notes`, bookingNotesResponse, client),
|
|
58
|
+
});
|
|
59
|
+
}
|
package/dist/schemas.d.ts
CHANGED
|
@@ -24,9 +24,9 @@ export declare const bookingStatusSchema: z.ZodEnum<{
|
|
|
24
24
|
cancelled: "cancelled";
|
|
25
25
|
}>;
|
|
26
26
|
export declare const supplierConfirmationStatusSchema: z.ZodEnum<{
|
|
27
|
+
pending: "pending";
|
|
27
28
|
confirmed: "confirmed";
|
|
28
29
|
cancelled: "cancelled";
|
|
29
|
-
pending: "pending";
|
|
30
30
|
rejected: "rejected";
|
|
31
31
|
}>;
|
|
32
32
|
export declare const bookingRecordSchema: z.ZodObject<{
|
|
@@ -74,9 +74,9 @@ export declare const bookingSupplierStatusRecordSchema: z.ZodObject<{
|
|
|
74
74
|
supplierServiceId: z.ZodNullable<z.ZodString>;
|
|
75
75
|
serviceName: z.ZodString;
|
|
76
76
|
status: z.ZodEnum<{
|
|
77
|
+
pending: "pending";
|
|
77
78
|
confirmed: "confirmed";
|
|
78
79
|
cancelled: "cancelled";
|
|
79
|
-
pending: "pending";
|
|
80
80
|
rejected: "rejected";
|
|
81
81
|
}>;
|
|
82
82
|
supplierReference: z.ZodNullable<z.ZodString>;
|
|
@@ -184,9 +184,9 @@ export declare const bookingSupplierStatusesResponse: z.ZodObject<{
|
|
|
184
184
|
supplierServiceId: z.ZodNullable<z.ZodString>;
|
|
185
185
|
serviceName: z.ZodString;
|
|
186
186
|
status: z.ZodEnum<{
|
|
187
|
+
pending: "pending";
|
|
187
188
|
confirmed: "confirmed";
|
|
188
189
|
cancelled: "cancelled";
|
|
189
|
-
pending: "pending";
|
|
190
190
|
rejected: "rejected";
|
|
191
191
|
}>;
|
|
192
192
|
supplierReference: z.ZodNullable<z.ZodString>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/bookings-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,67 +9,63 @@
|
|
|
9
9
|
},
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
|
-
".":
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"./
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./provider": {
|
|
17
|
+
"types": "./dist/provider.d.ts",
|
|
18
|
+
"import": "./dist/provider.js"
|
|
19
|
+
},
|
|
20
|
+
"./hooks": {
|
|
21
|
+
"types": "./dist/hooks/index.d.ts",
|
|
22
|
+
"import": "./dist/hooks/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./client": {
|
|
25
|
+
"types": "./dist/client.d.ts",
|
|
26
|
+
"import": "./dist/client.js"
|
|
27
|
+
},
|
|
28
|
+
"./query-keys": {
|
|
29
|
+
"types": "./dist/query-keys.d.ts",
|
|
30
|
+
"import": "./dist/query-keys.js"
|
|
31
|
+
}
|
|
25
32
|
},
|
|
26
33
|
"peerDependencies": {
|
|
27
|
-
"@voyantjs/bookings": "workspace:*",
|
|
28
34
|
"@tanstack/react-query": "^5.0.0",
|
|
29
35
|
"react": "^19.0.0",
|
|
30
36
|
"react-dom": "^19.0.0",
|
|
31
|
-
"zod": "^4.0.0"
|
|
37
|
+
"zod": "^4.0.0",
|
|
38
|
+
"@voyantjs/bookings": "0.3.0"
|
|
32
39
|
},
|
|
33
40
|
"devDependencies": {
|
|
34
41
|
"@tanstack/react-query": "^5.96.2",
|
|
35
42
|
"@types/react": "^19.2.14",
|
|
36
43
|
"@types/react-dom": "^19.2.3",
|
|
37
|
-
"@voyantjs/bookings": "workspace:*",
|
|
38
|
-
"@voyantjs/voyant-typescript-config": "workspace:*",
|
|
39
44
|
"react": "^19.2.4",
|
|
40
45
|
"react-dom": "^19.2.4",
|
|
41
46
|
"typescript": "^6.0.2",
|
|
42
47
|
"vitest": "^4.1.2",
|
|
43
|
-
"zod": "^4.3.6"
|
|
48
|
+
"zod": "^4.3.6",
|
|
49
|
+
"@voyantjs/bookings": "0.3.0",
|
|
50
|
+
"@voyantjs/react": "0.3.0",
|
|
51
|
+
"@voyantjs/voyant-typescript-config": "0.1.0"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@voyantjs/react": "0.3.0"
|
|
44
55
|
},
|
|
45
56
|
"files": [
|
|
46
57
|
"dist"
|
|
47
58
|
],
|
|
48
59
|
"publishConfig": {
|
|
49
|
-
"access": "public"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"import": "./dist/hooks/index.js"
|
|
62
|
-
},
|
|
63
|
-
"./client": {
|
|
64
|
-
"types": "./dist/client.d.ts",
|
|
65
|
-
"import": "./dist/client.js"
|
|
66
|
-
},
|
|
67
|
-
"./query-keys": {
|
|
68
|
-
"types": "./dist/query-keys.d.ts",
|
|
69
|
-
"import": "./dist/query-keys.js"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
"main": "./dist/index.js",
|
|
73
|
-
"types": "./dist/index.d.ts"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
60
|
+
"access": "public"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "tsc -p tsconfig.json",
|
|
64
|
+
"clean": "rm -rf dist",
|
|
65
|
+
"typecheck": "tsc --noEmit",
|
|
66
|
+
"lint": "biome check src/",
|
|
67
|
+
"test": "vitest run --passWithNoTests"
|
|
68
|
+
},
|
|
69
|
+
"main": "./dist/index.js",
|
|
70
|
+
"types": "./dist/index.d.ts"
|
|
71
|
+
}
|