@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
package/dist/data-BJkB-tvM.d.ts
DELETED
|
@@ -1,778 +0,0 @@
|
|
|
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
|
-
/**
|
|
159
|
-
* Typed data surface for @bowlos/reservations — booking-funnel reads.
|
|
160
|
-
*
|
|
161
|
-
* Arg shapes mirror the gateway functions; result shapes type the headline
|
|
162
|
-
* fields and pass the rest through (`[key: string]: unknown`), so the backend's
|
|
163
|
-
* full breakdown can grow without an SDK release. Each read has a
|
|
164
|
-
* framework-agnostic function here and a React hook in `hooks.tsx`, sharing
|
|
165
|
-
* these types.
|
|
166
|
-
*
|
|
167
|
-
* This file is React-free, so it's exported from the core entry. The hooks
|
|
168
|
-
* (React) live in `hooks.tsx` under the React entry.
|
|
169
|
-
*/
|
|
170
|
-
|
|
171
|
-
/** Inputs for `checkAvailability`. Times are minutes-of-day in the Center's tz. */
|
|
172
|
-
type AvailabilityArgs = {
|
|
173
|
-
productId: string;
|
|
174
|
-
dateISO: string;
|
|
175
|
-
startMinuteOfDay: number;
|
|
176
|
-
endMinuteOfDay: number;
|
|
177
|
-
};
|
|
178
|
-
interface AvailabilityResult {
|
|
179
|
-
totalUnits: number;
|
|
180
|
-
busyUnitIds: string[];
|
|
181
|
-
/** Operator-configured noun for a bookable unit (a lane/room/bay), both
|
|
182
|
-
* forms so you pick by count ("1 lane" vs "2 lanes"). Label it
|
|
183
|
-
* "available"/"open", never "free". Optional — older gateways omit it;
|
|
184
|
-
* fall back to "lane"/"lanes". Added v0.35.0. */
|
|
185
|
-
unitNoun?: {
|
|
186
|
-
singular: string;
|
|
187
|
-
plural: string;
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
type PricingMode = "per_unit_per_hour" | "per_person_per_hour" | "per_game";
|
|
191
|
-
type BookingAddonSelection = {
|
|
192
|
-
addonId: string;
|
|
193
|
-
quantity: number;
|
|
194
|
-
};
|
|
195
|
-
/** A bookable add-on for a product (shoe rental, upgrades…). `rateMode` is how
|
|
196
|
-
* it prices — `per_person` (× bowlers), `per_unit` (× lanes), or `flat` (once).
|
|
197
|
-
* `defaultQuantityRule: "one_per_guest"` hints the natural quantity is the
|
|
198
|
-
* party size; `"manual"` means the customer picks. */
|
|
199
|
-
interface PublicAddon {
|
|
200
|
-
id: string;
|
|
201
|
-
displayId: string;
|
|
202
|
-
name: string;
|
|
203
|
-
description: string | null;
|
|
204
|
-
priceCents: number;
|
|
205
|
-
rateMode: "per_person" | "per_unit" | "flat";
|
|
206
|
-
defaultQuantityRule: "one_per_guest" | "manual";
|
|
207
|
-
}
|
|
208
|
-
/** Inputs for `bookingPreview` (the authoritative price quote). */
|
|
209
|
-
type BookingPreviewArgs = {
|
|
210
|
-
centerId: string;
|
|
211
|
-
productId: string;
|
|
212
|
-
dateISO: string;
|
|
213
|
-
startMinuteOfDay: number;
|
|
214
|
-
endMinuteOfDay: number;
|
|
215
|
-
mode: PricingMode;
|
|
216
|
-
units?: number;
|
|
217
|
-
persons?: number;
|
|
218
|
-
games?: number;
|
|
219
|
-
addons?: BookingAddonSelection[];
|
|
220
|
-
shareToken?: string;
|
|
221
|
-
subtypeId?: string;
|
|
222
|
-
/** Reservation-mode event offer slug. Binds preview to that offer's event
|
|
223
|
-
* price plan, tax override, and Center fee override/inheritance. */
|
|
224
|
-
eventOfferSlug?: string;
|
|
225
|
-
};
|
|
226
|
-
/** One add-on line on a plan quote. A plan-included add-on (e.g. shoes on a
|
|
227
|
-
* "Thursday Special") is already dropped from this list — it won't appear. */
|
|
228
|
-
interface BookingQuoteAddonLine {
|
|
229
|
-
addonId: string;
|
|
230
|
-
addonName: string;
|
|
231
|
-
quantity: number;
|
|
232
|
-
unitPriceCents: number;
|
|
233
|
-
lineSubtotalCents: number;
|
|
234
|
-
rateMode?: string;
|
|
235
|
-
}
|
|
236
|
-
/** Per-plan price breakdown. Render THESE fields to itemize the order — do not
|
|
237
|
-
* reconstruct a base by subtracting tax/fee/add-ons from the total, and do not
|
|
238
|
-
* recompute the discount client-side. `preDiscountTotalCents` is the original
|
|
239
|
-
* (base + add-ons, before discount); `appliedDiscount` is present only when a
|
|
240
|
-
* discount applied; `finalCents` is the subtotal after discount, BEFORE tax +
|
|
241
|
-
* fee. The all-in charge is `totalCentsPerPlan[samePlanId].totalCents`. */
|
|
242
|
-
interface BookingQuotePlan {
|
|
243
|
-
pricePlanId: string;
|
|
244
|
-
pricePlanName: string;
|
|
245
|
-
pricePlanDescription?: string;
|
|
246
|
-
baseSubtotalCents: number;
|
|
247
|
-
addonSubtotalCents: number;
|
|
248
|
-
addonLineItems: BookingQuoteAddonLine[];
|
|
249
|
-
preDiscountTotalCents: number;
|
|
250
|
-
/** Present only when a discount applied. `.label` is display text
|
|
251
|
-
* ("Online booking discount"); `.amountCents` is the amount to subtract. */
|
|
252
|
-
appliedDiscount?: {
|
|
253
|
-
amountCents: number;
|
|
254
|
-
label: string;
|
|
255
|
-
source: string;
|
|
256
|
-
};
|
|
257
|
-
/** Subtotal after discount, before tax + fee. */
|
|
258
|
-
finalCents: number;
|
|
259
|
-
/** True when this plan/special bundles shoes — hide the shoe add-on selector
|
|
260
|
-
* and show a "Shoes included" line instead of a priced shoe row. */
|
|
261
|
-
shoesIncluded?: boolean;
|
|
262
|
-
}
|
|
263
|
-
/** The price quote. Headline fields are typed; the engine's full breakdown
|
|
264
|
-
* (line items, discounts, tax, credit) is passed through. Join `plans`,
|
|
265
|
-
* `taxLinesPerPlan`, and `totalCentsPerPlan` by `pricePlanId` — never index
|
|
266
|
-
* `[0]` blindly when more than one plan can be returned. */
|
|
267
|
-
interface BookingQuote {
|
|
268
|
-
reservationFee: Record<string, unknown> | null;
|
|
269
|
-
/** Per-plan breakdown (name, original price, applied discount, line items).
|
|
270
|
-
* Optional for back-compat with older cores that didn't type it. */
|
|
271
|
-
plans?: BookingQuotePlan[];
|
|
272
|
-
totalCentsPerPlan: Array<{
|
|
273
|
-
pricePlanId: string;
|
|
274
|
-
totalCents: number;
|
|
275
|
-
}>;
|
|
276
|
-
taxLinesPerPlan?: Array<{
|
|
277
|
-
pricePlanId: string;
|
|
278
|
-
taxLines: Array<{
|
|
279
|
-
rateId: string;
|
|
280
|
-
label: string;
|
|
281
|
-
rateBasisPoints: number;
|
|
282
|
-
mode: "added" | "included";
|
|
283
|
-
taxableBaseCents: number;
|
|
284
|
-
taxCents: number;
|
|
285
|
-
}>;
|
|
286
|
-
taxTotalCents: number;
|
|
287
|
-
}>;
|
|
288
|
-
/** Operator-configured noun for this booking's count, resolved by pricing
|
|
289
|
-
* mode (unit → lane/room, per-person → bowler/guest, per-game → game).
|
|
290
|
-
* Both forms so you render "{count} {singular|plural}" — e.g. "1 room",
|
|
291
|
-
* "2 rooms" — instead of hardcoding "lane"/"lanes". Optional — older
|
|
292
|
-
* gateways omit it; fall back to a sensible default. Added v0.35.0. */
|
|
293
|
-
unitNoun?: {
|
|
294
|
-
singular: string;
|
|
295
|
-
plural: string;
|
|
296
|
-
};
|
|
297
|
-
[key: string]: unknown;
|
|
298
|
-
}
|
|
299
|
-
/** Available (unoccupied) units for a product/date/time window (anonymous). */
|
|
300
|
-
declare function checkAvailability(client: BowlosClient, args: AvailabilityArgs): Promise<AvailabilityResult>;
|
|
301
|
-
/** Authoritative price quote for the chosen inputs. Anonymous by default
|
|
302
|
-
* (the center's standard online price). Pass `{ auth: true }` when the
|
|
303
|
-
* customer has a session so the quote includes member rate + account
|
|
304
|
-
* credit — headless sites must opt in, since the core doesn't track
|
|
305
|
-
* session state. (The `<BookingFlow>` reference + `useBookingPreview`
|
|
306
|
-
* hook do this automatically off `useAccount`.) */
|
|
307
|
-
declare function bookingPreview(client: BowlosClient, args: BookingPreviewArgs, opts?: {
|
|
308
|
-
auth?: boolean;
|
|
309
|
-
}): Promise<BookingQuote>;
|
|
310
|
-
/** Add-ons available for a product (shoe rental, upgrades…). Anonymous-callable;
|
|
311
|
-
* feed the customer's picks back as `addons` on the preview + the booking. */
|
|
312
|
-
declare function listAddons(client: BowlosClient, args: {
|
|
313
|
-
productId: string;
|
|
314
|
-
}): Promise<PublicAddon[]>;
|
|
315
|
-
/** Inputs for `availableStartTimes`. */
|
|
316
|
-
type StartTimesArgs = {
|
|
317
|
-
productId: string;
|
|
318
|
-
dateISO: string;
|
|
319
|
-
/** Booking length, to leave room before close. Default 60 on the server. */
|
|
320
|
-
durationMinutes?: number;
|
|
321
|
-
/** Grid step in minutes. Default 30 on the server. */
|
|
322
|
-
stepMinutes?: number;
|
|
323
|
-
mode?: PricingMode;
|
|
324
|
-
};
|
|
325
|
-
/** The bookable start times (minute-of-day, ascending) for a product on a date:
|
|
326
|
-
* within operating hours, past the booking buffer, and backed by a real price
|
|
327
|
-
* plan (same pricing engine the quote uses). Anonymous-callable. */
|
|
328
|
-
declare function listStartTimes(client: BowlosClient, args: StartTimesArgs): Promise<number[]>;
|
|
329
|
-
/** Convenience: available units = total minus the busy set (never negative).
|
|
330
|
-
* This is an availability count of UNOCCUPIED units — it is NOT a
|
|
331
|
-
* complimentary/price signal. Never render it as "free" next to a price
|
|
332
|
-
* (e.g. "2 lanes free"); label it "available"/"open". */
|
|
333
|
-
declare function availableUnitCount(availability: AvailabilityResult): number;
|
|
334
|
-
/** Customer identity for a booking (collected in the booking form; the server
|
|
335
|
-
* links/creates the customer per the booking-flow-only signup rule). */
|
|
336
|
-
type BookingCustomer = {
|
|
337
|
-
fullName: string;
|
|
338
|
-
email: string;
|
|
339
|
-
mobile?: string;
|
|
340
|
-
marketingOptIn: boolean;
|
|
341
|
-
};
|
|
342
|
-
/** Inputs for `createAnonymousBooking` — places the inventory hold. */
|
|
343
|
-
type CreateBookingArgs = {
|
|
344
|
-
centerId: string;
|
|
345
|
-
productId: string;
|
|
346
|
-
dateISO: string;
|
|
347
|
-
startMinuteOfDay: number;
|
|
348
|
-
endMinuteOfDay: number;
|
|
349
|
-
mode: PricingMode;
|
|
350
|
-
units?: number;
|
|
351
|
-
persons?: number;
|
|
352
|
-
games?: number;
|
|
353
|
-
addons?: BookingAddonSelection[];
|
|
354
|
-
customer: BookingCustomer;
|
|
355
|
-
/** Apply account credit (requires a signed-in customer). */
|
|
356
|
-
applyCredit?: boolean;
|
|
357
|
-
/** Idempotency key for the create. The SDK generates one if omitted. */
|
|
358
|
-
idempotencyKey?: string;
|
|
359
|
-
shareToken?: string;
|
|
360
|
-
subtypeId?: string;
|
|
361
|
-
/** Reservation-mode event offer slug. Must match the preview slug. */
|
|
362
|
-
eventOfferSlug?: string;
|
|
363
|
-
};
|
|
364
|
-
/** Result of placing a booking. The hold→pay path returns `checkoutRefToken`
|
|
365
|
-
* with `requiresPayment: true`; a credit-covered / $0 booking returns the
|
|
366
|
-
* materialized `reservationId` + `reservationDisplayId` with
|
|
367
|
-
* `requiresPayment: false`. Headline fields typed; the rest passes through. */
|
|
368
|
-
interface BookingHold {
|
|
369
|
-
checkoutRefToken?: string;
|
|
370
|
-
reservationId?: string | null;
|
|
371
|
-
reservationDisplayId?: string | null;
|
|
372
|
-
requiresPayment: boolean;
|
|
373
|
-
finalCents: number;
|
|
374
|
-
appliedCreditCents: number;
|
|
375
|
-
paidCents?: number;
|
|
376
|
-
holdExpiresAt?: number;
|
|
377
|
-
replayed?: boolean;
|
|
378
|
-
[key: string]: unknown;
|
|
379
|
-
}
|
|
380
|
-
type CheckoutStatus = "not_found" | "pending_payment" | "paid_materialized" | "expired" | "payment_failed_retryable" | "abandoned";
|
|
381
|
-
interface CheckoutStatusResult {
|
|
382
|
-
status: CheckoutStatus;
|
|
383
|
-
reservationDisplayId: string | null;
|
|
384
|
-
reservationId: string | null;
|
|
385
|
-
}
|
|
386
|
-
/** Stripe (Connect) PaymentIntent data for the UI layer to render Elements.
|
|
387
|
-
* The SDK does NOT load Stripe.js — initialize it with `connectedAccountId`
|
|
388
|
-
* (the operator's connected account) + `clientSecret`. */
|
|
389
|
-
interface PaymentIntentInfo {
|
|
390
|
-
paymentIntentId: string;
|
|
391
|
-
clientSecret: string;
|
|
392
|
-
amountCents: number;
|
|
393
|
-
customerId: string;
|
|
394
|
-
ephemeralKey: string;
|
|
395
|
-
customerSessionClientSecret: string;
|
|
396
|
-
connectedAccountId: string;
|
|
397
|
-
/** Full Test Mode (2026-06-23): the Stripe environment this PaymentIntent was
|
|
398
|
-
* created in. Load Stripe.js with the matching publishable key
|
|
399
|
-
* (`pk_test_…` for "test", `pk_live_…` for "live") scoped to
|
|
400
|
-
* `connectedAccountId`. `<BowlosPaymentForm>` picks it for you when you pass
|
|
401
|
-
* `testPublishableKey`. Absent on older gateway responses → treat as "live". */
|
|
402
|
-
stripeMode?: "test" | "live";
|
|
403
|
-
}
|
|
404
|
-
/** The minimal shape `<BowlosPaymentForm>` needs to confirm a payment on the
|
|
405
|
-
* operator's connected account. `PaymentIntentInfo` (booking) and the buy-flow
|
|
406
|
-
* intents both satisfy it; a recurring membership passes the subscription's
|
|
407
|
-
* first-invoice `clientSecret` here too. */
|
|
408
|
-
interface ConnectedPaymentInput {
|
|
409
|
-
clientSecret: string;
|
|
410
|
-
connectedAccountId: string;
|
|
411
|
-
customerSessionClientSecret?: string;
|
|
412
|
-
/** Full Test Mode (2026-06-23): the PI's Stripe environment. `<BowlosPaymentForm>`
|
|
413
|
-
* loads the matching publishable key (test vs live) when `testPublishableKey`
|
|
414
|
-
* is supplied. Absent → "live". */
|
|
415
|
-
stripeMode?: "test" | "live";
|
|
416
|
-
}
|
|
417
|
-
/** Inputs for a game-pass purchase. The SDK generates an idempotency key if omitted. */
|
|
418
|
-
type GameCardPurchaseArgs = {
|
|
419
|
-
templateId: string;
|
|
420
|
-
idempotencyKey?: string;
|
|
421
|
-
shareToken?: string;
|
|
422
|
-
/** v0.32.0: when set, the buy redeems this flash-sale item at its sale price
|
|
423
|
-
* (the flash sale must be Live; the server validates the item matches). */
|
|
424
|
-
flashSaleItemId?: string;
|
|
425
|
-
};
|
|
426
|
-
/** The connected-account PaymentIntent for a game-pass purchase. Confirm it with
|
|
427
|
-
* `<BowlosPaymentForm>` — it carries `connectedAccountId` + the customer session.
|
|
428
|
-
* Poll `getGameCardStatus(refToken)` for materialization. */
|
|
429
|
-
interface GameCardPurchaseIntent {
|
|
430
|
-
paymentIntentId: string;
|
|
431
|
-
clientSecret: string;
|
|
432
|
-
amountCents: number;
|
|
433
|
-
refToken: string | null;
|
|
434
|
-
cardId: string;
|
|
435
|
-
customerSessionClientSecret: string;
|
|
436
|
-
connectedAccountId: string;
|
|
437
|
-
/** Full Test Mode (2026-06-23): the Stripe environment this PaymentIntent was
|
|
438
|
-
* created in. Load Stripe.js with the matching publishable key
|
|
439
|
-
* (`pk_test_…` for "test", `pk_live_…` for "live") scoped to
|
|
440
|
-
* `connectedAccountId`. `<BowlosPaymentForm>` picks it for you when you pass
|
|
441
|
-
* `testPublishableKey`. Absent on older gateway responses → treat as "live". */
|
|
442
|
-
stripeMode?: "test" | "live";
|
|
443
|
-
}
|
|
444
|
-
/** Buy a game pass — mints the connected-account PaymentIntent (requires a
|
|
445
|
-
* signed-in customer; the charge lands on the operator's connected account). */
|
|
446
|
-
declare function createGameCardOrder(client: BowlosClient, args: GameCardPurchaseArgs): Promise<GameCardPurchaseIntent>;
|
|
447
|
-
type GameCardCheckoutStatus = "not_found" | "pending_payment" | "paid_materialized" | "expired" | "payment_failed_retryable" | "abandoned";
|
|
448
|
-
interface GameCardStatusResult {
|
|
449
|
-
status: GameCardCheckoutStatus;
|
|
450
|
-
gameCardId: string | null;
|
|
451
|
-
}
|
|
452
|
-
/** Poll a game-pass purchase to materialization (by the create's `refToken`). */
|
|
453
|
-
declare function getGameCardStatus(client: BowlosClient, refToken: string): Promise<GameCardStatusResult>;
|
|
454
|
-
/** Inputs for an itemized game-pass quote. A pass has no config (no date/qty),
|
|
455
|
-
* so it's just the template (+ an optional share token for a private pass).
|
|
456
|
-
* The selling Center is resolved server-side from the customer's home Center. */
|
|
457
|
-
type GameCardPreviewArgs = {
|
|
458
|
-
templateId: string;
|
|
459
|
-
shareToken?: string;
|
|
460
|
-
/** v0.32.0: reflect the flash sale price in the Review (same as the buy). */
|
|
461
|
-
flashSaleItemId?: string;
|
|
462
|
-
};
|
|
463
|
-
/** Server-computed itemized quote for a game-pass purchase — the base price,
|
|
464
|
-
* tax lines, the selling Center's booking fee, and the authoritative grand
|
|
465
|
-
* total. Drives the headless "Review" step. Computed by the SAME engine as the
|
|
466
|
-
* PaymentIntent, so it never diverges from what the customer is charged. */
|
|
467
|
-
interface GameCardPreviewResult {
|
|
468
|
-
tierDiscountCents?: number;
|
|
469
|
-
tierDiscountLabel?: string;
|
|
470
|
-
subtotalCents: number;
|
|
471
|
-
taxLines: {
|
|
472
|
-
rateId: string;
|
|
473
|
-
label: string;
|
|
474
|
-
rateBasisPoints: number;
|
|
475
|
-
mode: "added" | "included";
|
|
476
|
-
taxableBaseCents: number;
|
|
477
|
-
taxCents: number;
|
|
478
|
-
}[];
|
|
479
|
-
taxTotalCents: number;
|
|
480
|
-
reservationFeeCents: number | null;
|
|
481
|
-
reservationFeeLabel: string | null;
|
|
482
|
-
grandTotalCents: number;
|
|
483
|
-
}
|
|
484
|
-
/** Itemized quote for a game-pass purchase WITHOUT creating a PaymentIntent —
|
|
485
|
-
* feeds the Review step. Requires a signed-in customer (so tax exemptions +
|
|
486
|
-
* the resolved home Center match the eventual charge). */
|
|
487
|
-
declare function previewGameCard(client: BowlosClient, args: GameCardPreviewArgs): Promise<GameCardPreviewResult>;
|
|
488
|
-
type EventTicketPreviewArgs = {
|
|
489
|
-
eventOfferId: string;
|
|
490
|
-
quantity: number;
|
|
491
|
-
/** v0.32.0: reflect the flash sale price in the Review (same as the buy). */
|
|
492
|
-
flashSaleItemId?: string;
|
|
493
|
-
};
|
|
494
|
-
interface EventTicketPreviewResult {
|
|
495
|
-
tierDiscountCents?: number;
|
|
496
|
-
tierDiscountLabel?: string;
|
|
497
|
-
eventName: string;
|
|
498
|
-
eventDate: string;
|
|
499
|
-
quantity: number;
|
|
500
|
-
unitPriceCents: number;
|
|
501
|
-
subtotalCents: number;
|
|
502
|
-
taxLines: {
|
|
503
|
-
rateId: string;
|
|
504
|
-
label: string;
|
|
505
|
-
rateBasisPoints: number;
|
|
506
|
-
mode: "added" | "included";
|
|
507
|
-
taxableBaseCents: number;
|
|
508
|
-
taxCents: number;
|
|
509
|
-
}[];
|
|
510
|
-
taxTotalCents: number;
|
|
511
|
-
reservationFeeCents: number | null;
|
|
512
|
-
reservationFeeLabel: string | null;
|
|
513
|
-
grandTotalCents: number;
|
|
514
|
-
}
|
|
515
|
-
/** Itemized quote for a ticket-mode event offer WITHOUT creating a
|
|
516
|
-
* PaymentIntent. Requires a signed-in customer so tax exemptions match the
|
|
517
|
-
* eventual charge. */
|
|
518
|
-
declare function previewEventTicket(client: BowlosClient, args: EventTicketPreviewArgs): Promise<EventTicketPreviewResult>;
|
|
519
|
-
type EventTicketPurchaseArgs = {
|
|
520
|
-
eventOfferId: string;
|
|
521
|
-
quantity: number;
|
|
522
|
-
idempotencyKey?: string;
|
|
523
|
-
/** v0.32.0: redeem this flash-sale item at its sale price. */
|
|
524
|
-
flashSaleItemId?: string;
|
|
525
|
-
};
|
|
526
|
-
/** The connected-account PaymentIntent for a ticket-mode event purchase.
|
|
527
|
-
* Confirm it with `<BowlosPaymentForm>` — it carries `connectedAccountId` +
|
|
528
|
-
* the customer session. After payment, read the receipt with `getMyEventOrder`. */
|
|
529
|
-
interface EventTicketPurchaseIntent {
|
|
530
|
-
paymentIntentId: string;
|
|
531
|
-
clientSecret: string;
|
|
532
|
-
amountCents: number;
|
|
533
|
-
orderId: string;
|
|
534
|
-
customerSessionClientSecret: string;
|
|
535
|
-
connectedAccountId: string;
|
|
536
|
-
/** Full Test Mode (2026-06-23): the Stripe environment this PaymentIntent was
|
|
537
|
-
* created in. Load Stripe.js with the matching publishable key
|
|
538
|
-
* (`pk_test_…` for "test", `pk_live_…` for "live") scoped to
|
|
539
|
-
* `connectedAccountId`. `<BowlosPaymentForm>` picks it for you when you pass
|
|
540
|
-
* `testPublishableKey`. Absent on older gateway responses → treat as "live". */
|
|
541
|
-
stripeMode?: "test" | "live";
|
|
542
|
-
}
|
|
543
|
-
/** Buy tickets for a ticket-mode event offer — mints the connected-account
|
|
544
|
-
* PaymentIntent. Requires a signed-in customer so taxes and account ownership
|
|
545
|
-
* match the preview. */
|
|
546
|
-
declare function createEventTicketOrder(client: BowlosClient, args: EventTicketPurchaseArgs): Promise<EventTicketPurchaseIntent>;
|
|
547
|
-
type EventTicketCheckoutStatus = "not_found" | "pending_payment" | "paid" | "cancelled" | "refunded";
|
|
548
|
-
interface EventTicketStatusResult {
|
|
549
|
-
status: EventTicketCheckoutStatus;
|
|
550
|
-
orderId: string | null;
|
|
551
|
-
}
|
|
552
|
-
/** Poll a ticket-mode event purchase by the order id returned from create. */
|
|
553
|
-
declare function getEventTicketStatus(client: BowlosClient, orderId: string): Promise<EventTicketStatusResult>;
|
|
554
|
-
/** Inputs for a package purchase. The SDK generates an idempotency key if omitted.
|
|
555
|
-
* `scheduledDate` is `YYYY-MM-DD` in the Center's timezone; `scheduledStartMinute`
|
|
556
|
-
* is minutes-from-midnight (e.g. 1050 = 5:30 PM) and MUST be one of the package's
|
|
557
|
-
* bookable start times — see HEADLESS.md → "Buying a package" for computing them. */
|
|
558
|
-
type PackagePurchaseArgs = {
|
|
559
|
-
packageId: string;
|
|
560
|
-
centerId: string;
|
|
561
|
-
quantity: number;
|
|
562
|
-
optionalAddons?: {
|
|
563
|
-
addonId: string;
|
|
564
|
-
quantity: number;
|
|
565
|
-
}[];
|
|
566
|
-
scheduledDate: string;
|
|
567
|
-
scheduledStartMinute: number;
|
|
568
|
-
idempotencyKey?: string;
|
|
569
|
-
shareToken?: string;
|
|
570
|
-
/** v0.32.0: redeem this flash-sale item at its sale price. */
|
|
571
|
-
flashSaleItemId?: string;
|
|
572
|
-
};
|
|
573
|
-
/** The connected-account PaymentIntent for a package purchase. Confirm it with
|
|
574
|
-
* `<BowlosPaymentForm>` — it carries `connectedAccountId` + the customer session.
|
|
575
|
-
* Poll `getPackageStatus(orderId)` for materialization. */
|
|
576
|
-
interface PackagePurchaseIntent {
|
|
577
|
-
paymentIntentId: string;
|
|
578
|
-
clientSecret: string;
|
|
579
|
-
amountCents: number;
|
|
580
|
-
orderId: string;
|
|
581
|
-
customerSessionClientSecret: string;
|
|
582
|
-
connectedAccountId: string;
|
|
583
|
-
/** Group id for the inventory hold the order created — subscribe with
|
|
584
|
-
* `getMyHoldGroup` to render the checkout countdown if you choose to. */
|
|
585
|
-
inventoryHoldGroupId?: string;
|
|
586
|
-
}
|
|
587
|
-
/** Buy a package — mints the connected-account PaymentIntent (requires a
|
|
588
|
-
* signed-in customer; the charge lands on the operator's connected account). */
|
|
589
|
-
declare function createPackageOrder(client: BowlosClient, args: PackagePurchaseArgs): Promise<PackagePurchaseIntent>;
|
|
590
|
-
type PackageCheckoutStatus = "not_found" | "pending_payment" | "paid" | "cancelled" | "refunded";
|
|
591
|
-
interface PackageStatusResult {
|
|
592
|
-
status: PackageCheckoutStatus;
|
|
593
|
-
orderId: string | null;
|
|
594
|
-
}
|
|
595
|
-
/** Poll a package purchase to materialization (by the create's `orderId`). */
|
|
596
|
-
declare function getPackageStatus(client: BowlosClient, orderId: string): Promise<PackageStatusResult>;
|
|
597
|
-
/** Inputs for an itemized package quote — the buy config minus the schedule
|
|
598
|
-
* (price doesn't depend on date/time; the schedule only affects the eventual
|
|
599
|
-
* create's slot validation). */
|
|
600
|
-
type PackagePreviewArgs = {
|
|
601
|
-
packageId: string;
|
|
602
|
-
centerId: string;
|
|
603
|
-
quantity: number;
|
|
604
|
-
optionalAddons?: {
|
|
605
|
-
addonId: string;
|
|
606
|
-
quantity: number;
|
|
607
|
-
}[];
|
|
608
|
-
shareToken?: string;
|
|
609
|
-
/** v0.32.0: reflect the flash sale price in the Review (same as the buy). */
|
|
610
|
-
flashSaleItemId?: string;
|
|
611
|
-
};
|
|
612
|
-
/** Server-computed itemized quote for a package order — base, optional add-ons,
|
|
613
|
-
* tax lines, the selling Center's booking fee, and the authoritative grand
|
|
614
|
-
* total. Drives the headless "Review" step. Computed by the SAME engine as the
|
|
615
|
-
* PaymentIntent, so it never diverges from what the customer is charged. */
|
|
616
|
-
interface PackagePreviewResult {
|
|
617
|
-
tierDiscountCents?: number;
|
|
618
|
-
tierDiscountLabel?: string;
|
|
619
|
-
baseTotalCents: number;
|
|
620
|
-
addons: {
|
|
621
|
-
addonId: string;
|
|
622
|
-
name: string;
|
|
623
|
-
quantity: number;
|
|
624
|
-
lineCents: number;
|
|
625
|
-
}[];
|
|
626
|
-
addonsTotalCents: number;
|
|
627
|
-
taxLines: {
|
|
628
|
-
rateId: string;
|
|
629
|
-
label: string;
|
|
630
|
-
rateBasisPoints: number;
|
|
631
|
-
mode: "added" | "included";
|
|
632
|
-
taxableBaseCents: number;
|
|
633
|
-
taxCents: number;
|
|
634
|
-
}[];
|
|
635
|
-
taxTotalCents: number;
|
|
636
|
-
reservationFeeCents: number | null;
|
|
637
|
-
reservationFeeLabel: string | null;
|
|
638
|
-
grandTotalCents: number;
|
|
639
|
-
}
|
|
640
|
-
/** Itemized quote for a package order WITHOUT creating a PaymentIntent — feeds
|
|
641
|
-
* the Review step. Requires a signed-in customer (so tax exemptions match the
|
|
642
|
-
* eventual charge). */
|
|
643
|
-
declare function previewPackage(client: BowlosClient, args: PackagePreviewArgs): Promise<PackagePreviewResult>;
|
|
644
|
-
/** Inputs for an itemized membership quote. A membership has no config (no
|
|
645
|
-
* date/qty), so it's just the template (+ an optional share token for a private
|
|
646
|
-
* membership). The selling Center is resolved server-side from the customer's
|
|
647
|
-
* home Center. Shared by the one-time and recurring previews. */
|
|
648
|
-
type MembershipPreviewArgs = {
|
|
649
|
-
templateId: string;
|
|
650
|
-
shareToken?: string;
|
|
651
|
-
/** v0.32.0: reflect the flash sale price in the Review (one-time only). */
|
|
652
|
-
flashSaleItemId?: string;
|
|
653
|
-
};
|
|
654
|
-
/** Server-computed itemized quote for a one-time membership purchase — the dues,
|
|
655
|
-
* the one-time setup (joining) fee, tax lines, the selling Center's booking fee,
|
|
656
|
-
* and the authoritative grand total. Drives the headless "Review" step. Computed
|
|
657
|
-
* by the SAME engine as the PaymentIntent, so it never diverges from what the
|
|
658
|
-
* customer is charged. */
|
|
659
|
-
interface MembershipPreviewResult {
|
|
660
|
-
tierDiscountCents?: number;
|
|
661
|
-
tierDiscountLabel?: string;
|
|
662
|
-
duesCents: number;
|
|
663
|
-
setupFeeCents: number;
|
|
664
|
-
subtotalCents: number;
|
|
665
|
-
taxLines: {
|
|
666
|
-
rateId: string;
|
|
667
|
-
label: string;
|
|
668
|
-
rateBasisPoints: number;
|
|
669
|
-
mode: "added" | "included";
|
|
670
|
-
taxableBaseCents: number;
|
|
671
|
-
taxCents: number;
|
|
672
|
-
}[];
|
|
673
|
-
taxTotalCents: number;
|
|
674
|
-
reservationFeeCents: number | null;
|
|
675
|
-
reservationFeeLabel: string | null;
|
|
676
|
-
grandTotalCents: number;
|
|
677
|
-
}
|
|
678
|
-
/** Itemized quote for a one-time membership purchase WITHOUT creating a
|
|
679
|
-
* PaymentIntent — feeds the Review step. Requires a signed-in customer (so tax
|
|
680
|
-
* exemptions + the resolved home Center match the eventual charge). */
|
|
681
|
-
declare function previewMembership(client: BowlosClient, args: MembershipPreviewArgs): Promise<MembershipPreviewResult>;
|
|
682
|
-
/** Inputs for a one-time membership purchase. The SDK generates an idempotency
|
|
683
|
-
* key if omitted. */
|
|
684
|
-
type MembershipPurchaseArgs = {
|
|
685
|
-
templateId: string;
|
|
686
|
-
idempotencyKey?: string;
|
|
687
|
-
shareToken?: string;
|
|
688
|
-
/** v0.32.0: redeem this flash-sale item at its sale price (one-time only). */
|
|
689
|
-
flashSaleItemId?: string;
|
|
690
|
-
};
|
|
691
|
-
/** The connected-account PaymentIntent for a one-time membership purchase.
|
|
692
|
-
* Confirm it with `<BowlosPaymentForm>` — it carries `connectedAccountId` + the
|
|
693
|
-
* customer session. Poll `getMembershipStatus(refToken)` for materialization. */
|
|
694
|
-
interface MembershipPurchaseIntent {
|
|
695
|
-
paymentIntentId: string;
|
|
696
|
-
clientSecret: string;
|
|
697
|
-
amountCents: number;
|
|
698
|
-
refToken: string | null;
|
|
699
|
-
customerSessionClientSecret: string;
|
|
700
|
-
connectedAccountId: string;
|
|
701
|
-
/** Full Test Mode (2026-06-23): the Stripe environment this PaymentIntent was
|
|
702
|
-
* created in. Load Stripe.js with the matching publishable key
|
|
703
|
-
* (`pk_test_…` for "test", `pk_live_…` for "live") scoped to
|
|
704
|
-
* `connectedAccountId`. `<BowlosPaymentForm>` picks it for you when you pass
|
|
705
|
-
* `testPublishableKey`. Absent on older gateway responses → treat as "live". */
|
|
706
|
-
stripeMode?: "test" | "live";
|
|
707
|
-
}
|
|
708
|
-
/** Buy a one-time membership — mints the connected-account PaymentIntent
|
|
709
|
-
* (requires a signed-in customer; the charge lands on the operator's connected
|
|
710
|
-
* account). */
|
|
711
|
-
declare function createMembershipOrder(client: BowlosClient, args: MembershipPurchaseArgs): Promise<MembershipPurchaseIntent>;
|
|
712
|
-
type MembershipCheckoutStatus = "not_found" | "pending_payment" | "paid_materialized" | "expired" | "payment_failed_retryable" | "abandoned";
|
|
713
|
-
interface MembershipStatusResult {
|
|
714
|
-
status: MembershipCheckoutStatus;
|
|
715
|
-
membershipId: string | null;
|
|
716
|
-
}
|
|
717
|
-
/** Poll a one-time membership purchase to materialization (by the create's
|
|
718
|
-
* `refToken`). */
|
|
719
|
-
declare function getMembershipStatus(client: BowlosClient, refToken: string): Promise<MembershipStatusResult>;
|
|
720
|
-
/** Server-computed itemized quote for a RECURRING membership subscription — the
|
|
721
|
-
* same fields as the one-time quote (what's charged today: dues + one-time setup
|
|
722
|
-
* fee + tax + the selling Center's fee), PLUS `recurringTotalCents` (what each
|
|
723
|
-
* renewal charges) and the `cadence`. Drives the recurring "Review" step's
|
|
724
|
-
* "Due today" + "Auto-renews at" lines. Computed by the SAME engine as the
|
|
725
|
-
* subscription's first invoice, so it never diverges. */
|
|
726
|
-
interface MembershipSubscriptionPreviewResult extends MembershipPreviewResult {
|
|
727
|
-
recurringTotalCents: number;
|
|
728
|
-
cadence: "monthly" | "annual" | "one_time";
|
|
729
|
-
}
|
|
730
|
-
/** Itemized quote for a recurring membership subscription WITHOUT creating the
|
|
731
|
-
* subscription — feeds the Review step. Requires a signed-in customer (so tax
|
|
732
|
-
* exemptions + the resolved home Center match the eventual charge). */
|
|
733
|
-
declare function previewMembershipSubscription(client: BowlosClient, args: MembershipPreviewArgs): Promise<MembershipSubscriptionPreviewResult>;
|
|
734
|
-
/** Inputs for a recurring membership subscription. (No idempotency key — the
|
|
735
|
-
* subscription itself is the dedupe anchor; the buy is gated to one active
|
|
736
|
-
* membership per customer.) */
|
|
737
|
-
type MembershipSubscriptionArgs = {
|
|
738
|
-
templateId: string;
|
|
739
|
-
shareToken?: string;
|
|
740
|
-
};
|
|
741
|
-
/** The connected-account first-invoice payment for a recurring membership
|
|
742
|
-
* subscription. Confirm `clientSecret` with `<BowlosPaymentForm>` — it carries
|
|
743
|
-
* `connectedAccountId` + the customer session. There is NO refToken: the
|
|
744
|
-
* subscription materializes via webhook, so re-query `useMyMemberships` after
|
|
745
|
-
* payment rather than polling. */
|
|
746
|
-
interface MembershipSubscriptionIntent {
|
|
747
|
-
subscriptionId: string;
|
|
748
|
-
clientSecret: string;
|
|
749
|
-
amountCents: number;
|
|
750
|
-
customerSessionClientSecret: string;
|
|
751
|
-
connectedAccountId: string;
|
|
752
|
-
/** Full Test Mode (2026-06-23): the Stripe environment this PaymentIntent was
|
|
753
|
-
* created in. Load Stripe.js with the matching publishable key
|
|
754
|
-
* (`pk_test_…` for "test", `pk_live_…` for "live") scoped to
|
|
755
|
-
* `connectedAccountId`. `<BowlosPaymentForm>` picks it for you when you pass
|
|
756
|
-
* `testPublishableKey`. Absent on older gateway responses → treat as "live". */
|
|
757
|
-
stripeMode?: "test" | "live";
|
|
758
|
-
}
|
|
759
|
-
/** Start a recurring membership subscription — mints the subscription + its
|
|
760
|
-
* first-invoice PaymentIntent on the operator's connected account (requires a
|
|
761
|
-
* signed-in customer). Confirm the returned `clientSecret`; the subscription
|
|
762
|
-
* materializes via webhook. */
|
|
763
|
-
declare function createMembershipSubscriptionOrder(client: BowlosClient, args: MembershipSubscriptionArgs): Promise<MembershipSubscriptionIntent>;
|
|
764
|
-
/** Browser/Node-safe idempotency key for booking creates. */
|
|
765
|
-
declare function generateIdempotencyKey(): string;
|
|
766
|
-
/** Place the inventory hold + open a checkout. Requires a signed-in
|
|
767
|
-
* customer — the server rejects a guest. Sends the session bearer. */
|
|
768
|
-
declare function createBooking(client: BowlosClient, args: CreateBookingArgs): Promise<BookingHold>;
|
|
769
|
-
/** Mint the Stripe Connect PaymentIntent for a held checkout (by refToken). */
|
|
770
|
-
declare function createCheckoutPaymentIntent(client: BowlosClient, refToken: string): Promise<PaymentIntentInfo>;
|
|
771
|
-
/** Poll the hold→pay→materialize state for a checkout (by refToken). */
|
|
772
|
-
declare function getCheckoutStatus(client: BowlosClient, refToken: string): Promise<CheckoutStatusResult>;
|
|
773
|
-
/** Release the hold + cancel the checkout (the "Back" button). */
|
|
774
|
-
declare function abandonCheckout(client: BowlosClient, refToken: string): Promise<{
|
|
775
|
-
ok: boolean;
|
|
776
|
-
}>;
|
|
777
|
-
|
|
778
|
-
export { bookingPreview as $, type AuthState as A, type BookingAddonSelection as B, type CheckoutStatus as C, type MembershipStatusResult as D, type EventTicketCheckoutStatus as E, type FetchLike as F, type GameCardCheckoutStatus as G, type MembershipSubscriptionArgs as H, type MembershipSubscriptionIntent as I, type MembershipSubscriptionPreviewResult as J, type PackagePreviewArgs as K, type LinkProfile as L, type MembershipCheckoutStatus as M, type PackagePreviewResult as N, type PackagePurchaseArgs as O, type PackageCheckoutStatus as P, type PackagePurchaseIntent as Q, type PackageStatusResult as R, type PaymentIntentInfo as S, type PingResult as T, type PricingMode as U, type PublicAddon as V, type StartTimesArgs as W, type TokenStore as X, type Tokens as Y, abandonCheckout as Z, availableUnitCount as _, type AvailabilityArgs as a, checkAvailability as a0, createBooking as a1, createBowlosClient as a2, createCheckoutPaymentIntent as a3, createEventTicketOrder as a4, createGameCardOrder as a5, createMembershipOrder as a6, createMembershipSubscriptionOrder as a7, createPackageOrder as a8, generateIdempotencyKey as a9, getCheckoutStatus as aa, getEventTicketStatus as ab, getGameCardStatus as ac, getMembershipStatus as ad, getPackageStatus as ae, listAddons as af, listStartTimes as ag, localStorageTokenStore as ah, previewEventTicket as ai, previewGameCard as aj, previewMembership as ak, previewMembershipSubscription as al, previewPackage as am, type AvailabilityResult as b, type BookingCustomer as c, type BookingHold as d, type BookingPreviewArgs as e, type BookingQuote as f, BowlosClient as g, type BowlosClientConfig as h, type CheckoutStatusResult as i, type ConnectedPaymentInput as j, type CreateBookingArgs as k, type Customer as l, type EventTicketPreviewArgs as m, type EventTicketPreviewResult as n, type EventTicketPurchaseArgs as o, type EventTicketPurchaseIntent as p, type EventTicketStatusResult as q, type GameCardPreviewArgs as r, type GameCardPreviewResult as s, type GameCardPurchaseArgs as t, type GameCardPurchaseIntent as u, type GameCardStatusResult as v, type MembershipPreviewArgs as w, type MembershipPreviewResult as x, type MembershipPurchaseArgs as y, type MembershipPurchaseIntent as z };
|