@bowlos/reservations 0.25.0 → 0.26.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 (37) hide show
  1. package/HEADLESS.md +20 -1
  2. package/dist/{account-nHac98qx.d.cts → account-BXf9e6UW.d.cts} +1 -1
  3. package/dist/{account-5oZrwcaq.d.ts → account-N1Zs7yvQ.d.ts} +1 -1
  4. package/dist/{catalog-BMdk6ZSC.d.ts → catalog-BF_xtQxf.d.ts} +1 -1
  5. package/dist/{catalog-Ca7eN9CP.d.cts → catalog-CVvwgrbZ.d.cts} +1 -1
  6. package/dist/{chunk-7OHHK65Q.js → chunk-AYQIKZCU.js} +8 -4
  7. package/dist/chunk-AYQIKZCU.js.map +1 -0
  8. package/dist/{chunk-5JWJBLPE.js → chunk-PPCQFT3U.js} +19 -4
  9. package/dist/chunk-PPCQFT3U.js.map +1 -0
  10. package/dist/cli.cjs +17 -2
  11. package/dist/cli.cjs.map +1 -1
  12. package/dist/components.cjs +17 -1
  13. package/dist/components.cjs.map +1 -1
  14. package/dist/components.d.cts +4 -4
  15. package/dist/components.d.ts +4 -4
  16. package/dist/components.js +19 -3
  17. package/dist/components.js.map +1 -1
  18. package/dist/{data-CVq9zXz7.d.cts → data-BCbYaSC1.d.cts} +9 -2
  19. package/dist/{data-CVq9zXz7.d.ts → data-BCbYaSC1.d.ts} +9 -2
  20. package/dist/index.cjs +17 -2
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +4 -4
  23. package/dist/index.d.ts +4 -4
  24. package/dist/index.js +2 -2
  25. package/dist/payments.d.cts +1 -1
  26. package/dist/payments.d.ts +1 -1
  27. package/dist/{react-C9bUP9LB.d.ts → react-BQikV5KJ.d.ts} +4 -2
  28. package/dist/{react-Bhpzhr01.d.cts → react-Y11QkXEQ.d.cts} +4 -2
  29. package/dist/react.cjs +22 -3
  30. package/dist/react.cjs.map +1 -1
  31. package/dist/react.d.cts +5 -5
  32. package/dist/react.d.ts +5 -5
  33. package/dist/react.js +3 -3
  34. package/package.json +1 -1
  35. package/templates/center-site/package.json +1 -1
  36. package/dist/chunk-5JWJBLPE.js.map +0 -1
  37. package/dist/chunk-7OHHK65Q.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createBowlosClient, BOWLOS_ERROR_CODES, BowlosApiError } from './chunk-5JWJBLPE.js';
2
- export { BOWLOS_ERROR_CODES, BowlosApiError, BowlosClient, abandonCheckout, availableUnitCount, bookingPreview, checkAvailability, createBooking, createBowlosClient, createCheckoutPaymentIntent, createEventTicketOrder, createGameCardOrder, createMembershipOrder, createMembershipSubscriptionOrder, createPackageOrder, generateIdempotencyKey, getCheckoutStatus, getEventTicketStatus, getGameCardStatus, getMembershipStatus, getPackageStatus, listAddons, listStartTimes, localStorageTokenStore, previewEventTicket, previewGameCard, previewMembership, previewMembershipSubscription, previewPackage } from './chunk-5JWJBLPE.js';
1
+ import { createBowlosClient, BOWLOS_ERROR_CODES, BowlosApiError } from './chunk-PPCQFT3U.js';
2
+ export { BOWLOS_ERROR_CODES, BowlosApiError, BowlosClient, abandonCheckout, availableUnitCount, bookingPreview, checkAvailability, createBooking, createBowlosClient, createCheckoutPaymentIntent, createEventTicketOrder, createGameCardOrder, createMembershipOrder, createMembershipSubscriptionOrder, createPackageOrder, generateIdempotencyKey, getCheckoutStatus, getEventTicketStatus, getGameCardStatus, getMembershipStatus, getPackageStatus, listAddons, listStartTimes, localStorageTokenStore, previewEventTicket, previewGameCard, previewMembership, previewMembershipSubscription, previewPackage } from './chunk-PPCQFT3U.js';
3
3
 
4
4
  // src/doctor.ts
5
5
  var GATEWAY_SUFFIX = "/api/public/v1";
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { Appearance } from '@stripe/stripe-js';
3
- import { j as ConnectedPaymentInput } from './data-CVq9zXz7.cjs';
3
+ import { j as ConnectedPaymentInput } from './data-BCbYaSC1.cjs';
4
4
 
5
5
  /** Visible strings — override any subset for copy/i18n. */
