using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.SignalR; using xDataService.Configuration; using xFileService.Hubs; using xFileService.Interfaces.Entities; using xFileService.Models.Dtos; using xFileService.Models.Entities; using xIdentityModels.Models; using xIdentityService.Interfaces; using xModels.Dtos; using xStorageService.Interfaces; using XFileDto = xFileService.Models.Dtos.XFileDto; namespace xFileService.Interfaces { public interface IXFileProvider { // #region Props ... IXFileTagProvider TagProvider { get; } IHubContext Hub { get; } IXFileRepository FileRepository { get; } IXStorageProvider StorageProvider { get; } IXIdentityProvider IdentityProvider { get; } XDataServiceConfiguration DataSercviceConfiguration { get; } #endregion // #region Helpers ... /// /// Converts an Entity to Dto ... /// /// /// Task ToDto(XFile model); /// /// Convert a List of Entities to Dto ... /// /// /// Task> ToDtoList(IEnumerable list); /// /// Converts an Entity Query Result to Dto ... /// /// /// Task> ToDtoQueryResult(XQueryResult queryResult); #endregion // #region Tags ... /// /// Attach Tag to Specified File ... /// /// /// /// /// /// Task TagAttach( string tag, Guid id, XUserClaimsInfoDto userInfo = null, string connectionId = null ); /// /// Detach Tag fro Specified File ... /// /// /// /// /// /// Task TagDetach( string tag, Guid id, XUserClaimsInfoDto userInfo = null, string connectionId = null ); /// /// Attach Tags for Specified File ... /// /// /// /// /// /// Task TagsAttach( IEnumerable tags, Guid id, XUserClaimsInfoDto userInfo = null, string connectionId = null ); /// /// Detach Tags for Specified File ... /// /// /// /// /// /// Task TagsDetach( IEnumerable tags, Guid id, XUserClaimsInfoDto userInfo = null, string connectionId = null ); /// /// Detach all Attached Tags for Specified File ... /// /// /// /// /// Task TagsDetach( Guid id, XUserClaimsInfoDto userInfo = null, string connectionId = null ); #endregion // #region Tools ... /// /// Stream Specified File ... /// /// /// Task Stream(Guid id); /// /// Stream Specified File ... /// /// /// Task Stream(string fileName); /// /// Download Specified File ... /// /// /// Task Download(Guid id); /// /// Download Specified File ... /// /// /// Task Download(string fileName); /// /// Upload Files ... /// /// /// /// /// Task> Upload( IFormFileCollection files, XUserClaimsInfoDto userInfo = null, string connectionId = null ); /// /// Remove Specified Files ... /// /// /// /// /// Task> Remove( string ids, XUserClaimsInfoDto userInfo = null, string connectionId = null ); /// /// Retrieve Specified File Streaming Info ... /// /// /// Task GetFileDescriptor(Guid id); /// /// Retrieve Specified File Streaming Info ... /// /// /// Task GetFileDescriptor(string fileName); #endregion // #region Reference ... /// /// Get Reference Identifier for Specified Provider and Specified File ... /// /// /// /// string GetIdentifier( string providedFor, TKey forProvidedId ); /// /// Check Specified File has Refernce to Provider ... /// /// /// /// /// Task IsProvidedFor( string providedFor, TKey forProvidedId, Guid id ); /// /// Add Specified Reference to Specified File ... /// /// /// /// /// /// /// Task AddReference( string providedFor, TKey forProvidedId, Guid id, XUserClaimsInfoDto userInfo = null, string connectionId = null ); /// /// Remove Specified Reference from Specified File ... /// /// /// /// /// /// /// Task RemoveReference( string providedFor, TKey forProvidedId, Guid id, XUserClaimsInfoDto userInfo = null, string connectionId = null ); #endregion // #region Data Model ... /// /// Get Specified File Model ... /// /// /// /// Task Get( Guid id ); /// /// Get All Exists File Models ... /// /// /// Task> GetAll(); /// /// find an Entity by providing a Conditional Expression ... /// /// Task FindOne(Expression> whereClause); /// /// find a collection of Entities by proving a Conditional Expression ... /// /// /// Task> FindMany( Expression> whereClause ); /// /// retrieve Entities based on XQuery Pagination structure ... /// /// /// Task> Query( XQuery query ); /// /// retrieve Owned Entities based on XQuery Pagination structure ... /// /// /// /// Task> QueryOwned( XQuery query, XUserClaimsInfoDto userInfo = null ); /// /// retrieve Entities based on XQuery Pagination structure by providing a Conditional Expression ... /// /// /// /// Task> ConditionalQuery( Expression> whereClause, XQuery query ); /// /// retrieve Owned Entities based on XQuery Pagination structure by providing a Conditional Expression ... /// /// /// /// /// Task> ConditionalQueryOwned( Expression> whereClause, XQuery query, XUserClaimsInfoDto userInfo = null ); /// /// Update an Entity values ... /// /// /// /// /// /// Task Update( Guid id, XFileDto item, XUserClaimsInfoDto userInfo = null, string connectionId = null ); /// /// remove an Entity ... /// /// /// /// /// Task Remove( Guid id, XUserClaimsInfoDto userInfo = null, string connectionId = null ); /// /// count all exists Entities ... /// /// Task Count(); /// /// Check an Entity exists or not ... /// /// /// Task IsExists( Guid id ); #endregion } }