@connectedxm/client 0.4.9 → 0.4.11

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
@@ -40,6 +40,7 @@ __export(src_exports, {
40
40
  ACTIVITIES_QUERY_KEY: () => ACTIVITIES_QUERY_KEY,
41
41
  ACTIVITY_COMMENTS_QUERY_KEY: () => ACTIVITY_COMMENTS_QUERY_KEY,
42
42
  ACTIVITY_QUERY_KEY: () => ACTIVITY_QUERY_KEY,
43
+ ADD_SELF_RELATIONSHIP: () => ADD_SELF_RELATIONSHIP,
43
44
  ADVERTISEMENT_QUERY_KEY: () => ADVERTISEMENT_QUERY_KEY,
44
45
  AcceptCommunityInvitation: () => AcceptCommunityInvitation,
45
46
  AcceptCommunityRequest: () => AcceptCommunityRequest,
@@ -92,6 +93,7 @@ __export(src_exports, {
92
93
  CreateEventLead: () => CreateEventLead,
93
94
  CreateListing: () => CreateListing,
94
95
  CreateListingAnnouncement: () => CreateListingAnnouncement,
96
+ CreateListingQuestion: () => CreateListingQuestion,
95
97
  CreateListingSession: () => CreateListingSession,
96
98
  CreateListingSpeaker: () => CreateListingSpeaker,
97
99
  CreateSelfChatChannel: () => CreateSelfChatChannel,
@@ -104,6 +106,7 @@ __export(src_exports, {
104
106
  DeleteActivity: () => DeleteActivity,
105
107
  DeleteCommunityInvitation: () => DeleteCommunityInvitation,
106
108
  DeleteListing: () => DeleteListing,
109
+ DeleteListingQuestion: () => DeleteListingQuestion,
107
110
  DeleteListingSession: () => DeleteListingSession,
108
111
  DeleteListingSpeaker: () => DeleteListingSpeaker,
109
112
  DeleteReshare: () => DeleteReshare,
@@ -130,6 +133,7 @@ __export(src_exports, {
130
133
  EVENT_SPEAKER_QUERY_KEY: () => EVENT_SPEAKER_QUERY_KEY,
131
134
  EVENT_SPONSORS_QUERY_KEY: () => EVENT_SPONSORS_QUERY_KEY,
132
135
  EVENT_TICKETS_QUERY_KEY: () => EVENT_TICKETS_QUERY_KEY,
136
+ EventEmailType: () => EventEmailType,
133
137
  EventSource: () => EventSource,
134
138
  EventType: () => EventType,
135
139
  FollowAccount: () => FollowAccount,
@@ -208,6 +212,8 @@ __export(src_exports, {
208
212
  GetSelfEventListing: () => GetSelfEventListing,
209
213
  GetSelfEventListingAnnouncement: () => GetSelfEventListingAnnouncement,
210
214
  GetSelfEventListingAnnouncements: () => GetSelfEventListingAnnouncements,
215
+ GetSelfEventListingEmail: () => GetSelfEventListingEmail,
216
+ GetSelfEventListingQuestions: () => GetSelfEventListingQuestions,
211
217
  GetSelfEventListingRegistration: () => GetSelfEventListingRegistration,
212
218
  GetSelfEventListingRegistrations: () => GetSelfEventListingRegistrations,
213
219
  GetSelfEventListings: () => GetSelfEventListings,
@@ -228,6 +234,7 @@ __export(src_exports, {
228
234
  GetSelfPushDevice: () => GetSelfPushDevice,
229
235
  GetSelfPushDevices: () => GetSelfPushDevices,
230
236
  GetSelfRecommendations: () => GetSelfRecommendations,
237
+ GetSelfRelationships: () => GetSelfRelationships,
231
238
  GetSelfSubcription: () => GetSelfSubcription,
232
239
  GetSelfSubscriptionPayments: () => GetSelfSubscriptionPayments,
233
240
  GetSelfSubscriptions: () => GetSelfSubscriptions,
@@ -249,7 +256,9 @@ __export(src_exports, {
249
256
  LISTINGS_QUERY_KEY: () => LISTINGS_QUERY_KEY,
250
257
  LISTING_ANNOUNCEMENTS_QUERY_KEY: () => LISTING_ANNOUNCEMENTS_QUERY_KEY,
251
258
  LISTING_ANNOUNCEMENT_QUERY_KEY: () => LISTING_ANNOUNCEMENT_QUERY_KEY,
259
+ LISTING_EMAIL_QUERY_KEY: () => LISTING_EMAIL_QUERY_KEY,
252
260
  LISTING_QUERY_KEY: () => LISTING_QUERY_KEY,
261
+ LISTING_QUESTIONS_QUERY_KEY: () => LISTING_QUESTIONS_QUERY_KEY,
253
262
  LISTING_REGISTRATIONS_QUERY_KEY: () => LISTING_REGISTRATIONS_QUERY_KEY,
254
263
  LISTING_REGISTRATION_QUERY_KEY: () => LISTING_REGISTRATION_QUERY_KEY,
255
264
  LeaveCommunity: () => LeaveCommunity,
@@ -265,6 +274,7 @@ __export(src_exports, {
265
274
  PromoteCommunityMember: () => PromoteCommunityMember,
266
275
  PushDeviceAppType: () => PushDeviceAppType,
267
276
  PushService: () => PushService,
277
+ REMOVE_SELF_RELATIONSHIP: () => REMOVE_SELF_RELATIONSHIP,
268
278
  RegisterCancelledEventRegistration: () => RegisterCancelledEventRegistration,
269
279
  RegistrationQuestionType: () => RegistrationQuestionType,
270
280
  RegistrationStatus: () => RegistrationStatus,
@@ -308,6 +318,7 @@ __export(src_exports, {
308
318
  SELF_PUSH_DEVICE_QUERY_KEY: () => SELF_PUSH_DEVICE_QUERY_KEY,
309
319
  SELF_QUERY_KEY: () => SELF_QUERY_KEY,
310
320
  SELF_RECOMMENDATIONS_QUERY_KEY: () => SELF_RECOMMENDATIONS_QUERY_KEY,
321
+ SELF_RELATIONSHIPS_QUERY_KEY: () => SELF_RELATIONSHIPS_QUERY_KEY,
311
322
  SELF_SUBSCRIPTIONS_QUERY_KEY: () => SELF_SUBSCRIPTIONS_QUERY_KEY,
312
323
  SELF_SUBSCRIPTION_PAYMENTS_QUERY_KEY: () => SELF_SUBSCRIPTION_PAYMENTS_QUERY_KEY,
313
324
  SELF_SUBSCRIPTION_QUERY_KEY: () => SELF_SUBSCRIPTION_QUERY_KEY,
@@ -366,6 +377,7 @@ __export(src_exports, {
366
377
  SET_LEVEL_QUERY_DATA: () => SET_LEVEL_QUERY_DATA,
367
378
  SET_LEVEL_SPONSORS_QUERY_DATA: () => SET_LEVEL_SPONSORS_QUERY_DATA,
368
379
  SET_LISTING_ANNOUNCEMENT_QUERY_KEY: () => SET_LISTING_ANNOUNCEMENT_QUERY_KEY,
380
+ SET_LISTING_EMAIL_QUERY_DATA: () => SET_LISTING_EMAIL_QUERY_DATA,
369
381
  SET_LISTING_QUERY_DATA: () => SET_LISTING_QUERY_DATA,
370
382
  SET_LISTING_REGISTRATION_QUERY_KEY: () => SET_LISTING_REGISTRATION_QUERY_KEY,
371
383
  SET_ORGANIZATION_PAGE_QUERY_DATA: () => SET_ORGANIZATION_PAGE_QUERY_DATA,
@@ -403,6 +415,8 @@ __export(src_exports, {
403
415
  UnlikeActivity: () => UnlikeActivity,
404
416
  UpdateCommunity: () => UpdateCommunity,
405
417
  UpdateListing: () => UpdateListing,
418
+ UpdateListingEmail: () => UpdateListingEmail,
419
+ UpdateListingQuestion: () => UpdateListingQuestion,
406
420
  UpdateListingSession: () => UpdateListingSession,
407
421
  UpdateListingSpeaker: () => UpdateListingSpeaker,
408
422
  UpdateSelf: () => UpdateSelf,
@@ -451,6 +465,7 @@ __export(src_exports, {
451
465
  isTypeTicket: () => isTypeTicket,
452
466
  isTypeTrack: () => isTypeTrack,
453
467
  isTypeTransfer: () => isTypeTransfer,
468
+ isUUID: () => isUUID,
454
469
  setFirstPageData: () => setFirstPageData,
455
470
  useAcceptCommunityInvitation: () => useAcceptCommunityInvitation,
456
471
  useAcceptCommunityRequest: () => useAcceptCommunityRequest,
@@ -479,6 +494,7 @@ __export(src_exports, {
479
494
  useCreateEventLead: () => useCreateEventLead,
480
495
  useCreateListing: () => useCreateListing,
481
496
  useCreateListingAnnouncement: () => useCreateListingAnnouncement,
497
+ useCreateListingQuestion: () => useCreateListingQuestion,
482
498
  useCreateListingSession: () => useCreateListingSession,
483
499
  useCreateListingSpeaker: () => useCreateListingSpeaker,
484
500
  useCreateSelfChatChannel: () => useCreateSelfChatChannel,
@@ -490,6 +506,7 @@ __export(src_exports, {
490
506
  useDeleteActivity: () => useDeleteActivity,
491
507
  useDeleteCommunityInvitation: () => useDeleteCommunityInvitation,
492
508
  useDeleteListing: () => useDeleteListing,
509
+ useDeleteListingQuestion: () => useDeleteListingQuestion,
493
510
  useDeleteListingSession: () => useDeleteListingSession,
494
511
  useDeleteListingSpeaker: () => useDeleteListingSpeaker,
495
512
  useDeleteReshare: () => useDeleteReshare,
@@ -570,6 +587,8 @@ __export(src_exports, {
570
587
  useGetSelfEventListing: () => useGetSelfEventListing,
571
588
  useGetSelfEventListingAnnouncement: () => useGetSelfEventListingAnnouncement,
572
589
  useGetSelfEventListingAnnouncements: () => useGetSelfEventListingAnnouncements,
590
+ useGetSelfEventListingEmail: () => useGetSelfEventListingEmail,
591
+ useGetSelfEventListingQuestions: () => useGetSelfEventListingQuestions,
573
592
  useGetSelfEventListingRegistration: () => useGetSelfEventListingRegistration,
574
593
  useGetSelfEventListings: () => useGetSelfEventListings,
575
594
  useGetSelfEventListingsRegistrations: () => useGetSelfEventListingsRegistrations,
@@ -590,6 +609,7 @@ __export(src_exports, {
590
609
  useGetSelfPushDevice: () => useGetSelfPushDevice,
591
610
  useGetSelfPushDevices: () => useGetSelfPushDevices,
592
611
  useGetSelfRecommendations: () => useGetSelfRecommendations,
612
+ useGetSelfRelationships: () => useGetSelfRelationships,
593
613
  useGetSelfSubcription: () => useGetSelfSubcription,
594
614
  useGetSelfSubscriptionPayments: () => useGetSelfSubscriptionPayments,
595
615
  useGetSelfSubscriptions: () => useGetSelfSubscriptions,
@@ -600,6 +620,10 @@ __export(src_exports, {
600
620
  useGetSeriesList: () => useGetSeriesList,
601
621
  useGetSponsor: () => useGetSponsor,
602
622
  useGetSponsors: () => useGetSponsors,
623
+ useIsAccountFollowing: () => useIsAccountFollowing,
624
+ useIsChannelSubscribed: () => useIsChannelSubscribed,
625
+ useIsCommunityMember: () => useIsCommunityMember,
626
+ useIsEventRegistered: () => useIsEventRegistered,
603
627
  useJoinCommunity: () => useJoinCommunity,
604
628
  useLeaveCommunity: () => useLeaveCommunity,
605
629
  useLeaveSelfChatChannel: () => useLeaveSelfChatChannel,
@@ -627,6 +651,8 @@ __export(src_exports, {
627
651
  useUnlikeActivity: () => useUnlikeActivity,
628
652
  useUpdateCommunity: () => useUpdateCommunity,
629
653
  useUpdateListing: () => useUpdateListing,
654
+ useUpdateListingEmail: () => useUpdateListingEmail,
655
+ useUpdateListingQuestion: () => useUpdateListingQuestion,
630
656
  useUpdateListingSession: () => useUpdateListingSession,
631
657
  useUpdateListingSpeaker: () => useUpdateListingSpeaker,
632
658
  useUpdateSelf: () => useUpdateSelf,
@@ -649,9 +675,20 @@ var ConnectedXMClientContext = import_react.default.createContext(
649
675
  var ConnectedXMProvider = ({
650
676
  queryClient,
651
677
  children,
678
+ getToken,
652
679
  ...state
653
680
  }) => {
681
+ const [authenticated, setAuthenticated] = import_react.default.useState(false);
654
682
  const [ssr, setSSR] = import_react.default.useState(true);
683
+ import_react.default.useEffect(() => {
684
+ if (!authenticated) {
685
+ getToken().then((token) => {
686
+ if (token) {
687
+ setAuthenticated(true);
688
+ }
689
+ });
690
+ }
691
+ }, [authenticated, getToken]);
655
692
  import_react.default.useEffect(() => {
656
693
  setSSR(false);
657
694
  }, []);
@@ -661,6 +698,9 @@ var ConnectedXMProvider = ({
661
698
  {
662
699
  value: {
663
700
  ...state,
701
+ getToken,
702
+ authenticated,
703
+ setAuthenticated,
664
704
  queryClient
665
705
  }
666
706
  },
@@ -672,6 +712,9 @@ var ConnectedXMProvider = ({
672
712
  {
673
713
  value: {
674
714
  ...state,
715
+ getToken,
716
+ authenticated,
717
+ setAuthenticated,
675
718
  queryClient
676
719
  }
677
720
  },
@@ -691,6 +734,55 @@ var useConnectedXM = () => {
691
734
  return context;
692
735
  };
693
736
 
737
+ // src/hooks/useIsAccountFollowing.ts
738
+ var useIsAccountFollowing = (accountId) => {
739
+ const { data: relationships } = useGetSelfRelationships();
740
+ if (!accountId)
741
+ return false;
742
+ if (!isUUID(accountId)) {
743
+ throw new Error("Invalid accountId. Did you pass in the username?");
744
+ }
745
+ return relationships?.data.accounts[accountId] || false;
746
+ };
747
+
748
+ // src/hooks/useIsCommunityMember.ts
749
+ var useIsCommunityMember = (communityId, role) => {
750
+ const { data: relationships } = useGetSelfRelationships();
751
+ if (!communityId)
752
+ return false;
753
+ if (!isUUID(communityId)) {
754
+ throw new Error("Invalid communityId. Did you pass in the slug?");
755
+ }
756
+ const _role = relationships?.data.communities[communityId];
757
+ if (role) {
758
+ return _role === role;
759
+ } else {
760
+ return _role === "member" || _role === "moderator";
761
+ }
762
+ };
763
+
764
+ // src/hooks/useIsEventRegistered.ts
765
+ var useIsEventRegistered = (eventId) => {
766
+ const { data: relationships } = useGetSelfRelationships();
767
+ if (!eventId)
768
+ return false;
769
+ if (!isUUID(eventId)) {
770
+ throw new Error("Invalid eventId. Did you pass in the slug?");
771
+ }
772
+ return relationships?.data.events[eventId] || false;
773
+ };
774
+
775
+ // src/hooks/useIsChannelSubscribed.ts
776
+ var useIsChannelSubscribed = (channelId) => {
777
+ const { data: relationships } = useGetSelfRelationships();
778
+ if (!channelId)
779
+ return false;
780
+ if (!isUUID(channelId)) {
781
+ throw new Error("Invalid channelId. Did you pass in the slug?");
782
+ }
783
+ return relationships?.data.channels[channelId] || false;
784
+ };
785
+
694
786
  // src/interfaces.ts
695
787
  var RegistrationStatus = /* @__PURE__ */ ((RegistrationStatus2) => {
696
788
  RegistrationStatus2["registered"] = "registered";
@@ -950,6 +1042,12 @@ var CommunityRequestStatus = /* @__PURE__ */ ((CommunityRequestStatus2) => {
950
1042
  CommunityRequestStatus2["rejected"] = "rejected";
951
1043
  return CommunityRequestStatus2;
952
1044
  })(CommunityRequestStatus || {});
1045
+ var EventEmailType = /* @__PURE__ */ ((EventEmailType2) => {
1046
+ EventEmailType2["confirmation"] = "confirmation";
1047
+ EventEmailType2["cancellation"] = "cancellation";
1048
+ EventEmailType2["reminder"] = "reminder";
1049
+ return EventEmailType2;
1050
+ })(EventEmailType || {});
953
1051
 
954
1052
  // src/utilities/AppendInfiniteQuery.ts
955
1053
  var import_immer = require("immer");
@@ -1115,6 +1213,12 @@ var CacheIndividualQueries = (page, queryClient, queryKeyFn, locale = "en", item
1115
1213
  });
1116
1214
  };
1117
1215
 
1216
+ // src/utilities/IsUUID.ts
1217
+ var isUUID = (id) => {
1218
+ const uuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/;
1219
+ return uuidRegex.test(id);
1220
+ };
1221
+
1118
1222
  // src/queries/useConnectedInfiniteQuery.ts
1119
1223
  var import_react_query3 = require("@tanstack/react-query");
1120
1224
  var GetBaseInfiniteQueryKeys = (locale, search = "") => {
@@ -2562,7 +2666,7 @@ var useGetContentActivities = (contentId = "", params = {}, options = {}) => {
2562
2666
  params,
2563
2667
  {
2564
2668
  ...options,
2565
- enabled: !!contentId && (options.enabled ?? true)
2669
+ enabled: !!contentId && (options?.enabled ?? true)
2566
2670
  }
2567
2671
  );
2568
2672
  };
@@ -2643,7 +2747,7 @@ var useGetContentType = (contentTypeId = "", options = {}) => {
2643
2747
  (params) => GetContentType({ contentTypeId: contentTypeId || "", ...params }),
2644
2748
  {
2645
2749
  ...options,
2646
- enabled: !!contentTypeId && (options.enabled ?? true)
2750
+ enabled: !!contentTypeId && (options?.enabled ?? true)
2647
2751
  }
2648
2752
  );
2649
2753
  };
@@ -2698,7 +2802,7 @@ var useGetContentTypeContents = (contentTypeId = "", params = {}, options = {})
2698
2802
  params,
2699
2803
  {
2700
2804
  ...options,
2701
- enabled: !!contentTypeId && (options.enabled ?? true)
2805
+ enabled: !!contentTypeId && (options?.enabled ?? true)
2702
2806
  }
2703
2807
  );
2704
2808
  };
@@ -2898,7 +3002,7 @@ var useGetEventFaqs = (eventId = "", sectionId = "", params = {}, options = {})
2898
3002
  params,
2899
3003
  {
2900
3004
  ...options,
2901
- enabled: !!eventId && !!sectionId && (options.enabled ?? true)
3005
+ enabled: !!eventId && !!sectionId && (options?.enabled ?? true)
2902
3006
  }
2903
3007
  );
2904
3008
  };
@@ -3260,7 +3364,7 @@ var useGetEventSpeakers = (eventId = "", params = {}, options = {}) => {
3260
3364
  params,
3261
3365
  {
3262
3366
  ...options,
3263
- enabled: !!eventId && (options.enabled ?? true)
3367
+ enabled: !!eventId && (options?.enabled ?? true)
3264
3368
  }
3265
3369
  );
3266
3370
  };
@@ -3392,7 +3496,7 @@ var useGetEventSponsors = (eventId = "", params = {}, options = {}) => {
3392
3496
  params,
3393
3497
  {
3394
3498
  ...options,
3395
- enabled: !!eventId && (options.enabled ?? true)
3499
+ enabled: !!eventId && (options?.enabled ?? true)
3396
3500
  }
3397
3501
  );
3398
3502
  };
@@ -3512,7 +3616,7 @@ var useGetOrganizationPage = (type, options = {}) => {
3512
3616
  (params) => GetOrganizationPage({ type, ...params }),
3513
3617
  {
3514
3618
  ...options,
3515
- enabled: !!type && (options.enabled ?? true)
3619
+ enabled: !!type && (options?.enabled ?? true)
3516
3620
  }
3517
3621
  );
3518
3622
  };
@@ -3583,11 +3687,13 @@ var GetSelf = async ({
3583
3687
  return data;
3584
3688
  };
3585
3689
  var useGetSelf = (ignoreExecuteAs, options = {}) => {
3690
+ const { authenticated } = useConnectedXM();
3586
3691
  return useConnectedSingleQuery(
3587
3692
  SELF_QUERY_KEY(ignoreExecuteAs),
3588
3693
  (params) => GetSelf({ ignoreExecuteAs, ...params }),
3589
3694
  {
3590
- ...options
3695
+ ...options,
3696
+ enabled: authenticated && (options?.enabled ?? true)
3591
3697
  }
3592
3698
  );
3593
3699
  };
@@ -3641,12 +3747,14 @@ var GetSelfChatChannels = async ({
3641
3747
  return data;
3642
3748
  };
3643
3749
  var useGetSelfChatChannels = (params = {}, options = {}) => {
3750
+ const { authenticated } = useConnectedXM();
3644
3751
  return useConnectedInfiniteQuery(
3645
3752
  SELF_CHAT_CHANNELS_QUERY_KEY(),
3646
3753
  (params2) => GetSelfChatChannels(params2),
3647
3754
  params,
3648
3755
  {
3649
- ...options
3756
+ ...options,
3757
+ enabled: !!authenticated && (options?.enabled ?? true)
3650
3758
  }
3651
3759
  );
3652
3760
  };
@@ -3674,6 +3782,7 @@ var GetSelfChatChannel = async ({
3674
3782
  return data;
3675
3783
  };
3676
3784
  var useGetSelfChatChannel = (channelId, options = {}) => {
3785
+ const { authenticated } = useConnectedXM();
3677
3786
  return useConnectedSingleQuery(
3678
3787
  SELF_CHAT_CHANNEL_QUERY_KEY(channelId),
3679
3788
  (params) => GetSelfChatChannel({
@@ -3683,7 +3792,7 @@ var useGetSelfChatChannel = (channelId, options = {}) => {
3683
3792
  {
3684
3793
  staleTime: Infinity,
3685
3794
  ...options,
3686
- enabled: !!channelId && (options?.enabled ?? true)
3795
+ enabled: !!authenticated && !!channelId && (options?.enabled ?? true)
3687
3796
  }
3688
3797
  );
3689
3798
  };
@@ -3722,13 +3831,14 @@ var GetSelfChatChannelMembers = async ({
3722
3831
  return data;
3723
3832
  };
3724
3833
  var useGetSelfChatChannelMembers = (channelId, params = {}, options = {}) => {
3834
+ const { authenticated } = useConnectedXM();
3725
3835
  return useConnectedInfiniteQuery(
3726
3836
  SELF_CHAT_CHANNEL_MEMBERS_QUERY_KEY(channelId),
3727
3837
  (params2) => GetSelfChatChannelMembers({ ...params2, channelId }),
3728
3838
  params,
3729
3839
  {
3730
3840
  ...options,
3731
- enabled: !!channelId && (options?.enabled ?? true)
3841
+ enabled: !!authenticated && !!channelId && (options?.enabled ?? true)
3732
3842
  }
3733
3843
  );
3734
3844
  };
@@ -3777,13 +3887,14 @@ var GetSelfChatChannelMessages = async ({
3777
3887
  return data;
3778
3888
  };
3779
3889
  var useGetSelfChatChannelMessages = (channelId, params = {}, options = {}) => {
3890
+ const { authenticated } = useConnectedXM();
3780
3891
  return useConnectedInfiniteQuery(
3781
3892
  SELF_CHAT_CHANNEL_MESSAGES_QUERY_KEY(channelId),
3782
3893
  (params2) => GetSelfChatChannelMessages({ ...params2, channelId }),
3783
3894
  params,
3784
3895
  {
3785
3896
  ...options,
3786
- enabled: !!channelId && (options?.enabled ?? true)
3897
+ enabled: !!authenticated && !!channelId && (options?.enabled ?? true)
3787
3898
  }
3788
3899
  );
3789
3900
  };
@@ -3811,6 +3922,7 @@ var GetSelfEventRegistration = async ({
3811
3922
  return data;
3812
3923
  };
3813
3924
  var useGetSelfEventRegistration = (eventId, options = {}) => {
3925
+ const { authenticated } = useConnectedXM();
3814
3926
  return useConnectedSingleQuery_default(
3815
3927
  SELF_EVENT_REGISTRATION_QUERY_KEY(eventId),
3816
3928
  (params) => GetSelfEventRegistration({
@@ -3819,7 +3931,7 @@ var useGetSelfEventRegistration = (eventId, options = {}) => {
3819
3931
  }),
3820
3932
  {
3821
3933
  ...options,
3822
- enabled: !!eventId && (options?.enabled ?? true)
3934
+ enabled: !!authenticated && !!eventId && (options?.enabled ?? true)
3823
3935
  }
3824
3936
  );
3825
3937
  };
@@ -3842,6 +3954,7 @@ var GetSelfEventRegistrationCheckout = async ({
3842
3954
  return data;
3843
3955
  };
3844
3956
  var useGetSelfEventRegistrationCheckout = (eventId, registrationId = "", options = {}) => {
3957
+ const { authenticated } = useConnectedXM();
3845
3958
  return useConnectedSingleQuery_default(
3846
3959
  SELF_EVENT_REGISTRATION_CHECKOUT_QUERY_KEY(eventId, registrationId),
3847
3960
  (params) => GetSelfEventRegistrationCheckout({ eventId, registrationId, ...params }),
@@ -3850,7 +3963,7 @@ var useGetSelfEventRegistrationCheckout = (eventId, registrationId = "", options
3850
3963
  retry: false,
3851
3964
  retryOnMount: false,
3852
3965
  ...options,
3853
- enabled: !!eventId && !!registrationId && (options.enabled ?? true)
3966
+ enabled: !!authenticated && !!eventId && !!registrationId && (options?.enabled ?? true)
3854
3967
  }
3855
3968
  );
3856
3969
  };
@@ -3888,6 +4001,7 @@ var GetSelfEventRegistrationPurchase = async ({
3888
4001
  return data;
3889
4002
  };
3890
4003
  var useGetSelfEventRegistrationPurchase = (eventId, registrationId, purchaseId, options = {}) => {
4004
+ const { authenticated } = useConnectedXM();
3891
4005
  return useConnectedSingleQuery_default(
3892
4006
  SELF_EVENT_REGISTRATION_PURCHASE_QUERY_KEY(
3893
4007
  eventId,
@@ -3902,7 +4016,7 @@ var useGetSelfEventRegistrationPurchase = (eventId, registrationId, purchaseId,
3902
4016
  }),
3903
4017
  {
3904
4018
  ...options,
3905
- enabled: !!eventId && !!registrationId && !!purchaseId && (options?.enabled ?? true)
4019
+ enabled: !!authenticated && !!eventId && !!registrationId && !!purchaseId && (options?.enabled ?? true)
3906
4020
  }
3907
4021
  );
3908
4022
  };
@@ -3941,6 +4055,7 @@ var GetSelfEventRegistrationPurchaseSections = async ({
3941
4055
  return data;
3942
4056
  };
3943
4057
  var useGetSelfEventRegistrationPurchaseSections = (eventId, registrationId, purchaseId, options = {}) => {
4058
+ const { authenticated } = useConnectedXM();
3944
4059
  return useConnectedSingleQuery_default(
3945
4060
  SELF_EVENT_REGISTRATION_PURCHASE_SECTIONS_QUERY_KEY(
3946
4061
  eventId,
@@ -3958,7 +4073,7 @@ var useGetSelfEventRegistrationPurchaseSections = (eventId, registrationId, purc
3958
4073
  staleTime: Infinity,
3959
4074
  refetchOnMount: false,
3960
4075
  ...options,
3961
- enabled: !!eventId && !!registrationId && !!purchaseId && (options?.enabled ?? true)
4076
+ enabled: !!authenticated && !!eventId && !!registrationId && !!purchaseId && (options?.enabled ?? true)
3962
4077
  }
3963
4078
  );
3964
4079
  };
@@ -3997,6 +4112,7 @@ var GetSelfEventRegistrationPurchaseAddOns = async ({
3997
4112
  return data;
3998
4113
  };
3999
4114
  var useGetSelfEventRegistrationPurchaseAddOns = (eventId, registrationId, purchaseId, options = {}) => {
4115
+ const { authenticated } = useConnectedXM();
4000
4116
  return useConnectedSingleQuery_default(
4001
4117
  SELF_EVENT_REGISTRATION_PURCHASE_ADD_ONS_QUERY_KEY(
4002
4118
  eventId,
@@ -4011,7 +4127,7 @@ var useGetSelfEventRegistrationPurchaseAddOns = (eventId, registrationId, purcha
4011
4127
  }),
4012
4128
  {
4013
4129
  ...options,
4014
- enabled: !!eventId && !!registrationId && !!purchaseId && (options?.enabled ?? true)
4130
+ enabled: !!authenticated && !!eventId && !!registrationId && !!purchaseId && (options?.enabled ?? true)
4015
4131
  }
4016
4132
  );
4017
4133
  };
@@ -4052,6 +4168,7 @@ var GetSelfEventRegistrationPurchaseReservationSections = async ({
4052
4168
  return data;
4053
4169
  };
4054
4170
  var useGetSelfEventRegistrationPurchaseReservationSections = (eventId, registrationId, purchaseId, options = {}) => {
4171
+ const { authenticated } = useConnectedXM();
4055
4172
  return useConnectedSingleQuery_default(
4056
4173
  SELF_EVENT_REGISTRATION_PURCHASE_RESERVATION_SECTIONS_QUERY_KEY(
4057
4174
  eventId,
@@ -4066,7 +4183,7 @@ var useGetSelfEventRegistrationPurchaseReservationSections = (eventId, registrat
4066
4183
  }),
4067
4184
  {
4068
4185
  ...options,
4069
- enabled: !!eventId && !!registrationId && !!purchaseId && (options?.enabled ?? true)
4186
+ enabled: !!authenticated && !!eventId && !!registrationId && !!purchaseId && (options?.enabled ?? true)
4070
4187
  }
4071
4188
  );
4072
4189
  };
@@ -4094,6 +4211,7 @@ var GetSelfEventRegistrationStatus = async ({
4094
4211
  return data;
4095
4212
  };
4096
4213
  var useGetSelfEventRegistrationStatus = (eventId, selfId, options = {}) => {
4214
+ const { authenticated } = useConnectedXM();
4097
4215
  return useConnectedSingleQuery_default(
4098
4216
  SELF_EVENT_REGISTRATION_STATUS_QUERY_KEY(eventId),
4099
4217
  (params) => GetSelfEventRegistrationStatus({
@@ -4102,7 +4220,7 @@ var useGetSelfEventRegistrationStatus = (eventId, selfId, options = {}) => {
4102
4220
  }),
4103
4221
  {
4104
4222
  ...options,
4105
- enabled: !!eventId && !!selfId && (options?.enabled ?? true)
4223
+ enabled: !!authenticated && !!eventId && !!selfId && (options?.enabled ?? true)
4106
4224
  }
4107
4225
  );
4108
4226
  };
@@ -4146,13 +4264,14 @@ var GetSelfSubscriptions = async ({
4146
4264
  return data;
4147
4265
  };
4148
4266
  var useGetSelfSubscriptions = (status, params = {}, options = {}) => {
4267
+ const { authenticated } = useConnectedXM();
4149
4268
  return useConnectedInfiniteQuery(
4150
4269
  SELF_SUBSCRIPTIONS_QUERY_KEY(status),
4151
4270
  (params2) => GetSelfSubscriptions({ status, ...params2 }),
4152
4271
  params,
4153
4272
  {
4154
4273
  ...options,
4155
- enabled: options.enabled ?? true
4274
+ enabled: !!authenticated && (options?.enabled ?? true)
4156
4275
  }
4157
4276
  );
4158
4277
  };
@@ -4168,12 +4287,13 @@ var GetSelfSubcription = async ({
4168
4287
  return data;
4169
4288
  };
4170
4289
  var useGetSelfSubcription = (subscriptionId = "", options = {}) => {
4290
+ const { authenticated } = useConnectedXM();
4171
4291
  return useConnectedSingleQuery(
4172
4292
  SELF_SUBSCRIPTION_QUERY_KEY(subscriptionId),
4173
4293
  (params) => GetSelfSubcription({ subscriptionId, ...params }),
4174
4294
  {
4175
4295
  ...options,
4176
- enabled: !!subscriptionId && (options?.enabled ?? true)
4296
+ enabled: !!authenticated && !!subscriptionId && (options?.enabled ?? true)
4177
4297
  }
4178
4298
  );
4179
4299
  };
@@ -4203,13 +4323,69 @@ var GetSelfSubscriptionPayments = async ({
4203
4323
  return data;
4204
4324
  };
4205
4325
  var useGetSelfSubscriptionPayments = (subscriptionId, params = {}, options = {}) => {
4326
+ const { authenticated } = useConnectedXM();
4206
4327
  return useConnectedInfiniteQuery(
4207
4328
  SELF_SUBSCRIPTION_PAYMENTS_QUERY_KEY(subscriptionId),
4208
4329
  (params2) => GetSelfSubscriptionPayments({ ...params2, subscriptionId }),
4209
4330
  params,
4210
4331
  {
4211
4332
  ...options,
4212
- enabled: options.enabled ?? true
4333
+ enabled: !!authenticated && (options?.enabled ?? true)
4334
+ }
4335
+ );
4336
+ };
4337
+
4338
+ // src/queries/self/useGetSelfRelationships.ts
4339
+ var SELF_RELATIONSHIPS_QUERY_KEY = () => {
4340
+ const keys = [...SELF_QUERY_KEY(), "RELATIONSHIPS"];
4341
+ return keys;
4342
+ };
4343
+ var ADD_SELF_RELATIONSHIP = (client, baseKeys = ["en"], type, id, value = true) => {
4344
+ client.setQueryData(
4345
+ [...SELF_RELATIONSHIPS_QUERY_KEY(), ...GetBaseSingleQueryKeys(...baseKeys)],
4346
+ (prev) => ({
4347
+ ...prev,
4348
+ [type]: {
4349
+ ...prev?.[type],
4350
+ [id]: value
4351
+ }
4352
+ })
4353
+ );
4354
+ };
4355
+ var REMOVE_SELF_RELATIONSHIP = (client, baseKeys = ["en"], type, id, value = false) => {
4356
+ client.setQueryData(
4357
+ [...SELF_RELATIONSHIPS_QUERY_KEY(), ...GetBaseSingleQueryKeys(...baseKeys)],
4358
+ (prev) => ({
4359
+ ...prev,
4360
+ [type]: {
4361
+ ...prev?.[type],
4362
+ [id]: value
4363
+ }
4364
+ })
4365
+ );
4366
+ };
4367
+ var GetSelfRelationships = async ({
4368
+ clientApiParams
4369
+ }) => {
4370
+ const clientApi = await GetClientAPI({
4371
+ ...clientApiParams
4372
+ });
4373
+ const { data } = await clientApi.get(`/self/relationships`);
4374
+ return data;
4375
+ };
4376
+ var useGetSelfRelationships = (options = {}) => {
4377
+ const { authenticated } = useConnectedXM();
4378
+ return useConnectedSingleQuery(
4379
+ SELF_RELATIONSHIPS_QUERY_KEY(),
4380
+ (params) => GetSelfRelationships({ ...params }),
4381
+ {
4382
+ staleTime: 1e3 * 60 * 60,
4383
+ gcTime: 1e3 * 60 * 60,
4384
+ refetchOnMount: false,
4385
+ refetchOnWindowFocus: false,
4386
+ refetchOnReconnect: false,
4387
+ ...options,
4388
+ enabled: !!authenticated && (options?.enabled ?? true)
4213
4389
  }
4214
4390
  );
4215
4391
  };
@@ -4248,12 +4424,14 @@ var GetSelfActivities = async ({
4248
4424
  return data;
4249
4425
  };
4250
4426
  var useGetSelfActivities = (params = {}, options = {}) => {
4427
+ const { authenticated } = useConnectedXM();
4251
4428
  return useConnectedInfiniteQuery(
4252
4429
  SELF_ACTIVITIES_QUERY_KEY(),
4253
4430
  (params2) => GetSelfActivities({ ...params2 }),
4254
4431
  params,
4255
4432
  {
4256
- ...options
4433
+ ...options,
4434
+ enabled: !!authenticated && (options?.enabled ?? true)
4257
4435
  }
4258
4436
  );
4259
4437
  };
@@ -4269,12 +4447,13 @@ var GetSelfAnnouncement = async ({
4269
4447
  return data;
4270
4448
  };
4271
4449
  var useGetSelfAnnouncement = (announcementId, options = {}) => {
4450
+ const { authenticated } = useConnectedXM();
4272
4451
  return useConnectedSingleQuery(
4273
4452
  SELF_ANNOUNCEMENT_QUERY_KEY(announcementId),
4274
4453
  (params) => GetSelfAnnouncement({ announcementId, ...params }),
4275
4454
  {
4276
4455
  ...options,
4277
- enabled: !!announcementId && (options?.enabled ?? true)
4456
+ enabled: !!authenticated && !!announcementId && (options?.enabled ?? true)
4278
4457
  }
4279
4458
  );
4280
4459
  };
@@ -4303,12 +4482,14 @@ var GetSelfCommunityMemberships = async ({
4303
4482
  return data;
4304
4483
  };
4305
4484
  var useGetSelfCommunityMemberships = (params = {}, options = {}) => {
4485
+ const { authenticated } = useConnectedXM();
4306
4486
  return useConnectedInfiniteQuery(
4307
4487
  SELF_COMMUNITY_MEMBERSHIPS_QUERY_KEY(),
4308
4488
  (params2) => GetSelfCommunityMemberships({ ...params2 }),
4309
4489
  params,
4310
4490
  {
4311
- ...options
4491
+ ...options,
4492
+ enabled: !!authenticated && (options?.enabled ?? true)
4312
4493
  }
4313
4494
  );
4314
4495
  };
@@ -4335,12 +4516,13 @@ var GetSelfCommunityMembership = async ({
4335
4516
  return data;
4336
4517
  };
4337
4518
  var useGetSelfCommunityMembership = (communityId, options = {}) => {
4519
+ const { authenticated } = useConnectedXM();
4338
4520
  return useConnectedSingleQuery(
4339
4521
  SELF_COMMUNITY_MEMBERSHIP_QUERY_KEY(communityId),
4340
4522
  (params) => GetSelfCommunityMembership({ communityId, ...params }),
4341
4523
  {
4342
4524
  ...options,
4343
- enabled: !!communityId && (options?.enabled ?? true)
4525
+ enabled: !!authenticated && !!communityId && (options?.enabled ?? true)
4344
4526
  }
4345
4527
  );
4346
4528
  };
@@ -4379,12 +4561,14 @@ var GetSelfDelegateOf = async ({
4379
4561
  return data;
4380
4562
  };
4381
4563
  var useGetSelfDelegateOf = (params = {}, options = {}) => {
4564
+ const { authenticated } = useConnectedXM();
4382
4565
  return useConnectedInfiniteQuery(
4383
4566
  SELF_DELEGATE_OF_QUERY_KEY(),
4384
4567
  (params2) => GetSelfDelegateOf({ ...params2 }),
4385
4568
  params,
4386
4569
  {
4387
- ...options
4570
+ ...options,
4571
+ enabled: !!authenticated && (options?.enabled ?? true)
4388
4572
  }
4389
4573
  );
4390
4574
  };
@@ -4423,12 +4607,14 @@ var GetSelfDelegates = async ({
4423
4607
  return data;
4424
4608
  };
4425
4609
  var useGetSelfDelegates = (params = {}, options = {}) => {
4610
+ const { authenticated } = useConnectedXM();
4426
4611
  return useConnectedInfiniteQuery(
4427
4612
  SELF_DELEGATES_QUERY_KEY(),
4428
4613
  (params2) => GetSelfDelegates(params2),
4429
4614
  params,
4430
4615
  {
4431
- ...options
4616
+ ...options,
4617
+ enabled: !!authenticated && (options?.enabled ?? true)
4432
4618
  }
4433
4619
  );
4434
4620
  };
@@ -4470,12 +4656,14 @@ var GetSelfEvents = async ({
4470
4656
  return data;
4471
4657
  };
4472
4658
  var useGetSelfEvents = (past = false, params = {}, options = {}) => {
4659
+ const { authenticated } = useConnectedXM();
4473
4660
  return useConnectedInfiniteQuery(
4474
4661
  SELF_EVENTS_QUERY_KEY(past),
4475
4662
  (params2) => GetSelfEvents({ ...params2, past }),
4476
4663
  params,
4477
4664
  {
4478
- ...options
4665
+ ...options,
4666
+ enabled: !!authenticated && (options?.enabled ?? true)
4479
4667
  }
4480
4668
  );
4481
4669
  };
@@ -4517,13 +4705,14 @@ var GetSelfEventSessions = async ({
4517
4705
  return data;
4518
4706
  };
4519
4707
  var useGetSelfEventSessions = (eventId, params = {}, options = {}) => {
4708
+ const { authenticated } = useConnectedXM();
4520
4709
  return useConnectedInfiniteQuery(
4521
4710
  SELF_EVENT_SESSIONS_QUERY_KEY(eventId),
4522
4711
  (params2) => GetSelfEventSessions({ eventId, ...params2 }),
4523
4712
  params,
4524
4713
  {
4525
4714
  ...options,
4526
- enabled: !!eventId && (options.enabled ?? true)
4715
+ enabled: !!authenticated && !!eventId && (options?.enabled ?? true)
4527
4716
  }
4528
4717
  );
4529
4718
  };
@@ -4562,13 +4751,14 @@ var GetSelfFeed = async ({
4562
4751
  return data;
4563
4752
  };
4564
4753
  var useGetSelfFeed = (params = {}, options = {}) => {
4754
+ const { authenticated } = useConnectedXM();
4565
4755
  return useConnectedInfiniteQuery(
4566
4756
  SELF_FEED_QUERY_KEY(),
4567
4757
  (params2) => GetSelfFeed(params2),
4568
4758
  params,
4569
4759
  {
4570
4760
  ...options,
4571
- enabled: options.enabled ?? true
4761
+ enabled: !!authenticated && (options?.enabled ?? true)
4572
4762
  }
4573
4763
  );
4574
4764
  };
@@ -4597,12 +4787,14 @@ var GetSelfInterests = async ({
4597
4787
  return data;
4598
4788
  };
4599
4789
  var useGetSelfInterests = (params = {}, options = {}) => {
4790
+ const { authenticated } = useConnectedXM();
4600
4791
  return useConnectedInfiniteQuery(
4601
4792
  SELF_INTERESTS_QUERY_KEY(),
4602
4793
  (params2) => GetSelfInterests({ ...params2 }),
4603
4794
  params,
4604
4795
  {
4605
- ...options
4796
+ ...options,
4797
+ enabled: !!authenticated && (options?.enabled ?? true)
4606
4798
  }
4607
4799
  );
4608
4800
  };
@@ -4620,11 +4812,13 @@ var GetSelfNotificationPreferences = async ({
4620
4812
  return data;
4621
4813
  };
4622
4814
  var useGetSelfNotificationPreferences = (options = {}) => {
4815
+ const { authenticated } = useConnectedXM();
4623
4816
  return useConnectedSingleQuery(
4624
4817
  SELF_PREFERENCES_QUERY_KEY(),
4625
4818
  (params) => GetSelfNotificationPreferences({ ...params }),
4626
4819
  {
4627
- ...options
4820
+ ...options,
4821
+ enabled: authenticated && (options?.enabled ?? true)
4628
4822
  }
4629
4823
  );
4630
4824
  };
@@ -4656,13 +4850,15 @@ var GetSelfNotifications = async ({
4656
4850
  return data;
4657
4851
  };
4658
4852
  var useGetSelfNotifications = (filters = "", params = {}, options = {}) => {
4853
+ const { authenticated } = useConnectedXM();
4659
4854
  return useConnectedInfiniteQuery(
4660
4855
  SELF_NOTIFICATIONS_QUERY_KEY(filters),
4661
4856
  (params2) => GetSelfNotifications({ ...params2, filters }),
4662
4857
  params,
4663
4858
  {
4664
4859
  staleTime: 0,
4665
- ...options
4860
+ ...options,
4861
+ enabled: !!authenticated && (options?.enabled ?? true)
4666
4862
  }
4667
4863
  );
4668
4864
  };
@@ -4682,11 +4878,13 @@ var GetSelfNewNotificationsCount = async ({
4682
4878
  return data;
4683
4879
  };
4684
4880
  var useGetSelfNewNotificationsCount = (filters = "", options = {}) => {
4881
+ const { authenticated } = useConnectedXM();
4685
4882
  return useConnectedSingleQuery_default(
4686
4883
  SELF_NOTIFICATION_COUNT_QUERY_KEY(filters),
4687
4884
  (params) => GetSelfNewNotificationsCount({ filters, ...params }),
4688
4885
  {
4689
- ...options
4886
+ ...options,
4887
+ enabled: !!authenticated && (options?.enabled ?? true)
4690
4888
  }
4691
4889
  );
4692
4890
  };
@@ -4725,12 +4923,14 @@ var GetSelfPushDevices = async ({
4725
4923
  return data;
4726
4924
  };
4727
4925
  var useGetSelfPushDevices = (params = {}, options = {}) => {
4926
+ const { authenticated } = useConnectedXM();
4728
4927
  return useConnectedInfiniteQuery(
4729
4928
  SELF_PUSH_DEVICES_QUERY_KEY(),
4730
4929
  (params2) => GetSelfPushDevices({ ...params2 }),
4731
4930
  params,
4732
4931
  {
4733
- ...options
4932
+ ...options,
4933
+ enabled: !!authenticated && (options?.enabled ?? true)
4734
4934
  }
4735
4935
  );
4736
4936
  };
@@ -4758,12 +4958,13 @@ var GetSelfPushDevice = async ({
4758
4958
  return data;
4759
4959
  };
4760
4960
  var useGetSelfPushDevice = (pushDeviceId, options = {}) => {
4961
+ const { authenticated } = useConnectedXM();
4761
4962
  return useConnectedSingleQuery(
4762
4963
  SELF_PUSH_DEVICE_QUERY_KEY(pushDeviceId),
4763
4964
  (params) => GetSelfPushDevice({ pushDeviceId, ...params }),
4764
4965
  {
4765
4966
  ...options,
4766
- enabled: !!pushDeviceId && (options?.enabled ?? true)
4967
+ enabled: !!authenticated && !!pushDeviceId && (options?.enabled ?? true)
4767
4968
  }
4768
4969
  );
4769
4970
  };
@@ -4808,12 +5009,14 @@ var GetSelfRecommendations = async ({
4808
5009
  return data;
4809
5010
  };
4810
5011
  var useGetSelfRecommendations = (type, eventId = "", params = {}, options = {}) => {
5012
+ const { authenticated } = useConnectedXM();
4811
5013
  return useConnectedInfiniteQuery(
4812
5014
  SELF_RECOMMENDATIONS_QUERY_KEY(type, eventId),
4813
5015
  (params2) => GetSelfRecommendations({ ...params2, eventId, type }),
4814
5016
  params,
4815
5017
  {
4816
- ...options
5018
+ ...options,
5019
+ enabled: !!authenticated && (options?.enabled ?? true)
4817
5020
  }
4818
5021
  );
4819
5022
  };
@@ -4842,13 +5045,14 @@ var GetSelfTransfers = async ({
4842
5045
  return data;
4843
5046
  };
4844
5047
  var useGetSelfTransfers = (params = {}, options = {}) => {
5048
+ const { authenticated } = useConnectedXM();
4845
5049
  return useConnectedInfiniteQuery(
4846
5050
  SELF_TRANSFERS_QUERY_KEY(),
4847
5051
  (params2) => GetSelfTransfers({ ...params2 }),
4848
5052
  params,
4849
5053
  {
4850
5054
  ...options,
4851
- enabled: options.enabled ?? true
5055
+ enabled: !!authenticated && (options?.enabled ?? true)
4852
5056
  }
4853
5057
  );
4854
5058
  };
@@ -4864,12 +5068,13 @@ var GetSelfTransfer = async ({
4864
5068
  return data;
4865
5069
  };
4866
5070
  var useGetSelfTransfer = (transferId = "", options = {}) => {
5071
+ const { authenticated } = useConnectedXM();
4867
5072
  return useConnectedSingleQuery(
4868
5073
  SELF_PENDING_TRANSFER_QUERY_KEY(transferId),
4869
5074
  (params) => GetSelfTransfer({ ...params, transferId }),
4870
5075
  {
4871
5076
  ...options,
4872
- enabled: !!transferId && (options?.enabled ?? true)
5077
+ enabled: !!authenticated && !!transferId && (options?.enabled ?? true)
4873
5078
  }
4874
5079
  );
4875
5080
  };
@@ -5234,7 +5439,7 @@ var useGetSelfEventListings = (past = false, params = {}, options = {}) => {
5234
5439
  params,
5235
5440
  {
5236
5441
  ...options,
5237
- enabled: options.enabled ?? true
5442
+ enabled: options?.enabled ?? true
5238
5443
  }
5239
5444
  );
5240
5445
  };
@@ -5341,6 +5546,73 @@ var useGetSelfEventListingAnnouncement = (eventId = "", announcementId = "", opt
5341
5546
  );
5342
5547
  };
5343
5548
 
5549
+ // src/queries/listings/useGetListingEmail.ts
5550
+ var LISTING_EMAIL_QUERY_KEY = (eventId, type) => [...LISTING_QUERY_KEY(eventId), type];
5551
+ var SET_LISTING_EMAIL_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
5552
+ client.setQueryData(
5553
+ [
5554
+ ...LISTING_EMAIL_QUERY_KEY(...keyParams),
5555
+ ...GetBaseSingleQueryKeys(...baseKeys)
5556
+ ],
5557
+ response
5558
+ );
5559
+ };
5560
+ var GetSelfEventListingEmail = async ({
5561
+ eventId,
5562
+ type,
5563
+ clientApiParams
5564
+ }) => {
5565
+ const clientApi = await GetClientAPI(clientApiParams);
5566
+ const { data } = await clientApi.get(`/listings/${eventId}/emails/${type}`);
5567
+ return data;
5568
+ };
5569
+ var useGetSelfEventListingEmail = (eventId = "", type, options = {}) => {
5570
+ return useConnectedSingleQuery(
5571
+ LISTING_EMAIL_QUERY_KEY(eventId, type),
5572
+ (params) => GetSelfEventListingEmail({ eventId, type, ...params }),
5573
+ {
5574
+ ...options,
5575
+ enabled: !!eventId && !!type
5576
+ }
5577
+ );
5578
+ };
5579
+
5580
+ // src/queries/listings/useGetListingQuestions.ts
5581
+ var LISTING_QUESTIONS_QUERY_KEY = (eventId) => [
5582
+ ...LISTING_QUERY_KEY(eventId),
5583
+ "QUESTIONS"
5584
+ ];
5585
+ var GetSelfEventListingQuestions = async ({
5586
+ eventId,
5587
+ pageParam,
5588
+ pageSize,
5589
+ orderBy,
5590
+ search,
5591
+ clientApiParams
5592
+ }) => {
5593
+ const clientApi = await GetClientAPI(clientApiParams);
5594
+ const { data } = await clientApi.get(`/listings/${eventId}/questions`, {
5595
+ params: {
5596
+ page: pageParam || void 0,
5597
+ pageSize: pageSize || void 0,
5598
+ orderBy: orderBy || void 0,
5599
+ search: search || void 0
5600
+ }
5601
+ });
5602
+ return data;
5603
+ };
5604
+ var useGetSelfEventListingQuestions = (eventId, params = {}, options = {}) => {
5605
+ return useConnectedInfiniteQuery(
5606
+ LISTING_QUESTIONS_QUERY_KEY(eventId),
5607
+ (params2) => GetSelfEventListingQuestions({ eventId, ...params2 }),
5608
+ params,
5609
+ {
5610
+ ...options,
5611
+ enabled: !!eventId && (options?.enabled ?? true)
5612
+ }
5613
+ );
5614
+ };
5615
+
5344
5616
  // src/queries/listings/useGetListingRegistrations.ts
5345
5617
  var LISTING_REGISTRATIONS_QUERY_KEY = (eventId, status) => [...LISTING_QUERY_KEY(eventId), "REGISTRATIONS", status ?? "ALL"];
5346
5618
  var GetSelfEventListingRegistrations = async ({
@@ -5504,6 +5776,12 @@ var FollowAccount = async ({
5504
5776
  queryClient.invalidateQueries({
5505
5777
  queryKey: ACCOUNT_FOLLOWERS_QUERY_KEY(data.data.id)
5506
5778
  });
5779
+ ADD_SELF_RELATIONSHIP(
5780
+ queryClient,
5781
+ [clientApiParams.locale],
5782
+ "accounts",
5783
+ accountId
5784
+ );
5507
5785
  }
5508
5786
  return data;
5509
5787
  };
@@ -5531,6 +5809,12 @@ var UnfollowAccount = async ({
5531
5809
  queryClient.invalidateQueries({
5532
5810
  queryKey: ACCOUNT_FOLLOWERS_QUERY_KEY(data.data.id)
5533
5811
  });
5812
+ REMOVE_SELF_RELATIONSHIP(
5813
+ queryClient,
5814
+ [clientApiParams.locale],
5815
+ "accounts",
5816
+ accountId
5817
+ );
5534
5818
  }
5535
5819
  return data;
5536
5820
  };
@@ -6040,6 +6324,12 @@ var CaptureSelfEventRegistrationPayment = async ({
6040
6324
  queryClient.invalidateQueries({
6041
6325
  queryKey: SELF_EVENT_REGISTRATION_STATUS_QUERY_KEY(eventId)
6042
6326
  });
6327
+ ADD_SELF_RELATIONSHIP(
6328
+ queryClient,
6329
+ [clientApiParams.locale],
6330
+ "events",
6331
+ eventId
6332
+ );
6043
6333
  }
6044
6334
  return data;
6045
6335
  };
@@ -6176,6 +6466,12 @@ var SubmitSelfEventRegistration = async ({
6176
6466
  queryClient.invalidateQueries({
6177
6467
  queryKey: SELF_EVENT_REGISTRATION_STATUS_QUERY_KEY(eventId)
6178
6468
  });
6469
+ ADD_SELF_RELATIONSHIP(
6470
+ queryClient,
6471
+ [clientApiParams.locale],
6472
+ "events",
6473
+ eventId
6474
+ );
6179
6475
  }
6180
6476
  return data;
6181
6477
  };
@@ -7131,6 +7427,13 @@ var CreateCommunity = async ({
7131
7427
  queryClient.invalidateQueries({
7132
7428
  queryKey: COMMUNITIES_QUERY_KEY()
7133
7429
  });
7430
+ ADD_SELF_RELATIONSHIP(
7431
+ queryClient,
7432
+ [clientApiParams.locale],
7433
+ "communities",
7434
+ data.data.id,
7435
+ "moderator"
7436
+ );
7134
7437
  }
7135
7438
  return data;
7136
7439
  };
@@ -7248,6 +7551,13 @@ var JoinCommunity = async ({
7248
7551
  queryClient.invalidateQueries({
7249
7552
  queryKey: SELF_COMMUNITY_MEMBERSHIP_QUERY_KEY(communityId)
7250
7553
  });
7554
+ ADD_SELF_RELATIONSHIP(
7555
+ queryClient,
7556
+ [clientApiParams.locale],
7557
+ "communities",
7558
+ communityId,
7559
+ "member"
7560
+ );
7251
7561
  }
7252
7562
  return data;
7253
7563
  };
@@ -7278,6 +7588,12 @@ var LeaveCommunity = async ({
7278
7588
  queryClient.invalidateQueries({
7279
7589
  queryKey: SELF_COMMUNITY_MEMBERSHIP_QUERY_KEY(communityId)
7280
7590
  });
7591
+ REMOVE_SELF_RELATIONSHIP(
7592
+ queryClient,
7593
+ [clientApiParams.locale],
7594
+ "communities",
7595
+ communityId
7596
+ );
7281
7597
  }
7282
7598
  return data;
7283
7599
  };
@@ -7653,6 +7969,46 @@ var useCreateListingAnnouncement = (options = {}) => {
7653
7969
  return useConnectedMutation_default(CreateListingAnnouncement, options);
7654
7970
  };
7655
7971
 
7972
+ // src/mutations/listings/useCreateListingQuestion.ts
7973
+ var CreateListingQuestion = async ({
7974
+ eventId,
7975
+ question,
7976
+ clientApiParams,
7977
+ queryClient
7978
+ }) => {
7979
+ const clientApi = await GetClientAPI(clientApiParams);
7980
+ const { data } = await clientApi.post(`/listings/${eventId}/questions`, question);
7981
+ if (queryClient && data.status === "ok") {
7982
+ queryClient.invalidateQueries({
7983
+ queryKey: LISTING_QUESTIONS_QUERY_KEY(eventId)
7984
+ });
7985
+ }
7986
+ return data;
7987
+ };
7988
+ var useCreateListingQuestion = (options = {}) => {
7989
+ return useConnectedMutation_default(CreateListingQuestion, options);
7990
+ };
7991
+
7992
+ // src/mutations/listings/useDeleteListingQuestion.ts
7993
+ var DeleteListingQuestion = async ({
7994
+ eventId,
7995
+ questionId,
7996
+ clientApiParams,
7997
+ queryClient
7998
+ }) => {
7999
+ const clientApi = await GetClientAPI(clientApiParams);
8000
+ const { data } = await clientApi.delete(`/listings/${eventId}/questions/${questionId}`);
8001
+ if (queryClient && data.status === "ok") {
8002
+ queryClient.invalidateQueries({
8003
+ queryKey: LISTING_QUESTIONS_QUERY_KEY(eventId)
8004
+ });
8005
+ }
8006
+ return data;
8007
+ };
8008
+ var useDeleteListingQuestion = (options = {}) => {
8009
+ return useConnectedMutation_default(DeleteListingQuestion, options);
8010
+ };
8011
+
7656
8012
  // src/mutations/listings/useDeleteListingSession.ts
7657
8013
  var DeleteListingSession = async ({
7658
8014
  eventId,
@@ -7777,6 +8133,50 @@ var useUpdateListing = (options = {}) => {
7777
8133
  return useConnectedMutation_default(UpdateListing, options);
7778
8134
  };
7779
8135
 
8136
+ // src/mutations/listings/useUpdateListingEmail.ts
8137
+ var UpdateListingEmail = async ({
8138
+ eventId,
8139
+ type,
8140
+ email,
8141
+ clientApiParams,
8142
+ queryClient
8143
+ }) => {
8144
+ const clientApi = await GetClientAPI(clientApiParams);
8145
+ const { data } = await clientApi.put(
8146
+ `/listings/${eventId}/emails/${type}`,
8147
+ email
8148
+ );
8149
+ if (queryClient && data.status === "ok") {
8150
+ SET_LISTING_EMAIL_QUERY_DATA(queryClient, [eventId, type], data);
8151
+ }
8152
+ return data;
8153
+ };
8154
+ var useUpdateListingEmail = (options = {}) => {
8155
+ return useConnectedMutation_default(UpdateListingEmail, options);
8156
+ };
8157
+
8158
+ // src/mutations/listings/useUpdateListingQuestion.ts
8159
+ var UpdateListingQuestion = async ({
8160
+ eventId,
8161
+ question,
8162
+ questionId,
8163
+ clientApiParams,
8164
+ queryClient
8165
+ }) => {
8166
+ const clientApi = await GetClientAPI(clientApiParams);
8167
+ const { data } = await clientApi.put(`/listings/${eventId}/questions/${questionId}`, question);
8168
+ if (queryClient && data.status === "ok") {
8169
+ queryClient.invalidateQueries({
8170
+ queryKey: LISTING_QUESTIONS_QUERY_KEY(eventId),
8171
+ exact: false
8172
+ });
8173
+ }
8174
+ return data;
8175
+ };
8176
+ var useUpdateListingQuestion = (options = {}) => {
8177
+ return useConnectedMutation_default(UpdateListingQuestion, options);
8178
+ };
8179
+
7780
8180
  // src/mutations/listings/useUpdateListingSession.ts
7781
8181
  var UpdateListingSession = async ({
7782
8182
  eventId,
@@ -7846,6 +8246,7 @@ var useUpdateListingSpeaker = (options = {}) => {
7846
8246
  ACTIVITIES_QUERY_KEY,
7847
8247
  ACTIVITY_COMMENTS_QUERY_KEY,
7848
8248
  ACTIVITY_QUERY_KEY,
8249
+ ADD_SELF_RELATIONSHIP,
7849
8250
  ADVERTISEMENT_QUERY_KEY,
7850
8251
  AcceptCommunityInvitation,
7851
8252
  AcceptCommunityRequest,
@@ -7898,6 +8299,7 @@ var useUpdateListingSpeaker = (options = {}) => {
7898
8299
  CreateEventLead,
7899
8300
  CreateListing,
7900
8301
  CreateListingAnnouncement,
8302
+ CreateListingQuestion,
7901
8303
  CreateListingSession,
7902
8304
  CreateListingSpeaker,
7903
8305
  CreateSelfChatChannel,
@@ -7910,6 +8312,7 @@ var useUpdateListingSpeaker = (options = {}) => {
7910
8312
  DeleteActivity,
7911
8313
  DeleteCommunityInvitation,
7912
8314
  DeleteListing,
8315
+ DeleteListingQuestion,
7913
8316
  DeleteListingSession,
7914
8317
  DeleteListingSpeaker,
7915
8318
  DeleteReshare,
@@ -7936,6 +8339,7 @@ var useUpdateListingSpeaker = (options = {}) => {
7936
8339
  EVENT_SPEAKER_QUERY_KEY,
7937
8340
  EVENT_SPONSORS_QUERY_KEY,
7938
8341
  EVENT_TICKETS_QUERY_KEY,
8342
+ EventEmailType,
7939
8343
  EventSource,
7940
8344
  EventType,
7941
8345
  FollowAccount,
@@ -8014,6 +8418,8 @@ var useUpdateListingSpeaker = (options = {}) => {
8014
8418
  GetSelfEventListing,
8015
8419
  GetSelfEventListingAnnouncement,
8016
8420
  GetSelfEventListingAnnouncements,
8421
+ GetSelfEventListingEmail,
8422
+ GetSelfEventListingQuestions,
8017
8423
  GetSelfEventListingRegistration,
8018
8424
  GetSelfEventListingRegistrations,
8019
8425
  GetSelfEventListings,
@@ -8034,6 +8440,7 @@ var useUpdateListingSpeaker = (options = {}) => {
8034
8440
  GetSelfPushDevice,
8035
8441
  GetSelfPushDevices,
8036
8442
  GetSelfRecommendations,
8443
+ GetSelfRelationships,
8037
8444
  GetSelfSubcription,
8038
8445
  GetSelfSubscriptionPayments,
8039
8446
  GetSelfSubscriptions,
@@ -8055,7 +8462,9 @@ var useUpdateListingSpeaker = (options = {}) => {
8055
8462
  LISTINGS_QUERY_KEY,
8056
8463
  LISTING_ANNOUNCEMENTS_QUERY_KEY,
8057
8464
  LISTING_ANNOUNCEMENT_QUERY_KEY,
8465
+ LISTING_EMAIL_QUERY_KEY,
8058
8466
  LISTING_QUERY_KEY,
8467
+ LISTING_QUESTIONS_QUERY_KEY,
8059
8468
  LISTING_REGISTRATIONS_QUERY_KEY,
8060
8469
  LISTING_REGISTRATION_QUERY_KEY,
8061
8470
  LeaveCommunity,
@@ -8071,6 +8480,7 @@ var useUpdateListingSpeaker = (options = {}) => {
8071
8480
  PromoteCommunityMember,
8072
8481
  PushDeviceAppType,
8073
8482
  PushService,
8483
+ REMOVE_SELF_RELATIONSHIP,
8074
8484
  RegisterCancelledEventRegistration,
8075
8485
  RegistrationQuestionType,
8076
8486
  RegistrationStatus,
@@ -8114,6 +8524,7 @@ var useUpdateListingSpeaker = (options = {}) => {
8114
8524
  SELF_PUSH_DEVICE_QUERY_KEY,
8115
8525
  SELF_QUERY_KEY,
8116
8526
  SELF_RECOMMENDATIONS_QUERY_KEY,
8527
+ SELF_RELATIONSHIPS_QUERY_KEY,
8117
8528
  SELF_SUBSCRIPTIONS_QUERY_KEY,
8118
8529
  SELF_SUBSCRIPTION_PAYMENTS_QUERY_KEY,
8119
8530
  SELF_SUBSCRIPTION_QUERY_KEY,
@@ -8172,6 +8583,7 @@ var useUpdateListingSpeaker = (options = {}) => {
8172
8583
  SET_LEVEL_QUERY_DATA,
8173
8584
  SET_LEVEL_SPONSORS_QUERY_DATA,
8174
8585
  SET_LISTING_ANNOUNCEMENT_QUERY_KEY,
8586
+ SET_LISTING_EMAIL_QUERY_DATA,
8175
8587
  SET_LISTING_QUERY_DATA,
8176
8588
  SET_LISTING_REGISTRATION_QUERY_KEY,
8177
8589
  SET_ORGANIZATION_PAGE_QUERY_DATA,
@@ -8209,6 +8621,8 @@ var useUpdateListingSpeaker = (options = {}) => {
8209
8621
  UnlikeActivity,
8210
8622
  UpdateCommunity,
8211
8623
  UpdateListing,
8624
+ UpdateListingEmail,
8625
+ UpdateListingQuestion,
8212
8626
  UpdateListingSession,
8213
8627
  UpdateListingSpeaker,
8214
8628
  UpdateSelf,
@@ -8257,6 +8671,7 @@ var useUpdateListingSpeaker = (options = {}) => {
8257
8671
  isTypeTicket,
8258
8672
  isTypeTrack,
8259
8673
  isTypeTransfer,
8674
+ isUUID,
8260
8675
  setFirstPageData,
8261
8676
  useAcceptCommunityInvitation,
8262
8677
  useAcceptCommunityRequest,
@@ -8285,6 +8700,7 @@ var useUpdateListingSpeaker = (options = {}) => {
8285
8700
  useCreateEventLead,
8286
8701
  useCreateListing,
8287
8702
  useCreateListingAnnouncement,
8703
+ useCreateListingQuestion,
8288
8704
  useCreateListingSession,
8289
8705
  useCreateListingSpeaker,
8290
8706
  useCreateSelfChatChannel,
@@ -8296,6 +8712,7 @@ var useUpdateListingSpeaker = (options = {}) => {
8296
8712
  useDeleteActivity,
8297
8713
  useDeleteCommunityInvitation,
8298
8714
  useDeleteListing,
8715
+ useDeleteListingQuestion,
8299
8716
  useDeleteListingSession,
8300
8717
  useDeleteListingSpeaker,
8301
8718
  useDeleteReshare,
@@ -8376,6 +8793,8 @@ var useUpdateListingSpeaker = (options = {}) => {
8376
8793
  useGetSelfEventListing,
8377
8794
  useGetSelfEventListingAnnouncement,
8378
8795
  useGetSelfEventListingAnnouncements,
8796
+ useGetSelfEventListingEmail,
8797
+ useGetSelfEventListingQuestions,
8379
8798
  useGetSelfEventListingRegistration,
8380
8799
  useGetSelfEventListings,
8381
8800
  useGetSelfEventListingsRegistrations,
@@ -8396,6 +8815,7 @@ var useUpdateListingSpeaker = (options = {}) => {
8396
8815
  useGetSelfPushDevice,
8397
8816
  useGetSelfPushDevices,
8398
8817
  useGetSelfRecommendations,
8818
+ useGetSelfRelationships,
8399
8819
  useGetSelfSubcription,
8400
8820
  useGetSelfSubscriptionPayments,
8401
8821
  useGetSelfSubscriptions,
@@ -8406,6 +8826,10 @@ var useUpdateListingSpeaker = (options = {}) => {
8406
8826
  useGetSeriesList,
8407
8827
  useGetSponsor,
8408
8828
  useGetSponsors,
8829
+ useIsAccountFollowing,
8830
+ useIsChannelSubscribed,
8831
+ useIsCommunityMember,
8832
+ useIsEventRegistered,
8409
8833
  useJoinCommunity,
8410
8834
  useLeaveCommunity,
8411
8835
  useLeaveSelfChatChannel,
@@ -8433,6 +8857,8 @@ var useUpdateListingSpeaker = (options = {}) => {
8433
8857
  useUnlikeActivity,
8434
8858
  useUpdateCommunity,
8435
8859
  useUpdateListing,
8860
+ useUpdateListingEmail,
8861
+ useUpdateListingQuestion,
8436
8862
  useUpdateListingSession,
8437
8863
  useUpdateListingSpeaker,
8438
8864
  useUpdateSelf,