using System; using System.Collections.Generic; using System.Threading.Tasks; using Wino.Core.Domain.Entities.Mail; using Wino.Core.Domain.Entities.Shared; using Wino.Core.Domain.Enums; using Wino.Core.Domain.Models.Accounts; namespace Wino.Core.Domain.Interfaces; public interface IAccountService { /// /// Current IAuthenticator that should receive external authentication process to continue with. /// For example: Google auth will launch a browser authentication. After it completes, this is the IAuthenticator /// to continue process for token exchange. /// IAuthenticator ExternalAuthenticationAuthenticator { get; set; } /// /// Returns all local accounts. /// /// All local accounts Task> GetAccountsAsync(); /// /// Returns single MailAccount /// /// AccountId. Task GetAccountAsync(Guid accountId); /// /// Deletes all information about the account, including token information. /// /// MailAccount to be removed Task DeleteAccountAsync(MailAccount account); /// /// Returns the custom server information for the given account id. /// Task GetAccountCustomServerInformationAsync(Guid accountId); /// /// Updates the given account properties. /// Task UpdateAccountAsync(MailAccount account); /// /// Creates new account with the given server information if any. /// Also sets the account as Startup account if there are no accounts. /// Task CreateAccountAsync(MailAccount account, CustomServerInformation customServerInformation); /// /// Fixed authentication errors for account by forcing interactive login. /// Task FixTokenIssuesAsync(Guid accountId); /// /// Removed the attention from an account. /// /// Account id to remove from Task ClearAccountAttentionAsync(Guid accountId); /// /// Renames the merged inbox with the given id. /// /// Merged Inbox id /// New name for the merged/linked inbox. Task RenameMergedAccountAsync(Guid mergedInboxId, string newName); /// /// Creates a new merged inbox with the given accounts. /// /// Merged inbox properties. /// List of accounts to merge together. Task CreateMergeAccountsAsync(MergedInbox mergedInbox, IEnumerable accountsToMerge); /// /// Updates the merged inbox with the given id with the new linked accounts. /// /// Updating merged inbox id. /// List of linked account ids. Task UpdateMergedInboxAsync(Guid mergedInboxId, IEnumerable linkedAccountIds); /// /// Destroys the merged inbox with the given id. /// /// Merged inbox id to destroy. Task UnlinkMergedInboxAsync(Guid mergedInboxId); /// /// Updates the account listing orders. /// /// AccountId-OrderNumber pair for all accounts. Task UpdateAccountOrdersAsync(Dictionary accountIdOrderPair); /// /// Returns the account aliases. /// /// Account id. /// A list of MailAccountAlias that has e-mail aliases. Task> GetAccountAliasesAsync(Guid accountId); /// /// Updated account's aliases. /// /// Account id to update aliases for. /// Full list of updated aliases. /// Task UpdateAccountAliasesAsync(Guid accountId, List aliases); /// /// Delete account alias. /// /// Alias to remove. Task DeleteAccountAliasAsync(Guid aliasId); /// /// Updated profile information of the account. /// /// Account id to update info for. /// Info data. /// Task UpdateProfileInformationAsync(Guid accountId, ProfileInformation profileInformation); /// /// Creates a root + primary alias for the account. /// This is only called when the account is created. /// /// Account id. /// Address to create root primary alias from. Task CreateRootAliasAsync(Guid accountId, string address); /// /// Will compare local-remote aliases and update the local ones or add/delete new ones. /// /// Remotely fetched basic alias info from synchronizer. /// Account to update remote aliases for.. Task UpdateRemoteAliasInformationAsync(MailAccount account, List remoteAccountAliases); /// /// Gets the primary account alias for the given account id. /// Used when creating draft messages. /// /// Account id. /// Primary alias for the account. Task GetPrimaryAccountAliasAsync(Guid accountId); Task IsAccountFocusedEnabledAsync(Guid accountId); /// /// Deletes mail cache in the database for the given account. /// /// Account id. /// Reason for the cache reset. Task DeleteAccountMailCacheAsync(Guid accountId, AccountCacheResetReason accountCacheResetReason); /// /// Updates the synchronization identifier for a specific account asynchronously. /// /// Identifies the account for which the synchronization identifier is being updated. /// Represents the new synchronization identifier to be set for the specified account. Task UpdateSyncIdentifierRawAsync(Guid accountId, string syncIdentifier); /// /// Gets whether the notifications are enabled for the given account id. /// /// Account id. /// Whether the notifications should be created after sync or not. Task IsNotificationsEnabled(Guid accountId); Task UpdateAccountCustomServerInformationAsync(CustomServerInformation customServerInformation); }