@bowlos/reservations 0.19.0 → 0.21.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 (36) hide show
  1. package/HEADLESS.md +331 -6
  2. package/README.md +23 -10
  3. package/dist/{catalog-Dgapnrdm.d.ts → catalog-BuafmB8y.d.cts} +67 -2
  4. package/dist/{catalog-Db8EdzJ2.d.cts → catalog-bpCn9klL.d.ts} +67 -2
  5. package/dist/{chunk-BPLYLQO3.js → chunk-FV6SROO2.js} +31 -4
  6. package/dist/chunk-FV6SROO2.js.map +1 -0
  7. package/dist/{chunk-FWPXQII5.js → chunk-S5T4OCBY.js} +61 -3
  8. package/dist/chunk-S5T4OCBY.js.map +1 -0
  9. package/dist/components.cjs +11 -6
  10. package/dist/components.cjs.map +1 -1
  11. package/dist/components.d.cts +10 -4
  12. package/dist/components.d.ts +10 -4
  13. package/dist/components.js +11 -6
  14. package/dist/components.js.map +1 -1
  15. package/dist/{data-DevEKBmK.d.cts → data-BKlgn8Ln.d.cts} +174 -1
  16. package/dist/{data-DevEKBmK.d.ts → data-BKlgn8Ln.d.ts} +174 -1
  17. package/dist/index.cjs +86 -0
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +3 -3
  20. package/dist/index.d.ts +3 -3
  21. package/dist/index.js +18 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/payments.d.cts +1 -1
  24. package/dist/payments.d.ts +1 -1
  25. package/dist/{react-BgP6rtBS.d.ts → react-BI2RKM5p.d.ts} +1 -1
  26. package/dist/{react-D73ZxxDw.d.cts → react-D2mBw_-l.d.cts} +1 -1
  27. package/dist/react.cjs +173 -0
  28. package/dist/react.cjs.map +1 -1
  29. package/dist/react.d.cts +77 -5
  30. package/dist/react.d.ts +77 -5
  31. package/dist/react.js +102 -4
  32. package/dist/react.js.map +1 -1
  33. package/package.json +1 -1
  34. package/templates/center-site/package.json +1 -1
  35. package/dist/chunk-BPLYLQO3.js.map +0 -1
  36. package/dist/chunk-FWPXQII5.js.map +0 -1
@@ -190,6 +190,9 @@ type BookingPreviewArgs = {
190
190
  addons?: BookingAddonSelection[];
191
191
  shareToken?: string;
192
192
  subtypeId?: string;
193
+ /** Reservation-mode event offer slug. Binds preview to that offer's event
194
+ * price plan, tax override, and Center fee override/inheritance. */
195
+ eventOfferSlug?: string;
193
196
  };
194
197
  /** The price quote. Headline fields are typed; the engine's full breakdown
195
198
  * (line items, discounts, tax, credit) is passed through. */
@@ -199,6 +202,18 @@ interface BookingQuote {
199
202
  pricePlanId: string;
200
203
  totalCents: number;
201
204
  }>;
205
+ taxLinesPerPlan?: Array<{
206
+ pricePlanId: string;
207
+ taxLines: Array<{
208
+ rateId: string;
209
+ label: string;
210
+ rateBasisPoints: number;
211
+ mode: "added" | "included";
212
+ taxableBaseCents: number;
213
+ taxCents: number;
214
+ }>;
215
+ taxTotalCents: number;
216
+ }>;
202
217
  [key: string]: unknown;
203
218
  }
204
219
  /** Free units for a product/date/time window (anonymous). */
@@ -254,6 +269,8 @@ type CreateBookingArgs = {
254
269
  idempotencyKey?: string;
255
270
  shareToken?: string;
256
271
  subtypeId?: string;
272
+ /** Reservation-mode event offer slug. Must match the preview slug. */
273
+ eventOfferSlug?: string;
257
274
  };
258
275
  /** Result of placing a booking. The hold→pay path returns `checkoutRefToken`
259
276
  * with `requiresPayment: true`; a credit-covered / $0 booking returns the
@@ -356,6 +373,60 @@ interface GameCardPreviewResult {
356
373
  * feeds the Review step. Requires a signed-in customer (so tax exemptions +
357
374
  * the resolved home Center match the eventual charge). */
358
375
  declare function previewGameCard(client: BowlosClient, args: GameCardPreviewArgs): Promise<GameCardPreviewResult>;
