@bookinglab/booking-journey-api 2.17.0 → 2.18.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 +31 -7
- package/dist/index.d.ts +31 -7
- package/dist/index.js +70 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +70 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1579,6 +1579,12 @@ interface OrdnanceAddressResult {
|
|
|
1579
1579
|
interface OrdnanceAddressLookupResponse {
|
|
1580
1580
|
results: OrdnanceAddressResult[];
|
|
1581
1581
|
}
|
|
1582
|
+
/**
|
|
1583
|
+
* BookingLab OS Places service status
|
|
1584
|
+
*/
|
|
1585
|
+
interface OsPlacesStatusResponse {
|
|
1586
|
+
status: boolean;
|
|
1587
|
+
}
|
|
1582
1588
|
/**
|
|
1583
1589
|
* BookingLab Get Purchase
|
|
1584
1590
|
*/
|
|
@@ -1863,8 +1869,9 @@ declare class BookingLabClient extends ApiClient {
|
|
|
1863
1869
|
* Get services for a company
|
|
1864
1870
|
* @param companyId - The company ID
|
|
1865
1871
|
* @param clientToken - Client token for authentication
|
|
1872
|
+
* @param bypassCacheToken - Optional. When provided, sent as `X-Bypass-Cache` header
|
|
1866
1873
|
*/
|
|
1867
|
-
getCompanyServices(companyId: number, clientToken: string): Promise<ApiResponse<BookingLabGetServicesResponse>>;
|
|
1874
|
+
getCompanyServices(companyId: number, clientToken: string, bypassCacheToken?: string): Promise<ApiResponse<BookingLabGetServicesResponse>>;
|
|
1868
1875
|
/**
|
|
1869
1876
|
* Get a single service by ID for a company
|
|
1870
1877
|
* @param companyId - The company ID
|
|
@@ -1948,9 +1955,10 @@ declare class BookingLabClient extends ApiClient {
|
|
|
1948
1955
|
* List bookings for a company
|
|
1949
1956
|
* @param companyId - The company ID
|
|
1950
1957
|
* @param clientToken - Client token for authentication
|
|
1951
|
-
* @param params - Optional query params (client_id, member_id)
|
|
1958
|
+
* @param params - Optional query params (client_id, member_id, start_date, end_date)
|
|
1959
|
+
* @param bypassCacheToken - Optional. When provided, sent as `X-Bypass-Cache` header
|
|
1952
1960
|
*/
|
|
1953
|
-
listBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams): Promise<ApiResponse<BookingLabListBookingsResponse>>;
|
|
1961
|
+
listBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams, bypassCacheToken?: string): Promise<ApiResponse<BookingLabListBookingsResponse>>;
|
|
1954
1962
|
/**
|
|
1955
1963
|
* Update a booking for a company
|
|
1956
1964
|
* @param companyId - The company ID
|
|
@@ -1959,6 +1967,13 @@ declare class BookingLabClient extends ApiClient {
|
|
|
1959
1967
|
* @param clientToken - Client token for authentication
|
|
1960
1968
|
*/
|
|
1961
1969
|
updateBookinglabBooking(companyId: number, bookingId: number, request: BookingLabUpdateBookingRequest, clientToken: string): Promise<ApiResponse<BookingLabUpdateBookingResponse>>;
|
|
1970
|
+
/**
|
|
1971
|
+
* Get OS Places service status (BookingLab).
|
|
1972
|
+
* Calls the absolute serviceStatus endpoint on staging.bookinglab.co.uk.
|
|
1973
|
+
* @param token - Value for the X-BL-TOKEN header
|
|
1974
|
+
* @param isStaging - When true, hits the `osplaces-staging` variant
|
|
1975
|
+
*/
|
|
1976
|
+
getOsPlacesStatus(token: string, isStaging?: boolean): Promise<ApiResponse<OsPlacesStatusResponse>>;
|
|
1962
1977
|
}
|
|
1963
1978
|
/**
|
|
1964
1979
|
* Create a new BookingLab client instance
|
|
@@ -2374,8 +2389,9 @@ declare function useBookingLabGetToken(request: BookingLabGetTokenRequest, clien
|
|
|
2374
2389
|
* @param companyId - The company ID
|
|
2375
2390
|
* @param clientToken - Client token for authentication
|
|
2376
2391
|
* @param enabled - Whether the query should run
|
|
2392
|
+
* @param bypassCacheToken - Optional. Sent as `X-Bypass-Cache` header when provided
|
|
2377
2393
|
*/
|
|
2378
|
-
declare function useBookingLabServices(companyId: number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabGetServicesResponse, Error>;
|
|
2394
|
+
declare function useBookingLabServices(companyId: number, clientToken: string, enabled?: boolean, bypassCacheToken?: string): _tanstack_react_query.UseQueryResult<BookingLabGetServicesResponse, Error>;
|
|
2379
2395
|
/**
|
|
2380
2396
|
* Hook for fetching a single service for a company by ID (BookingLab)
|
|
2381
2397
|
* @param companyId - The company ID
|
|
@@ -2447,10 +2463,11 @@ declare function useOrdnanceAddressLookup(postcode: string, clientToken: string,
|
|
|
2447
2463
|
* Hook for listing bookings for a company (BookingLab)
|
|
2448
2464
|
* @param companyId - The company ID
|
|
2449
2465
|
* @param clientToken - Client token for authentication
|
|
2450
|
-
* @param params - Optional query params (client_id, member_id)
|
|
2466
|
+
* @param params - Optional query params (client_id, member_id, start_date, end_date)
|
|
2451
2467
|
* @param enabled - Whether the query should run
|
|
2468
|
+
* @param bypassCacheToken - Optional. Sent as `X-Bypass-Cache` header when provided
|
|
2452
2469
|
*/
|
|
2453
|
-
declare function useListBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabListBookingsResponse, Error>;
|
|
2470
|
+
declare function useListBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams, enabled?: boolean, bypassCacheToken?: string): _tanstack_react_query.UseQueryResult<BookingLabListBookingsResponse, Error>;
|
|
2454
2471
|
/**
|
|
2455
2472
|
* Hook for fetching a purchase by ID (BookingLab)
|
|
2456
2473
|
* @param companyId - The company ID
|
|
@@ -2464,5 +2481,12 @@ declare function useGetPurchase(companyId: number, serviceId: number, purchaseId
|
|
|
2464
2481
|
* Hook for updating a booking (BookingLab)
|
|
2465
2482
|
*/
|
|
2466
2483
|
declare function useUpdateBookinglabBooking(companyId: number, bookingId: number, clientToken: string): _tanstack_react_query.UseMutationResult<BookingLabUpdateBookingResponse, Error, BookingLabUpdateBookingRequest, unknown>;
|
|
2484
|
+
/**
|
|
2485
|
+
* Hook for checking the OS Places service status (BookingLab)
|
|
2486
|
+
* @param token - Value for the X-BL-TOKEN header
|
|
2487
|
+
* @param isStaging - When true, queries the `osplaces-staging` endpoint
|
|
2488
|
+
* @param enabled - Whether the query should run
|
|
2489
|
+
*/
|
|
2490
|
+
declare function useOsPlacesStatus(token: string, isStaging?: boolean, enabled?: boolean): _tanstack_react_query.UseQueryResult<OsPlacesStatusResponse, Error>;
|
|
2467
2491
|
|
|
2468
|
-
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, type BookingLabAddBasketServiceItemHeaders, type BookingLabAddBasketServiceItemQuestion, type BookingLabAddBasketServiceItemRequest, type BookingLabAddBasketServiceItemResponse, type BookingLabCheckoutBasketBooking, type BookingLabCheckoutBasketEmbeddedClient, type BookingLabCheckoutBasketEmbeddedMember, type BookingLabCheckoutBasketHeaders, type BookingLabCheckoutBasketRequest, type BookingLabCheckoutBasketResponse, BookingLabClient, type BookingLabCompany, type BookingLabConfigPage, type BookingLabConfigProduct, type BookingLabConfigRequest, type BookingLabConfigResponse, type BookingLabConfigUserJourney, BookingLabContext, type BookingLabCreateBasketHeaders, type BookingLabCreateBasketRequest, type BookingLabCreateBasketResponse, type BookingLabDay, type BookingLabDeleteBasketHeaders, type BookingLabDeleteBasketResponse, type BookingLabForgotPasswordRequest, type BookingLabForgotPasswordResponse, type BookingLabGetCompaniesParams, type BookingLabGetCompaniesResponse, type BookingLabGetDaysParams, type BookingLabGetDaysResponse, type BookingLabGetQuestionsResponse, type BookingLabGetServicesResponse, type BookingLabGetTimesParams, type BookingLabGetTimesResponse, type BookingLabGetTokenRequest, type BookingLabGetTokenResponse, type BookingLabHeldAsset, type BookingLabListBookingsParams, type BookingLabListBookingsResponse, BookingLabProvider, type BookingLabPurchaseEmbedded, type BookingLabPurchaseRefund, type BookingLabPurchaseResponse, type BookingLabQuestion, type BookingLabService, type BookingLabTime, type BookingLabUpdateBookingClient, type BookingLabUpdateBookingRequest, type BookingLabUpdateBookingResponse, 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 OrdnanceAddressDPA, type OrdnanceAddressLPI, type OrdnanceAddressLookupResponse, type OrdnanceAddressResult, 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, 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, useUpdateBookinglabBooking, useUpdateClient, useUpdateMember };
|
|
2492
|
+
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, type BookingLabAddBasketServiceItemHeaders, type BookingLabAddBasketServiceItemQuestion, type BookingLabAddBasketServiceItemRequest, type BookingLabAddBasketServiceItemResponse, type BookingLabCheckoutBasketBooking, type BookingLabCheckoutBasketEmbeddedClient, type BookingLabCheckoutBasketEmbeddedMember, type BookingLabCheckoutBasketHeaders, type BookingLabCheckoutBasketRequest, type BookingLabCheckoutBasketResponse, BookingLabClient, type BookingLabCompany, type BookingLabConfigPage, type BookingLabConfigProduct, type BookingLabConfigRequest, type BookingLabConfigResponse, type BookingLabConfigUserJourney, BookingLabContext, type BookingLabCreateBasketHeaders, type BookingLabCreateBasketRequest, type BookingLabCreateBasketResponse, type BookingLabDay, type BookingLabDeleteBasketHeaders, type BookingLabDeleteBasketResponse, type BookingLabForgotPasswordRequest, type BookingLabForgotPasswordResponse, type BookingLabGetCompaniesParams, type BookingLabGetCompaniesResponse, type BookingLabGetDaysParams, type BookingLabGetDaysResponse, type BookingLabGetQuestionsResponse, type BookingLabGetServicesResponse, type BookingLabGetTimesParams, type BookingLabGetTimesResponse, type BookingLabGetTokenRequest, type BookingLabGetTokenResponse, type BookingLabHeldAsset, type BookingLabListBookingsParams, type BookingLabListBookingsResponse, BookingLabProvider, type BookingLabPurchaseEmbedded, type BookingLabPurchaseRefund, type BookingLabPurchaseResponse, type BookingLabQuestion, type BookingLabService, type BookingLabTime, type BookingLabUpdateBookingClient, type BookingLabUpdateBookingRequest, type BookingLabUpdateBookingResponse, 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 OrdnanceAddressDPA, type OrdnanceAddressLPI, type OrdnanceAddressLookupResponse, type OrdnanceAddressResult, type OsPlacesStatusResponse, 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, 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, useOsPlacesStatus, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateBookinglabBooking, useUpdateClient, useUpdateMember };
|
package/dist/index.d.ts
CHANGED
|
@@ -1579,6 +1579,12 @@ interface OrdnanceAddressResult {
|
|
|
1579
1579
|
interface OrdnanceAddressLookupResponse {
|
|
1580
1580
|
results: OrdnanceAddressResult[];
|
|
1581
1581
|
}
|
|
1582
|
+
/**
|
|
1583
|
+
* BookingLab OS Places service status
|
|
1584
|
+
*/
|
|
1585
|
+
interface OsPlacesStatusResponse {
|
|
1586
|
+
status: boolean;
|
|
1587
|
+
}
|
|
1582
1588
|
/**
|
|
1583
1589
|
* BookingLab Get Purchase
|
|
1584
1590
|
*/
|
|
@@ -1863,8 +1869,9 @@ declare class BookingLabClient extends ApiClient {
|
|
|
1863
1869
|
* Get services for a company
|
|
1864
1870
|
* @param companyId - The company ID
|
|
1865
1871
|
* @param clientToken - Client token for authentication
|
|
1872
|
+
* @param bypassCacheToken - Optional. When provided, sent as `X-Bypass-Cache` header
|
|
1866
1873
|
*/
|
|
1867
|
-
getCompanyServices(companyId: number, clientToken: string): Promise<ApiResponse<BookingLabGetServicesResponse>>;
|
|
1874
|
+
getCompanyServices(companyId: number, clientToken: string, bypassCacheToken?: string): Promise<ApiResponse<BookingLabGetServicesResponse>>;
|
|
1868
1875
|
/**
|
|
1869
1876
|
* Get a single service by ID for a company
|
|
1870
1877
|
* @param companyId - The company ID
|
|
@@ -1948,9 +1955,10 @@ declare class BookingLabClient extends ApiClient {
|
|
|
1948
1955
|
* List bookings for a company
|
|
1949
1956
|
* @param companyId - The company ID
|
|
1950
1957
|
* @param clientToken - Client token for authentication
|
|
1951
|
-
* @param params - Optional query params (client_id, member_id)
|
|
1958
|
+
* @param params - Optional query params (client_id, member_id, start_date, end_date)
|
|
1959
|
+
* @param bypassCacheToken - Optional. When provided, sent as `X-Bypass-Cache` header
|
|
1952
1960
|
*/
|
|
1953
|
-
listBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams): Promise<ApiResponse<BookingLabListBookingsResponse>>;
|
|
1961
|
+
listBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams, bypassCacheToken?: string): Promise<ApiResponse<BookingLabListBookingsResponse>>;
|
|
1954
1962
|
/**
|
|
1955
1963
|
* Update a booking for a company
|
|
1956
1964
|
* @param companyId - The company ID
|
|
@@ -1959,6 +1967,13 @@ declare class BookingLabClient extends ApiClient {
|
|
|
1959
1967
|
* @param clientToken - Client token for authentication
|
|
1960
1968
|
*/
|
|
1961
1969
|
updateBookinglabBooking(companyId: number, bookingId: number, request: BookingLabUpdateBookingRequest, clientToken: string): Promise<ApiResponse<BookingLabUpdateBookingResponse>>;
|
|
1970
|
+
/**
|
|
1971
|
+
* Get OS Places service status (BookingLab).
|
|
1972
|
+
* Calls the absolute serviceStatus endpoint on staging.bookinglab.co.uk.
|
|
1973
|
+
* @param token - Value for the X-BL-TOKEN header
|
|
1974
|
+
* @param isStaging - When true, hits the `osplaces-staging` variant
|
|
1975
|
+
*/
|
|
1976
|
+
getOsPlacesStatus(token: string, isStaging?: boolean): Promise<ApiResponse<OsPlacesStatusResponse>>;
|
|
1962
1977
|
}
|
|
1963
1978
|
/**
|
|
1964
1979
|
* Create a new BookingLab client instance
|
|
@@ -2374,8 +2389,9 @@ declare function useBookingLabGetToken(request: BookingLabGetTokenRequest, clien
|
|
|
2374
2389
|
* @param companyId - The company ID
|
|
2375
2390
|
* @param clientToken - Client token for authentication
|
|
2376
2391
|
* @param enabled - Whether the query should run
|
|
2392
|
+
* @param bypassCacheToken - Optional. Sent as `X-Bypass-Cache` header when provided
|
|
2377
2393
|
*/
|
|
2378
|
-
declare function useBookingLabServices(companyId: number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabGetServicesResponse, Error>;
|
|
2394
|
+
declare function useBookingLabServices(companyId: number, clientToken: string, enabled?: boolean, bypassCacheToken?: string): _tanstack_react_query.UseQueryResult<BookingLabGetServicesResponse, Error>;
|
|
2379
2395
|
/**
|
|
2380
2396
|
* Hook for fetching a single service for a company by ID (BookingLab)
|
|
2381
2397
|
* @param companyId - The company ID
|
|
@@ -2447,10 +2463,11 @@ declare function useOrdnanceAddressLookup(postcode: string, clientToken: string,
|
|
|
2447
2463
|
* Hook for listing bookings for a company (BookingLab)
|
|
2448
2464
|
* @param companyId - The company ID
|
|
2449
2465
|
* @param clientToken - Client token for authentication
|
|
2450
|
-
* @param params - Optional query params (client_id, member_id)
|
|
2466
|
+
* @param params - Optional query params (client_id, member_id, start_date, end_date)
|
|
2451
2467
|
* @param enabled - Whether the query should run
|
|
2468
|
+
* @param bypassCacheToken - Optional. Sent as `X-Bypass-Cache` header when provided
|
|
2452
2469
|
*/
|
|
2453
|
-
declare function useListBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabListBookingsResponse, Error>;
|
|
2470
|
+
declare function useListBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams, enabled?: boolean, bypassCacheToken?: string): _tanstack_react_query.UseQueryResult<BookingLabListBookingsResponse, Error>;
|
|
2454
2471
|
/**
|
|
2455
2472
|
* Hook for fetching a purchase by ID (BookingLab)
|
|
2456
2473
|
* @param companyId - The company ID
|
|
@@ -2464,5 +2481,12 @@ declare function useGetPurchase(companyId: number, serviceId: number, purchaseId
|
|
|
2464
2481
|
* Hook for updating a booking (BookingLab)
|
|
2465
2482
|
*/
|
|
2466
2483
|
declare function useUpdateBookinglabBooking(companyId: number, bookingId: number, clientToken: string): _tanstack_react_query.UseMutationResult<BookingLabUpdateBookingResponse, Error, BookingLabUpdateBookingRequest, unknown>;
|
|
2484
|
+
/**
|
|
2485
|
+
* Hook for checking the OS Places service status (BookingLab)
|
|
2486
|
+
* @param token - Value for the X-BL-TOKEN header
|
|
2487
|
+
* @param isStaging - When true, queries the `osplaces-staging` endpoint
|
|
2488
|
+
* @param enabled - Whether the query should run
|
|
2489
|
+
*/
|
|
2490
|
+
declare function useOsPlacesStatus(token: string, isStaging?: boolean, enabled?: boolean): _tanstack_react_query.UseQueryResult<OsPlacesStatusResponse, Error>;
|
|
2467
2491
|
|
|
2468
|
-
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, type BookingLabAddBasketServiceItemHeaders, type BookingLabAddBasketServiceItemQuestion, type BookingLabAddBasketServiceItemRequest, type BookingLabAddBasketServiceItemResponse, type BookingLabCheckoutBasketBooking, type BookingLabCheckoutBasketEmbeddedClient, type BookingLabCheckoutBasketEmbeddedMember, type BookingLabCheckoutBasketHeaders, type BookingLabCheckoutBasketRequest, type BookingLabCheckoutBasketResponse, BookingLabClient, type BookingLabCompany, type BookingLabConfigPage, type BookingLabConfigProduct, type BookingLabConfigRequest, type BookingLabConfigResponse, type BookingLabConfigUserJourney, BookingLabContext, type BookingLabCreateBasketHeaders, type BookingLabCreateBasketRequest, type BookingLabCreateBasketResponse, type BookingLabDay, type BookingLabDeleteBasketHeaders, type BookingLabDeleteBasketResponse, type BookingLabForgotPasswordRequest, type BookingLabForgotPasswordResponse, type BookingLabGetCompaniesParams, type BookingLabGetCompaniesResponse, type BookingLabGetDaysParams, type BookingLabGetDaysResponse, type BookingLabGetQuestionsResponse, type BookingLabGetServicesResponse, type BookingLabGetTimesParams, type BookingLabGetTimesResponse, type BookingLabGetTokenRequest, type BookingLabGetTokenResponse, type BookingLabHeldAsset, type BookingLabListBookingsParams, type BookingLabListBookingsResponse, BookingLabProvider, type BookingLabPurchaseEmbedded, type BookingLabPurchaseRefund, type BookingLabPurchaseResponse, type BookingLabQuestion, type BookingLabService, type BookingLabTime, type BookingLabUpdateBookingClient, type BookingLabUpdateBookingRequest, type BookingLabUpdateBookingResponse, 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 OrdnanceAddressDPA, type OrdnanceAddressLPI, type OrdnanceAddressLookupResponse, type OrdnanceAddressResult, 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, 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, useUpdateBookinglabBooking, useUpdateClient, useUpdateMember };
|
|
2492
|
+
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, type BookingLabAddBasketServiceItemHeaders, type BookingLabAddBasketServiceItemQuestion, type BookingLabAddBasketServiceItemRequest, type BookingLabAddBasketServiceItemResponse, type BookingLabCheckoutBasketBooking, type BookingLabCheckoutBasketEmbeddedClient, type BookingLabCheckoutBasketEmbeddedMember, type BookingLabCheckoutBasketHeaders, type BookingLabCheckoutBasketRequest, type BookingLabCheckoutBasketResponse, BookingLabClient, type BookingLabCompany, type BookingLabConfigPage, type BookingLabConfigProduct, type BookingLabConfigRequest, type BookingLabConfigResponse, type BookingLabConfigUserJourney, BookingLabContext, type BookingLabCreateBasketHeaders, type BookingLabCreateBasketRequest, type BookingLabCreateBasketResponse, type BookingLabDay, type BookingLabDeleteBasketHeaders, type BookingLabDeleteBasketResponse, type BookingLabForgotPasswordRequest, type BookingLabForgotPasswordResponse, type BookingLabGetCompaniesParams, type BookingLabGetCompaniesResponse, type BookingLabGetDaysParams, type BookingLabGetDaysResponse, type BookingLabGetQuestionsResponse, type BookingLabGetServicesResponse, type BookingLabGetTimesParams, type BookingLabGetTimesResponse, type BookingLabGetTokenRequest, type BookingLabGetTokenResponse, type BookingLabHeldAsset, type BookingLabListBookingsParams, type BookingLabListBookingsResponse, BookingLabProvider, type BookingLabPurchaseEmbedded, type BookingLabPurchaseRefund, type BookingLabPurchaseResponse, type BookingLabQuestion, type BookingLabService, type BookingLabTime, type BookingLabUpdateBookingClient, type BookingLabUpdateBookingRequest, type BookingLabUpdateBookingResponse, 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 OrdnanceAddressDPA, type OrdnanceAddressLPI, type OrdnanceAddressLookupResponse, type OrdnanceAddressResult, type OsPlacesStatusResponse, 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, 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, useOsPlacesStatus, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateBookinglabBooking, useUpdateClient, useUpdateMember };
|
package/dist/index.js
CHANGED
|
@@ -369,15 +369,16 @@ var BookingLabClient = class extends ApiClient {
|
|
|
369
369
|
* Get services for a company
|
|
370
370
|
* @param companyId - The company ID
|
|
371
371
|
* @param clientToken - Client token for authentication
|
|
372
|
+
* @param bypassCacheToken - Optional. When provided, sent as `X-Bypass-Cache` header
|
|
372
373
|
*/
|
|
373
|
-
async getCompanyServices(companyId, clientToken) {
|
|
374
|
+
async getCompanyServices(companyId, clientToken, bypassCacheToken) {
|
|
375
|
+
const headers = {
|
|
376
|
+
"clienttoken": clientToken
|
|
377
|
+
};
|
|
378
|
+
if (bypassCacheToken) headers["X-Bypass-Cache"] = bypassCacheToken;
|
|
374
379
|
return this.get(
|
|
375
380
|
`/company/${companyId}/services`,
|
|
376
|
-
{
|
|
377
|
-
headers: {
|
|
378
|
-
"clienttoken": clientToken
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
+
{ headers }
|
|
381
382
|
);
|
|
382
383
|
}
|
|
383
384
|
/**
|
|
@@ -569,22 +570,25 @@ var BookingLabClient = class extends ApiClient {
|
|
|
569
570
|
* List bookings for a company
|
|
570
571
|
* @param companyId - The company ID
|
|
571
572
|
* @param clientToken - Client token for authentication
|
|
572
|
-
* @param params - Optional query params (client_id, member_id)
|
|
573
|
+
* @param params - Optional query params (client_id, member_id, start_date, end_date)
|
|
574
|
+
* @param bypassCacheToken - Optional. When provided, sent as `X-Bypass-Cache` header
|
|
573
575
|
*/
|
|
574
|
-
async listBookinglabBookings(companyId, clientToken, params) {
|
|
576
|
+
async listBookinglabBookings(companyId, clientToken, params, bypassCacheToken) {
|
|
575
577
|
const queryParams = {};
|
|
576
578
|
if (params?.client_id !== void 0) queryParams.client_id = params.client_id;
|
|
577
579
|
if (params?.member_id !== void 0) queryParams.member_id = params.member_id;
|
|
578
580
|
if (params?.start_date !== void 0) queryParams.start_date = params.start_date;
|
|
579
581
|
if (params?.end_date !== void 0) queryParams.end_date = params.end_date;
|
|
582
|
+
const headers = {
|
|
583
|
+
"clienttoken": clientToken,
|
|
584
|
+
"x-company-id": String(companyId)
|
|
585
|
+
};
|
|
586
|
+
if (bypassCacheToken) headers["X-Bypass-Cache"] = bypassCacheToken;
|
|
580
587
|
return this.get(
|
|
581
588
|
`/company/${companyId}/bookings`,
|
|
582
589
|
{
|
|
583
590
|
params: Object.keys(queryParams).length ? queryParams : void 0,
|
|
584
|
-
headers
|
|
585
|
-
"clienttoken": clientToken,
|
|
586
|
-
"x-company-id": String(companyId)
|
|
587
|
-
}
|
|
591
|
+
headers
|
|
588
592
|
}
|
|
589
593
|
);
|
|
590
594
|
}
|
|
@@ -607,6 +611,42 @@ var BookingLabClient = class extends ApiClient {
|
|
|
607
611
|
}
|
|
608
612
|
);
|
|
609
613
|
}
|
|
614
|
+
/**
|
|
615
|
+
* Get OS Places service status (BookingLab).
|
|
616
|
+
* Calls the absolute serviceStatus endpoint on staging.bookinglab.co.uk.
|
|
617
|
+
* @param token - Value for the X-BL-TOKEN header
|
|
618
|
+
* @param isStaging - When true, hits the `osplaces-staging` variant
|
|
619
|
+
*/
|
|
620
|
+
async getOsPlacesStatus(token, isStaging = false) {
|
|
621
|
+
const url = `https://staging.bookinglab.co.uk/serviceStatus/osplaces${isStaging ? "-staging" : ""}`;
|
|
622
|
+
const controller = new AbortController();
|
|
623
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
624
|
+
try {
|
|
625
|
+
const response = await fetch(url, {
|
|
626
|
+
method: "GET",
|
|
627
|
+
headers: {
|
|
628
|
+
"Content-Type": "application/json",
|
|
629
|
+
"X-BL-TOKEN": token
|
|
630
|
+
},
|
|
631
|
+
signal: controller.signal
|
|
632
|
+
});
|
|
633
|
+
clearTimeout(timeoutId);
|
|
634
|
+
if (!response.ok) {
|
|
635
|
+
throw {
|
|
636
|
+
message: `HTTP ${response.status}: ${response.statusText}`,
|
|
637
|
+
status: response.status
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
const data = await response.json();
|
|
641
|
+
return { data, status: response.status, headers: response.headers };
|
|
642
|
+
} catch (error) {
|
|
643
|
+
clearTimeout(timeoutId);
|
|
644
|
+
if (error.name === "AbortError") {
|
|
645
|
+
throw { message: "Request timeout", code: "TIMEOUT" };
|
|
646
|
+
}
|
|
647
|
+
throw error;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
610
650
|
};
|
|
611
651
|
function createBookingLabClient(baseUrl, authToken, appId) {
|
|
612
652
|
const client = new BookingLabClient({ baseUrl });
|
|
@@ -1357,12 +1397,12 @@ function useBookingLabGetToken(request, clientToken, enabled = true) {
|
|
|
1357
1397
|
enabled: enabled && !!request.client && !!request.company && !!clientToken
|
|
1358
1398
|
});
|
|
1359
1399
|
}
|
|
1360
|
-
function useBookingLabServices(companyId, clientToken, enabled = true) {
|
|
1400
|
+
function useBookingLabServices(companyId, clientToken, enabled = true, bypassCacheToken) {
|
|
1361
1401
|
const client = useBookingLabClient();
|
|
1362
1402
|
return reactQuery.useQuery({
|
|
1363
|
-
queryKey: ["bookingLabServices", companyId],
|
|
1403
|
+
queryKey: ["bookingLabServices", companyId, bypassCacheToken],
|
|
1364
1404
|
queryFn: async () => {
|
|
1365
|
-
const response = await client.getCompanyServices(companyId, clientToken);
|
|
1405
|
+
const response = await client.getCompanyServices(companyId, clientToken, bypassCacheToken);
|
|
1366
1406
|
return response.data;
|
|
1367
1407
|
},
|
|
1368
1408
|
enabled: enabled && !!companyId && !!clientToken
|
|
@@ -1470,12 +1510,12 @@ function useOrdnanceAddressLookup(postcode, clientToken, enabled = true) {
|
|
|
1470
1510
|
enabled: enabled && !!postcode && !!clientToken
|
|
1471
1511
|
});
|
|
1472
1512
|
}
|
|
1473
|
-
function useListBookinglabBookings(companyId, clientToken, params, enabled = true) {
|
|
1513
|
+
function useListBookinglabBookings(companyId, clientToken, params, enabled = true, bypassCacheToken) {
|
|
1474
1514
|
const client = useBookingLabClient();
|
|
1475
1515
|
return reactQuery.useQuery({
|
|
1476
|
-
queryKey: ["bookingLabListBookings", companyId, params?.client_id, params?.member_id, params?.start_date, params?.end_date],
|
|
1516
|
+
queryKey: ["bookingLabListBookings", companyId, params?.client_id, params?.member_id, params?.start_date, params?.end_date, bypassCacheToken],
|
|
1477
1517
|
queryFn: async () => {
|
|
1478
|
-
const response = await client.listBookinglabBookings(companyId, clientToken, params);
|
|
1518
|
+
const response = await client.listBookinglabBookings(companyId, clientToken, params, bypassCacheToken);
|
|
1479
1519
|
return response.data;
|
|
1480
1520
|
},
|
|
1481
1521
|
enabled: enabled && !!companyId && !!clientToken
|
|
@@ -1501,6 +1541,17 @@ function useUpdateBookinglabBooking(companyId, bookingId, clientToken) {
|
|
|
1501
1541
|
}
|
|
1502
1542
|
});
|
|
1503
1543
|
}
|
|
1544
|
+
function useOsPlacesStatus(token, isStaging = false, enabled = true) {
|
|
1545
|
+
const client = useBookingLabClient();
|
|
1546
|
+
return reactQuery.useQuery({
|
|
1547
|
+
queryKey: ["osPlacesStatus", isStaging],
|
|
1548
|
+
queryFn: async () => {
|
|
1549
|
+
const response = await client.getOsPlacesStatus(token, isStaging);
|
|
1550
|
+
return response.data;
|
|
1551
|
+
},
|
|
1552
|
+
enabled: enabled && !!token
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1504
1555
|
|
|
1505
1556
|
exports.ApiClient = ApiClient;
|
|
1506
1557
|
exports.ApiClientContext = ApiClientContext;
|
|
@@ -1551,6 +1602,7 @@ exports.useListBookinglabBookings = useListBookinglabBookings;
|
|
|
1551
1602
|
exports.useListBookings = useListBookings;
|
|
1552
1603
|
exports.useLogin = useLogin;
|
|
1553
1604
|
exports.useOrdnanceAddressLookup = useOrdnanceAddressLookup;
|
|
1605
|
+
exports.useOsPlacesStatus = useOsPlacesStatus;
|
|
1554
1606
|
exports.useQuestions = useQuestions;
|
|
1555
1607
|
exports.useRescheduleBooking = useRescheduleBooking;
|
|
1556
1608
|
exports.useResetPassword = useResetPassword;
|