2021-11-26 22:04:15 +00:00
|
|
|
/// <reference path="PEP440.d.ts" />
|
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 {
|
2021-11-26 22:04:15 +00:00
|
|
|
interface BackendPlugin {
|
|
|
|
permissions: string[];
|
|
|
|
version: PEP440Version;
|
|
|
|
}
|
|
|
|
interface Backend {
|
|
|
|
plugins: {[key: string]: BackendPlugin};
|
|
|
|
version: PEP440Version;
|
|
|
|
}
|
2021-05-20 21:14:32 +00:00
|
|
|
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
|
|
|
}
|