376
+ type EventTicketPreviewArgs = {
377
+ eventOfferId: string;
378
+ quantity: number;
379
+ };
380
+ interface EventTicketPreviewResult {
381
+ eventName: string;
382
+ eventDate: string;
383
+ quantity: number;
384
+ unitPriceCents: number;
385
+ subtotalCents: number;
386
+ taxLines: {
387
+ rateId: string;
388
+ label: string;
389
+ rateBasisPoints: number;
390
+ mode: "added" | "included";
391
+ taxableBaseCents: number;
392
+ taxCents: number;
393
+ }[];
394
+ taxTotalCents: number;
395
+ reservationFeeCents: number | null;
396
+ reservationFeeLabel: string | null;
397
+ grandTotalCents: number;
398
+ }
399
+ /** Itemized quote for a ticket-mode event offer WITHOUT creating a
400
+ * PaymentIntent. Requires a signed-in customer so tax exemptions match the
401
+ * eventual charge. */
402
+ declare function previewEventTicket(client: BowlosClient, args: EventTicketPreviewArgs): Promise<EventTicketPreviewResult>;
403
+ type EventTicketPurchaseArgs = {
404
+ eventOfferId: string;
405
+ quantity: number;
406
+ idempotencyKey?: string;
407
+ };
408
+ /** The connected-account PaymentIntent for a ticket-mode event purchase.
409
+ * Confirm it with `<BowlosPaymentForm>` — it carries `connectedAccountId` +
410
+ * the customer session. After payment, read the receipt with `getMyEventOrder`. */
411
+ interface EventTicketPurchaseIntent {
412
+ paymentIntentId: string;
413
+ clientSecret: string;
414
+ amountCents: number;
415
+ orderId: string;
416
+ customerSessionClientSecret: string;
417
+ connectedAccountId: string;
418
+ }
419
+ /** Buy tickets for a ticket-mode event offer — mints the connected-account
420
+ * PaymentIntent. Requires a signed-in customer so taxes and account ownership
421
+ * match the preview. */
422
+ declare function createEventTicketOrder(client: BowlosClient, args: EventTicketPurchaseArgs): Promise<EventTicketPurchaseIntent>;
423
+ type EventTicketCheckoutStatus = "not_found" | "pending_payment" | "paid" | "cancelled" | "refunded";
424
+ interface EventTicketStatusResult {
425
+ status: EventTicketCheckoutStatus;
426
+ orderId: string | null;
427
+ }
428
+ /** Poll a ticket-mode event purchase by the order id returned from create. */
429
+ declare function getEventTicketStatus(client: BowlosClient, orderId: string): Promise<EventTicketStatusResult>;
359
430
  /** Inputs for a package purchase. The SDK generates an idempotency key if omitted.
360
431
  * `scheduledDate` is `YYYY-MM-DD` in the Center's timezone; `scheduledStartMinute`
361
432
  * is minutes-from-midnight (e.g. 1050 = 5:30 PM) and MUST be one of the package's
@@ -440,6 +511,108 @@ interface PackagePreviewResult {
440
511
  * the Review step. Requires a signed-in customer (so tax exemptions match the
441
512
  * eventual charge). */
442
513
  declare function previewPackage(client: BowlosClient, args: PackagePreviewArgs): Promise<PackagePreviewResult>;
