@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.
- package/HEADLESS.md +20 -1
- package/dist/{account-nHac98qx.d.cts → account-BXf9e6UW.d.cts} +1 -1
- package/dist/{account-5oZrwcaq.d.ts → account-N1Zs7yvQ.d.ts} +1 -1
- package/dist/{catalog-BMdk6ZSC.d.ts → catalog-BF_xtQxf.d.ts} +1 -1
- package/dist/{catalog-Ca7eN9CP.d.cts → catalog-CVvwgrbZ.d.cts} +1 -1
- package/dist/{chunk-7OHHK65Q.js → chunk-AYQIKZCU.js} +8 -4
- package/dist/chunk-AYQIKZCU.js.map +1 -0
- package/dist/{chunk-5JWJBLPE.js → chunk-PPCQFT3U.js} +19 -4
- package/dist/chunk-PPCQFT3U.js.map +1 -0
- package/dist/cli.cjs +17 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/components.cjs +17 -1
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +4 -4
- package/dist/components.d.ts +4 -4
- package/dist/components.js +19 -3
- package/dist/components.js.map +1 -1
- package/dist/{data-CVq9zXz7.d.cts → data-BCbYaSC1.d.cts} +9 -2
- package/dist/{data-CVq9zXz7.d.ts → data-BCbYaSC1.d.ts} +9 -2
- package/dist/index.cjs +17 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/payments.d.cts +1 -1
- package/dist/payments.d.ts +1 -1
- package/dist/{react-C9bUP9LB.d.ts → react-BQikV5KJ.d.ts} +4 -2
- package/dist/{react-Bhpzhr01.d.cts → react-Y11QkXEQ.d.cts} +4 -2
- package/dist/react.cjs +22 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +5 -5
- package/dist/react.d.ts +5 -5
- package/dist/react.js +3 -3
- package/package.json +1 -1
- package/templates/center-site/package.json +1 -1
- package/dist/chunk-5JWJBLPE.js.map +0 -1
- 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-
|
|
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-
|
|
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";
|
package/dist/payments.d.cts
CHANGED
|
@@ -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-
|
|
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 {
|
package/dist/payments.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
4
|
-
import { a as BowlosApiError } from './catalog-
|
|
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-
|
|
4
|
-
import { a as BowlosApiError } from './catalog-
|
|
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
|
-
/**
|
|
210
|
-
*
|
|
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);
|