From 64b8b5d3c8576322b749ed979a3fd41d191a2eef Mon Sep 17 00:00:00 2001 From: sbwalker Date: Mon, 11 Aug 2025 16:53:32 -0400 Subject: [PATCH] consolidate Service interface and implementation classes --- Oqtane.Client/Services/AliasService.cs | 40 +++ .../Services/CookieConsentService.cs | 39 ++- Oqtane.Client/Services/DatabaseService.cs | 12 + Oqtane.Client/Services/FileService.cs | 98 ++++++- Oqtane.Client/Services/FolderService.cs | 52 ++++ Oqtane.Client/Services/InstallationService.cs | 32 +++ .../Services/Interfaces/IAliasService.cs | 47 --- .../Interfaces/ICookieConsentService.cs | 42 --- .../Services/Interfaces/IDatabaseService.cs | 18 -- .../Services/Interfaces/IFileService.cs | 104 ------- .../Services/Interfaces/IFolderService.cs | 59 ---- .../Interfaces/IInstallationService.cs | 39 --- .../Services/Interfaces/IJobLogService.cs | 26 -- .../Services/Interfaces/IJobService.cs | 61 ---- .../Services/Interfaces/ILanguageService.cs | 56 ---- .../Interfaces/ILocalizationCookieService.cs | 17 -- .../Interfaces/ILocalizationService.cs | 18 -- .../Services/Interfaces/ILogService.cs | 72 ----- .../Interfaces/IModuleDefinitionService.cs | 56 ---- .../Services/Interfaces/IModuleService.cs | 73 ----- .../Interfaces/INotificationService.cs | 70 ----- .../Interfaces/IOutputCacheService.cs | 18 -- .../Services/Interfaces/IPackageService.cs | 70 ----- .../Services/Interfaces/IPageModuleService.cs | 56 ---- .../Services/Interfaces/IPageService.cs | 71 ----- .../Services/Interfaces/IProfileService.cs | 48 ---- .../Services/Interfaces/IRoleService.cs | 57 ---- .../Interfaces/ISearchResultsService.cs | 13 - .../Services/Interfaces/ISettingService.cs | 269 ------------------ .../Services/Interfaces/ISiteService.cs | 61 ---- .../Interfaces/ISiteTemplateService.cs | 18 -- .../Services/Interfaces/ISqlService.cs | 18 -- .../Services/Interfaces/ISyncService.cs | 19 -- .../Services/Interfaces/ISystemService.cs | 42 --- .../Services/Interfaces/ITenantService.cs | 25 -- .../Services/Interfaces/IThemeService.cs | 94 ------ .../Services/Interfaces/ITimeZoneService.cs | 17 -- .../Services/Interfaces/IUrlMappingService.cs | 56 ---- .../Services/Interfaces/IUserRoleService.cs | 72 ----- .../Services/Interfaces/IUserService.cs | 171 ----------- .../Services/Interfaces/IVisitorService.cs | 29 -- Oqtane.Client/Services/JobLogService.cs | 21 +- Oqtane.Client/Services/JobService.cs | 54 ++++ Oqtane.Client/Services/LanguageService.cs | 49 ++++ .../Services/LocalizationCookieService.cs | 13 + Oqtane.Client/Services/LocalizationService.cs | 12 + Oqtane.Client/Services/LogService.cs | 63 ++++ .../Services/ModuleDefinitionService.cs | 49 ++++ Oqtane.Client/Services/ModuleService.cs | 67 +++++ Oqtane.Client/Services/NotificationService.cs | 64 +++++ Oqtane.Client/Services/OutputCacheService.cs | 15 +- Oqtane.Client/Services/PackageService.cs | 64 ++++- Oqtane.Client/Services/PageModuleService.cs | 51 ++++ Oqtane.Client/Services/PageService.cs | 65 +++++ Oqtane.Client/Services/ProfileService.cs | 42 +++ Oqtane.Client/Services/RoleService.cs | 51 ++++ .../Services/SearchResultsService.cs | 7 +- Oqtane.Client/Services/SettingService.cs | 262 +++++++++++++++++ Oqtane.Client/Services/SiteService.cs | 53 ++++ Oqtane.Client/Services/SiteTemplateService.cs | 12 + Oqtane.Client/Services/SqlService.cs | 13 + Oqtane.Client/Services/SyncService.cs | 13 + Oqtane.Client/Services/SystemService.cs | 38 ++- Oqtane.Client/Services/TenantService.cs | 19 ++ Oqtane.Client/Services/ThemeService.cs | 89 +++++- Oqtane.Client/Services/TimeZoneService.cs | 12 + Oqtane.Client/Services/UrlMappingService.cs | 50 ++++ Oqtane.Client/Services/UserRoleService.cs | 66 +++++ Oqtane.Client/Services/UserService.cs | 168 ++++++++++- Oqtane.Client/Services/VisitorService.cs | 22 ++ 70 files changed, 1763 insertions(+), 1996 deletions(-) delete mode 100644 Oqtane.Client/Services/Interfaces/IAliasService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ICookieConsentService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IDatabaseService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IFileService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IFolderService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IInstallationService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IJobLogService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IJobService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ILanguageService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ILocalizationCookieService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ILocalizationService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ILogService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IModuleDefinitionService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IModuleService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/INotificationService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IOutputCacheService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IPackageService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IPageModuleService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IPageService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IProfileService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IRoleService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISearchResultsService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISettingService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISiteService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISiteTemplateService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISqlService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISyncService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISystemService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ITenantService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IThemeService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ITimeZoneService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IUrlMappingService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IUserRoleService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IUserService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IVisitorService.cs diff --git a/Oqtane.Client/Services/AliasService.cs b/Oqtane.Client/Services/AliasService.cs index 714f1061..0fb0600b 100644 --- a/Oqtane.Client/Services/AliasService.cs +++ b/Oqtane.Client/Services/AliasService.cs @@ -8,6 +8,46 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to retrieve and store information. + /// + public interface IAliasService + { + /// + /// Get all aliases in the system + /// + /// + Task> GetAliasesAsync(); + + /// + /// Get a single alias + /// + /// The ID, not to be confused with a ID + /// + Task GetAliasAsync(int aliasId); + + /// + /// Save another in the DB. It must already contain all the information incl. it belongs to. + /// + /// An to add. + /// + Task AddAliasAsync(Alias alias); + + /// + /// Update an in the DB. Make sure the object is correctly filled, as it must update an existing record. + /// + /// The to update. + /// + Task UpdateAliasAsync(Alias alias); + + /// + /// Remove an from the DB. + /// + /// The Alias ID, not to be confused with a Site ID. + /// + Task DeleteAliasAsync(int aliasId); + } + /// [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class AliasService : ServiceBase, IAliasService diff --git a/Oqtane.Client/Services/CookieConsentService.cs b/Oqtane.Client/Services/CookieConsentService.cs index 83c2abc7..29b3a40d 100644 --- a/Oqtane.Client/Services/CookieConsentService.cs +++ b/Oqtane.Client/Services/CookieConsentService.cs @@ -1,13 +1,46 @@ -using Oqtane.Models; using System.Threading.Tasks; using System.Net.Http; -using System; using Oqtane.Documentation; using Oqtane.Shared; -using System.Globalization; namespace Oqtane.Services { + /// + /// Service to retrieve cookie consent information. + /// + public interface ICookieConsentService + { + /// + /// Get cookie consent bar actioned status + /// + /// + Task IsActionedAsync(); + + /// + /// Get cookie consent status + /// + /// + Task CanTrackAsync(bool optOut); + + /// + /// create actioned cookie + /// + /// + Task CreateActionedCookieAsync(); + + /// + /// create consent cookie + /// + /// + Task CreateConsentCookieAsync(); + + /// + /// widhdraw consent cookie + /// + /// + Task WithdrawConsentCookieAsync(); + } + /// [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class CookieConsentService : ServiceBase, ICookieConsentService diff --git a/Oqtane.Client/Services/DatabaseService.cs b/Oqtane.Client/Services/DatabaseService.cs index bfa06865..3ca4a1a2 100644 --- a/Oqtane.Client/Services/DatabaseService.cs +++ b/Oqtane.Client/Services/DatabaseService.cs @@ -8,6 +8,18 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to retrieve information. + /// + public interface IDatabaseService + { + /// + /// Returns a list of databases + /// + /// + Task> GetDatabasesAsync(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class DatabaseService : ServiceBase, IDatabaseService { diff --git a/Oqtane.Client/Services/FileService.cs b/Oqtane.Client/Services/FileService.cs index 9bc563c6..2b45455a 100644 --- a/Oqtane.Client/Services/FileService.cs +++ b/Oqtane.Client/Services/FileService.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using System.Net; @@ -10,6 +9,103 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to get / create / upload / download files. + /// + public interface IFileService + { + /// + /// Get all s in the specified Folder + /// + /// The folder ID + /// + Task> GetFilesAsync(int folderId); + + /// + /// Get all s in the specified folder. + /// + /// + /// The folder path relative to where the files are stored. + /// TODO: todoc verify exactly from where the folder path must start + /// + /// + Task> GetFilesAsync(string folder); + + /// + /// Get one + /// + /// + /// + Task GetFileAsync(int fileId); + + /// + /// Get a based on the and file name. + /// + /// Reference to the + /// name of the file + /// + /// + Task GetFileAsync(int folderId, string name); + + /// + /// Add / store a record. + /// This does not contain the file contents. + /// + /// + /// + Task AddFileAsync(File file); + + /// + /// Update a record. + /// Use this for rename a file or change some attributes. + /// This does not contain the file contents. + /// + /// + /// + Task UpdateFileAsync(File file); + + /// + /// Delete a + /// + /// + /// + Task DeleteFileAsync(int fileId); + + /// + /// Upload a file from a URL to a + /// + /// + /// + /// + /// + Task UploadFileAsync(string url, int folderId, string name); + + /// + /// Get / download a file (the body). + /// + /// Reference to a + /// The bytes of the file + Task DownloadFileAsync(int fileId); + + /// + /// Retrieve a list of files from a and + /// + /// Reference to the + /// Path of the folder + /// TODO: todoc verify exactly from where the folder path must start + /// + /// + Task> GetFilesAsync(int siteId, string folderPath); + + /// + /// Unzips the contents of a zip file + /// + /// Reference to the + /// + /// + Task UnzipFileAsync(int fileId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class FileService : ServiceBase, IFileService { diff --git a/Oqtane.Client/Services/FolderService.cs b/Oqtane.Client/Services/FolderService.cs index 2ce045db..9a099777 100644 --- a/Oqtane.Client/Services/FolderService.cs +++ b/Oqtane.Client/Services/FolderService.cs @@ -9,6 +9,58 @@ using Oqtane.Documentation; namespace Oqtane.Services { + /// + /// Service to get / create / modify objects. + /// + public interface IFolderService + { + /// + /// Retrieve root folders of a + /// + /// + /// + Task> GetFoldersAsync(int siteId); + + /// + /// Retrieve the information of one + /// + /// + /// + Task GetFolderAsync(int folderId); + + /// + /// Create one Folder using a object. + /// + /// + /// + Task AddFolderAsync(Folder folder); + + /// + /// Update the information about a + /// Use this to rename the folder etc. + /// + /// + /// + Task UpdateFolderAsync(Folder folder); + + /// + /// Delete a + /// + /// Reference to a + /// + Task DeleteFolderAsync(int folderId); + + /// + /// Get a of a based on the path. + /// + /// Reference to the + /// Path of the folder + /// TODO: todoc verify exactly from where the folder path must start + /// + /// + Task GetFolderAsync(int siteId, [NotNull] string folderPath); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class FolderService : ServiceBase, IFolderService { diff --git a/Oqtane.Client/Services/InstallationService.cs b/Oqtane.Client/Services/InstallationService.cs index e0c388c8..28b80c3b 100644 --- a/Oqtane.Client/Services/InstallationService.cs +++ b/Oqtane.Client/Services/InstallationService.cs @@ -10,6 +10,38 @@ using System.Linq; namespace Oqtane.Services { + /// + /// Service to manage (install master database / upgrade version / etc.) the installation + /// + public interface IInstallationService + { + /// + /// Returns a status/message object with the current installation state + /// + /// + Task IsInstalled(); + + /// + /// Starts the installation process + /// + /// connectionString, database type, alias etc. + /// internal status/message object + Task Install(InstallConfig config); + + /// + /// Starts the upgrade process + /// + /// indicates if files should be backed up during upgrade + /// internal status/message object + Task Upgrade(bool backup); + + /// + /// Restarts the installation + /// + /// internal status/message object + Task RestartAsync(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class InstallationService : ServiceBase, IInstallationService { diff --git a/Oqtane.Client/Services/Interfaces/IAliasService.cs b/Oqtane.Client/Services/Interfaces/IAliasService.cs deleted file mode 100644 index 6b002ec7..00000000 --- a/Oqtane.Client/Services/Interfaces/IAliasService.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Oqtane.Models; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve and store information. - /// - public interface IAliasService - { - /// - /// Get all aliases in the system - /// - /// - Task> GetAliasesAsync(); - - /// - /// Get a single alias - /// - /// The ID, not to be confused with a ID - /// - Task GetAliasAsync(int aliasId); - - /// - /// Save another in the DB. It must already contain all the information incl. it belongs to. - /// - /// An to add. - /// - Task AddAliasAsync(Alias alias); - - /// - /// Update an in the DB. Make sure the object is correctly filled, as it must update an existing record. - /// - /// The to update. - /// - Task UpdateAliasAsync(Alias alias); - - /// - /// Remove an from the DB. - /// - /// The Alias ID, not to be confused with a Site ID. - /// - Task DeleteAliasAsync(int aliasId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ICookieConsentService.cs b/Oqtane.Client/Services/Interfaces/ICookieConsentService.cs deleted file mode 100644 index 71580d7e..00000000 --- a/Oqtane.Client/Services/Interfaces/ICookieConsentService.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Oqtane.Models; -using System; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve cookie consent information. - /// - public interface ICookieConsentService - { - /// - /// Get cookie consent bar actioned status - /// - /// - Task IsActionedAsync(); - - /// - /// Get cookie consent status - /// - /// - Task CanTrackAsync(bool optOut); - - /// - /// create actioned cookie - /// - /// - Task CreateActionedCookieAsync(); - - /// - /// create consent cookie - /// - /// - Task CreateConsentCookieAsync(); - - /// - /// widhdraw consent cookie - /// - /// - Task WithdrawConsentCookieAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IDatabaseService.cs b/Oqtane.Client/Services/Interfaces/IDatabaseService.cs deleted file mode 100644 index 94ca3f77..00000000 --- a/Oqtane.Client/Services/Interfaces/IDatabaseService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve information. - /// - public interface IDatabaseService - { - /// - /// Returns a list of databases - /// - /// - Task> GetDatabasesAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IFileService.cs b/Oqtane.Client/Services/Interfaces/IFileService.cs deleted file mode 100644 index 451d3c4d..00000000 --- a/Oqtane.Client/Services/Interfaces/IFileService.cs +++ /dev/null @@ -1,104 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to get / create / upload / download files. - /// - public interface IFileService - { - /// - /// Get all s in the specified Folder - /// - /// The folder ID - /// - Task> GetFilesAsync(int folderId); - - /// - /// Get all s in the specified folder. - /// - /// - /// The folder path relative to where the files are stored. - /// TODO: todoc verify exactly from where the folder path must start - /// - /// - Task> GetFilesAsync(string folder); - - /// - /// Get one - /// - /// - /// - Task GetFileAsync(int fileId); - - /// - /// Get a based on the and file name. - /// - /// Reference to the - /// name of the file - /// - /// - Task GetFileAsync(int folderId, string name); - - /// - /// Add / store a record. - /// This does not contain the file contents. - /// - /// - /// - Task AddFileAsync(File file); - - /// - /// Update a record. - /// Use this for rename a file or change some attributes. - /// This does not contain the file contents. - /// - /// - /// - Task UpdateFileAsync(File file); - - /// - /// Delete a - /// - /// - /// - Task DeleteFileAsync(int fileId); - - /// - /// Upload a file from a URL to a - /// - /// - /// - /// - /// - Task UploadFileAsync(string url, int folderId, string name); - - /// - /// Get / download a file (the body). - /// - /// Reference to a - /// The bytes of the file - Task DownloadFileAsync(int fileId); - - /// - /// Retrieve a list of files from a and - /// - /// Reference to the - /// Path of the folder - /// TODO: todoc verify exactly from where the folder path must start - /// - /// - Task> GetFilesAsync(int siteId, string folderPath); - - /// - /// Unzips the contents of a zip file - /// - /// Reference to the - /// - /// - Task UnzipFileAsync(int fileId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IFolderService.cs b/Oqtane.Client/Services/Interfaces/IFolderService.cs deleted file mode 100644 index 35e96956..00000000 --- a/Oqtane.Client/Services/Interfaces/IFolderService.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to get / create / modify objects. - /// - public interface IFolderService - { - /// - /// Retrieve root folders of a - /// - /// - /// - Task> GetFoldersAsync(int siteId); - - /// - /// Retrieve the information of one - /// - /// - /// - Task GetFolderAsync(int folderId); - - /// - /// Create one Folder using a object. - /// - /// - /// - Task AddFolderAsync(Folder folder); - - /// - /// Update the information about a - /// Use this to rename the folder etc. - /// - /// - /// - Task UpdateFolderAsync(Folder folder); - - /// - /// Delete a - /// - /// Reference to a - /// - Task DeleteFolderAsync(int folderId); - - /// - /// Get a of a based on the path. - /// - /// Reference to the - /// Path of the folder - /// TODO: todoc verify exactly from where the folder path must start - /// - /// - Task GetFolderAsync(int siteId, [NotNull]string folderPath); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IInstallationService.cs b/Oqtane.Client/Services/Interfaces/IInstallationService.cs deleted file mode 100644 index 1e2311ce..00000000 --- a/Oqtane.Client/Services/Interfaces/IInstallationService.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Oqtane.Models; -using System.Threading.Tasks; -using Oqtane.Shared; - -namespace Oqtane.Services -{ - - /// - /// Service to manage (install master database / upgrade version / etc.) the installation - /// - public interface IInstallationService - { - /// - /// Returns a status/message object with the current installation state - /// - /// - Task IsInstalled(); - - /// - /// Starts the installation process - /// - /// connectionString, database type, alias etc. - /// internal status/message object - Task Install(InstallConfig config); - - /// - /// Starts the upgrade process - /// - /// indicates if files should be backed up during upgrade - /// internal status/message object - Task Upgrade(bool backup); - - /// - /// Restarts the installation - /// - /// internal status/message object - Task RestartAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IJobLogService.cs b/Oqtane.Client/Services/Interfaces/IJobLogService.cs deleted file mode 100644 index e6a10a20..00000000 --- a/Oqtane.Client/Services/Interfaces/IJobLogService.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to read the job schedule log - /// - public interface IJobLogService - { - /// - /// Return a list of entries - /// - /// - /// - Task> GetJobLogsAsync(int jobId); - - /// - /// Return a entry for the given Id - /// - /// - /// - Task GetJobLogAsync(int jobLogId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IJobService.cs b/Oqtane.Client/Services/Interfaces/IJobService.cs deleted file mode 100644 index 984f4b59..00000000 --- a/Oqtane.Client/Services/Interfaces/IJobService.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - - /// - /// Service to manage jobs () - /// - public interface IJobService - { - /// - /// Returns a list of all jobs - /// - /// - Task> GetJobsAsync(); - - /// - /// Return a specific job - /// - /// - /// - Task GetJobAsync(int jobId); - - /// - /// Adds a new job - /// - /// - /// - Task AddJobAsync(Job job); - - /// - /// Updates an existing job - /// - /// - /// - Task UpdateJobAsync(Job job); - - /// - /// Delete an existing job - /// - /// - /// - Task DeleteJobAsync(int jobId); - - /// - /// Starts the given job - /// - /// - /// - Task StartJobAsync(int jobId); - - /// - /// Stops the given job - /// - /// - /// - Task StopJobAsync(int jobId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ILanguageService.cs b/Oqtane.Client/Services/Interfaces/ILanguageService.cs deleted file mode 100644 index bf7aa9a7..00000000 --- a/Oqtane.Client/Services/Interfaces/ILanguageService.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Oqtane.Models; - -namespace Oqtane.Services -{ - - /// - /// Service to manage entries - /// - public interface ILanguageService - { - /// - /// Returns a list of all available languages for the given - /// - /// - /// - Task> GetLanguagesAsync(int siteId); - - /// - /// Returns a list of all available languages for the given and package - /// - /// - /// - /// - Task> GetLanguagesAsync(int siteId, string packageName); - - /// - /// Returns the given language - /// - /// - /// - Task GetLanguageAsync(int languageId); - - /// - /// Adds the given language - /// - /// - /// - Task AddLanguageAsync(Language language); - - /// - /// Edits the given language - /// - /// - /// - Task EditLanguageAsync(Language language); - - /// - /// Deletes the given language - /// - /// - /// - Task DeleteLanguageAsync(int languageId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ILocalizationCookieService.cs b/Oqtane.Client/Services/Interfaces/ILocalizationCookieService.cs deleted file mode 100644 index a422d432..00000000 --- a/Oqtane.Client/Services/Interfaces/ILocalizationCookieService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to set localization cookie - /// - public interface ILocalizationCookieService - { - /// - /// Set the localization cookie - /// - /// - /// - Task SetLocalizationCookieAsync(string culture); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ILocalizationService.cs b/Oqtane.Client/Services/Interfaces/ILocalizationService.cs deleted file mode 100644 index 543f8eba..00000000 --- a/Oqtane.Client/Services/Interfaces/ILocalizationService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Oqtane.Models; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve localizations () - /// - public interface ILocalizationService - { - /// - /// Returns a collection of supported cultures - /// - /// - Task> GetCulturesAsync(bool installed); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ILogService.cs b/Oqtane.Client/Services/Interfaces/ILogService.cs deleted file mode 100644 index 28fe51b2..00000000 --- a/Oqtane.Client/Services/Interfaces/ILogService.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Oqtane.Models; -using Oqtane.Shared; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Oqtane.Enums; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve and store entries - /// - public interface ILogService - { - /// - /// Returns a list of log entires for the given params - /// - /// - /// - /// - /// - /// - Task> GetLogsAsync(int siteId, string level, string function, int rows); - - /// - /// Returns a specific log entry for the given id - /// - /// - /// - Task GetLogAsync(int logId); - - /// - /// Clear the entire logs of the given site. - /// - /// - /// - Task DeleteLogsAsync(int siteId); - - /// - /// Creates a new log entry - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - Task Log(int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args); - - /// - /// Creates a new log entry - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - Task Log(Alias alias, int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IModuleDefinitionService.cs b/Oqtane.Client/Services/Interfaces/IModuleDefinitionService.cs deleted file mode 100644 index 707728eb..00000000 --- a/Oqtane.Client/Services/Interfaces/IModuleDefinitionService.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - - /// - /// Service to manage a - /// - public interface IModuleDefinitionService - { - /// - /// Returns a list of module definitions for the given site - /// - /// - /// - Task> GetModuleDefinitionsAsync(int siteId); - - /// - /// Returns a specific module definition - /// - /// - /// - /// - Task GetModuleDefinitionAsync(int moduleDefinitionId, int siteId); - - /// - /// Updates a existing module definition - /// - /// - /// - Task UpdateModuleDefinitionAsync(ModuleDefinition moduleDefinition); - - /// - /// Deletes a module definition - /// - /// - /// - /// - Task DeleteModuleDefinitionAsync(int moduleDefinitionId, int siteId); - - /// - /// Creates a new module definition - /// - /// - /// - Task CreateModuleDefinitionAsync(ModuleDefinition moduleDefinition); - - /// - /// Returns a list of module definition templates - /// - /// - Task> GetModuleDefinitionTemplatesAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IModuleService.cs b/Oqtane.Client/Services/Interfaces/IModuleService.cs deleted file mode 100644 index ea6beab3..00000000 --- a/Oqtane.Client/Services/Interfaces/IModuleService.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve and store modules () - /// - public interface IModuleService - { - /// - /// Returns a list of modules for the given site - /// - /// - /// - Task> GetModulesAsync(int siteId); - - /// - /// Returns a specific module - /// - /// - /// - Task GetModuleAsync(int moduleId); - - /// - /// Adds a new module - /// - /// - /// - Task AddModuleAsync(Module module); - - /// - /// Updates an existing module - /// - /// - /// - Task UpdateModuleAsync(Module module); - - /// - /// Deletes a module - /// - /// - /// - Task DeleteModuleAsync(int moduleId); - - /// - /// Imports a module - /// - /// - /// module in JSON format - /// - Task ImportModuleAsync(int moduleId, int pageId, string content); - - /// - /// Exports a given module - /// - /// - /// - /// module content in JSON format - Task ExportModuleAsync(int moduleId, int pageId); - - /// - /// Exports a given module - /// - /// - /// - /// - /// - /// file id - Task ExportModuleAsync(int moduleId, int pageId, int folderId, string filename); - } -} diff --git a/Oqtane.Client/Services/Interfaces/INotificationService.cs b/Oqtane.Client/Services/Interfaces/INotificationService.cs deleted file mode 100644 index 760f4a36..00000000 --- a/Oqtane.Client/Services/Interfaces/INotificationService.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to store and retrieve notifications () - /// - public interface INotificationService - { - /// - /// Return a list of notifications - /// - /// - /// - /// - /// - Task> GetNotificationsAsync(int siteId, string direction, int userId); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - Task> GetNotificationsAsync(int siteId, string direction, int userId, int count, bool isRead); - - /// - /// - /// - /// - /// - /// - /// - /// - Task GetNotificationCountAsync(int siteId, string direction, int userId, bool isRead); - - /// - /// Returns a specific notifications - /// - /// - /// - Task GetNotificationAsync(int notificationId); - - /// - /// Creates a new notification - /// - /// - /// - Task AddNotificationAsync(Notification notification); - - /// - /// Updates a existing notification - /// - /// - /// - Task UpdateNotificationAsync(Notification notification); - - /// - /// Deletes a notification - /// - /// - /// - Task DeleteNotificationAsync(int notificationId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IOutputCacheService.cs b/Oqtane.Client/Services/Interfaces/IOutputCacheService.cs deleted file mode 100644 index 08826146..00000000 --- a/Oqtane.Client/Services/Interfaces/IOutputCacheService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage cache - /// - public interface IOutputCacheService - { - /// - /// Evicts the output cache for a specific tag - /// - /// - /// - Task EvictByTag(string tag); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IPackageService.cs b/Oqtane.Client/Services/Interfaces/IPackageService.cs deleted file mode 100644 index ff930ccc..00000000 --- a/Oqtane.Client/Services/Interfaces/IPackageService.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - - /// - /// Service to manage packages () - /// - public interface IPackageService - { - /// - /// Returns a list of packages matching the given parameters - /// - /// - /// - Task> GetPackagesAsync(string type); - - /// - /// Returns a list of packages matching the given parameters - /// - /// - /// - /// - /// - /// - Task> GetPackagesAsync(string type, string search, string price, string package); - - /// - /// Returns a list of packages matching the given parameters - /// - /// - /// - /// - /// - /// - /// - Task> GetPackagesAsync(string type, string search, string price, string package, string sort); - - /// - /// Returns a list of packages based on installationid - /// - /// - Task> GetPackageUpdatesAsync(string type); - - /// - /// Returns a specific package - /// - /// - /// - /// - Task GetPackageAsync(string packageId, string version, bool download); - - /// - /// Downloads a specific package as .nupkg file - /// - /// - /// - /// - /// - Task DownloadPackageAsync(string packageId, string version); - - /// - /// Installs all packages located in //TODO: 2dm where? - /// - /// - Task InstallPackagesAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IPageModuleService.cs b/Oqtane.Client/Services/Interfaces/IPageModuleService.cs deleted file mode 100644 index 77bc5d3b..00000000 --- a/Oqtane.Client/Services/Interfaces/IPageModuleService.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Oqtane.Models; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to store and retrieve a - /// - public interface IPageModuleService - { - - /// - /// Returns a specific page module - /// - /// - /// - Task GetPageModuleAsync(int pageModuleId); - - /// - /// Return a specific page module - /// - /// - /// - /// - Task GetPageModuleAsync(int pageId, int moduleId); - - /// - /// Creates a new page module - /// - /// - /// - Task AddPageModuleAsync(PageModule pageModule); - - /// - /// Updates a existing page module - /// - /// - /// - Task UpdatePageModuleAsync(PageModule pageModule); - - /// - /// Updates order of all page modules in the given pane - /// - /// - /// - /// - Task UpdatePageModuleOrderAsync(int pageId, string pane); - - /// - /// Deletes a page module - /// - /// - /// - Task DeletePageModuleAsync(int pageModuleId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IPageService.cs b/Oqtane.Client/Services/Interfaces/IPageService.cs deleted file mode 100644 index d4002c3f..00000000 --- a/Oqtane.Client/Services/Interfaces/IPageService.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Services to store and retrieve a - /// - public interface IPageService - { - /// - /// Returns a list of pages - /// - /// - /// - Task> GetPagesAsync(int siteId); - - /// - /// Returns a specific page - /// - /// - /// - Task GetPageAsync(int pageId); - - /// - /// Returns a specific page by its defined path - /// - /// - /// - /// - Task GetPageAsync(string path, int siteId); - - /// - /// Adds a new page - /// - /// - /// - Task AddPageAsync(Page page); - - /// - /// Adds a new page - /// - /// - /// - Task AddPageAsync(int pageId, int userId); - - /// - /// Updates a existing page - /// - /// - /// - Task UpdatePageAsync(Page page); - - /// - /// Updates order of all page modules in the given parent - /// - /// - /// - /// - /// - Task UpdatePageOrderAsync(int siteId, int pageId, int? parentId); - - /// - /// Deletes a page - /// - /// - /// - Task DeletePageAsync(int pageId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IProfileService.cs b/Oqtane.Client/Services/Interfaces/IProfileService.cs deleted file mode 100644 index 72c2506c..00000000 --- a/Oqtane.Client/Services/Interfaces/IProfileService.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to store and retrieve entries - /// - public interface IProfileService - { - - /// - /// Returns a list of profile entries - /// - /// - /// - Task> GetProfilesAsync(int siteId); - - /// - /// Returns a specific profile entry - /// - /// - /// - Task GetProfileAsync(int profileId); - - /// - /// Creates a new profile entry - /// - /// - /// - Task AddProfileAsync(Profile profile); - - /// - /// Updates an existing profile entry - /// - /// - /// - Task UpdateProfileAsync(Profile profile); - - /// - /// Deletes a profile entry - /// - /// - /// - Task DeleteProfileAsync(int profileId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IRoleService.cs b/Oqtane.Client/Services/Interfaces/IRoleService.cs deleted file mode 100644 index 65d91023..00000000 --- a/Oqtane.Client/Services/Interfaces/IRoleService.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage s on a - /// - public interface IRoleService - { - /// - /// Get all s of this . - /// - /// Will exclude global roles which are for all sites. To get those as well, use the overload - /// - /// ID-reference of a - /// - Task> GetRolesAsync(int siteId); - - /// - /// Get roles of the and optionally include global Roles. - /// - /// ID-reference to a - /// True if it should also include global roles. False will return the same data as just calling - /// - Task> GetRolesAsync(int siteId, bool includeGlobalRoles); - - /// - /// Get one specific - /// - /// ID-reference of a - /// - Task GetRoleAsync(int roleId); - - /// - /// Add / save a new to the database. - /// - /// - /// - Task AddRoleAsync(Role role); - - /// - /// Update a in the database. - /// - /// - /// - Task UpdateRoleAsync(Role role); - - /// - /// Delete / mark-as-deleted a in the database. - /// - /// ID-reference of a - /// - Task DeleteRoleAsync(int roleId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISearchResultsService.cs b/Oqtane.Client/Services/Interfaces/ISearchResultsService.cs deleted file mode 100644 index 49eb02ec..00000000 --- a/Oqtane.Client/Services/Interfaces/ISearchResultsService.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Oqtane.Documentation; -using Oqtane.Models; - -namespace Oqtane.Services -{ - [PrivateApi("Mark SearchResults classes as private, since it's not very useful in the public docs")] - public interface ISearchResultsService - { - Task GetSearchResultsAsync(SearchQuery searchQuery); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISettingService.cs b/Oqtane.Client/Services/Interfaces/ISettingService.cs deleted file mode 100644 index 2f4c4b94..00000000 --- a/Oqtane.Client/Services/Interfaces/ISettingService.cs +++ /dev/null @@ -1,269 +0,0 @@ -using Oqtane.Models; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage s - /// - public interface ISettingService - { - /// - /// Returns a key-value dictionary of all tenant settings - /// - /// - Task> GetTenantSettingsAsync(); - - /// - /// Updates a tenant setting - /// - /// - /// - Task UpdateTenantSettingsAsync(Dictionary tenantSettings); - - /// - /// Returns a key-value dictionary of all site settings for the given site - /// - /// - /// - Task> GetSiteSettingsAsync(int siteId); - - /// - /// Updates a site setting - /// - /// - /// - /// - Task UpdateSiteSettingsAsync(Dictionary siteSettings, int siteId); - - /// - /// Clears site option cache - /// - /// - Task ClearSiteSettingsCacheAsync(); - - /// - /// Returns a key-value dictionary of all page settings for the given page - /// - /// - /// - Task> GetPageSettingsAsync(int pageId); - - /// - /// Updates a page setting - /// - /// - /// - /// - Task UpdatePageSettingsAsync(Dictionary pageSettings, int pageId); - - /// - /// Returns a key-value dictionary of all page module settings for the given page module - /// - /// - /// - Task> GetPageModuleSettingsAsync(int pageModuleId); - - /// - /// Updates a page module setting - /// - /// - /// - /// - Task UpdatePageModuleSettingsAsync(Dictionary pageModuleSettings, int pageModuleId); - - /// - /// Returns a key-value dictionary of all module settings for the given module - /// - /// - /// - Task> GetModuleSettingsAsync(int moduleId); - - /// - /// Updates a module setting - /// - /// - /// - /// - Task UpdateModuleSettingsAsync(Dictionary moduleSettings, int moduleId); - - /// - /// Returns a key-value dictionary of all module settings for the given module - /// - /// - /// - Task> GetModuleDefinitionSettingsAsync(int moduleDefinitionId); - - /// - /// Updates a module setting - /// - /// - /// - /// - Task UpdateModuleDefinitionSettingsAsync(Dictionary moduleDefinitionSettings, int moduleDefinitionId); - - /// - /// Returns a key-value dictionary of all user settings for the given user - /// - /// - /// - Task> GetUserSettingsAsync(int userId); - - /// - /// Updates a user setting - /// - /// - /// - /// - Task UpdateUserSettingsAsync(Dictionary userSettings, int userId); - - /// - /// Returns a key-value dictionary of all folder settings for the given folder - /// - /// - /// - Task> GetFolderSettingsAsync(int folderId); - - - /// - /// Updates a folder setting - /// - /// - /// - /// - Task UpdateFolderSettingsAsync(Dictionary folderSettings, int folderId); - - /// - /// Returns a key-value dictionary of all tenant settings - /// - /// - Task> GetHostSettingsAsync(); - - /// - /// Updates a host setting - /// - /// - /// - Task UpdateHostSettingsAsync(Dictionary hostSettings); - - /// - /// Returns a key-value dictionary of all settings for the given visitor - /// - /// - /// - Task> GetVisitorSettingsAsync(int visitorId); - - /// - /// Updates a visitor setting - /// - /// - /// - /// - Task UpdateVisitorSettingsAsync(Dictionary visitorSettings, int visitorId); - - /// - /// Returns a key-value dictionary of all settings for the given entityName - /// - /// - /// - Task> GetSettingsAsync(string entityName, int entityId); - - /// - /// Updates settings for a given entityName and Id - /// - /// - /// - /// - /// - Task UpdateSettingsAsync(Dictionary settings, string entityName, int entityId); - - /// - /// Updates setting for a given entityName and Id - /// - /// - /// - /// - /// - /// - /// - Task AddOrUpdateSettingAsync(string entityName, int entityId, string settingName, string settingValue, bool isPrivate); - - /// - /// Returns a specific setting - /// - /// - /// - /// - /// - Task DeleteSettingAsync(string entityName, int entityId, string settingName); - - /// - /// Returns a specific setting - /// - /// - /// - /// - /// - Task> GetSettingsAsync(string entityName, int entityId, string settingName); - - /// - /// Returns a specific setting - /// - /// - /// - Task GetSettingAsync(string entityName, int settingId); - - /// - /// Creates a new setting - /// - /// - /// - Task AddSettingAsync(Setting setting); - - /// - /// Updates a existing setting - /// - /// - /// - Task UpdateSettingAsync(Setting setting); - - /// - /// Deletes a setting - /// - /// - /// - Task DeleteSettingAsync(string entityName, int settingId); - - /// - /// Gets the value of the given settingName (key) from the given key-value dictionary - /// - /// - /// - /// - /// - string GetSetting(Dictionary settings, string settingName, string defaultValue); - - /// - /// Sets the value of the given settingName (key) in the given key-value dictionary - /// - /// - /// - /// - /// - Dictionary SetSetting(Dictionary settings, string settingName, string settingValue); - - Dictionary SetSetting(Dictionary settings, string settingName, string settingValue, bool isPrivate); - - Dictionary MergeSettings(Dictionary baseSettings, Dictionary overwriteSettings); - - - [Obsolete("GetSettingAsync(int settingId) is deprecated. Use GetSettingAsync(string entityName, int settingId) instead.", false)] - Task GetSettingAsync(int settingId); - - [Obsolete("DeleteSettingAsync(int settingId) is deprecated. Use DeleteSettingAsync(string entityName, int settingId) instead.", false)] - Task DeleteSettingAsync(int settingId); - - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISiteService.cs b/Oqtane.Client/Services/Interfaces/ISiteService.cs deleted file mode 100644 index 8095a743..00000000 --- a/Oqtane.Client/Services/Interfaces/ISiteService.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Oqtane.Documentation; -using Oqtane.Models; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to store and retrieve entries - /// - public interface ISiteService - { - - /// - /// Returns a list of sites - /// - /// - Task> GetSitesAsync(); - - /// - /// Returns a specific site - /// - /// - /// - Task GetSiteAsync(int siteId); - - /// - /// Creates a new site - /// - /// - /// - Task AddSiteAsync(Site site); - - /// - /// Updates an existing site - /// - /// - /// - Task UpdateSiteAsync(Site site); - - /// - /// Deletes a site - /// - /// - /// - Task DeleteSiteAsync(int siteId); - - /// - /// Returns a list of modules - /// - /// - /// - /// - Task> GetModulesAsync(int siteId, int pageId); - - [PrivateApi] - [Obsolete("This method is deprecated.", false)] - void SetAlias(Alias alias); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISiteTemplateService.cs b/Oqtane.Client/Services/Interfaces/ISiteTemplateService.cs deleted file mode 100644 index 48444277..00000000 --- a/Oqtane.Client/Services/Interfaces/ISiteTemplateService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve entries - /// - public interface ISiteTemplateService - { - /// - /// Returns a list of site templates - /// - /// - Task> GetSiteTemplatesAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISqlService.cs b/Oqtane.Client/Services/Interfaces/ISqlService.cs deleted file mode 100644 index a6b0ad86..00000000 --- a/Oqtane.Client/Services/Interfaces/ISqlService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Oqtane.Models; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to execute a against the backend database - /// - public interface ISqlService - { - /// - /// Executes a sql query and returns its result - /// - /// - /// - Task ExecuteQueryAsync(SqlQuery sqlquery); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISyncService.cs b/Oqtane.Client/Services/Interfaces/ISyncService.cs deleted file mode 100644 index 12af4f2e..00000000 --- a/Oqtane.Client/Services/Interfaces/ISyncService.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Oqtane.Models; -using System; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve information. - /// - public interface ISyncService - { - /// - /// Get sync events - /// - /// - /// - Task GetSyncEventsAsync(DateTime lastSyncDate); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISystemService.cs b/Oqtane.Client/Services/Interfaces/ISystemService.cs deleted file mode 100644 index 3f4e194d..00000000 --- a/Oqtane.Client/Services/Interfaces/ISystemService.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve and update system information. - /// - public interface ISystemService - { - /// - /// returns a key-value dictionary with the current system configuration information - /// - /// - Task> GetSystemInfoAsync(); - - /// - /// returns a key-value dictionary with the current system information - "environment" or "configuration" - /// - /// - Task> GetSystemInfoAsync(string type); - - /// - /// returns a config value - /// - /// - Task GetSystemInfoAsync(string settingKey, object defaultValue); - - /// - /// Updates system information - /// - /// - /// - Task UpdateSystemInfoAsync(Dictionary settings); - - /// - /// returns a key-value dictionary with default system icons - /// - /// - Task> GetIconsAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ITenantService.cs b/Oqtane.Client/Services/Interfaces/ITenantService.cs deleted file mode 100644 index cbb4e526..00000000 --- a/Oqtane.Client/Services/Interfaces/ITenantService.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage s on the Oqtane installation. - /// - public interface ITenantService - { - /// - /// Get all s - /// - /// - Task> GetTenantsAsync(); - - /// - /// Get one specific - /// - /// ID-reference of the - /// - Task GetTenantAsync(int tenantId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IThemeService.cs b/Oqtane.Client/Services/Interfaces/IThemeService.cs deleted file mode 100644 index 62617c55..00000000 --- a/Oqtane.Client/Services/Interfaces/IThemeService.cs +++ /dev/null @@ -1,94 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage entries - /// - public interface IThemeService - { - - /// - /// Returns a list of available themes - /// - /// - Task> GetThemesAsync(); - - /// - /// Returns a specific theme - /// - /// - /// - /// - Task GetThemeAsync(int themeId, int siteId); - - /// - /// Returns a theme s containing a specific theme control type - /// - /// - /// - /// - Theme GetTheme(List themes, string themeControlType); - - /// - /// Returns a list of s from the given themes - /// - /// - /// - List GetThemeControls(List themes); - - /// - /// Returns a list of s for a theme containing a specific theme control type - /// - /// - /// - /// - List GetThemeControls(List themes, string themeControlType); - - /// - /// Returns a list of containers () for a theme containing a specific theme control type - /// - /// - /// - /// - List GetContainerControls(List themes, string themeControlType); - - /// - /// Updates a existing theme - /// - /// - /// - Task UpdateThemeAsync(Theme theme); - - /// - /// Deletes a theme - /// - /// - /// - Task DeleteThemeAsync(string themeName); - - /// - /// Creates a new theme - /// - /// - /// - Task CreateThemeAsync(Theme theme); - - /// - /// Returns a list of theme templates () - /// - /// - Task> GetThemeTemplatesAsync(); - - - /// - /// Returns a list of layouts () from the given themes with a matching theme name - /// - /// - /// - /// - List GetLayoutControls(List themes, string themeName); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ITimeZoneService.cs b/Oqtane.Client/Services/Interfaces/ITimeZoneService.cs deleted file mode 100644 index de134838..00000000 --- a/Oqtane.Client/Services/Interfaces/ITimeZoneService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve entries - /// - public interface ITimeZoneService - { - /// - /// Get the list of time zones - /// - /// - List GetTimeZones(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IUrlMappingService.cs b/Oqtane.Client/Services/Interfaces/IUrlMappingService.cs deleted file mode 100644 index 6da0bf9d..00000000 --- a/Oqtane.Client/Services/Interfaces/IUrlMappingService.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage s on a - /// - public interface IUrlMappingService - { - /// - /// Get all s of this . - /// - /// - /// ID-reference of a - /// - Task> GetUrlMappingsAsync(int siteId, bool isMapped); - - /// - /// Get one specific - /// - /// ID-reference of a - /// - Task GetUrlMappingAsync(int urlMappingId); - - /// - /// Get one specific - /// - /// ID-reference of a - /// A url - /// - Task GetUrlMappingAsync(int siteId, string url); - - /// - /// Add / save a new to the database. - /// - /// - /// - Task AddUrlMappingAsync(UrlMapping urlMapping); - - /// - /// Update a in the database. - /// - /// - /// - Task UpdateUrlMappingAsync(UrlMapping urlMapping); - - /// - /// Delete a in the database. - /// - /// ID-reference of a - /// - Task DeleteUrlMappingAsync(int urlMappingId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IUserRoleService.cs b/Oqtane.Client/Services/Interfaces/IUserRoleService.cs deleted file mode 100644 index 802a0d0e..00000000 --- a/Oqtane.Client/Services/Interfaces/IUserRoleService.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Manage s assigned to a specific - /// - public interface IUserRoleService - { - /// - /// Get all s on a - /// - /// ID-reference to a - /// - Task> GetUserRolesAsync(int siteId); - - /// - /// Get all s on a - /// - /// ID-reference to a - /// ID-reference to a - /// - Task> GetUserRolesAsync(int siteId, int userId); - - /// - /// Get all s on a - /// - /// ID-reference to a - /// Name reference a - /// - Task> GetUserRolesAsync(int siteId, string roleName); - - /// - /// Get all s on a - /// - /// ID-reference to a - /// ID-reference to a - /// Name reference a - /// - Task> GetUserRolesAsync(int siteId, int userId, string roleName); - - /// - /// Get one specific - /// - /// ID-reference to a - /// - Task GetUserRoleAsync(int userRoleId); - - /// - /// Save a new - /// - /// - /// - Task AddUserRoleAsync(UserRole userRole); - - /// - /// Update a in the database - /// - /// - /// - Task UpdateUserRoleAsync(UserRole userRole); - - /// - /// Delete a in the database - /// - /// - /// - Task DeleteUserRoleAsync(int userRoleId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IUserService.cs b/Oqtane.Client/Services/Interfaces/IUserService.cs deleted file mode 100644 index b32a66f0..00000000 --- a/Oqtane.Client/Services/Interfaces/IUserService.cs +++ /dev/null @@ -1,171 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Manage (get / update) user information - /// - public interface IUserService - { - /// - /// Get a of a specific site - /// - /// ID of a - /// ID of a - /// - Task GetUserAsync(int userId, int siteId); - - /// - /// Get a of a specific site - /// - /// Username / login of a - /// ID of a - /// - Task GetUserAsync(string username, int siteId); - - /// - /// Get a of a specific site - /// - /// Username / login of a - /// email address of a - /// ID of a - /// - Task GetUserAsync(string username, string email, int siteId); - - /// - /// Save a user to the Database. - /// The object contains all the information incl. what it belongs to. - /// - /// - /// - Task AddUserAsync(User user); - - /// - /// Update an existing user in the database. - /// - /// - /// - Task UpdateUserAsync(User user); - - /// - /// Delete / remove a user in the database - /// - /// ID-reference to the - /// ID-reference to the - /// - Task DeleteUserAsync(int userId, int siteId); - - /// - /// Will login the specified . - /// - /// Note that this will probably not be a real User, but a user object where the `Username` and `Password` have been filled. - /// - /// A object which should have at least the and set. - /// Determines if the login cookie should be set (only relevant for Hybrid scenarios) - /// Determines if the login cookie should be persisted for a long time. - /// - Task LoginUserAsync(User user, bool setCookie, bool isPersistent); - - /// - /// Logout a - /// - /// - /// - Task LogoutUserAsync(User user); - - /// - /// Logout a - /// - /// - /// - Task LogoutUserEverywhereAsync(User user); - - /// - /// Update e-mail verification status of a user. - /// - /// The we're verifying - /// A Hash value in the URL which verifies this user got the e-mail (containing this token) - /// - Task VerifyEmailAsync(User user, string token); - - /// - /// Trigger a forgot-password e-mail for this . - /// - /// - /// - Task ForgotPasswordAsync(User user); - - /// - /// Reset the password of this - /// - /// - /// - /// - Task ResetPasswordAsync(User user, string token); - - /// - /// Verify the two factor verification code - /// - /// - /// - /// - Task VerifyTwoFactorAsync(User user, string token); - - /// - /// Validate identity user info. - /// - /// - /// - /// - /// - Task ValidateUserAsync(string username, string email, string password); - - /// - /// Validate a users password against the password policy - /// - /// - /// - Task ValidatePasswordAsync(string password); - - /// - /// Get token for current user - /// - /// - Task GetTokenAsync(); - - /// - /// Get personal access token for current user (administrators only) - /// - /// - Task GetPersonalAccessTokenAsync(); - - /// - /// Link an external login with a local user account - /// - /// The we're verifying - /// A Hash value in the URL which verifies this user got the e-mail (containing this token) - /// External Login provider type - /// External Login provider key - /// External Login provider display name - /// - Task LinkUserAsync(User user, string token, string type, string key, string name); - - /// - /// Get password requirements for site - /// - /// ID of a - /// - Task GetPasswordRequirementsAsync(int siteId); - - /// - /// Bulk import of users - /// - /// ID of a - /// ID of a - /// Indicates if new users should be notified by email - /// - Task> ImportUsersAsync(int siteId, int fileId, bool notify); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IVisitorService.cs b/Oqtane.Client/Services/Interfaces/IVisitorService.cs deleted file mode 100644 index 3f067144..00000000 --- a/Oqtane.Client/Services/Interfaces/IVisitorService.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Oqtane.Models; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage s on a - /// - public interface IVisitorService - { - /// - /// Get all s of this . - /// - /// - /// ID-reference of a - /// - Task> GetVisitorsAsync(int siteId, DateTime fromDate); - - /// - /// Get a specific of this . - /// - /// - /// ID-reference of a - /// - Task GetVisitorAsync(int visitorId); - } -} diff --git a/Oqtane.Client/Services/JobLogService.cs b/Oqtane.Client/Services/JobLogService.cs index 0d1d3359..b0392059 100644 --- a/Oqtane.Client/Services/JobLogService.cs +++ b/Oqtane.Client/Services/JobLogService.cs @@ -1,13 +1,32 @@ using Oqtane.Models; using System.Threading.Tasks; using System.Net.Http; -using System.Linq; using System.Collections.Generic; using Oqtane.Documentation; using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to read the job schedule log + /// + public interface IJobLogService + { + /// + /// Return a list of entries + /// + /// + /// + Task> GetJobLogsAsync(int jobId); + + /// + /// Return a entry for the given Id + /// + /// + /// + Task GetJobLogAsync(int jobLogId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class JobLogService : ServiceBase, IJobLogService { diff --git a/Oqtane.Client/Services/JobService.cs b/Oqtane.Client/Services/JobService.cs index edb43485..420e5bd8 100644 --- a/Oqtane.Client/Services/JobService.cs +++ b/Oqtane.Client/Services/JobService.cs @@ -8,6 +8,60 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage jobs () + /// + public interface IJobService + { + /// + /// Returns a list of all jobs + /// + /// + Task> GetJobsAsync(); + + /// + /// Return a specific job + /// + /// + /// + Task GetJobAsync(int jobId); + + /// + /// Adds a new job + /// + /// + /// + Task AddJobAsync(Job job); + + /// + /// Updates an existing job + /// + /// + /// + Task UpdateJobAsync(Job job); + + /// + /// Delete an existing job + /// + /// + /// + Task DeleteJobAsync(int jobId); + + /// + /// Starts the given job + /// + /// + /// + Task StartJobAsync(int jobId); + + /// + /// Stops the given job + /// + /// + /// + Task StopJobAsync(int jobId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class JobService : ServiceBase, IJobService { diff --git a/Oqtane.Client/Services/LanguageService.cs b/Oqtane.Client/Services/LanguageService.cs index 7e95e952..c42f0863 100644 --- a/Oqtane.Client/Services/LanguageService.cs +++ b/Oqtane.Client/Services/LanguageService.cs @@ -7,6 +7,55 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage entries + /// + public interface ILanguageService + { + /// + /// Returns a list of all available languages for the given + /// + /// + /// + Task> GetLanguagesAsync(int siteId); + + /// + /// Returns a list of all available languages for the given and package + /// + /// + /// + /// + Task> GetLanguagesAsync(int siteId, string packageName); + + /// + /// Returns the given language + /// + /// + /// + Task GetLanguageAsync(int languageId); + + /// + /// Adds the given language + /// + /// + /// + Task AddLanguageAsync(Language language); + + /// + /// Edits the given language + /// + /// + /// + Task EditLanguageAsync(Language language); + + /// + /// Deletes the given language + /// + /// + /// + Task DeleteLanguageAsync(int languageId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class LanguageService : ServiceBase, ILanguageService { diff --git a/Oqtane.Client/Services/LocalizationCookieService.cs b/Oqtane.Client/Services/LocalizationCookieService.cs index 330607e6..6ebbdc76 100644 --- a/Oqtane.Client/Services/LocalizationCookieService.cs +++ b/Oqtane.Client/Services/LocalizationCookieService.cs @@ -5,6 +5,19 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to set localization cookie + /// + public interface ILocalizationCookieService + { + /// + /// Set the localization cookie + /// + /// + /// + Task SetLocalizationCookieAsync(string culture); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class LocalizationCookieService : ServiceBase, ILocalizationCookieService { diff --git a/Oqtane.Client/Services/LocalizationService.cs b/Oqtane.Client/Services/LocalizationService.cs index 880624b7..ee537d60 100644 --- a/Oqtane.Client/Services/LocalizationService.cs +++ b/Oqtane.Client/Services/LocalizationService.cs @@ -7,6 +7,18 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to retrieve localizations () + /// + public interface ILocalizationService + { + /// + /// Returns a collection of supported cultures + /// + /// + Task> GetCulturesAsync(bool installed); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class LocalizationService : ServiceBase, ILocalizationService { diff --git a/Oqtane.Client/Services/LogService.cs b/Oqtane.Client/Services/LogService.cs index 177b3682..938836c3 100644 --- a/Oqtane.Client/Services/LogService.cs +++ b/Oqtane.Client/Services/LogService.cs @@ -11,6 +11,69 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to retrieve and store entries + /// + public interface ILogService + { + /// + /// Returns a list of log entires for the given params + /// + /// + /// + /// + /// + /// + Task> GetLogsAsync(int siteId, string level, string function, int rows); + + /// + /// Returns a specific log entry for the given id + /// + /// + /// + Task GetLogAsync(int logId); + + /// + /// Clear the entire logs of the given site. + /// + /// + /// + Task DeleteLogsAsync(int siteId); + + /// + /// Creates a new log entry + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + Task Log(int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args); + + /// + /// Creates a new log entry + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + Task Log(Alias alias, int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class LogService : ServiceBase, ILogService { diff --git a/Oqtane.Client/Services/ModuleDefinitionService.cs b/Oqtane.Client/Services/ModuleDefinitionService.cs index 932bef8f..f29287e6 100644 --- a/Oqtane.Client/Services/ModuleDefinitionService.cs +++ b/Oqtane.Client/Services/ModuleDefinitionService.cs @@ -8,6 +8,55 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage a + /// + public interface IModuleDefinitionService + { + /// + /// Returns a list of module definitions for the given site + /// + /// + /// + Task> GetModuleDefinitionsAsync(int siteId); + + /// + /// Returns a specific module definition + /// + /// + /// + /// + Task GetModuleDefinitionAsync(int moduleDefinitionId, int siteId); + + /// + /// Updates a existing module definition + /// + /// + /// + Task UpdateModuleDefinitionAsync(ModuleDefinition moduleDefinition); + + /// + /// Deletes a module definition + /// + /// + /// + /// + Task DeleteModuleDefinitionAsync(int moduleDefinitionId, int siteId); + + /// + /// Creates a new module definition + /// + /// + /// + Task CreateModuleDefinitionAsync(ModuleDefinition moduleDefinition); + + /// + /// Returns a list of module definition templates + /// + /// + Task> GetModuleDefinitionTemplatesAsync(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class ModuleDefinitionService : ServiceBase, IModuleDefinitionService { diff --git a/Oqtane.Client/Services/ModuleService.cs b/Oqtane.Client/Services/ModuleService.cs index ac093bed..0654d065 100644 --- a/Oqtane.Client/Services/ModuleService.cs +++ b/Oqtane.Client/Services/ModuleService.cs @@ -9,6 +9,73 @@ using Oqtane.Modules.Controls; namespace Oqtane.Services { + /// + /// Service to retrieve and store modules () + /// + public interface IModuleService + { + /// + /// Returns a list of modules for the given site + /// + /// + /// + Task> GetModulesAsync(int siteId); + + /// + /// Returns a specific module + /// + /// + /// + Task GetModuleAsync(int moduleId); + + /// + /// Adds a new module + /// + /// + /// + Task AddModuleAsync(Module module); + + /// + /// Updates an existing module + /// + /// + /// + Task UpdateModuleAsync(Module module); + + /// + /// Deletes a module + /// + /// + /// + Task DeleteModuleAsync(int moduleId); + + /// + /// Imports a module + /// + /// + /// module in JSON format + /// + Task ImportModuleAsync(int moduleId, int pageId, string content); + + /// + /// Exports a given module + /// + /// + /// + /// module content in JSON format + Task ExportModuleAsync(int moduleId, int pageId); + + /// + /// Exports a given module + /// + /// + /// + /// + /// + /// file id + Task ExportModuleAsync(int moduleId, int pageId, int folderId, string filename); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class ModuleService : ServiceBase, IModuleService { diff --git a/Oqtane.Client/Services/NotificationService.cs b/Oqtane.Client/Services/NotificationService.cs index f6fd1585..86992e42 100644 --- a/Oqtane.Client/Services/NotificationService.cs +++ b/Oqtane.Client/Services/NotificationService.cs @@ -8,6 +8,70 @@ using Oqtane.Documentation; namespace Oqtane.Services { + /// + /// Service to store and retrieve notifications () + /// + public interface INotificationService + { + /// + /// Return a list of notifications + /// + /// + /// + /// + /// + Task> GetNotificationsAsync(int siteId, string direction, int userId); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + Task> GetNotificationsAsync(int siteId, string direction, int userId, int count, bool isRead); + + /// + /// + /// + /// + /// + /// + /// + /// + Task GetNotificationCountAsync(int siteId, string direction, int userId, bool isRead); + + /// + /// Returns a specific notifications + /// + /// + /// + Task GetNotificationAsync(int notificationId); + + /// + /// Creates a new notification + /// + /// + /// + Task AddNotificationAsync(Notification notification); + + /// + /// Updates a existing notification + /// + /// + /// + Task UpdateNotificationAsync(Notification notification); + + /// + /// Deletes a notification + /// + /// + /// + Task DeleteNotificationAsync(int notificationId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class NotificationService : ServiceBase, INotificationService { diff --git a/Oqtane.Client/Services/OutputCacheService.cs b/Oqtane.Client/Services/OutputCacheService.cs index 40b43752..6e441a8f 100644 --- a/Oqtane.Client/Services/OutputCacheService.cs +++ b/Oqtane.Client/Services/OutputCacheService.cs @@ -1,12 +1,23 @@ using System.Net.Http; -using System.Threading; using System.Threading.Tasks; - using Oqtane.Documentation; using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage cache + /// + public interface IOutputCacheService + { + /// + /// Evicts the output cache for a specific tag + /// + /// + /// + Task EvictByTag(string tag); + } + /// [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class OutputCacheService : ServiceBase, IOutputCacheService diff --git a/Oqtane.Client/Services/PackageService.cs b/Oqtane.Client/Services/PackageService.cs index 3e2ad61c..cc1b13a6 100644 --- a/Oqtane.Client/Services/PackageService.cs +++ b/Oqtane.Client/Services/PackageService.cs @@ -2,13 +2,75 @@ using Oqtane.Models; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; -using System.Linq; using Oqtane.Documentation; using Oqtane.Shared; using System.Net; namespace Oqtane.Services { + /// + /// Service to manage packages () + /// + public interface IPackageService + { + /// + /// Returns a list of packages matching the given parameters + /// + /// + /// + Task> GetPackagesAsync(string type); + + /// + /// Returns a list of packages matching the given parameters + /// + /// + /// + /// + /// + /// + Task> GetPackagesAsync(string type, string search, string price, string package); + + /// + /// Returns a list of packages matching the given parameters + /// + /// + /// + /// + /// + /// + /// + Task> GetPackagesAsync(string type, string search, string price, string package, string sort); + + /// + /// Returns a list of packages based on installationid + /// + /// + Task> GetPackageUpdatesAsync(string type); + + /// + /// Returns a specific package + /// + /// + /// + /// + Task GetPackageAsync(string packageId, string version, bool download); + + /// + /// Downloads a specific package as .nupkg file + /// + /// + /// + /// + /// + Task DownloadPackageAsync(string packageId, string version); + + /// + /// Installs all packages located in //TODO: 2dm where? + /// + /// + Task InstallPackagesAsync(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class PackageService : ServiceBase, IPackageService { diff --git a/Oqtane.Client/Services/PageModuleService.cs b/Oqtane.Client/Services/PageModuleService.cs index c9ebc19a..8daafc39 100644 --- a/Oqtane.Client/Services/PageModuleService.cs +++ b/Oqtane.Client/Services/PageModuleService.cs @@ -6,6 +6,57 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to store and retrieve a + /// + public interface IPageModuleService + { + + /// + /// Returns a specific page module + /// + /// + /// + Task GetPageModuleAsync(int pageModuleId); + + /// + /// Return a specific page module + /// + /// + /// + /// + Task GetPageModuleAsync(int pageId, int moduleId); + + /// + /// Creates a new page module + /// + /// + /// + Task AddPageModuleAsync(PageModule pageModule); + + /// + /// Updates a existing page module + /// + /// + /// + Task UpdatePageModuleAsync(PageModule pageModule); + + /// + /// Updates order of all page modules in the given pane + /// + /// + /// + /// + Task UpdatePageModuleOrderAsync(int pageId, string pane); + + /// + /// Deletes a page module + /// + /// + /// + Task DeletePageModuleAsync(int pageModuleId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class PageModuleService : ServiceBase, IPageModuleService { diff --git a/Oqtane.Client/Services/PageService.cs b/Oqtane.Client/Services/PageService.cs index 934b156e..e3f940c6 100644 --- a/Oqtane.Client/Services/PageService.cs +++ b/Oqtane.Client/Services/PageService.cs @@ -8,6 +8,71 @@ using Oqtane.Documentation; namespace Oqtane.Services { + /// + /// Services to store and retrieve a + /// + public interface IPageService + { + /// + /// Returns a list of pages + /// + /// + /// + Task> GetPagesAsync(int siteId); + + /// + /// Returns a specific page + /// + /// + /// + Task GetPageAsync(int pageId); + + /// + /// Returns a specific page by its defined path + /// + /// + /// + /// + Task GetPageAsync(string path, int siteId); + + /// + /// Adds a new page + /// + /// + /// + Task AddPageAsync(Page page); + + /// + /// Adds a new page + /// + /// + /// + Task AddPageAsync(int pageId, int userId); + + /// + /// Updates a existing page + /// + /// + /// + Task UpdatePageAsync(Page page); + + /// + /// Updates order of all page modules in the given parent + /// + /// + /// + /// + /// + Task UpdatePageOrderAsync(int siteId, int pageId, int? parentId); + + /// + /// Deletes a page + /// + /// + /// + Task DeletePageAsync(int pageId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class PageService : ServiceBase, IPageService { diff --git a/Oqtane.Client/Services/ProfileService.cs b/Oqtane.Client/Services/ProfileService.cs index 700fb764..bf2c7e54 100644 --- a/Oqtane.Client/Services/ProfileService.cs +++ b/Oqtane.Client/Services/ProfileService.cs @@ -8,6 +8,48 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to store and retrieve entries + /// + public interface IProfileService + { + + /// + /// Returns a list of profile entries + /// + /// + /// + Task> GetProfilesAsync(int siteId); + + /// + /// Returns a specific profile entry + /// + /// + /// + Task GetProfileAsync(int profileId); + + /// + /// Creates a new profile entry + /// + /// + /// + Task AddProfileAsync(Profile profile); + + /// + /// Updates an existing profile entry + /// + /// + /// + Task UpdateProfileAsync(Profile profile); + + /// + /// Deletes a profile entry + /// + /// + /// + Task DeleteProfileAsync(int profileId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class ProfileService : ServiceBase, IProfileService { diff --git a/Oqtane.Client/Services/RoleService.cs b/Oqtane.Client/Services/RoleService.cs index 6215c51d..bf0d1c72 100644 --- a/Oqtane.Client/Services/RoleService.cs +++ b/Oqtane.Client/Services/RoleService.cs @@ -8,6 +8,57 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage s on a + /// + public interface IRoleService + { + /// + /// Get all s of this . + /// + /// Will exclude global roles which are for all sites. To get those as well, use the overload + /// + /// ID-reference of a + /// + Task> GetRolesAsync(int siteId); + + /// + /// Get roles of the and optionally include global Roles. + /// + /// ID-reference to a + /// True if it should also include global roles. False will return the same data as just calling + /// + Task> GetRolesAsync(int siteId, bool includeGlobalRoles); + + /// + /// Get one specific + /// + /// ID-reference of a + /// + Task GetRoleAsync(int roleId); + + /// + /// Add / save a new to the database. + /// + /// + /// + Task AddRoleAsync(Role role); + + /// + /// Update a in the database. + /// + /// + /// + Task UpdateRoleAsync(Role role); + + /// + /// Delete / mark-as-deleted a in the database. + /// + /// ID-reference of a + /// + Task DeleteRoleAsync(int roleId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class RoleService : ServiceBase, IRoleService { diff --git a/Oqtane.Client/Services/SearchResultsService.cs b/Oqtane.Client/Services/SearchResultsService.cs index 6597dc33..6ec1732f 100644 --- a/Oqtane.Client/Services/SearchResultsService.cs +++ b/Oqtane.Client/Services/SearchResultsService.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; using Oqtane.Documentation; @@ -8,6 +7,12 @@ using Oqtane.Shared; namespace Oqtane.Services { + [PrivateApi("Mark SearchResults classes as private, since it's not very useful in the public docs")] + public interface ISearchResultsService + { + Task GetSearchResultsAsync(SearchQuery searchQuery); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SearchResultsService : ServiceBase, ISearchResultsService, IClientService { diff --git a/Oqtane.Client/Services/SettingService.cs b/Oqtane.Client/Services/SettingService.cs index a55eeeba..4203f9c0 100644 --- a/Oqtane.Client/Services/SettingService.cs +++ b/Oqtane.Client/Services/SettingService.cs @@ -9,6 +9,268 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage s + /// + public interface ISettingService + { + /// + /// Returns a key-value dictionary of all tenant settings + /// + /// + Task> GetTenantSettingsAsync(); + + /// + /// Updates a tenant setting + /// + /// + /// + Task UpdateTenantSettingsAsync(Dictionary tenantSettings); + + /// + /// Returns a key-value dictionary of all site settings for the given site + /// + /// + /// + Task> GetSiteSettingsAsync(int siteId); + + /// + /// Updates a site setting + /// + /// + /// + /// + Task UpdateSiteSettingsAsync(Dictionary siteSettings, int siteId); + + /// + /// Clears site option cache + /// + /// + Task ClearSiteSettingsCacheAsync(); + + /// + /// Returns a key-value dictionary of all page settings for the given page + /// + /// + /// + Task> GetPageSettingsAsync(int pageId); + + /// + /// Updates a page setting + /// + /// + /// + /// + Task UpdatePageSettingsAsync(Dictionary pageSettings, int pageId); + + /// + /// Returns a key-value dictionary of all page module settings for the given page module + /// + /// + /// + Task> GetPageModuleSettingsAsync(int pageModuleId); + + /// + /// Updates a page module setting + /// + /// + /// + /// + Task UpdatePageModuleSettingsAsync(Dictionary pageModuleSettings, int pageModuleId); + + /// + /// Returns a key-value dictionary of all module settings for the given module + /// + /// + /// + Task> GetModuleSettingsAsync(int moduleId); + + /// + /// Updates a module setting + /// + /// + /// + /// + Task UpdateModuleSettingsAsync(Dictionary moduleSettings, int moduleId); + + /// + /// Returns a key-value dictionary of all module settings for the given module + /// + /// + /// + Task> GetModuleDefinitionSettingsAsync(int moduleDefinitionId); + + /// + /// Updates a module setting + /// + /// + /// + /// + Task UpdateModuleDefinitionSettingsAsync(Dictionary moduleDefinitionSettings, int moduleDefinitionId); + + /// + /// Returns a key-value dictionary of all user settings for the given user + /// + /// + /// + Task> GetUserSettingsAsync(int userId); + + /// + /// Updates a user setting + /// + /// + /// + /// + Task UpdateUserSettingsAsync(Dictionary userSettings, int userId); + + /// + /// Returns a key-value dictionary of all folder settings for the given folder + /// + /// + /// + Task> GetFolderSettingsAsync(int folderId); + + + /// + /// Updates a folder setting + /// + /// + /// + /// + Task UpdateFolderSettingsAsync(Dictionary folderSettings, int folderId); + + /// + /// Returns a key-value dictionary of all tenant settings + /// + /// + Task> GetHostSettingsAsync(); + + /// + /// Updates a host setting + /// + /// + /// + Task UpdateHostSettingsAsync(Dictionary hostSettings); + + /// + /// Returns a key-value dictionary of all settings for the given visitor + /// + /// + /// + Task> GetVisitorSettingsAsync(int visitorId); + + /// + /// Updates a visitor setting + /// + /// + /// + /// + Task UpdateVisitorSettingsAsync(Dictionary visitorSettings, int visitorId); + + /// + /// Returns a key-value dictionary of all settings for the given entityName + /// + /// + /// + Task> GetSettingsAsync(string entityName, int entityId); + + /// + /// Updates settings for a given entityName and Id + /// + /// + /// + /// + /// + Task UpdateSettingsAsync(Dictionary settings, string entityName, int entityId); + + /// + /// Updates setting for a given entityName and Id + /// + /// + /// + /// + /// + /// + /// + Task AddOrUpdateSettingAsync(string entityName, int entityId, string settingName, string settingValue, bool isPrivate); + + /// + /// Returns a specific setting + /// + /// + /// + /// + /// + Task DeleteSettingAsync(string entityName, int entityId, string settingName); + + /// + /// Returns a specific setting + /// + /// + /// + /// + /// + Task> GetSettingsAsync(string entityName, int entityId, string settingName); + + /// + /// Returns a specific setting + /// + /// + /// + Task GetSettingAsync(string entityName, int settingId); + + /// + /// Creates a new setting + /// + /// + /// + Task AddSettingAsync(Setting setting); + + /// + /// Updates a existing setting + /// + /// + /// + Task UpdateSettingAsync(Setting setting); + + /// + /// Deletes a setting + /// + /// + /// + Task DeleteSettingAsync(string entityName, int settingId); + + /// + /// Gets the value of the given settingName (key) from the given key-value dictionary + /// + /// + /// + /// + /// + string GetSetting(Dictionary settings, string settingName, string defaultValue); + + /// + /// Sets the value of the given settingName (key) in the given key-value dictionary + /// + /// + /// + /// + /// + Dictionary SetSetting(Dictionary settings, string settingName, string settingValue); + + Dictionary SetSetting(Dictionary settings, string settingName, string settingValue, bool isPrivate); + + Dictionary MergeSettings(Dictionary baseSettings, Dictionary overwriteSettings); + + + [Obsolete("GetSettingAsync(int settingId) is deprecated. Use GetSettingAsync(string entityName, int settingId) instead.", false)] + Task GetSettingAsync(int settingId); + + [Obsolete("DeleteSettingAsync(int settingId) is deprecated. Use DeleteSettingAsync(string entityName, int settingId) instead.", false)] + Task DeleteSettingAsync(int settingId); + + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SettingService : ServiceBase, ISettingService { diff --git a/Oqtane.Client/Services/SiteService.cs b/Oqtane.Client/Services/SiteService.cs index 4f1658f4..0ab922c1 100644 --- a/Oqtane.Client/Services/SiteService.cs +++ b/Oqtane.Client/Services/SiteService.cs @@ -8,6 +8,59 @@ using Oqtane.Documentation; namespace Oqtane.Services { + /// + /// Service to store and retrieve entries + /// + public interface ISiteService + { + + /// + /// Returns a list of sites + /// + /// + Task> GetSitesAsync(); + + /// + /// Returns a specific site + /// + /// + /// + Task GetSiteAsync(int siteId); + + /// + /// Creates a new site + /// + /// + /// + Task AddSiteAsync(Site site); + + /// + /// Updates an existing site + /// + /// + /// + Task UpdateSiteAsync(Site site); + + /// + /// Deletes a site + /// + /// + /// + Task DeleteSiteAsync(int siteId); + + /// + /// Returns a list of modules + /// + /// + /// + /// + Task> GetModulesAsync(int siteId, int pageId); + + [PrivateApi] + [Obsolete("This method is deprecated.", false)] + void SetAlias(Alias alias); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SiteService : ServiceBase, ISiteService { diff --git a/Oqtane.Client/Services/SiteTemplateService.cs b/Oqtane.Client/Services/SiteTemplateService.cs index 1e6d5c3c..b7ced874 100644 --- a/Oqtane.Client/Services/SiteTemplateService.cs +++ b/Oqtane.Client/Services/SiteTemplateService.cs @@ -8,6 +8,18 @@ using Oqtane.Documentation; namespace Oqtane.Services { + /// + /// Service to retrieve entries + /// + public interface ISiteTemplateService + { + /// + /// Returns a list of site templates + /// + /// + Task> GetSiteTemplatesAsync(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SiteTemplateService : ServiceBase, ISiteTemplateService { diff --git a/Oqtane.Client/Services/SqlService.cs b/Oqtane.Client/Services/SqlService.cs index 403de7fd..de9ce24f 100644 --- a/Oqtane.Client/Services/SqlService.cs +++ b/Oqtane.Client/Services/SqlService.cs @@ -6,6 +6,19 @@ using Oqtane.Documentation; namespace Oqtane.Services { + /// + /// Service to execute a against the backend database + /// + public interface ISqlService + { + /// + /// Executes a sql query and returns its result + /// + /// + /// + Task ExecuteQueryAsync(SqlQuery sqlquery); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SqlService : ServiceBase, ISqlService { diff --git a/Oqtane.Client/Services/SyncService.cs b/Oqtane.Client/Services/SyncService.cs index 781aba91..216befb5 100644 --- a/Oqtane.Client/Services/SyncService.cs +++ b/Oqtane.Client/Services/SyncService.cs @@ -8,6 +8,19 @@ using System.Globalization; namespace Oqtane.Services { + /// + /// Service to retrieve information. + /// + public interface ISyncService + { + /// + /// Get sync events + /// + /// + /// + Task GetSyncEventsAsync(DateTime lastSyncDate); + } + /// [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SyncService : ServiceBase, ISyncService diff --git a/Oqtane.Client/Services/SystemService.cs b/Oqtane.Client/Services/SystemService.cs index d6ab8268..b1a79ae0 100644 --- a/Oqtane.Client/Services/SystemService.cs +++ b/Oqtane.Client/Services/SystemService.cs @@ -3,10 +3,46 @@ using System.Threading.Tasks; using System.Collections.Generic; using Oqtane.Documentation; using Oqtane.Shared; -using System.Net; namespace Oqtane.Services { + /// + /// Service to retrieve and update system information. + /// + public interface ISystemService + { + /// + /// returns a key-value dictionary with the current system configuration information + /// + /// + Task> GetSystemInfoAsync(); + + /// + /// returns a key-value dictionary with the current system information - "environment" or "configuration" + /// + /// + Task> GetSystemInfoAsync(string type); + + /// + /// returns a config value + /// + /// + Task GetSystemInfoAsync(string settingKey, object defaultValue); + + /// + /// Updates system information + /// + /// + /// + Task UpdateSystemInfoAsync(Dictionary settings); + + /// + /// returns a key-value dictionary with default system icons + /// + /// + Task> GetIconsAsync(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SystemService : ServiceBase, ISystemService { diff --git a/Oqtane.Client/Services/TenantService.cs b/Oqtane.Client/Services/TenantService.cs index b6343e7a..00afcd9e 100644 --- a/Oqtane.Client/Services/TenantService.cs +++ b/Oqtane.Client/Services/TenantService.cs @@ -8,6 +8,25 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage s on the Oqtane installation. + /// + public interface ITenantService + { + /// + /// Get all s + /// + /// + Task> GetTenantsAsync(); + + /// + /// Get one specific + /// + /// ID-reference of the + /// + Task GetTenantAsync(int tenantId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class TenantService : ServiceBase, ITenantService { diff --git a/Oqtane.Client/Services/ThemeService.cs b/Oqtane.Client/Services/ThemeService.cs index d1c03495..4fd1d9eb 100644 --- a/Oqtane.Client/Services/ThemeService.cs +++ b/Oqtane.Client/Services/ThemeService.cs @@ -5,10 +5,97 @@ using System.Threading.Tasks; using Oqtane.Documentation; using Oqtane.Models; using Oqtane.Shared; -using Oqtane.UI; namespace Oqtane.Services { + /// + /// Service to manage entries + /// + public interface IThemeService + { + + /// + /// Returns a list of available themes + /// + /// + Task> GetThemesAsync(); + + /// + /// Returns a specific theme + /// + /// + /// + /// + Task GetThemeAsync(int themeId, int siteId); + + /// + /// Returns a theme s containing a specific theme control type + /// + /// + /// + /// + Theme GetTheme(List themes, string themeControlType); + + /// + /// Returns a list of s from the given themes + /// + /// + /// + List GetThemeControls(List themes); + + /// + /// Returns a list of s for a theme containing a specific theme control type + /// + /// + /// + /// + List GetThemeControls(List themes, string themeControlType); + + /// + /// Returns a list of containers () for a theme containing a specific theme control type + /// + /// + /// + /// + List GetContainerControls(List themes, string themeControlType); + + /// + /// Updates a existing theme + /// + /// + /// + Task UpdateThemeAsync(Theme theme); + + /// + /// Deletes a theme + /// + /// + /// + Task DeleteThemeAsync(string themeName); + + /// + /// Creates a new theme + /// + /// + /// + Task CreateThemeAsync(Theme theme); + + /// + /// Returns a list of theme templates () + /// + /// + Task> GetThemeTemplatesAsync(); + + + /// + /// Returns a list of layouts () from the given themes with a matching theme name + /// + /// + /// + /// + List GetLayoutControls(List themes, string themeName); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class ThemeService : ServiceBase, IThemeService { diff --git a/Oqtane.Client/Services/TimeZoneService.cs b/Oqtane.Client/Services/TimeZoneService.cs index 4b921bad..c8896449 100644 --- a/Oqtane.Client/Services/TimeZoneService.cs +++ b/Oqtane.Client/Services/TimeZoneService.cs @@ -9,6 +9,18 @@ using NodaTime.Extensions; namespace Oqtane.Services { + /// + /// Service to retrieve entries + /// + public interface ITimeZoneService + { + /// + /// Get the list of time zones + /// + /// + List GetTimeZones(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class TimeZoneService : ITimeZoneService { diff --git a/Oqtane.Client/Services/UrlMappingService.cs b/Oqtane.Client/Services/UrlMappingService.cs index 55f381e3..305dd2da 100644 --- a/Oqtane.Client/Services/UrlMappingService.cs +++ b/Oqtane.Client/Services/UrlMappingService.cs @@ -9,6 +9,56 @@ using System.Net; namespace Oqtane.Services { + /// + /// Service to manage s on a + /// + public interface IUrlMappingService + { + /// + /// Get all s of this . + /// + /// + /// ID-reference of a + /// + Task> GetUrlMappingsAsync(int siteId, bool isMapped); + + /// + /// Get one specific + /// + /// ID-reference of a + /// + Task GetUrlMappingAsync(int urlMappingId); + + /// + /// Get one specific + /// + /// ID-reference of a + /// A url + /// + Task GetUrlMappingAsync(int siteId, string url); + + /// + /// Add / save a new to the database. + /// + /// + /// + Task AddUrlMappingAsync(UrlMapping urlMapping); + + /// + /// Update a in the database. + /// + /// + /// + Task UpdateUrlMappingAsync(UrlMapping urlMapping); + + /// + /// Delete a in the database. + /// + /// ID-reference of a + /// + Task DeleteUrlMappingAsync(int urlMappingId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class UrlMappingService : ServiceBase, IUrlMappingService { diff --git a/Oqtane.Client/Services/UserRoleService.cs b/Oqtane.Client/Services/UserRoleService.cs index ef596854..c143ca20 100644 --- a/Oqtane.Client/Services/UserRoleService.cs +++ b/Oqtane.Client/Services/UserRoleService.cs @@ -7,6 +7,72 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Manage s assigned to a specific + /// + public interface IUserRoleService + { + /// + /// Get all s on a + /// + /// ID-reference to a + /// + Task> GetUserRolesAsync(int siteId); + + /// + /// Get all s on a + /// + /// ID-reference to a + /// ID-reference to a + /// + Task> GetUserRolesAsync(int siteId, int userId); + + /// + /// Get all s on a + /// + /// ID-reference to a + /// Name reference a + /// + Task> GetUserRolesAsync(int siteId, string roleName); + + /// + /// Get all s on a + /// + /// ID-reference to a + /// ID-reference to a + /// Name reference a + /// + Task> GetUserRolesAsync(int siteId, int userId, string roleName); + + /// + /// Get one specific + /// + /// ID-reference to a + /// + Task GetUserRoleAsync(int userRoleId); + + /// + /// Save a new + /// + /// + /// + Task AddUserRoleAsync(UserRole userRole); + + /// + /// Update a in the database + /// + /// + /// + Task UpdateUserRoleAsync(UserRole userRole); + + /// + /// Delete a in the database + /// + /// + /// + Task DeleteUserRoleAsync(int userRoleId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class UserRoleService : ServiceBase, IUserRoleService { diff --git a/Oqtane.Client/Services/UserService.cs b/Oqtane.Client/Services/UserService.cs index d69aa10d..ca5203e4 100644 --- a/Oqtane.Client/Services/UserService.cs +++ b/Oqtane.Client/Services/UserService.cs @@ -6,12 +6,174 @@ using Oqtane.Documentation; using System.Net; using System.Collections.Generic; using Microsoft.Extensions.Localization; -using Microsoft.EntityFrameworkCore.Metadata.Internal; -using Oqtane.Modules.Admin.Roles; -using System.Xml.Linq; namespace Oqtane.Services { + /// + /// Manage (get / update) user information + /// + public interface IUserService + { + /// + /// Get a of a specific site + /// + /// ID of a + /// ID of a + /// + Task GetUserAsync(int userId, int siteId); + + /// + /// Get a of a specific site + /// + /// Username / login of a + /// ID of a + /// + Task GetUserAsync(string username, int siteId); + + /// + /// Get a of a specific site + /// + /// Username / login of a + /// email address of a + /// ID of a + /// + Task GetUserAsync(string username, string email, int siteId); + + /// + /// Save a user to the Database. + /// The object contains all the information incl. what it belongs to. + /// + /// + /// + Task AddUserAsync(User user); + + /// + /// Update an existing user in the database. + /// + /// + /// + Task UpdateUserAsync(User user); + + /// + /// Delete / remove a user in the database + /// + /// ID-reference to the + /// ID-reference to the + /// + Task DeleteUserAsync(int userId, int siteId); + + /// + /// Will login the specified . + /// + /// Note that this will probably not be a real User, but a user object where the `Username` and `Password` have been filled. + /// + /// A object which should have at least the and set. + /// Determines if the login cookie should be set (only relevant for Hybrid scenarios) + /// Determines if the login cookie should be persisted for a long time. + /// + Task LoginUserAsync(User user, bool setCookie, bool isPersistent); + + /// + /// Logout a + /// + /// + /// + Task LogoutUserAsync(User user); + + /// + /// Logout a + /// + /// + /// + Task LogoutUserEverywhereAsync(User user); + + /// + /// Update e-mail verification status of a user. + /// + /// The we're verifying + /// A Hash value in the URL which verifies this user got the e-mail (containing this token) + /// + Task VerifyEmailAsync(User user, string token); + + /// + /// Trigger a forgot-password e-mail for this . + /// + /// + /// + Task ForgotPasswordAsync(User user); + + /// + /// Reset the password of this + /// + /// + /// + /// + Task ResetPasswordAsync(User user, string token); + + /// + /// Verify the two factor verification code + /// + /// + /// + /// + Task VerifyTwoFactorAsync(User user, string token); + + /// + /// Validate identity user info. + /// + /// + /// + /// + /// + Task ValidateUserAsync(string username, string email, string password); + + /// + /// Validate a users password against the password policy + /// + /// + /// + Task ValidatePasswordAsync(string password); + + /// + /// Get token for current user + /// + /// + Task GetTokenAsync(); + + /// + /// Get personal access token for current user (administrators only) + /// + /// + Task GetPersonalAccessTokenAsync(); + + /// + /// Link an external login with a local user account + /// + /// The we're verifying + /// A Hash value in the URL which verifies this user got the e-mail (containing this token) + /// External Login provider type + /// External Login provider key + /// External Login provider display name + /// + Task LinkUserAsync(User user, string token, string type, string key, string name); + + /// + /// Get password requirements for site + /// + /// ID of a + /// + Task GetPasswordRequirementsAsync(int siteId); + + /// + /// Bulk import of users + /// + /// ID of a + /// ID of a + /// Indicates if new users should be notified by email + /// + Task> ImportUsersAsync(int siteId, int fileId, bool notify); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class UserService : ServiceBase, IUserService { diff --git a/Oqtane.Client/Services/VisitorService.cs b/Oqtane.Client/Services/VisitorService.cs index b29e9c3c..0b8bbd1b 100644 --- a/Oqtane.Client/Services/VisitorService.cs +++ b/Oqtane.Client/Services/VisitorService.cs @@ -10,6 +10,28 @@ using System.Globalization; namespace Oqtane.Services { + /// + /// Service to manage s on a + /// + public interface IVisitorService + { + /// + /// Get all s of this . + /// + /// + /// ID-reference of a + /// + Task> GetVisitorsAsync(int siteId, DateTime fromDate); + + /// + /// Get a specific of this . + /// + /// + /// ID-reference of a + /// + Task GetVisitorAsync(int visitorId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class VisitorService : ServiceBase, IVisitorService {