Skip to content

Commit

Permalink
feat: Aggregate stats reports - request and response objects (#1614)
Browse files Browse the repository at this point in the history
Corresponding backend PR: GetStream/chat#7583

- [x] Move manually created interfaces to shims.ts
- [x] Create `queryAggregateCallStats` method for the client

---------

Co-authored-by: Oliver Lazoroski <[email protected]>
  • Loading branch information
su225 and oliverlaz authored Dec 10, 2024
1 parent 4543fe4 commit 8a47fea
Show file tree
Hide file tree
Showing 3 changed files with 407 additions and 1 deletion.
17 changes: 17 additions & 0 deletions packages/client/src/StreamVideoClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import type {
CreateGuestResponse,
GetEdgesResponse,
ListDevicesResponse,
QueryAggregateCallStatsRequest,
QueryAggregateCallStatsResponse,
QueryCallsRequest,
QueryCallsResponse,
QueryCallStatsRequest,
Expand Down Expand Up @@ -439,6 +441,21 @@ export class StreamVideoClient {
>(`/call/stats`, data);
};

/**
* Retrieve the list of available reports aggregated from the call stats.
*
* @param data Specify filter conditions like from and to (within last 30 days) and the report types
* @returns Requested reports with (mostly) raw daily data for each report type requested
*/
queryAggregateCallStats = async (
data: QueryAggregateCallStatsRequest = {},
) => {
return this.streamClient.post<
QueryAggregateCallStatsResponse,
QueryAggregateCallStatsRequest
>(`/stats`, data);
};

/**
* Returns a list of available data centers available for hosting calls.
*/
Expand Down
Loading

0 comments on commit 8a47fea

Please sign in to comment.