@bowlos/reservations 0.36.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/AGENTS.md +300 -0
  2. package/HEADLESS.md +534 -10
  3. package/README.md +242 -2
  4. package/dist/{data-BJkB-tvM.d.cts → account-DEX2Lr78.d.cts} +208 -1
  5. package/dist/{data-BJkB-tvM.d.ts → account-DEX2Lr78.d.ts} +208 -1
  6. package/dist/booking-change-4DGu-B08.d.ts +1282 -0
  7. package/dist/booking-change-aK6P37FZ.d.cts +1282 -0
  8. package/dist/{chunk-3JSVEOKG.js → chunk-44WKP6MW.js} +32 -5
  9. package/dist/chunk-44WKP6MW.js.map +1 -0
  10. package/dist/{chunk-TEHRROVY.js → chunk-BWJHRJN6.js} +47 -192
  11. package/dist/chunk-BWJHRJN6.js.map +1 -0
  12. package/dist/{chunk-Y3YSDO3H.js → chunk-FMFHNBDH.js} +56 -5
  13. package/dist/chunk-FMFHNBDH.js.map +1 -0
  14. package/dist/chunk-I37IJNYU.js +139 -0
  15. package/dist/chunk-I37IJNYU.js.map +1 -0
  16. package/dist/chunk-VJIS56OO.js +717 -0
  17. package/dist/chunk-VJIS56OO.js.map +1 -0
  18. package/dist/cli.cjs +29 -3
  19. package/dist/cli.cjs.map +1 -1
  20. package/dist/components.cjs +1595 -2
  21. package/dist/components.cjs.map +1 -1
  22. package/dist/components.d.cts +208 -7
  23. package/dist/components.d.ts +208 -7
  24. package/dist/components.js +1045 -7
  25. package/dist/components.js.map +1 -1
  26. package/dist/index.cjs +270 -3
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +56 -5
  29. package/dist/index.d.ts +56 -5
  30. package/dist/index.js +58 -3
  31. package/dist/index.js.map +1 -1
  32. package/dist/payments.cjs +203 -0
  33. package/dist/payments.cjs.map +1 -1
  34. package/dist/payments.d.cts +16 -2
  35. package/dist/payments.d.ts +16 -2
  36. package/dist/payments.js +78 -2
  37. package/dist/payments.js.map +1 -1
  38. package/dist/{react-0MyyTtE4.d.ts → react-CrRciA7I.d.ts} +2 -2
  39. package/dist/{react-CWAG4cW0.d.cts → react-QJrsaOnN.d.cts} +2 -2
  40. package/dist/react.cjs +758 -27
  41. package/dist/react.cjs.map +1 -1
  42. package/dist/react.d.cts +139 -12
  43. package/dist/react.d.ts +139 -12
  44. package/dist/react.js +72 -4
  45. package/dist/react.js.map +1 -1
  46. package/package.json +8 -2
  47. package/templates/center-site/README.md +5 -0
  48. package/templates/center-site/app/account/game-cards/page.tsx +17 -0
  49. package/templates/center-site/app/account/layout.tsx +16 -0
  50. package/templates/center-site/app/account/memberships/[id]/page.tsx +23 -0
  51. package/templates/center-site/app/account/memberships/page.tsx +33 -0
  52. package/templates/center-site/app/account/orders/page.tsx +17 -0
  53. package/templates/center-site/app/account/page.tsx +14 -0
  54. package/templates/center-site/app/account/payment-methods/page.tsx +23 -0
  55. package/templates/center-site/app/account/privacy/page.tsx +17 -0
  56. package/templates/center-site/app/account/profile/page.tsx +45 -0
  57. package/templates/center-site/app/account/reservations/[displayId]/change/page.tsx +46 -0
  58. package/templates/center-site/app/account/reservations/[displayId]/page.tsx +41 -0
  59. package/templates/center-site/app/account/reservations/page.tsx +35 -0
  60. package/templates/center-site/app/account/security/page.tsx +17 -0
  61. package/templates/center-site/app/events/[slug]/page.tsx +130 -0
  62. package/templates/center-site/app/events/page.tsx +57 -0
  63. package/templates/center-site/app/pay/[token]/page.tsx +53 -0
  64. package/templates/center-site/app/site-header.tsx +1 -0
  65. package/templates/center-site/lib/reservation.ts +14 -0
  66. package/templates/center-site/package.json +1 -1
  67. package/templates/center-site/tsconfig.json +7 -9
  68. package/dist/account-DfM2COaz.d.ts +0 -210
  69. package/dist/account-oCvYWmO9.d.cts +0 -210
  70. package/dist/catalog-DbhdwmnX.d.cts +0 -224
  71. package/dist/catalog-XkjgPI5C.d.ts +0 -224
  72. package/dist/chunk-3JSVEOKG.js.map +0 -1
  73. package/dist/chunk-TEHRROVY.js.map +0 -1
  74. package/dist/chunk-Y3YSDO3H.js.map +0 -1