514
+ /** Inputs for an itemized membership quote. A membership has no config (no
515
+ * date/qty), so it's just the template (+ an optional share token for a private
516
+ * membership). The selling Center is resolved server-side from the customer's
517
+ * home Center. Shared by the one-time and recurring previews. */
518
+ type MembershipPreviewArgs = {
519
+ templateId: string;
520
+ shareToken?: string;
521
+ };
522
+ /** Server-computed itemized quote for a one-time membership purchase — the dues,
523
+ * the one-time setup (joining) fee, tax lines, the selling Center's booking fee,
524
+ * and the authoritative grand total. Drives the headless "Review" step. Computed
525
+ * by the SAME engine as the PaymentIntent, so it never diverges from what the
526
+ * customer is charged. */
527
+ interface MembershipPreviewResult {
528
+ duesCents: number;
529
+ setupFeeCents: number;
530
+ subtotalCents: number;
531
+ taxLines: {
532
+ rateId: string;
533
+ label: string;
534
+ rateBasisPoints: number;
535
+ mode: "added" | "included";
536
+ taxableBaseCents: number;
537
+ taxCents: number;
538
+ }[];
539
+ taxTotalCents: number;
540
+ reservationFeeCents: number | null;
541
+ reservationFeeLabel: string | null;
542
+ grandTotalCents: number;
543
+ }
544
+ /** Itemized quote for a one-time membership purchase WITHOUT creating a
545
+ * PaymentIntent — feeds the Review step. Requires a signed-in customer (so tax
546
+ * exemptions + the resolved home Center match the eventual charge). */
547
+ declare function previewMembership(client: BowlosClient, args: MembershipPreviewArgs): Promise<MembershipPreviewResult>;
548
+ /** Inputs for a one-time membership purchase. The SDK generates an idempotency
549
+ * key if omitted. */
550
+ type MembershipPurchaseArgs = {
551
+ templateId: string;
552
+ idempotencyKey?: string;
553
+ shareToken?: string;
554
+ };
555
+ /** The connected-account PaymentIntent for a one-time membership purchase.
556
+ * Confirm it with `<BowlosPaymentForm>` — it carries `connectedAccountId` + the
557
+ * customer session. Poll `getMembershipStatus(refToken)` for materialization. */
558
+ interface MembershipPurchaseIntent {
559
+ paymentIntentId: string;
560
+ clientSecret: string;
561
+ amountCents: number;
562
+ refToken: string | null;
563
+ customerSessionClientSecret: string;
564
+ connectedAccountId: string;
565
+ }
566
+ /** Buy a one-time membership — mints the connected-account PaymentIntent
567
+ * (requires a signed-in customer; the charge lands on the operator's connected
568
+ * account). */
569
+ declare function createMembershipOrder(client: BowlosClient, args: MembershipPurchaseArgs): Promise<MembershipPurchaseIntent>;
570
+ type MembershipCheckoutStatus = "not_found" | "pending_payment" | "paid_materialized" | "expired" | "payment_failed_retryable" | "abandoned";
571
+ interface MembershipStatusResult {
572
+ status: MembershipCheckoutStatus;
573
+ membershipId: string | null;
574
+ }
575
+ /** Poll a one-time membership purchase to materialization (by the create's
576
+ * `refToken`). */
577
+ declare function getMembershipStatus(client: BowlosClient, refToken: string): Promise<MembershipStatusResult>;
578
+ /** Server-computed itemized quote for a RECURRING membership subscription — the
579
+ * same fields as the one-time quote (what's charged today: dues + one-time setup
580
+ * fee + tax + the selling Center's fee), PLUS `recurringTotalCents` (what each
581
+ * renewal charges) and the `cadence`. Drives the recurring "Review" step's
582
+ * "Due today" + "Auto-renews at" lines. Computed by the SAME engine as the
583
+ * subscription's first invoice, so it never diverges. */
584
+ interface MembershipSubscriptionPreviewResult extends MembershipPreviewResult {
585
+ recurringTotalCents: number;
586
+ cadence: "monthly" | "annual" | "one_time";
587
+ }
588
+ /** Itemized quote for a recurring membership subscription WITHOUT creating the
589
+ * subscription — feeds the Review step. Requires a signed-in customer (so tax
590
+ * exemptions + the resolved home Center match the eventual charge). */
591
+ declare function previewMembershipSubscription(client: BowlosClient, args: MembershipPreviewArgs): Promise<MembershipSubscriptionPreviewResult>;
592
+ /** Inputs for a recurring membership subscription. (No idempotency key — the
593
+ * subscription itself is the dedupe anchor; the buy is gated to one active
594
+ * membership per customer.) */
595
+ type MembershipSubscriptionArgs = {
596
+ templateId: string;
597
+ shareToken?: string;
598
+ };
599
+ /** The connected-account first-invoice payment for a recurring membership
600
+ * subscription. Confirm `clientSecret` with `<BowlosPaymentForm>` — it carries
601
+ * `connectedAccountId` + the customer session. There is NO refToken: the
602
+ * subscription materializes via webhook, so re-query `useMyMemberships` after
603
+ * payment rather than polling. */
604
+ interface MembershipSubscriptionIntent {
605
+ subscriptionId: string;
606
+ clientSecret: string;
607
+ amountCents: number;
608
+ customerSessionClientSecret: string;
609
+ connectedAccountId: string;
610
+ }
611
+ /** Start a recurring membership subscription — mints the subscription + its
612
+ * first-invoice PaymentIntent on the operator's connected account (requires a
613
+ * signed-in customer). Confirm the returned `clientSecret`; the subscription
614
+ * materializes via webhook. */
615
+ declare function createMembershipSubscriptionOrder(client: BowlosClient, args: MembershipSubscriptionArgs): Promise<MembershipSubscriptionIntent>;
443
616
  /** Browser/Node-safe idempotency key for booking creates. */
444
617
  declare function generateIdempotencyKey(): string;
