@bookinglab/booking-journey-api 2.8.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/README.md +2 -0
- package/dist/index.d.cts +231 -1
- package/dist/index.d.ts +231 -1
- package/dist/index.js +156 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +151 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -339,6 +339,90 @@ var BookingLabClient = class extends ApiClient {
|
|
|
339
339
|
}
|
|
340
340
|
);
|
|
341
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* Get company configuration
|
|
344
|
+
* @param request - Config request with client and company
|
|
345
|
+
* @param clientToken - Client token for authentication
|
|
346
|
+
*/
|
|
347
|
+
async getConfig(request, clientToken) {
|
|
348
|
+
return this.post("/config", request, {
|
|
349
|
+
headers: {
|
|
350
|
+
"clienttoken": clientToken
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Get a token for a client/company
|
|
356
|
+
* @param request - Token request with client and company
|
|
357
|
+
* @param clientToken - Client token for authentication
|
|
358
|
+
*/
|
|
359
|
+
async getToken(request, clientToken) {
|
|
360
|
+
return this.post("/token", request, {
|
|
361
|
+
headers: {
|
|
362
|
+
"clienttoken": clientToken
|
|
363
|
+
}
|
|
364
|
+
});
|
|
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
|
+
}
|
|
342
426
|
};
|
|
343
427
|
function createBookingLabClient(baseUrl, authToken, appId) {
|
|
344
428
|
const client = new BookingLabClient({ baseUrl });
|
|
@@ -1067,7 +1151,73 @@ function useBookingLabForgotPassword(companyId, clientToken) {
|
|
|
1067
1151
|
}
|
|
1068
1152
|
});
|
|
1069
1153
|
}
|
|
1154
|
+
function useBookingLabConfig(request, clientToken, enabled = true) {
|
|
1155
|
+
const client = useBookingLabClient();
|
|
1156
|
+
return useQuery({
|
|
1157
|
+
queryKey: ["bookingLabConfig", request.client, request.company],
|
|
1158
|
+
queryFn: async () => {
|
|
1159
|
+
const response = await client.getConfig(request, clientToken);
|
|
1160
|
+
return response.data;
|
|
1161
|
+
},
|
|
1162
|
+
enabled: enabled && !!request.client && !!request.company && !!clientToken
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
function useBookingLabGetToken(request, clientToken, enabled = true) {
|
|
1166
|
+
const client = useBookingLabClient();
|
|
1167
|
+
return useQuery({
|
|
1168
|
+
queryKey: ["bookingLabGetToken", request.client, request.company],
|
|
1169
|
+
queryFn: async () => {
|
|
1170
|
+
const response = await client.getToken(request, clientToken);
|
|
1171
|
+
return response.data;
|
|
1172
|
+
},
|
|
1173
|
+
enabled: enabled && !!request.client && !!request.company && !!clientToken
|
|
1174
|
+
});
|
|
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
|
+
}
|
|
1070
1220
|
|
|
1071
|
-
export { ApiClient, ApiClientContext, ApiClientProvider, BookingLabClient, BookingLabContext, BookingLabProvider, JrniClient, JrniContext, JrniProvider, MemberType, createBookingLabClient, createJrniClient, useAddServiceItem, useApiClientContext, useBookingLabClient, useBookingLabContext, useBookingLabForgotPassword, 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 };
|
|
1072
1222
|
//# sourceMappingURL=index.mjs.map
|
|
1073
1223
|
//# sourceMappingURL=index.mjs.map
|