diff --git a/Agent/Services/ScriptExecutor.cs b/Agent/Services/ScriptExecutor.cs index 67b200dc..ee470e71 100644 --- a/Agent/Services/ScriptExecutor.cs +++ b/Agent/Services/ScriptExecutor.cs @@ -4,8 +4,8 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Remotely.Shared; using Remotely.Shared.Dtos; +using Remotely.Shared.Entities; using Remotely.Shared.Enums; -using Remotely.Shared.Models; using Remotely.Shared.Utilities; using System; using System.Net.Http; diff --git a/Desktop.Shared/Services/BrandingProvider.cs b/Desktop.Shared/Services/BrandingProvider.cs index e9fe69f5..48586940 100644 --- a/Desktop.Shared/Services/BrandingProvider.cs +++ b/Desktop.Shared/Services/BrandingProvider.cs @@ -4,8 +4,8 @@ using Immense.RemoteControl.Shared; using Immense.RemoteControl.Shared.Models; using Microsoft.Extensions.Logging; using Remotely.Shared; +using Remotely.Shared.Entities; using Remotely.Shared.Enums; -using Remotely.Shared.Models; using Remotely.Shared.Services; using Remotely.Shared.Utilities; using System; diff --git a/Server/API/BrandingController.cs b/Server/API/BrandingController.cs index d9c6c961..696bf035 100644 --- a/Server/API/BrandingController.cs +++ b/Server/API/BrandingController.cs @@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Build.Framework; using Microsoft.Extensions.Logging; using Remotely.Server.Services; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; using System; using System.Collections.Generic; using System.Linq; diff --git a/Server/API/DevicesController.cs b/Server/API/DevicesController.cs index b7037080..40fe8c0b 100644 --- a/Server/API/DevicesController.cs +++ b/Server/API/DevicesController.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.Logging; using Remotely.Server.Auth; using Remotely.Server.Extensions; using Remotely.Server.Services; +using Remotely.Shared.Entities; using Remotely.Shared.Models; using System; using System.Collections.Generic; diff --git a/Server/API/LoginController.cs b/Server/API/LoginController.cs index fa8f3cf2..3268bfc9 100644 --- a/Server/API/LoginController.cs +++ b/Server/API/LoginController.cs @@ -8,7 +8,7 @@ using Microsoft.Extensions.Logging; using Remotely.Server.Hubs; using Remotely.Server.Models; using Remotely.Server.Services; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; using System; using System.Linq; using System.Threading.Tasks; diff --git a/Server/API/OrganizationManagementController.cs b/Server/API/OrganizationManagementController.cs index 323f1f60..c8d58229 100644 --- a/Server/API/OrganizationManagementController.cs +++ b/Server/API/OrganizationManagementController.cs @@ -11,6 +11,7 @@ using Org.BouncyCastle.Crypto.Agreement; using Remotely.Server.Auth; using Remotely.Server.Extensions; using Remotely.Server.Services; +using Remotely.Shared.Entities; using Remotely.Shared.Models; using Remotely.Shared.ViewModels; using System; diff --git a/Server/API/RemoteControlController.cs b/Server/API/RemoteControlController.cs index aba579bd..a6ab6f99 100644 --- a/Server/API/RemoteControlController.cs +++ b/Server/API/RemoteControlController.cs @@ -4,7 +4,6 @@ using Microsoft.AspNetCore.SignalR; using Remotely.Server.Hubs; using Remotely.Server.Models; using Remotely.Server.Services; -using Remotely.Shared.Models; using System; using System.Linq; using System.Threading.Tasks; @@ -14,6 +13,7 @@ using Immense.RemoteControl.Server.Abstractions; using Immense.RemoteControl.Shared.Helpers; using Microsoft.Extensions.Logging; using Remotely.Server.Extensions; +using Remotely.Shared.Entities; // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 diff --git a/Server/API/SavedScriptsController.cs b/Server/API/SavedScriptsController.cs index 86c1aebc..8aed4a79 100644 --- a/Server/API/SavedScriptsController.cs +++ b/Server/API/SavedScriptsController.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc; using Remotely.Server.Auth; using Remotely.Server.Services; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; using System; using System.Collections.Generic; using System.Linq; diff --git a/Server/API/ScriptingController.cs b/Server/API/ScriptingController.cs index d7d607f9..f9cf6cb9 100644 --- a/Server/API/ScriptingController.cs +++ b/Server/API/ScriptingController.cs @@ -4,7 +4,6 @@ using Microsoft.AspNetCore.SignalR; using Remotely.Server.Hubs; using Remotely.Server.Services; using Remotely.Shared.Utilities; -using Remotely.Shared.Models; using System; using System.IO; using System.Threading.Tasks; @@ -13,6 +12,7 @@ using Remotely.Server.Auth; using Immense.RemoteControl.Shared.Helpers; using Remotely.Shared; using Remotely.Server.Extensions; +using Remotely.Shared.Entities; namespace Remotely.Server.API; diff --git a/Server/Areas/Identity/Pages/Account/ConfirmEmail.cshtml.cs b/Server/Areas/Identity/Pages/Account/ConfirmEmail.cshtml.cs index 46058053..e2daf006 100644 --- a/Server/Areas/Identity/Pages/Account/ConfirmEmail.cshtml.cs +++ b/Server/Areas/Identity/Pages/Account/ConfirmEmail.cshtml.cs @@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.WebUtilities; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; namespace Remotely.Server.Areas.Identity.Pages.Account; diff --git a/Server/Areas/Identity/Pages/Account/ConfirmEmailChange.cshtml.cs b/Server/Areas/Identity/Pages/Account/ConfirmEmailChange.cshtml.cs index 983f2039..57da742c 100644 --- a/Server/Areas/Identity/Pages/Account/ConfirmEmailChange.cshtml.cs +++ b/Server/Areas/Identity/Pages/Account/ConfirmEmailChange.cshtml.cs @@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.WebUtilities; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; namespace Remotely.Server.Areas.Identity.Pages.Account; diff --git a/Server/Areas/Identity/Pages/Account/ForgotPassword.cshtml.cs b/Server/Areas/Identity/Pages/Account/ForgotPassword.cshtml.cs index a4fb87fc..69a1be3b 100644 --- a/Server/Areas/Identity/Pages/Account/ForgotPassword.cshtml.cs +++ b/Server/Areas/Identity/Pages/Account/ForgotPassword.cshtml.cs @@ -10,9 +10,9 @@ using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.AspNetCore.WebUtilities; -using Remotely.Shared.Models; using Remotely.Server.Services; using Microsoft.Extensions.Logging; +using Remotely.Shared.Entities; namespace Remotely.Server.Areas.Identity.Pages.Account; diff --git a/Server/Areas/Identity/Pages/Account/Login.cshtml.cs b/Server/Areas/Identity/Pages/Account/Login.cshtml.cs index d433aa52..de0d5602 100644 --- a/Server/Areas/Identity/Pages/Account/Login.cshtml.cs +++ b/Server/Areas/Identity/Pages/Account/Login.cshtml.cs @@ -11,10 +11,10 @@ using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Logging; -using Remotely.Shared.Models; using Remotely.Server.Services; using Microsoft.AspNetCore.WebUtilities; using System.Text; +using Remotely.Shared.Entities; namespace Remotely.Server.Areas.Identity.Pages.Account; diff --git a/Server/Areas/Identity/Pages/Account/Logout.cshtml b/Server/Areas/Identity/Pages/Account/Logout.cshtml index f320b019..99b4830c 100644 --- a/Server/Areas/Identity/Pages/Account/Logout.cshtml +++ b/Server/Areas/Identity/Pages/Account/Logout.cshtml @@ -4,6 +4,7 @@ @using Microsoft.AspNetCore.SignalR @using Remotely.Server.Hubs @using Immense.RemoteControl.Server.Hubs +@using Remotely.Shared.Entities @attribute [IgnoreAntiforgeryToken] @inject SignInManager SignInManager diff --git a/Server/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml.cs b/Server/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml.cs index 7a64628e..f218e4e8 100644 --- a/Server/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml.cs +++ b/Server/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml.cs @@ -10,7 +10,7 @@ using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Logging; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; namespace Remotely.Server.Areas.Identity.Pages.Account.Manage; diff --git a/Server/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs b/Server/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs index 9ee3bd79..8b243817 100644 --- a/Server/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs +++ b/Server/Areas/Identity/Pages/Account/Manage/Index.cshtml.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; namespace Remotely.Server.Areas.Identity.Pages.Account.Manage; diff --git a/Server/Areas/Identity/Pages/Account/Manage/_ViewImports.cshtml b/Server/Areas/Identity/Pages/Account/Manage/_ViewImports.cshtml index 6a917e1b..de11ea2b 100644 --- a/Server/Areas/Identity/Pages/Account/Manage/_ViewImports.cshtml +++ b/Server/Areas/Identity/Pages/Account/Manage/_ViewImports.cshtml @@ -1,2 +1,3 @@ @using Remotely.Server.Areas.Identity.Pages.Account.Manage -@using Remotely.Shared.Models \ No newline at end of file +@using Remotely.Shared.Models +@using Remotely.Shared.Entities \ No newline at end of file diff --git a/Server/Areas/Identity/Pages/Account/Register.cshtml.cs b/Server/Areas/Identity/Pages/Account/Register.cshtml.cs index 21d20bf8..53495e95 100644 --- a/Server/Areas/Identity/Pages/Account/Register.cshtml.cs +++ b/Server/Areas/Identity/Pages/Account/Register.cshtml.cs @@ -17,6 +17,7 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Remotely.Server.Services; using Remotely.Shared; +using Remotely.Shared.Entities; using Remotely.Shared.Models; namespace Remotely.Server.Areas.Identity.Pages.Account; diff --git a/Server/Areas/Identity/Pages/Shared/_LoginPartial.cshtml b/Server/Areas/Identity/Pages/Shared/_LoginPartial.cshtml index 28975f28..7285c71b 100644 --- a/Server/Areas/Identity/Pages/Shared/_LoginPartial.cshtml +++ b/Server/Areas/Identity/Pages/Shared/_LoginPartial.cshtml @@ -1,4 +1,5 @@ @using Microsoft.AspNetCore.Identity +@using Remotely.Shared.Entities @inject SignInManager SignInManager @inject UserManager UserManager @inject Remotely.Server.Services.IApplicationConfig AppConfig diff --git a/Server/Auth/OrganizationAdminRequirementHandler.cs b/Server/Auth/OrganizationAdminRequirementHandler.cs index 540e6d91..f0697b9f 100644 --- a/Server/Auth/OrganizationAdminRequirementHandler.cs +++ b/Server/Auth/OrganizationAdminRequirementHandler.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; using System.Threading.Tasks; namespace Remotely.Server.Auth; diff --git a/Server/Auth/ServerAdminRequirementHandler.cs b/Server/Auth/ServerAdminRequirementHandler.cs index e7a9f203..a5c060cc 100644 --- a/Server/Auth/ServerAdminRequirementHandler.cs +++ b/Server/Auth/ServerAdminRequirementHandler.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; using System.Threading.Tasks; namespace Remotely.Server.Auth; diff --git a/Server/Auth/TwoFactorRequiredHandler.cs b/Server/Auth/TwoFactorRequiredHandler.cs index beb431f9..ebeccff9 100644 --- a/Server/Auth/TwoFactorRequiredHandler.cs +++ b/Server/Auth/TwoFactorRequiredHandler.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Identity; using Remotely.Server.Services; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; using System; using System.Collections.Generic; using System.Linq; diff --git a/Server/Components/AuthComponentBase.cs b/Server/Components/AuthComponentBase.cs index 4090e39e..371392a6 100644 --- a/Server/Components/AuthComponentBase.cs +++ b/Server/Components/AuthComponentBase.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Identity; using Remotely.Server.Services; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; using System; using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; diff --git a/Server/Components/Devices/DeviceCard.razor.cs b/Server/Components/Devices/DeviceCard.razor.cs index 7a037597..c9ef0d3c 100644 --- a/Server/Components/Devices/DeviceCard.razor.cs +++ b/Server/Components/Devices/DeviceCard.razor.cs @@ -9,6 +9,7 @@ using Remotely.Server.Enums; using Remotely.Server.Hubs; using Remotely.Server.Models; using Remotely.Server.Services; +using Remotely.Shared.Entities; using Remotely.Shared.Enums; using Remotely.Shared.Models; using Remotely.Shared.Utilities; diff --git a/Server/Components/Devices/DevicesFrame.razor.cs b/Server/Components/Devices/DevicesFrame.razor.cs index 3d2cd22f..292a90ad 100644 --- a/Server/Components/Devices/DevicesFrame.razor.cs +++ b/Server/Components/Devices/DevicesFrame.razor.cs @@ -7,6 +7,7 @@ using Remotely.Server.Hubs; using Remotely.Server.Models; using Remotely.Server.Services; using Remotely.Shared.Attributes; +using Remotely.Shared.Entities; using Remotely.Shared.Models; using Remotely.Shared.Utilities; using System; diff --git a/Server/Components/Devices/Terminal.razor.cs b/Server/Components/Devices/Terminal.razor.cs index 8db4170b..8ba370e5 100644 --- a/Server/Components/Devices/Terminal.razor.cs +++ b/Server/Components/Devices/Terminal.razor.cs @@ -6,6 +6,7 @@ using Microsoft.Extensions.Logging; using Remotely.Server.Components.ModalContents; using Remotely.Server.Hubs; using Remotely.Server.Services; +using Remotely.Shared.Entities; using Remotely.Shared.Enums; using Remotely.Shared.Models; using Remotely.Shared.Utilities; diff --git a/Server/Components/Scripts/RunScript.razor.cs b/Server/Components/Scripts/RunScript.razor.cs index 75592689..9dbfd262 100644 --- a/Server/Components/Scripts/RunScript.razor.cs +++ b/Server/Components/Scripts/RunScript.razor.cs @@ -8,6 +8,7 @@ using Remotely.Server.Migrations.Sqlite; using Remotely.Server.Migrations.SqlServer; using Remotely.Server.Pages; using Remotely.Server.Services; +using Remotely.Shared.Entities; using Remotely.Shared.Enums; using Remotely.Shared.Models; using Remotely.Shared.Utilities; diff --git a/Server/Components/Scripts/SavedScripts.razor.cs b/Server/Components/Scripts/SavedScripts.razor.cs index 1cfc9675..9bf2609d 100644 --- a/Server/Components/Scripts/SavedScripts.razor.cs +++ b/Server/Components/Scripts/SavedScripts.razor.cs @@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Components.Forms; using Microsoft.CodeAnalysis.Scripting; using Remotely.Server.Pages; using Remotely.Server.Services; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/Server/Components/Scripts/ScriptSchedules.razor.cs b/Server/Components/Scripts/ScriptSchedules.razor.cs index 12dfc9e6..dacdb86e 100644 --- a/Server/Components/Scripts/ScriptSchedules.razor.cs +++ b/Server/Components/Scripts/ScriptSchedules.razor.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Forms; using Remotely.Server.Pages; using Remotely.Server.Services; +using Remotely.Shared.Entities; using Remotely.Shared.Models; using Remotely.Shared.Utilities; using System; diff --git a/Server/Components/Scripts/ScriptTreeNode.cs b/Server/Components/Scripts/ScriptTreeNode.cs index e3d9e76a..86384907 100644 --- a/Server/Components/Scripts/ScriptTreeNode.cs +++ b/Server/Components/Scripts/ScriptTreeNode.cs @@ -1,5 +1,5 @@ using Remotely.Server.Components.TreeView; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; using System; using System.Collections.Generic; using System.Linq; diff --git a/Server/Data/AppDb.cs b/Server/Data/AppDb.cs index 7ec77eea..b9112e81 100644 --- a/Server/Data/AppDb.cs +++ b/Server/Data/AppDb.cs @@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Logging; +using Remotely.Shared.Entities; using Remotely.Shared.Models; using Remotely.Shared.Utilities; using System; diff --git a/Server/Hubs/AgentHub.cs b/Server/Hubs/AgentHub.cs index f54c185c..a4c42404 100644 --- a/Server/Hubs/AgentHub.cs +++ b/Server/Hubs/AgentHub.cs @@ -6,6 +6,7 @@ using Remotely.Server.Models; using Remotely.Server.Services; using Remotely.Shared; using Remotely.Shared.Dtos; +using Remotely.Shared.Entities; using Remotely.Shared.Enums; using Remotely.Shared.Models; using Remotely.Shared.Utilities; @@ -278,7 +279,7 @@ public class AgentHub : Hub _ = await _circuitManager.InvokeOnConnection($"{result.Value.SenderConnectionID}", CircuitEventName.ScriptResult, - result); + result.Value); } public void ScriptResultViaApi(string commandID, string requestID) diff --git a/Server/Hubs/CircuitConnection.cs b/Server/Hubs/CircuitConnection.cs index e50ee796..1bc1bc60 100644 --- a/Server/Hubs/CircuitConnection.cs +++ b/Server/Hubs/CircuitConnection.cs @@ -12,8 +12,8 @@ using Remotely.Server.Auth; using Remotely.Server.Models; using Remotely.Server.Services; using Remotely.Shared; +using Remotely.Shared.Entities; using Remotely.Shared.Enums; -using Remotely.Shared.Models; using Remotely.Shared.Utilities; using System; using System.Collections.Concurrent; diff --git a/Server/Pages/ApiKeys.razor b/Server/Pages/ApiKeys.razor index 2386ad50..f773328d 100644 --- a/Server/Pages/ApiKeys.razor +++ b/Server/Pages/ApiKeys.razor @@ -1,5 +1,6 @@ @page "/api-keys" @using Immense.RemoteControl.Shared.Helpers; +@using Remotely.Shared.Entities; @attribute [Authorize(Policy = PolicyNames.OrganizationAdminRequired)] @inherits AuthComponentBase diff --git a/Server/Pages/DeviceDetails.razor.cs b/Server/Pages/DeviceDetails.razor.cs index 830fe90c..c3668ea4 100644 --- a/Server/Pages/DeviceDetails.razor.cs +++ b/Server/Pages/DeviceDetails.razor.cs @@ -4,8 +4,8 @@ using Microsoft.AspNetCore.Components.Web; using Remotely.Server.Components; using Remotely.Server.Hubs; using Remotely.Server.Services; +using Remotely.Shared.Entities; using Remotely.Shared.Enums; -using Remotely.Shared.Models; using Remotely.Shared.Utilities; using System; using System.Collections.Concurrent; diff --git a/Server/Pages/ManageOrganization.razor.cs b/Server/Pages/ManageOrganization.razor.cs index 992813a7..fbd6b3fb 100644 --- a/Server/Pages/ManageOrganization.razor.cs +++ b/Server/Pages/ManageOrganization.razor.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.WebUtilities; using Remotely.Server.Components; using Remotely.Server.Components.ModalContents; using Remotely.Server.Services; +using Remotely.Shared.Entities; using Remotely.Shared.Models; using Remotely.Shared.ViewModels; using System; diff --git a/Server/Pages/ServerConfig.razor.cs b/Server/Pages/ServerConfig.razor.cs index c6d7f694..dec2fb5d 100644 --- a/Server/Pages/ServerConfig.razor.cs +++ b/Server/Pages/ServerConfig.razor.cs @@ -9,8 +9,8 @@ using Microsoft.Extensions.Logging; using Remotely.Server.Components; using Remotely.Server.Hubs; using Remotely.Server.Services; +using Remotely.Shared.Entities; using Remotely.Shared.Enums; -using Remotely.Shared.Models; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/Server/Pages/Shared/_Layout.cshtml b/Server/Pages/Shared/_Layout.cshtml index 535b01ae..eef7464a 100644 --- a/Server/Pages/Shared/_Layout.cshtml +++ b/Server/Pages/Shared/_Layout.cshtml @@ -3,6 +3,7 @@ @using Microsoft.EntityFrameworkCore; @using Remotely.Server.Services @using Remotely.Shared.Models +@using Remotely.Shared.Entities @inject IApplicationConfig AppConfig @inject IWebHostEnvironment Environment @inject ICompositeViewEngine Engine diff --git a/Server/Pages/Shared/_LoginPartial.cshtml b/Server/Pages/Shared/_LoginPartial.cshtml index 5edd244a..c5ef3193 100644 --- a/Server/Pages/Shared/_LoginPartial.cshtml +++ b/Server/Pages/Shared/_LoginPartial.cshtml @@ -1,6 +1,6 @@ @using Microsoft.AspNetCore.Identity @using Remotely.Shared.Models - +@using Remotely.Shared.Entities @inject SignInManager SignInManager @inject UserManager UserManager @inject Remotely.Server.Services.IApplicationConfig AppConfig diff --git a/Server/Pages/_Host.cshtml b/Server/Pages/_Host.cshtml index 26289ed6..4f1f8f8d 100644 --- a/Server/Pages/_Host.cshtml +++ b/Server/Pages/_Host.cshtml @@ -1,6 +1,7 @@ @page "/" @using Remotely.Server.Services @using Remotely.Shared.Models +@using Remotely.Shared.Entities @namespace Remotely.Server.Pages @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @inject IDataService DataService diff --git a/Server/Program.cs b/Server/Program.cs index ec6b1b78..b5de741d 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -23,7 +23,6 @@ using Remotely.Server.Auth; using Remotely.Server.Data; using Remotely.Server.Hubs; using Remotely.Server.Services; -using Remotely.Shared.Models; using System.IO; using System.Linq; using System.Net; @@ -39,6 +38,7 @@ using Serilog; using Nihs.SimpleMessenger; using Microsoft.AspNetCore.RateLimiting; using RatePolicyNames = Remotely.Server.RateLimiting.PolicyNames; +using Remotely.Shared.Entities; var builder = WebApplication.CreateBuilder(args); var configuration = builder.Configuration; diff --git a/Server/Services/AgentHubSessionCache.cs b/Server/Services/AgentHubSessionCache.cs index 4ad82cbd..4921d39f 100644 --- a/Server/Services/AgentHubSessionCache.cs +++ b/Server/Services/AgentHubSessionCache.cs @@ -1,5 +1,5 @@ using Immense.RemoteControl.Server.Models; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/Server/Services/AuthService.cs b/Server/Services/AuthService.cs index 7cc451d0..4884dcc6 100644 --- a/Server/Services/AuthService.cs +++ b/Server/Services/AuthService.cs @@ -1,7 +1,7 @@ using Immense.RemoteControl.Shared; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Identity; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; using System; using System.Collections.Generic; using System.Linq; diff --git a/Server/Services/DataService.cs b/Server/Services/DataService.cs index 309f592f..3d112361 100644 --- a/Server/Services/DataService.cs +++ b/Server/Services/DataService.cs @@ -12,6 +12,7 @@ using Remotely.Server.Data; using Remotely.Server.Models; using Remotely.Shared; using Remotely.Shared.Dtos; +using Remotely.Shared.Entities; using Remotely.Shared.Enums; using Remotely.Shared.Models; using Remotely.Shared.Utilities; diff --git a/Server/Services/ScriptScheduleDispatcher.cs b/Server/Services/ScriptScheduleDispatcher.cs index 7cf4bc50..544f6af5 100644 --- a/Server/Services/ScriptScheduleDispatcher.cs +++ b/Server/Services/ScriptScheduleDispatcher.cs @@ -1,8 +1,8 @@ using Immense.RemoteControl.Server.Abstractions; using Microsoft.Extensions.Logging; using Remotely.Server.Hubs; +using Remotely.Shared.Entities; using Remotely.Shared.Enums; -using Remotely.Shared.Models; using Remotely.Shared.Utilities; using System; using System.Collections.Generic; diff --git a/Server/_Imports.razor b/Server/_Imports.razor index aca46d5e..d5b02e4e 100644 --- a/Server/_Imports.razor +++ b/Server/_Imports.razor @@ -23,4 +23,5 @@ @using System.Collections.Concurrent @using Remotely.Server.Components.Scripts @using Remotely.Server.Components.TreeView -@using Remotely.Server.Auth \ No newline at end of file +@using Remotely.Server.Auth +@using Remotely.Shared.Entities \ No newline at end of file diff --git a/Shared/Models/Alert.cs b/Shared/Entities/Alert.cs similarity index 95% rename from Shared/Models/Alert.cs rename to Shared/Entities/Alert.cs index 15100757..2f8a1b41 100644 --- a/Shared/Models/Alert.cs +++ b/Shared/Entities/Alert.cs @@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; -namespace Remotely.Shared.Models; +namespace Remotely.Shared.Entities; public class Alert { diff --git a/Shared/Models/ApiToken.cs b/Shared/Entities/ApiToken.cs similarity index 94% rename from Shared/Models/ApiToken.cs rename to Shared/Entities/ApiToken.cs index 86c7448c..c37b58e6 100644 --- a/Shared/Models/ApiToken.cs +++ b/Shared/Entities/ApiToken.cs @@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; -namespace Remotely.Shared.Models; +namespace Remotely.Shared.Entities; public class ApiToken { diff --git a/Shared/Models/BrandingInfo.cs b/Shared/Entities/BrandingInfo.cs similarity index 78% rename from Shared/Models/BrandingInfo.cs rename to Shared/Entities/BrandingInfo.cs index 52354efd..0e8d64d6 100644 --- a/Shared/Models/BrandingInfo.cs +++ b/Shared/Entities/BrandingInfo.cs @@ -9,15 +9,15 @@ using System.Text; using System.Text.Json.Serialization; using System.Threading.Tasks; -namespace Remotely.Shared.Models; +namespace Remotely.Shared.Entities; public class BrandingInfo : BrandingInfoBase { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public string Id { get; set; } = string.Empty; + public string Id { get; set; } = null!; - public string? OrganizationId { get; set; } + public string OrganizationId { get; set; } = null!; [JsonIgnore] public Organization? Organization { get; set; } diff --git a/Shared/Models/Device.cs b/Shared/Entities/Device.cs similarity index 94% rename from Shared/Models/Device.cs rename to Shared/Entities/Device.cs index 3720bad5..e37e74c3 100644 --- a/Shared/Models/Device.cs +++ b/Shared/Entities/Device.cs @@ -1,5 +1,6 @@ using Remotely.Shared.Attributes; using Remotely.Shared.Enums; +using Remotely.Shared.Models; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -7,7 +8,7 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.InteropServices; using System.Text.Json.Serialization; -namespace Remotely.Shared.Models; +namespace Remotely.Shared.Entities; public class Device { @@ -40,7 +41,7 @@ public class Device public List? Drives { get; set; } [Key] - public string ID { get; set; } = null!; + public string ID { get; set; } = Guid.NewGuid().ToString(); public bool Is64Bit { get; set; } public bool IsOnline { get; set; } @@ -54,7 +55,7 @@ public class Device public string[] MacAddresses { get; set; } = Array.Empty(); [StringLength(5000)] - public string? Notes { get; set; } + public string? Notes { get; set; } [JsonIgnore] public Organization? Organization { get; set; } diff --git a/Shared/Models/InviteLink.cs b/Shared/Entities/InviteLink.cs similarity index 85% rename from Shared/Models/InviteLink.cs rename to Shared/Entities/InviteLink.cs index 712dd755..12324acf 100644 --- a/Shared/Models/InviteLink.cs +++ b/Shared/Entities/InviteLink.cs @@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; -namespace Remotely.Shared.Models; +namespace Remotely.Shared.Entities; public class InviteLink { @@ -15,6 +15,6 @@ public class InviteLink public DateTimeOffset DateSent { get; set; } [JsonIgnore] public Organization? Organization { get; set; } - public string? OrganizationID { get; set; } + public string OrganizationID { get; set; } = null!; public string? ResetUrl { get; set; } } diff --git a/Shared/Models/Organization.cs b/Shared/Entities/Organization.cs similarity index 95% rename from Shared/Models/Organization.cs rename to Shared/Entities/Organization.cs index 610226c7..8ec7b6da 100644 --- a/Shared/Models/Organization.cs +++ b/Shared/Entities/Organization.cs @@ -1,11 +1,12 @@ using Immense.RemoteControl.Shared.Models; using Remotely.Shared.Enums; +using Remotely.Shared.Models; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Remotely.Shared.Models; +namespace Remotely.Shared.Entities; public class Organization { diff --git a/Shared/Models/RemotelyUser.cs b/Shared/Entities/RemotelyUser.cs similarity index 92% rename from Shared/Models/RemotelyUser.cs rename to Shared/Entities/RemotelyUser.cs index 53c863c6..62c1c290 100644 --- a/Shared/Models/RemotelyUser.cs +++ b/Shared/Entities/RemotelyUser.cs @@ -1,9 +1,10 @@ using Microsoft.AspNetCore.Identity; +using Remotely.Shared.Models; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; -namespace Remotely.Shared.Models; +namespace Remotely.Shared.Entities; public class RemotelyUser : IdentityUser { diff --git a/Shared/Models/SavedScript.cs b/Shared/Entities/SavedScript.cs similarity index 97% rename from Shared/Models/SavedScript.cs rename to Shared/Entities/SavedScript.cs index 2d91fedb..7b4b5a7b 100644 --- a/Shared/Models/SavedScript.cs +++ b/Shared/Entities/SavedScript.cs @@ -8,7 +8,7 @@ using System.Text; using System.Text.Json.Serialization; using System.Threading.Tasks; -namespace Remotely.Shared.Models; +namespace Remotely.Shared.Entities; public class SavedScript { diff --git a/Shared/Models/ScriptResult.cs b/Shared/Entities/ScriptResult.cs similarity index 84% rename from Shared/Models/ScriptResult.cs rename to Shared/Entities/ScriptResult.cs index 54db01c0..0dd8a740 100644 --- a/Shared/Models/ScriptResult.cs +++ b/Shared/Entities/ScriptResult.cs @@ -8,7 +8,7 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; using System.Text.Json.Serialization; -namespace Remotely.Shared.Models; +namespace Remotely.Shared.Entities; public class ScriptResult : ScriptResultBase { @@ -17,12 +17,12 @@ public class ScriptResult : ScriptResultBase [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public string ID { get; set; } = string.Empty; + public string ID { get; set; } = null!; [JsonIgnore] [IgnoreDataMember] public Organization? Organization { get; set; } - public string OrganizationID { get; set; } = string.Empty; + public required string OrganizationID { get; set; } [JsonIgnore] public SavedScript? SavedScript { get; set; } diff --git a/Shared/Models/ScriptRun.cs b/Shared/Entities/ScriptRun.cs similarity index 96% rename from Shared/Models/ScriptRun.cs rename to Shared/Entities/ScriptRun.cs index 90c61024..9889a63b 100644 --- a/Shared/Models/ScriptRun.cs +++ b/Shared/Entities/ScriptRun.cs @@ -8,7 +8,7 @@ using System.Text; using System.Text.Json.Serialization; using System.Threading.Tasks; -namespace Remotely.Shared.Models; +namespace Remotely.Shared.Entities; public class ScriptRun { diff --git a/Shared/Models/ScriptSchedule.cs b/Shared/Entities/ScriptSchedule.cs similarity index 95% rename from Shared/Models/ScriptSchedule.cs rename to Shared/Entities/ScriptSchedule.cs index 71cf7e8c..63f64664 100644 --- a/Shared/Models/ScriptSchedule.cs +++ b/Shared/Entities/ScriptSchedule.cs @@ -1,4 +1,5 @@ using Remotely.Shared.Enums; +using Remotely.Shared.Models; using Remotely.Shared.Utilities; using System; using System.Collections.Generic; @@ -9,7 +10,7 @@ using System.Text; using System.Text.Json.Serialization; using System.Threading.Tasks; -namespace Remotely.Shared.Models; +namespace Remotely.Shared.Entities; public class ScriptSchedule { diff --git a/Shared/Models/SharedFile.cs b/Shared/Entities/SharedFile.cs similarity index 94% rename from Shared/Models/SharedFile.cs rename to Shared/Entities/SharedFile.cs index 72fed5b8..ec69176e 100644 --- a/Shared/Models/SharedFile.cs +++ b/Shared/Entities/SharedFile.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Remotely.Shared.Models; +namespace Remotely.Shared.Entities; public class SharedFile { diff --git a/Shared/Extensions/DeviceExtensions.cs b/Shared/Extensions/DeviceExtensions.cs index 87901f18..8997c128 100644 --- a/Shared/Extensions/DeviceExtensions.cs +++ b/Shared/Extensions/DeviceExtensions.cs @@ -1,5 +1,5 @@ using Remotely.Shared.Dtos; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; using System; using System.Collections.Generic; using System.Linq; diff --git a/Shared/Models/DeviceGroup.cs b/Shared/Models/DeviceGroup.cs index 611d4d30..a04d55b1 100644 --- a/Shared/Models/DeviceGroup.cs +++ b/Shared/Models/DeviceGroup.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; +using Remotely.Shared.Entities; namespace Remotely.Shared.Models; diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index 182ada76..7d0f5592 100644 --- a/Shared/Shared.csproj +++ b/Shared/Shared.csproj @@ -22,11 +22,11 @@ - + ScriptResult.cs.d.ts DtsGenerator - + diff --git a/Tests/Server.Tests/DataServiceTests.cs b/Tests/Server.Tests/DataServiceTests.cs index 003f7676..245ed3fe 100644 --- a/Tests/Server.Tests/DataServiceTests.cs +++ b/Tests/Server.Tests/DataServiceTests.cs @@ -3,6 +3,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Remotely.Server.Services; using Remotely.Shared.Dtos; +using Remotely.Shared.Entities; using Remotely.Shared.Models; using Remotely.Shared.Utilities; using System; diff --git a/Tests/Server.Tests/IoCActivator.cs b/Tests/Server.Tests/IoCActivator.cs index 7c0e84f6..41c67c6f 100644 --- a/Tests/Server.Tests/IoCActivator.cs +++ b/Tests/Server.Tests/IoCActivator.cs @@ -10,7 +10,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Remotely.Server.API; using Remotely.Server.Data; using Remotely.Server.Services; -using Remotely.Shared.Models; +using Remotely.Shared.Entities; using Remotely.Shared.Utilities; using System; using System.Collections.Generic; diff --git a/Tests/Server.Tests/ScriptScheduleDispatcherTests.cs b/Tests/Server.Tests/ScriptScheduleDispatcherTests.cs index be1d0f92..55a0fefd 100644 --- a/Tests/Server.Tests/ScriptScheduleDispatcherTests.cs +++ b/Tests/Server.Tests/ScriptScheduleDispatcherTests.cs @@ -5,6 +5,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Remotely.Server.Hubs; using Remotely.Server.Services; +using Remotely.Shared.Entities; using Remotely.Shared.Enums; using Remotely.Shared.Models; using Remotely.Shared.Utilities; diff --git a/Tests/Server.Tests/TestData.cs b/Tests/Server.Tests/TestData.cs index 14089fa6..32014e74 100644 --- a/Tests/Server.Tests/TestData.cs +++ b/Tests/Server.Tests/TestData.cs @@ -6,6 +6,7 @@ using Remotely.Server.Areas.Identity.Pages.Account.Manage; using Remotely.Server.Data; using Remotely.Server.Services; using Remotely.Shared.Dtos; +using Remotely.Shared.Entities; using Remotely.Shared.Models; using System; using System.Linq;