445
618
  /** Place the inventory hold + open a checkout. Sends the session when present
@@ -454,4 +627,4 @@ declare function abandonCheckout(client: BowlosClient, refToken: string): Promis
454
627
  ok: boolean;
455
628
  }>;
456
629
 
457
- export { previewPackage as $, type AuthState as A, type BookingAddonSelection as B, type CheckoutStatus as C, type Tokens as D, abandonCheckout as E, type FetchLike as F, type GameCardCheckoutStatus as G, availableUnitCount as H, bookingPreview as I, checkAvailability as J, createBooking as K, type LinkProfile as L, createBowlosClient as M, createCheckoutPaymentIntent as N, createGameCardOrder as O, type PackageCheckoutStatus as P, createPackageOrder as Q, generateIdempotencyKey as R, type StartTimesArgs as S, type TokenStore as T, getCheckoutStatus as U, getGameCardStatus as V, getPackageStatus as W, listAddons as X, listStartTimes as Y, localStorageTokenStore as Z, previewGameCard as _, type AvailabilityArgs as a, type AvailabilityResult as b, type BookingCustomer as c, type BookingHold as d, type BookingPreviewArgs as e, type BookingQuote as f, BowlosClient as g, type BowlosClientConfig as h, type CheckoutStatusResult as i, type ConnectedPaymentInput as j, type CreateBookingArgs as k, type Customer as l, type GameCardPreviewArgs as m, type GameCardPreviewResult as n, type GameCardPurchaseArgs as o, type GameCardPurchaseIntent as p, type GameCardStatusResult as q, type PackagePreviewArgs as r, type PackagePreviewResult as s, type PackagePurchaseArgs as t, type PackagePurchaseIntent as u, type PackageStatusResult as v, type PaymentIntentInfo as w, type PingResult as x, type PricingMode as y, type PublicAddon as z };
630
+ export { bookingPreview as $, type AuthState as A, type BookingAddonSelection as B, type CheckoutStatus as C, type MembershipStatusResult as D, type EventTicketCheckoutStatus as E, type FetchLike as F, type GameCardCheckoutStatus as G, type MembershipSubscriptionArgs as H, type MembershipSubscriptionIntent as I, type MembershipSubscriptionPreviewResult as J, type PackagePreviewArgs as K, type LinkProfile as L, type MembershipCheckoutStatus as M, type PackagePreviewResult as N, type PackagePurchaseArgs as O, type PackageCheckoutStatus as P, type PackagePurchaseIntent as Q, type PackageStatusResult as R, type PaymentIntentInfo as S, type PingResult as T, type PricingMode as U, type PublicAddon as V, type StartTimesArgs as W, type TokenStore as X, type Tokens as Y, abandonCheckout as Z, availableUnitCount as _, type AvailabilityArgs as a, checkAvailability as a0, createBooking as a1, createBowlosClient as a2, createCheckoutPaymentIntent as a3, createEventTicketOrder as a4, createGameCardOrder as a5, createMembershipOrder as a6, createMembershipSubscriptionOrder as a7, createPackageOrder as a8, generateIdempotencyKey as a9, getCheckoutStatus as aa, getEventTicketStatus as ab, getGameCardStatus as ac, getMembershipStatus as ad, getPackageStatus as ae, listAddons as af, listStartTimes as ag, localStorageTokenStore as ah, previewEventTicket as ai, previewGameCard as aj, previewMembership as ak, previewMembershipSubscription as al, previewPackage as am, type AvailabilityResult as b, type BookingCustomer as c, type BookingHold as d, type BookingPreviewArgs as e, type BookingQuote as f, BowlosClient as g, type BowlosClientConfig as h, type CheckoutStatusResult as i, type ConnectedPaymentInput as j, type CreateBookingArgs as k, type Customer as l, type EventTicketPreviewArgs as m, type EventTicketPreviewResult as n, type EventTicketPurchaseArgs as o, type EventTicketPurchaseIntent as p, type EventTicketStatusResult as q, type GameCardPreviewArgs as r, type GameCardPreviewResult as s, type GameCardPurchaseArgs as t, type GameCardPurchaseIntent as u, type GameCardStatusResult as v, type MembershipPreviewArgs as w, type MembershipPreviewResult as x, type MembershipPurchaseArgs as y, type MembershipPurchaseIntent as z };
@@ -190,6 +190,9 @@ type BookingPreviewArgs = {
190
190
  addons?: BookingAddonSelection[];
191
191
  shareToken?: string;
192
192
  subtypeId?: string;
193
+ /** Reservation-mode event offer slug. Binds preview to that offer's event
194
+ * price plan, tax override, and Center fee override/inheritance. */
195
+ eventOfferSlug?: string;
193
196
  };
194
197
  /** The price quote. Headline fields are typed; the engine's full breakdown
195
198
  * (line items, discounts, tax, credit) is passed through. */
@@ -199,6 +202,18 @@ interface BookingQuote {
199
202
  pricePlanId: string;
200
203
  totalCents: number;
201
204
  }>;
205
+ taxLinesPerPlan?: Array<{
206
+ pricePlanId: string;
207
+ taxLines: Array<{
208
+ rateId: string;
209
+ label: string;
210
+ rateBasisPoints: number;
211
+ mode: "added" | "included";
212
+ taxableBaseCents: number;
213
+ taxCents: number;
214
+ }>;
215
+ taxTotalCents: number;
216
+ }>;
202
217
  [key: string]: unknown;
203
218
  }
204
219
  /** Free units for a product/date/time window (anonymous). */
@@ -254,6 +269,8 @@ type CreateBookingArgs = {
254
269
  idempotencyKey?: string;
255
270
  shareToken?: string;
256
271
  subtypeId?: string;
272
+ /** Reservation-mode event offer slug. Must match the preview slug. */
273
+ eventOfferSlug?: string;
257
274
  };
258
275
  /** Result of placing a booking. The hold→pay path returns `checkoutRefToken`
259
276
  * with `requiresPayment: true`; a credit-covered / $0 booking returns the
@@ -356,6 +373,60 @@ interface GameCardPreviewResult {
356
373
  * feeds the Review step. Requires a signed-in customer (so tax exemptions +
357
374
  * the resolved home Center match the eventual charge). */
358
375
  declare function previewGameCard(client: BowlosClient, args: GameCardPreviewArgs): Promise<GameCardPreviewResult>;
