@bookinglab/booking-journey-api 2.14.0 → 2.16.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 +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -563,6 +563,29 @@ var BookingLabClient = class extends ApiClient {
|
|
|
563
563
|
}
|
|
564
564
|
);
|
|
565
565
|
}
|
|
566
|
+
/**
|
|
567
|
+
* List bookings for a company
|
|
568
|
+
* @param companyId - The company ID
|
|
569
|
+
* @param clientToken - Client token for authentication
|
|
570
|
+
* @param params - Optional query params (client_id, member_id)
|
|
571
|
+
*/
|
|
572
|
+
async listBookinglabBookings(companyId, clientToken, params) {
|
|
573
|
+
const queryParams = {};
|
|
574
|
+
if (params?.client_id !== void 0) queryParams.client_id = params.client_id;
|
|
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;
|
|
578
|
+
return this.get(
|
|
579
|
+
`/company/${companyId}/bookings`,
|
|
580
|
+
{
|
|
581
|
+
params: Object.keys(queryParams).length ? queryParams : void 0,
|
|
582
|
+
headers: {
|
|
583
|
+
"clienttoken": clientToken,
|
|
584
|
+
"x-company-id": String(companyId)
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
);
|
|
588
|
+
}
|
|
566
589
|
};
|
|
567
590
|
function createBookingLabClient(baseUrl, authToken, appId) {
|
|
568
591
|
const client = new BookingLabClient({ baseUrl });
|
|
@@ -1426,6 +1449,17 @@ function useOrdnanceAddressLookup(postcode, clientToken, enabled = true) {
|
|
|
1426
1449
|
enabled: enabled && !!postcode && !!clientToken
|
|
1427
1450
|
});
|
|
1428
1451
|
}
|
|
1452
|
+
function useListBookinglabBookings(companyId, clientToken, params, enabled = true) {
|
|
1453
|
+
const client = useBookingLabClient();
|
|
1454
|
+
return useQuery({
|
|
1455
|
+
queryKey: ["bookingLabListBookings", companyId, params?.client_id, params?.member_id, params?.start_date, params?.end_date],
|
|
1456
|
+
queryFn: async () => {
|
|
1457
|
+
const response = await client.listBookinglabBookings(companyId, clientToken, params);
|
|
1458
|
+
return response.data;
|
|
1459
|
+
},
|
|
1460
|
+
enabled: enabled && !!companyId && !!clientToken
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1429
1463
|
function useGetPurchase(companyId, serviceId, purchaseId, clientToken, enabled = true) {
|
|
1430
1464
|
const client = useBookingLabClient();
|
|
1431
1465
|
return useQuery({
|
|
@@ -1438,6 +1472,6 @@ function useGetPurchase(companyId, serviceId, purchaseId, clientToken, enabled =
|
|
|
1438
1472
|
});
|
|
1439
1473
|
}
|
|
1440
1474
|
|
|
1441
|
-
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, useListBookings, useLogin, useOrdnanceAddressLookup, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateClient, useUpdateMember };
|
|
1475
|
+
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 };
|
|
1442
1476
|
//# sourceMappingURL=index.mjs.map
|
|
1443
1477
|
//# sourceMappingURL=index.mjs.map
|