mattermost-mobile/types/database/index.d.ts
Avinash Lingaloo 98c89797a5
MM_30476 [v2] Section 'Post' of the server schema (#5077)
* MM_30476 : Added all isolated tables from the server schema

* MM_30476 : Updated 'test' script in package.json

* MM_30476 : ADDED team section of the server schema

* MM_30476 : ADDED section for Group from the server schema

* MM_30476 : One PR for one section only

* MM_30476 : One PR for one section only

* MM_30476 : Rename table schemas to avoid name collision

* MM_30476 : ADDED section 'Post' of the server schema

* MM_30476 : Updated Post section of the server schema

* MM_30476 : Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* MM_30476 : Corrected draft wrt to suggestions

* MM_30476 : Apply suggestions from code review

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* MM_30476 : ADDED lazy queries to group_membership model

* MM_30476 : Update model to match definition - GroupsInChannel

* MM_30476 : Removed groups_in_team definition from Post section of this PR

* MM_30476 : Updated all comments to match their variable/field name

* MM_30476 : Updated test

* MM_30476 : Updated imports and groups_in_team definition

* MM_30476 : Updated FileInfo

* MM_30476 : Updated Posts and PostMetadata ts types

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2021-01-14 16:41:53 -03:00

97 lines
2 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
interface NotifyProps {
channel: true;
desktop: string;
desktop_sound: true;
email: true;
first_name: true
mention_keys: string;
push: string;
}
interface UserProps {
[userPropsName: string]: any
}
interface Timezone {
automaticTimezone: string
manualTimezone: string,
useAutomaticTimezone: true,
}
interface PostEmbed {
type: PostEmbedType;
url: string;
data: Record<string, any>;
}
interface CustomEmoji {
id: string;
create_at: number;
update_at: number;
delete_at: number;
creator_id: string;
name: string;
category: 'custom';
}
interface FileInfo {
id: string;
user_id: string;
post_id: string;
create_at: number;
update_at: number;
delete_at: number;
name: string;
extension: string;
size: number;
mime_type: string;
width: number;
height: number;
has_preview_image: boolean;
clientId: string;
localPath?: string;
uri?: string;
loading?: boolean;
}
type PostEmbedType = 'image' | 'message_attachment' | 'opengraph';
interface PostImage {
height: number;
width: number;
format?: string;
frame_count?: number;
}
interface Reaction {
user_id: string;
post_id: string;
emoji_name: string;
create_at: number;
}
interface PostMetadataTypes {
embeds: Array<PostEmbed>;
emojis: Array<CustomEmoji>;
files: Array<FileInfo>;
images: Dictionary<PostImage>;
reactions: Array<Reaction>;
}
type PostType = 'system_add_remove' |
'system_add_to_channel' |
'system_add_to_team' |
'system_channel_deleted' |
'system_channel_restored' |
'system_displayname_change' |
'system_convert_channel' |
'system_ephemeral' |
'system_header_change' |
'system_join_channel' |
'system_join_leave' |
'system_leave_channel' |
'system_purpose_change' |
'system_remove_from_channel';