@bowlos/reservations 0.43.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.
- package/AGENTS.md +14 -5
- package/CHANGELOG.md +22 -0
- package/HEADLESS.md +126 -41
- package/README.md +16 -0
- package/dist/{account-B4sZBmPI.d.cts → account-b8chVpED.d.cts} +27 -1
- package/dist/{account-B4sZBmPI.d.ts → account-b8chVpED.d.ts} +27 -1
- package/dist/{booking-change-DzYs9133.d.ts → booking-change-B-ADuVEz.d.cts} +77 -2
- package/dist/{booking-change-Dd4PVgd3.d.cts → booking-change-BrJ-XESC.d.ts} +77 -2
- package/dist/chunk-43WZ6TLQ.js +12 -0
- package/dist/chunk-43WZ6TLQ.js.map +1 -0
- package/dist/{chunk-4JMGS4YB.js → chunk-CTJODEHR.js} +27 -6
- package/dist/chunk-CTJODEHR.js.map +1 -0
- package/dist/{chunk-YAXBZJMI.js → chunk-EPYGIJRJ.js} +20 -3
- package/dist/chunk-EPYGIJRJ.js.map +1 -0
- package/dist/{chunk-YQRTBGXU.js → chunk-EXEKCMQ2.js} +57 -22
- package/dist/chunk-EXEKCMQ2.js.map +1 -0
- package/dist/{chunk-V4JRDYW4.js → chunk-IDRTMFJJ.js} +8 -3
- package/dist/chunk-IDRTMFJJ.js.map +1 -0
- package/dist/{chunk-T2E6AEC7.js → chunk-LFFANITL.js} +4 -11
- package/dist/chunk-LFFANITL.js.map +1 -0
- package/dist/components.cjs +357 -131
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +11 -5
- package/dist/components.d.ts +11 -5
- package/dist/components.js +200 -65
- package/dist/components.js.map +1 -1
- package/dist/index.cjs +34 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/payments.cjs.map +1 -1
- package/dist/payments.d.cts +1 -1
- package/dist/payments.d.ts +1 -1
- package/dist/payments.js +5 -4
- package/dist/payments.js.map +1 -1
- package/dist/{react-C6NWC80d.d.cts → react-cqGEohr0.d.cts} +4 -2
- package/dist/{react-DVdtpw5n.d.ts → react-s4J-e10i.d.ts} +4 -2
- package/dist/react.cjs +90 -19
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +11 -5
- package/dist/react.d.ts +11 -5
- package/dist/react.js +5 -5
- package/package.json +2 -1
- package/templates/center-site/README.md +1 -0
- package/templates/center-site/app/book/event-reservation-form.tsx +276 -0
- package/templates/center-site/app/book/page.tsx +107 -49
- package/templates/center-site/app/catalog/page.tsx +3 -1
- package/templates/center-site/app/events/[slug]/page.tsx +7 -10
- package/templates/center-site/package.json +1 -1
- package/dist/chunk-4JMGS4YB.js.map +0 -1
- package/dist/chunk-T2E6AEC7.js.map +0 -1
- package/dist/chunk-V4JRDYW4.js.map +0 -1
- package/dist/chunk-YAXBZJMI.js.map +0 -1
- package/dist/chunk-YQRTBGXU.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.
|
|
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
|
-
|
|
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. |
|
|
@@ -44,7 +48,7 @@ the real ones from the BowlOS admin.
|
|
|
44
48
|
|
|
45
49
|
```bash
|
|
46
50
|
cd <site-dir>
|
|
47
|
-
npm i @bowlos/reservations@^0.
|
|
51
|
+
npm i @bowlos/reservations@^1.0.0
|
|
48
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
|
|
49
53
|
```
|
|
50
54
|
|
|
@@ -103,7 +107,7 @@ npm install
|
|
|
103
107
|
```
|
|
104
108
|
|
|
105
109
|
`init` copies the full starter into `<site-dir>`. Its `package.json` pins
|
|
106
|
-
`@bowlos/reservations@^0.
|
|
110
|
+
`@bowlos/reservations@^1.0.0` and the peers above. `--force` is required because
|
|
107
111
|
step 1 already created files in the folder, and it overwrites files that share a
|
|
108
112
|
name with template files (your `.env.local` stays). On an existing app, skip `init`
|
|
109
113
|
and copy pages from `node_modules/@bowlos/reservations/templates/center-site/`
|
|
@@ -277,6 +281,11 @@ Do not treat internal/advanced as a recommended site integration path.
|
|
|
277
281
|
| `/react` | `WaitlistJoinStatus`, `useWaitlistJoin` | waitlist |
|
|
278
282
|
| `/components` | `WaitlistJoin`, `WaitlistJoinProps` | waitlist |
|
|
279
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
|
+
|
|
280
289
|
## Template pages
|
|
281
290
|
|
|
282
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"`,
|
|
755
|
-
offer's
|
|
756
|
-
|
|
757
|
-
|
|
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
|
|
|
@@ -2134,3 +2166,56 @@ Keep the separate authorization for the quoted card charge. The reference
|
|
|
2134
2166
|
checkbox for you. All entry fields above remain optional for older responses.
|
|
2135
2167
|
Staff-only promotion, unit availability, closing, start-time, and guest-confirmation
|
|
2136
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
|
|
@@ -882,3 +891,10 @@ Keep the separate authorization for the quoted card charge. The reference
|
|
|
882
891
|
checkbox for you. All entry fields above remain optional for older responses.
|
|
883
892
|
Staff-only promotion, unit availability, closing, start-time, and guest-confirmation
|
|
884
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.
|
|
@@ -301,6 +301,13 @@ declare function listAddons(client: BowlosClient, args: {
|
|
|
301
301
|
}): Promise<PublicAddon[]>;
|
|
302
302
|
/** Inputs for `availableStartTimes`. */
|
|
303
303
|
type StartTimesArgs = {
|
|
304
|
+
eventOfferSlug?: string;
|
|
305
|
+
centerId?: string;
|
|
306
|
+
brandId?: string;
|
|
307
|
+
subtypeId?: string;
|
|
308
|
+
units?: number;
|
|
309
|
+
persons?: number;
|
|
310
|
+
games?: number;
|
|
304
311
|
productId: string;
|
|
305
312
|
dateISO: string;
|
|
306
313
|
/** Booking length, to leave room before close. Default 60 on the server. */
|
|
@@ -775,6 +782,22 @@ declare function listMyWaitlist(client: BowlosClient, args: {
|
|
|
775
782
|
declare function leaveWaitlist(client: BowlosClient, args: WaitlistEntryArgs): Promise<{
|
|
776
783
|
status: "cancelled";
|
|
777
784
|
}>;
|
|
785
|
+
/** Advisory same-customer overlap check; times use the Center's local timezone. */
|
|
786
|
+
type DuplicateBookingArgs = AvailabilityArgs & {
|
|
787
|
+
centerId: string;
|
|
788
|
+
email?: string;
|
|
789
|
+
};
|
|
790
|
+
type DuplicateBookingResult = {
|
|
791
|
+
duplicate: boolean;
|
|
792
|
+
existingBooking: {
|
|
793
|
+
startMinuteOfDay: number;
|
|
794
|
+
endMinuteOfDay: number;
|
|
795
|
+
laneCount: number;
|
|
796
|
+
} | null;
|
|
797
|
+
};
|
|
798
|
+
declare function checkDuplicateBooking(client: BowlosClient, args: DuplicateBookingArgs, opts?: {
|
|
799
|
+
auth?: boolean;
|
|
800
|
+
}): Promise<DuplicateBookingResult>;
|
|
778
801
|
|
|
779
802
|
/** Wire contracts derived from convex/public_api.ts validators and success payloads.
|
|
780
803
|
* IDs cross the HTTP gateway as strings; envelopes are unwrapped by BowlosClient.
|
|
@@ -1402,6 +1425,9 @@ type GetPackagesLabelResult = {
|
|
|
1402
1425
|
label: string;
|
|
1403
1426
|
};
|
|
1404
1427
|
type PreviewSlotPricesArgs = {
|
|
1428
|
+
eventOfferSlug?: string;
|
|
1429
|
+
brandId?: string;
|
|
1430
|
+
subtypeId?: string;
|
|
1405
1431
|
units?: number | undefined;
|
|
1406
1432
|
persons?: number | undefined;
|
|
1407
1433
|
games?: number | undefined;
|
|
@@ -1834,4 +1860,4 @@ declare function changePassword(client: BowlosClient, args: ChangePasswordArgs):
|
|
|
1834
1860
|
ok: true;
|
|
1835
1861
|
}>;
|
|
1836
1862
|
|
|
1837
|
-
export { type SetMyMobileResult as $, type AddMyMembershipMemberArgs as A, BowlosClient as B, type CancelCheckoutPaymentArgs as C, type DeleteMyAccountArgs as D, type ExportMyDataArgs as E, type FetchLike as F, type GetCenterOperatingHoursForTypeArgs as G, type GetPackagesLabelArgs as H, type GetPackagesLabelResult as I, type GetProductArgs as J, type GetProductResult as K, type GetReceiptArgs as L, type GetReceiptResult as M, type ListBrandMembershipsArgs as N, type ListBrandMembershipsResult as O, type ListCentersArgs as P, type ListCentersResult as Q, type ListHoursArgs as R, type ListHoursResult as S, type ListProductSubtypesArgs as T, type ListProductSubtypesResult as U, type AccountDeletionPreview as V, type PreviewSlotPricesArgs as W, type PreviewSlotPricesResult as X, type SetMyCommunicationPrefArgs as Y, type SetMyCommunicationPrefResult as Z, type SetMyMobileArgs as _, type AddMyMembershipMemberResult as a, type
|
|
1863
|
+
export { type SetMyMobileResult as $, type AddMyMembershipMemberArgs as A, BowlosClient as B, type CancelCheckoutPaymentArgs as C, type DeleteMyAccountArgs as D, type ExportMyDataArgs as E, type FetchLike as F, type GetCenterOperatingHoursForTypeArgs as G, type GetPackagesLabelArgs as H, type GetPackagesLabelResult as I, type GetProductArgs as J, type GetProductResult as K, type GetReceiptArgs as L, type GetReceiptResult as M, type ListBrandMembershipsArgs as N, type ListBrandMembershipsResult as O, type ListCentersArgs as P, type ListCentersResult as Q, type ListHoursArgs as R, type ListHoursResult as S, type ListProductSubtypesArgs as T, type ListProductSubtypesResult as U, type AccountDeletionPreview as V, type PreviewSlotPricesArgs as W, type PreviewSlotPricesResult as X, type SetMyCommunicationPrefArgs as Y, type SetMyCommunicationPrefResult as Z, type SetMyMobileArgs as _, type AddMyMembershipMemberResult as a, type PackagePreviewResult as a$, type SubmitSupportRequestArgs as a0, type SubmitSupportRequestResult as a1, type UpdateMyProfileArgs as a2, type UpdateMyProfileResult as a3, type AuthState as a4, type AvailabilityArgs as a5, type AvailabilityResult as a6, type BookingAddonSelection as a7, type BookingCustomer as a8, type BookingHold as a9, type FlashSalesArgs as aA, type GameCardCancelArgs as aB, type GameCardCheckoutStatus as aC, type GameCardPreviewArgs as aD, type GameCardPreviewResult as aE, type GameCardPurchaseArgs as aF, type GameCardPurchaseIntent as aG, type GameCardStatusResult as aH, type JoinWaitlistArgs as aI, type JoinWaitlistResult as aJ, type LinkProfile as aK, type MembershipCheckoutStatus as aL, type MembershipDetailArgs as aM, type MembershipMember as aN, type MembershipPreviewArgs as aO, type MembershipPreviewResult as aP, type MembershipPurchaseArgs as aQ, type MembershipPurchaseIntent as aR, type MembershipStatusResult as aS, type MembershipSubscriptionArgs as aT, type MembershipSubscriptionIntent as aU, type MembershipSubscriptionPreviewResult as aV, type MyGameCard as aW, type MyWaitlistEntry as aX, type OrderCancelArgs as aY, type PackageCheckoutStatus as aZ, type PackagePreviewArgs as a_, type BookingPreviewArgs as aa, type BookingQuote as ab, type BowlosClientConfig as ac, type BrandScoped as ad, type CancelPreview as ae, type CancelResult as af, type CardSetupResult as ag, type ChangePasswordArgs as ah, type CheckoutStatus as ai, type CheckoutStatusResult as aj, type ConnectedPaymentInput as ak, type CreateBookingArgs as al, type CreateFlashSaleBookingArgs as am, type Customer as an, type DuplicateBookingArgs as ao, type DuplicateBookingResult as ap, type EventOrderDetailArgs as aq, type EventTicketCheckoutStatus as ar, type EventTicketPreviewArgs as as, type EventTicketPreviewResult as at, type EventTicketPurchaseArgs as au, type EventTicketPurchaseIntent as av, type EventTicketStatusResult as aw, type FlashBookingOptionsArgs as ax, type FlashSaleArgs as ay, type FlashSaleBookingResult as az, type ApplyMyModificationArgs as b, listMyWaitlist as b$, type PackagePurchaseArgs as b0, type PackagePurchaseIntent as b1, type PackageStatusResult as b2, type PaymentIntentInfo as b3, type PingResult as b4, type PricingMode as b5, type PublicAddon as b6, type ReservationCancelArgs as b7, type ReservationDetailArgs as b8, type SavedCard as b9, createGameCardOrder as bA, createMembershipOrder as bB, createMembershipSubscriptionOrder as bC, createPackageOrder as bD, createWaitlistSetupIntent as bE, generateIdempotencyKey as bF, getCheckoutStatus as bG, getEventTicketStatus as bH, getFlashSale as bI, getFlashSaleBookingOptions as bJ, getFlashSales as bK, getGameCardStatus as bL, getMembershipStatus as bM, getMyCredits as bN, getMyEventOrder as bO, getMyEventOrders as bP, getMyGameCards as bQ, getMyLoyalty as bR, getMyMembershipDetail as bS, getMyMemberships as bT, getMyPasses as bU, getMyReservationDetail as bV, getMyReservations as bW, getPackageStatus as bX, joinWaitlist as bY, leaveWaitlist as bZ, listAddons as b_, type SavedCardArgs as ba, type SavedCardScope as bb, type SavedCardsResult as bc, type SlotFullDetails as bd, type StartTimesArgs as be, type TokenStore as bf, type Tokens as bg, type WaitlistEntryArgs as bh, type WaitlistSetupIntent as bi, abandonCheckout as bj, availableUnitCount as bk, bookingPreview as bl, cancelMyEventOrder as bm, cancelMyGameCard as bn, cancelMyPackageOrder as bo, cancelMyReservation as bp, changePassword as bq, checkAvailability as br, checkDuplicateBooking as bs, confirmWaitlistCard as bt, createBooking as bu, createBowlosClient as bv, createCardSetup as bw, createCheckoutPaymentIntent as bx, createEventTicketOrder as by, createFlashSaleBooking as bz, type ApplyMyModificationResult as c, listSavedCards as c0, listStartTimes as c1, localStorageTokenStore as c2, previewEventOrderCancellation as c3, previewEventTicket as c4, previewGameCard as c5, previewGameCardCancellation as c6, previewMembership as c7, previewMembershipSubscription as c8, previewPackage as c9, previewPackageOrderCancellation as ca, previewReservationCancellation as cb, removeSavedCard as cc, setDefaultCard as cd, type CancelCheckoutPaymentResult as d, type CancelMyMembershipArgs as e, type CancelMyMembershipResult as f, type DeleteMyAccountResult as g, type ExportMyDataResult as h, type ExportMyDataV2Result as i, type GetCenterOperatingHoursForTypeResult as j, type GetGameCardArgs as k, type GetGameCardResult as l, type GetMembershipArgs as m, type GetMembershipResult as n, type GetMyCommunicationPrefsArgs as o, type GetMyCommunicationPrefsResult as p, type GetMyLoyaltyHistoryArgs as q, type GetMyLoyaltyHistoryResult as r, type GetMyMembershipMembersArgs as s, type GetMyMembershipMembersResult as t, type GetMyPackageOrderArgs as u, type GetMyPackageOrderResult as v, type GetMyPackageOrdersArgs as w, type GetMyPackageOrdersResult as x, type GetOperatingHoursArgs as y, type GetOperatingHoursResult as z };
|
|
@@ -301,6 +301,13 @@ declare function listAddons(client: BowlosClient, args: {
|
|
|
301
301
|
}): Promise<PublicAddon[]>;
|
|
302
302
|
/** Inputs for `availableStartTimes`. */
|
|
303
303
|
type StartTimesArgs = {
|
|
304
|
+
eventOfferSlug?: string;
|
|
305
|
+
centerId?: string;
|
|
306
|
+
brandId?: string;
|
|
307
|
+
subtypeId?: string;
|
|
308
|
+
units?: number;
|
|
309
|
+
persons?: number;
|
|
310
|
+
games?: number;
|
|
304
311
|
productId: string;
|
|
305
312
|
dateISO: string;
|
|
306
313
|
/** Booking length, to leave room before close. Default 60 on the server. */
|
|
@@ -775,6 +782,22 @@ declare function listMyWaitlist(client: BowlosClient, args: {
|
|
|
775
782
|
declare function leaveWaitlist(client: BowlosClient, args: WaitlistEntryArgs): Promise<{
|
|
776
783
|
status: "cancelled";
|
|
777
784
|
}>;
|
|
785
|
+
/** Advisory same-customer overlap check; times use the Center's local timezone. */
|
|
786
|
+
type DuplicateBookingArgs = AvailabilityArgs & {
|
|
787
|
+
centerId: string;
|
|
788
|
+
email?: string;
|
|
789
|
+
};
|
|
790
|
+
type DuplicateBookingResult = {
|
|
791
|
+
duplicate: boolean;
|
|
792
|
+
existingBooking: {
|
|
793
|
+
startMinuteOfDay: number;
|
|
794
|
+
endMinuteOfDay: number;
|
|
795
|
+
laneCount: number;
|
|
796
|
+
} | null;
|
|
797
|
+
};
|
|
798
|
+
declare function checkDuplicateBooking(client: BowlosClient, args: DuplicateBookingArgs, opts?: {
|
|
799
|
+
auth?: boolean;
|
|
800
|
+
}): Promise<DuplicateBookingResult>;
|
|
778
801
|
|
|
779
802
|
/** Wire contracts derived from convex/public_api.ts validators and success payloads.
|
|
780
803
|
* IDs cross the HTTP gateway as strings; envelopes are unwrapped by BowlosClient.
|
|
@@ -1402,6 +1425,9 @@ type GetPackagesLabelResult = {
|
|
|
1402
1425
|
label: string;
|
|
1403
1426
|
};
|
|
1404
1427
|
type PreviewSlotPricesArgs = {
|
|
1428
|
+
eventOfferSlug?: string;
|
|
1429
|
+
brandId?: string;
|
|
1430
|
+
subtypeId?: string;
|
|
1405
1431
|
units?: number | undefined;
|
|
1406
1432
|
persons?: number | undefined;
|
|
1407
1433
|
games?: number | undefined;
|
|
@@ -1834,4 +1860,4 @@ declare function changePassword(client: BowlosClient, args: ChangePasswordArgs):
|
|
|
1834
1860
|
ok: true;
|
|
1835
1861
|
}>;
|
|
1836
1862
|
|
|
1837
|
-
export { type SetMyMobileResult as $, type AddMyMembershipMemberArgs as A, BowlosClient as B, type CancelCheckoutPaymentArgs as C, type DeleteMyAccountArgs as D, type ExportMyDataArgs as E, type FetchLike as F, type GetCenterOperatingHoursForTypeArgs as G, type GetPackagesLabelArgs as H, type GetPackagesLabelResult as I, type GetProductArgs as J, type GetProductResult as K, type GetReceiptArgs as L, type GetReceiptResult as M, type ListBrandMembershipsArgs as N, type ListBrandMembershipsResult as O, type ListCentersArgs as P, type ListCentersResult as Q, type ListHoursArgs as R, type ListHoursResult as S, type ListProductSubtypesArgs as T, type ListProductSubtypesResult as U, type AccountDeletionPreview as V, type PreviewSlotPricesArgs as W, type PreviewSlotPricesResult as X, type SetMyCommunicationPrefArgs as Y, type SetMyCommunicationPrefResult as Z, type SetMyMobileArgs as _, type AddMyMembershipMemberResult as a, type
|
|
1863
|
+
export { type SetMyMobileResult as $, type AddMyMembershipMemberArgs as A, BowlosClient as B, type CancelCheckoutPaymentArgs as C, type DeleteMyAccountArgs as D, type ExportMyDataArgs as E, type FetchLike as F, type GetCenterOperatingHoursForTypeArgs as G, type GetPackagesLabelArgs as H, type GetPackagesLabelResult as I, type GetProductArgs as J, type GetProductResult as K, type GetReceiptArgs as L, type GetReceiptResult as M, type ListBrandMembershipsArgs as N, type ListBrandMembershipsResult as O, type ListCentersArgs as P, type ListCentersResult as Q, type ListHoursArgs as R, type ListHoursResult as S, type ListProductSubtypesArgs as T, type ListProductSubtypesResult as U, type AccountDeletionPreview as V, type PreviewSlotPricesArgs as W, type PreviewSlotPricesResult as X, type SetMyCommunicationPrefArgs as Y, type SetMyCommunicationPrefResult as Z, type SetMyMobileArgs as _, type AddMyMembershipMemberResult as a, type PackagePreviewResult as a$, type SubmitSupportRequestArgs as a0, type SubmitSupportRequestResult as a1, type UpdateMyProfileArgs as a2, type UpdateMyProfileResult as a3, type AuthState as a4, type AvailabilityArgs as a5, type AvailabilityResult as a6, type BookingAddonSelection as a7, type BookingCustomer as a8, type BookingHold as a9, type FlashSalesArgs as aA, type GameCardCancelArgs as aB, type GameCardCheckoutStatus as aC, type GameCardPreviewArgs as aD, type GameCardPreviewResult as aE, type GameCardPurchaseArgs as aF, type GameCardPurchaseIntent as aG, type GameCardStatusResult as aH, type JoinWaitlistArgs as aI, type JoinWaitlistResult as aJ, type LinkProfile as aK, type MembershipCheckoutStatus as aL, type MembershipDetailArgs as aM, type MembershipMember as aN, type MembershipPreviewArgs as aO, type MembershipPreviewResult as aP, type MembershipPurchaseArgs as aQ, type MembershipPurchaseIntent as aR, type MembershipStatusResult as aS, type MembershipSubscriptionArgs as aT, type MembershipSubscriptionIntent as aU, type MembershipSubscriptionPreviewResult as aV, type MyGameCard as aW, type MyWaitlistEntry as aX, type OrderCancelArgs as aY, type PackageCheckoutStatus as aZ, type PackagePreviewArgs as a_, type BookingPreviewArgs as aa, type BookingQuote as ab, type BowlosClientConfig as ac, type BrandScoped as ad, type CancelPreview as ae, type CancelResult as af, type CardSetupResult as ag, type ChangePasswordArgs as ah, type CheckoutStatus as ai, type CheckoutStatusResult as aj, type ConnectedPaymentInput as ak, type CreateBookingArgs as al, type CreateFlashSaleBookingArgs as am, type Customer as an, type DuplicateBookingArgs as ao, type DuplicateBookingResult as ap, type EventOrderDetailArgs as aq, type EventTicketCheckoutStatus as ar, type EventTicketPreviewArgs as as, type EventTicketPreviewResult as at, type EventTicketPurchaseArgs as au, type EventTicketPurchaseIntent as av, type EventTicketStatusResult as aw, type FlashBookingOptionsArgs as ax, type FlashSaleArgs as ay, type FlashSaleBookingResult as az, type ApplyMyModificationArgs as b, listMyWaitlist as b$, type PackagePurchaseArgs as b0, type PackagePurchaseIntent as b1, type PackageStatusResult as b2, type PaymentIntentInfo as b3, type PingResult as b4, type PricingMode as b5, type PublicAddon as b6, type ReservationCancelArgs as b7, type ReservationDetailArgs as b8, type SavedCard as b9, createGameCardOrder as bA, createMembershipOrder as bB, createMembershipSubscriptionOrder as bC, createPackageOrder as bD, createWaitlistSetupIntent as bE, generateIdempotencyKey as bF, getCheckoutStatus as bG, getEventTicketStatus as bH, getFlashSale as bI, getFlashSaleBookingOptions as bJ, getFlashSales as bK, getGameCardStatus as bL, getMembershipStatus as bM, getMyCredits as bN, getMyEventOrder as bO, getMyEventOrders as bP, getMyGameCards as bQ, getMyLoyalty as bR, getMyMembershipDetail as bS, getMyMemberships as bT, getMyPasses as bU, getMyReservationDetail as bV, getMyReservations as bW, getPackageStatus as bX, joinWaitlist as bY, leaveWaitlist as bZ, listAddons as b_, type SavedCardArgs as ba, type SavedCardScope as bb, type SavedCardsResult as bc, type SlotFullDetails as bd, type StartTimesArgs as be, type TokenStore as bf, type Tokens as bg, type WaitlistEntryArgs as bh, type WaitlistSetupIntent as bi, abandonCheckout as bj, availableUnitCount as bk, bookingPreview as bl, cancelMyEventOrder as bm, cancelMyGameCard as bn, cancelMyPackageOrder as bo, cancelMyReservation as bp, changePassword as bq, checkAvailability as br, checkDuplicateBooking as bs, confirmWaitlistCard as bt, createBooking as bu, createBowlosClient as bv, createCardSetup as bw, createCheckoutPaymentIntent as bx, createEventTicketOrder as by, createFlashSaleBooking as bz, type ApplyMyModificationResult as c, listSavedCards as c0, listStartTimes as c1, localStorageTokenStore as c2, previewEventOrderCancellation as c3, previewEventTicket as c4, previewGameCard as c5, previewGameCardCancellation as c6, previewMembership as c7, previewMembershipSubscription as c8, previewPackage as c9, previewPackageOrderCancellation as ca, previewReservationCancellation as cb, removeSavedCard as cc, setDefaultCard as cd, type CancelCheckoutPaymentResult as d, type CancelMyMembershipArgs as e, type CancelMyMembershipResult as f, type DeleteMyAccountResult as g, type ExportMyDataResult as h, type ExportMyDataV2Result as i, type GetCenterOperatingHoursForTypeResult as j, type GetGameCardArgs as k, type GetGameCardResult as l, type GetMembershipArgs as m, type GetMembershipResult as n, type GetMyCommunicationPrefsArgs as o, type GetMyCommunicationPrefsResult as p, type GetMyLoyaltyHistoryArgs as q, type GetMyLoyaltyHistoryResult as r, type GetMyMembershipMembersArgs as s, type GetMyMembershipMembersResult as t, type GetMyPackageOrderArgs as u, type GetMyPackageOrderResult as v, type GetMyPackageOrdersArgs as w, type GetMyPackageOrdersResult as x, type GetOperatingHoursArgs as y, type GetOperatingHoursResult as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bd as SlotFullDetails, b5 as PricingMode, B as BowlosClient, b as ApplyMyModificationArgs, c as ApplyMyModificationResult } from './account-b8chVpED.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Error model for the BowlOS Reservations SDK.
|
|
@@ -64,6 +64,59 @@ declare class BowlosApiError extends Error {
|
|
|
64
64
|
get isConfigError(): boolean;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
type EventOfferSession = {
|
|
68
|
+
dateISO: string;
|
|
69
|
+
timezone: string;
|
|
70
|
+
offerDescription: string | null;
|
|
71
|
+
planName: string;
|
|
72
|
+
planDescription: string | null;
|
|
73
|
+
earliestStartMinute: number;
|
|
74
|
+
latestEndMinute: number | null;
|
|
75
|
+
allowedStartTimes: number[] | null;
|
|
76
|
+
startIncrementMinutes: number;
|
|
77
|
+
minDurationMinutes: number;
|
|
78
|
+
maxDurationMinutes: number;
|
|
79
|
+
fixedDurationMinutes: number | null;
|
|
80
|
+
durationIncrementMinutes: number;
|
|
81
|
+
pricingMode: PricingMode | null;
|
|
82
|
+
/** Configured rate metadata. Fetch a booking preview for the order total. */
|
|
83
|
+
basePrice: {
|
|
84
|
+
cents: number;
|
|
85
|
+
basis: "fixed_block" | "hour" | "game" | "mode_dependent";
|
|
86
|
+
} | null;
|
|
87
|
+
shoeMode: "included" | "addon" | "per_offer";
|
|
88
|
+
/** Configured shoe add-on. Older session payloads may omit this field. */
|
|
89
|
+
defaultShoeAddonId?: string | null;
|
|
90
|
+
planShoesIncluded: boolean;
|
|
91
|
+
shoesIncluded: boolean;
|
|
92
|
+
maxPartySizePerUnit: number | null;
|
|
93
|
+
};
|
|
94
|
+
type EventOfferOptionsArgs = {
|
|
95
|
+
centerId: string;
|
|
96
|
+
brandId?: string;
|
|
97
|
+
productId: string;
|
|
98
|
+
dateISO: string;
|
|
99
|
+
eventOfferSlug: string;
|
|
100
|
+
mode?: PricingMode;
|
|
101
|
+
units?: number;
|
|
102
|
+
persons?: number;
|
|
103
|
+
games?: number;
|
|
104
|
+
subtypeId?: string;
|
|
105
|
+
};
|
|
106
|
+
type EventOfferStartOption = {
|
|
107
|
+
startMinuteOfDay: number;
|
|
108
|
+
durationMinutes: number[];
|
|
109
|
+
};
|
|
110
|
+
type EventOfferOptionsResult = EventOfferStartOption[];
|
|
111
|
+
/** Bookable start/duration pairs for the offer and requested party. */
|
|
112
|
+
declare function eventOfferOptions(client: BowlosClient, args: EventOfferOptionsArgs): Promise<EventOfferOptionsResult>;
|
|
113
|
+
/** True when the session duration is fixed, independent of price basis. */
|
|
114
|
+
declare function isFixedSession(session: EventOfferSession): boolean;
|
|
115
|
+
/** The server's bookable durations for this start, in server order. */
|
|
116
|
+
declare function durationsForStart(options: readonly EventOfferStartOption[], startMinuteOfDay: number): readonly number[];
|
|
117
|
+
/** Format Center-local minute offsets, including a next-day end at or after midnight. */
|
|
118
|
+
declare function formatSessionRange(startMinuteOfDay: number, endMinuteOfDay: number): string;
|
|
119
|
+
|
|
67
120
|
/** Gateway wire contracts, derived from the PR-6/7/8 backend validators and handlers. */
|
|
68
121
|
type EventOffer = {
|
|
69
122
|
id: string;
|
|
@@ -82,6 +135,27 @@ type EventOffer = {
|
|
|
82
135
|
pricePlanId: string | null;
|
|
83
136
|
pricePlanShoeIncluded: boolean;
|
|
84
137
|
priceCents: number | null;
|
|
138
|
+
session?: EventOfferSession | null;
|
|
139
|
+
};
|
|
140
|
+
type EventOfferDetail = EventOffer & {
|
|
141
|
+
minQuantity: number | null;
|
|
142
|
+
maxQuantity: number | null;
|
|
143
|
+
includedAddons: {
|
|
144
|
+
addonId: string;
|
|
145
|
+
name: string;
|
|
146
|
+
quantity: number;
|
|
147
|
+
}[];
|
|
148
|
+
brand: {
|
|
149
|
+
id: string;
|
|
150
|
+
name: string;
|
|
151
|
+
primaryColor: string | null;
|
|
152
|
+
bannerImageUrl: string | null;
|
|
153
|
+
};
|
|
154
|
+
center: {
|
|
155
|
+
id: string;
|
|
156
|
+
name: string;
|
|
157
|
+
timezone: string;
|
|
158
|
+
};
|
|
85
159
|
};
|
|
86
160
|
type ListEventOffersArgs = {
|
|
87
161
|
centerId: string;
|
|
@@ -264,6 +338,7 @@ interface CatalogItem {
|
|
|
264
338
|
priceLabel?: string | null;
|
|
265
339
|
imageUrl?: string | null;
|
|
266
340
|
badgeLabel?: string | null;
|
|
341
|
+
session?: EventOfferSession | null;
|
|
267
342
|
action: {
|
|
268
343
|
type: CatalogActionType;
|
|
269
344
|
payload: Record<string, string>;
|
|
@@ -484,4 +559,4 @@ declare function openMembershipBillingPortal(client: BowlosClient, args: Members
|
|
|
484
559
|
declare function getPayLink(client: BowlosClient, args: PayLinkArgs): Promise<PayLink>;
|
|
485
560
|
declare function createPayLinkPayment(client: BowlosClient, args: PayLinkArgs): Promise<PayLinkPayment>;
|
|
486
561
|
|
|
487
|
-
export { type
|
|
562
|
+
export { type PendingBookingChangeArgs as $, type ApplyBookingChangeArgs as A, BOWLOS_ERROR_CODES as B, type CancelMyPendingBookingArgs as C, type CatalogItem as D, type EmailVerificationTokenArgs as E, type CatalogResult as F, type GetCancellationPolicyArgs as G, type CatalogSection as H, type CatalogSourceTable as I, type CenterHoursArgs as J, type CenterScoped as K, type ListBrandEventOffersArgs as L, type MyHoldArgs as M, type EventOffer as N, type EventOfferDetail as O, type EventOfferOptionsArgs as P, type EventOfferOptionsResult as Q, type RequestEmailVerificationResult as R, type EventOfferSession as S, type EventOfferStartOption as T, type ListEventOffersArgs as U, type MembershipBillingPortalArgs as V, type PackageDetailArgs as W, type PayLink as X, type PayLinkArgs as Y, type PayLinkPayment as Z, type PendingBookingChange as _, type CancelMyPendingBookingResult as a, type PreviewBookingChangeArgs as a0, type PublicSurface as a1, type RetailAttraction as a2, type RetailPricing as a3, type RetailPricingMode as a4, type RetailSpecial as a5, type RetailWalkInRate as a6, applyBookingChange as a7, createBookingChangePayment as a8, createPayLinkPayment as a9, durationsForStart as aa, eventOfferOptions as ab, formatSessionRange as ac, getCenterHours as ad, getEventOffer as ae, getPackage as af, getPayLink as ag, getPendingBookingChange as ah, isFixedSession as ai, listCatalog as aj, listEventOffers as ak, listEvents as al, listGameCards as am, listPackages as an, listProducts as ao, listPublicMemberships as ap, listRetailPricing as aq, openMembershipBillingPortal as ar, previewBookingChange as as, type CancellationPolicy as b, type EmailVerificationSendStateArgs as c, type EmailVerificationSendState as d, type EmailVerificationStatus as e, type GetMyGameCardArgs as f, type GetMyGameCardResult as g, type GetMyGameCardHistoryArgs as h, type GetMyGameCardHistoryResult as i, type GameCardRedemption as j, type MyHold as k, type GetWalletPassUrlArgs as l, type GetWalletPassUrlResult as m, type ListBrandEventOffersResult as n, type EmailVerificationArgs as o, type BookingChangePayment as p, type BookingChangePaymentArgs as q, type BookingChangePreview as r, BowlosApiError as s, type BowlosApiErrorOptions as t, type BowlosErrorCode as u, type BrandCatalogArgs as v, type BrandEventOffer as w, type CatalogActionType as x, type CatalogArgs as y, type CatalogCategory as z };
|