///
/**
* Types used for communicating with the API
*/
declare namespace FG {
interface BackendPlugin {
permissions: string[];
version: PEP440Version;
}
interface Backend {
plugins: {[key: string]: BackendPlugin};
version: PEP440Version;
}
interface Notification {
id: number;
plugin: string;
text: string;
data?: any;
time: Date;
}
interface User {
userid: string;
display_name: string;
firstname: string;
lastname: string;
mail: string;
birthday?: Date;
roles: Array;
permissions?: Array;
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;
}
interface PaginationFilter {
limit?: number;
offset?: number;
from?: Date;
to?: Date;
/** Default to ascending */
descending?: boolean;
}
interface PaginationResponse {
result: T[];
count: number;
}
}