@bowlos/reservations 0.35.0 → 0.41.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 (79) hide show
  1. package/AGENTS.md +300 -0
  2. package/HEADLESS.md +716 -11
  3. package/README.md +363 -2
  4. package/dist/{data-qw8P3JW3.d.cts → account-DEX2Lr78.d.cts} +218 -3
  5. package/dist/{data-qw8P3JW3.d.ts → account-DEX2Lr78.d.ts} +218 -3
  6. package/dist/booking-change-4DGu-B08.d.ts +1282 -0
  7. package/dist/booking-change-aK6P37FZ.d.cts +1282 -0
  8. package/dist/{chunk-UN5E6UEZ.js → chunk-44WKP6MW.js} +38 -7
  9. package/dist/chunk-44WKP6MW.js.map +1 -0
  10. package/dist/{chunk-MMSVM3QS.js → chunk-BWJHRJN6.js} +75 -187
  11. package/dist/chunk-BWJHRJN6.js.map +1 -0
  12. package/dist/{chunk-Y3YSDO3H.js → chunk-FMFHNBDH.js} +56 -5
  13. package/dist/chunk-FMFHNBDH.js.map +1 -0
  14. package/dist/chunk-I37IJNYU.js +139 -0
  15. package/dist/chunk-I37IJNYU.js.map +1 -0
  16. package/dist/chunk-VJIS56OO.js +717 -0
  17. package/dist/chunk-VJIS56OO.js.map +1 -0
  18. package/dist/{chunk-SMPDCDMB.js → chunk-YAXBZJMI.js} +3 -3
  19. package/dist/chunk-YAXBZJMI.js.map +1 -0
  20. package/dist/cli.cjs +34 -6
  21. package/dist/cli.cjs.map +1 -1
  22. package/dist/components.cjs +1596 -4
  23. package/dist/components.cjs.map +1 -1
  24. package/dist/components.d.cts +208 -7
  25. package/dist/components.d.ts +208 -7
  26. package/dist/components.js +1046 -8
  27. package/dist/components.js.map +1 -1
  28. package/dist/index.cjs +299 -6
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.cts +56 -5
  31. package/dist/index.d.ts +56 -5
  32. package/dist/index.js +77 -5
  33. package/dist/index.js.map +1 -1
  34. package/dist/payments.cjs +203 -0
  35. package/dist/payments.cjs.map +1 -1
  36. package/dist/payments.d.cts +16 -2
  37. package/dist/payments.d.ts +16 -2
  38. package/dist/payments.js +78 -2
  39. package/dist/payments.js.map +1 -1
  40. package/dist/{react-C2V1kXnO.d.ts → react-CrRciA7I.d.ts} +2 -2
  41. package/dist/{react-DtncBQ3b.d.cts → react-QJrsaOnN.d.cts} +2 -2
  42. package/dist/react.cjs +801 -30
  43. package/dist/react.cjs.map +1 -1
  44. package/dist/react.d.cts +150 -7
  45. package/dist/react.d.ts +150 -7
  46. package/dist/react.js +72 -4
  47. package/dist/react.js.map +1 -1
  48. package/package.json +10 -3
  49. package/templates/center-site/README.md +5 -0
  50. package/templates/center-site/app/account/game-cards/page.tsx +17 -0
  51. package/templates/center-site/app/account/layout.tsx +16 -0
  52. package/templates/center-site/app/account/memberships/[id]/page.tsx +23 -0
  53. package/templates/center-site/app/account/memberships/page.tsx +33 -0
  54. package/templates/center-site/app/account/orders/page.tsx +17 -0
  55. package/templates/center-site/app/account/page.tsx +14 -0
  56. package/templates/center-site/app/account/payment-methods/page.tsx +23 -0
  57. package/templates/center-site/app/account/privacy/page.tsx +17 -0
  58. package/templates/center-site/app/account/profile/page.tsx +45 -0
  59. package/templates/center-site/app/account/reservations/[displayId]/change/page.tsx +46 -0
  60. package/templates/center-site/app/account/reservations/[displayId]/page.tsx +41 -0
  61. package/templates/center-site/app/account/reservations/page.tsx +35 -0
  62. package/templates/center-site/app/account/security/page.tsx +17 -0
  63. package/templates/center-site/app/book/page.tsx +11 -23
  64. package/templates/center-site/app/catalog/page.tsx +21 -12
  65. package/templates/center-site/app/events/[slug]/page.tsx +130 -0
  66. package/templates/center-site/app/events/page.tsx +57 -0
  67. package/templates/center-site/app/pay/[token]/page.tsx +53 -0
  68. package/templates/center-site/app/site-header.tsx +1 -0
  69. package/templates/center-site/lib/reservation.ts +14 -0
  70. package/templates/center-site/package.json +1 -1
  71. package/templates/center-site/tsconfig.json +7 -9
  72. package/dist/account-BJ5UjC0r.d.ts +0 -165
  73. package/dist/account-QoFg8-i1.d.cts +0 -165
  74. package/dist/catalog-CGitz1PG.d.ts +0 -221
  75. package/dist/catalog-p9cwB6Qv.d.cts +0 -221
  76. package/dist/chunk-MMSVM3QS.js.map +0 -1
  77. package/dist/chunk-SMPDCDMB.js.map +0 -1
  78. package/dist/chunk-UN5E6UEZ.js.map +0 -1
  79. package/dist/chunk-Y3YSDO3H.js.map +0 -1
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { useEffect, useState } from "react";
3
+ import { listBrandEventOffers, listEventOffers, type EventOffer } from "@bowlos/reservations";
4
+ import { useBowlosClient } from "@bowlos/reservations/react";
5
+ import { EventList } from "@bowlos/reservations/components";
6
+ import { BRAND_ID, CENTER_ID } from "../../lib/bowlos";
7
+
8
+ /** Every sellable occurrence with a landing page; one row per scheduled event. */
9
+ export default function EventsPage() {
10
+ const client = useBowlosClient();
11
+ const [items, setItems] = useState<EventOffer[]>([]);
12
+ const [loading, setLoading] = useState(true);
13
+ const [error, setError] = useState<Error | null>(null);
14
+ useEffect(() => {
15
+ let active = true;
16
+ async function load() {
17
+ try {
18
+ const all: EventOffer[] = [];
19
+ if (CENTER_ID) {
20
+ all.push(
21
+ ...(await listEventOffers(client, {
22
+ centerId: CENTER_ID,
23
+ includeWithoutLandingPage: false,
24
+ })),
25
+ );
26
+ } else {
27
+ let cursor: string | undefined;
28
+ for (;;) {
29
+ const page = await listBrandEventOffers(client, {
30
+ brandId: BRAND_ID,
31
+ includeWithoutLandingPage: false,
32
+ cursor,
33
+ });
34
+ if (!active) return;
35
+ all.push(...page.items);
36
+ if (page.isDone) break;
37
+ cursor = page.continueCursor; // Follow even when a filtered page is empty.
38
+ }
39
+ }
40
+ if (active) setItems(all);
41
+ } catch (cause) {
42
+ if (active) setError(cause instanceof Error ? cause : new Error("Unable to load events."));
43
+ } finally {
44
+ if (active) setLoading(false);
45
+ }
46
+ }
47
+ void load();
48
+ return () => {
49
+ active = false;
50
+ };
51
+ }, [client]);
52
+ return (
53
+ <main>
54
+ <EventList items={items} loading={loading} error={error} />
55
+ </main>
56
+ );
57
+ }
@@ -0,0 +1,53 @@
1
+ "use client";
2
+ import { useEffect } from "react";
3
+ import { useParams } from "next/navigation";
4
+ import { usePayLink, useCreatePayLinkPayment } from "@bowlos/reservations/react";
5
+ import { BowlosPaymentForm } from "@bowlos/reservations/payments";
6
+ import { BRAND_ID, CENTER_ID, formatCents } from "@/lib/bowlos";
7
+ export default function Page() {
8
+ const { token } = useParams<{ token: string }>();
9
+ const args = { token, brandId: BRAND_ID, centerId: CENTER_ID || undefined };
10
+ const q = usePayLink(args);
11
+ const payment = useCreatePayLinkPayment();
12
+ useEffect(() => {
13
+ const timer = setInterval(() => void q.refetch(), 2000);
14
+ return () => clearInterval(timer);
15
+ }, [q.refetch]);
16
+ return (
17
+ <main>
18
+ <h1>Pay balance</h1>
19
+ {q.loading && <p role="status">Loading…</p>}
20
+ {q.error && <p role="alert">{q.error.message}</p>}
21
+ {payment.error && <p role="alert">{payment.error.message}</p>}
22
+ {q.data && (
23
+ <>
24
+ <p>
25
+ {q.data.reservation.displayId} — {q.data.reservation.dateISO}
26
+ </p>
27
+ <p role="status">{q.data.status}</p>
28
+ <p>{formatCents(q.data.remainingDueCents)}</p>
29
+ {q.data.status === "pending_payment" && q.data.expiresAt > Date.now() && (
30
+ <>
31
+ {!payment.data ? (
32
+ <button
33
+ disabled={payment.loading}
34
+ onClick={() => void payment.run(args).catch(() => {})}
35
+ >
36
+ Pay balance
37
+ </button>
38
+ ) : (
39
+ <BowlosPaymentForm
40
+ paymentIntent={payment.data}
41
+ publishableKey={payment.data.publishableKey}
42
+ amountCents={payment.data.amountCents}
43
+ onPaid={() => void q.refetch()}
44
+ />
45
+ )}
46
+ </>
47
+ )}
48
+ </>
49
+ )}
50
+ <a href="/account">My account</a>
51
+ </main>
52
+ );
53
+ }
@@ -22,6 +22,7 @@ export function SiteHeader() {
22
22
  <nav style={{ display: "flex", gap: "1rem", fontSize: "0.9rem" }}>
23
23
  <Link href="/">Home</Link>
24
24
  <Link href="/catalog">Book</Link>
25
+ <Link href="/events">Events</Link>
25
26
  <Link href="/flash">Flash sales</Link>
26
27
  <Link href="/account">My account</Link>
27
28
  </nav>
@@ -0,0 +1,14 @@
1
+ export interface ReservationDetail {
2
+ id: string;
3
+ displayId: string;
4
+ version: number;
5
+ status: string;
6
+ dateISO: string;
7
+ startMinuteOfDay: number;
8
+ endMinuteOfDay: number;
9
+ units?: number;
10
+ persons?: number;
11
+ center: { id: string; name: string };
12
+ product: { name: string };
13
+ snapshot: { finalCents: number };
14
+ }
@@ -11,7 +11,7 @@
11
11
  "typecheck": "tsc --noEmit"
12
12
  },
