@bookinglab/booking-journey-api 2.9.0 → 2.10.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 +161 -1
- package/dist/index.d.ts +161 -1
- package/dist/index.js +108 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -363,6 +363,66 @@ var BookingLabClient = class extends ApiClient {
|
|
|
363
363
|
}
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
|
+
/**
|
|
367
|
+
* Get services for a company
|
|
368
|
+
* @param companyId - The company ID
|
|
369
|
+
* @param clientToken - Client token for authentication
|
|
370
|
+
*/
|
|
371
|
+
async getCompanyServices(companyId, clientToken) {
|
|
372
|
+
return this.get(
|
|
373
|
+
`/company/${companyId}/services`,
|
|
374
|
+
{
|
|
375
|
+
headers: {
|
|
376
|
+
"clienttoken": clientToken
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Get a single service by ID for a company
|
|
383
|
+
* @param companyId - The company ID
|
|
384
|
+
* @param serviceId - The service ID
|
|
385
|
+
* @param clientToken - Client token for authentication
|
|
386
|
+
*/
|
|
387
|
+
async getCompanyService(companyId, serviceId, clientToken) {
|
|
388
|
+
return this.get(
|
|
389
|
+
`/company/${companyId}/service/${serviceId}`,
|
|
390
|
+
{
|
|
391
|
+
headers: {
|
|
392
|
+
"clienttoken": clientToken
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Get all companies
|
|
399
|
+
* @param clientToken - Client token for authentication
|
|
400
|
+
* @param params - Optional query params (service_id, person_id)
|
|
401
|
+
*/
|
|
402
|
+
async getCompanies(clientToken, params) {
|
|
403
|
+
return this.get("/companies", {
|
|
404
|
+
headers: {
|
|
405
|
+
"clienttoken": clientToken
|
|
406
|
+
},
|
|
407
|
+
params
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Get questions for a company by detail group ID
|
|
412
|
+
* @param companyId - The company ID
|
|
413
|
+
* @param detailGroupId - The detail group ID
|
|
414
|
+
* @param clientToken - Client token for authentication
|
|
415
|
+
*/
|
|
416
|
+
async getCompanyQuestions(companyId, detailGroupId, clientToken) {
|
|
417
|
+
return this.get(
|
|
418
|
+
`/company/${companyId}/questions/${detailGroupId}`,
|
|
419
|
+
{
|
|
420
|
+
headers: {
|
|
421
|
+
"clienttoken": clientToken
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
);
|
|
425
|
+
}
|
|
366
426
|
};
|
|
367
427
|
function createBookingLabClient(baseUrl, authToken, appId) {
|
|
368
428
|
const client = new BookingLabClient({ baseUrl });
|
|
@@ -1113,7 +1173,51 @@ function useBookingLabGetToken(request, clientToken, enabled = true) {
|
|
|
1113
1173
|
enabled: enabled && !!request.client && !!request.company && !!clientToken
|
|
1114
1174
|
});
|
|
1115
1175
|
}
|
|
1176
|
+
function useBookingLabServices(companyId, clientToken, enabled = true) {
|
|
1177
|
+
const client = useBookingLabClient();
|
|
1178
|
+
return useQuery({
|
|
1179
|
+
queryKey: ["bookingLabServices", companyId],
|
|
1180
|
+
queryFn: async () => {
|
|
1181
|
+
const response = await client.getCompanyServices(companyId, clientToken);
|
|
1182
|
+
return response.data;
|
|
1183
|
+
},
|
|
1184
|
+
enabled: enabled && !!companyId && !!clientToken
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
function useBookingLabService(companyId, serviceId, clientToken, enabled = true) {
|
|
1188
|
+
const client = useBookingLabClient();
|
|
1189
|
+
return useQuery({
|
|
1190
|
+
queryKey: ["bookingLabService", companyId, serviceId],
|
|
1191
|
+
queryFn: async () => {
|
|
1192
|
+
const response = await client.getCompanyService(companyId, serviceId, clientToken);
|
|
1193
|
+
return response.data;
|
|
1194
|
+
},
|
|
1195
|
+
enabled: enabled && !!companyId && !!serviceId && !!clientToken
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
function useBookingLabCompanies(clientToken, params, enabled = true) {
|
|
1199
|
+
const client = useBookingLabClient();
|
|
1200
|
+
return useQuery({
|
|
1201
|
+
queryKey: ["bookingLabCompanies", params?.service_id, params?.person_id],
|
|
1202
|
+
queryFn: async () => {
|
|
1203
|
+
const response = await client.getCompanies(clientToken, params);
|
|
1204
|
+
return response.data;
|
|
1205
|
+
},
|
|
1206
|
+
enabled: enabled && !!clientToken
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
function useBookingLabQuestions(companyId, detailGroupId, clientToken, enabled = true) {
|
|
1210
|
+
const client = useBookingLabClient();
|
|
1211
|
+
return useQuery({
|
|
1212
|
+
queryKey: ["bookingLabQuestions", companyId, detailGroupId],
|
|
1213
|
+
queryFn: async () => {
|
|
1214
|
+
const response = await client.getCompanyQuestions(companyId, detailGroupId, clientToken);
|
|
1215
|
+
return response.data;
|
|
1216
|
+
},
|
|
1217
|
+
enabled: enabled && !!companyId && !!detailGroupId && !!clientToken
|
|
1218
|
+
});
|
|
1219
|
+
}
|
|
1116
1220
|
|
|
1117
|
-
export { ApiClient, ApiClientContext, ApiClientProvider, BookingLabClient, BookingLabContext, BookingLabProvider, JrniClient, JrniContext, JrniProvider, MemberType, createBookingLabClient, createJrniClient, useAddServiceItem, useApiClientContext, useBookingLabClient, useBookingLabConfig, useBookingLabContext, useBookingLabForgotPassword, useBookingLabGetToken, useCancelBooking, useCancelMemberBooking, useCheckoutBasket, useChildCompanies, useClearBaskets, useClientDetails, useCompany, useCreateBasket, useCreateClient, useDates, useFindClientByEmail, useForgottenPassword, useGetMember, useJrniClient, useJrniContext, useListBookings, useLogin, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateClient, useUpdateMember };
|
|
1221
|
+
export { ApiClient, ApiClientContext, ApiClientProvider, BookingLabClient, BookingLabContext, BookingLabProvider, JrniClient, JrniContext, JrniProvider, MemberType, createBookingLabClient, createJrniClient, useAddServiceItem, useApiClientContext, useBookingLabClient, useBookingLabCompanies, useBookingLabConfig, useBookingLabContext, useBookingLabForgotPassword, useBookingLabGetToken, useBookingLabQuestions, useBookingLabService, useBookingLabServices, useCancelBooking, useCancelMemberBooking, useCheckoutBasket, useChildCompanies, useClearBaskets, useClientDetails, useCompany, useCreateBasket, useCreateClient, useDates, useFindClientByEmail, useForgottenPassword, useGetMember, useJrniClient, useJrniContext, useListBookings, useLogin, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateClient, useUpdateMember };
|
|
1118
1222
|
//# sourceMappingURL=index.mjs.map
|
|
1119
1223
|
//# sourceMappingURL=index.mjs.map
|