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