6
6
  interface BowlosPaymentFormLabels {
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { Appearance } from '@stripe/stripe-js';
3
- import { j as ConnectedPaymentInput } from './data-CVq9zXz7.js';
3
+ import { j as ConnectedPaymentInput } from './data-BCbYaSC1.js';
4
4
 
5
5
  /** Visible strings — override any subset for copy/i18n. */
6
6
  interface BowlosPaymentFormLabels {
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { A as AuthState, g as BowlosClient, h as BowlosClientConfig, l as Customer, L as LinkProfile } from './data-CVq9zXz7.js';
4
- import { a as BowlosApiError } from './catalog-BMdk6ZSC.js';
3
+ import { A as AuthState, g as BowlosClient, h as BowlosClientConfig, l as Customer, L as LinkProfile } from './data-BCbYaSC1.js';
4
+ import { a as BowlosApiError } from './catalog-BF_xtQxf.js';
5
5
 
6
6
  interface BowlosProviderProps {
7
7
  /** A prebuilt client, or pass `config` to have one created and memoized. */
@@ -17,6 +17,8 @@ interface UseAccountResult {
17
17
  customer: Customer | null;
18
18
  error: BowlosApiError | null;
19
19
  signIn: (email: string, password: string) => Promise<void>;
20
+ /** Atomic sign-up (preferred): login + customer profile in one call. */
21
+ register: (email: string, password: string, profile: Omit<LinkProfile, "email">) => Promise<void>;
20
22
  signUp: (email: string, password: string) => Promise<void>;
21
23
  link: (profile: LinkProfile) => Promise<void>;
22
24
  signOut: () => Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { A as AuthState, g as BowlosClient, h as BowlosClientConfig, l as Customer, L as LinkProfile } from './data-CVq9zXz7.cjs';
4
- import { a as BowlosApiError } from './catalog-Ca7eN9CP.cjs';
3
+ import { A as AuthState, g as BowlosClient, h as BowlosClientConfig, l as Customer, L as LinkProfile } from './data-BCbYaSC1.cjs';
4
+ import { a as BowlosApiError } from './catalog-CVvwgrbZ.cjs';
5
5
 
6
6
  interface BowlosProviderProps {
7
7
  /** A prebuilt client, or pass `config` to have one created and memoized. */
@@ -17,6 +17,8 @@ interface UseAccountResult {
17
17
  customer: Customer | null;
18
18
  error: BowlosApiError | null;
19
19
  signIn: (email: string, password: string) => Promise<void>;
20
+ /** Atomic sign-up (preferred): login + customer profile in one call. */
21
+ register: (email: string, password: string, profile: Omit<LinkProfile, "email">) => Promise<void>;
20
22
  signUp: (email: string, password: string) => Promise<void>;
21
23
  link: (profile: LinkProfile) => Promise<void>;
22
24
  signOut: () => Promise<void>;
package/dist/react.cjs CHANGED
@@ -206,8 +206,23 @@ var BowlosClient = class {
206
206
  this.store.set(tokens);
207
207
  return tokens;
208
208
  }
209
- /** Create a login (the auth half of sign-up); stores the session. Follow with
210
- * `link()` to attach the customer profile. */
209
+ /**
210
+ * Atomic sign-up (preferred): create the login AND the brand-scoped customer
211
+ * profile in ONE server call, then store the session. Use this instead of
212
+ * `signUp()` + `link()` — the two-step path can strand a login with no
213
+ * customer profile if `link()` is missed or races the new session.
214
+ */
215
+ async register(email, password, profile) {
216
+ const { tokens } = await this.call("auth/register", {
217
+ email,
218
+ password,
219
+ ...profile
220
+ });
221
+ this.store.set(tokens);
222
+ return tokens;
223
+ }
224
+ /** Low-level: create a login only (no customer profile). Prefer `register()`;
225
+ * if you use this you MUST follow with `link()` or the customer is orphaned. */
211
226
  async signUp(email, password) {
212
227
  const { tokens } = await this.call("auth/signup", { email, password });
213
228
  this.store.set(tokens);
@@ -317,13 +332,17 @@ function useAccountState(client) {
317
332
  (email, password) => run(() => client.signIn(email, password)),
318
333
  [client, run]
319
334
  );
335
+ const register = react.useCallback(
336
+ (email, password, profile) => run(() => client.register(email, password, profile)),
337
+ [client, run]
338
+ );
320
339
  const signUp = react.useCallback(
321
340
  (email, password) => run(() => client.signUp(email, password)),
322
341
  [client, run]
323
342
  );
324
343
  const link = react.useCallback((profile) => run(() => client.link(profile)), [client, run]);
325
344
  const signOut = react.useCallback(() => run(() => client.signOut()), [client, run]);
326
- return { status, customer, error, signIn, signUp, link, signOut, refresh };
345
+ return { status, customer, error, signIn, register, signUp, link, signOut, refresh };
327
346
  }
328
347
  function useAccount() {
329
348
  const account = react.useContext(AccountContext);