2015-12-26 23:09:53 -05:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2017-03-08 21:45:08 -05:00
|
|
|
|
using Bit.Core.Models.Table;
|
2017-03-18 11:58:02 -04:00
|
|
|
|
using Core.Models.Data;
|
2017-03-21 00:04:39 -04:00
|
|
|
|
using System;
|
2017-06-30 11:15:58 -04:00
|
|
|
|
using System.IO;
|
2015-12-26 23:09:53 -05:00
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Services
|
|
|
|
|
|
{
|
|
|
|
|
|
public interface ICipherService
|
|
|
|
|
|
{
|
2020-11-23 08:48:05 -06:00
|
|
|
|
Task SaveAsync(Cipher cipher, Guid savingUserId, DateTime? lastKnownRevisionDate, IEnumerable<Guid> collectionIds = null,
|
2018-10-22 14:09:55 -04:00
|
|
|
|
bool skipPermissionCheck = false, bool limitCollectionScope = true);
|
2020-11-23 08:48:05 -06:00
|
|
|
|
Task SaveDetailsAsync(CipherDetails cipher, Guid savingUserId, DateTime? lastKnownRevisionDate,
|
|
|
|
|
|
IEnumerable<Guid> collectionIds = null, bool skipPermissionCheck = false);
|
2018-11-14 17:19:04 -05:00
|
|
|
|
Task CreateAttachmentAsync(Cipher cipher, Stream stream, string fileName, string key,
|
|
|
|
|
|
long requestLength, Guid savingUserId, bool orgAdmin = false);
|
|
|
|
|
|
Task CreateAttachmentShareAsync(Cipher cipher, Stream stream, long requestLength, string attachmentId,
|
2017-07-10 14:30:12 -04:00
|
|
|
|
Guid organizationShareId);
|
2017-04-19 16:00:47 -04:00
|
|
|
|
Task DeleteAsync(Cipher cipher, Guid deletingUserId, bool orgAdmin = false);
|
2020-07-22 11:38:53 -05:00
|
|
|
|
Task DeleteManyAsync(IEnumerable<Guid> cipherIds, Guid deletingUserId, Guid? organizationId = null, bool orgAdmin = false);
|
2017-07-07 11:07:22 -04:00
|
|
|
|
Task DeleteAttachmentAsync(Cipher cipher, string attachmentId, Guid deletingUserId, bool orgAdmin = false);
|
2018-09-25 09:12:50 -04:00
|
|
|
|
Task PurgeAsync(Guid organizationId);
|
2017-06-09 09:48:44 -04:00
|
|
|
|
Task MoveManyAsync(IEnumerable<Guid> cipherIds, Guid? destinationFolderId, Guid movingUserId);
|
2017-03-18 11:58:02 -04:00
|
|
|
|
Task SaveFolderAsync(Folder folder);
|
|
|
|
|
|
Task DeleteFolderAsync(Folder folder);
|
2018-10-22 14:09:55 -04:00
|
|
|
|
Task ShareAsync(Cipher originalCipher, Cipher cipher, Guid organizationId, IEnumerable<Guid> collectionIds,
|
2020-11-23 08:48:05 -06:00
|
|
|
|
Guid userId, DateTime? lastKnownRevisionDate);
|
|
|
|
|
|
Task ShareManyAsync(IEnumerable<(Cipher cipher, DateTime? lastKnownRevisionDate)> ciphers, Guid organizationId,
|
|
|
|
|
|
IEnumerable<Guid> collectionIds, Guid sharingUserId);
|
2017-04-27 09:19:30 -04:00
|
|
|
|
Task SaveCollectionsAsync(Cipher cipher, IEnumerable<Guid> collectionIds, Guid savingUserId, bool orgAdmin);
|
2017-03-18 11:58:02 -04:00
|
|
|
|
Task ImportCiphersAsync(List<Folder> folders, List<CipherDetails> ciphers,
|
2017-02-25 23:38:24 -05:00
|
|
|
|
IEnumerable<KeyValuePair<int, int>> folderRelationships);
|
2017-09-05 17:49:34 -04:00
|
|
|
|
Task ImportCiphersAsync(List<Collection> collections, List<CipherDetails> ciphers,
|
|
|
|
|
|
IEnumerable<KeyValuePair<int, int>> collectionRelationships, Guid importingUserId);
|
2020-04-01 13:00:25 -04:00
|
|
|
|
Task SoftDeleteAsync(Cipher cipher, Guid deletingUserId, bool orgAdmin = false);
|
2020-07-22 11:38:53 -05:00
|
|
|
|
Task SoftDeleteManyAsync(IEnumerable<Guid> cipherIds, Guid deletingUserId, Guid? organizationId = null, bool orgAdmin = false);
|
2020-04-01 13:00:25 -04:00
|
|
|
|
Task RestoreAsync(Cipher cipher, Guid restoringUserId, bool orgAdmin = false);
|
2021-01-08 08:52:42 -06:00
|
|
|
|
Task RestoreManyAsync(IEnumerable<CipherDetails> ciphers, Guid restoringUserId);
|
2015-12-26 23:09:53 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|