@stream-io/node-sdk 0.4.10 → 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.
@@ -1,6 +1,6 @@
1
1
  import { BaseApi } from '../../BaseApi';
2
2
  import { StreamResponse } from '../../types';
3
- import { CampaignResponse, CastPollVoteRequest, ChannelGetOrCreateRequest, ChannelStateResponse, CommitMessageRequest, CreateChannelTypeRequest, CreateChannelTypeResponse, CreateCommandRequest, CreateCommandResponse, CreatePollOptionRequest, CreatePollRequest, DeleteChannelResponse, DeleteChannelsRequest, DeleteChannelsResponse, DeleteCommandResponse, DeleteMessageResponse, DeleteReactionResponse, DeleteSegmentTargetsRequest, EventResponse, ExportChannelsRequest, ExportChannelsResponse, FileUploadRequest, FileUploadResponse, GetCampaignResponse, GetChannelTypeResponse, GetCommandResponse, GetExportChannelsStatusResponse, GetManyMessagesResponse, GetMessageResponse, GetReactionsResponse, GetRepliesResponse, GetSegmentResponse, GetThreadResponse, HideChannelRequest, HideChannelResponse, ImageUploadRequest, ImageUploadResponse, ListChannelTypesResponse, ListCommandsResponse, MarkChannelsReadRequest, MarkReadRequest, MarkReadResponse, MarkUnreadRequest, MembersResponse, MessageActionRequest, MessageResponse, MuteChannelRequest, MuteChannelResponse, PollOptionResponse, PollResponse, PollVoteResponse, PollVotesResponse, QueryBannedUsersPayload, QueryBannedUsersResponse, QueryCampaignsRequest, QueryCampaignsResponse, QueryChannelsRequest, QueryChannelsResponse, QueryMembersPayload, QueryMessageFlagsPayload, QueryMessageFlagsResponse, QueryMessageHistoryRequest, QueryMessageHistoryResponse, QueryPollVotesRequest, QueryPollsRequest, QueryPollsResponse, QueryReactionsRequest, QueryReactionsResponse, QuerySegmentTargetsRequest, QuerySegmentTargetsResponse, QuerySegmentsRequest, QuerySegmentsResponse, QueryThreadsRequest, QueryThreadsResponse, Response, SearchPayload, SearchResponse, SendEventRequest, SendMessageRequest, SendMessageResponse, SendReactionRequest, SendReactionResponse, SendUserCustomEventRequest, ShowChannelRequest, ShowChannelResponse, SortParamRequest, StartCampaignRequest, StartCampaignResponse, StopCampaignRequest, TranslateMessageRequest, TruncateChannelRequest, TruncateChannelResponse, UnmuteChannelRequest, UnmuteResponse, UnreadCountsBatchRequest, UnreadCountsBatchResponse, UpdateChannelPartialRequest, UpdateChannelPartialResponse, UpdateChannelRequest, UpdateChannelResponse, UpdateChannelTypeRequest, UpdateChannelTypeResponse, UpdateCommandRequest, UpdateCommandResponse, UpdateMemberPartialRequest, UpdateMemberPartialResponse, UpdateMessagePartialRequest, UpdateMessagePartialResponse, UpdateMessageRequest, UpdateMessageResponse, UpdatePollOptionRequest, UpdatePollPartialRequest, UpdatePollRequest, UpdateThreadPartialRequest, UpdateThreadPartialResponse, WrappedUnreadCountsResponse } from '../models';
3
+ import { CampaignResponse, CastPollVoteRequest, ChannelGetOrCreateRequest, ChannelStateResponse, CommitMessageRequest, CreateChannelTypeRequest, CreateChannelTypeResponse, CreateCommandRequest, CreateCommandResponse, CreatePollOptionRequest, CreatePollRequest, DeleteChannelResponse, DeleteChannelsRequest, DeleteChannelsResponse, DeleteCommandResponse, DeleteMessageResponse, DeleteReactionResponse, DeleteSegmentTargetsRequest, EventResponse, ExportChannelsRequest, ExportChannelsResponse, FileUploadRequest, FileUploadResponse, GetCampaignResponse, GetChannelTypeResponse, GetCommandResponse, GetExportChannelsStatusResponse, GetManyMessagesResponse, GetMessageResponse, GetReactionsResponse, GetRepliesResponse, GetSegmentResponse, GetThreadResponse, HideChannelRequest, HideChannelResponse, ImageUploadRequest, ImageUploadResponse, ListChannelTypesResponse, ListCommandsResponse, MarkChannelsReadRequest, MarkReadRequest, MarkReadResponse, MarkUnreadRequest, MembersResponse, MessageActionRequest, MessageResponse, MuteChannelRequest, MuteChannelResponse, PollOptionResponse, PollResponse, PollVoteResponse, PollVotesResponse, QueryBannedUsersPayload, QueryBannedUsersResponse, QueryCampaignsRequest, QueryCampaignsResponse, QueryChannelsRequest, QueryChannelsResponse, QueryMembersPayload, QueryMessageFlagsPayload, QueryMessageFlagsResponse, QueryMessageHistoryRequest, QueryMessageHistoryResponse, QueryPollVotesRequest, QueryPollsRequest, QueryPollsResponse, QueryReactionsRequest, QueryReactionsResponse, QuerySegmentTargetsRequest, QuerySegmentTargetsResponse, QuerySegmentsRequest, QuerySegmentsResponse, QueryThreadsRequest, QueryThreadsResponse, Response, SearchPayload, SearchResponse, SendEventRequest, SendMessageRequest, SendMessageResponse, SendReactionRequest, SendReactionResponse, SendUserCustomEventRequest, ShowChannelRequest, ShowChannelResponse, SortParamRequest, StartCampaignRequest, StartCampaignResponse, StopCampaignRequest, TranslateMessageRequest, TruncateChannelRequest, TruncateChannelResponse, UnmuteChannelRequest, UnmuteResponse, UnreadCountsBatchRequest, UnreadCountsBatchResponse, UpdateChannelPartialRequest, UpdateChannelPartialResponse, UpdateChannelRequest, UpdateChannelResponse, UpdateChannelTypeRequest, UpdateChannelTypeResponse, UpdateCommandRequest, UpdateCommandResponse, UpdateMemberPartialRequest, UpdateMemberPartialResponse, UpdateMessagePartialRequest, UpdateMessagePartialResponse, UpdateMessageRequest, UpdateMessageResponse, UpdatePollOptionRequest, UpdatePollPartialRequest, UpdatePollRequest, UpdateThreadPartialRequest, UpdateThreadPartialResponse, UpsertPushPreferencesRequest, UpsertPushPreferencesResponse, WrappedUnreadCountsResponse } from '../models';
4
4
  export declare class ChatApi extends BaseApi {
5
5
  queryCampaigns: (request?: QueryCampaignsRequest) => Promise<StreamResponse<QueryCampaignsResponse>>;
6
6
  getCampaign: (request: {
@@ -231,6 +231,7 @@ export declare class ChatApi extends BaseApi {
231
231
  poll_id: string;
232
232
  user_id?: string;
233
233
  }) => Promise<StreamResponse<PollVotesResponse>>;
234
+ updatePushNotificationPreferences: (request: UpsertPushPreferencesRequest) => Promise<StreamResponse<UpsertPushPreferencesResponse>>;
234
235
  queryBannedUsers: (request?: {
235
236
  payload?: QueryBannedUsersPayload;
236
237
  }) => Promise<StreamResponse<QueryBannedUsersResponse>>;
@@ -91,7 +91,6 @@ export interface ActionLogResponse {
91
91
  user?: UserResponse;
92
92
  }
93
93
  export interface AggregatedStats {
94
- countrywise_aggregate_stats?: Record<string, CountrywiseAggregateStats>;
95
94
  publisher_aggregate_stats?: PublisherAggregateStats;
96
95
  turn?: TURNAggregatedStats;
97
96
  }
@@ -538,22 +537,26 @@ export interface CallRecording {
538
537
  export interface CallRecordingFailedEvent {
539
538
  call_cid: string;
540
539
  created_at: Date;
540
+ egress_id: string;
541
541
  type: string;
542
542
  }
543
543
  export interface CallRecordingReadyEvent {
544
544
  call_cid: string;
545
545
  created_at: Date;
546
+ egress_id: string;
546
547
  call_recording: CallRecording;
547
548
  type: string;
548
549
  }
549
550
  export interface CallRecordingStartedEvent {
550
551
  call_cid: string;
551
552
  created_at: Date;
553
+ egress_id: string;
552
554
  type: string;
553
555
  }
554
556
  export interface CallRecordingStoppedEvent {
555
557
  call_cid: string;
556
558
  created_at: Date;
559
+ egress_id: string;
557
560
  type: string;
558
561
  }
559
562
  export interface CallRejectedEvent {
@@ -743,22 +746,26 @@ export interface CallTranscription {
743
746
  export interface CallTranscriptionFailedEvent {
744
747
  call_cid: string;
745
748
  created_at: Date;
749
+ egress_id: string;
746
750
  type: string;
747
751
  }
748
752
  export interface CallTranscriptionReadyEvent {
749
753
  call_cid: string;
750
754
  created_at: Date;
755
+ egress_id: string;
751
756
  call_transcription: CallTranscription;
752
757
  type: string;
753
758
  }
754
759
  export interface CallTranscriptionStartedEvent {
755
760
  call_cid: string;
756
761
  created_at: Date;
762
+ egress_id: string;
757
763
  type: string;
758
764
  }
759
765
  export interface CallTranscriptionStoppedEvent {
760
766
  call_cid: string;
761
767
  created_at: Date;
768
+ egress_id: string;
762
769
  type: string;
763
770
  }
764
771
  export interface CallType {
@@ -809,6 +816,7 @@ export interface CampaignChannelTemplate {
809
816
  }
810
817
  export interface CampaignCompletedEvent {
811
818
  created_at: Date;
819
+ custom: Record<string, any>;
812
820
  type: string;
813
821
  received_at?: Date;
814
822
  campaign?: CampaignResponse;
@@ -844,6 +852,7 @@ export interface CampaignResponse {
844
852
  }
845
853
  export interface CampaignStartedEvent {
846
854
  created_at: Date;
855
+ custom: Record<string, any>;
847
856
  type: string;
848
857
  received_at?: Date;
849
858
  campaign?: CampaignResponse;
@@ -1104,6 +1113,10 @@ export declare const ChannelOwnCapability: {
1104
1113
  readonly UPLOAD_FILE: "upload-file";
1105
1114
  };
1106
1115
  export type ChannelOwnCapability = (typeof ChannelOwnCapability)[keyof typeof ChannelOwnCapability];
1116
+ export interface ChannelPushPreferences {
1117
+ chat_level?: string;
1118
+ disabled_until?: Date;
1119
+ }
1107
1120
  export interface ChannelResponse {
1108
1121
  cid: string;
1109
1122
  created_at: Date;
@@ -1146,6 +1159,7 @@ export interface ChannelStateResponse {
1146
1159
  watchers?: UserResponse[];
1147
1160
  channel?: ChannelResponse;
1148
1161
  membership?: ChannelMember;
1162
+ push_preferences?: ChannelPushPreferences;
1149
1163
  }
1150
1164
  export interface ChannelStateResponseFields {
1151
1165
  members: ChannelMember[];
@@ -1160,6 +1174,7 @@ export interface ChannelStateResponseFields {
1160
1174
  watchers?: UserResponse[];
1161
1175
  channel?: ChannelResponse;
1162
1176
  membership?: ChannelMember;
1177
+ push_preferences?: ChannelPushPreferences;
1163
1178
  }
1164
1179
  export interface ChannelTruncatedEvent {
1165
1180
  channel_id: string;
@@ -1367,13 +1382,6 @@ export interface Count {
1367
1382
  approximate: boolean;
1368
1383
  value: number;
1369
1384
  }
1370
- export interface CountrywiseAggregateStats {
1371
- participant_count?: Count;
1372
- publisher_jitter?: TimeStats;
1373
- publisher_latency?: TimeStats;
1374
- subscriber_jitter?: TimeStats;
1375
- subscriber_latency?: TimeStats;
1376
- }
1377
1385
  export interface CreateBlockListRequest {
1378
1386
  name: string;
1379
1387
  words: string[];
@@ -1752,6 +1760,7 @@ export interface EdgeResponse {
1752
1760
  }
1753
1761
  export interface EgressHLSResponse {
1754
1762
  playlist_url: string;
1763
+ status: string;
1755
1764
  }
1756
1765
  export interface EgressRTMPResponse {
1757
1766
  name: string;
@@ -1818,7 +1827,6 @@ export interface EntityCreator {
1818
1827
  updated_at?: Date;
1819
1828
  teams?: string[];
1820
1829
  privacy_settings?: PrivacySettings;
1821
- push_notifications?: PushNotificationSettings;
1822
1830
  }
1823
1831
  export interface EntityCreatorResponse {
1824
1832
  ban_count: number;
@@ -1833,7 +1841,6 @@ export interface EntityCreatorResponse {
1833
1841
  shadow_banned: boolean;
1834
1842
  updated_at: Date;
1835
1843
  blocked_user_ids: string[];
1836
- devices: DeviceResponse[];
1837
1844
  teams: string[];
1838
1845
  custom: Record<string, any>;
1839
1846
  ban_expires?: Date;
@@ -1843,6 +1850,7 @@ export interface EntityCreatorResponse {
1843
1850
  last_active?: Date;
1844
1851
  name?: string;
1845
1852
  revoke_tokens_issued_before?: Date;
1853
+ devices?: DeviceResponse[];
1846
1854
  privacy_settings?: PrivacySettingsResponse;
1847
1855
  push_notifications?: PushNotificationSettingsResponse;
1848
1856
  }
@@ -2023,6 +2031,7 @@ export interface FlagResponse {
2023
2031
  }
2024
2032
  export interface FlagUpdatedEvent {
2025
2033
  created_at: Date;
2034
+ custom: Record<string, any>;
2026
2035
  type: string;
2027
2036
  received_at?: Date;
2028
2037
  created_by?: UserResponse;
@@ -2057,7 +2066,6 @@ export interface FullUserResponse {
2057
2066
  revoke_tokens_issued_before?: Date;
2058
2067
  latest_hidden_channels?: string[];
2059
2068
  privacy_settings?: PrivacySettingsResponse;
2060
- push_notifications?: PushNotificationSettingsResponse;
2061
2069
  }
2062
2070
  export interface GeofenceResponse {
2063
2071
  name: string;
@@ -2718,10 +2726,11 @@ export interface MessageReadEvent {
2718
2726
  cid: string;
2719
2727
  created_at: Date;
2720
2728
  type: string;
2729
+ channel_last_message_at?: Date;
2721
2730
  last_read_message_id?: string;
2722
2731
  team?: string;
2723
2732
  thread?: ThreadResponse;
2724
- user?: UserResponse;
2733
+ user?: UserResponseCommonFields;
2725
2734
  }
2726
2735
  export interface MessageRequest {
2727
2736
  html?: string;
@@ -2875,6 +2884,7 @@ export interface ModerationCustomActionEvent {
2875
2884
  }
2876
2885
  export interface ModerationEvent {
2877
2886
  created_at: Date;
2887
+ custom: Record<string, any>;
2878
2888
  type: string;
2879
2889
  received_at?: Date;
2880
2890
  flags?: Flag2Response[];
@@ -3008,13 +3018,7 @@ export interface NotificationSettings {
3008
3018
  call_ring: EventNotificationSettings;
3009
3019
  session_started: EventNotificationSettings;
3010
3020
  }
3011
- export interface NullBool {
3012
- has_value?: boolean;
3013
- value?: boolean;
3014
- }
3015
3021
  export interface NullTime {
3016
- has_value?: boolean;
3017
- value?: Date;
3018
3022
  }
3019
3023
  export interface OnlyUserID {
3020
3024
  id: string;
@@ -3075,7 +3079,7 @@ export interface OwnUser {
3075
3079
  latest_hidden_channels?: string[];
3076
3080
  teams?: string[];
3077
3081
  privacy_settings?: PrivacySettings;
3078
- push_notifications?: PushNotificationSettings;
3082
+ push_preferences?: PushPreferences;
3079
3083
  }
3080
3084
  export interface OwnUserResponse {
3081
3085
  banned: boolean;
@@ -3104,7 +3108,7 @@ export interface OwnUserResponse {
3104
3108
  blocked_user_ids?: string[];
3105
3109
  latest_hidden_channels?: string[];
3106
3110
  privacy_settings?: PrivacySettingsResponse;
3107
- push_notifications?: PushNotificationSettingsResponse;
3111
+ push_preferences?: PushPreferences;
3108
3112
  }
3109
3113
  export interface PaginationParams {
3110
3114
  limit?: number;
@@ -3308,16 +3312,20 @@ export interface PushNotificationFields {
3308
3312
  xiaomi: XiaomiConfigFields;
3309
3313
  providers?: PushProvider[];
3310
3314
  }
3311
- export interface PushNotificationSettings {
3315
+ export interface PushNotificationSettingsResponse {
3312
3316
  disabled?: boolean;
3313
3317
  disabled_until?: Date;
3314
3318
  }
3315
- export interface PushNotificationSettingsInput {
3316
- disabled?: NullBool;
3317
- disabled_until?: NullTime;
3319
+ export interface PushPreferenceInput {
3320
+ channel_cid?: string;
3321
+ chat_level?: 'all' | 'mentions' | 'none' | 'default';
3322
+ disabled_until?: Date;
3323
+ remove_disable?: boolean;
3324
+ user_id?: string;
3318
3325
  }
3319
- export interface PushNotificationSettingsResponse {
3320
- disabled?: boolean;
3326
+ export interface PushPreferences {
3327
+ call_level?: string;
3328
+ chat_level?: string;
3321
3329
  disabled_until?: Date;
3322
3330
  }
3323
3331
  export interface PushProvider {
@@ -3610,7 +3618,7 @@ export interface QueryReviewQueueResponse {
3610
3618
  duration: string;
3611
3619
  items: ReviewQueueItemResponse[];
3612
3620
  action_config: Record<string, ModerationActionConfig[]>;
3613
- stats: Record<string, number>;
3621
+ stats: Record<string, any>;
3614
3622
  next?: string;
3615
3623
  prev?: string;
3616
3624
  }
@@ -3895,7 +3903,6 @@ export interface ReviewQueueItem {
3895
3903
  flags: Flag2[];
3896
3904
  languages: string[];
3897
3905
  teams: string[];
3898
- completed_at: NullTime;
3899
3906
  reviewed_at: NullTime;
3900
3907
  assigned_to?: User;
3901
3908
  entity_creator?: EntityCreator;
@@ -4798,6 +4805,14 @@ export interface UpsertModerationTemplateResponse {
4798
4805
  updated_at: Date;
4799
4806
  config?: FeedsModerationTemplateConfig;
4800
4807
  }
4808
+ export interface UpsertPushPreferencesRequest {
4809
+ preferences: PushPreferenceInput[];
4810
+ }
4811
+ export interface UpsertPushPreferencesResponse {
4812
+ duration: string;
4813
+ user_channel_preferences: Record<string, Record<string, ChannelPushPreferences>>;
4814
+ user_preferences: Record<string, PushPreferences>;
4815
+ }
4801
4816
  export interface UpsertPushProviderRequest {
4802
4817
  push_provider?: PushProvider;
4803
4818
  }
@@ -4823,7 +4838,6 @@ export interface User {
4823
4838
  updated_at?: Date;
4824
4839
  teams?: string[];
4825
4840
  privacy_settings?: PrivacySettings;
4826
- push_notifications?: PushNotificationSettings;
4827
4841
  }
4828
4842
  export interface UserBannedEvent {
4829
4843
  channel_id: string;
@@ -4861,26 +4875,6 @@ export interface UserDeletedEvent {
4861
4875
  type: string;
4862
4876
  user?: User;
4863
4877
  }
4864
- export interface UserEventPayload {
4865
- banned: boolean;
4866
- created_at: Date;
4867
- id: string;
4868
- language: string;
4869
- online: boolean;
4870
- role: string;
4871
- updated_at: Date;
4872
- blocked_user_ids: string[];
4873
- teams: string[];
4874
- custom: Record<string, any>;
4875
- deactivated_at?: Date;
4876
- deleted_at?: Date;
4877
- image?: string;
4878
- invisible?: boolean;
4879
- last_active?: Date;
4880
- name?: string;
4881
- revoke_tokens_issued_before?: Date;
4882
- privacy_settings?: PrivacySettingsResponse;
4883
- }
4884
4878
  export interface UserFeedbackReport {
4885
4879
  unreported_count: number;
4886
4880
  count_by_rating: Record<string, number>;
@@ -4953,7 +4947,6 @@ export interface UserRequest {
4953
4947
  teams?: string[];
4954
4948
  custom?: Record<string, any>;
4955
4949
  privacy_settings?: PrivacySettingsResponse;
4956
- push_notifications?: PushNotificationSettingsInput;
4957
4950
  }
4958
4951
  export interface UserResponse {
4959
4952
  banned: boolean;
@@ -4966,7 +4959,6 @@ export interface UserResponse {
4966
4959
  shadow_banned: boolean;
4967
4960
  updated_at: Date;
4968
4961
  blocked_user_ids: string[];
4969
- devices: DeviceResponse[];
4970
4962
  teams: string[];
4971
4963
  custom: Record<string, any>;
4972
4964
  ban_expires?: Date;
@@ -4976,9 +4968,48 @@ export interface UserResponse {
4976
4968
  last_active?: Date;
4977
4969
  name?: string;
4978
4970
  revoke_tokens_issued_before?: Date;
4971
+ devices?: DeviceResponse[];
4979
4972
  privacy_settings?: PrivacySettingsResponse;
4980
4973
  push_notifications?: PushNotificationSettingsResponse;
4981
4974
  }
4975
+ export interface UserResponseCommonFields {
4976
+ banned: boolean;
4977
+ created_at: Date;
4978
+ id: string;
4979
+ language: string;
4980
+ online: boolean;
4981
+ role: string;
4982
+ updated_at: Date;
4983
+ blocked_user_ids: string[];
4984
+ teams: string[];
4985
+ custom: Record<string, any>;
4986
+ deactivated_at?: Date;
4987
+ deleted_at?: Date;
4988
+ image?: string;
4989
+ last_active?: Date;
4990
+ name?: string;
4991
+ revoke_tokens_issued_before?: Date;
4992
+ }
4993
+ export interface UserResponsePrivacyFields {
4994
+ banned: boolean;
4995
+ created_at: Date;
4996
+ id: string;
4997
+ language: string;
4998
+ online: boolean;
4999
+ role: string;
5000
+ updated_at: Date;
5001
+ blocked_user_ids: string[];
5002
+ teams: string[];
5003
+ custom: Record<string, any>;
5004
+ deactivated_at?: Date;
5005
+ deleted_at?: Date;
5006
+ image?: string;
5007
+ invisible?: boolean;
5008
+ last_active?: Date;
5009
+ name?: string;
5010
+ revoke_tokens_issued_before?: Date;
5011
+ privacy_settings?: PrivacySettingsResponse;
5012
+ }
4982
5013
  export interface UserSessionStats {
4983
5014
  freeze_duration_seconds: number;
4984
5015
  group: string;
@@ -5064,7 +5095,8 @@ export interface UserUnreadReminderEvent {
5064
5095
  }
5065
5096
  export interface UserUpdatedEvent {
5066
5097
  created_at: Date;
5067
- user: UserEventPayload;
5098
+ custom: Record<string, any>;
5099
+ user: UserResponsePrivacyFields;
5068
5100
  type: string;
5069
5101
  received_at?: Date;
5070
5102
  }
@@ -5129,6 +5161,7 @@ export interface WSEvent {
5129
5161
  custom: Record<string, any>;
5130
5162
  automoderation?: boolean;
5131
5163
  channel_id?: string;
5164
+ channel_last_message_at?: Date;
5132
5165
  channel_type?: string;
5133
5166
  cid?: string;
5134
5167
  connection_id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/node-sdk",
3
- "version": "0.4.10",
3
+ "version": "0.4.11",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -116,6 +116,8 @@ import {
116
116
  UpdatePollRequest,
117
117
  UpdateThreadPartialRequest,
118
118
  UpdateThreadPartialResponse,
119
+ UpsertPushPreferencesRequest,
120
+ UpsertPushPreferencesResponse,
119
121
  WrappedUnreadCountsResponse,
120
122
  } from '../models';
121
123
  import { decoders } from '../model-decoders';
@@ -1817,6 +1819,22 @@ export class ChatApi extends BaseApi {
1817
1819
  return { ...response.body, metadata: response.metadata };
1818
1820
  };
1819
1821
 
1822
+ updatePushNotificationPreferences = async (
1823
+ request: UpsertPushPreferencesRequest,
1824
+ ): Promise<StreamResponse<UpsertPushPreferencesResponse>> => {
1825
+ const body = {
1826
+ preferences: request?.preferences,
1827
+ };
1828
+
1829
+ const response = await this.sendRequest<
1830
+ StreamResponse<UpsertPushPreferencesResponse>
1831
+ >('POST', '/api/v2/chat/push_preferences', undefined, undefined, body);
1832
+
1833
+ decoders.UpsertPushPreferencesResponse?.(response.body);
1834
+
1835
+ return { ...response.body, metadata: response.metadata };
1836
+ };
1837
+
1820
1838
  queryBannedUsers = async (request?: {
1821
1839
  payload?: QueryBannedUsersPayload;
1822
1840
  }): Promise<StreamResponse<QueryBannedUsersResponse>> => {
@@ -381,6 +381,13 @@ decoders.ChannelMute = (input?: Record<string, any>) => {
381
381
  return decode(typeMappings, input);
382
382
  };
383
383
 
384
+ decoders.ChannelPushPreferences = (input?: Record<string, any>) => {
385
+ const typeMappings: TypeMapping = {
386
+ disabled_until: { type: 'DatetimeType', isSingle: true },
387
+ };
388
+ return decode(typeMappings, input);
389
+ };
390
+
384
391
  decoders.ChannelResponse = (input?: Record<string, any>) => {
385
392
  const typeMappings: TypeMapping = {
386
393
  created_at: { type: 'DatetimeType', isSingle: true },
@@ -429,6 +436,8 @@ decoders.ChannelStateResponse = (input?: Record<string, any>) => {
429
436
  channel: { type: 'ChannelResponse', isSingle: true },
430
437
 
431
438
  membership: { type: 'ChannelMember', isSingle: true },
439
+
440
+ push_preferences: { type: 'ChannelPushPreferences', isSingle: true },
432
441
  };
433
442
  return decode(typeMappings, input);
434
443
  };
@@ -454,6 +463,8 @@ decoders.ChannelStateResponseFields = (input?: Record<string, any>) => {
454
463
  channel: { type: 'ChannelResponse', isSingle: true },
455
464
 
456
465
  membership: { type: 'ChannelMember', isSingle: true },
466
+
467
+ push_preferences: { type: 'ChannelPushPreferences', isSingle: true },
457
468
  };
458
469
  return decode(typeMappings, input);
459
470
  };
@@ -622,8 +633,6 @@ decoders.EntityCreator = (input?: Record<string, any>) => {
622
633
  revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
623
634
 
624
635
  updated_at: { type: 'DatetimeType', isSingle: true },
625
-
626
- push_notifications: { type: 'PushNotificationSettings', isSingle: true },
627
636
  };
628
637
  return decode(typeMappings, input);
629
638
  };
@@ -634,8 +643,6 @@ decoders.EntityCreatorResponse = (input?: Record<string, any>) => {
634
643
 
635
644
  updated_at: { type: 'DatetimeType', isSingle: true },
636
645
 
637
- devices: { type: 'DeviceResponse', isSingle: false },
638
-
639
646
  ban_expires: { type: 'DatetimeType', isSingle: true },
640
647
 
641
648
  deactivated_at: { type: 'DatetimeType', isSingle: true },
@@ -646,6 +653,8 @@ decoders.EntityCreatorResponse = (input?: Record<string, any>) => {
646
653
 
647
654
  revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
648
655
 
656
+ devices: { type: 'DeviceResponse', isSingle: false },
657
+
649
658
  push_notifications: {
650
659
  type: 'PushNotificationSettingsResponse',
651
660
  isSingle: true,
@@ -727,11 +736,6 @@ decoders.FullUserResponse = (input?: Record<string, any>) => {
727
736
  last_active: { type: 'DatetimeType', isSingle: true },
728
737
 
729
738
  revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
730
-
731
- push_notifications: {
732
- type: 'PushNotificationSettingsResponse',
733
- isSingle: true,
734
- },
735
739
  };
736
740
  return decode(typeMappings, input);
737
741
  };
@@ -1109,9 +1113,11 @@ decoders.MessageReadEvent = (input?: Record<string, any>) => {
1109
1113
  const typeMappings: TypeMapping = {
1110
1114
  created_at: { type: 'DatetimeType', isSingle: true },
1111
1115
 
1116
+ channel_last_message_at: { type: 'DatetimeType', isSingle: true },
1117
+
1112
1118
  thread: { type: 'ThreadResponse', isSingle: true },
1113
1119
 
1114
- user: { type: 'UserResponse', isSingle: true },
1120
+ user: { type: 'UserResponseCommonFields', isSingle: true },
1115
1121
  };
1116
1122
  return decode(typeMappings, input);
1117
1123
  };
@@ -1217,13 +1223,6 @@ decoders.MuteResponse = (input?: Record<string, any>) => {
1217
1223
  return decode(typeMappings, input);
1218
1224
  };
1219
1225
 
1220
- decoders.NullTime = (input?: Record<string, any>) => {
1221
- const typeMappings: TypeMapping = {
1222
- value: { type: 'DatetimeType', isSingle: true },
1223
- };
1224
- return decode(typeMappings, input);
1225
- };
1226
-
1227
1226
  decoders.OwnUser = (input?: Record<string, any>) => {
1228
1227
  const typeMappings: TypeMapping = {
1229
1228
  created_at: { type: 'DatetimeType', isSingle: true },
@@ -1244,7 +1243,7 @@ decoders.OwnUser = (input?: Record<string, any>) => {
1244
1243
 
1245
1244
  last_engaged_at: { type: 'DatetimeType', isSingle: true },
1246
1245
 
1247
- push_notifications: { type: 'PushNotificationSettings', isSingle: true },
1246
+ push_preferences: { type: 'PushPreferences', isSingle: true },
1248
1247
  };
1249
1248
  return decode(typeMappings, input);
1250
1249
  };
@@ -1269,10 +1268,7 @@ decoders.OwnUserResponse = (input?: Record<string, any>) => {
1269
1268
 
1270
1269
  revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
1271
1270
 
1272
- push_notifications: {
1273
- type: 'PushNotificationSettingsResponse',
1274
- isSingle: true,
1275
- },
1271
+ push_preferences: { type: 'PushPreferences', isSingle: true },
1276
1272
  };
1277
1273
  return decode(typeMappings, input);
1278
1274
  };
@@ -1368,14 +1364,14 @@ decoders.PushNotificationFields = (input?: Record<string, any>) => {
1368
1364
  return decode(typeMappings, input);
1369
1365
  };
1370
1366
 
1371
- decoders.PushNotificationSettings = (input?: Record<string, any>) => {
1367
+ decoders.PushNotificationSettingsResponse = (input?: Record<string, any>) => {
1372
1368
  const typeMappings: TypeMapping = {
1373
1369
  disabled_until: { type: 'DatetimeType', isSingle: true },
1374
1370
  };
1375
1371
  return decode(typeMappings, input);
1376
1372
  };
1377
1373
 
1378
- decoders.PushNotificationSettingsResponse = (input?: Record<string, any>) => {
1374
+ decoders.PushPreferences = (input?: Record<string, any>) => {
1379
1375
  const typeMappings: TypeMapping = {
1380
1376
  disabled_until: { type: 'DatetimeType', isSingle: true },
1381
1377
  };
@@ -1607,10 +1603,6 @@ decoders.ReviewQueueItem = (input?: Record<string, any>) => {
1607
1603
 
1608
1604
  flags: { type: 'Flag2', isSingle: false },
1609
1605
 
1610
- completed_at: { type: 'NullTime', isSingle: true },
1611
-
1612
- reviewed_at: { type: 'NullTime', isSingle: true },
1613
-
1614
1606
  assigned_to: { type: 'User', isSingle: true },
1615
1607
 
1616
1608
  entity_creator: { type: 'EntityCreator', isSingle: true },
@@ -1980,6 +1972,13 @@ decoders.UpsertModerationTemplateResponse = (input?: Record<string, any>) => {
1980
1972
  return decode(typeMappings, input);
1981
1973
  };
1982
1974
 
1975
+ decoders.UpsertPushPreferencesResponse = (input?: Record<string, any>) => {
1976
+ const typeMappings: TypeMapping = {
1977
+ user_preferences: { type: 'PushPreferences', isSingle: false },
1978
+ };
1979
+ return decode(typeMappings, input);
1980
+ };
1981
+
1983
1982
  decoders.UpsertPushProviderResponse = (input?: Record<string, any>) => {
1984
1983
  const typeMappings: TypeMapping = {
1985
1984
  push_provider: { type: 'PushProviderResponse', isSingle: true },
@@ -2004,8 +2003,6 @@ decoders.User = (input?: Record<string, any>) => {
2004
2003
  revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
2005
2004
 
2006
2005
  updated_at: { type: 'DatetimeType', isSingle: true },
2007
-
2008
- push_notifications: { type: 'PushNotificationSettings', isSingle: true },
2009
2006
  };
2010
2007
  return decode(typeMappings, input);
2011
2008
  };
@@ -2053,8 +2050,6 @@ decoders.UserResponse = (input?: Record<string, any>) => {
2053
2050
 
2054
2051
  updated_at: { type: 'DatetimeType', isSingle: true },
2055
2052
 
2056
- devices: { type: 'DeviceResponse', isSingle: false },
2057
-
2058
2053
  ban_expires: { type: 'DatetimeType', isSingle: true },
2059
2054
 
2060
2055
  deactivated_at: { type: 'DatetimeType', isSingle: true },
@@ -2065,6 +2060,8 @@ decoders.UserResponse = (input?: Record<string, any>) => {
2065
2060
 
2066
2061
  revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
2067
2062
 
2063
+ devices: { type: 'DeviceResponse', isSingle: false },
2064
+
2068
2065
  push_notifications: {
2069
2066
  type: 'PushNotificationSettingsResponse',
2070
2067
  isSingle: true,
@@ -2073,10 +2070,29 @@ decoders.UserResponse = (input?: Record<string, any>) => {
2073
2070
  return decode(typeMappings, input);
2074
2071
  };
2075
2072
 
2073
+ decoders.UserResponseCommonFields = (input?: Record<string, any>) => {
2074
+ const typeMappings: TypeMapping = {
2075
+ created_at: { type: 'DatetimeType', isSingle: true },
2076
+
2077
+ updated_at: { type: 'DatetimeType', isSingle: true },
2078
+
2079
+ deactivated_at: { type: 'DatetimeType', isSingle: true },
2080
+
2081
+ deleted_at: { type: 'DatetimeType', isSingle: true },
2082
+
2083
+ last_active: { type: 'DatetimeType', isSingle: true },
2084
+
2085
+ revoke_tokens_issued_before: { type: 'DatetimeType', isSingle: true },
2086
+ };
2087
+ return decode(typeMappings, input);
2088
+ };
2089
+
2076
2090
  decoders.WSEvent = (input?: Record<string, any>) => {
2077
2091
  const typeMappings: TypeMapping = {
2078
2092
  created_at: { type: 'DatetimeType', isSingle: true },
2079
2093
 
2094
+ channel_last_message_at: { type: 'DatetimeType', isSingle: true },
2095
+
2080
2096
  channel: { type: 'ChannelResponse', isSingle: true },
2081
2097
 
2082
2098
  created_by: { type: 'UserResponse', isSingle: true },