376
+ type EventTicketPreviewArgs = {
377
+ eventOfferId: string;
378
+ quantity: number;
379
+ };
380
+ interface EventTicketPreviewResult {
381
+ eventName: string;
382
+ eventDate: string;
383
+ quantity: number;
384
+ unitPriceCents: number;
385
+ subtotalCents: number;
386
+ taxLines: {
387
+ rateId: string;
388
+ label: string;
389
+ rateBasisPoints: number;
390
+ mode: "added" | "included";
391
+ taxableBaseCents: number;
392
+ taxCents: number;
393
+ }[];
394
+ taxTotalCents: number;
395
+ reservationFeeCents: number | null;
396
+ reservationFeeLabel: string | null;
397
+ grandTotalCents: number;
398
+ }
399
+ /** Itemized quote for a ticket-mode event offer WITHOUT creating a
400
+ * PaymentIntent. Requires a signed-in customer so tax exemptions match the
401
+ * eventual charge. */
402
+ declare function previewEventTicket(client: BowlosClient, args: EventTicketPreviewArgs): Promise<EventTicketPreviewResult>;
403
+ type EventTicketPurchaseArgs = {
404
+ eventOfferId: string;
405
+ quantity: number;
406
+ idempotencyKey?: string;
407
+ };
408
+ /** The connected-account PaymentIntent for a ticket-mode event purchase.
409
+ * Confirm it with `<BowlosPaymentForm>` — it carries `connectedAccountId` +
410
+ * the customer session. After payment, read the receipt with `getMyEventOrder`. */
411
+ interface EventTicketPurchaseIntent {
412
+ paymentIntentId: string;
413
+ clientSecret: string;
414
+ amountCents: number;
415
+ orderId: string;
416
+ customerSessionClientSecret: string;
417
+ connectedAccountId: string;
418
+ }
419
+ /** Buy tickets for a ticket-mode event offer — mints the connected-account
420
+ * PaymentIntent. Requires a signed-in customer so taxes and account ownership
421
+ * match the preview. */
422
+ declare function createEventTicketOrder(client: BowlosClient, args: EventTicketPurchaseArgs): Promise<EventTicketPurchaseIntent>;
423
+ type EventTicketCheckoutStatus = "not_found" | "pending_payment" | "paid" | "cancelled" | "refunded";
424
+ interface EventTicketStatusResult {
425
+ status: EventTicketCheckoutStatus;
426
+ orderId: string | null;
427
+ }
428
+ /** Poll a ticket-mode event purchase by the order id returned from create. */
429
+ declare function getEventTicketStatus(client: BowlosClient, orderId: string): Promise<EventTicketStatusResult>;
359
430
  /** Inputs for a package purchase. The SDK generates an idempotency key if omitted.
360
431
  * `scheduledDate` is `YYYY-MM-DD` in the Center's timezone; `scheduledStartMinute`
361
432
  * is minutes-from-midnight (e.g. 1050 = 5:30 PM) and MUST be one of the package's
@@ -440,6 +511,108 @@ interface PackagePreviewResult {
440
511
  * the Review step. Requires a signed-in customer (so tax exemptions match the
441
512
  * eventual charge). */
442
513
  declare function previewPackage(client: BowlosClient, args: PackagePreviewArgs): Promise<PackagePreviewResult>;
