2020-03-24 13:01:14 +01:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using ModernKeePass.Domain.Dtos;
|
|
|
|
|
using ModernKeePass.Domain.Entities;
|
2020-03-30 19:43:04 +02:00
|
|
|
|
using ModernKeePass.Domain.Enums;
|
2020-03-24 13:01:14 +01:00
|
|
|
|
|
|
|
|
|
namespace ModernKeePass.Application.Common.Interfaces
|
|
|
|
|
{
|
|
|
|
|
public interface IDatabaseProxy
|
|
|
|
|
{
|
2020-04-06 20:20:45 +02:00
|
|
|
|
string ZeroId { get; }
|
2020-03-24 13:01:14 +01:00
|
|
|
|
bool IsOpen { get; }
|
2020-03-24 17:31:34 +01:00
|
|
|
|
string Name { get; }
|
2020-04-01 19:37:30 +02:00
|
|
|
|
string RootGroupId { get; }
|
|
|
|
|
string RecycleBinId { 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-04-06 20:20:45 +02:00
|
|
|
|
string FileAccessToken { get; set; }
|
2020-03-24 13:01:14 +01:00
|
|
|
|
|
2020-04-06 20:20:45 +02:00
|
|
|
|
Task Open(byte[] file, Credentials credentials);
|
|
|
|
|
Task ReOpen(byte[] file);
|
2020-04-07 17:29:03 +02:00
|
|
|
|
Task Create(Credentials credentials, string name, DatabaseVersion version = DatabaseVersion.V2);
|
2020-04-06 20:20:45 +02:00
|
|
|
|
Task<byte[]> SaveDatabase();
|
|
|
|
|
Task<byte[]> SaveDatabase(byte[] newFileContents);
|
|
|
|
|
void UpdateCredentials(Credentials credentials);
|
2020-03-24 13:01:14 +01:00
|
|
|
|
void CloseDatabase();
|
2020-03-26 12:25:22 +01:00
|
|
|
|
|
|
|
|
|
Task AddEntry(string parentGroupId, string entryId);
|
2020-04-08 15:27:40 +02:00
|
|
|
|
Task InsertEntry(string parentGroupId, string entryId, int index);
|
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-04-02 19:12:16 +02:00
|
|
|
|
Task RemoveEntry(string parentGroupId, string entryId);
|
|
|
|
|
Task RemoveGroup(string parentGroupId, string groupId);
|
2020-04-06 20:20:45 +02:00
|
|
|
|
void DeleteEntity(string entityId);
|
2020-03-26 12:25:22 +01:00
|
|
|
|
EntryEntity CreateEntry(string parentGroupId);
|
2020-04-07 17:29:03 +02:00
|
|
|
|
GroupEntity CreateGroup(string parentGroupId, string name, bool isRecycleBin = false);
|
2020-03-26 12:25:22 +01:00
|
|
|
|
void SortEntries(string groupId);
|
|
|
|
|
void SortSubGroups(string groupId);
|
2020-04-01 19:37:30 +02:00
|
|
|
|
EntryEntity GetEntry(string id);
|
|
|
|
|
GroupEntity GetGroup(string id);
|
2020-03-24 13:01:14 +01:00
|
|
|
|
}
|
|
|
|
|
}
|