2020-03-24 13:01:14 +01:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using ModernKeePass.Domain.Dtos;
|
|
|
|
|
using ModernKeePass.Domain.Entities;
|
|
|
|
|
|
|
|
|
|
namespace ModernKeePass.Application.Common.Interfaces
|
|
|
|
|
{
|
|
|
|
|
public interface IDatabaseProxy
|
|
|
|
|
{
|
|
|
|
|
bool IsOpen { get; }
|
2020-03-24 17:31:34 +01:00
|
|
|
|
string Name { get; }
|
2020-03-26 12:25:22 +01:00
|
|
|
|
GroupEntity RootGroup { get; }
|
|
|
|
|
|
2020-03-28 16:13:17 +01:00
|
|
|
|
GroupEntity RecycleBin { get; set; }
|
2020-03-26 12:25:22 +01:00
|
|
|
|
string CipherId { get; set; }
|
|
|
|
|
string KeyDerivationId { get; set; }
|
2020-03-24 13:01:14 +01:00
|
|
|
|
string Compression { get; set; }
|
2020-03-27 18:45:13 +01:00
|
|
|
|
bool IsRecycleBinEnabled { get; set; }
|
2020-03-24 13:01:14 +01:00
|
|
|
|
|
2020-03-26 12:25:22 +01:00
|
|
|
|
Task<GroupEntity> Open(FileInfo fileInfo, Credentials credentials);
|
|
|
|
|
Task<GroupEntity> ReOpen();
|
|
|
|
|
Task<GroupEntity> Create(FileInfo fileInfo, Credentials credentials);
|
2020-03-24 13:01:14 +01:00
|
|
|
|
Task SaveDatabase();
|
2020-03-27 18:45:13 +01:00
|
|
|
|
Task SaveDatabase(string filePath);
|
2020-03-28 16:13:17 +01:00
|
|
|
|
void SetRecycleBin(string id);
|
2020-03-24 13:01:14 +01:00
|
|
|
|
Task UpdateCredentials(Credentials credentials);
|
|
|
|
|
void CloseDatabase();
|
2020-03-26 12:25:22 +01:00
|
|
|
|
|
|
|
|
|
Task AddEntry(string parentGroupId, string entryId);
|
2020-03-27 13:27:29 +01:00
|
|
|
|
Task InsertEntry(string parentGroupId, string entryId, int messageIndex);
|
2020-03-26 12:25:22 +01:00
|
|
|
|
Task AddGroup(string parentGroupId, string groupId);
|
2020-03-27 13:27:29 +01:00
|
|
|
|
void UpdateEntry(string entryId, string fieldName, object fieldValue);
|
2020-03-26 15:38:29 +01:00
|
|
|
|
void UpdateGroup(string groupId);
|
2020-03-26 12:25:22 +01:00
|
|
|
|
Task RemoveEntry(string parentGroupId, string entryId);
|
|
|
|
|
Task RemoveGroup(string parentGroupId, string groupId);
|
|
|
|
|
EntryEntity CreateEntry(string parentGroupId);
|
|
|
|
|
GroupEntity CreateGroup(string parentGroupId, string nameId, bool isRecycleBin = false);
|
|
|
|
|
Task DeleteEntry(string entryId);
|
|
|
|
|
Task DeleteGroup(string groupId);
|
|
|
|
|
|
|
|
|
|
void SortEntries(string groupId);
|
|
|
|
|
void SortSubGroups(string groupId);
|
2020-03-24 13:01:14 +01:00
|
|
|
|
}
|
|
|
|
|
}
|