linagora/Twake-Mobile

Files view in chat:: new backend api

shepilov opened this issue · 0 comments

Hey, I can’t find your username on Twake so I can’t write to you.

I need to change the returned object for the endpoint of recent files so it will break the feature.

The change is that instead of receiving a File you will now get a MessageFile. There is the changes you may need to do:

Old version:

id: string;
user_id: string;
company_id: string;
thumbnails: {
index: number;
id: string;

type: string;
size: number;
width: number;
height: number;

url: string;
}[];
upload_data: null | {
size: number;
chunks: number;
};
metadata: null | {
name?: string;
mime?: string;
thumbnails_status?: "done" | "error" | "waiting";
};

New version:

message_id: string;
metadata: {
source: "internal" | "drive" | string; //Uuid of the corresponding connector
external_id: string | {company_id: string, id: string};

name?: string; //Original file name
mime?: string; //Original file mime
size?: number; //Original file weight
thumbnails?: Thumbnail[]; //Url to thumbnail (or set it to undefined if no relevant)
type?: string;
}
cache: null | {
company_id: string;
workspace_id: string;
channel_id: string;
user_id: string;
};