@bookinglab/booking-journey-api 2.16.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 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
  */
@@ -1646,6 +1652,65 @@ interface BookingLabListBookingsResponse {
1646
1652
  _links?: Record<string, any>;
1647
1653
  [key: string]: any;
1648
1654
  }
1655
+ interface BookingLabUpdateBookingClient {
1656
+ first_name?: string;
1657
+ first_name_extra?: string;
1658
+ last_name?: string;
1659
+ last_name_extra?: string;
1660
+ email?: string;
1661
+ mobile_prefix?: string;
1662
+ mobile?: string;
1663
+ mobile_prefix_country_code?: string;
1664
+ phone_prefix?: string;
1665
+ phone?: string;
1666
+ phone_prefix_country_code?: string;
1667
+ address1?: string;
1668
+ address2?: string;
1669
+ address3?: string;
1670
+ address4?: string;
1671
+ address5?: string;
1672
+ postcode?: string;
1673
+ country?: string;
1674
+ member_type?: number;
1675
+ member_level_id?: number;
1676
+ mem_join_date?: string;
1677
+ time_zone?: string;
1678
+ consent?: boolean;
1679
+ [key: string]: any;
1680
+ }
1681
+ interface BookingLabUpdateBookingRequest {
1682
+ datetime?: string;
1683
+ duration?: number;
1684
+ person_id?: number;
1685
+ resource_id?: number;
1686
+ service_id?: number;
1687
+ status?: string;
1688
+ position?: number;
1689
+ price?: number;
1690
+ paid?: number;
1691
+ time_zone?: string;
1692
+ email?: boolean;
1693
+ email_owner?: boolean;
1694
+ attended?: boolean;
1695
+ client_id?: number;
1696
+ client?: BookingLabUpdateBookingClient;
1697
+ extra_info?: {
1698
+ client_type?: number;
1699
+ [key: string]: any;
1700
+ };
1701
+ child_client_ids?: number[];
1702
+ private_note?: string;
1703
+ current_multi_status?: string;
1704
+ update_reason?: string;
1705
+ assets?: any[];
1706
+ requested_assets?: any[];
1707
+ attendees?: any[];
1708
+ [key: string]: any;
1709
+ }
1710
+ interface BookingLabUpdateBookingResponse {
1711
+ id?: number;
1712
+ [key: string]: any;
1713
+ }
1649
1714
 
1650
1715
  /**
1651
1716
  * Core API Client
@@ -1804,8 +1869,9 @@ declare class BookingLabClient extends ApiClient {
1804
1869
  * Get services for a company
1805
1870
  * @param companyId - The company ID
1806
1871
  * @param clientToken - Client token for authentication
1872
+ * @param bypassCacheToken - Optional. When provided, sent as `X-Bypass-Cache` header
1807
1873
  */
1808
- getCompanyServices(companyId: number, clientToken: string): Promise<ApiResponse<BookingLabGetServicesResponse>>;
1874
+ getCompanyServices(companyId: number, clientToken: string, bypassCacheToken?: string): Promise<ApiResponse<BookingLabGetServicesResponse>>;
1809
1875
  /**
1810
1876
  * Get a single service by ID for a company
1811
1877
  * @param companyId - The company ID
@@ -1889,9 +1955,25 @@ declare class BookingLabClient extends ApiClient {
1889
1955
  * List bookings for a company
1890
1956
  * @param companyId - The company ID
1891
1957
  * @param clientToken - Client token for authentication
1892
- * @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
1960
+ */
1961
+ listBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams, bypassCacheToken?: string): Promise<ApiResponse<BookingLabListBookingsResponse>>;
1962
+ /**
1963
+ * Update a booking for a company
1964
+ * @param companyId - The company ID
1965
+ * @param bookingId - The booking ID
1966
+ * @param request - Booking update body (all fields optional)
1967
+ * @param clientToken - Client token for authentication
1893
1968
  */
1894
- listBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams): Promise<ApiResponse<BookingLabListBookingsResponse>>;
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>>;
1895
1977
  }
