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
|
|
|
|
|
|
{
|
2018-10-22 14:09:55 -04:00
|
|
|
|
Task SaveAsync(Cipher cipher, Guid savingUserId, IEnumerable<Guid> collectionIds = null,
|
|
|
|
|
|
bool skipPermissionCheck = false, bool limitCollectionScope = true);
|
|
|
|
|
|
Task SaveDetailsAsync(CipherDetails cipher, Guid savingUserId, IEnumerable<Guid> collectionIds = null,
|
|
|
|
|
|
bool skipPermissionCheck = false);
|
2017-06-30 14:41:57 -04:00
|
|
|
|
Task CreateAttachmentAsync(Cipher cipher, Stream stream, string fileName, long requestLength, Guid savingUserId,
|
2017-06-30 11:15:58 -04:00
|
|
|
|
bool orgAdmin = false);
|
2018-10-22 14:09:55 -04:00
|
|
|
|
Task CreateAttachmentShareAsync(Cipher cipher, Stream stream, string fileName, 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);
|
2017-06-09 00:30:59 -04:00
|
|
|
|
Task DeleteManyAsync(IEnumerable<Guid> cipherIds, Guid deletingUserId);
|
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,
|
|
|
|
|
|
Guid userId);
|
|
|
|
|
|
Task ShareManyAsync(IEnumerable<Cipher> 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);
|
2015-12-26 23:09:53 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|