mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Update types.
This commit is contained in:
parent
19d5ac0a4c
commit
b1024c71de
2 changed files with 2 additions and 18 deletions
|
|
@ -149,19 +149,6 @@ export interface WebsiteStats {
|
||||||
totalTime: { value: number; change: number };
|
totalTime: { value: number; change: number };
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RealtimeInit {
|
|
||||||
websites: Website[];
|
|
||||||
token: string;
|
|
||||||
data: RealtimeUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RealtimeUpdate {
|
|
||||||
pageviews: any[];
|
|
||||||
sessions: any[];
|
|
||||||
events: any[];
|
|
||||||
timestamp: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DateRange {
|
export interface DateRange {
|
||||||
value: string;
|
value: string;
|
||||||
startDate: Date;
|
startDate: Date;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { startOfMinute, subMinutes } from 'date-fns';
|
import { startOfMinute, subMinutes } from 'date-fns';
|
||||||
import { canViewWebsite } from 'lib/auth';
|
import { canViewWebsite } from 'lib/auth';
|
||||||
import { useAuth, useValidate } from 'lib/middleware';
|
import { useAuth, useValidate } from 'lib/middleware';
|
||||||
import { NextApiRequestQueryBody, RealtimeInit } from 'lib/types';
|
import { NextApiRequestQueryBody } from 'lib/types';
|
||||||
import { NextApiResponse } from 'next';
|
import { NextApiResponse } from 'next';
|
||||||
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
|
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
|
||||||
import { getRealtimeData } from 'queries';
|
import { getRealtimeData } from 'queries';
|
||||||
|
|
@ -20,10 +20,7 @@ const schema = {
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async (
|
export default async (req: NextApiRequestQueryBody<RealtimeRequestQuery>, res: NextApiResponse) => {
|
||||||
req: NextApiRequestQueryBody<RealtimeRequestQuery>,
|
|
||||||
res: NextApiResponse<RealtimeInit>,
|
|
||||||
) => {
|
|
||||||
await useAuth(req, res);
|
await useAuth(req, res);
|
||||||
await useValidate(schema, req, res);
|
await useValidate(schema, req, res);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue