From bd7472526373db0514e1f25dff5b0184e609afd1 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 5 Dec 2021 14:21:18 +0100 Subject: [PATCH] Sync with backend, added deleted prop to users --- types/PEP440.d.ts | 2 +- types/api.d.ts | 27 ++++++++++++++++++++++ types/index.d.ts | 3 ++- types/{flaschengeist.d.ts => models.d.ts} | 28 ++--------------------- 4 files changed, 32 insertions(+), 28 deletions(-) create mode 100644 types/api.d.ts rename types/{flaschengeist.d.ts => models.d.ts} (53%) diff --git a/types/PEP440.d.ts b/types/PEP440.d.ts index f5c0a18..f55b2b9 100644 --- a/types/PEP440.d.ts +++ b/types/PEP440.d.ts @@ -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}`; \ No newline at end of file +declare type PEP440Version = PRVersion | `${PRVersion}.dev${number}`; diff --git a/types/api.d.ts b/types/api.d.ts new file mode 100644 index 0000000..2d473bb --- /dev/null +++ b/types/api.d.ts @@ -0,0 +1,27 @@ +/// +/** + * 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 { + result: T[]; + count: number; + } +} diff --git a/types/index.d.ts b/types/index.d.ts index b79cf34..2995593 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,4 +1,5 @@ -/// +/// +/// /// export * from './plugin'; diff --git a/types/flaschengeist.d.ts b/types/models.d.ts similarity index 53% rename from types/flaschengeist.d.ts rename to types/models.d.ts index 4133763..c8972c8 100644 --- a/types/flaschengeist.d.ts +++ b/types/models.d.ts @@ -1,17 +1,5 @@ -/// -/** - * 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; permissions?: Array; - avatar_url?: string; } interface Session { expires: Date; @@ -44,16 +32,4 @@ declare namespace FG { 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; - } }