@stream-io/node-sdk 0.3.1 → 0.4.1
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 +4136 -9282
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.es.js +4136 -9206
- package/dist/index.es.js.map +1 -1
- package/dist/src/BaseApi.d.ts +10 -0
- package/dist/src/StreamCall.d.ts +5 -37
- package/dist/src/StreamChannel.d.ts +7 -34
- package/dist/src/StreamChatClient.d.ts +2 -25
- package/dist/src/StreamClient.d.ts +51 -59
- package/dist/src/StreamModerationClient.d.ts +3 -0
- package/dist/src/StreamVideoClient.d.ts +2 -18
- package/dist/src/gen/chat/ChannelApi.d.ts +33 -0
- package/dist/src/gen/chat/ChatApi.d.ts +241 -0
- package/dist/src/gen/common/CommonApi.d.ts +99 -0
- package/dist/src/gen/model-decoders/index.d.ts +3 -0
- package/dist/src/gen/models/index.d.ts +3881 -0
- package/dist/src/gen/moderation/ModerationApi.d.ts +38 -0
- package/dist/src/gen/video/CallApi.d.ts +56 -0
- package/dist/src/gen/video/VideoApi.d.ts +151 -0
- package/dist/src/types.d.ts +25 -0
- package/dist/src/utils/create-token.d.ts +2 -0
- package/dist/src/utils/rate-limit.d.ts +2 -0
- package/index.ts +2 -3
- package/package.json +5 -4
- package/src/BaseApi.ts +115 -0
- package/src/StreamCall.ts +9 -199
- package/src/StreamChannel.ts +23 -246
- package/src/StreamChatClient.ts +3 -122
- package/src/StreamClient.ts +101 -345
- package/src/StreamModerationClient.ts +3 -0
- package/src/StreamVideoClient.ts +3 -95
- package/src/gen/chat/ChannelApi.ts +270 -0
- package/src/gen/chat/ChatApi.ts +1857 -0
- package/src/gen/common/CommonApi.ts +1004 -0
- package/src/gen/model-decoders/index.ts +1897 -0
- package/src/gen/models/index.ts +6794 -0
- package/src/gen/moderation/ModerationApi.ts +476 -0
- package/src/gen/video/CallApi.ts +309 -0
- package/src/gen/video/VideoApi.ts +1007 -0
- package/src/types.ts +35 -0
- package/src/utils/create-token.ts +6 -1
- package/src/utils/rate-limit.ts +21 -0
- package/dist/src/gen/chat/apis/ProductchatApi.d.ts +0 -1750
- package/dist/src/gen/chat/apis/index.d.ts +0 -1
- package/dist/src/gen/chat/index.d.ts +0 -3
- package/dist/src/gen/chat/models/index.d.ts +0 -14865
- package/dist/src/gen/chat/runtime.d.ts +0 -180
- package/dist/src/gen/video/apis/ProductvideoApi.d.ts +0 -648
- package/dist/src/gen/video/apis/index.d.ts +0 -1
- package/dist/src/gen/video/index.d.ts +0 -3
- package/dist/src/gen/video/models/index.d.ts +0 -5011
- package/dist/src/gen/video/runtime.d.ts +0 -180
- package/src/gen/chat/.openapi-generator/FILES +0 -6
- package/src/gen/chat/.openapi-generator/VERSION +0 -1
- package/src/gen/chat/.openapi-generator-ignore +0 -23
- package/src/gen/chat/apis/ProductchatApi.ts +0 -7007
- package/src/gen/chat/apis/index.ts +0 -3
- package/src/gen/chat/index.ts +0 -5
- package/src/gen/chat/models/index.ts +0 -14766
- package/src/gen/chat/runtime.ts +0 -415
- package/src/gen/video/.openapi-generator/FILES +0 -6
- package/src/gen/video/.openapi-generator/VERSION +0 -1
- package/src/gen/video/.openapi-generator-ignore +0 -23
- package/src/gen/video/apis/ProductvideoApi.ts +0 -2575
- package/src/gen/video/apis/index.ts +0 -3
- package/src/gen/video/index.ts +0 -5
- package/src/gen/video/models/index.ts +0 -5000
- package/src/gen/video/runtime.ts +0 -415
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { VideoApi } from './VideoApi';
|
|
2
|
+
import { StreamResponse } from '../../types';
|
|
3
|
+
import {
|
|
4
|
+
BlockUserRequest,
|
|
5
|
+
BlockUserResponse,
|
|
6
|
+
CollectUserFeedbackRequest,
|
|
7
|
+
CollectUserFeedbackResponse,
|
|
8
|
+
DeleteCallRequest,
|
|
9
|
+
DeleteCallResponse,
|
|
10
|
+
DeleteRecordingResponse,
|
|
11
|
+
DeleteTranscriptionResponse,
|
|
12
|
+
EndCallResponse,
|
|
13
|
+
GetCallResponse,
|
|
14
|
+
GetCallStatsResponse,
|
|
15
|
+
GetOrCreateCallRequest,
|
|
16
|
+
GetOrCreateCallResponse,
|
|
17
|
+
GoLiveRequest,
|
|
18
|
+
GoLiveResponse,
|
|
19
|
+
ListRecordingsResponse,
|
|
20
|
+
ListTranscriptionsResponse,
|
|
21
|
+
MuteUsersRequest,
|
|
22
|
+
MuteUsersResponse,
|
|
23
|
+
PinRequest,
|
|
24
|
+
PinResponse,
|
|
25
|
+
SendCallEventRequest,
|
|
26
|
+
SendCallEventResponse,
|
|
27
|
+
StartHLSBroadcastingResponse,
|
|
28
|
+
StartRTMPBroadcastsRequest,
|
|
29
|
+
StartRTMPBroadcastsResponse,
|
|
30
|
+
StartRecordingRequest,
|
|
31
|
+
StartRecordingResponse,
|
|
32
|
+
StartTranscriptionRequest,
|
|
33
|
+
StartTranscriptionResponse,
|
|
34
|
+
StopAllRTMPBroadcastsResponse,
|
|
35
|
+
StopHLSBroadcastingResponse,
|
|
36
|
+
StopLiveResponse,
|
|
37
|
+
StopRTMPBroadcastsRequest,
|
|
38
|
+
StopRTMPBroadcastsResponse,
|
|
39
|
+
StopRecordingResponse,
|
|
40
|
+
StopTranscriptionResponse,
|
|
41
|
+
UnblockUserRequest,
|
|
42
|
+
UnblockUserResponse,
|
|
43
|
+
UnpinRequest,
|
|
44
|
+
UnpinResponse,
|
|
45
|
+
UpdateCallMembersRequest,
|
|
46
|
+
UpdateCallMembersResponse,
|
|
47
|
+
UpdateCallRequest,
|
|
48
|
+
UpdateCallResponse,
|
|
49
|
+
UpdateUserPermissionsRequest,
|
|
50
|
+
UpdateUserPermissionsResponse,
|
|
51
|
+
} from '../models';
|
|
52
|
+
|
|
53
|
+
export class CallApi {
|
|
54
|
+
constructor(
|
|
55
|
+
protected videoApi: VideoApi,
|
|
56
|
+
public readonly type: string,
|
|
57
|
+
public readonly id: string,
|
|
58
|
+
) {}
|
|
59
|
+
|
|
60
|
+
get = (request?: {
|
|
61
|
+
members_limit?: number;
|
|
62
|
+
ring?: boolean;
|
|
63
|
+
notify?: boolean;
|
|
64
|
+
video?: boolean;
|
|
65
|
+
}): Promise<StreamResponse<GetCallResponse>> => {
|
|
66
|
+
return this.videoApi.getCall({ id: this.id, type: this.type, ...request });
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
update = (
|
|
70
|
+
request?: UpdateCallRequest,
|
|
71
|
+
): Promise<StreamResponse<UpdateCallResponse>> => {
|
|
72
|
+
return this.videoApi.updateCall({
|
|
73
|
+
id: this.id,
|
|
74
|
+
type: this.type,
|
|
75
|
+
...request,
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
getOrCreate = (
|
|
80
|
+
request?: GetOrCreateCallRequest,
|
|
81
|
+
): Promise<StreamResponse<GetOrCreateCallResponse>> => {
|
|
82
|
+
return this.videoApi.getOrCreateCall({
|
|
83
|
+
id: this.id,
|
|
84
|
+
type: this.type,
|
|
85
|
+
...request,
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
blockUser = (
|
|
90
|
+
request: BlockUserRequest,
|
|
91
|
+
): Promise<StreamResponse<BlockUserResponse>> => {
|
|
92
|
+
return this.videoApi.blockUser({
|
|
93
|
+
id: this.id,
|
|
94
|
+
type: this.type,
|
|
95
|
+
...request,
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
delete = (
|
|
100
|
+
request?: DeleteCallRequest,
|
|
101
|
+
): Promise<StreamResponse<DeleteCallResponse>> => {
|
|
102
|
+
return this.videoApi.deleteCall({
|
|
103
|
+
id: this.id,
|
|
104
|
+
type: this.type,
|
|
105
|
+
...request,
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
sendCallEvent = (
|
|
110
|
+
request?: SendCallEventRequest,
|
|
111
|
+
): Promise<StreamResponse<SendCallEventResponse>> => {
|
|
112
|
+
return this.videoApi.sendCallEvent({
|
|
113
|
+
id: this.id,
|
|
114
|
+
type: this.type,
|
|
115
|
+
...request,
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
collectUserFeedback = (
|
|
120
|
+
request: CollectUserFeedbackRequest & { session: string },
|
|
121
|
+
): Promise<StreamResponse<CollectUserFeedbackResponse>> => {
|
|
122
|
+
return this.videoApi.collectUserFeedback({
|
|
123
|
+
id: this.id,
|
|
124
|
+
type: this.type,
|
|
125
|
+
...request,
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
goLive = (
|
|
130
|
+
request?: GoLiveRequest,
|
|
131
|
+
): Promise<StreamResponse<GoLiveResponse>> => {
|
|
132
|
+
return this.videoApi.goLive({ id: this.id, type: this.type, ...request });
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
end = (): Promise<StreamResponse<EndCallResponse>> => {
|
|
136
|
+
return this.videoApi.endCall({ id: this.id, type: this.type });
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
updateCallMembers = (
|
|
140
|
+
request?: UpdateCallMembersRequest,
|
|
141
|
+
): Promise<StreamResponse<UpdateCallMembersResponse>> => {
|
|
142
|
+
return this.videoApi.updateCallMembers({
|
|
143
|
+
id: this.id,
|
|
144
|
+
type: this.type,
|
|
145
|
+
...request,
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
muteUsers = (
|
|
150
|
+
request?: MuteUsersRequest,
|
|
151
|
+
): Promise<StreamResponse<MuteUsersResponse>> => {
|
|
152
|
+
return this.videoApi.muteUsers({
|
|
153
|
+
id: this.id,
|
|
154
|
+
type: this.type,
|
|
155
|
+
...request,
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
videoPin = (request: PinRequest): Promise<StreamResponse<PinResponse>> => {
|
|
160
|
+
return this.videoApi.videoPin({ id: this.id, type: this.type, ...request });
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
listRecordings = (): Promise<StreamResponse<ListRecordingsResponse>> => {
|
|
164
|
+
return this.videoApi.listRecordings({ id: this.id, type: this.type });
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
startRTMPBroadcasts = (
|
|
168
|
+
request: StartRTMPBroadcastsRequest,
|
|
169
|
+
): Promise<StreamResponse<StartRTMPBroadcastsResponse>> => {
|
|
170
|
+
return this.videoApi.startRTMPBroadcasts({
|
|
171
|
+
id: this.id,
|
|
172
|
+
type: this.type,
|
|
173
|
+
...request,
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
stopAllRTMPBroadcasts = (): Promise<
|
|
178
|
+
StreamResponse<StopAllRTMPBroadcastsResponse>
|
|
179
|
+
> => {
|
|
180
|
+
return this.videoApi.stopAllRTMPBroadcasts({
|
|
181
|
+
id: this.id,
|
|
182
|
+
type: this.type,
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
stopRTMPBroadcast = (
|
|
187
|
+
request: StopRTMPBroadcastsRequest & { name: string },
|
|
188
|
+
): Promise<StreamResponse<StopRTMPBroadcastsResponse>> => {
|
|
189
|
+
return this.videoApi.stopRTMPBroadcast({
|
|
190
|
+
id: this.id,
|
|
191
|
+
type: this.type,
|
|
192
|
+
...request,
|
|
193
|
+
});
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
startHLSBroadcasting = (): Promise<
|
|
197
|
+
StreamResponse<StartHLSBroadcastingResponse>
|
|
198
|
+
> => {
|
|
199
|
+
return this.videoApi.startHLSBroadcasting({ id: this.id, type: this.type });
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
startRecording = (
|
|
203
|
+
request?: StartRecordingRequest,
|
|
204
|
+
): Promise<StreamResponse<StartRecordingResponse>> => {
|
|
205
|
+
return this.videoApi.startRecording({
|
|
206
|
+
id: this.id,
|
|
207
|
+
type: this.type,
|
|
208
|
+
...request,
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
startTranscription = (
|
|
213
|
+
request?: StartTranscriptionRequest,
|
|
214
|
+
): Promise<StreamResponse<StartTranscriptionResponse>> => {
|
|
215
|
+
return this.videoApi.startTranscription({
|
|
216
|
+
id: this.id,
|
|
217
|
+
type: this.type,
|
|
218
|
+
...request,
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
getCallStats = (request: {
|
|
223
|
+
session: string;
|
|
224
|
+
}): Promise<StreamResponse<GetCallStatsResponse>> => {
|
|
225
|
+
return this.videoApi.getCallStats({
|
|
226
|
+
id: this.id,
|
|
227
|
+
type: this.type,
|
|
228
|
+
...request,
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
stopHLSBroadcasting = (): Promise<
|
|
233
|
+
StreamResponse<StopHLSBroadcastingResponse>
|
|
234
|
+
> => {
|
|
235
|
+
return this.videoApi.stopHLSBroadcasting({ id: this.id, type: this.type });
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
stopLive = (): Promise<StreamResponse<StopLiveResponse>> => {
|
|
239
|
+
return this.videoApi.stopLive({ id: this.id, type: this.type });
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
stopRecording = (): Promise<StreamResponse<StopRecordingResponse>> => {
|
|
243
|
+
return this.videoApi.stopRecording({ id: this.id, type: this.type });
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
stopTranscription = (): Promise<
|
|
247
|
+
StreamResponse<StopTranscriptionResponse>
|
|
248
|
+
> => {
|
|
249
|
+
return this.videoApi.stopTranscription({ id: this.id, type: this.type });
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
listTranscriptions = (): Promise<
|
|
253
|
+
StreamResponse<ListTranscriptionsResponse>
|
|
254
|
+
> => {
|
|
255
|
+
return this.videoApi.listTranscriptions({ id: this.id, type: this.type });
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
unblockUser = (
|
|
259
|
+
request: UnblockUserRequest,
|
|
260
|
+
): Promise<StreamResponse<UnblockUserResponse>> => {
|
|
261
|
+
return this.videoApi.unblockUser({
|
|
262
|
+
id: this.id,
|
|
263
|
+
type: this.type,
|
|
264
|
+
...request,
|
|
265
|
+
});
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
videoUnpin = (
|
|
269
|
+
request: UnpinRequest,
|
|
270
|
+
): Promise<StreamResponse<UnpinResponse>> => {
|
|
271
|
+
return this.videoApi.videoUnpin({
|
|
272
|
+
id: this.id,
|
|
273
|
+
type: this.type,
|
|
274
|
+
...request,
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
updateUserPermissions = (
|
|
279
|
+
request: UpdateUserPermissionsRequest,
|
|
280
|
+
): Promise<StreamResponse<UpdateUserPermissionsResponse>> => {
|
|
281
|
+
return this.videoApi.updateUserPermissions({
|
|
282
|
+
id: this.id,
|
|
283
|
+
type: this.type,
|
|
284
|
+
...request,
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
deleteRecording = (request: {
|
|
289
|
+
session: string;
|
|
290
|
+
filename: string;
|
|
291
|
+
}): Promise<StreamResponse<DeleteRecordingResponse>> => {
|
|
292
|
+
return this.videoApi.deleteRecording({
|
|
293
|
+
id: this.id,
|
|
294
|
+
type: this.type,
|
|
295
|
+
...request,
|
|
296
|
+
});
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
deleteTranscription = (request: {
|
|
300
|
+
session: string;
|
|
301
|
+
filename: string;
|
|
302
|
+
}): Promise<StreamResponse<DeleteTranscriptionResponse>> => {
|
|
303
|
+
return this.videoApi.deleteTranscription({
|
|
304
|
+
id: this.id,
|
|
305
|
+
type: this.type,
|
|
306
|
+
...request,
|
|
307
|
+
});
|
|
308
|
+
};
|
|
309
|
+
}
|