@bookinglab/booking-journey-api 2.18.0 → 2.19.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 +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1585,6 +1585,15 @@ interface OrdnanceAddressLookupResponse {
|
|
|
1585
1585
|
interface OsPlacesStatusResponse {
|
|
1586
1586
|
status: boolean;
|
|
1587
1587
|
}
|
|
1588
|
+
/**
|
|
1589
|
+
* BookingLab Ordinance Survey service status (POST variant)
|
|
1590
|
+
*/
|
|
1591
|
+
interface OrdinanceSurveyStatusRequest {
|
|
1592
|
+
host: string;
|
|
1593
|
+
}
|
|
1594
|
+
interface OrdinanceSurveyStatusResponse {
|
|
1595
|
+
status: boolean;
|
|
1596
|
+
}
|
|
1588
1597
|
/**
|
|
1589
1598
|
* BookingLab Get Purchase
|
|
1590
1599
|
*/
|
|
@@ -1974,6 +1983,13 @@ declare class BookingLabClient extends ApiClient {
|
|
|
1974
1983
|
* @param isStaging - When true, hits the `osplaces-staging` variant
|
|
1975
1984
|
*/
|
|
1976
1985
|
getOsPlacesStatus(token: string, isStaging?: boolean): Promise<ApiResponse<OsPlacesStatusResponse>>;
|
|
1986
|
+
/**
|
|
1987
|
+
* Check Ordinance Survey (OS Places) service status via POST (BookingLab).
|
|
1988
|
+
* Sends the host to the absolute serviceStatus endpoint on api.bookinglab.co.uk.
|
|
1989
|
+
* @param token - Value for the X-BL-TOKEN header
|
|
1990
|
+
* @param request - Body containing the host to check
|
|
1991
|
+
*/
|
|
1992
|
+
getOrdinanceSurveyStatus(token: string, request: OrdinanceSurveyStatusRequest): Promise<ApiResponse<OrdinanceSurveyStatusResponse>>;
|
|
1977
1993
|
}
|
|
1978
1994
|
/**
|
|
1979
1995
|
* Create a new BookingLab client instance
|
|
@@ -2488,5 +2504,12 @@ declare function useUpdateBookinglabBooking(companyId: number, bookingId: number
|
|
|
2488
2504
|
* @param enabled - Whether the query should run
|
|
2489
2505
|
*/
|
|
2490
2506
|
declare function useOsPlacesStatus(token: string, isStaging?: boolean, enabled?: boolean): _tanstack_react_query.UseQueryResult<OsPlacesStatusResponse, Error>;
|
|
2507
|
+
/**
|
|
2508
|
+
* Hook for checking the Ordinance Survey (OS Places) service status via POST (BookingLab)
|
|
2509
|
+
* @param token - Value for the X-BL-TOKEN header
|
|
2510
|
+
* @param host - Host to check (sent in JSON body)
|
|
2511
|
+
* @param enabled - Whether the query should run
|
|
2512
|
+
*/
|
|
2513
|
+
declare function useOrdinanceSurveyStatus(token: string, host: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<OrdinanceSurveyStatusResponse, Error>;
|
|
2491
2514
|
|
|
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 };
|
|
2515
|
+
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 OrdinanceSurveyStatusRequest, type OrdinanceSurveyStatusResponse, 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, useOrdinanceSurveyStatus, useOrdnanceAddressLookup, useOsPlacesStatus, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateBookinglabBooking, useUpdateClient, useUpdateMember };
|
package/dist/index.d.ts
CHANGED
|
@@ -1585,6 +1585,15 @@ interface OrdnanceAddressLookupResponse {
|
|
|
1585
1585
|
interface OsPlacesStatusResponse {
|
|
1586
1586
|
status: boolean;
|
|
1587
1587
|
}
|
|
1588
|
+
/**
|
|
1589
|
+
* BookingLab Ordinance Survey service status (POST variant)
|
|
1590
|
+
*/
|
|
1591
|
+
interface OrdinanceSurveyStatusRequest {
|
|
1592
|
+
host: string;
|
|
1593
|
+
}
|
|
1594
|
+
interface OrdinanceSurveyStatusResponse {
|
|
1595
|
+
status: boolean;
|
|
1596
|
+
}
|
|
1588
1597
|
/**
|
|
1589
1598
|
* BookingLab Get Purchase
|
|
1590
1599
|
*/
|
|
@@ -1974,6 +1983,13 @@ declare class BookingLabClient extends ApiClient {
|
|
|
1974
1983
|
* @param isStaging - When true, hits the `osplaces-staging` variant
|
|
1975
1984
|
*/
|
|
1976
1985
|
getOsPlacesStatus(token: string, isStaging?: boolean): Promise<ApiResponse<OsPlacesStatusResponse>>;
|
|
1986
|
+
/**
|
|
1987
|
+
* Check Ordinance Survey (OS Places) service status via POST (BookingLab).
|
|
1988
|
+
* Sends the host to the absolute serviceStatus endpoint on api.bookinglab.co.uk.
|
|
1989
|
+
* @param token - Value for the X-BL-TOKEN header
|
|
1990
|
+
* @param request - Body containing the host to check
|
|
1991
|
+
*/
|
|
1992
|
+
getOrdinanceSurveyStatus(token: string, request: OrdinanceSurveyStatusRequest): Promise<ApiResponse<OrdinanceSurveyStatusResponse>>;
|
|
1977
1993
|
}
|
|
1978
1994
|
/**
|
|
1979
1995
|
* Create a new BookingLab client instance
|
|
@@ -2488,5 +2504,12 @@ declare function useUpdateBookinglabBooking(companyId: number, bookingId: number
|
|
|
2488
2504
|
* @param enabled - Whether the query should run
|
|
2489
2505
|
*/
|
|
2490
2506
|
declare function useOsPlacesStatus(token: string, isStaging?: boolean, enabled?: boolean): _tanstack_react_query.UseQueryResult<OsPlacesStatusResponse, Error>;
|
|
2507
|
+
/**
|
|
2508
|
+
* Hook for checking the Ordinance Survey (OS Places) service status via POST (BookingLab)
|
|
2509
|
+
* @param token - Value for the X-BL-TOKEN header
|
|
2510
|
+
* @param host - Host to check (sent in JSON body)
|
|
2511
|
+
* @param enabled - Whether the query should run
|
|
2512
|
+
*/
|
|
2513
|
+
declare function useOrdinanceSurveyStatus(token: string, host: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<OrdinanceSurveyStatusResponse, Error>;
|
|
2491
2514
|
|
|
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 };
|
|
2515
|
+
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 OrdinanceSurveyStatusRequest, type OrdinanceSurveyStatusResponse, 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, useOrdinanceSurveyStatus, useOrdnanceAddressLookup, useOsPlacesStatus, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateBookinglabBooking, useUpdateClient, useUpdateMember };
|
package/dist/index.js
CHANGED
|
@@ -647,6 +647,43 @@ var BookingLabClient = class extends ApiClient {
|
|
|
647
647
|
throw error;
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
|
+
/**
|
|
651
|
+
* Check Ordinance Survey (OS Places) service status via POST (BookingLab).
|
|
652
|
+
* Sends the host to the absolute serviceStatus endpoint on api.bookinglab.co.uk.
|
|
653
|
+
* @param token - Value for the X-BL-TOKEN header
|
|
654
|
+
* @param request - Body containing the host to check
|
|
655
|
+
*/
|
|
656
|
+
async getOrdinanceSurveyStatus(token, request) {
|
|
657
|
+
const url = "https://api.bookinglab.co.uk/serviceStatus/osplaces";
|
|
658
|
+
const controller = new AbortController();
|
|
659
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
660
|
+
try {
|
|
661
|
+
const response = await fetch(url, {
|
|
662
|
+
method: "POST",
|
|
663
|
+
headers: {
|
|
664
|
+
"Content-Type": "application/json",
|
|
665
|
+
"X-BL-TOKEN": token
|
|
666
|
+
},
|
|
667
|
+
body: JSON.stringify(request),
|
|
668
|
+
signal: controller.signal
|
|
669
|
+
});
|
|
670
|
+
clearTimeout(timeoutId);
|
|
671
|
+
if (!response.ok) {
|
|
672
|
+
throw {
|
|
673
|
+
message: `HTTP ${response.status}: ${response.statusText}`,
|
|
674
|
+
status: response.status
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
const data = await response.json();
|
|
678
|
+
return { data, status: response.status, headers: response.headers };
|
|
679
|
+
} catch (error) {
|
|
680
|
+
clearTimeout(timeoutId);
|
|
681
|
+
if (error.name === "AbortError") {
|
|
682
|
+
throw { message: "Request timeout", code: "TIMEOUT" };
|
|
683
|
+
}
|
|
684
|
+
throw error;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
650
687
|
};
|
|
651
688
|
function createBookingLabClient(baseUrl, authToken, appId) {
|
|
652
689
|
const client = new BookingLabClient({ baseUrl });
|
|
@@ -1552,6 +1589,18 @@ function useOsPlacesStatus(token, isStaging = false, enabled = true) {
|
|
|
1552
1589
|
enabled: enabled && !!token
|
|
1553
1590
|
});
|
|
1554
1591
|
}
|
|
1592
|
+
function useOrdinanceSurveyStatus(token, host, enabled = true) {
|
|
1593
|
+
const client = useBookingLabClient();
|
|
1594
|
+
return reactQuery.useQuery({
|
|
1595
|
+
queryKey: ["ordinanceSurveyStatus", host],
|
|
1596
|
+
queryFn: async () => {
|
|
1597
|
+
const request = { host };
|
|
1598
|
+
const response = await client.getOrdinanceSurveyStatus(token, request);
|
|
1599
|
+
return response.data;
|
|
1600
|
+
},
|
|
1601
|
+
enabled: enabled && !!token && !!host
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1555
1604
|
|
|
1556
1605
|
exports.ApiClient = ApiClient;
|
|
1557
1606
|
exports.ApiClientContext = ApiClientContext;
|
|
@@ -1601,6 +1650,7 @@ exports.useJrniContext = useJrniContext;
|
|
|
1601
1650
|
exports.useListBookinglabBookings = useListBookinglabBookings;
|
|
1602
1651
|
exports.useListBookings = useListBookings;
|
|
1603
1652
|
exports.useLogin = useLogin;
|
|
1653
|
+
exports.useOrdinanceSurveyStatus = useOrdinanceSurveyStatus;
|
|
1604
1654
|
exports.useOrdnanceAddressLookup = useOrdnanceAddressLookup;
|
|
1605
1655
|
exports.useOsPlacesStatus = useOsPlacesStatus;
|
|
1606
1656
|
exports.useQuestions = useQuestions;
|