@bowlos/reservations 0.41.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 (48) hide show
  1. package/AGENTS.md +9 -3
  2. package/HEADLESS.md +61 -0
  3. package/README.md +61 -0
  4. package/dist/{account-DEX2Lr78.d.cts → account-B4sZBmPI.d.cts} +866 -14
  5. package/dist/{account-DEX2Lr78.d.ts → account-B4sZBmPI.d.ts} +866 -14
  6. package/dist/booking-change-Dd4PVgd3.d.cts +487 -0
  7. package/dist/booking-change-DzYs9133.d.ts +487 -0
  8. package/dist/{chunk-VJIS56OO.js → chunk-4JMGS4YB.js} +96 -5
  9. package/dist/chunk-4JMGS4YB.js.map +1 -0
  10. package/dist/{chunk-FMFHNBDH.js → chunk-T2E6AEC7.js} +98 -5
  11. package/dist/chunk-T2E6AEC7.js.map +1 -0
  12. package/dist/{chunk-44WKP6MW.js → chunk-V4JRDYW4.js} +31 -3
  13. package/dist/chunk-V4JRDYW4.js.map +1 -0
  14. package/dist/{chunk-BWJHRJN6.js → chunk-YQRTBGXU.js} +3 -3
  15. package/dist/{chunk-BWJHRJN6.js.map → chunk-YQRTBGXU.js.map} +1 -1
  16. package/dist/cli.cjs +5 -0
  17. package/dist/cli.cjs.map +1 -1
  18. package/dist/components.cjs +313 -0
  19. package/dist/components.cjs.map +1 -1
  20. package/dist/components.d.cts +12 -6
  21. package/dist/components.d.ts +12 -6
  22. package/dist/components.js +109 -6
  23. package/dist/components.js.map +1 -1
  24. package/dist/index.cjs +33 -0
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +4 -4
  27. package/dist/index.d.ts +4 -4
  28. package/dist/index.js +2 -2
  29. package/dist/payments.cjs +34 -12
  30. package/dist/payments.cjs.map +1 -1
  31. package/dist/payments.d.cts +10 -2
  32. package/dist/payments.d.ts +10 -2
  33. package/dist/payments.js +5 -78
  34. package/dist/payments.js.map +1 -1
  35. package/dist/{react-CrRciA7I.d.ts → react-C6NWC80d.d.cts} +2 -2
  36. package/dist/{react-QJrsaOnN.d.cts → react-DVdtpw5n.d.ts} +2 -2
  37. package/dist/react.cjs +112 -0
  38. package/dist/react.cjs.map +1 -1
  39. package/dist/react.d.cts +22 -6
  40. package/dist/react.d.ts +22 -6
  41. package/dist/react.js +5 -5
  42. package/package.json +1 -1
  43. package/templates/center-site/package.json +1 -1
  44. package/dist/booking-change-4DGu-B08.d.ts +0 -1282
  45. package/dist/booking-change-aK6P37FZ.d.cts +0 -1282
  46. package/dist/chunk-44WKP6MW.js.map +0 -1
  47. package/dist/chunk-FMFHNBDH.js.map +0 -1
  48. package/dist/chunk-VJIS56OO.js.map +0 -1
package/AGENTS.md CHANGED
@@ -1,6 +1,6 @@
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 0.43.0. Use the installed package exports, not assumptions
4
4
  about future releases. Read [HEADLESS.md](./HEADLESS.md) for contracts and patterns.
5
5
  All APIs below are available. Build every listed page in the center’s own design.
6
6
 
@@ -31,6 +31,7 @@ to adapt; create and link the required route in the consuming site.
31
31
  | 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
32
  | 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
33
  | 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). |
34
+ | 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
35
 
35
36
  ## Install and configure
36
37
 
@@ -43,7 +44,7 @@ the real ones from the BowlOS admin.
43
44
 
44
45
  ```bash
45
46
  cd <site-dir>
46
- npm i @bowlos/reservations@^0.41.0
47
+ npm i @bowlos/reservations@^0.43.0
47
48
  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
49
  ```
49
50
 
@@ -102,7 +103,7 @@ npm install
102
103
  ```
103
104
 
104
105
  `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
106
+ `@bowlos/reservations@^0.43.0` and the peers above. `--force` is required because
106
107
  step 1 already created files in the folder, and it overwrites files that share a
107
108
  name with template files (your `.env.local` stays). On an existing app, skip `init`
108
109
  and copy pages from `node_modules/@bowlos/reservations/templates/center-site/`
@@ -271,6 +272,11 @@ Do not treat internal/advanced as a recommended site integration path.
271
272
  | `/components` | `BookingChange`, `BookingChangeProps` | detail |
272
273
  | `/payments` | `AddCardForm`, `AddCardFormProps` | saved-cards |
273
274
 
275
+
276
+ | `.` | `SlotFullDetails`, `JoinWaitlistArgs`, `WaitlistEntryArgs`, `JoinWaitlistResult`, `WaitlistSetupIntent`, `MyWaitlistEntry`, `joinWaitlist`, `createWaitlistSetupIntent`, `confirmWaitlistCard`, `listMyWaitlist`, `leaveWaitlist` | waitlist |
277
+ | `/react` | `WaitlistJoinStatus`, `useWaitlistJoin` | waitlist |
278
+ | `/components` | `WaitlistJoin`, `WaitlistJoinProps` | waitlist |
279
+
274
280
  ## Template pages
275
281
 
