2021-11-25 12:39:44 +00:00
|
|
|
/**
|
|
|
|
* Types used for communicating with the API
|
|
|
|
*/
|
|
|
|
|
2021-05-20 21:14:32 +00:00
|
|
|
declare namespace FG {
|
|
|
|
interface Notification {
|
|
|
|
id: number;
|
|
|
|
plugin: string;
|
|
|
|
text: string;
|
2021-05-26 14:55:53 +00:00
|
|
|
data?: any;
|
2021-05-20 21:14:32 +00:00
|
|
|
time: Date;
|
|
|
|
}
|
|
|
|
interface User {
|
|
|
|
userid: string;
|
|
|
|
display_name: string;
|
|
|
|
firstname: string;
|
|
|
|
lastname: string;
|
|
|
|
mail: string;
|
|
|
|
birthday?: Date;
|
|
|
|
roles: Array<string>;
|
|
|
|
permissions?: Array<string>;
|
|
|
|
avatar_url?: string;
|
|
|
|
}
|
|
|
|
interface Session {
|
|
|
|
expires: Date;
|
|
|
|
token: string;
|
|
|
|
lifetime: number;
|
|
|
|
browser: string;
|
|
|
|
platform: string;
|
|
|
|
userid: string;
|
|
|
|
}
|
|
|
|
type Permission = string;
|
|
|
|
interface Role {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
permissions: Array<Permission>;
|
|
|
|
}
|
2021-11-25 12:39:44 +00:00
|
|
|
interface PaginationFilter {
|
|
|
|
limit?: number;
|
|
|
|
offset?: number;
|
|
|
|
from?: Date;
|
|
|
|
to?: Date;
|
2021-11-25 14:29:34 +00:00
|
|
|
/** Default to ascending */
|
|
|
|
descending?: boolean;
|
2021-11-25 12:39:44 +00:00
|
|
|
}
|
|
|
|
interface PaginationResponse<T> {
|
|
|
|
result: T[];
|
|
|
|
count: number;
|
|
|
|
}
|
2021-05-20 21:14:32 +00:00
|
|
|
}
|