Types
Analytics
Types
Analytics
AnalyticsQuery
export type AnalyticsQuery = {
gateway_domain: string;
start_date: string;
end_date: string;
cid?: string;
file_name?: string;
user_agent?: string;
country?: string;
region?: string;
referer?: string;
limit?: number;
sort_order?: "asc" | "desc";
};
TopAnalyticsQuery
export type TopAnalyticsQuery = AnalyticsQuery & {
sort_by: "requests" | "bandwidth";
attribute:
| "cid"
| "country"
| "region"
| "user_agent"
| "referer"
| "file_name";
};
TopAnalyticsResponse
export type TopAnalyticsResponse = {
data: TopAnalyticsItem[];
};
TopAnalyticsItem
export type TopAnalyticsItem = {
value: string;
requests: number;
bandwidth: number;
};
TimeIntervalAnalyticsQuery
export type TimeIntervalAnalyticsQuery = AnalyticsQuery & {
sort_by?: "requests" | "bandwidth";
date_interval: "day" | "week";
};
TimePeriodItem
export type TimePeriodItem = {
period_start_time: string;
requests: number;
bandwidth: number;
};
TimeIntervalAnalyticsResponse
export type TimeIntervalAnalyticsResponse = {
total_requests: number;
total_bandwidth: number;
time_periods: TimePeriodItem[];
};
UserPinnedDataResponse
export type UserPinnedDataResponse = {
pin_count: number;
pin_size_total: number;
pin_size_with_replications_total: number;
};