@bowlos/reservations 0.36.0 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/AGENTS.md +306 -0
  2. package/HEADLESS.md +595 -10
  3. package/README.md +303 -2
  4. package/dist/account-B4sZBmPI.d.cts +1837 -0
  5. package/dist/account-B4sZBmPI.d.ts +1837 -0
  6. package/dist/booking-change-Dd4PVgd3.d.cts +487 -0
  7. package/dist/booking-change-DzYs9133.d.ts +487 -0
  8. package/dist/chunk-4JMGS4YB.js +808 -0
  9. package/dist/chunk-4JMGS4YB.js.map +1 -0
  10. package/dist/chunk-I37IJNYU.js +139 -0
  11. package/dist/chunk-I37IJNYU.js.map +1 -0
  12. package/dist/{chunk-Y3YSDO3H.js → chunk-T2E6AEC7.js} +150 -6
  13. package/dist/chunk-T2E6AEC7.js.map +1 -0
  14. package/dist/{chunk-3JSVEOKG.js → chunk-V4JRDYW4.js} +61 -6
  15. package/dist/chunk-V4JRDYW4.js.map +1 -0
  16. package/dist/{chunk-TEHRROVY.js → chunk-YQRTBGXU.js} +47 -192
  17. package/dist/chunk-YQRTBGXU.js.map +1 -0
  18. package/dist/cli.cjs +34 -3
  19. package/dist/cli.cjs.map +1 -1
  20. package/dist/components.cjs +2059 -153
  21. package/dist/components.cjs.map +1 -1
  22. package/dist/components.d.cts +214 -7
  23. package/dist/components.d.ts +214 -7
  24. package/dist/components.js +1148 -7
  25. package/dist/components.js.map +1 -1
  26. package/dist/index.cjs +303 -3
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +56 -5
  29. package/dist/index.d.ts +56 -5
  30. package/dist/index.js +58 -3
  31. package/dist/index.js.map +1 -1
  32. package/dist/payments.cjs +225 -0
  33. package/dist/payments.cjs.map +1 -1
  34. package/dist/payments.d.cts +24 -2
  35. package/dist/payments.d.ts +24 -2
  36. package/dist/payments.js +4 -1
  37. package/dist/payments.js.map +1 -1
  38. package/dist/{react-CWAG4cW0.d.cts → react-C6NWC80d.d.cts} +2 -2
  39. package/dist/{react-0MyyTtE4.d.ts → react-DVdtpw5n.d.ts} +2 -2
  40. package/dist/react.cjs +870 -27
  41. package/dist/react.cjs.map +1 -1
  42. package/dist/react.d.cts +155 -12
  43. package/dist/react.d.ts +155 -12
  44. package/dist/react.js +72 -4
  45. package/dist/react.js.map +1 -1
  46. package/package.json +8 -2
  47. package/templates/center-site/README.md +5 -0
  48. package/templates/center-site/app/account/game-cards/page.tsx +17 -0
  49. package/templates/center-site/app/account/layout.tsx +16 -0
  50. package/templates/center-site/app/account/memberships/[id]/page.tsx +23 -0
  51. package/templates/center-site/app/account/memberships/page.tsx +33 -0
  52. package/templates/center-site/app/account/orders/page.tsx +17 -0
  53. package/templates/center-site/app/account/page.tsx +14 -0
  54. package/templates/center-site/app/account/payment-methods/page.tsx +23 -0
  55. package/templates/center-site/app/account/privacy/page.tsx +17 -0
  56. package/templates/center-site/app/account/profile/page.tsx +45 -0
  57. package/templates/center-site/app/account/reservations/[displayId]/change/page.tsx +46 -0
  58. package/templates/center-site/app/account/reservations/[displayId]/page.tsx +41 -0
  59. package/templates/center-site/app/account/reservations/page.tsx +35 -0
  60. package/templates/center-site/app/account/security/page.tsx +17 -0
  61. package/templates/center-site/app/events/[slug]/page.tsx +130 -0
  62. package/templates/center-site/app/events/page.tsx +57 -0
  63. package/templates/center-site/app/pay/[token]/page.tsx +53 -0
  64. package/templates/center-site/app/site-header.tsx +1 -0
  65. package/templates/center-site/lib/reservation.ts +14 -0
  66. package/templates/center-site/package.json +1 -1
  67. package/templates/center-site/tsconfig.json +7 -9
  68. package/dist/account-DfM2COaz.d.ts +0 -210
  69. package/dist/account-oCvYWmO9.d.cts +0 -210
  70. package/dist/catalog-DbhdwmnX.d.cts +0 -224
  71. package/dist/catalog-XkjgPI5C.d.ts +0 -224
  72. package/dist/chunk-3JSVEOKG.js.map +0 -1
  73. package/dist/chunk-TEHRROVY.js.map +0 -1
  74. package/dist/chunk-Y3YSDO3H.js.map +0 -1
  75. package/dist/data-BJkB-tvM.d.cts +0 -778
  76. package/dist/data-BJkB-tvM.d.ts +0 -778
