@stream-io/node-sdk 0.4.5 → 0.4.6

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.
@@ -100,8 +100,11 @@ export class ModerationApi extends BaseApi {
100
100
  const body = {
101
101
  key: request?.key,
102
102
  async: request?.async,
103
+ team: request?.team,
104
+ user_id: request?.user_id,
103
105
  ai_image_config: request?.ai_image_config,
104
106
  ai_text_config: request?.ai_text_config,
107
+ ai_video_config: request?.ai_video_config,
105
108
  automod_platform_circumvention_config:
106
109
  request?.automod_platform_circumvention_config,
107
110
  automod_semantic_filters_config: request?.automod_semantic_filters_config,
@@ -110,6 +113,7 @@ export class ModerationApi extends BaseApi {
110
113
  block_list_config: request?.block_list_config,
111
114
  bodyguard_config: request?.bodyguard_config,
112
115
  google_vision_config: request?.google_vision_config,
116
+ user: request?.user,
113
117
  velocity_filter_config: request?.velocity_filter_config,
114
118
  };
115
119
 
@@ -124,14 +128,18 @@ export class ModerationApi extends BaseApi {
124
128
 
125
129
  deleteConfig = async (request: {
126
130
  key: string;
131
+ team?: string;
127
132
  }): Promise<StreamResponse<DeleteModerationConfigResponse>> => {
133
+ const queryParams = {
134
+ team: request?.team,
135
+ };
128
136
  const pathParams = {
129
137
  key: request?.key,
130
138
  };
131
139
 
132
140
  const response = await this.sendRequest<
133
141
  StreamResponse<DeleteModerationConfigResponse>
134
- >('DELETE', '/api/v2/moderation/config/{key}', pathParams, undefined);
142
+ >('DELETE', '/api/v2/moderation/config/{key}', pathParams, queryParams);
135
143
 
136
144
  decoders.DeleteModerationConfigResponse?.(response.body);
137
145
 
@@ -140,7 +148,11 @@ export class ModerationApi extends BaseApi {
140
148
 
141
149
  getConfig = async (request: {
142
150
  key: string;
151
+ team?: string;
143
152
  }): Promise<StreamResponse<GetConfigResponse>> => {
153
+ const queryParams = {
154
+ team: request?.team,
155
+ };
144
156
  const pathParams = {
145
157
  key: request?.key,
146
158
  };
@@ -149,7 +161,7 @@ export class ModerationApi extends BaseApi {
149
161
  'GET',
150
162
  '/api/v2/moderation/config/{key}',
151
163
  pathParams,
152
- undefined,
164
+ queryParams,
153
165
  );
154
166
 
155
167
  decoders.GetConfigResponse?.(response.body);
@@ -183,12 +195,10 @@ export class ModerationApi extends BaseApi {
183
195
  request: CustomCheckRequest,
184
196
  ): Promise<StreamResponse<CustomCheckResponse>> => {
185
197
  const body = {
186
- entity_creator_id: request?.entity_creator_id,
187
198
  entity_id: request?.entity_id,
188
199
  entity_type: request?.entity_type,
189
- name: request?.name,
190
- reason: request?.reason,
191
- recommended_action: request?.recommended_action,
200
+ flags: request?.flags,
201
+ entity_creator_id: request?.entity_creator_id,
192
202
  user_id: request?.user_id,
193
203
  moderation_payload: request?.moderation_payload,
194
204
  user: request?.user,
@@ -24,6 +24,7 @@ import {
24
24
  PinResponse,
25
25
  SendCallEventRequest,
26
26
  SendCallEventResponse,
27
+ StartClosedCaptionsRequest,
27
28
  StartClosedCaptionsResponse,
28
29
  StartHLSBroadcastingResponse,
29
30
  StartRTMPBroadcastsRequest,
@@ -33,6 +34,7 @@ import {
33
34
  StartTranscriptionRequest,
34
35
  StartTranscriptionResponse,
35
36
  StopAllRTMPBroadcastsResponse,
37
+ StopClosedCaptionsRequest,
36
38
  StopClosedCaptionsResponse,
37
39
  StopHLSBroadcastingResponse,
38
40
  StopLiveRequest,
@@ -40,6 +42,7 @@ import {
40
42
  StopRTMPBroadcastsRequest,
41
43
  StopRTMPBroadcastsResponse,
42
44
  StopRecordingResponse,
45
+ StopTranscriptionRequest,
43
46
  StopTranscriptionResponse,
44
47
  UnblockUserRequest,
45
48
  UnblockUserResponse,
@@ -202,10 +205,14 @@ export class CallApi {
202
205
  return this.videoApi.startHLSBroadcasting({ id: this.id, type: this.type });
203
206
  };
204
207
 
205
- startClosedCaptions = (): Promise<
206
- StreamResponse<StartClosedCaptionsResponse>
207
- > => {
208
- return this.videoApi.startClosedCaptions({ id: this.id, type: this.type });
208
+ startClosedCaptions = (
209
+ request?: StartClosedCaptionsRequest,
210
+ ): Promise<StreamResponse<StartClosedCaptionsResponse>> => {
211
+ return this.videoApi.startClosedCaptions({
212
+ id: this.id,
213
+ type: this.type,
214
+ ...request,
215
+ });
209
216
  };
210
217
 
211
218
  startRecording = (
@@ -244,10 +251,14 @@ export class CallApi {
244
251
  return this.videoApi.stopHLSBroadcasting({ id: this.id, type: this.type });
245
252
  };
246
253
 
247
- stopClosedCaptions = (): Promise<
248
- StreamResponse<StopClosedCaptionsResponse>
249
- > => {
250
- return this.videoApi.stopClosedCaptions({ id: this.id, type: this.type });
254
+ stopClosedCaptions = (
255
+ request?: StopClosedCaptionsRequest,
256
+ ): Promise<StreamResponse<StopClosedCaptionsResponse>> => {
257
+ return this.videoApi.stopClosedCaptions({
258
+ id: this.id,
259
+ type: this.type,
260
+ ...request,
261
+ });
251
262
  };
252
263
 
253
264
  stopLive = (
@@ -260,10 +271,14 @@ export class CallApi {
260
271
  return this.videoApi.stopRecording({ id: this.id, type: this.type });
261
272
  };
262
273
 
263
- stopTranscription = (): Promise<
264
- StreamResponse<StopTranscriptionResponse>
265
- > => {
266
- return this.videoApi.stopTranscription({ id: this.id, type: this.type });
274
+ stopTranscription = (
275
+ request?: StopTranscriptionRequest,
276
+ ): Promise<StreamResponse<StopTranscriptionResponse>> => {
277
+ return this.videoApi.stopTranscription({
278
+ id: this.id,
279
+ type: this.type,
280
+ ...request,
281
+ });
267
282
  };
268
283
 
269
284
  listTranscriptions = (): Promise<
@@ -27,6 +27,8 @@ import {
27
27
  MuteUsersResponse,
28
28
  PinRequest,
29
29
  PinResponse,
30
+ QueryAggregateCallStatsRequest,
31
+ QueryAggregateCallStatsResponse,
30
32
  QueryCallMembersRequest,
31
33
  QueryCallMembersResponse,
32
34
  QueryCallStatsRequest,
@@ -36,6 +38,7 @@ import {
36
38
  Response,
37
39
  SendCallEventRequest,
38
40
  SendCallEventResponse,
41
+ StartClosedCaptionsRequest,
39
42
  StartClosedCaptionsResponse,
40
43
  StartHLSBroadcastingResponse,
41
44
  StartRTMPBroadcastsRequest,
@@ -45,6 +48,7 @@ import {
45
48
  StartTranscriptionRequest,
46
49
  StartTranscriptionResponse,
47
50
  StopAllRTMPBroadcastsResponse,
51
+ StopClosedCaptionsRequest,
48
52
  StopClosedCaptionsResponse,
49
53
  StopHLSBroadcastingResponse,
50
54
  StopLiveRequest,
@@ -52,6 +56,7 @@ import {
52
56
  StopRTMPBroadcastsRequest,
53
57
  StopRTMPBroadcastsResponse,
54
58
  StopRecordingResponse,
59
+ StopTranscriptionRequest,
55
60
  StopTranscriptionResponse,
56
61
  UnblockUserRequest,
57
62
  UnblockUserResponse,
@@ -313,6 +318,7 @@ export class VideoApi extends BaseApi {
313
318
  };
314
319
  const body = {
315
320
  recording_storage_name: request?.recording_storage_name,
321
+ start_closed_caption: request?.start_closed_caption,
316
322
  start_hls: request?.start_hls,
317
323
  start_recording: request?.start_recording,
318
324
  start_rtmp_broadcasts: request?.start_rtmp_broadcasts,
@@ -561,14 +567,18 @@ export class VideoApi extends BaseApi {
561
567
  return { ...response.body, metadata: response.metadata };
562
568
  };
563
569
 
564
- startClosedCaptions = async (request: {
565
- type: string;
566
- id: string;
567
- }): Promise<StreamResponse<StartClosedCaptionsResponse>> => {
570
+ startClosedCaptions = async (
571
+ request: StartClosedCaptionsRequest & { type: string; id: string },
572
+ ): Promise<StreamResponse<StartClosedCaptionsResponse>> => {
568
573
  const pathParams = {
569
574
  type: request?.type,
570
575
  id: request?.id,
571
576
  };
577
+ const body = {
578
+ enable_transcription: request?.enable_transcription,
579
+ external_storage: request?.external_storage,
580
+ language: request?.language,
581
+ };
572
582
 
573
583
  const response = await this.sendRequest<
574
584
  StreamResponse<StartClosedCaptionsResponse>
@@ -577,6 +587,7 @@ export class VideoApi extends BaseApi {
577
587
  '/api/v2/video/call/{type}/{id}/start_closed_captions',
578
588
  pathParams,
579
589
  undefined,
590
+ body,
580
591
  );
581
592
 
582
593
  decoders.StartClosedCaptionsResponse?.(response.body);
@@ -618,6 +629,8 @@ export class VideoApi extends BaseApi {
618
629
  id: request?.id,
619
630
  };
620
631
  const body = {
632
+ enable_closed_captions: request?.enable_closed_captions,
633
+ language: request?.language,
621
634
  transcription_external_storage: request?.transcription_external_storage,
622
635
  };
623
636
 
@@ -684,14 +697,16 @@ export class VideoApi extends BaseApi {
684
697
  return { ...response.body, metadata: response.metadata };
685
698
  };
686
699
 
687
- stopClosedCaptions = async (request: {
688
- type: string;
689
- id: string;
690
- }): Promise<StreamResponse<StopClosedCaptionsResponse>> => {
700
+ stopClosedCaptions = async (
701
+ request: StopClosedCaptionsRequest & { type: string; id: string },
702
+ ): Promise<StreamResponse<StopClosedCaptionsResponse>> => {
691
703
  const pathParams = {
692
704
  type: request?.type,
693
705
  id: request?.id,
694
706
  };
707
+ const body = {
708
+ stop_transcription: request?.stop_transcription,
709
+ };
695
710
 
696
711
  const response = await this.sendRequest<
697
712
  StreamResponse<StopClosedCaptionsResponse>
@@ -700,6 +715,7 @@ export class VideoApi extends BaseApi {
700
715
  '/api/v2/video/call/{type}/{id}/stop_closed_captions',
701
716
  pathParams,
702
717
  undefined,
718
+ body,
703
719
  );
704
720
 
705
721
  decoders.StopClosedCaptionsResponse?.(response.body);
@@ -715,9 +731,10 @@ export class VideoApi extends BaseApi {
715
731
  id: request?.id,
716
732
  };
717
733
  const body = {
734
+ continue_closed_caption: request?.continue_closed_caption,
718
735
  continue_hls: request?.continue_hls,
719
736
  continue_recording: request?.continue_recording,
720
- continue_rtmp_broadcast: request?.continue_rtmp_broadcast,
737
+ continue_rtmp_broadcasts: request?.continue_rtmp_broadcasts,
721
738
  continue_transcription: request?.continue_transcription,
722
739
  };
723
740
 
@@ -757,14 +774,16 @@ export class VideoApi extends BaseApi {
757
774
  return { ...response.body, metadata: response.metadata };
758
775
  };
759
776
 
760
- stopTranscription = async (request: {
761
- type: string;
762
- id: string;
763
- }): Promise<StreamResponse<StopTranscriptionResponse>> => {
777
+ stopTranscription = async (
778
+ request: StopTranscriptionRequest & { type: string; id: string },
779
+ ): Promise<StreamResponse<StopTranscriptionResponse>> => {
764
780
  const pathParams = {
765
781
  type: request?.type,
766
782
  id: request?.id,
767
783
  };
784
+ const body = {
785
+ stop_closed_captions: request?.stop_closed_captions,
786
+ };
768
787
 
769
788
  const response = await this.sendRequest<
770
789
  StreamResponse<StopTranscriptionResponse>
@@ -773,6 +792,7 @@ export class VideoApi extends BaseApi {
773
792
  '/api/v2/video/call/{type}/{id}/stop_transcription',
774
793
  pathParams,
775
794
  undefined,
795
+ body,
776
796
  );
777
797
 
778
798
  decoders.StopTranscriptionResponse?.(response.body);
@@ -1059,4 +1079,22 @@ export class VideoApi extends BaseApi {
1059
1079
 
1060
1080
  return { ...response.body, metadata: response.metadata };
1061
1081
  };
1082
+
1083
+ queryAggregateCallStats = async (
1084
+ request?: QueryAggregateCallStatsRequest,
1085
+ ): Promise<StreamResponse<QueryAggregateCallStatsResponse>> => {
1086
+ const body = {
1087
+ from: request?.from,
1088
+ to: request?.to,
1089
+ report_types: request?.report_types,
1090
+ };
1091
+
1092
+ const response = await this.sendRequest<
1093
+ StreamResponse<QueryAggregateCallStatsResponse>
1094
+ >('POST', '/api/v2/video/stats', undefined, undefined, body);
1095
+
1096
+ decoders.QueryAggregateCallStatsResponse?.(response.body);
1097
+
1098
+ return { ...response.body, metadata: response.metadata };
1099
+ };
1062
1100
  }