@stream-io/feeds-client 0.2.5 → 0.2.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/feeds-client",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "./dist/index.node.js",
6
6
  "exports": {
@@ -127,6 +127,8 @@ import {
127
127
  UpdateUsersResponse,
128
128
  UpsertActivitiesRequest,
129
129
  UpsertActivitiesResponse,
130
+ UpsertPushPreferencesRequest,
131
+ UpsertPushPreferencesResponse,
130
132
  WSAuthMessage,
131
133
  } from '../models';
132
134
  import { decoders } from '../model-decoders/decoders';
@@ -726,6 +728,7 @@ export class FeedsApi {
726
728
  text: request?.text,
727
729
  visibility: request?.visibility,
728
730
  attachments: request?.attachments,
731
+ feeds: request?.feeds,
729
732
  filter_tags: request?.filter_tags,
730
733
  interest_tags: request?.interest_tags,
731
734
  custom: request?.custom,
@@ -2073,6 +2076,29 @@ export class FeedsApi {
2073
2076
  return { ...response.body, metadata: response.metadata };
2074
2077
  }
2075
2078
 
2079
+ async updatePushNotificationPreferences(
2080
+ request: UpsertPushPreferencesRequest,
2081
+ ): Promise<StreamResponse<UpsertPushPreferencesResponse>> {
2082
+ const body = {
2083
+ preferences: request?.preferences,
2084
+ };
2085
+
2086
+ const response = await this.apiClient.sendRequest<
2087
+ StreamResponse<UpsertPushPreferencesResponse>
2088
+ >(
2089
+ 'POST',
2090
+ '/api/v2/push_preferences',
2091
+ undefined,
2092
+ undefined,
2093
+ body,
2094
+ 'application/json',
2095
+ );
2096
+
2097
+ decoders.UpsertPushPreferencesResponse?.(response.body);
2098
+
2099
+ return { ...response.body, metadata: response.metadata };
2100
+ }
2101
+
2076
2102
  async deleteFile(request?: {
2077
2103
  url?: string;
2078
2104
  }): Promise<StreamResponse<Response>> {
@@ -1849,6 +1849,13 @@ decoders.UpsertConfigResponse = (input?: Record<string, any>) => {
1849
1849
  return decode(typeMappings, input);
1850
1850
  };
1851
1851
 
1852
+ decoders.UpsertPushPreferencesResponse = (input?: Record<string, any>) => {
1853
+ const typeMappings: TypeMapping = {
1854
+ user_preferences: { type: 'PushPreferences', isSingle: false },
1855
+ };
1856
+ return decode(typeMappings, input);
1857
+ };
1858
+
1852
1859
  decoders.User = (input?: Record<string, any>) => {
1853
1860
  const typeMappings: TypeMapping = {
1854
1861
  ban_expires: { type: 'DatetimeType', isSingle: true },
@@ -673,6 +673,8 @@ export interface AggregatedActivityResponse {
673
673
 
674
674
  user_count: number;
675
675
 
676
+ user_count_truncated: boolean;
677
+
676
678
  activities: ActivityResponse[];
677
679
  }
678
680
 
@@ -1221,6 +1223,8 @@ export interface CallEgress {
1221
1223
 
1222
1224
  export interface CallIngressResponse {
1223
1225
  rtmp: RTMPIngress;
1226
+
1227
+ srt: SRTIngress;
1224
1228
  }
1225
1229
 
1226
1230
  export interface CallMember {
@@ -1783,6 +1787,12 @@ export const ChannelOwnCapability = {
1783
1787
  export type ChannelOwnCapability =
1784
1788
  (typeof ChannelOwnCapability)[keyof typeof ChannelOwnCapability];
1785
1789
 
1790
+ export interface ChannelPushPreferences {
1791
+ chat_level?: string;
1792
+
1793
+ disabled_until?: Date;
1794
+ }
1795
+
1786
1796
  export interface ChannelResponse {
1787
1797
  cid: string;
1788
1798
 
@@ -2912,15 +2922,15 @@ export interface FeedUpdatedEvent {
2912
2922
  }
2913
2923
 
2914
2924
  export interface FeedsPreferences {
2915
- comment?: string;
2925
+ comment?: 'all' | 'none';
2916
2926
 
2917
- comment_reaction?: string;
2927
+ comment_reaction?: 'all' | 'none';
2918
2928
 
2919
- follow?: string;
2929
+ follow?: 'all' | 'none';
2920
2930
 
2921
- mention?: string;
2931
+ mention?: 'all' | 'none';
2922
2932
 
2923
- reaction?: string;
2933
+ reaction?: 'all' | 'none';
2924
2934
 
2925
2935
  custom_activity_types?: Record<string, string>;
2926
2936
  }
@@ -4562,6 +4572,24 @@ export interface PushNotificationConfig {
4562
4572
  push_types?: string[];
4563
4573
  }
4564
4574
 
4575
+ export interface PushPreferenceInput {
4576
+ call_level?: 'all' | 'none' | 'default';
4577
+
4578
+ channel_cid?: string;
4579
+
4580
+ chat_level?: 'all' | 'mentions' | 'none' | 'default';
4581
+
4582
+ disabled_until?: Date;
4583
+
4584
+ feeds_level?: 'all' | 'none' | 'default';
4585
+
4586
+ remove_disable?: boolean;
4587
+
4588
+ user_id?: string;
4589
+
4590
+ feeds_preferences?: FeedsPreferences;
4591
+ }
4592
+
4565
4593
  export interface PushPreferences {
4566
4594
  call_level?: string;
4567
4595
 
@@ -5314,6 +5342,10 @@ export interface SFUIDLastSeen {
5314
5342
  process_start_time: number;
5315
5343
  }
5316
5344
 
5345
+ export interface SRTIngress {
5346
+ address: string;
5347
+ }
5348
+
5317
5349
  export interface STTEgressConfig {
5318
5350
  closed_captions_enabled?: boolean;
5319
5351
 
@@ -5777,6 +5809,8 @@ export interface UpdateActivityRequest {
5777
5809
 
5778
5810
  attachments?: Attachment[];
5779
5811
 
5812
+ feeds?: string[];
5813
+
5780
5814
  filter_tags?: string[];
5781
5815
 
5782
5816
  interest_tags?: string[];
@@ -6024,6 +6058,21 @@ export interface UpsertConfigResponse {
6024
6058
  config?: ConfigResponse;
6025
6059
  }
6026
6060
 
6061
+ export interface UpsertPushPreferencesRequest {
6062
+ preferences: PushPreferenceInput[];
6063
+ }
6064
+
6065
+ export interface UpsertPushPreferencesResponse {
6066
+ duration: string;
6067
+
6068
+ user_channel_preferences: Record<
6069
+ string,
6070
+ Record<string, ChannelPushPreferences | null>
6071
+ >;
6072
+
6073
+ user_preferences: Record<string, PushPreferences>;
6074
+ }
6075
+
6027
6076
  export interface User {
6028
6077
  banned: boolean;
6029
6078