@@ -1,11 +1,7 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "ES2022",
4
- "lib": [
5
- "ES2023",
6
- "DOM",
7
- "DOM.Iterable"
8
- ],
4
+ "lib": ["ES2023", "DOM", "DOM.Iterable"],
9
5
  "module": "ESNext",
10
6
  "moduleResolution": "Bundler",
11
7
  "jsx": "react-jsx",
@@ -23,7 +19,11 @@
23
19
  }
24
20
  ],
25
21
  "allowJs": true,
26
- "incremental": true
22
+ "incremental": true,
23
+ "paths": {
24
+ "@/*": ["./*"]
25
+ },
26
+ "types": ["node"]
27
27
  },
28
28
  "include": [
29
29
  "**/*.ts",
@@ -32,7 +32,5 @@
32
32
  "next-env.d.ts",
33
33
  ".next/dev/types/**/*.ts"
34
34
  ],
35
- "exclude": [
36
- "node_modules"
37
- ]
35
+ "exclude": ["node_modules"]
38
36
  }
@@ -1,210 +0,0 @@
1
- import { g as BowlosClient } from './data-BJkB-tvM.js';
2
-
3
- /**
4
- * Typed account + flash reads for @bowlos/reservations.
5
- *
6
- * Session-scoped account reads (require a signed-in customer) and the
7
- * session-aware flash-sale reads. Args are typed precisely — every account read
8
- * is brand-scoped. Results are generic (`<T = unknown>`): parameterize with your
9
- * own shape, or read `unknown` and narrow. (The backend return shapes are rich
10
- * and evolving; the SDK doesn't pin them here.) Each read has a framework-agnostic
11
- * function here and a React hook in `hooks.tsx`.
12
- */
13
-
14
- /** Every account read is scoped to the customer's Brand. */
15
- type BrandScoped = {
16
- brandId: string;
17
- };
18
- type ReservationDetailArgs = {
19
- brandId: string;
20
- displayId: string;
21
- };
22
- type EventOrderDetailArgs = {
23
- brandId: string;
24
- orderId: string;
25
- };
26
- type MembershipDetailArgs = {
27
- brandId: string;
28
- membershipId: string;
29
- };
30
- type FlashSaleArgs = {
31
- slug: string;
32
- };
33
- type FlashBookingOptionsArgs = {
34
- slug: string;
35
- itemId: string;
36
- };
37
- type FlashSalesArgs = {
38
- brandId: string;
39
- };
40
- declare function getMyReservations<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
41
- declare function getMyReservationDetail<T = unknown>(client: BowlosClient, args: ReservationDetailArgs): Promise<T>;
42
- declare function getMyEventOrders<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
43
- declare function getMyEventOrder<T = unknown>(client: BowlosClient, args: EventOrderDetailArgs): Promise<T>;
44
- declare function getMyMemberships<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
45
- declare function getMyMembershipDetail<T = unknown>(client: BowlosClient, args: MembershipDetailArgs): Promise<T>;
46
- declare function getMyLoyalty<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
47
- declare function getMyCredits<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
48
- declare function getMyPasses<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
49
- declare function getMyGameCards<T = MyGameCard[]>(client: BowlosClient, args: BrandScoped): Promise<T>;
50
- /** Outcome preview shared by all four cancel types. `bucket`/`hoursBeforeStart`/
51
- * `forfeitCents` are inert (null/0) for game cards (no time policy). */
52
- interface CancelPreview {
53
- cancellable: boolean;
54
- reason: string | null;
55
- bucket: string | null;
56
- hoursBeforeStart: number;
57
- creditCents: number;
58
- forfeitCents: number;
59
- paidCents: number;
60
- }
61
- interface CancelResult {
62
- id: string;
63
- status: string;
64
- creditCents: number;
65
- bucket?: string | null;
66
- hoursBeforeStart?: number;
67
- forfeitCents?: number;
68
- version?: number;
69
- }
70
- interface MyGameCard {
71
- id: string;
72
- displayId: string;
73
- cardName: string;
74
- status: "active" | "depleted" | "expired" | "cancelled" | "refunded";
75
- totalGames: number;
76
- remainingGames: number;
77
- shoesIncluded: boolean;
78
- purchasedAt: number;
79
- expiresAt: number;
80
- paidCents: number;
81
- /** Precomputed unused-only rule; the per-card preview is the source of truth. */
82
- cancellable: boolean;
83
- }
84
- type ReservationCancelArgs = {
85
- brandId: string;
86
- reservationId: string;
87
- expectedVersion: number;
88
- reason?: string;
89
- /** Per-attempt key; safe to retry. */
90
- idempotencyKey: string;
91
- };
92
- type OrderCancelArgs = {
93
- brandId: string;
94
- orderId: string;
95
- reason?: string;
96
- idempotencyKey: string;
97
- };
98
- type GameCardCancelArgs = {
99
- brandId: string;
100
- cardId: string;
101
- reason?: string;
102
- idempotencyKey: string;
103
- };
104
- declare function previewReservationCancellation<T = CancelPreview>(client: BowlosClient, args: {
105
- brandId: string;
106
- reservationId: string;
107
- }): Promise<T>;
108
- declare function previewEventOrderCancellation<T = CancelPreview>(client: BowlosClient, args: {
109
- brandId: string;
110
- orderId: string;
111
- }): Promise<T>;
112
- declare function previewPackageOrderCancellation<T = CancelPreview>(client: BowlosClient, args: {
113
- brandId: string;
114
- orderId: string;
115
- }): Promise<T>;
116
- declare function previewGameCardCancellation<T = CancelPreview>(client: BowlosClient, args: {
117
- brandId: string;
118
- cardId: string;
119
- }): Promise<T>;
120
- declare function cancelMyReservation<T = CancelResult>(client: BowlosClient, args: ReservationCancelArgs): Promise<T>;
121
- declare function cancelMyEventOrder<T = CancelResult>(client: BowlosClient, args: OrderCancelArgs): Promise<T>;
122
- declare function cancelMyPackageOrder<T = CancelResult>(client: BowlosClient, args: OrderCancelArgs): Promise<T>;
123
- declare function cancelMyGameCard<T = CancelResult>(client: BowlosClient, args: GameCardCancelArgs): Promise<T>;
124
- declare function getFlashSale<T = unknown>(client: BowlosClient, args: FlashSaleArgs): Promise<T>;
125
- /** The public flash-sale index for a Brand (live + upcoming; no prices). Public. */
126
- declare function getFlashSales<T = unknown>(client: BowlosClient, args: FlashSalesArgs): Promise<T>;
127
- declare function getFlashSaleBookingOptions<T = unknown>(client: BowlosClient, args: FlashBookingOptionsArgs): Promise<T>;
128
- type CreateFlashSaleBookingArgs = {
129
- slug: string;
130
- itemId: string;
131
- dateISO: string;
132
- startMinuteOfDay: number;
133
- durationMinutes: number;
134
- units: number;
135
- /** Per-attempt key; replays return the original checkout. */
136
- idempotencyKey: string;
137
- };
138
- interface FlashSaleBookingResult {
139
- /** Handle for the rest of the checkout: mint the PaymentIntent with
140
- * `createCheckoutPaymentIntent(client, { refToken })`, then poll
141
- * `getCheckoutStatus(client, refToken)` to materialization. */
142
- refToken: string;
143
- /** The SALE-priced total the PaymentIntent charges (base at the flash
144
- * price + tax + the Center fee). */
145
- amountDueCents: number;
146
- holdExpiresAt: number;
147
- breakdown: {
148
- /** Tier savings already removed from baseSubtotalCents; do not subtract again. */
149
- tierDiscountCents: number;
150
- baseSubtotalCents: number;
151
- reservationFeeCents: number;
152
- reservationFeeLabel: string | null;
153
- taxAddedCents: number;
154
- taxIncludedCents: number;
155
- totalCents: number;
156
- };
157
- }
158
- /**
159
- * v0.22.1 — book a flash-sale reservation item at its SALE price (the flash
160
- * analog of `eventOfferSlug`: the server binds the item's sale price, holds
161
- * the inventory, and opens a checkout). Signed-in customers only. Pick the
162
- * date/time from `getFlashSaleBookingOptions` — the purpose-built option
163
- * list — never the regular booking calendar.
164
- */
165
- declare function createFlashSaleBooking(client: BowlosClient, args: CreateFlashSaleBookingArgs): Promise<FlashSaleBookingResult>;
166
- /** Saved cards belong to the active location's connected Stripe account. */
167
- type SavedCardScope = {
168
- brandId: string;
169
- centerId: string;
170
- };
171
- type SavedCardArgs = SavedCardScope & {
172
- paymentMethodId: string;
173
- };
174
- interface SavedCard {
175
- id: string;
176
- brand: string;
177
- last4: string;
178
- expMonth: number;
179
- expYear: number;
180
- isDefault: boolean;
181
- }
182
- interface SavedCardsResult {
183
- methods: SavedCard[];
184
- chargeable: boolean;
185
- }
186
- interface CardSetupResult {
187
- clientSecret: string;
188
- publishableKey: string;
189
- stripeAccount: string;
190
- stripeMode: "test" | "live";
191
- merchantDisplayName: string;
192
- }
193
- type ChangePasswordArgs = {
194
- currentPassword: string;
195
- newPassword: string;
196
- };
197
- declare function listSavedCards(client: BowlosClient, args: SavedCardScope): Promise<SavedCardsResult>;
198
- declare function createCardSetup(client: BowlosClient, args: SavedCardScope): Promise<CardSetupResult>;
199
- declare function removeSavedCard(client: BowlosClient, args: SavedCardArgs): Promise<{
200
- detached: boolean;
201
- }>;
202
- declare function setDefaultCard(client: BowlosClient, args: SavedCardArgs): Promise<{
203
- ok: boolean;
204
- }>;
205
- /** Success invalidates all sessions; discard local tokens and show sign-in. */
206
- declare function changePassword(client: BowlosClient, args: ChangePasswordArgs): Promise<{
207
- ok: true;
208
- }>;
209
-
210
- export { getMyLoyalty as A, type BrandScoped as B, type CancelPreview as C, getMyMembershipDetail as D, type EventOrderDetailArgs as E, type FlashBookingOptionsArgs as F, type GameCardCancelArgs as G, getMyMemberships as H, getMyPasses as I, getMyReservationDetail as J, getMyReservations as K, listSavedCards as L, type MembershipDetailArgs as M, previewEventOrderCancellation as N, type OrderCancelArgs as O, previewGameCardCancellation as P, previewPackageOrderCancellation as Q, type ReservationCancelArgs as R, type SavedCard as S, previewReservationCancellation as T, removeSavedCard as U, setDefaultCard as V, type CancelResult as a, type CardSetupResult as b, type ChangePasswordArgs as c, type CreateFlashSaleBookingArgs as d, type FlashSaleArgs as e, type FlashSaleBookingResult as f, type FlashSalesArgs as g, type MyGameCard as h, type ReservationDetailArgs as i, type SavedCardArgs as j, type SavedCardScope as k, type SavedCardsResult as l, cancelMyEventOrder as m, cancelMyGameCard as n, cancelMyPackageOrder as o, cancelMyReservation as p, changePassword as q, createCardSetup as r, createFlashSaleBooking as s, getFlashSale as t, getFlashSaleBookingOptions as u, getFlashSales as v, getMyCredits as w, getMyEventOrder as x, getMyEventOrders as y, getMyGameCards as z };
@@ -1,210 +0,0 @@
1
- import { g as BowlosClient } from './data-BJkB-tvM.cjs';
2
-
3
- /**
4
- * Typed account + flash reads for @bowlos/reservations.
5
- *
6
- * Session-scoped account reads (require a signed-in customer) and the
7
- * session-aware flash-sale reads. Args are typed precisely — every account read
8
- * is brand-scoped. Results are generic (`<T = unknown>`): parameterize with your
9
- * own shape, or read `unknown` and narrow. (The backend return shapes are rich
10
- * and evolving; the SDK doesn't pin them here.) Each read has a framework-agnostic
11
- * function here and a React hook in `hooks.tsx`.
12
- */
13
-
14
- /** Every account read is scoped to the customer's Brand. */
15
- type BrandScoped = {
16
- brandId: string;
17
- };
18
- type ReservationDetailArgs = {
19
- brandId: string;
20
- displayId: string;
21
- };
22
- type EventOrderDetailArgs = {
23
- brandId: string;
24
- orderId: string;
25
- };
26
- type MembershipDetailArgs = {
27
- brandId: string;
28
- membershipId: string;
29
- };
30
- type FlashSaleArgs = {
31
- slug: string;
32
- };
33
- type FlashBookingOptionsArgs = {
34
- slug: string;
35
- itemId: string;
36
- };
37
- type FlashSalesArgs = {
38
- brandId: string;
39
- };
40
- declare function getMyReservations<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
41
- declare function getMyReservationDetail<T = unknown>(client: BowlosClient, args: ReservationDetailArgs): Promise<T>;
42
- declare function getMyEventOrders<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
43
- declare function getMyEventOrder<T = unknown>(client: BowlosClient, args: EventOrderDetailArgs): Promise<T>;
44
- declare function getMyMemberships<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
45
- declare function getMyMembershipDetail<T = unknown>(client: BowlosClient, args: MembershipDetailArgs): Promise<T>;
46
- declare function getMyLoyalty<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
47
- declare function getMyCredits<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
48
- declare function getMyPasses<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
49
- declare function getMyGameCards<T = MyGameCard[]>(client: BowlosClient, args: BrandScoped): Promise<T>;
50
- /** Outcome preview shared by all four cancel types. `bucket`/`hoursBeforeStart`/
51
- * `forfeitCents` are inert (null/0) for game cards (no time policy). */
52
- interface CancelPreview {
53
- cancellable: boolean;
54
- reason: string | null;
55
- bucket: string | null;
56
- hoursBeforeStart: number;
57
- creditCents: number;
58
- forfeitCents: number;
59
- paidCents: number;
60
- }
61
- interface CancelResult {
62
- id: string;
63
- status: string;
64
- creditCents: number;
65
- bucket?: string | null;
66
- hoursBeforeStart?: number;
67
- forfeitCents?: number;
68
- version?: number;
69
- }
70
- interface MyGameCard {
71
- id: string;
72
- displayId: string;
73
- cardName: string;
74
- status: "active" | "depleted" | "expired" | "cancelled" | "refunded";
75
- totalGames: number;
76
- remainingGames: number;
77
- shoesIncluded: boolean;
78
- purchasedAt: number;
79
- expiresAt: number;
80
- paidCents: number;
81
- /** Precomputed unused-only rule; the per-card preview is the source of truth. */
82
- cancellable: boolean;
83
- }
84
- type ReservationCancelArgs = {
85
- brandId: string;
86
- reservationId: string;
87
- expectedVersion: number;
88
- reason?: string;
89
- /** Per-attempt key; safe to retry. */
90
- idempotencyKey: string;
91
- };
92
- type OrderCancelArgs = {
93
- brandId: string;
94
- orderId: string;
95
- reason?: string;
96
- idempotencyKey: string;
97
- };
98
- type GameCardCancelArgs = {
99
- brandId: string;
100
- cardId: string;
101
- reason?: string;
102
- idempotencyKey: string;
103
- };
104
- declare function previewReservationCancellation<T = CancelPreview>(client: BowlosClient, args: {
105
- brandId: string;
106
- reservationId: string;
107
- }): Promise<T>;
108
- declare function previewEventOrderCancellation<T = CancelPreview>(client: BowlosClient, args: {
109
- brandId: string;
110
- orderId: string;
111
- }): Promise<T>;
112
- declare function previewPackageOrderCancellation<T = CancelPreview>(client: BowlosClient, args: {
113
- brandId: string;
114
- orderId: string;
115
- }): Promise<T>;
116
- declare function previewGameCardCancellation<T = CancelPreview>(client: BowlosClient, args: {
117
- brandId: string;
118
- cardId: string;
119
- }): Promise<T>;
120
- declare function cancelMyReservation<T = CancelResult>(client: BowlosClient, args: ReservationCancelArgs): Promise<T>;
121
- declare function cancelMyEventOrder<T = CancelResult>(client: BowlosClient, args: OrderCancelArgs): Promise<T>;
122
- declare function cancelMyPackageOrder<T = CancelResult>(client: BowlosClient, args: OrderCancelArgs): Promise<T>;
123
- declare function cancelMyGameCard<T = CancelResult>(client: BowlosClient, args: GameCardCancelArgs): Promise<T>;
124
- declare function getFlashSale<T = unknown>(client: BowlosClient, args: FlashSaleArgs): Promise<T>;
125
- /** The public flash-sale index for a Brand (live + upcoming; no prices). Public. */
126
- declare function getFlashSales<T = unknown>(client: BowlosClient, args: FlashSalesArgs): Promise<T>;
127
- declare function getFlashSaleBookingOptions<T = unknown>(client: BowlosClient, args: FlashBookingOptionsArgs): Promise<T>;
128
- type CreateFlashSaleBookingArgs = {
129
- slug: string;
130
- itemId: string;
131
- dateISO: string;
132
- startMinuteOfDay: number;
133
- durationMinutes: number;
134
- units: number;
135
- /** Per-attempt key; replays return the original checkout. */
136
- idempotencyKey: string;
137
- };
138
- interface FlashSaleBookingResult {
139
- /** Handle for the rest of the checkout: mint the PaymentIntent with
140
- * `createCheckoutPaymentIntent(client, { refToken })`, then poll
141
- * `getCheckoutStatus(client, refToken)` to materialization. */
142
- refToken: string;
143
- /** The SALE-priced total the PaymentIntent charges (base at the flash
144
- * price + tax + the Center fee). */
145
- amountDueCents: number;
146
- holdExpiresAt: number;
147
- breakdown: {
148
- /** Tier savings already removed from baseSubtotalCents; do not subtract again. */
149
- tierDiscountCents: number;
150
- baseSubtotalCents: number;
151
- reservationFeeCents: number;
152
- reservationFeeLabel: string | null;
153
- taxAddedCents: number;
154
- taxIncludedCents: number;
155
- totalCents: number;
156
- };
157
- }
158
- /**
159
- * v0.22.1 — book a flash-sale reservation item at its SALE price (the flash
160
- * analog of `eventOfferSlug`: the server binds the item's sale price, holds
161
- * the inventory, and opens a checkout). Signed-in customers only. Pick the
162
- * date/time from `getFlashSaleBookingOptions` — the purpose-built option
163
- * list — never the regular booking calendar.
164
- */
165
- declare function createFlashSaleBooking(client: BowlosClient, args: CreateFlashSaleBookingArgs): Promise<FlashSaleBookingResult>;
166
- /** Saved cards belong to the active location's connected Stripe account. */
167
- type SavedCardScope = {
168
- brandId: string;
169
- centerId: string;
170
- };
171
- type SavedCardArgs = SavedCardScope & {
172
- paymentMethodId: string;
173
- };
174
- interface SavedCard {
175
- id: string;
176
- brand: string;
177
- last4: string;
178
- expMonth: number;
179
- expYear: number;
180
- isDefault: boolean;
181
- }
182
- interface SavedCardsResult {
183
- methods: SavedCard[];
184
- chargeable: boolean;
185
- }
186
- interface CardSetupResult {
187
- clientSecret: string;
188
- publishableKey: string;
189
- stripeAccount: string;
190
- stripeMode: "test" | "live";
191
- merchantDisplayName: string;
192
- }
193
- type ChangePasswordArgs = {
194
- currentPassword: string;
195
- newPassword: string;
196
- };
197
- declare function listSavedCards(client: BowlosClient, args: SavedCardScope): Promise<SavedCardsResult>;
198
- declare function createCardSetup(client: BowlosClient, args: SavedCardScope): Promise<CardSetupResult>;
199
- declare function removeSavedCard(client: BowlosClient, args: SavedCardArgs): Promise<{
200
- detached: boolean;
201
- }>;
202
- declare function setDefaultCard(client: BowlosClient, args: SavedCardArgs): Promise<{
203
- ok: boolean;
204
- }>;
205
- /** Success invalidates all sessions; discard local tokens and show sign-in. */
206
- declare function changePassword(client: BowlosClient, args: ChangePasswordArgs): Promise<{
207
- ok: true;
208
- }>;
209
-
210
- export { getMyLoyalty as A, type BrandScoped as B, type CancelPreview as C, getMyMembershipDetail as D, type EventOrderDetailArgs as E, type FlashBookingOptionsArgs as F, type GameCardCancelArgs as G, getMyMemberships as H, getMyPasses as I, getMyReservationDetail as J, getMyReservations as K, listSavedCards as L, type MembershipDetailArgs as M, previewEventOrderCancellation as N, type OrderCancelArgs as O, previewGameCardCancellation as P, previewPackageOrderCancellation as Q, type ReservationCancelArgs as R, type SavedCard as S, previewReservationCancellation as T, removeSavedCard as U, setDefaultCard as V, type CancelResult as a, type CardSetupResult as b, type ChangePasswordArgs as c, type CreateFlashSaleBookingArgs as d, type FlashSaleArgs as e, type FlashSaleBookingResult as f, type FlashSalesArgs as g, type MyGameCard as h, type ReservationDetailArgs as i, type SavedCardArgs as j, type SavedCardScope as k, type SavedCardsResult as l, cancelMyEventOrder as m, cancelMyGameCard as n, cancelMyPackageOrder as o, cancelMyReservation as p, changePassword as q, createCardSetup as r, createFlashSaleBooking as s, getFlashSale as t, getFlashSaleBookingOptions as u, getFlashSales as v, getMyCredits as w, getMyEventOrder as x, getMyEventOrders as y, getMyGameCards as z };
@@ -1,224 +0,0 @@
1
- import { g as BowlosClient } from './data-BJkB-tvM.cjs';
2
-
3
- /**
4
- * Error model for the BowlOS Reservations SDK.
5
- *
6
- * Every failed gateway call surfaces as a single `BowlosApiError` carrying a
7
- * stable `code` (string), the HTTP `status`, and — for rate limits — a
8
- * `retryAfterSeconds`. The gateway normalizes the backend's two error
9
- * conventions (thrown ConvexError + `{ ok:false }` envelopes) into one JSON
10
- * shape; this class is the client-side mirror of that shape, so consumers
11
- * branch on `error.code`, never on message text.
12
- */
13
- /** Stable error codes the gateway / backend can return. Open set — treat
14
- * `code` as a string and match against these for known cases. */
15
- declare const BOWLOS_ERROR_CODES: {
16
- readonly API_KEY_MISSING: "API_KEY_MISSING";
17
- readonly API_KEY_INVALID: "API_KEY_INVALID";
18
- readonly ORIGIN_NOT_ALLOWED: "ORIGIN_NOT_ALLOWED";
19
- readonly RATE_LIMITED: "RATE_LIMITED";
20
- readonly PASSWORD_TOO_WEAK: "PASSWORD_TOO_WEAK";
21
- readonly CURRENT_PASSWORD_INCORRECT: "CURRENT_PASSWORD_INCORRECT";
22
- readonly CURRENT_PASSWORD_REQUIRED: "CURRENT_PASSWORD_REQUIRED";
23
- readonly INVALID_CREDENTIALS: "INVALID_CREDENTIALS";
24
- readonly SIGNUP_FAILED: "SIGNUP_FAILED";
25
- readonly VALIDATION_FAILED: "VALIDATION_FAILED";
26
- readonly PERMISSION_DENIED: "PERMISSION_DENIED";
27
- readonly SCOPE_REVOKED: "SCOPE_REVOKED";
28
- readonly NOT_FOUND: "NOT_FOUND";
29
- readonly VERSION_CONFLICT: "VERSION_CONFLICT";
30
- readonly PRICING_SNAPSHOT_STALE: "PRICING_SNAPSHOT_STALE";
31
- readonly PAYMENTS_NOT_CONNECTED: "PAYMENTS_NOT_CONNECTED";
32
- readonly CONNECT_ACCOUNT_RESTRICTED: "CONNECT_ACCOUNT_RESTRICTED";
33
- readonly CHECKOUT_EXPIRED: "CHECKOUT_EXPIRED";
34
- readonly NETWORK_ERROR: "NETWORK_ERROR";
35
- readonly UNKNOWN: "ERROR";
36
- };
37
- type BowlosErrorCode = (typeof BOWLOS_ERROR_CODES)[keyof typeof BOWLOS_ERROR_CODES] | (string & {});
38
- interface BowlosApiErrorOptions {
39
- retryAfterSeconds?: number;
40
- cause?: unknown;
41
- }
42
- declare class BowlosApiError extends Error {
43
- /** Stable, machine-readable code. Branch on this, not on `message`. */
44
- readonly code: BowlosErrorCode;
45
- /** HTTP status (0 for a network failure before any response). */
46
- readonly status: number;
47
- /** Seconds to wait before retrying — present only on `RATE_LIMITED`. */
48
- readonly retryAfterSeconds?: number;
49
- constructor(code: BowlosErrorCode, message: string, status: number, options?: BowlosApiErrorOptions);
50
- /** Too many requests — caller should back off `retryAfterSeconds`. */
51
- get isRateLimited(): boolean;
52
- /** Bad/expired login. The session could not be established or has lapsed. */
53
- get isAuthError(): boolean;
54
- /** Wrong/missing API key or a disallowed origin — a site-config problem,
55
- * not something the end customer can fix. */
56
- get isConfigError(): boolean;
57
- }
58
-
59
- /**
60
- * Public catalog reads for @bowlos/reservations — the "what can I book/buy here"
61
- * surface that powers `<BookingCatalog>`. All anonymous (no customer login).
62
- * Products + events + memberships are Center-scoped; packages + game cards are
63
- * Brand-scoped (with an optional Center filter). Results are generic (`<T>`);
64
- * the component types the display fields it needs.
65
- */
66
-
67
- type CenterScoped = {
68
- centerId: string;
69
- };
70
- type BrandCatalogArgs = {
71
- brandId: string;
72
- centerId?: string;
73
- };
74
- /** Which public surface is asking — the backend applies that surface's
75
- * per-category + per-offer visibility before returning. */
76
- type PublicSurface = "sdk_custom_site" | "white_label_web" | "mobile_app";
77
- type CatalogCategory = "bowling" | "other_attractions" | "events" | "packages" | "memberships" | "game_passes";
78
- type CatalogActionType = "book_reservation" | "view_event" | "buy_ticket" | "buy_package" | "buy_membership" | "buy_game_pass";
79
- type CatalogSourceTable = "products" | "event_offers" | "packages" | "membership_templates" | "game_card_templates";
80
- /** A normalized, surface-agnostic catalog item. Route by `action.type`, using
81
- * the IDs in `action.payload` (e.g. `productId`, `slug`, `packageId`,
82
- * `templateId`). `priceLabel` is an indicative "from $X" only (null for
83
- * products — show "See times & pricing"); the binding price comes from the
84
- * per-category preview after login. */
85
- interface CatalogItem {
86
- id: string;
87
- category: CatalogCategory;
88
- sourceTable: CatalogSourceTable;
89
- sourceId: string;
90
- title: string;
91
- subtitle?: string | null;
92
- description?: string | null;
93
- priceLabel?: string | null;
94
- imageUrl?: string | null;
95
- badgeLabel?: string | null;
96
- action: {
97
- type: CatalogActionType;
98
- payload: Record<string, string>;
99
- };
100
- }
101
- interface CatalogSection {
102
- key: CatalogCategory;
103
- label: string;
104
- items: CatalogItem[];
105
- }
106
- interface CatalogResult {
107
- sections: CatalogSection[];
108
- /**
109
- * Date-first booking (v0.24.0): the Center's default booking entry point.
110
- * Open your funnel on this; let the customer toggle to the other. Optional —
111
- * older gateways omit it (treat absent as `"product_first"`).
112
- */
113
- bookingEntryDefault?: "product_first" | "date_first";
114
- /** Center-local "today" (YYYY-MM-DD) — default + minimum for a date-first
115
- * date picker, so you don't guess the Center's timezone. Optional. */
116
- todayISO?: string;
117
- /**
118
- * Full Test Mode (2026-06-23): true when the operator has put this Center in
119
- * test mode. Render a customer-facing "Maintenance mode" notice (use
120
- * `<MaintenanceBanner>` or `useTestMode()`); normal customers' bookings are
121
- * server-refused (`CENTER_IN_MAINTENANCE`) — only admin Test-Account customers
122
- * transact. Absent on older gateways → false.
123
- */
124
- maintenanceMode?: boolean;
125
- }
126
- /** Args for the canonical catalog read. `surface` selects which visibility
127
- * rules the backend applies. */
128
- type CatalogArgs = {
129
- brandId: string;
130
- centerId: string;
131
- surface: PublicSurface;
132
- };
133
- /**
134
- * The canonical public catalog for a surface — every active, public,
135
- * bookable/sellable item grouped into the six first-class categories, with the
136
- * Center admin's per-surface category + offer visibility already applied.
137
- * Anonymous. This is the recommended way to list "everything bookable here":
138
- * one call, all categories, visibility-aware, consistent with the white-label
139
- * web + mobile surfaces.
140
- */
141
- declare function listCatalog<T = CatalogResult>(client: BowlosClient, args: CatalogArgs): Promise<T>;
142
- /** One package's full detail. `shareToken` reveals a hidden/unlisted package. */
143
- type PackageDetailArgs = {
144
- packageId: string;
145
- shareToken?: string;
146
- };
147
- /** Args for a Center's operating-hours window on a date, across attraction types. */
148
- type CenterHoursArgs = {
149
- centerId: string;
150
- attractionTypeKeys: string[];
151
- dateISO: string;
152
- };
153
- /** Bookable products at a Center (each carries its attraction + `attractionTypeKey`). */
154
- declare function listProducts<T = unknown>(client: BowlosClient, args: CenterScoped): Promise<T>;
155
- /** Upcoming pricing events (NYE Bash, tournaments…) at a Center. */
156
- declare function listEvents<T = unknown>(client: BowlosClient, args: CenterScoped): Promise<T>;
157
- /** Sellable event offers at a Center. These are the public lineup + event
158
- * landing-page records; use this instead of `listEvents` when routing a
159
- * customer to an event purchase flow. */
160
- declare function listEventOffers<T = unknown>(client: BowlosClient, args: CenterScoped): Promise<T>;
161
- /** One sellable event offer by landing-page slug. */
162
- declare function getEventOffer<T = unknown>(client: BowlosClient, args: {
163
- slug: string;
164
- }): Promise<T>;
165
- /** Purchasable packages at a Brand. */
166
- declare function listPackages<T = unknown>(client: BowlosClient, args: BrandCatalogArgs): Promise<T>;
167
- /** Full detail for one package — components, optional add-ons, allowed start
168
- * times, duration, and quantity bounds. Drives the headless package config UI
169
- * (see HEADLESS.md → "Buying a package"). */
170
- declare function getPackage<T = unknown>(client: BowlosClient, args: PackageDetailArgs): Promise<T>;
171
- /** A Center's combined open/close window (minutes-from-midnight) for the given
172
- * attraction types on a date — the intersection across types; `null` if closed.
173
- * Bound a package's start times with its component attraction-type keys. */
174
- declare function getCenterHours<T = unknown>(client: BowlosClient, args: CenterHoursArgs): Promise<T>;
175
- /** Purchasable memberships at a Center. */
176
- declare function listPublicMemberships<T = unknown>(client: BowlosClient, args: CenterScoped): Promise<T>;
177
- /** Purchasable game cards / passes at a Brand. */
178
- declare function listGameCards<T = unknown>(client: BowlosClient, args: BrandCatalogArgs): Promise<T>;
179
- /** A pricing mode an attraction charges in. */
180
- type RetailPricingMode = "per_unit_per_hour" | "per_person_per_hour" | "per_game";
181
- /** One matrix row — a day-of-week + time band with per-mode rates. */
182
- interface RetailWalkInRate {
183
- dayOfWeek: number;
184
- startMinuteOfDay: number;
185
- endMinuteOfDay: number;
186
- label: string | null;
187
- rateUnitHourCents: number | null;
188
- ratePersonHourCents: number | null;
189
- rateGameCents: number | null;
190
- }
191
- /** Walk-in rates grouped by attraction. */
192
- interface RetailAttraction {
193
- attractionId: string;
194
- name: string;
195
- typeKey: string;
196
- enabledModes: RetailPricingMode[];
197
- unitLabelSingular: string;
198
- unitLabelPlural: string;
199
- walkInRates: RetailWalkInRate[];
200
- }
201
- /** A featured "website special" (an opted-in price plan). */
202
- interface RetailSpecial {
203
- planId: string;
204
- name: string;
205
- description: string;
206
- priceCents: number | null;
207
- attractionId: string;
208
- attractionName: string;
209
- /** Seasonal window (YYYY-MM-DD) when set — label/hide out of season. */
210
- effectiveStartDate: string | null;
211
- effectiveEndDate: string | null;
212
- }
213
- /** The full retail-pricing payload for a Center. */
214
- interface RetailPricing {
215
- centerName: string;
216
- attractions: RetailAttraction[];
217
- specials: RetailSpecial[];
218
- }
219
- /** A Center's public price list: walk-in (matrix) rates + website specials.
220
- * Read-only, anonymous — drives a printed-menu-style pricing page that always
221
- * matches the operator's live config. Not a booking surface. */
222
- declare function listRetailPricing<T = RetailPricing>(client: BowlosClient, args: CenterScoped): Promise<T>;
223
-
224
- export { listPublicMemberships as A, BOWLOS_ERROR_CODES as B, type CatalogActionType as C, listRetailPricing as D, type PackageDetailArgs as P, type RetailAttraction as R, BowlosApiError as a, type BowlosApiErrorOptions as b, type BowlosErrorCode as c, type BrandCatalogArgs as d, type CatalogArgs as e, type CatalogCategory as f, type CatalogItem as g, type CatalogResult as h, type CatalogSection as i, type CatalogSourceTable as j, type CenterHoursArgs as k, type CenterScoped as l, type PublicSurface as m, type RetailPricing as n, type RetailPricingMode as o, type RetailSpecial as p, type RetailWalkInRate as q, getCenterHours as r, getEventOffer as s, getPackage as t, listCatalog as u, listEventOffers as v, listEvents as w, listGameCards as x, listPackages as y, listProducts as z };