@bookinglab/booking-journey-api 2.10.0 → 2.11.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 +1 -0
- package/dist/index.d.cts +367 -1
- package/dist/index.d.ts +367 -1
- package/dist/index.js +171 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +166 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1222,6 +1222,290 @@ interface BookingLabGetQuestionsResponse {
|
|
|
1222
1222
|
_links?: Record<string, any>;
|
|
1223
1223
|
[key: string]: any;
|
|
1224
1224
|
}
|
|
1225
|
+
interface BookingLabDay {
|
|
1226
|
+
start_date: string;
|
|
1227
|
+
count: number;
|
|
1228
|
+
available: boolean;
|
|
1229
|
+
}
|
|
1230
|
+
interface BookingLabGetDaysParams {
|
|
1231
|
+
resource_id?: number;
|
|
1232
|
+
}
|
|
1233
|
+
interface BookingLabGetDaysResponse {
|
|
1234
|
+
dates: BookingLabDay[];
|
|
1235
|
+
_links?: Record<string, any>;
|
|
1236
|
+
[key: string]: any;
|
|
1237
|
+
}
|
|
1238
|
+
interface BookingLabTime {
|
|
1239
|
+
start: string;
|
|
1240
|
+
available: boolean;
|
|
1241
|
+
_links?: Record<string, any>;
|
|
1242
|
+
}
|
|
1243
|
+
interface BookingLabGetTimesParams {
|
|
1244
|
+
/** Comma-separated list of resource IDs, e.g. "1,2,3" */
|
|
1245
|
+
resource_ids?: string;
|
|
1246
|
+
}
|
|
1247
|
+
interface BookingLabGetTimesResponse {
|
|
1248
|
+
times: BookingLabTime[];
|
|
1249
|
+
_links?: Record<string, any>;
|
|
1250
|
+
[key: string]: any;
|
|
1251
|
+
}
|
|
1252
|
+
interface BookingLabAddBasketServiceItemQuestion {
|
|
1253
|
+
id: string | number;
|
|
1254
|
+
answer: string;
|
|
1255
|
+
[key: string]: any;
|
|
1256
|
+
}
|
|
1257
|
+
interface BookingLabAddBasketServiceItemRequest {
|
|
1258
|
+
company_id: number;
|
|
1259
|
+
start: string;
|
|
1260
|
+
service_id: number;
|
|
1261
|
+
duration: number;
|
|
1262
|
+
questions: BookingLabAddBasketServiceItemQuestion[];
|
|
1263
|
+
[key: string]: any;
|
|
1264
|
+
}
|
|
1265
|
+
interface BookingLabAddBasketServiceItemHeaders {
|
|
1266
|
+
clientToken: string;
|
|
1267
|
+
authToken: string;
|
|
1268
|
+
companyId: number;
|
|
1269
|
+
}
|
|
1270
|
+
interface BookingLabHeldAsset {
|
|
1271
|
+
company_id: number;
|
|
1272
|
+
resource_id: number;
|
|
1273
|
+
}
|
|
1274
|
+
interface BookingLabAddBasketServiceItemResponse {
|
|
1275
|
+
id: string;
|
|
1276
|
+
type: string;
|
|
1277
|
+
company_id: number;
|
|
1278
|
+
service_id: number;
|
|
1279
|
+
resource_id?: number;
|
|
1280
|
+
questions: BookingLabAddBasketServiceItemQuestion[];
|
|
1281
|
+
duration: number;
|
|
1282
|
+
start: string;
|
|
1283
|
+
expires: string;
|
|
1284
|
+
total_price: number;
|
|
1285
|
+
total_price_in_major_units: number;
|
|
1286
|
+
requested_assets: any[];
|
|
1287
|
+
held_assets: BookingLabHeldAsset[];
|
|
1288
|
+
_links?: Record<string, {
|
|
1289
|
+
href: string;
|
|
1290
|
+
templated?: boolean;
|
|
1291
|
+
}>;
|
|
1292
|
+
[key: string]: any;
|
|
1293
|
+
}
|
|
1294
|
+
interface BookingLabCreateBasketRequest {
|
|
1295
|
+
company_id: number;
|
|
1296
|
+
}
|
|
1297
|
+
interface BookingLabCreateBasketHeaders {
|
|
1298
|
+
clientToken: string;
|
|
1299
|
+
companyId: number;
|
|
1300
|
+
authToken?: string;
|
|
1301
|
+
memberId?: number;
|
|
1302
|
+
}
|
|
1303
|
+
interface BookingLabCreateBasketResponse {
|
|
1304
|
+
id: string;
|
|
1305
|
+
company_id: number;
|
|
1306
|
+
total_price: number;
|
|
1307
|
+
total_due_price: number;
|
|
1308
|
+
total_price_in_major_units: number;
|
|
1309
|
+
total_due_price_in_major_units: number;
|
|
1310
|
+
service_items: any[];
|
|
1311
|
+
event_items: any[];
|
|
1312
|
+
_embedded?: {
|
|
1313
|
+
items: any[];
|
|
1314
|
+
items_removed: any[];
|
|
1315
|
+
};
|
|
1316
|
+
_links?: Record<string, any>;
|
|
1317
|
+
[key: string]: any;
|
|
1318
|
+
}
|
|
1319
|
+
interface BookingLabCheckoutBasketRequest {
|
|
1320
|
+
company_id: number;
|
|
1321
|
+
client: {
|
|
1322
|
+
id: number;
|
|
1323
|
+
[key: string]: any;
|
|
1324
|
+
};
|
|
1325
|
+
[key: string]: any;
|
|
1326
|
+
}
|
|
1327
|
+
interface BookingLabCheckoutBasketHeaders {
|
|
1328
|
+
clientToken: string;
|
|
1329
|
+
authToken: string;
|
|
1330
|
+
companyId: number;
|
|
1331
|
+
}
|
|
1332
|
+
interface BookingLabCheckoutBasketBooking {
|
|
1333
|
+
id: number;
|
|
1334
|
+
full_describe?: string;
|
|
1335
|
+
describe?: string;
|
|
1336
|
+
resource_name?: string;
|
|
1337
|
+
datetime?: string;
|
|
1338
|
+
end_datetime?: string;
|
|
1339
|
+
duration?: number;
|
|
1340
|
+
duration_span?: number;
|
|
1341
|
+
listed_duration?: number;
|
|
1342
|
+
on_waitlist?: boolean;
|
|
1343
|
+
company_id?: number;
|
|
1344
|
+
attended?: boolean;
|
|
1345
|
+
price?: number;
|
|
1346
|
+
due_now?: number;
|
|
1347
|
+
paid?: number;
|
|
1348
|
+
quantity?: number;
|
|
1349
|
+
event_id?: number;
|
|
1350
|
+
service_id?: number;
|
|
1351
|
+
purchase_id?: number;
|
|
1352
|
+
purchase_ref?: string;
|
|
1353
|
+
settings?: Record<string, any>;
|
|
1354
|
+
slot_settings?: Record<string, any>;
|
|
1355
|
+
min_cancellation_time?: string;
|
|
1356
|
+
service_name?: string;
|
|
1357
|
+
time_zone?: string;
|
|
1358
|
+
address?: Record<string, any>;
|
|
1359
|
+
booking_type?: string;
|
|
1360
|
+
slot_id?: number;
|
|
1361
|
+
first_name?: string;
|
|
1362
|
+
last_name?: string;
|
|
1363
|
+
email?: string;
|
|
1364
|
+
is_cancelled?: boolean;
|
|
1365
|
+
_embedded?: {
|
|
1366
|
+
answers?: any[];
|
|
1367
|
+
survey_answers?: any[];
|
|
1368
|
+
[key: string]: any;
|
|
1369
|
+
};
|
|
1370
|
+
person_ids?: number[];
|
|
1371
|
+
price_in_major_units?: number;
|
|
1372
|
+
paid_in_major_units?: number;
|
|
1373
|
+
due_now_in_major_units?: number;
|
|
1374
|
+
method_of_appointment?: string;
|
|
1375
|
+
status?: number;
|
|
1376
|
+
member_can_confirm_now?: boolean;
|
|
1377
|
+
member_will_need_to_confirm_in_the_future?: boolean;
|
|
1378
|
+
notification_preferences?: Record<string, any>;
|
|
1379
|
+
_links?: Record<string, {
|
|
1380
|
+
href: string;
|
|
1381
|
+
templated?: boolean;
|
|
1382
|
+
}>;
|
|
1383
|
+
[key: string]: any;
|
|
1384
|
+
}
|
|
1385
|
+
interface BookingLabCheckoutBasketEmbeddedClient {
|
|
1386
|
+
first_name?: string;
|
|
1387
|
+
last_name?: string;
|
|
1388
|
+
name?: string;
|
|
1389
|
+
email?: string;
|
|
1390
|
+
country?: string;
|
|
1391
|
+
mobile?: string;
|
|
1392
|
+
phone_prefix?: string;
|
|
1393
|
+
phone_prefix_country_code?: string;
|
|
1394
|
+
mobile_prefix?: string;
|
|
1395
|
+
mobile_prefix_country_code?: string;
|
|
1396
|
+
id: number;
|
|
1397
|
+
answers?: Array<{
|
|
1398
|
+
question_id: number;
|
|
1399
|
+
name: string;
|
|
1400
|
+
answer: any;
|
|
1401
|
+
answer_id: any;
|
|
1402
|
+
}>;
|
|
1403
|
+
deleted?: boolean;
|
|
1404
|
+
notifications?: Record<string, any>;
|
|
1405
|
+
default_company_id?: number;
|
|
1406
|
+
locale?: string;
|
|
1407
|
+
consent?: boolean;
|
|
1408
|
+
notification_preferences?: Record<string, any>;
|
|
1409
|
+
_links?: Record<string, {
|
|
1410
|
+
href: string;
|
|
1411
|
+
templated?: boolean;
|
|
1412
|
+
}>;
|
|
1413
|
+
[key: string]: any;
|
|
1414
|
+
}
|
|
1415
|
+
interface BookingLabCheckoutBasketEmbeddedMember {
|
|
1416
|
+
id: number;
|
|
1417
|
+
name?: string;
|
|
1418
|
+
first_name?: string;
|
|
1419
|
+
last_name?: string;
|
|
1420
|
+
wallet_amount?: number;
|
|
1421
|
+
email?: string;
|
|
1422
|
+
country?: string;
|
|
1423
|
+
phone_prefix?: string;
|
|
1424
|
+
phone_prefix_country_code?: string;
|
|
1425
|
+
mobile?: string;
|
|
1426
|
+
mobile_prefix?: string;
|
|
1427
|
+
mobile_prefix_country_code?: string;
|
|
1428
|
+
path?: string;
|
|
1429
|
+
company_id?: number;
|
|
1430
|
+
has_active_wallet?: boolean;
|
|
1431
|
+
default_company_id?: number;
|
|
1432
|
+
has_wallet?: boolean;
|
|
1433
|
+
consent?: boolean;
|
|
1434
|
+
locale?: string;
|
|
1435
|
+
answers?: Array<{
|
|
1436
|
+
question_id: number;
|
|
1437
|
+
name: string;
|
|
1438
|
+
answer: any;
|
|
1439
|
+
}>;
|
|
1440
|
+
q?: Record<string, {
|
|
1441
|
+
answer: any;
|
|
1442
|
+
answer_id: any;
|
|
1443
|
+
name: string;
|
|
1444
|
+
}>;
|
|
1445
|
+
_links?: Record<string, {
|
|
1446
|
+
href: string;
|
|
1447
|
+
templated?: boolean;
|
|
1448
|
+
}>;
|
|
1449
|
+
[key: string]: any;
|
|
1450
|
+
}
|
|
1451
|
+
interface BookingLabDeleteBasketHeaders {
|
|
1452
|
+
clientToken: string;
|
|
1453
|
+
authToken: string;
|
|
1454
|
+
companyId: number;
|
|
1455
|
+
}
|
|
1456
|
+
interface BookingLabDeleteBasketResponse {
|
|
1457
|
+
[key: string]: any;
|
|
1458
|
+
}
|
|
1459
|
+
interface BookingLabCheckoutBasketResponse {
|
|
1460
|
+
total_price: number;
|
|
1461
|
+
price: number;
|
|
1462
|
+
paid: number;
|
|
1463
|
+
deposit: number;
|
|
1464
|
+
tax_payable_on_price?: number;
|
|
1465
|
+
tax_payable_on_deposit?: number;
|
|
1466
|
+
tax_payable_on_due_now?: number;
|
|
1467
|
+
due_now?: number;
|
|
1468
|
+
long_id: string;
|
|
1469
|
+
id: number;
|
|
1470
|
+
client_name?: string;
|
|
1471
|
+
created_at?: string;
|
|
1472
|
+
certificate_paid?: number;
|
|
1473
|
+
payment_type?: string;
|
|
1474
|
+
original_price?: number;
|
|
1475
|
+
payment_reference?: any[];
|
|
1476
|
+
_embedded?: {
|
|
1477
|
+
client?: BookingLabCheckoutBasketEmbeddedClient;
|
|
1478
|
+
member?: BookingLabCheckoutBasketEmbeddedMember;
|
|
1479
|
+
bookings?: BookingLabCheckoutBasketBooking[];
|
|
1480
|
+
packages?: any[];
|
|
1481
|
+
products?: any[];
|
|
1482
|
+
pre_paid_bookings?: any[];
|
|
1483
|
+
deals?: any[];
|
|
1484
|
+
course_bookings?: any[];
|
|
1485
|
+
external_purchases?: any[];
|
|
1486
|
+
payment_callbacks?: any[];
|
|
1487
|
+
confirm_messages?: any[];
|
|
1488
|
+
[key: string]: any;
|
|
1489
|
+
};
|
|
1490
|
+
refund?: {
|
|
1491
|
+
amount_refunded: number;
|
|
1492
|
+
amount_remaining: number;
|
|
1493
|
+
};
|
|
1494
|
+
price_in_major_units?: number;
|
|
1495
|
+
total_price_in_major_units?: number;
|
|
1496
|
+
paid_in_major_units?: number;
|
|
1497
|
+
deposit_in_major_units?: number;
|
|
1498
|
+
tax_payable_on_price_in_major_units?: number;
|
|
1499
|
+
tax_payable_on_deposit_in_major_units?: number;
|
|
1500
|
+
tax_payable_on_due_now_in_major_units?: number;
|
|
1501
|
+
due_now_in_major_units?: number;
|
|
1502
|
+
_links?: Record<string, {
|
|
1503
|
+
href: string;
|
|
1504
|
+
templated?: boolean;
|
|
1505
|
+
type?: string;
|
|
1506
|
+
}>;
|
|
1507
|
+
[key: string]: any;
|
|
1508
|
+
}
|
|
1225
1509
|
|
|
1226
1510
|
/**
|
|
1227
1511
|
* Core API Client
|
|
@@ -1402,6 +1686,51 @@ declare class BookingLabClient extends ApiClient {
|
|
|
1402
1686
|
* @param clientToken - Client token for authentication
|
|
1403
1687
|
*/
|
|
1404
1688
|
getCompanyQuestions(companyId: number, detailGroupId: number, clientToken: string): Promise<ApiResponse<BookingLabGetQuestionsResponse>>;
|
|
1689
|
+
/**
|
|
1690
|
+
* Get available days for a service within a date range
|
|
1691
|
+
* @param companyId - The company ID
|
|
1692
|
+
* @param serviceId - The service ID
|
|
1693
|
+
* @param fromDate - Start date (YYYY-MM-DD)
|
|
1694
|
+
* @param toDate - End date (YYYY-MM-DD)
|
|
1695
|
+
* @param clientToken - Client token for authentication
|
|
1696
|
+
* @param params - Optional query params (resource_id)
|
|
1697
|
+
*/
|
|
1698
|
+
getDays(companyId: number, serviceId: number, fromDate: string, toDate: string, clientToken: string, params?: BookingLabGetDaysParams): Promise<ApiResponse<BookingLabGetDaysResponse>>;
|
|
1699
|
+
/**
|
|
1700
|
+
* Get available times for a service within a date range
|
|
1701
|
+
* @param companyId - The company ID
|
|
1702
|
+
* @param serviceId - The service ID
|
|
1703
|
+
* @param fromDate - Start date (YYYY-MM-DD)
|
|
1704
|
+
* @param toDate - End date (YYYY-MM-DD)
|
|
1705
|
+
* @param clientToken - Client token for authentication
|
|
1706
|
+
* @param params - Optional query params (duration, resource_id, person_id)
|
|
1707
|
+
*/
|
|
1708
|
+
getTimes(companyId: number, serviceId: number, fromDate: string, toDate: string, clientToken: string, params?: BookingLabGetTimesParams): Promise<ApiResponse<BookingLabGetTimesResponse>>;
|
|
1709
|
+
/**
|
|
1710
|
+
* Create a new basket (BookingLab public)
|
|
1711
|
+
* @param request - Body with company_id
|
|
1712
|
+
* @param headers - Required clientToken/companyId; optional authToken/memberId
|
|
1713
|
+
*/
|
|
1714
|
+
createBasket(request: BookingLabCreateBasketRequest, headers: BookingLabCreateBasketHeaders): Promise<ApiResponse<BookingLabCreateBasketResponse>>;
|
|
1715
|
+
/**
|
|
1716
|
+
* Add a service item to a public basket (BookingLab)
|
|
1717
|
+
* @param basketId - The basket ID
|
|
1718
|
+
* @param request - Service item body
|
|
1719
|
+
* @param headers - Required clientToken/authToken/companyId
|
|
1720
|
+
*/
|
|
1721
|
+
addBasketServiceItem(basketId: string, request: BookingLabAddBasketServiceItemRequest, headers: BookingLabAddBasketServiceItemHeaders): Promise<ApiResponse<BookingLabAddBasketServiceItemResponse>>;
|
|
1722
|
+
/**
|
|
1723
|
+
* Checkout a public basket (BookingLab)
|
|
1724
|
+
* @param basketId - The basket ID
|
|
1725
|
+
* @param request - Body with company_id and client.id
|
|
1726
|
+
* @param headers - Required clientToken/authToken/companyId
|
|
1727
|
+
*/
|
|
1728
|
+
checkoutBasketPublic(basketId: string, request: BookingLabCheckoutBasketRequest, headers: BookingLabCheckoutBasketHeaders): Promise<ApiResponse<BookingLabCheckoutBasketResponse>>;
|
|
1729
|
+
/**
|
|
1730
|
+
* Delete a public basket (BookingLab)
|
|
1731
|
+
* @param headers - Required clientToken/authToken/companyId
|
|
1732
|
+
*/
|
|
1733
|
+
deleteBasketPublic(headers: BookingLabDeleteBasketHeaders): Promise<ApiResponse<BookingLabDeleteBasketResponse>>;
|
|
1405
1734
|
}
|
|
1406
1735
|
/**
|
|
1407
1736
|
* Create a new BookingLab client instance
|
|
@@ -1842,5 +2171,42 @@ declare function useBookingLabCompanies(clientToken: string, params?: BookingLab
|
|
|
1842
2171
|
* @param enabled - Whether the query should run
|
|
1843
2172
|
*/
|
|
1844
2173
|
declare function useBookingLabQuestions(companyId: number, detailGroupId: number, clientToken: string, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabGetQuestionsResponse, Error>;
|
|
2174
|
+
/**
|
|
2175
|
+
* Hook for fetching available days for a service within a date range (BookingLab)
|
|
2176
|
+
*/
|
|
2177
|
+
declare function useBookingLabDays(companyId: number, serviceId: number, fromDate: string, toDate: string, clientToken: string, params?: BookingLabGetDaysParams, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabGetDaysResponse, Error>;
|
|
2178
|
+
/**
|
|
2179
|
+
* Hook for fetching available times for a company/service (BookingLab)
|
|
2180
|
+
*/
|
|
2181
|
+
declare function useBookingLabTimes(companyId: number, serviceId: number, fromDate: string, toDate: string, clientToken: string, params?: BookingLabGetTimesParams, enabled?: boolean): _tanstack_react_query.UseQueryResult<BookingLabGetTimesResponse, Error>;
|
|
2182
|
+
/**
|
|
2183
|
+
* Hook for creating a new basket (BookingLab)
|
|
2184
|
+
*/
|
|
2185
|
+
declare function useBookingLabCreateBasket(): _tanstack_react_query.UseMutationResult<BookingLabCreateBasketResponse, Error, {
|
|
2186
|
+
request: BookingLabCreateBasketRequest;
|
|
2187
|
+
headers: BookingLabCreateBasketHeaders;
|
|
2188
|
+
}, unknown>;
|
|
2189
|
+
/**
|
|
2190
|
+
* Hook for adding a service item to a public basket (BookingLab)
|
|
2191
|
+
*/
|
|
2192
|
+
declare function useBookingLabAddBasketServiceItem(): _tanstack_react_query.UseMutationResult<BookingLabAddBasketServiceItemResponse, Error, {
|
|
2193
|
+
basketId: string;
|
|
2194
|
+
request: BookingLabAddBasketServiceItemRequest;
|
|
2195
|
+
headers: BookingLabAddBasketServiceItemHeaders;
|
|
2196
|
+
}, unknown>;
|
|
2197
|
+
/**
|
|
2198
|
+
* Hook for checking out a public basket (BookingLab)
|
|
2199
|
+
*/
|
|
2200
|
+
declare function useBookingLabCheckoutBasket(): _tanstack_react_query.UseMutationResult<BookingLabCheckoutBasketResponse, Error, {
|
|
2201
|
+
basketId: string;
|
|
2202
|
+
request: BookingLabCheckoutBasketRequest;
|
|
2203
|
+
headers: BookingLabCheckoutBasketHeaders;
|
|
2204
|
+
}, unknown>;
|
|
2205
|
+
/**
|
|
2206
|
+
* Hook for deleting a public basket (BookingLab)
|
|
2207
|
+
*/
|
|
2208
|
+
declare function useBookingLabDeleteBasket(): _tanstack_react_query.UseMutationResult<BookingLabDeleteBasketResponse, Error, {
|
|
2209
|
+
headers: BookingLabDeleteBasketHeaders;
|
|
2210
|
+
}, unknown>;
|
|
1845
2211
|
|
|
1846
|
-
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, BookingLabClient, type BookingLabCompany, type BookingLabConfigPage, type BookingLabConfigProduct, type BookingLabConfigRequest, type BookingLabConfigResponse, type BookingLabConfigUserJourney, BookingLabContext, type BookingLabForgotPasswordRequest, type BookingLabForgotPasswordResponse, type BookingLabGetCompaniesParams, type BookingLabGetCompaniesResponse, type BookingLabGetQuestionsResponse, type BookingLabGetServicesResponse, type BookingLabGetTokenRequest, type BookingLabGetTokenResponse, BookingLabProvider, type BookingLabQuestion, type BookingLabService, 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 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, useBookingLabClient, useBookingLabCompanies, useBookingLabConfig, useBookingLabContext, useBookingLabForgotPassword, useBookingLabGetToken, useBookingLabQuestions, useBookingLabService, useBookingLabServices, useCancelBooking, useCancelMemberBooking, useCheckoutBasket, useChildCompanies, useClearBaskets, useClientDetails, useCompany, useCreateBasket, useCreateClient, useDates, useFindClientByEmail, useForgottenPassword, useGetMember, useJrniClient, useJrniContext, useListBookings, useLogin, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateClient, useUpdateMember };
|
|
2212
|
+
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 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, useQuestions, useRescheduleBooking, useResetPassword, useResources, useSendCustomEmail, useServices, useTimes, useUpdateClient, useUpdateMember };
|
package/dist/index.js
CHANGED
|
@@ -425,6 +425,113 @@ var BookingLabClient = class extends ApiClient {
|
|
|
425
425
|
}
|
|
426
426
|
);
|
|
427
427
|
}
|
|
428
|
+
/**
|
|
429
|
+
* Get available days for a service within a date range
|
|
430
|
+
* @param companyId - The company ID
|
|
431
|
+
* @param serviceId - The service ID
|
|
432
|
+
* @param fromDate - Start date (YYYY-MM-DD)
|
|
433
|
+
* @param toDate - End date (YYYY-MM-DD)
|
|
434
|
+
* @param clientToken - Client token for authentication
|
|
435
|
+
* @param params - Optional query params (resource_id)
|
|
436
|
+
*/
|
|
437
|
+
async getDays(companyId, serviceId, fromDate, toDate, clientToken, params) {
|
|
438
|
+
return this.get(
|
|
439
|
+
`/company/${companyId}/service/${serviceId}/days/${fromDate}/${toDate}`,
|
|
440
|
+
{
|
|
441
|
+
headers: {
|
|
442
|
+
"clienttoken": clientToken
|
|
443
|
+
},
|
|
444
|
+
params
|
|
445
|
+
}
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Get available times for a service within a date range
|
|
450
|
+
* @param companyId - The company ID
|
|
451
|
+
* @param serviceId - The service ID
|
|
452
|
+
* @param fromDate - Start date (YYYY-MM-DD)
|
|
453
|
+
* @param toDate - End date (YYYY-MM-DD)
|
|
454
|
+
* @param clientToken - Client token for authentication
|
|
455
|
+
* @param params - Optional query params (duration, resource_id, person_id)
|
|
456
|
+
*/
|
|
457
|
+
async getTimes(companyId, serviceId, fromDate, toDate, clientToken, params) {
|
|
458
|
+
return this.get(
|
|
459
|
+
`/company/${companyId}/service/${serviceId}/times/${fromDate}/${toDate}`,
|
|
460
|
+
{
|
|
461
|
+
headers: {
|
|
462
|
+
"clienttoken": clientToken
|
|
463
|
+
},
|
|
464
|
+
params
|
|
465
|
+
}
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Create a new basket (BookingLab public)
|
|
470
|
+
* @param request - Body with company_id
|
|
471
|
+
* @param headers - Required clientToken/companyId; optional authToken/memberId
|
|
472
|
+
*/
|
|
473
|
+
async createBasket(request, headers) {
|
|
474
|
+
const reqHeaders = {
|
|
475
|
+
"clienttoken": headers.clientToken,
|
|
476
|
+
"x-company-id": String(headers.companyId)
|
|
477
|
+
};
|
|
478
|
+
if (headers.authToken) reqHeaders["authtoken"] = headers.authToken;
|
|
479
|
+
if (headers.memberId !== void 0) reqHeaders["x-member-id"] = String(headers.memberId);
|
|
480
|
+
return this.post("/basket-public", request, {
|
|
481
|
+
headers: reqHeaders
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Add a service item to a public basket (BookingLab)
|
|
486
|
+
* @param basketId - The basket ID
|
|
487
|
+
* @param request - Service item body
|
|
488
|
+
* @param headers - Required clientToken/authToken/companyId
|
|
489
|
+
*/
|
|
490
|
+
async addBasketServiceItem(basketId, request, headers) {
|
|
491
|
+
return this.post(
|
|
492
|
+
`/baskets/${basketId}/service_item-public`,
|
|
493
|
+
request,
|
|
494
|
+
{
|
|
495
|
+
headers: {
|
|
496
|
+
"clienttoken": headers.clientToken,
|
|
497
|
+
"authtoken": headers.authToken,
|
|
498
|
+
"x-company-id": String(headers.companyId)
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Checkout a public basket (BookingLab)
|
|
505
|
+
* @param basketId - The basket ID
|
|
506
|
+
* @param request - Body with company_id and client.id
|
|
507
|
+
* @param headers - Required clientToken/authToken/companyId
|
|
508
|
+
*/
|
|
509
|
+
async checkoutBasketPublic(basketId, request, headers) {
|
|
510
|
+
return this.post(
|
|
511
|
+
`/baskets/${basketId}/public-checkout`,
|
|
512
|
+
request,
|
|
513
|
+
{
|
|
514
|
+
headers: {
|
|
515
|
+
"clienttoken": headers.clientToken,
|
|
516
|
+
"authtoken": headers.authToken,
|
|
517
|
+
"x-company-id": String(headers.companyId)
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Delete a public basket (BookingLab)
|
|
524
|
+
* @param headers - Required clientToken/authToken/companyId
|
|
525
|
+
*/
|
|
526
|
+
async deleteBasketPublic(headers) {
|
|
527
|
+
return this.delete("/basket-public", {
|
|
528
|
+
headers: {
|
|
529
|
+
"clienttoken": headers.clientToken,
|
|
530
|
+
"authtoken": headers.authToken,
|
|
531
|
+
"x-company-id": String(headers.companyId)
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
}
|
|
428
535
|
};
|
|
429
536
|
function createBookingLabClient(baseUrl, authToken, appId) {
|
|
430
537
|
const client = new BookingLabClient({ baseUrl });
|
|
@@ -1219,6 +1326,64 @@ function useBookingLabQuestions(companyId, detailGroupId, clientToken, enabled =
|
|
|
1219
1326
|
enabled: enabled && !!companyId && !!detailGroupId && !!clientToken
|
|
1220
1327
|
});
|
|
1221
1328
|
}
|
|
1329
|
+
function useBookingLabDays(companyId, serviceId, fromDate, toDate, clientToken, params, enabled = true) {
|
|
1330
|
+
const client = useBookingLabClient();
|
|
1331
|
+
return reactQuery.useQuery({
|
|
1332
|
+
queryKey: ["bookingLabDays", companyId, serviceId, fromDate, toDate, params?.resource_id],
|
|
1333
|
+
queryFn: async () => {
|
|
1334
|
+
const response = await client.getDays(companyId, serviceId, fromDate, toDate, clientToken, params);
|
|
1335
|
+
return response.data;
|
|
1336
|
+
},
|
|
1337
|
+
enabled: enabled && !!companyId && !!serviceId && !!fromDate && !!toDate && !!clientToken
|
|
1338
|
+
});
|
|
1339
|
+
}
|
|
1340
|
+
function useBookingLabTimes(companyId, serviceId, fromDate, toDate, clientToken, params, enabled = true) {
|
|
1341
|
+
const client = useBookingLabClient();
|
|
1342
|
+
return reactQuery.useQuery({
|
|
1343
|
+
queryKey: ["bookingLabTimes", companyId, serviceId, fromDate, toDate, params?.resource_ids],
|
|
1344
|
+
queryFn: async () => {
|
|
1345
|
+
const response = await client.getTimes(companyId, serviceId, fromDate, toDate, clientToken, params);
|
|
1346
|
+
return response.data;
|
|
1347
|
+
},
|
|
1348
|
+
enabled: enabled && !!companyId && !!serviceId && !!fromDate && !!toDate && !!clientToken
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
function useBookingLabCreateBasket() {
|
|
1352
|
+
const client = useBookingLabClient();
|
|
1353
|
+
return reactQuery.useMutation({
|
|
1354
|
+
mutationFn: async (input) => {
|
|
1355
|
+
const response = await client.createBasket(input.request, input.headers);
|
|
1356
|
+
return response.data;
|
|
1357
|
+
}
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
function useBookingLabAddBasketServiceItem() {
|
|
1361
|
+
const client = useBookingLabClient();
|
|
1362
|
+
return reactQuery.useMutation({
|
|
1363
|
+
mutationFn: async (input) => {
|
|
1364
|
+
const response = await client.addBasketServiceItem(input.basketId, input.request, input.headers);
|
|
1365
|
+
return response.data;
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1368
|
+
}
|
|
1369
|
+
function useBookingLabCheckoutBasket() {
|
|
1370
|
+
const client = useBookingLabClient();
|
|
1371
|
+
return reactQuery.useMutation({
|
|
1372
|
+
mutationFn: async (input) => {
|
|
1373
|
+
const response = await client.checkoutBasketPublic(input.basketId, input.request, input.headers);
|
|
1374
|
+
return response.data;
|
|
1375
|
+
}
|
|
1376
|
+
});
|
|
1377
|
+
}
|
|
1378
|
+
function useBookingLabDeleteBasket() {
|
|
1379
|
+
const client = useBookingLabClient();
|
|
1380
|
+
return reactQuery.useMutation({
|
|
1381
|
+
mutationFn: async (input) => {
|
|
1382
|
+
const response = await client.deleteBasketPublic(input.headers);
|
|
1383
|
+
return response.data;
|
|
1384
|
+
}
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1222
1387
|
|
|
1223
1388
|
exports.ApiClient = ApiClient;
|
|
1224
1389
|
exports.ApiClientContext = ApiClientContext;
|
|
@@ -1234,15 +1399,21 @@ exports.createBookingLabClient = createBookingLabClient;
|
|
|
1234
1399
|
exports.createJrniClient = createJrniClient;
|
|
1235
1400
|
exports.useAddServiceItem = useAddServiceItem;
|
|
1236
1401
|
exports.useApiClientContext = useApiClientContext;
|
|
1402
|
+
exports.useBookingLabAddBasketServiceItem = useBookingLabAddBasketServiceItem;
|
|
1403
|
+
exports.useBookingLabCheckoutBasket = useBookingLabCheckoutBasket;
|
|
1237
1404
|
exports.useBookingLabClient = useBookingLabClient;
|
|
1238
1405
|
exports.useBookingLabCompanies = useBookingLabCompanies;
|
|
1239
1406
|
exports.useBookingLabConfig = useBookingLabConfig;
|
|
1240
1407
|
exports.useBookingLabContext = useBookingLabContext;
|
|
1408
|
+
exports.useBookingLabCreateBasket = useBookingLabCreateBasket;
|
|
1409
|
+
exports.useBookingLabDays = useBookingLabDays;
|
|
1410
|
+
exports.useBookingLabDeleteBasket = useBookingLabDeleteBasket;
|
|
1241
1411
|
exports.useBookingLabForgotPassword = useBookingLabForgotPassword;
|
|
1242
1412
|
exports.useBookingLabGetToken = useBookingLabGetToken;
|
|
1243
1413
|
exports.useBookingLabQuestions = useBookingLabQuestions;
|
|
1244
1414
|
exports.useBookingLabService = useBookingLabService;
|
|
1245
1415
|
exports.useBookingLabServices = useBookingLabServices;
|
|
1416
|
+
exports.useBookingLabTimes = useBookingLabTimes;
|
|
1246
1417
|
exports.useCancelBooking = useCancelBooking;
|
|
1247
1418
|
exports.useCancelMemberBooking = useCancelMemberBooking;
|
|
1248
1419
|
exports.useCheckoutBasket = useCheckoutBasket;
|