13
13
  "dependencies": {
14
- "@bowlos/reservations": "^0.35.0",
14
+ "@bowlos/reservations": "^0.41.0",
15
15
  "@stripe/react-stripe-js": "6.3.0",
16
16
  "@stripe/stripe-js": "9.4.0",
17
17
  "next": "16.2.4",
@@ -1,11 +1,7 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "ES2022",
4
- "lib": [
5
- "ES2023",
6
- "DOM",
7
- "DOM.Iterable"
8
- ],
4
+ "lib": ["ES2023", "DOM", "DOM.Iterable"],
9
5
  "module": "ESNext",
10
6
  "moduleResolution": "Bundler",
11
7
  "jsx": "react-jsx",
@@ -23,7 +19,11 @@
23
19
  }
24
20
  ],
25
21
  "allowJs": true,
26
- "incremental": true
22
+ "incremental": true,
23
+ "paths": {
24
+ "@/*": ["./*"]
25
+ },
26
+ "types": ["node"]
27
27
  },
28
28
  "include": [
29
29
  "**/*.ts",
@@ -32,7 +32,5 @@
32
32
  "next-env.d.ts",
33
33
  ".next/dev/types/**/*.ts"
34
34
  ],
35
- "exclude": [
36
- "node_modules"
37
- ]
35
+ "exclude": ["node_modules"]
38
36
  }
