@bowlos/reservations 0.36.0 → 0.43.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 (76) hide show
  1. package/AGENTS.md +306 -0
  2. package/HEADLESS.md +595 -10
  3. package/README.md +303 -2
  4. package/dist/account-B4sZBmPI.d.cts +1837 -0
  5. package/dist/account-B4sZBmPI.d.ts +1837 -0
  6. package/dist/booking-change-Dd4PVgd3.d.cts +487 -0
  7. package/dist/booking-change-DzYs9133.d.ts +487 -0
  8. package/dist/chunk-4JMGS4YB.js +808 -0
  9. package/dist/chunk-4JMGS4YB.js.map +1 -0
  10. package/dist/chunk-I37IJNYU.js +139 -0
  11. package/dist/chunk-I37IJNYU.js.map +1 -0
  12. package/dist/{chunk-Y3YSDO3H.js → chunk-T2E6AEC7.js} +150 -6
  13. package/dist/chunk-T2E6AEC7.js.map +1 -0
  14. package/dist/{chunk-3JSVEOKG.js → chunk-V4JRDYW4.js} +61 -6
  15. package/dist/chunk-V4JRDYW4.js.map +1 -0
  16. package/dist/{chunk-TEHRROVY.js → chunk-YQRTBGXU.js} +47 -192
  17. package/dist/chunk-YQRTBGXU.js.map +1 -0
  18. package/dist/cli.cjs +34 -3
  19. package/dist/cli.cjs.map +1 -1
  20. package/dist/components.cjs +2059 -153
  21. package/dist/components.cjs.map +1 -1
  22. package/dist/components.d.cts +214 -7
  23. package/dist/components.d.ts +214 -7
  24. package/dist/components.js +1148 -7
  25. package/dist/components.js.map +1 -1
  26. package/dist/index.cjs +303 -3
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +56 -5
  29. package/dist/index.d.ts +56 -5
  30. package/dist/index.js +58 -3
  31. package/dist/index.js.map +1 -1
  32. package/dist/payments.cjs +225 -0
  33. package/dist/payments.cjs.map +1 -1
  34. package/dist/payments.d.cts +24 -2
  35. package/dist/payments.d.ts +24 -2
  36. package/dist/payments.js +4 -1
  37. package/dist/payments.js.map +1 -1
  38. package/dist/{react-CWAG4cW0.d.cts → react-C6NWC80d.d.cts} +2 -2
  39. package/dist/{react-0MyyTtE4.d.ts → react-DVdtpw5n.d.ts} +2 -2
  40. package/dist/react.cjs +870 -27
  41. package/dist/react.cjs.map +1 -1
  42. package/dist/react.d.cts +155 -12
  43. package/dist/react.d.ts +155 -12
  44. package/dist/react.js +72 -4
  45. package/dist/react.js.map +1 -1
  46. package/package.json +8 -2
  47. package/templates/center-site/README.md +5 -0
  48. package/templates/center-site/app/account/game-cards/page.tsx +17 -0
  49. package/templates/center-site/app/account/layout.tsx +16 -0
  50. package/templates/center-site/app/account/memberships/[id]/page.tsx +23 -0
  51. package/templates/center-site/app/account/memberships/page.tsx +33 -0
  52. package/templates/center-site/app/account/orders/page.tsx +17 -0
  53. package/templates/center-site/app/account/page.tsx +14 -0
  54. package/templates/center-site/app/account/payment-methods/page.tsx +23 -0
  55. package/templates/center-site/app/account/privacy/page.tsx +17 -0
  56. package/templates/center-site/app/account/profile/page.tsx +45 -0
  57. package/templates/center-site/app/account/reservations/[displayId]/change/page.tsx +46 -0
  58. package/templates/center-site/app/account/reservations/[displayId]/page.tsx +41 -0
  59. package/templates/center-site/app/account/reservations/page.tsx +35 -0
  60. package/templates/center-site/app/account/security/page.tsx +17 -0
  61. package/templates/center-site/app/events/[slug]/page.tsx +130 -0
  62. package/templates/center-site/app/events/page.tsx +57 -0
  63. package/templates/center-site/app/pay/[token]/page.tsx +53 -0
  64. package/templates/center-site/app/site-header.tsx +1 -0
  65. package/templates/center-site/lib/reservation.ts +14 -0
  66. package/templates/center-site/package.json +1 -1
  67. package/templates/center-site/tsconfig.json +7 -9
  68. package/dist/account-DfM2COaz.d.ts +0 -210
  69. package/dist/account-oCvYWmO9.d.cts +0 -210
  70. package/dist/catalog-DbhdwmnX.d.cts +0 -224
  71. package/dist/catalog-XkjgPI5C.d.ts +0 -224
  72. package/dist/chunk-3JSVEOKG.js.map +0 -1
  73. package/dist/chunk-TEHRROVY.js.map +0 -1
  74. package/dist/chunk-Y3YSDO3H.js.map +0 -1
  75. package/dist/data-BJkB-tvM.d.cts +0 -778
  76. package/dist/data-BJkB-tvM.d.ts +0 -778
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @bowlos/reservations
2
2
 
