@connectedxm/client 0.5.31 → 0.5.33

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,10 +3236,16 @@ 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),
3236
- (params2) => GetChannelContents({ ...params2, channelId: channelId || "", type }),
3241
+ CHANNEL_CONTENTS_QUERY_KEY(channelId, type, featured, past),
3242
+ (params2) => GetChannelContents({
3243
+ ...params2,
3244
+ channelId: channelId || "",
3245
+ type,
3246
+ featured,
3247
+ past
3248
+ }),
3237
3249
  params,
3238
3250
  {
3239
3251
  ...options,
@@ -7835,6 +7847,9 @@ var CreateChannelSubscriber = async ({
7835
7847
  queryClient.invalidateQueries({
7836
7848
  queryKey: CHANNEL_QUERY_KEY(channelId)
7837
7849
  });
7850
+ queryClient.invalidateQueries({
7851
+ queryKey: SUBSCRIBED_CHANNELS_QUERY_KEY()
7852
+ });
7838
7853
  ADD_SELF_RELATIONSHIP(
7839
7854
  queryClient,
7840
7855
  [clientApiParams.locale],
@@ -7860,6 +7875,9 @@ var DeleteChannelSubscriber = async ({
7860
7875
  queryClient.invalidateQueries({
7861
7876
  queryKey: CHANNEL_QUERY_KEY(channelId)
7862
7877
  });
7878
+ queryClient.invalidateQueries({
7879
+ queryKey: SUBSCRIBED_CHANNELS_QUERY_KEY()
7880
+ });
7863
7881
  REMOVE_SELF_RELATIONSHIP(
7864
7882
  queryClient,
7865
7883
  [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,10 +2380,16 @@ 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),
2380
- (params2) => GetChannelContents({ ...params2, channelId: channelId || "", type }),
2385
+ CHANNEL_CONTENTS_QUERY_KEY(channelId, type, featured, past),
2386
+ (params2) => GetChannelContents({
2387
+ ...params2,
2388
+ channelId: channelId || "",
2389
+ type,
2390
+ featured,
2391
+ past
2392
+ }),
2381
2393
  params,
2382
2394
  {
2383
2395
  ...options,
@@ -6982,6 +6994,9 @@ var CreateChannelSubscriber = async ({
6982
6994
  queryClient.invalidateQueries({
6983
6995
  queryKey: CHANNEL_QUERY_KEY(channelId)
6984
6996
  });
6997
+ queryClient.invalidateQueries({
6998
+ queryKey: SUBSCRIBED_CHANNELS_QUERY_KEY()
6999
+ });
6985
7000
  ADD_SELF_RELATIONSHIP(
6986
7001
  queryClient,
6987
7002
  [clientApiParams.locale],
@@ -7007,6 +7022,9 @@ var DeleteChannelSubscriber = async ({
7007
7022
  queryClient.invalidateQueries({
7008
7023
  queryKey: CHANNEL_QUERY_KEY(channelId)
7009
7024
  });
7025
+ queryClient.invalidateQueries({
7026
+ queryKey: SUBSCRIBED_CHANNELS_QUERY_KEY()
7027
+ });
7010
7028
  REMOVE_SELF_RELATIONSHIP(
7011
7029
  queryClient,
7012
7030
  [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.33",
4
4
  "description": "Client API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "repository": {