all repos — stealth-developers @ 9ad6d6ff214141cd385a8931dcbf25abd5b74861

pkgs/api/src/responses.ts (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
import type { Message, Ticket, User } from "./types";

export type TicketResponse = {
	ticket: Ticket;
	messages: Message[];
};

export type TicketsResponse = {
	tickets: Ticket[];
	cursor?: string;
};

export type MeResponse = User;
export type ModeratorsResponse = User[];

export type Statistic = {
	mean: number;
	median: number;
	count: number;
};
export type OverallStatsResponse = {
	global: Statistic;
	hourly: (Statistic & { hour: number })[];
};

export type LeaderboardStat = Statistic & {
	user: User;
	rank: number;
};
export type LeaderboardResponse = LeaderboardStat[];