@voyantjs/bookings-react 0.2.0 → 0.3.1

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.
Files changed (52) hide show
  1. package/LICENSE +109 -0
  2. package/README.md +11 -0
  3. package/dist/hooks/index.d.ts +8 -0
  4. package/dist/hooks/index.d.ts.map +1 -1
  5. package/dist/hooks/index.js +8 -0
  6. package/dist/hooks/use-booking-activity.d.ts +15 -0
  7. package/dist/hooks/use-booking-activity.d.ts.map +1 -0
  8. package/dist/hooks/use-booking-activity.js +12 -0
  9. package/dist/hooks/use-booking-note-mutation.d.ts +11 -0
  10. package/dist/hooks/use-booking-note-mutation.d.ts.map +1 -0
  11. package/dist/hooks/use-booking-note-mutation.js +24 -0
  12. package/dist/hooks/use-booking-notes.d.ts +13 -0
  13. package/dist/hooks/use-booking-notes.d.ts.map +1 -0
  14. package/dist/hooks/use-booking-notes.js +12 -0
  15. package/dist/hooks/use-booking.d.ts.map +1 -1
  16. package/dist/hooks/use-booking.js +2 -5
  17. package/dist/hooks/use-bookings.d.ts +1 -1
  18. package/dist/hooks/use-bookings.d.ts.map +1 -1
  19. package/dist/hooks/use-bookings.js +2 -20
  20. package/dist/hooks/use-passengers.d.ts.map +1 -1
  21. package/dist/hooks/use-passengers.js +2 -8
  22. package/dist/hooks/use-public-booking-session-flow-mutation.d.ts +145 -0
  23. package/dist/hooks/use-public-booking-session-flow-mutation.d.ts.map +1 -0
  24. package/dist/hooks/use-public-booking-session-flow-mutation.js +35 -0
  25. package/dist/hooks/use-public-booking-session-state.d.ts +16 -0
  26. package/dist/hooks/use-public-booking-session-state.d.ts.map +1 -0
  27. package/dist/hooks/use-public-booking-session-state.js +12 -0
  28. package/dist/hooks/use-public-booking-session.d.ts +98 -0
  29. package/dist/hooks/use-public-booking-session.d.ts.map +1 -0
  30. package/dist/hooks/use-public-booking-session.js +12 -0
  31. package/dist/hooks/use-supplier-status-mutation.d.ts +46 -0
  32. package/dist/hooks/use-supplier-status-mutation.d.ts.map +1 -0
  33. package/dist/hooks/use-supplier-status-mutation.js +39 -0
  34. package/dist/hooks/use-supplier-statuses.d.ts +20 -0
  35. package/dist/hooks/use-supplier-statuses.d.ts.map +1 -0
  36. package/dist/hooks/use-supplier-statuses.js +12 -0
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +1 -0
  40. package/dist/provider.d.ts +1 -13
  41. package/dist/provider.d.ts.map +1 -1
  42. package/dist/provider.js +1 -16
  43. package/dist/query-keys.d.ts +3 -0
  44. package/dist/query-keys.d.ts.map +1 -1
  45. package/dist/query-keys.js +3 -0
  46. package/dist/query-options.d.ts +828 -0
  47. package/dist/query-options.d.ts.map +1 -0
  48. package/dist/query-options.js +71 -0
  49. package/dist/schemas.d.ts +342 -3
  50. package/dist/schemas.d.ts.map +1 -1
  51. package/dist/schemas.js +4 -0
  52. package/package.json +42 -46
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-options.d.ts","sourceRoot":"","sources":["../src/query-options.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,0BAA0B,EAAuB,MAAM,aAAa,CAAA;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAA;AAalF,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,0BAA0B,EAClC,OAAO,GAAE,kBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWrC;AAED,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,0BAA0B,EAClC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWrC"}
@@ -0,0 +1,71 @@
1
+ "use client";
2
+ import { queryOptions } from "@tanstack/react-query";
3
+ import { fetchWithValidation } from "./client.js";
4
+ import { bookingsQueryKeys } from "./query-keys.js";
5
+ import { bookingActivityResponse, bookingListResponse, bookingNotesResponse, bookingPassengersResponse, bookingSingleResponse, bookingSupplierStatusesResponse, publicBookingSessionResponse, publicBookingSessionStateResponse, } from "./schemas.js";
6
+ export function getBookingsQueryOptions(client, options = {}) {
7
+ const { enabled: _enabled = true, ...filters } = options;
8
+ return queryOptions({
9
+ queryKey: bookingsQueryKeys.bookingsList(filters),
10
+ queryFn: () => {
11
+ const params = new URLSearchParams();
12
+ if (filters.status)
13
+ params.set("status", filters.status);
14
+ if (filters.search)
15
+ params.set("search", filters.search);
16
+ if (filters.limit !== undefined)
17
+ params.set("limit", String(filters.limit));
18
+ if (filters.offset !== undefined)
19
+ params.set("offset", String(filters.offset));
20
+ const qs = params.toString();
21
+ return fetchWithValidation(`/v1/bookings${qs ? `?${qs}` : ""}`, bookingListResponse, client);
22
+ },
23
+ });
24
+ }
25
+ export function getBookingQueryOptions(client, id, options = {}) {
26
+ const { enabled: _enabled = true } = options;
27
+ return queryOptions({
28
+ queryKey: bookingsQueryKeys.booking(id ?? ""),
29
+ queryFn: () => fetchWithValidation(`/v1/bookings/${id}`, bookingSingleResponse, client),
30
+ });
31
+ }
32
+ export function getPassengersQueryOptions(client, bookingId, options = {}) {
33
+ const { enabled: _enabled = true } = options;
34
+ return queryOptions({
35
+ queryKey: bookingsQueryKeys.passengers(bookingId ?? ""),
36
+ queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/passengers`, bookingPassengersResponse, client),
37
+ });
38
+ }
39
+ export function getSupplierStatusesQueryOptions(client, bookingId, options = {}) {
40
+ const { enabled: _enabled = true } = options;
41
+ return queryOptions({
42
+ queryKey: bookingsQueryKeys.supplierStatuses(bookingId ?? ""),
43
+ queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/supplier-statuses`, bookingSupplierStatusesResponse, client),
44
+ });
45
+ }
46
+ export function getBookingActivityQueryOptions(client, bookingId, options = {}) {
47
+ const { enabled: _enabled = true } = options;
48
+ return queryOptions({
49
+ queryKey: bookingsQueryKeys.activity(bookingId ?? ""),
50
+ queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/activity`, bookingActivityResponse, client),
51
+ });
52
+ }
53
+ export function getBookingNotesQueryOptions(client, bookingId, options = {}) {
54
+ const { enabled: _enabled = true } = options;
55
+ return queryOptions({
56
+ queryKey: bookingsQueryKeys.notes(bookingId ?? ""),
57
+ queryFn: () => fetchWithValidation(`/v1/bookings/${bookingId}/notes`, bookingNotesResponse, client),
58
+ });
59
+ }
60
+ export function getPublicBookingSessionQueryOptions(client, sessionId) {
61
+ return queryOptions({
62
+ queryKey: bookingsQueryKeys.publicSession(sessionId ?? ""),
63
+ queryFn: () => fetchWithValidation(`/v1/public/bookings/sessions/${sessionId}`, publicBookingSessionResponse, client),
64
+ });
65
+ }
66
+ export function getPublicBookingSessionStateQueryOptions(client, sessionId) {
67
+ return queryOptions({
68
+ queryKey: bookingsQueryKeys.publicSessionState(sessionId ?? ""),
69
+ queryFn: () => fetchWithValidation(`/v1/public/bookings/sessions/${sessionId}/state`, publicBookingSessionStateResponse, client),
70
+ });
71
+ }
package/dist/schemas.d.ts CHANGED
@@ -24,9 +24,9 @@ export declare const bookingStatusSchema: z.ZodEnum<{
24
24
  cancelled: "cancelled";
25
25
  }>;
26
26
  export declare const supplierConfirmationStatusSchema: z.ZodEnum<{
27
+ pending: "pending";
27
28
  confirmed: "confirmed";
28
29
  cancelled: "cancelled";
29
- pending: "pending";
30
30
  rejected: "rejected";
31
31
  }>;
32
32
  export declare const bookingRecordSchema: z.ZodObject<{
@@ -74,9 +74,9 @@ export declare const bookingSupplierStatusRecordSchema: z.ZodObject<{
74
74
  supplierServiceId: z.ZodNullable<z.ZodString>;
75
75
  serviceName: z.ZodString;
76
76
  status: z.ZodEnum<{
77
+ pending: "pending";
77
78
  confirmed: "confirmed";
78
79
  cancelled: "cancelled";
79
- pending: "pending";
80
80
  rejected: "rejected";
81
81
  }>;
82
82
  supplierReference: z.ZodNullable<z.ZodString>;
@@ -184,9 +184,9 @@ export declare const bookingSupplierStatusesResponse: z.ZodObject<{
184
184
  supplierServiceId: z.ZodNullable<z.ZodString>;
185
185
  serviceName: z.ZodString;
186
186
  status: z.ZodEnum<{
187
+ pending: "pending";
187
188
  confirmed: "confirmed";
188
189
  cancelled: "cancelled";
189
- pending: "pending";
190
190
  rejected: "rejected";
191
191
  }>;
192
192
  supplierReference: z.ZodNullable<z.ZodString>;
@@ -218,4 +218,343 @@ export declare const bookingNotesResponse: z.ZodObject<{
218
218
  createdAt: z.ZodString;
219
219
  }, z.core.$strip>>;
220
220
  }, z.core.$strip>;
221
+ export declare const publicBookingSessionResponse: z.ZodObject<{
222
+ data: z.ZodObject<{
223
+ sessionId: z.ZodString;
224
+ bookingNumber: z.ZodString;
225
+ status: z.ZodEnum<{
226
+ draft: "draft";
227
+ on_hold: "on_hold";
228
+ confirmed: "confirmed";
229
+ in_progress: "in_progress";
230
+ completed: "completed";
231
+ expired: "expired";
232
+ cancelled: "cancelled";
233
+ }>;
234
+ externalBookingRef: z.ZodNullable<z.ZodString>;
235
+ communicationLanguage: z.ZodNullable<z.ZodString>;
236
+ sellCurrency: z.ZodString;
237
+ sellAmountCents: z.ZodNullable<z.ZodNumber>;
238
+ startDate: z.ZodNullable<z.ZodString>;
239
+ endDate: z.ZodNullable<z.ZodString>;
240
+ pax: z.ZodNullable<z.ZodNumber>;
241
+ holdExpiresAt: z.ZodNullable<z.ZodString>;
242
+ confirmedAt: z.ZodNullable<z.ZodString>;
243
+ expiredAt: z.ZodNullable<z.ZodString>;
244
+ cancelledAt: z.ZodNullable<z.ZodString>;
245
+ completedAt: z.ZodNullable<z.ZodString>;
246
+ participants: z.ZodArray<z.ZodObject<{
247
+ id: z.ZodString;
248
+ participantType: z.ZodEnum<{
249
+ traveler: "traveler";
250
+ booker: "booker";
251
+ contact: "contact";
252
+ occupant: "occupant";
253
+ staff: "staff";
254
+ other: "other";
255
+ }>;
256
+ travelerCategory: z.ZodNullable<z.ZodEnum<{
257
+ other: "other";
258
+ adult: "adult";
259
+ child: "child";
260
+ infant: "infant";
261
+ senior: "senior";
262
+ }>>;
263
+ firstName: z.ZodString;
264
+ lastName: z.ZodString;
265
+ email: z.ZodNullable<z.ZodString>;
266
+ phone: z.ZodNullable<z.ZodString>;
267
+ preferredLanguage: z.ZodNullable<z.ZodString>;
268
+ accessibilityNeeds: z.ZodNullable<z.ZodString>;
269
+ specialRequests: z.ZodNullable<z.ZodString>;
270
+ isPrimary: z.ZodBoolean;
271
+ notes: z.ZodNullable<z.ZodString>;
272
+ }, z.core.$strip>>;
273
+ items: z.ZodArray<z.ZodObject<{
274
+ id: z.ZodString;
275
+ title: z.ZodString;
276
+ description: z.ZodNullable<z.ZodString>;
277
+ itemType: z.ZodEnum<{
278
+ other: "other";
279
+ unit: "unit";
280
+ extra: "extra";
281
+ service: "service";
282
+ fee: "fee";
283
+ tax: "tax";
284
+ discount: "discount";
285
+ adjustment: "adjustment";
286
+ accommodation: "accommodation";
287
+ transport: "transport";
288
+ }>;
289
+ status: z.ZodEnum<{
290
+ draft: "draft";
291
+ on_hold: "on_hold";
292
+ confirmed: "confirmed";
293
+ expired: "expired";
294
+ cancelled: "cancelled";
295
+ fulfilled: "fulfilled";
296
+ }>;
297
+ serviceDate: z.ZodNullable<z.ZodString>;
298
+ startsAt: z.ZodNullable<z.ZodString>;
299
+ endsAt: z.ZodNullable<z.ZodString>;
300
+ quantity: z.ZodNumber;
301
+ sellCurrency: z.ZodString;
302
+ unitSellAmountCents: z.ZodNullable<z.ZodNumber>;
303
+ totalSellAmountCents: z.ZodNullable<z.ZodNumber>;
304
+ costCurrency: z.ZodNullable<z.ZodString>;
305
+ unitCostAmountCents: z.ZodNullable<z.ZodNumber>;
306
+ totalCostAmountCents: z.ZodNullable<z.ZodNumber>;
307
+ notes: z.ZodNullable<z.ZodString>;
308
+ productId: z.ZodNullable<z.ZodString>;
309
+ optionId: z.ZodNullable<z.ZodString>;
310
+ optionUnitId: z.ZodNullable<z.ZodString>;
311
+ pricingCategoryId: z.ZodNullable<z.ZodString>;
312
+ participantLinks: z.ZodArray<z.ZodObject<{
313
+ id: z.ZodString;
314
+ participantId: z.ZodString;
315
+ role: z.ZodEnum<{
316
+ traveler: "traveler";
317
+ occupant: "occupant";
318
+ other: "other";
319
+ primary_contact: "primary_contact";
320
+ service_assignee: "service_assignee";
321
+ beneficiary: "beneficiary";
322
+ }>;
323
+ isPrimary: z.ZodBoolean;
324
+ }, z.core.$strip>>;
325
+ }, z.core.$strip>>;
326
+ allocations: z.ZodArray<z.ZodObject<{
327
+ id: z.ZodString;
328
+ bookingItemId: z.ZodNullable<z.ZodString>;
329
+ productId: z.ZodNullable<z.ZodString>;
330
+ optionId: z.ZodNullable<z.ZodString>;
331
+ optionUnitId: z.ZodNullable<z.ZodString>;
332
+ pricingCategoryId: z.ZodNullable<z.ZodString>;
333
+ availabilitySlotId: z.ZodNullable<z.ZodString>;
334
+ quantity: z.ZodNumber;
335
+ allocationType: z.ZodEnum<{
336
+ unit: "unit";
337
+ pickup: "pickup";
338
+ resource: "resource";
339
+ }>;
340
+ status: z.ZodEnum<{
341
+ confirmed: "confirmed";
342
+ expired: "expired";
343
+ cancelled: "cancelled";
344
+ fulfilled: "fulfilled";
345
+ held: "held";
346
+ released: "released";
347
+ }>;
348
+ holdExpiresAt: z.ZodNullable<z.ZodString>;
349
+ confirmedAt: z.ZodNullable<z.ZodString>;
350
+ releasedAt: z.ZodNullable<z.ZodString>;
351
+ }, z.core.$strip>>;
352
+ checklist: z.ZodObject<{
353
+ hasParticipants: z.ZodBoolean;
354
+ hasTraveler: z.ZodBoolean;
355
+ hasPrimaryParticipant: z.ZodBoolean;
356
+ hasItems: z.ZodBoolean;
357
+ hasAllocations: z.ZodBoolean;
358
+ readyForConfirmation: z.ZodBoolean;
359
+ }, z.core.$strip>;
360
+ state: z.ZodNullable<z.ZodObject<{
361
+ sessionId: z.ZodString;
362
+ stateKey: z.ZodLiteral<"wizard">;
363
+ currentStep: z.ZodNullable<z.ZodString>;
364
+ completedSteps: z.ZodArray<z.ZodString>;
365
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
366
+ version: z.ZodNumber;
367
+ createdAt: z.ZodString;
368
+ updatedAt: z.ZodString;
369
+ }, z.core.$strip>>;
370
+ }, z.core.$strip>;
371
+ }, z.core.$strip>;
372
+ export declare const publicBookingSessionStateResponse: z.ZodObject<{
373
+ data: z.ZodObject<{
374
+ sessionId: z.ZodString;
375
+ stateKey: z.ZodLiteral<"wizard">;
376
+ currentStep: z.ZodNullable<z.ZodString>;
377
+ completedSteps: z.ZodArray<z.ZodString>;
378
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
379
+ version: z.ZodNumber;
380
+ createdAt: z.ZodString;
381
+ updatedAt: z.ZodString;
382
+ }, z.core.$strip>;
383
+ }, z.core.$strip>;
384
+ export declare const publicBookingSessionRepriceResponse: z.ZodObject<{
385
+ data: z.ZodObject<{
386
+ pricing: z.ZodObject<{
387
+ sessionId: z.ZodString;
388
+ catalogId: z.ZodNullable<z.ZodString>;
389
+ currencyCode: z.ZodString;
390
+ totalSellAmountCents: z.ZodNumber;
391
+ items: z.ZodArray<z.ZodObject<{
392
+ itemId: z.ZodString;
393
+ title: z.ZodString;
394
+ productId: z.ZodNullable<z.ZodString>;
395
+ optionId: z.ZodNullable<z.ZodString>;
396
+ optionUnitId: z.ZodNullable<z.ZodString>;
397
+ optionUnitName: z.ZodNullable<z.ZodString>;
398
+ optionUnitType: z.ZodNullable<z.ZodString>;
399
+ pricingCategoryId: z.ZodNullable<z.ZodString>;
400
+ quantity: z.ZodNumber;
401
+ pricingMode: z.ZodString;
402
+ unitSellAmountCents: z.ZodNullable<z.ZodNumber>;
403
+ totalSellAmountCents: z.ZodNullable<z.ZodNumber>;
404
+ warnings: z.ZodArray<z.ZodString>;
405
+ }, z.core.$strip>>;
406
+ warnings: z.ZodArray<z.ZodString>;
407
+ appliedToSession: z.ZodBoolean;
408
+ }, z.core.$strip>;
409
+ session: z.ZodNullable<z.ZodObject<{
410
+ sessionId: z.ZodString;
411
+ bookingNumber: z.ZodString;
412
+ status: z.ZodEnum<{
413
+ draft: "draft";
414
+ on_hold: "on_hold";
415
+ confirmed: "confirmed";
416
+ in_progress: "in_progress";
417
+ completed: "completed";
418
+ expired: "expired";
419
+ cancelled: "cancelled";
420
+ }>;
421
+ externalBookingRef: z.ZodNullable<z.ZodString>;
422
+ communicationLanguage: z.ZodNullable<z.ZodString>;
423
+ sellCurrency: z.ZodString;
424
+ sellAmountCents: z.ZodNullable<z.ZodNumber>;
425
+ startDate: z.ZodNullable<z.ZodString>;
426
+ endDate: z.ZodNullable<z.ZodString>;
427
+ pax: z.ZodNullable<z.ZodNumber>;
428
+ holdExpiresAt: z.ZodNullable<z.ZodString>;
429
+ confirmedAt: z.ZodNullable<z.ZodString>;
430
+ expiredAt: z.ZodNullable<z.ZodString>;
431
+ cancelledAt: z.ZodNullable<z.ZodString>;
432
+ completedAt: z.ZodNullable<z.ZodString>;
433
+ participants: z.ZodArray<z.ZodObject<{
434
+ id: z.ZodString;
435
+ participantType: z.ZodEnum<{
436
+ traveler: "traveler";
437
+ booker: "booker";
438
+ contact: "contact";
439
+ occupant: "occupant";
440
+ staff: "staff";
441
+ other: "other";
442
+ }>;
443
+ travelerCategory: z.ZodNullable<z.ZodEnum<{
444
+ other: "other";
445
+ adult: "adult";
446
+ child: "child";
447
+ infant: "infant";
448
+ senior: "senior";
449
+ }>>;
450
+ firstName: z.ZodString;
451
+ lastName: z.ZodString;
452
+ email: z.ZodNullable<z.ZodString>;
453
+ phone: z.ZodNullable<z.ZodString>;
454
+ preferredLanguage: z.ZodNullable<z.ZodString>;
455
+ accessibilityNeeds: z.ZodNullable<z.ZodString>;
456
+ specialRequests: z.ZodNullable<z.ZodString>;
457
+ isPrimary: z.ZodBoolean;
458
+ notes: z.ZodNullable<z.ZodString>;
459
+ }, z.core.$strip>>;
460
+ items: z.ZodArray<z.ZodObject<{
461
+ id: z.ZodString;
462
+ title: z.ZodString;
463
+ description: z.ZodNullable<z.ZodString>;
464
+ itemType: z.ZodEnum<{
465
+ other: "other";
466
+ unit: "unit";
467
+ extra: "extra";
468
+ service: "service";
469
+ fee: "fee";
470
+ tax: "tax";
471
+ discount: "discount";
472
+ adjustment: "adjustment";
473
+ accommodation: "accommodation";
474
+ transport: "transport";
475
+ }>;
476
+ status: z.ZodEnum<{
477
+ draft: "draft";
478
+ on_hold: "on_hold";
479
+ confirmed: "confirmed";
480
+ expired: "expired";
481
+ cancelled: "cancelled";
482
+ fulfilled: "fulfilled";
483
+ }>;
484
+ serviceDate: z.ZodNullable<z.ZodString>;
485
+ startsAt: z.ZodNullable<z.ZodString>;
486
+ endsAt: z.ZodNullable<z.ZodString>;
487
+ quantity: z.ZodNumber;
488
+ sellCurrency: z.ZodString;
489
+ unitSellAmountCents: z.ZodNullable<z.ZodNumber>;
490
+ totalSellAmountCents: z.ZodNullable<z.ZodNumber>;
491
+ costCurrency: z.ZodNullable<z.ZodString>;
492
+ unitCostAmountCents: z.ZodNullable<z.ZodNumber>;
493
+ totalCostAmountCents: z.ZodNullable<z.ZodNumber>;
494
+ notes: z.ZodNullable<z.ZodString>;
495
+ productId: z.ZodNullable<z.ZodString>;
496
+ optionId: z.ZodNullable<z.ZodString>;
497
+ optionUnitId: z.ZodNullable<z.ZodString>;
498
+ pricingCategoryId: z.ZodNullable<z.ZodString>;
499
+ participantLinks: z.ZodArray<z.ZodObject<{
500
+ id: z.ZodString;
501
+ participantId: z.ZodString;
502
+ role: z.ZodEnum<{
503
+ traveler: "traveler";
504
+ occupant: "occupant";
505
+ other: "other";
506
+ primary_contact: "primary_contact";
507
+ service_assignee: "service_assignee";
508
+ beneficiary: "beneficiary";
509
+ }>;
510
+ isPrimary: z.ZodBoolean;
511
+ }, z.core.$strip>>;
512
+ }, z.core.$strip>>;
513
+ allocations: z.ZodArray<z.ZodObject<{
514
+ id: z.ZodString;
515
+ bookingItemId: z.ZodNullable<z.ZodString>;
516
+ productId: z.ZodNullable<z.ZodString>;
517
+ optionId: z.ZodNullable<z.ZodString>;
518
+ optionUnitId: z.ZodNullable<z.ZodString>;
519
+ pricingCategoryId: z.ZodNullable<z.ZodString>;
520
+ availabilitySlotId: z.ZodNullable<z.ZodString>;
521
+ quantity: z.ZodNumber;
522
+ allocationType: z.ZodEnum<{
523
+ unit: "unit";
524
+ pickup: "pickup";
525
+ resource: "resource";
526
+ }>;
527
+ status: z.ZodEnum<{
528
+ confirmed: "confirmed";
529
+ expired: "expired";
530
+ cancelled: "cancelled";
531
+ fulfilled: "fulfilled";
532
+ held: "held";
533
+ released: "released";
534
+ }>;
535
+ holdExpiresAt: z.ZodNullable<z.ZodString>;
536
+ confirmedAt: z.ZodNullable<z.ZodString>;
537
+ releasedAt: z.ZodNullable<z.ZodString>;
538
+ }, z.core.$strip>>;
539
+ checklist: z.ZodObject<{
540
+ hasParticipants: z.ZodBoolean;
541
+ hasTraveler: z.ZodBoolean;
542
+ hasPrimaryParticipant: z.ZodBoolean;
543
+ hasItems: z.ZodBoolean;
544
+ hasAllocations: z.ZodBoolean;
545
+ readyForConfirmation: z.ZodBoolean;
546
+ }, z.core.$strip>;
547
+ state: z.ZodNullable<z.ZodObject<{
548
+ sessionId: z.ZodString;
549
+ stateKey: z.ZodLiteral<"wizard">;
550
+ currentStep: z.ZodNullable<z.ZodString>;
551
+ completedSteps: z.ZodArray<z.ZodString>;
552
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
553
+ version: z.ZodNumber;
554
+ createdAt: z.ZodString;
555
+ updatedAt: z.ZodString;
556
+ }, z.core.$strip>>;
557
+ }, z.core.$strip>>;
558
+ }, z.core.$strip>;
559
+ }, z.core.$strip>;
221
560
  //# sourceMappingURL=schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;;;;iBAM7D,CAAA;AAEJ,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;iBAA6B,CAAA;AAC3F,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;iBAAsC,CAAA;AACnG,eAAO,MAAM,eAAe;;iBAAqC,CAAA;AAEjE,eAAO,MAAM,mBAAmB;;;;;;;;EAQ9B,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;EAK3C,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;iBAgB9B,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D,eAA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AA;AACjF,eAAO,MAAM,oBAAoB;;;;;;;;iBAAyC,CAAA;AAC1E,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA6C,CAAA;AACtF,eAAO,MAAM,iCAAiC;;;;;;;;;;;iBAAkD,CAAA;AAChG,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE/C,CAAA"}
package/dist/schemas.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { publicBookingSessionRepriceResultSchema, publicBookingSessionSchema, publicBookingSessionStateSchema, } from "@voyantjs/bookings/validation";
1
2
  import { z } from "zod";
2
3
  export const paginatedEnvelope = (item) => z.object({
3
4
  data: z.array(item),
@@ -88,3 +89,6 @@ export const bookingPassengersResponse = arrayEnvelope(bookingPassengerRecordSch
88
89
  export const bookingSupplierStatusesResponse = arrayEnvelope(bookingSupplierStatusRecordSchema);
89
90
  export const bookingActivityResponse = arrayEnvelope(bookingActivityRecordSchema);
90
91
  export const bookingNotesResponse = arrayEnvelope(bookingNoteRecordSchema);
92
+ export const publicBookingSessionResponse = singleEnvelope(publicBookingSessionSchema);
93
+ export const publicBookingSessionStateResponse = singleEnvelope(publicBookingSessionStateSchema);
94
+ export const publicBookingSessionRepriceResponse = singleEnvelope(publicBookingSessionRepriceResultSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyantjs/bookings-react",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "license": "FSL-1.1-Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,67 +9,63 @@
9
9
  },
10
10
  "type": "module",
11
11
  "exports": {
12
- ".": "./src/index.ts",
13
- "./provider": "./src/provider.tsx",
14
- "./hooks": "./src/hooks/index.ts",
15
- "./client": "./src/client.ts",
16
- "./query-keys": "./src/query-keys.ts"
17
- },
18
- "scripts": {
19
- "build": "tsc -p tsconfig.json",
20
- "clean": "rm -rf dist",
21
- "prepack": "pnpm run build",
22
- "typecheck": "tsc --noEmit",
23
- "lint": "biome check src/",
24
- "test": "vitest run --passWithNoTests"
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ },
16
+ "./provider": {
17
+ "types": "./dist/provider.d.ts",
18
+ "import": "./dist/provider.js"
19
+ },
20
+ "./hooks": {
21
+ "types": "./dist/hooks/index.d.ts",
22
+ "import": "./dist/hooks/index.js"
23
+ },
24
+ "./client": {
25
+ "types": "./dist/client.d.ts",
26
+ "import": "./dist/client.js"
27
+ },
28
+ "./query-keys": {
29
+ "types": "./dist/query-keys.d.ts",
30
+ "import": "./dist/query-keys.js"
31
+ }
25
32
  },
26
33
  "peerDependencies": {
27
- "@voyantjs/bookings": "workspace:*",
28
34
  "@tanstack/react-query": "^5.0.0",
29
35
  "react": "^19.0.0",
30
36
  "react-dom": "^19.0.0",
31
- "zod": "^4.0.0"
37
+ "zod": "^4.0.0",
38
+ "@voyantjs/bookings": "0.3.1"
32
39
  },
33
40
  "devDependencies": {
34
41
  "@tanstack/react-query": "^5.96.2",
35
42
  "@types/react": "^19.2.14",
36
43
  "@types/react-dom": "^19.2.3",
37
- "@voyantjs/bookings": "workspace:*",
38
- "@voyantjs/voyant-typescript-config": "workspace:*",
39
44
  "react": "^19.2.4",
40
45
  "react-dom": "^19.2.4",
41
46
  "typescript": "^6.0.2",
42
47
  "vitest": "^4.1.2",
43
- "zod": "^4.3.6"
48
+ "zod": "^4.3.6",
49
+ "@voyantjs/bookings": "0.3.1",
50
+ "@voyantjs/react": "0.3.1",
51
+ "@voyantjs/voyant-typescript-config": "0.1.0"
52
+ },
53
+ "dependencies": {
54
+ "@voyantjs/react": "0.3.1"
44
55
  },
45
56
  "files": [
46
57
  "dist"
47
58
  ],
48
59
  "publishConfig": {
49
- "access": "public",
50
- "exports": {
51
- ".": {
52
- "types": "./dist/index.d.ts",
53
- "import": "./dist/index.js"
54
- },
55
- "./provider": {
56
- "types": "./dist/provider.d.ts",
57
- "import": "./dist/provider.js"
58
- },
59
- "./hooks": {
60
- "types": "./dist/hooks/index.d.ts",
61
- "import": "./dist/hooks/index.js"
62
- },
63
- "./client": {
64
- "types": "./dist/client.d.ts",
65
- "import": "./dist/client.js"
66
- },
67
- "./query-keys": {
68
- "types": "./dist/query-keys.d.ts",
69
- "import": "./dist/query-keys.js"
70
- }
71
- },
72
- "main": "./dist/index.js",
73
- "types": "./dist/index.d.ts"
74
- }
75
- }
60
+ "access": "public"
61
+ },
62
+ "scripts": {
63
+ "build": "tsc -p tsconfig.json",
64
+ "clean": "rm -rf dist",
65
+ "typecheck": "tsc --noEmit",
66
+ "lint": "biome check src/",
67
+ "test": "vitest run --passWithNoTests"
68
+ },
69
+ "main": "./dist/index.js",
70
+ "types": "./dist/index.d.ts"
71
+ }