1896
1978
  /**
1897
1979
  * Create a new BookingLab client instance
@@ -2307,8 +2389,9 @@ declare function useBookingLabGetToken(request: BookingLabGetTokenRequest, clien
2307
2389
  * @param companyId - The company ID
2308
2390
  * @param clientToken - Client token for authentication
2309
2391
  * @param enabled - Whether the query should run
2392
+ * @param bypassCacheToken - Optional. Sent as `X-Bypass-Cache` header when provided
2310
2393
  */
2311
- 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>;
2312
2395
  /**
2313
2396
  * Hook for fetching a single service for a company by ID (BookingLab)
2314
2397
  * @param companyId - The company ID
@@ -2380,10 +2463,11 @@ declare function useOrdnanceAddressLookup(postcode: string, clientToken: string,
2380
2463
  * Hook for listing bookings for a company (BookingLab)
2381
2464
  * @param companyId - The company ID
2382
2465
  * @param clientToken - Client token for authentication
2383
- * @param params - Optional query params (client_id, member_id)
2466
+ * @param params - Optional query params (client_id, member_id, start_date, end_date)
2384
2467
  * @param enabled - Whether the query should run
2468
+ * @param bypassCacheToken - Optional. Sent as `X-Bypass-Cache` header when provided
2385
2469
  */
2386
- 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>;
2387
2471
  /**
2388
2472
  * Hook for fetching a purchase by ID (BookingLab)
2389
2473
  * @param companyId - The company ID
@@ -2393,5 +2477,16 @@ declare function useListBookinglabBookings(companyId: number, clientToken: strin
2393
2477
  * @param enabled - Whether the query should run
2394
2478
  */
2395
2479
  declare function useGetPurchase(companyId: number, serviceId: number, purchaseId: string | number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabPurchaseResponse, Error>;
2480
+ /**
2481
+ * Hook for updating a booking (BookingLab)
2482
+ */
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>;
2396
2491
 
2397
- 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 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, 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
  */
@@ -1646,6 +1652,65 @@ interface BookingLabListBookingsResponse {
1646
1652
  _links?: Record<string, any>;
1647
1653
  [key: string]: any;
1648
1654
  }
1655
+ interface BookingLabUpdateBookingClient {
1656
+ first_name?: string;
1657
+ first_name_extra?: string;
1658
+ last_name?: string;
1659
+ last_name_extra?: string;
1660
+ email?: string;
1661
+ mobile_prefix?: string;
1662
+ mobile?: string;
1663
+ mobile_prefix_country_code?: string;
1664
+ phone_prefix?: string;
1665
+ phone?: string;
1666
+ phone_prefix_country_code?: string;
1667
+ address1?: string;
1668
+ address2?: string;
1669
+ address3?: string;
1670
+ address4?: string;
1671
+ address5?: string;
1672
+ postcode?: string;
1673
+ country?: string;
1674
+ member_type?: number;
1675
+ member_level_id?: number;
1676
+ mem_join_date?: string;
1677
+ time_zone?: string;
1678
+ consent?: boolean;
1679
+ [key: string]: any;
1680
+ }
1681
+ interface BookingLabUpdateBookingRequest {
1682
+ datetime?: string;
1683
+ duration?: number;
1684
+ person_id?: number;
1685
+ resource_id?: number;
1686
+ service_id?: number;
1687
+ status?: string;
1688
+ position?: number;
1689
+ price?: number;
1690
+ paid?: number;
1691
+ time_zone?: string;
1692
+ email?: boolean;
1693
+ email_owner?: boolean;
1694
+ attended?: boolean;
1695
+ client_id?: number;
1696
+ client?: BookingLabUpdateBookingClient;
1697
+ extra_info?: {
1698
+ client_type?: number;
1699
+ [key: string]: any;
1700
+ };
1701
+ child_client_ids?: number[];
1702
+ private_note?: string;
1703
+ current_multi_status?: string;
1704
+ update_reason?: string;
1705
+ assets?: any[];
1706
+ requested_assets?: any[];
1707
+ attendees?: any[];
1708
+ [key: string]: any;
1709
+ }
1710
+ interface BookingLabUpdateBookingResponse {
1711
+ id?: number;
1712
+ [key: string]: any;
1713
+ }
1649
1714
 
1650
1715
  /**
1651
1716
  * Core API Client
@@ -1804,8 +1869,9 @@ declare class BookingLabClient extends ApiClient {
1804
1869
  * Get services for a company
1805
1870
  * @param companyId - The company ID
1806
1871
  * @param clientToken - Client token for authentication
1872
+ * @param bypassCacheToken - Optional. When provided, sent as `X-Bypass-Cache` header
1807
1873
  */
1808
- getCompanyServices(companyId: number, clientToken: string): Promise<ApiResponse<BookingLabGetServicesResponse>>;
1874
+ getCompanyServices(companyId: number, clientToken: string, bypassCacheToken?: string): Promise<ApiResponse<BookingLabGetServicesResponse>>;
1809
1875
  /**
1810
1876
  * Get a single service by ID for a company
1811
1877
  * @param companyId - The company ID
@@ -1889,9 +1955,25 @@ declare class BookingLabClient extends ApiClient {
1889
1955
  * List bookings for a company
1890
1956
  * @param companyId - The company ID
1891
1957
  * @param clientToken - Client token for authentication
1892
- * @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
1960
+ */
1961
+ listBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams, bypassCacheToken?: string): Promise<ApiResponse<BookingLabListBookingsResponse>>;
1962
+ /**
1963
+ * Update a booking for a company
1964
+ * @param companyId - The company ID
1965
+ * @param bookingId - The booking ID
1966
+ * @param request - Booking update body (all fields optional)
1967
+ * @param clientToken - Client token for authentication
1893
1968
  */
