@bowlos/reservations 0.41.0 → 1.0.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.
Files changed (61) hide show
  1. package/AGENTS.md +20 -5
  2. package/CHANGELOG.md +22 -0
  3. package/HEADLESS.md +187 -41
  4. package/README.md +77 -0
  5. package/dist/{account-DEX2Lr78.d.cts → account-b8chVpED.d.cts} +892 -14
  6. package/dist/{account-DEX2Lr78.d.ts → account-b8chVpED.d.ts} +892 -14
  7. package/dist/booking-change-B-ADuVEz.d.cts +562 -0
  8. package/dist/booking-change-BrJ-XESC.d.ts +562 -0
  9. package/dist/chunk-43WZ6TLQ.js +12 -0
  10. package/dist/chunk-43WZ6TLQ.js.map +1 -0
  11. package/dist/{chunk-VJIS56OO.js → chunk-CTJODEHR.js} +119 -7
  12. package/dist/chunk-CTJODEHR.js.map +1 -0
  13. package/dist/{chunk-YAXBZJMI.js → chunk-EPYGIJRJ.js} +20 -3
  14. package/dist/chunk-EPYGIJRJ.js.map +1 -0
  15. package/dist/{chunk-BWJHRJN6.js → chunk-EXEKCMQ2.js} +57 -22
  16. package/dist/chunk-EXEKCMQ2.js.map +1 -0
  17. package/dist/{chunk-44WKP6MW.js → chunk-IDRTMFJJ.js} +36 -3
  18. package/dist/chunk-IDRTMFJJ.js.map +1 -0
  19. package/dist/{chunk-FMFHNBDH.js → chunk-LFFANITL.js} +98 -12
  20. package/dist/chunk-LFFANITL.js.map +1 -0
  21. package/dist/cli.cjs +5 -0
  22. package/dist/cli.cjs.map +1 -1
  23. package/dist/components.cjs +670 -131
  24. package/dist/components.cjs.map +1 -1
  25. package/dist/components.d.cts +19 -7
  26. package/dist/components.d.ts +19 -7
  27. package/dist/components.js +304 -66
  28. package/dist/components.js.map +1 -1
  29. package/dist/index.cjs +67 -0
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +4 -4
  32. package/dist/index.d.ts +4 -4
  33. package/dist/index.js +5 -4
  34. package/dist/index.js.map +1 -1
  35. package/dist/payments.cjs +34 -12
  36. package/dist/payments.cjs.map +1 -1
  37. package/dist/payments.d.cts +10 -2
  38. package/dist/payments.d.ts +10 -2
  39. package/dist/payments.js +6 -78
  40. package/dist/payments.js.map +1 -1
  41. package/dist/{react-CrRciA7I.d.ts → react-cqGEohr0.d.cts} +4 -2
  42. package/dist/{react-QJrsaOnN.d.cts → react-s4J-e10i.d.ts} +4 -2
  43. package/dist/react.cjs +202 -19
  44. package/dist/react.cjs.map +1 -1
  45. package/dist/react.d.cts +28 -6
  46. package/dist/react.d.ts +28 -6
  47. package/dist/react.js +5 -5
  48. package/package.json +2 -1
  49. package/templates/center-site/README.md +1 -0
  50. package/templates/center-site/app/book/event-reservation-form.tsx +276 -0
  51. package/templates/center-site/app/book/page.tsx +107 -49
  52. package/templates/center-site/app/catalog/page.tsx +3 -1
  53. package/templates/center-site/app/events/[slug]/page.tsx +7 -10
  54. package/templates/center-site/package.json +1 -1
  55. package/dist/booking-change-4DGu-B08.d.ts +0 -1282
  56. package/dist/booking-change-aK6P37FZ.d.cts +0 -1282
  57. package/dist/chunk-44WKP6MW.js.map +0 -1
  58. package/dist/chunk-BWJHRJN6.js.map +0 -1
  59. package/dist/chunk-FMFHNBDH.js.map +0 -1
  60. package/dist/chunk-VJIS56OO.js.map +0 -1
  61. package/dist/chunk-YAXBZJMI.js.map +0 -1
package/AGENTS.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # Agent build guide — complete center / brand customer website
2
2
 
3
- Target: @bowlos/reservations 0.41.0. Use the installed package exports, not assumptions
3
+ Target: @bowlos/reservations 1.0.0. Use the installed package exports, not assumptions
4
4
  about future releases. Read [HEADLESS.md](./HEADLESS.md) for contracts and patterns.
