File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,20 @@ describe('call API', () => {
144144 expect ( response . calls ) . toBeDefined ( ) ;
145145 } ) ;
146146
147+ it ( 'query call stats' , async ( ) => {
148+ const response = await client . video . queryCallStatistics ( ) ;
149+
150+ expect ( response . reports . length ) . toBeGreaterThan ( 0 ) ;
151+
152+ await expect ( ( ) =>
153+ call . getSessionStatistics ( {
154+ session : '<session id>' ,
155+ } ) ,
156+ ) . rejects . toThrowError (
157+ `Stream error code 16: GetCallStats failed with error: "call report not found for cid:default:${ callId } session_id:<session id>"` ,
158+ ) ;
159+ } ) ;
160+
147161 describe ( 'recording' , ( ) => {
148162 it ( 'enable call recording' , async ( ) => {
149163 let response = await call . update ( {
Original file line number Diff line number Diff line change 33 DeleteRecordingRequest ,
44 DeleteTranscriptionRequest ,
55 GetCallRequest ,
6+ GetCallStatsRequest ,
67 ProductvideoApi ,
78 VideoBlockUserRequest ,
89 VideoGetOrCreateCallRequest ,
@@ -57,6 +58,10 @@ export class StreamCall {
5758 } ) ;
5859 } ;
5960
61+ getSessionStatistics = ( request : OmitTypeId < GetCallStatsRequest > ) => {
62+ return this . apiClient . getCallStats ( { ...this . baseRequest , ...request } ) ;
63+ } ;
64+
6065 create = ( getOrCreateCallRequest ?: VideoGetOrCreateCallRequest ) => {
6166 return this . getOrCreate ( getOrCreateCallRequest ) ;
6267 } ;
Original file line number Diff line number Diff line change 88 ProductvideoApi ,
99 VideoCreateCallTypeRequest ,
1010 VideoCreateExternalStorageRequest ,
11+ VideoQueryCallStatsRequest ,
1112 VideoQueryCallsRequest ,
1213 VideoUpdateCallTypeRequest ,
1314 VideoUpdateExternalStorageRequest ,
@@ -31,6 +32,14 @@ export class StreamVideoClient {
3132 } ) ;
3233 } ;
3334
35+ queryCallStatistics = (
36+ videoQueryCallStatsRequest ?: VideoQueryCallStatsRequest ,
37+ ) => {
38+ return this . apiClient . queryCallStats ( {
39+ videoQueryCallStatsRequest : videoQueryCallStatsRequest ?? { } ,
40+ } ) ;
41+ } ;
42+
3443 createCallType = ( videoCreateCallTypeRequest : VideoCreateCallTypeRequest ) => {
3544 return this . apiClient . createCallType ( {
3645 videoCreateCallTypeRequest,
You can’t perform that action at this time.
0 commit comments