1894
- listBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams): Promise<ApiResponse<BookingLabListBookingsResponse>>;
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>>;
1895
1977
  }
1896
1978
  /**
1897
1979
  * Create a new BookingLab client instance
@@ -2307,8 +2389,9 @@ declare function useBookingLabGetToken(request: BookingLabGetTokenRequest, clien
2307
2389
  * @param companyId - The company ID
2308
2390
  * @param clientToken - Client token for authentication
2309
2391
  * @param enabled - Whether the query should run
2392
+ * @param bypassCacheToken - Optional. Sent as `X-Bypass-Cache` header when provided
2310
2393
  */
2311
- 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>;
2312
2395
  /**
2313
2396
  * Hook for fetching a single service for a company by ID (BookingLab)
2314
2397
  * @param companyId - The company ID
@@ -2380,10 +2463,11 @@ declare function useOrdnanceAddressLookup(postcode: string, clientToken: string,
2380
2463
  * Hook for listing bookings for a company (BookingLab)
2381
2464
  * @param companyId - The company ID
2382
2465
  * @param clientToken - Client token for authentication
2383
- * @param params - Optional query params (client_id, member_id)
2466
+ * @param params - Optional query params (client_id, member_id, start_date, end_date)
2384
2467
  * @param enabled - Whether the query should run
2468
+ * @param bypassCacheToken - Optional. Sent as `X-Bypass-Cache` header when provided
2385
2469
  */
2386
- 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>;
2387
2471
  /**
2388
2472
  * Hook for fetching a purchase by ID (BookingLab)
2389
2473
  * @param companyId - The company ID
@@ -2393,5 +2477,16 @@ declare function useListBookinglabBookings(companyId: number, clientToken: strin
2393
2477
  * @param enabled - Whether the query should run
2394
2478
  */
2395
2479
  declare function useGetPurchase(companyId: number, serviceId: number, purchaseId: string | number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabPurchaseResponse, Error>;
2480
+ /**
2481
+ * Hook for updating a booking (BookingLab)
2482
+ */
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>;
2396
2491
 
2397
- 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 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, 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,18 +570,40 @@ 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,
591
+ headers
592
+ }
593
+ );
594
+ }
595
+ /**
596
+ * Update a booking for a company
597
+ * @param companyId - The company ID
598
+ * @param bookingId - The booking ID
599
+ * @param request - Booking update body (all fields optional)
600
+ * @param clientToken - Client token for authentication
601
+ */
602
+ async updateBookinglabBooking(companyId, bookingId, request, clientToken) {
603
+ return this.put(
604
+ `/company/${companyId}/booking/${bookingId}`,
605
+ request,
606
+ {
584
607
  headers: {
585
608
  "clienttoken": clientToken,
586
609
  "x-company-id": String(companyId)
@@ -588,6 +611,42 @@ var BookingLabClient = class extends ApiClient {
588
611
  }
589
612
  );
590
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
+ }
591
650
  };
592
651
  function createBookingLabClient(baseUrl, authToken, appId) {
593
652
  const client = new BookingLabClient({ baseUrl });
@@ -1338,12 +1397,12 @@ function useBookingLabGetToken(request, clientToken, enabled = true) {
1338
1397
  enabled: enabled && !!request.client && !!request.company && !!clientToken
1339
1398
  });
1340
1399
  }
