feat(frontend): analytics shows minutes online by hour of week and by day, sessions with start and end, says when last seen is hidden, chat status is live and in russian
This commit is contained in:
1 parent
f44597b2dc
commit
73b8903de1
11 files changed
+1275
-373
No files matched your search
@@ -28,8 +28,9 @@ import type {
|
||||
PolicyRecord,
|
||||
PolicyRule,
|
||||
PolicyScope,
|
||||
PresenceHourly,
|
||||
PresenceSample,
|
||||
PresenceSession,
|
||||
PresenceStats,
|
||||
ReactionView,
|
||||
ReadInfo,
|
||||
ResponseStats,
|
||||
@@ -206,30 +207,38 @@ export function getCurrentPresence(
|
||||
});
|
||||
}
|
||||
|
||||
export function getPresenceHistory(
|
||||
export function getPresenceStats(
|
||||
peerId: number,
|
||||
days: number,
|
||||
tz: string,
|
||||
page: Page = {}
|
||||
): Promise<PresenceSample[]> {
|
||||
return request<PresenceSample[]>("/presence", {
|
||||
): Promise<PresenceStats> {
|
||||
return request<PresenceStats>("/presence/stats", {
|
||||
account: true,
|
||||
query: { peer_id: peerId, ...page },
|
||||
query: { days, peer_id: peerId, tz, ...page },
|
||||
});
|
||||
}
|
||||
|
||||
export function getPresenceHourly(peerId: number): Promise<PresenceHourly[]> {
|
||||
return request<PresenceHourly[]>("/presence/hourly", {
|
||||
export function getPresenceSessions(
|
||||
peerId: number,
|
||||
days: number,
|
||||
tz: string,
|
||||
page: Page = {}
|
||||
): Promise<PresenceSession[]> {
|
||||
return request<PresenceSession[]>("/presence/sessions", {
|
||||
account: true,
|
||||
query: { peer_id: peerId },
|
||||
query: { days, peer_id: peerId, tz, ...page },
|
||||
});
|
||||
}
|
||||
|
||||
export function getMessageVolume(
|
||||
chatId: number,
|
||||
days = 90
|
||||
days: number,
|
||||
tz: string
|
||||
): Promise<VolumeBucket[]> {
|
||||
return request<VolumeBucket[]>("/analytics/volume", {
|
||||
account: true,
|
||||
query: { chat_id: chatId, days },
|
||||
query: { chat_id: chatId, days, tz },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user