5
- All APIs below are available. Build every listed page in the center’s own design.
5
+ Build every listed page in the center’s own design. The documented 1.x SDK APIs
6
+ follow semantic versioning. Before building reservation events, read the
7
+ [1.0.0 headless adoption steps](./HEADLESS.md#100). Carry the offer slug through
8
+ discovery, slot pricing, preview, and creation. Use the server-returned choices
9
+ and the Center-local date. Keep ticket checkout on the ticket APIs.
6
10
 
7
11
  ## Required pages checklist
8
12
 
@@ -15,7 +19,7 @@ to adapt; create and link the required route in the consuming site.
15
19
  | --- | --- | --- | --- |
16
20
  | home: Home / center selection | `useCenters`, `useHours`, `useCenterHours`, `useCatalog` | [Customer toolkit routes (v0.37.0)](./HEADLESS.md#customer-toolkit-routes-v0370) | Custom home UI (no dedicated component). `templates/center-site/app/page.tsx`. Use the Center local timezone for dates, hours and receipts. |
17
21
  | book: Book (date-first) | `useBookingFlow`, `useProducts`, `useStartTimes`, `useAvailability`, `useBookingPreview`, `useAddons` | [Date-first booking (v0.24.0)](./HEADLESS.md#date-first-booking-v0240) | `BookingFlow` reference. `templates/center-site/app/book/page.tsx`. Default to today; date → product → quantity → time → add-ons → review → payment → confirmation. Available: `useHoldCountdown`, `useMyHold`, `useExtendMyHold`, `useReleaseMyHold`, `useCancellationPolicy`, `useCancelMyPendingBooking` ([holds](./HEADLESS.md#holds-and-pending-cancellation-v0390)); Available: `useBookingChange` ([booking changes](./HEADLESS.md#booking-changes-v0400)). |
18
- | events: Events index + /events/<slug> + tickets | `useEvents` (legacy pricing events), `useEventOffers`, `useEventOffer`, `useEventTicketPreview`, `useEventTicketPurchase` | [Event offers in the catalog](./HEADLESS.md#event-offers-in-the-catalog) | Available: EventList; event detail + ticket purchase. `templates/center-site/app/events/page.tsx`, `templates/center-site/app/events/[slug]/page.tsx`. [Reference account components](./HEADLESS.md#reference-account-components-v0410). |
22
+ | events: Events index + /events/<slug> + tickets | `useEvents` (legacy pricing events), `useEventOffers`, `useEventOffer`, `useEventOfferOptions`, `useEventTicketPreview`, `useEventTicketPurchase` | [Event offers in the catalog](./HEADLESS.md#event-offers-in-the-catalog) | Available: EventList; event detail + ticket purchase. `templates/center-site/app/events/page.tsx`, `templates/center-site/app/events/[slug]/page.tsx`. [Reference account components](./HEADLESS.md#reference-account-components-v0410). |
19
23
  | buy: Catalog, packages, passes and memberships buy pages | `useCatalog`, `usePackages`, `usePackage`, `usePackagePreview`, `usePackagePurchase`, `useGameCards`, `useGameCardPreview`, `useGameCardPurchase`, `usePublicMemberships`, `useMembershipPreview`, `useMembershipPurchase`, `useMembershipSubscriptionCheckout` | [The canonical catalog (visibility-aware) — `useCatalog`](./HEADLESS.md#the-canonical-catalog-visibility-aware--usecatalog) | `BookingCatalog` reference. `templates/center-site/app/catalog/page.tsx`. Also copy `templates/center-site/app/buy/page.tsx`; preserve one-time versus recurring membership checkout and refresh status after payment. |
20
24
  | flash: Flash sales index + detail | `useFlashSales`, `useFlashSale`, `useFlashSaleBookingOptions`, `createFlashSaleBooking` | [Booking a flash-sale item at the sale price (headless)](./HEADLESS.md#booking-a-flash-sale-item-at-the-sale-price-headless) | `FlashSaleIndex` / `FlashSale` reference. `templates/center-site/app/flash/page.tsx`. Also copy `templates/center-site/app/flash/[slug]/page.tsx`; carry sale context through preview/purchase. |
21
25
  | pricing: Pricing | `useRetailPricing`, `listRetailPricing` | [Retail pricing page — walk-in rates + website specials (v0.31.0)](./HEADLESS.md#retail-pricing-page--walk-in-rates--website-specials-v0310) | `PricingTable`; adapt `templates/center-site/app/page.tsx` into a pricing route using the hooks. No dedicated pricing template is shipped. All prices come at runtime from the brand/center Bowl OS account via `useRetailPricing` / `listRetailPricing`, never hardcoded. |
@@ -31,6 +35,7 @@ to adapt; create and link the required route in the consuming site.
31
35
  | privacy: Privacy: export + delete account | `useAccountDeletion`, `previewAccountDeletion`, `deleteMyAccount`, `exportMyDataV2`, `useExportMyData`, `exportMyData`, `useDeleteMyAccount` | [Account deletion and export (v0.38.0)](./HEADLESS.md#account-deletion-and-export-v0380) | Available: PrivacyCenter: deletion consequences, exact typing, retry/support and export v2. `templates/center-site/app/account/privacy/page.tsx`. [Reference account components](./HEADLESS.md#reference-account-components-v0410). |
32
36
  | detail: Order / reservation detail + cancellation | `useMyReservationDetail`, `useMyEventOrder`, `useMyPackageOrder`, `useReceipt`, `useReservationCancelPreview`, `useEventOrderCancelPreview`, `usePackageOrderCancelPreview`, `useCancelMyReservation`, `useCancelMyEventOrder`, `useCancelMyPackageOrder` | [Self-serve cancel (v0.23.0)](./HEADLESS.md#self-serve-cancel-v0230) | Available: BookingChange + AddToWalletButtons; use the loaded expectedVersion. `templates/center-site/app/account/reservations/page.tsx`, `templates/center-site/app/account/reservations/[displayId]/page.tsx`, `templates/center-site/app/account/reservations/[displayId]/change/page.tsx`. [Reference account components](./HEADLESS.md#reference-account-components-v0410). |
33
37
  | pay-links: Pay links | `getPayLink`, `createPayLinkPayment`, `usePayLink`, `useCreatePayLinkPayment` | [9. Payment (Stripe Connect)](./HEADLESS.md#9-payment-stripe-connect) | Available: BowlosPaymentForm from /payments with usePayLink and useCreatePayLinkPayment. `templates/center-site/app/pay/[token]/page.tsx`. [Reference account components](./HEADLESS.md#reference-account-components-v0410). |
38
+ | waitlist: Slot-full join + account pending entries | `joinWaitlist`, `createWaitlistSetupIntent`, `confirmWaitlistCard`, `listMyWaitlist`, `leaveWaitlist`, `useWaitlistJoin` | [0.42.0](./HEADLESS.md#0420) | `WaitlistJoin` reference; adapt booking and account templates to your own design. Center toggle controls availability; explicit amount consent required. |
34
39
 
35
40
  ## Install and configure
36
41
 
@@ -43,7 +48,7 @@ the real ones from the BowlOS admin.
43
48
 
44
49
  ```bash
45
50
  cd <site-dir>
46
- npm i @bowlos/reservations@^0.41.0
51
+ npm i @bowlos/reservations@^1.0.0
47
52
  npm i react@19.2.4 react-dom@19.2.4 next@16.2.4 @stripe/stripe-js@9.4.0 @stripe/react-stripe-js@6.3.0
48
53
  ```
49
54
 
@@ -102,7 +107,7 @@ npm install
102
107
  ```
103
108
 
104
109
  `init` copies the full starter into `<site-dir>`. Its `package.json` pins
105
- `@bowlos/reservations@^0.41.0` and the peers above. `--force` is required because
110
+ `@bowlos/reservations@^1.0.0` and the peers above. `--force` is required because
106
111
  step 1 already created files in the folder, and it overwrites files that share a
107
112
  name with template files (your `.env.local` stays). On an existing app, skip `init`
108
113
  and copy pages from `node_modules/@bowlos/reservations/templates/center-site/`
@@ -271,6 +276,16 @@ Do not treat internal/advanced as a recommended site integration path.
271
276
  | `/components` | `BookingChange`, `BookingChangeProps` | detail |
272
277
  | `/payments` | `AddCardForm`, `AddCardFormProps` | saved-cards |
273
278
 
279
+
280
+ | `.` | `SlotFullDetails`, `JoinWaitlistArgs`, `WaitlistEntryArgs`, `JoinWaitlistResult`, `WaitlistSetupIntent`, `MyWaitlistEntry`, `joinWaitlist`, `createWaitlistSetupIntent`, `confirmWaitlistCard`, `listMyWaitlist`, `leaveWaitlist` | waitlist |
281
+ | `/react` | `WaitlistJoinStatus`, `useWaitlistJoin` | waitlist |
282
+ | `/components` | `WaitlistJoin`, `WaitlistJoinProps` | waitlist |
283
+
284
+ | `.` | `EventOfferSession`, `EventOfferDetail`, `EventOfferOptionsArgs`, `EventOfferOptionsResult`, `EventOfferStartOption`, `eventOfferOptions`, `isFixedSession`, `durationsForStart`, `formatSessionRange` | events / book |
285
+ | `/react` | `useEventOfferOptions` | events / book |
286
+ | `.` | `DuplicateBookingArgs`, `DuplicateBookingResult`, `checkDuplicateBooking` | book |
287
+ | `/react` | `useDuplicateBooking` | book |
288
+
274
289
  ## Template pages
275
290
 
276
291
  Generated from examples/center-site; edit the source when maintaining the SDK.
package/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0
4
+
5
+ - Adopt semantic versioning for the documented SDK surface.
6
+ - Add typed reservation-event sessions, server-filtered start and duration
7
+ options, and helpers for fixed sessions, duration choices, and overnight labels.
8
+ - Support offer-scoped start and price calls with the existing response
9
+ shapes. Preserve regular bookings and ticket checkout.
10
+ - Update the reference booking flow and canonical Center-site template.
11
+ See the [headless adoption steps](./HEADLESS.md#100).
12
+
13
+ ## 0.43.0
14
+
15
+ - Accept optional `textUpdates` in `joinWaitlist` and `useWaitlistJoin().join`; omitted consent defaults to no texts on the backend.
16
+ - Document and test the optional waitlist quantity, attraction labels, promoted window, and text status fields added in N5.
17
+ - Keep staff-only waitlist error codes out of the public SDK exports.
18
+ - See HEADLESS.md for adoption in a center site's own design. Code prepared for `next`; publishing and tag changes are separate release steps.
19
+
20
+ ## 0.42.0
21
+
22
+ - Added authenticated waitlist routes, `useWaitlistJoin`, reference join/account components, and additive slot-full error details. See README.md and HEADLESS.md for the original release notes.
package/HEADLESS.md CHANGED
@@ -25,6 +25,37 @@ All hooks come from `@bowlos/reservations/react`; the framework-agnostic twins
25
25
 
26
26
  ## Capability map
27
27
 
28
+ | Reservation event capability | Headless API |
29
+ | --- | --- |
30
+ | Session metadata | `EventOffer.session`, `EventOfferDetail`, `CatalogItem.session` |
31
+ | Available starts and durations | `eventOfferOptions` / `useEventOfferOptions`, `durationsForStart` |
32
+ | Fixed duration and overnight display | `isFixedSession`, `formatSessionRange` |
33
+ | Offer-scoped slot prices | `previewSlotPrices` / `useSlotPrices` |
34
+ | Checkout | `useBookingPreview`, `useBookingFlow.startHold` with `eventOfferSlug` |
35
+
36
+ ### Unreleased — checkout expiry safety (2026-11-29)
37
+
38
+ | Behavior | Headless API | Adoption |
39
+ | --- | --- | --- |
40
+ | Recheck active inventory before Stripe confirmation | `useBookingFlow().checkBeforePayment()`; core `getCheckoutStatus(client, refToken)` | Await immediately before `stripe.confirmPayment`; continue only when true (core: pending_payment/payment_failed_retryable). |
41
+
42
+ `preparePayment()` also checks, but customers can leave Elements open afterwards.
43
+ In your pay submit handler: `if (!await flow.checkBeforePayment()) return;`.
44
+ Render `flow.error.message` on failure; expired polls stop with `CHECKOUT_EXPIRED`:
45
+ “Your hold expired — please pick your time again”. Restart from time selection.
46
+ The backend never revives expired inventory and automatically refunds/cancels late
47
+ payments. A separate thunderrock300.com site PR must wire this submit check and
48
+ message into its headless form. This source change is unreleased; do not assume
49
+ installing the currently published 0.43.0 adds the callback. Reference payment
50
+ components still delegate confirmation to the consumer's payment renderer.
51
+
52
+ ### Unreleased — duplicate-booking warning (2026-11-29)
53
+
54
+ | Core helper | React hook | Gateway route |
55
+ | --- | --- | --- |
56
+ | `checkDuplicateBooking` (unreleased E2) | `useDuplicateBooking` | `checkDuplicateBooking` |
57
+
58
+
28
59
  ### Customer toolkit additions (v0.39.0)
29
60
 
30
61
  | Core helper | React hook | Gateway route |
@@ -483,6 +514,21 @@ const startTimes = useStartTimes(
483
514
  );
484
515
  ```
485
516
 
517
+ Gateway addition (unreleased; no SDK version change): `listPublicProducts`
518
+ (`useProducts` / `listProducts`) now also returns these three **optional** fields
519
+ for hourly products, using the same attraction settings and 60/30/240 defaults
520
+ as mobile. Per-game entries omit the fields; fixed events keep their own window.
521
+ Headless adoption: build the picker directly from a timed list entry when all
522
+ three fields are present, or fetch `getPublicProduct` for older gateway responses.
523
+ Use `min + n * increment` through `max` (inclusive), default to `min`, and pass the
524
+ chosen duration unchanged to start-times, availability, slot prices, preview,
525
+ and createBooking (as `endMinuteOfDay - startMinuteOfDay` where applicable).
526
+ Per-game flows keep using `product.durationMinutes` without a duration picker.
527
+ The server rejects out-of-range or off-increment hourly durations with
528
+ `VALIDATION_FAILED`; refresh product bounds and ask the customer to reselect.
529
+ `useProducts` / `listProducts` remain generic; include these optional numeric
530
+ fields in your site's product type. No component adoption is required.
531
+
486
532
  #### 5b. Booking horizon — cap the date picker
487
533
 
488
534
  The product read also returns `maxAdvanceDays: number | null` (null = no limit).
@@ -751,47 +797,10 @@ const events = useEventOffers({ centerId });
751
797
  Route catalog picks by `offer.slug` to your event landing page. On that page,
752
798
  read the full offer with `useEventOffer({ slug })`.
753
799
 
754
- For `purchaseMode: "reservation"`, start the normal booking flow with the
755
- offer's `productId`, preselect `date`, `startMinuteOfDay`, and duration
756
- (`endMinuteOfDay - startMinuteOfDay`) when present, and preselect
757
- `includedAddons` — these are the offer's PRE-SELECTED add-ons, charged at
758
- their normal add-on price on top of the event plan rate (they are not
759
- free); initialize each add-on's quantity to the configured amount and let
760
- the customer adjust. Pass `eventOfferSlug: offer.slug` into both
761
- `useBookingPreview` and the booking hold/create call (`useBookingFlow.startHold`
762
- or `createBooking`). The server uses that slug to bind the quote to the offer's
763
- event price plan, tax override, and Center fee override/inheritance. Then
764
- continue through the same [Review step](#7-review-step--an-order-summary-before-payment)
765
- and `useBookingFlow` lifecycle above. That keeps event reservations on the same
766
- pricing, hold, tax, fee, credit, and Stripe Connect path as regular bookings.
767
- `useBookingPreview` returns `taxLinesPerPlan` alongside `totalCentsPerPlan`;
768
- render the entry matching the selected/headline price plan so event tax appears
769
- as its own Review row instead of being hidden inside the base reservation line.
770
-
771
- ```tsx
772
- const eventArgs = offer.purchaseMode === "reservation"
773
- ? { eventOfferSlug: offer.slug }
774
- : {};
775
-
776
- const preview = useBookingPreview(
777
- { centerId, productId: offer.productId!, dateISO, startMinuteOfDay, endMinuteOfDay, mode: pricingMode, ...countField(count), addons: selectedAddons, ...eventArgs },
778
- { enabled: offer.purchaseMode === "reservation" && signedIn },
779
- );
780
-
781
- // Later, after your Review step:
782
- flow.startHold({
783
- centerId,
784
- productId: offer.productId!,
785
- dateISO,
786
- startMinuteOfDay,
787
- endMinuteOfDay,
788
- mode: pricingMode,
789
- ...countField(count),
790
- addons: selectedAddons,
791
- customer,
792
- ...eventArgs,
793
- });
794
- ```
800
+ For `purchaseMode: "reservation"`, use the [1.0.0 adoption steps](#100).
801
+ Keep the offer's slug when routing from its landing page into your booking
802
+ funnel. The template uses `/book?eventOfferSlug=<slug>` and resolves the
803
+ product, Center and local date from the offer detail.
795
804
 
796
805
  For `purchaseMode: "ticket"`, route the customer to the hosted tenant ticket
797
806
  checkout at `/tenant/<slug>/events/<eventSlug>/tickets`, or mirror that flow in
@@ -1608,6 +1617,29 @@ intents/customer/hour), and also apply to direct Convex callers.
1608
1617
 
1609
1618
  ## Adopting changes by version
1610
1619
 
1620
+ [1.0.0 reservation event sessions](#100)
1621
+
1622
+ ### Unreleased (2026-11-29) — same-customer same-slot warning (E2)
1623
+
1624
+ Capability: `checkDuplicateBooking(client, args)` (core) / `useDuplicateBooking(args)`
1625
+ (React) checks existing reservations before creating a checkout. Pass `centerId`,
1626
+ `productId`, `dateISO`, `startMinuteOfDay`, `endMinuteOfDay`, and optionally the
1627
+ email the guest supplied. Signed-in sessions use their own customer identity;
1628
+ guest emails are trimmed/lowercased. Results contain only `duplicate` and
1629
+ `existingBooking` (local start/end minutes and `laneCount`, or null).
1630
+
1631
+ Pass `{ auth: true }` as the hook options or core helper third argument when
1632
+ a customer is signed in, so the server uses session identity.
1633
+
1634
+ Adoption: wait for a successful check before calling your booking mutation,
1635
+ including free/credit bookings. When `duplicate` is true, show “You already have
1636
+ a booking at this time” and require “Book another lane anyway” acknowledgement.
1637
+ Cancel must create no checkout/payment; reset acknowledgement when identity or
1638
+ slot changes. Surface query errors and allow retry. This is a warning, not a
1639
+ server-side hard block; intentional extra lanes remain allowed. Concurrent
1640
+ checkouts may both pass before either becomes a reservation. No version bump or
1641
+ publication in E2. Mobile JS is held for the 1.0.2 binaries.
1642
+
1611
1643
  What each SDK release changed in `<BookingFlow>` and the headless steps to match.
1612
1644
  Headless sites do **not** get these from a version bump — apply them by hand.
1613
1645
 
@@ -2073,3 +2105,117 @@ Migration: explicitly update `^0.40.0` to `^0.41.0`; follow the capability map a
2073
2105
  and the [reference component contracts](#reference-account-components-v0410).
2074
2106
  Keep custom headless UI or adopt individual references. Test recovery, cancellation,
2075
2107
  wallet eligibility, deletion retry and payment completion in the site's own design.
2108
+
2109
+ ## 0.42.0
2110
+
2111
+ Waitlist booking is available when the Center enables its online waitlist toggle.
2112
+ Upgrade explicitly from 0.41.x to 0.42.0; existing booking signatures and reservation
2113
+ statuses are unchanged. A waitlist entry becomes a reservation only on promotion.
2114
+
2115
+ For headless adoption, catch the `createBooking` / `createAnonymousBooking` error:
2116
+ `BowlosApiError.slotFullDetails` exposes `{ reason: "slot_full", waitlistAvailable,
2117
+ requested, available }`. The error code remains `VALIDATION_FAILED`; offer a
2118
+ waitlist only when `waitlistAvailable` is true. Subtype waitlisting is unsupported.
2119
+ Login is required. The Center toggle also gates join and card setup server-side.
2120
+
2121
+ Use `useWaitlistJoin` from `/react`: call `join(args)` (idle → quoting → card),
2122
+ display `entry.amountCents` from the Center pricing engine, and obtain explicit
2123
+ consent: “I authorize a charge of $X to this card if a spot opens.” No charge
2124
+ occurs at join. Never hardcode the amount. Then call `createCardSetup()` and use
2125
+ `setupIntent` (publishableKey, stripeAccount, clientSecret and
2126
+ customerSessionClientSecret) with Stripe Elements in SetupIntent mode. Confirm
2127
+ with `stripe.confirmSetup({ elements, redirect: "if_required" })`, complete any
2128
+ requires_action authentication, and pass the succeeded intent to
2129
+ `cardConfirmed({ id, status })` (confirming → joined or error). Unfinished intents
2130
+ stay in card state. `error` exposes failures; `reset()` starts over. Card setup
2131
+ must follow consent, including for a zero-dollar quote. The server freezes this
2132
+ quote for the eventual promotion charge. Abandoned pending_card entries expire.
2133
+
2134
+ Framework-free routes are `joinWaitlist`, `createWaitlistSetupIntent`,
2135
+ `confirmWaitlistCard`, `listMyWaitlist`, and `leaveWaitlist`, all authenticated.
2136
+ Entry routes take `entryId` plus optional brandId/centerId; confirm also takes
2137
+ setupIntentId. List takes brandId and optional centerId and returns active entries
2138
+ plus recent history. Show pending_card/waiting under “Pending — waitlist” and call
2139
+ leaveWaitlist for Leave; refresh the list and show “not charged”. Leaving is
2140
+ rejected while promotion is charging or its outcome is unknown. Cards remain in
2141
+ the wallet after leaving. Promoted entries link through promotedReservationDisplayId.
2142
+
2143
+ `WaitlistJoin` from `/components` is an optional reference using the same headless
2144
+ hook and AddCardForm SetupIntent UI, including amount consent. Pass booking `args`
2145
+ and optional `onJoined`. AccountDashboard supports a `"waitlist"` section;
2146
+ add it to your explicit section list to show pending entries. Existing headless sites retain
2147
+ their markup and adopt these routes directly; no component adoption is required.
2148
+
2149
+ ## 0.43.0
2150
+
2151
+ Waitlist text consent and account entry details are additive. Upgrade the SDK to
2152
+ 0.43.0 after the N6 backend is deployed; old clients omit consent and receive no
2153
+ waitlist texts. Existing booking and payment behavior is unchanged.
2154
+
2155
+ | Capability | Headless API | Adoption in your site's own UI |
2156
+ | ------------------------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2157
+ | Per-waitlist text consent | `joinWaitlist(client, { ...args, textUpdates })` or `useWaitlistJoin().join({ ...args, textUpdates })` | Pass the join checkbox's boolean. Omitted or `false` means no texts; `true` opts into this waitlist's transactional texts, subject to STOP and Center event settings. |
2158
+ | Attraction and quantity | `listMyWaitlist` → `MyWaitlistEntry` | Render optional `units`, `unitLabelSingular`, `unitLabelPlural`, and `attractionName`; use neutral “unit/units” when labels are absent. |
2159
+ | Promoted time | `MyWaitlistEntry.promotedStartMinuteOfDay` / `promotedEndMinuteOfDay` | Show the actual promoted window when present, otherwise the original start/end. Display in the Center's timezone. |
2160
+ | Text status | `MyWaitlistEntry.textUpdates` | Show whether texts are enabled; missing means no texts. This is not a marketing preference. |
2161
+
2162
+ For headless adoption, show a per-waitlist checkbox, initially checked, with the
2163
+ account holder's destination phone number; pass its current value explicitly.
2164
+ Keep the separate authorization for the quoted card charge. The reference
2165
+ `WaitlistJoin` accepts `textUpdates` through its `args`; it does not add a text
2166
+ checkbox for you. All entry fields above remain optional for older responses.
2167
+ Staff-only promotion, unit availability, closing, start-time, and guest-confirmation
2168
+ error codes are not part of the SDK's exported constants.
2169
+
2170
+ ## 1.0.0
2171
+
2172
+ Documented SDK exports and behavior follow semantic versioning. Compatible
2173
+ additions ship in 1.x minor releases, fixes in patches, and breaking changes
2174
+ require a new major version. Existing regular booking and ticket integrations
2175
+ can upgrade without changing their calls. Reservation event sessions require
2176
+ a gateway with the event-offer session contract.
2177
+
2178
+ 1. Use `useEventOffer<EventOfferDetail>({ slug })` and check
2179
+ `purchaseMode === "reservation"`, `productId` and `session`. An absent or
2180
+ null session means the session is unavailable to this flow. Lock the date
2181
+ to `session.dateISO` in `session.timezone`. Keep the existing ticket flow.
2182
+ 2. Pass `{ centerId, productId, dateISO, eventOfferSlug, mode, units, persons }`
2183
+ to `useEventOfferOptions` (or call `eventOfferOptions` directly). Include
2184
+ `games` for per-game bookings and `subtypeId` if selected. When present,
2185
+ use `session.pricingMode`. Let customers choose units and bowlers and cap
2186
+ bowlers at `units * session.maxPartySizePerUnit` when the cap is set.
2187
+ Use the returned starts and `durationsForStart(options, start)` for the
2188
+ duration choices. Revalidate both after a party or start change.
2189
+ 3. Use `isFixedSession(session)` to decide whether to show a duration picker.
2190
+ A fixed duration with one available start can show a static session.
2191
+ Several available starts still need a start picker. Use
2192
+ `formatSessionRange(startMinuteOfDay, endMinuteOfDay)` for a Center-local
2193
+ time range with a next-day label when it ends at or after midnight.
2194
+ 4. A successful empty result means no bookable sessions. Show an unavailable
2195
+ state for an invalid offer or missing session and surface API failures
2196
+ separately. Keep general availability queries disabled in this branch.
2197
+ `listStartTimes` / `useStartTimes` can take the slug when querying for a
2198
+ specific duration, and still return `number[]`. With the slug omitted,
2199
+ the regular start grid and server defaults apply.
2200
+ 5. Pass the slug and selected counts to `useSlotPrices` /
2201
+ `previewSlotPrices` for optional slot-price displays. Responses keep
2202
+ `{ startMinuteOfDay, headlinePriceCents }` with numeric cents or null.
2203
+ `session.basePrice` is configured-rate metadata, with a nullable
2204
+ `{ cents, basis }` where the basis is `fixed_block`, `hour`, `game`, or
2205
+ `mode_dependent`. Use the booking preview's per-plan total and breakdown
2206
+ for review, and the PaymentIntent amount for payment. The server calculates
2207
+ all prices, discounts, fees, and taxes.
2208
+ 6. If `session.shoesIncluded`, show “Shoes included”, hide the product's
2209
+ configured `defaultShoeAddonId`, and omit it from preview and hold
2210
+ payloads. Keep the other add-ons selectable. The offer detail's
2211
+ `includedAddons` are preselected paid add-ons, except for the included
2212
+ shoe rental. Use `session.defaultShoeAddonId` first, including for
2213
+ event-only products whose generic product detail is unavailable. For an
2214
+ older session payload that omits the field, use the configured product
2215
+ ID from `useProduct` / `getProduct` or supply `eventOffer.defaultShoeAddonId`.
2216
+ If legacy shoe metadata is unavailable, the references omit paid add-ons
2217
+ rather than risk charging for included shoes.
2218
+ 7. Send the same slug, date, selected start and end, and party and add-on
2219
+ choices to `useBookingPreview` and `useBookingFlow.startHold` or
2220
+ `createBooking`. Enable checkout only after the current selection has
2221
+ a server quote. Then use the usual hold, payment, and confirmation flow.
package/README.md CHANGED
@@ -17,6 +17,15 @@ operator's own account.
17
17
  `@bowlos/reservations/react` (provider + hooks). React is an optional peer.
18
18
  - **Dual ESM + CJS**, fully typed.
19
19
 
20
+ ## 1.0.0
21
+
22
+ The documented public SDK surface follows semantic versioning from 1.0 onward.
23
+ The release adds typed reservation-event sessions and availability for headless
24
+ sites. Existing regular booking and ticket calls keep their contracts.
25
+ Use the event offer slug through discovery, slot pricing, preview, and
26
+ creation, and use the server's quote for checkout. Follow the Center-local
27
+ session and add-on rules in the [headless adoption guide](./HEADLESS.md#100).
28
+
20
29
  ## Quickest start: scaffold a site
21
30
 
22
31
  ```bash
@@ -821,3 +830,71 @@ Migration: explicitly update `^0.40.0` to `^0.41.0`; follow the capability map a
821
830
  and the [reference component contracts](./HEADLESS.md#reference-account-components-v0410).
822
831
  Keep custom headless UI or adopt individual references. Test recovery, cancellation,
823
832
  wallet eligibility, deletion retry and payment completion in the site's own design.
833
+
834
+ ## 0.42.0
835
+
836
+ Waitlist booking is available when the Center enables its online waitlist toggle.
837
+ Upgrade explicitly from 0.41.x to 0.42.0; existing booking signatures and reservation
838
+ statuses are unchanged. A waitlist entry becomes a reservation only on promotion.
839
+
840
+ For headless adoption, catch the `createBooking` / `createAnonymousBooking` error:
841
+ `BowlosApiError.slotFullDetails` exposes `{ reason: "slot_full", waitlistAvailable,
842
+ requested, available }`. The error code remains `VALIDATION_FAILED`; offer a
843
+ waitlist only when `waitlistAvailable` is true. Subtype waitlisting is unsupported.
844
+ Login is required. The Center toggle also gates join and card setup server-side.
845
+
846
+ Use `useWaitlistJoin` from `/react`: call `join(args)` (idle → quoting → card),
847
+ display `entry.amountCents` from the Center pricing engine, and obtain explicit
848
+ consent: “I authorize a charge of $X to this card if a spot opens.” No charge
849
+ occurs at join. Never hardcode the amount. Then call `createCardSetup()` and use
850
+ `setupIntent` (publishableKey, stripeAccount, clientSecret and
851
+ customerSessionClientSecret) with Stripe Elements in SetupIntent mode. Confirm
852
+ with `stripe.confirmSetup({ elements, redirect: "if_required" })`, complete any
853
+ requires_action authentication, and pass the succeeded intent to
854
+ `cardConfirmed({ id, status })` (confirming → joined or error). Unfinished intents
855
+ stay in card state. `error` exposes failures; `reset()` starts over. Card setup
856
+ must follow consent, including for a zero-dollar quote. The server freezes this
857
+ quote for the eventual promotion charge. Abandoned pending_card entries expire.
858
+
859
+ Framework-free routes are `joinWaitlist`, `createWaitlistSetupIntent`,
860
+ `confirmWaitlistCard`, `listMyWaitlist`, and `leaveWaitlist`, all authenticated.
861
+ Entry routes take `entryId` plus optional brandId/centerId; confirm also takes
862
+ setupIntentId. List takes brandId and optional centerId and returns active entries
863
+ plus recent history. Show pending_card/waiting under “Pending — waitlist” and call
864
+ leaveWaitlist for Leave; refresh the list and show “not charged”. Leaving is
865
+ rejected while promotion is charging or its outcome is unknown. Cards remain in
866
+ the wallet after leaving. Promoted entries link through promotedReservationDisplayId.
867
+
868
+ `WaitlistJoin` from `/components` is an optional reference using the same headless
869
+ hook and AddCardForm SetupIntent UI, including amount consent. Pass booking `args`
870
+ and optional `onJoined`. AccountDashboard supports a `"waitlist"` section;
871
+ add it to your explicit section list to show pending entries. Existing headless sites retain
872
+ their markup and adopt these routes directly; no component adoption is required.
873
+
874
+ ## 0.43.0
875
+
876
+ Waitlist text consent and account entry details are additive. Upgrade the SDK to
877
+ 0.43.0 after the N6 backend is deployed; old clients omit consent and receive no
878
+ waitlist texts. Existing booking and payment behavior is unchanged.
879
+
880
+ | Capability | Headless API | Adoption in your site's own UI |
881
+ | ------------------------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
882
+ | Per-waitlist text consent | `joinWaitlist(client, { ...args, textUpdates })` or `useWaitlistJoin().join({ ...args, textUpdates })` | Pass the join checkbox's boolean. Omitted or `false` means no texts; `true` opts into this waitlist's transactional texts, subject to STOP and Center event settings. |
883
+ | Attraction and quantity | `listMyWaitlist` → `MyWaitlistEntry` | Render optional `units`, `unitLabelSingular`, `unitLabelPlural`, and `attractionName`; use neutral “unit/units” when labels are absent. |
884
+ | Promoted time | `MyWaitlistEntry.promotedStartMinuteOfDay` / `promotedEndMinuteOfDay` | Show the actual promoted window when present, otherwise the original start/end. Display in the Center's timezone. |
885
+ | Text status | `MyWaitlistEntry.textUpdates` | Show whether texts are enabled; missing means no texts. This is not a marketing preference. |
886
+
887
+ For headless adoption, show a per-waitlist checkbox, initially checked, with the
888
+ account holder's destination phone number; pass its current value explicitly.
889
+ Keep the separate authorization for the quoted card charge. The reference
890
+ `WaitlistJoin` accepts `textUpdates` through its `args`; it does not add a text
891
+ checkbox for you. All entry fields above remain optional for older responses.
892
+ Staff-only promotion, unit availability, closing, start-time, and guest-confirmation
893
+ error codes are not part of the SDK's exported constants.
894
+
895
+
896
+ Unreleased checkout safety: `useBookingFlow().checkBeforePayment()` must be
897
+ awaited immediately before Stripe confirmation. Continue only on `true`; show
898
+ `flow.error.message` on expiry and return to time selection. See the
899
+ [headless adoption guide](./HEADLESS.md#unreleased--checkout-expiry-safety-2026-11-29).
900
+ This change does not publish or bump the SDK version.