514
+ /** Inputs for an itemized membership quote. A membership has no config (no
515
+ * date/qty), so it's just the template (+ an optional share token for a private
516
+ * membership). The selling Center is resolved server-side from the customer's
517
+ * home Center. Shared by the one-time and recurring previews. */
518
+ type MembershipPreviewArgs = {
519
+ templateId: string;
520
+ shareToken?: string;
521
+ };
522
+ /** Server-computed itemized quote for a one-time membership purchase — the dues,
523
+ * the one-time setup (joining) fee, tax lines, the selling Center's booking fee,
524
+ * and the authoritative grand total. Drives the headless "Review" step. Computed
525
+ * by the SAME engine as the PaymentIntent, so it never diverges from what the
526
+ * customer is charged. */
527
+ interface MembershipPreviewResult {
528
+ duesCents: number;
529
+ setupFeeCents: number;
530
+ subtotalCents: number;
531
+ taxLines: {
532
+ rateId: string;
533
+ label: string;
534
+ rateBasisPoints: number;
535
+ mode: "added" | "included";
536
+ taxableBaseCents: number;
537
+ taxCents: number;
538
+ }[];
539
+ taxTotalCents: number;
540
+ reservationFeeCents: number | null;
541
+ reservationFeeLabel: string | null;
542
+ grandTotalCents: number;
543
+ }
544
+ /** Itemized quote for a one-time membership purchase WITHOUT creating a
545
+ * PaymentIntent — feeds the Review step. Requires a signed-in customer (so tax
546
+ * exemptions + the resolved home Center match the eventual charge). */
547
+ declare function previewMembership(client: BowlosClient, args: MembershipPreviewArgs): Promise<MembershipPreviewResult>;
548
+ /** Inputs for a one-time membership purchase. The SDK generates an idempotency
549
+ * key if omitted. */
550
+ type MembershipPurchaseArgs = {
551
+ templateId: string;
552
+ idempotencyKey?: string;
553
+ shareToken?: string;
554
+ };
555
+ /** The connected-account PaymentIntent for a one-time membership purchase.
556
+ * Confirm it with `<BowlosPaymentForm>` — it carries `connectedAccountId` + the
557
+ * customer session. Poll `getMembershipStatus(refToken)` for materialization. */
558
+ interface MembershipPurchaseIntent {
559
+ paymentIntentId: string;
560
+ clientSecret: string;
561
+ amountCents: number;
562
+ refToken: string | null;
563
+ customerSessionClientSecret: string;
564
+ connectedAccountId: string;
565
+ }
566
+ /** Buy a one-time membership — mints the connected-account PaymentIntent
567
+ * (requires a signed-in customer; the charge lands on the operator's connected
568
+ * account). */
569
+ declare function createMembershipOrder(client: BowlosClient, args: MembershipPurchaseArgs): Promise<MembershipPurchaseIntent>;
570
+ type MembershipCheckoutStatus = "not_found" | "pending_payment" | "paid_materialized" | "expired" | "payment_failed_retryable" | "abandoned";
571
+ interface MembershipStatusResult {
572
+ status: MembershipCheckoutStatus;
573
+ membershipId: string | null;
574
+ }
575
+ /** Poll a one-time membership purchase to materialization (by the create's
576
+ * `refToken`). */
577
+ declare function getMembershipStatus(client: BowlosClient, refToken: string): Promise<MembershipStatusResult>;
578
+ /** Server-computed itemized quote for a RECURRING membership subscription — the
579
+ * same fields as the one-time quote (what's charged today: dues + one-time setup
580
+ * fee + tax + the selling Center's fee), PLUS `recurringTotalCents` (what each
581
+ * renewal charges) and the `cadence`. Drives the recurring "Review" step's
582
+ * "Due today" + "Auto-renews at" lines. Computed by the SAME engine as the
583
+ * subscription's first invoice, so it never diverges. */
584
+ interface MembershipSubscriptionPreviewResult extends MembershipPreviewResult {
585
+ recurringTotalCents: number;
586
+ cadence: "monthly" | "annual" | "one_time";
587
+ }
588
+ /** Itemized quote for a recurring membership subscription WITHOUT creating the
589
+ * subscription — feeds the Review step. Requires a signed-in customer (so tax
590
+ * exemptions + the resolved home Center match the eventual charge). */
591
+ declare function previewMembershipSubscription(client: BowlosClient, args: MembershipPreviewArgs): Promise<MembershipSubscriptionPreviewResult>;
592
+ /** Inputs for a recurring membership subscription. (No idempotency key — the
593
+ * subscription itself is the dedupe anchor; the buy is gated to one active
594
+ * membership per customer.) */
595
+ type MembershipSubscriptionArgs = {
596
+ templateId: string;
597
+ shareToken?: string;
598
+ };
599
+ /** The connected-account first-invoice payment for a recurring membership
600
+ * subscription. Confirm `clientSecret` with `<BowlosPaymentForm>` — it carries
601
+ * `connectedAccountId` + the customer session. There is NO refToken: the
602
+ * subscription materializes via webhook, so re-query `useMyMemberships` after
603
+ * payment rather than polling. */
604
+ interface MembershipSubscriptionIntent {
605
+ subscriptionId: string;
606
+ clientSecret: string;
607
+ amountCents: number;
608
+ customerSessionClientSecret: string;
609
+ connectedAccountId: string;
610
+ }
611
+ /** Start a recurring membership subscription — mints the subscription + its
612
+ * first-invoice PaymentIntent on the operator's connected account (requires a
613
+ * signed-in customer). Confirm the returned `clientSecret`; the subscription
614
+ * materializes via webhook. */
615
+ declare function createMembershipSubscriptionOrder(client: BowlosClient, args: MembershipSubscriptionArgs): Promise<MembershipSubscriptionIntent>;
443
616
  /** Browser/Node-safe idempotency key for booking creates. */
444
617
  declare function generateIdempotencyKey(): string;
