2022-02-27 17:54:25 +00:00
|
|
|
import { ModelWithRelationships, UUID } from '@/api/definitions';
|
2022-02-27 16:26:13 +00:00
|
|
|
import { Server } from '@/api/admin/server';
|
|
|
|
|
2022-02-27 17:54:25 +00:00
|
|
|
interface User extends ModelWithRelationships {
|
2022-02-27 16:26:13 +00:00
|
|
|
id: number;
|
|
|
|
uuid: UUID;
|
|
|
|
externalId: string;
|
|
|
|
username: string;
|
|
|
|
email: string;
|
|
|
|
language: string;
|
|
|
|
adminRoleId: number | null;
|
|
|
|
roleName: string;
|
|
|
|
isRootAdmin: boolean;
|
|
|
|
isUsingTwoFactor: boolean;
|
|
|
|
avatarUrl: string;
|
|
|
|
createdAt: Date;
|
|
|
|
updatedAt: Date;
|
|
|
|
relationships: {
|
|
|
|
role: UserRole | null;
|
|
|
|
// TODO: just use an API call, this is probably a bad idea for performance.
|
|
|
|
servers?: Server[];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-02-27 17:54:25 +00:00
|
|
|
interface UserRole extends ModelWithRelationships {
|
2022-02-27 20:26:26 +00:00
|
|
|
id: number;
|
2022-02-27 16:26:13 +00:00
|
|
|
name: string;
|
|
|
|
description: string;
|
|
|
|
}
|