2022-01-11 13:51:48 +00:00
|
|
|
import Model from '@nozbe/watermelondb/Model';
|
|
|
|
|
2022-03-08 18:54:26 +00:00
|
|
|
import { IUserEmail, IUserSettings } from './IUser';
|
|
|
|
import { UserStatus } from './UserStatus';
|
|
|
|
|
2022-01-11 13:51:48 +00:00
|
|
|
export interface ILoggedUser {
|
|
|
|
id: string;
|
|
|
|
token: string;
|
|
|
|
username: string;
|
|
|
|
name: string;
|
|
|
|
language?: string;
|
2022-03-08 18:54:26 +00:00
|
|
|
status: UserStatus;
|
2022-01-11 13:51:48 +00:00
|
|
|
statusText?: string;
|
2022-03-08 18:54:26 +00:00
|
|
|
customFields?: {
|
|
|
|
[key: string]: any;
|
|
|
|
};
|
|
|
|
statusLivechat?: string;
|
|
|
|
emails?: IUserEmail[];
|
2022-02-21 16:06:57 +00:00
|
|
|
roles?: string[];
|
2022-01-11 13:51:48 +00:00
|
|
|
avatarETag?: string;
|
2022-02-21 16:06:57 +00:00
|
|
|
showMessageInMainThread?: boolean;
|
|
|
|
isFromWebView?: boolean;
|
2022-01-11 13:51:48 +00:00
|
|
|
enableMessageParserEarlyAdoption?: boolean;
|
|
|
|
}
|
|
|
|
|
2022-03-08 18:54:26 +00:00
|
|
|
export interface ILoggedUserResultFromServer
|
|
|
|
extends Omit<ILoggedUser, 'enableMessageParserEarlyAdoption' | 'showMessageInMainThread'> {
|
|
|
|
settings: IUserSettings;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ILoginResultFromServer {
|
|
|
|
status: string;
|
|
|
|
authToken: string;
|
|
|
|
userId: string;
|
|
|
|
me: ILoggedUserResultFromServer;
|
|
|
|
}
|
|
|
|
|
2022-02-01 13:39:09 +00:00
|
|
|
export type TLoggedUserModel = ILoggedUser & Model;
|