using System.IO;
namespace BotSharp.Abstraction.Files;
public interface IFileBasicService
{
#region Conversation
///
/// Get the files that have been uploaded in the chat.
/// If includeScreenShot is true, it will take the screenshots of non-image files, such as pdf, and return the screenshots instead of the original file.
///
///
///
///
///
///
///
///
Task> GetChatFiles(string conversationId, string source,
IEnumerable conversations, IEnumerable contentTypes,
bool includeScreenShot = false, int? offset = null);
///
/// Get the files that have been uploaded in the chat. No screenshot images are included.
///
///
///
///
///
///
IEnumerable GetMessageFiles(string conversationId, IEnumerable messageIds, string source, IEnumerable? contentTypes = null);
string GetMessageFile(string conversationId, string messageId, string source, string index, string fileName);
IEnumerable GetMessagesWithFile(string conversationId, IEnumerable messageIds);
bool SaveMessageFiles(string conversationId, string messageId, string source, List files);
///
/// Delete files under messages
///
/// Conversation Id
/// Files in these messages will be deleted
/// The starting message to delete
/// If not null, delete messages while input a new message; otherwise, delete messages only
///
bool DeleteMessageFiles(string conversationId, IEnumerable messageIds, string targetMessageId, string? newMessageId = null);
bool DeleteConversationFiles(IEnumerable conversationIds);
#endregion
#region User
string GetUserAvatar();
bool SaveUserAvatar(BotSharpFile file);
#endregion
#region Common
string GetDirectory(string conversationId);
byte[] GetFileBytes(string fileStorageUrl);
bool SavefileToPath(string filePath, Stream stream);
bool ExistDirectory(string? dir);
void CreateDirectory(string dir);
void DeleteDirectory(string dir);
string BuildDirectory(params string[] segments);
#endregion
}