@wix/bookings 1.0.1777 → 1.0.1779

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 (56) hide show
  1. package/build/cjs/context-booking-checkout.d.ts +243 -108
  2. package/build/cjs/context-booking-checkout.js +176 -182
  3. package/build/cjs/context-booking-checkout.js.map +1 -1
  4. package/build/cjs/context-categories.d.ts +16 -143
  5. package/build/cjs/context-categories.js +411 -411
  6. package/build/cjs/context-categories.js.map +1 -1
  7. package/build/cjs/context-locations.d.ts +16 -287
  8. package/build/cjs/context-locations.js +335 -335
  9. package/build/cjs/context-locations.js.map +1 -1
  10. package/build/cjs/context-service-addons.d.ts +2 -2
  11. package/build/cjs/context-service.d.ts +71 -33
  12. package/build/cjs/context-service.js +97 -95
  13. package/build/cjs/context-service.js.map +1 -1
  14. package/build/cjs/context-time-slots.d.ts +10 -0
  15. package/build/cjs/context-time-slots.js +1 -1
  16. package/build/cjs/context-time-slots.js.map +1 -1
  17. package/build/es/context-booking-checkout.d.mts +243 -108
  18. package/build/es/context-booking-checkout.mjs +176 -179
  19. package/build/es/context-booking-checkout.mjs.map +1 -1
  20. package/build/es/context-categories.d.mts +16 -143
  21. package/build/es/context-categories.mjs +411 -411
  22. package/build/es/context-categories.mjs.map +1 -1
  23. package/build/es/context-locations.d.mts +16 -287
  24. package/build/es/context-locations.mjs +335 -335
  25. package/build/es/context-locations.mjs.map +1 -1
  26. package/build/es/context-service-addons.d.mts +2 -2
  27. package/build/es/context-service.d.mts +71 -33
  28. package/build/es/context-service.mjs +97 -95
  29. package/build/es/context-service.mjs.map +1 -1
  30. package/build/es/context-time-slots.d.mts +10 -0
  31. package/build/es/context-time-slots.mjs +1 -1
  32. package/build/es/context-time-slots.mjs.map +1 -1
  33. package/build/internal/cjs/context-booking-checkout.d.ts +243 -108
  34. package/build/internal/cjs/context-categories.d.ts +16 -143
  35. package/build/internal/cjs/context-locations.d.ts +16 -287
  36. package/build/internal/cjs/context-service-addons.d.ts +2 -2
  37. package/build/internal/cjs/context-service.d.ts +71 -33
  38. package/build/internal/cjs/context-time-slots.d.ts +10 -0
  39. package/build/internal/es/context-booking-checkout.d.mts +243 -108
  40. package/build/internal/es/context-categories.d.mts +16 -143
  41. package/build/internal/es/context-locations.d.mts +16 -287
  42. package/build/internal/es/context-service-addons.d.mts +2 -2
  43. package/build/internal/es/context-service.d.mts +71 -33
  44. package/build/internal/es/context-time-slots.d.mts +10 -0
  45. package/context-runtime/context-booking-checkout/runtime.d.ts +243 -108
  46. package/context-runtime/context-booking-checkout/runtime.js +3 -3
  47. package/context-runtime/context-categories/runtime.d.ts +16 -143
  48. package/context-runtime/context-categories/runtime.js +2 -2
  49. package/context-runtime/context-locations/runtime.d.ts +16 -287
  50. package/context-runtime/context-locations/runtime.js +2 -2
  51. package/context-runtime/context-service/runtime.d.ts +71 -33
  52. package/context-runtime/context-service/runtime.js +3 -3
  53. package/context-runtime/context-service-addons/runtime.d.ts +2 -2
  54. package/context-runtime/context-time-slots/runtime.d.ts +10 -0
  55. package/context-runtime/context-time-slots/runtime.js +2 -2
  56. package/package.json +7 -7
@@ -481,6 +481,16 @@ interface TimeSlotItem {
481
481
  readonly slotEndTime: string | null;
482
482
  /** Whether the visitor can book the time slot. */
483
483
  readonly bookable: boolean;
484
+ /**
485
+ * Whether booking for the time slot hasn't opened yet, under the business's booking policy
486
+ * (it books too far ahead).
487
+ */
488
+ readonly tooEarlyToBook: boolean;
489
+ /**
490
+ * Whether booking for the time slot has closed, under the business's booking policy (it starts
491
+ * too soon).
492
+ */
493
+ readonly tooLateToBook: boolean;
484
494
  /** Total number of spots in the time slot. `null` when it's unknown. */
485
495
  readonly totalCapacity: number | null;
486
496
  /** Number of spots left in the time slot. `null` when it's unknown. */
@@ -2623,7 +2623,7 @@ function xl({ rows: e2, slotIdOf: t2 }, n2) {
2623
2623
  return [...e2.filter((e3) => t2(e3) === n2)].sort((e3, t3) => Dl(t3) - Dl(e3))[0] ?? null;
2624
2624
  }
2625
2625
  function Sl(e2, t2, n2, r2) {
2626
- return { slotId: n2(e2), slotStartTime: e2.localStartDate ?? null, slotEndTime: e2.localEndDate ?? null, bookable: e2.bookable ?? false, totalCapacity: e2.totalCapacity ?? null, remainingCapacity: e2.remainingCapacity ?? null, bookableCapacity: e2.bookableCapacity ?? null, eventId: e2.eventInfo?.eventId ?? null, eventTitle: e2.eventInfo?.eventTitle ?? null, waitlistCapacity: e2.eventInfo?.waitingList?.remainingCapacity ?? null, locationId: e2.location?._id ?? null, locationName: e2.location?.name || e2.location?.formattedAddress || null, durationMinutes: El(e2, t2), isAllDay: e2.allDay ?? false, staff: r2 ? [] : Cl(e2) };
2626
+ return { slotId: n2(e2), slotStartTime: e2.localStartDate ?? null, slotEndTime: e2.localEndDate ?? null, bookable: e2.bookable ?? false, tooEarlyToBook: e2.bookingPolicyViolations?.tooEarlyToBook ?? false, tooLateToBook: e2.bookingPolicyViolations?.tooLateToBook ?? false, totalCapacity: e2.totalCapacity ?? null, remainingCapacity: e2.remainingCapacity ?? null, bookableCapacity: e2.bookableCapacity ?? null, eventId: e2.eventInfo?.eventId ?? null, eventTitle: e2.eventInfo?.eventTitle ?? null, waitlistCapacity: e2.eventInfo?.waitingList?.remainingCapacity ?? null, locationId: e2.location?._id ?? null, locationName: e2.location?.name || e2.location?.formattedAddress || null, durationMinutes: El(e2, t2), isAllDay: e2.allDay ?? false, staff: r2 ? [] : Cl(e2) };
2627
2627
  }
2628
2628
  function Cl(e2) {
2629
2629
  let t2 = /* @__PURE__ */ new Map();