@bookinglab/booking-journey-api 2.3.0 → 2.5.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/README.md +18 -0
- package/dist/index.d.cts +149 -1
- package/dist/index.d.ts +149 -1
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +57 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -201,6 +201,8 @@ const client = createJrniClient('https://api.jrni.com', {
|
|
|
201
201
|
- `client.updateMember(companyId, memberId, request, authToken)` - Update a member's details
|
|
202
202
|
- `client.getCompany(companyId)` - Get a company by ID
|
|
203
203
|
- `client.getMember(companyId, memberId, authToken)` - Get a member by ID
|
|
204
|
+
- `client.cancelMemberBooking(companyId, memberId, bookingId, authToken)` - Cancel a member's booking
|
|
205
|
+
- `client.rescheduleBooking(companyId, memberId, bookingId, request, authToken)` - Reschedule a member's booking
|
|
204
206
|
- `client.setAuthToken(token)` - Set auth token for subsequent requests
|
|
205
207
|
|
|
206
208
|
#### `createBookingLabClient(options)`
|
|
@@ -288,6 +290,8 @@ Combined provider for applications using multiple API clients.
|
|
|
288
290
|
- `useUpdateMember(companyId, memberId, authToken)` - Update a member's details
|
|
289
291
|
- `useCompany(companyId, enabled?)` - Get a company by ID
|
|
290
292
|
- `useGetMember(companyId, memberId, authToken, enabled?)` - Get a member by ID
|
|
293
|
+
- `useCancelMemberBooking(companyId, memberId, authToken)` - Cancel a member's booking
|
|
294
|
+
- `useRescheduleBooking(companyId, memberId, authToken)` - Reschedule a member's booking
|
|
291
295
|
- `useJrniClient()` - Access the JRNI client directly
|
|
292
296
|
|
|
293
297
|
```typescript
|
|
@@ -375,6 +379,17 @@ const { data: company } = useCompany(37001);
|
|
|
375
379
|
const { data: member } = useGetMember(37001, 19, 'user-auth-token');
|
|
376
380
|
// member = { id: 19, name: "John Doe", email: "john@example.com", ... }
|
|
377
381
|
|
|
382
|
+
// Cancel a member's booking
|
|
383
|
+
const cancelMemberBookingMutation = useCancelMemberBooking(37001, 2, 'user-auth-token');
|
|
384
|
+
cancelMemberBookingMutation.mutate(29); // bookingId
|
|
385
|
+
|
|
386
|
+
// Reschedule a member's booking
|
|
387
|
+
const rescheduleMutation = useRescheduleBooking(37001, 2, 'user-auth-token');
|
|
388
|
+
rescheduleMutation.mutate({
|
|
389
|
+
bookingId: 29,
|
|
390
|
+
request: { date: '2026-03-03', time: '10:00', duration: 60, notify: true, notify_admin: true }
|
|
391
|
+
});
|
|
392
|
+
|
|
378
393
|
const client = useJrniClient();
|
|
379
394
|
```
|
|
380
395
|
|
|
@@ -470,6 +485,9 @@ import type {
|
|
|
470
485
|
CompanyResponse,
|
|
471
486
|
CompanySettings,
|
|
472
487
|
GetMemberResponse,
|
|
488
|
+
CancelMemberBookingResponse,
|
|
489
|
+
RescheduleBookingRequest,
|
|
490
|
+
RescheduleBookingResponse,
|
|
473
491
|
// BookingLab Types
|
|
474
492
|
Booking,
|
|
475
493
|
CreateBookingRequest,
|
package/dist/index.d.cts
CHANGED
|
@@ -943,6 +943,120 @@ interface CompanyResponse {
|
|
|
943
943
|
};
|
|
944
944
|
_links: Record<string, any>;
|
|
945
945
|
}
|
|
946
|
+
/**
|
|
947
|
+
* Cancel Member Booking Response
|
|
948
|
+
* Response from DELETE /{company_id}/members/{member_id}/bookings/{id}
|
|
949
|
+
*/
|
|
950
|
+
interface CancelMemberBookingResponse {
|
|
951
|
+
id: number;
|
|
952
|
+
full_describe: string;
|
|
953
|
+
describe: string;
|
|
954
|
+
resource_name: string;
|
|
955
|
+
datetime: string;
|
|
956
|
+
end_datetime: string;
|
|
957
|
+
duration: number;
|
|
958
|
+
on_waitlist: boolean;
|
|
959
|
+
company_id: number;
|
|
960
|
+
attended: boolean;
|
|
961
|
+
price: number;
|
|
962
|
+
paid: number;
|
|
963
|
+
quantity: number;
|
|
964
|
+
event_id: number;
|
|
965
|
+
purchase_id: number;
|
|
966
|
+
purchase_ref: string;
|
|
967
|
+
min_cancellation_time: string;
|
|
968
|
+
service_name: string;
|
|
969
|
+
service_id: number;
|
|
970
|
+
category_name: string;
|
|
971
|
+
time_zone: string;
|
|
972
|
+
status: string;
|
|
973
|
+
is_cancelled: boolean;
|
|
974
|
+
_embedded: {
|
|
975
|
+
payment_item: {
|
|
976
|
+
id: number;
|
|
977
|
+
price: number;
|
|
978
|
+
paid: number;
|
|
979
|
+
describe: string;
|
|
980
|
+
full_describe: string;
|
|
981
|
+
item_type: string;
|
|
982
|
+
_links: Record<string, any>;
|
|
983
|
+
};
|
|
984
|
+
answers: any[];
|
|
985
|
+
};
|
|
986
|
+
person_ids: number[];
|
|
987
|
+
settings: {
|
|
988
|
+
obfuscated_id: string;
|
|
989
|
+
who_updated: string;
|
|
990
|
+
cancel_reason: string | null;
|
|
991
|
+
late_cancel: number;
|
|
992
|
+
who_cancelled: string | null;
|
|
993
|
+
};
|
|
994
|
+
questions: Record<string, any>;
|
|
995
|
+
_links: Record<string, any>;
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* Reschedule Booking Request
|
|
999
|
+
* Body for PUT /{company_id}/members/{member_id}/bookings/{id}/reschedule
|
|
1000
|
+
*/
|
|
1001
|
+
interface RescheduleBookingRequest {
|
|
1002
|
+
/** New booking date in ISO-8601 format (YYYY-MM-DD) */
|
|
1003
|
+
date: string;
|
|
1004
|
+
/** New booking time in HH:mm format */
|
|
1005
|
+
time: string;
|
|
1006
|
+
/** New booking duration in minutes (defaults to current duration if not provided) */
|
|
1007
|
+
duration?: number;
|
|
1008
|
+
/** Whether to send notifications (defaults to true) */
|
|
1009
|
+
notify?: boolean;
|
|
1010
|
+
/** Whether to notify admins (defaults to true) */
|
|
1011
|
+
notify_admin?: boolean;
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* Reschedule Booking Response
|
|
1015
|
+
* Response from PUT /{company_id}/members/{member_id}/bookings/{id}/reschedule
|
|
1016
|
+
*/
|
|
1017
|
+
interface RescheduleBookingResponse {
|
|
1018
|
+
id: number;
|
|
1019
|
+
full_describe: string;
|
|
1020
|
+
describe: string;
|
|
1021
|
+
resource_name: string;
|
|
1022
|
+
datetime: string;
|
|
1023
|
+
end_datetime: string;
|
|
1024
|
+
duration: number;
|
|
1025
|
+
on_waitlist: boolean;
|
|
1026
|
+
company_id: number;
|
|
1027
|
+
attended: boolean;
|
|
1028
|
+
price: number;
|
|
1029
|
+
paid: number;
|
|
1030
|
+
quantity: number;
|
|
1031
|
+
event_id: number;
|
|
1032
|
+
purchase_id: number;
|
|
1033
|
+
purchase_ref: string;
|
|
1034
|
+
min_cancellation_time: string;
|
|
1035
|
+
service_name: string;
|
|
1036
|
+
service_id: number;
|
|
1037
|
+
category_name: string;
|
|
1038
|
+
time_zone: string;
|
|
1039
|
+
status: string;
|
|
1040
|
+
is_cancelled: boolean;
|
|
1041
|
+
_embedded: {
|
|
1042
|
+
payment_item: {
|
|
1043
|
+
id: number;
|
|
1044
|
+
price: number;
|
|
1045
|
+
paid: number;
|
|
1046
|
+
describe: string;
|
|
1047
|
+
full_describe: string;
|
|
1048
|
+
item_type: string;
|
|
1049
|
+
_links: Record<string, any>;
|
|
1050
|
+
};
|
|
1051
|
+
answers: any[];
|
|
1052
|
+
};
|
|
1053
|
+
person_ids: number[];
|
|
1054
|
+
settings: {
|
|
1055
|
+
obfuscated_id: string;
|
|
1056
|
+
};
|
|
1057
|
+
questions: Record<string, any>;
|
|
1058
|
+
_links: Record<string, any>;
|
|
1059
|
+
}
|
|
946
1060
|
|
|
947
1061
|
/**
|
|
948
1062
|
* Core API Client
|
|
@@ -1189,6 +1303,23 @@ declare class JrniClient extends ApiClient {
|
|
|
1189
1303
|
* @param companyId - The company ID
|
|
1190
1304
|
*/
|
|
1191
1305
|
getCompany(companyId: number): Promise<ApiResponse<CompanyResponse>>;
|
|
1306
|
+
/**
|
|
1307
|
+
* Cancel a member's booking
|
|
1308
|
+
* @param companyId - The company ID
|
|
1309
|
+
* @param memberId - The member ID
|
|
1310
|
+
* @param bookingId - The booking ID
|
|
1311
|
+
* @param authToken - Auth token for authenticated requests (required)
|
|
1312
|
+
*/
|
|
1313
|
+
cancelMemberBooking(companyId: number, memberId: number, bookingId: number, authToken: string): Promise<ApiResponse<CancelMemberBookingResponse>>;
|
|
1314
|
+
/**
|
|
1315
|
+
* Reschedule a member's booking
|
|
1316
|
+
* @param companyId - The company ID
|
|
1317
|
+
* @param memberId - The member ID
|
|
1318
|
+
* @param bookingId - The booking ID
|
|
1319
|
+
* @param request - The reschedule request data
|
|
1320
|
+
* @param authToken - Auth token for authenticated requests (required)
|
|
1321
|
+
*/
|
|
1322
|
+
rescheduleBooking(companyId: number, memberId: number, bookingId: number, request: RescheduleBookingRequest, authToken: string): Promise<ApiResponse<RescheduleBookingResponse>>;
|
|
1192
1323
|
/**
|
|
1193
1324
|
* Update JRNI configuration
|
|
1194
1325
|
*/
|
|
@@ -1369,6 +1500,23 @@ declare function useGetMember(companyId: number, memberId: number, authToken: st
|
|
|
1369
1500
|
* @param enabled - Whether the query should run
|
|
1370
1501
|
*/
|
|
1371
1502
|
declare function useCompany(companyId: number, enabled?: boolean): _tanstack_react_query.UseQueryResult<CompanyResponse, Error>;
|
|
1503
|
+
/**
|
|
1504
|
+
* Hook for cancelling a member's booking
|
|
1505
|
+
* @param companyId - The company ID
|
|
1506
|
+
* @param memberId - The member ID
|
|
1507
|
+
* @param authToken - Auth token for authenticated requests (required)
|
|
1508
|
+
*/
|
|
1509
|
+
declare function useCancelMemberBooking(companyId: number, memberId: number, authToken: string): _tanstack_react_query.UseMutationResult<CancelMemberBookingResponse, Error, number, unknown>;
|
|
1510
|
+
/**
|
|
1511
|
+
* Hook for rescheduling a member's booking
|
|
1512
|
+
* @param companyId - The company ID
|
|
1513
|
+
* @param memberId - The member ID
|
|
1514
|
+
* @param authToken - Auth token for authenticated requests (required)
|
|
1515
|
+
*/
|
|
1516
|
+
declare function useRescheduleBooking(companyId: number, memberId: number, authToken: string): _tanstack_react_query.UseMutationResult<RescheduleBookingResponse, Error, {
|
|
1517
|
+
bookingId: number;
|
|
1518
|
+
request: RescheduleBookingRequest;
|
|
1519
|
+
}, unknown>;
|
|
1372
1520
|
|
|
1373
1521
|
/**
|
|
1374
1522
|
* Hook for fetching client details
|
|
@@ -1407,4 +1555,4 @@ declare function useResetPassword(memberId: number, companyId: number, authToken
|
|
|
1407
1555
|
*/
|
|
1408
1556
|
declare function useFindClientByEmail(companyId: number, email: string, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<FindClientByEmailResponse, Error>;
|
|
1409
1557
|
|
|
1410
|
-
export { type AddBasketItemRequest, type AddServiceItemAssets, type AddServiceItemQuestion, type AddServiceItemRequest, ApiClient, type ApiClientConfig, ApiClientProvider, type ApiError, type ApiResponse, type AvailabilityTime, type AvailabilityTimesResponse, type Booking, type BookingAnswer, BookingLabClient, BookingLabProvider, type BookingPaymentItem, type BookingSettings, type CancelBookingRequest, type CancelBookingResponse, 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, JrniProvider, type JrniService, type ListBookingsParams, type ListBookingsResponse, type Location, type LocationsResponse, type LoginRequest, type LoginResponse, type MemberBooking, type MemberBookingsResponse, MemberType, type PersonImage, type PersonImagesResponse, type Question, type QuestionOption, type QuestionsResponse, type RequestOptions, type ResetPasswordRequest, type Resource, type ResourceLinks, type ResourcesResponse, type Service, type ServiceItemResponse, type ServicesResponse, type TimeSlot, type TimesResponse, type UpdateClientAnswer, type UpdateClientAnswerEntry, type UpdateClientDetailsData, type UpdateClientExtraInfo, type UpdateClientNotificationPreferences, type UpdateClientQuestionEntry, type UpdateClientRequest, type UpdateClientResponse, type UpdateMemberDetailsData, type UpdateMemberRequest, type UpdateMemberResponse, type Vehicle, type VehiclesResponse, createBookingLabClient, createJrniClient, useAddServiceItem, useApiClientContext, useBookingLabClient, useBookingLabContext, useCancelBooking, useCheckoutBasket, useChildCompanies, useClearBaskets, useClientDetails, useCompany, useCreateBasket, useCreateClient, useDates, useFindClientByEmail, useForgottenPassword, useGetMember, useJrniClient, useJrniContext, useListBookings, useLogin, useQuestions, useResetPassword, useResources, useServices, useTimes, useUpdateClient, useUpdateMember };
|
|
1558
|
+
export { type AddBasketItemRequest, type AddServiceItemAssets, type AddServiceItemQuestion, type AddServiceItemRequest, ApiClient, type ApiClientConfig, ApiClientProvider, type ApiError, type ApiResponse, type AvailabilityTime, type AvailabilityTimesResponse, type Booking, type BookingAnswer, BookingLabClient, BookingLabProvider, type BookingPaymentItem, type BookingSettings, type CancelBookingRequest, type CancelBookingResponse, type CancelMemberBookingResponse, type CheckoutBasketClient, type CheckoutBasketRequest, type CheckoutBasketResponse, type ChildCompaniesResponse, type ChildCompany, type ChildCompanyAddress, type ChildCompanySettings, type ClearBasketsResponse, type ClientDetailsQuestion, type ClientDetailsResponse, type CompanyResponse, type CompanySettings, type CreateBasketRequest, type CreateBasketResponse, type CreateBookingRequest, type CreateClientRequest, type CreateClientResponse, type DateSlot, type DatesResponse, type FindClientByEmailResponse, type ForgottenPasswordRequest, type ForgottenPasswordResponse, type GetChildCompaniesParams, type GetDatesParams, type GetMemberResponse, type GetQuestionsParams, type GetTimesParams, type JrniBooking, JrniClient, type JrniConfig, JrniProvider, type JrniService, type ListBookingsParams, type ListBookingsResponse, type Location, type LocationsResponse, type LoginRequest, type LoginResponse, type MemberBooking, type MemberBookingsResponse, MemberType, type PersonImage, type PersonImagesResponse, type Question, type QuestionOption, type QuestionsResponse, type RequestOptions, type RescheduleBookingRequest, type RescheduleBookingResponse, type ResetPasswordRequest, type Resource, type ResourceLinks, type ResourcesResponse, type Service, type ServiceItemResponse, type ServicesResponse, type TimeSlot, type TimesResponse, type UpdateClientAnswer, type UpdateClientAnswerEntry, type UpdateClientDetailsData, type UpdateClientExtraInfo, type UpdateClientNotificationPreferences, type UpdateClientQuestionEntry, type UpdateClientRequest, type UpdateClientResponse, type UpdateMemberDetailsData, type UpdateMemberRequest, type UpdateMemberResponse, type Vehicle, type VehiclesResponse, createBookingLabClient, createJrniClient, useAddServiceItem, useApiClientContext, useBookingLabClient, useBookingLabContext, useCancelBooking, useCancelMemberBooking, useCheckoutBasket, useChildCompanies, useClearBaskets, useClientDetails, useCompany, useCreateBasket, useCreateClient, useDates, useFindClientByEmail, useForgottenPassword, useGetMember, useJrniClient, useJrniContext, useListBookings, useLogin, useQuestions, useRescheduleBooking, useResetPassword, useResources, useServices, useTimes, useUpdateClient, useUpdateMember };
|
package/dist/index.d.ts
CHANGED
|
@@ -943,6 +943,120 @@ interface CompanyResponse {
|
|
|
943
943
|
};
|
|
944
944
|
_links: Record<string, any>;
|
|
945
945
|
}
|
|
946
|
+
/**
|
|
947
|
+
* Cancel Member Booking Response
|
|
948
|
+
* Response from DELETE /{company_id}/members/{member_id}/bookings/{id}
|
|
949
|
+
*/
|
|
950
|
+
interface CancelMemberBookingResponse {
|
|
951
|
+
id: number;
|
|
952
|
+
full_describe: string;
|
|
953
|
+
describe: string;
|
|
954
|
+
resource_name: string;
|
|
955
|
+
datetime: string;
|
|
956
|
+
end_datetime: string;
|
|
957
|
+
duration: number;
|
|
958
|
+
on_waitlist: boolean;
|
|
959
|
+
company_id: number;
|
|
960
|
+
attended: boolean;
|
|
961
|
+
price: number;
|
|
962
|
+
paid: number;
|
|
963
|
+
quantity: number;
|
|
964
|
+
event_id: number;
|
|
965
|
+
purchase_id: number;
|
|
966
|
+
purchase_ref: string;
|
|
967
|
+
min_cancellation_time: string;
|
|
968
|
+
service_name: string;
|
|
969
|
+
service_id: number;
|
|
970
|
+
category_name: string;
|
|
971
|
+
time_zone: string;
|
|
972
|
+
status: string;
|
|
973
|
+
is_cancelled: boolean;
|
|
974
|
+
_embedded: {
|
|
975
|
+
payment_item: {
|
|
976
|
+
id: number;
|
|
977
|
+
price: number;
|
|
978
|
+
paid: number;
|
|
979
|
+
describe: string;
|
|
980
|
+
full_describe: string;
|
|
981
|
+
item_type: string;
|
|
982
|
+
_links: Record<string, any>;
|
|
983
|
+
};
|
|
984
|
+
answers: any[];
|
|
985
|
+
};
|
|
986
|
+
person_ids: number[];
|
|
987
|
+
settings: {
|
|
988
|
+
obfuscated_id: string;
|
|
989
|
+
who_updated: string;
|
|
990
|
+
cancel_reason: string | null;
|
|
991
|
+
late_cancel: number;
|
|
992
|
+
who_cancelled: string | null;
|
|
993
|
+
};
|
|
994
|
+
questions: Record<string, any>;
|
|
995
|
+
_links: Record<string, any>;
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* Reschedule Booking Request
|
|
999
|
+
* Body for PUT /{company_id}/members/{member_id}/bookings/{id}/reschedule
|
|
1000
|
+
*/
|
|
1001
|
+
interface RescheduleBookingRequest {
|
|
1002
|
+
/** New booking date in ISO-8601 format (YYYY-MM-DD) */
|
|
1003
|
+
date: string;
|
|
1004
|
+
/** New booking time in HH:mm format */
|
|
1005
|
+
time: string;
|
|
1006
|
+
/** New booking duration in minutes (defaults to current duration if not provided) */
|
|
1007
|
+
duration?: number;
|
|
1008
|
+
/** Whether to send notifications (defaults to true) */
|
|
1009
|
+
notify?: boolean;
|
|
1010
|
+
/** Whether to notify admins (defaults to true) */
|
|
1011
|
+
notify_admin?: boolean;
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* Reschedule Booking Response
|
|
1015
|
+
* Response from PUT /{company_id}/members/{member_id}/bookings/{id}/reschedule
|
|
1016
|
+
*/
|
|
1017
|
+
interface RescheduleBookingResponse {
|
|
1018
|
+
id: number;
|
|
1019
|
+
full_describe: string;
|
|
1020
|
+
describe: string;
|
|
1021
|
+
resource_name: string;
|
|
1022
|
+
datetime: string;
|
|
1023
|
+
end_datetime: string;
|
|
1024
|
+
duration: number;
|
|
1025
|
+
on_waitlist: boolean;
|
|
1026
|
+
company_id: number;
|
|
1027
|
+
attended: boolean;
|
|
1028
|
+
price: number;
|
|
1029
|
+
paid: number;
|
|
1030
|
+
quantity: number;
|
|
1031
|
+
event_id: number;
|
|
1032
|
+
purchase_id: number;
|
|
1033
|
+
purchase_ref: string;
|
|
1034
|
+
min_cancellation_time: string;
|
|
1035
|
+
service_name: string;
|
|
1036
|
+
service_id: number;
|
|
1037
|
+
category_name: string;
|
|
1038
|
+
time_zone: string;
|
|
1039
|
+
status: string;
|
|
1040
|
+
is_cancelled: boolean;
|
|
1041
|
+
_embedded: {
|
|
1042
|
+
payment_item: {
|
|
1043
|
+
id: number;
|
|
1044
|
+
price: number;
|
|
1045
|
+
paid: number;
|
|
1046
|
+
describe: string;
|
|
1047
|
+
full_describe: string;
|
|
1048
|
+
item_type: string;
|
|
1049
|
+
_links: Record<string, any>;
|
|
1050
|
+
};
|
|
1051
|
+
answers: any[];
|
|
1052
|
+
};
|
|
1053
|
+
person_ids: number[];
|
|
1054
|
+
settings: {
|
|
1055
|
+
obfuscated_id: string;
|
|
1056
|
+
};
|
|
1057
|
+
questions: Record<string, any>;
|
|
1058
|
+
_links: Record<string, any>;
|
|
1059
|
+
}
|
|
946
1060
|
|
|
947
1061
|
/**
|
|
948
1062
|
* Core API Client
|
|
@@ -1189,6 +1303,23 @@ declare class JrniClient extends ApiClient {
|
|
|
1189
1303
|
* @param companyId - The company ID
|
|
1190
1304
|
*/
|
|
1191
1305
|
getCompany(companyId: number): Promise<ApiResponse<CompanyResponse>>;
|
|
1306
|
+
/**
|
|
1307
|
+
* Cancel a member's booking
|
|
1308
|
+
* @param companyId - The company ID
|
|
1309
|
+
* @param memberId - The member ID
|
|
1310
|
+
* @param bookingId - The booking ID
|
|
1311
|
+
* @param authToken - Auth token for authenticated requests (required)
|
|
1312
|
+
*/
|
|
1313
|
+
cancelMemberBooking(companyId: number, memberId: number, bookingId: number, authToken: string): Promise<ApiResponse<CancelMemberBookingResponse>>;
|
|
1314
|
+
/**
|
|
1315
|
+
* Reschedule a member's booking
|
|
1316
|
+
* @param companyId - The company ID
|
|
1317
|
+
* @param memberId - The member ID
|
|
1318
|
+
* @param bookingId - The booking ID
|
|
1319
|
+
* @param request - The reschedule request data
|
|
1320
|
+
* @param authToken - Auth token for authenticated requests (required)
|
|
1321
|
+
*/
|
|
1322
|
+
rescheduleBooking(companyId: number, memberId: number, bookingId: number, request: RescheduleBookingRequest, authToken: string): Promise<ApiResponse<RescheduleBookingResponse>>;
|
|
1192
1323
|
/**
|
|
1193
1324
|
* Update JRNI configuration
|
|
1194
1325
|
*/
|
|
@@ -1369,6 +1500,23 @@ declare function useGetMember(companyId: number, memberId: number, authToken: st
|
|
|
1369
1500
|
* @param enabled - Whether the query should run
|
|
1370
1501
|
*/
|
|
1371
1502
|
declare function useCompany(companyId: number, enabled?: boolean): _tanstack_react_query.UseQueryResult<CompanyResponse, Error>;
|
|
1503
|
+
/**
|
|
1504
|
+
* Hook for cancelling a member's booking
|
|
1505
|
+
* @param companyId - The company ID
|
|
1506
|
+
* @param memberId - The member ID
|
|
1507
|
+
* @param authToken - Auth token for authenticated requests (required)
|
|
1508
|
+
*/
|
|
1509
|
+
declare function useCancelMemberBooking(companyId: number, memberId: number, authToken: string): _tanstack_react_query.UseMutationResult<CancelMemberBookingResponse, Error, number, unknown>;
|
|
1510
|
+
/**
|
|
1511
|
+
* Hook for rescheduling a member's booking
|
|
1512
|
+
* @param companyId - The company ID
|
|
1513
|
+
* @param memberId - The member ID
|
|
1514
|
+
* @param authToken - Auth token for authenticated requests (required)
|
|
1515
|
+
*/
|
|
1516
|
+
declare function useRescheduleBooking(companyId: number, memberId: number, authToken: string): _tanstack_react_query.UseMutationResult<RescheduleBookingResponse, Error, {
|
|
1517
|
+
bookingId: number;
|
|
1518
|
+
request: RescheduleBookingRequest;
|
|
1519
|
+
}, unknown>;
|
|
1372
1520
|
|
|
1373
1521
|
/**
|
|
1374
1522
|
* Hook for fetching client details
|
|
@@ -1407,4 +1555,4 @@ declare function useResetPassword(memberId: number, companyId: number, authToken
|
|
|
1407
1555
|
*/
|
|
1408
1556
|
declare function useFindClientByEmail(companyId: number, email: string, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<FindClientByEmailResponse, Error>;
|
|
1409
1557
|
|
|
1410
|
-
export { type AddBasketItemRequest, type AddServiceItemAssets, type AddServiceItemQuestion, type AddServiceItemRequest, ApiClient, type ApiClientConfig, ApiClientProvider, type ApiError, type ApiResponse, type AvailabilityTime, type AvailabilityTimesResponse, type Booking, type BookingAnswer, BookingLabClient, BookingLabProvider, type BookingPaymentItem, type BookingSettings, type CancelBookingRequest, type CancelBookingResponse, 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, JrniProvider, type JrniService, type ListBookingsParams, type ListBookingsResponse, type Location, type LocationsResponse, type LoginRequest, type LoginResponse, type MemberBooking, type MemberBookingsResponse, MemberType, type PersonImage, type PersonImagesResponse, type Question, type QuestionOption, type QuestionsResponse, type RequestOptions, type ResetPasswordRequest, type Resource, type ResourceLinks, type ResourcesResponse, type Service, type ServiceItemResponse, type ServicesResponse, type TimeSlot, type TimesResponse, type UpdateClientAnswer, type UpdateClientAnswerEntry, type UpdateClientDetailsData, type UpdateClientExtraInfo, type UpdateClientNotificationPreferences, type UpdateClientQuestionEntry, type UpdateClientRequest, type UpdateClientResponse, type UpdateMemberDetailsData, type UpdateMemberRequest, type UpdateMemberResponse, type Vehicle, type VehiclesResponse, createBookingLabClient, createJrniClient, useAddServiceItem, useApiClientContext, useBookingLabClient, useBookingLabContext, useCancelBooking, useCheckoutBasket, useChildCompanies, useClearBaskets, useClientDetails, useCompany, useCreateBasket, useCreateClient, useDates, useFindClientByEmail, useForgottenPassword, useGetMember, useJrniClient, useJrniContext, useListBookings, useLogin, useQuestions, useResetPassword, useResources, useServices, useTimes, useUpdateClient, useUpdateMember };
|
|
1558
|
+
export { type AddBasketItemRequest, type AddServiceItemAssets, type AddServiceItemQuestion, type AddServiceItemRequest, ApiClient, type ApiClientConfig, ApiClientProvider, type ApiError, type ApiResponse, type AvailabilityTime, type AvailabilityTimesResponse, type Booking, type BookingAnswer, BookingLabClient, BookingLabProvider, type BookingPaymentItem, type BookingSettings, type CancelBookingRequest, type CancelBookingResponse, type CancelMemberBookingResponse, type CheckoutBasketClient, type CheckoutBasketRequest, type CheckoutBasketResponse, type ChildCompaniesResponse, type ChildCompany, type ChildCompanyAddress, type ChildCompanySettings, type ClearBasketsResponse, type ClientDetailsQuestion, type ClientDetailsResponse, type CompanyResponse, type CompanySettings, type CreateBasketRequest, type CreateBasketResponse, type CreateBookingRequest, type CreateClientRequest, type CreateClientResponse, type DateSlot, type DatesResponse, type FindClientByEmailResponse, type ForgottenPasswordRequest, type ForgottenPasswordResponse, type GetChildCompaniesParams, type GetDatesParams, type GetMemberResponse, type GetQuestionsParams, type GetTimesParams, type JrniBooking, JrniClient, type JrniConfig, JrniProvider, type JrniService, type ListBookingsParams, type ListBookingsResponse, type Location, type LocationsResponse, type LoginRequest, type LoginResponse, type MemberBooking, type MemberBookingsResponse, MemberType, type PersonImage, type PersonImagesResponse, type Question, type QuestionOption, type QuestionsResponse, type RequestOptions, type RescheduleBookingRequest, type RescheduleBookingResponse, type ResetPasswordRequest, type Resource, type ResourceLinks, type ResourcesResponse, type Service, type ServiceItemResponse, type ServicesResponse, type TimeSlot, type TimesResponse, type UpdateClientAnswer, type UpdateClientAnswerEntry, type UpdateClientDetailsData, type UpdateClientExtraInfo, type UpdateClientNotificationPreferences, type UpdateClientQuestionEntry, type UpdateClientRequest, type UpdateClientResponse, type UpdateMemberDetailsData, type UpdateMemberRequest, type UpdateMemberResponse, type Vehicle, type VehiclesResponse, createBookingLabClient, createJrniClient, useAddServiceItem, useApiClientContext, useBookingLabClient, useBookingLabContext, useCancelBooking, useCancelMemberBooking, useCheckoutBasket, useChildCompanies, useClearBaskets, useClientDetails, useCompany, useCreateBasket, useCreateClient, useDates, useFindClientByEmail, useForgottenPassword, useGetMember, useJrniClient, useJrniContext, useListBookings, useLogin, useQuestions, useRescheduleBooking, useResetPassword, useResources, useServices, useTimes, useUpdateClient, useUpdateMember };
|
package/dist/index.js
CHANGED
|
@@ -596,6 +596,44 @@ var JrniClient = class extends ApiClient {
|
|
|
596
596
|
}
|
|
597
597
|
);
|
|
598
598
|
}
|
|
599
|
+
/**
|
|
600
|
+
* Cancel a member's booking
|
|
601
|
+
* @param companyId - The company ID
|
|
602
|
+
* @param memberId - The member ID
|
|
603
|
+
* @param bookingId - The booking ID
|
|
604
|
+
* @param authToken - Auth token for authenticated requests (required)
|
|
605
|
+
*/
|
|
606
|
+
async cancelMemberBooking(companyId, memberId, bookingId, authToken) {
|
|
607
|
+
return this.delete(
|
|
608
|
+
`/${companyId}/members/${memberId}/bookings/${bookingId}`,
|
|
609
|
+
{
|
|
610
|
+
headers: {
|
|
611
|
+
...this.getDefaultHeaders(),
|
|
612
|
+
"Auth-Token": authToken
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
);
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Reschedule a member's booking
|
|
619
|
+
* @param companyId - The company ID
|
|
620
|
+
* @param memberId - The member ID
|
|
621
|
+
* @param bookingId - The booking ID
|
|
622
|
+
* @param request - The reschedule request data
|
|
623
|
+
* @param authToken - Auth token for authenticated requests (required)
|
|
624
|
+
*/
|
|
625
|
+
async rescheduleBooking(companyId, memberId, bookingId, request, authToken) {
|
|
626
|
+
return this.put(
|
|
627
|
+
`/${companyId}/members/${memberId}/bookings/${bookingId}/reschedule`,
|
|
628
|
+
request,
|
|
629
|
+
{
|
|
630
|
+
headers: {
|
|
631
|
+
...this.getDefaultHeaders(),
|
|
632
|
+
"Auth-Token": authToken
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
);
|
|
636
|
+
}
|
|
599
637
|
/**
|
|
600
638
|
* Update JRNI configuration
|
|
601
639
|
*/
|
|
@@ -891,6 +929,24 @@ function useCompany(companyId, enabled = true) {
|
|
|
891
929
|
enabled: enabled && !!companyId
|
|
892
930
|
});
|
|
893
931
|
}
|
|
932
|
+
function useCancelMemberBooking(companyId, memberId, authToken) {
|
|
933
|
+
const client = useJrniClient();
|
|
934
|
+
return reactQuery.useMutation({
|
|
935
|
+
mutationFn: async (bookingId) => {
|
|
936
|
+
const response = await client.cancelMemberBooking(companyId, memberId, bookingId, authToken);
|
|
937
|
+
return response.data;
|
|
938
|
+
}
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
function useRescheduleBooking(companyId, memberId, authToken) {
|
|
942
|
+
const client = useJrniClient();
|
|
943
|
+
return reactQuery.useMutation({
|
|
944
|
+
mutationFn: async ({ bookingId, request }) => {
|
|
945
|
+
const response = await client.rescheduleBooking(companyId, memberId, bookingId, request, authToken);
|
|
946
|
+
return response.data;
|
|
947
|
+
}
|
|
948
|
+
});
|
|
949
|
+
}
|
|
894
950
|
function useClientDetails(companyId, clientToken, enabled = true) {
|
|
895
951
|
const client = useBookingLabClient();
|
|
896
952
|
return reactQuery.useQuery({
|
|
@@ -955,6 +1011,7 @@ exports.useApiClientContext = useApiClientContext;
|
|
|
955
1011
|
exports.useBookingLabClient = useBookingLabClient;
|
|
956
1012
|
exports.useBookingLabContext = useBookingLabContext;
|
|
957
1013
|
exports.useCancelBooking = useCancelBooking;
|
|
1014
|
+
exports.useCancelMemberBooking = useCancelMemberBooking;
|
|
958
1015
|
exports.useCheckoutBasket = useCheckoutBasket;
|
|
959
1016
|
exports.useChildCompanies = useChildCompanies;
|
|
960
1017
|
exports.useClearBaskets = useClearBaskets;
|
|
@@ -971,6 +1028,7 @@ exports.useJrniContext = useJrniContext;
|
|
|
971
1028
|
exports.useListBookings = useListBookings;
|
|
972
1029
|
exports.useLogin = useLogin;
|
|
973
1030
|
exports.useQuestions = useQuestions;
|
|
1031
|
+
exports.useRescheduleBooking = useRescheduleBooking;
|
|
974
1032
|
exports.useResetPassword = useResetPassword;
|
|
975
1033
|
exports.useResources = useResources;
|
|
976
1034
|
exports.useServices = useServices;
|