3
+ **Building a complete customer website? Start with the [agent build guide](./AGENTS.md).**
4
+
3
5
  Headless client + React hooks for the **BowlOS public API gateway** — white-label
4
6
  booking, customer accounts, and flash-sale reads for third-party-hosted center
5
7
  websites. Built for React/Next sites (including AI-agent-built ones) that book on
@@ -37,6 +39,10 @@ Prefer to wire it by hand, or add the SDK to an existing app? Read on.
37
39
 
38
40
  ## Install
39
41
 
42
+ **Building a complete site (or an agent doing it)?** Follow the exact copy-paste steps in
43
+ [AGENTS.md → Install and configure](./AGENTS.md#install-and-configure): package and peer installs,
44
+ every env var, doctor, init, local run, test → live, and troubleshooting.
45
+
40
46
  ```bash
41
47
  npm install @bowlos/reservations
42
48
  ```
@@ -163,8 +169,8 @@ the session with `useAccount` (`signIn` / `signUp` / `link` / `signOut`).
163
169
 
164
170
  **Self-serve cancel (v0.23.0):** preview → confirm → cancel for reservations,
165
171
  event orders, package orders, and game cards — e.g. `useGameCardCancelPreview`
166
- + `useCancelMyGameCard`. Returns **store credit** per the Center's policy (card
167
- refunds stay staff-only); game cards cancel only while fully unused. See the
172
+ + `useCancelMyGameCard`. Returns store credit per the Center's policy; game cards cancel only while fully unused.
173
+ Booking changes support credit or card refunds (see the 0.40.0 section). See the
168
174
  "Self-serve cancel" section of `HEADLESS.md`.
169
175
 
170
176
  Every read also has a framework-agnostic function in the core entry
@@ -581,3 +587,298 @@ public sale prices. `createFlashSaleBooking().breakdown.tierDiscountCents` repor
581
587
  savings already included in `baseSubtotalCents` and `amountDueCents`. Display it as
582
588
  an informational discount line; do not subtract it a second time. Existing sales
583
589
  with the toggle enabled begin applying this benefit when the Convex change deploys.
