2019-04-17 05:30:52 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
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);
|
2020-10-13 21:39:36 +02:00
|
|
|
|
Task ClearCacheAsync();
|
2019-04-17 05:30:52 +02:00
|
|
|
|
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();
|
2022-12-07 17:39:20 +01:00
|
|
|
|
Task<List<CipherView>> GetAllDecryptedAsync(Func<Cipher, bool> filter = null);
|
2019-04-17 05:30:52 +02:00
|
|
|
|
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);
|
2023-09-28 15:00:20 +02:00
|
|
|
|
Task<Cipher> SaveAttachmentRawWithServerAsync(Cipher cipher, CipherView cipherView, string filename, byte[] data);
|
2019-04-17 05:30:52 +02:00
|
|
|
|
Task SaveCollectionsWithServerAsync(Cipher cipher);
|
|
|
|
|
Task SaveWithServerAsync(Cipher cipher);
|
2023-10-17 17:36:54 +02:00
|
|
|
|
Task ShareWithServerAsync(CipherView cipher, string organizationId, HashSet<string> collectionIds);
|
2019-04-17 05:30:52 +02:00
|
|
|
|
Task UpdateLastUsedDateAsync(string id);
|
|
|
|
|
Task UpsertAsync(CipherData cipher);
|
|
|
|
|
Task UpsertAsync(List<CipherData> cipher);
|
2021-03-31 01:42:43 +02:00
|
|
|
|
Task<byte[]> DownloadAndDecryptAttachmentAsync(string cipherId, AttachmentView attachment, string organizationId);
|
2020-05-20 19:35:20 +02:00
|
|
|
|
Task SoftDeleteWithServerAsync(string id);
|
|
|
|
|
Task RestoreWithServerAsync(string id);
|
2019-04-17 05:30:52 +02:00
|
|
|
|
}
|
2020-05-20 19:35:20 +02:00
|
|
|
|
}
|