using Bit.Core.Enums; using Bit.Core.Models.Data; using Bit.Core.Models.Domain; using Bit.Core.Models.View; namespace Bit.Core.Abstractions { public interface ICipherService { Task ClearAsync(string userId); Task ClearCacheAsync(); Task DeleteAsync(List ids); Task DeleteAsync(string id); Task DeleteAttachmentAsync(string id, string attachmentId); Task DeleteAttachmentWithServerAsync(string id, string attachmentId); Task DeleteWithServerAsync(string id); Task EncryptAsync(CipherView model, SymmetricCryptoKey key = null, Cipher originalCipher = null); Task> GetAllAsync(); Task> GetAllDecryptedAsync(Func filter = null); Task, List, List>> GetAllDecryptedByUrlAsync(string url, List includeOtherTypes = null); Task> GetAllDecryptedForGroupingAsync(string groupingId, bool folder = true); Task> GetAllDecryptedForUrlAsync(string url); Task GetAsync(string id); Task GetLastUsedForUrlAsync(string url); Task ReplaceAsync(Dictionary ciphers); Task SaveAttachmentRawWithServerAsync(Cipher cipher, CipherView cipherView, string filename, byte[] data); Task SaveCollectionsWithServerAsync(Cipher cipher); Task SaveWithServerAsync(Cipher cipher); Task ShareWithServerAsync(CipherView cipher, string organizationId, HashSet collectionIds); Task UpdateLastUsedDateAsync(string id); Task UpsertAsync(CipherData cipher); Task UpsertAsync(List cipher); Task DownloadAndDecryptAttachmentAsync(string cipherId, AttachmentView attachment, string organizationId); Task SoftDeleteWithServerAsync(string id); Task RestoreWithServerAsync(string id); Task CreateNewLoginForPasskeyAsync(Fido2ConfirmNewCredentialParams newPasskeyParams); Task CopyTotpCodeIfNeededAsync(CipherView cipher); Task VerifyOrganizationHasUnassignedItemsAsync(); } }