@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.
- package/AGENTS.md +300 -0
- package/HEADLESS.md +534 -10
- package/README.md +242 -2
- package/dist/{data-BJkB-tvM.d.cts → account-DEX2Lr78.d.cts} +208 -1
- package/dist/{data-BJkB-tvM.d.ts → account-DEX2Lr78.d.ts} +208 -1
- package/dist/booking-change-4DGu-B08.d.ts +1282 -0
- package/dist/booking-change-aK6P37FZ.d.cts +1282 -0
- package/dist/{chunk-3JSVEOKG.js → chunk-44WKP6MW.js} +32 -5
- package/dist/chunk-44WKP6MW.js.map +1 -0
- package/dist/{chunk-TEHRROVY.js → chunk-BWJHRJN6.js} +47 -192
- package/dist/chunk-BWJHRJN6.js.map +1 -0
- package/dist/{chunk-Y3YSDO3H.js → chunk-FMFHNBDH.js} +56 -5
- package/dist/chunk-FMFHNBDH.js.map +1 -0
- package/dist/chunk-I37IJNYU.js +139 -0
- package/dist/chunk-I37IJNYU.js.map +1 -0
- package/dist/chunk-VJIS56OO.js +717 -0
- package/dist/chunk-VJIS56OO.js.map +1 -0
- package/dist/cli.cjs +29 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/components.cjs +1595 -2
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +208 -7
- package/dist/components.d.ts +208 -7
- package/dist/components.js +1045 -7
- package/dist/components.js.map +1 -1
- package/dist/index.cjs +270 -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 +203 -0
- package/dist/payments.cjs.map +1 -1
- package/dist/payments.d.cts +16 -2
- package/dist/payments.d.ts +16 -2
- package/dist/payments.js +78 -2
- package/dist/payments.js.map +1 -1
- package/dist/{react-0MyyTtE4.d.ts → react-CrRciA7I.d.ts} +2 -2
- package/dist/{react-CWAG4cW0.d.cts → react-QJrsaOnN.d.cts} +2 -2
- package/dist/react.cjs +758 -27
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +139 -12
- package/dist/react.d.ts +139 -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
|
@@ -775,4 +775,211 @@ declare function abandonCheckout(client: BowlosClient, refToken: string): Promis
|
|
|
775
775
|
ok: boolean;
|
|
776
776
|
}>;
|
|
777
777
|
|
|
778
|
-
|
|
778
|
+
/**
|
|
779
|
+
* Typed account + flash reads for @bowlos/reservations.
|
|
780
|
+
*
|
|
781
|
+
* Session-scoped account reads (require a signed-in customer) and the
|
|
782
|
+
* session-aware flash-sale reads. Args are typed precisely — every account read
|
|
783
|
+
* is brand-scoped. Results are generic (`<T = unknown>`): parameterize with your
|
|
784
|
+
* own shape, or read `unknown` and narrow. (The backend return shapes are rich
|
|
785
|
+
* and evolving; the SDK doesn't pin them here.) Each read has a framework-agnostic
|
|
786
|
+
* function here and a React hook in `hooks.tsx`.
|
|
787
|
+
*/
|
|
788
|
+
|
|
789
|
+
/** Every account read is scoped to the customer's Brand. */
|
|
790
|
+
type BrandScoped = {
|
|
791
|
+
brandId: string;
|
|
792
|
+
};
|
|
793
|
+
type ReservationDetailArgs = {
|
|
794
|
+
brandId: string;
|
|
795
|
+
displayId: string;
|
|
796
|
+
};
|
|
797
|
+
type EventOrderDetailArgs = {
|
|
798
|
+
brandId: string;
|
|
799
|
+
orderId: string;
|
|
800
|
+
};
|
|
801
|
+
type MembershipDetailArgs = {
|
|
802
|
+
brandId: string;
|
|
803
|
+
membershipId: string;
|
|
804
|
+
};
|
|
805
|
+
type FlashSaleArgs = {
|
|
806
|
+
slug: string;
|
|
807
|
+
};
|
|
808
|
+
type FlashBookingOptionsArgs = {
|
|
809
|
+
slug: string;
|
|
810
|
+
itemId: string;
|
|
811
|
+
};
|
|
812
|
+
type FlashSalesArgs = {
|
|
813
|
+
brandId: string;
|
|
814
|
+
};
|
|
815
|
+
declare function getMyReservations<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
816
|
+
declare function getMyReservationDetail<T = unknown>(client: BowlosClient, args: ReservationDetailArgs): Promise<T>;
|
|
817
|
+
declare function getMyEventOrders<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
818
|
+
declare function getMyEventOrder<T = unknown>(client: BowlosClient, args: EventOrderDetailArgs): Promise<T>;
|
|
819
|
+
declare function getMyMemberships<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
820
|
+
declare function getMyMembershipDetail<T = unknown>(client: BowlosClient, args: MembershipDetailArgs): Promise<T>;
|
|
821
|
+
declare function getMyLoyalty<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
822
|
+
declare function getMyCredits<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
823
|
+
declare function getMyPasses<T = unknown>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
824
|
+
declare function getMyGameCards<T = MyGameCard[]>(client: BowlosClient, args: BrandScoped): Promise<T>;
|
|
825
|
+
/** Outcome preview shared by all four cancel types. `bucket`/`hoursBeforeStart`/
|
|
826
|
+
* `forfeitCents` are inert (null/0) for game cards (no time policy). */
|
|
827
|
+
interface CancelPreview {
|
|
828
|
+
cancellable: boolean;
|
|
829
|
+
reason: string | null;
|
|
830
|
+
bucket: string | null;
|
|
831
|
+
hoursBeforeStart: number;
|
|
832
|
+
creditCents: number;
|
|
833
|
+
forfeitCents: number;
|
|
834
|
+
paidCents: number;
|
|
835
|
+
}
|
|
836
|
+
interface CancelResult {
|
|
837
|
+
id: string;
|
|
838
|
+
status: string;
|
|
839
|
+
creditCents: number;
|
|
840
|
+
bucket?: string | null;
|
|
841
|
+
hoursBeforeStart?: number;
|
|
842
|
+
forfeitCents?: number;
|
|
843
|
+
version?: number;
|
|
844
|
+
}
|
|
845
|
+
interface MyGameCard {
|
|
846
|
+
id: string;
|
|
847
|
+
displayId: string;
|
|
848
|
+
cardName: string;
|
|
849
|
+
status: "active" | "depleted" | "expired" | "cancelled" | "refunded";
|
|
850
|
+
totalGames: number;
|
|
851
|
+
remainingGames: number;
|
|
852
|
+
shoesIncluded: boolean;
|
|
853
|
+
purchasedAt: number;
|
|
854
|
+
expiresAt: number;
|
|
855
|
+
paidCents: number;
|
|
856
|
+
/** Precomputed unused-only rule; the per-card preview is the source of truth. */
|
|
857
|
+
cancellable: boolean;
|
|
858
|
+
}
|
|
859
|
+
type ReservationCancelArgs = {
|
|
860
|
+
brandId: string;
|
|
861
|
+
reservationId: string;
|
|
862
|
+
expectedVersion: number;
|
|
863
|
+
reason?: string;
|
|
864
|
+
/** Per-attempt key; safe to retry. */
|
|
865
|
+
idempotencyKey: string;
|
|
866
|
+
};
|
|
867
|
+
type OrderCancelArgs = {
|
|
868
|
+
brandId: string;
|
|
869
|
+
orderId: string;
|
|
870
|
+
reason?: string;
|
|
871
|
+
idempotencyKey: string;
|
|
872
|
+
};
|
|
873
|
+
type GameCardCancelArgs = {
|
|
874
|
+
brandId: string;
|
|
875
|
+
cardId: string;
|
|
876
|
+
reason?: string;
|
|
877
|
+
idempotencyKey: string;
|
|
878
|
+
};
|
|
879
|
+
declare function previewReservationCancellation<T = CancelPreview>(client: BowlosClient, args: {
|
|
880
|
+
brandId: string;
|
|
881
|
+
reservationId: string;
|
|
882
|
+
}): Promise<T>;
|
|
883
|
+
declare function previewEventOrderCancellation<T = CancelPreview>(client: BowlosClient, args: {
|
|
884
|
+
brandId: string;
|
|
885
|
+
orderId: string;
|
|
886
|
+
}): Promise<T>;
|
|
887
|
+
declare function previewPackageOrderCancellation<T = CancelPreview>(client: BowlosClient, args: {
|
|
888
|
+
brandId: string;
|
|
889
|
+
orderId: string;
|
|
890
|
+
}): Promise<T>;
|
|
891
|
+
declare function previewGameCardCancellation<T = CancelPreview>(client: BowlosClient, args: {
|
|
892
|
+
brandId: string;
|
|
893
|
+
cardId: string;
|
|
894
|
+
}): Promise<T>;
|
|
895
|
+
declare function cancelMyReservation<T = CancelResult>(client: BowlosClient, args: ReservationCancelArgs): Promise<T>;
|
|
896
|
+
declare function cancelMyEventOrder<T = CancelResult>(client: BowlosClient, args: OrderCancelArgs): Promise<T>;
|
|
897
|
+
declare function cancelMyPackageOrder<T = CancelResult>(client: BowlosClient, args: OrderCancelArgs): Promise<T>;
|
|
898
|
+
declare function cancelMyGameCard<T = CancelResult>(client: BowlosClient, args: GameCardCancelArgs): Promise<T>;
|
|
899
|
+
declare function getFlashSale<T = unknown>(client: BowlosClient, args: FlashSaleArgs): Promise<T>;
|
|
900
|
+
/** The public flash-sale index for a Brand (live + upcoming; no prices). Public. */
|
|
901
|
+
declare function getFlashSales<T = unknown>(client: BowlosClient, args: FlashSalesArgs): Promise<T>;
|
|
902
|
+
declare function getFlashSaleBookingOptions<T = unknown>(client: BowlosClient, args: FlashBookingOptionsArgs): Promise<T>;
|
|
903
|
+
type CreateFlashSaleBookingArgs = {
|
|
904
|
+
slug: string;
|
|
905
|
+
itemId: string;
|
|
906
|
+
dateISO: string;
|
|
907
|
+
startMinuteOfDay: number;
|
|
908
|
+
durationMinutes: number;
|
|
909
|
+
units: number;
|
|
910
|
+
/** Per-attempt key; replays return the original checkout. */
|
|
911
|
+
idempotencyKey: string;
|
|
912
|
+
};
|
|
913
|
+
interface FlashSaleBookingResult {
|
|
914
|
+
/** Handle for the rest of the checkout: mint the PaymentIntent with
|
|
915
|
+
* `createCheckoutPaymentIntent(client, { refToken })`, then poll
|
|
916
|
+
* `getCheckoutStatus(client, refToken)` to materialization. */
|
|
917
|
+
refToken: string;
|
|
918
|
+
/** The SALE-priced total the PaymentIntent charges (base at the flash
|
|
919
|
+
* price + tax + the Center fee). */
|
|
920
|
+
amountDueCents: number;
|
|
921
|
+
holdExpiresAt: number;
|
|
922
|
+
breakdown: {
|
|
923
|
+
/** Tier savings already removed from baseSubtotalCents; do not subtract again. */
|
|
924
|
+
tierDiscountCents: number;
|
|
925
|
+
baseSubtotalCents: number;
|
|
926
|
+
reservationFeeCents: number;
|
|
927
|
+
reservationFeeLabel: string | null;
|
|
928
|
+
taxAddedCents: number;
|
|
929
|
+
taxIncludedCents: number;
|
|
930
|
+
totalCents: number;
|
|
931
|
+
};
|
|
932
|
+
}
|
|
933
|
+
/**
|
|
934
|
+
* v0.22.1 — book a flash-sale reservation item at its SALE price (the flash
|
|
935
|
+
* analog of `eventOfferSlug`: the server binds the item's sale price, holds
|
|
936
|
+
* the inventory, and opens a checkout). Signed-in customers only. Pick the
|
|
937
|
+
* date/time from `getFlashSaleBookingOptions` — the purpose-built option
|
|
938
|
+
* list — never the regular booking calendar.
|
|
939
|
+
*/
|
|
940
|
+
declare function createFlashSaleBooking(client: BowlosClient, args: CreateFlashSaleBookingArgs): Promise<FlashSaleBookingResult>;
|
|
941
|
+
/** Saved cards belong to the active location's connected Stripe account. */
|
|
942
|
+
type SavedCardScope = {
|
|
943
|
+
brandId: string;
|
|
944
|
+
centerId: string;
|
|
945
|
+
};
|
|
946
|
+
type SavedCardArgs = SavedCardScope & {
|
|
947
|
+
paymentMethodId: string;
|
|
948
|
+
};
|
|
949
|
+
interface SavedCard {
|
|
950
|
+
id: string;
|
|
951
|
+
brand: string;
|
|
952
|
+
last4: string;
|
|
953
|
+
expMonth: number;
|
|
954
|
+
expYear: number;
|
|
955
|
+
isDefault: boolean;
|
|
956
|
+
}
|
|
957
|
+
interface SavedCardsResult {
|
|
958
|
+
methods: SavedCard[];
|
|
959
|
+
chargeable: boolean;
|
|
960
|
+
}
|
|
961
|
+
interface CardSetupResult {
|
|
962
|
+
clientSecret: string;
|
|
963
|
+
publishableKey: string;
|
|
964
|
+
stripeAccount: string;
|
|
965
|
+
stripeMode: "test" | "live";
|
|
966
|
+
merchantDisplayName: string;
|
|
967
|
+
}
|
|
968
|
+
type ChangePasswordArgs = {
|
|
969
|
+
currentPassword: string;
|
|
970
|
+
newPassword: string;
|
|
971
|
+
};
|
|
972
|
+
declare function listSavedCards(client: BowlosClient, args: SavedCardScope): Promise<SavedCardsResult>;
|
|
973
|
+
declare function createCardSetup(client: BowlosClient, args: SavedCardScope): Promise<CardSetupResult>;
|
|
974
|
+
declare function removeSavedCard(client: BowlosClient, args: SavedCardArgs): Promise<{
|
|
975
|
+
detached: boolean;
|
|
976
|
+
}>;
|
|
977
|
+
declare function setDefaultCard(client: BowlosClient, args: SavedCardArgs): Promise<{
|
|
978
|
+
ok: boolean;
|
|
979
|
+
}>;
|
|
980
|
+
/** Success invalidates all sessions; discard local tokens and show sign-in. */
|
|
981
|
+
declare function changePassword(client: BowlosClient, args: ChangePasswordArgs): Promise<{
|
|
982
|
+
ok: true;
|
|
983
|
+
}>;
|
|
984
|
+
|
|
985
|
+
export { type PackageCheckoutStatus as $, type AuthState as A, BowlosClient as B, type CancelPreview as C, type FlashSaleBookingResult as D, type EventOrderDetailArgs as E, type FetchLike as F, type FlashSalesArgs as G, type GameCardCancelArgs as H, type GameCardCheckoutStatus as I, type GameCardPreviewArgs as J, type GameCardPreviewResult as K, type GameCardPurchaseArgs as L, type GameCardPurchaseIntent as M, type GameCardStatusResult as N, type LinkProfile as O, type MembershipCheckoutStatus as P, type MembershipDetailArgs as Q, type MembershipPreviewArgs as R, type MembershipPreviewResult as S, type MembershipPurchaseArgs as T, type MembershipPurchaseIntent as U, type MembershipStatusResult as V, type MembershipSubscriptionArgs as W, type MembershipSubscriptionIntent as X, type MembershipSubscriptionPreviewResult as Y, type MyGameCard as Z, type OrderCancelArgs as _, type AvailabilityArgs as a, previewGameCardCancellation as a$, type PackagePreviewArgs as a0, type PackagePreviewResult as a1, type PackagePurchaseArgs as a2, type PackagePurchaseIntent as a3, type PackageStatusResult as a4, type PaymentIntentInfo as a5, type PingResult as a6, type PricingMode as a7, type PublicAddon as a8, type ReservationCancelArgs as a9, createPackageOrder as aA, generateIdempotencyKey as aB, getCheckoutStatus as aC, getEventTicketStatus as aD, getFlashSale as aE, getFlashSaleBookingOptions as aF, getFlashSales as aG, getGameCardStatus as aH, getMembershipStatus as aI, getMyCredits as aJ, getMyEventOrder as aK, getMyEventOrders as aL, getMyGameCards as aM, getMyLoyalty as aN, getMyMembershipDetail as aO, getMyMemberships as aP, getMyPasses as aQ, getMyReservationDetail as aR, getMyReservations as aS, getPackageStatus as aT, listAddons as aU, listSavedCards as aV, listStartTimes as aW, localStorageTokenStore as aX, previewEventOrderCancellation as aY, previewEventTicket as aZ, previewGameCard as a_, type ReservationDetailArgs as aa, type SavedCard as ab, type SavedCardArgs as ac, type SavedCardScope as ad, type SavedCardsResult as ae, type StartTimesArgs as af, type TokenStore as ag, type Tokens as ah, abandonCheckout as ai, availableUnitCount as aj, bookingPreview as ak, cancelMyEventOrder as al, cancelMyGameCard as am, cancelMyPackageOrder as an, cancelMyReservation as ao, changePassword as ap, checkAvailability as aq, createBooking as ar, createBowlosClient as as, createCardSetup as at, createCheckoutPaymentIntent as au, createEventTicketOrder as av, createFlashSaleBooking as aw, createGameCardOrder as ax, createMembershipOrder as ay, createMembershipSubscriptionOrder as az, type AvailabilityResult as b, previewMembership as b0, previewMembershipSubscription as b1, previewPackage as b2, previewPackageOrderCancellation as b3, previewReservationCancellation as b4, removeSavedCard as b5, setDefaultCard as b6, type BookingAddonSelection as c, type BookingCustomer as d, type BookingHold as e, type BookingPreviewArgs as f, type BookingQuote as g, type BowlosClientConfig as h, type BrandScoped as i, type CancelResult as j, type CardSetupResult as k, type ChangePasswordArgs as l, type CheckoutStatus as m, type CheckoutStatusResult as n, type ConnectedPaymentInput as o, type CreateBookingArgs as p, type CreateFlashSaleBookingArgs as q, type Customer as r, type EventTicketCheckoutStatus as s, type EventTicketPreviewArgs as t, type EventTicketPreviewResult as u, type EventTicketPurchaseArgs as v, type EventTicketPurchaseIntent as w, type EventTicketStatusResult as x, type FlashBookingOptionsArgs as y, type FlashSaleArgs as z };
|