Sync with backend, added deleted prop to users

This commit is contained in:
Ferdinand Thiessen 2021-12-05 14:21:18 +01:00
parent 471fb486d5
commit bd74725263
4 changed files with 32 additions and 28 deletions

2
types/PEP440.d.ts vendored
View File

@ -11,4 +11,4 @@ type PreRelease = Join<[['a' | 'b' | 'rc'], number], '.'>;
type PRVersion = BaseVersion | `${BaseVersion}${PreRelease}`;
/** A PEP440 subset used to describe backend module versions */
declare type PEP440Version = PRVersion | `${PRVersion}.dev${number}`;
declare type PEP440Version = PRVersion | `${PRVersion}.dev${number}`;

27
types/api.d.ts vendored Normal file
View File

@ -0,0 +1,27 @@
/// <reference path="PEP440.d.ts" />
/**
* 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 PaginationFilter {
limit?: number;
offset?: number;
from?: Date;
to?: Date;
/** Default to ascending */
descending?: boolean;
}
interface PaginationResponse<T> {
result: T[];
count: number;
}
}

3
types/index.d.ts vendored
View File

@ -1,4 +1,5 @@
/// <reference path="flaschengeist.d.ts" />
/// <reference path="api.d.ts" />
/// <reference path="models.d.ts" />
/// <reference path="PEP440.d.ts" />
export * from './plugin';

View File

@ -1,17 +1,5 @@
/// <reference path="PEP440.d.ts" />
/**
* Types used for communicating with the API
*/
/** Models exported from backend */
declare namespace FG {
interface BackendPlugin {
permissions: string[];
version: PEP440Version;
}
interface Backend {
plugins: {[key: string]: BackendPlugin};
version: PEP440Version;
}
interface Notification {
id: number;
plugin: string;
@ -21,6 +9,7 @@ declare namespace FG {
}
interface User {
userid: string;
deleted: boolean;
display_name: string;
firstname: string;
lastname: string;
@ -28,7 +17,6 @@ declare namespace FG {
birthday?: Date;
roles: Array<string>;
permissions?: Array<string>;
avatar_url?: string;
}
interface Session {
expires: Date;
@ -44,16 +32,4 @@ declare namespace FG {
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;
}
}