@connectedxm/client 1.4.23 → 1.4.25

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/dist/index.js CHANGED
@@ -65,6 +65,13 @@ __export(src_exports, {
65
65
  AdvertisementType: () => AdvertisementType,
66
66
  AppendInfiniteQuery: () => AppendInfiniteQuery,
67
67
  BENEFITS_QUERY_KEY: () => BENEFITS_QUERY_KEY,
68
+ BOOKINGS_QUERY_KEY: () => BOOKINGS_QUERY_KEY,
69
+ BOOKING_PLACES_QUERY_KEY: () => BOOKING_PLACES_QUERY_KEY,
70
+ BOOKING_PLACE_QUERY_KEY: () => BOOKING_PLACE_QUERY_KEY,
71
+ BOOKING_PLACE_SPACES_QUERY_KEY: () => BOOKING_PLACE_SPACES_QUERY_KEY,
72
+ BOOKING_PLACE_SPACE_QUERY_KEY: () => BOOKING_PLACE_SPACE_QUERY_KEY,
73
+ BOOKING_PLACE_SPACE_SLOTS_QUERY_KEY: () => BOOKING_PLACE_SPACE_SLOTS_QUERY_KEY,
74
+ BOOKING_QUERY_KEY: () => BOOKING_QUERY_KEY,
68
75
  BlockIntegration: () => BlockIntegration,
69
76
  CHANNELS_QUERY_KEY: () => CHANNELS_QUERY_KEY,
70
77
  CHANNEL_COLLECTIONS_QUERY_KEY: () => CHANNEL_COLLECTIONS_QUERY_KEY,
@@ -82,6 +89,7 @@ __export(src_exports, {
82
89
  CONTENT_QUERY_KEY: () => CONTENT_QUERY_KEY,
83
90
  CUSTOM_ERROR_CODES: () => CUSTOM_ERROR_CODES,
84
91
  CacheIndividualQueries: () => CacheIndividualQueries,
92
+ CancelBooking: () => CancelBooking,
85
93
  CancelGroupInvitation: () => CancelGroupInvitation,
86
94
  CancelGroupRequest: () => CancelGroupRequest,
87
95
  CancelPass: () => CancelPass,
@@ -89,6 +97,7 @@ __export(src_exports, {
89
97
  CapturePaymentIntent: () => CapturePaymentIntent,
90
98
  CheckinListingAttendeePass: () => CheckinListingAttendeePass,
91
99
  CompleteEventActivation: () => CompleteEventActivation,
100
+ ConfirmBooking: () => ConfirmBooking,
92
101
  ConnectedXMProvider: () => ConnectedXMProvider,
93
102
  ContentGuestType: () => ContentGuestType,
94
103
  CouponType: () => CouponType,
@@ -116,6 +125,7 @@ __export(src_exports, {
116
125
  CreateThread: () => CreateThread,
117
126
  CreateThreadMessage: () => CreateThreadMessage,
118
127
  Currency: () => Currency,
128
+ DayOfWeek: () => DayOfWeek,
119
129
  DeactivateGroup: () => DeactivateGroup,
120
130
  DefaultAuthAction: () => DefaultAuthAction,
121
131
  DeleteActivity: () => DeleteActivity,
@@ -125,6 +135,7 @@ __export(src_exports, {
125
135
  DeleteChannelSubscriber: () => DeleteChannelSubscriber,
126
136
  DeleteContentGuest: () => DeleteContentGuest,
127
137
  DeleteContentPublishSchedule: () => DeleteContentPublishSchedule,
138
+ DeleteDraftBooking: () => DeleteDraftBooking,
128
139
  DeleteListing: () => DeleteListing,
129
140
  DeleteListingQuestion: () => DeleteListingQuestion,
130
141
  DeleteListingSession: () => DeleteListingSession,
@@ -140,6 +151,7 @@ __export(src_exports, {
140
151
  DeleteThreadMessage: () => DeleteThreadMessage,
141
152
  DemoteGroupModerator: () => DemoteGroupModerator,
142
153
  DisableIntegration: () => DisableIntegration,
154
+ DraftBooking: () => DraftBooking,
143
155
  ERR_FEATURE_NOT_AVAILABLE: () => ERR_FEATURE_NOT_AVAILABLE,
144
156
  ERR_INTEGRATION_PERMISSION_DENIED: () => ERR_INTEGRATION_PERMISSION_DENIED,
145
157
  ERR_KNOWN_ERROR: () => ERR_KNOWN_ERROR,
@@ -208,6 +220,14 @@ __export(src_exports, {
208
220
  GetBaseInfiniteQueryKeys: () => GetBaseInfiniteQueryKeys,
209
221
  GetBaseSingleQueryKeys: () => GetBaseSingleQueryKeys,
210
222
  GetBenefits: () => GetBenefits,
223
+ GetBooking: () => GetBooking,
224
+ GetBookingIntent: () => GetBookingIntent,
225
+ GetBookingPlace: () => GetBookingPlace,
226
+ GetBookingPlaceSpace: () => GetBookingPlaceSpace,
227
+ GetBookingPlaceSpaceSlots: () => GetBookingPlaceSpaceSlots,
228
+ GetBookingPlaces: () => GetBookingPlaces,
229
+ GetBookingPlacesSpaces: () => GetBookingPlacesSpaces,
230
+ GetBookings: () => GetBookings,
211
231
  GetChannel: () => GetChannel,
212
232
  GetChannelCollection: () => GetChannelCollection,
213
233
  GetChannelCollectionContents: () => GetChannelCollectionContents,
@@ -443,6 +463,7 @@ __export(src_exports, {
443
463
  SELF_ADDRESSES_QUERY_KEY: () => SELF_ADDRESSES_QUERY_KEY,
444
464
  SELF_ADDRESS_QUERY_KEY: () => SELF_ADDRESS_QUERY_KEY,
445
465
  SELF_ANNOUNCEMENT_QUERY_KEY: () => SELF_ANNOUNCEMENT_QUERY_KEY,
466
+ SELF_BOOKING_INTENT_QUERY_KEY: () => SELF_BOOKING_INTENT_QUERY_KEY,
446
467
  SELF_CHAT_CHANNELS_QUERY_KEY: () => SELF_CHAT_CHANNELS_QUERY_KEY,
447
468
  SELF_CHAT_CHANNEL_MEMBERS_QUERY_KEY: () => SELF_CHAT_CHANNEL_MEMBERS_QUERY_KEY,
448
469
  SELF_CHAT_CHANNEL_MESSAGES_QUERY_KEY: () => SELF_CHAT_CHANNEL_MESSAGES_QUERY_KEY,
@@ -507,6 +528,12 @@ __export(src_exports, {
507
528
  SET_ADVERTISEMENT_QUERY_DATA: () => SET_ADVERTISEMENT_QUERY_DATA,
508
529
  SET_ALL_GROUP_EVENTS_QUERY_DATA: () => SET_ALL_GROUP_EVENTS_QUERY_DATA,
509
530
  SET_BENEFITS_QUERY_DATA: () => SET_BENEFITS_QUERY_DATA,
531
+ SET_BOOKINGS_QUERY_DATA: () => SET_BOOKINGS_QUERY_DATA,
532
+ SET_BOOKING_PLACES_QUERY_DATA: () => SET_BOOKING_PLACES_QUERY_DATA,
533
+ SET_BOOKING_PLACE_QUERY_DATA: () => SET_BOOKING_PLACE_QUERY_DATA,
534
+ SET_BOOKING_PLACE_SPACES_QUERY_DATA: () => SET_BOOKING_PLACE_SPACES_QUERY_DATA,
535
+ SET_BOOKING_PLACE_SPACE_QUERY_DATA: () => SET_BOOKING_PLACE_SPACE_QUERY_DATA,
536
+ SET_BOOKING_QUERY_DATA: () => SET_BOOKING_QUERY_DATA,
510
537
  SET_CHANNELS_QUERY_DATA: () => SET_CHANNELS_QUERY_DATA,
511
538
  SET_CHANNEL_COLLECTIONS_QUERY_DATA: () => SET_CHANNEL_COLLECTIONS_QUERY_DATA,
512
539
  SET_CHANNEL_COLLECTION_QUERY_DATA: () => SET_CHANNEL_COLLECTION_QUERY_DATA,
@@ -720,6 +747,7 @@ __export(src_exports, {
720
747
  useAddThreadMessageReaction: () => useAddThreadMessageReaction,
721
748
  useAddThreadMessageReply: () => useAddThreadMessageReply,
722
749
  useBlockIntegration: () => useBlockIntegration,
750
+ useCancelBooking: () => useCancelBooking,
723
751
  useCancelGroupInvitation: () => useCancelGroupInvitation,
724
752
  useCancelGroupRequest: () => useCancelGroupRequest,
725
753
  useCancelPass: () => useCancelPass,
@@ -727,6 +755,7 @@ __export(src_exports, {
727
755
  useCapturePaymentIntent: () => useCapturePaymentIntent,
728
756
  useCheckinListingAttendeePass: () => useCheckinListingAttendeePass,
729
757
  useCompleteEventActivation: () => useCompleteEventActivation,
758
+ useConfirmBooking: () => useConfirmBooking,
730
759
  useConnectedInfiniteQuery: () => useConnectedInfiniteQuery,
731
760
  useConnectedMutation: () => useConnectedMutation,
732
761
  useConnectedSingleQuery: () => useConnectedSingleQuery,
@@ -762,6 +791,7 @@ __export(src_exports, {
762
791
  useDeleteChannelSubscriber: () => useDeleteChannelSubscriber,
763
792
  useDeleteContentGuest: () => useDeleteContentGuest,
764
793
  useDeleteContentPublishSchedule: () => useDeleteContentPublishSchedule,
794
+ useDeleteDraftBooking: () => useDeleteDraftBooking,
765
795
  useDeleteListing: () => useDeleteListing,
766
796
  useDeleteListingQuestion: () => useDeleteListingQuestion,
767
797
  useDeleteListingSession: () => useDeleteListingSession,
@@ -777,6 +807,7 @@ __export(src_exports, {
777
807
  useDeleteThreadMessage: () => useDeleteThreadMessage,
778
808
  useDemoteGroupModerator: () => useDemoteGroupModerator,
779
809
  useDisableIntegration: () => useDisableIntegration,
810
+ useDraftBooking: () => useDraftBooking,
780
811
  useEnableIntegration: () => useEnableIntegration,
781
812
  useFollowAccount: () => useFollowAccount,
782
813
  useGetAccount: () => useGetAccount,
@@ -795,6 +826,14 @@ __export(src_exports, {
795
826
  useGetAdvertisement: () => useGetAdvertisement,
796
827
  useGetAllGroupEvents: () => useGetAllGroupEvents,
797
828
  useGetBenefits: () => useGetBenefits,
829
+ useGetBooking: () => useGetBooking,
830
+ useGetBookingIntent: () => useGetBookingIntent,
831
+ useGetBookingPlace: () => useGetBookingPlace,
832
+ useGetBookingPlaceSpace: () => useGetBookingPlaceSpace,
833
+ useGetBookingPlaceSpaceSlots: () => useGetBookingPlaceSpaceSlots,
834
+ useGetBookingPlaces: () => useGetBookingPlaces,
835
+ useGetBookingPlacesSpaces: () => useGetBookingPlacesSpaces,
836
+ useGetBookings: () => useGetBookings,
798
837
  useGetChannel: () => useGetChannel,
799
838
  useGetChannelCollection: () => useGetChannelCollection,
800
839
  useGetChannelCollectionContents: () => useGetChannelCollectionContents,
@@ -1461,6 +1500,7 @@ var OrganizationModuleType = /* @__PURE__ */ ((OrganizationModuleType2) => {
1461
1500
  OrganizationModuleType2["subscriptions"] = "subscriptions";
1462
1501
  OrganizationModuleType2["invoices"] = "invoices";
1463
1502
  OrganizationModuleType2["announcements"] = "announcements";
1503
+ OrganizationModuleType2["bookings"] = "bookings";
1464
1504
  return OrganizationModuleType2;
1465
1505
  })(OrganizationModuleType || {});
1466
1506
  var PaymentIntegrationType = /* @__PURE__ */ ((PaymentIntegrationType2) => {
@@ -1469,6 +1509,16 @@ var PaymentIntegrationType = /* @__PURE__ */ ((PaymentIntegrationType2) => {
1469
1509
  PaymentIntegrationType2["braintree"] = "braintree";
1470
1510
  return PaymentIntegrationType2;
1471
1511
  })(PaymentIntegrationType || {});
1512
+ var DayOfWeek = /* @__PURE__ */ ((DayOfWeek2) => {
1513
+ DayOfWeek2["sunday"] = "sunday";
1514
+ DayOfWeek2["monday"] = "monday";
1515
+ DayOfWeek2["tuesday"] = "tuesday";
1516
+ DayOfWeek2["wednesday"] = "wednesday";
1517
+ DayOfWeek2["thursday"] = "thursday";
1518
+ DayOfWeek2["friday"] = "friday";
1519
+ DayOfWeek2["saturday"] = "saturday";
1520
+ return DayOfWeek2;
1521
+ })(DayOfWeek || {});
1472
1522
 
1473
1523
  // src/utilities/AppendInfiniteQuery.ts
1474
1524
  var import_immer = require("immer");
@@ -2466,6 +2516,339 @@ var useGetAdvertisement = (position, options = {}) => {
2466
2516
  );
2467
2517
  };
2468
2518
 
2519
+ // src/queries/bookings/useGetBookings.ts
2520
+ var BOOKINGS_QUERY_KEY = (past, placeId) => {
2521
+ const keys = ["BOOKINGS"];
2522
+ if (typeof past !== "undefined") {
2523
+ keys.push(past ? "PAST" : "UPCOMING");
2524
+ }
2525
+ if (placeId) {
2526
+ keys.push(placeId);
2527
+ }
2528
+ return keys;
2529
+ };
2530
+ var SET_BOOKINGS_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
2531
+ client.setQueryData(
2532
+ [
2533
+ ...BOOKINGS_QUERY_KEY(...keyParams),
2534
+ ...GetBaseInfiniteQueryKeys(...baseKeys)
2535
+ ],
2536
+ setFirstPageData(response)
2537
+ );
2538
+ };
2539
+ var GetBookings = async ({
2540
+ pageParam,
2541
+ pageSize,
2542
+ orderBy,
2543
+ search,
2544
+ past,
2545
+ placeId,
2546
+ queryClient,
2547
+ clientApiParams,
2548
+ locale
2549
+ }) => {
2550
+ const clientApi = await GetClientAPI(clientApiParams);
2551
+ const { data } = await clientApi.get(`/bookings`, {
2552
+ params: {
2553
+ page: pageParam || void 0,
2554
+ pageSize: pageSize || void 0,
2555
+ orderBy: orderBy || void 0,
2556
+ search: search || void 0,
2557
+ past: past !== void 0 ? past : void 0,
2558
+ placeId: placeId || void 0
2559
+ }
2560
+ });
2561
+ if (queryClient && data.status === "ok") {
2562
+ CacheIndividualQueries(
2563
+ data,
2564
+ queryClient,
2565
+ (bookingId) => BOOKING_QUERY_KEY(bookingId),
2566
+ locale
2567
+ );
2568
+ }
2569
+ return data;
2570
+ };
2571
+ var useGetBookings = (past = false, placeId = "", params = {}, options = {}) => {
2572
+ return useConnectedInfiniteQuery(
2573
+ BOOKINGS_QUERY_KEY(past, placeId),
2574
+ (params2) => GetBookings({ past, placeId, ...params2 }),
2575
+ params,
2576
+ options
2577
+ );
2578
+ };
2579
+
2580
+ // src/queries/bookings/useGetBooking.ts
2581
+ var BOOKING_QUERY_KEY = (bookingId) => [
2582
+ ...BOOKINGS_QUERY_KEY(),
2583
+ bookingId
2584
+ ];
2585
+ var SET_BOOKING_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
2586
+ client.setQueryData(
2587
+ [
2588
+ ...BOOKING_QUERY_KEY(...keyParams),
2589
+ ...GetBaseSingleQueryKeys(...baseKeys)
2590
+ ],
2591
+ response
2592
+ );
2593
+ };
2594
+ var GetBooking = async ({
2595
+ bookingId,
2596
+ clientApiParams
2597
+ }) => {
2598
+ const clientApi = await GetClientAPI(clientApiParams);
2599
+ const { data } = await clientApi.get(`/bookings/${bookingId}`);
2600
+ return data;
2601
+ };
2602
+ var useGetBooking = (bookingId = "", options = {}) => {
2603
+ return useConnectedSingleQuery(
2604
+ BOOKING_QUERY_KEY(bookingId),
2605
+ (_params) => GetBooking({ bookingId, ..._params }),
2606
+ {
2607
+ ...options,
2608
+ enabled: !!bookingId && (options?.enabled ?? true)
2609
+ }
2610
+ );
2611
+ };
2612
+
2613
+ // src/queries/bookings/useGetBookingIntent.ts
2614
+ var SELF_BOOKING_INTENT_QUERY_KEY = (bookingId, addressId) => [...BOOKING_QUERY_KEY(bookingId), addressId, "INTENT"];
2615
+ var GetBookingIntent = async ({
2616
+ bookingId,
2617
+ addressId,
2618
+ clientApiParams
2619
+ }) => {
2620
+ const clientApi = await GetClientAPI(clientApiParams);
2621
+ const { data } = await clientApi.get(`/bookings/${bookingId}/intent`, {
2622
+ params: {
2623
+ addressId
2624
+ }
2625
+ });
2626
+ return data;
2627
+ };
2628
+ var useGetBookingIntent = (bookingId = "", addressId = "", options = {}) => {
2629
+ const { authenticated } = useConnectedXM();
2630
+ return useConnectedSingleQuery_default(
2631
+ SELF_BOOKING_INTENT_QUERY_KEY(bookingId, addressId),
2632
+ (params) => GetBookingIntent({ bookingId, addressId, ...params }),
2633
+ {
2634
+ staleTime: Infinity,
2635
+ retry: false,
2636
+ retryOnMount: false,
2637
+ ...options,
2638
+ enabled: !!authenticated && !!bookingId && !!addressId && (options?.enabled ?? true)
2639
+ }
2640
+ );
2641
+ };
2642
+
2643
+ // src/queries/bookings/useGetBookingPlaces.ts
2644
+ var BOOKING_PLACES_QUERY_KEY = () => ["BOOKING_PLACES"];
2645
+ var SET_BOOKING_PLACES_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
2646
+ client.setQueryData(
2647
+ [
2648
+ ...BOOKING_PLACES_QUERY_KEY(...keyParams),
2649
+ ...GetBaseInfiniteQueryKeys(...baseKeys)
2650
+ ],
2651
+ setFirstPageData(response)
2652
+ );
2653
+ };
2654
+ var GetBookingPlaces = async ({
2655
+ pageParam,
2656
+ pageSize,
2657
+ orderBy,
2658
+ search,
2659
+ queryClient,
2660
+ clientApiParams,
2661
+ locale
2662
+ }) => {
2663
+ const clientApi = await GetClientAPI(clientApiParams);
2664
+ const { data } = await clientApi.get(`/bookings/places`, {
2665
+ params: {
2666
+ page: pageParam || void 0,
2667
+ pageSize: pageSize || void 0,
2668
+ orderBy: orderBy || void 0,
2669
+ search: search || void 0
2670
+ }
2671
+ });
2672
+ if (queryClient && data.status === "ok") {
2673
+ CacheIndividualQueries(
2674
+ data,
2675
+ queryClient,
2676
+ (bookingPlaceId) => BOOKING_PLACE_QUERY_KEY(bookingPlaceId),
2677
+ locale
2678
+ );
2679
+ }
2680
+ return data;
2681
+ };
2682
+ var useGetBookingPlaces = (params = {}, options = {}) => {
2683
+ return useConnectedInfiniteQuery(
2684
+ BOOKING_PLACES_QUERY_KEY(),
2685
+ (params2) => GetBookingPlaces({ ...params2 }),
2686
+ params,
2687
+ options
2688
+ );
2689
+ };
2690
+
2691
+ // src/queries/bookings/useGetBookingPlace.ts
2692
+ var BOOKING_PLACE_QUERY_KEY = (placeId) => [
2693
+ ...BOOKING_PLACES_QUERY_KEY(),
2694
+ placeId
2695
+ ];
2696
+ var SET_BOOKING_PLACE_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
2697
+ client.setQueryData(
2698
+ [
2699
+ ...BOOKING_PLACE_QUERY_KEY(...keyParams),
2700
+ ...GetBaseSingleQueryKeys(...baseKeys)
2701
+ ],
2702
+ response
2703
+ );
2704
+ };
2705
+ var GetBookingPlace = async ({
2706
+ placeId,
2707
+ clientApiParams
2708
+ }) => {
2709
+ const clientApi = await GetClientAPI(clientApiParams);
2710
+ const { data } = await clientApi.get(`/bookings/places/${placeId}`);
2711
+ return data;
2712
+ };
2713
+ var useGetBookingPlace = (placeId = "", options = {}) => {
2714
+ return useConnectedSingleQuery(
2715
+ BOOKING_PLACE_QUERY_KEY(placeId),
2716
+ (_params) => GetBookingPlace({ placeId, ..._params }),
2717
+ {
2718
+ ...options,
2719
+ enabled: !!placeId && (options?.enabled ?? true)
2720
+ }
2721
+ );
2722
+ };
2723
+
2724
+ // src/queries/bookings/useGetBookingPlaceSpace.ts
2725
+ var BOOKING_PLACE_SPACE_QUERY_KEY = (placeId, spaceId) => [...BOOKING_PLACES_QUERY_KEY(), placeId, "SPACE", spaceId];
2726
+ var SET_BOOKING_PLACE_SPACE_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
2727
+ client.setQueryData(
2728
+ [
2729
+ ...BOOKING_PLACE_SPACE_QUERY_KEY(...keyParams),
2730
+ ...GetBaseSingleQueryKeys(...baseKeys)
2731
+ ],
2732
+ response
2733
+ );
2734
+ };
2735
+ var GetBookingPlaceSpace = async ({
2736
+ placeId,
2737
+ spaceId,
2738
+ clientApiParams
2739
+ }) => {
2740
+ const clientApi = await GetClientAPI(clientApiParams);
2741
+ const { data } = await clientApi.get(
2742
+ `/bookings/places/${placeId}/spaces/${spaceId}`
2743
+ );
2744
+ return data;
2745
+ };
2746
+ var useGetBookingPlaceSpace = (placeId = "", spaceId = "", options = {}) => {
2747
+ return useConnectedSingleQuery(
2748
+ BOOKING_PLACE_SPACE_QUERY_KEY(placeId, spaceId),
2749
+ (_params) => GetBookingPlaceSpace({ placeId, spaceId, ..._params }),
2750
+ {
2751
+ ...options,
2752
+ enabled: !!placeId && !!spaceId && (options?.enabled ?? true)
2753
+ }
2754
+ );
2755
+ };
2756
+
2757
+ // src/queries/bookings/useGetBookingPlaceSpaces.ts
2758
+ var BOOKING_PLACE_SPACES_QUERY_KEY = (bookingId) => [
2759
+ ...BOOKING_PLACE_QUERY_KEY(bookingId),
2760
+ "SPACES"
2761
+ ];
2762
+ var SET_BOOKING_PLACE_SPACES_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
2763
+ client.setQueryData(
2764
+ [
2765
+ ...BOOKING_PLACE_SPACES_QUERY_KEY(...keyParams),
2766
+ ...GetBaseInfiniteQueryKeys(...baseKeys)
2767
+ ],
2768
+ setFirstPageData(response)
2769
+ );
2770
+ };
2771
+ var GetBookingPlacesSpaces = async ({
2772
+ bookingId,
2773
+ pageParam,
2774
+ pageSize,
2775
+ orderBy,
2776
+ search,
2777
+ queryClient,
2778
+ clientApiParams,
2779
+ locale
2780
+ }) => {
2781
+ const clientApi = await GetClientAPI(clientApiParams);
2782
+ const { data } = await clientApi.get(`/bookings/places/${bookingId}/spaces`, {
2783
+ params: {
2784
+ page: pageParam || void 0,
2785
+ pageSize: pageSize || void 0,
2786
+ orderBy: orderBy || void 0,
2787
+ search: search || void 0
2788
+ }
2789
+ });
2790
+ if (queryClient && data.status === "ok") {
2791
+ CacheIndividualQueries(
2792
+ data,
2793
+ queryClient,
2794
+ (spaceId) => BOOKING_PLACE_SPACE_QUERY_KEY(bookingId, spaceId),
2795
+ locale
2796
+ );
2797
+ }
2798
+ return data;
2799
+ };
2800
+ var useGetBookingPlacesSpaces = (bookingId = "", params = {}, options = {}) => {
2801
+ return useConnectedInfiniteQuery(
2802
+ BOOKING_PLACE_SPACES_QUERY_KEY(bookingId),
2803
+ (params2) => GetBookingPlacesSpaces({ bookingId, ...params2 }),
2804
+ params,
2805
+ {
2806
+ ...options,
2807
+ enabled: !!bookingId && (options?.enabled ?? true)
2808
+ }
2809
+ );
2810
+ };
2811
+
2812
+ // src/queries/bookings/useGetBookingPlaceSpaceSlots.ts
2813
+ var BOOKING_PLACE_SPACE_SLOTS_QUERY_KEY = (placeId, spaceId, firstDayOfMonth) => [
2814
+ ...BOOKING_PLACES_QUERY_KEY(),
2815
+ placeId,
2816
+ "SPACE",
2817
+ spaceId,
2818
+ "SLOTS",
2819
+ firstDayOfMonth
2820
+ ];
2821
+ var GetBookingPlaceSpaceSlots = async ({
2822
+ placeId,
2823
+ spaceId,
2824
+ firstDayOfMonth,
2825
+ clientApiParams
2826
+ }) => {
2827
+ const clientApi = await GetClientAPI(clientApiParams);
2828
+ const { data } = await clientApi.get(
2829
+ `/bookings/places/${placeId}/spaces/${spaceId}/slots`,
2830
+ {
2831
+ params: { firstDayOfMonth }
2832
+ }
2833
+ );
2834
+ return data;
2835
+ };
2836
+ var useGetBookingPlaceSpaceSlots = (placeId = "", spaceId = "", firstDayOfMonth, options = {}) => {
2837
+ return useConnectedSingleQuery(
2838
+ BOOKING_PLACE_SPACE_SLOTS_QUERY_KEY(placeId, spaceId, firstDayOfMonth),
2839
+ (_params) => GetBookingPlaceSpaceSlots({
2840
+ placeId,
2841
+ spaceId,
2842
+ firstDayOfMonth,
2843
+ ..._params
2844
+ }),
2845
+ {
2846
+ ...options,
2847
+ enabled: !!placeId && !!spaceId && (options?.enabled ?? true)
2848
+ }
2849
+ );
2850
+ };
2851
+
2469
2852
  // src/queries/benefits/useGetBenefits.ts
2470
2853
  var BENEFITS_QUERY_KEY = () => ["BENEFITS"];
2471
2854
  var SET_BENEFITS_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
@@ -9131,6 +9514,97 @@ var useUnlikeActivity = (options = {}) => {
9131
9514
  return useConnectedMutation_default(UnlikeActivity, options);
9132
9515
  };
9133
9516
 
9517
+ // src/mutations/bookings/useCancelBooking.ts
9518
+ var CancelBooking = async ({
9519
+ bookingId,
9520
+ clientApiParams,
9521
+ queryClient
9522
+ }) => {
9523
+ const clientApi = await GetClientAPI(clientApiParams);
9524
+ const { data } = await clientApi.delete(
9525
+ `/bookings/${bookingId}`
9526
+ );
9527
+ if (queryClient && data.status === "ok") {
9528
+ queryClient.setQueryData(BOOKING_QUERY_KEY(bookingId), data);
9529
+ queryClient.invalidateQueries({
9530
+ queryKey: BOOKINGS_QUERY_KEY()
9531
+ });
9532
+ }
9533
+ return data;
9534
+ };
9535
+ var useCancelBooking = (options = {}) => {
9536
+ return useConnectedMutation_default(CancelBooking, options);
9537
+ };
9538
+
9539
+ // src/mutations/bookings/useConfirmBooking.ts
9540
+ var ConfirmBooking = async ({
9541
+ bookingId,
9542
+ clientApiParams,
9543
+ queryClient
9544
+ }) => {
9545
+ const clientApi = await GetClientAPI(clientApiParams);
9546
+ const { data } = await clientApi.post(
9547
+ `/bookings/${bookingId}`
9548
+ );
9549
+ if (queryClient && data.status === "ok") {
9550
+ queryClient.setQueryData(BOOKING_QUERY_KEY(bookingId), data);
9551
+ queryClient.invalidateQueries({
9552
+ queryKey: BOOKINGS_QUERY_KEY()
9553
+ });
9554
+ queryClient.invalidateQueries({
9555
+ predicate: ({ queryKey }) => queryKey.includes("SLOTS")
9556
+ });
9557
+ }
9558
+ return data;
9559
+ };
9560
+ var useConfirmBooking = (options = {}) => {
9561
+ return useConnectedMutation_default(ConfirmBooking, options);
9562
+ };
9563
+
9564
+ // src/mutations/bookings/useDraftBooking.ts
9565
+ var DraftBooking = async ({
9566
+ placeId,
9567
+ spaceId,
9568
+ day,
9569
+ time,
9570
+ queryClient,
9571
+ clientApiParams
9572
+ }) => {
9573
+ const clientApi = await GetClientAPI(clientApiParams);
9574
+ const { data } = await clientApi.post(
9575
+ `/bookings/places/${placeId}/spaces/${spaceId}/slots`,
9576
+ { day, time }
9577
+ );
9578
+ if (data.status === "ok" && queryClient) {
9579
+ queryClient.invalidateQueries({
9580
+ queryKey: BOOKINGS_QUERY_KEY()
9581
+ });
9582
+ }
9583
+ return data;
9584
+ };
9585
+ var useDraftBooking = (options = {}) => {
9586
+ return useConnectedMutation_default(DraftBooking, options);
9587
+ };
9588
+
9589
+ // src/mutations/bookings/useDeleteDraftBooking.ts
9590
+ var DeleteDraftBooking = async ({
9591
+ bookingId,
9592
+ clientApiParams,
9593
+ queryClient
9594
+ }) => {
9595
+ const clientApi = await GetClientAPI(clientApiParams);
9596
+ const { data } = await clientApi.delete(
9597
+ `/bookings/${bookingId}`
9598
+ );
9599
+ if (queryClient && data.status === "ok") {
9600
+ queryClient.removeQueries({ queryKey: BOOKING_QUERY_KEY(bookingId) });
9601
+ }
9602
+ return data;
9603
+ };
9604
+ var useDeleteDraftBooking = (options = {}) => {
9605
+ return useConnectedMutation_default(DeleteDraftBooking, options);
9606
+ };
9607
+
9134
9608
  // src/mutations/channels/contents/useLikeContent.ts
9135
9609
  var LikeContent = async ({
9136
9610
  channelId,
@@ -9822,6 +10296,14 @@ var CapturePaymentIntent = async ({
9822
10296
  queryKey: INVOICE_QUERY_KEY(intent.invoiceId)
9823
10297
  });
9824
10298
  }
10299
+ if (intent.bookingId) {
10300
+ queryClient.invalidateQueries({
10301
+ queryKey: BOOKINGS_QUERY_KEY()
10302
+ });
10303
+ queryClient.invalidateQueries({
10304
+ predicate: ({ queryKey }) => queryKey.includes("SLOTS")
10305
+ });
10306
+ }
9825
10307
  }
9826
10308
  return data;
9827
10309
  };
@@ -12617,6 +13099,13 @@ var useEnableIntegration = (options = {}) => {
12617
13099
  AdvertisementType,
12618
13100
  AppendInfiniteQuery,
12619
13101
  BENEFITS_QUERY_KEY,
13102
+ BOOKINGS_QUERY_KEY,
13103
+ BOOKING_PLACES_QUERY_KEY,
13104
+ BOOKING_PLACE_QUERY_KEY,
13105
+ BOOKING_PLACE_SPACES_QUERY_KEY,
13106
+ BOOKING_PLACE_SPACE_QUERY_KEY,
13107
+ BOOKING_PLACE_SPACE_SLOTS_QUERY_KEY,
13108
+ BOOKING_QUERY_KEY,
12620
13109
  BlockIntegration,
12621
13110
  CHANNELS_QUERY_KEY,
12622
13111
  CHANNEL_COLLECTIONS_QUERY_KEY,
@@ -12634,6 +13123,7 @@ var useEnableIntegration = (options = {}) => {
12634
13123
  CONTENT_QUERY_KEY,
12635
13124
  CUSTOM_ERROR_CODES,
12636
13125
  CacheIndividualQueries,
13126
+ CancelBooking,
12637
13127
  CancelGroupInvitation,
12638
13128
  CancelGroupRequest,
12639
13129
  CancelPass,
@@ -12641,6 +13131,7 @@ var useEnableIntegration = (options = {}) => {
12641
13131
  CapturePaymentIntent,
12642
13132
  CheckinListingAttendeePass,
12643
13133
  CompleteEventActivation,
13134
+ ConfirmBooking,
12644
13135
  ConnectedXMProvider,
12645
13136
  ContentGuestType,
12646
13137
  CouponType,
@@ -12668,6 +13159,7 @@ var useEnableIntegration = (options = {}) => {
12668
13159
  CreateThread,
12669
13160
  CreateThreadMessage,
12670
13161
  Currency,
13162
+ DayOfWeek,
12671
13163
  DeactivateGroup,
12672
13164
  DefaultAuthAction,
12673
13165
  DeleteActivity,
@@ -12677,6 +13169,7 @@ var useEnableIntegration = (options = {}) => {
12677
13169
  DeleteChannelSubscriber,
12678
13170
  DeleteContentGuest,
12679
13171
  DeleteContentPublishSchedule,
13172
+ DeleteDraftBooking,
12680
13173
  DeleteListing,
12681
13174
  DeleteListingQuestion,
12682
13175
  DeleteListingSession,
@@ -12692,6 +13185,7 @@ var useEnableIntegration = (options = {}) => {
12692
13185
  DeleteThreadMessage,
12693
13186
  DemoteGroupModerator,
12694
13187
  DisableIntegration,
13188
+ DraftBooking,
12695
13189
  ERR_FEATURE_NOT_AVAILABLE,
12696
13190
  ERR_INTEGRATION_PERMISSION_DENIED,
12697
13191
  ERR_KNOWN_ERROR,
@@ -12760,6 +13254,14 @@ var useEnableIntegration = (options = {}) => {
12760
13254
  GetBaseInfiniteQueryKeys,
12761
13255
  GetBaseSingleQueryKeys,
12762
13256
  GetBenefits,
13257
+ GetBooking,
13258
+ GetBookingIntent,
13259
+ GetBookingPlace,
13260
+ GetBookingPlaceSpace,
13261
+ GetBookingPlaceSpaceSlots,
13262
+ GetBookingPlaces,
13263
+ GetBookingPlacesSpaces,
13264
+ GetBookings,
12763
13265
  GetChannel,
12764
13266
  GetChannelCollection,
12765
13267
  GetChannelCollectionContents,
@@ -12995,6 +13497,7 @@ var useEnableIntegration = (options = {}) => {
12995
13497
  SELF_ADDRESSES_QUERY_KEY,
12996
13498
  SELF_ADDRESS_QUERY_KEY,
12997
13499
  SELF_ANNOUNCEMENT_QUERY_KEY,
13500
+ SELF_BOOKING_INTENT_QUERY_KEY,
12998
13501
  SELF_CHAT_CHANNELS_QUERY_KEY,
12999
13502
  SELF_CHAT_CHANNEL_MEMBERS_QUERY_KEY,
13000
13503
  SELF_CHAT_CHANNEL_MESSAGES_QUERY_KEY,
@@ -13059,6 +13562,12 @@ var useEnableIntegration = (options = {}) => {
13059
13562
  SET_ADVERTISEMENT_QUERY_DATA,
13060
13563
  SET_ALL_GROUP_EVENTS_QUERY_DATA,
13061
13564
  SET_BENEFITS_QUERY_DATA,
13565
+ SET_BOOKINGS_QUERY_DATA,
13566
+ SET_BOOKING_PLACES_QUERY_DATA,
13567
+ SET_BOOKING_PLACE_QUERY_DATA,
13568
+ SET_BOOKING_PLACE_SPACES_QUERY_DATA,
13569
+ SET_BOOKING_PLACE_SPACE_QUERY_DATA,
13570
+ SET_BOOKING_QUERY_DATA,
13062
13571
  SET_CHANNELS_QUERY_DATA,
13063
13572
  SET_CHANNEL_COLLECTIONS_QUERY_DATA,
13064
13573
  SET_CHANNEL_COLLECTION_QUERY_DATA,
@@ -13272,6 +13781,7 @@ var useEnableIntegration = (options = {}) => {
13272
13781
  useAddThreadMessageReaction,
13273
13782
  useAddThreadMessageReply,
13274
13783
  useBlockIntegration,
13784
+ useCancelBooking,
13275
13785
  useCancelGroupInvitation,
13276
13786
  useCancelGroupRequest,
13277
13787
  useCancelPass,
@@ -13279,6 +13789,7 @@ var useEnableIntegration = (options = {}) => {
13279
13789
  useCapturePaymentIntent,
13280
13790
  useCheckinListingAttendeePass,
13281
13791
  useCompleteEventActivation,
13792
+ useConfirmBooking,
13282
13793
  useConnectedInfiniteQuery,
13283
13794
  useConnectedMutation,
13284
13795
  useConnectedSingleQuery,
@@ -13314,6 +13825,7 @@ var useEnableIntegration = (options = {}) => {
13314
13825
  useDeleteChannelSubscriber,
13315
13826
  useDeleteContentGuest,
13316
13827
  useDeleteContentPublishSchedule,
13828
+ useDeleteDraftBooking,
13317
13829
  useDeleteListing,
13318
13830
  useDeleteListingQuestion,
13319
13831
  useDeleteListingSession,
@@ -13329,6 +13841,7 @@ var useEnableIntegration = (options = {}) => {
13329
13841
  useDeleteThreadMessage,
13330
13842
  useDemoteGroupModerator,
13331
13843
  useDisableIntegration,
13844
+ useDraftBooking,
13332
13845
  useEnableIntegration,
13333
13846
  useFollowAccount,
13334
13847
  useGetAccount,
@@ -13347,6 +13860,14 @@ var useEnableIntegration = (options = {}) => {
13347
13860
  useGetAdvertisement,
13348
13861
  useGetAllGroupEvents,
13349
13862
  useGetBenefits,
13863
+ useGetBooking,
13864
+ useGetBookingIntent,
13865
+ useGetBookingPlace,
13866
+ useGetBookingPlaceSpace,
13867
+ useGetBookingPlaceSpaceSlots,
13868
+ useGetBookingPlaces,
13869
+ useGetBookingPlacesSpaces,
13870
+ useGetBookings,
13350
13871
  useGetChannel,
13351
13872
  useGetChannelCollection,
13352
13873
  useGetChannelCollectionContents,