1341
- function useBookingLabServices(companyId, clientToken, enabled = true) {
1400
+ function useBookingLabServices(companyId, clientToken, enabled = true, bypassCacheToken) {
1342
1401
  const client = useBookingLabClient();
1343
1402
  return reactQuery.useQuery({
1344
- queryKey: ["bookingLabServices", companyId],
1403
+ queryKey: ["bookingLabServices", companyId, bypassCacheToken],
1345
1404
  queryFn: async () => {
1346
- const response = await client.getCompanyServices(companyId, clientToken);
1405
+ const response = await client.getCompanyServices(companyId, clientToken, bypassCacheToken);
1347
1406
  return response.data;
1348
1407
  },
1349
1408
  enabled: enabled && !!companyId && !!clientToken
@@ -1451,12 +1510,12 @@ function useOrdnanceAddressLookup(postcode, clientToken, enabled = true) {
1451
1510
  enabled: enabled && !!postcode && !!clientToken
1452
1511
  });
1453
1512
  }
1454
- function useListBookinglabBookings(companyId, clientToken, params, enabled = true) {
1513
+ function useListBookinglabBookings(companyId, clientToken, params, enabled = true, bypassCacheToken) {
1455
1514
  const client = useBookingLabClient();
1456
1515
  return reactQuery.useQuery({
1457
- 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],
1458
1517
  queryFn: async () => {
1459
- const response = await client.listBookinglabBookings(companyId, clientToken, params);
1518
+ const response = await client.listBookinglabBookings(companyId, clientToken, params, bypassCacheToken);
1460
1519
  return response.data;
1461
1520
  },
1462
1521
  enabled: enabled && !!companyId && !!clientToken
@@ -1473,6 +1532,26 @@ function useGetPurchase(companyId, serviceId, purchaseId, clientToken, enabled =
1473
1532
  enabled: enabled && !!companyId && !!serviceId && !!purchaseId && !!clientToken
1474
1533
  });
1475
1534
  }
1535
+ function useUpdateBookinglabBooking(companyId, bookingId, clientToken) {
1536
+ const client = useBookingLabClient();
1537
+ return reactQuery.useMutation({
1538
+ mutationFn: async (request) => {
1539
+ const response = await client.updateBookinglabBooking(companyId, bookingId, request, clientToken);
1540
+ return response.data;
1541
+ }
1542
+ });
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
+ }
1476
1555
 
1477
1556
  exports.ApiClient = ApiClient;
1478
1557
  exports.ApiClientContext = ApiClientContext;
@@ -1523,6 +1602,7 @@ exports.useListBookinglabBookings = useListBookinglabBookings;
1523
1602
  exports.useListBookings = useListBookings;
1524
1603
  exports.useLogin = useLogin;
1525
1604
  exports.useOrdnanceAddressLookup = useOrdnanceAddressLookup;
1605
+ exports.useOsPlacesStatus = useOsPlacesStatus;
1526
1606
  exports.useQuestions = useQuestions;
1527
1607
  exports.useRescheduleBooking = useRescheduleBooking;
1528
1608
  exports.useResetPassword = useResetPassword;
@@ -1530,6 +1610,7 @@ exports.useResources = useResources;
1530
1610
  exports.useSendCustomEmail = useSendCustomEmail;
1531
1611
  exports.useServices = useServices;
1532
1612
  exports.useTimes = useTimes;
1613
+ exports.useUpdateBookinglabBooking = useUpdateBookinglabBooking;
1533
1614
  exports.useUpdateClient = useUpdateClient;
1534
1615
  exports.useUpdateMember = useUpdateMember;
1535
1616
  //# sourceMappingURL=index.js.map