@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.d.cts
CHANGED
|
@@ -1118,6 +1118,110 @@ interface BookingLabGetTokenRequest {
|
|
|
1118
1118
|
interface BookingLabGetTokenResponse {
|
|
1119
1119
|
[key: string]: unknown;
|
|
1120
1120
|
}
|
|
1121
|
+
interface BookingLabService {
|
|
1122
|
+
id: number;
|
|
1123
|
+
category_id: number;
|
|
1124
|
+
name: string;
|
|
1125
|
+
description: string;
|
|
1126
|
+
durations: number[];
|
|
1127
|
+
prices: number[];
|
|
1128
|
+
detail_group_id: number;
|
|
1129
|
+
listed_durations: any[];
|
|
1130
|
+
extra?: Record<string, any>;
|
|
1131
|
+
booking_time_step: number;
|
|
1132
|
+
can_refund_automatically: boolean;
|
|
1133
|
+
is_event_group: boolean;
|
|
1134
|
+
type: string;
|
|
1135
|
+
group_id: number | null;
|
|
1136
|
+
deleted: boolean;
|
|
1137
|
+
queuing_disabled: boolean;
|
|
1138
|
+
company_id: number;
|
|
1139
|
+
min_advance_period: number;
|
|
1140
|
+
max_advance_period: number;
|
|
1141
|
+
min_cancel_period: number;
|
|
1142
|
+
booking_type_public: string;
|
|
1143
|
+
booking_type: number;
|
|
1144
|
+
mbooking_type: number;
|
|
1145
|
+
min_bookings: number;
|
|
1146
|
+
max_bookings: number;
|
|
1147
|
+
method_of_appointment: string;
|
|
1148
|
+
groups: any[];
|
|
1149
|
+
spaces?: number;
|
|
1150
|
+
order: number;
|
|
1151
|
+
child_level_service: boolean;
|
|
1152
|
+
global_id: number;
|
|
1153
|
+
availability: number;
|
|
1154
|
+
prices_in_major_units: number[];
|
|
1155
|
+
combine_resource_and_staff: boolean;
|
|
1156
|
+
disabled: boolean;
|
|
1157
|
+
_links: Record<string, any>;
|
|
1158
|
+
[key: string]: any;
|
|
1159
|
+
}
|
|
1160
|
+
interface BookingLabGetServicesResponse {
|
|
1161
|
+
total_entries: number;
|
|
1162
|
+
_embedded: {
|
|
1163
|
+
services: BookingLabService[];
|
|
1164
|
+
};
|
|
1165
|
+
_links: Record<string, any>;
|
|
1166
|
+
}
|
|
1167
|
+
interface BookingLabCompany {
|
|
1168
|
+
id: number;
|
|
1169
|
+
name: string;
|
|
1170
|
+
description?: string;
|
|
1171
|
+
company_type?: string;
|
|
1172
|
+
extra?: Record<string, any>;
|
|
1173
|
+
address_id?: number;
|
|
1174
|
+
website?: string;
|
|
1175
|
+
multi_status?: string[];
|
|
1176
|
+
numeric_widget_id?: number;
|
|
1177
|
+
currency_code?: string;
|
|
1178
|
+
timezone?: string;
|
|
1179
|
+
country_code?: string;
|
|
1180
|
+
live?: boolean;
|
|
1181
|
+
ref?: string;
|
|
1182
|
+
created_at?: string;
|
|
1183
|
+
updated_at?: string;
|
|
1184
|
+
children_count?: number;
|
|
1185
|
+
locale?: string;
|
|
1186
|
+
available_locales?: string[];
|
|
1187
|
+
membership_id?: number;
|
|
1188
|
+
address?: Record<string, any>;
|
|
1189
|
+
_embedded?: Record<string, any>;
|
|
1190
|
+
_links?: Record<string, any>;
|
|
1191
|
+
parent?: number;
|
|
1192
|
+
[key: string]: any;
|
|
1193
|
+
}
|
|
1194
|
+
interface BookingLabGetCompaniesParams {
|
|
1195
|
+
service_id?: number;
|
|
1196
|
+
person_id?: number;
|
|
1197
|
+
}
|
|
1198
|
+
type BookingLabGetCompaniesResponse = BookingLabCompany[];
|
|
1199
|
+
interface BookingLabQuestion {
|
|
1200
|
+
id: number;
|
|
1201
|
+
name: string;
|
|
1202
|
+
required: boolean;
|
|
1203
|
+
important: boolean;
|
|
1204
|
+
admin_only: boolean;
|
|
1205
|
+
applies_to: number;
|
|
1206
|
+
ask_member: boolean;
|
|
1207
|
+
detail_type: string;
|
|
1208
|
+
settings: Record<string, any>;
|
|
1209
|
+
price: number;
|
|
1210
|
+
price_per_booking: boolean;
|
|
1211
|
+
outcome: boolean;
|
|
1212
|
+
hide_on_customer_journey: boolean;
|
|
1213
|
+
_links?: Record<string, any>;
|
|
1214
|
+
[key: string]: any;
|
|
1215
|
+
}
|
|
1216
|
+
interface BookingLabGetQuestionsResponse {
|
|
1217
|
+
company_id: number;
|
|
1218
|
+
questions: BookingLabQuestion[];
|
|
1219
|
+
name: string;
|
|
1220
|
+
admin?: any;
|
|
1221
|
+
outcome?: any;
|
|
1222
|
+
_links?: Record<string, any>;
|
|
1223
|
+
[key: string]: any;
|
|
1224
|
+
}
|
|
1121
1225
|
|
|
1122
1226
|
/**
|
|
1123
1227
|
* Core API Client
|
|
@@ -1272,6 +1376,32 @@ declare class BookingLabClient extends ApiClient {
|
|
|
1272
1376
|
* @param clientToken - Client token for authentication
|
|
1273
1377
|
*/
|
|
1274
1378
|
getToken(request: BookingLabGetTokenRequest, clientToken: string): Promise<ApiResponse<BookingLabGetTokenResponse>>;
|
|
1379
|
+
/**
|
|
1380
|
+
* Get services for a company
|
|
1381
|
+
* @param companyId - The company ID
|
|
1382
|
+
* @param clientToken - Client token for authentication
|
|
1383
|
+
*/
|
|
1384
|
+
getCompanyServices(companyId: number, clientToken: string): Promise<ApiResponse<BookingLabGetServicesResponse>>;
|
|
1385
|
+
/**
|
|
1386
|
+
* Get a single service by ID for a company
|
|
1387
|
+
* @param companyId - The company ID
|
|
1388
|
+
* @param serviceId - The service ID
|
|
1389
|
+
* @param clientToken - Client token for authentication
|
|
1390
|
+
*/
|
|
1391
|
+
getCompanyService(companyId: number, serviceId: number, clientToken: string): Promise<ApiResponse<BookingLabService>>;
|
|
1392
|
+
/**
|
|
1393
|
+
* Get all companies
|
|
1394
|
+
* @param clientToken - Client token for authentication
|
|
1395
|
+
* @param params - Optional query params (service_id, person_id)
|
|
1396
|
+
*/
|
|
1397
|
+
getCompanies(clientToken: string, params?: BookingLabGetCompaniesParams): Promise<ApiResponse<BookingLabGetCompaniesResponse>>;
|
|
1398
|
+
/**
|
|
1399
|
+
* Get questions for a company by detail group ID
|
|
1400
|
+
* @param companyId - The company ID
|
|
1401
|
+
* @param detailGroupId - The detail group ID
|
|
1402
|
+
* @param clientToken - Client token for authentication
|
|
1403
|
+
*/
|
|
1404
|
+
getCompanyQuestions(companyId: number, detailGroupId: number, clientToken: string): Promise<ApiResponse<BookingLabGetQuestionsResponse>>;
|
|
1275
1405
|
}
|
|
1276
1406
|
/**
|
|
1277
1407
|
* Create a new BookingLab client instance
|
|
@@ -1682,5 +1812,35 @@ declare function useBookingLabConfig(request: BookingLabConfigRequest, clientTok
|
|
|
1682
1812
|
* @param enabled - Whether the query should run
|
|
1683
1813
|
*/
|
|
1684
1814
|
declare function useBookingLabGetToken(request: BookingLabGetTokenRequest, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabGetTokenResponse, Error>;
|
|
1815
|
+
/**
|
|
1816
|
+
* Hook for fetching services for a company (BookingLab)
|
|
1817
|
+
* @param companyId - The company ID
|
|
1818
|
+
* @param clientToken - Client token for authentication
|
|
1819
|
+
* @param enabled - Whether the query should run
|
|
1820
|
+
*/
|
|
1821
|
+
declare function useBookingLabServices(companyId: number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabGetServicesResponse, Error>;
|
|
1822
|
+
/**
|
|
1823
|
+
* Hook for fetching a single service for a company by ID (BookingLab)
|
|
1824
|
+
* @param companyId - The company ID
|
|
1825
|
+
* @param serviceId - The service ID
|
|
1826
|
+
* @param clientToken - Client token for authentication
|
|
1827
|
+
* @param enabled - Whether the query should run
|
|
1828
|
+
*/
|
|
1829
|
+
declare function useBookingLabService(companyId: number, serviceId: number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabService, Error>;
|
|
1830
|
+
/**
|
|
1831
|
+
* Hook for fetching all companies (BookingLab)
|
|
1832
|
+
* @param clientToken - Client token for authentication
|
|
1833
|
+
* @param params - Optional query params (service_id, person_id)
|
|
1834
|
+
* @param enabled - Whether the query should run
|
|
1835
|
+
*/
|
|
1836
|
+
declare function useBookingLabCompanies(clientToken: string, params?: BookingLabGetCompaniesParams, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabGetCompaniesResponse, Error>;
|
|
1837
|
+
/**
|
|
1838
|
+
* Hook for fetching questions for a company by detail group (BookingLab)
|
|
1839
|
+
* @param companyId - The company ID
|
|
1840
|
+
* @param detailGroupId - The detail group ID
|
|
1841
|
+
* @param clientToken - Client token for authentication
|
|
1842
|
+
* @param enabled - Whether the query should run
|
|
1843
|
+
*/
|
|
1844
|
+
declare function useBookingLabQuestions(companyId: number, detailGroupId: number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabGetQuestionsResponse, Error>;
|
|
1685
1845
|
|
|
1686
|
-
export { type AddBasketItemRequest, type AddServiceItemAssets, type AddServiceItemQuestion, type AddServiceItemRequest, ApiClient, type ApiClientConfig, ApiClientContext, ApiClientProvider, type ApiError, type ApiResponse, type AvailabilityTime, type AvailabilityTimesResponse, type Booking, type BookingAnswer, BookingLabClient, type BookingLabConfigPage, type BookingLabConfigProduct, type BookingLabConfigRequest, type BookingLabConfigResponse, type BookingLabConfigUserJourney, BookingLabContext, type BookingLabForgotPasswordRequest, type BookingLabForgotPasswordResponse, type BookingLabGetTokenRequest, type BookingLabGetTokenResponse, BookingLabProvider, type BookingPaymentItem, type BookingSettings, type CancelBookingRequest, type CancelBookingResponse, type CancelMemberBookingResponse, type CheckoutBasketClient, type CheckoutBasketRequest, type CheckoutBasketResponse, type ChildCompaniesResponse, type ChildCompany, type ChildCompanyAddress, type ChildCompanySettings, type ClearBasketsResponse, type ClientDetailsQuestion, type ClientDetailsResponse, type CompanyResponse, type CompanySettings, type CreateBasketRequest, type CreateBasketResponse, type CreateBookingRequest, type CreateClientRequest, type CreateClientResponse, type DateSlot, type DatesResponse, type FindClientByEmailResponse, type ForgottenPasswordRequest, type ForgottenPasswordResponse, type GetChildCompaniesParams, type GetDatesParams, type GetMemberResponse, type GetQuestionsParams, type GetTimesParams, type JrniBooking, JrniClient, type JrniConfig, JrniContext, JrniProvider, type JrniService, type ListBookingsParams, type ListBookingsResponse, type Location, type LocationsResponse, type LoginRequest, type LoginResponse, type MemberBooking, type MemberBookingsResponse, MemberType, type PersonImage, type PersonImagesResponse, type Question, type QuestionOption, type QuestionsResponse, type RequestOptions, type RescheduleBookingRequest, type RescheduleBookingResponse, type ResetPasswordRequest, type Resource, type ResourceLinks, type ResourcesResponse, type SendCustomEmailRequest, type SendCustomEmailResponse, type Service, type ServiceItemResponse, type ServicesResponse, type TimeSlot, type TimesResponse, type UpdateClientAnswer, type UpdateClientAnswerEntry, type UpdateClientDetailsData, type UpdateClientExtraInfo, type UpdateClientNotificationPreferences, type UpdateClientQuestionEntry, type UpdateClientRequest, type UpdateClientResponse, type UpdateMemberDetailsData, type UpdateMemberRequest, type UpdateMemberResponse, type Vehicle, type VehiclesResponse, 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 };
|
|
1846
|
+
export { type AddBasketItemRequest, type AddServiceItemAssets, type AddServiceItemQuestion, type AddServiceItemRequest, ApiClient, type ApiClientConfig, ApiClientContext, ApiClientProvider, type ApiError, type ApiResponse, type AvailabilityTime, type AvailabilityTimesResponse, type Booking, type BookingAnswer, BookingLabClient, type BookingLabCompany, type BookingLabConfigPage, type BookingLabConfigProduct, type BookingLabConfigRequest, type BookingLabConfigResponse, type BookingLabConfigUserJourney, BookingLabContext, type BookingLabForgotPasswordRequest, type BookingLabForgotPasswordResponse, type BookingLabGetCompaniesParams, type BookingLabGetCompaniesResponse, type BookingLabGetQuestionsResponse, type BookingLabGetServicesResponse, type BookingLabGetTokenRequest, type BookingLabGetTokenResponse, BookingLabProvider, type BookingLabQuestion, type BookingLabService, type BookingPaymentItem, type BookingSettings, type CancelBookingRequest, type CancelBookingResponse, type CancelMemberBookingResponse, type CheckoutBasketClient, type CheckoutBasketRequest, type CheckoutBasketResponse, type ChildCompaniesResponse, type ChildCompany, type ChildCompanyAddress, type ChildCompanySettings, type ClearBasketsResponse, type ClientDetailsQuestion, type ClientDetailsResponse, type CompanyResponse, type CompanySettings, type CreateBasketRequest, type CreateBasketResponse, type CreateBookingRequest, type CreateClientRequest, type CreateClientResponse, type DateSlot, type DatesResponse, type FindClientByEmailResponse, type ForgottenPasswordRequest, type ForgottenPasswordResponse, type GetChildCompaniesParams, type GetDatesParams, type GetMemberResponse, type GetQuestionsParams, type GetTimesParams, type JrniBooking, JrniClient, type JrniConfig, JrniContext, JrniProvider, type JrniService, type ListBookingsParams, type ListBookingsResponse, type Location, type LocationsResponse, type LoginRequest, type LoginResponse, type MemberBooking, type MemberBookingsResponse, MemberType, type PersonImage, type PersonImagesResponse, type Question, type QuestionOption, type QuestionsResponse, type RequestOptions, type RescheduleBookingRequest, type RescheduleBookingResponse, type ResetPasswordRequest, type Resource, type ResourceLinks, type ResourcesResponse, type SendCustomEmailRequest, type SendCustomEmailResponse, type Service, type ServiceItemResponse, type ServicesResponse, type TimeSlot, type TimesResponse, type UpdateClientAnswer, type UpdateClientAnswerEntry, type UpdateClientDetailsData, type UpdateClientExtraInfo, type UpdateClientNotificationPreferences, type UpdateClientQuestionEntry, type UpdateClientRequest, type UpdateClientResponse, type UpdateMemberDetailsData, type UpdateMemberRequest, type UpdateMemberResponse, type Vehicle, type VehiclesResponse, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1118,6 +1118,110 @@ interface BookingLabGetTokenRequest {
|
|
|
1118
1118
|
interface BookingLabGetTokenResponse {
|
|
1119
1119
|
[key: string]: unknown;
|
|
1120
1120
|
}
|
|
1121
|
+
interface BookingLabService {
|
|
1122
|
+
id: number;
|
|
1123
|
+
category_id: number;
|
|
1124
|
+
name: string;
|
|
1125
|
+
description: string;
|
|
1126
|
+
durations: number[];
|
|
1127
|
+
prices: number[];
|
|
1128
|
+
detail_group_id: number;
|
|
1129
|
+
listed_durations: any[];
|
|
1130
|
+
extra?: Record<string, any>;
|
|
1131
|
+
booking_time_step: number;
|
|
1132
|
+
can_refund_automatically: boolean;
|
|
1133
|
+
is_event_group: boolean;
|
|
1134
|
+
type: string;
|
|
1135
|
+
group_id: number | null;
|
|
1136
|
+
deleted: boolean;
|
|
1137
|
+
queuing_disabled: boolean;
|
|
1138
|
+
company_id: number;
|
|
1139
|
+
min_advance_period: number;
|
|
1140
|
+
max_advance_period: number;
|
|
1141
|
+
min_cancel_period: number;
|
|
1142
|
+
booking_type_public: string;
|
|
1143
|
+
booking_type: number;
|
|
1144
|
+
mbooking_type: number;
|
|
1145
|
+
min_bookings: number;
|
|
1146
|
+
max_bookings: number;
|
|
1147
|
+
method_of_appointment: string;
|
|
1148
|
+
groups: any[];
|
|
1149
|
+
spaces?: number;
|
|
1150
|
+
order: number;
|
|
1151
|
+
child_level_service: boolean;
|
|
1152
|
+
global_id: number;
|
|
1153
|
+
availability: number;
|
|
1154
|
+
prices_in_major_units: number[];
|
|
1155
|
+
combine_resource_and_staff: boolean;
|
|
1156
|
+
disabled: boolean;
|
|
1157
|
+
_links: Record<string, any>;
|
|
1158
|
+
[key: string]: any;
|
|
1159
|
+
}
|
|
1160
|
+
interface BookingLabGetServicesResponse {
|
|
1161
|
+
total_entries: number;
|
|
1162
|
+
_embedded: {
|
|
1163
|
+
services: BookingLabService[];
|
|
1164
|
+
};
|
|
1165
|
+
_links: Record<string, any>;
|
|
1166
|
+
}
|
|
1167
|
+
interface BookingLabCompany {
|
|
1168
|
+
id: number;
|
|
1169
|
+
name: string;
|
|
1170
|
+
description?: string;
|
|
1171
|
+
company_type?: string;
|
|
1172
|
+
extra?: Record<string, any>;
|
|
1173
|
+
address_id?: number;
|
|
1174
|
+
website?: string;
|
|
1175
|
+
multi_status?: string[];
|
|
1176
|
+
numeric_widget_id?: number;
|
|
1177
|
+
currency_code?: string;
|
|
1178
|
+
timezone?: string;
|
|
1179
|
+
country_code?: string;
|
|
1180
|
+
live?: boolean;
|
|
1181
|
+
ref?: string;
|
|
1182
|
+
created_at?: string;
|
|
1183
|
+
updated_at?: string;
|
|
1184
|
+
children_count?: number;
|
|
1185
|
+
locale?: string;
|
|
1186
|
+
available_locales?: string[];
|
|
1187
|
+
membership_id?: number;
|
|
1188
|
+
address?: Record<string, any>;
|
|
1189
|
+
_embedded?: Record<string, any>;
|
|
1190
|
+
_links?: Record<string, any>;
|
|
1191
|
+
parent?: number;
|
|
1192
|
+
[key: string]: any;
|
|
1193
|
+
}
|
|
1194
|
+
interface BookingLabGetCompaniesParams {
|
|
1195
|
+
service_id?: number;
|
|
1196
|
+
person_id?: number;
|
|
1197
|
+
}
|
|
1198
|
+
type BookingLabGetCompaniesResponse = BookingLabCompany[];
|
|
1199
|
+
interface BookingLabQuestion {
|
|
1200
|
+
id: number;
|
|
1201
|
+
name: string;
|
|
1202
|
+
required: boolean;
|
|
1203
|
+
important: boolean;
|
|
1204
|
+
admin_only: boolean;
|
|
1205
|
+
applies_to: number;
|
|
1206
|
+
ask_member: boolean;
|
|
1207
|
+
detail_type: string;
|
|
1208
|
+
settings: Record<string, any>;
|
|
1209
|
+
price: number;
|
|
1210
|
+
price_per_booking: boolean;
|
|
1211
|
+
outcome: boolean;
|
|
1212
|
+
hide_on_customer_journey: boolean;
|
|
1213
|
+
_links?: Record<string, any>;
|
|
1214
|
+
[key: string]: any;
|
|
1215
|
+
}
|
|
1216
|
+
interface BookingLabGetQuestionsResponse {
|
|
1217
|
+
company_id: number;
|
|
1218
|
+
questions: BookingLabQuestion[];
|
|
1219
|
+
name: string;
|
|
1220
|
+
admin?: any;
|
|
1221
|
+
outcome?: any;
|
|
1222
|
+
_links?: Record<string, any>;
|
|
1223
|
+
[key: string]: any;
|
|
1224
|
+
}
|
|
1121
1225
|
|
|
1122
1226
|
/**
|
|
1123
1227
|
* Core API Client
|
|
@@ -1272,6 +1376,32 @@ declare class BookingLabClient extends ApiClient {
|
|
|
1272
1376
|
* @param clientToken - Client token for authentication
|
|
1273
1377
|
*/
|
|
1274
1378
|
getToken(request: BookingLabGetTokenRequest, clientToken: string): Promise<ApiResponse<BookingLabGetTokenResponse>>;
|
|
1379
|
+
/**
|
|
1380
|
+
* Get services for a company
|
|
1381
|
+
* @param companyId - The company ID
|
|
1382
|
+
* @param clientToken - Client token for authentication
|
|
1383
|
+
*/
|
|
1384
|
+
getCompanyServices(companyId: number, clientToken: string): Promise<ApiResponse<BookingLabGetServicesResponse>>;
|
|
1385
|
+
/**
|
|
1386
|
+
* Get a single service by ID for a company
|
|
1387
|
+
* @param companyId - The company ID
|
|
1388
|
+
* @param serviceId - The service ID
|
|
1389
|
+
* @param clientToken - Client token for authentication
|
|
1390
|
+
*/
|
|
1391
|
+
getCompanyService(companyId: number, serviceId: number, clientToken: string): Promise<ApiResponse<BookingLabService>>;
|
|
1392
|
+
/**
|
|
1393
|
+
* Get all companies
|
|
1394
|
+
* @param clientToken - Client token for authentication
|
|
1395
|
+
* @param params - Optional query params (service_id, person_id)
|
|
1396
|
+
*/
|
|
1397
|
+
getCompanies(clientToken: string, params?: BookingLabGetCompaniesParams): Promise<ApiResponse<BookingLabGetCompaniesResponse>>;
|
|
1398
|
+
/**
|
|
1399
|
+
* Get questions for a company by detail group ID
|
|
1400
|
+
* @param companyId - The company ID
|
|
1401
|
+
* @param detailGroupId - The detail group ID
|
|
1402
|
+
* @param clientToken - Client token for authentication
|
|
1403
|
+
*/
|
|
1404
|
+
getCompanyQuestions(companyId: number, detailGroupId: number, clientToken: string): Promise<ApiResponse<BookingLabGetQuestionsResponse>>;
|
|
1275
1405
|
}
|
|
1276
1406
|
/**
|
|
1277
1407
|
* Create a new BookingLab client instance
|
|
@@ -1682,5 +1812,35 @@ declare function useBookingLabConfig(request: BookingLabConfigRequest, clientTok
|
|
|
1682
1812
|
* @param enabled - Whether the query should run
|
|
1683
1813
|
*/
|
|
1684
1814
|
declare function useBookingLabGetToken(request: BookingLabGetTokenRequest, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabGetTokenResponse, Error>;
|
|
1815
|
+
/**
|
|
1816
|
+
* Hook for fetching services for a company (BookingLab)
|
|
1817
|
+
* @param companyId - The company ID
|
|
1818
|
+
* @param clientToken - Client token for authentication
|
|
1819
|
+
* @param enabled - Whether the query should run
|
|
1820
|
+
*/
|
|
1821
|
+
declare function useBookingLabServices(companyId: number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabGetServicesResponse, Error>;
|
|
1822
|
+
/**
|
|
1823
|
+
* Hook for fetching a single service for a company by ID (BookingLab)
|
|
1824
|
+
* @param companyId - The company ID
|
|
1825
|
+
* @param serviceId - The service ID
|
|
1826
|
+
* @param clientToken - Client token for authentication
|
|
1827
|
+
* @param enabled - Whether the query should run
|
|
1828
|
+
*/
|
|
1829
|
+
declare function useBookingLabService(companyId: number, serviceId: number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabService, Error>;
|
|
1830
|
+
/**
|
|
1831
|
+
* Hook for fetching all companies (BookingLab)
|
|
1832
|
+
* @param clientToken - Client token for authentication
|
|
1833
|
+
* @param params - Optional query params (service_id, person_id)
|
|
1834
|
+
* @param enabled - Whether the query should run
|
|
1835
|
+
*/
|
|
1836
|
+
declare function useBookingLabCompanies(clientToken: string, params?: BookingLabGetCompaniesParams, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabGetCompaniesResponse, Error>;
|
|
1837
|
+
/**
|
|
1838
|
+
* Hook for fetching questions for a company by detail group (BookingLab)
|
|
1839
|
+
* @param companyId - The company ID
|
|
1840
|
+
* @param detailGroupId - The detail group ID
|
|
1841
|
+
* @param clientToken - Client token for authentication
|
|
1842
|
+
* @param enabled - Whether the query should run
|
|
1843
|
+
*/
|
|
1844
|
+
declare function useBookingLabQuestions(companyId: number, detailGroupId: number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabGetQuestionsResponse, Error>;
|
|
1685
1845
|
|
|
1686
|
-
export { type AddBasketItemRequest, type AddServiceItemAssets, type AddServiceItemQuestion, type AddServiceItemRequest, ApiClient, type ApiClientConfig, ApiClientContext, ApiClientProvider, type ApiError, type ApiResponse, type AvailabilityTime, type AvailabilityTimesResponse, type Booking, type BookingAnswer, BookingLabClient, type BookingLabConfigPage, type BookingLabConfigProduct, type BookingLabConfigRequest, type BookingLabConfigResponse, type BookingLabConfigUserJourney, BookingLabContext, type BookingLabForgotPasswordRequest, type BookingLabForgotPasswordResponse, type BookingLabGetTokenRequest, type BookingLabGetTokenResponse, BookingLabProvider, type BookingPaymentItem, type BookingSettings, type CancelBookingRequest, type CancelBookingResponse, type CancelMemberBookingResponse, type CheckoutBasketClient, type CheckoutBasketRequest, type CheckoutBasketResponse, type ChildCompaniesResponse, type ChildCompany, type ChildCompanyAddress, type ChildCompanySettings, type ClearBasketsResponse, type ClientDetailsQuestion, type ClientDetailsResponse, type CompanyResponse, type CompanySettings, type CreateBasketRequest, type CreateBasketResponse, type CreateBookingRequest, type CreateClientRequest, type CreateClientResponse, type DateSlot, type DatesResponse, type FindClientByEmailResponse, type ForgottenPasswordRequest, type ForgottenPasswordResponse, type GetChildCompaniesParams, type GetDatesParams, type GetMemberResponse, type GetQuestionsParams, type GetTimesParams, type JrniBooking, JrniClient, type JrniConfig, JrniContext, JrniProvider, type JrniService, type ListBookingsParams, type ListBookingsResponse, type Location, type LocationsResponse, type LoginRequest, type LoginResponse, type MemberBooking, type MemberBookingsResponse, MemberType, type PersonImage, type PersonImagesResponse, type Question, type QuestionOption, type QuestionsResponse, type RequestOptions, type RescheduleBookingRequest, type RescheduleBookingResponse, type ResetPasswordRequest, type Resource, type ResourceLinks, type ResourcesResponse, type SendCustomEmailRequest, type SendCustomEmailResponse, type Service, type ServiceItemResponse, type ServicesResponse, type TimeSlot, type TimesResponse, type UpdateClientAnswer, type UpdateClientAnswerEntry, type UpdateClientDetailsData, type UpdateClientExtraInfo, type UpdateClientNotificationPreferences, type UpdateClientQuestionEntry, type UpdateClientRequest, type UpdateClientResponse, type UpdateMemberDetailsData, type UpdateMemberRequest, type UpdateMemberResponse, type Vehicle, type VehiclesResponse, 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 };
|
|
1846
|
+
export { type AddBasketItemRequest, type AddServiceItemAssets, type AddServiceItemQuestion, type AddServiceItemRequest, ApiClient, type ApiClientConfig, ApiClientContext, ApiClientProvider, type ApiError, type ApiResponse, type AvailabilityTime, type AvailabilityTimesResponse, type Booking, type BookingAnswer, BookingLabClient, type BookingLabCompany, type BookingLabConfigPage, type BookingLabConfigProduct, type BookingLabConfigRequest, type BookingLabConfigResponse, type BookingLabConfigUserJourney, BookingLabContext, type BookingLabForgotPasswordRequest, type BookingLabForgotPasswordResponse, type BookingLabGetCompaniesParams, type BookingLabGetCompaniesResponse, type BookingLabGetQuestionsResponse, type BookingLabGetServicesResponse, type BookingLabGetTokenRequest, type BookingLabGetTokenResponse, BookingLabProvider, type BookingLabQuestion, type BookingLabService, type BookingPaymentItem, type BookingSettings, type CancelBookingRequest, type CancelBookingResponse, type CancelMemberBookingResponse, type CheckoutBasketClient, type CheckoutBasketRequest, type CheckoutBasketResponse, type ChildCompaniesResponse, type ChildCompany, type ChildCompanyAddress, type ChildCompanySettings, type ClearBasketsResponse, type ClientDetailsQuestion, type ClientDetailsResponse, type CompanyResponse, type CompanySettings, type CreateBasketRequest, type CreateBasketResponse, type CreateBookingRequest, type CreateClientRequest, type CreateClientResponse, type DateSlot, type DatesResponse, type FindClientByEmailResponse, type ForgottenPasswordRequest, type ForgottenPasswordResponse, type GetChildCompaniesParams, type GetDatesParams, type GetMemberResponse, type GetQuestionsParams, type GetTimesParams, type JrniBooking, JrniClient, type JrniConfig, JrniContext, JrniProvider, type JrniService, type ListBookingsParams, type ListBookingsResponse, type Location, type LocationsResponse, type LoginRequest, type LoginResponse, type MemberBooking, type MemberBookingsResponse, MemberType, type PersonImage, type PersonImagesResponse, type Question, type QuestionOption, type QuestionsResponse, type RequestOptions, type RescheduleBookingRequest, type RescheduleBookingResponse, type ResetPasswordRequest, type Resource, type ResourceLinks, type ResourcesResponse, type SendCustomEmailRequest, type SendCustomEmailResponse, type Service, type ServiceItemResponse, type ServicesResponse, type TimeSlot, type TimesResponse, type UpdateClientAnswer, type UpdateClientAnswerEntry, type UpdateClientDetailsData, type UpdateClientExtraInfo, type UpdateClientNotificationPreferences, type UpdateClientQuestionEntry, type UpdateClientRequest, type UpdateClientResponse, type UpdateMemberDetailsData, type UpdateMemberRequest, type UpdateMemberResponse, type Vehicle, type VehiclesResponse, 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 };
|
package/dist/index.js
CHANGED
|
@@ -365,6 +365,66 @@ var BookingLabClient = class extends ApiClient {
|
|
|
365
365
|
}
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
+
/**
|
|
369
|
+
* Get services for a company
|
|
370
|
+
* @param companyId - The company ID
|
|
371
|
+
* @param clientToken - Client token for authentication
|
|
372
|
+
*/
|
|
373
|
+
async getCompanyServices(companyId, clientToken) {
|
|
374
|
+
return this.get(
|
|
375
|
+
`/company/${companyId}/services`,
|
|
376
|
+
{
|
|
377
|
+
headers: {
|
|
378
|
+
"clienttoken": clientToken
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Get a single service by ID for a company
|
|
385
|
+
* @param companyId - The company ID
|
|
386
|
+
* @param serviceId - The service ID
|
|
387
|
+
* @param clientToken - Client token for authentication
|
|
388
|
+
*/
|
|
389
|
+
async getCompanyService(companyId, serviceId, clientToken) {
|
|
390
|
+
return this.get(
|
|
391
|
+
`/company/${companyId}/service/${serviceId}`,
|
|
392
|
+
{
|
|
393
|
+
headers: {
|
|
394
|
+
"clienttoken": clientToken
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Get all companies
|
|
401
|
+
* @param clientToken - Client token for authentication
|
|
402
|
+
* @param params - Optional query params (service_id, person_id)
|
|
403
|
+
*/
|
|
404
|
+
async getCompanies(clientToken, params) {
|
|
405
|
+
return this.get("/companies", {
|
|
406
|
+
headers: {
|
|
407
|
+
"clienttoken": clientToken
|
|
408
|
+
},
|
|
409
|
+
params
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Get questions for a company by detail group ID
|
|
414
|
+
* @param companyId - The company ID
|
|
415
|
+
* @param detailGroupId - The detail group ID
|
|
416
|
+
* @param clientToken - Client token for authentication
|
|
417
|
+
*/
|
|
418
|
+
async getCompanyQuestions(companyId, detailGroupId, clientToken) {
|
|
419
|
+
return this.get(
|
|
420
|
+
`/company/${companyId}/questions/${detailGroupId}`,
|
|
421
|
+
{
|
|
422
|
+
headers: {
|
|
423
|
+
"clienttoken": clientToken
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
);
|
|
427
|
+
}
|
|
368
428
|
};
|
|
369
429
|
function createBookingLabClient(baseUrl, authToken, appId) {
|
|
370
430
|
const client = new BookingLabClient({ baseUrl });
|
|
@@ -1115,6 +1175,50 @@ function useBookingLabGetToken(request, clientToken, enabled = true) {
|
|
|
1115
1175
|
enabled: enabled && !!request.client && !!request.company && !!clientToken
|
|
1116
1176
|
});
|
|
1117
1177
|
}
|
|
1178
|
+
function useBookingLabServices(companyId, clientToken, enabled = true) {
|
|
1179
|
+
const client = useBookingLabClient();
|
|
1180
|
+
return reactQuery.useQuery({
|
|
1181
|
+
queryKey: ["bookingLabServices", companyId],
|
|
1182
|
+
queryFn: async () => {
|
|
1183
|
+
const response = await client.getCompanyServices(companyId, clientToken);
|
|
1184
|
+
return response.data;
|
|
1185
|
+
},
|
|
1186
|
+
enabled: enabled && !!companyId && !!clientToken
|
|
1187
|
+
});
|
|
1188
|
+
}
|
|
1189
|
+
function useBookingLabService(companyId, serviceId, clientToken, enabled = true) {
|
|
1190
|
+
const client = useBookingLabClient();
|
|
1191
|
+
return reactQuery.useQuery({
|
|
1192
|
+
queryKey: ["bookingLabService", companyId, serviceId],
|
|
1193
|
+
queryFn: async () => {
|
|
1194
|
+
const response = await client.getCompanyService(companyId, serviceId, clientToken);
|
|
1195
|
+
return response.data;
|
|
1196
|
+
},
|
|
1197
|
+
enabled: enabled && !!companyId && !!serviceId && !!clientToken
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
function useBookingLabCompanies(clientToken, params, enabled = true) {
|
|
1201
|
+
const client = useBookingLabClient();
|
|
1202
|
+
return reactQuery.useQuery({
|
|
1203
|
+
queryKey: ["bookingLabCompanies", params?.service_id, params?.person_id],
|
|
1204
|
+
queryFn: async () => {
|
|
1205
|
+
const response = await client.getCompanies(clientToken, params);
|
|
1206
|
+
return response.data;
|
|
1207
|
+
},
|
|
1208
|
+
enabled: enabled && !!clientToken
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
function useBookingLabQuestions(companyId, detailGroupId, clientToken, enabled = true) {
|
|
1212
|
+
const client = useBookingLabClient();
|
|
1213
|
+
return reactQuery.useQuery({
|
|
1214
|
+
queryKey: ["bookingLabQuestions", companyId, detailGroupId],
|
|
1215
|
+
queryFn: async () => {
|
|
1216
|
+
const response = await client.getCompanyQuestions(companyId, detailGroupId, clientToken);
|
|
1217
|
+
return response.data;
|
|
1218
|
+
},
|
|
1219
|
+
enabled: enabled && !!companyId && !!detailGroupId && !!clientToken
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
1118
1222
|
|
|
1119
1223
|
exports.ApiClient = ApiClient;
|
|
1120
1224
|
exports.ApiClientContext = ApiClientContext;
|
|
@@ -1131,10 +1235,14 @@ exports.createJrniClient = createJrniClient;
|
|
|
1131
1235
|
exports.useAddServiceItem = useAddServiceItem;
|
|
1132
1236
|
exports.useApiClientContext = useApiClientContext;
|
|
1133
1237
|
exports.useBookingLabClient = useBookingLabClient;
|
|
1238
|
+
exports.useBookingLabCompanies = useBookingLabCompanies;
|
|
1134
1239
|
exports.useBookingLabConfig = useBookingLabConfig;
|
|
1135
1240
|
exports.useBookingLabContext = useBookingLabContext;
|
|
1136
1241
|
exports.useBookingLabForgotPassword = useBookingLabForgotPassword;
|
|
1137
1242
|
exports.useBookingLabGetToken = useBookingLabGetToken;
|
|
1243
|
+
exports.useBookingLabQuestions = useBookingLabQuestions;
|
|
1244
|
+
exports.useBookingLabService = useBookingLabService;
|
|
1245
|
+
exports.useBookingLabServices = useBookingLabServices;
|
|
1138
1246
|
exports.useCancelBooking = useCancelBooking;
|
|
1139
1247
|
exports.useCancelMemberBooking = useCancelMemberBooking;
|
|
1140
1248
|
exports.useCheckoutBasket = useCheckoutBasket;
|