@bookinglab/booking-journey-api 2.13.0 → 2.15.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 +98 -1
- package/dist/index.d.ts +98 -1
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1579,6 +1579,71 @@ interface OrdnanceAddressResult {
|
|
|
1579
1579
|
interface OrdnanceAddressLookupResponse {
|
|
1580
1580
|
results: OrdnanceAddressResult[];
|
|
1581
1581
|
}
|
|
1582
|
+
/**
|
|
1583
|
+
* BookingLab Get Purchase
|
|
1584
|
+
*/
|
|
1585
|
+
interface BookingLabPurchaseRefund {
|
|
1586
|
+
amount_refunded: number;
|
|
1587
|
+
amount_remaining: number;
|
|
1588
|
+
}
|
|
1589
|
+
interface BookingLabPurchaseEmbedded {
|
|
1590
|
+
client?: Record<string, any>;
|
|
1591
|
+
member?: Record<string, any>;
|
|
1592
|
+
bookings?: Array<Record<string, any>>;
|
|
1593
|
+
packages?: Array<Record<string, any>>;
|
|
1594
|
+
products?: Array<Record<string, any>>;
|
|
1595
|
+
pre_paid_bookings?: Array<Record<string, any>>;
|
|
1596
|
+
deals?: Array<Record<string, any>>;
|
|
1597
|
+
course_bookings?: Array<Record<string, any>>;
|
|
1598
|
+
external_purchases?: Array<Record<string, any>>;
|
|
1599
|
+
payment_callbacks?: Array<Record<string, any>>;
|
|
1600
|
+
confirm_messages?: Array<Record<string, any>>;
|
|
1601
|
+
[key: string]: any;
|
|
1602
|
+
}
|
|
1603
|
+
interface BookingLabPurchaseResponse {
|
|
1604
|
+
id: number;
|
|
1605
|
+
long_id: string;
|
|
1606
|
+
client_name?: string;
|
|
1607
|
+
created_at?: string;
|
|
1608
|
+
payment_type?: string;
|
|
1609
|
+
payment_reference?: any[];
|
|
1610
|
+
total_price: number;
|
|
1611
|
+
price: number;
|
|
1612
|
+
paid: number;
|
|
1613
|
+
deposit: number;
|
|
1614
|
+
due_now: number;
|
|
1615
|
+
original_price?: number;
|
|
1616
|
+
certificate_paid?: number;
|
|
1617
|
+
tax_payable_on_price?: number;
|
|
1618
|
+
tax_payable_on_deposit?: number;
|
|
1619
|
+
tax_payable_on_due_now?: number;
|
|
1620
|
+
price_in_major_units?: number;
|
|
1621
|
+
total_price_in_major_units?: number;
|
|
1622
|
+
paid_in_major_units?: number;
|
|
1623
|
+
deposit_in_major_units?: number;
|
|
1624
|
+
due_now_in_major_units?: number;
|
|
1625
|
+
tax_payable_on_price_in_major_units?: number;
|
|
1626
|
+
tax_payable_on_deposit_in_major_units?: number;
|
|
1627
|
+
tax_payable_on_due_now_in_major_units?: number;
|
|
1628
|
+
refund?: BookingLabPurchaseRefund;
|
|
1629
|
+
_embedded?: BookingLabPurchaseEmbedded;
|
|
1630
|
+
_links?: Record<string, any>;
|
|
1631
|
+
[key: string]: any;
|
|
1632
|
+
}
|
|
1633
|
+
interface BookingLabListBookingsParams {
|
|
1634
|
+
client_id?: number;
|
|
1635
|
+
member_id?: number;
|
|
1636
|
+
}
|
|
1637
|
+
interface BookingLabListBookingsResponse {
|
|
1638
|
+
total_entries?: number;
|
|
1639
|
+
include_cancelled?: boolean;
|
|
1640
|
+
_embedded?: {
|
|
1641
|
+
bookings?: any[];
|
|
1642
|
+
[key: string]: any;
|
|
1643
|
+
};
|
|
1644
|
+
_links?: Record<string, any>;
|
|
1645
|
+
[key: string]: any;
|
|
1646
|
+
}
|
|
1582
1647
|
|
|
1583
1648
|
/**
|
|
1584
1649
|
* Core API Client
|
|
@@ -1810,6 +1875,21 @@ declare class BookingLabClient extends ApiClient {
|
|
|
1810
1875
|
* @param clientToken - Client token for authentication
|
|
1811
1876
|
*/
|
|
1812
1877
|
getOrdnanceAddressLookup(postcode: string, clientToken: string): Promise<ApiResponse<OrdnanceAddressLookupResponse>>;
|
|
1878
|
+
/**
|
|
1879
|
+
* Get a purchase by ID for a company/service
|
|
1880
|
+
* @param companyId - The company ID
|
|
1881
|
+
* @param serviceId - The service ID
|
|
1882
|
+
* @param purchaseId - The purchase ID
|
|
1883
|
+
* @param clientToken - Client token for authentication
|
|
1884
|
+
*/
|
|
1885
|
+
getPurchase(companyId: number, serviceId: number, purchaseId: string | number, clientToken: string): Promise<ApiResponse<BookingLabPurchaseResponse>>;
|
|
1886
|
+
/**
|
|
1887
|
+
* List bookings for a company
|
|
1888
|
+
* @param companyId - The company ID
|
|
1889
|
+
* @param clientToken - Client token for authentication
|
|
1890
|
+
* @param params - Optional query params (client_id, member_id)
|
|
1891
|
+
*/
|
|
1892
|
+
listBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams): Promise<ApiResponse<BookingLabListBookingsResponse>>;
|
|
1813
1893
|
}
|
|
1814
1894
|
/**
|
|
1815
1895
|
* Create a new BookingLab client instance
|
|
@@ -2294,5 +2374,22 @@ declare function useBookingLabDeleteBasket(): _tanstack_react_query.UseMutationR
|
|
|
2294
2374
|
* @param enabled - Whether the query should run
|
|
2295
2375
|
*/
|
|
2296
2376
|
declare function useOrdnanceAddressLookup(postcode: string, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<OrdnanceAddressLookupResponse, Error>;
|
|
2377
|
+
/**
|
|
2378
|
+
* Hook for listing bookings for a company (BookingLab)
|
|
2379
|
+
* @param companyId - The company ID
|
|
2380
|
+
* @param clientToken - Client token for authentication
|
|
2381
|
+
* @param params - Optional query params (client_id, member_id)
|
|
2382
|
+
* @param enabled - Whether the query should run
|
|
2383
|
+
*/
|
|
2384
|
+
declare function useListBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabListBookingsResponse, Error>;
|
|
2385
|
+
/**
|
|
2386
|
+
* Hook for fetching a purchase by ID (BookingLab)
|
|
2387
|
+
* @param companyId - The company ID
|
|
2388
|
+
* @param serviceId - The service ID
|
|
2389
|
+
* @param purchaseId - The purchase ID
|
|
2390
|
+
* @param clientToken - Client token for authentication
|
|
2391
|
+
* @param enabled - Whether the query should run
|
|
2392
|
+
*/
|
|
2393
|
+
declare function useGetPurchase(companyId: number, serviceId: number, purchaseId: string | number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabPurchaseResponse, Error>;
|
|
2297
2394
|
|
|
2298
|
-
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, BookingLabProvider, 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, useJrniClient, useJrniContext, useListBookings, useLogin, useOrdnanceAddressLookup, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateClient, useUpdateMember };
|
|
2395
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1579,6 +1579,71 @@ interface OrdnanceAddressResult {
|
|
|
1579
1579
|
interface OrdnanceAddressLookupResponse {
|
|
1580
1580
|
results: OrdnanceAddressResult[];
|
|
1581
1581
|
}
|
|
1582
|
+
/**
|
|
1583
|
+
* BookingLab Get Purchase
|
|
1584
|
+
*/
|
|
1585
|
+
interface BookingLabPurchaseRefund {
|
|
1586
|
+
amount_refunded: number;
|
|
1587
|
+
amount_remaining: number;
|
|
1588
|
+
}
|
|
1589
|
+
interface BookingLabPurchaseEmbedded {
|
|
1590
|
+
client?: Record<string, any>;
|
|
1591
|
+
member?: Record<string, any>;
|
|
1592
|
+
bookings?: Array<Record<string, any>>;
|
|
1593
|
+
packages?: Array<Record<string, any>>;
|
|
1594
|
+
products?: Array<Record<string, any>>;
|
|
1595
|
+
pre_paid_bookings?: Array<Record<string, any>>;
|
|
1596
|
+
deals?: Array<Record<string, any>>;
|
|
1597
|
+
course_bookings?: Array<Record<string, any>>;
|
|
1598
|
+
external_purchases?: Array<Record<string, any>>;
|
|
1599
|
+
payment_callbacks?: Array<Record<string, any>>;
|
|
1600
|
+
confirm_messages?: Array<Record<string, any>>;
|
|
1601
|
+
[key: string]: any;
|
|
1602
|
+
}
|
|
1603
|
+
interface BookingLabPurchaseResponse {
|
|
1604
|
+
id: number;
|
|
1605
|
+
long_id: string;
|
|
1606
|
+
client_name?: string;
|
|
1607
|
+
created_at?: string;
|
|
1608
|
+
payment_type?: string;
|
|
1609
|
+
payment_reference?: any[];
|
|
1610
|
+
total_price: number;
|
|
1611
|
+
price: number;
|
|
1612
|
+
paid: number;
|
|
1613
|
+
deposit: number;
|
|
1614
|
+
due_now: number;
|
|
1615
|
+
original_price?: number;
|
|
1616
|
+
certificate_paid?: number;
|
|
1617
|
+
tax_payable_on_price?: number;
|
|
1618
|
+
tax_payable_on_deposit?: number;
|
|
1619
|
+
tax_payable_on_due_now?: number;
|
|
1620
|
+
price_in_major_units?: number;
|
|
1621
|
+
total_price_in_major_units?: number;
|
|
1622
|
+
paid_in_major_units?: number;
|
|
1623
|
+
deposit_in_major_units?: number;
|
|
1624
|
+
due_now_in_major_units?: number;
|
|
1625
|
+
tax_payable_on_price_in_major_units?: number;
|
|
1626
|
+
tax_payable_on_deposit_in_major_units?: number;
|
|
1627
|
+
tax_payable_on_due_now_in_major_units?: number;
|
|
1628
|
+
refund?: BookingLabPurchaseRefund;
|
|
1629
|
+
_embedded?: BookingLabPurchaseEmbedded;
|
|
1630
|
+
_links?: Record<string, any>;
|
|
1631
|
+
[key: string]: any;
|
|
1632
|
+
}
|
|
1633
|
+
interface BookingLabListBookingsParams {
|
|
1634
|
+
client_id?: number;
|
|
1635
|
+
member_id?: number;
|
|
1636
|
+
}
|
|
1637
|
+
interface BookingLabListBookingsResponse {
|
|
1638
|
+
total_entries?: number;
|
|
1639
|
+
include_cancelled?: boolean;
|
|
1640
|
+
_embedded?: {
|
|
1641
|
+
bookings?: any[];
|
|
1642
|
+
[key: string]: any;
|
|
1643
|
+
};
|
|
1644
|
+
_links?: Record<string, any>;
|
|
1645
|
+
[key: string]: any;
|
|
1646
|
+
}
|
|
1582
1647
|
|
|
1583
1648
|
/**
|
|
1584
1649
|
* Core API Client
|
|
@@ -1810,6 +1875,21 @@ declare class BookingLabClient extends ApiClient {
|
|
|
1810
1875
|
* @param clientToken - Client token for authentication
|
|
1811
1876
|
*/
|
|
1812
1877
|
getOrdnanceAddressLookup(postcode: string, clientToken: string): Promise<ApiResponse<OrdnanceAddressLookupResponse>>;
|
|
1878
|
+
/**
|
|
1879
|
+
* Get a purchase by ID for a company/service
|
|
1880
|
+
* @param companyId - The company ID
|
|
1881
|
+
* @param serviceId - The service ID
|
|
1882
|
+
* @param purchaseId - The purchase ID
|
|
1883
|
+
* @param clientToken - Client token for authentication
|
|
1884
|
+
*/
|
|
1885
|
+
getPurchase(companyId: number, serviceId: number, purchaseId: string | number, clientToken: string): Promise<ApiResponse<BookingLabPurchaseResponse>>;
|
|
1886
|
+
/**
|
|
1887
|
+
* List bookings for a company
|
|
1888
|
+
* @param companyId - The company ID
|
|
1889
|
+
* @param clientToken - Client token for authentication
|
|
1890
|
+
* @param params - Optional query params (client_id, member_id)
|
|
1891
|
+
*/
|
|
1892
|
+
listBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams): Promise<ApiResponse<BookingLabListBookingsResponse>>;
|
|
1813
1893
|
}
|
|
1814
1894
|
/**
|
|
1815
1895
|
* Create a new BookingLab client instance
|
|
@@ -2294,5 +2374,22 @@ declare function useBookingLabDeleteBasket(): _tanstack_react_query.UseMutationR
|
|
|
2294
2374
|
* @param enabled - Whether the query should run
|
|
2295
2375
|
*/
|
|
2296
2376
|
declare function useOrdnanceAddressLookup(postcode: string, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<OrdnanceAddressLookupResponse, Error>;
|
|
2377
|
+
/**
|
|
2378
|
+
* Hook for listing bookings for a company (BookingLab)
|
|
2379
|
+
* @param companyId - The company ID
|
|
2380
|
+
* @param clientToken - Client token for authentication
|
|
2381
|
+
* @param params - Optional query params (client_id, member_id)
|
|
2382
|
+
* @param enabled - Whether the query should run
|
|
2383
|
+
*/
|
|
2384
|
+
declare function useListBookinglabBookings(companyId: number, clientToken: string, params?: BookingLabListBookingsParams, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabListBookingsResponse, Error>;
|
|
2385
|
+
/**
|
|
2386
|
+
* Hook for fetching a purchase by ID (BookingLab)
|
|
2387
|
+
* @param companyId - The company ID
|
|
2388
|
+
* @param serviceId - The service ID
|
|
2389
|
+
* @param purchaseId - The purchase ID
|
|
2390
|
+
* @param clientToken - Client token for authentication
|
|
2391
|
+
* @param enabled - Whether the query should run
|
|
2392
|
+
*/
|
|
2393
|
+
declare function useGetPurchase(companyId: number, serviceId: number, purchaseId: string | number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabPurchaseResponse, Error>;
|
|
2297
2394
|
|
|
2298
|
-
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, BookingLabProvider, 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, useJrniClient, useJrniContext, useListBookings, useLogin, useOrdnanceAddressLookup, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateClient, useUpdateMember };
|
|
2395
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -547,6 +547,45 @@ var BookingLabClient = class extends ApiClient {
|
|
|
547
547
|
}
|
|
548
548
|
);
|
|
549
549
|
}
|
|
550
|
+
/**
|
|
551
|
+
* Get a purchase by ID for a company/service
|
|
552
|
+
* @param companyId - The company ID
|
|
553
|
+
* @param serviceId - The service ID
|
|
554
|
+
* @param purchaseId - The purchase ID
|
|
555
|
+
* @param clientToken - Client token for authentication
|
|
556
|
+
*/
|
|
557
|
+
async getPurchase(companyId, serviceId, purchaseId, clientToken) {
|
|
558
|
+
return this.get(
|
|
559
|
+
`/company/${companyId}/service/${serviceId}/purchase/${purchaseId}`,
|
|
560
|
+
{
|
|
561
|
+
headers: {
|
|
562
|
+
"clienttoken": clientToken,
|
|
563
|
+
"x-company-id": String(companyId)
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
);
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* List bookings for a company
|
|
570
|
+
* @param companyId - The company ID
|
|
571
|
+
* @param clientToken - Client token for authentication
|
|
572
|
+
* @param params - Optional query params (client_id, member_id)
|
|
573
|
+
*/
|
|
574
|
+
async listBookinglabBookings(companyId, clientToken, params) {
|
|
575
|
+
const queryParams = {};
|
|
576
|
+
if (params?.client_id !== void 0) queryParams.client_id = params.client_id;
|
|
577
|
+
if (params?.member_id !== void 0) queryParams.member_id = params.member_id;
|
|
578
|
+
return this.get(
|
|
579
|
+
`/company/${companyId}/bookings`,
|
|
580
|
+
{
|
|
581
|
+
params: Object.keys(queryParams).length ? queryParams : void 0,
|
|
582
|
+
headers: {
|
|
583
|
+
"clienttoken": clientToken,
|
|
584
|
+
"x-company-id": String(companyId)
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
);
|
|
588
|
+
}
|
|
550
589
|
};
|
|
551
590
|
function createBookingLabClient(baseUrl, authToken, appId) {
|
|
552
591
|
const client = new BookingLabClient({ baseUrl });
|
|
@@ -1410,6 +1449,28 @@ function useOrdnanceAddressLookup(postcode, clientToken, enabled = true) {
|
|
|
1410
1449
|
enabled: enabled && !!postcode && !!clientToken
|
|
1411
1450
|
});
|
|
1412
1451
|
}
|
|
1452
|
+
function useListBookinglabBookings(companyId, clientToken, params, enabled = true) {
|
|
1453
|
+
const client = useBookingLabClient();
|
|
1454
|
+
return reactQuery.useQuery({
|
|
1455
|
+
queryKey: ["bookingLabListBookings", companyId, params?.client_id, params?.member_id],
|
|
1456
|
+
queryFn: async () => {
|
|
1457
|
+
const response = await client.listBookinglabBookings(companyId, clientToken, params);
|
|
1458
|
+
return response.data;
|
|
1459
|
+
},
|
|
1460
|
+
enabled: enabled && !!companyId && !!clientToken
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
function useGetPurchase(companyId, serviceId, purchaseId, clientToken, enabled = true) {
|
|
1464
|
+
const client = useBookingLabClient();
|
|
1465
|
+
return reactQuery.useQuery({
|
|
1466
|
+
queryKey: ["bookingLabPurchase", companyId, serviceId, purchaseId],
|
|
1467
|
+
queryFn: async () => {
|
|
1468
|
+
const response = await client.getPurchase(companyId, serviceId, purchaseId, clientToken);
|
|
1469
|
+
return response.data;
|
|
1470
|
+
},
|
|
1471
|
+
enabled: enabled && !!companyId && !!serviceId && !!purchaseId && !!clientToken
|
|
1472
|
+
});
|
|
1473
|
+
}
|
|
1413
1474
|
|
|
1414
1475
|
exports.ApiClient = ApiClient;
|
|
1415
1476
|
exports.ApiClientContext = ApiClientContext;
|
|
@@ -1453,8 +1514,10 @@ exports.useDates = useDates;
|
|
|
1453
1514
|
exports.useFindClientByEmail = useFindClientByEmail;
|
|
1454
1515
|
exports.useForgottenPassword = useForgottenPassword;
|
|
1455
1516
|
exports.useGetMember = useGetMember;
|
|
1517
|
+
exports.useGetPurchase = useGetPurchase;
|
|
1456
1518
|
exports.useJrniClient = useJrniClient;
|
|
1457
1519
|
exports.useJrniContext = useJrniContext;
|
|
1520
|
+
exports.useListBookinglabBookings = useListBookinglabBookings;
|
|
1458
1521
|
exports.useListBookings = useListBookings;
|
|
1459
1522
|
exports.useLogin = useLogin;
|
|
1460
1523
|
exports.useOrdnanceAddressLookup = useOrdnanceAddressLookup;
|