@bowlos/reservations 0.26.0 → 0.28.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 (38) hide show
  1. package/HEADLESS.md +109 -16
  2. package/README.md +7 -5
  3. package/dist/{account-BXf9e6UW.d.cts → account-BZ-lZcs5.d.cts} +1 -1
  4. package/dist/{account-N1Zs7yvQ.d.ts → account-DVAwhiki.d.ts} +1 -1
  5. package/dist/{catalog-CVvwgrbZ.d.cts → catalog-BdOZC2nx.d.cts} +1 -1
  6. package/dist/{catalog-BF_xtQxf.d.ts → catalog-C-YyKVk5.d.ts} +1 -1
  7. package/dist/{chunk-AYQIKZCU.js → chunk-44AWSRIG.js} +32 -4
  8. package/dist/chunk-44AWSRIG.js.map +1 -0
  9. package/dist/{chunk-PPCQFT3U.js → chunk-P5YWNLEC.js} +30 -4
  10. package/dist/chunk-P5YWNLEC.js.map +1 -0
  11. package/dist/cli.cjs +24 -0
  12. package/dist/cli.cjs.map +1 -1
  13. package/dist/components.cjs +136 -20
  14. package/dist/components.cjs.map +1 -1
  15. package/dist/components.d.cts +17 -4
  16. package/dist/components.d.ts +17 -4
  17. package/dist/components.js +138 -22
  18. package/dist/components.js.map +1 -1
  19. package/dist/{data-BCbYaSC1.d.cts → data-BzO2guh0.d.cts} +23 -3
  20. package/dist/{data-BCbYaSC1.d.ts → data-BzO2guh0.d.ts} +23 -3
  21. package/dist/index.cjs +28 -2
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +4 -4
  24. package/dist/index.d.ts +4 -4
  25. package/dist/index.js +2 -2
  26. package/dist/payments.d.cts +1 -1
  27. package/dist/payments.d.ts +1 -1
  28. package/dist/{react-BQikV5KJ.d.ts → react-BQaKMnCR.d.ts} +8 -2
  29. package/dist/{react-Y11QkXEQ.d.cts → react-CYgFZdHO.d.cts} +8 -2
  30. package/dist/react.cjs +53 -1
  31. package/dist/react.cjs.map +1 -1
  32. package/dist/react.d.cts +5 -5
  33. package/dist/react.d.ts +5 -5
  34. package/dist/react.js +3 -3
  35. package/package.json +1 -1
  36. package/templates/center-site/package.json +1 -1
  37. package/dist/chunk-AYQIKZCU.js.map +0 -1
  38. package/dist/chunk-PPCQFT3U.js.map +0 -1
