@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
@@ -2696,62 +2696,94 @@ declare const SERVICE_CTA_STATES: {
2696
2696
  type ServiceCtaState = (typeof SERVICE_CTA_STATES)[keyof typeof SERVICE_CTA_STATES];
2697
2697
  //#endregion
2698
2698
  //#region ../bookings-flow-data/dist/types.d.ts
2699
- /** Whether the Booking Preferences hold one service or a Multi-Service Appointment. Derived,
2700
- * not chosen: the bookings-uou writer sets it from the service count on every encode (2+
2701
- * services is `multi`). Readers should count `services` rather than read it. */
2702
- type BookingMode = 'single' | 'multi';
2703
- /** A committed resource selection for one resource *type* (staff, room, equipment…).
2704
- * Carried as ids — the server accepts ids via `resourceSelections`, so the full resource
2705
- * object (name, schedule) is never needed in the contract.
2699
+ /**
2700
+ * Whether the selection holds 1 service or several services booked together. Supported values:
2701
+ * - `'single'`: 1 service.
2702
+ * - `'multi'`: 2 or more services, booked together as a multi-service appointment.
2706
2703
  *
2707
- * Not `bookings.ResourceSelection` (API shape is `resourceTypeId` + `selectionMethod`). */
2704
+ * It follows the number of entries in `services`, so count those instead of reading it.
2705
+ */
2706
+ type BookingMode = 'single' | 'multi';
2707
+ /** Resources the visitor chose for 1 resource type, such as a staff member or a room. */
2708
2708
  interface ResourceSelection {
2709
+ /** ID of the resource type, such as the staff member resource type. */
2709
2710
  type: string;
2711
+ /** IDs of the chosen resources of this type. */
2710
2712
  ids: string[];
2711
- /** The user picked "any available" rather than a specific resource of this type. */
2713
+ /** Whether the visitor chose any available resource of this type, instead of a specific one. */
2712
2714
  anyResource?: boolean;
2713
2715
  }
2714
- /** A chosen service variant (dynamic pricing): participant count and/or option choices. */
2716
+ /** A variant the visitor chose for a service with variants: a number of participants, option choices, or both. */
2715
2717
  type SelectedVariant = Pick<ServiceChoices, 'numberOfParticipants'> & {
2716
- /** Selected option values (wire carries string ids / custom values, not full `ServiceChoice` objects). */choices?: string[];
2718
+ /** The chosen option values: a choice ID, or the text of a custom choice. */choices?: string[];
2717
2719
  };
2718
2720
  /** Genders a visitor can narrow "any staff member" to, in display order. Same literals as the
2719
2721
  * availability API's `requestedGender.gender`, single- and multi-service alike. */
2720
2722
  declare const REQUESTED_GENDERS: readonly ["ANY_FEMALE", "ANY_MALE"];
2721
2723
  type RequestedGender = (typeof REQUESTED_GENDERS)[number];
2722
- /** A chosen add-on with its quantity — maps SDK `BookedAddOn` fields to flow names (`id` ↔ `_id`). */
2724
+ /** An add-on the visitor chose, with its quantity. */
2723
2725
  type AddOn = {
2724
- id: NonNullable<BookedAddOn['_id']>;
2726
+ /** ID of the add-on. */id: NonNullable<BookedAddOn['_id']>; /** Number of the add-on to book. */
2725
2727
  quantity: NonNullable<BookedAddOn['quantity']>;
2726
2728
  };
2727
- /** One service's committed selections. Slot/schedule fields align with `bookings.V2Slot`. */
2729
+ /** What the visitor chose for 1 service: the service, its time slot, and their choices. */
2728
2730
  type ServicePreference = {
2729
- serviceId: NonNullable<V2Slot['serviceId']>;
2731
+ /** ID of the service. */serviceId: NonNullable<V2Slot['serviceId']>; /** Slug of the service, as in its page URL. */
2730
2732
  slug?: NonNullable<Slug['name']>;
2731
- serviceType?: Service['type']; /** ISO local datetimes — per service (services in a bundle can start at different times). */
2732
- slotStart?: V2Slot['startDate'];
2733
- slotEnd?: V2Slot['endDate'];
2734
- eventId?: V2Slot['eventId'];
2735
- scheduleId?: V2Slot['scheduleId']; /** Needed to rehydrate class sessions in the OOI form. */
2736
- sessionId?: V2Slot['sessionId']; /** Id only — maps to `SlotLocation._id` / location refetch at the destination. */
2737
- locationId?: NonNullable<SlotLocation['_id']>; /** Availability naming (`BUSINESS` | `CUSTOM` | `CUSTOMER`); the booking step translates it to the bookings enum. */
2738
- locationType?: 'BUSINESS' | 'CUSTOM' | 'CUSTOMER';
2739
- resources?: ResourceSelection[];
2740
- selectedVariants?: SelectedVariant[];
2741
- addOns?: AddOn[]; /** The duration variant choice's id, sent to availability as `customerChoices.durationChoiceId`. */
2742
- durationChoiceId?: string;
2743
- /** A chosen duration in minutes, sent as `customerChoices.durationInMinutes`. With add-ons the
2744
- * API requires it to equal the service duration plus theirs, so writers usually omit it. */
2745
- durationInMinutes?: number; /** Narrows "any staff member" to a gender, sent as `customerChoices.requestedGender`. */
2733
+ /**
2734
+ * Type of the service. Supported values:
2735
+ * - `'APPOINTMENT'`: An appointment, booked by time slot.
2736
+ * - `'CLASS'`: A class session.
2737
+ * - `'COURSE'`: A course, booked as a whole by its schedule.
2738
+ */
2739
+ serviceType?: Service['type'];
2740
+ /**
2741
+ * Start of the time slot, as a local date and time without an offset, such as
2742
+ * `'2026-10-08T10:00:00'`. It's in the selection's `timezone`. Each service has its own, because
2743
+ * services booked together can start at different times. Absent for a course.
2744
+ */
2745
+ slotStart?: V2Slot['startDate']; /** End of the time slot, in the same format as `slotStart`. Absent for a course. */
2746
+ slotEnd?: V2Slot['endDate']; /** ID of the calendar event of a class session. */
2747
+ eventId?: V2Slot['eventId']; /** ID of the schedule the slot belongs to. For a course, the course's schedule. */
2748
+ scheduleId?: V2Slot['scheduleId']; /** ID of the class session. */
2749
+ sessionId?: V2Slot['sessionId']; /** ID of the business location of the slot. */
2750
+ locationId?: NonNullable<SlotLocation['_id']>;
2751
+ /**
2752
+ * Where the service takes place. Supported values:
2753
+ * - `'BUSINESS'`: At one of the business's locations, in `locationId`.
2754
+ * - `'CUSTOM'`: At an address the business set for the service.
2755
+ * - `'CUSTOMER'`: At the customer's address.
2756
+ */
2757
+ locationType?: 'BUSINESS' | 'CUSTOM' | 'CUSTOMER'; /** Resources the visitor chose, such as a staff member, by resource type. */
2758
+ resources?: ResourceSelection[]; /** Variants the visitor chose, for a service with variants. */
2759
+ selectedVariants?: SelectedVariant[]; /** Add-ons the visitor chose. */
2760
+ addOns?: AddOn[]; /** ID of the duration choice the visitor chose, for a service with a choice of durations. */
2761
+ durationChoiceId?: string; /** Duration the visitor chose, in minutes. */
2762
+ durationInMinutes?: number;
2763
+ /**
2764
+ * Gender the visitor asked for when they chose any available staff member. Supported values:
2765
+ * `'ANY_FEMALE'`, `'ANY_MALE'`.
2766
+ */
2746
2767
  requestedGender?: RequestedGender;
2747
2768
  };
2748
- /** One accumulating object; each destination builder projects the slice it needs. */
2769
+ /** What the visitor selected to book: the services, their time slots, and their choices. */
2749
2770
  interface BookingPreferences {
2771
+ /** Whether the selection holds 1 service or several. Count `services` instead of reading it. */
2750
2772
  mode: BookingMode;
2773
+ /**
2774
+ * Time zone of the slots' local dates and times, as an IANA name such as `'Europe/London'`.
2775
+ * Can be absent when the selection has no time slot, such as a course.
2776
+ */
2751
2777
  timezone?: V2Slot['timezone'];
2778
+ /** The selected services, in booking order. */
2752
2779
  services: ServicePreference[];
2753
- /** The visitor ticked "I have a coupon" in the Booking Summary, so checkout must not be skipped.
2754
- * Absent means unticked; writers omit `false`. */
2780
+ /**
2781
+ * Whether the visitor asked to enter a promo code, in the booking summary. When it's `true`, a
2782
+ * priced booking paid in person goes through the checkout page, where the visitor enters the
2783
+ * code.
2784
+ *
2785
+ * Default: `false`
2786
+ */
2755
2787
  wantsPromoCode?: boolean;
2756
2788
  }
2757
2789
  //#endregion
@@ -3943,6 +3975,12 @@ interface Reschedule {
3943
3975
  * couldn't be read.
3944
3976
  */
3945
3977
  validUntil: string | null;
3978
+ /**
3979
+ * Name of the plan that the booking was paid with, in the site's language when it's translated.
3980
+ *
3981
+ * `null` when the booking wasn't paid with a plan, or the plan couldn't be read.
3982
+ */
3983
+ planName: string | null;
3946
3984
  }
3947
3985
  //#endregion
3948
3986
  //#region src/api/adapters/booking/reschedule-booking.d.ts
@@ -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. */