2016-05-21 23:16:22 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2015-12-09 04:57:38 +01:00
|
|
|
|
using System.Threading.Tasks;
|
2017-03-09 03:45:08 +01:00
|
|
|
|
using Bit.Core.Models.Table;
|
2017-03-18 05:02:06 +01:00
|
|
|
|
using Core.Models.Data;
|
2017-06-30 17:15:58 +02:00
|
|
|
|
using Bit.Core.Models.Data;
|
2015-12-09 04:57:38 +01:00
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Repositories
|
|
|
|
|
{
|
2016-05-21 23:16:22 +02:00
|
|
|
|
public interface ICipherRepository : IRepository<Cipher, Guid>
|
2015-12-09 04:57:38 +01:00
|
|
|
|
{
|
2017-03-18 16:58:02 +01:00
|
|
|
|
Task<CipherDetails> GetByIdAsync(Guid id, Guid userId);
|
2017-09-06 19:01:22 +02:00
|
|
|
|
Task<CipherDetails> GetDetailsByIdAsync(Guid id);
|
2017-05-07 05:23:01 +02:00
|
|
|
|
Task<bool> GetCanEditByIdAsync(Guid userId, Guid cipherId);
|
2018-04-24 18:48:43 +02:00
|
|
|
|
Task<ICollection<CipherDetails>> GetManyByUserIdAsync(Guid userId, bool withOrganizations = true);
|
2017-04-17 23:01:23 +02:00
|
|
|
|
Task<ICollection<Cipher>> GetManyByOrganizationIdAsync(Guid organizationId);
|
2017-03-19 04:41:46 +01:00
|
|
|
|
Task CreateAsync(CipherDetails cipher);
|
|
|
|
|
Task ReplaceAsync(CipherDetails cipher);
|
|
|
|
|
Task UpsertAsync(CipherDetails cipher);
|
2017-08-31 00:18:39 +02:00
|
|
|
|
Task<bool> ReplaceAsync(Cipher obj, IEnumerable<Guid> collectionIds);
|
2017-03-24 21:15:50 +01:00
|
|
|
|
Task UpdatePartialAsync(Guid id, Guid userId, Guid? folderId, bool favorite);
|
2017-06-30 17:15:58 +02:00
|
|
|
|
Task UpdateAttachmentAsync(CipherAttachment attachment);
|
2017-07-07 17:07:22 +02:00
|
|
|
|
Task DeleteAttachmentAsync(Guid cipherId, string attachmentId);
|
2017-06-09 06:30:59 +02:00
|
|
|
|
Task DeleteAsync(IEnumerable<Guid> ids, Guid userId);
|
2017-06-09 15:48:44 +02:00
|
|
|
|
Task MoveAsync(IEnumerable<Guid> ids, Guid? folderId, Guid userId);
|
2017-10-26 03:26:09 +02:00
|
|
|
|
Task DeleteByUserIdAsync(Guid userId);
|
2017-05-31 15:54:32 +02:00
|
|
|
|
Task UpdateUserKeysAndCiphersAsync(User user, IEnumerable<Cipher> ciphers, IEnumerable<Folder> folders);
|
2017-04-16 04:26:45 +02:00
|
|
|
|
Task CreateAsync(IEnumerable<Cipher> ciphers, IEnumerable<Folder> folders);
|
2017-09-05 23:49:34 +02:00
|
|
|
|
Task CreateAsync(IEnumerable<Cipher> ciphers, IEnumerable<Collection> collections,
|
|
|
|
|
IEnumerable<CollectionCipher> collectionCiphers);
|
2015-12-09 04:57:38 +01:00
|
|
|
|
}
|
|
|
|
|
}
|