@connectedxm/client 0.5.31 → 0.5.32

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
@@ -1967,14 +1967,16 @@ interface GetChannelContentParams extends SingleQueryParams {
1967
1967
  declare const GetChannelContent: ({ contentId, channelId, clientApiParams, }: GetChannelContentParams) => Promise<ConnectedXMResponse<Content>>;
1968
1968
  declare const useGetChannelContent: (channelId?: string, contentId?: string, options?: SingleQueryOptions<ReturnType<typeof GetChannelContent>>) => _tanstack_react_query.UseQueryResult<ConnectedXMResponse<Content>, axios.AxiosError<ConnectedXMResponse<any>, any>>;
1969
1969
 
1970
- declare const CHANNEL_CONTENTS_QUERY_KEY: (channelId: string, type?: "video" | "audio" | "article") => QueryKey;
1970
+ declare const CHANNEL_CONTENTS_QUERY_KEY: (channelId: string, type?: "video" | "audio" | "article", featured?: boolean, past?: boolean) => QueryKey;
1971
1971
  declare const SET_CHANNEL_CONTENTS_QUERY_DATA: (client: QueryClient, keyParams: Parameters<typeof CHANNEL_CONTENTS_QUERY_KEY>, response: Awaited<ReturnType<typeof GetChannelContents>>, baseKeys?: Parameters<typeof GetBaseInfiniteQueryKeys>) => void;
1972
1972
  interface GetChannelContentsParams extends InfiniteQueryParams {
1973
1973
  channelId: string;
1974
1974
  type?: "video" | "audio" | "article";
1975
+ featured?: boolean;
1976
+ past?: boolean;
1975
1977
  }
1976
- declare const GetChannelContents: ({ channelId, type, pageParam, pageSize, orderBy, search, queryClient, clientApiParams, locale, }: GetChannelContentsParams) => Promise<ConnectedXMResponse<Content[]>>;
1977
- declare const useGetChannelContents: (channelId?: string, type?: "video" | "audio" | "article", params?: Omit<InfiniteQueryParams, "pageParam" | "queryClient" | "clientApiParams">, options?: InfiniteQueryOptions<Awaited<ReturnType<typeof GetChannelContents>>>) => _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<ConnectedXMResponse<Content[]>, number>, axios.AxiosError<ConnectedXMResponse<null>, any>>;
1978
+ declare const GetChannelContents: ({ channelId, type, featured, past, pageParam, pageSize, orderBy, search, queryClient, clientApiParams, locale, }: GetChannelContentsParams) => Promise<ConnectedXMResponse<Content[]>>;
1979
+ declare const useGetChannelContents: (channelId?: string, type?: "video" | "audio" | "article", featured?: boolean, past?: boolean, params?: Omit<InfiniteQueryParams, "pageParam" | "queryClient" | "clientApiParams">, options?: InfiniteQueryOptions<Awaited<ReturnType<typeof GetChannelContents>>>) => _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<ConnectedXMResponse<Content[]>, number>, axios.AxiosError<ConnectedXMResponse<null>, any>>;
1978
1980
 
1979
1981
  declare const CHANNEL_CONTENT_INTERESTS_QUERY_KEY: (channelId: string, contentId: string) => QueryKey;
1980
1982
  interface GetChannelContentInterestsParams extends InfiniteQueryParams {
package/dist/index.d.ts CHANGED
@@ -1967,14 +1967,16 @@ interface GetChannelContentParams extends SingleQueryParams {
1967
1967
  declare const GetChannelContent: ({ contentId, channelId, clientApiParams, }: GetChannelContentParams) => Promise<ConnectedXMResponse<Content>>;
1968
1968
  declare const useGetChannelContent: (channelId?: string, contentId?: string, options?: SingleQueryOptions<ReturnType<typeof GetChannelContent>>) => _tanstack_react_query.UseQueryResult<ConnectedXMResponse<Content>, axios.AxiosError<ConnectedXMResponse<any>, any>>;
1969
1969
 
1970
- declare const CHANNEL_CONTENTS_QUERY_KEY: (channelId: string, type?: "video" | "audio" | "article") => QueryKey;
1970
+ declare const CHANNEL_CONTENTS_QUERY_KEY: (channelId: string, type?: "video" | "audio" | "article", featured?: boolean, past?: boolean) => QueryKey;
1971
1971
  declare const SET_CHANNEL_CONTENTS_QUERY_DATA: (client: QueryClient, keyParams: Parameters<typeof CHANNEL_CONTENTS_QUERY_KEY>, response: Awaited<ReturnType<typeof GetChannelContents>>, baseKeys?: Parameters<typeof GetBaseInfiniteQueryKeys>) => void;
1972
1972
  interface GetChannelContentsParams extends InfiniteQueryParams {
1973
1973
  channelId: string;
1974
1974
  type?: "video" | "audio" | "article";
1975
+ featured?: boolean;
1976
+ past?: boolean;
1975
1977
  }
1976
- declare const GetChannelContents: ({ channelId, type, pageParam, pageSize, orderBy, search, queryClient, clientApiParams, locale, }: GetChannelContentsParams) => Promise<ConnectedXMResponse<Content[]>>;
1977
- declare const useGetChannelContents: (channelId?: string, type?: "video" | "audio" | "article", params?: Omit<InfiniteQueryParams, "pageParam" | "queryClient" | "clientApiParams">, options?: InfiniteQueryOptions<Awaited<ReturnType<typeof GetChannelContents>>>) => _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<ConnectedXMResponse<Content[]>, number>, axios.AxiosError<ConnectedXMResponse<null>, any>>;
1978
+ declare const GetChannelContents: ({ channelId, type, featured, past, pageParam, pageSize, orderBy, search, queryClient, clientApiParams, locale, }: GetChannelContentsParams) => Promise<ConnectedXMResponse<Content[]>>;
1979
+ declare const useGetChannelContents: (channelId?: string, type?: "video" | "audio" | "article", featured?: boolean, past?: boolean, params?: Omit<InfiniteQueryParams, "pageParam" | "queryClient" | "clientApiParams">, options?: InfiniteQueryOptions<Awaited<ReturnType<typeof GetChannelContents>>>) => _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<ConnectedXMResponse<Content[]>, number>, axios.AxiosError<ConnectedXMResponse<null>, any>>;
1978
1980
 
1979
1981
  declare const CHANNEL_CONTENT_INTERESTS_QUERY_KEY: (channelId: string, contentId: string) => QueryKey;
1980
1982
  interface GetChannelContentInterestsParams extends InfiniteQueryParams {
package/dist/index.js CHANGED
@@ -3185,8 +3185,10 @@ var useGetSubscribedContents = (type, interest, params = {}, options = {}) => {
3185
3185
  };
3186
3186
 
3187
3187
  // src/queries/channels/content/useGetChannelContents.ts
3188
- var CHANNEL_CONTENTS_QUERY_KEY = (channelId, type) => {
3188
+ var CHANNEL_CONTENTS_QUERY_KEY = (channelId, type, featured, past) => {
3189
3189
  const key = [...CHANNEL_QUERY_KEY(channelId), "CONTENTS"];
3190
+ if (featured) key.push("FEATURED");
3191
+ if (typeof past !== "undefined") key.push(past ? "PAST" : "UPCOMING");
3190
3192
  if (type) key.push(type);
3191
3193
  return key;
3192
3194
  };
@@ -3202,6 +3204,8 @@ var SET_CHANNEL_CONTENTS_QUERY_DATA = (client, keyParams, response, baseKeys = [
3202
3204
  var GetChannelContents = async ({
3203
3205
  channelId,
3204
3206
  type,
3207
+ featured,
3208
+ past,
3205
3209
  pageParam,
3206
3210
  pageSize,
3207
3211
  orderBy,
@@ -3214,6 +3218,8 @@ var GetChannelContents = async ({
3214
3218
  const { data } = await clientApi.get(`/channels/${channelId}/contents`, {
3215
3219
  params: {
3216
3220
  type: type || void 0,
3221
+ featured: featured || void 0,
3222
+ past,
3217
3223
  page: pageParam || void 0,
3218
3224
  pageSize: pageSize || void 0,
3219
3225
  orderBy: orderBy || void 0,
@@ -3230,9 +3236,9 @@ var GetChannelContents = async ({
3230
3236
  }
3231
3237
  return data;
3232
3238
  };
3233
- var useGetChannelContents = (channelId = "", type, params = {}, options = {}) => {
3239
+ var useGetChannelContents = (channelId = "", type, featured, past, params = {}, options = {}) => {
3234
3240
  return useConnectedInfiniteQuery(
3235
- CHANNEL_CONTENTS_QUERY_KEY(channelId, type),
3241
+ CHANNEL_CONTENTS_QUERY_KEY(channelId, type, featured, past),
3236
3242
  (params2) => GetChannelContents({ ...params2, channelId: channelId || "", type }),
3237
3243
  params,
3238
3244
  {
@@ -7835,6 +7841,9 @@ var CreateChannelSubscriber = async ({
7835
7841
  queryClient.invalidateQueries({
7836
7842
  queryKey: CHANNEL_QUERY_KEY(channelId)
7837
7843
  });
7844
+ queryClient.invalidateQueries({
7845
+ queryKey: SUBSCRIBED_CHANNELS_QUERY_KEY()
7846
+ });
7838
7847
  ADD_SELF_RELATIONSHIP(
7839
7848
  queryClient,
7840
7849
  [clientApiParams.locale],
@@ -7860,6 +7869,9 @@ var DeleteChannelSubscriber = async ({
7860
7869
  queryClient.invalidateQueries({
7861
7870
  queryKey: CHANNEL_QUERY_KEY(channelId)
7862
7871
  });
7872
+ queryClient.invalidateQueries({
7873
+ queryKey: SUBSCRIBED_CHANNELS_QUERY_KEY()
7874
+ });
7863
7875
  REMOVE_SELF_RELATIONSHIP(
7864
7876
  queryClient,
7865
7877
  [clientApiParams.locale],
package/dist/index.mjs CHANGED
@@ -2329,8 +2329,10 @@ var useGetSubscribedContents = (type, interest, params = {}, options = {}) => {
2329
2329
  };
2330
2330
 
2331
2331
  // src/queries/channels/content/useGetChannelContents.ts
2332
- var CHANNEL_CONTENTS_QUERY_KEY = (channelId, type) => {
2332
+ var CHANNEL_CONTENTS_QUERY_KEY = (channelId, type, featured, past) => {
2333
2333
  const key = [...CHANNEL_QUERY_KEY(channelId), "CONTENTS"];
2334
+ if (featured) key.push("FEATURED");
2335
+ if (typeof past !== "undefined") key.push(past ? "PAST" : "UPCOMING");
2334
2336
  if (type) key.push(type);
2335
2337
  return key;
2336
2338
  };
@@ -2346,6 +2348,8 @@ var SET_CHANNEL_CONTENTS_QUERY_DATA = (client, keyParams, response, baseKeys = [
2346
2348
  var GetChannelContents = async ({
2347
2349
  channelId,
2348
2350
  type,
2351
+ featured,
2352
+ past,
2349
2353
  pageParam,
2350
2354
  pageSize,
2351
2355
  orderBy,
@@ -2358,6 +2362,8 @@ var GetChannelContents = async ({
2358
2362
  const { data } = await clientApi.get(`/channels/${channelId}/contents`, {
2359
2363
  params: {
2360
2364
  type: type || void 0,
2365
+ featured: featured || void 0,
2366
+ past,
2361
2367
  page: pageParam || void 0,
2362
2368
  pageSize: pageSize || void 0,
2363
2369
  orderBy: orderBy || void 0,
@@ -2374,9 +2380,9 @@ var GetChannelContents = async ({
2374
2380
  }
2375
2381
  return data;
2376
2382
  };
2377
- var useGetChannelContents = (channelId = "", type, params = {}, options = {}) => {
2383
+ var useGetChannelContents = (channelId = "", type, featured, past, params = {}, options = {}) => {
2378
2384
  return useConnectedInfiniteQuery(
2379
- CHANNEL_CONTENTS_QUERY_KEY(channelId, type),
2385
+ CHANNEL_CONTENTS_QUERY_KEY(channelId, type, featured, past),
2380
2386
  (params2) => GetChannelContents({ ...params2, channelId: channelId || "", type }),
2381
2387
  params,
2382
2388
  {
@@ -6982,6 +6988,9 @@ var CreateChannelSubscriber = async ({
6982
6988
  queryClient.invalidateQueries({
6983
6989
  queryKey: CHANNEL_QUERY_KEY(channelId)
6984
6990
  });
6991
+ queryClient.invalidateQueries({
6992
+ queryKey: SUBSCRIBED_CHANNELS_QUERY_KEY()
6993
+ });
6985
6994
  ADD_SELF_RELATIONSHIP(
6986
6995
  queryClient,
6987
6996
  [clientApiParams.locale],
@@ -7007,6 +7016,9 @@ var DeleteChannelSubscriber = async ({
7007
7016
  queryClient.invalidateQueries({
7008
7017
  queryKey: CHANNEL_QUERY_KEY(channelId)
7009
7018
  });
7019
+ queryClient.invalidateQueries({
7020
+ queryKey: SUBSCRIBED_CHANNELS_QUERY_KEY()
7021
+ });
7010
7022
  REMOVE_SELF_RELATIONSHIP(
7011
7023
  queryClient,
7012
7024
  [clientApiParams.locale],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/client",
3
- "version": "0.5.31",
3
+ "version": "0.5.32",
4
4
  "description": "Client API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "repository": {