445
618
  /** Place the inventory hold + open a checkout. Sends the session when present
@@ -454,4 +627,4 @@ declare function abandonCheckout(client: BowlosClient, refToken: string): Promis
454
627
  ok: boolean;
455
628
  }>;
456
629
 
457
- export { previewPackage as $, type AuthState as A, type BookingAddonSelection as B, type CheckoutStatus as C, type Tokens as D, abandonCheckout as E, type FetchLike as F, type GameCardCheckoutStatus as G, availableUnitCount as H, bookingPreview as I, checkAvailability as J, createBooking as K, type LinkProfile as L, createBowlosClient as M, createCheckoutPaymentIntent as N, createGameCardOrder as O, type PackageCheckoutStatus as P, createPackageOrder as Q, generateIdempotencyKey as R, type StartTimesArgs as S, type TokenStore as T, getCheckoutStatus as U, getGameCardStatus as V, getPackageStatus as W, listAddons as X, listStartTimes as Y, localStorageTokenStore as Z, previewGameCard as _, type AvailabilityArgs as a, type AvailabilityResult as b, type BookingCustomer as c, type BookingHold as d, type BookingPreviewArgs as e, type BookingQuote as f, BowlosClient as g, type BowlosClientConfig as h, type CheckoutStatusResult as i, type ConnectedPaymentInput as j, type CreateBookingArgs as k, type Customer as l, type GameCardPreviewArgs as m, type GameCardPreviewResult as n, type GameCardPurchaseArgs as o, type GameCardPurchaseIntent as p, type GameCardStatusResult as q, type PackagePreviewArgs as r, type PackagePreviewResult as s, type PackagePurchaseArgs as t, type PackagePurchaseIntent as u, type PackageStatusResult as v, type PaymentIntentInfo as w, type PingResult as x, type PricingMode as y, type PublicAddon as z };
630
+ export { bookingPreview as $, type AuthState as A, type BookingAddonSelection as B, type CheckoutStatus as C, type MembershipStatusResult as D, type EventTicketCheckoutStatus as E, type FetchLike as F, type GameCardCheckoutStatus as G, type MembershipSubscriptionArgs as H, type MembershipSubscriptionIntent as I, type MembershipSubscriptionPreviewResult as J, type PackagePreviewArgs as K, type LinkProfile as L, type MembershipCheckoutStatus as M, type PackagePreviewResult as N, type PackagePurchaseArgs as O, type PackageCheckoutStatus as P, type PackagePurchaseIntent as Q, type PackageStatusResult as R, type PaymentIntentInfo as S, type PingResult as T, type PricingMode as U, type PublicAddon as V, type StartTimesArgs as W, type TokenStore as X, type Tokens as Y, abandonCheckout as Z, availableUnitCount as _, type AvailabilityArgs as a, checkAvailability as a0, createBooking as a1, createBowlosClient as a2, createCheckoutPaymentIntent as a3, createEventTicketOrder as a4, createGameCardOrder as a5, createMembershipOrder as a6, createMembershipSubscriptionOrder as a7, createPackageOrder as a8, generateIdempotencyKey as a9, getCheckoutStatus as aa, getEventTicketStatus as ab, getGameCardStatus as ac, getMembershipStatus as ad, getPackageStatus as ae, listAddons as af, listStartTimes as ag, localStorageTokenStore as ah, previewEventTicket as ai, previewGameCard as aj, previewMembership as ak, previewMembershipSubscription as al, previewPackage as am, type AvailabilityResult as b, type BookingCustomer as c, type BookingHold as d, type BookingPreviewArgs as e, type BookingQuote as f, BowlosClient as g, type BowlosClientConfig as h, type CheckoutStatusResult as i, type ConnectedPaymentInput as j, type CreateBookingArgs as k, type Customer as l, type EventTicketPreviewArgs as m, type EventTicketPreviewResult as n, type EventTicketPurchaseArgs as o, type EventTicketPurchaseIntent as p, type EventTicketStatusResult as q, type GameCardPreviewArgs as r, type GameCardPreviewResult as s, type GameCardPurchaseArgs as t, type GameCardPurchaseIntent as u, type GameCardStatusResult as v, type MembershipPreviewArgs as w, type MembershipPreviewResult as x, type MembershipPurchaseArgs as y, type MembershipPurchaseIntent as z };
package/dist/index.cjs CHANGED
@@ -491,6 +491,28 @@ function previewGameCard(client, args) {
491
491
  { auth: true }
492
492
  );
493
493
  }
494
+ function previewEventTicket(client, args) {
495
+ return client.call(
496
+ "previewEventTicketOrder",
497
+ args,
498
+ { auth: true }
499
+ );
500
+ }
501
+ function createEventTicketOrder(client, args) {
502
+ const idempotencyKey = args.idempotencyKey ?? generateIdempotencyKey();
503
+ return client.call(
504
+ "createEventTicketPaymentIntent",
505
+ { ...args, idempotencyKey },
506
+ { auth: true }
507
+ );
508
+ }
509
+ function getEventTicketStatus(client, orderId) {
510
+ return client.call(
511
+ "getEventTicketCheckoutStatus",
512
+ { orderId },
513
+ { auth: true }
514
+ );
515
+ }
494
516
  function createPackageOrder(client, args) {
495
517
  const idempotencyKey = args.idempotencyKey ?? generateIdempotencyKey();
496
518
  return client.call(
@@ -513,6 +535,42 @@ function previewPackage(client, args) {
513
535
  { auth: true }
514
536
  );
515
537
  }
538
+ function previewMembership(client, args) {
539
+ return client.call(
540
+ "previewMembershipOrder",
541
+ args,
542
+ { auth: true }
543
+ );
544
+ }
545
+ function createMembershipOrder(client, args) {
546
+ const idempotencyKey = args.idempotencyKey ?? generateIdempotencyKey();
547
+ return client.call(
548
+ "createMembershipPaymentIntent",
549
+ { ...args, idempotencyKey },
550
+ { auth: true }
551
+ );
552
+ }
553
+ function getMembershipStatus(client, refToken) {
554
+ return client.call(
555
+ "getMembershipCheckoutStatus",
556
+ { refToken },
557
+ { auth: true }
558
+ );
559
+ }
560
+ function previewMembershipSubscription(client, args) {
561
+ return client.call(
562
+ "previewMembershipSubscriptionOrder",
563
+ args,
564
+ { auth: true }
565
+ );
566
+ }
567
+ function createMembershipSubscriptionOrder(client, args) {
568
+ return client.call(
569
+ "createMembershipSubscription",
570
+ args,
571
+ { auth: true }
572
+ );
573
+ }
516
574
  function generateIdempotencyKey() {
517
575
  if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
518
576
  return crypto.randomUUID();
@@ -548,6 +606,12 @@ function getMyReservations(client, args) {
548
606
  function getMyReservationDetail(client, args) {
549
607
  return client.call("getMyReservationDetail", args, { auth: true });
550
608
  }
609
+ function getMyEventOrders(client, args) {
610
+ return client.call("listMyEventOrders", args, { auth: true });
611
+ }
612
+ function getMyEventOrder(client, args) {
613
+ return client.call("getMyEventOrder", args, { auth: true });
614
+ }
551
615
  function getMyMemberships(client, args) {
552
616
  return client.call("listMyMemberships", args, { auth: true });
553
617
  }
@@ -574,12 +638,21 @@ function getFlashSaleBookingOptions(client, args) {
574
638
  }
575
639
 
576
640
  // src/catalog.ts
641
+ function listCatalog(client, args) {
642
+ return client.call("listPublicCatalog", args);
643
+ }
577
644
  function listProducts(client, args) {
578
645
  return client.call("listPublicProducts", args);
579
646
  }
580
647
  function listEvents(client, args) {
581
648
  return client.call("listPublicEvents", args);
582
649
  }
650
+ function listEventOffers(client, args) {
651
+ return client.call("listPublicEventOffers", args);
652
+ }
653
+ function getEventOffer(client, args) {
654
+ return client.call("getPublicEventOffer", args);
655
+ }
583
656
  function listPackages(client, args) {
584
657
  return client.call("listPublicPackages", args);
585
658
  }
@@ -606,16 +679,24 @@ exports.checkAvailability = checkAvailability;
606
679
  exports.createBooking = createBooking;
607
680
  exports.createBowlosClient = createBowlosClient;
608
681
  exports.createCheckoutPaymentIntent = createCheckoutPaymentIntent;
682
+ exports.createEventTicketOrder = createEventTicketOrder;
609
683
  exports.createGameCardOrder = createGameCardOrder;
684
+ exports.createMembershipOrder = createMembershipOrder;
685
+ exports.createMembershipSubscriptionOrder = createMembershipSubscriptionOrder;
610
686
  exports.createPackageOrder = createPackageOrder;
611
687
  exports.generateIdempotencyKey = generateIdempotencyKey;
612
688
  exports.getCenterHours = getCenterHours;
613
689
  exports.getCheckoutStatus = getCheckoutStatus;
690
+ exports.getEventOffer = getEventOffer;
691
+ exports.getEventTicketStatus = getEventTicketStatus;
614
692
  exports.getFlashSale = getFlashSale;
615
693
  exports.getFlashSaleBookingOptions = getFlashSaleBookingOptions;
616
694
  exports.getFlashSales = getFlashSales;
617
695
  exports.getGameCardStatus = getGameCardStatus;
696
+ exports.getMembershipStatus = getMembershipStatus;
618
697
  exports.getMyCredits = getMyCredits;
698
+ exports.getMyEventOrder = getMyEventOrder;
699
+ exports.getMyEventOrders = getMyEventOrders;
619
700
  exports.getMyLoyalty = getMyLoyalty;
620
701
  exports.getMyMembershipDetail = getMyMembershipDetail;
621
702
  exports.getMyMemberships = getMyMemberships;
@@ -625,6 +706,8 @@ exports.getMyReservations = getMyReservations;
625
706
  exports.getPackage = getPackage;
626
707
  exports.getPackageStatus = getPackageStatus;
627
708
  exports.listAddons = listAddons;
709
+ exports.listCatalog = listCatalog;
710
+ exports.listEventOffers = listEventOffers;
628
711
  exports.listEvents = listEvents;
629
712
  exports.listGameCards = listGameCards;
630
713
  exports.listPackages = listPackages;
@@ -632,7 +715,10 @@ exports.listProducts = listProducts;
632
715
  exports.listPublicMemberships = listPublicMemberships;
633
716
  exports.listStartTimes = listStartTimes;
634
717
  exports.localStorageTokenStore = localStorageTokenStore;
718
+ exports.previewEventTicket = previewEventTicket;
635
719
  exports.previewGameCard = previewGameCard;
720
+ exports.previewMembership = previewMembership;
721
+ exports.previewMembershipSubscription = previewMembershipSubscription;
636
722
  exports.previewPackage = previewPackage;
637
723
  exports.runDoctor = runDoctor;
638
724
  //# sourceMappingURL=index.cjs.map