@stream-io/node-sdk 0.4.9 → 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.
@@ -167,8 +167,6 @@ export interface ActionLogResponse {
167
167
  }
168
168
 
169
169
  export interface AggregatedStats {
170
- countrywise_aggregate_stats?: Record<string, CountrywiseAggregateStats>;
171
-
172
170
  publisher_aggregate_stats?: PublisherAggregateStats;
173
171
 
174
172
  turn?: TURNAggregatedStats;
@@ -666,6 +664,12 @@ export interface BroadcastSettingsResponse {
666
664
  rtmp: RTMPSettingsResponse;
667
665
  }
668
666
 
667
+ export interface BrowserDataResponse {
668
+ name?: string;
669
+
670
+ version?: string;
671
+ }
672
+
669
673
  export interface CallAcceptedEvent {
670
674
  call_cid: string;
671
675
 
@@ -945,6 +949,8 @@ export interface CallRecordingFailedEvent {
945
949
 
946
950
  created_at: Date;
947
951
 
952
+ egress_id: string;
953
+
948
954
  type: string;
949
955
  }
950
956
 
@@ -953,6 +959,8 @@ export interface CallRecordingReadyEvent {
953
959
 
954
960
  created_at: Date;
955
961
 
962
+ egress_id: string;
963
+
956
964
  call_recording: CallRecording;
957
965
 
958
966
  type: string;
@@ -963,6 +971,8 @@ export interface CallRecordingStartedEvent {
963
971
 
964
972
  created_at: Date;
965
973
 
974
+ egress_id: string;
975
+
966
976
  type: string;
967
977
  }
968
978
 
@@ -971,6 +981,8 @@ export interface CallRecordingStoppedEvent {
971
981
 
972
982
  created_at: Date;
973
983
 
984
+ egress_id: string;
985
+
974
986
  type: string;
975
987
  }
976
988
 
@@ -1307,6 +1319,8 @@ export interface CallTranscriptionFailedEvent {
1307
1319
 
1308
1320
  created_at: Date;
1309
1321
 
1322
+ egress_id: string;
1323
+
1310
1324
  type: string;
1311
1325
  }
1312
1326
 
@@ -1315,6 +1329,8 @@ export interface CallTranscriptionReadyEvent {
1315
1329
 
1316
1330
  created_at: Date;
1317
1331
 
1332
+ egress_id: string;
1333
+
1318
1334
  call_transcription: CallTranscription;
1319
1335
 
1320
1336
  type: string;
@@ -1325,6 +1341,8 @@ export interface CallTranscriptionStartedEvent {
1325
1341
 
1326
1342
  created_at: Date;
1327
1343
 
1344
+ egress_id: string;
1345
+
1328
1346
  type: string;
1329
1347
  }
1330
1348
 
@@ -1333,6 +1351,8 @@ export interface CallTranscriptionStoppedEvent {
1333
1351
 
1334
1352
  created_at: Date;
1335
1353
 
1354
+ egress_id: string;
1355
+
1336
1356
  type: string;
1337
1357
  }
1338
1358
 
@@ -1417,6 +1437,8 @@ export interface CampaignChannelTemplate {
1417
1437
  export interface CampaignCompletedEvent {
1418
1438
  created_at: Date;
1419
1439
 
1440
+ custom: Record<string, any>;
1441
+
1420
1442
  type: string;
1421
1443
 
1422
1444
  received_at?: Date;
@@ -1481,6 +1503,8 @@ export interface CampaignResponse {
1481
1503
  export interface CampaignStartedEvent {
1482
1504
  created_at: Date;
1483
1505
 
1506
+ custom: Record<string, any>;
1507
+
1484
1508
  type: string;
1485
1509
 
1486
1510
  received_at?: Date;
@@ -1933,6 +1957,12 @@ export const ChannelOwnCapability = {
1933
1957
  export type ChannelOwnCapability =
1934
1958
  (typeof ChannelOwnCapability)[keyof typeof ChannelOwnCapability];
1935
1959
 
1960
+ export interface ChannelPushPreferences {
1961
+ chat_level?: string;
1962
+
1963
+ disabled_until?: Date;
1964
+ }
1965
+
1936
1966
  export interface ChannelResponse {
1937
1967
  cid: string;
1938
1968
 
@@ -2013,6 +2043,8 @@ export interface ChannelStateResponse {
2013
2043
  channel?: ChannelResponse;
2014
2044
 
2015
2045
  membership?: ChannelMember;
2046
+
2047
+ push_preferences?: ChannelPushPreferences;
2016
2048
  }
2017
2049
 
2018
2050
  export interface ChannelStateResponseFields {
@@ -2039,6 +2071,8 @@ export interface ChannelStateResponseFields {
2039
2071
  channel?: ChannelResponse;
2040
2072
 
2041
2073
  membership?: ChannelMember;
2074
+
2075
+ push_preferences?: ChannelPushPreferences;
2042
2076
  }
2043
2077
 
2044
2078
  export interface ChannelTruncatedEvent {
@@ -2287,6 +2321,14 @@ export interface CheckSQSResponse {
2287
2321
  data?: Record<string, any>;
2288
2322
  }
2289
2323
 
2324
+ export interface ClientOSDataResponse {
2325
+ architecture?: string;
2326
+
2327
+ name?: string;
2328
+
2329
+ version?: string;
2330
+ }
2331
+
2290
2332
  export interface ClosedCaptionEvent {
2291
2333
  call_cid: string;
2292
2334
 
@@ -2395,18 +2437,6 @@ export interface Count {
2395
2437
  value: number;
2396
2438
  }
2397
2439
 
2398
- export interface CountrywiseAggregateStats {
2399
- participant_count?: Count;
2400
-
2401
- publisher_jitter?: TimeStats;
2402
-
2403
- publisher_latency?: TimeStats;
2404
-
2405
- subscriber_jitter?: TimeStats;
2406
-
2407
- subscriber_latency?: TimeStats;
2408
- }
2409
-
2410
2440
  export interface CreateBlockListRequest {
2411
2441
  name: string;
2412
2442
 
@@ -2979,6 +3009,12 @@ export interface Device {
2979
3009
  voip?: boolean;
2980
3010
  }
2981
3011
 
3012
+ export interface DeviceDataResponse {
3013
+ name?: string;
3014
+
3015
+ version?: string;
3016
+ }
3017
+
2982
3018
  export interface DeviceErrorInfo {
2983
3019
  error_message: string;
2984
3020
 
@@ -3029,6 +3065,8 @@ export interface EdgeResponse {
3029
3065
 
3030
3066
  export interface EgressHLSResponse {
3031
3067
  playlist_url: string;
3068
+
3069
+ status: string;
3032
3070
  }
3033
3071
 
3034
3072
  export interface EgressRTMPResponse {
@@ -3147,8 +3185,6 @@ export interface EntityCreator {
3147
3185
  teams?: string[];
3148
3186
 
3149
3187
  privacy_settings?: PrivacySettings;
3150
-
3151
- push_notifications?: PushNotificationSettings;
3152
3188
  }
3153
3189
 
3154
3190
  export interface EntityCreatorResponse {
@@ -3176,8 +3212,6 @@ export interface EntityCreatorResponse {
3176
3212
 
3177
3213
  blocked_user_ids: string[];
3178
3214
 
3179
- devices: DeviceResponse[];
3180
-
3181
3215
  teams: string[];
3182
3216
 
3183
3217
  custom: Record<string, any>;
@@ -3196,6 +3230,8 @@ export interface EntityCreatorResponse {
3196
3230
 
3197
3231
  revoke_tokens_issued_before?: Date;
3198
3232
 
3233
+ devices?: DeviceResponse[];
3234
+
3199
3235
  privacy_settings?: PrivacySettingsResponse;
3200
3236
 
3201
3237
  push_notifications?: PushNotificationSettingsResponse;
@@ -3502,6 +3538,8 @@ export interface FlagResponse {
3502
3538
  export interface FlagUpdatedEvent {
3503
3539
  created_at: Date;
3504
3540
 
3541
+ custom: Record<string, any>;
3542
+
3505
3543
  type: string;
3506
3544
 
3507
3545
  received_at?: Date;
@@ -3567,8 +3605,6 @@ export interface FullUserResponse {
3567
3605
  latest_hidden_channels?: string[];
3568
3606
 
3569
3607
  privacy_settings?: PrivacySettingsResponse;
3570
-
3571
- push_notifications?: PushNotificationSettingsResponse;
3572
3608
  }
3573
3609
 
3574
3610
  export interface GeofenceResponse {
@@ -4706,13 +4742,15 @@ export interface MessageReadEvent {
4706
4742
 
4707
4743
  type: string;
4708
4744
 
4745
+ channel_last_message_at?: Date;
4746
+
4709
4747
  last_read_message_id?: string;
4710
4748
 
4711
4749
  team?: string;
4712
4750
 
4713
4751
  thread?: ThreadResponse;
4714
4752
 
4715
- user?: UserResponse;
4753
+ user?: UserResponseCommonFields;
4716
4754
  }
4717
4755
 
4718
4756
  export interface MessageRequest {
@@ -5000,6 +5038,8 @@ export interface ModerationCustomActionEvent {
5000
5038
  export interface ModerationEvent {
5001
5039
  created_at: Date;
5002
5040
 
5041
+ custom: Record<string, any>;
5042
+
5003
5043
  type: string;
5004
5044
 
5005
5045
  received_at?: Date;
@@ -5229,17 +5269,7 @@ export interface NotificationSettings {
5229
5269
  session_started: EventNotificationSettings;
5230
5270
  }
5231
5271
 
5232
- export interface NullBool {
5233
- has_value?: boolean;
5234
-
5235
- value?: boolean;
5236
- }
5237
-
5238
- export interface NullTime {
5239
- has_value?: boolean;
5240
-
5241
- value?: Date;
5242
- }
5272
+ export interface NullTime {}
5243
5273
 
5244
5274
  export interface OnlyUserID {
5245
5275
  id: string;
@@ -5328,7 +5358,7 @@ export interface OwnUser {
5328
5358
 
5329
5359
  privacy_settings?: PrivacySettings;
5330
5360
 
5331
- push_notifications?: PushNotificationSettings;
5361
+ push_preferences?: PushPreferences;
5332
5362
  }
5333
5363
 
5334
5364
  export interface OwnUserResponse {
@@ -5384,7 +5414,7 @@ export interface OwnUserResponse {
5384
5414
 
5385
5415
  privacy_settings?: PrivacySettingsResponse;
5386
5416
 
5387
- push_notifications?: PushNotificationSettingsResponse;
5417
+ push_preferences?: PushPreferences;
5388
5418
  }
5389
5419
 
5390
5420
  export interface PaginationParams {
@@ -5459,6 +5489,14 @@ export interface PinResponse {
5459
5489
  duration: string;
5460
5490
  }
5461
5491
 
5492
+ export interface PlatformDataResponse {
5493
+ browser: BrowserDataResponse;
5494
+
5495
+ device: DeviceDataResponse;
5496
+
5497
+ os: ClientOSDataResponse;
5498
+ }
5499
+
5462
5500
  export interface Policy {
5463
5501
  action: number;
5464
5502
 
@@ -5725,20 +5763,28 @@ export interface PushNotificationFields {
5725
5763
  providers?: PushProvider[];
5726
5764
  }
5727
5765
 
5728
- export interface PushNotificationSettings {
5766
+ export interface PushNotificationSettingsResponse {
5729
5767
  disabled?: boolean;
5730
5768
 
5731
5769
  disabled_until?: Date;
5732
5770
  }
5733
5771
 
5734
- export interface PushNotificationSettingsInput {
5735
- disabled?: NullBool;
5772
+ export interface PushPreferenceInput {
5773
+ channel_cid?: string;
5774
+
5775
+ chat_level?: 'all' | 'mentions' | 'none' | 'default';
5776
+
5777
+ disabled_until?: Date;
5736
5778
 
5737
- disabled_until?: NullTime;
5779
+ remove_disable?: boolean;
5780
+
5781
+ user_id?: string;
5738
5782
  }
5739
5783
 
5740
- export interface PushNotificationSettingsResponse {
5741
- disabled?: boolean;
5784
+ export interface PushPreferences {
5785
+ call_level?: string;
5786
+
5787
+ chat_level?: string;
5742
5788
 
5743
5789
  disabled_until?: Date;
5744
5790
  }
@@ -6252,7 +6298,7 @@ export interface QueryReviewQueueResponse {
6252
6298
 
6253
6299
  action_config: Record<string, ModerationActionConfig[]>;
6254
6300
 
6255
- stats: Record<string, number>;
6301
+ stats: Record<string, any>;
6256
6302
 
6257
6303
  next?: string;
6258
6304
 
@@ -6357,6 +6403,28 @@ export interface QueryUsageStatsResponse {
6357
6403
  prev?: string;
6358
6404
  }
6359
6405
 
6406
+ export interface QueryUserFeedbackRequest {
6407
+ limit?: number;
6408
+
6409
+ next?: string;
6410
+
6411
+ prev?: string;
6412
+
6413
+ sort?: SortParamRequest[];
6414
+
6415
+ filter_conditions?: Record<string, any>;
6416
+ }
6417
+
6418
+ export interface QueryUserFeedbackResponse {
6419
+ duration: string;
6420
+
6421
+ user_feedback: UserFeedbackResponse[];
6422
+
6423
+ next?: string;
6424
+
6425
+ prev?: string;
6426
+ }
6427
+
6360
6428
  export interface QueryUsersPayload {
6361
6429
  filter_conditions: Record<string, any>;
6362
6430
 
@@ -6746,8 +6814,6 @@ export interface ReviewQueueItem {
6746
6814
 
6747
6815
  teams: string[];
6748
6816
 
6749
- completed_at: NullTime;
6750
-
6751
6817
  reviewed_at: NullTime;
6752
6818
 
6753
6819
  assigned_to?: User;
@@ -8426,6 +8492,21 @@ export interface UpsertModerationTemplateResponse {
8426
8492
  config?: FeedsModerationTemplateConfig;
8427
8493
  }
8428
8494
 
8495
+ export interface UpsertPushPreferencesRequest {
8496
+ preferences: PushPreferenceInput[];
8497
+ }
8498
+
8499
+ export interface UpsertPushPreferencesResponse {
8500
+ duration: string;
8501
+
8502
+ user_channel_preferences: Record<
8503
+ string,
8504
+ Record<string, ChannelPushPreferences>
8505
+ >;
8506
+
8507
+ user_preferences: Record<string, PushPreferences>;
8508
+ }
8509
+
8429
8510
  export interface UpsertPushProviderRequest {
8430
8511
  push_provider?: PushProvider;
8431
8512
  }
@@ -8470,8 +8551,6 @@ export interface User {
8470
8551
  teams?: string[];
8471
8552
 
8472
8553
  privacy_settings?: PrivacySettings;
8473
-
8474
- push_notifications?: PushNotificationSettings;
8475
8554
  }
8476
8555
 
8477
8556
  export interface UserBannedEvent {
@@ -8536,52 +8615,34 @@ export interface UserDeletedEvent {
8536
8615
  user?: User;
8537
8616
  }
8538
8617
 
8539
- export interface UserEventPayload {
8540
- banned: boolean;
8541
-
8542
- created_at: Date;
8543
-
8544
- id: string;
8545
-
8546
- language: string;
8547
-
8548
- online: boolean;
8549
-
8550
- role: string;
8551
-
8552
- updated_at: Date;
8553
-
8554
- blocked_user_ids: string[];
8555
-
8556
- teams: string[];
8557
-
8558
- custom: Record<string, any>;
8618
+ export interface UserFeedbackReport {
8619
+ unreported_count: number;
8559
8620
 
8560
- deactivated_at?: Date;
8621
+ count_by_rating: Record<string, number>;
8622
+ }
8561
8623
 
8562
- deleted_at?: Date;
8624
+ export interface UserFeedbackReportResponse {
8625
+ daily: DailyAggregateUserFeedbackReportResponse[];
8626
+ }
8563
8627
 
8564
- image?: string;
8628
+ export interface UserFeedbackResponse {
8629
+ cid: string;
8565
8630
 
8566
- invisible?: boolean;
8631
+ rating: number;
8567
8632
 
8568
- last_active?: Date;
8633
+ reason: string;
8569
8634
 
8570
- name?: string;
8635
+ sdk: string;
8571
8636
 
8572
- revoke_tokens_issued_before?: Date;
8637
+ sdk_version: string;
8573
8638
 
8574
- privacy_settings?: PrivacySettingsResponse;
8575
- }
8639
+ session_id: string;
8576
8640
 
8577
- export interface UserFeedbackReport {
8578
- unreported_count: number;
8641
+ user_id: string;
8579
8642
 
8580
- count_by_rating: Record<string, number>;
8581
- }
8643
+ platform: PlatformDataResponse;
8582
8644
 
8583
- export interface UserFeedbackReportResponse {
8584
- daily: DailyAggregateUserFeedbackReportResponse[];
8645
+ custom?: Record<string, any>;
8585
8646
  }
8586
8647
 
8587
8648
  export interface UserFlaggedEvent {
@@ -8676,8 +8737,6 @@ export interface UserRequest {
8676
8737
  custom?: Record<string, any>;
8677
8738
 
8678
8739
  privacy_settings?: PrivacySettingsResponse;
8679
-
8680
- push_notifications?: PushNotificationSettingsInput;
8681
8740
  }
8682
8741
 
8683
8742
  export interface UserResponse {
@@ -8701,8 +8760,6 @@ export interface UserResponse {
8701
8760
 
8702
8761
  blocked_user_ids: string[];
8703
8762
 
8704
- devices: DeviceResponse[];
8705
-
8706
8763
  teams: string[];
8707
8764
 
8708
8765
  custom: Record<string, any>;
@@ -8721,11 +8778,85 @@ export interface UserResponse {
8721
8778
 
8722
8779
  revoke_tokens_issued_before?: Date;
8723
8780
 
8781
+ devices?: DeviceResponse[];
8782
+
8724
8783
  privacy_settings?: PrivacySettingsResponse;
8725
8784
 
8726
8785
  push_notifications?: PushNotificationSettingsResponse;
8727
8786
  }
8728
8787
 
8788
+ export interface UserResponseCommonFields {
8789
+ banned: boolean;
8790
+
8791
+ created_at: Date;
8792
+
8793
+ id: string;
8794
+
8795
+ language: string;
8796
+
8797
+ online: boolean;
8798
+
8799
+ role: string;
8800
+
8801
+ updated_at: Date;
8802
+
8803
+ blocked_user_ids: string[];
8804
+
8805
+ teams: string[];
8806
+
8807
+ custom: Record<string, any>;
8808
+
8809
+ deactivated_at?: Date;
8810
+
8811
+ deleted_at?: Date;
8812
+
8813
+ image?: string;
8814
+
8815
+ last_active?: Date;
8816
+
8817
+ name?: string;
8818
+
8819
+ revoke_tokens_issued_before?: Date;
8820
+ }
8821
+
8822
+ export interface UserResponsePrivacyFields {
8823
+ banned: boolean;
8824
+
8825
+ created_at: Date;
8826
+
8827
+ id: string;
8828
+
8829
+ language: string;
8830
+
8831
+ online: boolean;
8832
+
8833
+ role: string;
8834
+
8835
+ updated_at: Date;
8836
+
8837
+ blocked_user_ids: string[];
8838
+
8839
+ teams: string[];
8840
+
8841
+ custom: Record<string, any>;
8842
+
8843
+ deactivated_at?: Date;
8844
+
8845
+ deleted_at?: Date;
8846
+
8847
+ image?: string;
8848
+
8849
+ invisible?: boolean;
8850
+
8851
+ last_active?: Date;
8852
+
8853
+ name?: string;
8854
+
8855
+ revoke_tokens_issued_before?: Date;
8856
+
8857
+ privacy_settings?: PrivacySettingsResponse;
8858
+ }
8859
+
8729
8860
  export interface UserSessionStats {
8730
8861
  freeze_duration_seconds: number;
8731
8862
 
@@ -8885,7 +9016,9 @@ export interface UserUnreadReminderEvent {
8885
9016
  export interface UserUpdatedEvent {
8886
9017
  created_at: Date;
8887
9018
 
8888
- user: UserEventPayload;
9019
+ custom: Record<string, any>;
9020
+
9021
+ user: UserResponsePrivacyFields;
8889
9022
 
8890
9023
  type: string;
8891
9024
 
@@ -8997,6 +9130,8 @@ export interface WSEvent {
8997
9130
 
8998
9131
  channel_id?: string;
8999
9132
 
9133
+ channel_last_message_at?: Date;
9134
+
9000
9135
  channel_type?: string;
9001
9136
 
9002
9137
  cid?: string;
@@ -36,6 +36,8 @@ import {
36
36
  QueryCallStatsResponse,
37
37
  QueryCallsRequest,
38
38
  QueryCallsResponse,
39
+ QueryUserFeedbackRequest,
40
+ QueryUserFeedbackResponse,
39
41
  Response,
40
42
  SendCallEventRequest,
41
43
  SendCallEventResponse,
@@ -75,6 +77,29 @@ import {
75
77
  import { decoders } from '../model-decoders';
76
78
 
77
79
  export class VideoApi extends BaseApi {
80
+ queryUserFeedback = async (
81
+ request?: QueryUserFeedbackRequest & { full?: boolean },
82
+ ): Promise<StreamResponse<QueryUserFeedbackResponse>> => {
83
+ const queryParams = {
84
+ full: request?.full,
85
+ };
86
+ const body = {
87
+ limit: request?.limit,
88
+ next: request?.next,
89
+ prev: request?.prev,
90
+ sort: request?.sort,
91
+ filter_conditions: request?.filter_conditions,
92
+ };
93
+
94
+ const response = await this.sendRequest<
95
+ StreamResponse<QueryUserFeedbackResponse>
96
+ >('POST', '/api/v2/video/call/feedback', undefined, queryParams, body);
97
+
98
+ decoders.QueryUserFeedbackResponse?.(response.body);
99
+
100
+ return { ...response.body, metadata: response.metadata };
101
+ };
102
+
78
103
  queryCallMembers = async (
79
104
  request: QueryCallMembersRequest,
80
105
  ): Promise<StreamResponse<QueryCallMembersResponse>> => {