@bookinglab/booking-journey-api 2.13.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 +98 -1
- package/dist/index.d.ts +98 -1
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -545,6 +545,45 @@ var BookingLabClient = class extends ApiClient {
|
|
|
545
545
|
}
|
|
546
546
|
);
|
|
547
547
|
}
|
|
548
|
+
/**
|
|
549
|
+
* Get a purchase by ID for a company/service
|
|
550
|
+
* @param companyId - The company ID
|
|
551
|
+
* @param serviceId - The service ID
|
|
552
|
+
* @param purchaseId - The purchase ID
|
|
553
|
+
* @param clientToken - Client token for authentication
|
|
554
|
+
*/
|
|
555
|
+
async getPurchase(companyId, serviceId, purchaseId, clientToken) {
|
|
556
|
+
return this.get(
|
|
557
|
+
`/company/${companyId}/service/${serviceId}/purchase/${purchaseId}`,
|
|
558
|
+
{
|
|
559
|
+
headers: {
|
|
560
|
+
"clienttoken": clientToken,
|
|
561
|
+
"x-company-id": String(companyId)
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
);
|
|
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
|
+
}
|
|
548
587
|
};
|
|
549
588
|
function createBookingLabClient(baseUrl, authToken, appId) {
|
|
550
589
|
const client = new BookingLabClient({ baseUrl });
|
|
@@ -1408,7 +1447,29 @@ function useOrdnanceAddressLookup(postcode, clientToken, enabled = true) {
|
|
|
1408
1447
|
enabled: enabled && !!postcode && !!clientToken
|
|
1409
1448
|
});
|
|
1410
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
|
+
}
|
|
1461
|
+
function useGetPurchase(companyId, serviceId, purchaseId, clientToken, enabled = true) {
|
|
1462
|
+
const client = useBookingLabClient();
|
|
1463
|
+
return useQuery({
|
|
1464
|
+
queryKey: ["bookingLabPurchase", companyId, serviceId, purchaseId],
|
|
1465
|
+
queryFn: async () => {
|
|
1466
|
+
const response = await client.getPurchase(companyId, serviceId, purchaseId, clientToken);
|
|
1467
|
+
return response.data;
|
|
1468
|
+
},
|
|
1469
|
+
enabled: enabled && !!companyId && !!serviceId && !!purchaseId && !!clientToken
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1411
1472
|
|
|
1412
|
-
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, 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 };
|
|
1413
1474
|
//# sourceMappingURL=index.mjs.map
|
|
1414
1475
|
//# sourceMappingURL=index.mjs.map
|