@connectedxm/client 0.0.78 → 0.0.79

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.d.mts CHANGED
@@ -1093,6 +1093,8 @@ interface BaseVideo {
1093
1093
  thumbnailUrl: string;
1094
1094
  previewUrl: string;
1095
1095
  readyToStream: string;
1096
+ hlsUrl: string;
1097
+ dashUrl: string;
1096
1098
  }
1097
1099
  declare enum SubscriptionStatus {
1098
1100
  active = "active",
@@ -1154,6 +1156,7 @@ interface ConnectedXMClientContextState {
1154
1156
  queryClient: QueryClient;
1155
1157
  organizationId: string;
1156
1158
  apiUrl: "https://client-api.connectedxm.com" | "https://staging-client-api.connectedxm.com" | "http://localhost:4001";
1159
+ authenticated: boolean;
1157
1160
  getToken: () => Promise<string | undefined> | string | undefined;
1158
1161
  getExecuteAs?: () => Promise<string | undefined> | string | undefined;
1159
1162
  locale: string;
@@ -1164,7 +1167,7 @@ interface ConnectedXMClientContextState {
1164
1167
  interface ConnectedXMProviderProps extends Omit<ConnectedXMClientContextState, "token" | "setToken" | "executeAs" | "setExecuteAs"> {
1165
1168
  children: React.ReactNode;
1166
1169
  }
1167
- declare const ConnectedXMProvider: ({ queryClient, children, ...state }: ConnectedXMProviderProps) => React.JSX.Element;
1170
+ declare const ConnectedXMProvider: ({ queryClient, authenticated, children, ...state }: ConnectedXMProviderProps) => React.JSX.Element;
1168
1171
 
1169
1172
  declare const useConnectedXM: () => Omit<ConnectedXMClientContextState, "queryClient">;
1170
1173
 
@@ -1687,13 +1690,13 @@ interface GetSelfSubscriptionPaymentsProps extends InfiniteQueryParams {
1687
1690
  declare const GetSelfSubscriptionPayments: ({ subscriptionId, pageParam, pageSize, orderBy, search, clientApiParams, }: GetSelfSubscriptionPaymentsProps) => Promise<ConnectedXMResponse<Payment[]>>;
1688
1691
  declare const useGetSelfSubscriptionPayments: (subscriptionId: string, params?: Omit<InfiniteQueryParams, "pageParam" | "queryClient" | "clientApiParams">, options?: InfiniteQueryOptions<Awaited<ReturnType<typeof GetSelfSubscriptionPayments>>>) => _tanstack_react_query_build_legacy_types.UseInfiniteQueryResult<_tanstack_query_core_build_legacy_queryClient_Ho_z40Sw.B<ConnectedXMResponse<Payment[]>, number>, axios.AxiosError<ConnectedXMResponse<null>, any>>;
1689
1692
 
1690
- declare const SELF_QUERY_KEY: (authenticated?: boolean) => QueryKey;
1693
+ declare const SELF_QUERY_KEY: (ignoreExecuteAs?: boolean) => QueryKey;
1691
1694
  declare const SET_SELF_QUERY_DATA: (client: QueryClient, keyParams: Parameters<typeof SELF_QUERY_KEY>, response: Awaited<ReturnType<typeof GetSelf>>, baseKeys?: Parameters<typeof GetBaseSingleQueryKeys>) => void;
1692
1695
  interface GetSelfProps extends SingleQueryParams {
1693
- authenticated?: boolean;
1696
+ ignoreExecuteAs?: boolean;
1694
1697
  }
1695
- declare const GetSelf: ({ authenticated, clientApiParams, }: GetSelfProps) => Promise<ConnectedXMResponse<Self>>;
1696
- declare const useGetSelf: (authenticated?: boolean, options?: SingleQueryOptions<ReturnType<typeof GetSelf>>) => _tanstack_react_query_build_legacy_types.UseQueryResult<ConnectedXMResponse<Self>, axios.AxiosError<ConnectedXMResponse<any>, any>>;
1698
+ declare const GetSelf: ({ ignoreExecuteAs, clientApiParams, }: GetSelfProps) => Promise<ConnectedXMResponse<Self>>;
1699
+ declare const useGetSelf: (ignoreExecuteAs?: boolean, options?: SingleQueryOptions<ReturnType<typeof GetSelf>>) => _tanstack_react_query_build_legacy_types.UseQueryResult<ConnectedXMResponse<Self>, axios.AxiosError<ConnectedXMResponse<any>, any>>;
1697
1700
 
1698
1701
  declare const SELF_ACTIVITIES_QUERY_KEY: () => QueryKey;
1699
1702
  interface GetSelfActivitiesProps extends InfiniteQueryParams {
package/dist/index.d.ts CHANGED
@@ -1093,6 +1093,8 @@ interface BaseVideo {
1093
1093
  thumbnailUrl: string;
1094
1094
  previewUrl: string;
1095
1095
  readyToStream: string;
1096
+ hlsUrl: string;
1097
+ dashUrl: string;
1096
1098
  }
1097
1099
  declare enum SubscriptionStatus {
1098
1100
  active = "active",
@@ -1154,6 +1156,7 @@ interface ConnectedXMClientContextState {
1154
1156
  queryClient: QueryClient;
1155
1157
  organizationId: string;
1156
1158
  apiUrl: "https://client-api.connectedxm.com" | "https://staging-client-api.connectedxm.com" | "http://localhost:4001";
1159
+ authenticated: boolean;
1157
1160
  getToken: () => Promise<string | undefined> | string | undefined;
1158
1161
  getExecuteAs?: () => Promise<string | undefined> | string | undefined;
1159
1162
  locale: string;
@@ -1164,7 +1167,7 @@ interface ConnectedXMClientContextState {
1164
1167
  interface ConnectedXMProviderProps extends Omit<ConnectedXMClientContextState, "token" | "setToken" | "executeAs" | "setExecuteAs"> {
1165
1168
  children: React.ReactNode;
1166
1169
  }
1167
- declare const ConnectedXMProvider: ({ queryClient, children, ...state }: ConnectedXMProviderProps) => React.JSX.Element;
1170
+ declare const ConnectedXMProvider: ({ queryClient, authenticated, children, ...state }: ConnectedXMProviderProps) => React.JSX.Element;
1168
1171
 
1169
1172
  declare const useConnectedXM: () => Omit<ConnectedXMClientContextState, "queryClient">;
1170
1173
 
@@ -1687,13 +1690,13 @@ interface GetSelfSubscriptionPaymentsProps extends InfiniteQueryParams {
1687
1690
  declare const GetSelfSubscriptionPayments: ({ subscriptionId, pageParam, pageSize, orderBy, search, clientApiParams, }: GetSelfSubscriptionPaymentsProps) => Promise<ConnectedXMResponse<Payment[]>>;
1688
1691
  declare const useGetSelfSubscriptionPayments: (subscriptionId: string, params?: Omit<InfiniteQueryParams, "pageParam" | "queryClient" | "clientApiParams">, options?: InfiniteQueryOptions<Awaited<ReturnType<typeof GetSelfSubscriptionPayments>>>) => _tanstack_react_query_build_legacy_types.UseInfiniteQueryResult<_tanstack_query_core_build_legacy_queryClient_Ho_z40Sw.B<ConnectedXMResponse<Payment[]>, number>, axios.AxiosError<ConnectedXMResponse<null>, any>>;
1689
1692
 
1690
- declare const SELF_QUERY_KEY: (authenticated?: boolean) => QueryKey;
1693
+ declare const SELF_QUERY_KEY: (ignoreExecuteAs?: boolean) => QueryKey;
1691
1694
  declare const SET_SELF_QUERY_DATA: (client: QueryClient, keyParams: Parameters<typeof SELF_QUERY_KEY>, response: Awaited<ReturnType<typeof GetSelf>>, baseKeys?: Parameters<typeof GetBaseSingleQueryKeys>) => void;
1692
1695
  interface GetSelfProps extends SingleQueryParams {
1693
- authenticated?: boolean;
1696
+ ignoreExecuteAs?: boolean;
1694
1697
  }
1695
- declare const GetSelf: ({ authenticated, clientApiParams, }: GetSelfProps) => Promise<ConnectedXMResponse<Self>>;
1696
- declare const useGetSelf: (authenticated?: boolean, options?: SingleQueryOptions<ReturnType<typeof GetSelf>>) => _tanstack_react_query_build_legacy_types.UseQueryResult<ConnectedXMResponse<Self>, axios.AxiosError<ConnectedXMResponse<any>, any>>;
1698
+ declare const GetSelf: ({ ignoreExecuteAs, clientApiParams, }: GetSelfProps) => Promise<ConnectedXMResponse<Self>>;
1699
+ declare const useGetSelf: (ignoreExecuteAs?: boolean, options?: SingleQueryOptions<ReturnType<typeof GetSelf>>) => _tanstack_react_query_build_legacy_types.UseQueryResult<ConnectedXMResponse<Self>, axios.AxiosError<ConnectedXMResponse<any>, any>>;
1697
1700
 
1698
1701
  declare const SELF_ACTIVITIES_QUERY_KEY: () => QueryKey;
1699
1702
  interface GetSelfActivitiesProps extends InfiniteQueryParams {
package/dist/index.js CHANGED
@@ -571,6 +571,7 @@ var import_react_query = require("@tanstack/react-query");
571
571
  var ConnectedXMClientContext = import_react.default.createContext({});
572
572
  var ConnectedXMProvider = ({
573
573
  queryClient,
574
+ authenticated = true,
574
575
  children,
575
576
  ...state
576
577
  }) => {
@@ -579,7 +580,16 @@ var ConnectedXMProvider = ({
579
580
  setSSR(false);
580
581
  }, []);
581
582
  const render = () => {
582
- return /* @__PURE__ */ import_react.default.createElement(ConnectedXMClientContext.Provider, { value: state }, children);
583
+ return /* @__PURE__ */ import_react.default.createElement(
584
+ ConnectedXMClientContext.Provider,
585
+ {
586
+ value: {
587
+ ...state,
588
+ authenticated
589
+ }
590
+ },
591
+ children
592
+ );
583
593
  };
584
594
  if (ssr)
585
595
  return /* @__PURE__ */ import_react.default.createElement(import_react_query.QueryClientProvider, { client: queryClient }, render());
@@ -3347,12 +3357,14 @@ var GetSelfChatChannels = async ({
3347
3357
  return data;
3348
3358
  };
3349
3359
  var useGetSelfChatChannels = (params = {}, options = {}) => {
3360
+ const { authenticated } = useConnectedXM();
3350
3361
  return useConnectedInfiniteQuery(
3351
3362
  SELF_CHAT_CHANNELS_QUERY_KEY(),
3352
3363
  (params2) => GetSelfChatChannels(params2),
3353
3364
  params,
3354
3365
  {
3355
- ...options
3366
+ ...options,
3367
+ enabled: !!authenticated && (options.enabled ?? true)
3356
3368
  }
3357
3369
  );
3358
3370
  };
@@ -3380,6 +3392,7 @@ var GetSelfChatChannel = async ({
3380
3392
  return data;
3381
3393
  };
3382
3394
  var useGetSelfChatChannel = (channelId, options = {}) => {
3395
+ const { authenticated } = useConnectedXM();
3383
3396
  return useConnectedSingleQuery(
3384
3397
  SELF_CHAT_CHANNEL_QUERY_KEY(channelId),
3385
3398
  (params) => GetSelfChatChannel({
@@ -3389,7 +3402,7 @@ var useGetSelfChatChannel = (channelId, options = {}) => {
3389
3402
  {
3390
3403
  staleTime: Infinity,
3391
3404
  ...options,
3392
- enabled: !!channelId && (options?.enabled ?? true)
3405
+ enabled: !!authenticated && !!channelId && (options?.enabled ?? true)
3393
3406
  }
3394
3407
  );
3395
3408
  };
@@ -3428,13 +3441,14 @@ var GetSelfChatChannelMembers = async ({
3428
3441
  return data;
3429
3442
  };
3430
3443
  var useGetSelfChatChannelMembers = (channelId, params = {}, options = {}) => {
3444
+ const { authenticated } = useConnectedXM();
3431
3445
  return useConnectedInfiniteQuery(
3432
3446
  SELF_CHAT_CHANNEL_MEMBERS_QUERY_KEY(channelId),
3433
3447
  (params2) => GetSelfChatChannelMembers({ ...params2, channelId }),
3434
3448
  params,
3435
3449
  {
3436
3450
  ...options,
3437
- enabled: !!channelId && (options?.enabled ?? true)
3451
+ enabled: !!authenticated && !!channelId && (options?.enabled ?? true)
3438
3452
  }
3439
3453
  );
3440
3454
  };
@@ -3483,22 +3497,23 @@ var GetSelfChatChannelMessages = async ({
3483
3497
  return data;
3484
3498
  };
3485
3499
  var useGetSelfChatChannelMessages = (channelId, params = {}, options = {}) => {
3500
+ const { authenticated } = useConnectedXM();
3486
3501
  return useConnectedInfiniteQuery(
3487
3502
  SELF_CHAT_CHANNEL_MESSAGES_QUERY_KEY(channelId),
3488
3503
  (params2) => GetSelfChatChannelMessages({ ...params2, channelId }),
3489
3504
  params,
3490
3505
  {
3491
3506
  ...options,
3492
- enabled: !!channelId && (options?.enabled ?? true)
3507
+ enabled: !!authenticated && !!channelId && (options?.enabled ?? true)
3493
3508
  }
3494
3509
  );
3495
3510
  };
3496
3511
 
3497
3512
  // src/queries/self/useGetSelf.ts
3498
- var SELF_QUERY_KEY = (authenticated) => {
3513
+ var SELF_QUERY_KEY = (ignoreExecuteAs) => {
3499
3514
  const keys = ["SELF"];
3500
- if (authenticated)
3501
- keys.push("AUTHENTICATED");
3515
+ if (ignoreExecuteAs)
3516
+ keys.push("IGNORE_EXECUTEAS");
3502
3517
  return keys;
3503
3518
  };
3504
3519
  var SET_SELF_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
@@ -3508,22 +3523,24 @@ var SET_SELF_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
3508
3523
  );
3509
3524
  };
3510
3525
  var GetSelf = async ({
3511
- authenticated,
3526
+ ignoreExecuteAs,
3512
3527
  clientApiParams
3513
3528
  }) => {
3514
3529
  const clientApi = await GetClientAPI({
3515
3530
  ...clientApiParams,
3516
- getExecuteAs: authenticated ? void 0 : clientApiParams.getExecuteAs
3531
+ getExecuteAs: ignoreExecuteAs ? void 0 : clientApiParams.getExecuteAs
3517
3532
  });
3518
3533
  const { data } = await clientApi.get(`/self`);
3519
3534
  return data;
3520
3535
  };
3521
- var useGetSelf = (authenticated, options = {}) => {
3536
+ var useGetSelf = (ignoreExecuteAs, options = {}) => {
3537
+ const { authenticated } = useConnectedXM();
3522
3538
  return useConnectedSingleQuery(
3523
- SELF_QUERY_KEY(authenticated),
3524
- (params) => GetSelf({ authenticated, ...params }),
3539
+ SELF_QUERY_KEY(ignoreExecuteAs),
3540
+ (params) => GetSelf({ ignoreExecuteAs, ...params }),
3525
3541
  {
3526
- ...options
3542
+ ...options,
3543
+ enabled: authenticated && (options.enabled ?? true)
3527
3544
  }
3528
3545
  );
3529
3546
  };
@@ -3557,6 +3574,7 @@ var GetSelfEventRegistration = async ({
3557
3574
  return data;
3558
3575
  };
3559
3576
  var useGetSelfEventRegistration = (eventId, ticket, quantity, coupon, options = {}) => {
3577
+ const { authenticated } = useConnectedXM();
3560
3578
  return useConnectedSingleQuery_default(
3561
3579
  SELF_EVENT_REGISTRATION_QUERY_KEY(eventId),
3562
3580
  (params) => GetSelfEventRegistration({
@@ -3571,7 +3589,7 @@ var useGetSelfEventRegistration = (eventId, ticket, quantity, coupon, options =
3571
3589
  staleTime: Infinity,
3572
3590
  refetchOnMount: false,
3573
3591
  ...options,
3574
- enabled: !!eventId && (options?.enabled ?? true)
3592
+ enabled: !!authenticated && !!eventId && (options?.enabled ?? true)
3575
3593
  }
3576
3594
  );
3577
3595
  };
@@ -3594,6 +3612,7 @@ var GetSelfEventRegistrationCheckout = async ({
3594
3612
  return data;
3595
3613
  };
3596
3614
  var useGetSelfEventRegistrationCheckout = (eventId, registrationId = "", options = {}) => {
3615
+ const { authenticated } = useConnectedXM();
3597
3616
  return useConnectedSingleQuery_default(
3598
3617
  SELF_EVENT_REGISTRATION_CHECKOUT_QUERY_KEY(eventId, registrationId),
3599
3618
  (params) => GetSelfEventRegistrationCheckout({ eventId, registrationId, ...params }),
@@ -3602,7 +3621,7 @@ var useGetSelfEventRegistrationCheckout = (eventId, registrationId = "", options
3602
3621
  retry: false,
3603
3622
  retryOnMount: false,
3604
3623
  ...options,
3605
- enabled: !!eventId && !!registrationId
3624
+ enabled: !!authenticated && !!eventId && !!registrationId && (options.enabled ?? true)
3606
3625
  }
3607
3626
  );
3608
3627
  };
@@ -3646,12 +3665,14 @@ var GetSelfSubscriptions = async ({
3646
3665
  return data;
3647
3666
  };
3648
3667
  var useGetSelfSubscriptions = (status, params = {}, options = {}) => {
3668
+ const { authenticated } = useConnectedXM();
3649
3669
  return useConnectedInfiniteQuery(
3650
3670
  SELF_SUBSCRIPTIONS_QUERY_KEY(status),
3651
3671
  (params2) => GetSelfSubscriptions({ status, ...params2 }),
3652
3672
  params,
3653
3673
  {
3654
- ...options
3674
+ ...options,
3675
+ enabled: !!authenticated && (options.enabled ?? true)
3655
3676
  }
3656
3677
  );
3657
3678
  };
@@ -3667,12 +3688,13 @@ var GetSelfSubcription = async ({
3667
3688
  return data;
3668
3689
  };
3669
3690
  var useGetSelfSubcription = (subscriptionId = "", options = {}) => {
3691
+ const { authenticated } = useConnectedXM();
3670
3692
  return useConnectedSingleQuery(
3671
3693
  SELF_SUBSCRIPTION_QUERY_KEY(subscriptionId),
3672
3694
  (params) => GetSelfSubcription({ subscriptionId, ...params }),
3673
3695
  {
3674
3696
  ...options,
3675
- enabled: !!subscriptionId
3697
+ enabled: !!authenticated && !!subscriptionId && (options?.enabled ?? true)
3676
3698
  }
3677
3699
  );
3678
3700
  };
@@ -3702,12 +3724,14 @@ var GetSelfSubscriptionPayments = async ({
3702
3724
  return data;
3703
3725
  };
3704
3726
  var useGetSelfSubscriptionPayments = (subscriptionId, params = {}, options = {}) => {
3727
+ const { authenticated } = useConnectedXM();
3705
3728
  return useConnectedInfiniteQuery(
3706
3729
  SELF_SUBSCRIPTION_PAYMENTS_QUERY_KEY(subscriptionId),
3707
3730
  (params2) => GetSelfSubscriptionPayments({ ...params2, subscriptionId }),
3708
3731
  params,
3709
3732
  {
3710
- ...options
3733
+ ...options,
3734
+ enabled: !!authenticated && (options.enabled ?? true)
3711
3735
  }
3712
3736
  );
3713
3737
  };
@@ -3746,13 +3770,14 @@ var GetSelfActivities = async ({
3746
3770
  return data;
3747
3771
  };
3748
3772
  var useGetSelfActivities = (params = {}, options = {}) => {
3773
+ const { authenticated } = useConnectedXM();
3749
3774
  return useConnectedInfiniteQuery(
3750
3775
  SELF_ACTIVITIES_QUERY_KEY(),
3751
3776
  (params2) => GetSelfActivities({ ...params2 }),
3752
3777
  params,
3753
3778
  {
3754
3779
  ...options,
3755
- enabled: options.enabled ?? true
3780
+ enabled: !!authenticated && (options.enabled ?? true)
3756
3781
  }
3757
3782
  );
3758
3783
  };
@@ -3768,12 +3793,13 @@ var GetSelfAnnouncement = async ({
3768
3793
  return data;
3769
3794
  };
3770
3795
  var useGetSelfAnnouncement = (announcementId, options = {}) => {
3796
+ const { authenticated } = useConnectedXM();
3771
3797
  return useConnectedSingleQuery(
3772
3798
  SELF_ANNOUNCEMENT_QUERY_KEY(announcementId),
3773
3799
  (params) => GetSelfAnnouncement({ announcementId, ...params }),
3774
3800
  {
3775
3801
  ...options,
3776
- enabled: !!announcementId && (options?.enabled ?? true)
3802
+ enabled: !!authenticated && !!announcementId && (options?.enabled ?? true)
3777
3803
  }
3778
3804
  );
3779
3805
  };
@@ -3802,12 +3828,14 @@ var GetSelfCommunityMemberships = async ({
3802
3828
  return data;
3803
3829
  };
3804
3830
  var useGetSelfCommunityMemberships = (params = {}, options = {}) => {
3831
+ const { authenticated } = useConnectedXM();
3805
3832
  return useConnectedInfiniteQuery(
3806
3833
  SELF_COMMUNITY_MEMBERSHIPS_QUERY_KEY(),
3807
3834
  (params2) => GetSelfCommunityMemberships({ ...params2 }),
3808
3835
  params,
3809
3836
  {
3810
- ...options
3837
+ ...options,
3838
+ enabled: !!authenticated && (options.enabled ?? true)
3811
3839
  }
3812
3840
  );
3813
3841
  };
@@ -3834,12 +3862,13 @@ var GetSelfCommunityMembership = async ({
3834
3862
  return data;
3835
3863
  };
3836
3864
  var useGetSelfCommunityMembership = (communityId, options = {}) => {
3865
+ const { authenticated } = useConnectedXM();
3837
3866
  return useConnectedSingleQuery(
3838
3867
  SELF_COMMUNITY_MEMBERSHIP_QUERY_KEY(communityId),
3839
3868
  (params) => GetSelfCommunityMembership({ communityId, ...params }),
3840
3869
  {
3841
3870
  ...options,
3842
- enabled: !!communityId && (options?.enabled ?? true)
3871
+ enabled: !!authenticated && !!communityId && (options?.enabled ?? true)
3843
3872
  }
3844
3873
  );
3845
3874
  };
@@ -3878,12 +3907,14 @@ var GetSelfDelegateOf = async ({
3878
3907
  return data;
3879
3908
  };
3880
3909
  var useGetSelfDelegateOf = (params = {}, options = {}) => {
3910
+ const { authenticated } = useConnectedXM();
3881
3911
  return useConnectedInfiniteQuery(
3882
3912
  SELF_DELEGATE_OF_QUERY_KEY(),
3883
3913
  (params2) => GetSelfDelegateOf({ ...params2 }),
3884
3914
  params,
3885
3915
  {
3886
- ...options
3916
+ ...options,
3917
+ enabled: !!authenticated && (options.enabled ?? true)
3887
3918
  }
3888
3919
  );
3889
3920
  };
@@ -3922,12 +3953,14 @@ var GetSelfDelegates = async ({
3922
3953
  return data;
3923
3954
  };
3924
3955
  var useGetSelfDelegates = (params = {}, options = {}) => {
3956
+ const { authenticated } = useConnectedXM();
3925
3957
  return useConnectedInfiniteQuery(
3926
3958
  SELF_DELEGATES_QUERY_KEY(),
3927
3959
  (params2) => GetSelfDelegates(params2),
3928
3960
  params,
3929
3961
  {
3930
- ...options
3962
+ ...options,
3963
+ enabled: !!authenticated && (options.enabled ?? true)
3931
3964
  }
3932
3965
  );
3933
3966
  };
@@ -3969,12 +4002,14 @@ var GetSelfEventListings = async ({
3969
4002
  return data;
3970
4003
  };
3971
4004
  var useGetSelfEventListings = (past = false, params = {}, options = {}) => {
4005
+ const { authenticated } = useConnectedXM();
3972
4006
  return useConnectedInfiniteQuery(
3973
4007
  SELF_EVENT_LISTINGS_QUERY_KEY(past),
3974
4008
  (params2) => GetSelfEventListings({ past, ...params2 }),
3975
4009
  params,
3976
4010
  {
3977
- ...options
4011
+ ...options,
4012
+ enabled: !!authenticated && (options.enabled ?? true)
3978
4013
  }
3979
4014
  );
3980
4015
  };
@@ -4002,12 +4037,13 @@ var GetSelfEventListing = async ({
4002
4037
  return data;
4003
4038
  };
4004
4039
  var useGetSelfEventListing = (eventId, options = {}) => {
4040
+ const { authenticated } = useConnectedXM();
4005
4041
  return useConnectedSingleQuery(
4006
4042
  SELF_EVENT_LISTING_QUERY_KEY(eventId),
4007
4043
  (params) => GetSelfEventListing({ eventId, ...params }),
4008
4044
  {
4009
4045
  ...options,
4010
- enabled: !!eventId && (options?.enabled ?? true)
4046
+ enabled: !!authenticated && !!eventId && (options?.enabled ?? true)
4011
4047
  }
4012
4048
  );
4013
4049
  };
@@ -4043,13 +4079,14 @@ var GetSelfEventListingRegistrations = async ({
4043
4079
  return data;
4044
4080
  };
4045
4081
  var useGetSelfEventListingsRegistrations = (eventId, checkedIn = false, params = {}, options = {}) => {
4082
+ const { authenticated } = useConnectedXM();
4046
4083
  return useConnectedInfiniteQuery(
4047
4084
  SELF_EVENT_LISTING_REGISTRATIONS_QUERY_KEY(eventId, checkedIn),
4048
4085
  (params2) => GetSelfEventListingRegistrations({ eventId, checkedIn, ...params2 }),
4049
4086
  params,
4050
4087
  {
4051
4088
  ...options,
4052
- enabled: !!eventId && (options?.enabled ?? true)
4089
+ enabled: !!authenticated && !!eventId && (options?.enabled ?? true)
4053
4090
  }
4054
4091
  );
4055
4092
  };
@@ -4091,13 +4128,14 @@ var GetSelfEvents = async ({
4091
4128
  return data;
4092
4129
  };
4093
4130
  var useGetSelfEvents = (past = false, params = {}, options = {}) => {
4131
+ const { authenticated } = useConnectedXM();
4094
4132
  return useConnectedInfiniteQuery(
4095
4133
  SELF_EVENTS_QUERY_KEY(past),
4096
4134
  (params2) => GetSelfEvents({ ...params2, past }),
4097
4135
  params,
4098
4136
  {
4099
4137
  ...options,
4100
- enabled: options.enabled ?? true
4138
+ enabled: !!authenticated && (options.enabled ?? true)
4101
4139
  }
4102
4140
  );
4103
4141
  };
@@ -4139,13 +4177,14 @@ var GetSelfEventSessions = async ({
4139
4177
  return data;
4140
4178
  };
4141
4179
  var useGetSelfEventSessions = (eventId, params = {}, options = {}) => {
4180
+ const { authenticated } = useConnectedXM();
4142
4181
  return useConnectedInfiniteQuery(
4143
4182
  SELF_EVENT_SESSIONS_QUERY_KEY(eventId),
4144
4183
  (params2) => GetSelfEventSessions({ eventId, ...params2 }),
4145
4184
  params,
4146
4185
  {
4147
4186
  ...options,
4148
- enabled: !!eventId && (options.enabled ?? true)
4187
+ enabled: !!authenticated && !!eventId && (options.enabled ?? true)
4149
4188
  }
4150
4189
  );
4151
4190
  };
@@ -4184,12 +4223,14 @@ var GetSelfFeed = async ({
4184
4223
  return data;
4185
4224
  };
4186
4225
  var useGetSelfFeed = (params = {}, options = {}) => {
4226
+ const { authenticated } = useConnectedXM();
4187
4227
  return useConnectedInfiniteQuery(
4188
4228
  SELF_FEED_QUERY_KEY(),
4189
4229
  (params2) => GetSelfFeed(params2),
4190
4230
  params,
4191
4231
  {
4192
- ...options
4232
+ ...options,
4233
+ enabled: !!authenticated && (options.enabled ?? true)
4193
4234
  }
4194
4235
  );
4195
4236
  };
@@ -4218,12 +4259,14 @@ var GetSelfInterests = async ({
4218
4259
  return data;
4219
4260
  };
4220
4261
  var useGetSelfInterests = (params = {}, options = {}) => {
4262
+ const { authenticated } = useConnectedXM();
4221
4263
  return useConnectedInfiniteQuery(
4222
4264
  SELF_INTERESTS_QUERY_KEY(),
4223
4265
  (params2) => GetSelfInterests({ ...params2 }),
4224
4266
  params,
4225
4267
  {
4226
- ...options
4268
+ ...options,
4269
+ enabled: !!authenticated && (options.enabled ?? true)
4227
4270
  }
4228
4271
  );
4229
4272
  };
@@ -4241,11 +4284,13 @@ var GetSelfNotificationPreferences = async ({
4241
4284
  return data;
4242
4285
  };
4243
4286
  var useGetSelfNotificationPreferences = (options = {}) => {
4287
+ const { authenticated } = useConnectedXM();
4244
4288
  return useConnectedSingleQuery(
4245
4289
  SELF_PREFERENCES_QUERY_KEY(),
4246
4290
  (params) => GetSelfNotificationPreferences({ ...params }),
4247
4291
  {
4248
- ...options
4292
+ ...options,
4293
+ enabled: !!authenticated && (options.enabled ?? true)
4249
4294
  }
4250
4295
  );
4251
4296
  };
@@ -4277,13 +4322,15 @@ var GetSelfNotifications = async ({
4277
4322
  return data;
4278
4323
  };
4279
4324
  var useGetSelfNotifications = (filters = "", params = {}, options = {}) => {
4325
+ const { authenticated } = useConnectedXM();
4280
4326
  return useConnectedInfiniteQuery(
4281
4327
  SELF_NOTIFICATIONS_QUERY_KEY(filters),
4282
4328
  (params2) => GetSelfNotifications({ ...params2, filters }),
4283
4329
  params,
4284
4330
  {
4285
4331
  staleTime: 0,
4286
- ...options
4332
+ ...options,
4333
+ enabled: !!authenticated && (options.enabled ?? true)
4287
4334
  }
4288
4335
  );
4289
4336
  };
@@ -4303,11 +4350,13 @@ var GetSelfNewNotificationsCount = async ({
4303
4350
  return data;
4304
4351
  };
4305
4352
  var useGetSelfNewNotificationsCount = (filters = "", options = {}) => {
4353
+ const { authenticated } = useConnectedXM();
4306
4354
  return useConnectedSingleQuery_default(
4307
4355
  SELF_NOTIFICATION_COUNT_QUERY_KEY(filters),
4308
4356
  (params) => GetSelfNewNotificationsCount({ filters, ...params }),
4309
4357
  {
4310
- ...options
4358
+ ...options,
4359
+ enabled: !!authenticated && (options.enabled ?? true)
4311
4360
  }
4312
4361
  );
4313
4362
  };
@@ -4346,12 +4395,14 @@ var GetSelfPushDevices = async ({
4346
4395
  return data;
4347
4396
  };
4348
4397
  var useGetSelfPushDevices = (params = {}, options = {}) => {
4398
+ const { authenticated } = useConnectedXM();
4349
4399
  return useConnectedInfiniteQuery(
4350
4400
  SELF_PUSH_DEVICES_QUERY_KEY(),
4351
4401
  (params2) => GetSelfPushDevices({ ...params2 }),
4352
4402
  params,
4353
4403
  {
4354
- ...options
4404
+ ...options,
4405
+ enabled: !!authenticated && (options.enabled ?? true)
4355
4406
  }
4356
4407
  );
4357
4408
  };
@@ -4379,12 +4430,13 @@ var GetSelfPushDevice = async ({
4379
4430
  return data;
4380
4431
  };
4381
4432
  var useGetSelfPushDevice = (pushDeviceId, options = {}) => {
4433
+ const { authenticated } = useConnectedXM();
4382
4434
  return useConnectedSingleQuery(
4383
4435
  SELF_PUSH_DEVICE_QUERY_KEY(pushDeviceId),
4384
4436
  (params) => GetSelfPushDevice({ pushDeviceId, ...params }),
4385
4437
  {
4386
4438
  ...options,
4387
- enabled: !!pushDeviceId && (options?.enabled ?? true)
4439
+ enabled: !!authenticated && !!pushDeviceId && (options?.enabled ?? true)
4388
4440
  }
4389
4441
  );
4390
4442
  };
@@ -4429,12 +4481,14 @@ var GetSelfRecommendations = async ({
4429
4481
  return data;
4430
4482
  };
4431
4483
  var useGetSelfRecommendations = (type, eventId = "", params = {}, options = {}) => {
4484
+ const { authenticated } = useConnectedXM();
4432
4485
  return useConnectedInfiniteQuery(
4433
4486
  SELF_RECOMMENDATIONS_QUERY_KEY(type, eventId),
4434
4487
  (params2) => GetSelfRecommendations({ ...params2, eventId, type }),
4435
4488
  params,
4436
4489
  {
4437
- ...options
4490
+ ...options,
4491
+ enabled: !!authenticated && (options.enabled ?? true)
4438
4492
  }
4439
4493
  );
4440
4494
  };
@@ -4463,12 +4517,14 @@ var GetSelfTransfers = async ({
4463
4517
  return data;
4464
4518
  };
4465
4519
  var useGetSelfTransfers = (params = {}, options = {}) => {
4520
+ const { authenticated } = useConnectedXM();
4466
4521
  return useConnectedInfiniteQuery(
4467
4522
  SELF_TRANSFERS_QUERY_KEY(),
4468
4523
  (params2) => GetSelfTransfers({ ...params2 }),
4469
4524
  params,
4470
4525
  {
4471
- ...options
4526
+ ...options,
4527
+ enabled: !!authenticated && (options.enabled ?? true)
4472
4528
  }
4473
4529
  );
4474
4530
  };
@@ -4484,12 +4540,13 @@ var GetSelfTransfer = async ({
4484
4540
  return data;
4485
4541
  };
4486
4542
  var useGetSelfTransfer = (transferId = "", options = {}) => {
4543
+ const { authenticated } = useConnectedXM();
4487
4544
  return useConnectedSingleQuery(
4488
4545
  SELF_PENDING_TRANSFER_QUERY_KEY(transferId),
4489
4546
  (params) => GetSelfTransfer({ ...params, transferId }),
4490
4547
  {
4491
4548
  ...options,
4492
- enabled: !!transferId && (options?.enabled ?? true)
4549
+ enabled: !!authenticated && !!transferId && (options?.enabled ?? true)
4493
4550
  }
4494
4551
  );
4495
4552
  };
package/dist/index.mjs CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  var ConnectedXMClientContext = React.createContext({});
7
7
  var ConnectedXMProvider = ({
8
8
  queryClient,
9
+ authenticated = true,
9
10
  children,
10
11
  ...state
11
12
  }) => {
@@ -14,7 +15,16 @@ var ConnectedXMProvider = ({
14
15
  setSSR(false);
15
16
  }, []);
16
17
  const render = () => {
17
- return /* @__PURE__ */ React.createElement(ConnectedXMClientContext.Provider, { value: state }, children);
18
+ return /* @__PURE__ */ React.createElement(
19
+ ConnectedXMClientContext.Provider,
20
+ {
21
+ value: {
22
+ ...state,
23
+ authenticated
24
+ }
25
+ },
26
+ children
27
+ );
18
28
  };
19
29
  if (ssr)
20
30
  return /* @__PURE__ */ React.createElement(QueryClientProvider, { client: queryClient }, render());
@@ -2784,12 +2794,14 @@ var GetSelfChatChannels = async ({
2784
2794
  return data;
2785
2795
  };
2786
2796
  var useGetSelfChatChannels = (params = {}, options = {}) => {
2797
+ const { authenticated } = useConnectedXM();
2787
2798
  return useConnectedInfiniteQuery(
2788
2799
  SELF_CHAT_CHANNELS_QUERY_KEY(),
2789
2800
  (params2) => GetSelfChatChannels(params2),
2790
2801
  params,
2791
2802
  {
2792
- ...options
2803
+ ...options,
2804
+ enabled: !!authenticated && (options.enabled ?? true)
2793
2805
  }
2794
2806
  );
2795
2807
  };
@@ -2817,6 +2829,7 @@ var GetSelfChatChannel = async ({
2817
2829
  return data;
2818
2830
  };
2819
2831
  var useGetSelfChatChannel = (channelId, options = {}) => {
2832
+ const { authenticated } = useConnectedXM();
2820
2833
  return useConnectedSingleQuery(
2821
2834
  SELF_CHAT_CHANNEL_QUERY_KEY(channelId),
2822
2835
  (params) => GetSelfChatChannel({
@@ -2826,7 +2839,7 @@ var useGetSelfChatChannel = (channelId, options = {}) => {
2826
2839
  {
2827
2840
  staleTime: Infinity,
2828
2841
  ...options,
2829
- enabled: !!channelId && (options?.enabled ?? true)
2842
+ enabled: !!authenticated && !!channelId && (options?.enabled ?? true)
2830
2843
  }
2831
2844
  );
2832
2845
  };
@@ -2865,13 +2878,14 @@ var GetSelfChatChannelMembers = async ({
2865
2878
  return data;
2866
2879
  };
2867
2880
  var useGetSelfChatChannelMembers = (channelId, params = {}, options = {}) => {
2881
+ const { authenticated } = useConnectedXM();
2868
2882
  return useConnectedInfiniteQuery(
2869
2883
  SELF_CHAT_CHANNEL_MEMBERS_QUERY_KEY(channelId),
2870
2884
  (params2) => GetSelfChatChannelMembers({ ...params2, channelId }),
2871
2885
  params,
2872
2886
  {
2873
2887
  ...options,
2874
- enabled: !!channelId && (options?.enabled ?? true)
2888
+ enabled: !!authenticated && !!channelId && (options?.enabled ?? true)
2875
2889
  }
2876
2890
  );
2877
2891
  };
@@ -2920,22 +2934,23 @@ var GetSelfChatChannelMessages = async ({
2920
2934
  return data;
2921
2935
  };
2922
2936
  var useGetSelfChatChannelMessages = (channelId, params = {}, options = {}) => {
2937
+ const { authenticated } = useConnectedXM();
2923
2938
  return useConnectedInfiniteQuery(
2924
2939
  SELF_CHAT_CHANNEL_MESSAGES_QUERY_KEY(channelId),
2925
2940
  (params2) => GetSelfChatChannelMessages({ ...params2, channelId }),
2926
2941
  params,
2927
2942
  {
2928
2943
  ...options,
2929
- enabled: !!channelId && (options?.enabled ?? true)
2944
+ enabled: !!authenticated && !!channelId && (options?.enabled ?? true)
2930
2945
  }
2931
2946
  );
2932
2947
  };
2933
2948
 
2934
2949
  // src/queries/self/useGetSelf.ts
2935
- var SELF_QUERY_KEY = (authenticated) => {
2950
+ var SELF_QUERY_KEY = (ignoreExecuteAs) => {
2936
2951
  const keys = ["SELF"];
2937
- if (authenticated)
2938
- keys.push("AUTHENTICATED");
2952
+ if (ignoreExecuteAs)
2953
+ keys.push("IGNORE_EXECUTEAS");
2939
2954
  return keys;
2940
2955
  };
2941
2956
  var SET_SELF_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
@@ -2945,22 +2960,24 @@ var SET_SELF_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
2945
2960
  );
2946
2961
  };
2947
2962
  var GetSelf = async ({
2948
- authenticated,
2963
+ ignoreExecuteAs,
2949
2964
  clientApiParams
2950
2965
  }) => {
2951
2966
  const clientApi = await GetClientAPI({
2952
2967
  ...clientApiParams,
2953
- getExecuteAs: authenticated ? void 0 : clientApiParams.getExecuteAs
2968
+ getExecuteAs: ignoreExecuteAs ? void 0 : clientApiParams.getExecuteAs
2954
2969
  });
2955
2970
  const { data } = await clientApi.get(`/self`);
2956
2971
  return data;
2957
2972
  };
2958
- var useGetSelf = (authenticated, options = {}) => {
2973
+ var useGetSelf = (ignoreExecuteAs, options = {}) => {
2974
+ const { authenticated } = useConnectedXM();
2959
2975
  return useConnectedSingleQuery(
2960
- SELF_QUERY_KEY(authenticated),
2961
- (params) => GetSelf({ authenticated, ...params }),
2976
+ SELF_QUERY_KEY(ignoreExecuteAs),
2977
+ (params) => GetSelf({ ignoreExecuteAs, ...params }),
2962
2978
  {
2963
- ...options
2979
+ ...options,
2980
+ enabled: authenticated && (options.enabled ?? true)
2964
2981
  }
2965
2982
  );
2966
2983
  };
@@ -2994,6 +3011,7 @@ var GetSelfEventRegistration = async ({
2994
3011
  return data;
2995
3012
  };
2996
3013
  var useGetSelfEventRegistration = (eventId, ticket, quantity, coupon, options = {}) => {
3014
+ const { authenticated } = useConnectedXM();
2997
3015
  return useConnectedSingleQuery_default(
2998
3016
  SELF_EVENT_REGISTRATION_QUERY_KEY(eventId),
2999
3017
  (params) => GetSelfEventRegistration({
@@ -3008,7 +3026,7 @@ var useGetSelfEventRegistration = (eventId, ticket, quantity, coupon, options =
3008
3026
  staleTime: Infinity,
3009
3027
  refetchOnMount: false,
3010
3028
  ...options,
3011
- enabled: !!eventId && (options?.enabled ?? true)
3029
+ enabled: !!authenticated && !!eventId && (options?.enabled ?? true)
3012
3030
  }
3013
3031
  );
3014
3032
  };
@@ -3031,6 +3049,7 @@ var GetSelfEventRegistrationCheckout = async ({
3031
3049
  return data;
3032
3050
  };
3033
3051
  var useGetSelfEventRegistrationCheckout = (eventId, registrationId = "", options = {}) => {
3052
+ const { authenticated } = useConnectedXM();
3034
3053
  return useConnectedSingleQuery_default(
3035
3054
  SELF_EVENT_REGISTRATION_CHECKOUT_QUERY_KEY(eventId, registrationId),
3036
3055
  (params) => GetSelfEventRegistrationCheckout({ eventId, registrationId, ...params }),
@@ -3039,7 +3058,7 @@ var useGetSelfEventRegistrationCheckout = (eventId, registrationId = "", options
3039
3058
  retry: false,
3040
3059
  retryOnMount: false,
3041
3060
  ...options,
3042
- enabled: !!eventId && !!registrationId
3061
+ enabled: !!authenticated && !!eventId && !!registrationId && (options.enabled ?? true)
3043
3062
  }
3044
3063
  );
3045
3064
  };
@@ -3083,12 +3102,14 @@ var GetSelfSubscriptions = async ({
3083
3102
  return data;
3084
3103
  };
3085
3104
  var useGetSelfSubscriptions = (status, params = {}, options = {}) => {
3105
+ const { authenticated } = useConnectedXM();
3086
3106
  return useConnectedInfiniteQuery(
3087
3107
  SELF_SUBSCRIPTIONS_QUERY_KEY(status),
3088
3108
  (params2) => GetSelfSubscriptions({ status, ...params2 }),
3089
3109
  params,
3090
3110
  {
3091
- ...options
3111
+ ...options,
3112
+ enabled: !!authenticated && (options.enabled ?? true)
3092
3113
  }
3093
3114
  );
3094
3115
  };
@@ -3104,12 +3125,13 @@ var GetSelfSubcription = async ({
3104
3125
  return data;
3105
3126
  };
3106
3127
  var useGetSelfSubcription = (subscriptionId = "", options = {}) => {
3128
+ const { authenticated } = useConnectedXM();
3107
3129
  return useConnectedSingleQuery(
3108
3130
  SELF_SUBSCRIPTION_QUERY_KEY(subscriptionId),
3109
3131
  (params) => GetSelfSubcription({ subscriptionId, ...params }),
3110
3132
  {
3111
3133
  ...options,
3112
- enabled: !!subscriptionId
3134
+ enabled: !!authenticated && !!subscriptionId && (options?.enabled ?? true)
3113
3135
  }
3114
3136
  );
3115
3137
  };
@@ -3139,12 +3161,14 @@ var GetSelfSubscriptionPayments = async ({
3139
3161
  return data;
3140
3162
  };
3141
3163
  var useGetSelfSubscriptionPayments = (subscriptionId, params = {}, options = {}) => {
3164
+ const { authenticated } = useConnectedXM();
3142
3165
  return useConnectedInfiniteQuery(
3143
3166
  SELF_SUBSCRIPTION_PAYMENTS_QUERY_KEY(subscriptionId),
3144
3167
  (params2) => GetSelfSubscriptionPayments({ ...params2, subscriptionId }),
3145
3168
  params,
3146
3169
  {
3147
- ...options
3170
+ ...options,
3171
+ enabled: !!authenticated && (options.enabled ?? true)
3148
3172
  }
3149
3173
  );
3150
3174
  };
@@ -3183,13 +3207,14 @@ var GetSelfActivities = async ({
3183
3207
  return data;
3184
3208
  };
3185
3209
  var useGetSelfActivities = (params = {}, options = {}) => {
3210
+ const { authenticated } = useConnectedXM();
3186
3211
  return useConnectedInfiniteQuery(
3187
3212
  SELF_ACTIVITIES_QUERY_KEY(),
3188
3213
  (params2) => GetSelfActivities({ ...params2 }),
3189
3214
  params,
3190
3215
  {
3191
3216
  ...options,
3192
- enabled: options.enabled ?? true
3217
+ enabled: !!authenticated && (options.enabled ?? true)
3193
3218
  }
3194
3219
  );
3195
3220
  };
@@ -3205,12 +3230,13 @@ var GetSelfAnnouncement = async ({
3205
3230
  return data;
3206
3231
  };
3207
3232
  var useGetSelfAnnouncement = (announcementId, options = {}) => {
3233
+ const { authenticated } = useConnectedXM();
3208
3234
  return useConnectedSingleQuery(
3209
3235
  SELF_ANNOUNCEMENT_QUERY_KEY(announcementId),
3210
3236
  (params) => GetSelfAnnouncement({ announcementId, ...params }),
3211
3237
  {
3212
3238
  ...options,
3213
- enabled: !!announcementId && (options?.enabled ?? true)
3239
+ enabled: !!authenticated && !!announcementId && (options?.enabled ?? true)
3214
3240
  }
3215
3241
  );
3216
3242
  };
@@ -3239,12 +3265,14 @@ var GetSelfCommunityMemberships = async ({
3239
3265
  return data;
3240
3266
  };
3241
3267
  var useGetSelfCommunityMemberships = (params = {}, options = {}) => {
3268
+ const { authenticated } = useConnectedXM();
3242
3269
  return useConnectedInfiniteQuery(
3243
3270
  SELF_COMMUNITY_MEMBERSHIPS_QUERY_KEY(),
3244
3271
  (params2) => GetSelfCommunityMemberships({ ...params2 }),
3245
3272
  params,
3246
3273
  {
3247
- ...options
3274
+ ...options,
3275
+ enabled: !!authenticated && (options.enabled ?? true)
3248
3276
  }
3249
3277
  );
3250
3278
  };
@@ -3271,12 +3299,13 @@ var GetSelfCommunityMembership = async ({
3271
3299
  return data;
3272
3300
  };
3273
3301
  var useGetSelfCommunityMembership = (communityId, options = {}) => {
3302
+ const { authenticated } = useConnectedXM();
3274
3303
  return useConnectedSingleQuery(
3275
3304
  SELF_COMMUNITY_MEMBERSHIP_QUERY_KEY(communityId),
3276
3305
  (params) => GetSelfCommunityMembership({ communityId, ...params }),
3277
3306
  {
3278
3307
  ...options,
3279
- enabled: !!communityId && (options?.enabled ?? true)
3308
+ enabled: !!authenticated && !!communityId && (options?.enabled ?? true)
3280
3309
  }
3281
3310
  );
3282
3311
  };
@@ -3315,12 +3344,14 @@ var GetSelfDelegateOf = async ({
3315
3344
  return data;
3316
3345
  };
3317
3346
  var useGetSelfDelegateOf = (params = {}, options = {}) => {
3347
+ const { authenticated } = useConnectedXM();
3318
3348
  return useConnectedInfiniteQuery(
3319
3349
  SELF_DELEGATE_OF_QUERY_KEY(),
3320
3350
  (params2) => GetSelfDelegateOf({ ...params2 }),
3321
3351
  params,
3322
3352
  {
3323
- ...options
3353
+ ...options,
3354
+ enabled: !!authenticated && (options.enabled ?? true)
3324
3355
  }
3325
3356
  );
3326
3357
  };
@@ -3359,12 +3390,14 @@ var GetSelfDelegates = async ({
3359
3390
  return data;
3360
3391
  };
3361
3392
  var useGetSelfDelegates = (params = {}, options = {}) => {
3393
+ const { authenticated } = useConnectedXM();
3362
3394
  return useConnectedInfiniteQuery(
3363
3395
  SELF_DELEGATES_QUERY_KEY(),
3364
3396
  (params2) => GetSelfDelegates(params2),
3365
3397
  params,
3366
3398
  {
3367
- ...options
3399
+ ...options,
3400
+ enabled: !!authenticated && (options.enabled ?? true)
3368
3401
  }
3369
3402
  );
3370
3403
  };
@@ -3406,12 +3439,14 @@ var GetSelfEventListings = async ({
3406
3439
  return data;
3407
3440
  };
3408
3441
  var useGetSelfEventListings = (past = false, params = {}, options = {}) => {
3442
+ const { authenticated } = useConnectedXM();
3409
3443
  return useConnectedInfiniteQuery(
3410
3444
  SELF_EVENT_LISTINGS_QUERY_KEY(past),
3411
3445
  (params2) => GetSelfEventListings({ past, ...params2 }),
3412
3446
  params,
3413
3447
  {
3414
- ...options
3448
+ ...options,
3449
+ enabled: !!authenticated && (options.enabled ?? true)
3415
3450
  }
3416
3451
  );
3417
3452
  };
@@ -3439,12 +3474,13 @@ var GetSelfEventListing = async ({
3439
3474
  return data;
3440
3475
  };
3441
3476
  var useGetSelfEventListing = (eventId, options = {}) => {
3477
+ const { authenticated } = useConnectedXM();
3442
3478
  return useConnectedSingleQuery(
3443
3479
  SELF_EVENT_LISTING_QUERY_KEY(eventId),
3444
3480
  (params) => GetSelfEventListing({ eventId, ...params }),
3445
3481
  {
3446
3482
  ...options,
3447
- enabled: !!eventId && (options?.enabled ?? true)
3483
+ enabled: !!authenticated && !!eventId && (options?.enabled ?? true)
3448
3484
  }
3449
3485
  );
3450
3486
  };
@@ -3480,13 +3516,14 @@ var GetSelfEventListingRegistrations = async ({
3480
3516
  return data;
3481
3517
  };
3482
3518
  var useGetSelfEventListingsRegistrations = (eventId, checkedIn = false, params = {}, options = {}) => {
3519
+ const { authenticated } = useConnectedXM();
3483
3520
  return useConnectedInfiniteQuery(
3484
3521
  SELF_EVENT_LISTING_REGISTRATIONS_QUERY_KEY(eventId, checkedIn),
3485
3522
  (params2) => GetSelfEventListingRegistrations({ eventId, checkedIn, ...params2 }),
3486
3523
  params,
3487
3524
  {
3488
3525
  ...options,
3489
- enabled: !!eventId && (options?.enabled ?? true)
3526
+ enabled: !!authenticated && !!eventId && (options?.enabled ?? true)
3490
3527
  }
3491
3528
  );
3492
3529
  };
@@ -3528,13 +3565,14 @@ var GetSelfEvents = async ({
3528
3565
  return data;
3529
3566
  };
3530
3567
  var useGetSelfEvents = (past = false, params = {}, options = {}) => {
3568
+ const { authenticated } = useConnectedXM();
3531
3569
  return useConnectedInfiniteQuery(
3532
3570
  SELF_EVENTS_QUERY_KEY(past),
3533
3571
  (params2) => GetSelfEvents({ ...params2, past }),
3534
3572
  params,
3535
3573
  {
3536
3574
  ...options,
3537
- enabled: options.enabled ?? true
3575
+ enabled: !!authenticated && (options.enabled ?? true)
3538
3576
  }
3539
3577
  );
3540
3578
  };
@@ -3576,13 +3614,14 @@ var GetSelfEventSessions = async ({
3576
3614
  return data;
3577
3615
  };
3578
3616
  var useGetSelfEventSessions = (eventId, params = {}, options = {}) => {
3617
+ const { authenticated } = useConnectedXM();
3579
3618
  return useConnectedInfiniteQuery(
3580
3619
  SELF_EVENT_SESSIONS_QUERY_KEY(eventId),
3581
3620
  (params2) => GetSelfEventSessions({ eventId, ...params2 }),
3582
3621
  params,
3583
3622
  {
3584
3623
  ...options,
3585
- enabled: !!eventId && (options.enabled ?? true)
3624
+ enabled: !!authenticated && !!eventId && (options.enabled ?? true)
3586
3625
  }
3587
3626
  );
3588
3627
  };
@@ -3621,12 +3660,14 @@ var GetSelfFeed = async ({
3621
3660
  return data;
3622
3661
  };
3623
3662
  var useGetSelfFeed = (params = {}, options = {}) => {
3663
+ const { authenticated } = useConnectedXM();
3624
3664
  return useConnectedInfiniteQuery(
3625
3665
  SELF_FEED_QUERY_KEY(),
3626
3666
  (params2) => GetSelfFeed(params2),
3627
3667
  params,
3628
3668
  {
3629
- ...options
3669
+ ...options,
3670
+ enabled: !!authenticated && (options.enabled ?? true)
3630
3671
  }
3631
3672
  );
3632
3673
  };
@@ -3655,12 +3696,14 @@ var GetSelfInterests = async ({
3655
3696
  return data;
3656
3697
  };
3657
3698
  var useGetSelfInterests = (params = {}, options = {}) => {
3699
+ const { authenticated } = useConnectedXM();
3658
3700
  return useConnectedInfiniteQuery(
3659
3701
  SELF_INTERESTS_QUERY_KEY(),
3660
3702
  (params2) => GetSelfInterests({ ...params2 }),
3661
3703
  params,
3662
3704
  {
3663
- ...options
3705
+ ...options,
3706
+ enabled: !!authenticated && (options.enabled ?? true)
3664
3707
  }
3665
3708
  );
3666
3709
  };
@@ -3678,11 +3721,13 @@ var GetSelfNotificationPreferences = async ({
3678
3721
  return data;
3679
3722
  };
3680
3723
  var useGetSelfNotificationPreferences = (options = {}) => {
3724
+ const { authenticated } = useConnectedXM();
3681
3725
  return useConnectedSingleQuery(
3682
3726
  SELF_PREFERENCES_QUERY_KEY(),
3683
3727
  (params) => GetSelfNotificationPreferences({ ...params }),
3684
3728
  {
3685
- ...options
3729
+ ...options,
3730
+ enabled: !!authenticated && (options.enabled ?? true)
3686
3731
  }
3687
3732
  );
3688
3733
  };
@@ -3714,13 +3759,15 @@ var GetSelfNotifications = async ({
3714
3759
  return data;
3715
3760
  };
3716
3761
  var useGetSelfNotifications = (filters = "", params = {}, options = {}) => {
3762
+ const { authenticated } = useConnectedXM();
3717
3763
  return useConnectedInfiniteQuery(
3718
3764
  SELF_NOTIFICATIONS_QUERY_KEY(filters),
3719
3765
  (params2) => GetSelfNotifications({ ...params2, filters }),
3720
3766
  params,
3721
3767
  {
3722
3768
  staleTime: 0,
3723
- ...options
3769
+ ...options,
3770
+ enabled: !!authenticated && (options.enabled ?? true)
3724
3771
  }
3725
3772
  );
3726
3773
  };
@@ -3740,11 +3787,13 @@ var GetSelfNewNotificationsCount = async ({
3740
3787
  return data;
3741
3788
  };
3742
3789
  var useGetSelfNewNotificationsCount = (filters = "", options = {}) => {
3790
+ const { authenticated } = useConnectedXM();
3743
3791
  return useConnectedSingleQuery_default(
3744
3792
  SELF_NOTIFICATION_COUNT_QUERY_KEY(filters),
3745
3793
  (params) => GetSelfNewNotificationsCount({ filters, ...params }),
3746
3794
  {
3747
- ...options
3795
+ ...options,
3796
+ enabled: !!authenticated && (options.enabled ?? true)
3748
3797
  }
3749
3798
  );
3750
3799
  };
@@ -3783,12 +3832,14 @@ var GetSelfPushDevices = async ({
3783
3832
  return data;
3784
3833
  };
3785
3834
  var useGetSelfPushDevices = (params = {}, options = {}) => {
3835
+ const { authenticated } = useConnectedXM();
3786
3836
  return useConnectedInfiniteQuery(
3787
3837
  SELF_PUSH_DEVICES_QUERY_KEY(),
3788
3838
  (params2) => GetSelfPushDevices({ ...params2 }),
3789
3839
  params,
3790
3840
  {
3791
- ...options
3841
+ ...options,
3842
+ enabled: !!authenticated && (options.enabled ?? true)
3792
3843
  }
3793
3844
  );
3794
3845
  };
@@ -3816,12 +3867,13 @@ var GetSelfPushDevice = async ({
3816
3867
  return data;
3817
3868
  };
3818
3869
  var useGetSelfPushDevice = (pushDeviceId, options = {}) => {
3870
+ const { authenticated } = useConnectedXM();
3819
3871
  return useConnectedSingleQuery(
3820
3872
  SELF_PUSH_DEVICE_QUERY_KEY(pushDeviceId),
3821
3873
  (params) => GetSelfPushDevice({ pushDeviceId, ...params }),
3822
3874
  {
3823
3875
  ...options,
3824
- enabled: !!pushDeviceId && (options?.enabled ?? true)
3876
+ enabled: !!authenticated && !!pushDeviceId && (options?.enabled ?? true)
3825
3877
  }
3826
3878
  );
3827
3879
  };
@@ -3866,12 +3918,14 @@ var GetSelfRecommendations = async ({
3866
3918
  return data;
3867
3919
  };
3868
3920
  var useGetSelfRecommendations = (type, eventId = "", params = {}, options = {}) => {
3921
+ const { authenticated } = useConnectedXM();
3869
3922
  return useConnectedInfiniteQuery(
3870
3923
  SELF_RECOMMENDATIONS_QUERY_KEY(type, eventId),
3871
3924
  (params2) => GetSelfRecommendations({ ...params2, eventId, type }),
3872
3925
  params,
3873
3926
  {
3874
- ...options
3927
+ ...options,
3928
+ enabled: !!authenticated && (options.enabled ?? true)
3875
3929
  }
3876
3930
  );
3877
3931
  };
@@ -3900,12 +3954,14 @@ var GetSelfTransfers = async ({
3900
3954
  return data;
3901
3955
  };
3902
3956
  var useGetSelfTransfers = (params = {}, options = {}) => {
3957
+ const { authenticated } = useConnectedXM();
3903
3958
  return useConnectedInfiniteQuery(
3904
3959
  SELF_TRANSFERS_QUERY_KEY(),
3905
3960
  (params2) => GetSelfTransfers({ ...params2 }),
3906
3961
  params,
3907
3962
  {
3908
- ...options
3963
+ ...options,
3964
+ enabled: !!authenticated && (options.enabled ?? true)
3909
3965
  }
3910
3966
  );
3911
3967
  };
@@ -3921,12 +3977,13 @@ var GetSelfTransfer = async ({
3921
3977
  return data;
3922
3978
  };
3923
3979
  var useGetSelfTransfer = (transferId = "", options = {}) => {
3980
+ const { authenticated } = useConnectedXM();
3924
3981
  return useConnectedSingleQuery(
3925
3982
  SELF_PENDING_TRANSFER_QUERY_KEY(transferId),
3926
3983
  (params) => GetSelfTransfer({ ...params, transferId }),
3927
3984
  {
3928
3985
  ...options,
3929
- enabled: !!transferId && (options?.enabled ?? true)
3986
+ enabled: !!authenticated && !!transferId && (options?.enabled ?? true)
3930
3987
  }
3931
3988
  );
3932
3989
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/client",
3
- "version": "0.0.78",
3
+ "version": "0.0.79",
4
4
  "description": "Client API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "repository": {