@bookinglab/booking-journey-api 2.15.0 → 2.17.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/index.d.cts +74 -1
- package/dist/index.d.ts +74 -1
- package/dist/index.js +32 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -573,6 +573,8 @@ var BookingLabClient = class extends ApiClient {
|
|
|
573
573
|
const queryParams = {};
|
|
574
574
|
if (params?.client_id !== void 0) queryParams.client_id = params.client_id;
|
|
575
575
|
if (params?.member_id !== void 0) queryParams.member_id = params.member_id;
|
|
576
|
+
if (params?.start_date !== void 0) queryParams.start_date = params.start_date;
|
|
577
|
+
if (params?.end_date !== void 0) queryParams.end_date = params.end_date;
|
|
576
578
|
return this.get(
|
|
577
579
|
`/company/${companyId}/bookings`,
|
|
578
580
|
{
|
|
@@ -584,6 +586,25 @@ var BookingLabClient = class extends ApiClient {
|
|
|
584
586
|
}
|
|
585
587
|
);
|
|
586
588
|
}
|
|
589
|
+
/**
|
|
590
|
+
* Update a booking for a company
|
|
591
|
+
* @param companyId - The company ID
|
|
592
|
+
* @param bookingId - The booking ID
|
|
593
|
+
* @param request - Booking update body (all fields optional)
|
|
594
|
+
* @param clientToken - Client token for authentication
|
|
595
|
+
*/
|
|
596
|
+
async updateBookinglabBooking(companyId, bookingId, request, clientToken) {
|
|
597
|
+
return this.put(
|
|
598
|
+
`/company/${companyId}/booking/${bookingId}`,
|
|
599
|
+
request,
|
|
600
|
+
{
|
|
601
|
+
headers: {
|
|
602
|
+
"clienttoken": clientToken,
|
|
603
|
+
"x-company-id": String(companyId)
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
);
|
|
607
|
+
}
|
|
587
608
|
};
|
|
588
609
|
function createBookingLabClient(baseUrl, authToken, appId) {
|
|
589
610
|
const client = new BookingLabClient({ baseUrl });
|
|
@@ -1450,7 +1471,7 @@ function useOrdnanceAddressLookup(postcode, clientToken, enabled = true) {
|
|
|
1450
1471
|
function useListBookinglabBookings(companyId, clientToken, params, enabled = true) {
|
|
1451
1472
|
const client = useBookingLabClient();
|
|
1452
1473
|
return useQuery({
|
|
1453
|
-
queryKey: ["bookingLabListBookings", companyId, params?.client_id, params?.member_id],
|
|
1474
|
+
queryKey: ["bookingLabListBookings", companyId, params?.client_id, params?.member_id, params?.start_date, params?.end_date],
|
|
1454
1475
|
queryFn: async () => {
|
|
1455
1476
|
const response = await client.listBookinglabBookings(companyId, clientToken, params);
|
|
1456
1477
|
return response.data;
|
|
@@ -1469,7 +1490,16 @@ function useGetPurchase(companyId, serviceId, purchaseId, clientToken, enabled =
|
|
|
1469
1490
|
enabled: enabled && !!companyId && !!serviceId && !!purchaseId && !!clientToken
|
|
1470
1491
|
});
|
|
1471
1492
|
}
|
|
1493
|
+
function useUpdateBookinglabBooking(companyId, bookingId, clientToken) {
|
|
1494
|
+
const client = useBookingLabClient();
|
|
1495
|
+
return useMutation({
|
|
1496
|
+
mutationFn: async (request) => {
|
|
1497
|
+
const response = await client.updateBookinglabBooking(companyId, bookingId, request, clientToken);
|
|
1498
|
+
return response.data;
|
|
1499
|
+
}
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1472
1502
|
|
|
1473
|
-
export { ApiClient, ApiClientContext, ApiClientProvider, BookingLabClient, BookingLabContext, BookingLabProvider, JrniClient, JrniContext, JrniProvider, MemberType, createBookingLabClient, createJrniClient, useAddServiceItem, useApiClientContext, useBookingLabAddBasketServiceItem, useBookingLabCheckoutBasket, useBookingLabClient, useBookingLabCompanies, useBookingLabConfig, useBookingLabContext, useBookingLabCreateBasket, useBookingLabDays, useBookingLabDeleteBasket, useBookingLabForgotPassword, useBookingLabGetToken, useBookingLabQuestions, useBookingLabService, useBookingLabServices, useBookingLabTimes, useCancelBooking, useCancelMemberBooking, useCheckoutBasket, useChildCompanies, useClearBaskets, useClientDetails, useCompany, useCreateBasket, useCreateClient, useDates, useFindClientByEmail, useForgottenPassword, useGetMember, useGetPurchase, useJrniClient, useJrniContext, useListBookinglabBookings, useListBookings, useLogin, useOrdnanceAddressLookup, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateClient, useUpdateMember };
|
|
1503
|
+
export { ApiClient, ApiClientContext, ApiClientProvider, BookingLabClient, BookingLabContext, BookingLabProvider, JrniClient, JrniContext, JrniProvider, MemberType, createBookingLabClient, createJrniClient, useAddServiceItem, useApiClientContext, useBookingLabAddBasketServiceItem, useBookingLabCheckoutBasket, useBookingLabClient, useBookingLabCompanies, useBookingLabConfig, useBookingLabContext, useBookingLabCreateBasket, useBookingLabDays, useBookingLabDeleteBasket, useBookingLabForgotPassword, useBookingLabGetToken, useBookingLabQuestions, useBookingLabService, useBookingLabServices, useBookingLabTimes, useCancelBooking, useCancelMemberBooking, useCheckoutBasket, useChildCompanies, useClearBaskets, useClientDetails, useCompany, useCreateBasket, useCreateClient, useDates, useFindClientByEmail, useForgottenPassword, useGetMember, useGetPurchase, useJrniClient, useJrniContext, useListBookinglabBookings, useListBookings, useLogin, useOrdnanceAddressLookup, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateBookinglabBooking, useUpdateClient, useUpdateMember };
|
|
1474
1504
|
//# sourceMappingURL=index.mjs.map
|
|
1475
1505
|
//# sourceMappingURL=index.mjs.map
|