@@ -127,6 +127,20 @@ declare class BowlosClient {
127
127
  /** Low-level: create a login only (no customer profile). Prefer `register()`;
128
128
  * if you use this you MUST follow with `link()` or the customer is orphaned. */
129
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>;
130
144
  /** Link the signed-in auth user to a customer profile at the brand. */
131
145
  link(profile: LinkProfile): Promise<unknown>;
132
146
  /** End the session (best-effort server call; always clears locally). */
@@ -225,9 +239,15 @@ interface BookingQuote {
225
239
  }
226
240
  /** Free units for a product/date/time window (anonymous). */
227
241
  declare function checkAvailability(client: BowlosClient, args: AvailabilityArgs): Promise<AvailabilityResult>;
228
- /** Authoritative price quote for the chosen inputs (anonymous; a signed-in
229
- * session unlocks member rates + account credit). */
230
- declare function bookingPreview(client: BowlosClient, args: BookingPreviewArgs): Promise<BookingQuote>;
242
+ /** Authoritative price quote for the chosen inputs. Anonymous by default
243
+ * (the center's standard online price). Pass `{ auth: true }` when the
244
+ * customer has a session so the quote includes member rate + account
245
+ * credit — headless sites must opt in, since the core doesn't track
246
+ * session state. (The `<BookingFlow>` reference + `useBookingPreview`
247
+ * hook do this automatically off `useAccount`.) */
248
+ declare function bookingPreview(client: BowlosClient, args: BookingPreviewArgs, opts?: {
249
+ auth?: boolean;
250
+ }): Promise<BookingQuote>;
231
251
  /** Add-ons available for a product (shoe rental, upgrades…). Anonymous-callable;
232
252
  * feed the customer's picks back as `addons` on the preview + the booking. */
233
253
  declare function listAddons(client: BowlosClient, args: {
@@ -127,6 +127,20 @@ declare class BowlosClient {
127
127
  /** Low-level: create a login only (no customer profile). Prefer `register()`;
128
128
  * if you use this you MUST follow with `link()` or the customer is orphaned. */
129
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>;
130
144
  /** Link the signed-in auth user to a customer profile at the brand. */
131
145
  link(profile: LinkProfile): Promise<unknown>;
132
146
  /** End the session (best-effort server call; always clears locally). */
@@ -225,9 +239,15 @@ interface BookingQuote {
225
239
  }
226
240
  /** Free units for a product/date/time window (anonymous). */
227
241
  declare function checkAvailability(client: BowlosClient, args: AvailabilityArgs): Promise<AvailabilityResult>;
228
- /** Authoritative price quote for the chosen inputs (anonymous; a signed-in
229
- * session unlocks member rates + account credit). */
230
- declare function bookingPreview(client: BowlosClient, args: BookingPreviewArgs): Promise<BookingQuote>;
242
+ /** Authoritative price quote for the chosen inputs. Anonymous by default
243
+ * (the center's standard online price). Pass `{ auth: true }` when the
244
+ * customer has a session so the quote includes member rate + account
245
+ * credit — headless sites must opt in, since the core doesn't track
246
+ * session state. (The `<BookingFlow>` reference + `useBookingPreview`
247
+ * hook do this automatically off `useAccount`.) */
248
+ declare function bookingPreview(client: BowlosClient, args: BookingPreviewArgs, opts?: {
249
+ auth?: boolean;
250
+ }): Promise<BookingQuote>;
231
251
  /** Add-ons available for a product (shoe rental, upgrades…). Anonymous-callable;
232
252
  * feed the customer's picks back as `addons` on the preview + the booking. */
233
253
  declare function listAddons(client: BowlosClient, args: {
package/dist/index.cjs CHANGED
@@ -251,6 +251,30 @@ var BowlosClient = class {
251
251
  this.store.set(tokens);
252
252
  return tokens;
253
253
  }
254
+ /**
255
+ * Forgot-password step 1: email a reset code to the address (if it has an
256
+ * account at this center). Resolves regardless of whether the email exists —
257
+ * the server never reveals that, to prevent account enumeration. No session
258
+ * needed.
259
+ */
260
+ async requestPasswordReset(email) {
261
+ await this.call("auth/request-reset", { email });
262
+ }
263
+ /**
264
+ * Forgot-password step 2: verify the emailed code + set a new password. On
265
+ * success the customer is signed in (the session is stored), so the UI can
266
+ * continue straight into the funnel. Throws `INVALID_RESET` on a bad/expired
267
+ * code and `PASSWORD_TOO_WEAK` if the new password fails the policy.
268
+ */
269
+ async resetPassword(email, code, newPassword) {
270
+ const { tokens } = await this.call("auth/reset", {
271
+ email,
272
+ code,
273
+ newPassword
274
+ });
275
+ this.store.set(tokens);
276
+ return tokens;
277
+ }
254
278
  /** Link the signed-in auth user to a customer profile at the brand. */
255
279
  async link(profile) {
256
280
  return this.call("auth/link", { ...profile }, { auth: true });
@@ -472,8 +496,10 @@ async function runDoctor(options) {
472
496
  function checkAvailability(client, args) {
473
497
  return client.call("checkAvailability", args);
474
498
  }
475
- function bookingPreview(client, args) {
476
- return client.call("bookingPreview", args);
499
+ function bookingPreview(client, args, opts) {
500
+ return client.call("bookingPreview", args, {
501
+ auth: opts?.auth ?? false
502
+ });
477
503
  }
478
504
  function listAddons(client, args) {
479
505
  return client.call("listPublicAddons", args);