1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-09-27 03:52:57 +02:00
bitwarden-mobile/src/Core/Abstractions/ICipherService.cs
Federico Maccaroni 76e0f7e1a4
Merge branch 'main' into feature/maui-migration-passkeys
# Conflicts:
#	src/Core/Abstractions/ICipherService.cs
#	src/Core/Abstractions/IStateService.cs
#	src/Core/Models/AppOptions.cs
#	src/Core/Resources/Localization/AppResources.resx
#	src/Core/Utilities/ServiceContainer.cs
#	src/iOS.Autofill/iOS.Autofill.csproj
2024-04-18 13:28:22 -03:00

42 lines
2.2 KiB
C#

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<string> ids);
Task DeleteAsync(string id);
Task DeleteAttachmentAsync(string id, string attachmentId);
Task DeleteAttachmentWithServerAsync(string id, string attachmentId);
Task DeleteWithServerAsync(string id);
Task<Cipher> EncryptAsync(CipherView model, SymmetricCryptoKey key = null, Cipher originalCipher = null);
Task<List<Cipher>> GetAllAsync();
Task<List<CipherView>> GetAllDecryptedAsync(Func<Cipher, bool> filter = null);
Task<Tuple<List<CipherView>, List<CipherView>, List<CipherView>>> GetAllDecryptedByUrlAsync(string url,
List<CipherType> includeOtherTypes = null);
Task<List<CipherView>> GetAllDecryptedForGroupingAsync(string groupingId, bool folder = true);
Task<List<CipherView>> GetAllDecryptedForUrlAsync(string url);
Task<Cipher> GetAsync(string id);
Task<CipherView> GetLastUsedForUrlAsync(string url);
Task ReplaceAsync(Dictionary<string, CipherData> ciphers);
Task<Cipher> SaveAttachmentRawWithServerAsync(Cipher cipher, CipherView cipherView, string filename, byte[] data);
Task SaveCollectionsWithServerAsync(Cipher cipher);
Task SaveWithServerAsync(Cipher cipher);
Task ShareWithServerAsync(CipherView cipher, string organizationId, HashSet<string> collectionIds);
Task UpdateLastUsedDateAsync(string id);
Task UpsertAsync(CipherData cipher);
Task UpsertAsync(List<CipherData> cipher);
Task<byte[]> DownloadAndDecryptAttachmentAsync(string cipherId, AttachmentView attachment, string organizationId);
Task SoftDeleteWithServerAsync(string id);
Task RestoreWithServerAsync(string id);
Task<string> CreateNewLoginForPasskeyAsync(Fido2ConfirmNewCredentialParams newPasskeyParams);
Task CopyTotpCodeIfNeededAsync(CipherView cipher);
Task<bool> VerifyOrganizationHasUnassignedItemsAsync();
}
}