@stream-io/node-sdk 0.4.4 → 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.
- package/dist/index.cjs.js +737 -357
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.mjs +737 -358
- package/dist/index.es.mjs.map +1 -1
- package/dist/src/gen/chat/ChatApi.d.ts +28 -2
- package/dist/src/gen/models/index.d.ts +1412 -223
- package/dist/src/gen/moderation/ModerationApi.d.ts +7 -1
- package/dist/src/gen/video/CallApi.d.ts +5 -3
- package/dist/src/gen/video/VideoApi.d.ts +12 -3
- package/package.json +1 -1
- package/src/gen/chat/ChatApi.ts +225 -2
- package/src/gen/common/CommonApi.ts +0 -3
- package/src/gen/model-decoders/index.ts +331 -139
- package/src/gen/models/index.ts +2578 -397
- package/src/gen/moderation/ModerationApi.ts +66 -10
- package/src/gen/video/CallApi.ts +38 -6
- package/src/gen/video/VideoApi.ts +101 -8
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
CheckResponse,
|
|
8
8
|
CustomCheckRequest,
|
|
9
9
|
CustomCheckResponse,
|
|
10
|
+
DeleteModerationConfigResponse,
|
|
10
11
|
DeleteModerationTemplateResponse,
|
|
11
12
|
FlagRequest,
|
|
12
13
|
FlagResponse,
|
|
@@ -17,6 +18,8 @@ import {
|
|
|
17
18
|
MuteRequest,
|
|
18
19
|
MuteResponse,
|
|
19
20
|
QueryFeedModerationTemplatesResponse,
|
|
21
|
+
QueryModerationConfigsRequest,
|
|
22
|
+
QueryModerationConfigsResponse,
|
|
20
23
|
QueryModerationLogsRequest,
|
|
21
24
|
QueryModerationLogsResponse,
|
|
22
25
|
QueryReviewQueueRequest,
|
|
@@ -71,6 +74,7 @@ export class ModerationApi extends BaseApi {
|
|
|
71
74
|
entity_creator_id: request?.entity_creator_id,
|
|
72
75
|
entity_id: request?.entity_id,
|
|
73
76
|
entity_type: request?.entity_type,
|
|
77
|
+
test_mode: request?.test_mode,
|
|
74
78
|
user_id: request?.user_id,
|
|
75
79
|
moderation_payload: request?.moderation_payload,
|
|
76
80
|
options: request?.options,
|
|
@@ -96,14 +100,20 @@ export class ModerationApi extends BaseApi {
|
|
|
96
100
|
const body = {
|
|
97
101
|
key: request?.key,
|
|
98
102
|
async: request?.async,
|
|
103
|
+
team: request?.team,
|
|
104
|
+
user_id: request?.user_id,
|
|
105
|
+
ai_image_config: request?.ai_image_config,
|
|
106
|
+
ai_text_config: request?.ai_text_config,
|
|
107
|
+
ai_video_config: request?.ai_video_config,
|
|
99
108
|
automod_platform_circumvention_config:
|
|
100
109
|
request?.automod_platform_circumvention_config,
|
|
101
110
|
automod_semantic_filters_config: request?.automod_semantic_filters_config,
|
|
102
111
|
automod_toxicity_config: request?.automod_toxicity_config,
|
|
103
|
-
|
|
112
|
+
aws_rekognition_config: request?.aws_rekognition_config,
|
|
104
113
|
block_list_config: request?.block_list_config,
|
|
105
114
|
bodyguard_config: request?.bodyguard_config,
|
|
106
|
-
|
|
115
|
+
google_vision_config: request?.google_vision_config,
|
|
116
|
+
user: request?.user,
|
|
107
117
|
velocity_filter_config: request?.velocity_filter_config,
|
|
108
118
|
};
|
|
109
119
|
|
|
@@ -116,9 +126,33 @@ export class ModerationApi extends BaseApi {
|
|
|
116
126
|
return { ...response.body, metadata: response.metadata };
|
|
117
127
|
};
|
|
118
128
|
|
|
129
|
+
deleteConfig = async (request: {
|
|
130
|
+
key: string;
|
|
131
|
+
team?: string;
|
|
132
|
+
}): Promise<StreamResponse<DeleteModerationConfigResponse>> => {
|
|
133
|
+
const queryParams = {
|
|
134
|
+
team: request?.team,
|
|
135
|
+
};
|
|
136
|
+
const pathParams = {
|
|
137
|
+
key: request?.key,
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const response = await this.sendRequest<
|
|
141
|
+
StreamResponse<DeleteModerationConfigResponse>
|
|
142
|
+
>('DELETE', '/api/v2/moderation/config/{key}', pathParams, queryParams);
|
|
143
|
+
|
|
144
|
+
decoders.DeleteModerationConfigResponse?.(response.body);
|
|
145
|
+
|
|
146
|
+
return { ...response.body, metadata: response.metadata };
|
|
147
|
+
};
|
|
148
|
+
|
|
119
149
|
getConfig = async (request: {
|
|
120
150
|
key: string;
|
|
151
|
+
team?: string;
|
|
121
152
|
}): Promise<StreamResponse<GetConfigResponse>> => {
|
|
153
|
+
const queryParams = {
|
|
154
|
+
team: request?.team,
|
|
155
|
+
};
|
|
122
156
|
const pathParams = {
|
|
123
157
|
key: request?.key,
|
|
124
158
|
};
|
|
@@ -127,7 +161,7 @@ export class ModerationApi extends BaseApi {
|
|
|
127
161
|
'GET',
|
|
128
162
|
'/api/v2/moderation/config/{key}',
|
|
129
163
|
pathParams,
|
|
130
|
-
|
|
164
|
+
queryParams,
|
|
131
165
|
);
|
|
132
166
|
|
|
133
167
|
decoders.GetConfigResponse?.(response.body);
|
|
@@ -135,16 +169,36 @@ export class ModerationApi extends BaseApi {
|
|
|
135
169
|
return { ...response.body, metadata: response.metadata };
|
|
136
170
|
};
|
|
137
171
|
|
|
172
|
+
queryModerationConfigs = async (
|
|
173
|
+
request?: QueryModerationConfigsRequest,
|
|
174
|
+
): Promise<StreamResponse<QueryModerationConfigsResponse>> => {
|
|
175
|
+
const body = {
|
|
176
|
+
limit: request?.limit,
|
|
177
|
+
next: request?.next,
|
|
178
|
+
prev: request?.prev,
|
|
179
|
+
user_id: request?.user_id,
|
|
180
|
+
sort: request?.sort,
|
|
181
|
+
filter: request?.filter,
|
|
182
|
+
user: request?.user,
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
const response = await this.sendRequest<
|
|
186
|
+
StreamResponse<QueryModerationConfigsResponse>
|
|
187
|
+
>('POST', '/api/v2/moderation/configs', undefined, undefined, body);
|
|
188
|
+
|
|
189
|
+
decoders.QueryModerationConfigsResponse?.(response.body);
|
|
190
|
+
|
|
191
|
+
return { ...response.body, metadata: response.metadata };
|
|
192
|
+
};
|
|
193
|
+
|
|
138
194
|
customCheck = async (
|
|
139
195
|
request: CustomCheckRequest,
|
|
140
196
|
): Promise<StreamResponse<CustomCheckResponse>> => {
|
|
141
197
|
const body = {
|
|
142
|
-
entity_creator_id: request?.entity_creator_id,
|
|
143
198
|
entity_id: request?.entity_id,
|
|
144
199
|
entity_type: request?.entity_type,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
recommended_action: request?.recommended_action,
|
|
200
|
+
flags: request?.flags,
|
|
201
|
+
entity_creator_id: request?.entity_creator_id,
|
|
148
202
|
user_id: request?.user_id,
|
|
149
203
|
moderation_payload: request?.moderation_payload,
|
|
150
204
|
user: request?.user,
|
|
@@ -222,8 +276,8 @@ export class ModerationApi extends BaseApi {
|
|
|
222
276
|
const body = {
|
|
223
277
|
entity_id: request?.entity_id,
|
|
224
278
|
entity_type: request?.entity_type,
|
|
225
|
-
reason: request?.reason,
|
|
226
279
|
entity_creator_id: request?.entity_creator_id,
|
|
280
|
+
reason: request?.reason,
|
|
227
281
|
user_id: request?.user_id,
|
|
228
282
|
custom: request?.custom,
|
|
229
283
|
moderation_payload: request?.moderation_payload,
|
|
@@ -318,8 +372,9 @@ export class ModerationApi extends BaseApi {
|
|
|
318
372
|
): Promise<StreamResponse<QueryReviewQueueResponse>> => {
|
|
319
373
|
const body = {
|
|
320
374
|
limit: request?.limit,
|
|
321
|
-
|
|
322
|
-
|
|
375
|
+
lock_count: request?.lock_count,
|
|
376
|
+
lock_duration: request?.lock_duration,
|
|
377
|
+
lock_items: request?.lock_items,
|
|
323
378
|
next: request?.next,
|
|
324
379
|
prev: request?.prev,
|
|
325
380
|
stats_only: request?.stats_only,
|
|
@@ -367,6 +422,7 @@ export class ModerationApi extends BaseApi {
|
|
|
367
422
|
delete_message: request?.delete_message,
|
|
368
423
|
delete_reaction: request?.delete_reaction,
|
|
369
424
|
delete_user: request?.delete_user,
|
|
425
|
+
mark_reviewed: request?.mark_reviewed,
|
|
370
426
|
unban: request?.unban,
|
|
371
427
|
user: request?.user,
|
|
372
428
|
};
|
package/src/gen/video/CallApi.ts
CHANGED
|
@@ -24,6 +24,8 @@ import {
|
|
|
24
24
|
PinResponse,
|
|
25
25
|
SendCallEventRequest,
|
|
26
26
|
SendCallEventResponse,
|
|
27
|
+
StartClosedCaptionsRequest,
|
|
28
|
+
StartClosedCaptionsResponse,
|
|
27
29
|
StartHLSBroadcastingResponse,
|
|
28
30
|
StartRTMPBroadcastsRequest,
|
|
29
31
|
StartRTMPBroadcastsResponse,
|
|
@@ -32,11 +34,15 @@ import {
|
|
|
32
34
|
StartTranscriptionRequest,
|
|
33
35
|
StartTranscriptionResponse,
|
|
34
36
|
StopAllRTMPBroadcastsResponse,
|
|
37
|
+
StopClosedCaptionsRequest,
|
|
38
|
+
StopClosedCaptionsResponse,
|
|
35
39
|
StopHLSBroadcastingResponse,
|
|
40
|
+
StopLiveRequest,
|
|
36
41
|
StopLiveResponse,
|
|
37
42
|
StopRTMPBroadcastsRequest,
|
|
38
43
|
StopRTMPBroadcastsResponse,
|
|
39
44
|
StopRecordingResponse,
|
|
45
|
+
StopTranscriptionRequest,
|
|
40
46
|
StopTranscriptionResponse,
|
|
41
47
|
UnblockUserRequest,
|
|
42
48
|
UnblockUserResponse,
|
|
@@ -199,6 +205,16 @@ export class CallApi {
|
|
|
199
205
|
return this.videoApi.startHLSBroadcasting({ id: this.id, type: this.type });
|
|
200
206
|
};
|
|
201
207
|
|
|
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
|
+
});
|
|
216
|
+
};
|
|
217
|
+
|
|
202
218
|
startRecording = (
|
|
203
219
|
request?: StartRecordingRequest,
|
|
204
220
|
): Promise<StreamResponse<StartRecordingResponse>> => {
|
|
@@ -235,18 +251,34 @@ export class CallApi {
|
|
|
235
251
|
return this.videoApi.stopHLSBroadcasting({ id: this.id, type: this.type });
|
|
236
252
|
};
|
|
237
253
|
|
|
238
|
-
|
|
239
|
-
|
|
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
|
+
});
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
stopLive = (
|
|
265
|
+
request?: StopLiveRequest,
|
|
266
|
+
): Promise<StreamResponse<StopLiveResponse>> => {
|
|
267
|
+
return this.videoApi.stopLive({ id: this.id, type: this.type, ...request });
|
|
240
268
|
};
|
|
241
269
|
|
|
242
270
|
stopRecording = (): Promise<StreamResponse<StopRecordingResponse>> => {
|
|
243
271
|
return this.videoApi.stopRecording({ id: this.id, type: this.type });
|
|
244
272
|
};
|
|
245
273
|
|
|
246
|
-
stopTranscription = (
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
return this.videoApi.stopTranscription({
|
|
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
|
+
});
|
|
250
282
|
};
|
|
251
283
|
|
|
252
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,8 @@ import {
|
|
|
36
38
|
Response,
|
|
37
39
|
SendCallEventRequest,
|
|
38
40
|
SendCallEventResponse,
|
|
41
|
+
StartClosedCaptionsRequest,
|
|
42
|
+
StartClosedCaptionsResponse,
|
|
39
43
|
StartHLSBroadcastingResponse,
|
|
40
44
|
StartRTMPBroadcastsRequest,
|
|
41
45
|
StartRTMPBroadcastsResponse,
|
|
@@ -44,11 +48,15 @@ import {
|
|
|
44
48
|
StartTranscriptionRequest,
|
|
45
49
|
StartTranscriptionResponse,
|
|
46
50
|
StopAllRTMPBroadcastsResponse,
|
|
51
|
+
StopClosedCaptionsRequest,
|
|
52
|
+
StopClosedCaptionsResponse,
|
|
47
53
|
StopHLSBroadcastingResponse,
|
|
54
|
+
StopLiveRequest,
|
|
48
55
|
StopLiveResponse,
|
|
49
56
|
StopRTMPBroadcastsRequest,
|
|
50
57
|
StopRTMPBroadcastsResponse,
|
|
51
58
|
StopRecordingResponse,
|
|
59
|
+
StopTranscriptionRequest,
|
|
52
60
|
StopTranscriptionResponse,
|
|
53
61
|
UnblockUserRequest,
|
|
54
62
|
UnblockUserResponse,
|
|
@@ -310,6 +318,7 @@ export class VideoApi extends BaseApi {
|
|
|
310
318
|
};
|
|
311
319
|
const body = {
|
|
312
320
|
recording_storage_name: request?.recording_storage_name,
|
|
321
|
+
start_closed_caption: request?.start_closed_caption,
|
|
313
322
|
start_hls: request?.start_hls,
|
|
314
323
|
start_recording: request?.start_recording,
|
|
315
324
|
start_rtmp_broadcasts: request?.start_rtmp_broadcasts,
|
|
@@ -558,6 +567,34 @@ export class VideoApi extends BaseApi {
|
|
|
558
567
|
return { ...response.body, metadata: response.metadata };
|
|
559
568
|
};
|
|
560
569
|
|
|
570
|
+
startClosedCaptions = async (
|
|
571
|
+
request: StartClosedCaptionsRequest & { type: string; id: string },
|
|
572
|
+
): Promise<StreamResponse<StartClosedCaptionsResponse>> => {
|
|
573
|
+
const pathParams = {
|
|
574
|
+
type: request?.type,
|
|
575
|
+
id: request?.id,
|
|
576
|
+
};
|
|
577
|
+
const body = {
|
|
578
|
+
enable_transcription: request?.enable_transcription,
|
|
579
|
+
external_storage: request?.external_storage,
|
|
580
|
+
language: request?.language,
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
const response = await this.sendRequest<
|
|
584
|
+
StreamResponse<StartClosedCaptionsResponse>
|
|
585
|
+
>(
|
|
586
|
+
'POST',
|
|
587
|
+
'/api/v2/video/call/{type}/{id}/start_closed_captions',
|
|
588
|
+
pathParams,
|
|
589
|
+
undefined,
|
|
590
|
+
body,
|
|
591
|
+
);
|
|
592
|
+
|
|
593
|
+
decoders.StartClosedCaptionsResponse?.(response.body);
|
|
594
|
+
|
|
595
|
+
return { ...response.body, metadata: response.metadata };
|
|
596
|
+
};
|
|
597
|
+
|
|
561
598
|
startRecording = async (
|
|
562
599
|
request: StartRecordingRequest & { type: string; id: string },
|
|
563
600
|
): Promise<StreamResponse<StartRecordingResponse>> => {
|
|
@@ -592,6 +629,8 @@ export class VideoApi extends BaseApi {
|
|
|
592
629
|
id: request?.id,
|
|
593
630
|
};
|
|
594
631
|
const body = {
|
|
632
|
+
enable_closed_captions: request?.enable_closed_captions,
|
|
633
|
+
language: request?.language,
|
|
595
634
|
transcription_external_storage: request?.transcription_external_storage,
|
|
596
635
|
};
|
|
597
636
|
|
|
@@ -658,20 +697,53 @@ export class VideoApi extends BaseApi {
|
|
|
658
697
|
return { ...response.body, metadata: response.metadata };
|
|
659
698
|
};
|
|
660
699
|
|
|
661
|
-
|
|
662
|
-
type: string;
|
|
663
|
-
|
|
664
|
-
|
|
700
|
+
stopClosedCaptions = async (
|
|
701
|
+
request: StopClosedCaptionsRequest & { type: string; id: string },
|
|
702
|
+
): Promise<StreamResponse<StopClosedCaptionsResponse>> => {
|
|
703
|
+
const pathParams = {
|
|
704
|
+
type: request?.type,
|
|
705
|
+
id: request?.id,
|
|
706
|
+
};
|
|
707
|
+
const body = {
|
|
708
|
+
stop_transcription: request?.stop_transcription,
|
|
709
|
+
};
|
|
710
|
+
|
|
711
|
+
const response = await this.sendRequest<
|
|
712
|
+
StreamResponse<StopClosedCaptionsResponse>
|
|
713
|
+
>(
|
|
714
|
+
'POST',
|
|
715
|
+
'/api/v2/video/call/{type}/{id}/stop_closed_captions',
|
|
716
|
+
pathParams,
|
|
717
|
+
undefined,
|
|
718
|
+
body,
|
|
719
|
+
);
|
|
720
|
+
|
|
721
|
+
decoders.StopClosedCaptionsResponse?.(response.body);
|
|
722
|
+
|
|
723
|
+
return { ...response.body, metadata: response.metadata };
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
stopLive = async (
|
|
727
|
+
request: StopLiveRequest & { type: string; id: string },
|
|
728
|
+
): Promise<StreamResponse<StopLiveResponse>> => {
|
|
665
729
|
const pathParams = {
|
|
666
730
|
type: request?.type,
|
|
667
731
|
id: request?.id,
|
|
668
732
|
};
|
|
733
|
+
const body = {
|
|
734
|
+
continue_closed_caption: request?.continue_closed_caption,
|
|
735
|
+
continue_hls: request?.continue_hls,
|
|
736
|
+
continue_recording: request?.continue_recording,
|
|
737
|
+
continue_rtmp_broadcasts: request?.continue_rtmp_broadcasts,
|
|
738
|
+
continue_transcription: request?.continue_transcription,
|
|
739
|
+
};
|
|
669
740
|
|
|
670
741
|
const response = await this.sendRequest<StreamResponse<StopLiveResponse>>(
|
|
671
742
|
'POST',
|
|
672
743
|
'/api/v2/video/call/{type}/{id}/stop_live',
|
|
673
744
|
pathParams,
|
|
674
745
|
undefined,
|
|
746
|
+
body,
|
|
675
747
|
);
|
|
676
748
|
|
|
677
749
|
decoders.StopLiveResponse?.(response.body);
|
|
@@ -702,14 +774,16 @@ export class VideoApi extends BaseApi {
|
|
|
702
774
|
return { ...response.body, metadata: response.metadata };
|
|
703
775
|
};
|
|
704
776
|
|
|
705
|
-
stopTranscription = async (
|
|
706
|
-
type: string;
|
|
707
|
-
|
|
708
|
-
}): Promise<StreamResponse<StopTranscriptionResponse>> => {
|
|
777
|
+
stopTranscription = async (
|
|
778
|
+
request: StopTranscriptionRequest & { type: string; id: string },
|
|
779
|
+
): Promise<StreamResponse<StopTranscriptionResponse>> => {
|
|
709
780
|
const pathParams = {
|
|
710
781
|
type: request?.type,
|
|
711
782
|
id: request?.id,
|
|
712
783
|
};
|
|
784
|
+
const body = {
|
|
785
|
+
stop_closed_captions: request?.stop_closed_captions,
|
|
786
|
+
};
|
|
713
787
|
|
|
714
788
|
const response = await this.sendRequest<
|
|
715
789
|
StreamResponse<StopTranscriptionResponse>
|
|
@@ -718,6 +792,7 @@ export class VideoApi extends BaseApi {
|
|
|
718
792
|
'/api/v2/video/call/{type}/{id}/stop_transcription',
|
|
719
793
|
pathParams,
|
|
720
794
|
undefined,
|
|
795
|
+
body,
|
|
721
796
|
);
|
|
722
797
|
|
|
723
798
|
decoders.StopTranscriptionResponse?.(response.body);
|
|
@@ -1004,4 +1079,22 @@ export class VideoApi extends BaseApi {
|
|
|
1004
1079
|
|
|
1005
1080
|
return { ...response.body, metadata: response.metadata };
|
|
1006
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
|
+
};
|
|
1007
1100
|
}
|