590
+
591
+ ## Customer toolkit route wrappers (v0.37.0)
592
+
593
+ | Core helper `(client, args)` | React hook | Gateway route |
594
+ | -------------------------------- | ------------------------------------------------ | -------------------------------- |
595
+ | `updateMyProfile` | `useUpdateMyProfile()` | `updateMyProfile` |
596
+ | `getMyCommunicationPrefs` | `useMyCommunicationPrefs(args, options?)` | `listMyMarketingPrefs` |
597
+ | `setMyCommunicationPref` | `useSetMyCommunicationPref()` | `setMyMarketingPref` |
598
+ | `setMyMobile` | `useSetMyMobile()` | `setMyMobile` |
599
+ | `submitSupportRequest` | `useSubmitSupportRequest()` | `submitMySupportRequest` |
600
+ | `deleteMyAccount` | `useDeleteMyAccount()` | `deleteMyAccount` |
601
+ | `exportMyData` | `useExportMyData()` | `exportMyData` |
602
+ | `getMyPackageOrders` | `useMyPackageOrders(args, options?)` | `listMyPackageOrders` |
603
+ | `getMyPackageOrder` | `useMyPackageOrder(args, options?)` | `getMyPackageOrder` |
604
+ | `getMyMembershipMembers` | `useMyMembershipMembers(args, options?)` | `listMyMembershipMembers` |
605
+ | `addMyMembershipMember` | `useAddMyMembershipMember()` | `addMyMembershipMember` |
606
+ | `getMyLoyaltyHistory` | `useMyLoyaltyHistory(args, options?)` | `listMyLoyaltyHistory` |
607
+ | `getReceipt` | `useReceipt(args, options?)` | `getReservationByDisplayId` |
608
+ | `getProduct` | `useProduct(args, options?)` | `getPublicProduct` |
609
+ | `getMembership` | `useMembership(args, options?)` | `getPublicMembership` |
610
+ | `getGameCard` | `useGameCard(args, options?)` | `getPublicGameCard` |
611
+ | `listProductSubtypes` | `useProductSubtypes(args, options?)` | `listSubtypesForProduct` |
612
+ | `listBrandMemberships` | `useBrandMemberships(args, options?)` | `listBrandMemberships` |
613
+ | `getPackagesLabel` | `usePackagesLabel(args, options?)` | `getBrandPackagesLabelPublic` |
614
+ | `previewSlotPrices` | `useSlotPrices(args, options?)` | `previewSlotPrices` |
615
+ | `listHours` | `useHours(args, options?)` | `listPublicHours` |
616
+ | `getOperatingHours` | `useOperatingHours(args, options?)` | `getOperatingHours` |
617
+ | `getCenterOperatingHoursForType` | `useCenterOperatingHoursForType(args, options?)` | `getCenterOperatingHoursForType` |
618
+ | `listCenters` | `useCenters(args, options?)` | `listPublicCenters` |
619
+ | `cancelMyMembership` | `useCancelMyMembership()` | `cancelMyMembership` |
620
+ | `applyMyModification` | `useApplyMyModification()` | `applyMyModification` |
621
+ | `cancelCheckoutPayment` | `—` | `cancelCheckoutPaymentIntent` |
622
+
623
+ Core helpers and their concrete `XArgs` / `XResult` types are exported from
624
+ `@bowlos/reservations` (`X` is the helper name with its first letter capitalized,
625
+ for example `GetMyPackageOrdersResult`). Hooks are exported from
626
+ `@bowlos/reservations/react`. The wire types mirror the existing validators and
627
+ success payloads; IDs are strings. Mount `BowlosProvider` with your client.
628
+
629
+ Query hooks accept `(args, options?)` and return `{ data, loading, error, refetch }`.
630
+ Write hooks return `{ run(args), data, loading, error, reset }`.
631
+ `useExportMyData()` is lazy: call `run({ brandId })` when the customer requests a
632
+ download. It returns the existing **v1** export, including the profile, raw
633
+ reservation/credit/loyalty/membership/pass records and communication subscriptions;
634
+ it does not add the planned v2 export fields.
635
+
636
+ Profile, communication preferences, mobile, support, export, deletion, package
637
+ orders, membership roster, loyalty history, membership cancellation and
638
+ modification require a customer session. These account calls require `brandId`.
639
+ `updateMyProfile` requires `expectedVersion`; optional profile changes include
640
+ `fullName`, `mobile`, `marketingOptIn` and `preferredCenterId` (nullable mobile and
641
+ preferred center clear their values). Support accepts `message` and optional
642
+ `centerId`. Communication preferences use `channel: "email" | "sms"` and
643
+ `status: "subscribed" | "unsubscribed"`; SMS opt-in needs `acceptedTerms: true` and
644
+ a mobile number. Transactional delivery is unaffected.
645
+
646
+ `getMyPackageOrders` lists package bookings, while `getMyPackageOrder` requires
647
+ `orderId`. Membership roster calls take `membershipId`; adding a member also
648
+ takes their `email`. Loyalty history takes `brandId`. `getReceipt` takes
649
+ `displayId` and returns the reservation receipt with its frozen snapshot, payment
650
+ trail and credit entries. The receipt and catalog/hours/centers reads use the
651
+ existing public routes. Product/subtype reads take `productId`; membership/game
652
+ card reads take `templateId` and optional `shareToken`. Brand memberships, packages
653
+ label and centers take `brandId`. `listHours` takes `centerId`;
654
+ `getOperatingHours` takes `productId, dateISO`, and
655
+ `getCenterOperatingHoursForType` takes `centerId, attractionTypeKey, dateISO`.
656
+ `previewSlotPrices` takes `centerId, productId, dateISO, mode, duration, slots` and
657
+ optional `units, persons, games`, returning each slot's `headlinePriceCents`
658
+ (which can be null). `cancelCheckoutPayment` takes `{ refToken }` and returns
659
+ `{ cancelled }`.
660
+
661
+ `deleteMyAccount` and `useDeleteMyAccount` use the current v1
662
+ `{ brandId, confirmation: "DELETE" }` contract. Successful deletion then runs the
663
+ client's best-effort sign-out and clears local tokens; failed deletion preserves
664
+ the session and surfaces the existing gateway error. No new error-details channel
665
+ is introduced in this version.
666
+
667
+ `cancelMyMembership` requires `{ brandId, membershipId, expectedVersion,
668
+ idempotencyKey, reason? }`. Its result contains `id, version, status` and optional
669
+ `currentPeriodEndsAt`; show that end date and refresh membership reads after
670
+ success. `useCancelMyMembership()` supplies the idempotency key. Cancellation
671
+ schedules the existing end-of-period behavior; it does not request a refund.
672
+
673
+ All five `useCancelMy*` hooks and `useApplyMyModification` retain one key for
674
+ retries of the same inputs after network, timeout, rate-limit or server failures.
675
+ They rotate it after success or a terminal error, or when inputs change. `reset()`
676
+ explicitly begins a new action. Re-preview and refresh versions after a terminal
677
+ conflict before submitting again. Core functions still require caller-managed
678
+ `idempotencyKey`: retain it across uncertain retries. `applyMyModification` /
679
+ `useApplyMyModification` expose the existing apply contract (new date/time,
680
+ units/persons, optional games/add-ons/refund mode/credit and `expectedVersion`);
681
+ inspect `requiresPayment` and `pendingModificationId` in its result. For paid change
682
+ orchestration, use `useBookingChange` and the payment wrappers added in 0.40.0.
683
+
684
+ A non-JSON HTTP 404 now raises `ROUTE_NOT_FOUND`; a JSON route error with
685
+ `NOT_FOUND` still means the requested data was not found. Handle missing-route
686
+ errors separately in your own UI. `/ping` currently has no capabilities array,
687
+ so this release does not implement capability detection or probe routes to infer it.
688
+
689
+ ### v0.37.0 — Existing gateway coverage (2026-10-30, unpublished)
690
+
691
+ | Version | Changes | Migration |
692
+ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
693
+ | 0.37.0 | Typed account/catalog/hours wrappers and hooks, package orders, membership cancellation, stable retry keys, `ROUTE_NOT_FOUND`, gateway coverage guard; shipped AGENTS.md build guide + coverage gate; completed HEADLESS v0.36.0 saved-card/password guidance | Change `^0.36.0` → `^0.37.0` explicitly; pre-1.0 caret ranges do not cross minor versions. |
694
+
695
+ Build each screen in your site's design with these hooks; no component adoption
696
+ is required. See [headless adoption](./HEADLESS.md#v0370--customer-toolkit-route-coverage-2026-10-30-unpublished).
697
+
698
+ For 0.37.0, migrate `^0.36.0` -> `^0.37.0` by hand. Start with [AGENTS.md](./AGENTS.md);
699
+ its page checklist and API/template coverage are checked by release-gate step i.
700
+ The [saved-card and signed-in password guidance](./HEADLESS.md#saved-cards-and-signed-in-password-changes-v0360)
701
+ now includes the required password-recovery link; adopt it in your own security screen.
702
+
703
+ ## 0.38.0
704
+
705
+ Account deletion previews, `useAccountDeletion`, structured `BowlosApiError.details`
706
+ and `exportMyDataV2` short-lived downloads are available. `exportMyData` v1 is
707
+ now deprecated with its shape unchanged. Migration: ^0.37.0 -> ^0.38.0 by hand.
708
+ Adopt the consequences/token confirmation and retry contract in
709
+ [HEADLESS.md](./HEADLESS.md#account-deletion-and-export-v0380).
710
+
711
+ | New API | Purpose |
712
+ | --- | --- |
713
+ | `previewAccountDeletion`, `AccountDeletionPreview` | Typed consequences, phrase and preview token |
714
+ | `useAccountDeletion` (`/react`) | Confirmation, stale preview reload and pending Stripe retry |
715
+ | `exportMyDataV2`, `ExportMyDataV2Result` | Curated download URL and expiry |
716
+ | `BowlosApiError.details` | Optional primitive error metadata |
717
+
718
+ ## 0.39.0
719
+
720
+ 2026-10-30: Adds EventList and the events index template, Brand event pagination,
721
+ owned game-card detail/history, normalized wallet URLs, hold countdown/actions,
722
+ email verification, cancellation policy and typed pending cancellation.
723
+ See [HEADLESS.md](./HEADLESS.md#events-index-v0390) for exact contracts and adoption.
724
+ Migration: explicitly change `^0.38.0` → `^0.39.0`. Old wrapper arguments keep working;
725
+ use `includeWithoutLandingPage: false` for index links and follow every Brand cursor.
726
+
727
+ ## 0.40.0
728
+
729
+ Booking changes: `previewBookingChange`, `applyBookingChange`,
730
+ `getPendingBookingChange`, `createBookingChangePayment` and `useBookingChange`
731
+ cover preview, apply, payment and webhook polling. Cheaper changes can return credit
732
+ or a refund; a paid change that loses its slot is automatically refunded.
733
+ Membership billing: `openMembershipBillingPortal` / `useOpenMembershipBillingPortal`
734
+ return a hosted URL. Handle `BILLING_PORTAL_UNAVAILABLE` with a venue support path.
735
+ Token pay links: `getPayLink`, `createPayLinkPayment`, `usePayLink`,
736
+ `useCreatePayLinkPayment` work without customer sign-in.
737
+
738
+ Migration: explicitly change `^0.39.0` to `^0.40.0`. Existing APIs are unchanged.
739
+ Use the new headless APIs with your own UI; follow the
740
+ [booking change](./HEADLESS.md#booking-changes-v0400) and
741
+ [billing and pay links](./HEADLESS.md#billing-portal-and-pay-links-v0400) contracts.
742
+ Version 0.41.0 adds reservation detail/change and pay-link templates;
743
+ 0.40.0 sites can compose the same hooks in their own routes.
744
+
745
+
746
+ ## Customer account toolkit
747
+
748
+ Build customer pages with hooks from `@bowlos/reservations/react` and core helpers
749
+ from `@bowlos/reservations`. Reference components are optional; keep the center's
750
+ own design. Mount one `BowlosProvider` for the shared customer session. The
751
+ [complete page checklist](./AGENTS.md#required-pages-checklist) names the shipped
752
+ starter file to copy or adapt for every page, including recovery and inquiry.
753
+
754
+ ### Account capability map
755
+
756
+ | Capability | Headless hooks / core APIs | Optional reference | Template under `templates/center-site/app/` |
757
+ | --- | --- | --- | --- |
758
+ | Sign-in, atomic registration, recovery | `useAccount`: `signIn`, `register`, `requestPasswordReset`, `resetPassword`; `useEmailVerification` | `AuthForm`, `AuthGate` | `account/page.tsx` (adapt for a standalone recovery route) |
759
+ | Reservations, event orders, package orders | `useMyReservations`, `useMyEventOrders`, `useMyPackageOrders`, `useMyReservationDetail`, `useMyEventOrder`, `useMyPackageOrder`, `useReceipt` | `AccountDashboard` | `account/orders/page.tsx`, `account/reservations/[displayId]/page.tsx` |
760
+ | Credit, loyalty and passes | `useMyCredits`, `useMyLoyalty`, `useMyLoyaltyHistory`, `useMyPasses` | `AccountDashboard`, `AddToWalletButtons` | `account/page.tsx` |
761
+ | Membership members, cancellation, billing | `useMyMemberships`, `useMyMembershipDetail`, `useMyMembershipMembers`, `useAddMyMembershipMember`, `useCancelMyMembership`, `useOpenMembershipBillingPortal` | `MembershipDetail` | `account/memberships/[id]/page.tsx` |
762
+ | Game cards, history and wallet | `useMyGameCards`, `useMyGameCard`, `useMyGameCardHistory`, `useWalletPassUrl` | `GameCardHistory`, `AddToWalletButtons` | `account/game-cards/page.tsx` |
763
+ | Saved cards | `useSavedCards`, `useCreateCardSetup`, `useRemoveCard`, `useSetDefaultCard` | `SavedCards` + `AddCardForm` (`/payments`) | `account/payment-methods/page.tsx` |
764
+ | Password change | `useChangePassword`, `useAccount` recovery methods | `ChangePasswordForm` | `account/security/page.tsx` |
765
+ | Profile and consent | `useUpdateMyProfile`, `useSetMyMobile`, `useMyCommunicationPrefs`, `useSetMyCommunicationPref`, `useSubmitSupportRequest` | `ProfileForm`, `CommunicationPrefs` | `account/profile/page.tsx` |
766
+ | Export and deletion | `exportMyDataV2`, `useAccountDeletion` | `PrivacyCenter` | `account/privacy/page.tsx` |
767
+ | Cancellation and booking changes | `useReservationCancelPreview`, `useCancelMyReservation`, event/package/game-card preview and cancel hooks; `useBookingChange` | `BookingChange` | `account/reservations/[displayId]/change/page.tsx` |
768
+ | Token pay links | `usePayLink`, `useCreatePayLinkPayment` | `BowlosPaymentForm` (`/payments`) | `pay/[token]/page.tsx` |
769
+
770
+ `AccountDashboard` keeps its original five default sections: reservations,
771
+ memberships, loyalty, credit and passes. Opt in through `sections` to eventOrders,
772
+ packageOrders, gameCards, profile, communications, paymentMethods, security and
773
+ privacy; payment methods require `centerId`. `useMyPackageOrders` is a shipped
774
+ hook, with `getMyPackageOrders` as its core twin; open orders with `useMyPackageOrder`.
775
+
776
+ Gate wallet buttons on `pass.walletEligible`, then request a fresh normalized
777
+ `{ url, platform }` through `useWalletPassUrl` / `getWalletPassUrl`. Pass
778
+ `eligible={pass.walletEligible}` to `AddToWalletButtons`; never build a pass URL.
779
+
780
+ Cancellation routes return policy-based store credit. Booking modifications
781
+ separately support credit or card refunds; render the preview and resulting
782
+ outcome rather than promising a card refund for every cancellation. Preview is
783
+ read-only; apply revalidates. Paid upgrades reserve inventory while payment is
784
+ pending, then apply after webhook confirmation. Do not treat Stripe confirmation
785
+ alone as a completed change.
786
+
787
+ For `useCancelMy*` and `useApplyMyModification`, one idempotency key belongs to
788
+ one user action. Hooks retain it across uncertain retries, rotate after success
789
+ or terminal errors and when inputs change; `reset()` starts a new action. Core
790
+ callers retain their own key across retries. Modification/payment and pay-link
791
+ PaymentIntents use server-derived keys: do not supply a client key to those calls.
792
+
793
+ Keep a reachable email-code recovery page, including for signed-in customers.
794
+ Handle `CURRENT_PASSWORD_INCORRECT` inline without signing out. Deletion needs a
795
+ fresh preview, exact confirmation and a working retry/support path. Disable
796
+ completion, correction, capitalization and spell checking on confirmation inputs.
797
+ Use `err.code`, Center-local dates, server totals and returned Stripe account/key/mode.
798
+ Never expose secret keys. Transactional sends remain independent of marketing consent.
799
+
800
+ ### Toolkit migration by release
801
+
802
+ Pre-1.0 caret ranges stay within one minor: each row requires an explicit dependency
803
+ range edit. Existing calls and dashboard defaults remain supported. Adopt the
804
+ hooks selectively; no reference component migration is required.
805
+
806
+ | Release | Dependency change | Headless adoption |
807
+ | --- | --- | --- |
808
+ | 0.37.0 | `^0.36.0` → `^0.37.0` | Add typed account/catalog reads, package-order lists/details, membership cancellation and per-action retry keys. Handle `ROUTE_NOT_FOUND` separately from missing records. |
809
+ | 0.38.0 | `^0.37.0` → `^0.38.0` | Add deletion preview/token/retry handling and short-lived `exportMyDataV2` downloads. Legacy export v1 retains its shape. |
810
+ | 0.39.0 | `^0.38.0` → `^0.39.0` | Add paginated events/history, fresh wallet URLs, hold actions and email verification. Follow cursors until `isDone`, even after an empty page. |
811
+ | 0.40.0 | `^0.39.0` → `^0.40.0` | Compose booking preview/apply/payment/polling, allowlisted billing returns and token pay links. Preserve loaded versions and server-derived payment keys. |
812
+ | 0.41.0 | `^0.40.0` → `^0.41.0` | Keep existing hook markup or copy optional account components and detail/payment templates. Explicitly select new dashboard sections and provide `centerId` for saved cards. |
813
+
814
+ ## 0.41.0
815
+
816
+ 2026-10-30: Customer account toolkit documentation, final agent checklist and
817
+ optional account reference components/templates from PR-10. Public hook contracts
818
+ and dashboard defaults are unchanged. This release introduces no backend routes.
819
+
820
+ Migration: explicitly update `^0.40.0` to `^0.41.0`; follow the capability map above
821
+ and the [reference component contracts](./HEADLESS.md#reference-account-components-v0410).
822
+ Keep custom headless UI or adopt individual references. Test recovery, cancellation,
823
+ wallet eligibility, deletion retry and payment completion in the site's own design.
824
+
825
+ ## 0.42.0
826
+
827
+ Waitlist booking is available when the Center enables its online waitlist toggle.
828
+ Upgrade explicitly from 0.41.x to 0.42.0; existing booking signatures and reservation
829
+ statuses are unchanged. A waitlist entry becomes a reservation only on promotion.
830
+
831
+ For headless adoption, catch the `createBooking` / `createAnonymousBooking` error:
832
+ `BowlosApiError.slotFullDetails` exposes `{ reason: "slot_full", waitlistAvailable,
833
+ requested, available }`. The error code remains `VALIDATION_FAILED`; offer a
834
+ waitlist only when `waitlistAvailable` is true. Subtype waitlisting is unsupported.
835
+ Login is required. The Center toggle also gates join and card setup server-side.
836
+
837
+ Use `useWaitlistJoin` from `/react`: call `join(args)` (idle → quoting → card),
838
+ display `entry.amountCents` from the Center pricing engine, and obtain explicit
839
+ consent: “I authorize a charge of $X to this card if a spot opens.” No charge
840
+ occurs at join. Never hardcode the amount. Then call `createCardSetup()` and use
841
+ `setupIntent` (publishableKey, stripeAccount, clientSecret and
842
+ customerSessionClientSecret) with Stripe Elements in SetupIntent mode. Confirm
843
+ with `stripe.confirmSetup({ elements, redirect: "if_required" })`, complete any
844
+ requires_action authentication, and pass the succeeded intent to
845
+ `cardConfirmed({ id, status })` (confirming → joined or error). Unfinished intents
846
+ stay in card state. `error` exposes failures; `reset()` starts over. Card setup
847
+ must follow consent, including for a zero-dollar quote. The server freezes this
848
+ quote for the eventual promotion charge. Abandoned pending_card entries expire.
849
+
850
+ Framework-free routes are `joinWaitlist`, `createWaitlistSetupIntent`,
851
+ `confirmWaitlistCard`, `listMyWaitlist`, and `leaveWaitlist`, all authenticated.
852
+ Entry routes take `entryId` plus optional brandId/centerId; confirm also takes
853
+ setupIntentId. List takes brandId and optional centerId and returns active entries
854
+ plus recent history. Show pending_card/waiting under “Pending — waitlist” and call
855
+ leaveWaitlist for Leave; refresh the list and show “not charged”. Leaving is
856
+ rejected while promotion is charging or its outcome is unknown. Cards remain in
857
+ the wallet after leaving. Promoted entries link through promotedReservationDisplayId.
858
+
859
+ `WaitlistJoin` from `/components` is an optional reference using the same headless
860
+ hook and AddCardForm SetupIntent UI, including amount consent. Pass booking `args`
861
+ and optional `onJoined`. AccountDashboard supports a `"waitlist"` section;
862
+ add it to your explicit section list to show pending entries. Existing headless sites retain
863
+ their markup and adopt these routes directly; no component adoption is required.
864
+
865
+ ## 0.43.0
866
+
867
+ Waitlist text consent and account entry details are additive. Upgrade the SDK to
868
+ 0.43.0 after the N6 backend is deployed; old clients omit consent and receive no
869
+ waitlist texts. Existing booking and payment behavior is unchanged.
870
+
871
+ | Capability | Headless API | Adoption in your site's own UI |
872
+ | ------------------------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
873
+ | 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. |
874
+ | Attraction and quantity | `listMyWaitlist` → `MyWaitlistEntry` | Render optional `units`, `unitLabelSingular`, `unitLabelPlural`, and `attractionName`; use neutral “unit/units” when labels are absent. |
875
+ | Promoted time | `MyWaitlistEntry.promotedStartMinuteOfDay` / `promotedEndMinuteOfDay` | Show the actual promoted window when present, otherwise the original start/end. Display in the Center's timezone. |
876
+ | Text status | `MyWaitlistEntry.textUpdates` | Show whether texts are enabled; missing means no texts. This is not a marketing preference. |
877
+
878
+ For headless adoption, show a per-waitlist checkbox, initially checked, with the
879
+ account holder's destination phone number; pass its current value explicitly.
880
+ Keep the separate authorization for the quoted card charge. The reference
881
+ `WaitlistJoin` accepts `textUpdates` through its `args`; it does not add a text
882
+ checkbox for you. All entry fields above remain optional for older responses.
883
+ Staff-only promotion, unit availability, closing, start-time, and guest-confirmation
884
+ error codes are not part of the SDK's exported constants.