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';
|
2022-03-25 20:05:49 +00:00
|
|
|
import { TUserStatus } from './TUserStatus';
|
2022-03-08 18:54:26 +00:00
|
|
|
|
2022-01-11 13:51:48 +00:00
|
|
|
export interface ILoggedUser {
|
|
|
|
id: string;
|
|
|
|
token: string;
|
|
|
|
username: string;
|
2022-04-07 16:27:45 +00:00
|
|
|
name?: string;
|
2022-01-11 13:51:48 +00:00
|
|
|
language?: string;
|
2022-03-25 20:05:49 +00:00
|
|
|
status: TUserStatus;
|
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-04-07 16:27:45 +00:00
|
|
|
enableMessageParserEarlyAdoption: boolean;
|
2022-08-25 19:53:19 +00:00
|
|
|
alsoSendThreadToChannel: 'default' | 'always' | 'never';
|
2023-08-01 17:34:05 +00:00
|
|
|
bio?: string;
|
|
|
|
nickname?: string;
|
2022-01-11 13:51:48 +00:00
|
|
|
}
|
|
|
|
|
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;
|