@bookinglab/booking-journey-api 2.14.0 → 2.15.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 +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -563,6 +563,27 @@ 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
|
+
return this.get(
|
|
577
|
+
`/company/${companyId}/bookings`,
|
|
578
|
+
{
|
|
579
|
+
params: Object.keys(queryParams).length ? queryParams : void 0,
|
|
580
|
+
headers: {
|
|
581
|
+
"clienttoken": clientToken,
|
|
582
|
+
"x-company-id": String(companyId)
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
);
|
|
586
|
+
}
|
|
566
587
|
};
|
|
567
588
|
function createBookingLabClient(baseUrl, authToken, appId) {
|
|
568
589
|
const client = new BookingLabClient({ baseUrl });
|
|
@@ -1426,6 +1447,17 @@ function useOrdnanceAddressLookup(postcode, clientToken, enabled = true) {
|
|
|
1426
1447
|
enabled: enabled && !!postcode && !!clientToken
|
|
1427
1448
|
});
|
|
1428
1449
|
}
|
|
1450
|
+
function useListBookinglabBookings(companyId, clientToken, params, enabled = true) {
|
|
1451
|
+
const client = useBookingLabClient();
|
|
1452
|
+
return useQuery({
|
|
1453
|
+
queryKey: ["bookingLabListBookings", companyId, params?.client_id, params?.member_id],
|
|
1454
|
+
queryFn: async () => {
|
|
1455
|
+
const response = await client.listBookinglabBookings(companyId, clientToken, params);
|
|
1456
|
+
return response.data;
|
|
1457
|
+
},
|
|
1458
|
+
enabled: enabled && !!companyId && !!clientToken
|
|
1459
|
+
});
|
|
1460
|
+
}
|
|
1429
1461
|
function useGetPurchase(companyId, serviceId, purchaseId, clientToken, enabled = true) {
|
|
1430
1462
|
const client = useBookingLabClient();
|
|
1431
1463
|
return useQuery({
|
|
@@ -1438,6 +1470,6 @@ function useGetPurchase(companyId, serviceId, purchaseId, clientToken, enabled =
|
|
|
1438
1470
|
});
|
|
1439
1471
|
}
|
|
1440
1472
|
|
|
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 };
|
|
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 };
|
|
1442
1474
|
//# sourceMappingURL=index.mjs.map
|
|
1443
1475
|
//# sourceMappingURL=index.mjs.map
|