@bowlos/reservations 0.22.0 → 0.23.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 +128 -1
- package/README.md +8 -1
- package/dist/account-B9tDfXke.d.ts +165 -0
- package/dist/account-C9SvfE3q.d.cts +165 -0
- package/dist/{chunk-FV6SROO2.js → chunk-CRETIPLS.js} +83 -6
- package/dist/chunk-CRETIPLS.js.map +1 -0
- package/dist/components.cjs +32 -34
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/index.cjs +42 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/dist/payments.cjs +9 -1
- package/dist/payments.cjs.map +1 -1
- package/dist/payments.js +9 -1
- package/dist/payments.js.map +1 -1
- package/dist/{react-Bc_6yi9q.d.cts → react--BT8olOw.d.cts} +14 -1
- package/dist/{react-B1uSOozS.d.ts → react-BvuU4nzT.d.ts} +14 -1
- package/dist/react.cjs +185 -98
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +36 -9
- package/dist/react.d.ts +36 -9
- package/dist/react.js +2 -2
- package/package.json +1 -1
- package/templates/center-site/package.json +1 -1
- package/dist/account-CO8xzUs_.d.ts +0 -54
- package/dist/account-SqT7et4C.d.cts +0 -54
- package/dist/chunk-FV6SROO2.js.map +0 -1
package/dist/react.cjs
CHANGED
|
@@ -360,103 +360,35 @@ function useBowlosQuery(name, args = {}, options = {}) {
|
|
|
360
360
|
}, [enabled, refetch]);
|
|
361
361
|
return { data, error, loading, refetch };
|
|
362
362
|
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
}
|
|
392
|
-
function useMyMembershipDetail(args, options) {
|
|
393
|
-
return useBowlosQuery("getMyMembershipDetail", args, { ...options, auth: true });
|
|
394
|
-
}
|
|
395
|
-
function useMyLoyalty(args, options) {
|
|
396
|
-
return useBowlosQuery("getMyLoyalty", args, { ...options, auth: true });
|
|
397
|
-
}
|
|
398
|
-
function useMyCredits(args, options) {
|
|
399
|
-
return useBowlosQuery("listMyCredits", args, { ...options, auth: true });
|
|
400
|
-
}
|
|
401
|
-
function useMyPasses(args, options) {
|
|
402
|
-
return useBowlosQuery("listMyPasses", args, { ...options, auth: true });
|
|
403
|
-
}
|
|
404
|
-
function useFlashSale(args, options) {
|
|
405
|
-
return useBowlosQuery("getPublicFlashSaleBySlug", args, { ...options, auth: true });
|
|
406
|
-
}
|
|
407
|
-
function useFlashSales(args, options) {
|
|
408
|
-
return useBowlosQuery("listPublicFlashSales", args, options);
|
|
409
|
-
}
|
|
410
|
-
function useFlashSaleBookingOptions(args, options) {
|
|
411
|
-
return useBowlosQuery("getFlashSaleBookingOptions", args, { ...options, auth: true });
|
|
412
|
-
}
|
|
413
|
-
function useCatalog(args, options) {
|
|
414
|
-
return useBowlosQuery("listPublicCatalog", args, options);
|
|
415
|
-
}
|
|
416
|
-
function useProducts(args, options) {
|
|
417
|
-
return useBowlosQuery("listPublicProducts", args, options);
|
|
418
|
-
}
|
|
419
|
-
function useEvents(args, options) {
|
|
420
|
-
return useBowlosQuery("listPublicEvents", args, options);
|
|
421
|
-
}
|
|
422
|
-
function useEventOffers(args, options) {
|
|
423
|
-
return useBowlosQuery("listPublicEventOffers", args, options);
|
|
424
|
-
}
|
|
425
|
-
function useEventOffer(args, options) {
|
|
426
|
-
return useBowlosQuery("getPublicEventOffer", args, options);
|
|
427
|
-
}
|
|
428
|
-
function usePackages(args, options) {
|
|
429
|
-
return useBowlosQuery("listPublicPackages", args, options);
|
|
430
|
-
}
|
|
431
|
-
function usePackage(args, options) {
|
|
432
|
-
return useBowlosQuery("getPublicPackage", args, options);
|
|
433
|
-
}
|
|
434
|
-
function useCenterHours(args, options) {
|
|
435
|
-
return useBowlosQuery("getCenterOperatingHoursForTypes", args, options);
|
|
436
|
-
}
|
|
437
|
-
function usePackagePreview(args, options) {
|
|
438
|
-
return useBowlosQuery("previewPackageOrder", args, { ...options, auth: true });
|
|
439
|
-
}
|
|
440
|
-
function usePublicMemberships(args, options) {
|
|
441
|
-
return useBowlosQuery("listPublicMemberships", args, options);
|
|
442
|
-
}
|
|
443
|
-
function useGameCards(args, options) {
|
|
444
|
-
return useBowlosQuery("listPublicGameCards", args, options);
|
|
445
|
-
}
|
|
446
|
-
function useGameCardPreview(args, options) {
|
|
447
|
-
return useBowlosQuery("previewGameCardOrder", args, { ...options, auth: true });
|
|
448
|
-
}
|
|
449
|
-
function useEventTicketPreview(args, options) {
|
|
450
|
-
return useBowlosQuery("previewEventTicketOrder", args, { ...options, auth: true });
|
|
451
|
-
}
|
|
452
|
-
function useMembershipPreview(args, options) {
|
|
453
|
-
return useBowlosQuery("previewMembershipOrder", args, { ...options, auth: true });
|
|
454
|
-
}
|
|
455
|
-
function useMembershipSubscriptionPreview(args, options) {
|
|
456
|
-
return useBowlosQuery("previewMembershipSubscriptionOrder", args, {
|
|
457
|
-
...options,
|
|
458
|
-
auth: true
|
|
459
|
-
});
|
|
363
|
+
function useBowlosMutation(name, options = {}) {
|
|
364
|
+
const client = useBowlosClient();
|
|
365
|
+
const auth = options.auth ?? false;
|
|
366
|
+
const [data, setData] = react.useState(null);
|
|
367
|
+
const [error, setError] = react.useState(null);
|
|
368
|
+
const [loading, setLoading] = react.useState(false);
|
|
369
|
+
const run = react.useCallback(
|
|
370
|
+
async (args) => {
|
|
371
|
+
setLoading(true);
|
|
372
|
+
setError(null);
|
|
373
|
+
try {
|
|
374
|
+
const result = await client.call(name, args, { auth });
|
|
375
|
+
setData(result);
|
|
376
|
+
return result;
|
|
377
|
+
} catch (e) {
|
|
378
|
+
if (e instanceof BowlosApiError) setError(e);
|
|
379
|
+
throw e;
|
|
380
|
+
} finally {
|
|
381
|
+
setLoading(false);
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
[client, name, auth]
|
|
385
|
+
);
|
|
386
|
+
const reset = react.useCallback(() => {
|
|
387
|
+
setData(null);
|
|
388
|
+
setError(null);
|
|
389
|
+
setLoading(false);
|
|
390
|
+
}, []);
|
|
391
|
+
return { run, data, error, loading, reset };
|
|
460
392
|
}
|
|
461
393
|
|
|
462
394
|
// src/data.ts
|
|
@@ -555,7 +487,152 @@ function abandonCheckout(client, refToken) {
|
|
|
555
487
|
return client.call("abandonCheckout", { refToken }, { auth: true });
|
|
556
488
|
}
|
|
557
489
|
|
|
558
|
-
// src/
|
|
490
|
+
// src/hooks.tsx
|
|
491
|
+
function useAvailability(args, options) {
|
|
492
|
+
return useBowlosQuery("checkAvailability", args, options);
|
|
493
|
+
}
|
|
494
|
+
function useBookingPreview(args, options) {
|
|
495
|
+
return useBowlosQuery("bookingPreview", args, options);
|
|
496
|
+
}
|
|
497
|
+
function useAddons(args, options) {
|
|
498
|
+
return useBowlosQuery("listPublicAddons", args, options);
|
|
499
|
+
}
|
|
500
|
+
function useStartTimes(args, options) {
|
|
501
|
+
return useBowlosQuery("availableStartTimes", args, options);
|
|
502
|
+
}
|
|
503
|
+
function useMyReservations(args, options) {
|
|
504
|
+
return useBowlosQuery("listMyReservations", args, { ...options, auth: true });
|
|
505
|
+
}
|
|
506
|
+
function useMyReservationDetail(args, options) {
|
|
507
|
+
return useBowlosQuery("getMyReservationDetail", args, { ...options, auth: true });
|
|
508
|
+
}
|
|
509
|
+
function useMyEventOrders(args, options) {
|
|
510
|
+
return useBowlosQuery("listMyEventOrders", args, { ...options, auth: true });
|
|
511
|
+
}
|
|
512
|
+
function useMyEventOrder(args, options) {
|
|
513
|
+
return useBowlosQuery("getMyEventOrder", args, { ...options, auth: true });
|
|
514
|
+
}
|
|
515
|
+
function useMyMemberships(args, options) {
|
|
516
|
+
return useBowlosQuery("listMyMemberships", args, { ...options, auth: true });
|
|
517
|
+
}
|
|
518
|
+
function useMyMembershipDetail(args, options) {
|
|
519
|
+
return useBowlosQuery("getMyMembershipDetail", args, { ...options, auth: true });
|
|
520
|
+
}
|
|
521
|
+
function useMyLoyalty(args, options) {
|
|
522
|
+
return useBowlosQuery("getMyLoyalty", args, { ...options, auth: true });
|
|
523
|
+
}
|
|
524
|
+
function useMyCredits(args, options) {
|
|
525
|
+
return useBowlosQuery("listMyCredits", args, { ...options, auth: true });
|
|
526
|
+
}
|
|
527
|
+
function useMyPasses(args, options) {
|
|
528
|
+
return useBowlosQuery("listMyPasses", args, { ...options, auth: true });
|
|
529
|
+
}
|
|
530
|
+
function useMyGameCards(args, options) {
|
|
531
|
+
return useBowlosQuery("listMyGameCards", args, { ...options, auth: true });
|
|
532
|
+
}
|
|
533
|
+
function useReservationCancelPreview(args, options) {
|
|
534
|
+
return useBowlosQuery("previewMyCancellation", args, { ...options, auth: true });
|
|
535
|
+
}
|
|
536
|
+
function useEventOrderCancelPreview(args, options) {
|
|
537
|
+
return useBowlosQuery("previewMyEventOrderCancellation", args, { ...options, auth: true });
|
|
538
|
+
}
|
|
539
|
+
function usePackageOrderCancelPreview(args, options) {
|
|
540
|
+
return useBowlosQuery("previewMyPackageOrderCancellation", args, { ...options, auth: true });
|
|
541
|
+
}
|
|
542
|
+
function useGameCardCancelPreview(args, options) {
|
|
543
|
+
return useBowlosQuery("previewMyGameCardCancellation", args, { ...options, auth: true });
|
|
544
|
+
}
|
|
545
|
+
function useCancelMyReservation() {
|
|
546
|
+
const m = useBowlosMutation("cancelMyReservation", {
|
|
547
|
+
auth: true
|
|
548
|
+
});
|
|
549
|
+
const run = react.useCallback(
|
|
550
|
+
(args) => m.run({ ...args, idempotencyKey: generateIdempotencyKey() }),
|
|
551
|
+
[m]
|
|
552
|
+
);
|
|
553
|
+
return { ...m, run };
|
|
554
|
+
}
|
|
555
|
+
function useCancelMyEventOrder() {
|
|
556
|
+
const m = useBowlosMutation("cancelMyEventOrder", { auth: true });
|
|
557
|
+
const run = react.useCallback(
|
|
558
|
+
(args) => m.run({ ...args, idempotencyKey: generateIdempotencyKey() }),
|
|
559
|
+
[m]
|
|
560
|
+
);
|
|
561
|
+
return { ...m, run };
|
|
562
|
+
}
|
|
563
|
+
function useCancelMyPackageOrder() {
|
|
564
|
+
const m = useBowlosMutation("cancelMyPackageOrder", { auth: true });
|
|
565
|
+
const run = react.useCallback(
|
|
566
|
+
(args) => m.run({ ...args, idempotencyKey: generateIdempotencyKey() }),
|
|
567
|
+
[m]
|
|
568
|
+
);
|
|
569
|
+
return { ...m, run };
|
|
570
|
+
}
|
|
571
|
+
function useCancelMyGameCard() {
|
|
572
|
+
const m = useBowlosMutation("cancelMyGameCard", { auth: true });
|
|
573
|
+
const run = react.useCallback(
|
|
574
|
+
(args) => m.run({ ...args, idempotencyKey: generateIdempotencyKey() }),
|
|
575
|
+
[m]
|
|
576
|
+
);
|
|
577
|
+
return { ...m, run };
|
|
578
|
+
}
|
|
579
|
+
function useFlashSale(args, options) {
|
|
580
|
+
return useBowlosQuery("getPublicFlashSaleBySlug", args, { ...options, auth: true });
|
|
581
|
+
}
|
|
582
|
+
function useFlashSales(args, options) {
|
|
583
|
+
return useBowlosQuery("listPublicFlashSales", args, options);
|
|
584
|
+
}
|
|
585
|
+
function useFlashSaleBookingOptions(args, options) {
|
|
586
|
+
return useBowlosQuery("getFlashSaleBookingOptions", args, { ...options, auth: true });
|
|
587
|
+
}
|
|
588
|
+
function useCatalog(args, options) {
|
|
589
|
+
return useBowlosQuery("listPublicCatalog", args, options);
|
|
590
|
+
}
|
|
591
|
+
function useProducts(args, options) {
|
|
592
|
+
return useBowlosQuery("listPublicProducts", args, options);
|
|
593
|
+
}
|
|
594
|
+
function useEvents(args, options) {
|
|
595
|
+
return useBowlosQuery("listPublicEvents", args, options);
|
|
596
|
+
}
|
|
597
|
+
function useEventOffers(args, options) {
|
|
598
|
+
return useBowlosQuery("listPublicEventOffers", args, options);
|
|
599
|
+
}
|
|
600
|
+
function useEventOffer(args, options) {
|
|
601
|
+
return useBowlosQuery("getPublicEventOffer", args, options);
|
|
602
|
+
}
|
|
603
|
+
function usePackages(args, options) {
|
|
604
|
+
return useBowlosQuery("listPublicPackages", args, options);
|
|
605
|
+
}
|
|
606
|
+
function usePackage(args, options) {
|
|
607
|
+
return useBowlosQuery("getPublicPackage", args, options);
|
|
608
|
+
}
|
|
609
|
+
function useCenterHours(args, options) {
|
|
610
|
+
return useBowlosQuery("getCenterOperatingHoursForTypes", args, options);
|
|
611
|
+
}
|
|
612
|
+
function usePackagePreview(args, options) {
|
|
613
|
+
return useBowlosQuery("previewPackageOrder", args, { ...options, auth: true });
|
|
614
|
+
}
|
|
615
|
+
function usePublicMemberships(args, options) {
|
|
616
|
+
return useBowlosQuery("listPublicMemberships", args, options);
|
|
617
|
+
}
|
|
618
|
+
function useGameCards(args, options) {
|
|
619
|
+
return useBowlosQuery("listPublicGameCards", args, options);
|
|
620
|
+
}
|
|
621
|
+
function useGameCardPreview(args, options) {
|
|
622
|
+
return useBowlosQuery("previewGameCardOrder", args, { ...options, auth: true });
|
|
623
|
+
}
|
|
624
|
+
function useEventTicketPreview(args, options) {
|
|
625
|
+
return useBowlosQuery("previewEventTicketOrder", args, { ...options, auth: true });
|
|
626
|
+
}
|
|
627
|
+
function useMembershipPreview(args, options) {
|
|
628
|
+
return useBowlosQuery("previewMembershipOrder", args, { ...options, auth: true });
|
|
629
|
+
}
|
|
630
|
+
function useMembershipSubscriptionPreview(args, options) {
|
|
631
|
+
return useBowlosQuery("previewMembershipSubscriptionOrder", args, {
|
|
632
|
+
...options,
|
|
633
|
+
auth: true
|
|
634
|
+
});
|
|
635
|
+
}
|
|
559
636
|
var DEFAULT_POLL_MS = 2500;
|
|
560
637
|
function useBookingFlow() {
|
|
561
638
|
const client = useBowlosClient();
|
|
@@ -972,17 +1049,24 @@ exports.useAvailability = useAvailability;
|
|
|
972
1049
|
exports.useBookingFlow = useBookingFlow;
|
|
973
1050
|
exports.useBookingPreview = useBookingPreview;
|
|
974
1051
|
exports.useBowlosClient = useBowlosClient;
|
|
1052
|
+
exports.useBowlosMutation = useBowlosMutation;
|
|
975
1053
|
exports.useBowlosQuery = useBowlosQuery;
|
|
1054
|
+
exports.useCancelMyEventOrder = useCancelMyEventOrder;
|
|
1055
|
+
exports.useCancelMyGameCard = useCancelMyGameCard;
|
|
1056
|
+
exports.useCancelMyPackageOrder = useCancelMyPackageOrder;
|
|
1057
|
+
exports.useCancelMyReservation = useCancelMyReservation;
|
|
976
1058
|
exports.useCatalog = useCatalog;
|
|
977
1059
|
exports.useCenterHours = useCenterHours;
|
|
978
1060
|
exports.useEventOffer = useEventOffer;
|
|
979
1061
|
exports.useEventOffers = useEventOffers;
|
|
1062
|
+
exports.useEventOrderCancelPreview = useEventOrderCancelPreview;
|
|
980
1063
|
exports.useEventTicketPreview = useEventTicketPreview;
|
|
981
1064
|
exports.useEventTicketPurchase = useEventTicketPurchase;
|
|
982
1065
|
exports.useEvents = useEvents;
|
|
983
1066
|
exports.useFlashSale = useFlashSale;
|
|
984
1067
|
exports.useFlashSaleBookingOptions = useFlashSaleBookingOptions;
|
|
985
1068
|
exports.useFlashSales = useFlashSales;
|
|
1069
|
+
exports.useGameCardCancelPreview = useGameCardCancelPreview;
|
|
986
1070
|
exports.useGameCardPreview = useGameCardPreview;
|
|
987
1071
|
exports.useGameCardPurchase = useGameCardPurchase;
|
|
988
1072
|
exports.useGameCards = useGameCards;
|
|
@@ -993,6 +1077,7 @@ exports.useMembershipSubscriptionPreview = useMembershipSubscriptionPreview;
|
|
|
993
1077
|
exports.useMyCredits = useMyCredits;
|
|
994
1078
|
exports.useMyEventOrder = useMyEventOrder;
|
|
995
1079
|
exports.useMyEventOrders = useMyEventOrders;
|
|
1080
|
+
exports.useMyGameCards = useMyGameCards;
|
|
996
1081
|
exports.useMyLoyalty = useMyLoyalty;
|
|
997
1082
|
exports.useMyMembershipDetail = useMyMembershipDetail;
|
|
998
1083
|
exports.useMyMemberships = useMyMemberships;
|
|
@@ -1000,12 +1085,14 @@ exports.useMyPasses = useMyPasses;
|
|
|
1000
1085
|
exports.useMyReservationDetail = useMyReservationDetail;
|
|
1001
1086
|
exports.useMyReservations = useMyReservations;
|
|
1002
1087
|
exports.usePackage = usePackage;
|
|
1088
|
+
exports.usePackageOrderCancelPreview = usePackageOrderCancelPreview;
|
|
1003
1089
|
exports.usePackagePreview = usePackagePreview;
|
|
1004
1090
|
exports.usePackagePurchase = usePackagePurchase;
|
|
1005
1091
|
exports.usePackages = usePackages;
|
|
1006
1092
|
exports.useProducts = useProducts;
|
|
1007
1093
|
exports.usePublicMemberships = usePublicMemberships;
|
|
1008
1094
|
exports.usePurchase = usePurchase;
|
|
1095
|
+
exports.useReservationCancelPreview = useReservationCancelPreview;
|
|
1009
1096
|
exports.useStartTimes = useStartTimes;
|
|
1010
1097
|
//# sourceMappingURL=react.cjs.map
|
|
1011
1098
|
//# sourceMappingURL=react.cjs.map
|