@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.
- package/AGENTS.md +306 -0
- package/HEADLESS.md +595 -10
- package/README.md +303 -2
- package/dist/account-B4sZBmPI.d.cts +1837 -0
- package/dist/account-B4sZBmPI.d.ts +1837 -0
- package/dist/booking-change-Dd4PVgd3.d.cts +487 -0
- package/dist/booking-change-DzYs9133.d.ts +487 -0
- package/dist/chunk-4JMGS4YB.js +808 -0
- package/dist/chunk-4JMGS4YB.js.map +1 -0
- package/dist/chunk-I37IJNYU.js +139 -0
- package/dist/chunk-I37IJNYU.js.map +1 -0
- package/dist/{chunk-Y3YSDO3H.js → chunk-T2E6AEC7.js} +150 -6
- package/dist/chunk-T2E6AEC7.js.map +1 -0
- package/dist/{chunk-3JSVEOKG.js → chunk-V4JRDYW4.js} +61 -6
- package/dist/chunk-V4JRDYW4.js.map +1 -0
- package/dist/{chunk-TEHRROVY.js → chunk-YQRTBGXU.js} +47 -192
- package/dist/chunk-YQRTBGXU.js.map +1 -0
- package/dist/cli.cjs +34 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/components.cjs +2059 -153
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +214 -7
- package/dist/components.d.ts +214 -7
- package/dist/components.js +1148 -7
- package/dist/components.js.map +1 -1
- package/dist/index.cjs +303 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -5
- package/dist/index.d.ts +56 -5
- package/dist/index.js +58 -3
- package/dist/index.js.map +1 -1
- package/dist/payments.cjs +225 -0
- package/dist/payments.cjs.map +1 -1
- package/dist/payments.d.cts +24 -2
- package/dist/payments.d.ts +24 -2
- package/dist/payments.js +4 -1
- package/dist/payments.js.map +1 -1
- package/dist/{react-CWAG4cW0.d.cts → react-C6NWC80d.d.cts} +2 -2
- package/dist/{react-0MyyTtE4.d.ts → react-DVdtpw5n.d.ts} +2 -2
- package/dist/react.cjs +870 -27
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +155 -12
- package/dist/react.d.ts +155 -12
- package/dist/react.js +72 -4
- package/dist/react.js.map +1 -1
- package/package.json +8 -2
- package/templates/center-site/README.md +5 -0
- package/templates/center-site/app/account/game-cards/page.tsx +17 -0
- package/templates/center-site/app/account/layout.tsx +16 -0
- package/templates/center-site/app/account/memberships/[id]/page.tsx +23 -0
- package/templates/center-site/app/account/memberships/page.tsx +33 -0
- package/templates/center-site/app/account/orders/page.tsx +17 -0
- package/templates/center-site/app/account/page.tsx +14 -0
- package/templates/center-site/app/account/payment-methods/page.tsx +23 -0
- package/templates/center-site/app/account/privacy/page.tsx +17 -0
- package/templates/center-site/app/account/profile/page.tsx +45 -0
- package/templates/center-site/app/account/reservations/[displayId]/change/page.tsx +46 -0
- package/templates/center-site/app/account/reservations/[displayId]/page.tsx +41 -0
- package/templates/center-site/app/account/reservations/page.tsx +35 -0
- package/templates/center-site/app/account/security/page.tsx +17 -0
- package/templates/center-site/app/events/[slug]/page.tsx +130 -0
- package/templates/center-site/app/events/page.tsx +57 -0
- package/templates/center-site/app/pay/[token]/page.tsx +53 -0
- package/templates/center-site/app/site-header.tsx +1 -0
- package/templates/center-site/lib/reservation.ts +14 -0
- package/templates/center-site/package.json +1 -1
- package/templates/center-site/tsconfig.json +7 -9
- package/dist/account-DfM2COaz.d.ts +0 -210
- package/dist/account-oCvYWmO9.d.cts +0 -210
- package/dist/catalog-DbhdwmnX.d.cts +0 -224
- package/dist/catalog-XkjgPI5C.d.ts +0 -224
- package/dist/chunk-3JSVEOKG.js.map +0 -1
- package/dist/chunk-TEHRROVY.js.map +0 -1
- package/dist/chunk-Y3YSDO3H.js.map +0 -1
- package/dist/data-BJkB-tvM.d.cts +0 -778
- package/dist/data-BJkB-tvM.d.ts +0 -778
|
@@ -0,0 +1,1837 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for the BowlOS Reservations SDK client.
|
|
3
|
+
*/
|
|
4
|
+
/** The customer session token pair returned by the auth relay. */
|
|
5
|
+
interface Tokens {
|
|
6
|
+
token: string;
|
|
7
|
+
refreshToken: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Where the client persists the customer's session. Defaults to in-memory.
|
|
11
|
+
* Browser apps pass `localStorageTokenStore()`; SSR / native pass their own.
|
|
12
|
+
*
|
|
13
|
+
* Sync for the web-first scaffold. Async stores (e.g. secure storage) are a
|
|
14
|
+
* follow-up — they will widen these to `| Promise<...>`.
|
|
15
|
+
*/
|
|
16
|
+
interface TokenStore {
|
|
17
|
+
get(): Tokens | null;
|
|
18
|
+
set(tokens: Tokens | null): void;
|
|
19
|
+
}
|
|
20
|
+
/** Minimal fetch surface the client needs — injectable for tests / SSR. */
|
|
21
|
+
type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
22
|
+
interface BowlosClientConfig {
|
|
23
|
+
/** Brand publishable API key, sent as `X-BowlOS-Api-Key` on every request. */
|
|
24
|
+
apiKey: string;
|
|
25
|
+
/**
|
|
26
|
+
* Gateway base URL, including the version prefix, e.g.
|
|
27
|
+
* `https://<deployment>.convex.site/api/public/v1`. A trailing slash is fine.
|
|
28
|
+
*/
|
|
29
|
+
baseUrl: string;
|
|
30
|
+
/** Session persistence. Defaults to an in-memory store (lost on reload). */
|
|
31
|
+
tokenStore?: TokenStore;
|
|
32
|
+
/** Override `fetch` (tests, SSR polyfills). Defaults to `globalThis.fetch`. */
|
|
33
|
+
fetch?: FetchLike;
|
|
34
|
+
}
|
|
35
|
+
/** The signed-in customer, as returned by `/auth/me`. Extra fields are passed
|
|
36
|
+
* through so the shape can grow server-side without an SDK release. */
|
|
37
|
+
interface Customer {
|
|
38
|
+
_id: string;
|
|
39
|
+
brandId: string;
|
|
40
|
+
displayId: string;
|
|
41
|
+
fullName: string;
|
|
42
|
+
email: string;
|
|
43
|
+
mobile?: string | null;
|
|
44
|
+
marketingOptIn?: boolean;
|
|
45
|
+
preferredCenterId?: string | null;
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
}
|
|
48
|
+
/** Result of `/auth/probe` — the three-state session bootstrap. */
|
|
49
|
+
type AuthState = "unauthenticated" | "authed_no_customer" | "linked";
|
|
50
|
+
/** Result of `GET /ping` — a cheap health + key-validity probe. `mode` reports
|
|
51
|
+
* whether this is a `live` or `test` key; `authenticated` is true when a valid
|
|
52
|
+
* customer bearer happened to be attached. */
|
|
53
|
+
interface PingResult {
|
|
54
|
+
service: string;
|
|
55
|
+
version: string;
|
|
56
|
+
brandId: string;
|
|
57
|
+
mode: "live" | "test";
|
|
58
|
+
authenticated: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** Profile fields collected when linking a freshly-signed-up auth user to a
|
|
61
|
+
* customer record (the second half of sign-up). */
|
|
62
|
+
interface LinkProfile {
|
|
63
|
+
fullName: string;
|
|
64
|
+
email: string;
|
|
65
|
+
mobile?: string;
|
|
66
|
+
marketingOptIn?: boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* BowlosClient — the framework-agnostic core of the Reservations SDK.
|
|
71
|
+
*
|
|
72
|
+
* It is a thin, typed client for the public API gateway (`/api/public/v1/*`):
|
|
73
|
+
* - sends the brand API key (`X-BowlOS-Api-Key`) on every request,
|
|
74
|
+
* - attaches the customer bearer token on authenticated calls,
|
|
75
|
+
* - parses the `{ ok, data | error }` envelope and throws a typed
|
|
76
|
+
* `BowlosApiError` on failure,
|
|
77
|
+
* - owns the customer session: sign-in / sign-up / link / sign-out, plus
|
|
78
|
+
* a transparent refresh-and-retry-once when a session has expired.
|
|
79
|
+
*
|
|
80
|
+
* The React layer (hooks + components) wraps this; nothing here imports React.
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
/** A `TokenStore` backed by `localStorage` for browser apps. No-ops under SSR
|
|
84
|
+
* / environments without `localStorage`. */
|
|
85
|
+
declare function localStorageTokenStore(storageKey?: string): TokenStore;
|
|
86
|
+
declare class BowlosClient {
|
|
87
|
+
private readonly apiKey;
|
|
88
|
+
private readonly baseUrl;
|
|
89
|
+
private readonly store;
|
|
90
|
+
private readonly fetchFn;
|
|
91
|
+
constructor(config: BowlosClientConfig);
|
|
92
|
+
/** Is there a stored session right now? (Does not validate it server-side.) */
|
|
93
|
+
isAuthenticated(): boolean;
|
|
94
|
+
/** The current token pair, if any (rarely needed directly). */
|
|
95
|
+
getTokens(): Tokens | null;
|
|
96
|
+
/**
|
|
97
|
+
* Health + key-validity probe (`GET /ping`). Resolves with the gateway's
|
|
98
|
+
* service info when the API key is accepted; throws a `BowlosApiError` whose
|
|
99
|
+
* `.code` distinguishes the failure (`NETWORK_ERROR`, `API_KEY_INVALID`,
|
|
100
|
+
* `ORIGIN_NOT_ALLOWED`, `RATE_LIMITED`, …). Cheap enough to call on boot, and
|
|
101
|
+
* the basis for `runDoctor`.
|
|
102
|
+
*/
|
|
103
|
+
ping(): Promise<PingResult>;
|
|
104
|
+
private request;
|
|
105
|
+
/**
|
|
106
|
+
* Call a gateway route by name (`POST /api/public/v1/<name>`), returning the
|
|
107
|
+
* unwrapped `data`. Set `{ auth: true }` to attach the bearer token and
|
|
108
|
+
* enable refresh-and-retry on an expired session.
|
|
109
|
+
*/
|
|
110
|
+
call<T = unknown>(name: string, args?: Record<string, unknown>, opts?: {
|
|
111
|
+
auth?: boolean;
|
|
112
|
+
method?: "GET" | "POST";
|
|
113
|
+
}): Promise<T>;
|
|
114
|
+
private callInternal;
|
|
115
|
+
/** Exchange the stored refresh token for a fresh pair. Clears the session if
|
|
116
|
+
* the refresh token is itself invalid/expired. Returns success. */
|
|
117
|
+
private tryRefresh;
|
|
118
|
+
/** Sign an existing customer in; stores the session on success. */
|
|
119
|
+
signIn(email: string, password: string): Promise<Tokens>;
|
|
120
|
+
/**
|
|
121
|
+
* Atomic sign-up (preferred): create the login AND the brand-scoped customer
|
|
122
|
+
* profile in ONE server call, then store the session. Use this instead of
|
|
123
|
+
* `signUp()` + `link()` — the two-step path can strand a login with no
|
|
124
|
+
* customer profile if `link()` is missed or races the new session.
|
|
125
|
+
*/
|
|
126
|
+
register(email: string, password: string, profile: Omit<LinkProfile, "email">): Promise<Tokens>;
|
|
127
|
+
/** Low-level: create a login only (no customer profile). Prefer `register()`;
|
|
128
|
+
* if you use this you MUST follow with `link()` or the customer is orphaned. */
|
|
129
|
+
signUp(email: string, password: string): Promise<Tokens>;
|
|
130
|
+
/**
|
|
131
|
+
* Forgot-password step 1: email a reset code to the address (if it has an
|
|
132
|
+
* account at this center). Resolves regardless of whether the email exists —
|
|
133
|
+
* the server never reveals that, to prevent account enumeration. No session
|
|
134
|
+
* needed.
|
|
135
|
+
*/
|
|
136
|
+
requestPasswordReset(email: string): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Forgot-password step 2: verify the emailed code + set a new password. On
|
|
139
|
+
* success the customer is signed in (the session is stored), so the UI can
|
|
140
|
+
* continue straight into the funnel. Throws `INVALID_RESET` on a bad/expired
|
|
141
|
+
* code and `PASSWORD_TOO_WEAK` if the new password fails the policy.
|
|
142
|
+
*/
|
|
143
|
+
resetPassword(email: string, code: string, newPassword: string): Promise<Tokens>;
|
|
144
|
+
/** Link the signed-in auth user to a customer profile at the brand. */
|
|
145
|
+
link(profile: LinkProfile): Promise<unknown>;
|
|
146
|
+
/** End the session (best-effort server call; always clears locally). */
|
|
147
|
+
signOut(): Promise<void>;
|
|
148
|
+
/** Session bootstrap: unauthenticated / authed-no-customer / linked.
|
|
149
|
+
* GET — matches the gateway's `GET /auth/probe` route. */
|
|
150
|
+
probe(): Promise<AuthState>;
|
|
151
|
+
/** The signed-in customer's profile, or null.
|
|
152
|
+
* GET — matches the gateway's `GET /auth/me` route. */
|
|
153
|
+
me(): Promise<Customer | null>;
|
|
154
|
+
}
|
|
155
|
+
/** Create a configured client. */
|
|
156
|
+
declare function createBowlosClient(config: BowlosClientConfig): BowlosClient;
|
|
157
|
+
|
|
158
|
+
/** Inputs for `checkAvailability`. Times are minutes-of-day in the Center's tz. */
|
|
159
|
+
type AvailabilityArgs = {
|
|
160
|
+
productId: string;
|
|
161
|
+
dateISO: string;
|
|
162
|
+
startMinuteOfDay: number;
|
|
163
|
+
endMinuteOfDay: number;
|
|
164
|
+
};
|
|
165
|
+
interface AvailabilityResult {
|
|
166
|
+
totalUnits: number;
|
|
167
|
+
busyUnitIds: string[];
|
|
168
|
+
/** Operator-configured noun for a bookable unit (a lane/room/bay), both
|
|
169
|
+
* forms so you pick by count ("1 lane" vs "2 lanes"). Label it
|
|
170
|
+
* "available"/"open", never "free". Optional — older gateways omit it;
|
|
171
|
+
* fall back to "lane"/"lanes". Added v0.35.0. */
|
|
172
|
+
unitNoun?: {
|
|
173
|
+
singular: string;
|
|
174
|
+
plural: string;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
type PricingMode = "per_unit_per_hour" | "per_person_per_hour" | "per_game";
|
|
178
|
+
type BookingAddonSelection = {
|
|
179
|
+
addonId: string;
|
|
180
|
+
quantity: number;
|
|
181
|
+
};
|
|
182
|
+
/** A bookable add-on for a product (shoe rental, upgrades…). `rateMode` is how
|
|
183
|
+
* it prices — `per_person` (× bowlers), `per_unit` (× lanes), or `flat` (once).
|
|
184
|
+
* `defaultQuantityRule: "one_per_guest"` hints the natural quantity is the
|
|
185
|
+
* party size; `"manual"` means the customer picks. */
|
|
186
|
+
interface PublicAddon {
|
|
187
|
+
id: string;
|
|
188
|
+
displayId: string;
|
|
189
|
+
name: string;
|
|
190
|
+
description: string | null;
|
|
191
|
+
priceCents: number;
|
|
192
|
+
rateMode: "per_person" | "per_unit" | "flat";
|
|
193
|
+
defaultQuantityRule: "one_per_guest" | "manual";
|
|
194
|
+
}
|
|
195
|
+
/** Inputs for `bookingPreview` (the authoritative price quote). */
|
|
196
|
+
type BookingPreviewArgs = {
|
|
197
|
+
centerId: string;
|
|
198
|
+
productId: string;
|
|
199
|
+
dateISO: string;
|
|
200
|
+
startMinuteOfDay: number;
|
|
201
|
+
endMinuteOfDay: number;
|
|
202
|
+
mode: PricingMode;
|
|
203
|
+
units?: number;
|
|
204
|
+
persons?: number;
|
|
205
|
+
games?: number;
|
|
206
|
+
addons?: BookingAddonSelection[];
|
|
207
|
+
shareToken?: string;
|
|
208
|
+
subtypeId?: string;
|
|
209
|
+
/** Reservation-mode event offer slug. Binds preview to that offer's event
|
|
210
|
+
* price plan, tax override, and Center fee override/inheritance. */
|
|
211
|
+
eventOfferSlug?: string;
|
|
212
|
+
};
|
|
213
|
+
/** One add-on line on a plan quote. A plan-included add-on (e.g. shoes on a
|
|
214
|
+
* "Thursday Special") is already dropped from this list — it won't appear. */
|
|
215
|
+
interface BookingQuoteAddonLine {
|
|
216
|
+
addonId: string;
|
|
217
|
+
addonName: string;
|
|
218
|
+
quantity: number;
|
|
219
|
+
unitPriceCents: number;
|
|
220
|
+
lineSubtotalCents: number;
|
|
221
|
+
rateMode?: string;
|
|
222
|
+
}
|
|
223
|
+
/** Per-plan price breakdown. Render THESE fields to itemize the order — do not
|
|
224
|
+
* reconstruct a base by subtracting tax/fee/add-ons from the total, and do not
|
|
225
|
+
* recompute the discount client-side. `preDiscountTotalCents` is the original
|
|
226
|
+
* (base + add-ons, before discount); `appliedDiscount` is present only when a
|
|
227
|
+
* discount applied; `finalCents` is the subtotal after discount, BEFORE tax +
|
|
228
|
+
* fee. The all-in charge is `totalCentsPerPlan[samePlanId].totalCents`. */
|
|
229
|
+
interface BookingQuotePlan {
|
|
230
|
+
pricePlanId: string;
|
|
231
|
+
pricePlanName: string;
|
|
232
|
+
pricePlanDescription?: string;
|
|
233
|
+
baseSubtotalCents: number;
|
|
234
|
+
addonSubtotalCents: number;
|
|
235
|
+
addonLineItems: BookingQuoteAddonLine[];
|
|
236
|
+
preDiscountTotalCents: number;
|
|
237
|
+
/** Present only when a discount applied. `.label` is display text
|
|
238
|
+
* ("Online booking discount"); `.amountCents` is the amount to subtract. */
|
|
239
|
+
appliedDiscount?: {
|
|
240
|
+
amountCents: number;
|
|
241
|
+
label: string;
|
|
242
|
+
source: string;
|
|
243
|
+
};
|
|
244
|
+
/** Subtotal after discount, before tax + fee. */
|
|
245
|
+
finalCents: number;
|
|
246
|
+
/** True when this plan/special bundles shoes — hide the shoe add-on selector
|
|
247
|
+
* and show a "Shoes included" line instead of a priced shoe row. */
|
|
248
|
+
shoesIncluded?: boolean;
|
|
249
|
+
}
|
|
250
|
+
/** The price quote. Headline fields are typed; the engine's full breakdown
|
|
251
|
+
* (line items, discounts, tax, credit) is passed through. Join `plans`,
|
|
252
|
+
* `taxLinesPerPlan`, and `totalCentsPerPlan` by `pricePlanId` — never index
|
|
253
|
+
* `[0]` blindly when more than one plan can be returned. */
|
|
254
|
+
interface BookingQuote {
|
|
255
|
+
reservationFee: Record<string, unknown> | null;
|
|
256
|
+
/** Per-plan breakdown (name, original price, applied discount, line items).
|
|
257
|
+
* Optional for back-compat with older cores that didn't type it. */
|
|
258
|
+
plans?: BookingQuotePlan[];
|
|
259
|
+
totalCentsPerPlan: Array<{
|
|
260
|
+
pricePlanId: string;
|
|
261
|
+
totalCents: number;
|
|
262
|
+
}>;
|
|
263
|
+
taxLinesPerPlan?: Array<{
|
|
264
|
+
pricePlanId: string;
|
|
265
|
+
taxLines: Array<{
|
|
266
|
+
rateId: string;
|
|
267
|
+
label: string;
|
|
268
|
+
rateBasisPoints: number;
|
|
269
|
+
mode: "added" | "included";
|
|
270
|
+
taxableBaseCents: number;
|
|
271
|
+
taxCents: number;
|
|
272
|
+
}>;
|
|
273
|
+
taxTotalCents: number;
|
|
274
|
+
}>;
|
|
275
|
+
/** Operator-configured noun for this booking's count, resolved by pricing
|
|
276
|
+
* mode (unit → lane/room, per-person → bowler/guest, per-game → game).
|
|
277
|
+
* Both forms so you render "{count} {singular|plural}" — e.g. "1 room",
|
|
278
|
+
* "2 rooms" — instead of hardcoding "lane"/"lanes". Optional — older
|
|
279
|
+
* gateways omit it; fall back to a sensible default. Added v0.35.0. */
|
|
280
|
+
unitNoun?: {
|
|
281
|
+
singular: string;
|
|
282
|
+
plural: string;
|
|
283
|
+
};
|
|
284
|
+
[key: string]: unknown;
|
|
285
|
+
}
|
|
286
|
+
/** Available (unoccupied) units for a product/date/time window (anonymous). */
|
|
287
|
+
declare function checkAvailability(client: BowlosClient, args: AvailabilityArgs): Promise<AvailabilityResult>;
|
|
288
|
+
/** Authoritative price quote for the chosen inputs. Anonymous by default
|
|
289
|
+
* (the center's standard online price). Pass `{ auth: true }` when the
|
|
290
|
+
* customer has a session so the quote includes member rate + account
|
|
291
|
+
* credit — headless sites must opt in, since the core doesn't track
|
|
292
|
+
* session state. (The `<BookingFlow>` reference + `useBookingPreview`
|
|
293
|
+
* hook do this automatically off `useAccount`.) */
|
|
294
|
+
declare function bookingPreview(client: BowlosClient, args: BookingPreviewArgs, opts?: {
|
|
295
|
+
auth?: boolean;
|
|
296
|
+
}): Promise<BookingQuote>;
|
|
297
|
+
/** Add-ons available for a product (shoe rental, upgrades…). Anonymous-callable;
|
|
298
|
+
* feed the customer's picks back as `addons` on the preview + the booking. */
|
|
299
|
+
declare function listAddons(client: BowlosClient, args: {
|
|
300
|
+
productId: string;
|
|
301
|
+
}): Promise<PublicAddon[]>;
|
|
302
|
+
/** Inputs for `availableStartTimes`. */
|
|
303
|
+
type StartTimesArgs = {
|
|
304
|
+
productId: string;
|
|
305
|
+
dateISO: string;
|
|
306
|
+
/** Booking length, to leave room before close. Default 60 on the server. */
|
|
307
|
+
durationMinutes?: number;
|
|
308
|
+
/** Grid step in minutes. Default 30 on the server. */
|
|
309
|
+
stepMinutes?: number;
|
|
310
|
+
mode?: PricingMode;
|
|
311
|
+
};
|
|
312
|
+
/** The bookable start times (minute-of-day, ascending) for a product on a date:
|
|
313
|
+
* within operating hours, past the booking buffer, and backed by a real price
|
|
314
|
+
* plan (same pricing engine the quote uses). Anonymous-callable. */
|
|
315
|
+
declare function listStartTimes(client: BowlosClient, args: StartTimesArgs): Promise<number[]>;
|
|
316
|
+
/** Convenience: available units = total minus the busy set (never negative).
|
|
317
|
+
* This is an availability count of UNOCCUPIED units — it is NOT a
|
|
318
|
+
* complimentary/price signal. Never render it as "free" next to a price
|
|
319
|
+
* (e.g. "2 lanes free"); label it "available"/"open". */
|
|
320
|
+
declare function availableUnitCount(availability: AvailabilityResult): number;
|
|
321
|
+
/** Customer identity for a booking (collected in the booking form; the server
|
|
322
|
+
* links/creates the customer per the booking-flow-only signup rule). */
|
|
323
|
+
type BookingCustomer = {
|
|
324
|
+
fullName: string;
|
|
325
|
+
email: string;
|
|
326
|
+
mobile?: string;
|
|
327
|
+
marketingOptIn: boolean;
|
|
328
|
+
};
|
|
329
|
+
/** Inputs for `createAnonymousBooking` — places the inventory hold. */
|
|
330
|
+
type CreateBookingArgs = {
|
|
331
|
+
centerId: string;
|
|
332
|
+
productId: string;
|
|
333
|
+
dateISO: string;
|
|
334
|
+
startMinuteOfDay: number;
|
|
335
|
+
endMinuteOfDay: number;
|
|
336
|
+
mode: PricingMode;
|
|
337
|
+
units?: number;
|
|
338
|
+
persons?: number;
|
|
339
|
+
games?: number;
|
|
340
|
+
addons?: BookingAddonSelection[];
|
|
341
|
+
customer: BookingCustomer;
|
|
342
|
+
/** Apply account credit (requires a signed-in customer). */
|
|
343
|
+
applyCredit?: boolean;
|
|
344
|
+
/** Idempotency key for the create. The SDK generates one if omitted. */
|
|
345
|
+
idempotencyKey?: string;
|
|
346
|
+
shareToken?: string;
|
|
347
|
+
subtypeId?: string;
|
|
348
|
+
/** Reservation-mode event offer slug. Must match the preview slug. */
|
|
349
|
+
eventOfferSlug?: string;
|
|
350
|
+
};
|
|
351
|
+
/** Result of placing a booking. The hold→pay path returns `checkoutRefToken`
|
|
352
|
+
* with `requiresPayment: true`; a credit-covered / $0 booking returns the
|
|
353
|
+
* materialized `reservationId` + `reservationDisplayId` with
|
|
354
|
+
* `requiresPayment: false`. Headline fields typed; the rest passes through. */
|
|
355
|
+
interface BookingHold {
|
|
356
|
+
checkoutRefToken?: string;
|
|
357
|
+
reservationId?: string | null;
|
|
358
|
+
reservationDisplayId?: string | null;
|
|
359
|
+
requiresPayment: boolean;
|
|
360
|
+
finalCents: number;
|
|
361
|
+
appliedCreditCents: number;
|
|
362
|
+
paidCents?: number;
|
|
363
|
+
holdExpiresAt?: number;
|
|
364
|
+
replayed?: boolean;
|
|
365
|
+
[key: string]: unknown;
|
|
366
|
+
}
|
|
367
|
+
type CheckoutStatus = "not_found" | "pending_payment" | "paid_materialized" | "expired" | "payment_failed_retryable" | "abandoned";
|
|
368
|
+
interface CheckoutStatusResult {
|
|
369
|
+
status: CheckoutStatus;
|
|
370
|
+
reservationDisplayId: string | null;
|
|
371
|
+
reservationId: string | null;
|
|
372
|
+
}
|
|
373
|
+
/** Stripe (Connect) PaymentIntent data for the UI layer to render Elements.
|
|
374
|
+
* The SDK does NOT load Stripe.js — initialize it with `connectedAccountId`
|
|
375
|
+
* (the operator's connected account) + `clientSecret`. */
|
|
376
|
+
interface PaymentIntentInfo {
|
|
377
|
+
paymentIntentId: string;
|
|
378
|
+
clientSecret: string;
|
|
379
|
+
amountCents: number;
|
|
380
|
+
customerId: string;
|
|
381
|
+
ephemeralKey: string;
|
|
382
|
+
customerSessionClientSecret: string;
|
|
383
|
+
connectedAccountId: string;
|
|
384
|
+
/** Full Test Mode (2026-06-23): the Stripe environment this PaymentIntent was
|
|
385
|
+
* created in. Load Stripe.js with the matching publishable key
|
|
386
|
+
* (`pk_test_…` for "test", `pk_live_…` for "live") scoped to
|
|
387
|
+
* `connectedAccountId`. `<BowlosPaymentForm>` picks it for you when you pass
|
|
388
|
+
* `testPublishableKey`. Absent on older gateway responses → treat as "live". */
|
|
389
|
+
stripeMode?: "test" | "live";
|
|
390
|
+
}
|
|
391
|
+
/** The minimal shape `<BowlosPaymentForm>` needs to confirm a payment on the
|
|
392
|
+
* operator's connected account. `PaymentIntentInfo` (booking) and the buy-flow
|
|
393
|
+
* intents both satisfy it; a recurring membership passes the subscription's
|
|
394
|
+
* first-invoice `clientSecret` here too. */
|
|
395
|
+
interface ConnectedPaymentInput {
|
|
396
|
+
clientSecret: string;
|
|
397
|
+
connectedAccountId: string;
|
|
398
|
+
customerSessionClientSecret?: string;
|
|
399
|
+
/** Full Test Mode (2026-06-23): the PI's Stripe environment. `<BowlosPaymentForm>`
|
|
400
|
+
* loads the matching publishable key (test vs live) when `testPublishableKey`
|
|
401
|
+
* is supplied. Absent → "live". */
|
|
402
|
+
stripeMode?: "test" | "live";
|
|
403
|
+
}
|
|
404
|
+
/** Inputs for a game-pass purchase. The SDK generates an idempotency key if omitted. */
|
|
405
|
+
type GameCardPurchaseArgs = {
|
|
406
|
+
templateId: string;
|
|
407
|
+
idempotencyKey?: string;
|
|
408
|
+
shareToken?: string;
|
|
409
|
+
/** v0.32.0: when set, the buy redeems this flash-sale item at its sale price
|
|
410
|
+
* (the flash sale must be Live; the server validates the item matches). */
|
|
411
|
+
flashSaleItemId?: string;
|
|
412
|
+
};
|
|
413
|
+
/** The connected-account PaymentIntent for a game-pass purchase. Confirm it with
|
|
414
|
+
* `<BowlosPaymentForm>` — it carries `connectedAccountId` + the customer session.
|
|
415
|
+
* Poll `getGameCardStatus(refToken)` for materialization. */
|
|
416
|
+
interface GameCardPurchaseIntent {
|
|
417
|
+
paymentIntentId: string;
|
|
418
|
+
clientSecret: string;
|
|
419
|
+
amountCents: number;
|
|
420
|
+
refToken: string | null;
|
|
421
|
+
cardId: string;
|
|
422
|
+
customerSessionClientSecret: string;
|
|
423
|
+
connectedAccountId: string;
|
|
424
|
+
/** Full Test Mode (2026-06-23): the Stripe environment this PaymentIntent was
|
|
425
|
+
* created in. Load Stripe.js with the matching publishable key
|
|
426
|
+
* (`pk_test_…` for "test", `pk_live_…` for "live") scoped to
|
|
427
|
+
* `connectedAccountId`. `<BowlosPaymentForm>` picks it for you when you pass
|
|
428
|
+
* `testPublishableKey`. Absent on older gateway responses → treat as "live". */
|
|
429
|
+
stripeMode?: "test" | "live";
|
|
430
|
+
}
|
|
431
|
+
/** Buy a game pass — mints the connected-account PaymentIntent (requires a
|
|
432
|
+
* signed-in customer; the charge lands on the operator's connected account). */
|
|
433
|
+
declare function createGameCardOrder(client: BowlosClient, args: GameCardPurchaseArgs): Promise<GameCardPurchaseIntent>;
|
|
434
|
+
type GameCardCheckoutStatus = "not_found" | "pending_payment" | "paid_materialized" | "expired" | "payment_failed_retryable" | "abandoned";
|
|
435
|
+
interface GameCardStatusResult {
|
|
436
|
+
status: GameCardCheckoutStatus;
|
|
437
|
+
gameCardId: string | null;
|
|
438
|
+
}
|
|
439
|
+
/** Poll a game-pass purchase to materialization (by the create's `refToken`). */
|
|
440
|
+
declare function getGameCardStatus(client: BowlosClient, refToken: string): Promise<GameCardStatusResult>;
|
|
441
|
+
/** Inputs for an itemized game-pass quote. A pass has no config (no date/qty),
|
|
442
|
+
* so it's just the template (+ an optional share token for a private pass).
|
|
443
|
+
* The selling Center is resolved server-side from the customer's home Center. */
|
|
444
|
+
type GameCardPreviewArgs = {
|
|
445
|
+
templateId: string;
|
|
446
|
+
shareToken?: string;
|
|
447
|
+
/** v0.32.0: reflect the flash sale price in the Review (same as the buy). */
|
|
448
|
+
flashSaleItemId?: string;
|
|
449
|
+
};
|
|
450
|
+
/** Server-computed itemized quote for a game-pass purchase — the base price,
|
|
451
|
+
* tax lines, the selling Center's booking fee, and the authoritative grand
|
|
452
|
+
* total. Drives the headless "Review" step. Computed by the SAME engine as the
|
|
453
|
+
* PaymentIntent, so it never diverges from what the customer is charged. */
|
|
454
|
+
interface GameCardPreviewResult {
|
|
455
|
+
tierDiscountCents?: number;
|
|
456
|
+
tierDiscountLabel?: string;
|
|
457
|
+
subtotalCents: number;
|
|
458
|
+
taxLines: {
|
|
459
|
+
rateId: string;
|
|
460
|
+
label: string;
|
|
461
|
+
rateBasisPoints: number;
|
|
462
|
+
mode: "added" | "included";
|
|
463
|
+
taxableBaseCents: number;
|
|
464
|
+
taxCents: number;
|
|
465
|
+
}[];
|
|
466
|
+
taxTotalCents: number;
|
|
467
|
+
reservationFeeCents: number | null;
|
|
468
|
+
reservationFeeLabel: string | null;
|
|
469
|
+
grandTotalCents: number;
|
|
470
|
+
}
|
|
471
|
+
/** Itemized quote for a game-pass purchase WITHOUT creating a PaymentIntent —
|
|
472
|
+
* feeds the Review step. Requires a signed-in customer (so tax exemptions +
|
|
473
|
+
* the resolved home Center match the eventual charge). */
|
|
474
|
+
declare function previewGameCard(client: BowlosClient, args: GameCardPreviewArgs): Promise<GameCardPreviewResult>;
|
|
475
|
+
type EventTicketPreviewArgs = {
|
|
476
|
+
eventOfferId: string;
|
|
477
|
+
quantity: number;
|
|
478
|
+
/** v0.32.0: reflect the flash sale price in the Review (same as the buy). */
|
|
479
|
+
flashSaleItemId?: string;
|
|
480
|
+
};
|
|
481
|
+
interface EventTicketPreviewResult {
|
|
482
|
+
tierDiscountCents?: number;
|
|
483
|
+
tierDiscountLabel?: string;
|
|
484
|
+
eventName: string;
|
|
485
|
+
eventDate: string;
|
|
486
|
+
quantity: number;
|
|
487
|
+
unitPriceCents: number;
|
|
488
|
+
subtotalCents: number;
|
|
489
|
+
taxLines: {
|
|
490
|
+
rateId: string;
|
|
491
|
+
label: string;
|
|
492
|
+
rateBasisPoints: number;
|
|
493
|
+
mode: "added" | "included";
|
|
494
|
+
taxableBaseCents: number;
|
|
495
|
+
taxCents: number;
|
|
496
|
+
}[];
|
|
497
|
+
taxTotalCents: number;
|
|
498
|
+
reservationFeeCents: number | null;
|
|
499
|
+
reservationFeeLabel: string | null;
|
|
500
|
+
grandTotalCents: number;
|
|
501
|
+
}
|
|
502
|
+
/** Itemized quote for a ticket-mode event offer WITHOUT creating a
|
|
503
|
+
* PaymentIntent. Requires a signed-in customer so tax exemptions match the
|
|
504
|
+
* eventual charge. */
|
|
505
|
+
declare function previewEventTicket(client: BowlosClient, args: EventTicketPreviewArgs): Promise<EventTicketPreviewResult>;
|
|
506
|
+
type EventTicketPurchaseArgs = {
|
|
507
|
+
eventOfferId: string;
|
|
508
|
+
quantity: number;
|
|
509
|
+
idempotencyKey?: string;
|
|
510
|
+
/** v0.32.0: redeem this flash-sale item at its sale price. */
|
|
511
|
+
flashSaleItemId?: string;
|
|
512
|
+
};
|
|
513
|
+
/** The connected-account PaymentIntent for a ticket-mode event purchase.
|
|
514
|
+
* Confirm it with `<BowlosPaymentForm>` — it carries `connectedAccountId` +
|
|
515
|
+
* the customer session. After payment, read the receipt with `getMyEventOrder`. */
|
|
516
|
+
interface EventTicketPurchaseIntent {
|
|
517
|
+
paymentIntentId: string;
|
|
518
|
+
clientSecret: string;
|
|
519
|
+
amountCents: number;
|
|
520
|
+
orderId: string;
|
|
521
|
+
customerSessionClientSecret: string;
|
|
522
|
+
connectedAccountId: string;
|
|
523
|
+
/** Full Test Mode (2026-06-23): the Stripe environment this PaymentIntent was
|
|
524
|
+
* created in. Load Stripe.js with the matching publishable key
|
|
525
|
+
* (`pk_test_…` for "test", `pk_live_…` for "live") scoped to
|
|
526
|
+
* `connectedAccountId`. `<BowlosPaymentForm>` picks it for you when you pass
|
|
527
|
+
* `testPublishableKey`. Absent on older gateway responses → treat as "live". */
|
|
528
|
+
stripeMode?: "test" | "live";
|
|
529
|
+
}
|
|
530
|
+
/** Buy tickets for a ticket-mode event offer — mints the connected-account
|
|
531
|
+
* PaymentIntent. Requires a signed-in customer so taxes and account ownership
|
|
532
|
+
* match the preview. */
|
|
533
|
+
declare function createEventTicketOrder(client: BowlosClient, args: EventTicketPurchaseArgs): Promise<EventTicketPurchaseIntent>;
|
|
534
|
+
type EventTicketCheckoutStatus = "not_found" | "pending_payment" | "paid" | "cancelled" | "refunded";
|
|
535
|
+
interface EventTicketStatusResult {
|
|
536
|
+
status: EventTicketCheckoutStatus;
|
|
537
|
+
orderId: string | null;
|
|
538
|
+
}
|
|
539
|
+
/** Poll a ticket-mode event purchase by the order id returned from create. */
|
|
540
|
+
declare function getEventTicketStatus(client: BowlosClient, orderId: string): Promise<EventTicketStatusResult>;
|
|
541
|
+
/** Inputs for a package purchase. The SDK generates an idempotency key if omitted.
|
|
542
|
+
* `scheduledDate` is `YYYY-MM-DD` in the Center's timezone; `scheduledStartMinute`
|
|
543
|
+
* is minutes-from-midnight (e.g. 1050 = 5:30 PM) and MUST be one of the package's
|
|
544
|
+
* bookable start times — see HEADLESS.md → "Buying a package" for computing them. */
|
|
545
|
+
type PackagePurchaseArgs = {
|
|
546
|
+
packageId: string;
|
|
547
|
+
centerId: string;
|
|
548
|
+
quantity: number;
|
|
549
|
+
optionalAddons?: {
|
|
550
|
+
addonId: string;
|
|
551
|
+
quantity: number;
|
|
552
|
+
}[];
|
|
553
|
+
scheduledDate: string;
|
|
554
|
+
scheduledStartMinute: number;
|
|
555
|
+
idempotencyKey?: string;
|
|
556
|
+
shareToken?: string;
|
|
557
|
+
/** v0.32.0: redeem this flash-sale item at its sale price. */
|
|
558
|
+
flashSaleItemId?: string;
|
|
559
|
+
};
|
|
560
|
+
/** The connected-account PaymentIntent for a package purchase. Confirm it with
|
|
561
|
+
* `<BowlosPaymentForm>` — it carries `connectedAccountId` + the customer session.
|
|
562
|
+
* Poll `getPackageStatus(orderId)` for materialization. */
|
|
563
|
+
interface PackagePurchaseIntent {
|
|
564
|
+
paymentIntentId: string;
|
|
565
|
+
clientSecret: string;
|
|
566
|
+
amountCents: number;
|
|
567
|
+
orderId: string;
|
|
568
|
+
customerSessionClientSecret: string;
|
|
569
|
+
connectedAccountId: string;
|
|
570
|
+
/** Group id for the inventory hold the order created — subscribe with
|
|
571
|
+
* `getMyHoldGroup` to render the checkout countdown if you choose to. */
|
|
572
|
+
inventoryHoldGroupId?: string;
|
|
573
|
+
}
|
|
574
|
+
/** Buy a package — mints the connected-account PaymentIntent (requires a
|
|
575
|
+
* signed-in customer; the charge lands on the operator's connected account). */
|
|
576
|
+
declare function createPackageOrder(client: BowlosClient, args: PackagePurchaseArgs): Promise<PackagePurchaseIntent>;
|
|
577
|
+
type PackageCheckoutStatus = "not_found" | "pending_payment" | "paid" | "cancelled" | "refunded";
|
|
578
|
+
interface PackageStatusResult {
|
|
579
|
+
status: PackageCheckoutStatus;
|
|
580
|
+
orderId: string | null;
|
|
581
|
+
}
|
|
582
|
+
/** Poll a package purchase to materialization (by the create's `orderId`). */
|
|
583
|
+
declare function getPackageStatus(client: BowlosClient, orderId: string): Promise<PackageStatusResult>;
|
|
584
|
+
/** Inputs for an itemized package quote — the buy config minus the schedule
|
|
585
|
+
* (price doesn't depend on date/time; the schedule only affects the eventual
|
|
586
|
+
* create's slot validation). */
|
|
587
|
+
type PackagePreviewArgs = {
|
|
588
|
+
packageId: string;
|
|
589
|
+
centerId: string;
|
|
590
|
+
quantity: number;
|
|
591
|
+
optionalAddons?: {
|
|
592
|
+
addonId: string;
|
|
593
|
+
quantity: number;
|
|
594
|
+
}[];
|
|
595
|
+
shareToken?: string;
|
|
596
|
+
/** v0.32.0: reflect the flash sale price in the Review (same as the buy). */
|
|
597
|
+
flashSaleItemId?: string;
|
|
598
|
+
};
|
|
599
|
+
/** Server-computed itemized quote for a package order — base, optional add-ons,
|
|
600
|
+
* tax lines, the selling Center's booking fee, and the authoritative grand
|
|
601
|
+
* total. Drives the headless "Review" step. Computed by the SAME engine as the
|
|
602
|
+
* PaymentIntent, so it never diverges from what the customer is charged. */
|
|
603
|
+
interface PackagePreviewResult {
|
|
604
|
+
tierDiscountCents?: number;
|
|
605
|
+
tierDiscountLabel?: string;
|
|
606
|
+
baseTotalCents: number;
|
|
607
|
+
addons: {
|
|
608
|
+
addonId: string;
|
|
609
|
+
name: string;
|
|
610
|
+
quantity: number;
|
|
611
|
+
lineCents: number;
|
|
612
|
+
}[];
|
|
613
|
+
addonsTotalCents: number;
|
|
614
|
+
taxLines: {
|
|
615
|
+
rateId: string;
|
|
616
|
+
label: string;
|
|
617
|
+
rateBasisPoints: number;
|
|
618
|
+
mode: "added" | "included";
|
|
619
|
+
taxableBaseCents: number;
|
|
620
|
+
taxCents: number;
|
|
621
|
+
}[];
|
|
622
|
+
taxTotalCents: number;
|
|
623
|
+
reservationFeeCents: number | null;
|
|
624
|
+
reservationFeeLabel: string | null;
|
|
625
|
+
grandTotalCents: number;
|
|
626
|
+
}
|
|
627
|
+
/** Itemized quote for a package order WITHOUT creating a PaymentIntent — feeds
|
|
628
|
+
* the Review step. Requires a signed-in customer (so tax exemptions match the
|
|
629
|
+
* eventual charge). */
|
|
630
|
+
declare function previewPackage(client: BowlosClient, args: PackagePreviewArgs): Promise<PackagePreviewResult>;
|
|
631
|
+
/** Inputs for an itemized membership quote. A membership has no config (no
|
|
632
|
+
* date/qty), so it's just the template (+ an optional share token for a private
|
|
633
|
+
* membership). The selling Center is resolved server-side from the customer's
|
|
634
|
+
* home Center. Shared by the one-time and recurring previews. */
|
|
635
|
+
type MembershipPreviewArgs = {
|
|
636
|
+
templateId: string;
|
|
637
|
+
shareToken?: string;
|
|
638
|
+
/** v0.32.0: reflect the flash sale price in the Review (one-time only). */
|
|
639
|
+
flashSaleItemId?: string;
|
|
640
|
+
};
|
|
641
|
+
/** Server-computed itemized quote for a one-time membership purchase — the dues,
|
|
642
|
+
* the one-time setup (joining) fee, tax lines, the selling Center's booking fee,
|
|
643
|
+
* and the authoritative grand total. Drives the headless "Review" step. Computed
|
|
644
|
+
* by the SAME engine as the PaymentIntent, so it never diverges from what the
|
|
645
|
+
* customer is charged. */
|
|
646
|
+
interface MembershipPreviewResult {
|
|
647
|
+
tierDiscountCents?: number;
|
|
648
|
+
tierDiscountLabel?: string;
|
|
649
|
+
duesCents: number;
|
|
650
|
+
setupFeeCents: number;
|
|
651
|
+
subtotalCents: number;
|
|
652
|
+
taxLines: {
|
|
653
|
+
rateId: string;
|
|
654
|
+
label: string;
|
|
655
|
+
rateBasisPoints: number;
|
|
656
|
+
mode: "added" | "included";
|
|
657
|
+
taxableBaseCents: number;
|
|
658
|
+
taxCents: number;
|
|
659
|
+
}[];
|
|
660
|
+
taxTotalCents: number;
|
|
661
|
+
reservationFeeCents: number | null;
|
|
662
|
+
reservationFeeLabel: string | null;
|
|
663
|
+
grandTotalCents: number;
|
|
664
|
+
}
|
|
665
|
+
/** Itemized quote for a one-time membership purchase WITHOUT creating a
|
|
666
|
+
* PaymentIntent — feeds the Review step. Requires a signed-in customer (so tax
|
|
667
|
+
* exemptions + the resolved home Center match the eventual charge). */
|
|
668
|
+
declare function previewMembership(client: BowlosClient, args: MembershipPreviewArgs): Promise<MembershipPreviewResult>;
|
|
669
|
+
/** Inputs for a one-time membership purchase. The SDK generates an idempotency
|
|
670
|
+
* key if omitted. */
|
|
671
|
+
type MembershipPurchaseArgs = {
|
|
672
|
+
templateId: string;
|
|
673
|
+
idempotencyKey?: string;
|
|
674
|
+
shareToken?: string;
|
|
675
|
+
/** v0.32.0: redeem this flash-sale item at its sale price (one-time only). */
|
|
676
|
+
flashSaleItemId?: string;
|
|
677
|
+
};
|
|
678
|
+
/** The connected-account PaymentIntent for a one-time membership purchase.
|
|
679
|
+
* Confirm it with `<BowlosPaymentForm>` — it carries `connectedAccountId` + the
|
|
680
|
+
* customer session. Poll `getMembershipStatus(refToken)` for materialization. */
|
|
681
|
+
interface MembershipPurchaseIntent {
|
|
682
|
+
paymentIntentId: string;
|
|
683
|
+
clientSecret: string;
|
|
684
|
+
amountCents: number;
|
|
685
|
+
refToken: string | null;
|
|
686
|
+
customerSessionClientSecret: string;
|
|
687
|
+
connectedAccountId: string;
|
|
688
|
+
/** Full Test Mode (2026-06-23): the Stripe environment this PaymentIntent was
|
|
689
|
+
* created in. Load Stripe.js with the matching publishable key
|
|
690
|
+
* (`pk_test_…` for "test", `pk_live_…` for "live") scoped to
|
|
691
|
+
* `connectedAccountId`. `<BowlosPaymentForm>` picks it for you when you pass
|
|
692
|
+
* `testPublishableKey`. Absent on older gateway responses → treat as "live". */
|
|
693
|
+
stripeMode?: "test" | "live";
|
|
694
|
+
}
|
|
695
|
+
/** Buy a one-time membership — mints the connected-account PaymentIntent
|
|
696
|
+
* (requires a signed-in customer; the charge lands on the operator's connected
|
|
697
|
+
* account). */
|
|
698
|
+
declare function createMembershipOrder(client: BowlosClient, args: MembershipPurchaseArgs): Promise<MembershipPurchaseIntent>;
|
|
699
|
+
type MembershipCheckoutStatus = "not_found" | "pending_payment" | "paid_materialized" | "expired" | "payment_failed_retryable" | "abandoned";
|
|
700
|
+
interface MembershipStatusResult {
|
|
701
|
+
status: MembershipCheckoutStatus;
|
|
702
|
+
membershipId: string | null;
|
|
703
|
+
}
|
|
704
|
+
/** Poll a one-time membership purchase to materialization (by the create's
|
|
705
|
+
* `refToken`). */
|
|
706
|
+
declare function getMembershipStatus(client: BowlosClient, refToken: string): Promise<MembershipStatusResult>;
|
|
707
|
+
/** Server-computed itemized quote for a RECURRING membership subscription — the
|
|
708
|
+
* same fields as the one-time quote (what's charged today: dues + one-time setup
|
|
709
|
+
* fee + tax + the selling Center's fee), PLUS `recurringTotalCents` (what each
|
|
710
|
+
* renewal charges) and the `cadence`. Drives the recurring "Review" step's
|
|
711
|
+
* "Due today" + "Auto-renews at" lines. Computed by the SAME engine as the
|
|
712
|
+
* subscription's first invoice, so it never diverges. */
|
|
713
|
+
interface MembershipSubscriptionPreviewResult extends MembershipPreviewResult {
|
|
714
|
+
recurringTotalCents: number;
|
|
715
|
+
cadence: "monthly" | "annual" | "one_time";
|
|
716
|
+
}
|
|
717
|
+
/** Itemized quote for a recurring membership subscription WITHOUT creating the
|
|
718
|
+
* subscription — feeds the Review step. Requires a signed-in customer (so tax
|
|
719
|
+
* exemptions + the resolved home Center match the eventual charge). */
|
|
720
|
+
declare function previewMembershipSubscription(client: BowlosClient, args: MembershipPreviewArgs): Promise<MembershipSubscriptionPreviewResult>;
|
|
721
|
+
/** Inputs for a recurring membership subscription. (No idempotency key — the
|
|
722
|
+
* subscription itself is the dedupe anchor; the buy is gated to one active
|
|
723
|
+
* membership per customer.) */
|
|
724
|
+
type MembershipSubscriptionArgs = {
|
|
725
|
+
templateId: string;
|
|
726
|
+
shareToken?: string;
|
|
727
|
+
};
|
|
728
|
+
/** The connected-account first-invoice payment for a recurring membership
|
|
729
|
+
* subscription. Confirm `clientSecret` with `<BowlosPaymentForm>` — it carries
|
|
730
|
+
* `connectedAccountId` + the customer session. There is NO refToken: the
|
|
731
|
+
* subscription materializes via webhook, so re-query `useMyMemberships` after
|
|
732
|
+
* payment rather than polling. */
|
|
733
|
+
interface MembershipSubscriptionIntent {
|
|
734
|
+
subscriptionId: string;
|
|
735
|
+
clientSecret: string;
|
|
736
|
+
amountCents: number;
|
|
737
|
+
customerSessionClientSecret: string;
|
|
738
|
+
connectedAccountId: string;
|
|
739
|
+
/** Full Test Mode (2026-06-23): the Stripe environment this PaymentIntent was
|
|
740
|
+
* created in. Load Stripe.js with the matching publishable key
|
|
741
|
+
* (`pk_test_…` for "test", `pk_live_…` for "live") scoped to
|
|
742
|
+
* `connectedAccountId`. `<BowlosPaymentForm>` picks it for you when you pass
|
|
743
|
+
* `testPublishableKey`. Absent on older gateway responses → treat as "live". */
|
|
744
|
+
stripeMode?: "test" | "live";
|
|
745
|
+
}
|
|
746
|
+
/** Start a recurring membership subscription — mints the subscription + its
|
|
747
|
+
* first-invoice PaymentIntent on the operator's connected account (requires a
|
|
748
|
+
* signed-in customer). Confirm the returned `clientSecret`; the subscription
|
|
749
|
+
* materializes via webhook. */
|
|
750
|
+
declare function createMembershipSubscriptionOrder(client: BowlosClient, args: MembershipSubscriptionArgs): Promise<MembershipSubscriptionIntent>;
|
|
751
|
+
/** Browser/Node-safe idempotency key for booking creates. */
|
|
752
|
+
declare function generateIdempotencyKey(): string;
|
|
753
|
+
/** Place the inventory hold + open a checkout. Requires a signed-in
|
|
754
|
+
* customer — the server rejects a guest. Sends the session bearer. */
|
|
755
|
+
declare function createBooking(client: BowlosClient, args: CreateBookingArgs): Promise<BookingHold>;
|
|
756
|
+
/** Mint the Stripe Connect PaymentIntent for a held checkout (by refToken). */
|
|
757
|
+
declare function createCheckoutPaymentIntent(client: BowlosClient, refToken: string): Promise<PaymentIntentInfo>;
|
|
758
|
+
/** Poll the hold→pay→materialize state for a checkout (by refToken). */
|
|
759
|
+
declare function getCheckoutStatus(client: BowlosClient, refToken: string): Promise<CheckoutStatusResult>;
|
|
760
|
+
/** Release the hold + cancel the checkout (the "Back" button). */
|
|
761
|
+
declare function abandonCheckout(client: BowlosClient, refToken: string): Promise<{
|
|
762
|
+
ok: boolean;
|
|
763
|
+
}>;
|
|
764
|
+
declare function joinWaitlist(client: BowlosClient, args: JoinWaitlistArgs): Promise<JoinWaitlistResult>;
|
|
765
|
+
declare function createWaitlistSetupIntent(client: BowlosClient, args: WaitlistEntryArgs): Promise<WaitlistSetupIntent>;
|
|
766
|
+
declare function confirmWaitlistCard(client: BowlosClient, args: WaitlistEntryArgs & {
|
|
767
|
+
setupIntentId: string;
|
|
768
|
+
}): Promise<{
|
|
769
|
+
status: string;
|
|
770
|
+
}>;
|
|
771
|
+
declare function listMyWaitlist(client: BowlosClient, args: {
|
|
772
|
+
brandId: string;
|
|
773
|
+
centerId?: string;
|
|
774
|
+
}): Promise<MyWaitlistEntry[]>;
|
|
775
|
+
declare function leaveWaitlist(client: BowlosClient, args: WaitlistEntryArgs): Promise<{
|
|
776
|
+
status: "cancelled";
|
|
777
|
+
}>;
|
|
778
|
+
|
|
779
|
+
/** Wire contracts derived from convex/public_api.ts validators and success payloads.
|
|
780
|
+
* IDs cross the HTTP gateway as strings; envelopes are unwrapped by BowlosClient.
|
|
781
|
+
* ExportMyDataResult preserves the existing v1 export, including its raw records. */
|
|
782
|
+
type UpdateMyProfileArgs = {
|
|
783
|
+
fullName?: string | undefined;
|
|
784
|
+
mobile?: string | null | undefined;
|
|
785
|
+
marketingOptIn?: boolean | undefined;
|
|
786
|
+
preferredCenterId?: string | null | undefined;
|
|
787
|
+
brandId: string;
|
|
788
|
+
expectedVersion: number;
|
|
789
|
+
};
|
|
790
|
+
type UpdateMyProfileResult = {
|
|
791
|
+
id: string;
|
|
792
|
+
version: number;
|
|
793
|
+
};
|
|
794
|
+
type GetMyCommunicationPrefsArgs = {
|
|
795
|
+
brandId: string;
|
|
796
|
+
};
|
|
797
|
+
type GetMyCommunicationPrefsResult = {
|
|
798
|
+
email: {
|
|
799
|
+
status: "unsubscribed" | "subscribed";
|
|
800
|
+
version: number;
|
|
801
|
+
};
|
|
802
|
+
sms: {
|
|
803
|
+
status: "unsubscribed" | "subscribed";
|
|
804
|
+
version: number;
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
type SetMyCommunicationPrefArgs = {
|
|
808
|
+
acceptedTerms?: boolean | undefined;
|
|
809
|
+
brandId: string;
|
|
810
|
+
status: "unsubscribed" | "subscribed";
|
|
811
|
+
channel: "email" | "sms";
|
|
812
|
+
};
|
|
813
|
+
type SetMyCommunicationPrefResult = {
|
|
814
|
+
status: "unsubscribed" | "subscribed";
|
|
815
|
+
version: number;
|
|
816
|
+
};
|
|
817
|
+
type SetMyMobileArgs = {
|
|
818
|
+
brandId: string;
|
|
819
|
+
mobile: string;
|
|
820
|
+
};
|
|
821
|
+
type SetMyMobileResult = {
|
|
822
|
+
mobile: string;
|
|
823
|
+
};
|
|
824
|
+
type SubmitSupportRequestArgs = {
|
|
825
|
+
centerId?: string | undefined;
|
|
826
|
+
brandId: string;
|
|
827
|
+
message: string;
|
|
828
|
+
};
|
|
829
|
+
type SubmitSupportRequestResult = {
|
|
830
|
+
submittedAt: number;
|
|
831
|
+
};
|
|
832
|
+
type DeleteMyAccountArgs = {
|
|
833
|
+
brandId: string;
|
|
834
|
+
previewToken?: string;
|
|
835
|
+
} & ({
|
|
836
|
+
confirmation: string;
|
|
837
|
+
confirmPhrase?: string;
|
|
838
|
+
} | {
|
|
839
|
+
confirmPhrase: string;
|
|
840
|
+
confirmation?: string;
|
|
841
|
+
});
|
|
842
|
+
type DeleteMyAccountResult = {
|
|
843
|
+
deletedAt: number;
|
|
844
|
+
};
|
|
845
|
+
type ExportMyDataArgs = {
|
|
846
|
+
brandId: string;
|
|
847
|
+
};
|
|
848
|
+
type ExportMyDataResult = {
|
|
849
|
+
exportedAt: number;
|
|
850
|
+
customer: {
|
|
851
|
+
id: string;
|
|
852
|
+
displayId: string;
|
|
853
|
+
brandId: string;
|
|
854
|
+
fullName: string;
|
|
855
|
+
email: string;
|
|
856
|
+
mobile: string | undefined;
|
|
857
|
+
marketingOptIn: boolean;
|
|
858
|
+
preferredCenterId: string | undefined;
|
|
859
|
+
customerSinceMs: number | undefined;
|
|
860
|
+
};
|
|
861
|
+
reservations: {
|
|
862
|
+
_id: string;
|
|
863
|
+
_creationTime: number;
|
|
864
|
+
deletedAt?: number | undefined;
|
|
865
|
+
deletedBy?: string | undefined;
|
|
866
|
+
deletionReason?: string | undefined;
|
|
867
|
+
demoSeedRunId?: string | undefined;
|
|
868
|
+
demoSeedKey?: string | undefined;
|
|
869
|
+
subtypeId?: string | undefined;
|
|
870
|
+
flashSaleEventId?: string | undefined;
|
|
871
|
+
pricePlanId?: string | undefined;
|
|
872
|
+
tierDiscountCents?: number | undefined;
|
|
873
|
+
tierDiscountLabel?: string | undefined;
|
|
874
|
+
flashSaleItemId?: string | undefined;
|
|
875
|
+
stripeMode?: "live" | "test" | undefined;
|
|
876
|
+
units?: number | undefined;
|
|
877
|
+
persons?: number | undefined;
|
|
878
|
+
games?: number | undefined;
|
|
879
|
+
stripeCardBrand?: string | undefined;
|
|
880
|
+
stripeCardLast4?: string | undefined;
|
|
881
|
+
refundedCents?: number | undefined;
|
|
882
|
+
compedCents?: number | undefined;
|
|
883
|
+
needsUnitReassignment?: boolean | undefined;
|
|
884
|
+
paymentReference?: string | undefined;
|
|
885
|
+
stripePaymentIntentId?: string | undefined;
|
|
886
|
+
stripeConnectedAccountId?: string | undefined;
|
|
887
|
+
confirmationEmailSentAt?: number | undefined;
|
|
888
|
+
cancellationEmailSentAt?: number | undefined;
|
|
889
|
+
paymentFailedEmailSentAt?: number | undefined;
|
|
890
|
+
modifiedEmailSentForVersion?: number | undefined;
|
|
891
|
+
reminderEmailSentForDate?: string | undefined;
|
|
892
|
+
checkInEmailSentAt?: number | undefined;
|
|
893
|
+
noShowEmailSentAt?: number | undefined;
|
|
894
|
+
completedEmailSentAt?: number | undefined;
|
|
895
|
+
statusReason?: string | undefined;
|
|
896
|
+
paymentLinkDispatchedAt?: number | undefined;
|
|
897
|
+
checkedInAt?: number | undefined;
|
|
898
|
+
completedAt?: number | undefined;
|
|
899
|
+
cancelledAt?: number | undefined;
|
|
900
|
+
noShowAt?: number | undefined;
|
|
901
|
+
personsCheckedIn?: number | undefined;
|
|
902
|
+
personsAttended?: number | undefined;
|
|
903
|
+
noShowSettlement?: {
|
|
904
|
+
bucket: string;
|
|
905
|
+
refundedCents: number;
|
|
906
|
+
idempotencyKey: string;
|
|
907
|
+
absentSeats: number;
|
|
908
|
+
absentDeltaCents: number;
|
|
909
|
+
creditedCents: number;
|
|
910
|
+
forfeitedCents: number;
|
|
911
|
+
settledAtMs: number;
|
|
912
|
+
} | undefined;
|
|
913
|
+
lastTransitionedBy?: string | undefined;
|
|
914
|
+
recurringProfileId?: string | undefined;
|
|
915
|
+
recurringInstanceIndex?: number | undefined;
|
|
916
|
+
flaggedAt?: number | undefined;
|
|
917
|
+
flagReason?: string | undefined;
|
|
918
|
+
packageOrderId?: string | undefined;
|
|
919
|
+
shareToken?: string | undefined;
|
|
920
|
+
customerId: string;
|
|
921
|
+
brandId: string;
|
|
922
|
+
centerId: string;
|
|
923
|
+
status: "completed" | "pending" | "confirmed" | "confirmed_awaiting_payment" | "pending_review" | "checked_in" | "cancelled_forfeited" | "cancelled_credited" | "no_show";
|
|
924
|
+
displayId: string;
|
|
925
|
+
version: number;
|
|
926
|
+
attractionId: string;
|
|
927
|
+
productId: string;
|
|
928
|
+
unitIds: string[];
|
|
929
|
+
startMinuteOfDay: number;
|
|
930
|
+
endMinuteOfDay: number;
|
|
931
|
+
dateISO: string;
|
|
932
|
+
mode: "per_unit_per_hour" | "per_person_per_hour" | "per_game";
|
|
933
|
+
snapshot: {
|
|
934
|
+
addonSubtotalCents?: number | undefined;
|
|
935
|
+
addonLineItems?: {
|
|
936
|
+
rateMode: "flat" | "per_person" | "per_unit";
|
|
937
|
+
addonId: string;
|
|
938
|
+
quantity: number;
|
|
939
|
+
addonName: string;
|
|
940
|
+
unitPriceCents: number;
|
|
941
|
+
lineSubtotalCents: number;
|
|
942
|
+
}[] | undefined;
|
|
943
|
+
appliedDiscountSource?: string | undefined;
|
|
944
|
+
reservationFeeCents?: number | undefined;
|
|
945
|
+
reservationFeeLabel?: string | undefined;
|
|
946
|
+
purchaseSummary?: string | undefined;
|
|
947
|
+
productName?: string | undefined;
|
|
948
|
+
pricePlanName?: string | undefined;
|
|
949
|
+
pricePlanDescription?: string | undefined;
|
|
950
|
+
appliedDiscountLabel?: string | undefined;
|
|
951
|
+
shoesIncluded?: boolean | undefined;
|
|
952
|
+
taxLines?: {
|
|
953
|
+
label: string;
|
|
954
|
+
rateBasisPoints: number;
|
|
955
|
+
mode: "included" | "added";
|
|
956
|
+
rateId: string;
|
|
957
|
+
taxableBaseCents: number;
|
|
958
|
+
taxCents: number;
|
|
959
|
+
}[] | undefined;
|
|
960
|
+
taxTotalCents?: number | undefined;
|
|
961
|
+
taxIncludedTotalCents?: number | undefined;
|
|
962
|
+
taxExemptForgoneCents?: number | undefined;
|
|
963
|
+
taxExemptApplied?: boolean | undefined;
|
|
964
|
+
issuedAtMs: number;
|
|
965
|
+
validUntilMs: number;
|
|
966
|
+
baseRateCents: number;
|
|
967
|
+
baseSubtotalCents: number;
|
|
968
|
+
shoeAddOnCents: number;
|
|
969
|
+
preDiscountTotalCents: number;
|
|
970
|
+
appliedDiscountCents: number;
|
|
971
|
+
finalCents: number;
|
|
972
|
+
};
|
|
973
|
+
paidCents: number;
|
|
974
|
+
balanceDue: boolean;
|
|
975
|
+
sourceChannel: "native_ui" | "staff_created" | "public_api" | "mobile_app" | "ai_receptionist" | "flash_sale" | "waitlist";
|
|
976
|
+
idempotencyKey: string;
|
|
977
|
+
}[];
|
|
978
|
+
creditLedger: {
|
|
979
|
+
_id: string;
|
|
980
|
+
_creationTime: number;
|
|
981
|
+
centerId?: string | undefined;
|
|
982
|
+
demoSeedRunId?: string | undefined;
|
|
983
|
+
demoSeedKey?: string | undefined;
|
|
984
|
+
relatedReservationId?: string | undefined;
|
|
985
|
+
relatedEventOrderId?: string | undefined;
|
|
986
|
+
relatedPackageOrderId?: string | undefined;
|
|
987
|
+
relatedGameCardId?: string | undefined;
|
|
988
|
+
reversesEntryId?: string | undefined;
|
|
989
|
+
writtenByStaffId?: string | undefined;
|
|
990
|
+
writtenByUserId?: string | undefined;
|
|
991
|
+
issuedEmailSentAt?: number | undefined;
|
|
992
|
+
customerId: string;
|
|
993
|
+
brandId: string;
|
|
994
|
+
displayId: string;
|
|
995
|
+
amountCents: number;
|
|
996
|
+
entryType: "CREDIT_ISSUED_CANCEL" | "CREDIT_ISSUED_MANUAL" | "CREDIT_ISSUED_ADJUSTMENT" | "CREDIT_CONSUMED" | "CREDIT_REVERSAL" | "CREDIT_ISSUED_MEMBERSHIP_REFUND" | "CREDIT_ISSUED_EVENT_REFUND" | "CREDIT_ISSUED_NO_SHOW" | "WRITE_OFF";
|
|
997
|
+
note: string;
|
|
998
|
+
}[];
|
|
999
|
+
loyaltyLedger: {
|
|
1000
|
+
_id: string;
|
|
1001
|
+
_creationTime: number;
|
|
1002
|
+
centerId?: string | undefined;
|
|
1003
|
+
demoSeedRunId?: string | undefined;
|
|
1004
|
+
demoSeedKey?: string | undefined;
|
|
1005
|
+
relatedReservationId?: string | undefined;
|
|
1006
|
+
writtenByStaffId?: string | undefined;
|
|
1007
|
+
writtenByUserId?: string | undefined;
|
|
1008
|
+
multiplierBreakdown?: {
|
|
1009
|
+
baseRate: number;
|
|
1010
|
+
tierMultiplier: number;
|
|
1011
|
+
brandBonusMultiplier: number;
|
|
1012
|
+
centerBonusMultiplier: number;
|
|
1013
|
+
} | undefined;
|
|
1014
|
+
customerId: string;
|
|
1015
|
+
brandId: string;
|
|
1016
|
+
displayId: string;
|
|
1017
|
+
points: number;
|
|
1018
|
+
entryType: "ACCRUAL_RESERVATION" | "REVERSAL_CANCELLATION" | "ADJUSTMENT_MANUAL" | "ADJUSTMENT_BONUS";
|
|
1019
|
+
note: string;
|
|
1020
|
+
qualificationYear: number;
|
|
1021
|
+
}[];
|
|
1022
|
+
loyaltyState: {
|
|
1023
|
+
_id: string;
|
|
1024
|
+
_creationTime: number;
|
|
1025
|
+
demoSeedRunId?: string | undefined;
|
|
1026
|
+
demoSeedKey?: string | undefined;
|
|
1027
|
+
complimentaryTierRank?: number | undefined;
|
|
1028
|
+
tierEmailSentForRank?: number | undefined;
|
|
1029
|
+
customerId: string;
|
|
1030
|
+
brandId: string;
|
|
1031
|
+
version: number;
|
|
1032
|
+
qualificationYear: number;
|
|
1033
|
+
yearPoints: number;
|
|
1034
|
+
currentTierRank: number;
|
|
1035
|
+
floorTierRank: number;
|
|
1036
|
+
} | null;
|
|
1037
|
+
memberships: {
|
|
1038
|
+
_id: string;
|
|
1039
|
+
_creationTime: number;
|
|
1040
|
+
centerId?: string | undefined;
|
|
1041
|
+
deletedAt?: number | undefined;
|
|
1042
|
+
deletedBy?: string | undefined;
|
|
1043
|
+
deletionReason?: string | undefined;
|
|
1044
|
+
demoSeedRunId?: string | undefined;
|
|
1045
|
+
demoSeedKey?: string | undefined;
|
|
1046
|
+
flashSaleEventId?: string | undefined;
|
|
1047
|
+
tierDiscountCents?: number | undefined;
|
|
1048
|
+
tierDiscountLabel?: string | undefined;
|
|
1049
|
+
flashSaleItemId?: string | undefined;
|
|
1050
|
+
stripeMode?: "live" | "test" | undefined;
|
|
1051
|
+
reservationFeeCents?: number | undefined;
|
|
1052
|
+
reservationFeeLabel?: string | undefined;
|
|
1053
|
+
taxLines?: {
|
|
1054
|
+
label: string;
|
|
1055
|
+
rateBasisPoints: number;
|
|
1056
|
+
mode: "included" | "added";
|
|
1057
|
+
rateId: string;
|
|
1058
|
+
taxableBaseCents: number;
|
|
1059
|
+
taxCents: number;
|
|
1060
|
+
}[] | undefined;
|
|
1061
|
+
taxTotalCents?: number | undefined;
|
|
1062
|
+
taxIncludedTotalCents?: number | undefined;
|
|
1063
|
+
taxExemptForgoneCents?: number | undefined;
|
|
1064
|
+
taxExemptApplied?: boolean | undefined;
|
|
1065
|
+
refundedCents?: number | undefined;
|
|
1066
|
+
stripeConnectedAccountId?: string | undefined;
|
|
1067
|
+
cancellationEmailSentAt?: number | undefined;
|
|
1068
|
+
shareToken?: string | undefined;
|
|
1069
|
+
subtotalCents?: number | undefined;
|
|
1070
|
+
duesCents?: number | undefined;
|
|
1071
|
+
terminatedAt?: number | undefined;
|
|
1072
|
+
purchaseSetupFeeCents?: number | undefined;
|
|
1073
|
+
grandTotalCents?: number | undefined;
|
|
1074
|
+
pricedAtCents?: number | undefined;
|
|
1075
|
+
redeemedFromCodeId?: string | undefined;
|
|
1076
|
+
billingContactCustomerId?: string | undefined;
|
|
1077
|
+
enrollmentEmailSentAt?: number | undefined;
|
|
1078
|
+
expirationEmailSentForPeriodEndingAt?: number | undefined;
|
|
1079
|
+
stripeSubscriptionId?: string | undefined;
|
|
1080
|
+
graceEnteredAt?: number | undefined;
|
|
1081
|
+
terminationEmailSentAt?: number | undefined;
|
|
1082
|
+
refundedAt?: number | undefined;
|
|
1083
|
+
refundReason?: string | undefined;
|
|
1084
|
+
customerId: string;
|
|
1085
|
+
brandId: string;
|
|
1086
|
+
status: "active" | "cancel_at_period_end" | "grace" | "terminated" | "reactivatable";
|
|
1087
|
+
displayId: string;
|
|
1088
|
+
version: number;
|
|
1089
|
+
paymentReference: string;
|
|
1090
|
+
templateId: string;
|
|
1091
|
+
purchasedAt: number;
|
|
1092
|
+
currentPeriodEndsAt: number;
|
|
1093
|
+
isFamily: boolean;
|
|
1094
|
+
isCorporate: boolean;
|
|
1095
|
+
}[];
|
|
1096
|
+
walletPasses: {
|
|
1097
|
+
_id: string;
|
|
1098
|
+
_creationTime: number;
|
|
1099
|
+
deletedAt?: number | undefined;
|
|
1100
|
+
deletedBy?: string | undefined;
|
|
1101
|
+
deletionReason?: string | undefined;
|
|
1102
|
+
demoSeedRunId?: string | undefined;
|
|
1103
|
+
demoSeedKey?: string | undefined;
|
|
1104
|
+
revokedAt?: number | undefined;
|
|
1105
|
+
packageOrderId?: string | undefined;
|
|
1106
|
+
reservationId?: string | undefined;
|
|
1107
|
+
gameCardId?: string | undefined;
|
|
1108
|
+
issuedEmailSentAt?: number | undefined;
|
|
1109
|
+
membershipId?: string | undefined;
|
|
1110
|
+
visualDesignId?: string | undefined;
|
|
1111
|
+
applePassBundleRef?: string | undefined;
|
|
1112
|
+
googleWalletJwt?: string | undefined;
|
|
1113
|
+
distributedVia?: "email_link" | "sms_link" | "portal_download" | "app_prompt" | "qr_receipt" | "staff_issued" | undefined;
|
|
1114
|
+
revokedReason?: string | undefined;
|
|
1115
|
+
revokedEmailSentAt?: number | undefined;
|
|
1116
|
+
lastPushedAt?: number | undefined;
|
|
1117
|
+
appleAuthenticationToken?: string | undefined;
|
|
1118
|
+
applePassUpdatedAt?: number | undefined;
|
|
1119
|
+
customerId: string;
|
|
1120
|
+
brandId: string;
|
|
1121
|
+
kind: "reservation" | "package" | "game_card" | "membership";
|
|
1122
|
+
displayId: string;
|
|
1123
|
+
version: number;
|
|
1124
|
+
token: string;
|
|
1125
|
+
state: "active" | "suspended" | "revoked" | "checked_in" | "expired" | "issued" | "reissued";
|
|
1126
|
+
generation: number;
|
|
1127
|
+
}[];
|
|
1128
|
+
emailSubscriptions: {
|
|
1129
|
+
_id: string;
|
|
1130
|
+
_creationTime: number;
|
|
1131
|
+
centerId?: string | undefined;
|
|
1132
|
+
statusReason?: string | undefined;
|
|
1133
|
+
statusSource?: "system" | "staff" | "customer" | undefined;
|
|
1134
|
+
statusChangedAt?: number | undefined;
|
|
1135
|
+
statusChangedByUserId?: string | undefined;
|
|
1136
|
+
customerId: string;
|
|
1137
|
+
brandId: string;
|
|
1138
|
+
status: "unsubscribed" | "subscribed";
|
|
1139
|
+
version: number;
|
|
1140
|
+
}[];
|
|
1141
|
+
smsSubscriptions: {
|
|
1142
|
+
_id: string;
|
|
1143
|
+
_creationTime: number;
|
|
1144
|
+
centerId?: string | undefined;
|
|
1145
|
+
statusReason?: string | undefined;
|
|
1146
|
+
statusSource?: "system" | "staff" | "customer" | undefined;
|
|
1147
|
+
statusChangedAt?: number | undefined;
|
|
1148
|
+
statusChangedByUserId?: string | undefined;
|
|
1149
|
+
acceptedTermsAt?: number | undefined;
|
|
1150
|
+
customerId: string;
|
|
1151
|
+
brandId: string;
|
|
1152
|
+
status: "unsubscribed" | "subscribed";
|
|
1153
|
+
version: number;
|
|
1154
|
+
}[];
|
|
1155
|
+
};
|
|
1156
|
+
type GetMyPackageOrdersArgs = {
|
|
1157
|
+
brandId: string;
|
|
1158
|
+
};
|
|
1159
|
+
type GetMyPackageOrdersResult = {
|
|
1160
|
+
id: string;
|
|
1161
|
+
displayId: string;
|
|
1162
|
+
packageName: string;
|
|
1163
|
+
scheduledDate: string;
|
|
1164
|
+
scheduledStartMinute: number;
|
|
1165
|
+
quantity: number;
|
|
1166
|
+
pricingMode: "per_lane" | "fixed" | "per_bowler";
|
|
1167
|
+
grandTotalCents: number;
|
|
1168
|
+
status: "pending_payment" | "cancelled" | "refunded" | "paid";
|
|
1169
|
+
paidAt: number | null;
|
|
1170
|
+
}[];
|
|
1171
|
+
type GetMyPackageOrderArgs = {
|
|
1172
|
+
brandId: string;
|
|
1173
|
+
orderId: string;
|
|
1174
|
+
};
|
|
1175
|
+
type GetMyPackageOrderResult = {
|
|
1176
|
+
id: string;
|
|
1177
|
+
displayId: string;
|
|
1178
|
+
packageName: string;
|
|
1179
|
+
pricingMode: "per_lane" | "fixed" | "per_bowler";
|
|
1180
|
+
quantity: number;
|
|
1181
|
+
basePriceCents: number;
|
|
1182
|
+
optionalAddons: {
|
|
1183
|
+
inventoryExtraUnits?: number | undefined;
|
|
1184
|
+
inventoryAttractionTypeKey?: string | undefined;
|
|
1185
|
+
name: string;
|
|
1186
|
+
addonId: string;
|
|
1187
|
+
quantity: number;
|
|
1188
|
+
pricePerUnitCents: number;
|
|
1189
|
+
}[];
|
|
1190
|
+
optionalAddonsTotalCents: number;
|
|
1191
|
+
grandTotalCents: number;
|
|
1192
|
+
scheduledDate: string;
|
|
1193
|
+
scheduledStartMinute: number;
|
|
1194
|
+
totalDurationMinutes: number;
|
|
1195
|
+
status: "pending_payment" | "cancelled" | "refunded" | "paid";
|
|
1196
|
+
paidAt: number | null;
|
|
1197
|
+
};
|
|
1198
|
+
type GetMyMembershipMembersArgs = {
|
|
1199
|
+
brandId: string;
|
|
1200
|
+
membershipId: string;
|
|
1201
|
+
};
|
|
1202
|
+
type GetMyMembershipMembersResult = {
|
|
1203
|
+
seatCount: number;
|
|
1204
|
+
canManage: boolean;
|
|
1205
|
+
members: MembershipMember[];
|
|
1206
|
+
};
|
|
1207
|
+
type AddMyMembershipMemberArgs = {
|
|
1208
|
+
brandId: string;
|
|
1209
|
+
email: string;
|
|
1210
|
+
membershipId: string;
|
|
1211
|
+
};
|
|
1212
|
+
type AddMyMembershipMemberResult = {
|
|
1213
|
+
memberRowId: string;
|
|
1214
|
+
walletPassId: string;
|
|
1215
|
+
addedCustomerName: string;
|
|
1216
|
+
};
|
|
1217
|
+
type GetMyLoyaltyHistoryArgs = {
|
|
1218
|
+
brandId: string;
|
|
1219
|
+
};
|
|
1220
|
+
type GetMyLoyaltyHistoryResult = {
|
|
1221
|
+
id: string;
|
|
1222
|
+
displayId: string;
|
|
1223
|
+
entryType: "ACCRUAL_RESERVATION" | "REVERSAL_CANCELLATION" | "ADJUSTMENT_MANUAL" | "ADJUSTMENT_BONUS";
|
|
1224
|
+
points: number;
|
|
1225
|
+
qualificationYear: number;
|
|
1226
|
+
note: string;
|
|
1227
|
+
createdAt: number;
|
|
1228
|
+
}[];
|
|
1229
|
+
type GetReceiptArgs = {
|
|
1230
|
+
displayId: string;
|
|
1231
|
+
};
|
|
1232
|
+
type GetReceiptResult = {
|
|
1233
|
+
displayId: string;
|
|
1234
|
+
status: "completed" | "pending" | "confirmed" | "confirmed_awaiting_payment" | "pending_review" | "checked_in" | "cancelled_forfeited" | "cancelled_credited" | "no_show";
|
|
1235
|
+
balanceDue: boolean;
|
|
1236
|
+
paidCents: number;
|
|
1237
|
+
refundedCents: number;
|
|
1238
|
+
dateISO: string;
|
|
1239
|
+
startMinuteOfDay: number;
|
|
1240
|
+
endMinuteOfDay: number;
|
|
1241
|
+
mode: "per_unit_per_hour" | "per_person_per_hour" | "per_game";
|
|
1242
|
+
units: number | undefined;
|
|
1243
|
+
persons: number | undefined;
|
|
1244
|
+
games: number | undefined;
|
|
1245
|
+
snapshot: {
|
|
1246
|
+
finalCents: number;
|
|
1247
|
+
baseSubtotalCents: number;
|
|
1248
|
+
addonSubtotalCents: number;
|
|
1249
|
+
addonLineItems: {
|
|
1250
|
+
rateMode: "flat" | "per_person" | "per_unit";
|
|
1251
|
+
addonId: string;
|
|
1252
|
+
quantity: number;
|
|
1253
|
+
addonName: string;
|
|
1254
|
+
unitPriceCents: number;
|
|
1255
|
+
lineSubtotalCents: number;
|
|
1256
|
+
}[];
|
|
1257
|
+
preDiscountTotalCents: number;
|
|
1258
|
+
appliedDiscountSource: string | null;
|
|
1259
|
+
appliedDiscountCents: number;
|
|
1260
|
+
reservationFeeCents: number | undefined;
|
|
1261
|
+
reservationFeeLabel: string | null;
|
|
1262
|
+
purchaseSummary: string | null;
|
|
1263
|
+
pricePlanName: string | null;
|
|
1264
|
+
pricePlanDescription: string | null;
|
|
1265
|
+
appliedDiscountLabel: string | null;
|
|
1266
|
+
shoesIncluded: boolean | null;
|
|
1267
|
+
taxTotalCents: number | null;
|
|
1268
|
+
taxLines: {
|
|
1269
|
+
label: string;
|
|
1270
|
+
rateBasisPoints: number;
|
|
1271
|
+
mode: "included" | "added";
|
|
1272
|
+
rateId: string;
|
|
1273
|
+
taxableBaseCents: number;
|
|
1274
|
+
taxCents: number;
|
|
1275
|
+
}[] | null;
|
|
1276
|
+
};
|
|
1277
|
+
productName: string;
|
|
1278
|
+
centerName: string;
|
|
1279
|
+
customerName: string | null;
|
|
1280
|
+
customerEmail: string | null;
|
|
1281
|
+
originalPayment: {
|
|
1282
|
+
stripePaymentIntentId: string;
|
|
1283
|
+
cardBrand: string | null;
|
|
1284
|
+
cardLast4: string | null;
|
|
1285
|
+
} | null;
|
|
1286
|
+
appliedModifications: {
|
|
1287
|
+
id: string;
|
|
1288
|
+
amountCents: number;
|
|
1289
|
+
stripePaymentIntentId: string | null;
|
|
1290
|
+
cardBrand: string | null;
|
|
1291
|
+
cardLast4: string | null;
|
|
1292
|
+
appliedAt: number | null;
|
|
1293
|
+
}[];
|
|
1294
|
+
creditLedgerEntries: {
|
|
1295
|
+
id: string;
|
|
1296
|
+
displayId: string;
|
|
1297
|
+
entryType: "CREDIT_ISSUED_CANCEL" | "CREDIT_ISSUED_MANUAL" | "CREDIT_ISSUED_ADJUSTMENT" | "CREDIT_CONSUMED" | "CREDIT_REVERSAL" | "CREDIT_ISSUED_MEMBERSHIP_REFUND" | "CREDIT_ISSUED_EVENT_REFUND" | "CREDIT_ISSUED_NO_SHOW" | "WRITE_OFF";
|
|
1298
|
+
amountCents: number;
|
|
1299
|
+
note: string;
|
|
1300
|
+
createdAt: number;
|
|
1301
|
+
}[];
|
|
1302
|
+
bookedAt: number;
|
|
1303
|
+
};
|
|
1304
|
+
type GetProductArgs = {
|
|
1305
|
+
productId: string;
|
|
1306
|
+
};
|
|
1307
|
+
type GetProductResult = {
|
|
1308
|
+
id: string;
|
|
1309
|
+
displayId: string;
|
|
1310
|
+
name: string;
|
|
1311
|
+
description: string | null;
|
|
1312
|
+
attractionId: string;
|
|
1313
|
+
attractionName: string;
|
|
1314
|
+
centerId: string;
|
|
1315
|
+
brandId: string;
|
|
1316
|
+
durationMinutes: number;
|
|
1317
|
+
pricingMode: "per_unit_per_hour" | "per_person_per_hour" | "per_game";
|
|
1318
|
+
minPartySize: number;
|
|
1319
|
+
maxPartySize: number;
|
|
1320
|
+
partyLabelSingular: string;
|
|
1321
|
+
partyLabelPlural: string;
|
|
1322
|
+
unitLabelSingular: string;
|
|
1323
|
+
unitLabelPlural: string;
|
|
1324
|
+
gameLabelSingular: string;
|
|
1325
|
+
gameLabelPlural: string;
|
|
1326
|
+
minDurationMinutes: number;
|
|
1327
|
+
durationIncrementMinutes: number;
|
|
1328
|
+
maxDurationMinutes: number;
|
|
1329
|
+
maxAdvanceDays: number | null;
|
|
1330
|
+
shoeMode: "included" | "addon" | "per_offer";
|
|
1331
|
+
defaultShoeAddonId: string | null;
|
|
1332
|
+
};
|
|
1333
|
+
type GetMembershipArgs = {
|
|
1334
|
+
shareToken?: string | undefined;
|
|
1335
|
+
templateId: string;
|
|
1336
|
+
};
|
|
1337
|
+
type GetMembershipResult = {
|
|
1338
|
+
id: string;
|
|
1339
|
+
displayId: string;
|
|
1340
|
+
name: string;
|
|
1341
|
+
description: string | null;
|
|
1342
|
+
type: "space_availability" | "game_pass" | "hybrid";
|
|
1343
|
+
recurringPriceCents: number;
|
|
1344
|
+
recurringCadence: "monthly" | "annual" | "one_time";
|
|
1345
|
+
setupFeeCents: number;
|
|
1346
|
+
fixedStartDate: string | null;
|
|
1347
|
+
fixedEndDate: string | null;
|
|
1348
|
+
entitlements: {
|
|
1349
|
+
attractionTypeKey: string;
|
|
1350
|
+
gamesPerPeriod: number | null;
|
|
1351
|
+
unlimited: boolean;
|
|
1352
|
+
gamesPerDay: number | null;
|
|
1353
|
+
includesShoeRental: boolean;
|
|
1354
|
+
sessionDurationMinutes: number | null;
|
|
1355
|
+
}[];
|
|
1356
|
+
gracePeriodDays: number;
|
|
1357
|
+
namedMemberSeatCount: number | null;
|
|
1358
|
+
};
|
|
1359
|
+
type GetGameCardArgs = {
|
|
1360
|
+
shareToken?: string | undefined;
|
|
1361
|
+
templateId: string;
|
|
1362
|
+
};
|
|
1363
|
+
type GetGameCardResult = {
|
|
1364
|
+
id: string;
|
|
1365
|
+
brandId: string;
|
|
1366
|
+
displayId: string;
|
|
1367
|
+
name: string;
|
|
1368
|
+
description: string | null;
|
|
1369
|
+
totalGames: number;
|
|
1370
|
+
expiryMonths: number;
|
|
1371
|
+
priceCents: number;
|
|
1372
|
+
shoesIncluded: boolean;
|
|
1373
|
+
};
|
|
1374
|
+
type ListProductSubtypesArgs = {
|
|
1375
|
+
productId: string;
|
|
1376
|
+
};
|
|
1377
|
+
type ListProductSubtypesResult = {
|
|
1378
|
+
id: string;
|
|
1379
|
+
name: string;
|
|
1380
|
+
upcharge: {
|
|
1381
|
+
kind: "flat" | "percent" | "replacement";
|
|
1382
|
+
value: number;
|
|
1383
|
+
};
|
|
1384
|
+
}[];
|
|
1385
|
+
type ListBrandMembershipsArgs = {
|
|
1386
|
+
brandId: string;
|
|
1387
|
+
};
|
|
1388
|
+
type ListBrandMembershipsResult = {
|
|
1389
|
+
id: string;
|
|
1390
|
+
displayId: string;
|
|
1391
|
+
name: string;
|
|
1392
|
+
description: string | null;
|
|
1393
|
+
type: "space_availability" | "game_pass" | "hybrid";
|
|
1394
|
+
recurringPriceCents: number;
|
|
1395
|
+
recurringCadence: "monthly" | "annual" | "one_time";
|
|
1396
|
+
availableAtCenters: string | string[];
|
|
1397
|
+
}[];
|
|
1398
|
+
type GetPackagesLabelArgs = {
|
|
1399
|
+
brandId: string;
|
|
1400
|
+
};
|
|
1401
|
+
type GetPackagesLabelResult = {
|
|
1402
|
+
label: string;
|
|
1403
|
+
};
|
|
1404
|
+
type PreviewSlotPricesArgs = {
|
|
1405
|
+
units?: number | undefined;
|
|
1406
|
+
persons?: number | undefined;
|
|
1407
|
+
games?: number | undefined;
|
|
1408
|
+
centerId: string;
|
|
1409
|
+
productId: string;
|
|
1410
|
+
dateISO: string;
|
|
1411
|
+
mode: "per_unit_per_hour" | "per_person_per_hour" | "per_game";
|
|
1412
|
+
duration: number;
|
|
1413
|
+
slots: number[];
|
|
1414
|
+
};
|
|
1415
|
+
type PreviewSlotPricesResult = {
|
|
1416
|
+
startMinuteOfDay: number;
|
|
1417
|
+
headlinePriceCents: number | null;
|
|
1418
|
+
}[];
|
|
1419
|
+
type ListHoursArgs = {
|
|
1420
|
+
centerId: string;
|
|
1421
|
+
};
|
|
1422
|
+
type ListHoursResult = {
|
|
1423
|
+
defaultHours: {
|
|
1424
|
+
attractionId: string;
|
|
1425
|
+
attractionName: string;
|
|
1426
|
+
fromDate: string;
|
|
1427
|
+
toDate: string;
|
|
1428
|
+
weeklyHours: ({
|
|
1429
|
+
openMinute: number;
|
|
1430
|
+
closeMinute: number;
|
|
1431
|
+
} | null)[];
|
|
1432
|
+
}[];
|
|
1433
|
+
exceptions: {
|
|
1434
|
+
attractionId: string;
|
|
1435
|
+
attractionName: string;
|
|
1436
|
+
productId: string | null;
|
|
1437
|
+
type: "available" | "blocked";
|
|
1438
|
+
startMinuteOfDay: number;
|
|
1439
|
+
endMinuteOfDay: number;
|
|
1440
|
+
daysOfWeek: number[] | null;
|
|
1441
|
+
singleDate: string | null;
|
|
1442
|
+
}[];
|
|
1443
|
+
};
|
|
1444
|
+
type GetOperatingHoursArgs = {
|
|
1445
|
+
productId: string;
|
|
1446
|
+
dateISO: string;
|
|
1447
|
+
};
|
|
1448
|
+
type GetOperatingHoursResult = {
|
|
1449
|
+
openMinute: number;
|
|
1450
|
+
closeMinute: number;
|
|
1451
|
+
} | null;
|
|
1452
|
+
type GetCenterOperatingHoursForTypeArgs = {
|
|
1453
|
+
centerId: string;
|
|
1454
|
+
dateISO: string;
|
|
1455
|
+
attractionTypeKey: string;
|
|
1456
|
+
};
|
|
1457
|
+
type GetCenterOperatingHoursForTypeResult = {
|
|
1458
|
+
openMinute: number;
|
|
1459
|
+
closeMinute: number;
|
|
1460
|
+
} | null;
|
|
1461
|
+
type ListCentersArgs = {
|
|
1462
|
+
brandId: string;
|
|
1463
|
+
};
|
|
1464
|
+
type ListCentersResult = {
|
|
1465
|
+
id: string;
|
|
1466
|
+
displayId: string;
|
|
1467
|
+
name: string;
|
|
1468
|
+
timezone: string;
|
|
1469
|
+
customWebsiteUrl: string | null;
|
|
1470
|
+
status: "active" | "suspended" | "churned" | "onboarding" | "trial";
|
|
1471
|
+
address: {
|
|
1472
|
+
line2?: string | undefined;
|
|
1473
|
+
line1: string;
|
|
1474
|
+
city: string;
|
|
1475
|
+
region: string;
|
|
1476
|
+
postalCode: string;
|
|
1477
|
+
country: string;
|
|
1478
|
+
} | null | undefined;
|
|
1479
|
+
}[];
|
|
1480
|
+
type CancelMyMembershipArgs = {
|
|
1481
|
+
reason?: string | undefined;
|
|
1482
|
+
brandId: string;
|
|
1483
|
+
idempotencyKey: string;
|
|
1484
|
+
membershipId: string;
|
|
1485
|
+
expectedVersion: number;
|
|
1486
|
+
};
|
|
1487
|
+
type CancelMyMembershipResult = {
|
|
1488
|
+
id: string;
|
|
1489
|
+
version: number;
|
|
1490
|
+
status: "cancel_at_period_end";
|
|
1491
|
+
currentPeriodEndsAt: number;
|
|
1492
|
+
};
|
|
1493
|
+
type ApplyMyModificationArgs = {
|
|
1494
|
+
newGames?: number | undefined;
|
|
1495
|
+
newAddons?: {
|
|
1496
|
+
addonId: string;
|
|
1497
|
+
quantity: number;
|
|
1498
|
+
}[] | undefined;
|
|
1499
|
+
refundMode?: "refund" | "credit" | undefined;
|
|
1500
|
+
applyCredit?: boolean | undefined;
|
|
1501
|
+
brandId: string;
|
|
1502
|
+
idempotencyKey: string;
|
|
1503
|
+
reservationId: string;
|
|
1504
|
+
newDateISO: string;
|
|
1505
|
+
newStartMinuteOfDay: number;
|
|
1506
|
+
newEndMinuteOfDay: number;
|
|
1507
|
+
newUnits: number;
|
|
1508
|
+
newPersons: number;
|
|
1509
|
+
expectedVersion: number;
|
|
1510
|
+
};
|
|
1511
|
+
type ApplyMyModificationResult = {
|
|
1512
|
+
id: string;
|
|
1513
|
+
version: number;
|
|
1514
|
+
diffCents: number;
|
|
1515
|
+
refundedCents: number;
|
|
1516
|
+
creditedCents: number;
|
|
1517
|
+
newFinalCents: number;
|
|
1518
|
+
requiresPayment: false;
|
|
1519
|
+
pendingModificationId: null;
|
|
1520
|
+
} | {
|
|
1521
|
+
id: string;
|
|
1522
|
+
version: number;
|
|
1523
|
+
diffCents: number;
|
|
1524
|
+
refundedCents: number;
|
|
1525
|
+
creditedCents: number;
|
|
1526
|
+
newFinalCents: number;
|
|
1527
|
+
requiresPayment: true;
|
|
1528
|
+
pendingModificationId: string;
|
|
1529
|
+
};
|
|
1530
|
+
type CancelCheckoutPaymentArgs = {
|
|
1531
|
+
refToken: string;
|
|
1532
|
+
};
|
|
1533
|
+
type CancelCheckoutPaymentResult = {
|
|
1534
|
+
cancelled: boolean;
|
|
1535
|
+
};
|
|
1536
|
+
interface MembershipMember {
|
|
1537
|
+
id: string | null;
|
|
1538
|
+
customerId: string;
|
|
1539
|
+
customerName: string;
|
|
1540
|
+
customerEmail: string | null;
|
|
1541
|
+
isPayingMember: boolean;
|
|
1542
|
+
addedAt: number;
|
|
1543
|
+
}
|
|
1544
|
+
type AccountDeletionPreview = {
|
|
1545
|
+
memberships: Array<{
|
|
1546
|
+
id: string;
|
|
1547
|
+
name: string;
|
|
1548
|
+
status: string;
|
|
1549
|
+
endsAt: number;
|
|
1550
|
+
autoRenew: boolean;
|
|
1551
|
+
willCancelStripe: boolean;
|
|
1552
|
+
forfeitsRemainingTime: boolean;
|
|
1553
|
+
}>;
|
|
1554
|
+
upcoming: Array<{
|
|
1555
|
+
kind: "reservation" | "party" | "event";
|
|
1556
|
+
id: string;
|
|
1557
|
+
displayId: string;
|
|
1558
|
+
date: string;
|
|
1559
|
+
centerName: string;
|
|
1560
|
+
refundPreview: {
|
|
1561
|
+
refundCents: number;
|
|
1562
|
+
feeCents: number;
|
|
1563
|
+
creditCents: number;
|
|
1564
|
+
policyLabel: string;
|
|
1565
|
+
};
|
|
1566
|
+
}>;
|
|
1567
|
+
loses: string[];
|
|
1568
|
+
confirmPhrase: "DELETE";
|
|
1569
|
+
previewToken: string;
|
|
1570
|
+
};
|
|
1571
|
+
type ExportMyDataV2Result = {
|
|
1572
|
+
url: string;
|
|
1573
|
+
expiresAt: number;
|
|
1574
|
+
};
|
|
1575
|
+
/** Slot-full remains VALIDATION_FAILED for older consumers. */
|
|
1576
|
+
type SlotFullDetails = {
|
|
1577
|
+
reason: "slot_full";
|
|
1578
|
+
waitlistAvailable: boolean;
|
|
1579
|
+
requested: number;
|
|
1580
|
+
available: number;
|
|
1581
|
+
};
|
|
1582
|
+
type JoinWaitlistArgs = Omit<BookingPreviewArgs, "shareToken"> & {
|
|
1583
|
+
brandId?: string;
|
|
1584
|
+
promoCode?: string;
|
|
1585
|
+
/** Consent for texts about this waitlist only. Omitted defaults to false. */
|
|
1586
|
+
textUpdates?: boolean;
|
|
1587
|
+
};
|
|
1588
|
+
type WaitlistEntryArgs = {
|
|
1589
|
+
entryId: string;
|
|
1590
|
+
brandId?: string;
|
|
1591
|
+
centerId?: string;
|
|
1592
|
+
};
|
|
1593
|
+
type JoinWaitlistResult = {
|
|
1594
|
+
entryId: string;
|
|
1595
|
+
displayId: string;
|
|
1596
|
+
amountCents: number;
|
|
1597
|
+
breakdown?: Record<string, unknown>;
|
|
1598
|
+
};
|
|
1599
|
+
type WaitlistSetupIntent = {
|
|
1600
|
+
clientSecret: string;
|
|
1601
|
+
customerSessionClientSecret: string;
|
|
1602
|
+
publishableKey: string;
|
|
1603
|
+
stripeAccount: string;
|
|
1604
|
+
stripeMode: "test" | "live";
|
|
1605
|
+
};
|
|
1606
|
+
type MyWaitlistEntry = {
|
|
1607
|
+
units?: number;
|
|
1608
|
+
unitLabelSingular?: string;
|
|
1609
|
+
unitLabelPlural?: string;
|
|
1610
|
+
attractionName?: string;
|
|
1611
|
+
promotedStartMinuteOfDay?: number;
|
|
1612
|
+
promotedEndMinuteOfDay?: number;
|
|
1613
|
+
textUpdates?: boolean;
|
|
1614
|
+
entryId: string;
|
|
1615
|
+
displayId: string;
|
|
1616
|
+
center?: string;
|
|
1617
|
+
product?: string;
|
|
1618
|
+
dateISO: string;
|
|
1619
|
+
startMinuteOfDay: number;
|
|
1620
|
+
endMinuteOfDay: number;
|
|
1621
|
+
amountCents: number;
|
|
1622
|
+
card?: {
|
|
1623
|
+
brand?: string;
|
|
1624
|
+
last4?: string;
|
|
1625
|
+
};
|
|
1626
|
+
status: "pending_card" | "waiting" | "promoted" | "cancelled" | "expired";
|
|
1627
|
+
promotedReservationDisplayId?: string;
|
|
1628
|
+
};
|
|
1629
|
+
|
|
1630
|
+
/**
|
|
1631
|
+
* Typed account + flash reads for @bowlos/reservations.
|
|
1632
|
+
*
|
|
1633
|
+
* Session-scoped account reads (require a signed-in customer) and the
|
|
1634
|
+
* session-aware flash-sale reads. Args are typed precisely — every account read
|
|
1635
|
+
* is brand-scoped. Results are generic (`<T = unknown>`): parameterize with your
|
|
1636
|
+
* own shape, or read `unknown` and narrow. (The backend return shapes are rich
|
|
1637
|
+
* and evolving; the SDK doesn't pin them here.) Each read has a framework-agnostic
|
|
1638
|
+
* function here and a React hook in `hooks.tsx`.
|
|
1639
|
+
*/
|
|
1640
|
+
|
|
1641
|
+
/** Every account read is scoped to the customer's Brand. */
|
|
1642
|
+
type BrandScoped = {
|
|
1643
|
+
brandId: string;
|
|
1644
|
+
};
|
|
1645
|
+
type ReservationDetailArgs = {
|
|
1646
|
+
brandId: string;
|
|
1647
|
+
displayId: string;
|
|
1648
|
+
};
|
|
1649
|
+
type EventOrderDetailArgs = {
|
|
1650
|
+
brandId: string;
|
|
1651
|
+
orderId: string;
|
|
1652
|
+
};
|
|
1653
|
+
type MembershipDetailArgs = {
|
|
1654
|
+
brandId: string;
|
|
1655
|
+
membershipId: string;
|
|
1656
|
+
};
|
|
1657
|
+
type FlashSaleArgs = {
|
|
1658
|
+
slug: string;
|
|
1659
|
+
};
|
|
1660
|
+
type FlashBookingOptionsArgs = {
|
|
1661
|
+
slug: string;
|
|
1662
|
+
itemId: string;
|
|
1663
|
+
};
|
|
1664
|
+
type FlashSalesArgs = {
|
|
1665
|
+
brandId: string;
|
|
1666
|
+
};
|
|
1667
|
+
declare function getMyReservations<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
1668
|
+
declare function getMyReservationDetail<T = unknown>(client: BowlosClient, args: ReservationDetailArgs): Promise<T>;
|
|
1669
|
+
declare function getMyEventOrders<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
1670
|
+
declare function getMyEventOrder<T = unknown>(client: BowlosClient, args: EventOrderDetailArgs): Promise<T>;
|
|
1671
|
+
declare function getMyMemberships<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
1672
|
+
declare function getMyMembershipDetail<T = unknown>(client: BowlosClient, args: MembershipDetailArgs): Promise<T>;
|
|
1673
|
+
declare function getMyLoyalty<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
1674
|
+
declare function getMyCredits<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
1675
|
+
declare function getMyPasses<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
1676
|
+
declare function getMyGameCards<T = MyGameCard[]>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
1677
|
+
/** Outcome preview shared by all four cancel types. `bucket`/`hoursBeforeStart`/
|
|
1678
|
+
* `forfeitCents` are inert (null/0) for game cards (no time policy). */
|
|
1679
|
+
interface CancelPreview {
|
|
1680
|
+
cancellable: boolean;
|
|
1681
|
+
reason: string | null;
|
|
1682
|
+
bucket: string | null;
|
|
1683
|
+
hoursBeforeStart: number;
|
|
1684
|
+
creditCents: number;
|
|
1685
|
+
forfeitCents: number;
|
|
1686
|
+
paidCents: number;
|
|
1687
|
+
}
|
|
1688
|
+
interface CancelResult {
|
|
1689
|
+
id: string;
|
|
1690
|
+
status: string;
|
|
1691
|
+
creditCents: number;
|
|
1692
|
+
bucket?: string | null;
|
|
1693
|
+
hoursBeforeStart?: number;
|
|
1694
|
+
forfeitCents?: number;
|
|
1695
|
+
version?: number;
|
|
1696
|
+
}
|
|
1697
|
+
interface MyGameCard {
|
|
1698
|
+
id: string;
|
|
1699
|
+
displayId: string;
|
|
1700
|
+
cardName: string;
|
|
1701
|
+
status: "active" | "depleted" | "expired" | "cancelled" | "refunded";
|
|
1702
|
+
totalGames: number;
|
|
1703
|
+
remainingGames: number;
|
|
1704
|
+
shoesIncluded: boolean;
|
|
1705
|
+
purchasedAt: number;
|
|
1706
|
+
expiresAt: number;
|
|
1707
|
+
paidCents: number;
|
|
1708
|
+
/** Precomputed unused-only rule; the per-card preview is the source of truth. */
|
|
1709
|
+
cancellable: boolean;
|
|
1710
|
+
}
|
|
1711
|
+
type ReservationCancelArgs = {
|
|
1712
|
+
brandId: string;
|
|
1713
|
+
reservationId: string;
|
|
1714
|
+
expectedVersion: number;
|
|
1715
|
+
reason?: string;
|
|
1716
|
+
/** Per-attempt key; safe to retry. */
|
|
1717
|
+
idempotencyKey: string;
|
|
1718
|
+
};
|
|
1719
|
+
type OrderCancelArgs = {
|
|
1720
|
+
brandId: string;
|
|
1721
|
+
orderId: string;
|
|
1722
|
+
reason?: string;
|
|
1723
|
+
idempotencyKey: string;
|
|
1724
|
+
};
|
|
1725
|
+
type GameCardCancelArgs = {
|
|
1726
|
+
brandId: string;
|
|
1727
|
+
cardId: string;
|
|
1728
|
+
reason?: string;
|
|
1729
|
+
idempotencyKey: string;
|
|
1730
|
+
};
|
|
1731
|
+
declare function previewReservationCancellation<T = CancelPreview>(client: BowlosClient, args: {
|
|
1732
|
+
brandId: string;
|
|
1733
|
+
reservationId: string;
|
|
1734
|
+
}): Promise<T>;
|
|
1735
|
+
declare function previewEventOrderCancellation<T = CancelPreview>(client: BowlosClient, args: {
|
|
1736
|
+
brandId: string;
|
|
1737
|
+
orderId: string;
|
|
1738
|
+
}): Promise<T>;
|
|
1739
|
+
declare function previewPackageOrderCancellation<T = CancelPreview>(client: BowlosClient, args: {
|
|
1740
|
+
brandId: string;
|
|
1741
|
+
orderId: string;
|
|
1742
|
+
}): Promise<T>;
|
|
1743
|
+
declare function previewGameCardCancellation<T = CancelPreview>(client: BowlosClient, args: {
|
|
1744
|
+
brandId: string;
|
|
1745
|
+
cardId: string;
|
|
1746
|
+
}): Promise<T>;
|
|
1747
|
+
declare function cancelMyReservation<T = CancelResult>(client: BowlosClient, args: ReservationCancelArgs): Promise<T>;
|
|
1748
|
+
declare function cancelMyEventOrder<T = CancelResult>(client: BowlosClient, args: OrderCancelArgs): Promise<T>;
|
|
1749
|
+
declare function cancelMyPackageOrder<T = CancelResult>(client: BowlosClient, args: OrderCancelArgs): Promise<T>;
|
|
1750
|
+
declare function cancelMyGameCard<T = CancelResult>(client: BowlosClient, args: GameCardCancelArgs): Promise<T>;
|
|
1751
|
+
declare function getFlashSale<T = unknown>(client: BowlosClient, args: FlashSaleArgs): Promise<T>;
|
|
1752
|
+
/** The public flash-sale index for a Brand (live + upcoming; no prices). Public. */
|
|
1753
|
+
declare function getFlashSales<T = unknown>(client: BowlosClient, args: FlashSalesArgs): Promise<T>;
|
|
1754
|
+
declare function getFlashSaleBookingOptions<T = unknown>(client: BowlosClient, args: FlashBookingOptionsArgs): Promise<T>;
|
|
1755
|
+
type CreateFlashSaleBookingArgs = {
|
|
1756
|
+
slug: string;
|
|
1757
|
+
itemId: string;
|
|
1758
|
+
dateISO: string;
|
|
1759
|
+
startMinuteOfDay: number;
|
|
1760
|
+
durationMinutes: number;
|
|
1761
|
+
units: number;
|
|
1762
|
+
/** Per-attempt key; replays return the original checkout. */
|
|
1763
|
+
idempotencyKey: string;
|
|
1764
|
+
};
|
|
1765
|
+
interface FlashSaleBookingResult {
|
|
1766
|
+
/** Handle for the rest of the checkout: mint the PaymentIntent with
|
|
1767
|
+
* `createCheckoutPaymentIntent(client, { refToken })`, then poll
|
|
1768
|
+
* `getCheckoutStatus(client, refToken)` to materialization. */
|
|
1769
|
+
refToken: string;
|
|
1770
|
+
/** The SALE-priced total the PaymentIntent charges (base at the flash
|
|
1771
|
+
* price + tax + the Center fee). */
|
|
1772
|
+
amountDueCents: number;
|
|
1773
|
+
holdExpiresAt: number;
|
|
1774
|
+
breakdown: {
|
|
1775
|
+
/** Tier savings already removed from baseSubtotalCents; do not subtract again. */
|
|
1776
|
+
tierDiscountCents: number;
|
|
1777
|
+
baseSubtotalCents: number;
|
|
1778
|
+
reservationFeeCents: number;
|
|
1779
|
+
reservationFeeLabel: string | null;
|
|
1780
|
+
taxAddedCents: number;
|
|
1781
|
+
taxIncludedCents: number;
|
|
1782
|
+
totalCents: number;
|
|
1783
|
+
};
|
|
1784
|
+
}
|
|
1785
|
+
/**
|
|
1786
|
+
* v0.22.1 — book a flash-sale reservation item at its SALE price (the flash
|
|
1787
|
+
* analog of `eventOfferSlug`: the server binds the item's sale price, holds
|
|
1788
|
+
* the inventory, and opens a checkout). Signed-in customers only. Pick the
|
|
1789
|
+
* date/time from `getFlashSaleBookingOptions` — the purpose-built option
|
|
1790
|
+
* list — never the regular booking calendar.
|
|
1791
|
+
*/
|
|
1792
|
+
declare function createFlashSaleBooking(client: BowlosClient, args: CreateFlashSaleBookingArgs): Promise<FlashSaleBookingResult>;
|
|
1793
|
+
/** Saved cards belong to the active location's connected Stripe account. */
|
|
1794
|
+
type SavedCardScope = {
|
|
1795
|
+
brandId: string;
|
|
1796
|
+
centerId: string;
|
|
1797
|
+
};
|
|
1798
|
+
type SavedCardArgs = SavedCardScope & {
|
|
1799
|
+
paymentMethodId: string;
|
|
1800
|
+
};
|
|
1801
|
+
interface SavedCard {
|
|
1802
|
+
id: string;
|
|
1803
|
+
brand: string;
|
|
1804
|
+
last4: string;
|
|
1805
|
+
expMonth: number;
|
|
1806
|
+
expYear: number;
|
|
1807
|
+
isDefault: boolean;
|
|
1808
|
+
}
|
|
1809
|
+
interface SavedCardsResult {
|
|
1810
|
+
methods: SavedCard[];
|
|
1811
|
+
chargeable: boolean;
|
|
1812
|
+
}
|
|
1813
|
+
interface CardSetupResult {
|
|
1814
|
+
clientSecret: string;
|
|
1815
|
+
publishableKey: string;
|
|
1816
|
+
stripeAccount: string;
|
|
1817
|
+
stripeMode: "test" | "live";
|
|
1818
|
+
merchantDisplayName: string;
|
|
1819
|
+
}
|
|
1820
|
+
type ChangePasswordArgs = {
|
|
1821
|
+
currentPassword: string;
|
|
1822
|
+
newPassword: string;
|
|
1823
|
+
};
|
|
1824
|
+
declare function listSavedCards(client: BowlosClient, args: SavedCardScope): Promise<SavedCardsResult>;
|
|
1825
|
+
declare function createCardSetup(client: BowlosClient, args: SavedCardScope): Promise<CardSetupResult>;
|
|
1826
|
+
declare function removeSavedCard(client: BowlosClient, args: SavedCardArgs): Promise<{
|
|
1827
|
+
detached: boolean;
|
|
1828
|
+
}>;
|
|
1829
|
+
declare function setDefaultCard(client: BowlosClient, args: SavedCardArgs): Promise<{
|
|
1830
|
+
ok: boolean;
|
|
1831
|
+
}>;
|
|
1832
|
+
/** Success invalidates all sessions; discard local tokens and show sign-in. */
|
|
1833
|
+
declare function changePassword(client: BowlosClient, args: ChangePasswordArgs): Promise<{
|
|
1834
|
+
ok: true;
|
|
1835
|
+
}>;
|
|
1836
|
+
|
|
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 PackagePurchaseIntent 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 GameCardCheckoutStatus as aA, type GameCardPreviewArgs as aB, type GameCardPreviewResult as aC, type GameCardPurchaseArgs as aD, type GameCardPurchaseIntent as aE, type GameCardStatusResult as aF, type JoinWaitlistArgs as aG, type JoinWaitlistResult as aH, type LinkProfile as aI, type MembershipCheckoutStatus as aJ, type MembershipDetailArgs as aK, type MembershipMember as aL, type MembershipPreviewArgs as aM, type MembershipPreviewResult as aN, type MembershipPurchaseArgs as aO, type MembershipPurchaseIntent as aP, type MembershipStatusResult as aQ, type MembershipSubscriptionArgs as aR, type MembershipSubscriptionIntent as aS, type MembershipSubscriptionPreviewResult as aT, type MyGameCard as aU, type MyWaitlistEntry as aV, type OrderCancelArgs as aW, type PackageCheckoutStatus as aX, type PackagePreviewArgs as aY, type PackagePreviewResult as aZ, type PackagePurchaseArgs 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 EventOrderDetailArgs as ao, type EventTicketCheckoutStatus as ap, type EventTicketPreviewArgs as aq, type EventTicketPreviewResult as ar, type EventTicketPurchaseArgs as as, type EventTicketPurchaseIntent as at, type EventTicketStatusResult as au, type FlashBookingOptionsArgs as av, type FlashSaleArgs as aw, type FlashSaleBookingResult as ax, type FlashSalesArgs as ay, type GameCardCancelArgs as az, type ApplyMyModificationArgs as b, localStorageTokenStore as b$, type PackageStatusResult as b0, type PaymentIntentInfo as b1, type PingResult as b2, type PricingMode as b3, type PublicAddon as b4, type ReservationCancelArgs as b5, type ReservationDetailArgs as b6, type SavedCard as b7, type SavedCardArgs as b8, type SavedCardScope as b9, createPackageOrder as bA, createWaitlistSetupIntent as bB, generateIdempotencyKey as bC, getCheckoutStatus as bD, getEventTicketStatus as bE, getFlashSale as bF, getFlashSaleBookingOptions as bG, getFlashSales as bH, getGameCardStatus as bI, getMembershipStatus as bJ, getMyCredits as bK, getMyEventOrder as bL, getMyEventOrders as bM, getMyGameCards as bN, getMyLoyalty as bO, getMyMembershipDetail as bP, getMyMemberships as bQ, getMyPasses as bR, getMyReservationDetail as bS, getMyReservations as bT, getPackageStatus as bU, joinWaitlist as bV, leaveWaitlist as bW, listAddons as bX, listMyWaitlist as bY, listSavedCards as bZ, listStartTimes as b_, type SavedCardsResult as ba, type SlotFullDetails as bb, type StartTimesArgs as bc, type TokenStore as bd, type Tokens as be, type WaitlistEntryArgs as bf, type WaitlistSetupIntent as bg, abandonCheckout as bh, availableUnitCount as bi, bookingPreview as bj, cancelMyEventOrder as bk, cancelMyGameCard as bl, cancelMyPackageOrder as bm, cancelMyReservation as bn, changePassword as bo, checkAvailability as bp, confirmWaitlistCard as bq, createBooking as br, createBowlosClient as bs, createCardSetup as bt, createCheckoutPaymentIntent as bu, createEventTicketOrder as bv, createFlashSaleBooking as bw, createGameCardOrder as bx, createMembershipOrder as by, createMembershipSubscriptionOrder as bz, type ApplyMyModificationResult as c, previewEventOrderCancellation as c0, previewEventTicket as c1, previewGameCard as c2, previewGameCardCancellation as c3, previewMembership as c4, previewMembershipSubscription as c5, previewPackage as c6, previewPackageOrderCancellation as c7, previewReservationCancellation as c8, removeSavedCard as c9, setDefaultCard as ca, 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 };
|