@@ -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.36.0",
14
+ "@bowlos/reservations": "^0.43.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,210 +0,0 @@
1
- import { g as BowlosClient } from './data-BJkB-tvM.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
- /** Tier savings already removed from baseSubtotalCents; do not subtract again. */
149
- tierDiscountCents: number;
150
- baseSubtotalCents: number;
151
- reservationFeeCents: number;
152
- reservationFeeLabel: string | null;
153
- taxAddedCents: number;
154
- taxIncludedCents: number;
155
- totalCents: number;
156
- };
157
- }
158
- /**
159
- * v0.22.1 — book a flash-sale reservation item at its SALE price (the flash
160
- * analog of `eventOfferSlug`: the server binds the item's sale price, holds
161
- * the inventory, and opens a checkout). Signed-in customers only. Pick the
162
- * date/time from `getFlashSaleBookingOptions` — the purpose-built option
163
- * list — never the regular booking calendar.
164
- */
165
- declare function createFlashSaleBooking(client: BowlosClient, args: CreateFlashSaleBookingArgs): Promise<FlashSaleBookingResult>;
166
- /** Saved cards belong to the active location's connected Stripe account. */
167
- type SavedCardScope = {
168
- brandId: string;
169
- centerId: string;
170
- };
171
- type SavedCardArgs = SavedCardScope & {
172
- paymentMethodId: string;
173
- };
174
- interface SavedCard {
175
- id: string;
176
- brand: string;
177
- last4: string;
178
- expMonth: number;
179
- expYear: number;
180
- isDefault: boolean;
181
- }
182
- interface SavedCardsResult {
183
- methods: SavedCard[];
184
- chargeable: boolean;
185
- }
186
- interface CardSetupResult {
187
- clientSecret: string;
188
- publishableKey: string;
189
- stripeAccount: string;
190
- stripeMode: "test" | "live";
191
- merchantDisplayName: string;
192
- }
193
- type ChangePasswordArgs = {
194
- currentPassword: string;
195
- newPassword: string;
196
- };
197
- declare function listSavedCards(client: BowlosClient, args: SavedCardScope): Promise<SavedCardsResult>;
198
- declare function createCardSetup(client: BowlosClient, args: SavedCardScope): Promise<CardSetupResult>;
199
- declare function removeSavedCard(client: BowlosClient, args: SavedCardArgs): Promise<{
200
- detached: boolean;
201
- }>;
202
- declare function setDefaultCard(client: BowlosClient, args: SavedCardArgs): Promise<{
203
- ok: boolean;
204
- }>;
205
- /** Success invalidates all sessions; discard local tokens and show sign-in. */
206
- declare function changePassword(client: BowlosClient, args: ChangePasswordArgs): Promise<{
207
- ok: true;
208
- }>;
209
-
210
- export { getMyLoyalty as A, type BrandScoped as B, type CancelPreview as C, getMyMembershipDetail as D, type EventOrderDetailArgs as E, type FlashBookingOptionsArgs as F, type GameCardCancelArgs as G, getMyMemberships as H, getMyPasses as I, getMyReservationDetail as J, getMyReservations as K, listSavedCards as L, type MembershipDetailArgs as M, previewEventOrderCancellation as N, type OrderCancelArgs as O, previewGameCardCancellation as P, previewPackageOrderCancellation as Q, type ReservationCancelArgs as R, type SavedCard as S, previewReservationCancellation as T, removeSavedCard as U, setDefaultCard as V, type CancelResult as a, type CardSetupResult as b, type ChangePasswordArgs as c, type CreateFlashSaleBookingArgs as d, type FlashSaleArgs as e, type FlashSaleBookingResult as f, type FlashSalesArgs as g, type MyGameCard as h, type ReservationDetailArgs as i, type SavedCardArgs as j, type SavedCardScope as k, type SavedCardsResult as l, cancelMyEventOrder as m, cancelMyGameCard as n, cancelMyPackageOrder as o, cancelMyReservation as p, changePassword as q, createCardSetup as r, createFlashSaleBooking as s, getFlashSale as t, getFlashSaleBookingOptions as u, getFlashSales as v, getMyCredits as w, getMyEventOrder as x, getMyEventOrders as y, getMyGameCards as z };
@@ -1,210 +0,0 @@
1
- import { g as BowlosClient } from './data-BJkB-tvM.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
- /** Tier savings already removed from baseSubtotalCents; do not subtract again. */
149
- tierDiscountCents: number;
150
- baseSubtotalCents: number;
151
- reservationFeeCents: number;
152
- reservationFeeLabel: string | null;
153
- taxAddedCents: number;
154
- taxIncludedCents: number;
155
- totalCents: number;
156
- };
157
- }
158
- /**
159
- * v0.22.1 — book a flash-sale reservation item at its SALE price (the flash
160
- * analog of `eventOfferSlug`: the server binds the item's sale price, holds
161
- * the inventory, and opens a checkout). Signed-in customers only. Pick the
162
- * date/time from `getFlashSaleBookingOptions` — the purpose-built option
163
- * list — never the regular booking calendar.
164
- */
165
- declare function createFlashSaleBooking(client: BowlosClient, args: CreateFlashSaleBookingArgs): Promise<FlashSaleBookingResult>;
166
- /** Saved cards belong to the active location's connected Stripe account. */
167
- type SavedCardScope = {
168
- brandId: string;
169
- centerId: string;
170
- };
171
- type SavedCardArgs = SavedCardScope & {
172
- paymentMethodId: string;
173
- };
174
- interface SavedCard {
175
- id: string;
176
- brand: string;
177
- last4: string;
178
- expMonth: number;
179
- expYear: number;
180
- isDefault: boolean;
181
- }
182
- interface SavedCardsResult {
183
- methods: SavedCard[];
184
- chargeable: boolean;
185
- }
186
- interface CardSetupResult {
187
- clientSecret: string;
188
- publishableKey: string;
189
- stripeAccount: string;
190
- stripeMode: "test" | "live";
191
- merchantDisplayName: string;
192
- }
193
- type ChangePasswordArgs = {
194
- currentPassword: string;
195
- newPassword: string;
196
- };
197
- declare function listSavedCards(client: BowlosClient, args: SavedCardScope): Promise<SavedCardsResult>;
198
- declare function createCardSetup(client: BowlosClient, args: SavedCardScope): Promise<CardSetupResult>;
199
- declare function removeSavedCard(client: BowlosClient, args: SavedCardArgs): Promise<{
200
- detached: boolean;
201
- }>;
202
- declare function setDefaultCard(client: BowlosClient, args: SavedCardArgs): Promise<{
203
- ok: boolean;
204
- }>;
205
- /** Success invalidates all sessions; discard local tokens and show sign-in. */
206
- declare function changePassword(client: BowlosClient, args: ChangePasswordArgs): Promise<{
207
- ok: true;
208
- }>;
209
-
210
- export { getMyLoyalty as A, type BrandScoped as B, type CancelPreview as C, getMyMembershipDetail as D, type EventOrderDetailArgs as E, type FlashBookingOptionsArgs as F, type GameCardCancelArgs as G, getMyMemberships as H, getMyPasses as I, getMyReservationDetail as J, getMyReservations as K, listSavedCards as L, type MembershipDetailArgs as M, previewEventOrderCancellation as N, type OrderCancelArgs as O, previewGameCardCancellation as P, previewPackageOrderCancellation as Q, type ReservationCancelArgs as R, type SavedCard as S, previewReservationCancellation as T, removeSavedCard as U, setDefaultCard as V, type CancelResult as a, type CardSetupResult as b, type ChangePasswordArgs as c, type CreateFlashSaleBookingArgs as d, type FlashSaleArgs as e, type FlashSaleBookingResult as f, type FlashSalesArgs as g, type MyGameCard as h, type ReservationDetailArgs as i, type SavedCardArgs as j, type SavedCardScope as k, type SavedCardsResult as l, cancelMyEventOrder as m, cancelMyGameCard as n, cancelMyPackageOrder as o, cancelMyReservation as p, changePassword as q, createCardSetup as r, createFlashSaleBooking as s, getFlashSale as t, getFlashSaleBookingOptions as u, getFlashSales as v, getMyCredits as w, getMyEventOrder as x, getMyEventOrders as y, getMyGameCards as z };