@@ -1,165 +0,0 @@
1
- import { g as BowlosClient } from './data-qw8P3JW3.js';
2
-
3
- /**
4
- * Typed account + flash reads for @bowlos/reservations.
5
- *
6
- * Session-scoped account reads (require a signed-in customer) and the
7
- * session-aware flash-sale reads. Args are typed precisely — every account read
8
- * is brand-scoped. Results are generic (`<T = unknown>`): parameterize with your
9
- * own shape, or read `unknown` and narrow. (The backend return shapes are rich
10
- * and evolving; the SDK doesn't pin them here.) Each read has a framework-agnostic
11
- * function here and a React hook in `hooks.tsx`.
12
- */
13
-
14
- /** Every account read is scoped to the customer's Brand. */
15
- type BrandScoped = {
16
- brandId: string;
17
- };
18
- type ReservationDetailArgs = {
19
- brandId: string;
20
- displayId: string;
21
- };
22
- type EventOrderDetailArgs = {
23
- brandId: string;
24
- orderId: string;
25
- };
26
- type MembershipDetailArgs = {
27
- brandId: string;
28
- membershipId: string;
29
- };
30
- type FlashSaleArgs = {
31
- slug: string;
32
- };
33
- type FlashBookingOptionsArgs = {
34
- slug: string;
35
- itemId: string;
36
- };
37
- type FlashSalesArgs = {
38
- brandId: string;
39
- };
40
- declare function getMyReservations<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
41
- declare function getMyReservationDetail<T = unknown>(client: BowlosClient, args: ReservationDetailArgs): Promise<T>;
42
- declare function getMyEventOrders<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
43
- declare function getMyEventOrder<T = unknown>(client: BowlosClient, args: EventOrderDetailArgs): Promise<T>;
44
- declare function getMyMemberships<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
45
- declare function getMyMembershipDetail<T = unknown>(client: BowlosClient, args: MembershipDetailArgs): Promise<T>;
46
- declare function getMyLoyalty<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
47
- declare function getMyCredits<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
48
- declare function getMyPasses<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
49
- declare function getMyGameCards<T = MyGameCard[]>(client: BowlosClient, args: BrandScoped): Promise<T>;
50
- /** Outcome preview shared by all four cancel types. `bucket`/`hoursBeforeStart`/
51
- * `forfeitCents` are inert (null/0) for game cards (no time policy). */
52
- interface CancelPreview {
53
- cancellable: boolean;
54
- reason: string | null;
55
- bucket: string | null;
56
- hoursBeforeStart: number;
57
- creditCents: number;
58
- forfeitCents: number;
59
- paidCents: number;
60
- }
61
- interface CancelResult {
62
- id: string;
63
- status: string;
64
- creditCents: number;
65
- bucket?: string | null;
66
- hoursBeforeStart?: number;
67
- forfeitCents?: number;
68
- version?: number;
69
- }
70
- interface MyGameCard {
71
- id: string;
72
- displayId: string;
73
- cardName: string;
74
- status: "active" | "depleted" | "expired" | "cancelled" | "refunded";
75
- totalGames: number;
76
- remainingGames: number;
77
- shoesIncluded: boolean;
78
- purchasedAt: number;
79
- expiresAt: number;
80
- paidCents: number;
81
- /** Precomputed unused-only rule; the per-card preview is the source of truth. */
82
- cancellable: boolean;
83
- }
84
- type ReservationCancelArgs = {
85
- brandId: string;
86
- reservationId: string;
87
- expectedVersion: number;
88
- reason?: string;
89
- /** Per-attempt key; safe to retry. */
90
- idempotencyKey: string;
91
- };
92
- type OrderCancelArgs = {
93
- brandId: string;
94
- orderId: string;
95
- reason?: string;
96
- idempotencyKey: string;
97
- };
98
- type GameCardCancelArgs = {
99
- brandId: string;
100
- cardId: string;
101
- reason?: string;
102
- idempotencyKey: string;
103
- };
104
- declare function previewReservationCancellation<T = CancelPreview>(client: BowlosClient, args: {
105
- brandId: string;
106
- reservationId: string;
107
- }): Promise<T>;
108
- declare function previewEventOrderCancellation<T = CancelPreview>(client: BowlosClient, args: {
109
- brandId: string;
110
- orderId: string;
111
- }): Promise<T>;
112
- declare function previewPackageOrderCancellation<T = CancelPreview>(client: BowlosClient, args: {
113
- brandId: string;
114
- orderId: string;
115
- }): Promise<T>;
116
- declare function previewGameCardCancellation<T = CancelPreview>(client: BowlosClient, args: {
117
- brandId: string;
118
- cardId: string;
119
- }): Promise<T>;
120
- declare function cancelMyReservation<T = CancelResult>(client: BowlosClient, args: ReservationCancelArgs): Promise<T>;
121
- declare function cancelMyEventOrder<T = CancelResult>(client: BowlosClient, args: OrderCancelArgs): Promise<T>;
122
- declare function cancelMyPackageOrder<T = CancelResult>(client: BowlosClient, args: OrderCancelArgs): Promise<T>;
123
- declare function cancelMyGameCard<T = CancelResult>(client: BowlosClient, args: GameCardCancelArgs): Promise<T>;
124
- declare function getFlashSale<T = unknown>(client: BowlosClient, args: FlashSaleArgs): Promise<T>;
125
- /** The public flash-sale index for a Brand (live + upcoming; no prices). Public. */
126
- declare function getFlashSales<T = unknown>(client: BowlosClient, args: FlashSalesArgs): Promise<T>;
127
- declare function getFlashSaleBookingOptions<T = unknown>(client: BowlosClient, args: FlashBookingOptionsArgs): Promise<T>;
128
- type CreateFlashSaleBookingArgs = {
129
- slug: string;
130
- itemId: string;
131
- dateISO: string;
132
- startMinuteOfDay: number;
133
- durationMinutes: number;
134
- units: number;
135
- /** Per-attempt key; replays return the original checkout. */
136
- idempotencyKey: string;
137
- };
138
- interface FlashSaleBookingResult {
139
- /** Handle for the rest of the checkout: mint the PaymentIntent with
140
- * `createCheckoutPaymentIntent(client, { refToken })`, then poll
141
- * `getCheckoutStatus(client, refToken)` to materialization. */
142
- refToken: string;
143
- /** The SALE-priced total the PaymentIntent charges (base at the flash
144
- * price + tax + the Center fee). */
145
- amountDueCents: number;
146
- holdExpiresAt: number;
147
- breakdown: {
148
- baseSubtotalCents: number;
149
- reservationFeeCents: number;
150
- reservationFeeLabel: string | null;
151
- taxAddedCents: number;
152
- taxIncludedCents: number;
153
- totalCents: number;
154
- };
155
- }
156
- /**
157
- * v0.22.1 — book a flash-sale reservation item at its SALE price (the flash
158
- * analog of `eventOfferSlug`: the server binds the item's sale price, holds
159
- * the inventory, and opens a checkout). Signed-in customers only. Pick the
160
- * date/time from `getFlashSaleBookingOptions` — the purpose-built option
161
- * list — never the regular booking calendar.
162
- */
163
- declare function createFlashSaleBooking(client: BowlosClient, args: CreateFlashSaleBookingArgs): Promise<FlashSaleBookingResult>;
164
-
165
- export { previewGameCardCancellation as A, type BrandScoped as B, type CancelPreview as C, previewPackageOrderCancellation as D, type EventOrderDetailArgs as E, type FlashBookingOptionsArgs as F, type GameCardCancelArgs as G, previewReservationCancellation as H, type MembershipDetailArgs as M, type OrderCancelArgs as O, type ReservationCancelArgs as R, type CancelResult as a, type CreateFlashSaleBookingArgs as b, type FlashSaleArgs as c, type FlashSaleBookingResult as d, type FlashSalesArgs as e, type MyGameCard as f, type ReservationDetailArgs as g, cancelMyEventOrder as h, cancelMyGameCard as i, cancelMyPackageOrder as j, cancelMyReservation as k, createFlashSaleBooking as l, getFlashSale as m, getFlashSaleBookingOptions as n, getFlashSales as o, getMyCredits as p, getMyEventOrder as q, getMyEventOrders as r, getMyGameCards as s, getMyLoyalty as t, getMyMembershipDetail as u, getMyMemberships as v, getMyPasses as w, getMyReservationDetail as x, getMyReservations as y, previewEventOrderCancellation as z };
@@ -1,165 +0,0 @@
1
- import { g as BowlosClient } from './data-qw8P3JW3.cjs';
2
-
3
- /**
4
- * Typed account + flash reads for @bowlos/reservations.
5
- *
6
- * Session-scoped account reads (require a signed-in customer) and the
7
- * session-aware flash-sale reads. Args are typed precisely — every account read
8
- * is brand-scoped. Results are generic (`<T = unknown>`): parameterize with your
9
- * own shape, or read `unknown` and narrow. (The backend return shapes are rich
10
- * and evolving; the SDK doesn't pin them here.) Each read has a framework-agnostic
11
- * function here and a React hook in `hooks.tsx`.
12
- */
13
-
14
- /** Every account read is scoped to the customer's Brand. */
15
- type BrandScoped = {
16
- brandId: string;
17
- };
18
- type ReservationDetailArgs = {
19
- brandId: string;
20
- displayId: string;
21
- };
22
- type EventOrderDetailArgs = {
23
- brandId: string;
24
- orderId: string;
25
- };
26
- type MembershipDetailArgs = {
27
- brandId: string;
28
- membershipId: string;
29
- };
30
- type FlashSaleArgs = {
31
- slug: string;
32
- };
33
- type FlashBookingOptionsArgs = {
34
- slug: string;
35
- itemId: string;
36
- };
37
- type FlashSalesArgs = {
38
- brandId: string;
39
- };
40
- declare function getMyReservations<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
41
- declare function getMyReservationDetail<T = unknown>(client: BowlosClient, args: ReservationDetailArgs): Promise<T>;
42
- declare function getMyEventOrders<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
43
- declare function getMyEventOrder<T = unknown>(client: BowlosClient, args: EventOrderDetailArgs): Promise<T>;
44
- declare function getMyMemberships<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
45
- declare function getMyMembershipDetail<T = unknown>(client: BowlosClient, args: MembershipDetailArgs): Promise<T>;
46
- declare function getMyLoyalty<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
47
- declare function getMyCredits<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
48
- declare function getMyPasses<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
49
- declare function getMyGameCards<T = MyGameCard[]>(client: BowlosClient, args: BrandScoped): Promise<T>;
50
- /** Outcome preview shared by all four cancel types. `bucket`/`hoursBeforeStart`/
51
- * `forfeitCents` are inert (null/0) for game cards (no time policy). */
52
- interface CancelPreview {
53
- cancellable: boolean;
54
- reason: string | null;
55
- bucket: string | null;
56
- hoursBeforeStart: number;
57
- creditCents: number;
58
- forfeitCents: number;
59
- paidCents: number;
60
- }
61
- interface CancelResult {
62
- id: string;
63
- status: string;
64
- creditCents: number;
65
- bucket?: string | null;
66
- hoursBeforeStart?: number;
67
- forfeitCents?: number;
68
- version?: number;
69
- }
70
- interface MyGameCard {
71
- id: string;
72
- displayId: string;
73
- cardName: string;
74
- status: "active" | "depleted" | "expired" | "cancelled" | "refunded";
75
- totalGames: number;
76
- remainingGames: number;
77
- shoesIncluded: boolean;
78
- purchasedAt: number;
79
- expiresAt: number;
80
- paidCents: number;
81
- /** Precomputed unused-only rule; the per-card preview is the source of truth. */
82
- cancellable: boolean;
83
- }
84
- type ReservationCancelArgs = {
85
- brandId: string;
86
- reservationId: string;
87
- expectedVersion: number;
88
- reason?: string;
89
- /** Per-attempt key; safe to retry. */
90
- idempotencyKey: string;
91
- };
92
- type OrderCancelArgs = {
93
- brandId: string;
94
- orderId: string;
95
- reason?: string;
96
- idempotencyKey: string;
97
- };
98
- type GameCardCancelArgs = {
99
- brandId: string;
100
- cardId: string;
101
- reason?: string;
102
- idempotencyKey: string;
103
- };
104
- declare function previewReservationCancellation<T = CancelPreview>(client: BowlosClient, args: {
105
- brandId: string;
106
- reservationId: string;
107
- }): Promise<T>;
108
- declare function previewEventOrderCancellation<T = CancelPreview>(client: BowlosClient, args: {
109
- brandId: string;
110
- orderId: string;
111
- }): Promise<T>;
112
- declare function previewPackageOrderCancellation<T = CancelPreview>(client: BowlosClient, args: {
113
- brandId: string;
114
- orderId: string;
115
- }): Promise<T>;
116
- declare function previewGameCardCancellation<T = CancelPreview>(client: BowlosClient, args: {
117
- brandId: string;
118
- cardId: string;
119
- }): Promise<T>;
120
- declare function cancelMyReservation<T = CancelResult>(client: BowlosClient, args: ReservationCancelArgs): Promise<T>;
121
- declare function cancelMyEventOrder<T = CancelResult>(client: BowlosClient, args: OrderCancelArgs): Promise<T>;
122
- declare function cancelMyPackageOrder<T = CancelResult>(client: BowlosClient, args: OrderCancelArgs): Promise<T>;
123
- declare function cancelMyGameCard<T = CancelResult>(client: BowlosClient, args: GameCardCancelArgs): Promise<T>;
124
- declare function getFlashSale<T = unknown>(client: BowlosClient, args: FlashSaleArgs): Promise<T>;
125
- /** The public flash-sale index for a Brand (live + upcoming; no prices). Public. */
126
- declare function getFlashSales<T = unknown>(client: BowlosClient, args: FlashSalesArgs): Promise<T>;
127
- declare function getFlashSaleBookingOptions<T = unknown>(client: BowlosClient, args: FlashBookingOptionsArgs): Promise<T>;
128
- type CreateFlashSaleBookingArgs = {
129
- slug: string;
130
- itemId: string;
131
- dateISO: string;
132
- startMinuteOfDay: number;
133
- durationMinutes: number;
134
- units: number;
135
- /** Per-attempt key; replays return the original checkout. */
136
- idempotencyKey: string;
137
- };
138
- interface FlashSaleBookingResult {
139
- /** Handle for the rest of the checkout: mint the PaymentIntent with
140
- * `createCheckoutPaymentIntent(client, { refToken })`, then poll
141
- * `getCheckoutStatus(client, refToken)` to materialization. */
142
- refToken: string;
143
- /** The SALE-priced total the PaymentIntent charges (base at the flash
144
- * price + tax + the Center fee). */
145
- amountDueCents: number;
146
- holdExpiresAt: number;
147
- breakdown: {
148
- baseSubtotalCents: number;
149
- reservationFeeCents: number;
150
- reservationFeeLabel: string | null;
151
- taxAddedCents: number;
152
- taxIncludedCents: number;
153
- totalCents: number;
154
- };
155
- }
156
- /**
157
- * v0.22.1 — book a flash-sale reservation item at its SALE price (the flash
158
- * analog of `eventOfferSlug`: the server binds the item's sale price, holds
159
- * the inventory, and opens a checkout). Signed-in customers only. Pick the
160
- * date/time from `getFlashSaleBookingOptions` — the purpose-built option
161
- * list — never the regular booking calendar.
162
- */
163
- declare function createFlashSaleBooking(client: BowlosClient, args: CreateFlashSaleBookingArgs): Promise<FlashSaleBookingResult>;
164
-
165
- export { previewGameCardCancellation as A, type BrandScoped as B, type CancelPreview as C, previewPackageOrderCancellation as D, type EventOrderDetailArgs as E, type FlashBookingOptionsArgs as F, type GameCardCancelArgs as G, previewReservationCancellation as H, type MembershipDetailArgs as M, type OrderCancelArgs as O, type ReservationCancelArgs as R, type CancelResult as a, type CreateFlashSaleBookingArgs as b, type FlashSaleArgs as c, type FlashSaleBookingResult as d, type FlashSalesArgs as e, type MyGameCard as f, type ReservationDetailArgs as g, cancelMyEventOrder as h, cancelMyGameCard as i, cancelMyPackageOrder as j, cancelMyReservation as k, createFlashSaleBooking as l, getFlashSale as m, getFlashSaleBookingOptions as n, getFlashSales as o, getMyCredits as p, getMyEventOrder as q, getMyEventOrders as r, getMyGameCards as s, getMyLoyalty as t, getMyMembershipDetail as u, getMyMemberships as v, getMyPasses as w, getMyReservationDetail as x, getMyReservations as y, previewEventOrderCancellation as z };