276
282
  Generated from examples/center-site; edit the source when maintaining the SDK.
package/HEADLESS.md CHANGED
@@ -2073,3 +2073,64 @@ Migration: explicitly update `^0.40.0` to `^0.41.0`; follow the capability map a
2073
2073
  and the [reference component contracts](#reference-account-components-v0410).
2074
2074
  Keep custom headless UI or adopt individual references. Test recovery, cancellation,
2075
2075
  wallet eligibility, deletion retry and payment completion in the site's own design.
2076
+
2077
+ ## 0.42.0
2078
+
2079
+ Waitlist booking is available when the Center enables its online waitlist toggle.
2080
+ Upgrade explicitly from 0.41.x to 0.42.0; existing booking signatures and reservation
2081
+ statuses are unchanged. A waitlist entry becomes a reservation only on promotion.
2082
+
2083
+ For headless adoption, catch the `createBooking` / `createAnonymousBooking` error:
2084
+ `BowlosApiError.slotFullDetails` exposes `{ reason: "slot_full", waitlistAvailable,
2085
+ requested, available }`. The error code remains `VALIDATION_FAILED`; offer a
2086
+ waitlist only when `waitlistAvailable` is true. Subtype waitlisting is unsupported.
2087
+ Login is required. The Center toggle also gates join and card setup server-side.
2088
+
2089
+ Use `useWaitlistJoin` from `/react`: call `join(args)` (idle → quoting → card),
2090
+ display `entry.amountCents` from the Center pricing engine, and obtain explicit
2091
+ consent: “I authorize a charge of $X to this card if a spot opens.” No charge
2092
+ occurs at join. Never hardcode the amount. Then call `createCardSetup()` and use
2093
+ `setupIntent` (publishableKey, stripeAccount, clientSecret and
2094
+ customerSessionClientSecret) with Stripe Elements in SetupIntent mode. Confirm
2095
+ with `stripe.confirmSetup({ elements, redirect: "if_required" })`, complete any
2096
+ requires_action authentication, and pass the succeeded intent to
2097
+ `cardConfirmed({ id, status })` (confirming → joined or error). Unfinished intents
2098
+ stay in card state. `error` exposes failures; `reset()` starts over. Card setup
2099
+ must follow consent, including for a zero-dollar quote. The server freezes this
2100
+ quote for the eventual promotion charge. Abandoned pending_card entries expire.
2101
+
2102
+ Framework-free routes are `joinWaitlist`, `createWaitlistSetupIntent`,
2103
+ `confirmWaitlistCard`, `listMyWaitlist`, and `leaveWaitlist`, all authenticated.
2104
+ Entry routes take `entryId` plus optional brandId/centerId; confirm also takes
2105
+ setupIntentId. List takes brandId and optional centerId and returns active entries
2106
+ plus recent history. Show pending_card/waiting under “Pending — waitlist” and call
2107
+ leaveWaitlist for Leave; refresh the list and show “not charged”. Leaving is
2108
+ rejected while promotion is charging or its outcome is unknown. Cards remain in
2109
+ the wallet after leaving. Promoted entries link through promotedReservationDisplayId.
2110
+
2111
+ `WaitlistJoin` from `/components` is an optional reference using the same headless
2112
+ hook and AddCardForm SetupIntent UI, including amount consent. Pass booking `args`
2113
+ and optional `onJoined`. AccountDashboard supports a `"waitlist"` section;
2114
+ add it to your explicit section list to show pending entries. Existing headless sites retain
2115
+ their markup and adopt these routes directly; no component adoption is required.
2116
+
2117
+ ## 0.43.0
2118
+
2119
+ Waitlist text consent and account entry details are additive. Upgrade the SDK to
2120
+ 0.43.0 after the N6 backend is deployed; old clients omit consent and receive no
2121
+ waitlist texts. Existing booking and payment behavior is unchanged.
2122
+
2123
+ | Capability | Headless API | Adoption in your site's own UI |
2124
+ | ------------------------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2125
+ | 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. |
2126
+ | Attraction and quantity | `listMyWaitlist` → `MyWaitlistEntry` | Render optional `units`, `unitLabelSingular`, `unitLabelPlural`, and `attractionName`; use neutral “unit/units” when labels are absent. |
2127
+ | Promoted time | `MyWaitlistEntry.promotedStartMinuteOfDay` / `promotedEndMinuteOfDay` | Show the actual promoted window when present, otherwise the original start/end. Display in the Center's timezone. |
2128
+ | Text status | `MyWaitlistEntry.textUpdates` | Show whether texts are enabled; missing means no texts. This is not a marketing preference. |
2129
+
2130
+ For headless adoption, show a per-waitlist checkbox, initially checked, with the
2131
+ account holder's destination phone number; pass its current value explicitly.
2132
+ Keep the separate authorization for the quoted card charge. The reference
2133
+ `WaitlistJoin` accepts `textUpdates` through its `args`; it does not add a text
2134
+ checkbox for you. All entry fields above remain optional for older responses.
2135
+ Staff-only promotion, unit availability, closing, start-time, and guest-confirmation
2136
+ error codes are not part of the SDK's exported constants.
package/README.md CHANGED
@@ -821,3 +821,64 @@ Migration: explicitly update `^0.40.0` to `^0.41.0`; follow the capability map a
821
821
  and the [reference component contracts](./HEADLESS.md#reference-account-components-v0410).
822
822
  Keep custom headless UI or adopt individual references. Test recovery, cancellation,
823
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.