@stream-io/node-sdk 0.4.18 → 0.4.20

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.
@@ -162,6 +162,16 @@ export interface AsyncExportErrorEvent {
162
162
  type: string;
163
163
  received_at?: Date;
164
164
  }
165
+ export interface AsyncExportModerationLogsEvent {
166
+ created_at: Date;
167
+ finished_at: Date;
168
+ started_at: Date;
169
+ task_id: string;
170
+ url: string;
171
+ custom: Record<string, any>;
172
+ type: string;
173
+ received_at?: Date;
174
+ }
165
175
  export interface AsyncExportUsersEvent {
166
176
  created_at: Date;
167
177
  finished_at: Date;
@@ -866,6 +876,18 @@ export interface CallUpdatedEvent {
866
876
  capabilities_by_role: Record<string, string[]>;
867
877
  type: string;
868
878
  }
879
+ export interface CallUserFeedbackSubmittedEvent {
880
+ call_cid: string;
881
+ created_at: Date;
882
+ rating: number;
883
+ session_id: string;
884
+ user: UserResponse;
885
+ type: string;
886
+ reason?: string;
887
+ sdk?: string;
888
+ sdk_version?: string;
889
+ custom?: Record<string, any>;
890
+ }
869
891
  export interface CallUserMutedEvent {
870
892
  call_cid: string;
871
893
  created_at: Date;
@@ -935,6 +957,8 @@ export interface CampaignStatsResponse {
935
957
  stats_completed_at: Date;
936
958
  stats_messages_sent: number;
937
959
  stats_started_at: Date;
960
+ stats_users_read: number;
961
+ stats_users_sent: number;
938
962
  }
939
963
  export interface CastPollVoteRequest {
940
964
  user_id?: string;
@@ -954,6 +978,7 @@ export interface Channel {
954
978
  auto_translation_enabled?: boolean;
955
979
  cooldown?: number;
956
980
  deleted_at?: Date;
981
+ last_campaigns?: string;
957
982
  last_message_at?: Date;
958
983
  member_count?: number;
959
984
  team?: string;
@@ -1231,6 +1256,7 @@ export interface ChannelStateResponse {
1231
1256
  read?: ReadStateResponse[];
1232
1257
  watchers?: UserResponse[];
1233
1258
  channel?: ChannelResponse;
1259
+ draft?: DraftResponse;
1234
1260
  membership?: ChannelMember;
1235
1261
  push_preferences?: ChannelPushPreferences;
1236
1262
  }
@@ -1246,6 +1272,7 @@ export interface ChannelStateResponseFields {
1246
1272
  read?: ReadStateResponse[];
1247
1273
  watchers?: UserResponse[];
1248
1274
  channel?: ChannelResponse;
1275
+ draft?: DraftResponse;
1249
1276
  membership?: ChannelMember;
1250
1277
  push_preferences?: ChannelPushPreferences;
1251
1278
  }
@@ -1825,6 +1852,30 @@ export interface DeviceResponse {
1825
1852
  push_provider_name?: string;
1826
1853
  voip?: boolean;
1827
1854
  }
1855
+ export interface DraftPayloadResponse {
1856
+ id: string;
1857
+ text: string;
1858
+ custom: Record<string, any>;
1859
+ html?: string;
1860
+ mml?: string;
1861
+ parent_id?: string;
1862
+ poll_id?: string;
1863
+ quoted_message_id?: string;
1864
+ show_in_channel?: boolean;
1865
+ silent?: boolean;
1866
+ type?: string;
1867
+ attachments?: Attachment[];
1868
+ mentioned_users?: UserResponse[];
1869
+ }
1870
+ export interface DraftResponse {
1871
+ channel_cid: string;
1872
+ created_at: Date;
1873
+ message: DraftPayloadResponse;
1874
+ parent_id?: string;
1875
+ channel?: ChannelResponse;
1876
+ parent_message?: MessageResponse;
1877
+ quoted_message?: MessageResponse;
1878
+ }
1828
1879
  export interface EdgeResponse {
1829
1880
  continent_code: string;
1830
1881
  country_iso_code: string;
@@ -1895,6 +1946,7 @@ export interface EntityCreator {
1895
1946
  online: boolean;
1896
1947
  role: string;
1897
1948
  custom: Record<string, any>;
1949
+ teams_role: Record<string, string>;
1898
1950
  ban_expires?: Date;
1899
1951
  created_at?: Date;
1900
1952
  deactivated_at?: Date;
@@ -1934,6 +1986,7 @@ export interface EntityCreatorResponse {
1934
1986
  devices?: DeviceResponse[];
1935
1987
  privacy_settings?: PrivacySettingsResponse;
1936
1988
  push_notifications?: PushNotificationSettingsResponse;
1989
+ teams_role?: Record<string, string>;
1937
1990
  }
1938
1991
  export interface ErrorResult {
1939
1992
  type: string;
@@ -1988,7 +2041,6 @@ export interface ExternalStorageResponse {
1988
2041
  }
1989
2042
  export interface FPSStats {
1990
2043
  average_fps: number;
1991
- harmonic_fps: number;
1992
2044
  tracked: number;
1993
2045
  }
1994
2046
  export interface FeedsModerationTemplateConfig {
@@ -2033,22 +2085,6 @@ export interface FirebaseConfigFields {
2033
2085
  server_key?: string;
2034
2086
  }
2035
2087
  export interface Flag {
2036
- created_at: Date;
2037
- created_by_automod: boolean;
2038
- updated_at: Date;
2039
- approved_at?: Date;
2040
- reason?: string;
2041
- rejected_at?: Date;
2042
- reviewed_at?: Date;
2043
- reviewed_by?: string;
2044
- target_message_id?: string;
2045
- custom?: Record<string, any>;
2046
- details?: FlagDetails;
2047
- target_message?: Message;
2048
- target_user?: User;
2049
- user?: User;
2050
- }
2051
- export interface Flag2 {
2052
2088
  created_at: Date;
2053
2089
  entity_id: string;
2054
2090
  entity_type: string;
@@ -2064,22 +2100,6 @@ export interface Flag2 {
2064
2100
  moderation_payload?: ModerationPayload;
2065
2101
  user?: User;
2066
2102
  }
2067
- export interface Flag2Response {
2068
- created_at: Date;
2069
- entity_id: string;
2070
- entity_type: string;
2071
- updated_at: Date;
2072
- user_id: string;
2073
- result: Array<Record<string, any>>;
2074
- entity_creator_id?: string;
2075
- reason?: string;
2076
- review_queue_item_id?: string;
2077
- type?: string;
2078
- labels?: string[];
2079
- custom?: Record<string, any>;
2080
- moderation_payload?: ModerationPayload;
2081
- user?: UserResponse;
2082
- }
2083
2103
  export interface FlagDetails {
2084
2104
  original_text: string;
2085
2105
  extra: Record<string, any>;
@@ -2157,6 +2177,7 @@ export interface FullUserResponse {
2157
2177
  mutes: UserMuteResponse[];
2158
2178
  teams: string[];
2159
2179
  custom: Record<string, any>;
2180
+ ban_expires?: Date;
2160
2181
  deactivated_at?: Date;
2161
2182
  deleted_at?: Date;
2162
2183
  image?: string;
@@ -2165,6 +2186,7 @@ export interface FullUserResponse {
2165
2186
  revoke_tokens_issued_before?: Date;
2166
2187
  latest_hidden_channels?: string[];
2167
2188
  privacy_settings?: PrivacySettingsResponse;
2189
+ teams_role?: Record<string, string>;
2168
2190
  }
2169
2191
  export interface GeofenceResponse {
2170
2192
  name: string;
@@ -2220,6 +2242,7 @@ export interface GetCallStatsResponse {
2220
2242
  call_duration_seconds: number;
2221
2243
  call_status: string;
2222
2244
  duration: string;
2245
+ is_truncated_report: boolean;
2223
2246
  max_freezes_duration_seconds: number;
2224
2247
  max_participants: number;
2225
2248
  max_total_quality_limitation_duration_seconds: number;
@@ -2247,6 +2270,7 @@ export interface GetCallTypeResponse {
2247
2270
  export interface GetCampaignResponse {
2248
2271
  duration: string;
2249
2272
  campaign?: CampaignResponse;
2273
+ users?: PagerResponse;
2250
2274
  }
2251
2275
  export interface GetChannelTypeResponse {
2252
2276
  automod: 'disabled' | 'simple' | 'AI';
@@ -2300,6 +2324,10 @@ export interface GetCustomPermissionResponse {
2300
2324
  duration: string;
2301
2325
  permission: Permission;
2302
2326
  }
2327
+ export interface GetDraftResponse {
2328
+ duration: string;
2329
+ draft: DraftResponse;
2330
+ }
2303
2331
  export interface GetEdgesResponse {
2304
2332
  duration: string;
2305
2333
  edges: EdgeResponse[];
@@ -2317,14 +2345,6 @@ export interface GetMessageResponse {
2317
2345
  message: MessageWithChannelResponse;
2318
2346
  pending_message_metadata?: Record<string, string>;
2319
2347
  }
2320
- export interface GetModerationAnalyticsRequest {
2321
- end_date?: string;
2322
- start_date?: string;
2323
- }
2324
- export interface GetModerationAnalyticsResponse {
2325
- duration: string;
2326
- analytics?: ModerationAnalytics;
2327
- }
2328
2348
  export interface GetOGResponse {
2329
2349
  duration: string;
2330
2350
  custom: Record<string, any>;
@@ -2404,12 +2424,6 @@ export interface GetThreadResponse {
2404
2424
  duration: string;
2405
2425
  thread: ThreadStateResponse;
2406
2426
  }
2407
- export interface GetUserModerationReportResponse {
2408
- duration: string;
2409
- user_blocks: UserBlock[];
2410
- user_mutes: UserMute[];
2411
- user: UserResponse;
2412
- }
2413
2427
  export interface GoLiveRequest {
2414
2428
  recording_storage_name?: string;
2415
2429
  start_closed_caption?: boolean;
@@ -2816,6 +2830,9 @@ export interface MessageNewEvent {
2816
2830
  message?: Message;
2817
2831
  user?: User;
2818
2832
  }
2833
+ export interface MessageOptions {
2834
+ include_thread_participants?: boolean;
2835
+ }
2819
2836
  export interface MessagePaginationParams {
2820
2837
  }
2821
2838
  export interface MessageReadEvent {
@@ -2884,6 +2901,7 @@ export interface MessageResponse {
2884
2901
  quoted_message_id?: string;
2885
2902
  show_in_channel?: boolean;
2886
2903
  thread_participants?: UserResponse[];
2904
+ draft?: DraftResponse;
2887
2905
  i18n?: Record<string, string>;
2888
2906
  image_labels?: Record<string, string[]>;
2889
2907
  moderation?: ModerationV2Response;
@@ -2960,6 +2978,7 @@ export interface MessageWithChannelResponse {
2960
2978
  quoted_message_id?: string;
2961
2979
  show_in_channel?: boolean;
2962
2980
  thread_participants?: UserResponse[];
2981
+ draft?: DraftResponse;
2963
2982
  i18n?: Record<string, string>;
2964
2983
  image_labels?: Record<string, string[]>;
2965
2984
  moderation?: ModerationV2Response;
@@ -2976,21 +2995,6 @@ export interface ModerationActionConfig {
2976
2995
  order: number;
2977
2996
  custom: Record<string, any>;
2978
2997
  }
2979
- export interface ModerationAnalytics {
2980
- total_items_moderated: number;
2981
- ai_image_harms: Array<Record<string, any>>;
2982
- ai_text_harms: Array<Record<string, any>>;
2983
- ai_video_harms: Array<Record<string, any>>;
2984
- blocklist_by_list: Array<Record<string, any>>;
2985
- blocklist_matches: Array<Record<string, any>>;
2986
- model_accuracy: Array<Record<string, any>>;
2987
- moderator_actions: Array<Record<string, any>>;
2988
- moderator_productivity: Array<Record<string, any>>;
2989
- semantic_filter_top_matches: Array<Record<string, any>>;
2990
- sla_metrics: Array<Record<string, any>>;
2991
- action_distribution_over_time: Record<string, Record<string, any>>;
2992
- detection_by_engine_over_time: Record<string, Record<string, any>>;
2993
- }
2994
2998
  export interface ModerationCustomActionEvent {
2995
2999
  created_at: Date;
2996
3000
  type: string;
@@ -2998,15 +3002,6 @@ export interface ModerationCustomActionEvent {
2998
3002
  message?: Message;
2999
3003
  user?: User;
3000
3004
  }
3001
- export interface ModerationEvent {
3002
- created_at: Date;
3003
- custom: Record<string, any>;
3004
- type: string;
3005
- received_at?: Date;
3006
- flags?: Flag2Response[];
3007
- action?: ActionLogResponse;
3008
- review_queue_item?: ReviewQueueItemResponse;
3009
- }
3010
3005
  export interface ModerationFlaggedEvent {
3011
3006
  created_at: Date;
3012
3007
  type: string;
@@ -3033,15 +3028,6 @@ export interface ModerationResponse {
3033
3028
  spam: number;
3034
3029
  toxic: number;
3035
3030
  }
3036
- export interface ModerationUsageStats {
3037
- app_pk: number;
3038
- id: number;
3039
- organization_id: number;
3040
- reference_date: Date;
3041
- updated_at: Date;
3042
- usage_amount: number;
3043
- usage_type: string;
3044
- }
3045
3031
  export interface ModerationV2Response {
3046
3032
  action: string;
3047
3033
  original_text: string;
@@ -3051,15 +3037,6 @@ export interface ModerationV2Response {
3051
3037
  image_harms?: string[];
3052
3038
  text_harms?: string[];
3053
3039
  }
3054
- export interface ModeratorStats {
3055
- id: string;
3056
- items_reviewed: number;
3057
- action_counts: Record<string, number>;
3058
- }
3059
- export interface ModeratorStatsResponse {
3060
- duration: string;
3061
- moderator_stats: ModeratorStats[];
3062
- }
3063
3040
  export interface MuteChannelRequest {
3064
3041
  expiration?: number;
3065
3042
  user_id?: string;
@@ -3198,6 +3175,7 @@ export interface OwnUser {
3198
3175
  teams?: string[];
3199
3176
  privacy_settings?: PrivacySettings;
3200
3177
  push_preferences?: PushPreferences;
3178
+ teams_role?: Record<string, string>;
3201
3179
  }
3202
3180
  export interface OwnUserResponse {
3203
3181
  banned: boolean;
@@ -3227,6 +3205,11 @@ export interface OwnUserResponse {
3227
3205
  latest_hidden_channels?: string[];
3228
3206
  privacy_settings?: PrivacySettingsResponse;
3229
3207
  push_preferences?: PushPreferences;
3208
+ teams_role?: Record<string, string>;
3209
+ }
3210
+ export interface PagerResponse {
3211
+ next?: string;
3212
+ prev?: string;
3230
3213
  }
3231
3214
  export interface PaginationParams {
3232
3215
  limit?: number;
@@ -3583,6 +3566,7 @@ export interface QueryCampaignsRequest {
3583
3566
  limit?: number;
3584
3567
  next?: string;
3585
3568
  prev?: string;
3569
+ user_limit?: number;
3586
3570
  sort?: SortParamRequest[];
3587
3571
  filter?: Record<string, any>;
3588
3572
  }
@@ -3607,6 +3591,21 @@ export interface QueryChannelsResponse {
3607
3591
  duration: string;
3608
3592
  channels: ChannelStateResponseFields[];
3609
3593
  }
3594
+ export interface QueryDraftsRequest {
3595
+ limit?: number;
3596
+ next?: string;
3597
+ prev?: string;
3598
+ user_id?: string;
3599
+ sort?: SortParamRequest[];
3600
+ filter?: Record<string, any>;
3601
+ user?: UserRequest;
3602
+ }
3603
+ export interface QueryDraftsResponse {
3604
+ duration: string;
3605
+ drafts: DraftResponse[];
3606
+ next?: string;
3607
+ prev?: string;
3608
+ }
3610
3609
  export interface QueryFeedModerationTemplate {
3611
3610
  created_at: Date;
3612
3611
  name: string;
@@ -3782,21 +3781,6 @@ export interface QueryThreadsResponse {
3782
3781
  next?: string;
3783
3782
  prev?: string;
3784
3783
  }
3785
- export interface QueryUsageStatsRequest {
3786
- limit?: number;
3787
- next?: string;
3788
- prev?: string;
3789
- user_id?: string;
3790
- sort?: SortParamRequest[];
3791
- filter?: Record<string, any>;
3792
- user?: UserRequest;
3793
- }
3794
- export interface QueryUsageStatsResponse {
3795
- duration: string;
3796
- items: ModerationUsageStats[];
3797
- next?: string;
3798
- prev?: string;
3799
- }
3800
3784
  export interface QueryUserFeedbackRequest {
3801
3785
  limit?: number;
3802
3786
  next?: string;
@@ -3824,11 +3808,6 @@ export interface QueryUsersResponse {
3824
3808
  duration: string;
3825
3809
  users: FullUserResponse[];
3826
3810
  }
3827
- export interface QueueStatsResponse {
3828
- avg_time_to_action: number;
3829
- duration: string;
3830
- time_to_action_buckets: Record<string, number>;
3831
- }
3832
3811
  export interface RTMPBroadcastRequest {
3833
3812
  name: string;
3834
3813
  stream_url: string;
@@ -4006,6 +3985,7 @@ export interface ReviewQueueItem {
4006
3985
  created_at: Date;
4007
3986
  entity_id: string;
4008
3987
  entity_type: string;
3988
+ flags_count: number;
4009
3989
  has_image: boolean;
4010
3990
  has_text: boolean;
4011
3991
  has_video: boolean;
@@ -4018,22 +3998,34 @@ export interface ReviewQueueItem {
4018
3998
  updated_at: Date;
4019
3999
  actions: ActionLog[];
4020
4000
  bans: Ban[];
4021
- flags: Flag2[];
4001
+ flags: Flag[];
4022
4002
  languages: string[];
4023
4003
  teams: string[];
4024
4004
  reviewed_at: NullTime;
4005
+ activity?: EnrichedActivity;
4025
4006
  assigned_to?: User;
4026
4007
  entity_creator?: EntityCreator;
4027
4008
  feeds_v2_activity?: EnrichedActivity;
4028
4009
  feeds_v2_reaction?: Reaction;
4029
4010
  message?: Message;
4030
4011
  moderation_payload?: ModerationPayload;
4012
+ reaction?: Reaction;
4013
+ }
4014
+ export interface ReviewQueueItemNewEvent {
4015
+ created_at: Date;
4016
+ custom: Record<string, any>;
4017
+ type: string;
4018
+ received_at?: Date;
4019
+ flags?: FlagResponse[];
4020
+ action?: ActionLogResponse;
4021
+ review_queue_item?: ReviewQueueItemResponse;
4031
4022
  }
4032
4023
  export interface ReviewQueueItemResponse {
4033
4024
  ai_text_severity: string;
4034
4025
  created_at: Date;
4035
4026
  entity_id: string;
4036
4027
  entity_type: string;
4028
+ flags_count: number;
4037
4029
  id: string;
4038
4030
  recommended_action: string;
4039
4031
  reviewed_by: string;
@@ -4042,18 +4034,29 @@ export interface ReviewQueueItemResponse {
4042
4034
  updated_at: Date;
4043
4035
  actions: ActionLogResponse[];
4044
4036
  bans: Ban[];
4045
- flags: Flag2Response[];
4037
+ flags: FlagResponse[];
4046
4038
  languages: string[];
4047
4039
  completed_at?: Date;
4048
4040
  entity_creator_id?: string;
4049
4041
  reviewed_at?: Date;
4050
4042
  teams?: string[];
4043
+ activity?: EnrichedActivity;
4051
4044
  assigned_to?: UserResponse;
4052
4045
  entity_creator?: EntityCreatorResponse;
4053
4046
  feeds_v2_activity?: EnrichedActivity;
4054
4047
  feeds_v2_reaction?: Reaction;
4055
4048
  message?: MessageResponse;
4056
4049
  moderation_payload?: ModerationPayload;
4050
+ reaction?: Reaction;
4051
+ }
4052
+ export interface ReviewQueueItemUpdatedEvent {
4053
+ created_at: Date;
4054
+ custom: Record<string, any>;
4055
+ type: string;
4056
+ received_at?: Date;
4057
+ flags?: FlagResponse[];
4058
+ action?: ActionLogResponse;
4059
+ review_queue_item?: ReviewQueueItemResponse;
4057
4060
  }
4058
4061
  export interface RingSettings {
4059
4062
  auto_cancel_timeout_ms: number;
@@ -4117,6 +4120,7 @@ export interface SearchPayload {
4117
4120
  query?: string;
4118
4121
  sort?: SortParamRequest[];
4119
4122
  message_filter_conditions?: Record<string, any>;
4123
+ message_options?: MessageOptions;
4120
4124
  }
4121
4125
  export interface SearchResponse {
4122
4126
  duration: string;
@@ -4162,6 +4166,7 @@ export interface SearchResultMessage {
4162
4166
  show_in_channel?: boolean;
4163
4167
  thread_participants?: UserResponse[];
4164
4168
  channel?: ChannelResponse;
4169
+ draft?: DraftResponse;
4165
4170
  i18n?: Record<string, string>;
4166
4171
  image_labels?: Record<string, string[]>;
4167
4172
  moderation?: ModerationV2Response;
@@ -4276,6 +4281,7 @@ export interface StartCampaignRequest {
4276
4281
  export interface StartCampaignResponse {
4277
4282
  duration: string;
4278
4283
  campaign?: CampaignResponse;
4284
+ users?: PagerResponse;
4279
4285
  }
4280
4286
  export interface StartClosedCaptionsRequest {
4281
4287
  enable_transcription?: boolean;
@@ -4448,6 +4454,7 @@ export interface ThreadStateResponse {
4448
4454
  thread_participants?: ThreadParticipant[];
4449
4455
  channel?: ChannelResponse;
4450
4456
  created_by?: UserResponse;
4457
+ draft?: DraftResponse;
4451
4458
  parent_message?: MessageResponse;
4452
4459
  }
4453
4460
  export interface ThreadUpdatedEvent {
@@ -4498,7 +4505,7 @@ export interface TranscriptionSettingsResponse {
4498
4505
  mode: 'available' | 'disabled' | 'auto-on';
4499
4506
  }
4500
4507
  export interface TranslateMessageRequest {
4501
- language: 'af' | 'sq' | 'am' | 'ar' | 'az' | 'bn' | 'bs' | 'bg' | 'zh' | 'zh-TW' | 'hr' | 'cs' | 'da' | 'fa-AF' | 'nl' | 'en' | 'et' | 'fi' | 'fr' | 'fr-CA' | 'ka' | 'de' | 'el' | 'ha' | 'he' | 'hi' | 'hu' | 'id' | 'it' | 'ja' | 'ko' | 'lv' | 'ms' | 'no' | 'fa' | 'ps' | 'pl' | 'pt' | 'ro' | 'ru' | 'sr' | 'sk' | 'sl' | 'so' | 'es' | 'es-MX' | 'sw' | 'sv' | 'tl' | 'ta' | 'th' | 'tr' | 'uk' | 'ur' | 'vi' | 'lt';
4508
+ language: 'af' | 'sq' | 'am' | 'ar' | 'az' | 'bn' | 'bs' | 'bg' | 'zh' | 'zh-TW' | 'hr' | 'cs' | 'da' | 'fa-AF' | 'nl' | 'en' | 'et' | 'fi' | 'fr' | 'fr-CA' | 'ka' | 'de' | 'el' | 'ha' | 'he' | 'hi' | 'hu' | 'id' | 'it' | 'ja' | 'ko' | 'lv' | 'ms' | 'no' | 'fa' | 'ps' | 'pl' | 'pt' | 'ro' | 'ru' | 'sr' | 'sk' | 'sl' | 'so' | 'es' | 'es-MX' | 'sw' | 'sv' | 'tl' | 'ta' | 'th' | 'tr' | 'uk' | 'ur' | 'vi' | 'lt' | 'ht';
4502
4509
  }
4503
4510
  export interface TruncateChannelRequest {
4504
4511
  hard_delete?: boolean;
@@ -4966,6 +4973,7 @@ export interface User {
4966
4973
  online: boolean;
4967
4974
  role: string;
4968
4975
  custom: Record<string, any>;
4976
+ teams_role: Record<string, string>;
4969
4977
  ban_expires?: Date;
4970
4978
  created_at?: Date;
4971
4979
  deactivated_at?: Date;
@@ -4992,11 +5000,6 @@ export interface UserBannedEvent {
4992
5000
  team?: string;
4993
5001
  user?: User;
4994
5002
  }
4995
- export interface UserBlock {
4996
- blocked_by_user_id: string;
4997
- blocked_user_id: string;
4998
- created_at: Date;
4999
- }
5000
5003
  export interface UserCustomEventRequest {
5001
5004
  type: string;
5002
5005
  custom?: Record<string, any>;
@@ -5087,6 +5090,7 @@ export interface UserRequest {
5087
5090
  teams?: string[];
5088
5091
  custom?: Record<string, any>;
5089
5092
  privacy_settings?: PrivacySettingsResponse;
5093
+ teams_role?: Record<string, string>;
5090
5094
  }
5091
5095
  export interface UserResponse {
5092
5096
  banned: boolean;
@@ -5111,6 +5115,7 @@ export interface UserResponse {
5111
5115
  devices?: DeviceResponse[];
5112
5116
  privacy_settings?: PrivacySettingsResponse;
5113
5117
  push_notifications?: PushNotificationSettingsResponse;
5118
+ teams_role?: Record<string, string>;
5114
5119
  }
5115
5120
  export interface UserResponseCommonFields {
5116
5121
  banned: boolean;
@@ -5129,6 +5134,7 @@ export interface UserResponseCommonFields {
5129
5134
  last_active?: Date;
5130
5135
  name?: string;
5131
5136
  revoke_tokens_issued_before?: Date;
5137
+ teams_role?: Record<string, string>;
5132
5138
  }
5133
5139
  export interface UserResponsePrivacyFields {
5134
5140
  banned: boolean;
@@ -5149,6 +5155,7 @@ export interface UserResponsePrivacyFields {
5149
5155
  name?: string;
5150
5156
  revoke_tokens_issued_before?: Date;
5151
5157
  privacy_settings?: PrivacySettingsResponse;
5158
+ teams_role?: Record<string, string>;
5152
5159
  }
5153
5160
  export interface UserSessionStats {
5154
5161
  freeze_duration_seconds: number;
@@ -5209,6 +5216,7 @@ export interface UserStats {
5209
5216
  min_event_ts: number;
5210
5217
  session_stats: UserSessionStats[];
5211
5218
  info: UserInfoResponse;
5219
+ feedback?: string;
5212
5220
  rating?: number;
5213
5221
  }
5214
5222
  export interface UserUnbannedEvent {
@@ -5242,6 +5250,7 @@ export interface UserUpdatedEvent {
5242
5250
  received_at?: Date;
5243
5251
  }
5244
5252
  export interface VelocityFilterConfig {
5253
+ advanced_filters: boolean;
5245
5254
  cascading_actions: boolean;
5246
5255
  cids_per_user: number;
5247
5256
  enabled: boolean;
@@ -5258,9 +5267,11 @@ export interface VelocityFilterConfigRule {
5258
5267
  fast_spam_threshold: number;
5259
5268
  fast_spam_ttl: number;
5260
5269
  ip_ban: boolean;
5270
+ probation_period: number;
5261
5271
  shadow_ban: boolean;
5262
5272
  slow_spam_threshold: number;
5263
5273
  slow_spam_ttl: number;
5274
+ url_only: boolean;
5264
5275
  slow_spam_ban_duration?: number;
5265
5276
  }
5266
5277
  export interface VideoDimension {
@@ -1,8 +1,7 @@
1
1
  import { BaseApi } from '../../BaseApi';
2
2
  import { StreamResponse } from '../../types';
3
- import { BanRequest, BanResponse, CheckRequest, CheckResponse, CustomCheckRequest, CustomCheckResponse, DeleteModerationConfigResponse, DeleteModerationTemplateResponse, FlagRequest, FlagResponse, GetConfigResponse, GetModerationAnalyticsRequest, GetModerationAnalyticsResponse, GetReviewQueueItemResponse, GetUserModerationReportResponse, ModeratorStatsResponse, MuteRequest, MuteResponse, QueryFeedModerationTemplatesResponse, QueryModerationConfigsRequest, QueryModerationConfigsResponse, QueryModerationLogsRequest, QueryModerationLogsResponse, QueryReviewQueueRequest, QueryReviewQueueResponse, QueryUsageStatsRequest, QueryUsageStatsResponse, QueueStatsResponse, SubmitActionRequest, SubmitActionResponse, UnbanRequest, UnbanResponse, UnmuteRequest, UnmuteResponse, UpsertConfigRequest, UpsertConfigResponse, UpsertModerationTemplateRequest, UpsertModerationTemplateResponse } from '../models';
3
+ import { BanRequest, BanResponse, CheckRequest, CheckResponse, CustomCheckRequest, CustomCheckResponse, DeleteModerationConfigResponse, DeleteModerationTemplateResponse, FlagRequest, FlagResponse, GetConfigResponse, GetReviewQueueItemResponse, MuteRequest, MuteResponse, QueryFeedModerationTemplatesResponse, QueryModerationConfigsRequest, QueryModerationConfigsResponse, QueryModerationLogsRequest, QueryModerationLogsResponse, QueryReviewQueueRequest, QueryReviewQueueResponse, SubmitActionRequest, SubmitActionResponse, UnbanRequest, UnbanResponse, UnmuteRequest, UnmuteResponse, UpsertConfigRequest, UpsertConfigResponse, UpsertModerationTemplateRequest, UpsertModerationTemplateResponse } from '../models';
4
4
  export declare class ModerationApi extends BaseApi {
5
- getModerationAnalytics: (request?: GetModerationAnalyticsRequest) => Promise<StreamResponse<GetModerationAnalyticsResponse>>;
6
5
  ban: (request: BanRequest) => Promise<StreamResponse<BanResponse>>;
7
6
  check: (request: CheckRequest) => Promise<StreamResponse<CheckResponse>>;
8
7
  upsertConfig: (request: UpsertConfigRequest) => Promise<StreamResponse<UpsertConfigResponse>>;
@@ -21,9 +20,7 @@ export declare class ModerationApi extends BaseApi {
21
20
  v2UpsertTemplate: (request: UpsertModerationTemplateRequest) => Promise<StreamResponse<UpsertModerationTemplateResponse>>;
22
21
  flag: (request: FlagRequest) => Promise<StreamResponse<FlagResponse>>;
23
22
  queryModerationLogs: (request?: QueryModerationLogsRequest) => Promise<StreamResponse<QueryModerationLogsResponse>>;
24
- getModeratorStats: () => Promise<StreamResponse<ModeratorStatsResponse>>;
25
23
  mute: (request: MuteRequest) => Promise<StreamResponse<MuteResponse>>;
26
- getQueueStats: () => Promise<StreamResponse<QueueStatsResponse>>;
27
24
  queryReviewQueue: (request?: QueryReviewQueueRequest) => Promise<StreamResponse<QueryReviewQueueResponse>>;
28
25
  getReviewQueueItem: (request: {
29
26
  id: string;
@@ -35,11 +32,4 @@ export declare class ModerationApi extends BaseApi {
35
32
  created_by?: string;
36
33
  }) => Promise<StreamResponse<UnbanResponse>>;
37
34
  unmute: (request: UnmuteRequest) => Promise<StreamResponse<UnmuteResponse>>;
38
- queryUsageStats: (request?: QueryUsageStatsRequest) => Promise<StreamResponse<QueryUsageStatsResponse>>;
39
- getUserReport: (request: {
40
- user_id: string;
41
- create_user_if_not_exists?: boolean;
42
- include_user_mutes?: boolean;
43
- include_user_blocks?: boolean;
44
- }) => Promise<StreamResponse<GetUserModerationReportResponse>>;
45
35
  }
@@ -1,9 +1,12 @@
1
+ import { Agent } from 'undici';
1
2
  export type OmitTypeId<T> = Omit<T, 'type' | 'id' | 'connection_id'>;
2
3
  export interface ApiConfig {
3
4
  apiKey: string;
4
5
  token: string;
5
6
  baseUrl: string;
7
+ /** The timeout for requests in milliseconds. The default is 3000. */
6
8
  timeout: number;
9
+ agent: Agent;
7
10
  }
8
11
  export interface RequestMetadata {
9
12
  responseHeaders: Headers;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/node-sdk",
3
- "version": "0.4.18",
3
+ "version": "0.4.20",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -73,6 +73,7 @@
73
73
  "@types/jsonwebtoken": "^9.0.3",
74
74
  "@types/node": "^20.11.24",
75
75
  "jsonwebtoken": "^9.0.2",
76
+ "undici": "^5.29.0",
76
77
  "uuid": "^9.0.1"
77
78
  },
78
79
  "peerDependencies": {
package/src/BaseApi.ts CHANGED
@@ -2,9 +2,14 @@ import { v4 as uuidv4 } from 'uuid';
2
2
  import { ApiConfig, RequestMetadata, StreamError } from './types';
3
3
  import { APIError } from './gen/models';
4
4
  import { getRateLimitFromResponseHeader } from './utils/rate-limit';
5
+ import { Agent } from 'undici';
5
6
 
6
7
  export class BaseApi {
7
- constructor(protected readonly apiConfig: ApiConfig) {}
8
+ private readonly dispatcher: Agent;
9
+
10
+ constructor(protected readonly apiConfig: ApiConfig) {
11
+ this.dispatcher = this.apiConfig.agent;
12
+ }
8
13
 
9
14
  protected sendRequest = async <T>(
10
15
  method: string,
@@ -21,6 +26,7 @@ export class BaseApi {
21
26
  url = url.replace(`{${paramName}}`, pathParams[paramName]);
22
27
  });
23
28
  }
29
+
24
30
  url += `?${encodedParams}`;
25
31
  const clientRequestId = uuidv4();
26
32
  const headers = {
@@ -40,6 +46,8 @@ export class BaseApi {
40
46
  method,
41
47
  body: JSON.stringify(body),
42
48
  headers,
49
+ /** @ts-expect-error we get types from DOM here, but we should use node types */
50
+ dispatcher: this.dispatcher,
43
51
  });
44
52
 
45
53
  const responseHeaders = response.headers;