51 lines
945 B
TypeScript
51 lines
945 B
TypeScript
/**
|
|
* Types used for communicating with the API
|
|
*/
|
|
|
|
declare namespace FG {
|
|
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<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>;
|
|
}
|
|
interface PaginationFilter {
|
|
limit?: number;
|
|
offset?: number;
|
|
from?: Date;
|
|
to?: Date;
|
|
/** Default to ascending */
|
|
descending?: boolean;
|
|
}
|
|
interface PaginationResponse<T> {
|
|
result: T[];
|
|
count: number;
|
|
}
|
|
}
|