diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Culture/AllCultureController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Culture/AllCultureController.cs deleted file mode 100644 index f1ff94cce7..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Culture/AllCultureController.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Globalization; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Api.Management.ViewModels.Culture; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; - -namespace Umbraco.Cms.Api.Management.Controllers.Culture; - -public class AllCultureController : CultureControllerBase -{ - private readonly IUmbracoMapper _umbracoMapper; - - public AllCultureController(IUmbracoMapper umbracoMapper) => _umbracoMapper = umbracoMapper; - - /// - /// Returns all cultures available for creating languages. - /// - /// - [HttpGet] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task> GetAll(int skip, int take) - { - IEnumerable list = CultureInfo.GetCultures(CultureTypes.AllCultures) - .DistinctBy(x => x.Name) - .OrderBy(x => x.EnglishName) - .Skip(skip) - .Take(take); - - return await Task.FromResult(_umbracoMapper.Map>(list)!); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Culture/CultureControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Culture/CultureControllerBase.cs deleted file mode 100644 index 7355345493..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Culture/CultureControllerBase.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Culture; - -[ApiController] -[VersionedApiBackOfficeRoute("culture")] -[ApiExplorerSettings(GroupName = "Culture")] -[ApiVersion("1.0")] -public abstract class CultureControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/ChildrenDataTypeTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/ChildrenDataTypeTreeController.cs deleted file mode 100644 index f792c2c494..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/ChildrenDataTypeTreeController.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.DataType.Tree; - -public class ChildrenDataTypeTreeController : DataTypeTreeControllerBase -{ - public ChildrenDataTypeTreeController(IEntityService entityService, IDataTypeService dataTypeService) - : base(entityService, dataTypeService) - { - } - - [HttpGet("children")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Children(Guid parentKey, int skip = 0, int take = 100, bool foldersOnly = false) - { - RenderFoldersOnly(foldersOnly); - return await GetChildren(parentKey, skip, take); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/DataTypeTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/DataTypeTreeControllerBase.cs deleted file mode 100644 index b92aa99ddb..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/DataTypeTreeControllerBase.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.DataType.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.DataType}")] -[ApiExplorerSettings(GroupName = "Data Type")] -public class DataTypeTreeControllerBase : FolderTreeControllerBase -{ - private readonly IDataTypeService _dataTypeService; - - public DataTypeTreeControllerBase(IEntityService entityService, IDataTypeService dataTypeService) - : base(entityService) => - _dataTypeService = dataTypeService; - - protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.DataType; - - protected override UmbracoObjectTypes FolderObjectType => UmbracoObjectTypes.DataTypeContainer; - - protected override FolderTreeItemViewModel[] MapTreeItemViewModels(Guid? parentKey, IEntitySlim[] entities) - { - var dataTypes = _dataTypeService - .GetAll(entities.Select(entity => entity.Id).ToArray()) - .ToDictionary(contentType => contentType.Id); - - return entities.Select(entity => - { - FolderTreeItemViewModel viewModel = MapTreeItemViewModel(parentKey, entity); - if (dataTypes.TryGetValue(entity.Id, out IDataType? dataType)) - { - viewModel.Icon = dataType.Editor?.Icon ?? viewModel.Icon; - } - - return viewModel; - }).ToArray(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/ItemsDataTypeTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/ItemsDataTypeTreeController.cs deleted file mode 100644 index 6e4cf2791c..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/ItemsDataTypeTreeController.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.DataType.Tree; - -public class ItemsDataTypeTreeController : DataTypeTreeControllerBase -{ - public ItemsDataTypeTreeController(IEntityService entityService, IDataTypeService dataTypeService) - : base(entityService, dataTypeService) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "key")] Guid[] keys) - => await GetItems(keys); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/RootDataTypeTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/RootDataTypeTreeController.cs deleted file mode 100644 index d14b8fa066..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/Tree/RootDataTypeTreeController.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.DataType.Tree; - -public class RootDataTypeTreeController : DataTypeTreeControllerBase -{ - public RootDataTypeTreeController(IEntityService entityService, IDataTypeService dataTypeService) - : base(entityService, dataTypeService) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100, bool foldersOnly = false) - { - RenderFoldersOnly(foldersOnly); - return await GetRoot(skip, take); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/AllDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/AllDictionaryController.cs deleted file mode 100644 index 4415a5ff5f..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/AllDictionaryController.cs +++ /dev/null @@ -1,69 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Dictionary; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; - -namespace Umbraco.Cms.Api.Management.Controllers.Dictionary; - -public class AllDictionaryController : DictionaryControllerBase -{ - private readonly ILocalizationService _localizationService; - private readonly IUmbracoMapper _umbracoMapper; - - public AllDictionaryController(ILocalizationService localizationService, IUmbracoMapper umbracoMapper) - { - _localizationService = localizationService; - _umbracoMapper = umbracoMapper; - } - - - /// - /// Retrieves a list with all dictionary items - /// - /// - /// The . - /// - [HttpGet] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> All(int skip, int take) - { - IDictionaryItem[] items = _localizationService.GetDictionaryItemDescendants(null).ToArray(); - var list = new List(items.Length); - - // Build the proper tree structure, as we can have nested dictionary items - BuildTree(list, items); - - var model = new PagedViewModel - { - Total = list.Count, - Items = list.Skip(skip).Take(take), - }; - return await Task.FromResult(model); - } - - // recursive method to build a tree structure from the flat structure returned above - private void BuildTree(List list, IDictionaryItem[] items, int level = 0, Guid? parentId = null) - { - IDictionaryItem[] children = items.Where(t => t.ParentId == parentId).ToArray(); - if (children.Any() == false) - { - return; - } - - foreach (IDictionaryItem child in children.OrderBy(item => item.ItemKey)) - { - DictionaryOverviewViewModel? display = _umbracoMapper.Map(child); - if (display is not null) - { - display.Level = level; - list.Add(display); - } - - BuildTree(list, items, level + 1, child.Key); - } - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ByKeyDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ByKeyDictionaryController.cs deleted file mode 100644 index a595296dc3..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ByKeyDictionaryController.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.ContentEditing; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Dictionary; -using Umbraco.New.Cms.Core.Factories; - -namespace Umbraco.Cms.Api.Management.Controllers.Dictionary; - -public class ByIdDictionaryController : DictionaryControllerBase -{ - private readonly ILocalizationService _localizationService; - private readonly IDictionaryFactory _dictionaryFactory; - - public ByIdDictionaryController( - ILocalizationService localizationService, - IDictionaryFactory dictionaryFactory) - { - _localizationService = localizationService; - _dictionaryFactory = dictionaryFactory; - } - - /// - /// Gets a dictionary item by guid - /// - /// - /// The id. - /// - /// - /// The . Returns a not found response when dictionary item does not exist - /// - [HttpGet("{key:guid}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(DictionaryViewModel), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)] - public async Task> ByKey(Guid key) - { - IDictionaryItem? dictionary = _localizationService.GetDictionaryItemById(key); - if (dictionary == null) - { - return NotFound(); - } - - return await Task.FromResult(_dictionaryFactory.CreateDictionaryViewModel(dictionary)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/CreateDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/CreateDictionaryController.cs deleted file mode 100644 index ab0cc69625..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/CreateDictionaryController.cs +++ /dev/null @@ -1,90 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Security; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Dictionary; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Controllers.Dictionary; - -public class CreateDictionaryController : DictionaryControllerBase -{ - private readonly ILocalizationService _localizationService; - private readonly ILocalizedTextService _localizedTextService; - private readonly GlobalSettings _globalSettings; - private readonly IBackOfficeSecurityAccessor _backofficeSecurityAccessor; - private readonly ILogger _logger; - - public CreateDictionaryController( - ILocalizationService localizationService, - ILocalizedTextService localizedTextService, - IOptionsSnapshot globalSettings, - IBackOfficeSecurityAccessor backofficeSecurityAccessor, - ILogger logger) - { - _localizationService = localizationService; - _localizedTextService = localizedTextService; - _globalSettings = globalSettings.Value; - _backofficeSecurityAccessor = backofficeSecurityAccessor; - _logger = logger; - } - - /// - /// Creates a new dictionary item - /// - /// The viewmodel to pass to the action - /// - /// The . - /// - [HttpPost] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(CreatedResult), StatusCodes.Status201Created)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - public async Task> Create(DictionaryItemViewModel dictionaryViewModel) - { - if (string.IsNullOrEmpty(dictionaryViewModel.Key.ToString())) - { - return ValidationProblem("Key can not be empty."); // TODO: translate - } - - if (_localizationService.DictionaryItemExists(dictionaryViewModel.Key.ToString())) - { - var message = _localizedTextService.Localize( - "dictionaryItem", - "changeKeyError", - _backofficeSecurityAccessor.BackOfficeSecurity?.CurrentUser?.GetUserCulture(_localizedTextService, _globalSettings), - new Dictionary - { - { "0", dictionaryViewModel.Key.ToString() }, - }); - return await Task.FromResult(ValidationProblem(message)); - } - - try - { - Guid? parentGuid = null; - - if (dictionaryViewModel.ParentId.HasValue) - { - parentGuid = dictionaryViewModel.ParentId; - } - - IDictionaryItem item = _localizationService.CreateDictionaryItemWithIdentity( - dictionaryViewModel.Key.ToString(), - parentGuid, - string.Empty); - - - return await Task.FromResult(Created($"api/v1.0/dictionary/{item.Key}", item.Key)); - } - catch (Exception ex) - { - _logger.LogError(ex, "Error creating dictionary with {Name} under {ParentId}", dictionaryViewModel.Key, dictionaryViewModel.ParentId); - return await Task.FromResult(ValidationProblem("Error creating dictionary item")); - } - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DeleteDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DeleteDictionaryController.cs deleted file mode 100644 index 0f86cc0e5a..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DeleteDictionaryController.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Security; -using Umbraco.Cms.Core.Services; - -namespace Umbraco.Cms.Api.Management.Controllers.Dictionary; - -public class DeleteDictionaryController : DictionaryControllerBase -{ - private readonly ILocalizationService _localizationService; - private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; - - public DeleteDictionaryController(ILocalizationService localizationService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor) - { - _localizationService = localizationService; - _backOfficeSecurityAccessor = backOfficeSecurityAccessor; - } - /// - /// Deletes a data type with a given ID - /// - /// The key of the dictionary item to delete - /// - /// - /// - [HttpDelete("{key}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)] - public async Task Delete(Guid key) - { - IDictionaryItem? foundDictionary = _localizationService.GetDictionaryItemByKey(key.ToString()); - - if (foundDictionary == null) - { - return await Task.FromResult(NotFound()); - } - - IEnumerable foundDictionaryDescendants = - _localizationService.GetDictionaryItemDescendants(foundDictionary.Key); - - foreach (IDictionaryItem dictionaryItem in foundDictionaryDescendants) - { - _localizationService.Delete(dictionaryItem, _backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser?.Id ?? -1); - } - - _localizationService.Delete(foundDictionary, _backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser?.Id ?? -1); - - return await Task.FromResult(Ok()); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DictionaryControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DictionaryControllerBase.cs deleted file mode 100644 index 4914298d14..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/DictionaryControllerBase.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Dictionary; - -[ApiController] -[VersionedApiBackOfficeRoute("dictionary")] -[ApiExplorerSettings(GroupName = "Dictionary")] -[ApiVersion("1.0")] -// TODO: Add authentication -public abstract class DictionaryControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ExportDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ExportDictionaryController.cs deleted file mode 100644 index 1b0236af93..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ExportDictionaryController.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Net.Mime; -using System.Text; -using System.Xml.Linq; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Controllers.Dictionary; - -public class ExportDictionaryController : DictionaryControllerBase -{ - private readonly ILocalizationService _localizationService; - private readonly IEntityXmlSerializer _entityXmlSerializer; - - public ExportDictionaryController(ILocalizationService localizationService, IEntityXmlSerializer entityXmlSerializer) - { - _localizationService = localizationService; - _entityXmlSerializer = entityXmlSerializer; - } - - [HttpGet("export/{key:guid}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)] - public async Task ExportDictionary(Guid key, bool includeChildren = false) - { - IDictionaryItem? dictionaryItem = _localizationService.GetDictionaryItemById(key); - if (dictionaryItem is null) - { - return await Task.FromResult(NotFound()); - } - - XElement xml = _entityXmlSerializer.Serialize(dictionaryItem, includeChildren); - - var fileName = $"{dictionaryItem.ItemKey}.udt"; - - // Set custom header so umbRequestHelper.downloadFile can save the correct filename - HttpContext.Response.Headers.Add("x-filename", fileName); - - return await Task.FromResult(File(Encoding.UTF8.GetBytes(xml.ToDataString()), MediaTypeNames.Application.Octet, fileName)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ImportDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ImportDictionaryController.cs deleted file mode 100644 index ef1cf4a24f..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/ImportDictionaryController.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Net.Mime; -using System.Text; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Extensions; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Services; -using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment; - -namespace Umbraco.Cms.Api.Management.Controllers.Dictionary; - -public class ImportDictionaryController : DictionaryControllerBase -{ - private readonly IDictionaryService _dictionaryService; - private readonly IWebHostEnvironment _webHostEnvironment; - private readonly ILoadDictionaryItemService _loadDictionaryItemService; - - public ImportDictionaryController( - IDictionaryService dictionaryService, - IWebHostEnvironment webHostEnvironment, - ILoadDictionaryItemService loadDictionaryItemService) - { - _dictionaryService = dictionaryService; - _webHostEnvironment = webHostEnvironment; - _loadDictionaryItemService = loadDictionaryItemService; - } - - [HttpPost("import")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ContentResult), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)] - public async Task ImportDictionary(string file, int? parentId) - { - if (string.IsNullOrWhiteSpace(file)) - { - return NotFound(); - } - - var filePath = Path.Combine(_webHostEnvironment.MapPathContentRoot(Constants.SystemDirectories.Data), file); - if (_webHostEnvironment.ContentRootFileProvider.GetFileInfo(filePath) is null) - { - return await Task.FromResult(NotFound()); - } - - IDictionaryItem dictionaryItem = _loadDictionaryItemService.Load(filePath, parentId); - - return await Task.FromResult(Content(_dictionaryService.CalculatePath(dictionaryItem.ParentId, dictionaryItem.Id), MediaTypeNames.Text.Plain, Encoding.UTF8)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/Tree/ChildrenDictionaryTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/Tree/ChildrenDictionaryTreeController.cs deleted file mode 100644 index 8dfa33835f..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/Tree/ChildrenDictionaryTreeController.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Services.Paging; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Dictionary.Tree; - -public class ChildrenDictionaryTreeController : DictionaryTreeControllerBase -{ - public ChildrenDictionaryTreeController(IEntityService entityService, ILocalizationService localizationService) - : base(entityService, localizationService) - { - } - - [HttpGet("children")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Children(Guid parentKey, int skip = 0, int take = 100) - { - if (PaginationService.ConvertSkipTakeToPaging(skip, take, out var pageNumber, out var pageSize, out ProblemDetails? error) == false) - { - return BadRequest(error); - } - - IDictionaryItem[] dictionaryItems = PaginatedDictionaryItems( - pageNumber, - pageSize, - LocalizationService.GetDictionaryItemChildren(parentKey), - out var totalItems); - - EntityTreeItemViewModel[] viewModels = MapTreeItemViewModels(null, dictionaryItems); - - PagedViewModel result = PagedViewModel(viewModels, totalItems); - return await Task.FromResult(Ok(result)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/Tree/DictionaryTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/Tree/DictionaryTreeControllerBase.cs deleted file mode 100644 index 87fdd2bdde..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/Tree/DictionaryTreeControllerBase.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Dictionary.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/dictionary")] -[ApiExplorerSettings(GroupName = "Dictionary")] -// NOTE: at the moment dictionary items (renamed to dictionary tree) aren't supported by EntityService, so we have little use of the -// tree controller base. We'll keep it though, in the hope that we can mend EntityService. -public class DictionaryTreeControllerBase : EntityTreeControllerBase -{ - public DictionaryTreeControllerBase(IEntityService entityService, ILocalizationService localizationService) - : base(entityService) => - LocalizationService = localizationService; - - // dictionary items do not currently have a known UmbracoObjectType, so we'll settle with Unknown for now - protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.Unknown; - - protected ILocalizationService LocalizationService { get; } - - protected EntityTreeItemViewModel[] MapTreeItemViewModels(Guid? parentKey, IDictionaryItem[] dictionaryItems) - => dictionaryItems.Select(dictionaryItem => new EntityTreeItemViewModel - { - Icon = Constants.Icons.RelationType, - Name = dictionaryItem.ItemKey, - Key = dictionaryItem.Key, - Type = Constants.UdiEntityType.DictionaryItem, - HasChildren = false, - IsContainer = LocalizationService.GetDictionaryItemChildren(dictionaryItem.Key).Any(), - ParentKey = parentKey - }).ToArray(); - - // localization service does not (yet) allow pagination of dictionary items, we have to do it in memory for now - protected IDictionaryItem[] PaginatedDictionaryItems(long pageNumber, int pageSize, IEnumerable allDictionaryItems, out long totalItems) - { - IDictionaryItem[] allDictionaryItemsAsArray = allDictionaryItems.ToArray(); - - totalItems = allDictionaryItemsAsArray.Length; - return allDictionaryItemsAsArray - .OrderBy(item => item.ItemKey) - .Skip((int)pageNumber * pageSize) - .Take(pageSize) - .ToArray(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/Tree/ItemsDictionaryTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/Tree/ItemsDictionaryTreeController.cs deleted file mode 100644 index c74cf8f340..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/Tree/ItemsDictionaryTreeController.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Dictionary.Tree; - -public class ItemsDictionaryTreeController : DictionaryTreeControllerBase -{ - public ItemsDictionaryTreeController(IEntityService entityService, ILocalizationService localizationService) - : base(entityService, localizationService) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "key")] Guid[] keys) - { - IDictionaryItem[] dictionaryItems = LocalizationService.GetDictionaryItemsByIds(keys).ToArray(); - - EntityTreeItemViewModel[] viewModels = MapTreeItemViewModels(null, dictionaryItems); - - return await Task.FromResult(Ok(viewModels)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/Tree/RootDictionaryTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/Tree/RootDictionaryTreeController.cs deleted file mode 100644 index bd2fc78418..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/Tree/RootDictionaryTreeController.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Services.Paging; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Dictionary.Tree; - -public class RootDictionaryTreeController : DictionaryTreeControllerBase -{ - public RootDictionaryTreeController(IEntityService entityService, ILocalizationService localizationService) - : base(entityService, localizationService) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100) - { - if (PaginationService.ConvertSkipTakeToPaging(skip, take, out var pageNumber, out var pageSize, out ProblemDetails? error) == false) - { - return BadRequest(error); - } - - IDictionaryItem[] dictionaryItems = PaginatedDictionaryItems( - pageNumber, - pageSize, - LocalizationService.GetRootDictionaryItems(), - out var totalItems); - - EntityTreeItemViewModel[] viewModels = MapTreeItemViewModels(null, dictionaryItems); - - PagedViewModel result = PagedViewModel(viewModels, totalItems); - return await Task.FromResult(Ok(result)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/UpdateDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/UpdateDictionaryController.cs deleted file mode 100644 index efe2214733..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/UpdateDictionaryController.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System.Net.Mime; -using System.Text; -using System.Text.Json; -using Json.Patch; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Serialization; -using Umbraco.Cms.Api.Management.Services; -using Umbraco.Cms.Api.Management.ViewModels.Dictionary; -using Umbraco.Cms.Api.Management.ViewModels.JsonPatch; -using Umbraco.New.Cms.Core.Factories; - -namespace Umbraco.Cms.Api.Management.Controllers.Dictionary; - -public class UpdateDictionaryController : DictionaryControllerBase -{ - private readonly ILocalizationService _localizationService; - private readonly IUmbracoMapper _umbracoMapper; - private readonly IDictionaryService _dictionaryService; - private readonly IDictionaryFactory _dictionaryFactory; - private readonly IJsonPatchService _jsonPatchService; - private readonly ISystemTextJsonSerializer _systemTextJsonSerializer; - - public UpdateDictionaryController( - ILocalizationService localizationService, - IUmbracoMapper umbracoMapper, - IDictionaryService dictionaryService, - IDictionaryFactory dictionaryFactory, - IJsonPatchService jsonPatchService, - ISystemTextJsonSerializer systemTextJsonSerializer) - { - _localizationService = localizationService; - _umbracoMapper = umbracoMapper; - _dictionaryService = dictionaryService; - _dictionaryFactory = dictionaryFactory; - _jsonPatchService = jsonPatchService; - _systemTextJsonSerializer = systemTextJsonSerializer; - } - - [HttpPatch("{id:Guid}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ContentResult), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)] - public async Task Update(Guid id, JsonPatchViewModel[] updateViewModel) - { - IDictionaryItem? dictionaryItem = _localizationService.GetDictionaryItemById(id); - - if (dictionaryItem is null) - { - return NotFound(); - } - - DictionaryViewModel dictionaryToPatch = _umbracoMapper.Map(dictionaryItem)!; - - PatchResult? result = _jsonPatchService.Patch(updateViewModel, dictionaryToPatch); - - if (result?.Result is null) - { - throw new JsonException("Could not patch the JsonPatchViewModel"); - } - - DictionaryViewModel? updatedDictionaryItem = _systemTextJsonSerializer.Deserialize(result.Result.ToJsonString()); - if (updatedDictionaryItem is null) - { - throw new JsonException("Could not serialize from PatchResult to DictionaryViewModel"); - } - - IDictionaryItem dictionaryToSave = _dictionaryFactory.CreateDictionaryItem(updatedDictionaryItem!); - _localizationService.Save(dictionaryToSave); - return await Task.FromResult(Content(_dictionaryService.CalculatePath(dictionaryToSave.ParentId, dictionaryToSave.Id), MediaTypeNames.Text.Plain, Encoding.UTF8)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/UploadDictionaryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/UploadDictionaryController.cs deleted file mode 100644 index 32156d21c0..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Dictionary/UploadDictionaryController.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Xml; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Models; -using Umbraco.Cms.Api.Management.Services; -using Umbraco.Cms.Api.Management.ViewModels.Dictionary; -using Umbraco.Extensions; -using Umbraco.New.Cms.Core.Factories; - -namespace Umbraco.Cms.Api.Management.Controllers.Dictionary; - -public class UploadDictionaryController : DictionaryControllerBase -{ - private readonly ILocalizedTextService _localizedTextService; - private readonly IUploadFileService _uploadFileService; - private readonly IDictionaryFactory _dictionaryFactory; - - public UploadDictionaryController(ILocalizedTextService localizedTextService, IUploadFileService uploadFileService, IDictionaryFactory dictionaryFactory) - { - _localizedTextService = localizedTextService; - _uploadFileService = uploadFileService; - _dictionaryFactory = dictionaryFactory; - } - - [HttpPost("upload")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(DictionaryImportViewModel), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - public async Task> Upload(IFormFile file) - { - FormFileUploadResult formFileUploadResult = _uploadFileService.TryLoad(file); - if (formFileUploadResult.CouldLoad is false || formFileUploadResult.XmlDocument is null) - { - return await Task.FromResult(ValidationProblem( - _localizedTextService.Localize("media", "failedFileUpload"), - formFileUploadResult.ErrorMessage)); - } - - DictionaryImportViewModel model = _dictionaryFactory.CreateDictionaryImportViewModel(formFileUploadResult); - - if (!model.DictionaryItems.Any()) - { - return ValidationProblem( - _localizedTextService.Localize("media", "failedFileUpload"), - _localizedTextService.Localize("dictionary", "noItemsInFile")); - } - - return await Task.FromResult(model); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/RecycleBin/ChildrenDocumentRecycleBinController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/RecycleBin/ChildrenDocumentRecycleBinController.cs deleted file mode 100644 index 412b6e3306..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/RecycleBin/ChildrenDocumentRecycleBinController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.RecycleBin; - -namespace Umbraco.Cms.Api.Management.Controllers.Document.RecycleBin; - -public class ChildrenDocumentRecycleBinController : DocumentRecycleBinControllerBase -{ - public ChildrenDocumentRecycleBinController(IEntityService entityService) - : base(entityService) - { - } - - [HttpGet("children")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Children(Guid parentKey, int skip = 0, int take = 100) - => await GetChildren(parentKey, skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/RecycleBin/DocumentRecycleBinControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/RecycleBin/DocumentRecycleBinControllerBase.cs deleted file mode 100644 index 222aac35db..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/RecycleBin/DocumentRecycleBinControllerBase.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Controllers.RecycleBin; -using Umbraco.Cms.Api.Management.Filters; -using Umbraco.Cms.Api.Management.ViewModels.RecycleBin; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Document.RecycleBin; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.RecycleBin}/{Constants.UdiEntityType.Document}")] -[RequireDocumentTreeRootAccess] -[ProducesResponseType(StatusCodes.Status401Unauthorized)] -[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Document))] -public class DocumentRecycleBinControllerBase : RecycleBinControllerBase -{ - public DocumentRecycleBinControllerBase(IEntityService entityService) - : base(entityService) - { - } - - protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.Document; - - protected override int RecycleBinRootId => Constants.System.RecycleBinContent; - - protected override RecycleBinItemViewModel MapRecycleBinViewModel(Guid? parentKey, IEntitySlim entity) - { - RecycleBinItemViewModel viewModel = base.MapRecycleBinViewModel(parentKey, entity); - - if (entity is IDocumentEntitySlim documentEntitySlim) - { - viewModel.Icon = documentEntitySlim.ContentTypeIcon ?? viewModel.Icon; - } - - return viewModel; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/RecycleBin/RootDocumentRecycleBinController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/RecycleBin/RootDocumentRecycleBinController.cs deleted file mode 100644 index 2d8a4ef8d5..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/RecycleBin/RootDocumentRecycleBinController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.RecycleBin; - -namespace Umbraco.Cms.Api.Management.Controllers.Document.RecycleBin; - -public class RootDocumentRecycleBinController : DocumentRecycleBinControllerBase -{ - public RootDocumentRecycleBinController(IEntityService entityService) - : base(entityService) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100) - => await GetRoot(skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/ChildrenDocumentTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/ChildrenDocumentTreeController.cs deleted file mode 100644 index 63361b2c67..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/ChildrenDocumentTreeController.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.Security; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Services.Entities; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Document.Tree; - -public class ChildrenDocumentTreeController : DocumentTreeControllerBase -{ - public ChildrenDocumentTreeController( - IEntityService entityService, - IUserStartNodeEntitiesService userStartNodeEntitiesService, - IDataTypeService dataTypeService, - IPublicAccessService publicAccessService, - AppCaches appCaches, - IBackOfficeSecurityAccessor backofficeSecurityAccessor) - : base(entityService, userStartNodeEntitiesService, dataTypeService, publicAccessService, appCaches, backofficeSecurityAccessor) - { - } - - [HttpGet("children")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Children(Guid parentKey, int skip = 0, int take = 100, Guid? dataTypeKey = null, string? culture = null) - { - IgnoreUserStartNodesForDataType(dataTypeKey); - RenderForClientCulture(culture); - return await GetChildren(parentKey, skip, take); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs deleted file mode 100644 index 2b8463de26..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/DocumentTreeControllerBase.cs +++ /dev/null @@ -1,93 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Security; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.Services.Entities; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Extensions; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Document.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Document}")] -[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Document))] -public abstract class DocumentTreeControllerBase : UserStartNodeTreeControllerBase -{ - private readonly IPublicAccessService _publicAccessService; - private readonly AppCaches _appCaches; - private readonly IBackOfficeSecurityAccessor _backofficeSecurityAccessor; - private string? _culture; - - protected DocumentTreeControllerBase( - IEntityService entityService, - IUserStartNodeEntitiesService userStartNodeEntitiesService, - IDataTypeService dataTypeService, - IPublicAccessService publicAccessService, - AppCaches appCaches, - IBackOfficeSecurityAccessor backofficeSecurityAccessor) - : base(entityService, userStartNodeEntitiesService, dataTypeService) - { - _publicAccessService = publicAccessService; - _appCaches = appCaches; - _backofficeSecurityAccessor = backofficeSecurityAccessor; - } - - protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.Document; - - protected override Ordering ItemOrdering => Ordering.By(nameof(Infrastructure.Persistence.Dtos.NodeDto.SortOrder)); - - protected void RenderForClientCulture(string? culture) => _culture = culture; - - protected override DocumentTreeItemViewModel MapTreeItemViewModel(Guid? parentKey, IEntitySlim entity) - { - DocumentTreeItemViewModel viewModel = base.MapTreeItemViewModel(parentKey, entity); - - if (entity is IDocumentEntitySlim documentEntitySlim) - { - viewModel.IsPublished = documentEntitySlim.Published; - viewModel.IsEdited = documentEntitySlim.Edited; - viewModel.Icon = documentEntitySlim.ContentTypeIcon ?? viewModel.Icon; - viewModel.IsProtected = _publicAccessService.IsProtected(entity.Path); - - if (_culture != null && documentEntitySlim.Variations.VariesByCulture()) - { - viewModel.Name = documentEntitySlim.CultureNames.TryGetValue(_culture, out var cultureName) - ? cultureName - : $"({viewModel.Name})"; - - viewModel.IsPublished = documentEntitySlim.PublishedCultures.Contains(_culture); - viewModel.IsEdited = documentEntitySlim.EditedCultures.Contains(_culture); - } - - viewModel.IsEdited &= viewModel.IsPublished; - } - - return viewModel; - } - - // TODO: delete these (faking start node setup for unlimited editor) - protected override int[] GetUserStartNodeIds() => new[] { -1 }; - - protected override string[] GetUserStartNodePaths() => Array.Empty(); - - // TODO: use these implementations instead of the dummy ones above once we have backoffice auth in place - // protected override int[] GetUserStartNodeIds() - // => _backofficeSecurityAccessor - // .BackOfficeSecurity? - // .CurrentUser? - // .CalculateContentStartNodeIds(EntityService, _appCaches) - // ?? Array.Empty(); - // - // protected override string[] GetUserStartNodePaths() - // => _backofficeSecurityAccessor - // .BackOfficeSecurity? - // .CurrentUser? - // .GetContentStartNodePaths(EntityService, _appCaches) - // ?? Array.Empty(); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/ItemsDocumentTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/ItemsDocumentTreeController.cs deleted file mode 100644 index 22fe695c36..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/ItemsDocumentTreeController.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.Security; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Services.Entities; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Document.Tree; - -public class ItemsDocumentTreeController : DocumentTreeControllerBase -{ - public ItemsDocumentTreeController( - IEntityService entityService, - IUserStartNodeEntitiesService userStartNodeEntitiesService, - IDataTypeService dataTypeService, - IPublicAccessService publicAccessService, - AppCaches appCaches, - IBackOfficeSecurityAccessor backofficeSecurityAccessor) - : base(entityService, userStartNodeEntitiesService, dataTypeService, publicAccessService, appCaches, backofficeSecurityAccessor) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "key")] Guid[] keys, Guid? dataTypeKey = null, string? culture = null) - { - IgnoreUserStartNodesForDataType(dataTypeKey); - RenderForClientCulture(culture); - return await GetItems(keys); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/RootDocumentTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/RootDocumentTreeController.cs deleted file mode 100644 index dfe51475a8..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/Tree/RootDocumentTreeController.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.Security; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Services.Entities; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Document.Tree; - -public class RootDocumentTreeController : DocumentTreeControllerBase -{ - public RootDocumentTreeController( - IEntityService entityService, - IUserStartNodeEntitiesService userStartNodeEntitiesService, - IDataTypeService dataTypeService, - IPublicAccessService publicAccessService, - AppCaches appCaches, - IBackOfficeSecurityAccessor backofficeSecurityAccessor) - : base(entityService, userStartNodeEntitiesService, dataTypeService, publicAccessService, appCaches, backofficeSecurityAccessor) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100, Guid? dataTypeKey = null, string? culture = null) - { - IgnoreUserStartNodesForDataType(dataTypeKey); - RenderForClientCulture(culture); - return await GetRoot(skip, take); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentBlueprint/Tree/DocumentBlueprintTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentBlueprint/Tree/DocumentBlueprintTreeControllerBase.cs deleted file mode 100644 index cd43bb8d4f..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentBlueprint/Tree/DocumentBlueprintTreeControllerBase.cs +++ /dev/null @@ -1,55 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.DocumentBlueprint.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.DocumentBlueprint}")] -[ApiExplorerSettings(GroupName = "Document Blueprint")] -public class DocumentBlueprintTreeControllerBase : EntityTreeControllerBase -{ - private readonly IContentTypeService _contentTypeService; - - public DocumentBlueprintTreeControllerBase(IEntityService entityService, IContentTypeService contentTypeService) - : base(entityService) => - _contentTypeService = contentTypeService; - - protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.DocumentBlueprint; - - protected override DocumentBlueprintTreeItemViewModel[] MapTreeItemViewModels(Guid? parentKey, IEntitySlim[] entities) - { - var contentTypeAliases = entities - .OfType() - .Select(entity => entity.ContentTypeAlias) - .ToArray(); - - var contentTypeIds = _contentTypeService.GetAllContentTypeIds(contentTypeAliases).ToArray(); - var contentTypeByAlias = _contentTypeService - .GetAll(contentTypeIds) - .ToDictionary(contentType => contentType.Alias); - - return entities.Select(entity => - { - DocumentBlueprintTreeItemViewModel viewModel = base.MapTreeItemViewModel(parentKey, entity); - viewModel.Icon = Constants.Icons.Blueprint; - viewModel.HasChildren = false; - - if (entity is IDocumentEntitySlim documentEntitySlim - && contentTypeByAlias.TryGetValue(documentEntitySlim.ContentTypeAlias, out IContentType? contentType)) - { - viewModel.DocumentTypeKey = contentType.Key; - viewModel.DocumentTypeAlias = contentType.Alias; - viewModel.DocumentTypeName = contentType.Name; - } - - return viewModel; - }).ToArray(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentBlueprint/Tree/ItemsDocumentBlueprintTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentBlueprint/Tree/ItemsDocumentBlueprintTreeController.cs deleted file mode 100644 index 0b9daed9c0..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentBlueprint/Tree/ItemsDocumentBlueprintTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.DocumentBlueprint.Tree; - -public class ItemsDocumentBlueprintTreeController : DocumentBlueprintTreeControllerBase -{ - public ItemsDocumentBlueprintTreeController(IEntityService entityService, IContentTypeService contentTypeService) - : base(entityService, contentTypeService) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "key")] Guid[] keys) - => await GetItems(keys); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentBlueprint/Tree/RootDocumentBlueprintTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentBlueprint/Tree/RootDocumentBlueprintTreeController.cs deleted file mode 100644 index 9df4a53723..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentBlueprint/Tree/RootDocumentBlueprintTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.DocumentBlueprint.Tree; - -public class RootDocumentBlueprintTreeController : DocumentBlueprintTreeControllerBase -{ - public RootDocumentBlueprintTreeController(IEntityService entityService, IContentTypeService contentTypeService) - : base(entityService, contentTypeService) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100) - => await GetRoot(skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Tree/ChildrenDocumentTypeTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Tree/ChildrenDocumentTypeTreeController.cs deleted file mode 100644 index f9e3971fa5..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Tree/ChildrenDocumentTypeTreeController.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.DocumentType.Tree; - -public class ChildrenDocumentTypeTreeController : DocumentTypeTreeControllerBase -{ - public ChildrenDocumentTypeTreeController(IEntityService entityService, IContentTypeService contentTypeService) - : base(entityService, contentTypeService) - { - } - - [HttpGet("children")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Children(Guid parentKey, int skip = 0, int take = 100, bool foldersOnly = false) - { - RenderFoldersOnly(foldersOnly); - return await GetChildren(parentKey, skip, take); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Tree/DocumentTypeTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Tree/DocumentTypeTreeControllerBase.cs deleted file mode 100644 index d0a0d27143..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Tree/DocumentTypeTreeControllerBase.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.DocumentType.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.DocumentType}")] -[ApiExplorerSettings(GroupName = "Document Type")] -public class DocumentTypeTreeControllerBase : FolderTreeControllerBase -{ - private readonly IContentTypeService _contentTypeService; - - public DocumentTypeTreeControllerBase(IEntityService entityService, IContentTypeService contentTypeService) - : base(entityService) => - _contentTypeService = contentTypeService; - - protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.DocumentType; - - protected override UmbracoObjectTypes FolderObjectType => UmbracoObjectTypes.DocumentTypeContainer; - - protected override DocumentTypeTreeItemViewModel[] MapTreeItemViewModels(Guid? parentKey, IEntitySlim[] entities) - { - var contentTypes = _contentTypeService - .GetAll(entities.Select(entity => entity.Id).ToArray()) - .ToDictionary(contentType => contentType.Id); - - return entities.Select(entity => - { - DocumentTypeTreeItemViewModel viewModel = MapTreeItemViewModel(parentKey, entity); - if (contentTypes.TryGetValue(entity.Id, out IContentType? contentType)) - { - viewModel.Icon = contentType.Icon ?? viewModel.Icon; - viewModel.IsElement = contentType.IsElement; - } - - return viewModel; - }).ToArray(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Tree/ItemsDocumentTypeTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Tree/ItemsDocumentTypeTreeController.cs deleted file mode 100644 index 411e5f7446..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Tree/ItemsDocumentTypeTreeController.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.DocumentType.Tree; - -public class ItemsDocumentTypeTreeController : DocumentTypeTreeControllerBase -{ - public ItemsDocumentTypeTreeController(IEntityService entityService, IContentTypeService contentTypeService) - : base(entityService, contentTypeService) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "key")] Guid[] keys) - => await GetItems(keys); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Tree/RootDocumentTypeTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Tree/RootDocumentTypeTreeController.cs deleted file mode 100644 index 23ba9ebc73..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/Tree/RootDocumentTypeTreeController.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.DocumentType.Tree; - -public class RootDocumentTypeTreeController : DocumentTypeTreeControllerBase -{ - public RootDocumentTypeTreeController(IEntityService entityService, IContentTypeService contentTypeService) - : base(entityService, contentTypeService) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100, bool foldersOnly = false) - { - RenderFoldersOnly(foldersOnly); - return await GetRoot(skip, take); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/ExecuteActionHealthCheckController.cs b/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/ExecuteActionHealthCheckController.cs deleted file mode 100644 index bdfef7dc39..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/ExecuteActionHealthCheckController.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Umbraco.Cms.Api.Management.ViewModels.HealthCheck; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.HealthChecks; -using Umbraco.Cms.Core.Mapping; - -namespace Umbraco.Cms.Api.Management.Controllers.HealthCheck; - -public class ExecuteActionHealthCheckController : HealthCheckControllerBase -{ - private readonly HealthCheckCollection _healthChecks; - private readonly IUmbracoMapper _umbracoMapper; - private readonly IList _disabledCheckIds; - - public ExecuteActionHealthCheckController( - HealthCheckCollection healthChecks, - IOptions healthChecksSettings, - IUmbracoMapper umbracoMapper) - { - _healthChecks = healthChecks; - _disabledCheckIds = healthChecksSettings.Value - .DisabledChecks - .Select(x => x.Id) - .ToList(); - _umbracoMapper = umbracoMapper; - } - - /// - /// Executes a given action from a HealthCheck. - /// - /// The action to be executed. - /// The result of a health check after the health check action is performed. - [HttpPost("execute-action")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(HealthCheckResultViewModel), StatusCodes.Status200OK)] - public async Task> ExecuteAction(HealthCheckActionViewModel action) - { - Guid healthCheckKey = action.HealthCheckKey; - - Core.HealthChecks.HealthCheck? healthCheck = _healthChecks - .Where(x => _disabledCheckIds.Contains(healthCheckKey) == false) - .FirstOrDefault(x => x.Id == healthCheckKey); - - if (healthCheck is null) - { - var invalidModelProblem = new ProblemDetails - { - Title = "Health Check Not Found", - Detail = $"No health check found with key = {healthCheckKey}", - Status = StatusCodes.Status400BadRequest, - Type = "Error", - }; - - return await Task.FromResult(BadRequest(invalidModelProblem)); - } - - HealthCheckStatus result = healthCheck.ExecuteAction(_umbracoMapper.Map(action)!); - - return await Task.FromResult(Ok(_umbracoMapper.Map(result))); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/AllHealthCheckGroupController.cs b/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/AllHealthCheckGroupController.cs deleted file mode 100644 index a4f8d91c4c..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/AllHealthCheckGroupController.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.Cms.Api.Management.ViewModels.HealthCheck; -using Umbraco.Cms.Core.HealthChecks; -using Umbraco.Cms.Core.Mapping; - -namespace Umbraco.Cms.Api.Management.Controllers.HealthCheck.Group; - -public class AllHealthCheckGroupController : HealthCheckGroupControllerBase -{ - private readonly HealthCheckCollection _healthChecks; - private readonly IHealthCheckGroupWithResultViewModelFactory _healthCheckGroupWithResultViewModelFactory; - private readonly IUmbracoMapper _umbracoMapper; - - public AllHealthCheckGroupController( - HealthCheckCollection healthChecks, - IHealthCheckGroupWithResultViewModelFactory healthCheckGroupWithResultViewModelFactory, - IUmbracoMapper umbracoMapper) - { - _healthChecks = healthChecks; - _healthCheckGroupWithResultViewModelFactory = healthCheckGroupWithResultViewModelFactory; - _umbracoMapper = umbracoMapper; - } - - /// - /// Gets a paginated grouped list of all health checks without checking the result of each health check. - /// - /// The amount of items to skip. - /// The amount of items to take. - /// The paged result of health checks, grouped by health check group name. - [HttpGet] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> All(int skip = 0, int take = 100) - { - IEnumerable> groups = _healthCheckGroupWithResultViewModelFactory - .CreateGroupingFromHealthCheckCollection(_healthChecks) - .Skip(skip) - .Take(take); - - return await Task.FromResult(Ok(_umbracoMapper.Map>(groups))); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/ByNameWithResultHealthCheckGroupController.cs b/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/ByNameWithResultHealthCheckGroupController.cs deleted file mode 100644 index 14965ea926..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/ByNameWithResultHealthCheckGroupController.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.Cms.Api.Management.ViewModels.HealthCheck; -using Umbraco.Cms.Core.HealthChecks; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Controllers.HealthCheck.Group; - -public class ByNameWithResultHealthCheckGroupController : HealthCheckGroupControllerBase -{ - private readonly HealthCheckCollection _healthChecks; - private readonly IHealthCheckGroupWithResultViewModelFactory _healthCheckGroupWithResultViewModelFactory; - - public ByNameWithResultHealthCheckGroupController( - HealthCheckCollection healthChecks, - IHealthCheckGroupWithResultViewModelFactory healthCheckGroupWithResultViewModelFactory) - { - _healthChecks = healthChecks; - _healthCheckGroupWithResultViewModelFactory = healthCheckGroupWithResultViewModelFactory; - } - - /// - /// Gets a health check group with all its health checks by a group name. - /// - /// The name of the group. - /// The health check result(s) will be included as part of the health checks. - /// The health check group or not found result. - [HttpGet("{name}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(HealthCheckGroupWithResultViewModel), StatusCodes.Status200OK)] - public async Task> ByName(string name) - { - IEnumerable> groups = _healthCheckGroupWithResultViewModelFactory - .CreateGroupingFromHealthCheckCollection(_healthChecks); - - IGrouping? group = groups.FirstOrDefault(x => x.Key.InvariantEquals(name.Trim())); - - if (group is null) - { - return await Task.FromResult(NotFound()); - } - - return await Task.FromResult(Ok(_healthCheckGroupWithResultViewModelFactory.CreateHealthCheckGroupWithResultViewModel(group))); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/HealthCheckGroupControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/HealthCheckGroupControllerBase.cs deleted file mode 100644 index 06731d32e1..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/Group/HealthCheckGroupControllerBase.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; -using Constants = Umbraco.Cms.Core.Constants; - -namespace Umbraco.Cms.Api.Management.Controllers.HealthCheck.Group; - -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.HealthChecks.RoutePath.HealthCheck}-group")] -[ApiExplorerSettings(GroupName = "Health Check")] -[ApiVersion("1.0")] -public abstract class HealthCheckGroupControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/HealthCheckControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/HealthCheckControllerBase.cs deleted file mode 100644 index c5681f3323..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/HealthCheck/HealthCheckControllerBase.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; -using Constants = Umbraco.Cms.Core.Constants; - -namespace Umbraco.Cms.Api.Management.Controllers.HealthCheck; - -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.HealthChecks.RoutePath.HealthCheck}")] -[ApiExplorerSettings(GroupName = "Health Check")] -[ApiVersion("1.0")] -public abstract class HealthCheckControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Help/GetHelpController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Help/GetHelpController.cs deleted file mode 100644 index 1db67b14f7..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Help/GetHelpController.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.Serialization; -using Umbraco.Cms.Api.Common.Builders; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.Cms.Api.Management.ViewModels.Help; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; - -namespace Umbraco.Cms.Api.Management.Controllers.Help; - -public class GetHelpController : HelpControllerBase -{ - private readonly ILogger _logger; - private readonly IJsonSerializer _jsonSerializer; - private HelpPageSettings _helpPageSettings; - - public GetHelpController( - IOptionsMonitor helpPageSettings, - ILogger logger, - IJsonSerializer jsonSerializer) - { - _logger = logger; - _jsonSerializer = jsonSerializer; - _helpPageSettings = helpPageSettings.CurrentValue; - helpPageSettings.OnChange(UpdateHelpPageSettings); - } - - private void UpdateHelpPageSettings(HelpPageSettings settings) => _helpPageSettings = settings; - - [HttpGet] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task Get(string section, string? tree, int skip, int take, string? baseUrl = "https://our.umbraco.com") - { - if (IsAllowedUrl(baseUrl) is false) - { - _logger.LogError($"The following URL is not listed in the allowlist for HelpPage in HelpPageSettings: {baseUrl}"); - - ProblemDetails invalidModelProblem = - new ProblemDetailsBuilder() - .WithTitle("Invalid database configuration") - .WithDetail("The provided database configuration is invalid") - .Build(); - - return BadRequest(invalidModelProblem); - } - - var url = string.Format(baseUrl + "/Umbraco/Documentation/Lessons/GetContextHelpDocs?sectionAlias={0}&treeAlias={1}", section, tree); - - try - { - var httpClient = new HttpClient(); - - // fetch dashboard json and parse to JObject - var json = await httpClient.GetStringAsync(url); - List? result = _jsonSerializer.Deserialize>(json); - if (result != null) - { - return Ok(new PagedViewModel - { - Total = result.Count, - Items = result.Skip(skip).Take(take), - }); - } - } - catch (HttpRequestException rex) - { - _logger.LogInformation($"Check your network connection, exception: {rex.Message}"); - } - - return Ok(PagedViewModel.Empty()); - } - - private bool IsAllowedUrl(string? url) => - _helpPageSettings.HelpPageUrlAllowList is null || _helpPageSettings.HelpPageUrlAllowList.Contains(url); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Help/HelpControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Help/HelpControllerBase.cs deleted file mode 100644 index f09e424a31..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Help/HelpControllerBase.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Help; - -[ApiController] -[VersionedApiBackOfficeRoute("help")] -[ApiExplorerSettings(GroupName = "Help")] -[ApiVersion("1.0")] -public abstract class HelpControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Indexer/AllIndexerController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Indexer/AllIndexerController.cs deleted file mode 100644 index 9e62a225ff..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Indexer/AllIndexerController.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Examine; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Search; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Controllers.Indexer; - -[ApiVersion("1.0")] -public class AllIndexerController : IndexerControllerBase -{ - private readonly IExamineManager _examineManager; - private readonly IIndexViewModelFactory _indexViewModelFactory; - - public AllIndexerController( - IExamineManager examineManager, - IIndexViewModelFactory indexViewModelFactory) - { - _examineManager = examineManager; - _indexViewModelFactory = indexViewModelFactory; - } - - /// - /// Get the details for indexers - /// - /// - [HttpGet] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public Task> All(int skip, int take) - { - IndexViewModel[] indexes = _examineManager.Indexes - .Select(_indexViewModelFactory.Create) - .OrderBy(indexModel => indexModel.Name.TrimEnd("Indexer")).ToArray(); - - var viewModel = new PagedViewModel { Items = indexes.Skip(skip).Take(take), Total = indexes.Length }; - return Task.FromResult(viewModel); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Indexer/DetailsIndexerController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Indexer/DetailsIndexerController.cs deleted file mode 100644 index 7275993fd2..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Indexer/DetailsIndexerController.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Examine; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.Cms.Api.Management.ViewModels.Search; - -namespace Umbraco.Cms.Api.Management.Controllers.Indexer; - -[ApiVersion("1.0")] -public class DetailsIndexerController : IndexerControllerBase -{ - private readonly IIndexViewModelFactory _indexViewModelFactory; - private readonly IExamineManager _examineManager; - - public DetailsIndexerController( - IIndexViewModelFactory indexViewModelFactory, - IExamineManager examineManager) - { - _indexViewModelFactory = indexViewModelFactory; - _examineManager = examineManager; - } - - /// - /// Check if the index has been rebuilt - /// - /// - /// - /// - /// This is kind of rudimentary since there's no way we can know that the index has rebuilt, we - /// have a listener for the index op complete so we'll just check if that key is no longer there in the runtime cache - /// - [HttpGet("{indexName}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(IndexViewModel), StatusCodes.Status200OK)] - public async Task> Details(string indexName) - { - if (_examineManager.TryGetIndex(indexName, out IIndex? index)) - { - return await Task.FromResult(_indexViewModelFactory.Create(index!)); - } - - var invalidModelProblem = new ProblemDetails - { - Title = "Index Not Found", - Detail = $"No index found with name = {indexName}", - Status = StatusCodes.Status400BadRequest, - Type = "Error", - }; - - return await Task.FromResult(BadRequest(invalidModelProblem)); - - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Indexer/IndexerControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Indexer/IndexerControllerBase.cs deleted file mode 100644 index 7d41b6c2ef..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Indexer/IndexerControllerBase.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Indexer; - -[ApiController] -[VersionedApiBackOfficeRoute("indexer")] -[ApiExplorerSettings(GroupName = "Indexer")] -public class IndexerControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Indexer/RebuildIndexerController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Indexer/RebuildIndexerController.cs deleted file mode 100644 index 4d2b51fd87..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Indexer/RebuildIndexerController.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Examine; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using Umbraco.Cms.Infrastructure.Examine; -using Umbraco.New.Cms.Infrastructure.Services; - -namespace Umbraco.Cms.Api.Management.Controllers.Indexer; - -[ApiVersion("1.0")] -public class RebuildIndexerController : IndexerControllerBase -{ - private readonly ILogger _logger; - private readonly IIndexingRebuilderService _indexingRebuilderService; - private readonly IExamineManager _examineManager; - - public RebuildIndexerController( - ILogger logger, - IIndexingRebuilderService indexingRebuilderService, - IExamineManager examineManager) - { - _logger = logger; - _indexingRebuilderService = indexingRebuilderService; - _examineManager = examineManager; - } - - /// - /// Rebuilds the index - /// - /// - /// - [HttpPost("{indexName}/rebuild")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(OkResult), StatusCodes.Status200OK)] - public async Task Rebuild(string indexName) - { - if (!_examineManager.TryGetIndex(indexName, out var index)) - { - var invalidModelProblem = new ProblemDetails - { - Title = "Index Not Found", - Detail = $"No index found with name = {indexName}", - Status = StatusCodes.Status400BadRequest, - Type = "Error", - }; - - return await Task.FromResult(BadRequest(invalidModelProblem)); - } - - if (!_indexingRebuilderService.CanRebuild(index.Name)) - { - var invalidModelProblem = new ProblemDetails - { - Title = "Could not validate the populator", - Detail = - $"The index {index?.Name} could not be rebuilt because we could not validate its associated {typeof(IIndexPopulator)}", - Status = StatusCodes.Status400BadRequest, - Type = "Error", - }; - - return await Task.FromResult(BadRequest(invalidModelProblem)); - } - - _logger.LogInformation("Rebuilding index '{IndexName}'", indexName); - - if (_indexingRebuilderService.TryRebuild(index, indexName)) - { - return await Task.FromResult(Ok()); - } - - var problemDetails = new ProblemDetails - { - Title = "Index could not be rebuilt", - Detail = $"The index {index.Name} could not be rebuild. Check the log for details on this error.", - Status = StatusCodes.Status400BadRequest, - Type = "Error", - }; - - return await Task.FromResult(Conflict(problemDetails)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Install/InstallControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Install/InstallControllerBase.cs deleted file mode 100644 index 52fcd0e62e..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Install/InstallControllerBase.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Api.Management.Filters; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Install; - -[ApiController] -[VersionedApiBackOfficeRoute("install")] -[ApiExplorerSettings(GroupName = "Install")] -[RequireRuntimeLevel(RuntimeLevel.Install)] -public abstract class InstallControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Install/SettingsInstallController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Install/SettingsInstallController.cs deleted file mode 100644 index b60d4788cb..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Install/SettingsInstallController.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Infrastructure.Install; -using Umbraco.Cms.Api.Management.ViewModels.Installer; -using Umbraco.New.Cms.Core.Factories; -using Umbraco.New.Cms.Core.Models.Installer; - -namespace Umbraco.Cms.Api.Management.Controllers.Install; - -[ApiVersion("1.0")] -public class SettingsInstallController : InstallControllerBase -{ - private readonly InstallHelper _installHelper; - private readonly IInstallSettingsFactory _installSettingsFactory; - private readonly IUmbracoMapper _mapper; - - public SettingsInstallController( - InstallHelper installHelper, - IInstallSettingsFactory installSettingsFactory, - IUmbracoMapper mapper) - { - _installHelper = installHelper; - _installSettingsFactory = installSettingsFactory; - _mapper = mapper; - } - - [HttpGet("settings")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)] - [ProducesResponseType(typeof(InstallSettingsViewModel), StatusCodes.Status200OK)] - public async Task> Settings() - { - // Register that the install has started - await _installHelper.SetInstallStatusAsync(false, string.Empty); - - InstallSettingsModel installSettings = _installSettingsFactory.GetInstallSettings(); - InstallSettingsViewModel viewModel = _mapper.Map(installSettings)!; - - return viewModel; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Install/SetupInstallController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Install/SetupInstallController.cs deleted file mode 100644 index 8e13fb2cfb..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Install/SetupInstallController.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.Hosting; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Api.Management.ViewModels.Installer; -using Umbraco.Extensions; -using Umbraco.New.Cms.Core.Models.Installer; -using Umbraco.New.Cms.Core.Services.Installer; - -namespace Umbraco.Cms.Api.Management.Controllers.Install; - -[ApiVersion("1.0")] -public class SetupInstallController : InstallControllerBase -{ - private readonly IUmbracoMapper _mapper; - private readonly IInstallService _installService; - private readonly IHostingEnvironment _hostingEnvironment; - private readonly GlobalSettings _globalSettings; - - public SetupInstallController( - IUmbracoMapper mapper, - IInstallService installService, - IOptions globalSettings, - IHostingEnvironment hostingEnvironment) - { - _mapper = mapper; - _installService = installService; - _hostingEnvironment = hostingEnvironment; - _globalSettings = globalSettings.Value; - } - - [HttpPost("setup")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)] - [ProducesResponseType(StatusCodes.Status200OK)] - public async Task Setup(InstallViewModel installData) - { - InstallData data = _mapper.Map(installData)!; - await _installService.Install(data); - - var backOfficePath = _globalSettings.GetBackOfficePath(_hostingEnvironment); - return Created(backOfficePath, null); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Install/ValidateDatabaseInstallController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Install/ValidateDatabaseInstallController.cs deleted file mode 100644 index 16e40f1eae..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Install/ValidateDatabaseInstallController.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Install.Models; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Infrastructure.Migrations.Install; -using Umbraco.Cms.Api.Management.ViewModels.Installer; - -namespace Umbraco.Cms.Api.Management.Controllers.Install; - -[ApiVersion("1.0")] -public class ValidateDatabaseInstallController : InstallControllerBase -{ - private readonly DatabaseBuilder _databaseBuilder; - private readonly IUmbracoMapper _mapper; - - public ValidateDatabaseInstallController( - DatabaseBuilder databaseBuilder, - IUmbracoMapper mapper) - { - _databaseBuilder = databaseBuilder; - _mapper = mapper; - } - - [HttpPost("validate-database")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status200OK)] - public async Task ValidateDatabase(DatabaseInstallViewModel viewModel) - { - DatabaseModel databaseModel = _mapper.Map(viewModel)!; - - var success = _databaseBuilder.ConfigureDatabaseConnection(databaseModel, true); - - if (success) - { - return await Task.FromResult(Ok()); - } - - var invalidModelProblem = new ProblemDetails - { - Title = "Invalid database configuration", - Detail = "The provided database configuration is invalid", - Status = StatusCodes.Status400BadRequest, - Type = "Error", - }; - - return await Task.FromResult(BadRequest(invalidModelProblem)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Language/AllLanguageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Language/AllLanguageController.cs deleted file mode 100644 index e2d0ec7f6c..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Language/AllLanguageController.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Language; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.New.Cms.Core.Models; - -namespace Umbraco.Cms.Api.Management.Controllers.Language; - -public class AllLanguageController : LanguageControllerBase -{ - private readonly ILocalizationService _localizationService; - private readonly IUmbracoMapper _umbracoMapper; - - public AllLanguageController(ILocalizationService localizationService, IUmbracoMapper umbracoMapper) - { - _localizationService = localizationService; - _umbracoMapper = umbracoMapper; - } - - /// 1 - /// Returns all currently configured languages. - /// - /// - [HttpGet] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> GetAll(int skip, int take) - { - PagedModel allLanguages = _localizationService.GetAllLanguagesPaged(skip, take); - - return await Task.FromResult(_umbracoMapper.Map, PagedViewModel>(allLanguages)!); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Language/ByIdLanguageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Language/ByIdLanguageController.cs deleted file mode 100644 index f9b823b440..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Language/ByIdLanguageController.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Language; - -namespace Umbraco.Cms.Api.Management.Controllers.Language; - -public class ByIdLanguageController : LanguageControllerBase -{ - private readonly ILocalizationService _localizationService; - private readonly IUmbracoMapper _umbracoMapper; - - public ByIdLanguageController(ILocalizationService localizationService, IUmbracoMapper umbracoMapper) - { - _localizationService = localizationService; - _umbracoMapper = umbracoMapper; - } - - [HttpGet("{id:int}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)] - [ProducesResponseType(StatusCodes.Status200OK)] - public async Task> ById(int id) - { - ILanguage? lang = _localizationService.GetLanguageById(id); - if (lang is null) - { - return NotFound(); - } - - return await Task.FromResult(_umbracoMapper.Map(lang)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Language/CreateLanguageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Language/CreateLanguageController.cs deleted file mode 100644 index 720182ccce..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Language/CreateLanguageController.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.Globalization; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Language; -using Umbraco.New.Cms.Core.Services.Installer; - -namespace Umbraco.Cms.Api.Management.Controllers.Language; - -public class CreateLanguageController : LanguageControllerBase -{ - private readonly ILanguageService _languageService; - private readonly IUmbracoMapper _umbracoMapper; - private readonly ILocalizationService _localizationService; - - public CreateLanguageController(ILanguageService languageService, IUmbracoMapper umbracoMapper, ILocalizationService localizationService) - { - _languageService = languageService; - _umbracoMapper = umbracoMapper; - _localizationService = localizationService; - } - - /// - /// Creates or saves a language - /// - [HttpPost] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status201Created)] - // TODO: This needs to be an authorized endpoint. - public async Task Create(LanguageViewModel language) - { - if (_languageService.LanguageAlreadyExists(language.Id, language.IsoCode)) - { - // Someone is trying to create a language that already exist - ModelState.AddModelError("IsoCode", "The language " + language.IsoCode + " already exists"); - return ValidationProblem(ModelState); - } - - // Creating a new lang... - CultureInfo culture; - try - { - culture = CultureInfo.GetCultureInfo(language.IsoCode); - } - catch (CultureNotFoundException) - { - ModelState.AddModelError("IsoCode", "No Culture found with name " + language.IsoCode); - return ValidationProblem(ModelState); - } - - language.Name ??= culture.EnglishName; - - ILanguage newLang = _umbracoMapper.Map(language)!; - - _localizationService.Save(newLang); - return await Task.FromResult(Created($"api/v1.0/language/{newLang.Id}", null)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Language/DeleteLanguageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Language/DeleteLanguageController.cs deleted file mode 100644 index 35b16628de..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Language/DeleteLanguageController.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.Builders; - -namespace Umbraco.Cms.Api.Management.Controllers.Language; - -public class DeleteLanguageController : LanguageControllerBase -{ - private readonly ILocalizationService _localizationService; - - public DeleteLanguageController(ILocalizationService localizationService) => _localizationService = localizationService; - - /// - /// Deletes a language with a given ID - /// - [HttpDelete("{id:int}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - [ProducesResponseType(StatusCodes.Status200OK)] - // TODO: This needs to be an authorized endpoint. - public async Task Delete(int id) - { - ILanguage? language = _localizationService.GetLanguageById(id); - if (language == null) - { - return await Task.FromResult(NotFound()); - } - - // the service would not let us do it, but test here nevertheless - if (language.IsDefault) - { - ProblemDetails invalidModelProblem = - new ProblemDetailsBuilder() - .WithTitle("Cannot delete default language") - .WithDetail($"Language '{language.IsoCode}' is currently set to 'default' and can not be deleted.") - .Build(); - - return BadRequest(invalidModelProblem); - } - - // service is happy deleting a language that's fallback for another language, - // will just remove it - so no need to check here - _localizationService.Delete(language); - - return await Task.FromResult(Ok()); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Language/LanguageControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Language/LanguageControllerBase.cs deleted file mode 100644 index df6cad192c..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Language/LanguageControllerBase.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Language; - -[ApiController] -[VersionedApiBackOfficeRoute("language")] -[ApiExplorerSettings(GroupName = "Language")] -[ApiVersion("1.0")] -public abstract class LanguageControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Language/UpdateLanguageController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Language/UpdateLanguageController.cs deleted file mode 100644 index 2452d6468e..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Language/UpdateLanguageController.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Language; -using Umbraco.New.Cms.Core.Services.Installer; - -namespace Umbraco.Cms.Api.Management.Controllers.Language; - -public class UpdateLanguageController : LanguageControllerBase -{ - private readonly ILanguageService _languageService; - private readonly IUmbracoMapper _umbracoMapper; - private readonly ILocalizationService _localizationService; - - public UpdateLanguageController(ILanguageService languageService, IUmbracoMapper umbracoMapper, ILocalizationService localizationService) - { - _languageService = languageService; - _umbracoMapper = umbracoMapper; - _localizationService = localizationService; - } - - /// - /// Updates a language - /// - [HttpPut("{id:int}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status200OK)] - // TODO: This needs to be an authorized endpoint. - public async Task Update(int id, LanguageViewModel language) - { - ILanguage? existingById = _localizationService.GetLanguageById(id); - if (existingById is null) - { - return await Task.FromResult(NotFound()); - } - - // note that the service will prevent the default language from being "un-defaulted" - // but does not hurt to test here - though the UI should prevent it too - if (existingById.IsDefault && !language.IsDefault) - { - ModelState.AddModelError("IsDefault", "Cannot un-default the default language."); - return await Task.FromResult(ValidationProblem(ModelState)); - } - - existingById = _umbracoMapper.Map(language, existingById); - - if (!_languageService.CanUseLanguagesFallbackLanguage(existingById)) - { - ModelState.AddModelError("FallbackLanguage", "The selected fall back language does not exist."); - return await Task.FromResult(ValidationProblem(ModelState)); - } - - if (!_languageService.CanGetProperFallbackLanguage(existingById)) - { - ModelState.AddModelError("FallbackLanguage", $"The selected fall back language {_localizationService.GetLanguageById(existingById.FallbackLanguageId!.Value)} would create a circular path."); - return await Task.FromResult(ValidationProblem(ModelState)); - } - - _localizationService.Save(existingById); - return await Task.FromResult(Ok()); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/ManagementApiControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/ManagementApiControllerBase.cs deleted file mode 100644 index 70b5328517..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/ManagementApiControllerBase.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Common.Filters; -using Umbraco.New.Cms.Core; - -namespace Umbraco.Cms.Api.Management.Controllers; - -[JsonOptionsName(Constants.JsonOptionsNames.BackOffice)] -public class ManagementApiControllerBase : Controller -{ - -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/RecycleBin/ChildrenMediaRecycleBinController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/RecycleBin/ChildrenMediaRecycleBinController.cs deleted file mode 100644 index b91c4e61d7..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/RecycleBin/ChildrenMediaRecycleBinController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.RecycleBin; - -namespace Umbraco.Cms.Api.Management.Controllers.Media.RecycleBin; - -public class ChildrenMediaRecycleBinController : MediaRecycleBinControllerBase -{ - public ChildrenMediaRecycleBinController(IEntityService entityService) - : base(entityService) - { - } - - [HttpGet("children")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Children(Guid parentKey, int skip = 0, int take = 100) - => await GetChildren(parentKey, skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/RecycleBin/MediaRecycleBinControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/RecycleBin/MediaRecycleBinControllerBase.cs deleted file mode 100644 index 82756051b7..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/RecycleBin/MediaRecycleBinControllerBase.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Controllers.RecycleBin; -using Umbraco.Cms.Api.Management.Filters; -using Umbraco.Cms.Api.Management.ViewModels.RecycleBin; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Media.RecycleBin; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.RecycleBin}/{Constants.UdiEntityType.Media}")] -[RequireMediaTreeRootAccess] -[ProducesResponseType(StatusCodes.Status401Unauthorized)] -[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Media))] -public class MediaRecycleBinControllerBase : RecycleBinControllerBase -{ - public MediaRecycleBinControllerBase(IEntityService entityService) - : base(entityService) - { - } - - protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.Media; - - protected override int RecycleBinRootId => Constants.System.RecycleBinMedia; - - protected override RecycleBinItemViewModel MapRecycleBinViewModel(Guid? parentKey, IEntitySlim entity) - { - RecycleBinItemViewModel viewModel = base.MapRecycleBinViewModel(parentKey, entity); - - if (entity is IMediaEntitySlim mediaEntitySlim) - { - viewModel.Icon = mediaEntitySlim.ContentTypeIcon ?? viewModel.Icon; - } - - return viewModel; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/RecycleBin/RootMediaRecycleBinController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/RecycleBin/RootMediaRecycleBinController.cs deleted file mode 100644 index 5379fec5c3..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/RecycleBin/RootMediaRecycleBinController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.RecycleBin; - -namespace Umbraco.Cms.Api.Management.Controllers.Media.RecycleBin; - -public class RootMediaRecycleBinController : MediaRecycleBinControllerBase -{ - public RootMediaRecycleBinController(IEntityService entityService) - : base(entityService) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100) - => await GetRoot(skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/Tree/ChildrenMediaTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/Tree/ChildrenMediaTreeController.cs deleted file mode 100644 index 51fc8dfee5..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/Tree/ChildrenMediaTreeController.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.Security; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Services.Entities; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Media.Tree; - -public class ChildrenMediaTreeController : MediaTreeControllerBase -{ - public ChildrenMediaTreeController( - IEntityService entityService, - IUserStartNodeEntitiesService userStartNodeEntitiesService, - IDataTypeService dataTypeService, - AppCaches appCaches, - IBackOfficeSecurityAccessor backofficeSecurityAccessor) - : base(entityService, userStartNodeEntitiesService, dataTypeService, appCaches, backofficeSecurityAccessor) - { - } - - [HttpGet("children")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Children(Guid parentKey, int skip = 0, int take = 100, Guid? dataTypeKey = null) - { - IgnoreUserStartNodesForDataType(dataTypeKey); - return await GetChildren(parentKey, skip, take); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/Tree/ItemsMediaTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/Tree/ItemsMediaTreeController.cs deleted file mode 100644 index 4305ec4cab..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/Tree/ItemsMediaTreeController.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.Security; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Services.Entities; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Media.Tree; - -public class ItemsMediaTreeController : MediaTreeControllerBase -{ - public ItemsMediaTreeController( - IEntityService entityService, - IUserStartNodeEntitiesService userStartNodeEntitiesService, - IDataTypeService dataTypeService, - AppCaches appCaches, - IBackOfficeSecurityAccessor backofficeSecurityAccessor) - : base(entityService, userStartNodeEntitiesService, dataTypeService, appCaches, backofficeSecurityAccessor) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "key")] Guid[] keys, Guid? dataTypeKey = null) - { - IgnoreUserStartNodesForDataType(dataTypeKey); - return await GetItems(keys); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/Tree/MediaTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/Tree/MediaTreeControllerBase.cs deleted file mode 100644 index b3a2769e87..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/Tree/MediaTreeControllerBase.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Security; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.Services.Entities; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Media.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Media}")] -[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Media))] -public class MediaTreeControllerBase : UserStartNodeTreeControllerBase -{ - private readonly AppCaches _appCaches; - private readonly IBackOfficeSecurityAccessor _backofficeSecurityAccessor; - - public MediaTreeControllerBase( - IEntityService entityService, - IUserStartNodeEntitiesService userStartNodeEntitiesService, - IDataTypeService dataTypeService, - AppCaches appCaches, - IBackOfficeSecurityAccessor backofficeSecurityAccessor) - : base(entityService, userStartNodeEntitiesService, dataTypeService) - { - _appCaches = appCaches; - _backofficeSecurityAccessor = backofficeSecurityAccessor; - } - - protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.Media; - - protected override Ordering ItemOrdering => Ordering.By(nameof(Infrastructure.Persistence.Dtos.NodeDto.SortOrder)); - - protected override ContentTreeItemViewModel MapTreeItemViewModel(Guid? parentKey, IEntitySlim entity) - { - ContentTreeItemViewModel viewModel = base.MapTreeItemViewModel(parentKey, entity); - - if (entity is IMediaEntitySlim mediaEntitySlim) - { - viewModel.Icon = mediaEntitySlim.ContentTypeIcon ?? viewModel.Icon; - } - - return viewModel; - } - - // TODO: delete these (faking start node setup for unlimited editor) - protected override int[] GetUserStartNodeIds() => new[] { -1 }; - - protected override string[] GetUserStartNodePaths() => Array.Empty(); - - // TODO: use these implementations instead of the dummy ones above once we have backoffice auth in place - // protected override int[] GetUserStartNodeIds() - // => _backofficeSecurityAccessor - // .BackOfficeSecurity? - // .CurrentUser? - // .CalculateMediaStartNodeIds(EntityService, _appCaches) - // ?? Array.Empty(); - // - // protected override string[] GetUserStartNodePaths() - // => _backofficeSecurityAccessor - // .BackOfficeSecurity? - // .CurrentUser? - // .GetMediaStartNodePaths(EntityService, _appCaches) - // ?? Array.Empty(); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/Tree/RootMediaTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/Tree/RootMediaTreeController.cs deleted file mode 100644 index 31d07715b6..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/Tree/RootMediaTreeController.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.Security; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Services.Entities; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Media.Tree; - -public class RootMediaTreeController : MediaTreeControllerBase -{ - public RootMediaTreeController( - IEntityService entityService, - IUserStartNodeEntitiesService userStartNodeEntitiesService, - IDataTypeService dataTypeService, - AppCaches appCaches, - IBackOfficeSecurityAccessor backofficeSecurityAccessor) - : base(entityService, userStartNodeEntitiesService, dataTypeService, appCaches, backofficeSecurityAccessor) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100, Guid? dataTypeKey = null) - { - IgnoreUserStartNodesForDataType(dataTypeKey); - return await GetRoot(skip, take); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/Tree/ChildrenMediaTypeTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/MediaType/Tree/ChildrenMediaTypeTreeController.cs deleted file mode 100644 index 4e8ceee792..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/Tree/ChildrenMediaTypeTreeController.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.MediaType.Tree; - -public class ChildrenMediaTypeTreeController : MediaTypeTreeControllerBase -{ - public ChildrenMediaTypeTreeController(IEntityService entityService, IMediaTypeService mediaTypeService) - : base(entityService, mediaTypeService) - { - } - - [HttpGet("children")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Children(Guid parentKey, int skip = 0, int take = 100, bool foldersOnly = false) - { - RenderFoldersOnly(foldersOnly); - return await GetChildren(parentKey, skip, take); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/Tree/ItemsMediaTypeTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/MediaType/Tree/ItemsMediaTypeTreeController.cs deleted file mode 100644 index 881276da3e..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/Tree/ItemsMediaTypeTreeController.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.MediaType.Tree; - -public class ItemsMediaTypeTreeController : MediaTypeTreeControllerBase -{ - public ItemsMediaTypeTreeController(IEntityService entityService, IMediaTypeService mediaTypeService) - : base(entityService, mediaTypeService) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "key")] Guid[] keys) - => await GetItems(keys); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/Tree/MediaTypeTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/MediaType/Tree/MediaTypeTreeControllerBase.cs deleted file mode 100644 index 63aeb0390d..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/Tree/MediaTypeTreeControllerBase.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.MediaType.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.MediaType}")] -[ApiExplorerSettings(GroupName = "Media Type")] -public class MediaTypeTreeControllerBase : FolderTreeControllerBase -{ - private readonly IMediaTypeService _mediaTypeService; - - public MediaTypeTreeControllerBase(IEntityService entityService, IMediaTypeService mediaTypeService) - : base(entityService) => - _mediaTypeService = mediaTypeService; - - protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.MediaType; - - protected override UmbracoObjectTypes FolderObjectType => UmbracoObjectTypes.MediaTypeContainer; - - protected override FolderTreeItemViewModel[] MapTreeItemViewModels(Guid? parentKey, IEntitySlim[] entities) - { - var mediaTypes = _mediaTypeService - .GetAll(entities.Select(entity => entity.Id).ToArray()) - .ToDictionary(contentType => contentType.Id); - - return entities.Select(entity => - { - FolderTreeItemViewModel viewModel = MapTreeItemViewModel(parentKey, entity); - if (mediaTypes.TryGetValue(entity.Id, out IMediaType? mediaType)) - { - viewModel.Icon = mediaType.Icon ?? viewModel.Icon; - } - - return viewModel; - }).ToArray(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/Tree/RootMediaTypeTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/MediaType/Tree/RootMediaTypeTreeController.cs deleted file mode 100644 index 0dd09b56d3..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/Tree/RootMediaTypeTreeController.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.MediaType.Tree; - -public class RootMediaTypeTreeController : MediaTypeTreeControllerBase -{ - public RootMediaTypeTreeController(IEntityService entityService, IMediaTypeService mediaTypeService) - : base(entityService, mediaTypeService) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100, bool foldersOnly = false) - { - RenderFoldersOnly(foldersOnly); - return await GetRoot(skip, take); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/MemberGroup/Tree/ItemsMemberGroupTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/MemberGroup/Tree/ItemsMemberGroupTreeController.cs deleted file mode 100644 index 9f6ad89275..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/MemberGroup/Tree/ItemsMemberGroupTreeController.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.MemberGroup.Tree; - -public class ItemsMemberGroupTreeController : MemberGroupTreeControllerBase -{ - public ItemsMemberGroupTreeController(IEntityService entityService) - : base(entityService) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "key")] Guid[] keys) - => await GetItems(keys); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/MemberGroup/Tree/MemberGroupTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/MemberGroup/Tree/MemberGroupTreeControllerBase.cs deleted file mode 100644 index 5fa672dcaa..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/MemberGroup/Tree/MemberGroupTreeControllerBase.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.MemberGroup.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.MemberGroup}")] -[ApiExplorerSettings(GroupName = "Member Group")] -public class MemberGroupTreeControllerBase : EntityTreeControllerBase -{ - public MemberGroupTreeControllerBase(IEntityService entityService) - : base(entityService) - { - } - - protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.MemberGroup; - - protected override EntityTreeItemViewModel MapTreeItemViewModel(Guid? parentKey, IEntitySlim entity) - { - EntityTreeItemViewModel viewModel = base.MapTreeItemViewModel(parentKey, entity); - viewModel.Icon = Constants.Icons.MemberGroup; - return viewModel; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/MemberGroup/Tree/RootMemberGroupTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/MemberGroup/Tree/RootMemberGroupTreeController.cs deleted file mode 100644 index 591ab3344f..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/MemberGroup/Tree/RootMemberGroupTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.MemberGroup.Tree; - -public class RootMemberGroupTreeController : MemberGroupTreeControllerBase -{ - public RootMemberGroupTreeController(IEntityService entityService) - : base(entityService) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100) - => await GetRoot(skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/MemberType/Tree/ItemsMemberTypeTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/MemberType/Tree/ItemsMemberTypeTreeController.cs deleted file mode 100644 index ec8e68262f..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/MemberType/Tree/ItemsMemberTypeTreeController.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.MemberType.Tree; - -public class ItemsMemberTypeTreeController : MemberTypeTreeControllerBase -{ - public ItemsMemberTypeTreeController(IEntityService entityService) - : base(entityService) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "key")] Guid[] keys) - => await GetItems(keys); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/MemberType/Tree/MemberTypeTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/MemberType/Tree/MemberTypeTreeControllerBase.cs deleted file mode 100644 index 8d4c2b5ba9..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/MemberType/Tree/MemberTypeTreeControllerBase.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.MemberType.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.MemberType}")] -[ApiExplorerSettings(GroupName = "Member Type")] -public class MemberTypeTreeControllerBase : EntityTreeControllerBase -{ - public MemberTypeTreeControllerBase(IEntityService entityService) - : base(entityService) - { - } - - protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.MemberType; - - protected override EntityTreeItemViewModel MapTreeItemViewModel(Guid? parentKey, IEntitySlim entity) - { - EntityTreeItemViewModel viewModel = base.MapTreeItemViewModel(parentKey, entity); - viewModel.Icon = Constants.Icons.User; - return viewModel; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/MemberType/Tree/RootMemberTypeTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/MemberType/Tree/RootMemberTypeTreeController.cs deleted file mode 100644 index 4262b09085..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/MemberType/Tree/RootMemberTypeTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.MemberType.Tree; - -public class RootMemberTypeTreeController : MemberTypeTreeControllerBase -{ - public RootMemberTypeTreeController(IEntityService entityService) - : base(entityService) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100) - => await GetRoot(skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/BuildModelsBuilderController.cs b/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/BuildModelsBuilderController.cs deleted file mode 100644 index 5fd8233579..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/BuildModelsBuilderController.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Infrastructure.ModelsBuilder; -using Umbraco.Cms.Infrastructure.ModelsBuilder.Building; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Controllers.ModelsBuilder; - -public class BuildModelsBuilderController : ModelsBuilderControllerBase -{ - private ModelsBuilderSettings _modelsBuilderSettings; - private readonly ModelsGenerationError _mbErrors; - private readonly ModelsGenerator _modelGenerator; - - public BuildModelsBuilderController( - IOptionsMonitor modelsBuilderSettings, - ModelsGenerationError mbErrors, - ModelsGenerator modelGenerator) - { - _mbErrors = mbErrors; - _modelGenerator = modelGenerator; - _modelsBuilderSettings = modelsBuilderSettings.CurrentValue; - - modelsBuilderSettings.OnChange(x => _modelsBuilderSettings = x); - } - - [HttpPost("build")] - [ProducesResponseType(typeof(CreatedResult), StatusCodes.Status201Created)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)] - [MapToApiVersion("1.0")] - public async Task BuildModels() - { - try - { - if (!_modelsBuilderSettings.ModelsMode.SupportsExplicitGeneration()) - { - var problemDetailsModel = new ProblemDetails - { - Title = "Models generation is not enabled", - Detail = "ModelsBuilderMode is not set to SourceCodeManual or SourceCodeAuto", - Status = StatusCodes.Status428PreconditionRequired, - Type = "Error", - }; - - return await Task.FromResult(new ObjectResult(problemDetailsModel) { StatusCode = StatusCodes.Status428PreconditionRequired }); - } - - _modelGenerator.GenerateModels(); - _mbErrors.Clear(); - } - catch (Exception e) - { - _mbErrors.Report("Failed to build models.", e); - } - - return await Task.FromResult(Created("api/v1/modelsBuilderDashboard", null)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/GetModelsBuilderController.cs b/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/GetModelsBuilderController.cs deleted file mode 100644 index 4b7d29a443..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/GetModelsBuilderController.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.Cms.Api.Management.ViewModels.ModelsBuilderDashboard; - -namespace Umbraco.Cms.Api.Management.Controllers.ModelsBuilder; - -public class GetModelsBuilderController : ModelsBuilderControllerBase -{ - private readonly IModelsBuilderViewModelFactory _modelsBuilderViewModelFactory; - - public GetModelsBuilderController(IModelsBuilderViewModelFactory modelsBuilderViewModelFactory) => _modelsBuilderViewModelFactory = modelsBuilderViewModelFactory; - - [HttpGet("dashboard")] - [ProducesResponseType(typeof(ModelsBuilderViewModel), StatusCodes.Status200OK)] - [MapToApiVersion("1.0")] - public async Task> GetDashboard() => await Task.FromResult(Ok(_modelsBuilderViewModelFactory.Create())); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/ModelsBuilderControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/ModelsBuilderControllerBase.cs deleted file mode 100644 index ca018896ed..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/ModelsBuilderControllerBase.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.ModelsBuilder; - -[ApiController] -[VersionedApiBackOfficeRoute("models-builder")] -[ApiExplorerSettings(GroupName = "Models Builder")] -[ApiVersion("1.0")] - -public class ModelsBuilderControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/StatusModelsBuilderController.cs b/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/StatusModelsBuilderController.cs deleted file mode 100644 index b660fdedcc..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/StatusModelsBuilderController.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Infrastructure.ModelsBuilder; -using Umbraco.Cms.Api.Management.ViewModels.ModelsBuilderDashboard; -using Umbraco.New.Cms.Core.Models; - -namespace Umbraco.Cms.Api.Management.Controllers.ModelsBuilder; - -public class StatusModelsBuilderController : ModelsBuilderControllerBase -{ - private readonly OutOfDateModelsStatus _outOfDateModelsStatus; - - public StatusModelsBuilderController(OutOfDateModelsStatus outOfDateModelsStatus) => _outOfDateModelsStatus = outOfDateModelsStatus; - - [HttpGet("status")] - [ProducesResponseType(typeof(OutOfDateStatusViewModel), StatusCodes.Status200OK)] - [MapToApiVersion("1.0")] - public async Task> GetModelsOutOfDateStatus() - { - OutOfDateStatusViewModel status = _outOfDateModelsStatus.IsEnabled - ? _outOfDateModelsStatus.IsOutOfDate - ? new OutOfDateStatusViewModel { Status = OutOfDateType.OutOfDate } - : new OutOfDateStatusViewModel { Status = OutOfDateType.Current } - : new OutOfDateStatusViewModel { Status = OutOfDateType.Unknown }; - - return await Task.FromResult(Ok(status)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Tree/ChildrenPartialViewTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Tree/ChildrenPartialViewTreeController.cs deleted file mode 100644 index 408feeb09e..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Tree/ChildrenPartialViewTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.PartialView.Tree; - -public class ChildrenPartialViewTreeController : PartialViewTreeControllerBase -{ - public ChildrenPartialViewTreeController(FileSystems fileSystems) - : base(fileSystems) - { - } - - [HttpGet("children")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Children(string path, int skip = 0, int take = 100) - => await GetChildren(path, skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Tree/ItemsPartialViewTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Tree/ItemsPartialViewTreeController.cs deleted file mode 100644 index 48bf294822..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Tree/ItemsPartialViewTreeController.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.PartialView.Tree; - -public class ItemsPartialViewTreeController : PartialViewTreeControllerBase -{ - public ItemsPartialViewTreeController(FileSystems fileSystems) - : base(fileSystems) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "path")] string[] paths) - => await GetItems(paths); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Tree/PartialViewTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Tree/PartialViewTreeControllerBase.cs deleted file mode 100644 index 45fef6eb7f..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Tree/PartialViewTreeControllerBase.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.PartialView.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.PartialView}")] -[ApiExplorerSettings(GroupName = "Partial View")] -public class PartialViewTreeControllerBase : FileSystemTreeControllerBase -{ - public PartialViewTreeControllerBase(FileSystems fileSystems) - => FileSystem = fileSystems.PartialViewsFileSystem ?? - throw new ArgumentException("Missing partial views file system", nameof(fileSystems)); - - protected override IFileSystem FileSystem { get; } - - protected override string FileIcon(string path) => Constants.Icons.PartialView; - - protected override string ItemType(string path) => Constants.UdiEntityType.PartialView; -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Tree/RootPartialViewTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Tree/RootPartialViewTreeController.cs deleted file mode 100644 index c4c689df51..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/PartialView/Tree/RootPartialViewTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.PartialView.Tree; - -public class RootPartialViewTreeController : PartialViewTreeControllerBase -{ - public RootPartialViewTreeController(FileSystems fileSystems) - : base(fileSystems) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100) - => await GetRoot(skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Profiling/ProfilingControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Profiling/ProfilingControllerBase.cs deleted file mode 100644 index 07b068f5c9..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Profiling/ProfilingControllerBase.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Profiling; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute("profiling")] -[ApiExplorerSettings(GroupName = "Profiling")] -public class ProfilingControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Profiling/StatusProfilingController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Profiling/StatusProfilingController.cs deleted file mode 100644 index 5738655e14..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Profiling/StatusProfilingController.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Hosting; -using Umbraco.Cms.Api.Management.ViewModels.Profiling; - -namespace Umbraco.Cms.Api.Management.Controllers.Profiling; - -public class StatusProfilingController : ProfilingControllerBase -{ - private readonly IHostingEnvironment _hosting; - - public StatusProfilingController(IHostingEnvironment hosting) => _hosting = hosting; - - [HttpGet("status")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ProfilingStatusViewModel), StatusCodes.Status200OK)] - public async Task> Status() - => await Task.FromResult(Ok(new ProfilingStatusViewModel(_hosting.IsDebugMode))); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/CollectPublishedCacheController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/CollectPublishedCacheController.cs deleted file mode 100644 index eecb495f7a..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/CollectPublishedCacheController.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.PublishedCache; - -namespace Umbraco.Cms.Api.Management.Controllers.PublishedCache; - -public class CollectPublishedCacheController : PublishedCacheControllerBase -{ - private readonly IPublishedSnapshotService _publishedSnapshotService; - - public CollectPublishedCacheController(IPublishedSnapshotService publishedSnapshotService) - => _publishedSnapshotService = publishedSnapshotService; - - [HttpPost("collect")] - [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status200OK)] - public async Task Collect() - { - GC.Collect(); - await _publishedSnapshotService.CollectAsync(); - return Ok(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/PublishedCacheControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/PublishedCacheControllerBase.cs deleted file mode 100644 index aa8db8b316..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/PublishedCacheControllerBase.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.PublishedCache; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute("published-cache")] -[ApiExplorerSettings(GroupName = "Published Cache")] -public class PublishedCacheControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/RebuildPublishedCacheController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/RebuildPublishedCacheController.cs deleted file mode 100644 index c7742b567f..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/RebuildPublishedCacheController.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.PublishedCache; - -namespace Umbraco.Cms.Api.Management.Controllers.PublishedCache; - -public class RebuildPublishedCacheController : PublishedCacheControllerBase -{ - private readonly IPublishedSnapshotService _publishedSnapshotService; - - public RebuildPublishedCacheController(IPublishedSnapshotService publishedSnapshotService) - => _publishedSnapshotService = publishedSnapshotService; - - [HttpPost("rebuild")] - [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status200OK)] - public async Task Rebuild() - { - _publishedSnapshotService.Rebuild(); - return await Task.FromResult(Ok()); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/ReloadPublishedCacheController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/ReloadPublishedCacheController.cs deleted file mode 100644 index 36c36a64b7..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/ReloadPublishedCacheController.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Cache; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Controllers.PublishedCache; - -public class ReloadPublishedCacheController : PublishedCacheControllerBase -{ - private readonly DistributedCache _distributedCache; - - public ReloadPublishedCacheController(DistributedCache distributedCache) => _distributedCache = distributedCache; - - [HttpPost("reload")] - [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status200OK)] - public async Task Reload() - { - _distributedCache.RefreshAllPublishedSnapshot(); - return await Task.FromResult(Ok()); - } -} - diff --git a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/StatusPublishedCacheController.cs b/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/StatusPublishedCacheController.cs deleted file mode 100644 index ba24605f79..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/StatusPublishedCacheController.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.PublishedCache; - -namespace Umbraco.Cms.Api.Management.Controllers.PublishedCache; - -public class StatusPublishedCacheController : PublishedCacheControllerBase -{ - private readonly IPublishedSnapshotStatus _publishedSnapshotStatus; - - public StatusPublishedCacheController(IPublishedSnapshotStatus publishedSnapshotStatus) - => _publishedSnapshotStatus = publishedSnapshotStatus; - - [HttpGet("status")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(string), StatusCodes.Status200OK)] - public async Task> Status() - => await Task.FromResult(Ok(_publishedSnapshotStatus.GetStatus())); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/RecycleBin/RecycleBinControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/RecycleBin/RecycleBinControllerBase.cs deleted file mode 100644 index f92b6fd879..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/RecycleBin/RecycleBinControllerBase.cs +++ /dev/null @@ -1,111 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Services.Paging; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.RecycleBin; - -namespace Umbraco.Cms.Api.Management.Controllers.RecycleBin; - -public abstract class RecycleBinControllerBase : Controller - where TItem : RecycleBinItemViewModel, new() -{ - private readonly IEntityService _entityService; - private readonly string _itemUdiType; - - protected RecycleBinControllerBase(IEntityService entityService) - { - _entityService = entityService; - // ReSharper disable once VirtualMemberCallInConstructor - _itemUdiType = ItemObjectType.GetUdiType(); - } - - protected abstract UmbracoObjectTypes ItemObjectType { get; } - - protected abstract int RecycleBinRootId { get; } - - protected async Task>> GetRoot(int skip, int take) - { - if (PaginationService.ConvertSkipTakeToPaging(skip, take, out var pageNumber, out var pageSize, out ProblemDetails? error) == false) - { - return BadRequest(error); - } - - IEntitySlim[] rootEntities = GetPagedRootEntities(pageNumber, pageSize, out var totalItems); - - TItem[] treeItemViewModels = MapRecycleBinViewModels(null, rootEntities); - - PagedViewModel result = PagedViewModel(treeItemViewModels, totalItems); - return await Task.FromResult(Ok(result)); - } - - protected async Task>> GetChildren(Guid parentKey, int skip, int take) - { - if (PaginationService.ConvertSkipTakeToPaging(skip, take, out var pageNumber, out var pageSize, out ProblemDetails? error) == false) - { - return BadRequest(error); - } - - IEntitySlim[] children = GetPagedChildEntities(parentKey, pageNumber, pageSize, out var totalItems); - - TItem[] treeItemViewModels = MapRecycleBinViewModels(parentKey, children); - - PagedViewModel result = PagedViewModel(treeItemViewModels, totalItems); - - return await Task.FromResult(Ok(result)); - } - - protected virtual TItem MapRecycleBinViewModel(Guid? parentKey, IEntitySlim entity) - { - if (entity == null) - { - throw new ArgumentNullException(nameof(entity)); - } - - var viewModel = new TItem - { - Icon = _itemUdiType, - Name = entity.Name!, - Key = entity.Key, - Type = _itemUdiType, - HasChildren = entity.HasChildren, - IsContainer = entity.IsContainer, - ParentKey = parentKey - }; - - return viewModel; - } - - private IEntitySlim[] GetPagedRootEntities(long pageNumber, int pageSize, out long totalItems) - { - IEntitySlim[] rootEntities = _entityService - .GetPagedTrashedChildren(RecycleBinRootId, ItemObjectType, pageNumber, pageSize, out totalItems) - .ToArray(); - - return rootEntities; - } - - private IEntitySlim[] GetPagedChildEntities(Guid parentKey, long pageNumber, int pageSize, out long totalItems) - { - IEntitySlim? parent = _entityService.Get(parentKey, ItemObjectType); - if (parent == null || parent.Trashed == false) - { - // not much else we can do here but return nothing - totalItems = 0; - return Array.Empty(); - } - - IEntitySlim[] children = _entityService - .GetPagedTrashedChildren(parent.Id, ItemObjectType, pageNumber, pageSize, out totalItems) - .ToArray(); - - return children; - } - - private TItem[] MapRecycleBinViewModels(Guid? parentKey, IEntitySlim[] entities) - => entities.Select(entity => MapRecycleBinViewModel(parentKey, entity)).ToArray(); - - private PagedViewModel PagedViewModel(IEnumerable treeItemViewModels, long totalItems) - => new() { Total = totalItems, Items = treeItemViewModels }; -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/ByKeyRedirectUrlManagementController.cs b/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/ByKeyRedirectUrlManagementController.cs deleted file mode 100644 index 57e7f17df3..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/ByKeyRedirectUrlManagementController.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.Cms.Api.Management.ViewModels.RedirectUrlManagement; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; - -namespace Umbraco.Cms.Api.Management.Controllers.RedirectUrlManagement; - -public class ByKeyRedirectUrlManagementController : RedirectUrlManagementBaseController -{ - private readonly IRedirectUrlService _redirectUrlService; - private readonly IRedirectUrlViewModelFactory _redirectUrlViewModelFactory; - - public ByKeyRedirectUrlManagementController( - IRedirectUrlService redirectUrlService, - IRedirectUrlViewModelFactory redirectUrlViewModelFactory) - { - _redirectUrlService = redirectUrlService; - _redirectUrlViewModelFactory = redirectUrlViewModelFactory; - } - - [HttpGet("{key:guid}")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public Task>> ByKey(Guid key, int skip, int take) - { - IRedirectUrl[] redirects = _redirectUrlService.GetContentRedirectUrls(key).ToArray(); - - IEnumerable viewModels = _redirectUrlViewModelFactory.CreateMany(redirects); - - return Task.FromResult>>(new PagedViewModel - { - Items = viewModels.Skip(skip).Take(take), - Total = redirects.Length, - }); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/DeleteByKeyRedirectUrlManagementController.cs b/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/DeleteByKeyRedirectUrlManagementController.cs deleted file mode 100644 index fbab340a73..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/DeleteByKeyRedirectUrlManagementController.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; - -namespace Umbraco.Cms.Api.Management.Controllers.RedirectUrlManagement; - -public class DeleteByKeyRedirectUrlManagementController : RedirectUrlManagementBaseController -{ - private readonly IRedirectUrlService _redirectUrlService; - - public DeleteByKeyRedirectUrlManagementController(IRedirectUrlService redirectUrlService) - { - _redirectUrlService = redirectUrlService; - } - - [HttpDelete("{key:guid}")] - [ProducesResponseType(StatusCodes.Status200OK)] - public async Task DeleteByKey(Guid key) - { - _redirectUrlService.Delete(key); - return Ok(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/GetAllRedirectUrlManagementController.cs b/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/GetAllRedirectUrlManagementController.cs deleted file mode 100644 index 8c375a416e..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/GetAllRedirectUrlManagementController.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.Cms.Api.Management.Services.Paging; -using Umbraco.Cms.Api.Management.ViewModels.RedirectUrlManagement; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; - -namespace Umbraco.Cms.Api.Management.Controllers.RedirectUrlManagement; - -public class GetAllRedirectUrlManagementController : RedirectUrlManagementBaseController -{ - private readonly IRedirectUrlService _redirectUrlService; - private readonly IRedirectUrlViewModelFactory _redirectUrlViewModelFactory; - - public GetAllRedirectUrlManagementController( - IRedirectUrlService redirectUrlService, - IRedirectUrlViewModelFactory redirectUrlViewModelFactory) - { - _redirectUrlService = redirectUrlService; - _redirectUrlViewModelFactory = redirectUrlViewModelFactory; - } - - [HttpGet] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> GetAll(string? filter, int skip, int take) - { - if (PaginationService.ConvertSkipTakeToPaging(skip, take, out long pageNumber, out int pageSize, out ProblemDetails? error) is false) - { - return BadRequest(error); - } - - long total; - IEnumerable redirects = filter is null - ? _redirectUrlService.GetAllRedirectUrls(pageNumber, pageSize, out total) - : _redirectUrlService.SearchRedirectUrls(filter, pageNumber, pageSize, out total); - - IEnumerable redirectViewModels = _redirectUrlViewModelFactory.CreateMany(redirects); - return new PagedViewModel { Items = redirectViewModels, Total = total }; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/GetStatusRedirectUrlManagementController.cs b/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/GetStatusRedirectUrlManagementController.cs deleted file mode 100644 index 779d95bc56..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/GetStatusRedirectUrlManagementController.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.Cms.Api.Management.ViewModels.RedirectUrlManagement; - -namespace Umbraco.Cms.Api.Management.Controllers.RedirectUrlManagement; - -public class GetStatusRedirectUrlManagementController : RedirectUrlManagementBaseController -{ - private readonly IRedirectUrlStatusViewModelFactory _redirectUrlStatusViewModelFactory; - - public GetStatusRedirectUrlManagementController( - IRedirectUrlStatusViewModelFactory redirectUrlStatusViewModelFactory) => - _redirectUrlStatusViewModelFactory = redirectUrlStatusViewModelFactory; - - [HttpGet("status")] - [ProducesResponseType(typeof(RedirectUrlStatusViewModel), 200)] - public Task> GetStatus() => - Task.FromResult>(_redirectUrlStatusViewModelFactory.CreateViewModel()); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/RedirectUrlManagementBaseController.cs b/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/RedirectUrlManagementBaseController.cs deleted file mode 100644 index 0c8cc74822..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/RedirectUrlManagementBaseController.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.RedirectUrlManagement; - -[ApiController] -[VersionedApiBackOfficeRoute("redirect-management")] -[ApiExplorerSettings(GroupName = "Redirect Management")] -[ApiVersion("1.0")] -public class RedirectUrlManagementBaseController : ManagementApiControllerBase -{ - -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/SetStatusRedirectUrlManagementController.cs b/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/SetStatusRedirectUrlManagementController.cs deleted file mode 100644 index d51e91a08d..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/SetStatusRedirectUrlManagementController.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Configuration; -using Umbraco.Cms.Core.Security; -using Umbraco.New.Cms.Core.Models.RedirectUrlManagement; - -namespace Umbraco.Cms.Api.Management.Controllers.RedirectUrlManagement; - -public class SetStatusRedirectUrlManagementController : RedirectUrlManagementBaseController -{ - private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; - private readonly IConfigManipulator _configManipulator; - - public SetStatusRedirectUrlManagementController( - IBackOfficeSecurityAccessor backOfficeSecurityAccessor, - IConfigManipulator configManipulator) - { - _backOfficeSecurityAccessor = backOfficeSecurityAccessor; - _configManipulator = configManipulator; - } - - // TODO: Consider if we should even allow this, or only allow using the appsettings - // We generally don't want to edit the appsettings from our code. - // But maybe there is a valid use case for doing it on the fly. - [HttpPost("status")] - public async Task SetStatus([FromQuery] RedirectStatus status) - { - // TODO: uncomment this when auth is implemented. - // var userIsAdmin = _backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser?.IsAdmin(); - // if (userIsAdmin is null or false) - // { - // return Unauthorized(); - // } - - var enable = status switch - { - RedirectStatus.Enabled => true, - RedirectStatus.Disabled => false - }; - - // For now I'm not gonna change this to limit breaking, but it's weird to have a "disabled" switch, - // since you're essentially negating the boolean from the get go, - // it's much easier to reason with enabled = false == disabled. - _configManipulator.SaveDisableRedirectUrlTracking(!enable); - - // Taken from the existing implementation in RedirectUrlManagementController - // TODO this is ridiculous, but we need to ensure the configuration is reloaded, before this request is ended. - // otherwise we can read the old value in GetEnableState. - // The value is equal to JsonConfigurationSource.ReloadDelay - Thread.Sleep(250); - - return Ok(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByChildRelationController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByChildRelationController.cs deleted file mode 100644 index c6153d5639..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByChildRelationController.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Relation; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Controllers.Relation; - -public class ByChildRelationController : RelationControllerBase -{ - private readonly IRelationService _relationService; - private readonly IRelationViewModelFactory _relationViewModelFactory; - - public ByChildRelationController( - IRelationService relationService, - IRelationViewModelFactory relationViewModelFactory) - { - _relationService = relationService; - _relationViewModelFactory = relationViewModelFactory; - } - - [HttpGet("child-relation/{childId:int}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task> ByChild(int childId, int skip, int take, string? relationTypeAlias = "") - { - IRelation[] relations = _relationService.GetByChildId(childId).ToArray(); - RelationViewModel[] result = Array.Empty(); - - if (relations.Any()) - { - if (string.IsNullOrWhiteSpace(relationTypeAlias) == false) - { - result = _relationViewModelFactory.CreateMultiple(relations.Where(x => - x.RelationType.Alias.InvariantEquals(relationTypeAlias))).ToArray(); - } - else - { - result = _relationViewModelFactory.CreateMultiple(relations).ToArray(); - } - } - - return await Task.FromResult(new PagedViewModel - { - Total = result.Length, - Items = result.Skip(skip).Take(take), - }); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByIdRelationController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByIdRelationController.cs deleted file mode 100644 index a9ac8cf0cd..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Relation/ByIdRelationController.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.Cms.Api.Management.ViewModels.Relation; - -namespace Umbraco.Cms.Api.Management.Controllers.Relation; - -public class ByIdRelationController : RelationControllerBase -{ - private readonly IRelationService _relationService; - private readonly IRelationViewModelFactory _relationViewModelFactory; - - public ByIdRelationController(IRelationService relationService, IRelationViewModelFactory relationViewModelFactory) - { - _relationService = relationService; - _relationViewModelFactory = relationViewModelFactory; - } - - [HttpGet("{id:int}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(RelationViewModel), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)] - public async Task ById(int id) - { - IRelation? relation = _relationService.GetById(id); - if (relation is null) - { - return NotFound(); - } - - return await Task.FromResult(Ok(_relationViewModelFactory.Create(relation))); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Relation/RelationControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Relation/RelationControllerBase.cs deleted file mode 100644 index 4c0f525898..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Relation/RelationControllerBase.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Relation; - -[ApiController] -[VersionedApiBackOfficeRoute("relation")] -[ApiExplorerSettings(GroupName = "Relation")] -[ApiVersion("1.0")] -// TODO: Implement Authentication -public abstract class RelationControllerBase : ManagementApiControllerBase -{ - -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Tree/ItemsRelationTypeTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Tree/ItemsRelationTypeTreeController.cs deleted file mode 100644 index 8271d80706..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Tree/ItemsRelationTypeTreeController.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.RelationType.Tree; - -public class ItemsRelationTypeTreeController : RelationTypeTreeControllerBase -{ - private readonly IRelationService _relationService; - - public ItemsRelationTypeTreeController(IEntityService entityService, IRelationService relationService) - : base(entityService) => - _relationService = relationService; - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "key")] Guid[] keys) - { - // relation service does not allow fetching a collection of relation types by their ids; instead it relies - // heavily on caching, which means this is as fast as it gets - even if it looks less than performant - IRelationType[] relationTypes = _relationService - .GetAllRelationTypes() - .Where(relationType => keys.Contains(relationType.Key)).ToArray(); - - EntityTreeItemViewModel[] viewModels = MapTreeItemViewModels(null, relationTypes); - - return await Task.FromResult(Ok(viewModels)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Tree/RelationTypeTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Tree/RelationTypeTreeControllerBase.cs deleted file mode 100644 index 10d53ffcbb..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Tree/RelationTypeTreeControllerBase.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.RelationType.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.RelationType}")] -[ApiExplorerSettings(GroupName = "Relation Type")] -// NOTE: at the moment relation types aren't supported by EntityService, so we have little use of the -// tree controller base. We'll keep it though, in the hope that we can mend EntityService. -public class RelationTypeTreeControllerBase : EntityTreeControllerBase -{ - public RelationTypeTreeControllerBase(IEntityService entityService) - : base(entityService) - { - } - - protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.RelationType; - - protected EntityTreeItemViewModel[] MapTreeItemViewModels(Guid? parentKey, IRelationType[] relationTypes) - => relationTypes.Select(relationType => new EntityTreeItemViewModel - { - Icon = Constants.Icons.RelationType, - Name = relationType.Name!, - Key = relationType.Key, - Type = Constants.UdiEntityType.RelationType, - HasChildren = false, - IsContainer = false, - ParentKey = parentKey - }).ToArray(); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Tree/RootRelationTypeTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Tree/RootRelationTypeTreeController.cs deleted file mode 100644 index c7d3e122b4..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/RelationType/Tree/RootRelationTypeTreeController.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Services.Paging; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.RelationType.Tree; - -public class RootRelationTypeTreeController : RelationTypeTreeControllerBase -{ - private readonly IRelationService _relationService; - - public RootRelationTypeTreeController(IEntityService entityService, IRelationService relationService) - : base(entityService) => - _relationService = relationService; - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100) - { - if (PaginationService.ConvertSkipTakeToPaging(skip, take, out var pageNumber, out var pageSize, out ProblemDetails? error) == false) - { - return BadRequest(error); - } - - // pagination is not supported (yet) by relation service, so we do it in memory for now - // - chances are we won't have many relation types, so it won't be an actual issue - IRelationType[] allRelationTypes = _relationService.GetAllRelationTypes().ToArray(); - - EntityTreeItemViewModel[] viewModels = MapTreeItemViewModels( - null, - allRelationTypes - .OrderBy(relationType => relationType.Name) - .Skip((int)(pageNumber * pageSize)) - .Take(pageSize) - .ToArray()); - - PagedViewModel result = PagedViewModel(viewModels, allRelationTypes.Length); - return await Task.FromResult(Ok(result)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Script/Tree/ChildrenScriptTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Script/Tree/ChildrenScriptTreeController.cs deleted file mode 100644 index 53974b3575..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Script/Tree/ChildrenScriptTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Script.Tree; - -public class ChildrenScriptTreeController : ScriptTreeControllerBase -{ - public ChildrenScriptTreeController(FileSystems fileSystems) - : base(fileSystems) - { - } - - [HttpGet("children")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Children(string path, int skip = 0, int take = 100) - => await GetChildren(path, skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Script/Tree/ItemsScriptTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Script/Tree/ItemsScriptTreeController.cs deleted file mode 100644 index 4db18a409b..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Script/Tree/ItemsScriptTreeController.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Script.Tree; - -public class ItemsScriptTreeController : ScriptTreeControllerBase -{ - public ItemsScriptTreeController(FileSystems fileSystems) - : base(fileSystems) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "path")] string[] paths) - => await GetItems(paths); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Script/Tree/RootScriptTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Script/Tree/RootScriptTreeController.cs deleted file mode 100644 index d04525daa4..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Script/Tree/RootScriptTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Script.Tree; - -public class RootScriptTreeController : ScriptTreeControllerBase -{ - public RootScriptTreeController(FileSystems fileSystems) - : base(fileSystems) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100) - => await GetRoot(skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Script/Tree/ScriptTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Script/Tree/ScriptTreeControllerBase.cs deleted file mode 100644 index d5206e1734..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Script/Tree/ScriptTreeControllerBase.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Script.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Script}")] -[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Script))] -public class ScriptTreeControllerBase : FileSystemTreeControllerBase -{ - public ScriptTreeControllerBase(FileSystems fileSystems) - => FileSystem = fileSystems.ScriptsFileSystem ?? - throw new ArgumentException("Missing scripts file system", nameof(fileSystems)); - - protected override IFileSystem FileSystem { get; } - - protected override string FileIcon(string path) => Constants.Icons.Script; - - protected override string ItemType(string path) => Constants.UdiEntityType.Script; -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Searcher/AllSearcherController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Searcher/AllSearcherController.cs deleted file mode 100644 index c4cf3863bb..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Searcher/AllSearcherController.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Examine; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Search; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Controllers.Searcher; - -[ApiVersion("1.0")] -public class AllSearcherController : SearcherControllerBase -{ - private readonly IExamineManager _examineManager; - - public AllSearcherController(IExamineManager examineManager) => _examineManager = examineManager; - - /// - /// Get the details for searchers - /// - /// - [HttpGet] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> All(int skip, int take) - { - var searchers = new List( - _examineManager.RegisteredSearchers.Select(searcher => new SearcherViewModel { Name = searcher.Name }) - .OrderBy(x => - x.Name.TrimEnd("Searcher"))); // order by name , but strip the "Searcher" from the end if it exists - var viewModel = new PagedViewModel - { - Items = searchers.Skip(skip).Take(take), - Total = searchers.Count, - }; - - return await Task.FromResult(Ok(viewModel)); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Searcher/QuerySearcherController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Searcher/QuerySearcherController.cs deleted file mode 100644 index ac34444fcb..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Searcher/QuerySearcherController.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Examine; -using Examine.Search; -using Lucene.Net.QueryParsers.Classic; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Search; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Controllers.Searcher; - -[ApiVersion("1.0")] -public class QuerySearcherController : SearcherControllerBase -{ - private readonly IExamineManagerService _examineManagerService; - - public QuerySearcherController(IExamineManagerService examineManagerService) => _examineManagerService = examineManagerService; - - [HttpGet("{searcherName}/query")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - public async Task>> Query(string searcherName, string? term, int skip, int take) - { - term = term?.Trim(); - - if (term.IsNullOrWhiteSpace()) - { - return new PagedViewModel(); - } - - if (!_examineManagerService.TryFindSearcher(searcherName, out ISearcher searcher)) - { - var invalidModelProblem = new ProblemDetails - { - Title = "Could not find a valid searcher", - Detail = "The provided searcher name did not match any of our registered searchers", - Status = StatusCodes.Status404NotFound, - Type = "Error", - }; - - return NotFound(invalidModelProblem); - } - - ISearchResults results; - - // NativeQuery will work for a single word/phrase too (but depends on the implementation) the lucene one will work. - try - { - results = searcher - .CreateQuery() - .NativeQuery(term) - .Execute(QueryOptions.SkipTake(skip, take)); - } - catch (ParseException) - { - var invalidModelProblem = new ProblemDetails - { - Title = "Could not parse the query", - Detail = "Parser could not parse the query. Please double check if the query is valid. Sometimes this can also happen if your query starts with a wildcard (*)", - Status = StatusCodes.Status404NotFound, - Type = "Error", - }; - - return BadRequest(invalidModelProblem); - } - - return await Task.FromResult(new PagedViewModel - { - Total = results.TotalItemCount, - Items = results.Select(x => new SearchResultViewModel - { - Id = x.Id, - Score = x.Score, - Fields = x.AllValues.OrderBy(y => y.Key).Select(y => new FieldViewModel { Name = y.Key, Values = y.Value }), - }), - }); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Searcher/SearcherControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Searcher/SearcherControllerBase.cs deleted file mode 100644 index d27fe28826..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Searcher/SearcherControllerBase.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Searcher; - -[ApiController] -[VersionedApiBackOfficeRoute("searcher")] -[ApiExplorerSettings(GroupName = "Searcher")] -public class SearcherControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeController.cs deleted file mode 100644 index a7731e1f46..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeController.cs +++ /dev/null @@ -1,144 +0,0 @@ -using System.Security.Claims; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using OpenIddict.Abstractions; -using OpenIddict.Server.AspNetCore; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.Security; -using Umbraco.Cms.Web.BackOffice.Security; -using Umbraco.Extensions; -using Umbraco.Cms.Api.Management.Routing; -using SignInResult = Microsoft.AspNetCore.Mvc.SignInResult; -using IdentitySignInResult = Microsoft.AspNetCore.Identity.SignInResult; - -namespace Umbraco.Cms.Api.Management.Controllers.Security; - -[ApiController] -[VersionedApiBackOfficeRoute(Paths.BackOfficeApiEndpointTemplate)] -[ApiExplorerSettings(GroupName = "Security")] -public class BackOfficeController : ManagementApiControllerBase -{ - private readonly IHttpContextAccessor _httpContextAccessor; - private readonly IBackOfficeSignInManager _backOfficeSignInManager; - private readonly IBackOfficeUserManager _backOfficeUserManager; - private readonly IOptions _securitySettings; - - public BackOfficeController( - IHttpContextAccessor httpContextAccessor, - IBackOfficeSignInManager backOfficeSignInManager, - IBackOfficeUserManager backOfficeUserManager, - IOptions securitySettings) - { - _httpContextAccessor = httpContextAccessor; - _backOfficeSignInManager = backOfficeSignInManager; - _backOfficeUserManager = backOfficeUserManager; - _securitySettings = securitySettings; - } - - [HttpGet("authorize")] - [HttpPost("authorize")] - [MapToApiVersion("1.0")] - public async Task Authorize() - { - HttpContext context = _httpContextAccessor.GetRequiredHttpContext(); - OpenIddictRequest? request = context.GetOpenIddictServerRequest(); - if (request == null) - { - return BadRequest("Unable to obtain OpenID data from the current request"); - } - - return request.IdentityProvider.IsNullOrWhiteSpace() - ? await AuthorizeInternal(request) - : await AuthorizeExternal(request); - } - - private async Task AuthorizeInternal(OpenIddictRequest request) - { - // TODO: ensure we handle sign-in notifications for internal logins. - // when the new login screen is implemented for internal logins, make sure it still handles - // user sign-in notifications (calls BackOfficeSignInManager.HandleSignIn) as part of the - // sign-in process - // for future reference, notifications are already handled for the external login flow by - // by calling BackOfficeSignInManager.ExternalLoginSignInAsync - - // retrieve the user principal stored in the authentication cookie. - AuthenticateResult cookieAuthResult = await HttpContext.AuthenticateAsync(Constants.Security.BackOfficeAuthenticationType); - var userName = cookieAuthResult.Succeeded - ? cookieAuthResult.Principal?.Identity?.Name - : null; - - if (userName != null) - { - BackOfficeIdentityUser? backOfficeUser = await _backOfficeUserManager.FindByNameAsync(userName); - if (backOfficeUser != null) - { - return await SignInBackOfficeUser(backOfficeUser, request); - } - } - - return DefaultChallengeResult(); - } - - private async Task AuthorizeExternal(OpenIddictRequest request) - { - var provider = request.IdentityProvider ?? throw new ArgumentException("No identity provider found in request", nameof(request)); - - ExternalLoginInfo? loginInfo = await _backOfficeSignInManager.GetExternalLoginInfoAsync(); - if (loginInfo?.Principal != null) - { - IdentitySignInResult result = await _backOfficeSignInManager.ExternalLoginSignInAsync(loginInfo, false, _securitySettings.Value.UserBypassTwoFactorForExternalLogins); - - if (result.Succeeded) - { - // Update any authentication tokens if succeeded - await _backOfficeSignInManager.UpdateExternalAuthenticationTokensAsync(loginInfo); - - // sign in the backoffice user associated with the login provider and unique provider key - BackOfficeIdentityUser? backOfficeUser = await _backOfficeUserManager.FindByLoginAsync(loginInfo.LoginProvider, loginInfo.ProviderKey); - if (backOfficeUser != null) - { - return await SignInBackOfficeUser(backOfficeUser, request); - } - } - else - { - // avoid infinite auth loops when something fails by performing the default challenge (default login screen) - return DefaultChallengeResult(); - } - } - - AuthenticationProperties properties = _backOfficeSignInManager.ConfigureExternalAuthenticationProperties(provider, null); - return new ChallengeResult(provider, properties); - } - - private async Task SignInBackOfficeUser(BackOfficeIdentityUser backOfficeUser, OpenIddictRequest request) - { - ClaimsPrincipal backOfficePrincipal = await _backOfficeSignInManager.CreateUserPrincipalAsync(backOfficeUser); - backOfficePrincipal.SetClaim(OpenIddictConstants.Claims.Subject, backOfficeUser.Key.ToString()); - - // TODO: it is not optimal to append all claims to the token. - // the token size grows with each claim, although it is still smaller than the old cookie. - // see if we can find a better way so we do not risk leaking sensitive data in bearer tokens. - // maybe work with scopes instead? - Claim[] backOfficeClaims = backOfficePrincipal.Claims.ToArray(); - foreach (Claim backOfficeClaim in backOfficeClaims) - { - backOfficeClaim.SetDestinations(OpenIddictConstants.Destinations.AccessToken); - } - - if (request.GetScopes().Contains(OpenIddictConstants.Scopes.OfflineAccess)) - { - // "offline_access" scope is required to use refresh tokens - backOfficePrincipal.SetScopes(OpenIddictConstants.Scopes.OfflineAccess); - } - - return new SignInResult(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, backOfficePrincipal); - } - - private static IActionResult DefaultChallengeResult() => new ChallengeResult(Constants.Security.BackOfficeAuthenticationType); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Security/Paths.cs b/src/Umbraco.Cms.Api.Management/Controllers/Security/Paths.cs deleted file mode 100644 index ee527c85e2..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Security/Paths.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Umbraco.Cms.Api.Management.Controllers.Security; - -public static class Paths -{ - public const string BackOfficeApiEndpointTemplate = "security/back-office"; - - public static readonly string BackOfficeApiAuthorizationEndpoint = BackOfficeApiEndpointPath($"{BackOfficeApiEndpointTemplate}/authorize"); - - public static readonly string BackOfficeApiTokenEndpoint = BackOfficeApiEndpointPath($"{BackOfficeApiEndpointTemplate}/token"); - - private static string BackOfficeApiEndpointPath(string relativePath) => $"/umbraco/management/api/v1.0/{relativePath}"; -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Server/ServerControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Server/ServerControllerBase.cs deleted file mode 100644 index 646f1f6996..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Server/ServerControllerBase.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Server; - -[ApiController] -[VersionedApiBackOfficeRoute("server")] -[ApiExplorerSettings(GroupName = "Server")] -public abstract class ServerControllerBase : ManagementApiControllerBase -{ - -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Server/StatusServerController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Server/StatusServerController.cs deleted file mode 100644 index f11147fdbb..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Server/StatusServerController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Server; - -namespace Umbraco.Cms.Api.Management.Controllers.Server; - -[ApiVersion("1.0")] -public class StatusServerController : ServerControllerBase -{ - private readonly IRuntimeState _runtimeState; - - public StatusServerController(IRuntimeState runtimeState) => _runtimeState = runtimeState; - - [HttpGet("status")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ServerStatusViewModel), StatusCodes.Status200OK)] - public async Task> Get() => - await Task.FromResult(new ServerStatusViewModel { ServerStatus = _runtimeState.Level }); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Server/VersionServerController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Server/VersionServerController.cs deleted file mode 100644 index bb9ce5846e..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Server/VersionServerController.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Configuration; -using Umbraco.Cms.Api.Management.ViewModels.Server; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Controllers.Server; - -[ApiVersion("1.0")] -public class VersionServerController : ServerControllerBase -{ - private readonly IUmbracoVersion _umbracoVersion; - - public VersionServerController(IUmbracoVersion umbracoVersion) => _umbracoVersion = umbracoVersion; - - [HttpGet("version")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(VersionViewModel), StatusCodes.Status200OK)] - public async Task> Get() => - await Task.FromResult(new VersionViewModel - { - Version = _umbracoVersion.SemanticVersion.ToSemanticStringWithoutBuild() - }); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/StaticFile/Tree/ChildrenStaticFileTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/StaticFile/Tree/ChildrenStaticFileTreeController.cs deleted file mode 100644 index 826d2b3103..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/StaticFile/Tree/ChildrenStaticFileTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.StaticFile.Tree; - -public class ChildrenStaticFileTreeController : StaticFileTreeControllerBase -{ - public ChildrenStaticFileTreeController(IPhysicalFileSystem physicalFileSystem) - : base(physicalFileSystem) - { - } - - [HttpGet("children")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Children(string path, int skip = 0, int take = 100) - => await GetChildren(path, skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/StaticFile/Tree/ItemsStaticFileTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/StaticFile/Tree/ItemsStaticFileTreeController.cs deleted file mode 100644 index 78d63d9143..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/StaticFile/Tree/ItemsStaticFileTreeController.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.StaticFile.Tree; - -public class ItemsStaticFileTreeController : StaticFileTreeControllerBase -{ - public ItemsStaticFileTreeController(IPhysicalFileSystem physicalFileSystem) - : base(physicalFileSystem) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "path")] string[] paths) - => await GetItems(paths); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/StaticFile/Tree/RootStaticFileTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/StaticFile/Tree/RootStaticFileTreeController.cs deleted file mode 100644 index 48d4cacc4d..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/StaticFile/Tree/RootStaticFileTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.StaticFile.Tree; - -public class RootStaticFileTreeController : StaticFileTreeControllerBase -{ - public RootStaticFileTreeController(IPhysicalFileSystem physicalFileSystem) - : base(physicalFileSystem) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100) - => await GetRoot(skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/StaticFile/Tree/StaticFileTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/StaticFile/Tree/StaticFileTreeControllerBase.cs deleted file mode 100644 index aed2042255..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/StaticFile/Tree/StaticFileTreeControllerBase.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.StaticFile.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/static-file")] -[ApiExplorerSettings(GroupName = "Static File")] -public class StaticFileTreeControllerBase : FileSystemTreeControllerBase -{ - private static readonly string[] _allowedRootFolders = { "App_Plugins", "wwwroot" }; - - public StaticFileTreeControllerBase(IPhysicalFileSystem physicalFileSystem) - => FileSystem = physicalFileSystem; - - protected override IFileSystem FileSystem { get; } - - protected override string FileIcon(string path) => Constants.Icons.DefaultIcon; - - protected override string ItemType(string path) => "static-file"; - - protected override string[] GetDirectories(string path) => - IsTreeRootPath(path) - ? _allowedRootFolders - : IsAllowedPath(path) - ? base.GetDirectories(path) - : Array.Empty(); - - protected override string[] GetFiles(string path) - => IsTreeRootPath(path) || IsAllowedPath(path) == false - ? Array.Empty() - : base.GetFiles(path); - - private bool IsTreeRootPath(string path) => string.IsNullOrWhiteSpace(path); - - private bool IsAllowedPath(string path) => _allowedRootFolders.Contains(path) || _allowedRootFolders.Any(folder => path.StartsWith($"{folder}/")); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Tree/ChildrenStylesheetTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Tree/ChildrenStylesheetTreeController.cs deleted file mode 100644 index 8e6a0022d4..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Tree/ChildrenStylesheetTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Stylesheet.Tree; - -public class ChildrenStylesheetTreeController : StylesheetTreeControllerBase -{ - public ChildrenStylesheetTreeController(FileSystems fileSystems) - : base(fileSystems) - { - } - - [HttpGet("children")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Children(string path, int skip = 0, int take = 100) - => await GetChildren(path, skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Tree/ItemsStylesheetTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Tree/ItemsStylesheetTreeController.cs deleted file mode 100644 index ff54931403..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Tree/ItemsStylesheetTreeController.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Stylesheet.Tree; - -public class ItemsStylesheetTreeController : StylesheetTreeControllerBase -{ - public ItemsStylesheetTreeController(FileSystems fileSystems) - : base(fileSystems) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "path")] string[] paths) - => await GetItems(paths); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Tree/RootStylesheetTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Tree/RootStylesheetTreeController.cs deleted file mode 100644 index cb8ca07d75..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Tree/RootStylesheetTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Stylesheet.Tree; - -public class RootStylesheetTreeController : StylesheetTreeControllerBase -{ - public RootStylesheetTreeController(FileSystems fileSystems) - : base(fileSystems) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100) - => await GetRoot(skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Tree/StylesheetTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Tree/StylesheetTreeControllerBase.cs deleted file mode 100644 index 905d31bb1f..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Stylesheet/Tree/StylesheetTreeControllerBase.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Stylesheet.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Stylesheet}")] -[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Stylesheet))] -public class StylesheetTreeControllerBase : FileSystemTreeControllerBase -{ - public StylesheetTreeControllerBase(FileSystems fileSystems) - => FileSystem = fileSystems.StylesheetsFileSystem ?? - throw new ArgumentException("Missing stylesheets file system", nameof(fileSystems)); - - protected override IFileSystem FileSystem { get; } - - protected override string FileIcon(string path) => Constants.Icons.Stylesheet; - - protected override string ItemType(string path) => Constants.UdiEntityType.Stylesheet; -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Telemetry/AllTelemetryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Telemetry/AllTelemetryController.cs deleted file mode 100644 index 2ad72017fa..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Telemetry/AllTelemetryController.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Telemetry; - -namespace Umbraco.Cms.Api.Management.Controllers.Telemetry; - -public class AllTelemetryController : TelemetryControllerBase -{ - [HttpGet] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task> GetAll(int skip, int take) - { - TelemetryLevel[] levels = Enum.GetValues(); - return await Task.FromResult(new PagedViewModel - { - Total = levels.Length, - Items = levels.Skip(skip).Take(take).Select(level => new TelemetryViewModel { TelemetryLevel = level }), - }); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Telemetry/GetTelemetryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Telemetry/GetTelemetryController.cs deleted file mode 100644 index 52a4a47d06..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Telemetry/GetTelemetryController.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Telemetry; - -namespace Umbraco.Cms.Api.Management.Controllers.Telemetry; - -public class GetTelemetryController : TelemetryControllerBase -{ - private readonly IMetricsConsentService _metricsConsentService; - - public GetTelemetryController(IMetricsConsentService metricsConsentService) => _metricsConsentService = metricsConsentService; - - [HttpGet("level")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(TelemetryViewModel), StatusCodes.Status200OK)] - public async Task Get() => await Task.FromResult(new TelemetryViewModel { TelemetryLevel = _metricsConsentService.GetConsentLevel() }); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Telemetry/SetTelemetryController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Telemetry/SetTelemetryController.cs deleted file mode 100644 index 0667c7df3b..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Telemetry/SetTelemetryController.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Telemetry; - -namespace Umbraco.Cms.Api.Management.Controllers.Telemetry; - -public class SetTelemetryController : TelemetryControllerBase -{ - private readonly IMetricsConsentService _metricsConsentService; - - public SetTelemetryController(IMetricsConsentService metricsConsentService) => _metricsConsentService = metricsConsentService; - - [HttpPost("level")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status200OK)] - public async Task SetConsentLevel(TelemetryViewModel telemetryViewModel) - { - if (!Enum.IsDefined(telemetryViewModel.TelemetryLevel)) - { - var invalidModelProblem = new ProblemDetails - { - Title = "Invalid TelemetryLevel value", - Detail = "The provided value for TelemetryLevel is not valid", - Status = StatusCodes.Status400BadRequest, - Type = "Error", - }; - return BadRequest(invalidModelProblem); - } - - _metricsConsentService.SetConsentLevel(telemetryViewModel.TelemetryLevel); - return await Task.FromResult(Ok()); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Telemetry/TelemetryControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Telemetry/TelemetryControllerBase.cs deleted file mode 100644 index bb65bf1b85..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Telemetry/TelemetryControllerBase.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Telemetry; - -[ApiController] -[VersionedApiBackOfficeRoute("telemetry")] -[ApiExplorerSettings(GroupName = "Telemetry")] -[ApiVersion("1.0")] -public abstract class TelemetryControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Template/Tree/ChildrenTemplateTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Template/Tree/ChildrenTemplateTreeController.cs deleted file mode 100644 index 19968927a2..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Template/Tree/ChildrenTemplateTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Template.Tree; - -public class ChildrenTemplateTreeController : TemplateTreeControllerBase -{ - public ChildrenTemplateTreeController(IEntityService entityService) - : base(entityService) - { - } - - [HttpGet("children")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Children(Guid parentKey, int skip = 0, int take = 100) - => await GetChildren(parentKey, skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Template/Tree/ItemsTemplateTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Template/Tree/ItemsTemplateTreeController.cs deleted file mode 100644 index 63a8e0cf22..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Template/Tree/ItemsTemplateTreeController.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Template.Tree; - -public class ItemsTemplateTreeController : TemplateTreeControllerBase -{ - public ItemsTemplateTreeController(IEntityService entityService) - : base(entityService) - { - } - - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - public async Task>> Items([FromQuery(Name = "key")] Guid[] keys) - => await GetItems(keys); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Template/Tree/RootTemplateTreeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Template/Tree/RootTemplateTreeController.cs deleted file mode 100644 index 50efa34e4f..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Template/Tree/RootTemplateTreeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Template.Tree; - -public class RootTemplateTreeController : TemplateTreeControllerBase -{ - public RootTemplateTreeController(IEntityService entityService) - : base(entityService) - { - } - - [HttpGet("root")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Root(int skip = 0, int take = 100) - => await GetRoot(skip, take); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Template/Tree/TemplateTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Template/Tree/TemplateTreeControllerBase.cs deleted file mode 100644 index d1c0ce5271..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Template/Tree/TemplateTreeControllerBase.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Controllers.Tree; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Template.Tree; - -[ApiVersion("1.0")] -[ApiController] -[VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Template}")] -[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Template))] -public class TemplateTreeControllerBase : EntityTreeControllerBase -{ - public TemplateTreeControllerBase(IEntityService entityService) - : base(entityService) - { - } - - protected override UmbracoObjectTypes ItemObjectType => UmbracoObjectTypes.Template; - - protected override EntityTreeItemViewModel MapTreeItemViewModel(Guid? parentKey, IEntitySlim entity) - { - EntityTreeItemViewModel viewModel = base.MapTreeItemViewModel(parentKey, entity); - viewModel.Icon = Constants.Icons.Template; - return viewModel; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/TrackedReference/ByIdTrackedReferenceController.cs b/src/Umbraco.Cms.Api.Management/Controllers/TrackedReference/ByIdTrackedReferenceController.cs deleted file mode 100644 index 39d2cfe3c2..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/TrackedReference/ByIdTrackedReferenceController.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.TrackedReferences; -using Umbraco.New.Cms.Core.Models; - -namespace Umbraco.Cms.Api.Management.Controllers.TrackedReference; - -public class ByIdTrackedReferenceController : TrackedReferenceControllerBase -{ - private readonly ITrackedReferencesService _trackedReferencesService; - private readonly IUmbracoMapper _umbracoMapper; - - public ByIdTrackedReferenceController(ITrackedReferencesService trackedReferencesService, IUmbracoMapper umbracoMapper) - { - _trackedReferencesService = trackedReferencesService; - _umbracoMapper = umbracoMapper; - } - - /// - /// Gets a page list of tracked references for the current item, so you can see where an item is being used. - /// - /// - /// Used by info tabs on content, media etc. and for the delete and unpublish of single items. - /// This is basically finding parents of relations. - /// - [HttpGet("{id:int}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Get( - int id, - long skip, - long take, - bool? filterMustBeIsDependency) - { - PagedModel relationItems = _trackedReferencesService.GetPagedRelationsForItem(id, skip, take, filterMustBeIsDependency ?? false); - - var pagedViewModel = new PagedViewModel - { - Total = relationItems.Total, - Items = _umbracoMapper.MapEnumerable(relationItems.Items), - }; - - return await Task.FromResult(pagedViewModel); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/TrackedReference/DescendantsTrackedReferenceController.cs b/src/Umbraco.Cms.Api.Management/Controllers/TrackedReference/DescendantsTrackedReferenceController.cs deleted file mode 100644 index 752b6d8846..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/TrackedReference/DescendantsTrackedReferenceController.cs +++ /dev/null @@ -1,45 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.TrackedReferences; -using Umbraco.New.Cms.Core.Models; - -namespace Umbraco.Cms.Api.Management.Controllers.TrackedReference; - -public class DescendantsTrackedReferenceController : TrackedReferenceControllerBase -{ - private readonly ITrackedReferencesService _trackedReferencesSkipTakeService; - private readonly IUmbracoMapper _umbracoMapper; - - public DescendantsTrackedReferenceController(ITrackedReferencesService trackedReferencesSkipTakeService, IUmbracoMapper umbracoMapper) - { - _trackedReferencesSkipTakeService = trackedReferencesSkipTakeService; - _umbracoMapper = umbracoMapper; - } - - /// - /// Gets a page list of the child nodes of the current item used in any kind of relation. - /// - /// - /// Used when deleting and unpublishing a single item to check if this item has any descending items that are in any - /// kind of relation. - /// This is basically finding the descending items which are children in relations. - /// - [HttpGet("descendants/{parentId:int}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> Descendants(int parentId, long skip, long take, bool? filterMustBeIsDependency) - { - PagedModel relationItems = _trackedReferencesSkipTakeService.GetPagedDescendantsInReferences(parentId, skip, take, filterMustBeIsDependency ?? true); - var pagedViewModel = new PagedViewModel - { - Total = relationItems.Total, - Items = _umbracoMapper.MapEnumerable(relationItems.Items), - }; - - return await Task.FromResult(pagedViewModel); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/TrackedReference/ItemsTrackedReferenceController.cs b/src/Umbraco.Cms.Api.Management/Controllers/TrackedReference/ItemsTrackedReferenceController.cs deleted file mode 100644 index ecc0e3434d..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/TrackedReference/ItemsTrackedReferenceController.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.TrackedReferences; -using Umbraco.New.Cms.Core.Models; - -namespace Umbraco.Cms.Api.Management.Controllers.TrackedReference; - -public class ItemsTrackedReferenceController : TrackedReferenceControllerBase -{ - private readonly ITrackedReferencesService _trackedReferencesSkipTakeService; - private readonly IUmbracoMapper _umbracoMapper; - - public ItemsTrackedReferenceController(ITrackedReferencesService trackedReferencesSkipTakeService, IUmbracoMapper umbracoMapper) - { - _trackedReferencesSkipTakeService = trackedReferencesSkipTakeService; - _umbracoMapper = umbracoMapper; - } - - /// - /// Gets a page list of the items used in any kind of relation from selected integer ids. - /// - /// - /// Used when bulk deleting content/media and bulk unpublishing content (delete and unpublish on List view). - /// This is basically finding children of relations. - /// - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task>> GetPagedReferencedItems([FromQuery]int[] ids, long skip, long take, bool? filterMustBeIsDependency) - { - PagedModel relationItems = _trackedReferencesSkipTakeService.GetPagedItemsWithRelations(ids, skip, take, filterMustBeIsDependency ?? true); - var pagedViewModel = new PagedViewModel - { - Total = relationItems.Total, - Items = _umbracoMapper.MapEnumerable(relationItems.Items), - }; - - return await Task.FromResult(pagedViewModel); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/TrackedReference/TrackedReferencesControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/TrackedReference/TrackedReferencesControllerBase.cs deleted file mode 100644 index 68d7fb7c31..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/TrackedReference/TrackedReferencesControllerBase.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.TrackedReference; - -[ApiController] -[VersionedApiBackOfficeRoute("tracked-reference")] -[ApiExplorerSettings(GroupName = "Tracked Reference")] -[ApiVersion("1.0")] -public abstract class TrackedReferenceControllerBase : ManagementApiControllerBase -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Tree/EntityTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Tree/EntityTreeControllerBase.cs deleted file mode 100644 index 0857b11541..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Tree/EntityTreeControllerBase.cs +++ /dev/null @@ -1,132 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Services.Paging; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Controllers.Tree; - -public abstract class EntityTreeControllerBase : ManagementApiControllerBase - where TItem : EntityTreeItemViewModel, new() -{ - private readonly string _itemUdiType; - - protected EntityTreeControllerBase(IEntityService entityService) - { - EntityService = entityService; - - // ReSharper disable once VirtualMemberCallInConstructor - _itemUdiType = ItemObjectType.GetUdiType(); - } - - protected IEntityService EntityService { get; } - - protected abstract UmbracoObjectTypes ItemObjectType { get; } - - protected virtual Ordering ItemOrdering => Ordering.By(nameof(Infrastructure.Persistence.Dtos.NodeDto.Text)); - - protected async Task>> GetRoot(int skip, int take) - { - if (PaginationService.ConvertSkipTakeToPaging(skip, take, out var pageNumber, out var pageSize, out ProblemDetails? error) == false) - { - return BadRequest(error); - } - - IEntitySlim[] rootEntities = GetPagedRootEntities(pageNumber, pageSize, out var totalItems); - - TItem[] treeItemViewModels = MapTreeItemViewModels(null, rootEntities); - - PagedViewModel result = PagedViewModel(treeItemViewModels, totalItems); - return await Task.FromResult(Ok(result)); - } - - protected async Task>> GetChildren(Guid parentKey, int skip, int take) - { - if (PaginationService.ConvertSkipTakeToPaging(skip, take, out var pageNumber, out var pageSize, out ProblemDetails? error) == false) - { - return BadRequest(error); - } - - IEntitySlim[] children = GetPagedChildEntities(parentKey, pageNumber, pageSize, out var totalItems); - - TItem[] treeItemViewModels = MapTreeItemViewModels(parentKey, children); - - PagedViewModel result = PagedViewModel(treeItemViewModels, totalItems); - return await Task.FromResult(Ok(result)); - } - - protected async Task>> GetItems(Guid[] keys) - { - if (keys.IsCollectionEmpty()) - { - return await Task.FromResult(Ok(PagedViewModel(Array.Empty(), 0))); - } - - IEntitySlim[] itemEntities = GetEntities(keys); - - TItem[] treeItemViewModels = MapTreeItemViewModels(null, itemEntities); - - return await Task.FromResult(Ok(treeItemViewModels)); - } - - protected virtual IEntitySlim[] GetPagedRootEntities(long pageNumber, int pageSize, out long totalItems) - => EntityService - .GetPagedChildren( - Constants.System.Root, - ItemObjectType, - pageNumber, - pageSize, - out totalItems, - ordering: ItemOrdering) - .ToArray(); - - protected virtual IEntitySlim[] GetPagedChildEntities(Guid parentKey, long pageNumber, int pageSize, out long totalItems) - { - // EntityService is only able to get paged children by parent ID, so we must first map parent key to parent ID - Attempt parentId = EntityService.GetId(parentKey, ItemObjectType); - if (parentId.Success == false) - { - // not much else we can do here but return nothing - totalItems = 0; - return Array.Empty(); - } - - IEntitySlim[] children = EntityService.GetPagedChildren( - parentId.Result, - ItemObjectType, - pageNumber, - pageSize, - out totalItems, - ordering: ItemOrdering) - .ToArray(); - return children; - } - - protected virtual IEntitySlim[] GetEntities(Guid[] keys) => EntityService.GetAll(ItemObjectType, keys).ToArray(); - - protected virtual TItem[] MapTreeItemViewModels(Guid? parentKey, IEntitySlim[] entities) - => entities.Select(entity => MapTreeItemViewModel(parentKey, entity)).ToArray(); - - protected virtual TItem MapTreeItemViewModel(Guid? parentKey, IEntitySlim entity) - { - var viewModel = new TItem - { - Icon = _itemUdiType, - Name = entity.Name!, - Key = entity.Key, - Type = _itemUdiType, - HasChildren = entity.HasChildren, - IsContainer = entity.IsContainer, - ParentKey = parentKey - }; - - return viewModel; - } - - protected PagedViewModel PagedViewModel(IEnumerable treeItemViewModels, long totalItems) - => new() { Total = totalItems, Items = treeItemViewModels }; -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Tree/FileSystemTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Tree/FileSystemTreeControllerBase.cs deleted file mode 100644 index 0bd7712967..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Tree/FileSystemTreeControllerBase.cs +++ /dev/null @@ -1,110 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Api.Management.Services.Paging; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Controllers.Tree; - -public abstract class FileSystemTreeControllerBase : ManagementApiControllerBase -{ - protected abstract IFileSystem FileSystem { get; } - - protected abstract string FileIcon(string path); - - protected abstract string ItemType(string path); - - protected async Task>> GetRoot(int skip, int take) - { - if (PaginationService.ConvertSkipTakeToPaging(skip, take, out var pageNumber, out var pageSize, out ProblemDetails? error) == false) - { - return BadRequest(error); - } - - FileSystemTreeItemViewModel[] viewModels = GetPathViewModels(string.Empty, pageNumber, pageSize, out var totalItems); - - PagedViewModel result = PagedViewModel(viewModels, totalItems); - return await Task.FromResult(Ok(result)); - } - - protected async Task>> GetChildren(string path, int skip, int take) - { - if (PaginationService.ConvertSkipTakeToPaging(skip, take, out var pageNumber, out var pageSize, out ProblemDetails? error) == false) - { - return BadRequest(error); - } - - FileSystemTreeItemViewModel[] viewModels = GetPathViewModels(path, pageNumber, pageSize, out var totalItems); - - PagedViewModel result = PagedViewModel(viewModels, totalItems); - return await Task.FromResult(Ok(result)); - } - - protected async Task>> GetItems(string[] paths) - { - FileSystemTreeItemViewModel[] viewModels = paths - .Where(FileSystem.FileExists) - .Select(path => - { - var fileName = GetFileName(path); - return fileName.IsNullOrWhiteSpace() - ? null - : MapViewModel(path, fileName, false); - }).WhereNotNull().ToArray(); - - return await Task.FromResult(Ok(viewModels)); - } - - protected virtual string[] GetDirectories(string path) => FileSystem - .GetDirectories(path) - .OrderBy(directory => directory) - .ToArray(); - - protected virtual string[] GetFiles(string path) => FileSystem - .GetFiles(path) - .OrderBy(file => file) - .ToArray(); - - protected virtual string GetFileName(string path) => FileSystem.GetFileName(path); - - protected virtual bool DirectoryHasChildren(string path) - => FileSystem.GetFiles(path).Any() || FileSystem.GetDirectories(path).Any(); - - private FileSystemTreeItemViewModel[] GetPathViewModels(string path, long pageNumber, int pageSize, out long totalItems) - { - var allItems = GetDirectories(path) - .Select(directory => new { Path = directory, IsFolder = true }) - .Union(GetFiles(path).Select(file => new { Path = file, IsFolder = false })) - .ToArray(); - - totalItems = allItems.Length; - - FileSystemTreeItemViewModel ViewModel(string itemPath, bool isFolder) - => MapViewModel( - itemPath, - isFolder ? Path.GetFileName(itemPath) : FileSystem.GetFileName(itemPath), - isFolder); - - return allItems - .Skip((int)(pageNumber * pageSize)) - .Take(pageSize) - .Select(item => ViewModel(item.Path, item.IsFolder)) - .ToArray(); - } - - private PagedViewModel PagedViewModel(IEnumerable viewModels, long totalItems) - => new() { Total = totalItems, Items = viewModels }; - - private FileSystemTreeItemViewModel MapViewModel(string path, string name, bool isFolder) - => new() - { - Path = path, - Name = name, - Icon = isFolder ? Constants.Icons.Folder : FileIcon(path), - HasChildren = isFolder && DirectoryHasChildren(path), - Type = ItemType(path), - IsFolder = isFolder - }; -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Tree/FolderTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Tree/FolderTreeControllerBase.cs deleted file mode 100644 index 6c76eae966..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Tree/FolderTreeControllerBase.cs +++ /dev/null @@ -1,88 +0,0 @@ -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Tree; - -namespace Umbraco.Cms.Api.Management.Controllers.Tree; - -public abstract class FolderTreeControllerBase : EntityTreeControllerBase - where TItem : FolderTreeItemViewModel, new() -{ - private readonly Guid _folderObjectTypeId; - private bool _foldersOnly; - - protected FolderTreeControllerBase(IEntityService entityService) - : base(entityService) => - // ReSharper disable once VirtualMemberCallInConstructor - _folderObjectTypeId = FolderObjectType.GetGuid(); - - protected abstract UmbracoObjectTypes FolderObjectType { get; } - - protected void RenderFoldersOnly(bool foldersOnly) => _foldersOnly = foldersOnly; - - protected override IEntitySlim[] GetPagedRootEntities(long pageNumber, int pageSize, out long totalItems) - => GetEntities( - Constants.System.Root, - pageNumber, - pageSize, - out totalItems); - - protected override IEntitySlim[] GetPagedChildEntities(Guid parentKey, long pageNumber, int pageSize, out long totalItems) - { - // EntityService is only able to get paged children by parent ID, so we must first map parent key to parent ID - Attempt parentId = EntityService.GetId(parentKey, FolderObjectType); - if (parentId.Success == false) - { - parentId = EntityService.GetId(parentKey, ItemObjectType); - if (parentId.Success == false) - { - // not much else we can do here but return nothing - totalItems = 0; - return Array.Empty(); - } - } - - return GetEntities( - parentId.Result, - pageNumber, - pageSize, - out totalItems); - } - - protected override TItem MapTreeItemViewModel(Guid? parentKey, IEntitySlim entity) - { - TItem viewModel = base.MapTreeItemViewModel(parentKey, entity); - - if (entity.NodeObjectType == _folderObjectTypeId) - { - viewModel.IsFolder = true; - viewModel.Icon = Constants.Icons.Folder; - } - - return viewModel; - } - - private IEntitySlim[] GetEntities(int parentId, long pageNumber, int pageSize, out long totalItems) - { - totalItems = 0; - - // EntityService is not able to paginate children of multiple item types, so we will only paginate the - // item type entities and always return all folders as part of the the first result page - IEntitySlim[] folderEntities = pageNumber == 0 - ? EntityService.GetChildren(parentId, FolderObjectType).OrderBy(c => c.Name).ToArray() - : Array.Empty(); - IEntitySlim[] itemEntities = _foldersOnly - ? Array.Empty() - : EntityService.GetPagedChildren( - parentId, - ItemObjectType, - pageNumber, - pageSize, - out totalItems, - ordering: ItemOrdering) - .ToArray(); - - return folderEntities.Union(itemEntities).ToArray(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Tree/UserStartNodeTreeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Tree/UserStartNodeTreeControllerBase.cs deleted file mode 100644 index 27de4a4876..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Tree/UserStartNodeTreeControllerBase.cs +++ /dev/null @@ -1,117 +0,0 @@ -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Models.Entities; -using Umbraco.Cms.Api.Management.Services.Entities; -using Umbraco.Cms.Api.Management.ViewModels.Tree; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Controllers.Tree; - -public abstract class UserStartNodeTreeControllerBase : EntityTreeControllerBase - where TItem : ContentTreeItemViewModel, new() -{ - private readonly IUserStartNodeEntitiesService _userStartNodeEntitiesService; - private readonly IDataTypeService _dataTypeService; - - private int[]? _userStartNodeIds; - private string[]? _userStartNodePaths; - private Dictionary _accessMap = new(); - private Guid? _dataTypeKey; - - protected UserStartNodeTreeControllerBase( - IEntityService entityService, - IUserStartNodeEntitiesService userStartNodeEntitiesService, - IDataTypeService dataTypeService) - : base(entityService) - { - _userStartNodeEntitiesService = userStartNodeEntitiesService; - _dataTypeService = dataTypeService; - } - - protected abstract int[] GetUserStartNodeIds(); - - protected abstract string[] GetUserStartNodePaths(); - - protected void IgnoreUserStartNodesForDataType(Guid? dataTypeKey) => _dataTypeKey = dataTypeKey; - - protected override IEntitySlim[] GetPagedRootEntities(long pageNumber, int pageSize, out long totalItems) - => UserHasRootAccess() || IgnoreUserStartNodes() - ? base.GetPagedRootEntities(pageNumber, pageSize, out totalItems) - : CalculateAccessMap(() => _userStartNodeEntitiesService.RootUserAccessEntities(ItemObjectType, UserStartNodeIds), out totalItems); - - protected override IEntitySlim[] GetPagedChildEntities(Guid parentKey, long pageNumber, int pageSize, out long totalItems) - { - IEntitySlim[] children = base.GetPagedChildEntities(parentKey, pageNumber, pageSize, out totalItems); - return UserHasRootAccess() || IgnoreUserStartNodes() - ? children - : CalculateAccessMap(() => _userStartNodeEntitiesService.ChildUserAccessEntities(children, UserStartNodePaths), out totalItems); - } - - protected override IEntitySlim[] GetEntities(Guid[] keys) - { - IEntitySlim[] entities = base.GetEntities(keys); - return UserHasRootAccess() || IgnoreUserStartNodes() - ? entities - : CalculateAccessMap(() => _userStartNodeEntitiesService.UserAccessEntities(entities, UserStartNodePaths), out _); - } - - protected override TItem[] MapTreeItemViewModels(Guid? parentKey, IEntitySlim[] entities) - { - if (UserHasRootAccess() || IgnoreUserStartNodes()) - { - return base.MapTreeItemViewModels(parentKey, entities); - } - - // for users with no root access, only add items for the entities contained within the calculated access map. - // the access map may contain entities that the user does not have direct access to, but need still to see, - // because it has descendants that the user *does* have access to. these entities are added as "no access" items. - TItem[] contentTreeItemViewModels = entities.Select(entity => - { - if (_accessMap.TryGetValue(entity.Key, out var hasAccess) == false) - { - // entity is not a part of the calculated access map - return null; - } - - // direct access => return a regular item - // no direct access => return a "no access" item - return hasAccess - ? MapTreeItemViewModel(parentKey, entity) - : MapTreeItemViewModelAsNoAccess(parentKey, entity); - }) - .WhereNotNull() - .ToArray(); - - return contentTreeItemViewModels; - } - - private int[] UserStartNodeIds => _userStartNodeIds ??= GetUserStartNodeIds(); - - private string[] UserStartNodePaths => _userStartNodePaths ??= GetUserStartNodePaths(); - - private bool UserHasRootAccess() => UserStartNodeIds.Contains(Constants.System.Root); - - private bool IgnoreUserStartNodes() - => _dataTypeKey.HasValue - && _dataTypeService.IsDataTypeIgnoringUserStartNodes(_dataTypeKey.Value); - - private IEntitySlim[] CalculateAccessMap(Func> getUserAccessEntities, out long totalItems) - { - UserAccessEntity[] userAccessEntities = getUserAccessEntities().ToArray(); - - _accessMap = userAccessEntities.ToDictionary(uae => uae.Entity.Key, uae => uae.HasAccess); - - IEntitySlim[] entities = userAccessEntities.Select(uae => uae.Entity).ToArray(); - totalItems = entities.Length; - - return entities; - } - - private TItem MapTreeItemViewModelAsNoAccess(Guid? parentKey, IEntitySlim entity) - { - TItem viewModel = MapTreeItemViewModel(parentKey, entity); - viewModel.NoAccess = true; - return viewModel; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Upgrade/AuthorizeUpgradeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Upgrade/AuthorizeUpgradeController.cs deleted file mode 100644 index 713ae4224b..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Upgrade/AuthorizeUpgradeController.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.New.Cms.Core.Services.Installer; - -namespace Umbraco.Cms.Api.Management.Controllers.Upgrade; - -[ApiVersion("1.0")] -public class AuthorizeUpgradeController : UpgradeControllerBase -{ - private readonly IUpgradeService _upgradeService; - - public AuthorizeUpgradeController(IUpgradeService upgradeService) => _upgradeService = upgradeService; - - [HttpPost("authorize")] - [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)] - public async Task Authorize() - { - await _upgradeService.Upgrade(); - return Ok(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Upgrade/SettingsUpgradeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Upgrade/SettingsUpgradeController.cs deleted file mode 100644 index dec77cce3b..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Upgrade/SettingsUpgradeController.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Api.Management.ViewModels.Installer; -using Umbraco.New.Cms.Core.Factories; -using Umbraco.New.Cms.Core.Models.Installer; - -namespace Umbraco.Cms.Api.Management.Controllers.Upgrade; - -[ApiVersion("1.0")] -public class SettingsUpgradeController : UpgradeControllerBase -{ - private readonly IUpgradeSettingsFactory _upgradeSettingsFactory; - private readonly IUmbracoMapper _mapper; - - public SettingsUpgradeController( - IUpgradeSettingsFactory upgradeSettingsFactory, - IUmbracoMapper mapper) - { - _upgradeSettingsFactory = upgradeSettingsFactory; - _mapper = mapper; - } - - [HttpGet("settings")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(UpgradeSettingsViewModel), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)] - public async Task> Settings() - { - // TODO: Async - We need to figure out what we want to do with async endpoints that doesn't do anything async - // We want these to be async for future use (Ideally we'll have more async things), - // But we need to figure out how we want to handle it in the meantime? use Task.FromResult or? - UpgradeSettingsModel upgradeSettings = _upgradeSettingsFactory.GetUpgradeSettings(); - UpgradeSettingsViewModel viewModel = _mapper.Map(upgradeSettings)!; - - return await Task.FromResult(viewModel); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Upgrade/UpgradeControllerBase.cs b/src/Umbraco.Cms.Api.Management/Controllers/Upgrade/UpgradeControllerBase.cs deleted file mode 100644 index 80bb617ff8..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/Upgrade/UpgradeControllerBase.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Umbraco.Cms.Core; -using Umbraco.Cms.Api.Management.Filters; -using Umbraco.Cms.Api.Management.Routing; - -namespace Umbraco.Cms.Api.Management.Controllers.Upgrade; - -// TODO: This needs to be an authorized controller. - -[ApiController] -[RequireRuntimeLevel(RuntimeLevel.Upgrade)] -[VersionedApiBackOfficeRoute("upgrade")] -[ApiExplorerSettings(GroupName = "Upgrade")] -public abstract class UpgradeControllerBase : ManagementApiControllerBase -{ - -} diff --git a/src/Umbraco.Cms.Api.Management/DependencyInjection/BackOfficeAuthBuilderExtensions.cs b/src/Umbraco.Cms.Api.Management/DependencyInjection/BackOfficeAuthBuilderExtensions.cs deleted file mode 100644 index 332d744ba4..0000000000 --- a/src/Umbraco.Cms.Api.Management/DependencyInjection/BackOfficeAuthBuilderExtensions.cs +++ /dev/null @@ -1,168 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using OpenIddict.Validation.AspNetCore; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.DependencyInjection; -using Umbraco.Cms.Api.Management.Middleware; -using Umbraco.Cms.Api.Management.Security; -using Umbraco.Cms.Web.Common.Authorization; -using Umbraco.New.Cms.Infrastructure.HostedServices; -using Umbraco.New.Cms.Infrastructure.Security; - -namespace Umbraco.Cms.Api.Management.DependencyInjection; - -public static class BackOfficeAuthBuilderExtensions -{ - public static IUmbracoBuilder AddBackOfficeAuthentication(this IUmbracoBuilder builder) - { - builder - .AddDbContext() - .AddOpenIddict(); - - return builder; - } - - private static IUmbracoBuilder AddDbContext(this IUmbracoBuilder builder) - { - builder.Services.AddDbContext(options => - { - // Configure the DB context - // TODO: use actual Umbraco DbContext once EF is implemented - and remove dependency on Microsoft.EntityFrameworkCore.InMemory - options.UseInMemoryDatabase(nameof(DbContext)); - - // Register the entity sets needed by OpenIddict. - options.UseOpenIddict(); - }); - - return builder; - } - - private static IUmbracoBuilder AddOpenIddict(this IUmbracoBuilder builder) - { - builder.Services.AddAuthentication(); - builder.Services.AddAuthorization(CreatePolicies); - - builder.Services.AddOpenIddict() - - // Register the OpenIddict core components. - .AddCore(options => - { - options - .UseEntityFrameworkCore() - .UseDbContext(); - }) - - // Register the OpenIddict server components. - .AddServer(options => - { - // Enable the authorization and token endpoints. - options - .SetAuthorizationEndpointUris(Controllers.Security.Paths.BackOfficeApiAuthorizationEndpoint) - .SetTokenEndpointUris(Controllers.Security.Paths.BackOfficeApiTokenEndpoint); - - // Enable authorization code flow with PKCE - options - .AllowAuthorizationCodeFlow() - .RequireProofKeyForCodeExchange() - .AllowRefreshTokenFlow(); - - // Register the encryption and signing credentials. - // - see https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html - options - // TODO: use actual certificates here, see docs above - .AddDevelopmentEncryptionCertificate() - .AddDevelopmentSigningCertificate() - .DisableAccessTokenEncryption(); - - // Register the ASP.NET Core host and configure for custom authentication endpoint. - options - .UseAspNetCore() - .EnableAuthorizationEndpointPassthrough(); - - // Enable reference tokens - // - see https://documentation.openiddict.com/configuration/token-storage.html - options - .UseReferenceAccessTokens() - .UseReferenceRefreshTokens(); - - // Use ASP.NET Core Data Protection for tokens instead of JWT. - // This is more secure, and has the added benefit of having a high throughput - // but means that all servers (such as in a load balanced setup) - // needs to use the same application name and key ring, - // however this is already recommended for load balancing, so should be fine. - // See https://documentation.openiddict.com/configuration/token-formats.html#switching-to-data-protection-tokens - // and https://learn.microsoft.com/en-us/aspnet/core/security/data-protection/configuration/overview?view=aspnetcore-7.0 - // for more information - options.UseDataProtection(); - }) - - // Register the OpenIddict validation components. - .AddValidation(options => - { - // Import the configuration from the local OpenIddict server instance. - options.UseLocalServer(); - - // Register the ASP.NET Core host. - options.UseAspNetCore(); - - // Enable token entry validation - // - see https://documentation.openiddict.com/configuration/token-storage.html#enabling-token-entry-validation-at-the-api-level - options.EnableTokenEntryValidation(); - - // Use ASP.NET Core Data Protection for tokens instead of JWT. (see note in AddServer) - options.UseDataProtection(); - }); - - builder.Services.AddTransient(); - builder.Services.AddSingleton(); - - builder.Services.AddHostedService(); - builder.Services.AddHostedService(); - - return builder; - } - - // TODO: remove this once EF is implemented - public class DatabaseManager : IHostedService - { - private readonly IServiceProvider _serviceProvider; - - public DatabaseManager(IServiceProvider serviceProvider) => _serviceProvider = serviceProvider; - - public async Task StartAsync(CancellationToken cancellationToken) - { - using IServiceScope scope = _serviceProvider.CreateScope(); - - DbContext context = scope.ServiceProvider.GetRequiredService(); - await context.Database.EnsureCreatedAsync(cancellationToken); - - // TODO: add BackOfficeAuthorizationInitializationMiddleware before UseAuthorization (to make it run for unauthorized API requests) and remove this - IBackOfficeApplicationManager backOfficeApplicationManager = scope.ServiceProvider.GetRequiredService(); - await backOfficeApplicationManager.EnsureBackOfficeApplicationAsync(new Uri("https://localhost:44331/"), cancellationToken); - } - - public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; - } - - // TODO: move this to an appropriate location and implement the policy scheme that should be used for the new management APIs - private static void CreatePolicies(AuthorizationOptions options) - { - void AddPolicy(string policyName, string claimType, params string[] allowedClaimValues) - { - options.AddPolicy($"New{policyName}", policy => - { - policy.AuthenticationSchemes.Add(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme); - policy.RequireClaim(claimType, allowedClaimValues); - }); - } - - // NOTE: these are ONLY sample policies that allow us to test the new management APIs - AddPolicy(AuthorizationPolicies.SectionAccessContent, Constants.Security.AllowedApplicationsClaimType, Constants.Applications.Content); - AddPolicy(AuthorizationPolicies.SectionAccessForContentTree, Constants.Security.AllowedApplicationsClaimType, Constants.Applications.Content); - AddPolicy(AuthorizationPolicies.SectionAccessForMediaTree, Constants.Security.AllowedApplicationsClaimType, Constants.Applications.Media); - AddPolicy(AuthorizationPolicies.SectionAccessMedia, Constants.Security.AllowedApplicationsClaimType, Constants.Applications.Media); - AddPolicy(AuthorizationPolicies.SectionAccessContentOrMedia, Constants.Security.AllowedApplicationsClaimType, Constants.Applications.Content, Constants.Applications.Media); - } -} diff --git a/src/Umbraco.Cms.Api.Management/DependencyInjection/FactoryBuilderExtensions.cs b/src/Umbraco.Cms.Api.Management/DependencyInjection/FactoryBuilderExtensions.cs deleted file mode 100644 index b8d04c115c..0000000000 --- a/src/Umbraco.Cms.Api.Management/DependencyInjection/FactoryBuilderExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.New.Cms.Core.Factories; - -namespace Umbraco.Cms.Api.Management.DependencyInjection; - -public static class FactoryBuilderExtensions -{ - internal static IUmbracoBuilder AddFactories(this IUmbracoBuilder builder) - { - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - - return builder; - } -} diff --git a/src/Umbraco.Cms.Api.Management/DependencyInjection/InstallerBuilderExtensions.cs b/src/Umbraco.Cms.Api.Management/DependencyInjection/InstallerBuilderExtensions.cs deleted file mode 100644 index 263bb508a2..0000000000 --- a/src/Umbraco.Cms.Api.Management/DependencyInjection/InstallerBuilderExtensions.cs +++ /dev/null @@ -1,85 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Api.Management.Mapping.Dictionary; -using Umbraco.Cms.Api.Management.Mapping.Installer; -using Umbraco.Cms.Api.Management.Services.Entities; -using Umbraco.Cms.Api.Management.Services.Paging; -using Umbraco.New.Cms.Core.Factories; -using Umbraco.New.Cms.Core.Installer; -using Umbraco.New.Cms.Core.Installer.Steps; -using Umbraco.New.Cms.Core.Services.Installer; -using Umbraco.New.Cms.Infrastructure.Factories.Installer; -using Umbraco.New.Cms.Infrastructure.Installer.Steps; -using Umbraco.New.Cms.Web.Common.Installer; - -namespace Umbraco.Cms.Api.Management.DependencyInjection; - -public static class InstallerBuilderExtensions -{ - internal static IUmbracoBuilder AddNewInstaller(this IUmbracoBuilder builder) - { - IServiceCollection services = builder.Services; - - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - - builder.AddInstallSteps(); - services.AddTransient(); - - return builder; - } - - internal static IUmbracoBuilder AddUpgrader(this IUmbracoBuilder builder) - { - IServiceCollection services = builder.Services; - - services.AddTransient(); - builder.AddUpgradeSteps(); - services.AddTransient(); - - return builder; - } - - internal static IUmbracoBuilder AddInstallSteps(this IUmbracoBuilder builder) - { - builder.InstallSteps() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append(); - - return builder; - } - - public static NewInstallStepCollectionBuilder InstallSteps(this IUmbracoBuilder builder) - => builder.WithCollectionBuilder(); - - internal static IUmbracoBuilder AddUpgradeSteps(this IUmbracoBuilder builder) - { - builder.UpgradeSteps() - .Append() - .Append() - .Append() - .Append() - .Append() - .Append(); - - return builder; - } - - public static UpgradeStepCollectionBuilder UpgradeSteps(this IUmbracoBuilder builder) - => builder.WithCollectionBuilder(); - - internal static IUmbracoBuilder AddTrees(this IUmbracoBuilder builder) - { - builder.Services.AddTransient(); - return builder; - } -} diff --git a/src/Umbraco.Cms.Api.Management/DependencyInjection/MappingBuilderExtensions.cs b/src/Umbraco.Cms.Api.Management/DependencyInjection/MappingBuilderExtensions.cs deleted file mode 100644 index 4f1d5c5842..0000000000 --- a/src/Umbraco.Cms.Api.Management/DependencyInjection/MappingBuilderExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Umbraco.Cms.Core.DependencyInjection; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Api.Management.Mapping.Culture; -using Umbraco.Cms.Api.Management.Mapping.Dictionary; -using Umbraco.Cms.Api.Management.Mapping.HealthCheck; -using Umbraco.Cms.Api.Management.Mapping.Installer; -using Umbraco.Cms.Api.Management.Mapping.Languages; -using Umbraco.Cms.Api.Management.Mapping.Relation; -using Umbraco.Cms.Api.Management.Mapping.TrackedReferences; -using Umbraco.New.Cms.Infrastructure.Persistence.Mappers; - -namespace Umbraco.Cms.Api.Management.DependencyInjection; - -public static class MappingBuilderExtensions -{ - internal static IUmbracoBuilder AddMappers(this IUmbracoBuilder builder) - { - builder.WithCollectionBuilder() - .Add() - .Add() - .Add() - .Add() - .Add() - .Add() - .Add() - .Add(); - - return builder; - } -} diff --git a/src/Umbraco.Cms.Api.Management/DependencyInjection/SearchManagementBuilderExtensions.cs b/src/Umbraco.Cms.Api.Management/DependencyInjection/SearchManagementBuilderExtensions.cs deleted file mode 100644 index 726c076a62..0000000000 --- a/src/Umbraco.Cms.Api.Management/DependencyInjection/SearchManagementBuilderExtensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; -using Umbraco.Cms.Infrastructure.Examine; -using Umbraco.Cms.Api.Management.Factories; -using Umbraco.Cms.Api.Management.Services; -using Umbraco.New.Cms.Infrastructure.Services; - -namespace Umbraco.Cms.Api.Management.DependencyInjection; - -public static class SearchManagementBuilderExtensions -{ - internal static IUmbracoBuilder AddSearchManagement(this IUmbracoBuilder builder) - { - // Add examine service - builder.Services.AddTransient(); - builder.Services.AddTransient(); - - // Add factories - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - return builder; - } -} diff --git a/src/Umbraco.Cms.Api.Management/DependencyInjection/ServicesBuilderExtensions.cs b/src/Umbraco.Cms.Api.Management/DependencyInjection/ServicesBuilderExtensions.cs deleted file mode 100644 index dc1b60f31f..0000000000 --- a/src/Umbraco.Cms.Api.Management/DependencyInjection/ServicesBuilderExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; -using Umbraco.Cms.Core.Routing; -using Umbraco.Cms.Api.Management.Serialization; -using Umbraco.Cms.Api.Management.Services; -using Umbraco.Extensions; -using Umbraco.New.Cms.Core.Services.Installer; -using Umbraco.New.Cms.Core.Services.Languages; - -namespace Umbraco.Cms.Api.Management.DependencyInjection; - -public static class ServicesBuilderExtensions -{ - internal static IUmbracoBuilder AddServices(this IUmbracoBuilder builder) - { - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - - // TODO: handle new management API path in core UmbracoRequestPaths (it's a behavioural breaking change so it goes here for now) - builder.Services.Configure(options => - { - options.IsBackOfficeRequest = urlPath => urlPath.InvariantStartsWith($"/umbraco/management/api/"); - }); - - return builder; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/DictionaryFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/DictionaryFactory.cs deleted file mode 100644 index 651a806244..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/DictionaryFactory.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System.Xml; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Mapping; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Models; -using Umbraco.Cms.Api.Management.ViewModels.Dictionary; -using Umbraco.New.Cms.Core.Factories; - -namespace Umbraco.Cms.Api.Management.Factories; - -public class DictionaryFactory : IDictionaryFactory -{ - private readonly IUmbracoMapper _umbracoMapper; - private readonly ILocalizationService _localizationService; - private readonly IDictionaryService _dictionaryService; - private readonly CommonMapper _commonMapper; - - public DictionaryFactory( - IUmbracoMapper umbracoMapper, - ILocalizationService localizationService, - IDictionaryService dictionaryService, - CommonMapper commonMapper) - { - _umbracoMapper = umbracoMapper; - _localizationService = localizationService; - _dictionaryService = dictionaryService; - _commonMapper = commonMapper; - } - - public IDictionaryItem CreateDictionaryItem(DictionaryViewModel dictionaryViewModel) - { - IDictionaryItem mappedItem = _umbracoMapper.Map(dictionaryViewModel)!; - IDictionaryItem? dictionaryItem = _localizationService.GetDictionaryItemById(dictionaryViewModel.Key); - mappedItem.Id = dictionaryItem!.Id; - return mappedItem; - } - - public DictionaryViewModel CreateDictionaryViewModel(IDictionaryItem dictionaryItem) - { - DictionaryViewModel dictionaryViewModel = _umbracoMapper.Map(dictionaryItem)!; - - dictionaryViewModel.ContentApps = _commonMapper.GetContentAppsForEntity(dictionaryItem); - dictionaryViewModel.Path = _dictionaryService.CalculatePath(dictionaryItem.ParentId, dictionaryItem.Id); - - var translations = new List(); - // add all languages and the translations - foreach (ILanguage lang in _localizationService.GetAllLanguages()) - { - var langId = lang.Id; - IDictionaryTranslation? translation = dictionaryItem.Translations?.FirstOrDefault(x => x.LanguageId == langId); - - translations.Add(new DictionaryTranslationViewModel - { - IsoCode = lang.IsoCode, - DisplayName = lang.CultureName, - Translation = translation?.Value ?? string.Empty, - LanguageId = lang.Id, - Id = translation?.Id ?? 0, - Key = translation?.Key ?? Guid.Empty, - }); - } - - dictionaryViewModel.Translations = translations; - - return dictionaryViewModel; - } - - public DictionaryImportViewModel CreateDictionaryImportViewModel(FormFileUploadResult formFileUploadResult) - { - if (formFileUploadResult.CouldLoad is false || formFileUploadResult.XmlDocument is null) - { - throw new ArgumentNullException("The document of the FormFileUploadResult cannot be null"); - } - - var model = new DictionaryImportViewModel - { - TempFileName = formFileUploadResult.TemporaryPath, DictionaryItems = new List(), - }; - - var level = 1; - var currentParent = string.Empty; - foreach (XmlNode dictionaryItem in formFileUploadResult.XmlDocument.GetElementsByTagName("DictionaryItem")) - { - var name = dictionaryItem.Attributes?.GetNamedItem("Name")?.Value ?? string.Empty; - var parentKey = dictionaryItem?.ParentNode?.Attributes?.GetNamedItem("Key")?.Value ?? string.Empty; - - if (parentKey != currentParent || level == 1) - { - level += 1; - currentParent = parentKey; - } - - model.DictionaryItems.Add(new DictionaryItemsImportViewModel { Level = level, Name = name }); - } - - return model; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/HealthCheckGroupWithResultViewModelFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/HealthCheckGroupWithResultViewModelFactory.cs deleted file mode 100644 index c09dd6d5cc..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/HealthCheckGroupWithResultViewModelFactory.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Umbraco.Cms.Api.Management.ViewModels.HealthCheck; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.HealthChecks; -using Umbraco.Cms.Core.Mapping; - -namespace Umbraco.Cms.Api.Management.Factories; - -public class HealthCheckGroupWithResultViewModelFactory : IHealthCheckGroupWithResultViewModelFactory -{ - private readonly HealthChecksSettings _healthChecksSettings; - private readonly ILogger _logger; - private readonly IUmbracoMapper _umbracoMapper; - - public HealthCheckGroupWithResultViewModelFactory( - IOptions healthChecksSettings, - ILogger logger, - IUmbracoMapper umbracoMapper) - { - _healthChecksSettings = healthChecksSettings.Value; - _logger = logger; - _umbracoMapper = umbracoMapper; - } - - public IEnumerable> CreateGroupingFromHealthCheckCollection(HealthCheckCollection healthChecks) - { - IList disabledCheckIds = _healthChecksSettings.DisabledChecks - .Select(x => x.Id) - .ToList(); - - IEnumerable> groups = healthChecks - .Where(x => disabledCheckIds.Contains(x.Id) == false) - .GroupBy(x => x.Group) - .OrderBy(x => x.Key); - - return groups; - } - - public HealthCheckGroupWithResultViewModel CreateHealthCheckGroupWithResultViewModel(IGrouping healthCheckGroup) - { - var healthChecks = new List(); - - foreach (HealthCheck healthCheck in healthCheckGroup) - { - healthChecks.Add(CreateHealthCheckWithResultViewModel(healthCheck)); - } - - var healthCheckGroupViewModel = new HealthCheckGroupWithResultViewModel - { - Name = healthCheckGroup.Key, - Checks = healthChecks - }; - - return healthCheckGroupViewModel; - } - - public HealthCheckWithResultViewModel CreateHealthCheckWithResultViewModel(HealthCheck healthCheck) - { - _logger.LogDebug("Running health check: " + healthCheck.Name); - - IEnumerable results = healthCheck.GetStatus().Result; - - var healthCheckViewModel = new HealthCheckWithResultViewModel - { - Key = healthCheck.Id, - Name = healthCheck.Name, - Description = healthCheck.Description, - Results = _umbracoMapper.MapEnumerable(results) - }; - - return healthCheckViewModel; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/IDictionaryFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/IDictionaryFactory.cs deleted file mode 100644 index fb86b6aec0..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/IDictionaryFactory.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Api.Management.Models; -using Umbraco.Cms.Api.Management.ViewModels.Dictionary; - -namespace Umbraco.New.Cms.Core.Factories; - -public interface IDictionaryFactory -{ - IDictionaryItem CreateDictionaryItem(DictionaryViewModel dictionaryViewModel); - DictionaryViewModel CreateDictionaryViewModel(IDictionaryItem dictionaryItem); - - DictionaryImportViewModel CreateDictionaryImportViewModel(FormFileUploadResult formFileUploadResult); -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/IHealthCheckGroupWithResultViewModelFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/IHealthCheckGroupWithResultViewModelFactory.cs deleted file mode 100644 index 3ee0146b29..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/IHealthCheckGroupWithResultViewModelFactory.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Umbraco.Cms.Api.Management.ViewModels.HealthCheck; -using Umbraco.Cms.Core.HealthChecks; - -namespace Umbraco.Cms.Api.Management.Factories; - -public interface IHealthCheckGroupWithResultViewModelFactory -{ - IEnumerable> CreateGroupingFromHealthCheckCollection(HealthCheckCollection healthChecks); - - HealthCheckGroupWithResultViewModel CreateHealthCheckGroupWithResultViewModel(IGrouping healthCheckGroup); - - HealthCheckWithResultViewModel CreateHealthCheckWithResultViewModel(HealthCheck healthCheck); -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/IIndexViewModelFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/IIndexViewModelFactory.cs deleted file mode 100644 index 211606609a..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/IIndexViewModelFactory.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Examine; -using Umbraco.Cms.Api.Management.ViewModels.Search; - -namespace Umbraco.Cms.Api.Management.Factories; - -public interface IIndexViewModelFactory -{ - IndexViewModel Create(IIndex index); -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/IModelsBuilderViewModelFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/IModelsBuilderViewModelFactory.cs deleted file mode 100644 index dcaacaa750..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/IModelsBuilderViewModelFactory.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Umbraco.Cms.Api.Management.ViewModels.ModelsBuilderDashboard; - -namespace Umbraco.Cms.Api.Management.Factories; - -public interface IModelsBuilderViewModelFactory -{ - ModelsBuilderViewModel Create(); -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/IRedirectUrlStatusViewModelFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/IRedirectUrlStatusViewModelFactory.cs deleted file mode 100644 index 95b5a2614a..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/IRedirectUrlStatusViewModelFactory.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Umbraco.Cms.Api.Management.ViewModels.RedirectUrlManagement; - -namespace Umbraco.Cms.Api.Management.Factories; - -public interface IRedirectUrlStatusViewModelFactory -{ - RedirectUrlStatusViewModel CreateViewModel(); -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/IRedirectUrlViewModelFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/IRedirectUrlViewModelFactory.cs deleted file mode 100644 index 9ce0eb4c27..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/IRedirectUrlViewModelFactory.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Umbraco.Cms.Api.Management.ViewModels.RedirectUrlManagement; -using Umbraco.Cms.Core.Models; - -namespace Umbraco.Cms.Api.Management.Factories; - -public interface IRedirectUrlViewModelFactory -{ - RedirectUrlViewModel Create(IRedirectUrl source); - - IEnumerable CreateMany(IEnumerable sources); -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/IRelationViewModelFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/IRelationViewModelFactory.cs deleted file mode 100644 index 9a333a0cf4..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/IRelationViewModelFactory.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Api.Management.ViewModels.Relation; - -namespace Umbraco.Cms.Api.Management.Factories; - -public interface IRelationViewModelFactory -{ - RelationViewModel Create(IRelation relation); - - IEnumerable CreateMultiple(IEnumerable relations); -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/IndexViewModelFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/IndexViewModelFactory.cs deleted file mode 100644 index debf38995f..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/IndexViewModelFactory.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Examine; -using Umbraco.Cms.Core; -using Umbraco.Cms.Infrastructure.Examine; -using Umbraco.Cms.Api.Management.ViewModels.Search; -using Umbraco.New.Cms.Infrastructure.Services; - -namespace Umbraco.Cms.Api.Management.Factories; - -public class IndexViewModelFactory : IIndexViewModelFactory -{ - private readonly IIndexDiagnosticsFactory _indexDiagnosticsFactory; - private readonly IIndexRebuilder _indexRebuilder; - private readonly IIndexingRebuilderService _indexingRebuilderService; - - public IndexViewModelFactory(IIndexDiagnosticsFactory indexDiagnosticsFactory, IIndexRebuilder indexRebuilder, IIndexingRebuilderService indexingRebuilderService) - { - _indexDiagnosticsFactory = indexDiagnosticsFactory; - _indexRebuilder = indexRebuilder; - _indexingRebuilderService = indexingRebuilderService; - } - - public IndexViewModel Create(IIndex index) - { - if (_indexingRebuilderService.IsRebuilding(index.Name)) - { - return new IndexViewModel - { - Name = index.Name, - HealthStatus = "Rebuilding", - SearcherName = index.Searcher.Name, - DocumentCount = 0, - FieldCount = 0, - }; - } - - IIndexDiagnostics indexDiag = _indexDiagnosticsFactory.Create(index); - - Attempt isHealthy = indexDiag.IsHealthy(); - - var properties = new Dictionary(); - - foreach (var property in indexDiag.Metadata) - { - if (property.Value is null) - { - properties[property.Key] = null; - } - else - { - var propertyType = property.Value.GetType(); - properties[property.Key] = propertyType.IsClass && !propertyType.IsArray ? property.Value?.ToString() : property.Value; - } - } - - var indexerModel = new IndexViewModel - { - Name = index.Name, - HealthStatus = isHealthy.Success ? isHealthy.Result ?? "Healthy" : isHealthy.Result ?? "Unhealthy", - CanRebuild = _indexRebuilder.CanRebuild(index.Name), - SearcherName = index.Searcher.Name, - DocumentCount = indexDiag.GetDocumentCount(), - FieldCount = indexDiag.GetFieldNames().Count(), - ProviderProperties = properties, - }; - - return indexerModel; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/ModelsBuilderViewModelFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/ModelsBuilderViewModelFactory.cs deleted file mode 100644 index e9d2b658e1..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/ModelsBuilderViewModelFactory.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Text; -using Microsoft.Extensions.Options; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Configuration; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Infrastructure.ModelsBuilder; -using Umbraco.Cms.Api.Management.ViewModels.ModelsBuilderDashboard; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Factories; - -public class ModelsBuilderViewModelFactory : IModelsBuilderViewModelFactory -{ - private ModelsBuilderSettings _modelsBuilderSettings; - private readonly ModelsGenerationError _mbErrors; - private readonly OutOfDateModelsStatus _outOfDateModels; - - public ModelsBuilderViewModelFactory(IOptionsMonitor modelsBuilderSettings, ModelsGenerationError mbErrors, OutOfDateModelsStatus outOfDateModels) - { - _mbErrors = mbErrors; - _outOfDateModels = outOfDateModels; - _modelsBuilderSettings = modelsBuilderSettings.CurrentValue; - - modelsBuilderSettings.OnChange(x => _modelsBuilderSettings = x); - } - - - public ModelsBuilderViewModel Create() => - new() - { - Mode = _modelsBuilderSettings.ModelsMode, - CanGenerate = _modelsBuilderSettings.ModelsMode.SupportsExplicitGeneration(), - OutOfDateModels = _outOfDateModels.IsOutOfDate, - LastError = _mbErrors.GetLastError(), - Version = ApiVersion.Current.Version.ToString(), - ModelsNamespace = _modelsBuilderSettings.ModelsNamespace, - TrackingOutOfDateModels = _modelsBuilderSettings.FlagOutOfDateModels, - }; -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/RedirectUrlStatusViewModelFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/RedirectUrlStatusViewModelFactory.cs deleted file mode 100644 index 1db6772e39..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/RedirectUrlStatusViewModelFactory.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.Extensions.Options; -using Umbraco.Cms.Api.Management.ViewModels.RedirectUrlManagement; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.Security; -using Umbraco.Extensions; -using Umbraco.New.Cms.Core.Models.RedirectUrlManagement; - -namespace Umbraco.Cms.Api.Management.Factories; - -public class RedirectUrlStatusViewModelFactory : IRedirectUrlStatusViewModelFactory -{ - private readonly IOptionsMonitor _webRoutingSettings; - private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; - - public RedirectUrlStatusViewModelFactory( - IOptionsMonitor webRoutingSettings, - IBackOfficeSecurityAccessor backOfficeSecurityAccessor) - { - _webRoutingSettings = webRoutingSettings; - _backOfficeSecurityAccessor = backOfficeSecurityAccessor; - } - - public RedirectUrlStatusViewModel CreateViewModel() - { - RedirectStatus status = _webRoutingSettings.CurrentValue.DisableRedirectUrlTracking switch - { - true => RedirectStatus.Disabled, - false => RedirectStatus.Enabled - }; - - return new RedirectUrlStatusViewModel - { - Status = status, - // TODO: Ensure that CurrentUser can be found when we use the new auth. - UserIsAdmin = _backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser?.IsAdmin() ?? false, - }; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/RedirectUrlViewModelFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/RedirectUrlViewModelFactory.cs deleted file mode 100644 index b2da370586..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/RedirectUrlViewModelFactory.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Umbraco.Cms.Api.Management.ViewModels.RedirectUrlManagement; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Routing; - -namespace Umbraco.Cms.Api.Management.Factories; - -public class RedirectUrlViewModelFactory : IRedirectUrlViewModelFactory -{ - private readonly IPublishedUrlProvider _publishedUrlProvider; - - public RedirectUrlViewModelFactory(IPublishedUrlProvider publishedUrlProvider) - { - _publishedUrlProvider = publishedUrlProvider; - } - - public RedirectUrlViewModel Create(IRedirectUrl source) - { - var destinationUrl = source.ContentId > 0 - ? _publishedUrlProvider.GetUrl(source.ContentId, culture: source.Culture) - : "#"; - - var originalUrl = _publishedUrlProvider.GetUrlFromRoute(source.ContentId, source.Url, source.Culture); - - return new RedirectUrlViewModel - { - OriginalUrl = originalUrl, - DestinationUrl = destinationUrl, - ContentKey = source.ContentKey, - Created = source.CreateDateUtc, - Culture = source.Culture, - Key = source.Key, - }; - } - - public IEnumerable CreateMany(IEnumerable sources) - { - foreach (IRedirectUrl source in sources) - { - yield return Create(source); - } - } -} diff --git a/src/Umbraco.Cms.Api.Management/Factories/RelationViewModelFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/RelationViewModelFactory.cs deleted file mode 100644 index 368a4d999c..0000000000 --- a/src/Umbraco.Cms.Api.Management/Factories/RelationViewModelFactory.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Relation; - -namespace Umbraco.Cms.Api.Management.Factories; - -public class RelationViewModelFactory : IRelationViewModelFactory -{ - private readonly IRelationService _relationService; - private readonly IUmbracoMapper _umbracoMapper; - - public RelationViewModelFactory(IRelationService relationService, IUmbracoMapper umbracoMapper) - { - _relationService = relationService; - _umbracoMapper = umbracoMapper; - } - - public RelationViewModel Create(IRelation relation) - { - RelationViewModel relationViewModel = _umbracoMapper.Map(relation)!; - Tuple? entities = _relationService.GetEntitiesFromRelation(relation); - - if (entities is not null) - { - relationViewModel.ParentName = entities.Item1.Name; - relationViewModel.ChildName = entities.Item2.Name; - } - - return relationViewModel; - } - - public IEnumerable CreateMultiple(IEnumerable relations) => relations.Select(Create); -} diff --git a/src/Umbraco.Cms.Api.Management/Filters/RequireDocumentTreeRootAccessAttribute.cs b/src/Umbraco.Cms.Api.Management/Filters/RequireDocumentTreeRootAccessAttribute.cs deleted file mode 100644 index 7adb281f17..0000000000 --- a/src/Umbraco.Cms.Api.Management/Filters/RequireDocumentTreeRootAccessAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Membership; -using Umbraco.Cms.Core.Services; - -namespace Umbraco.Cms.Api.Management.Filters; - -public class RequireDocumentTreeRootAccessAttribute : RequireTreeRootAccessAttribute -{ - protected override int[] GetUserStartNodeIds(IUser user, ActionExecutingContext context) - { - AppCaches appCaches = context.HttpContext.RequestServices.GetRequiredService(); - IEntityService entityService = context.HttpContext.RequestServices.GetRequiredService(); - - return user.CalculateContentStartNodeIds(entityService, appCaches) ?? Array.Empty(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Filters/RequireMediaTreeRootAccessAttribute.cs b/src/Umbraco.Cms.Api.Management/Filters/RequireMediaTreeRootAccessAttribute.cs deleted file mode 100644 index 65fa1e4094..0000000000 --- a/src/Umbraco.Cms.Api.Management/Filters/RequireMediaTreeRootAccessAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Membership; -using Umbraco.Cms.Core.Services; - -namespace Umbraco.Cms.Api.Management.Filters; - -public class RequireMediaTreeRootAccessAttribute : RequireTreeRootAccessAttribute -{ - protected override int[] GetUserStartNodeIds(IUser user, ActionExecutingContext context) - { - AppCaches appCaches = context.HttpContext.RequestServices.GetRequiredService(); - IEntityService entityService = context.HttpContext.RequestServices.GetRequiredService(); - - return user.CalculateMediaStartNodeIds(entityService, appCaches) ?? Array.Empty(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Filters/RequireRuntimeLevelAttribute.cs b/src/Umbraco.Cms.Api.Management/Filters/RequireRuntimeLevelAttribute.cs deleted file mode 100644 index 23b767b6fe..0000000000 --- a/src/Umbraco.Cms.Api.Management/Filters/RequireRuntimeLevelAttribute.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Services; - -namespace Umbraco.Cms.Api.Management.Filters; - -public class RequireRuntimeLevelAttribute : ActionFilterAttribute -{ - private readonly RuntimeLevel _requiredRuntimeLevel; - - public RequireRuntimeLevelAttribute(RuntimeLevel requiredRuntimeLevel) => - _requiredRuntimeLevel = requiredRuntimeLevel; - - public override void OnActionExecuting(ActionExecutingContext context) - { - IRuntimeState runtimeState = context.HttpContext.RequestServices.GetRequiredService(); - if (runtimeState.Level == _requiredRuntimeLevel) - { - return; - } - - // We're not in the expected runtime level, so we need to short circuit - var problemDetails = new ProblemDetails - { - Title = "Invalid runtime level", - Detail = $"Runtime level {_requiredRuntimeLevel} is required", - Status = StatusCodes.Status428PreconditionRequired, - Type = "Error", - }; - - context.Result = new ObjectResult(problemDetails) { StatusCode = StatusCodes.Status428PreconditionRequired }; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Filters/RequireTreeRootAccessAttribute.cs b/src/Umbraco.Cms.Api.Management/Filters/RequireTreeRootAccessAttribute.cs deleted file mode 100644 index afe85fdc9c..0000000000 --- a/src/Umbraco.Cms.Api.Management/Filters/RequireTreeRootAccessAttribute.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models.Membership; -using Umbraco.Cms.Core.Security; - -namespace Umbraco.Cms.Api.Management.Filters; - -public abstract class RequireTreeRootAccessAttribute : ActionFilterAttribute -{ - public override void OnActionExecuting(ActionExecutingContext context) - { - IBackOfficeSecurityAccessor backOfficeSecurityAccessor = context.HttpContext.RequestServices.GetRequiredService(); - IUser? user = backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser; - - var startNodeIds = user != null ? GetUserStartNodeIds(user, context) : Array.Empty(); - - // TODO: remove this once we have backoffice auth in place - startNodeIds = new[] { Constants.System.Root }; - - if (startNodeIds.Contains(Constants.System.Root)) - { - return; - } - - var problemDetails = new ProblemDetails - { - Title = "Unauthorized user", - Detail = "The current backoffice user should have access to the tree root", - Status = StatusCodes.Status401Unauthorized, - Type = "Error", - }; - - context.Result = new ObjectResult(problemDetails) { StatusCode = StatusCodes.Status401Unauthorized }; - } - - protected abstract int[] GetUserStartNodeIds(IUser user, ActionExecutingContext context); -} diff --git a/src/Umbraco.Cms.Api.Management/ManagementApiComposer.cs b/src/Umbraco.Cms.Api.Management/ManagementApiComposer.cs deleted file mode 100644 index d7a967853e..0000000000 --- a/src/Umbraco.Cms.Api.Management/ManagementApiComposer.cs +++ /dev/null @@ -1,274 +0,0 @@ -using System.Text.Json; -using System.Text.Json.Serialization; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Diagnostics; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ApiExplorer; -using Microsoft.AspNetCore.Mvc.Versioning; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.FileProviders; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Options; -using Microsoft.OpenApi.Models; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Composing; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; -using Umbraco.Cms.Api.Common.Configuration; -using Umbraco.Cms.Api.Common.DependencyInjection; -using Umbraco.Cms.Api.Management.Controllers.Security; -using Umbraco.Cms.Api.Management.DependencyInjection; -using Umbraco.Cms.Api.Management.OpenApi; -using Umbraco.Cms.Infrastructure.Serialization; -using Umbraco.Cms.Web.Common.ApplicationBuilder; -using Umbraco.Extensions; -using Umbraco.New.Cms.Core.Models.Configuration; -using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment; - -namespace Umbraco.Cms.Api.Management; - -public class ManagementApiComposer : IComposer -{ - private const string ApiTitle = "Umbraco Backoffice API"; - private const string ApiDefaultDocumentName = "v1"; - - private ApiVersion DefaultApiVersion => new ApiVersion(1, 0); - - public void Compose(IUmbracoBuilder builder) - { - // TODO Should just call a single extension method that can be called fromUmbracoTestServerTestBase too, instead of calling this method - - IServiceCollection services = builder.Services; - - builder - .AddNewInstaller() - .AddUpgrader() - .AddSearchManagement() - .AddFactories() - .AddTrees() - .AddFactories() - .AddServices() - .AddMappers() - .AddBackOfficeAuthentication(); - - services.ConfigureOptions(); - services.AddApiVersioning(); - - services.AddSwaggerGen(swaggerGenOptions => - { - swaggerGenOptions.CustomOperationIds(e => - { - var httpMethod = e.HttpMethod?.ToLower().ToFirstUpper() ?? "Get"; - - // if the route info "Name" is supplied we'll use this explicitly as the operation ID - // - usage example: [HttpGet("my-api/route}", Name = "MyCustomRoute")] - if (string.IsNullOrWhiteSpace(e.ActionDescriptor.AttributeRouteInfo?.Name) == false) - { - var explicitOperationId = e.ActionDescriptor.AttributeRouteInfo!.Name; - return explicitOperationId.InvariantStartsWith(httpMethod) - ? explicitOperationId - : $"{httpMethod}{explicitOperationId}"; - } - - var relativePath = e.RelativePath; - - if (string.IsNullOrWhiteSpace(relativePath)) - { - throw new Exception( - $"There is no relative path for controller action {e.ActionDescriptor.RouteValues["controller"]}"); - } - - // Remove the prefixed base path with version, e.g. /umbraco/management/api/v1/tracked-reference/{id} => tracked-reference/{id} - var unprefixedRelativePath = - OperationIdRegexes.VersionPrefixRegex().Replace(relativePath, string.Empty); - - // Remove template placeholders, e.g. tracked-reference/{id} => tracked-reference/Id - var formattedOperationId = OperationIdRegexes.TemplatePlaceholdersRegex() - .Replace(unprefixedRelativePath, m => $"By{m.Groups[1].Value.ToFirstUpper()}"); - - // Remove dashes (-) and slashes (/) and convert the following letter to uppercase with - // the word "By" in front, e.g. tracked-reference/Id => TrackedReferenceById - formattedOperationId = OperationIdRegexes.ToCamelCaseRegex() - .Replace(formattedOperationId, m => m.Groups[1].Value.ToUpper()); - - // Return the operation ID with the formatted http method verb in front, e.g. GetTrackedReferenceById - return $"{httpMethod}{formattedOperationId.ToFirstUpper()}"; - }); - swaggerGenOptions.SwaggerDoc( - ApiDefaultDocumentName, - new OpenApiInfo - { - Title = ApiTitle, - Version = DefaultApiVersion.ToString(), - Description = - "This shows all APIs available in this version of Umbraco - including all the legacy apis that are available for backward compatibility" - }); - - swaggerGenOptions.DocInclusionPredicate((_, api) => !string.IsNullOrWhiteSpace(api.GroupName)); - - swaggerGenOptions.TagActionsBy(api => new[] { api.GroupName }); - - // see https://github.com/domaindrivendev/Swashbuckle.AspNetCore#change-operation-sort-order-eg-for-ui-sorting - string ActionSortKeySelector(ApiDescription apiDesc) - { - return - $"{apiDesc.GroupName}_{apiDesc.ActionDescriptor.AttributeRouteInfo?.Template ?? apiDesc.ActionDescriptor.RouteValues["controller"]}_{apiDesc.ActionDescriptor.RouteValues["action"]}_{apiDesc.HttpMethod}"; - } - - swaggerGenOptions.OrderActionsBy(ActionSortKeySelector); - - swaggerGenOptions.AddSecurityDefinition( - "OAuth", - new OpenApiSecurityScheme - { - In = ParameterLocation.Header, - Name = "Umbraco", - Type = SecuritySchemeType.OAuth2, - Description = "Umbraco Authentication", - Flows = new OpenApiOAuthFlows - { - AuthorizationCode = new OpenApiOAuthFlow - { - AuthorizationUrl = - new Uri(Paths.BackOfficeApiAuthorizationEndpoint, UriKind.Relative), - TokenUrl = new Uri(Paths.BackOfficeApiTokenEndpoint, UriKind.Relative) - } - } - }); - - swaggerGenOptions.AddSecurityRequirement(new OpenApiSecurityRequirement - { - // this weird looking construct works because OpenApiSecurityRequirement - // is a specialization of Dictionary<,> - { - new OpenApiSecurityScheme - { - Reference = new OpenApiReference { Id = "OAuth", Type = ReferenceType.SecurityScheme } - }, - new List() - } - }); - - swaggerGenOptions.DocumentFilter(); - swaggerGenOptions.SchemaFilter(); - - swaggerGenOptions.CustomSchemaIds(SchemaIdGenerator.Generate); - }); - - - services.ConfigureOptions(); - services.AddVersionedApiExplorer(); - services.AddControllers() - .AddJsonOptions(options => - { - // any generic JSON options go here - }) - .AddJsonOptions(Umbraco.New.Cms.Core.Constants.JsonOptionsNames.BackOffice, options => - { - // all back-office specific JSON options go here - options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; - options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); - options.JsonSerializerOptions.Converters.Add(new JsonObjectConverter()); - }); - builder.Services.ConfigureOptions(); - - // TODO: when this is moved to core, make the AddUmbracoOptions extension private again and remove core InternalsVisibleTo for Umbraco.Cms.Api.Management - builder.AddUmbracoOptions(); - builder.Services.AddSingleton, NewBackOfficeSettingsValidator>(); - - builder.Services.Configure(options => - { - options.AddFilter(new UmbracoPipelineFilter( - "BackofficeSwagger", - applicationBuilder => - { - // Only use the API exception handler when we are requesting an API - applicationBuilder.UseWhen( - httpContext => - { - GlobalSettings? settings = httpContext.RequestServices - .GetRequiredService>().Value; - IHostingEnvironment hostingEnvironment = - httpContext.RequestServices.GetRequiredService(); - var officePath = settings.GetBackOfficePath(hostingEnvironment); - - return httpContext.Request.Path.Value?.StartsWith($"{officePath}/management/api/") ?? false; - }, - innerBuilder => - { - innerBuilder.UseExceptionHandler(exceptionBuilder => exceptionBuilder.Run(async context => - { - Exception? exception = context.Features.Get()?.Error; - if (exception is null) - { - return; - } - - var response = new ProblemDetails - { - Title = exception.Message, - Detail = exception.StackTrace, - Status = StatusCodes.Status500InternalServerError, - Instance = exception.GetType().Name, - Type = "Error" - }; - await context.Response.WriteAsJsonAsync(response); - })); - }); - }, - applicationBuilder => - { - IServiceProvider provider = applicationBuilder.ApplicationServices; - IWebHostEnvironment webHostEnvironment = provider.GetRequiredService(); - - if (!webHostEnvironment.IsProduction()) - { - GlobalSettings? settings = provider.GetRequiredService>().Value; - IHostingEnvironment hostingEnvironment = provider.GetRequiredService(); - var officePath = settings.GetBackOfficePath(hostingEnvironment); - - applicationBuilder.UseSwagger(swaggerOptions => - { - swaggerOptions.RouteTemplate = - $"{officePath.TrimStart(Constants.CharArrays.ForwardSlash)}/swagger/{{documentName}}/swagger.json"; - }); - applicationBuilder.UseSwaggerUI( - swaggerUiOptions => - { - swaggerUiOptions.SwaggerEndpoint( - $"{officePath}/swagger/v1/swagger.json", - $"{ApiTitle} {DefaultApiVersion}"); - swaggerUiOptions.RoutePrefix = - $"{officePath.TrimStart(Constants.CharArrays.ForwardSlash)}/swagger"; - - swaggerUiOptions.OAuthClientId(New.Cms.Core.Constants.OauthClientIds.Swagger); - swaggerUiOptions.OAuthUsePkce(); - }); - } - }, - applicationBuilder => - { - IServiceProvider provider = applicationBuilder.ApplicationServices; - - applicationBuilder.UseEndpoints(endpoints => - { - GlobalSettings? settings = provider.GetRequiredService>().Value; - IHostingEnvironment hostingEnvironment = provider.GetRequiredService(); - var officePath = settings.GetBackOfficePath(hostingEnvironment); - // Maps attribute routed controllers. - endpoints.MapControllers(); - - // Serve contract - endpoints.MapGet($"{officePath}/management/api/openapi.json", async context => - { - await context.Response.SendFileAsync( - new EmbeddedFileProvider(GetType().Assembly).GetFileInfo("OpenApi.json")); - }); - }); - })); - }); - } -} - diff --git a/src/Umbraco.Cms.Api.Management/Mapping/Culture/CultureViewModelMapDefinition.cs b/src/Umbraco.Cms.Api.Management/Mapping/Culture/CultureViewModelMapDefinition.cs deleted file mode 100644 index 71e0b26857..0000000000 --- a/src/Umbraco.Cms.Api.Management/Mapping/Culture/CultureViewModelMapDefinition.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Globalization; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Api.Management.ViewModels.Culture; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; - -namespace Umbraco.Cms.Api.Management.Mapping.Culture; - -/// -public class CultureViewModelMapDefinition : IMapDefinition -{ - /// - public void DefineMaps(IUmbracoMapper mapper) - { - mapper.Define, PagedViewModel>((source, context) => new PagedViewModel(), Map); - mapper.Define((source, context) => new CultureViewModel(), Map); - } - - // Umbraco.Code.MapAll - private static void Map(CultureInfo source, CultureViewModel target, MapperContext context) - { - target.Name = source.Name; - target.EnglishName = source.EnglishName; - } - - // Umbraco.Code.MapAll - private static void Map(IEnumerable source, PagedViewModel target, MapperContext context) - { - CultureInfo[] cultureInfos = source.ToArray(); - target.Items = context.MapEnumerable(cultureInfos); - target.Total = cultureInfos.Length; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Mapping/Dictionary/DictionaryViewModelMapDefinition.cs b/src/Umbraco.Cms.Api.Management/Mapping/Dictionary/DictionaryViewModelMapDefinition.cs deleted file mode 100644 index f0721bb032..0000000000 --- a/src/Umbraco.Cms.Api.Management/Mapping/Dictionary/DictionaryViewModelMapDefinition.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.ContentEditing; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.ViewModels.Dictionary; - -namespace Umbraco.Cms.Api.Management.Mapping.Dictionary; - -public class DictionaryViewModelMapDefinition : IMapDefinition -{ - private readonly ILocalizationService _localizationService; - - public DictionaryViewModelMapDefinition(ILocalizationService localizationService) => _localizationService = localizationService; - - public void DefineMaps(IUmbracoMapper mapper) - { - mapper.Define((source, context) => new DictionaryItem(string.Empty), Map); - mapper.Define((source, context) => new DictionaryViewModel(), Map); - mapper.Define((source, context) => new DictionaryTranslation(source.LanguageId, string.Empty), Map); - mapper.Define((source, context) => new DictionaryOverviewViewModel(), Map); - - } - - // Umbraco.Code.MapAll -Id -CreateDate -UpdateDate - private void Map(DictionaryViewModel source, IDictionaryItem target, MapperContext context) - { - target.ItemKey = source.Name!; - target.Key = source.Key; - target.ParentId = source.ParentId; - target.Translations = context.MapEnumerable(source.Translations); - target.DeleteDate = null; - } - - // Umbraco.Code.MapAll -CreateDate -DeleteDate -UpdateDate -Language - private void Map(DictionaryTranslationViewModel source, IDictionaryTranslation target, MapperContext context) - { - target.Value = source.Translation; - target.Id = source.Id; - target.Key = source.Key; - } - - // Umbraco.Code.MapAll -Icon -Trashed -Alias -NameIsDirty -ContentApps -Path -Translations - private void Map(IDictionaryItem source, DictionaryViewModel target, MapperContext context) - { - target.Key = source.Key; - target.Name = source.ItemKey; - target.ParentId = source.ParentId ?? null; - } - - // Umbraco.Code.MapAll -Level -Translations - private void Map(IDictionaryItem source, DictionaryOverviewViewModel target, MapperContext context) - { - target.Key = source.Key; - target.Name = source.ItemKey; - - // add all languages and the translations - foreach (ILanguage lang in _localizationService.GetAllLanguages()) - { - var langId = lang.Id; - IDictionaryTranslation? translation = source.Translations?.FirstOrDefault(x => x.LanguageId == langId); - - target.Translations.Add( - new DictionaryTranslationOverviewViewModel - { - DisplayName = lang.CultureName, - HasTranslation = translation != null && string.IsNullOrEmpty(translation.Value) == false, - }); - } - } -} diff --git a/src/Umbraco.Cms.Api.Management/Mapping/HealthCheck/HealthCheckViewModelsMapDefinition.cs b/src/Umbraco.Cms.Api.Management/Mapping/HealthCheck/HealthCheckViewModelsMapDefinition.cs deleted file mode 100644 index bc70fd5f7b..0000000000 --- a/src/Umbraco.Cms.Api.Management/Mapping/HealthCheck/HealthCheckViewModelsMapDefinition.cs +++ /dev/null @@ -1,80 +0,0 @@ -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.Cms.Api.Management.ViewModels.HealthCheck; -using Umbraco.Cms.Core.HealthChecks; -using Umbraco.Cms.Core.Mapping; - -namespace Umbraco.Cms.Api.Management.Mapping.HealthCheck; - -public class HealthCheckViewModelsMapDefinition : IMapDefinition -{ - public void DefineMaps(IUmbracoMapper mapper) - { - mapper.Define((source, context) => new HealthCheckAction(), Map); - mapper.Define((source, context) => new HealthCheckActionViewModel() { ValueRequired = false }, Map); - mapper.Define((source, context) => new HealthCheckResultViewModel() { Message = string.Empty }, Map); - mapper.Define((source, context) => new HealthCheckViewModel() { Name = string.Empty }, Map); - mapper.Define, HealthCheckGroupViewModel>((source, context) => new HealthCheckGroupViewModel() { Checks = new List() }, Map); - mapper.Define>, PagedViewModel>((source, context) => new PagedViewModel(), Map); - } - - // Umbraco.Code.MapAll -ActionParameters - private static void Map(HealthCheckActionViewModel source, HealthCheckAction target, MapperContext context) - { - target.Alias = source.Alias; - target.HealthCheckId = source.HealthCheckKey; - target.Name = source.Name; - target.Description = source.Description; - target.ValueRequired = source.ValueRequired; - target.ProvidedValueValidation = source.ProvidedValueValidation; - target.ProvidedValueValidationRegex = source.ProvidedValueValidationRegex; - target.ProvidedValue = source.ProvidedValue; - } - - // Umbraco.Code.MapAll - private static void Map(HealthCheckAction source, HealthCheckActionViewModel target, MapperContext context) - { - if (source.HealthCheckId is not null) - { - target.HealthCheckKey = (Guid)source.HealthCheckId; - } - - target.Alias = source.Alias; - target.Name = source.Name; - target.Description = source.Description; - target.ValueRequired = source.ValueRequired; - target.ProvidedValue = source.ProvidedValue; - target.ProvidedValueValidation = source.ProvidedValueValidation; - target.ProvidedValueValidationRegex = source.ProvidedValueValidationRegex; - } - - // Umbraco.Code.MapAll - private static void Map(HealthCheckStatus source, HealthCheckResultViewModel target, MapperContext context) - { - target.Message = source.Message; - target.ResultType = source.ResultType; - target.ReadMoreLink = source.ReadMoreLink; - target.Actions = context.MapEnumerable(source.Actions); - } - - // Umbraco.Code.MapAll - private static void Map(Core.HealthChecks.HealthCheck source, HealthCheckViewModel target, MapperContext context) - { - target.Key = source.Id; - target.Name = source.Name; - target.Description = source.Description; - } - - // Umbraco.Code.MapAll - private static void Map(IGrouping source, HealthCheckGroupViewModel target, MapperContext context) - { - target.Name = source.Key; - target.Checks = context.MapEnumerable(source.OrderBy(x => x.Name)); - } - - // Umbraco.Code.MapAll - private static void Map(IEnumerable> source, PagedViewModel target, MapperContext context) - { - target.Items = context.MapEnumerable, HealthCheckGroupViewModel>(source); - target.Total = source.Count(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Mapping/Installer/InstallerViewModelsMapDefinition.cs b/src/Umbraco.Cms.Api.Management/Mapping/Installer/InstallerViewModelsMapDefinition.cs deleted file mode 100644 index fa3df994f7..0000000000 --- a/src/Umbraco.Cms.Api.Management/Mapping/Installer/InstallerViewModelsMapDefinition.cs +++ /dev/null @@ -1,144 +0,0 @@ -using Umbraco.Cms.Core.Install.Models; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Infrastructure.Persistence; -using Umbraco.Cms.Api.Management.ViewModels.Installer; -using Umbraco.New.Cms.Core.Models.Installer; - -namespace Umbraco.Cms.Api.Management.Mapping.Installer; - -public class InstallerViewModelsMapDefinition : IMapDefinition -{ - public void DefineMaps(IUmbracoMapper mapper) - { - mapper.Define((source, context) => new InstallData(), Map); - mapper.Define((source, context) => new UserInstallData(), Map); - mapper.Define((source, context) => new DatabaseInstallData(), Map); - mapper.Define((source, context) => new DatabaseModel(), Map); - mapper.Define((source, context) => new DatabaseModel(), Map); - mapper.Define((source, context) => new InstallSettingsViewModel(), Map); - mapper.Define((source, context) => new UserSettingsViewModel(), Map); - mapper.Define((source, context) => new DatabaseSettingsModel(), Map); - mapper.Define((source, context) => new DatabaseSettingsViewModel(), Map); - mapper.Define((source, context) => new ConsentLevelViewModel(), Map); - mapper.Define((source, context) => new UpgradeSettingsViewModel(), Map); - } - - // Umbraco.Code.MapAll - private void Map(UpgradeSettingsModel source, UpgradeSettingsViewModel target, MapperContext context) - { - target.CurrentState = source.CurrentState; - target.NewState = source.NewState; - target.NewVersion = source.NewVersion.ToString(); - target.OldVersion = source.OldVersion.ToString(); - } - - // Umbraco.Code.MapAll - private void Map(DatabaseInstallViewModel source, DatabaseModel target, MapperContext context) - { - target.ConnectionString = source.ConnectionString; - target.DatabaseName = source.Name ?? string.Empty; - target.DatabaseProviderMetadataId = source.Id; - target.IntegratedAuth = source.UseIntegratedAuthentication; - target.Login = source.Username; - target.Password = source.Password; - target.ProviderName = source.ProviderName; - target.Server = source.Server!; - } - - // Umbraco.Code.MapAll - private static void Map(InstallViewModel source, InstallData target, MapperContext context) - { - target.TelemetryLevel = source.TelemetryLevel; - target.User = context.Map(source.User)!; - target.Database = context.Map(source.Database)!; - } - - // Umbraco.Code.MapAll - private static void Map(UserInstallViewModel source, UserInstallData target, MapperContext context) - { - target.Email = source.Email; - target.Name = source.Name; - target.Password = source.Password; - target.SubscribeToNewsletter = source.SubscribeToNewsletter; - } - - // Umbraco.Code.MapAll - private static void Map(DatabaseInstallViewModel source, DatabaseInstallData target, MapperContext context) - { - target.Id = source.Id; - target.ProviderName = source.ProviderName; - target.Server = source.Server; - target.Name = source.Name; - target.Username = source.Username; - target.Password = source.Password; - target.UseIntegratedAuthentication = source.UseIntegratedAuthentication; - target.ConnectionString = source.ConnectionString; - } - - // Umbraco.Code.MapAll - private static void Map(DatabaseInstallData source, DatabaseModel target, MapperContext context) - { - target.ConnectionString = source.ConnectionString; - target.DatabaseName = source.Name ?? string.Empty; - target.DatabaseProviderMetadataId = source.Id; - target.IntegratedAuth = source.UseIntegratedAuthentication; - target.Login = source.Username; - target.Password = source.Password; - target.ProviderName = source.ProviderName; - target.Server = source.Server!; - } - - // Umbraco.Code.MapAll - private static void Map(InstallSettingsModel source, InstallSettingsViewModel target, MapperContext context) - { - target.User = context.Map(source.UserSettings)!; - target.Databases = context.MapEnumerable(source.DatabaseSettings); - } - - // Umbraco.Code.MapAll - private static void Map(UserSettingsModel source, UserSettingsViewModel target, MapperContext context) - { - target.MinCharLength = source.PasswordSettings.MinCharLength; - target.MinNonAlphaNumericLength = source.PasswordSettings.MinNonAlphaNumericLength; - target.ConsentLevels = context.MapEnumerable(source.ConsentLevels); - } - - // Umbraco.Code.MapAll - private static void Map(IDatabaseProviderMetadata source, DatabaseSettingsModel target, MapperContext context) - { - target.DefaultDatabaseName = source.DefaultDatabaseName; - target.DisplayName = source.DisplayName; - target.Id = source.Id; - target.ProviderName = source.ProviderName ?? string.Empty; - target.RequiresConnectionTest = source.RequiresConnectionTest; - target.RequiresCredentials = source.RequiresCredentials; - target.RequiresServer = source.RequiresServer; - target.ServerPlaceholder = source.ServerPlaceholder ?? string.Empty; - target.SortOrder = source.SortOrder; - target.SupportsIntegratedAuthentication = source.SupportsIntegratedAuthentication; - target.IsConfigured = false; // Defaults to false, we'll set this to true if needed, - } - - // Umbraco.Code.MapAll - private static void Map(DatabaseSettingsModel source, DatabaseSettingsViewModel target, MapperContext context) - { - target.DefaultDatabaseName = source.DefaultDatabaseName; - target.DisplayName = source.DisplayName; - target.Id = source.Id; - target.IsConfigured = source.IsConfigured; - target.ProviderName = source.ProviderName; - target.RequiresConnectionTest = source.RequiresConnectionTest; - target.RequiresCredentials = source.RequiresCredentials; - target.RequiresServer = source.RequiresServer; - target.ServerPlaceholder = source.ServerPlaceholder; - target.SortOrder = source.SortOrder; - target.SupportsIntegratedAuthentication = source.SupportsIntegratedAuthentication; - } - - // Umbraco.Code.MapAll - private static void Map(ConsentLevelModel source, ConsentLevelViewModel target, MapperContext context) - { - target.Description = source.Description; - target.Level = source.Level; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Mapping/Languages/LanguageViewModelsMapDefinition.cs b/src/Umbraco.Cms.Api.Management/Mapping/Languages/LanguageViewModelsMapDefinition.cs deleted file mode 100644 index 289f8636c9..0000000000 --- a/src/Umbraco.Cms.Api.Management/Mapping/Languages/LanguageViewModelsMapDefinition.cs +++ /dev/null @@ -1,70 +0,0 @@ -using NPoco.FluentMappings; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Api.Management.ViewModels.Language; -using Umbraco.Cms.Api.Common.ViewModels.Pagination; -using Umbraco.New.Cms.Core.Models; - -namespace Umbraco.Cms.Api.Management.Mapping.Languages; - -public class LanguageViewModelsMapDefinition : IMapDefinition -{ - public void DefineMaps(IUmbracoMapper mapper) - { - mapper.Define((source, context) => new Language(string.Empty, string.Empty), Map); - mapper.Define((source, context) => new LanguageViewModel(), Map); - mapper.Define, PagedViewModel>((source, context) => new PagedViewModel(), Map); - - } - - // Umbraco.Code.MapAll - private static void Map(ILanguage source, LanguageViewModel target, MapperContext context) - { - target.Id = source.Id; - target.IsoCode = source.IsoCode; - target.Name = source.CultureName; - target.IsDefault = source.IsDefault; - target.IsMandatory = source.IsMandatory; - target.FallbackLanguageId = source.FallbackLanguageId; - } - - - // Umbraco.Code.MapAll - private static void Map(LanguageViewModel source, ILanguage target, MapperContext context) - { - target.CreateDate = default; - if (!string.IsNullOrEmpty(source.Name)) - { - target.CultureName = source.Name; - } - - target.DeleteDate = null; - target.FallbackLanguageId = source.FallbackLanguageId; - target.Id = source.Id; - target.IsDefault = source.IsDefault; - target.IsMandatory = source.IsMandatory; - target.IsoCode = source.IsoCode; - target.Key = default; - target.UpdateDate = default; - } - - private static void Map(PagedModel source, PagedViewModel target, MapperContext context) - { - List temp = context.MapEnumerable(source.Items); - - // Put the default language first in the list & then sort rest by a-z - LanguageViewModel? defaultLang = temp.SingleOrDefault(x => x.IsDefault); - - var languages = new List(); - - // insert default lang first, then remaining language a-z - if (defaultLang is not null) - { - languages.Add(defaultLang); - languages.AddRange(temp.Where(x => x != defaultLang).OrderBy(x => x.Name)); - } - - target.Items = languages; - target.Total = source.Total; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Mapping/Relation/RelationViewModelsMapDefinition.cs b/src/Umbraco.Cms.Api.Management/Mapping/Relation/RelationViewModelsMapDefinition.cs deleted file mode 100644 index b2b0acb88e..0000000000 --- a/src/Umbraco.Cms.Api.Management/Mapping/Relation/RelationViewModelsMapDefinition.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Api.Management.ViewModels.Relation; - -namespace Umbraco.Cms.Api.Management.Mapping.Relation; - -public class RelationViewModelsMapDefinition : IMapDefinition -{ - public void DefineMaps(IUmbracoMapper mapper) - { - mapper.Define((source, context) => new RelationViewModel(), Map); - } - - // Umbraco.Code.MapAll -ParentName -ChildName - private void Map(IRelation source, RelationViewModel target, MapperContext context) - { - target.ChildId = source.ChildId; - target.Comment = source.Comment; - target.CreateDate = source.CreateDate; - target.ParentId = source.ParentId; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Mapping/TrackedReferences/TrackedReferenceViewModelsMapDefinition.cs b/src/Umbraco.Cms.Api.Management/Mapping/TrackedReferences/TrackedReferenceViewModelsMapDefinition.cs deleted file mode 100644 index 9b36669fcf..0000000000 --- a/src/Umbraco.Cms.Api.Management/Mapping/TrackedReferences/TrackedReferenceViewModelsMapDefinition.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Api.Management.ViewModels.TrackedReferences; - -namespace Umbraco.Cms.Api.Management.Mapping.TrackedReferences; - -public class TrackedReferenceViewModelsMapDefinition : IMapDefinition -{ - public void DefineMaps(IUmbracoMapper mapper) - { - mapper.Define((source, context) => new RelationItemViewModel(), Map); - } - - // Umbraco.Code.MapAll - private void Map(RelationItemModel source, RelationItemViewModel target, MapperContext context) - { - target.ContentTypeAlias = source.ContentTypeAlias; - target.ContentTypeIcon = source.ContentTypeIcon; - target.ContentTypeName = source.ContentTypeName; - target.NodeKey = source.NodeKey; - target.NodeName = source.NodeName; - target.NodeType = source.NodeType; - target.RelationTypeIsBidirectional = source.RelationTypeIsBidirectional; - target.RelationTypeIsDependency = source.RelationTypeIsDependency; - target.RelationTypeName = source.RelationTypeName; - } - -} diff --git a/src/Umbraco.Cms.Api.Management/Middleware/BackOfficeAuthorizationInitializationMiddleware.cs b/src/Umbraco.Cms.Api.Management/Middleware/BackOfficeAuthorizationInitializationMiddleware.cs deleted file mode 100644 index ab2d69e496..0000000000 --- a/src/Umbraco.Cms.Api.Management/Middleware/BackOfficeAuthorizationInitializationMiddleware.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Extensions; -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.Routing; -using Umbraco.New.Cms.Infrastructure.Security; - -namespace Umbraco.Cms.Api.Management.Middleware; - -public class BackOfficeAuthorizationInitializationMiddleware : IMiddleware -{ - private static bool _firstBackOfficeRequest; - private static SemaphoreSlim _firstBackOfficeRequestLocker = new(1); - - private readonly UmbracoRequestPaths _umbracoRequestPaths; - private readonly IServiceProvider _serviceProvider; - - public BackOfficeAuthorizationInitializationMiddleware(UmbracoRequestPaths umbracoRequestPaths, IServiceProvider serviceProvider) - { - _umbracoRequestPaths = umbracoRequestPaths; - _serviceProvider = serviceProvider; - } - - public async Task InvokeAsync(HttpContext context, RequestDelegate next) - { - await InitializeBackOfficeAuthorizationOnceAsync(context); - await next(context); - } - - private async Task InitializeBackOfficeAuthorizationOnceAsync(HttpContext context) - { - if (_firstBackOfficeRequest) - { - return; - } - - if (_umbracoRequestPaths.IsBackOfficeRequest(context.Request.Path) == false) - { - return; - } - - await _firstBackOfficeRequestLocker.WaitAsync(); - if (_firstBackOfficeRequest == false) - { - using IServiceScope scope = _serviceProvider.CreateScope(); - IBackOfficeApplicationManager backOfficeApplicationManager = scope.ServiceProvider.GetRequiredService(); - await backOfficeApplicationManager.EnsureBackOfficeApplicationAsync(new Uri(context.Request.GetDisplayUrl())); - _firstBackOfficeRequest = true; - } - - _firstBackOfficeRequestLocker.Release(); - } -} - -// TODO: remove this (used for testing BackOfficeAuthorizationInitializationMiddleware until it can be added to the existing UseBackOffice extension) -// public static class UmbracoApplicationBuilderExtensions -// { -// public static IUmbracoApplicationBuilderContext UseNewBackOffice(this IUmbracoApplicationBuilderContext builder) -// { -// builder.AppBuilder.UseMiddleware(); -// return builder; -// } -// } diff --git a/src/Umbraco.Cms.Api.Management/Models/Entities/UserAccessEntity.cs b/src/Umbraco.Cms.Api.Management/Models/Entities/UserAccessEntity.cs deleted file mode 100644 index 4976b769dd..0000000000 --- a/src/Umbraco.Cms.Api.Management/Models/Entities/UserAccessEntity.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Umbraco.Cms.Core.Models.Entities; - -namespace Umbraco.Cms.Api.Management.Models.Entities; - -public class UserAccessEntity -{ - public UserAccessEntity(IEntitySlim entity, bool hasAccess) - { - Entity = entity; - HasAccess = hasAccess; - } - - public IEntitySlim Entity { get; } - - public bool HasAccess { get; } -} diff --git a/src/Umbraco.Cms.Api.Management/Models/FormFileUploadResult.cs b/src/Umbraco.Cms.Api.Management/Models/FormFileUploadResult.cs deleted file mode 100644 index e5f51311bc..0000000000 --- a/src/Umbraco.Cms.Api.Management/Models/FormFileUploadResult.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Xml; - -namespace Umbraco.Cms.Api.Management.Models; - -public class FormFileUploadResult -{ - public bool CouldLoad { get; set; } - - public XmlDocument? XmlDocument { get; set; } - - public string? ErrorMessage { get; set; } - - public string? TemporaryPath { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/OpenApi.json b/src/Umbraco.Cms.Api.Management/OpenApi.json deleted file mode 100644 index 9f9cc9a95e..0000000000 --- a/src/Umbraco.Cms.Api.Management/OpenApi.json +++ /dev/null @@ -1,7644 +0,0 @@ -{ - "openapi": "3.0.1", - "info": { - "title": "Umbraco Backoffice API", - "description": "This shows all APIs available in this version of Umbraco - including all the legacy apis that are available for backward compatibility", - "version": "1.0" - }, - "paths": { - "/umbraco/management/api/v1/culture": { - "get": { - "tags": [ - "Culture" - ], - "operationId": "GetCulture", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedCulture" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/data-type/children": { - "get": { - "tags": [ - "Data Type" - ], - "operationId": "GetTreeDataTypeChildren", - "parameters": [ - { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - }, - { - "name": "foldersOnly", - "in": "query", - "schema": { - "type": "boolean", - "default": false - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedFolderTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/data-type/item": { - "get": { - "tags": [ - "Data Type" - ], - "operationId": "GetTreeDataTypeItem", - "parameters": [ - { - "name": "key", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FolderTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/data-type/root": { - "get": { - "tags": [ - "Data Type" - ], - "operationId": "GetTreeDataTypeRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - }, - { - "name": "foldersOnly", - "in": "query", - "schema": { - "type": "boolean", - "default": false - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedFolderTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/dictionary": { - "get": { - "tags": [ - "Dictionary" - ], - "operationId": "GetDictionary", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedDictionaryOverview" - } - } - } - } - } - }, - "post": { - "tags": [ - "Dictionary" - ], - "operationId": "PostDictionary", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DictionaryItem" - } - } - } - }, - "responses": { - "201": { - "description": "Created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreatedResult" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/dictionary/{id}": { - "patch": { - "tags": [ - "Dictionary" - ], - "operationId": "PatchDictionaryById", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/JsonPatch" - } - } - } - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ContentResult" - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundResult" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/dictionary/{key}": { - "get": { - "tags": [ - "Dictionary" - ], - "operationId": "GetDictionaryByKey", - "parameters": [ - { - "name": "key", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Dictionary" - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundResult" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Dictionary" - ], - "operationId": "DeleteDictionaryByKey", - "parameters": [ - { - "name": "key", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Success" - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundResult" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/dictionary/export/{key}": { - "get": { - "tags": [ - "Dictionary" - ], - "operationId": "GetDictionaryExportByKey", - "parameters": [ - { - "name": "key", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "includeChildren", - "in": "query", - "schema": { - "type": "boolean", - "default": false - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundResult" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/dictionary/import": { - "post": { - "tags": [ - "Dictionary" - ], - "operationId": "PostDictionaryImport", - "parameters": [ - { - "name": "file", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "parentId", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ContentResult" - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundResult" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/dictionary/upload": { - "post": { - "tags": [ - "Dictionary" - ], - "operationId": "PostDictionaryUpload", - "requestBody": { - "content": {} - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DictionaryImport" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/dictionary/children": { - "get": { - "tags": [ - "Dictionary" - ], - "operationId": "GetTreeDictionaryChildren", - "parameters": [ - { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedEntityTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/dictionary/item": { - "get": { - "tags": [ - "Dictionary" - ], - "operationId": "GetTreeDictionaryItem", - "parameters": [ - { - "name": "key", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FolderTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/dictionary/root": { - "get": { - "tags": [ - "Dictionary" - ], - "operationId": "GetTreeDictionaryRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedEntityTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/document-blueprint/item": { - "get": { - "tags": [ - "Document Blueprint" - ], - "operationId": "GetTreeDocumentBlueprintItem", - "parameters": [ - { - "name": "key", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DocumentBlueprintTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/document-blueprint/root": { - "get": { - "tags": [ - "Document Blueprint" - ], - "operationId": "GetTreeDocumentBlueprintRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedDocumentBlueprintTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/document-type/children": { - "get": { - "tags": [ - "Document Type" - ], - "operationId": "GetTreeDocumentTypeChildren", - "parameters": [ - { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - }, - { - "name": "foldersOnly", - "in": "query", - "schema": { - "type": "boolean", - "default": false - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedDocumentTypeTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/document-type/item": { - "get": { - "tags": [ - "Document Type" - ], - "operationId": "GetTreeDocumentTypeItem", - "parameters": [ - { - "name": "key", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DocumentTypeTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/document-type/root": { - "get": { - "tags": [ - "Document Type" - ], - "operationId": "GetTreeDocumentTypeRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - }, - { - "name": "foldersOnly", - "in": "query", - "schema": { - "type": "boolean", - "default": false - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedDocumentTypeTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/recycle-bin/document/children": { - "get": { - "tags": [ - "Document" - ], - "operationId": "GetRecycleBinDocumentChildren", - "parameters": [ - { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedRecycleBinItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/recycle-bin/document/root": { - "get": { - "tags": [ - "Document" - ], - "operationId": "GetRecycleBinDocumentRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedRecycleBinItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/document/children": { - "get": { - "tags": [ - "Document" - ], - "operationId": "GetTreeDocumentChildren", - "parameters": [ - { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - }, - { - "name": "dataTypeKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "culture", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedDocumentTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/document/item": { - "get": { - "tags": [ - "Document" - ], - "operationId": "GetTreeDocumentItem", - "parameters": [ - { - "name": "key", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - { - "name": "dataTypeKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "culture", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DocumentTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/document/root": { - "get": { - "tags": [ - "Document" - ], - "operationId": "GetTreeDocumentRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - }, - { - "name": "dataTypeKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "culture", - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedDocumentTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/health-check-group": { - "get": { - "tags": [ - "Health Check" - ], - "operationId": "GetHealthCheckGroup", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedHealthCheckGroup" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/health-check-group/{name}": { - "get": { - "tags": [ - "Health Check" - ], - "operationId": "GetHealthCheckGroupByName", - "parameters": [ - { - "name": "name", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundResult" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HealthCheckGroupWithResult" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/health-check/execute-action": { - "post": { - "tags": [ - "Health Check" - ], - "operationId": "PostHealthCheckExecuteAction", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HealthCheckAction" - } - } - } - }, - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HealthCheckResult" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/help": { - "get": { - "tags": [ - "Help" - ], - "operationId": "GetHelp", - "parameters": [ - { - "name": "section", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "tree", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "baseUrl", - "in": "query", - "schema": { - "type": "string", - "default": "https://our.umbraco.com" - } - } - ], - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedHelpPage" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/indexer": { - "get": { - "tags": [ - "Indexer" - ], - "operationId": "GetIndexer", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedIndex" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/indexer/{indexName}": { - "get": { - "tags": [ - "Indexer" - ], - "operationId": "GetIndexerByIndexName", - "parameters": [ - { - "name": "indexName", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Index" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/indexer/{indexName}/rebuild": { - "post": { - "tags": [ - "Indexer" - ], - "operationId": "PostIndexerByIndexNameRebuild", - "parameters": [ - { - "name": "indexName", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OkResult" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/install/settings": { - "get": { - "tags": [ - "Install" - ], - "operationId": "GetInstallSettings", - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "428": { - "description": "Client Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InstallSettings" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/install/setup": { - "post": { - "tags": [ - "Install" - ], - "operationId": "PostInstallSetup", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Install" - } - } - } - }, - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "428": { - "description": "Client Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success" - } - } - } - }, - "/umbraco/management/api/v1/install/validate-database": { - "post": { - "tags": [ - "Install" - ], - "operationId": "PostInstallValidateDatabase", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DatabaseInstall" - } - } - } - }, - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success" - } - } - } - }, - "/umbraco/management/api/v1/language": { - "post": { - "tags": [ - "Language" - ], - "operationId": "PostLanguage", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Language" - } - } - } - }, - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "201": { - "description": "Created" - } - } - }, - "get": { - "tags": [ - "Language" - ], - "operationId": "GetLanguage", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedLanguage" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/language/{id}": { - "get": { - "tags": [ - "Language" - ], - "operationId": "GetLanguageById", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundResult" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Language" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Language" - ], - "operationId": "DeleteLanguageById", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success" - } - } - }, - "put": { - "tags": [ - "Language" - ], - "operationId": "PutLanguageById", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Language" - } - } - } - }, - "responses": { - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundResult" - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success" - } - } - } - }, - "/umbraco/management/api/v1/tree/media-type/children": { - "get": { - "tags": [ - "Media Type" - ], - "operationId": "GetTreeMediaTypeChildren", - "parameters": [ - { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - }, - { - "name": "foldersOnly", - "in": "query", - "schema": { - "type": "boolean", - "default": false - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedFolderTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/media-type/item": { - "get": { - "tags": [ - "Media Type" - ], - "operationId": "GetTreeMediaTypeItem", - "parameters": [ - { - "name": "key", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FolderTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/media-type/root": { - "get": { - "tags": [ - "Media Type" - ], - "operationId": "GetTreeMediaTypeRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - }, - { - "name": "foldersOnly", - "in": "query", - "schema": { - "type": "boolean", - "default": false - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedFolderTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/recycle-bin/media/children": { - "get": { - "tags": [ - "Media" - ], - "operationId": "GetRecycleBinMediaChildren", - "parameters": [ - { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedRecycleBinItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/recycle-bin/media/root": { - "get": { - "tags": [ - "Media" - ], - "operationId": "GetRecycleBinMediaRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedRecycleBinItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/media/children": { - "get": { - "tags": [ - "Media" - ], - "operationId": "GetTreeMediaChildren", - "parameters": [ - { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - }, - { - "name": "dataTypeKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedContentTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/media/item": { - "get": { - "tags": [ - "Media" - ], - "operationId": "GetTreeMediaItem", - "parameters": [ - { - "name": "key", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - { - "name": "dataTypeKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ContentTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/media/root": { - "get": { - "tags": [ - "Media" - ], - "operationId": "GetTreeMediaRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - }, - { - "name": "dataTypeKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedContentTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/member-group/item": { - "get": { - "tags": [ - "Member Group" - ], - "operationId": "GetTreeMemberGroupItem", - "parameters": [ - { - "name": "key", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/member-group/root": { - "get": { - "tags": [ - "Member Group" - ], - "operationId": "GetTreeMemberGroupRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedEntityTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/member-type/item": { - "get": { - "tags": [ - "Member Type" - ], - "operationId": "GetTreeMemberTypeItem", - "parameters": [ - { - "name": "key", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/member-type/root": { - "get": { - "tags": [ - "Member Type" - ], - "operationId": "GetTreeMemberTypeRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedEntityTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/models-builder/build": { - "post": { - "tags": [ - "Models Builder" - ], - "operationId": "PostModelsBuilderBuild", - "responses": { - "201": { - "description": "Created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreatedResult" - } - } - } - }, - "428": { - "description": "Client Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/models-builder/dashboard": { - "get": { - "tags": [ - "Models Builder" - ], - "operationId": "GetModelsBuilderDashboard", - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModelsBuilder" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/models-builder/status": { - "get": { - "tags": [ - "Models Builder" - ], - "operationId": "GetModelsBuilderStatus", - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OutOfDateStatus" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/partial-view/children": { - "get": { - "tags": [ - "Partial View" - ], - "operationId": "GetTreePartialViewChildren", - "parameters": [ - { - "name": "path", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedFileSystemTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/partial-view/item": { - "get": { - "tags": [ - "Partial View" - ], - "operationId": "GetTreePartialViewItem", - "parameters": [ - { - "name": "path", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileSystemTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/partial-view/root": { - "get": { - "tags": [ - "Partial View" - ], - "operationId": "GetTreePartialViewRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedFileSystemTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/profiling/status": { - "get": { - "tags": [ - "Profiling" - ], - "operationId": "GetProfilingStatus", - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProfilingStatus" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/published-cache/collect": { - "post": { - "tags": [ - "Published Cache" - ], - "operationId": "PostPublishedCacheCollect", - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/umbraco/management/api/v1/published-cache/rebuild": { - "post": { - "tags": [ - "Published Cache" - ], - "operationId": "PostPublishedCacheRebuild", - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/umbraco/management/api/v1/published-cache/reload": { - "post": { - "tags": [ - "Published Cache" - ], - "operationId": "PostPublishedCacheReload", - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/umbraco/management/api/v1/published-cache/status": { - "get": { - "tags": [ - "Published Cache" - ], - "operationId": "GetPublishedCacheStatus", - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/redirect-management": { - "get": { - "tags": [ - "Redirect Management" - ], - "operationId": "GetRedirectManagement", - "parameters": [ - { - "name": "filter", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedRedirectUrl" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/redirect-management/{key}": { - "get": { - "tags": [ - "Redirect Management" - ], - "operationId": "GetRedirectManagementByKey", - "parameters": [ - { - "name": "key", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedRedirectUrl" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Redirect Management" - ], - "operationId": "DeleteRedirectManagementByKey", - "parameters": [ - { - "name": "key", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/umbraco/management/api/v1/redirect-management/status": { - "get": { - "tags": [ - "Redirect Management" - ], - "operationId": "GetRedirectManagementStatus", - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RedirectUrlStatus" - } - } - } - } - } - }, - "post": { - "tags": [ - "Redirect Management" - ], - "operationId": "PostRedirectManagementStatus", - "parameters": [ - { - "name": "status", - "in": "query", - "schema": { - "$ref": "#/components/schemas/RedirectStatus" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/umbraco/management/api/v1/tree/relation-type/item": { - "get": { - "tags": [ - "Relation Type" - ], - "operationId": "GetTreeRelationTypeItem", - "parameters": [ - { - "name": "key", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FolderTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/relation-type/root": { - "get": { - "tags": [ - "Relation Type" - ], - "operationId": "GetTreeRelationTypeRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedEntityTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/relation/{id}": { - "get": { - "tags": [ - "Relation" - ], - "operationId": "GetRelationById", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Relation" - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundResult" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/relation/child-relation/{childId}": { - "get": { - "tags": [ - "Relation" - ], - "operationId": "GetRelationChildRelationByChildId", - "parameters": [ - { - "name": "childId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "relationTypeAlias", - "in": "query", - "schema": { - "type": "string", - "default": "" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedRelation" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/script/children": { - "get": { - "tags": [ - "Script" - ], - "operationId": "GetTreeScriptChildren", - "parameters": [ - { - "name": "path", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedFileSystemTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/script/item": { - "get": { - "tags": [ - "Script" - ], - "operationId": "GetTreeScriptItem", - "parameters": [ - { - "name": "path", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileSystemTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/script/root": { - "get": { - "tags": [ - "Script" - ], - "operationId": "GetTreeScriptRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedFileSystemTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/searcher": { - "get": { - "tags": [ - "Searcher" - ], - "operationId": "GetSearcher", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedSearcher" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/searcher/{searcherName}/query": { - "get": { - "tags": [ - "Searcher" - ], - "operationId": "GetSearcherBySearcherNameQuery", - "parameters": [ - { - "name": "searcherName", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "term", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedSearchResult" - } - } - } - }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/security/back-office/authorize": { - "get": { - "tags": [ - "Security" - ], - "operationId": "GetSecurityBackOfficeAuthorize", - "responses": { - "200": { - "description": "Success" - } - } - }, - "post": { - "tags": [ - "Security" - ], - "operationId": "PostSecurityBackOfficeAuthorize", - "responses": { - "200": { - "description": "Success" - } - } - } - }, - "/umbraco/management/api/v1/server/status": { - "get": { - "tags": [ - "Server" - ], - "operationId": "GetServerStatus", - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ServerStatus" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/server/version": { - "get": { - "tags": [ - "Server" - ], - "operationId": "GetServerVersion", - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Version" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/static-file/children": { - "get": { - "tags": [ - "Static File" - ], - "operationId": "GetTreeStaticFileChildren", - "parameters": [ - { - "name": "path", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedFileSystemTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/static-file/item": { - "get": { - "tags": [ - "Static File" - ], - "operationId": "GetTreeStaticFileItem", - "parameters": [ - { - "name": "path", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileSystemTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/static-file/root": { - "get": { - "tags": [ - "Static File" - ], - "operationId": "GetTreeStaticFileRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedFileSystemTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/stylesheet/children": { - "get": { - "tags": [ - "Stylesheet" - ], - "operationId": "GetTreeStylesheetChildren", - "parameters": [ - { - "name": "path", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedFileSystemTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/stylesheet/item": { - "get": { - "tags": [ - "Stylesheet" - ], - "operationId": "GetTreeStylesheetItem", - "parameters": [ - { - "name": "path", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileSystemTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/stylesheet/root": { - "get": { - "tags": [ - "Stylesheet" - ], - "operationId": "GetTreeStylesheetRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedFileSystemTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/telemetry": { - "get": { - "tags": [ - "Telemetry" - ], - "operationId": "GetTelemetry", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedTelemetry" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/telemetry/level": { - "get": { - "tags": [ - "Telemetry" - ], - "operationId": "GetTelemetryLevel", - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Telemetry" - } - } - } - } - } - }, - "post": { - "tags": [ - "Telemetry" - ], - "operationId": "PostTelemetryLevel", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Telemetry" - } - } - } - }, - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "Success" - } - } - } - }, - "/umbraco/management/api/v1/tree/template/children": { - "get": { - "tags": [ - "Template" - ], - "operationId": "GetTreeTemplateChildren", - "parameters": [ - { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedEntityTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/template/item": { - "get": { - "tags": [ - "Template" - ], - "operationId": "GetTreeTemplateItem", - "parameters": [ - { - "name": "key", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityTreeItem" - } - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tree/template/root": { - "get": { - "tags": [ - "Template" - ], - "operationId": "GetTreeTemplateRoot", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedEntityTreeItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tracked-reference/{id}": { - "get": { - "tags": [ - "Tracked Reference" - ], - "operationId": "GetTrackedReferenceById", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "filterMustBeIsDependency", - "in": "query", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedRelationItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tracked-reference/descendants/{parentId}": { - "get": { - "tags": [ - "Tracked Reference" - ], - "operationId": "GetTrackedReferenceDescendantsByParentId", - "parameters": [ - { - "name": "parentId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "filterMustBeIsDependency", - "in": "query", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedRelationItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/tracked-reference/item": { - "get": { - "tags": [ - "Tracked Reference" - ], - "operationId": "GetTrackedReferenceItem", - "parameters": [ - { - "name": "ids", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - } - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "filterMustBeIsDependency", - "in": "query", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedRelationItem" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/upgrade/authorize": { - "post": { - "tags": [ - "Upgrade" - ], - "operationId": "PostUpgradeAuthorize", - "responses": { - "200": { - "description": "Success" - }, - "428": { - "description": "Client Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "500": { - "description": "Server Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/upgrade/settings": { - "get": { - "tags": [ - "Upgrade" - ], - "operationId": "GetUpgradeSettings", - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpgradeSettings" - } - } - } - }, - "428": { - "description": "Client Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "Assembly": { - "type": "object", - "properties": { - "definedTypes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TypeInfo" - }, - "nullable": true, - "readOnly": true - }, - "exportedTypes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Type" - }, - "nullable": true, - "readOnly": true - }, - "codeBase": { - "type": "string", - "nullable": true, - "readOnly": true, - "deprecated": true - }, - "entryPoint": { - "$ref": "#/components/schemas/MethodInfo" - }, - "fullName": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "imageRuntimeVersion": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "isDynamic": { - "type": "boolean", - "readOnly": true - }, - "location": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "reflectionOnly": { - "type": "boolean", - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "isFullyTrusted": { - "type": "boolean", - "readOnly": true - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "nullable": true, - "readOnly": true - }, - "escapedCodeBase": { - "type": "string", - "nullable": true, - "readOnly": true, - "deprecated": true - }, - "manifestModule": { - "$ref": "#/components/schemas/Module" - }, - "modules": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Module" - }, - "nullable": true, - "readOnly": true - }, - "globalAssemblyCache": { - "type": "boolean", - "readOnly": true, - "deprecated": true - }, - "hostContext": { - "type": "integer", - "format": "int64", - "readOnly": true - }, - "securityRuleSet": { - "$ref": "#/components/schemas/SecurityRuleSet" - } - }, - "additionalProperties": false - }, - "BackOfficeNotification": { - "type": "object", - "properties": { - "header": { - "type": "string", - "nullable": true - }, - "message": { - "type": "string", - "nullable": true - }, - "notificationType": { - "$ref": "#/components/schemas/NotificationStyle" - } - }, - "additionalProperties": false - }, - "CallingConventions": { - "enum": [ - "Standard", - "VarArgs", - "Any", - "HasThis", - "ExplicitThis" - ], - "type": "integer", - "format": "int32" - }, - "ConsentLevel": { - "type": "object", - "properties": { - "level": { - "$ref": "#/components/schemas/TelemetryLevel" - }, - "description": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "ConstructorInfo": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "nullable": true, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "attributes": { - "$ref": "#/components/schemas/MethodAttributes" - }, - "methodImplementationFlags": { - "$ref": "#/components/schemas/MethodImplAttributes" - }, - "callingConvention": { - "$ref": "#/components/schemas/CallingConventions" - }, - "isAbstract": { - "type": "boolean", - "readOnly": true - }, - "isConstructor": { - "type": "boolean", - "readOnly": true - }, - "isFinal": { - "type": "boolean", - "readOnly": true - }, - "isHideBySig": { - "type": "boolean", - "readOnly": true - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "isStatic": { - "type": "boolean", - "readOnly": true - }, - "isVirtual": { - "type": "boolean", - "readOnly": true - }, - "isAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamily": { - "type": "boolean", - "readOnly": true - }, - "isFamilyAndAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamilyOrAssembly": { - "type": "boolean", - "readOnly": true - }, - "isPrivate": { - "type": "boolean", - "readOnly": true - }, - "isPublic": { - "type": "boolean", - "readOnly": true - }, - "isConstructedGenericMethod": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethod": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethodDefinition": { - "type": "boolean", - "readOnly": true - }, - "containsGenericParameters": { - "type": "boolean", - "readOnly": true - }, - "methodHandle": { - "$ref": "#/components/schemas/RuntimeMethodHandle" - }, - "isSecurityCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecuritySafeCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecurityTransparent": { - "type": "boolean", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - } - }, - "additionalProperties": false - }, - "ContentApp": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "alias": { - "type": "string", - "nullable": true - }, - "weight": { - "type": "integer", - "format": "int32" - }, - "icon": { - "type": "string", - "nullable": true - }, - "view": { - "type": "string", - "nullable": true - }, - "viewModel": { - "nullable": true - }, - "active": { - "type": "boolean" - }, - "badge": { - "$ref": "#/components/schemas/ContentAppBadge" - } - }, - "additionalProperties": false - }, - "ContentAppBadge": { - "type": "object", - "properties": { - "count": { - "type": "integer", - "format": "int32" - }, - "type": { - "$ref": "#/components/schemas/ContentAppBadgeType" - } - }, - "additionalProperties": false - }, - "ContentAppBadgeType": { - "enum": [ - "default", - "warning", - "alert" - ], - "type": "integer", - "format": "int32" - }, - "ContentResult": { - "type": "object", - "properties": { - "content": { - "type": "string", - "nullable": true - }, - "contentType": { - "type": "string", - "nullable": true - }, - "statusCode": { - "type": "integer", - "format": "int32", - "nullable": true - } - }, - "additionalProperties": false - }, - "ContentTreeItem": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "type": { - "type": "string", - "nullable": true - }, - "icon": { - "type": "string", - "nullable": true - }, - "hasChildren": { - "type": "boolean" - }, - "key": { - "type": "string", - "format": "uuid" - }, - "isContainer": { - "type": "boolean" - }, - "parentKey": { - "type": "string", - "format": "uuid", - "nullable": true - }, - "noAccess": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "CreatedResult": { - "type": "object", - "properties": { - "value": { - "nullable": true - }, - "formatters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/IOutputFormatter" - }, - "nullable": true - }, - "contentTypes": { - "type": "array", - "items": { - "type": "string" - }, - "nullable": true - }, - "declaredType": { - "$ref": "#/components/schemas/Type" - }, - "statusCode": { - "type": "integer", - "format": "int32", - "nullable": true - }, - "location": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "Culture": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "englishName": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "CustomAttributeData": { - "type": "object", - "properties": { - "attributeType": { - "$ref": "#/components/schemas/Type" - }, - "constructor": { - "$ref": "#/components/schemas/ConstructorInfo" - }, - "constructorArguments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeTypedArgument" - }, - "nullable": true, - "readOnly": true - }, - "namedArguments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeNamedArgument" - }, - "nullable": true, - "readOnly": true - } - }, - "additionalProperties": false - }, - "CustomAttributeNamedArgument": { - "type": "object", - "properties": { - "memberInfo": { - "$ref": "#/components/schemas/MemberInfo" - }, - "typedValue": { - "$ref": "#/components/schemas/CustomAttributeTypedArgument" - }, - "memberName": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "isField": { - "type": "boolean", - "readOnly": true - } - }, - "additionalProperties": false - }, - "CustomAttributeTypedArgument": { - "type": "object", - "properties": { - "argumentType": { - "$ref": "#/components/schemas/Type" - }, - "value": { - "nullable": true - } - }, - "additionalProperties": false - }, - "DatabaseInstall": { - "required": [ - "id", - "providerName" - ], - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "providerName": { - "minLength": 1, - "type": "string" - }, - "server": { - "type": "string", - "nullable": true - }, - "name": { - "type": "string", - "nullable": true - }, - "username": { - "type": "string", - "nullable": true - }, - "password": { - "type": "string", - "nullable": true - }, - "useIntegratedAuthentication": { - "type": "boolean" - }, - "connectionString": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "DatabaseSettings": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "sortOrder": { - "type": "integer", - "format": "int32" - }, - "displayName": { - "type": "string", - "nullable": true - }, - "defaultDatabaseName": { - "type": "string", - "nullable": true - }, - "providerName": { - "type": "string", - "nullable": true - }, - "isConfigured": { - "type": "boolean" - }, - "requiresServer": { - "type": "boolean" - }, - "serverPlaceholder": { - "type": "string", - "nullable": true - }, - "requiresCredentials": { - "type": "boolean" - }, - "supportsIntegratedAuthentication": { - "type": "boolean" - }, - "requiresConnectionTest": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "Dictionary": { - "required": [ - "name" - ], - "type": "object", - "properties": { - "parentId": { - "type": "string", - "format": "uuid", - "nullable": true - }, - "translations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DictionaryTranslation" - }, - "nullable": true - }, - "contentApps": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ContentApp" - }, - "nullable": true - }, - "notifications": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BackOfficeNotification" - }, - "nullable": true, - "readOnly": true - }, - "name": { - "minLength": 1, - "type": "string" - }, - "key": { - "type": "string", - "format": "uuid" - }, - "path": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "DictionaryImport": { - "type": "object", - "properties": { - "dictionaryItems": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DictionaryItemsImport" - }, - "nullable": true - }, - "tempFileName": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "DictionaryItem": { - "type": "object", - "properties": { - "parentId": { - "type": "string", - "format": "uuid", - "nullable": true - }, - "key": { - "type": "string", - "format": "uuid" - } - }, - "additionalProperties": false - }, - "DictionaryItemsImport": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "level": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, - "DictionaryOverview": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "key": { - "type": "string", - "format": "uuid" - }, - "level": { - "type": "integer", - "format": "int32" - }, - "translations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DictionaryTranslationOverview" - }, - "nullable": true, - "readOnly": true - } - }, - "additionalProperties": false - }, - "DictionaryTranslation": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "key": { - "type": "string", - "format": "uuid" - }, - "displayName": { - "type": "string", - "nullable": true - }, - "isoCode": { - "type": "string", - "nullable": true - }, - "translation": { - "type": "string", - "nullable": true - }, - "languageId": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, - "DictionaryTranslationOverview": { - "type": "object", - "properties": { - "displayName": { - "type": "string", - "nullable": true - }, - "hasTranslation": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "DocumentBlueprintTreeItem": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "type": { - "type": "string", - "nullable": true - }, - "icon": { - "type": "string", - "nullable": true - }, - "hasChildren": { - "type": "boolean" - }, - "key": { - "type": "string", - "format": "uuid" - }, - "isContainer": { - "type": "boolean" - }, - "parentKey": { - "type": "string", - "format": "uuid", - "nullable": true - }, - "documentTypeKey": { - "type": "string", - "format": "uuid" - }, - "documentTypeAlias": { - "type": "string", - "nullable": true - }, - "documentTypeName": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "DocumentTreeItem": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "type": { - "type": "string", - "nullable": true - }, - "icon": { - "type": "string", - "nullable": true - }, - "hasChildren": { - "type": "boolean" - }, - "key": { - "type": "string", - "format": "uuid" - }, - "isContainer": { - "type": "boolean" - }, - "parentKey": { - "type": "string", - "format": "uuid", - "nullable": true - }, - "noAccess": { - "type": "boolean" - }, - "isProtected": { - "type": "boolean" - }, - "isPublished": { - "type": "boolean" - }, - "isEdited": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "DocumentTypeTreeItem": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "type": { - "type": "string", - "nullable": true - }, - "icon": { - "type": "string", - "nullable": true - }, - "hasChildren": { - "type": "boolean" - }, - "key": { - "type": "string", - "format": "uuid" - }, - "isContainer": { - "type": "boolean" - }, - "parentKey": { - "type": "string", - "format": "uuid", - "nullable": true - }, - "isFolder": { - "type": "boolean" - }, - "isElement": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "EntityTreeItem": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "type": { - "type": "string", - "nullable": true - }, - "icon": { - "type": "string", - "nullable": true - }, - "hasChildren": { - "type": "boolean" - }, - "key": { - "type": "string", - "format": "uuid" - }, - "isContainer": { - "type": "boolean" - }, - "parentKey": { - "type": "string", - "format": "uuid", - "nullable": true - } - }, - "additionalProperties": false - }, - "EventAttributes": { - "enum": [ - "None", - "SpecialName", - "RTSpecialName", - "ReservedMask" - ], - "type": "integer", - "format": "int32" - }, - "EventInfo": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "nullable": true, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "attributes": { - "$ref": "#/components/schemas/EventAttributes" - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "addMethod": { - "$ref": "#/components/schemas/MethodInfo" - }, - "removeMethod": { - "$ref": "#/components/schemas/MethodInfo" - }, - "raiseMethod": { - "$ref": "#/components/schemas/MethodInfo" - }, - "isMulticast": { - "type": "boolean", - "readOnly": true - }, - "eventHandlerType": { - "$ref": "#/components/schemas/Type" - } - }, - "additionalProperties": false - }, - "Field": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "values": { - "type": "array", - "items": { - "type": "string" - }, - "nullable": true - } - }, - "additionalProperties": false - }, - "FieldAttributes": { - "enum": [ - "PrivateScope", - "Private", - "FamANDAssem", - "Assembly", - "Family", - "FamORAssem", - "Public", - "FieldAccessMask", - "Static", - "InitOnly", - "Literal", - "NotSerialized", - "HasFieldRVA", - "SpecialName", - "RTSpecialName", - "HasFieldMarshal", - "PinvokeImpl", - "HasDefault", - "ReservedMask" - ], - "type": "integer", - "format": "int32" - }, - "FieldInfo": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "nullable": true, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "attributes": { - "$ref": "#/components/schemas/FieldAttributes" - }, - "fieldType": { - "$ref": "#/components/schemas/Type" - }, - "isInitOnly": { - "type": "boolean", - "readOnly": true - }, - "isLiteral": { - "type": "boolean", - "readOnly": true - }, - "isNotSerialized": { - "type": "boolean", - "readOnly": true - }, - "isPinvokeImpl": { - "type": "boolean", - "readOnly": true - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "isStatic": { - "type": "boolean", - "readOnly": true - }, - "isAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamily": { - "type": "boolean", - "readOnly": true - }, - "isFamilyAndAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamilyOrAssembly": { - "type": "boolean", - "readOnly": true - }, - "isPrivate": { - "type": "boolean", - "readOnly": true - }, - "isPublic": { - "type": "boolean", - "readOnly": true - }, - "isSecurityCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecuritySafeCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecurityTransparent": { - "type": "boolean", - "readOnly": true - }, - "fieldHandle": { - "$ref": "#/components/schemas/RuntimeFieldHandle" - } - }, - "additionalProperties": false - }, - "FileSystemTreeItem": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "type": { - "type": "string", - "nullable": true - }, - "icon": { - "type": "string", - "nullable": true - }, - "hasChildren": { - "type": "boolean" - }, - "path": { - "type": "string", - "nullable": true - }, - "isFolder": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "FolderTreeItem": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "type": { - "type": "string", - "nullable": true - }, - "icon": { - "type": "string", - "nullable": true - }, - "hasChildren": { - "type": "boolean" - }, - "key": { - "type": "string", - "format": "uuid" - }, - "isContainer": { - "type": "boolean" - }, - "parentKey": { - "type": "string", - "format": "uuid", - "nullable": true - }, - "isFolder": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "GenericParameterAttributes": { - "enum": [ - "None", - "Covariant", - "Contravariant", - "VarianceMask", - "ReferenceTypeConstraint", - "NotNullableValueTypeConstraint", - "DefaultConstructorConstraint", - "SpecialConstraintMask" - ], - "type": "integer", - "format": "int32" - }, - "HealthCheck": { - "type": "object", - "properties": { - "key": { - "type": "string", - "format": "uuid" - }, - "name": { - "type": "string", - "nullable": true - }, - "description": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "HealthCheckAction": { - "type": "object", - "properties": { - "healthCheckKey": { - "type": "string", - "format": "uuid" - }, - "alias": { - "type": "string", - "nullable": true - }, - "name": { - "type": "string", - "nullable": true - }, - "description": { - "type": "string", - "nullable": true - }, - "valueRequired": { - "type": "boolean" - }, - "providedValue": { - "type": "string", - "nullable": true - }, - "providedValueValidation": { - "type": "string", - "nullable": true - }, - "providedValueValidationRegex": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "HealthCheckGroup": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "checks": { - "type": "array", - "items": { - "$ref": "#/components/schemas/HealthCheck" - }, - "nullable": true - } - }, - "additionalProperties": false - }, - "HealthCheckGroupWithResult": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "checks": { - "type": "array", - "items": { - "$ref": "#/components/schemas/HealthCheckWithResult" - }, - "nullable": true - } - }, - "additionalProperties": false - }, - "HealthCheckResult": { - "type": "object", - "properties": { - "message": { - "type": "string", - "nullable": true - }, - "resultType": { - "$ref": "#/components/schemas/StatusResultType" - }, - "actions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/HealthCheckAction" - }, - "nullable": true - }, - "readMoreLink": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "HealthCheckWithResult": { - "type": "object", - "properties": { - "key": { - "type": "string", - "format": "uuid" - }, - "name": { - "type": "string", - "nullable": true - }, - "description": { - "type": "string", - "nullable": true - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/HealthCheckResult" - }, - "nullable": true - } - }, - "additionalProperties": false - }, - "HelpPage": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - }, - "description": { - "type": "string", - "nullable": true - }, - "url": { - "type": "string", - "nullable": true - }, - "type": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "ICustomAttributeProvider": { - "type": "object", - "additionalProperties": false - }, - "IOutputFormatter": { - "type": "object", - "additionalProperties": false - }, - "Index": { - "required": [ - "canRebuild", - "documentCount", - "fieldCount", - "isHealthy", - "name" - ], - "type": "object", - "properties": { - "name": { - "minLength": 1, - "type": "string" - }, - "healthStatus": { - "type": "string", - "nullable": true - }, - "isHealthy": { - "type": "boolean", - "readOnly": true - }, - "canRebuild": { - "type": "boolean" - }, - "searcherName": { - "type": "string", - "nullable": true - }, - "documentCount": { - "type": "integer", - "format": "int64" - }, - "fieldCount": { - "type": "integer", - "format": "int32" - }, - "providerProperties": { - "type": "object", - "additionalProperties": {}, - "nullable": true - } - }, - "additionalProperties": false - }, - "Install": { - "required": [ - "database", - "user" - ], - "type": "object", - "properties": { - "user": { - "$ref": "#/components/schemas/UserInstall" - }, - "database": { - "$ref": "#/components/schemas/DatabaseInstall" - }, - "telemetryLevel": { - "$ref": "#/components/schemas/TelemetryLevel" - } - }, - "additionalProperties": false - }, - "InstallSettings": { - "type": "object", - "properties": { - "user": { - "$ref": "#/components/schemas/UserSettings" - }, - "databases": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DatabaseSettings" - }, - "nullable": true - } - }, - "additionalProperties": false - }, - "IntPtr": { - "type": "object", - "additionalProperties": false - }, - "JsonPatch": { - "type": "object", - "properties": { - "op": { - "type": "string", - "nullable": true - }, - "path": { - "type": "string", - "nullable": true - }, - "value": { - "nullable": true - } - }, - "additionalProperties": false - }, - "Language": { - "required": [ - "isoCode" - ], - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "isoCode": { - "minLength": 1, - "type": "string" - }, - "name": { - "type": "string", - "nullable": true - }, - "isDefault": { - "type": "boolean" - }, - "isMandatory": { - "type": "boolean" - }, - "fallbackLanguageId": { - "type": "integer", - "format": "int32", - "nullable": true - } - }, - "additionalProperties": false - }, - "LayoutKind": { - "enum": [ - "Sequential", - "Explicit", - "Auto" - ], - "type": "integer", - "format": "int32" - }, - "MemberInfo": { - "type": "object", - "properties": { - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "name": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "nullable": true, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - } - }, - "additionalProperties": false - }, - "MemberTypes": { - "enum": [ - "Constructor", - "Event", - "Field", - "Method", - "Property", - "TypeInfo", - "Custom", - "NestedType", - "All" - ], - "type": "integer", - "format": "int32" - }, - "MethodAttributes": { - "enum": [ - "ReuseSlot", - "PrivateScope", - "Private", - "FamANDAssem", - "Assembly", - "Family", - "FamORAssem", - "Public", - "MemberAccessMask", - "UnmanagedExport", - "Static", - "Final", - "Virtual", - "HideBySig", - "NewSlot", - "VtableLayoutMask", - "CheckAccessOnOverride", - "Abstract", - "SpecialName", - "RTSpecialName", - "PinvokeImpl", - "HasSecurity", - "RequireSecObject", - "ReservedMask" - ], - "type": "integer", - "format": "int32" - }, - "MethodBase": { - "type": "object", - "properties": { - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "name": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "nullable": true, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "attributes": { - "$ref": "#/components/schemas/MethodAttributes" - }, - "methodImplementationFlags": { - "$ref": "#/components/schemas/MethodImplAttributes" - }, - "callingConvention": { - "$ref": "#/components/schemas/CallingConventions" - }, - "isAbstract": { - "type": "boolean", - "readOnly": true - }, - "isConstructor": { - "type": "boolean", - "readOnly": true - }, - "isFinal": { - "type": "boolean", - "readOnly": true - }, - "isHideBySig": { - "type": "boolean", - "readOnly": true - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "isStatic": { - "type": "boolean", - "readOnly": true - }, - "isVirtual": { - "type": "boolean", - "readOnly": true - }, - "isAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamily": { - "type": "boolean", - "readOnly": true - }, - "isFamilyAndAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamilyOrAssembly": { - "type": "boolean", - "readOnly": true - }, - "isPrivate": { - "type": "boolean", - "readOnly": true - }, - "isPublic": { - "type": "boolean", - "readOnly": true - }, - "isConstructedGenericMethod": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethod": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethodDefinition": { - "type": "boolean", - "readOnly": true - }, - "containsGenericParameters": { - "type": "boolean", - "readOnly": true - }, - "methodHandle": { - "$ref": "#/components/schemas/RuntimeMethodHandle" - }, - "isSecurityCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecuritySafeCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecurityTransparent": { - "type": "boolean", - "readOnly": true - } - }, - "additionalProperties": false - }, - "MethodImplAttributes": { - "enum": [ - "IL", - "Managed", - "Native", - "OPTIL", - "Runtime", - "CodeTypeMask", - "Unmanaged", - "ManagedMask", - "NoInlining", - "ForwardRef", - "Synchronized", - "NoOptimization", - "PreserveSig", - "AggressiveInlining", - "AggressiveOptimization", - "InternalCall", - "MaxMethodImplVal" - ], - "type": "integer", - "format": "int32" - }, - "MethodInfo": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "nullable": true, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "attributes": { - "$ref": "#/components/schemas/MethodAttributes" - }, - "methodImplementationFlags": { - "$ref": "#/components/schemas/MethodImplAttributes" - }, - "callingConvention": { - "$ref": "#/components/schemas/CallingConventions" - }, - "isAbstract": { - "type": "boolean", - "readOnly": true - }, - "isConstructor": { - "type": "boolean", - "readOnly": true - }, - "isFinal": { - "type": "boolean", - "readOnly": true - }, - "isHideBySig": { - "type": "boolean", - "readOnly": true - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "isStatic": { - "type": "boolean", - "readOnly": true - }, - "isVirtual": { - "type": "boolean", - "readOnly": true - }, - "isAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamily": { - "type": "boolean", - "readOnly": true - }, - "isFamilyAndAssembly": { - "type": "boolean", - "readOnly": true - }, - "isFamilyOrAssembly": { - "type": "boolean", - "readOnly": true - }, - "isPrivate": { - "type": "boolean", - "readOnly": true - }, - "isPublic": { - "type": "boolean", - "readOnly": true - }, - "isConstructedGenericMethod": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethod": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethodDefinition": { - "type": "boolean", - "readOnly": true - }, - "containsGenericParameters": { - "type": "boolean", - "readOnly": true - }, - "methodHandle": { - "$ref": "#/components/schemas/RuntimeMethodHandle" - }, - "isSecurityCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecuritySafeCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecurityTransparent": { - "type": "boolean", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "returnParameter": { - "$ref": "#/components/schemas/ParameterInfo" - }, - "returnType": { - "$ref": "#/components/schemas/Type" - }, - "returnTypeCustomAttributes": { - "$ref": "#/components/schemas/ICustomAttributeProvider" - } - }, - "additionalProperties": false - }, - "ModelsBuilder": { - "type": "object", - "properties": { - "mode": { - "$ref": "#/components/schemas/ModelsMode" - }, - "canGenerate": { - "type": "boolean" - }, - "outOfDateModels": { - "type": "boolean" - }, - "lastError": { - "type": "string", - "nullable": true - }, - "version": { - "type": "string", - "nullable": true - }, - "modelsNamespace": { - "type": "string", - "nullable": true - }, - "trackingOutOfDateModels": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "ModelsMode": { - "enum": [ - "Nothing", - "InMemoryAuto", - "SourceCodeManual", - "SourceCodeAuto" - ], - "type": "integer", - "format": "int32" - }, - "Module": { - "type": "object", - "properties": { - "assembly": { - "$ref": "#/components/schemas/Assembly" - }, - "fullyQualifiedName": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "name": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "mdStreamVersion": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "moduleVersionId": { - "type": "string", - "format": "uuid", - "readOnly": true - }, - "scopeName": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "moduleHandle": { - "$ref": "#/components/schemas/ModuleHandle" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "nullable": true, - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - } - }, - "additionalProperties": false - }, - "ModuleHandle": { - "type": "object", - "properties": { - "mdStreamVersion": { - "type": "integer", - "format": "int32", - "readOnly": true - } - }, - "additionalProperties": false - }, - "NotFoundResult": { - "type": "object", - "properties": { - "statusCode": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, - "NotificationStyle": { - "enum": [ - "Save", - "Info", - "Error", - "Success", - "Warning" - ], - "type": "integer", - "format": "int32" - }, - "OkResult": { - "type": "object", - "properties": { - "statusCode": { - "type": "integer", - "format": "int32" - } - }, - "additionalProperties": false - }, - "OutOfDateStatus": { - "type": "object", - "properties": { - "status": { - "$ref": "#/components/schemas/OutOfDateType" - } - }, - "additionalProperties": false - }, - "OutOfDateType": { - "enum": [ - "OutOfDate", - "Current", - "Unknown" - ], - "type": "integer", - "format": "int32" - }, - "PagedContentTreeItem": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ContentTreeItem" - } - } - }, - "additionalProperties": false - }, - "PagedCulture": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Culture" - } - } - }, - "additionalProperties": false - }, - "PagedDictionaryOverview": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DictionaryOverview" - } - } - }, - "additionalProperties": false - }, - "PagedDocumentBlueprintTreeItem": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DocumentBlueprintTreeItem" - } - } - }, - "additionalProperties": false - }, - "PagedDocumentTreeItem": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DocumentTreeItem" - } - } - }, - "additionalProperties": false - }, - "PagedDocumentTypeTreeItem": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DocumentTypeTreeItem" - } - } - }, - "additionalProperties": false - }, - "PagedEntityTreeItem": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityTreeItem" - } - } - }, - "additionalProperties": false - }, - "PagedFileSystemTreeItem": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileSystemTreeItem" - } - } - }, - "additionalProperties": false - }, - "PagedFolderTreeItem": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FolderTreeItem" - } - } - }, - "additionalProperties": false - }, - "PagedHealthCheckGroup": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/HealthCheckGroup" - } - } - }, - "additionalProperties": false - }, - "PagedHelpPage": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/HelpPage" - } - } - }, - "additionalProperties": false - }, - "PagedIndex": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Index" - } - } - }, - "additionalProperties": false - }, - "PagedLanguage": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Language" - } - } - }, - "additionalProperties": false - }, - "PagedRecycleBinItem": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RecycleBinItem" - } - } - }, - "additionalProperties": false - }, - "PagedRedirectUrl": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RedirectUrl" - } - } - }, - "additionalProperties": false - }, - "PagedRelation": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Relation" - } - } - }, - "additionalProperties": false - }, - "PagedRelationItem": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RelationItem" - } - } - }, - "additionalProperties": false - }, - "PagedSearchResult": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SearchResult" - } - } - }, - "additionalProperties": false - }, - "PagedSearcher": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Searcher" - } - } - }, - "additionalProperties": false - }, - "PagedTelemetry": { - "required": [ - "items", - "total" - ], - "type": "object", - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Telemetry" - } - } - }, - "additionalProperties": false - }, - "ParameterAttributes": { - "enum": [ - "None", - "In", - "Out", - "Lcid", - "Retval", - "Optional", - "HasDefault", - "HasFieldMarshal", - "Reserved3", - "Reserved4", - "ReservedMask" - ], - "type": "integer", - "format": "int32" - }, - "ParameterInfo": { - "type": "object", - "properties": { - "attributes": { - "$ref": "#/components/schemas/ParameterAttributes" - }, - "member": { - "$ref": "#/components/schemas/MemberInfo" - }, - "name": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "parameterType": { - "$ref": "#/components/schemas/Type" - }, - "position": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "isIn": { - "type": "boolean", - "readOnly": true - }, - "isLcid": { - "type": "boolean", - "readOnly": true - }, - "isOptional": { - "type": "boolean", - "readOnly": true - }, - "isOut": { - "type": "boolean", - "readOnly": true - }, - "isRetval": { - "type": "boolean", - "readOnly": true - }, - "defaultValue": { - "nullable": true, - "readOnly": true - }, - "rawDefaultValue": { - "nullable": true, - "readOnly": true - }, - "hasDefaultValue": { - "type": "boolean", - "readOnly": true - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "nullable": true, - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - } - }, - "additionalProperties": false - }, - "ProblemDetails": { - "type": "object", - "properties": { - "type": { - "type": "string", - "nullable": true - }, - "title": { - "type": "string", - "nullable": true - }, - "status": { - "type": "integer", - "format": "int32", - "nullable": true - }, - "detail": { - "type": "string", - "nullable": true - }, - "instance": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": {} - }, - "ProfilingStatus": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "PropertyAttributes": { - "enum": [ - "None", - "SpecialName", - "RTSpecialName", - "HasDefault", - "Reserved2", - "Reserved3", - "Reserved4", - "ReservedMask" - ], - "type": "integer", - "format": "int32" - }, - "PropertyInfo": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "nullable": true, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "propertyType": { - "$ref": "#/components/schemas/Type" - }, - "attributes": { - "$ref": "#/components/schemas/PropertyAttributes" - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "canRead": { - "type": "boolean", - "readOnly": true - }, - "canWrite": { - "type": "boolean", - "readOnly": true - }, - "getMethod": { - "$ref": "#/components/schemas/MethodInfo" - }, - "setMethod": { - "$ref": "#/components/schemas/MethodInfo" - } - }, - "additionalProperties": false - }, - "RecycleBinItem": { - "type": "object", - "properties": { - "key": { - "type": "string", - "format": "uuid" - }, - "name": { - "type": "string", - "nullable": true - }, - "type": { - "type": "string", - "nullable": true - }, - "icon": { - "type": "string", - "nullable": true - }, - "hasChildren": { - "type": "boolean" - }, - "isContainer": { - "type": "boolean" - }, - "parentKey": { - "type": "string", - "format": "uuid", - "nullable": true - } - }, - "additionalProperties": false - }, - "RedirectStatus": { - "enum": [ - "Enabled", - "Disabled" - ], - "type": "integer", - "format": "int32" - }, - "RedirectUrl": { - "type": "object", - "properties": { - "key": { - "type": "string", - "format": "uuid" - }, - "originalUrl": { - "type": "string", - "nullable": true - }, - "destinationUrl": { - "type": "string", - "nullable": true - }, - "created": { - "type": "string", - "format": "date-time" - }, - "contentKey": { - "type": "string", - "format": "uuid" - }, - "culture": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "RedirectUrlStatus": { - "type": "object", - "properties": { - "status": { - "$ref": "#/components/schemas/RedirectStatus" - }, - "userIsAdmin": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "Relation": { - "type": "object", - "properties": { - "parentId": { - "type": "integer", - "format": "int32" - }, - "parentName": { - "type": "string", - "nullable": true - }, - "childId": { - "type": "integer", - "format": "int32" - }, - "childName": { - "type": "string", - "nullable": true - }, - "createDate": { - "type": "string", - "format": "date-time" - }, - "comment": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "RelationItem": { - "type": "object", - "properties": { - "nodeKey": { - "type": "string", - "format": "uuid" - }, - "nodeName": { - "type": "string", - "nullable": true - }, - "nodeType": { - "type": "string", - "nullable": true - }, - "contentTypeIcon": { - "type": "string", - "nullable": true - }, - "contentTypeAlias": { - "type": "string", - "nullable": true - }, - "contentTypeName": { - "type": "string", - "nullable": true - }, - "relationTypeName": { - "type": "string", - "nullable": true - }, - "relationTypeIsBidirectional": { - "type": "boolean" - }, - "relationTypeIsDependency": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "RuntimeFieldHandle": { - "type": "object", - "properties": { - "value": { - "$ref": "#/components/schemas/IntPtr" - } - }, - "additionalProperties": false - }, - "RuntimeLevel": { - "enum": [ - "Unknown", - "Boot", - "Install", - "Upgrade", - "Run", - "BootFailed" - ], - "type": "integer", - "format": "int32" - }, - "RuntimeMethodHandle": { - "type": "object", - "properties": { - "value": { - "$ref": "#/components/schemas/IntPtr" - } - }, - "additionalProperties": false - }, - "RuntimeTypeHandle": { - "type": "object", - "properties": { - "value": { - "$ref": "#/components/schemas/IntPtr" - } - }, - "additionalProperties": false - }, - "SearchResult": { - "type": "object", - "properties": { - "id": { - "type": "string", - "nullable": true - }, - "score": { - "type": "number", - "format": "float" - }, - "fieldCount": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "fields": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Field" - }, - "nullable": true - } - }, - "additionalProperties": false - }, - "Searcher": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - }, - "SecurityRuleSet": { - "enum": [ - "None", - "Level1", - "Level2" - ], - "type": "integer", - "format": "int32" - }, - "ServerStatus": { - "type": "object", - "properties": { - "serverStatus": { - "$ref": "#/components/schemas/RuntimeLevel" - } - }, - "additionalProperties": false - }, - "StatusResultType": { - "enum": [ - "Success", - "Warning", - "Error", - "Info" - ], - "type": "integer", - "format": "int32" - }, - "StructLayoutAttribute": { - "type": "object", - "properties": { - "typeId": { - "nullable": true, - "readOnly": true - }, - "value": { - "$ref": "#/components/schemas/LayoutKind" - } - }, - "additionalProperties": false - }, - "Telemetry": { - "type": "object", - "properties": { - "telemetryLevel": { - "$ref": "#/components/schemas/TelemetryLevel" - } - }, - "additionalProperties": false - }, - "TelemetryLevel": { - "enum": [ - "Minimal", - "Basic", - "Detailed" - ], - "type": "integer", - "format": "int32" - }, - "Type": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "nullable": true, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "isInterface": { - "type": "boolean", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "namespace": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "assemblyQualifiedName": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "fullName": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "assembly": { - "$ref": "#/components/schemas/Assembly" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "isNested": { - "type": "boolean", - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "declaringMethod": { - "$ref": "#/components/schemas/MethodBase" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "underlyingSystemType": { - "$ref": "#/components/schemas/Type" - }, - "isTypeDefinition": { - "type": "boolean", - "readOnly": true - }, - "isArray": { - "type": "boolean", - "readOnly": true - }, - "isByRef": { - "type": "boolean", - "readOnly": true - }, - "isPointer": { - "type": "boolean", - "readOnly": true - }, - "isConstructedGenericType": { - "type": "boolean", - "readOnly": true - }, - "isGenericParameter": { - "type": "boolean", - "readOnly": true - }, - "isGenericTypeParameter": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethodParameter": { - "type": "boolean", - "readOnly": true - }, - "isGenericType": { - "type": "boolean", - "readOnly": true - }, - "isGenericTypeDefinition": { - "type": "boolean", - "readOnly": true - }, - "isSZArray": { - "type": "boolean", - "readOnly": true - }, - "isVariableBoundArray": { - "type": "boolean", - "readOnly": true - }, - "isByRefLike": { - "type": "boolean", - "readOnly": true - }, - "hasElementType": { - "type": "boolean", - "readOnly": true - }, - "genericTypeArguments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Type" - }, - "nullable": true, - "readOnly": true - }, - "genericParameterPosition": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "genericParameterAttributes": { - "$ref": "#/components/schemas/GenericParameterAttributes" - }, - "attributes": { - "$ref": "#/components/schemas/TypeAttributes" - }, - "isAbstract": { - "type": "boolean", - "readOnly": true - }, - "isImport": { - "type": "boolean", - "readOnly": true - }, - "isSealed": { - "type": "boolean", - "readOnly": true - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "isClass": { - "type": "boolean", - "readOnly": true - }, - "isNestedAssembly": { - "type": "boolean", - "readOnly": true - }, - "isNestedFamANDAssem": { - "type": "boolean", - "readOnly": true - }, - "isNestedFamily": { - "type": "boolean", - "readOnly": true - }, - "isNestedFamORAssem": { - "type": "boolean", - "readOnly": true - }, - "isNestedPrivate": { - "type": "boolean", - "readOnly": true - }, - "isNestedPublic": { - "type": "boolean", - "readOnly": true - }, - "isNotPublic": { - "type": "boolean", - "readOnly": true - }, - "isPublic": { - "type": "boolean", - "readOnly": true - }, - "isAutoLayout": { - "type": "boolean", - "readOnly": true - }, - "isExplicitLayout": { - "type": "boolean", - "readOnly": true - }, - "isLayoutSequential": { - "type": "boolean", - "readOnly": true - }, - "isAnsiClass": { - "type": "boolean", - "readOnly": true - }, - "isAutoClass": { - "type": "boolean", - "readOnly": true - }, - "isUnicodeClass": { - "type": "boolean", - "readOnly": true - }, - "isCOMObject": { - "type": "boolean", - "readOnly": true - }, - "isContextful": { - "type": "boolean", - "readOnly": true - }, - "isEnum": { - "type": "boolean", - "readOnly": true - }, - "isMarshalByRef": { - "type": "boolean", - "readOnly": true - }, - "isPrimitive": { - "type": "boolean", - "readOnly": true - }, - "isValueType": { - "type": "boolean", - "readOnly": true - }, - "isSignatureType": { - "type": "boolean", - "readOnly": true - }, - "isSecurityCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecuritySafeCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecurityTransparent": { - "type": "boolean", - "readOnly": true - }, - "structLayoutAttribute": { - "$ref": "#/components/schemas/StructLayoutAttribute" - }, - "typeInitializer": { - "$ref": "#/components/schemas/ConstructorInfo" - }, - "typeHandle": { - "$ref": "#/components/schemas/RuntimeTypeHandle" - }, - "guid": { - "type": "string", - "format": "uuid", - "readOnly": true - }, - "baseType": { - "$ref": "#/components/schemas/Type" - }, - "isSerializable": { - "type": "boolean", - "readOnly": true - }, - "containsGenericParameters": { - "type": "boolean", - "readOnly": true - }, - "isVisible": { - "type": "boolean", - "readOnly": true - } - }, - "additionalProperties": false - }, - "TypeAttributes": { - "enum": [ - "NotPublic", - "AutoLayout", - "AnsiClass", - "Class", - "Public", - "NestedPublic", - "NestedPrivate", - "NestedFamily", - "NestedAssembly", - "NestedFamANDAssem", - "NestedFamORAssem", - "VisibilityMask", - "SequentialLayout", - "ExplicitLayout", - "LayoutMask", - "Interface", - "ClassSemanticsMask", - "Abstract", - "Sealed", - "SpecialName", - "RTSpecialName", - "Import", - "Serializable", - "WindowsRuntime", - "UnicodeClass", - "AutoClass", - "CustomFormatClass", - "StringFormatMask", - "HasSecurity", - "ReservedMask", - "BeforeFieldInit", - "CustomFormatMask" - ], - "type": "integer", - "format": "int32" - }, - "TypeInfo": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "customAttributes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CustomAttributeData" - }, - "nullable": true, - "readOnly": true - }, - "isCollectible": { - "type": "boolean", - "readOnly": true - }, - "metadataToken": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "isInterface": { - "type": "boolean", - "readOnly": true - }, - "memberType": { - "$ref": "#/components/schemas/MemberTypes" - }, - "namespace": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "assemblyQualifiedName": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "fullName": { - "type": "string", - "nullable": true, - "readOnly": true - }, - "assembly": { - "$ref": "#/components/schemas/Assembly" - }, - "module": { - "$ref": "#/components/schemas/Module" - }, - "isNested": { - "type": "boolean", - "readOnly": true - }, - "declaringType": { - "$ref": "#/components/schemas/Type" - }, - "declaringMethod": { - "$ref": "#/components/schemas/MethodBase" - }, - "reflectedType": { - "$ref": "#/components/schemas/Type" - }, - "underlyingSystemType": { - "$ref": "#/components/schemas/Type" - }, - "isTypeDefinition": { - "type": "boolean", - "readOnly": true - }, - "isArray": { - "type": "boolean", - "readOnly": true - }, - "isByRef": { - "type": "boolean", - "readOnly": true - }, - "isPointer": { - "type": "boolean", - "readOnly": true - }, - "isConstructedGenericType": { - "type": "boolean", - "readOnly": true - }, - "isGenericParameter": { - "type": "boolean", - "readOnly": true - }, - "isGenericTypeParameter": { - "type": "boolean", - "readOnly": true - }, - "isGenericMethodParameter": { - "type": "boolean", - "readOnly": true - }, - "isGenericType": { - "type": "boolean", - "readOnly": true - }, - "isGenericTypeDefinition": { - "type": "boolean", - "readOnly": true - }, - "isSZArray": { - "type": "boolean", - "readOnly": true - }, - "isVariableBoundArray": { - "type": "boolean", - "readOnly": true - }, - "isByRefLike": { - "type": "boolean", - "readOnly": true - }, - "hasElementType": { - "type": "boolean", - "readOnly": true - }, - "genericTypeArguments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Type" - }, - "nullable": true, - "readOnly": true - }, - "genericParameterPosition": { - "type": "integer", - "format": "int32", - "readOnly": true - }, - "genericParameterAttributes": { - "$ref": "#/components/schemas/GenericParameterAttributes" - }, - "attributes": { - "$ref": "#/components/schemas/TypeAttributes" - }, - "isAbstract": { - "type": "boolean", - "readOnly": true - }, - "isImport": { - "type": "boolean", - "readOnly": true - }, - "isSealed": { - "type": "boolean", - "readOnly": true - }, - "isSpecialName": { - "type": "boolean", - "readOnly": true - }, - "isClass": { - "type": "boolean", - "readOnly": true - }, - "isNestedAssembly": { - "type": "boolean", - "readOnly": true - }, - "isNestedFamANDAssem": { - "type": "boolean", - "readOnly": true - }, - "isNestedFamily": { - "type": "boolean", - "readOnly": true - }, - "isNestedFamORAssem": { - "type": "boolean", - "readOnly": true - }, - "isNestedPrivate": { - "type": "boolean", - "readOnly": true - }, - "isNestedPublic": { - "type": "boolean", - "readOnly": true - }, - "isNotPublic": { - "type": "boolean", - "readOnly": true - }, - "isPublic": { - "type": "boolean", - "readOnly": true - }, - "isAutoLayout": { - "type": "boolean", - "readOnly": true - }, - "isExplicitLayout": { - "type": "boolean", - "readOnly": true - }, - "isLayoutSequential": { - "type": "boolean", - "readOnly": true - }, - "isAnsiClass": { - "type": "boolean", - "readOnly": true - }, - "isAutoClass": { - "type": "boolean", - "readOnly": true - }, - "isUnicodeClass": { - "type": "boolean", - "readOnly": true - }, - "isCOMObject": { - "type": "boolean", - "readOnly": true - }, - "isContextful": { - "type": "boolean", - "readOnly": true - }, - "isEnum": { - "type": "boolean", - "readOnly": true - }, - "isMarshalByRef": { - "type": "boolean", - "readOnly": true - }, - "isPrimitive": { - "type": "boolean", - "readOnly": true - }, - "isValueType": { - "type": "boolean", - "readOnly": true - }, - "isSignatureType": { - "type": "boolean", - "readOnly": true - }, - "isSecurityCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecuritySafeCritical": { - "type": "boolean", - "readOnly": true - }, - "isSecurityTransparent": { - "type": "boolean", - "readOnly": true - }, - "structLayoutAttribute": { - "$ref": "#/components/schemas/StructLayoutAttribute" - }, - "typeInitializer": { - "$ref": "#/components/schemas/ConstructorInfo" - }, - "typeHandle": { - "$ref": "#/components/schemas/RuntimeTypeHandle" - }, - "guid": { - "type": "string", - "format": "uuid", - "readOnly": true - }, - "baseType": { - "$ref": "#/components/schemas/Type" - }, - "isSerializable": { - "type": "boolean", - "readOnly": true - }, - "containsGenericParameters": { - "type": "boolean", - "readOnly": true - }, - "isVisible": { - "type": "boolean", - "readOnly": true - }, - "genericTypeParameters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Type" - }, - "nullable": true, - "readOnly": true - }, - "declaredConstructors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ConstructorInfo" - }, - "nullable": true, - "readOnly": true - }, - "declaredEvents": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EventInfo" - }, - "nullable": true, - "readOnly": true - }, - "declaredFields": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FieldInfo" - }, - "nullable": true, - "readOnly": true - }, - "declaredMembers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MemberInfo" - }, - "nullable": true, - "readOnly": true - }, - "declaredMethods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MethodInfo" - }, - "nullable": true, - "readOnly": true - }, - "declaredNestedTypes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TypeInfo" - }, - "nullable": true, - "readOnly": true - }, - "declaredProperties": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PropertyInfo" - }, - "nullable": true, - "readOnly": true - }, - "implementedInterfaces": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Type" - }, - "nullable": true, - "readOnly": true - } - }, - "additionalProperties": false - }, - "UpgradeSettings": { - "type": "object", - "properties": { - "currentState": { - "type": "string", - "nullable": true - }, - "newState": { - "type": "string", - "nullable": true - }, - "newVersion": { - "type": "string", - "nullable": true - }, - "oldVersion": { - "type": "string", - "nullable": true - }, - "reportUrl": { - "type": "string", - "nullable": true, - "readOnly": true - } - }, - "additionalProperties": false - }, - "UserInstall": { - "required": [ - "email", - "name", - "password" - ], - "type": "object", - "properties": { - "name": { - "maxLength": 255, - "minLength": 0, - "type": "string" - }, - "email": { - "minLength": 1, - "type": "string", - "format": "email" - }, - "password": { - "minLength": 1, - "type": "string" - }, - "subscribeToNewsletter": { - "type": "boolean", - "readOnly": true - } - }, - "additionalProperties": false - }, - "UserSettings": { - "type": "object", - "properties": { - "minCharLength": { - "type": "integer", - "format": "int32" - }, - "minNonAlphaNumericLength": { - "type": "integer", - "format": "int32" - }, - "consentLevels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ConsentLevel" - }, - "nullable": true - } - }, - "additionalProperties": false - }, - "Version": { - "type": "object", - "properties": { - "version": { - "type": "string", - "nullable": true - } - }, - "additionalProperties": false - } - }, - "securitySchemes": { - "OAuth": { - "type": "oauth2", - "description": "Umbraco Authentication", - "flows": { - "authorizationCode": { - "authorizationUrl": "/umbraco/management/api/v1.0/security/back-office/authorize", - "tokenUrl": "/umbraco/management/api/v1.0/security/back-office/token", - "scopes": {} - } - } - } - } - }, - "security": [ - { - "OAuth": [] - } - ] -} diff --git a/src/Umbraco.Cms.Api.Management/OpenApi/EnumSchemaFilter.cs b/src/Umbraco.Cms.Api.Management/OpenApi/EnumSchemaFilter.cs deleted file mode 100644 index df78dc080d..0000000000 --- a/src/Umbraco.Cms.Api.Management/OpenApi/EnumSchemaFilter.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Reflection; -using System.Runtime.Serialization; -using Microsoft.OpenApi.Any; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; - -namespace Umbraco.Cms.Api.Management.OpenApi; - -public class EnumSchemaFilter : ISchemaFilter -{ - public void Apply(OpenApiSchema model, SchemaFilterContext context) - { - if (context.Type.IsEnum) - { - model.Enum.Clear(); - foreach (var name in Enum.GetNames(context.Type)) - { - var actualName = context.Type.GetField(name)?.GetCustomAttribute()?.Value ?? name; - model.Enum.Add(new OpenApiString(actualName)); - } - } - } -} diff --git a/src/Umbraco.Cms.Api.Management/OpenApi/MimeTypeDocumentFilter.cs b/src/Umbraco.Cms.Api.Management/OpenApi/MimeTypeDocumentFilter.cs deleted file mode 100644 index 15a1bda815..0000000000 --- a/src/Umbraco.Cms.Api.Management/OpenApi/MimeTypeDocumentFilter.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.OpenApi; - -/// -/// This filter explicitly removes all other mime types than application/json from the produced OpenAPI document -/// -public class MimeTypeDocumentFilter : IDocumentFilter -{ - public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) - { - OpenApiOperation[] operations = swaggerDoc.Paths - .SelectMany(path => path.Value.Operations.Values) - .ToArray(); - - void RemoveUnwantedMimeTypes(IDictionary content) => - content.RemoveAll(r => r.Key != "application/json"); - - OpenApiRequestBody[] requestBodies = operations.Select(operation => operation.RequestBody).WhereNotNull().ToArray(); - foreach (OpenApiRequestBody requestBody in requestBodies) - { - RemoveUnwantedMimeTypes(requestBody.Content); - } - - OpenApiResponse[] responses = operations.SelectMany(operation => operation.Responses.Values).WhereNotNull().ToArray(); - foreach (OpenApiResponse response in responses) - { - RemoveUnwantedMimeTypes(response.Content); - } - } -} diff --git a/src/Umbraco.Cms.Api.Management/OpenApi/OperationIdRegexes.cs b/src/Umbraco.Cms.Api.Management/OpenApi/OperationIdRegexes.cs deleted file mode 100644 index 4b764ceaa3..0000000000 --- a/src/Umbraco.Cms.Api.Management/OpenApi/OperationIdRegexes.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Text.RegularExpressions; - -namespace Umbraco.Cms.Api.Management.OpenApi; - -/// -/// This is the regexes used to generate the operation IDs, the benefit of this being partial with GeneratedRegex -/// source generators is that it will be pre-compiled at startup -/// See: https://devblogs.microsoft.com/dotnet/regular-expression-improvements-in-dotnet-7/#source-generation for more info. -/// -internal static partial class OperationIdRegexes -{ - // Your IDE may be showing errors here, this is because it's a new dotnet 7 feature (it's fixed in the EAP of Rider) - [GeneratedRegex(".*?\\/v[1-9]+/")] - public static partial Regex VersionPrefixRegex(); - - [GeneratedRegex("\\{(.*?)\\:?\\}")] - public static partial Regex TemplatePlaceholdersRegex(); - - [GeneratedRegex("[\\/\\-](\\w{1})")] - public static partial Regex ToCamelCaseRegex(); -} diff --git a/src/Umbraco.Cms.Api.Management/OpenApi/SchemaIdGenerator.cs b/src/Umbraco.Cms.Api.Management/OpenApi/SchemaIdGenerator.cs deleted file mode 100644 index a23ead7acb..0000000000 --- a/src/Umbraco.Cms.Api.Management/OpenApi/SchemaIdGenerator.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Text.RegularExpressions; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.OpenApi; - -internal static class SchemaIdGenerator -{ - public static string Generate(Type type) - { - string SanitizedTypeName(Type t) => t.Name - // first grab the "non generic" part of any generic type name (i.e. "PagedViewModel`1" becomes "PagedViewModel") - .Split('`').First() - // then remove the "ViewModel" postfix from type names - .TrimEnd("ViewModel"); - - var name = SanitizedTypeName(type); - if (type.IsGenericType) - { - // append the generic type names, ultimately turning i.e. "PagedViewModel" into "PagedRelationItem" - name += string.Join(string.Empty, type.GenericTypeArguments.Select(SanitizedTypeName)); - } - - // make absolutely sure we don't pass any invalid named by removing all non-word chars - return Regex.Replace(name, @"[^\w]", string.Empty); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Routing/VersionedApiBackOfficeRouteAttribute.cs b/src/Umbraco.Cms.Api.Management/Routing/VersionedApiBackOfficeRouteAttribute.cs deleted file mode 100644 index b5cda38f1d..0000000000 --- a/src/Umbraco.Cms.Api.Management/Routing/VersionedApiBackOfficeRouteAttribute.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Umbraco.Cms.Api.Common.Routing; - -namespace Umbraco.Cms.Api.Management.Routing; - -public class VersionedApiBackOfficeRouteAttribute : BackOfficeRouteAttribute -{ - public VersionedApiBackOfficeRouteAttribute(string template) - : base($"management/api/v{{version:apiVersion}}/{template.TrimStart('/')}") - { - } -} diff --git a/src/Umbraco.Cms.Api.Management/Security/BackOfficeApplicationManager.cs b/src/Umbraco.Cms.Api.Management/Security/BackOfficeApplicationManager.cs deleted file mode 100644 index d062edbc34..0000000000 --- a/src/Umbraco.Cms.Api.Management/Security/BackOfficeApplicationManager.cs +++ /dev/null @@ -1,131 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Options; -using OpenIddict.Abstractions; -using Umbraco.New.Cms.Core; -using Umbraco.New.Cms.Core.Models.Configuration; -using Umbraco.New.Cms.Infrastructure.Security; - -namespace Umbraco.Cms.Api.Management.Security; - -public class BackOfficeApplicationManager : IBackOfficeApplicationManager -{ - private readonly IOpenIddictApplicationManager _applicationManager; - private readonly IWebHostEnvironment _webHostEnvironment; - private readonly Uri? _backOfficeHost; - - public BackOfficeApplicationManager( - IOpenIddictApplicationManager applicationManager, - IWebHostEnvironment webHostEnvironment, - IOptionsMonitor securitySettingsMonitor) - { - _applicationManager = applicationManager; - _webHostEnvironment = webHostEnvironment; - _backOfficeHost = securitySettingsMonitor.CurrentValue.BackOfficeHost; - } - - public async Task EnsureBackOfficeApplicationAsync(Uri backOfficeUrl, CancellationToken cancellationToken = default) - { - if (backOfficeUrl.IsAbsoluteUri is false) - { - throw new ArgumentException($"Expected an absolute URL, got: {backOfficeUrl}", nameof(backOfficeUrl)); - } - - await CreateOrUpdate( - new OpenIddictApplicationDescriptor - { - DisplayName = "Umbraco back-office access", - ClientId = Constants.OauthClientIds.BackOffice, - RedirectUris = - { - CallbackUrlFor(_backOfficeHost ?? backOfficeUrl, "/umbraco/login/callback/") - }, - Type = OpenIddictConstants.ClientTypes.Public, - Permissions = - { - OpenIddictConstants.Permissions.Endpoints.Authorization, - OpenIddictConstants.Permissions.Endpoints.Token, - OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode, - OpenIddictConstants.Permissions.GrantTypes.RefreshToken, - OpenIddictConstants.Permissions.ResponseTypes.Code - } - }, - cancellationToken); - - if (_webHostEnvironment.IsProduction()) - { - await Delete(Constants.OauthClientIds.Swagger, cancellationToken); - await Delete(Constants.OauthClientIds.Postman, cancellationToken); - } - else - { - await CreateOrUpdate( - new OpenIddictApplicationDescriptor - { - DisplayName = "Umbraco Swagger access", - ClientId = Constants.OauthClientIds.Swagger, - RedirectUris = - { - CallbackUrlFor(backOfficeUrl, "/umbraco/swagger/oauth2-redirect.html") - }, - Type = OpenIddictConstants.ClientTypes.Public, - Permissions = - { - OpenIddictConstants.Permissions.Endpoints.Authorization, - OpenIddictConstants.Permissions.Endpoints.Token, - OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode, - OpenIddictConstants.Permissions.ResponseTypes.Code - } - }, - cancellationToken); - - await CreateOrUpdate( - new OpenIddictApplicationDescriptor - { - DisplayName = "Umbraco Postman access", - ClientId = Constants.OauthClientIds.Postman, - RedirectUris = - { - new Uri("https://oauth.pstmn.io/v1/callback") - }, - Type = OpenIddictConstants.ClientTypes.Public, - Permissions = - { - OpenIddictConstants.Permissions.Endpoints.Authorization, - OpenIddictConstants.Permissions.Endpoints.Token, - OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode, - OpenIddictConstants.Permissions.ResponseTypes.Code - } - }, - cancellationToken); - } - } - - private async Task CreateOrUpdate(OpenIddictApplicationDescriptor clientDescriptor, CancellationToken cancellationToken) - { - var identifier = clientDescriptor.ClientId ?? - throw new ApplicationException($"ClientId is missing for application: {clientDescriptor.DisplayName ?? "(no name)"}"); - var client = await _applicationManager.FindByClientIdAsync(identifier, cancellationToken); - if (client is null) - { - await _applicationManager.CreateAsync(clientDescriptor, cancellationToken); - } - else - { - await _applicationManager.UpdateAsync(client, clientDescriptor, cancellationToken); - } - } - - private async Task Delete(string identifier, CancellationToken cancellationToken) - { - var client = await _applicationManager.FindByClientIdAsync(identifier, cancellationToken); - if (client is null) - { - return; - } - - await _applicationManager.DeleteAsync(client, cancellationToken); - } - - private static Uri CallbackUrlFor(Uri url, string relativePath) => new Uri( $"{url.GetLeftPart(UriPartial.Authority)}/{relativePath.TrimStart(Core.Constants.CharArrays.ForwardSlash)}"); -} diff --git a/src/Umbraco.Cms.Api.Management/Serialization/ISystemTextJsonSerializer.cs b/src/Umbraco.Cms.Api.Management/Serialization/ISystemTextJsonSerializer.cs deleted file mode 100644 index 8ec90b6740..0000000000 --- a/src/Umbraco.Cms.Api.Management/Serialization/ISystemTextJsonSerializer.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Umbraco.Cms.Core.Serialization; - -namespace Umbraco.Cms.Api.Management.Serialization; - -public interface ISystemTextJsonSerializer : IJsonSerializer -{ -} diff --git a/src/Umbraco.Cms.Api.Management/Serialization/SystemTextJsonSerializer.cs b/src/Umbraco.Cms.Api.Management/Serialization/SystemTextJsonSerializer.cs deleted file mode 100644 index fce9df39cd..0000000000 --- a/src/Umbraco.Cms.Api.Management/Serialization/SystemTextJsonSerializer.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Text.Json; - -namespace Umbraco.Cms.Api.Management.Serialization; - -public class SystemTextJsonSerializer : ISystemTextJsonSerializer -{ - private JsonSerializerOptions _jsonSerializerOptions; - public SystemTextJsonSerializer() - { - _jsonSerializerOptions = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; - } - public string Serialize(object? input) => JsonSerializer.Serialize(input, _jsonSerializerOptions); - - public T? Deserialize(string input) => JsonSerializer.Deserialize(input, _jsonSerializerOptions); - - public T? DeserializeSubset(string input, string key) => throw new NotSupportedException(); -} diff --git a/src/Umbraco.Cms.Api.Management/Services/Entities/IUserStartNodeEntitiesService.cs b/src/Umbraco.Cms.Api.Management/Services/Entities/IUserStartNodeEntitiesService.cs deleted file mode 100644 index 0a00d2e963..0000000000 --- a/src/Umbraco.Cms.Api.Management/Services/Entities/IUserStartNodeEntitiesService.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Models.Entities; - -namespace Umbraco.Cms.Api.Management.Services.Entities; - -public interface IUserStartNodeEntitiesService -{ - /// - /// Calculates the applicable root entities for a given object type for users without root access. - /// - /// The object type. - /// The calculated start node IDs for the user. - /// A list of root entities for the user. - /// - /// The returned entities may include entities that outside of the user start node scope, but are needed to - /// for browsing to the actual user start nodes. These entities will be marked as "no access" entities. - /// - IEnumerable RootUserAccessEntities(UmbracoObjectTypes umbracoObjectType, int[] userStartNodeIds); - - /// - /// Calculates the applicable child entities from a list of candidate child entities for users without root access. - /// - /// The candidate child entities to filter (i.e. entities fetched with ). - /// The calculated start node paths for the user. - /// A list of child entities applicable entities for the user. - /// - /// The returned entities may include entities that outside of the user start node scope, but are needed to - /// for browsing to the actual user start nodes. These entities will be marked as "no access" entities. - /// Some candidate entities may be filtered out if they are not applicable for the user scope. - /// - IEnumerable ChildUserAccessEntities(IEnumerable candidateChildren, string[] userStartNodePaths); - - /// - /// Calculates the access level of a collection of entities for users without root access. - /// - /// The entities. - /// The calculated start node paths for the user. - /// The access level for each entity. - IEnumerable UserAccessEntities(IEnumerable entities, string[] userStartNodePaths); -} diff --git a/src/Umbraco.Cms.Api.Management/Services/Entities/UserStartNodeEntitiesService.cs b/src/Umbraco.Cms.Api.Management/Services/Entities/UserStartNodeEntitiesService.cs deleted file mode 100644 index be309815d7..0000000000 --- a/src/Umbraco.Cms.Api.Management/Services/Entities/UserStartNodeEntitiesService.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Entities; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Models.Entities; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Api.Management.Services.Entities; - -public class UserStartNodeEntitiesService : IUserStartNodeEntitiesService -{ - private readonly IEntityService _entityService; - - public UserStartNodeEntitiesService(IEntityService entityService) => _entityService = entityService; - - /// - public IEnumerable RootUserAccessEntities(UmbracoObjectTypes umbracoObjectType, int[] userStartNodeIds) - { - // root entities for users without root access should include: - // - the start nodes that are actual root entities (level == 1) - // - the root level ancestors to the rest of the start nodes (required for browsing to the actual start nodes - will be marked as "no access") - IEntitySlim[] userStartEntities = _entityService.GetAll(umbracoObjectType, userStartNodeIds).ToArray(); - - // find the start nodes that are at root level (level == 1) - IEntitySlim[] allowedTopmostEntities = userStartEntities.Where(entity => entity.Level == 1).ToArray(); - - // find the root level ancestors of the rest of the start nodes, and add those as well - var nonAllowedTopmostEntityIds = userStartEntities.Except(allowedTopmostEntities) - .Select(entity => int.TryParse(entity.Path.Split(Constants.CharArrays.Comma).Skip(1).FirstOrDefault(), out var id) ? id : 0) - .Where(id => id > 0) - .ToArray(); - IEntitySlim[] nonAllowedTopmostEntities = nonAllowedTopmostEntityIds.Any() - ? _entityService.GetAll(umbracoObjectType, nonAllowedTopmostEntityIds).ToArray() - : Array.Empty(); - - return allowedTopmostEntities - .Select(entity => new UserAccessEntity(entity, true)) - .Union( - nonAllowedTopmostEntities - .Select(entity => new UserAccessEntity(entity, false))) - .ToArray(); - } - - /// - public IEnumerable ChildUserAccessEntities(IEnumerable candidateChildren, string[] userStartNodePaths) - // child entities for users without root access should include: - // - children that are descendant-or-self of a user start node - // - children that are ancestors of a user start node (required for browsing to the actual start nodes - will be marked as "no access") - // all other candidate children should be discarded - => candidateChildren.Select(child => - { - // is descendant-or-self of a start node? - if (IsDescendantOrSelf(child, userStartNodePaths)) - { - return new UserAccessEntity(child, true); - } - - // is ancestor of a start node? - if (userStartNodePaths.Any(path => path.StartsWith(child.Path))) - { - return new UserAccessEntity(child, false); - } - - return null; - }).WhereNotNull().ToArray(); - - /// - public IEnumerable UserAccessEntities(IEnumerable entities, string[] userStartNodePaths) - // entities for users without root access should include: - // - entities that are descendant-or-self of a user start node as regular entities - // - all other entities as "no access" entities - => entities.Select(entity => new UserAccessEntity(entity, IsDescendantOrSelf(entity, userStartNodePaths))).ToArray(); - - private static bool IsDescendantOrSelf(IEntitySlim child, string[] userStartNodePaths) - => userStartNodePaths.Any(path => child.Path.StartsWith(path)); -} diff --git a/src/Umbraco.Cms.Api.Management/Services/ExamineManagerService.cs b/src/Umbraco.Cms.Api.Management/Services/ExamineManagerService.cs deleted file mode 100644 index ce48560a48..0000000000 --- a/src/Umbraco.Cms.Api.Management/Services/ExamineManagerService.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Examine; - -namespace Umbraco.Cms.Api.Management.Services; - -public class ExamineManagerService : IExamineManagerService -{ - private readonly IExamineManager _examineManager; - - public ExamineManagerService(IExamineManager examineManager) => _examineManager = examineManager; - - public bool TryFindSearcher(string searcherName, out ISearcher searcher) - { - // try to get the searcher from the indexes - if (!_examineManager.TryGetIndex(searcherName, out IIndex index)) - { - // if we didn't find anything try to find it by an explicitly declared searcher - return _examineManager.TryGetSearcher(searcherName, out searcher); - } - - searcher = index.Searcher; - return true; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Services/IExamineManagerService.cs b/src/Umbraco.Cms.Api.Management/Services/IExamineManagerService.cs deleted file mode 100644 index d4be7da2a8..0000000000 --- a/src/Umbraco.Cms.Api.Management/Services/IExamineManagerService.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Examine; - -namespace Umbraco.Cms.Api.Management.Services; - -public interface IExamineManagerService -{ - bool TryFindSearcher(string searcherName, out ISearcher searcher); -} diff --git a/src/Umbraco.Cms.Api.Management/Services/IJsonPatchService.cs b/src/Umbraco.Cms.Api.Management/Services/IJsonPatchService.cs deleted file mode 100644 index 7cf951bcc4..0000000000 --- a/src/Umbraco.Cms.Api.Management/Services/IJsonPatchService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Json.Patch; -using Umbraco.Cms.Api.Management.ViewModels.JsonPatch; - -namespace Umbraco.Cms.Api.Management.Services; - -public interface IJsonPatchService -{ - PatchResult? Patch(JsonPatchViewModel[] patchViewModel, object objectToPatch); -} diff --git a/src/Umbraco.Cms.Api.Management/Services/ILoadDictionaryItemService.cs b/src/Umbraco.Cms.Api.Management/Services/ILoadDictionaryItemService.cs deleted file mode 100644 index 9cd6357ecd..0000000000 --- a/src/Umbraco.Cms.Api.Management/Services/ILoadDictionaryItemService.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Umbraco.Cms.Core.Models; - -namespace Umbraco.Cms.Api.Management.Services; - -public interface ILoadDictionaryItemService -{ - IDictionaryItem Load(string filePath, int? parentId); -} diff --git a/src/Umbraco.Cms.Api.Management/Services/IUploadFileService.cs b/src/Umbraco.Cms.Api.Management/Services/IUploadFileService.cs deleted file mode 100644 index 3e632217dd..0000000000 --- a/src/Umbraco.Cms.Api.Management/Services/IUploadFileService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Umbraco.Cms.Api.Management.Models; - -namespace Umbraco.Cms.Api.Management.Services; - -public interface IUploadFileService -{ - FormFileUploadResult TryLoad(IFormFile file); -} diff --git a/src/Umbraco.Cms.Api.Management/Services/JsonPatchService.cs b/src/Umbraco.Cms.Api.Management/Services/JsonPatchService.cs deleted file mode 100644 index af10432492..0000000000 --- a/src/Umbraco.Cms.Api.Management/Services/JsonPatchService.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Text.Json.Nodes; -using Json.Patch; -using Umbraco.Cms.Api.Management.Serialization; -using Umbraco.Cms.Api.Management.ViewModels.JsonPatch; - -namespace Umbraco.Cms.Api.Management.Services; - -public class JsonPatchService : IJsonPatchService -{ - private readonly ISystemTextJsonSerializer _systemTextJsonSerializer; - - public JsonPatchService(ISystemTextJsonSerializer systemTextJsonSerializer) => _systemTextJsonSerializer = systemTextJsonSerializer; - - public PatchResult? Patch(JsonPatchViewModel[] patchViewModel, object objectToPatch) - { - var patchString = _systemTextJsonSerializer.Serialize(patchViewModel); - - var docString = _systemTextJsonSerializer.Serialize(objectToPatch); - JsonPatch? patch = _systemTextJsonSerializer.Deserialize(patchString); - var doc = JsonNode.Parse(docString); - return patch?.Apply(doc); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Services/LoadDictionaryItemService.cs b/src/Umbraco.Cms.Api.Management/Services/LoadDictionaryItemService.cs deleted file mode 100644 index 3fd791bcc0..0000000000 --- a/src/Umbraco.Cms.Api.Management/Services/LoadDictionaryItemService.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Xml; -using System.Xml.Linq; -using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Security; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Infrastructure.Packaging; - -namespace Umbraco.Cms.Api.Management.Services; - -public class LoadDictionaryItemService : ILoadDictionaryItemService -{ - private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; - private readonly ILocalizationService _localizationService; - private readonly PackageDataInstallation _packageDataInstallation; - private readonly ILogger _logger; - - public LoadDictionaryItemService( - IBackOfficeSecurityAccessor backOfficeSecurityAccessor, - ILocalizationService localizationService, - PackageDataInstallation packageDataInstallation, - ILogger logger) - { - _backOfficeSecurityAccessor = backOfficeSecurityAccessor; - _localizationService = localizationService; - _packageDataInstallation = packageDataInstallation; - _logger = logger; - } - public IDictionaryItem Load(string filePath, int? parentId) - { - var xmlDocument = new XmlDocument { XmlResolver = null }; - xmlDocument.Load(filePath); - - var userId = _backOfficeSecurityAccessor.BackOfficeSecurity?.GetUserId().Result ?? 0; - var element = XElement.Parse(xmlDocument.InnerXml); - - IDictionaryItem? parentDictionaryItem = _localizationService.GetDictionaryItemById(parentId ?? 0); - IEnumerable dictionaryItems = _packageDataInstallation.ImportDictionaryItem(element, userId, parentDictionaryItem?.Key); - - // Try to clean up the temporary file. - try - { - System.IO.File.Delete(filePath); - } - catch (Exception ex) - { - _logger.LogError(ex, "Error cleaning up temporary udt file in {File}", filePath); - } - - return dictionaryItems.First(); - } -} diff --git a/src/Umbraco.Cms.Api.Management/Services/Paging/PaginationService.cs b/src/Umbraco.Cms.Api.Management/Services/Paging/PaginationService.cs deleted file mode 100644 index ea8dde174c..0000000000 --- a/src/Umbraco.Cms.Api.Management/Services/Paging/PaginationService.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -namespace Umbraco.Cms.Api.Management.Services.Paging; - -// TODO: remove this class once EF core is in place with proper skip/take pagination implementation -// this service is used for converting skip/take to classic pagination with page number and page size. -// it is a temporary solution that should be removed once EF core is in place, thus we'll live -// with this code being statically referenced across multiple controllers. the alternative would be -// an injectable service, but that would require a greater clean-up effort later on. -internal static class PaginationService -{ - internal static bool ConvertSkipTakeToPaging(int skip, int take, out long pageNumber, out int pageSize, out ProblemDetails? error) - { - if (take <= 0) - { - throw new ArgumentException("Must be greater than zero", nameof(take)); - } - - if (skip % take != 0) - { - pageSize = 0; - pageNumber = 0; - error = new ProblemDetails - { - Title = "Invalid skip/take", - Detail = "Skip must be a multiple of take - i.e. skip = 10, take = 5", - Status = StatusCodes.Status400BadRequest, - Type = "Error", - }; - return false; - } - - pageSize = take; - pageNumber = skip / take; - error = null; - return true; - } -} diff --git a/src/Umbraco.Cms.Api.Management/Services/UploadFileService.cs b/src/Umbraco.Cms.Api.Management/Services/UploadFileService.cs deleted file mode 100644 index db784744f0..0000000000 --- a/src/Umbraco.Cms.Api.Management/Services/UploadFileService.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Xml; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.FileProviders; -using Microsoft.Extensions.Hosting; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Extensions; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Models; -using Umbraco.Extensions; -using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment; - -namespace Umbraco.Cms.Api.Management.Services; - -public class UploadFileService : IUploadFileService -{ - private readonly IHostEnvironment _hostEnvironment; - private readonly ILocalizedTextService _localizedTextService; - - public UploadFileService(IHostEnvironment hostEnvironment, ILocalizedTextService localizedTextService) - { - _hostEnvironment = hostEnvironment; - _localizedTextService = localizedTextService; - } - - public FormFileUploadResult TryLoad(IFormFile file) - { - var formFileUploadResult = new FormFileUploadResult(); - var fileName = file.FileName.Trim(Constants.CharArrays.DoubleQuote); - var ext = fileName.Substring(fileName.LastIndexOf('.') + 1).ToLower(); - var root = _hostEnvironment.MapPathContentRoot(Constants.SystemDirectories.TempFileUploads); - formFileUploadResult.TemporaryPath = Path.Combine(root, fileName); - - if (!Path.GetFullPath(formFileUploadResult.TemporaryPath).StartsWith(Path.GetFullPath(root))) - { - formFileUploadResult.ErrorMessage = _localizedTextService.Localize("media", "invalidFileName"); - formFileUploadResult.CouldLoad = false; - return formFileUploadResult; - } - - if (!ext.InvariantEquals("udt")) - { - formFileUploadResult.ErrorMessage = _localizedTextService.Localize("media", "disallowedFileType"); - formFileUploadResult.CouldLoad = false; - return formFileUploadResult; - } - - using (FileStream stream = File.Create(formFileUploadResult.TemporaryPath)) - { - file.CopyToAsync(stream).GetAwaiter().GetResult(); - } - - formFileUploadResult.XmlDocument = new XmlDocument {XmlResolver = null}; - formFileUploadResult.XmlDocument.Load(formFileUploadResult.TemporaryPath); - - if (formFileUploadResult.XmlDocument.DocumentElement != null) - { - return formFileUploadResult; - } - - formFileUploadResult.ErrorMessage = _localizedTextService.Localize("speechBubbles", "fileErrorNotFound"); - formFileUploadResult.CouldLoad = false; - return formFileUploadResult; - - } -} diff --git a/src/Umbraco.Cms.Api.Management/Umbraco.Cms.Api.Management.csproj b/src/Umbraco.Cms.Api.Management/Umbraco.Cms.Api.Management.csproj deleted file mode 100644 index 191d22193e..0000000000 --- a/src/Umbraco.Cms.Api.Management/Umbraco.Cms.Api.Management.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - Umbraco CMS - Management API - Contains the presentation layer for the Umbraco CMS Management API. - false - false - Umbraco.Cms.Api.Management - Umbraco.Cms.Api.Management - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Culture/CultureViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Culture/CultureViewModel.cs deleted file mode 100644 index b6ad89ccd4..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Culture/CultureViewModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Culture; - -public class CultureViewModel -{ - public string Name { get; set; } = null!; - - public string EnglishName { get; set; } = null!; -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryImportViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryImportViewModel.cs deleted file mode 100644 index d60af74a4a..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryImportViewModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Dictionary; - -public class DictionaryImportViewModel -{ - public List DictionaryItems { get; set; } = null!; - - public string? TempFileName { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryItemViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryItemViewModel.cs deleted file mode 100644 index 5616705c05..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryItemViewModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Dictionary; - -public class DictionaryItemViewModel -{ - public Guid? ParentId { get; set; } - - public Guid Key { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryItemsImportViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryItemsImportViewModel.cs deleted file mode 100644 index f0599a3e46..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryItemsImportViewModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Dictionary; - -public class DictionaryItemsImportViewModel -{ - public string? Name { get; set; } - - public int Level { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryOverviewViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryOverviewViewModel.cs deleted file mode 100644 index 05eb2fe6e3..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryOverviewViewModel.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Umbraco.Cms.Core.Models.ContentEditing; - -namespace Umbraco.Cms.Api.Management.ViewModels.Dictionary; - -public class DictionaryOverviewViewModel -{ - /// - /// Initializes a new instance of the class. - /// - public DictionaryOverviewViewModel() => Translations = new List(); - - /// - /// Gets or sets the key. - /// - public string? Name { get; set; } - - /// - /// Gets or sets the key. - /// - public Guid Key { get; set; } - - /// - /// Gets or sets the level. - /// - public int Level { get; set; } - - /// - /// Sets the translations. - /// - public List Translations { get; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryTranslationOverviewViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryTranslationOverviewViewModel.cs deleted file mode 100644 index d7d5f9e568..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryTranslationOverviewViewModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Dictionary; - -public class DictionaryTranslationOverviewViewModel -{ - /// - /// Gets or sets the display name. - /// - public string? DisplayName { get; set; } - - /// - /// Gets or sets a value indicating whether has translation. - /// - public bool HasTranslation { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryTranslationViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryTranslationViewModel.cs deleted file mode 100644 index 9d82f93f1e..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryTranslationViewModel.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Dictionary; - -public class DictionaryTranslationViewModel -{ - public int Id { get; set; } - - public Guid Key { get; set; } - - /// - /// Gets or sets the display name. - /// - public string? DisplayName { get; set; } - - /// - /// Gets or sets the ISO code. - /// - public string? IsoCode { get; set; } - - /// - /// Gets or sets the translation. - /// - public string Translation { get; set; } = null!; - - /// - /// Gets or sets the language id. - /// - public int LanguageId { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryViewModel.cs deleted file mode 100644 index 03fc307862..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Dictionary/DictionaryViewModel.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using Umbraco.Cms.Core.Models.ContentEditing; -using Umbraco.Cms.Core.Models.Validation; - -namespace Umbraco.Cms.Api.Management.ViewModels.Dictionary; - -/// -/// The dictionary display model -/// -public class DictionaryViewModel : INotificationModel -{ - /// - /// Initializes a new instance of the class. - /// - public DictionaryViewModel() - { - Notifications = new List(); - Translations = new List(); - ContentApps = new List(); - } - - /// - /// Gets or sets the parent id. - /// - public Guid? ParentId { get; set; } - - /// - /// Gets or sets the translations. - /// - public IEnumerable Translations { get; set; } = Enumerable.Empty(); - - /// - /// Apps for the dictionary item - /// - public IEnumerable ContentApps { get; set; } - - /// - /// - /// This is used to add custom localized messages/strings to the response for the app to use for localized UI purposes. - /// - public List Notifications { get; private set; } - - [RequiredForPersistence(AllowEmptyStrings = false, ErrorMessage = "Required")] - [Required] - public string Name { get; set; } = null!; - - /// - /// Gets or sets the Key for the object - /// - public Guid Key { get; set; } - - /// - /// The path of the entity - /// - public string Path { get; set; } = string.Empty; -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckActionViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckActionViewModel.cs deleted file mode 100644 index 2b47fd999e..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckActionViewModel.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.HealthCheck; - -public class HealthCheckActionViewModel -{ - /// - /// Gets or sets the health check key. - /// - public Guid HealthCheckKey { get; set; } - - /// - /// Gets or sets the alias. - /// - /// - /// It is used by the Health Check instance to execute the action. - /// - public string? Alias { get; set; } - - /// - /// Gets or sets the name. - /// - /// - /// It is used to name the "Fix" button. - /// - public string? Name { get; set; } - - /// - /// Gets or sets the description. - /// - public string? Description { get; set; } - - /// - /// Gets or sets a value indicating whether a value is required to rectify the issue. - /// - public required bool ValueRequired { get; set; } - - /// - /// Gets or sets the value to rectify the issue. - /// - public string? ProvidedValue { get; set; } - - /// - /// Gets or sets how the provided value is validated. - /// - public string? ProvidedValueValidation { get; set; } - - /// - /// Gets or sets the regex to use when validating the provided value (if the value can be validated by a regex). - /// - public string? ProvidedValueValidationRegex { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckGroupViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckGroupViewModel.cs deleted file mode 100644 index 74b5995d37..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckGroupViewModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.HealthCheck; - -public class HealthCheckGroupViewModel -{ - /// - /// Gets or sets the name. - /// - public string? Name { get; set; } - - /// - /// Gets or sets the health checks. - /// - public required List Checks { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckGroupWithResultViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckGroupWithResultViewModel.cs deleted file mode 100644 index a5ad99eea0..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckGroupWithResultViewModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.HealthCheck; - -public class HealthCheckGroupWithResultViewModel -{ - /// - /// Gets or sets the name. - /// - public string? Name { get; set; } - - /// - /// Gets or sets the health checks with the result(s) from each health check. - /// - public required List Checks { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckResultViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckResultViewModel.cs deleted file mode 100644 index f4c89b7b34..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckResultViewModel.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Umbraco.Cms.Core.HealthChecks; - -namespace Umbraco.Cms.Api.Management.ViewModels.HealthCheck; - -public class HealthCheckResultViewModel -{ - /// - /// Gets or sets the status message. - /// - public required string Message { get; set; } - - /// - /// Gets or sets the status type. - /// - public StatusResultType ResultType { get; set; } - - /// - /// Gets or sets the potential actions to take (if any). - /// - public IEnumerable? Actions { get; set; } - - /// - /// This is optional but would allow a developer to get or set a link that is shown as a "Read more" button. - /// - public string? ReadMoreLink { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckViewModel.cs deleted file mode 100644 index 39cde4843e..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckViewModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.HealthCheck; - -public class HealthCheckViewModel -{ - /// - /// Gets or sets the key. - /// - public Guid Key { get; set; } - - /// - /// Gets or sets the name. - /// - public required string Name { get; set; } - - /// - /// Gets or sets the description. - /// - public string? Description { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckWithResultViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckWithResultViewModel.cs deleted file mode 100644 index c566ae86b8..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/HealthCheck/HealthCheckWithResultViewModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.HealthCheck; - -public class HealthCheckWithResultViewModel : HealthCheckViewModel -{ - /// - /// Gets or sets the result(s) for a health check. - /// There can be several. - /// - public List? Results { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Help/HelpPageViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Help/HelpPageViewModel.cs deleted file mode 100644 index 162c0b75d0..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Help/HelpPageViewModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Help; - -public class HelpPageViewModel -{ - public string? Name { get; set; } - - public string? Description { get; set; } - - public string? Url { get; set; } - - public string? Type { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/ConsentLevelViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Installer/ConsentLevelViewModel.cs deleted file mode 100644 index e6a17e7e45..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/ConsentLevelViewModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Text.Json.Serialization; -using Umbraco.Cms.Core.Models; - -namespace Umbraco.Cms.Api.Management.ViewModels.Installer; - -public class ConsentLevelViewModel -{ - [JsonConverter(typeof(JsonStringEnumConverter))] - public TelemetryLevel Level { get; set; } - - public string Description { get; set; } = string.Empty; -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/DatabaseInstallViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Installer/DatabaseInstallViewModel.cs deleted file mode 100644 index c93726d3f7..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/DatabaseInstallViewModel.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; - -namespace Umbraco.Cms.Api.Management.ViewModels.Installer; - -public class DatabaseInstallViewModel -{ - [Required] - public Guid Id { get; set; } - - [Required] - public string? ProviderName { get; set; } - - public string? Server { get; set; } - - public string? Name { get; set; } - - public string? Username { get; set; } - - [PasswordPropertyText] - public string? Password { get; set; } - - public bool UseIntegratedAuthentication { get; set; } - - public string? ConnectionString { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/DatabaseSettingsViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Installer/DatabaseSettingsViewModel.cs deleted file mode 100644 index c6c5e582c3..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/DatabaseSettingsViewModel.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Installer; - -public class DatabaseSettingsViewModel -{ - public Guid Id { get; set; } - - public int SortOrder { get; set; } - - public string DisplayName { get; set; } = string.Empty; - - public string DefaultDatabaseName { get; set; } = string.Empty; - - public string ProviderName { get; set; } = string.Empty; - - public bool IsConfigured { get; set; } - - public bool RequiresServer { get; set; } - - public string ServerPlaceholder { get; set; } = string.Empty; - - public bool RequiresCredentials { get; set; } - - public bool SupportsIntegratedAuthentication { get; set; } - - public bool RequiresConnectionTest { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/InstallSettingsViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Installer/InstallSettingsViewModel.cs deleted file mode 100644 index d05823590f..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/InstallSettingsViewModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Installer; - -public class InstallSettingsViewModel -{ - public UserSettingsViewModel User { get; set; } = null!; - - public IEnumerable Databases { get; set; } = Enumerable.Empty(); -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/InstallViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Installer/InstallViewModel.cs deleted file mode 100644 index d8f68f8faa..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/InstallViewModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Text.Json.Serialization; -using Umbraco.Cms.Core.Models; - -namespace Umbraco.Cms.Api.Management.ViewModels.Installer; - -public class InstallViewModel -{ - [Required] - public UserInstallViewModel User { get; set; } = null!; - - [Required] - public DatabaseInstallViewModel Database { get; set; } = null!; - - [JsonConverter(typeof(JsonStringEnumConverter))] - public TelemetryLevel TelemetryLevel { get; set; } = TelemetryLevel.Basic; -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/UpgradeSettingsViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Installer/UpgradeSettingsViewModel.cs deleted file mode 100644 index 55ceb6b761..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/UpgradeSettingsViewModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Installer; - -public class UpgradeSettingsViewModel -{ - public string CurrentState { get; set; } = string.Empty; - - public string NewState { get; set; } = string.Empty; - - public string NewVersion { get; set; } = string.Empty; - - public string OldVersion { get; set; } = string.Empty; - - public string ReportUrl => - $"https://our.umbraco.com/contribute/releases/compare?from={OldVersion}&to={NewVersion}¬es=1"; -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/UserInstallViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Installer/UserInstallViewModel.cs deleted file mode 100644 index fe18241763..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/UserInstallViewModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; - -namespace Umbraco.Cms.Api.Management.ViewModels.Installer; - -public class UserInstallViewModel -{ - [Required] - [StringLength(255)] - public string Name { get; set; } = null!; - - [Required] - [EmailAddress] - public string Email { get; set; } = null!; - - [Required] - [PasswordPropertyText] - public string Password { get; set; } = null!; - - public bool SubscribeToNewsletter { get; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/UserSettingsViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Installer/UserSettingsViewModel.cs deleted file mode 100644 index 242e3ae3b3..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Installer/UserSettingsViewModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Installer; - -public class UserSettingsViewModel -{ - public int MinCharLength { get; set; } - - public int MinNonAlphaNumericLength { get; set; } - - public IEnumerable ConsentLevels { get; set; } = Enumerable.Empty(); -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/JsonPatch/JsonPatchViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/JsonPatch/JsonPatchViewModel.cs deleted file mode 100644 index ecba170d4e..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/JsonPatch/JsonPatchViewModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.JsonPatch; - -public class JsonPatchViewModel -{ - public string Op { get; set; } = null!; - - public string Path { get; set; } = null!; - - public object Value { get; set; } = null!; -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Language/LanguageViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Language/LanguageViewModel.cs deleted file mode 100644 index a5cc1a7f1a..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Language/LanguageViewModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Umbraco.Cms.Api.Management.ViewModels.Language; - -public class LanguageViewModel -{ - public int Id { get; set; } - - [Required(AllowEmptyStrings = false)] - public string IsoCode { get; set; } = null!; - - public string? Name { get; set; } - - public bool IsDefault { get; set; } - - public bool IsMandatory { get; set; } - - public int? FallbackLanguageId { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/ModelsBuilderDashboard/ModelsBuilderViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/ModelsBuilderDashboard/ModelsBuilderViewModel.cs deleted file mode 100644 index a6bec1444b..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/ModelsBuilderDashboard/ModelsBuilderViewModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Umbraco.Cms.Core.Configuration; - -namespace Umbraco.Cms.Api.Management.ViewModels.ModelsBuilderDashboard; - -public class ModelsBuilderViewModel -{ - public ModelsMode Mode { get; set; } - - public bool CanGenerate { get; set; } - - public bool OutOfDateModels { get; set; } - - public string? LastError { get; set; } - - public string? Version { get; set; } - - public string? ModelsNamespace { get; set; } - - public bool TrackingOutOfDateModels { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/ModelsBuilderDashboard/OutOfDateStatusViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/ModelsBuilderDashboard/OutOfDateStatusViewModel.cs deleted file mode 100644 index 8e18356ef4..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/ModelsBuilderDashboard/OutOfDateStatusViewModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Umbraco.New.Cms.Core.Models; - -namespace Umbraco.Cms.Api.Management.ViewModels.ModelsBuilderDashboard; - -public class OutOfDateStatusViewModel -{ - public OutOfDateType Status { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Move/MoveViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Move/MoveViewModel.cs deleted file mode 100644 index 88942df570..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Move/MoveViewModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Umbraco.Cms.Api.Management.ViewModels.Move; - -/// -/// A model representing a model for moving or copying -/// -public class MoveViewModel -{ - /// - /// The Id of the node to move or copy to - /// - [Required] - public int ParentId { get; set; } - - /// - /// The id of the node to move or copy - /// - [Required] - public int Id { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Profiling/ProfilingStatusViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Profiling/ProfilingStatusViewModel.cs deleted file mode 100644 index 6fe73dd158..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Profiling/ProfilingStatusViewModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Profiling; - -public class ProfilingStatusViewModel -{ - public ProfilingStatusViewModel(bool enabled) => Enabled = enabled; - - public bool Enabled { get; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/RecycleBin/RecycleBinItemViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/RecycleBin/RecycleBinItemViewModel.cs deleted file mode 100644 index d3d25622f0..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/RecycleBin/RecycleBinItemViewModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.RecycleBin; - -public class RecycleBinItemViewModel -{ - public Guid Key { get; set; } - - public string Name { get; set; } = string.Empty; - - public string Type { get; set; } = string.Empty; - - public string Icon { get; set; } = string.Empty; - - public bool HasChildren { get; set; } - - public bool IsContainer { get; set; } - - public Guid? ParentKey { get; set; } -} - diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/RedirectUrlManagement/RedirectUrlStatusViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/RedirectUrlManagement/RedirectUrlStatusViewModel.cs deleted file mode 100644 index 0efa0ef843..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/RedirectUrlManagement/RedirectUrlStatusViewModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Umbraco.New.Cms.Core.Models.RedirectUrlManagement; - -namespace Umbraco.Cms.Api.Management.ViewModels.RedirectUrlManagement; - -public class RedirectUrlStatusViewModel -{ - public RedirectStatus Status { get; set; } - - public bool UserIsAdmin { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/RedirectUrlManagement/RedirectUrlViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/RedirectUrlManagement/RedirectUrlViewModel.cs deleted file mode 100644 index 6840ae1c19..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/RedirectUrlManagement/RedirectUrlViewModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.RedirectUrlManagement; - -public class RedirectUrlViewModel -{ - public Guid Key { get; set; } - - public required string OriginalUrl { get; set; } - - public required string DestinationUrl { get; set; } - - public DateTime Created { get; set; } - - public Guid ContentKey { get; set; } - - public string? Culture { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Relation/RelationViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Relation/RelationViewModel.cs deleted file mode 100644 index 7518075e77..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Relation/RelationViewModel.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.ComponentModel; -using System.Text.Json.Serialization; - -namespace Umbraco.Cms.Api.Management.ViewModels.Relation; - -public class RelationViewModel -{ - /// - /// Gets or sets the Parent Id of the Relation (Source). - /// - [ReadOnly(true)] - public int ParentId { get; set; } - - /// - /// Gets or sets the Parent Name of the relation (Source). - /// - [ReadOnly(true)] - public string? ParentName { get; set; } - - /// - /// Gets or sets the Child Id of the Relation (Destination). - /// - [ReadOnly(true)] - public int ChildId { get; set; } - - /// - /// Gets or sets the Child Name of the relation (Destination). - /// - [ReadOnly(true)] - public string? ChildName { get; set; } - - /// - /// Gets or sets the date when the Relation was created. - /// - [ReadOnly(true)] - public DateTime CreateDate { get; set; } - - /// - /// Gets or sets a comment for the Relation. - /// - [ReadOnly(true)] - public string? Comment { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Search/FieldViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Search/FieldViewModel.cs deleted file mode 100644 index b6eb496865..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Search/FieldViewModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Search; - -public class FieldViewModel -{ - public string Name { get; init; } = null!; - - public IEnumerable Values { get; init; } = null!; -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Search/IndexViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Search/IndexViewModel.cs deleted file mode 100644 index 54110bc578..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Search/IndexViewModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Umbraco.Cms.Api.Management.ViewModels.Search; - -public class IndexViewModel -{ - [Required] - public string Name { get; init; } = null!; - - public string? HealthStatus { get; init; } - - [Required] - public bool IsHealthy => HealthStatus == "Healthy"; - - [Required] - public bool CanRebuild { get; init; } - - public string SearcherName { get; init; } = null!; - - [Required] - public long DocumentCount { get; init; } - - [Required] - public int FieldCount { get; init; } - - public IReadOnlyDictionary? ProviderProperties { get; init; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Search/SearchResultViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Search/SearchResultViewModel.cs deleted file mode 100644 index 19a03405f9..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Search/SearchResultViewModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Search; - -public class SearchResultViewModel -{ - public string Id { get; set; } = null!; - - public float Score { get; set; } - - public int FieldCount => Fields.Count(); - - public IEnumerable Fields { get; set; } = null!; -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Search/SearcherViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Search/SearcherViewModel.cs deleted file mode 100644 index 38fcb7d984..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Search/SearcherViewModel.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Search; - -public class SearcherViewModel -{ - public string Name { get; set; } = null!; -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Server/ServerStatusViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Server/ServerStatusViewModel.cs deleted file mode 100644 index bca009947c..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Server/ServerStatusViewModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Text.Json.Serialization; -using Umbraco.Cms.Core; - -namespace Umbraco.Cms.Api.Management.ViewModels.Server; - -public class ServerStatusViewModel -{ - [JsonConverter(typeof(JsonStringEnumConverter))] - public RuntimeLevel ServerStatus { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Server/VersionViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Server/VersionViewModel.cs deleted file mode 100644 index 255ed4d08d..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Server/VersionViewModel.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Server; - -public class VersionViewModel -{ - public string Version { get; set; } = null!; -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Telemetry/TelemetryViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Telemetry/TelemetryViewModel.cs deleted file mode 100644 index f0ef63e25e..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Telemetry/TelemetryViewModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Text.Json.Serialization; -using Umbraco.Cms.Core.Models; - -namespace Umbraco.Cms.Api.Management.ViewModels.Telemetry; - -public class TelemetryViewModel -{ - [JsonConverter(typeof(JsonStringEnumConverter))] - public TelemetryLevel TelemetryLevel { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/TrackedReferences/RelationItemViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/TrackedReferences/RelationItemViewModel.cs deleted file mode 100644 index f27c81f3eb..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/TrackedReferences/RelationItemViewModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.TrackedReferences; - -public class RelationItemViewModel -{ - public Guid NodeKey { get; set; } - - public string? NodeName { get; set; } - - public string? NodeType { get; set; } - - public string? ContentTypeIcon { get; set; } - - public string? ContentTypeAlias { get; set; } - - public string? ContentTypeName { get; set; } - - public string? RelationTypeName { get; set; } - - public bool RelationTypeIsBidirectional { get; set; } - - public bool RelationTypeIsDependency { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/ContentTreeItemViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Tree/ContentTreeItemViewModel.cs deleted file mode 100644 index ccaa4182e6..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/ContentTreeItemViewModel.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Tree; - -public class ContentTreeItemViewModel : EntityTreeItemViewModel -{ - public bool NoAccess { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentBlueprintTreeItemViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentBlueprintTreeItemViewModel.cs deleted file mode 100644 index 940f0ec793..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentBlueprintTreeItemViewModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Tree; - -public class DocumentBlueprintTreeItemViewModel : EntityTreeItemViewModel -{ - public Guid DocumentTypeKey { get; set; } - - public string DocumentTypeAlias { get; set; } = string.Empty; - - public string? DocumentTypeName { get; set; } = string.Empty; -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTreeItemViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTreeItemViewModel.cs deleted file mode 100644 index 09ffd927d8..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTreeItemViewModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Tree; - -public class DocumentTreeItemViewModel : ContentTreeItemViewModel -{ - public bool IsProtected { get; set; } - - public bool IsPublished { get; set; } - - public bool IsEdited { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTypeTreeItemViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTypeTreeItemViewModel.cs deleted file mode 100644 index b789c89975..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/DocumentTypeTreeItemViewModel.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Tree; - -public class DocumentTypeTreeItemViewModel : FolderTreeItemViewModel -{ - public bool IsElement { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/EntityTreeItemViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Tree/EntityTreeItemViewModel.cs deleted file mode 100644 index a163a4f9a7..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/EntityTreeItemViewModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Tree; - -public class EntityTreeItemViewModel : TreeItemViewModel -{ - public Guid Key { get; set; } - - public bool IsContainer { get; set; } - - public Guid? ParentKey { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/FileSystemTreeItemViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Tree/FileSystemTreeItemViewModel.cs deleted file mode 100644 index 0ad7a45e9b..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/FileSystemTreeItemViewModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Tree; - -public class FileSystemTreeItemViewModel : TreeItemViewModel -{ - public string Path { get; set; } = string.Empty; - - public bool IsFolder { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/FolderTreeItemViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Tree/FolderTreeItemViewModel.cs deleted file mode 100644 index 920a67a26c..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/FolderTreeItemViewModel.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Tree; - -public class FolderTreeItemViewModel : EntityTreeItemViewModel -{ - public bool IsFolder { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/TreeItemViewModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Tree/TreeItemViewModel.cs deleted file mode 100644 index b32a96af2f..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Tree/TreeItemViewModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Tree; - -public class TreeItemViewModel -{ - public string Name { get; set; } = string.Empty; - - public string Type { get; set; } = string.Empty; - - public string Icon { get; set; } = string.Empty; - - public bool HasChildren { get; set; } -} diff --git a/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj b/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj index 8e310a5f42..39412ef362 100644 --- a/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj +++ b/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj @@ -9,8 +9,6 @@ - - diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 160680d3ee..4be13cb615 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -8,7 +8,6 @@ - diff --git a/tests/Umbraco.Tests.Integration/GlobalSetupTeardown.cs b/tests/Umbraco.Tests.Integration/GlobalSetupTeardown.cs index e811b18e08..834dfce91e 100644 --- a/tests/Umbraco.Tests.Integration/GlobalSetupTeardown.cs +++ b/tests/Umbraco.Tests.Integration/GlobalSetupTeardown.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using System.Linq; using Microsoft.Extensions.Configuration; diff --git a/tests/Umbraco.Tests.Integration/Implementations/TestHelper.cs b/tests/Umbraco.Tests.Integration/Implementations/TestHelper.cs index b203ce7aea..1a4ccacdd1 100644 --- a/tests/Umbraco.Tests.Integration/Implementations/TestHelper.cs +++ b/tests/Umbraco.Tests.Integration/Implementations/TestHelper.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections; using System.ComponentModel; using System.IO; diff --git a/tests/Umbraco.Tests.Integration/NewBackoffice/OpenAPIContractTest.cs b/tests/Umbraco.Tests.Integration/NewBackoffice/OpenAPIContractTest.cs deleted file mode 100644 index ecb3112d7c..0000000000 --- a/tests/Umbraco.Tests.Integration/NewBackoffice/OpenAPIContractTest.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using NUnit.Framework; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.Hosting; -using Umbraco.Cms.Tests.Integration.TestServerTest; - -namespace Umbraco.Cms.Tests.Integration.NewBackoffice; - -[TestFixture] -internal sealed class OpenAPIContractTest : UmbracoTestServerTestBase -{ - private GlobalSettings GlobalSettings => GetRequiredService>().Value; - - private IHostingEnvironment HostingEnvironment => GetRequiredService(); - - protected override void CustomTestSetup(IUmbracoBuilder builder) - { - builder.AddMvcAndRazor(mvcBuilder => - { - // Adds Umbraco.Cms.Api.Management - mvcBuilder.AddApplicationPart(typeof(Api.Management.Controllers.Install.InstallControllerBase).Assembly); - }); - - new Api.Management.ManagementApiComposer().Compose(builder); - } - - [Test] - public async Task Validate_OpenApi_Contract_is_implemented() - { - string[] keysToIgnore = { "servers", "x-generator" }; - - var officePath = GlobalSettings.GetBackOfficePath(HostingEnvironment); - - var urlToContract = $"{officePath}/management/api/openapi.json"; - var swaggerPath = $"{officePath}/swagger/v1/swagger.json"; - var apiContract = JObject.Parse(await Client.GetStringAsync(urlToContract)); - - var generatedJsonString = await Client.GetStringAsync(swaggerPath); - var mergedContract = JObject.Parse(generatedJsonString); - var originalGeneratedContract = JObject.Parse(generatedJsonString); - - mergedContract.Merge(apiContract, new JsonMergeSettings - { - MergeArrayHandling = MergeArrayHandling.Merge - }); - - foreach (var key in keysToIgnore) - { - originalGeneratedContract.Remove(key); - mergedContract.Remove(key); - } - - Assert.AreEqual(originalGeneratedContract.ToString(Formatting.Indented), mergedContract.ToString(Formatting.Indented), $"Generated API do not respect the contract."); - } -} diff --git a/tests/Umbraco.Tests.Integration/TestServerTest/Controllers/EnsureNotAmbiguousActionNameControllerTests.cs b/tests/Umbraco.Tests.Integration/TestServerTest/Controllers/EnsureNotAmbiguousActionNameControllerTests.cs index 21b1445e36..a13affb340 100644 --- a/tests/Umbraco.Tests.Integration/TestServerTest/Controllers/EnsureNotAmbiguousActionNameControllerTests.cs +++ b/tests/Umbraco.Tests.Integration/TestServerTest/Controllers/EnsureNotAmbiguousActionNameControllerTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models.ContentEditing; diff --git a/tests/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs b/tests/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs index dfe7b9377b..162713d8fb 100644 --- a/tests/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs +++ b/tests/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs @@ -16,8 +16,6 @@ using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Composing; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Web; -using Umbraco.Cms.Api.Management; -using Umbraco.Cms.Api.Management.Controllers.Install; using Umbraco.Cms.Persistence.Sqlite; using Umbraco.Cms.Persistence.SqlServer; using Umbraco.Cms.Tests.Common.Testing; @@ -251,7 +249,7 @@ namespace Umbraco.Cms.Tests.Integration.TestServerTest /// protected virtual void ConfigureTestServices(IServiceCollection services) { - + } protected void Configure(IApplicationBuilder app) diff --git a/tests/Umbraco.Tests.Integration/TestServerTest/UmbracoWebApplicationFactory.cs b/tests/Umbraco.Tests.Integration/TestServerTest/UmbracoWebApplicationFactory.cs index 98ad406694..bfebf0b41b 100644 --- a/tests/Umbraco.Tests.Integration/TestServerTest/UmbracoWebApplicationFactory.cs +++ b/tests/Umbraco.Tests.Integration/TestServerTest/UmbracoWebApplicationFactory.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.Extensions.Hosting; diff --git a/tests/Umbraco.Tests.Integration/Testing/BaseTestDatabase.cs b/tests/Umbraco.Tests.Integration/Testing/BaseTestDatabase.cs index 7aa632987b..76a95cd950 100644 --- a/tests/Umbraco.Tests.Integration/Testing/BaseTestDatabase.cs +++ b/tests/Umbraco.Tests.Integration/Testing/BaseTestDatabase.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Data; diff --git a/tests/Umbraco.Tests.Integration/Testing/LocalDbTestDatabase.cs b/tests/Umbraco.Tests.Integration/Testing/LocalDbTestDatabase.cs index 38da6ad7a4..dfc7d84155 100644 --- a/tests/Umbraco.Tests.Integration/Testing/LocalDbTestDatabase.cs +++ b/tests/Umbraco.Tests.Integration/Testing/LocalDbTestDatabase.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Concurrent; using System.IO; using System.Linq; diff --git a/tests/Umbraco.Tests.Integration/Testing/SqlServerBaseTestDatabase.cs b/tests/Umbraco.Tests.Integration/Testing/SqlServerBaseTestDatabase.cs index 8a19c07ac9..f9538a24cf 100644 --- a/tests/Umbraco.Tests.Integration/Testing/SqlServerBaseTestDatabase.cs +++ b/tests/Umbraco.Tests.Integration/Testing/SqlServerBaseTestDatabase.cs @@ -1,4 +1,3 @@ -using System; using System.Data; using System.Data.Common; using System.Linq; diff --git a/tests/Umbraco.Tests.Integration/Testing/SqlServerTestDatabase.cs b/tests/Umbraco.Tests.Integration/Testing/SqlServerTestDatabase.cs index e489081e60..8faaf66d82 100644 --- a/tests/Umbraco.Tests.Integration/Testing/SqlServerTestDatabase.cs +++ b/tests/Umbraco.Tests.Integration/Testing/SqlServerTestDatabase.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Concurrent; using System.Linq; using System.Threading; @@ -90,7 +89,7 @@ public class SqlServerTestDatabase : SqlServerBaseTestDatabase, ITestDatabase var sql = $@" ALTER DATABASE {LocalDb.QuotedName(meta.Name)} - SET SINGLE_USER + SET SINGLE_USER WITH ROLLBACK IMMEDIATE"; SetCommand(command, sql); command.ExecuteNonQuery(); diff --git a/tests/Umbraco.Tests.Integration/Testing/SqliteTestDatabase.cs b/tests/Umbraco.Tests.Integration/Testing/SqliteTestDatabase.cs index 2c39e6cc6c..a20b00ebe5 100644 --- a/tests/Umbraco.Tests.Integration/Testing/SqliteTestDatabase.cs +++ b/tests/Umbraco.Tests.Integration/Testing/SqliteTestDatabase.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Concurrent; using System.Data; using System.Data.Common; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs index 70951d98c2..c5f4d62a61 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs @@ -1,4 +1,3 @@ -using System; using System.Net; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/FileSystemsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/FileSystemsTests.cs index 8fa8f0e252..18b50b1b8e 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/FileSystemsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/FileSystemsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.IO; using System.Text; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/ShadowFileSystemTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/ShadowFileSystemTests.cs index 9285fcc729..6b9f3ae042 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/ShadowFileSystemTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/ShadowFileSystemTests.cs @@ -1,4 +1,3 @@ -using System; using System.IO; using System.Linq; using System.Text; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Mapping/ContentTypeModelMappingTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Mapping/ContentTypeModelMappingTests.cs index 5a3c7723b3..c7cb3d091d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Mapping/ContentTypeModelMappingTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Mapping/ContentTypeModelMappingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using Microsoft.Extensions.DependencyInjection; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs index e9c4ac320b..c60083f4c8 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.IO; using System.IO.Compression; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContentQueryAccessorTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContentQueryAccessorTests.cs index daa99b89a2..108c3dab19 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContentQueryAccessorTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContentQueryAccessorTests.cs @@ -1,4 +1,3 @@ -using System; using System.Net; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/RuntimeStateTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/RuntimeStateTests.cs index 148758f7ca..cd18e58563 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/RuntimeStateTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/RuntimeStateTests.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Telemetry/TelemetryServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Telemetry/TelemetryServiceTests.cs index bc4b68b508..f44c381172 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Telemetry/TelemetryServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Telemetry/TelemetryServiceTests.cs @@ -1,4 +1,3 @@ -using System; using System.Linq; using Microsoft.Extensions.DependencyInjection; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineBaseTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineBaseTest.cs index 75181d0b33..381464faf3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineBaseTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineBaseTest.cs @@ -1,4 +1,3 @@ -using System; using System.Data; using Examine.Lucene.Providers; using Microsoft.Extensions.DependencyInjection; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineExtensions.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineExtensions.cs index 7f601898c6..f8bca9ef51 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineExtensions.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineExtensions.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs index b271cabb08..4d31b9c314 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Bogus; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/RandomIdRAMDirectory.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/RandomIdRAMDirectory.cs index 92c7d6581b..10b6b1366f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/RandomIdRAMDirectory.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/RandomIdRAMDirectory.cs @@ -1,4 +1,3 @@ -using System; using Lucene.Net.Store; namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/SearchTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/SearchTests.cs index 0b3a7ef45a..41ba42dc86 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/SearchTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/SearchTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Examine; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/TestFiles.Designer.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/TestFiles.Designer.cs index 166d329208..c076cd8b22 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/TestFiles.Designer.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/TestFiles.Designer.cs @@ -1,122 +1,121 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class TestFiles { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal TestFiles() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine.TestFiles", typeof(TestFiles).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> - ///<media> - /// <node id="1111" version="902e13f7-5793-482a-9e06-cd94eebd1de0" parentID="-1" level="1" writerID="0" nodeType="1031" template="0" sortOrder="2" createDate="2010-05-19T15:26:08" updateDate="2010-05-19T15:26:09" nodeName="Product Images" urlName="productimages" writerName="Administrator" nodeTypeAlias="Folder" path="-1,1111"> - /// <data alias="contents"></data> - /// <node id="2222" version="902e13f7-5793-482a-9e06-cd94eebd1de0" parentID="1111" level="2" writerID="0 [rest of string was truncated]";. - /// - internal static string media { - get { - return ResourceManager.GetString("media", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> - ///<!DOCTYPE root[ - ///<!ELEMENT CWS_Contact ANY> - ///<!ATTLIST CWS_Contact id ID #REQUIRED> - ///<!ELEMENT CWS_EmailAFriend ANY> - ///<!ATTLIST CWS_EmailAFriend id ID #REQUIRED> - ///<!ELEMENT CWS_EventItem ANY> - ///<!ATTLIST CWS_EventItem id ID #REQUIRED> - ///<!ELEMENT CWS_Galleries ANY> - ///<!ATTLIST CWS_Galleries id ID #REQUIRED> - ///<!ELEMENT CWS_Gallery ANY> - ///<!ATTLIST CWS_Gallery id ID #REQUIRED> - ///<!ELEMENT CWS_Home ANY> - ///<!ATTLIST CWS_Home id ID #REQUIRED> - ///<!ELEMENT CWS_NewsEventsList ANY> /// [rest of string was truncated]";. - /// - internal static string umbraco { - get { - return ResourceManager.GetString("umbraco", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> - ///<!DOCTYPE root[ - ///<!ELEMENT CWS_Contact ANY> - ///<!ATTLIST CWS_Contact id ID #REQUIRED> - ///<!ELEMENT CWS_EmailAFriend ANY> - ///<!ATTLIST CWS_EmailAFriend id ID #REQUIRED> - ///<!ELEMENT CWS_EventItem ANY> - ///<!ATTLIST CWS_EventItem id ID #REQUIRED> - ///<!ELEMENT CWS_Galleries ANY> - ///<!ATTLIST CWS_Galleries id ID #REQUIRED> - ///<!ELEMENT CWS_Gallery ANY> - ///<!ATTLIST CWS_Gallery id ID #REQUIRED> - ///<!ELEMENT CWS_Home ANY> - ///<!ATTLIST CWS_Home id ID #REQUIRED> - ///<!ELEMENT CWS_NewsEventsList ANY> /// [rest of string was truncated]";. - /// - internal static string umbraco_sort { - get { - return ResourceManager.GetString("umbraco_sort", resourceCulture); - } - } - } -} +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine { + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class TestFiles { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal TestFiles() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine.TestFiles", typeof(TestFiles).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> + ///<media> + /// <node id="1111" version="902e13f7-5793-482a-9e06-cd94eebd1de0" parentID="-1" level="1" writerID="0" nodeType="1031" template="0" sortOrder="2" createDate="2010-05-19T15:26:08" updateDate="2010-05-19T15:26:09" nodeName="Product Images" urlName="productimages" writerName="Administrator" nodeTypeAlias="Folder" path="-1,1111"> + /// <data alias="contents"></data> + /// <node id="2222" version="902e13f7-5793-482a-9e06-cd94eebd1de0" parentID="1111" level="2" writerID="0 [rest of string was truncated]";. + /// + internal static string media { + get { + return ResourceManager.GetString("media", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> + ///<!DOCTYPE root[ + ///<!ELEMENT CWS_Contact ANY> + ///<!ATTLIST CWS_Contact id ID #REQUIRED> + ///<!ELEMENT CWS_EmailAFriend ANY> + ///<!ATTLIST CWS_EmailAFriend id ID #REQUIRED> + ///<!ELEMENT CWS_EventItem ANY> + ///<!ATTLIST CWS_EventItem id ID #REQUIRED> + ///<!ELEMENT CWS_Galleries ANY> + ///<!ATTLIST CWS_Galleries id ID #REQUIRED> + ///<!ELEMENT CWS_Gallery ANY> + ///<!ATTLIST CWS_Gallery id ID #REQUIRED> + ///<!ELEMENT CWS_Home ANY> + ///<!ATTLIST CWS_Home id ID #REQUIRED> + ///<!ELEMENT CWS_NewsEventsList ANY> + /// [rest of string was truncated]";. + /// + internal static string umbraco { + get { + return ResourceManager.GetString("umbraco", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> + ///<!DOCTYPE root[ + ///<!ELEMENT CWS_Contact ANY> + ///<!ATTLIST CWS_Contact id ID #REQUIRED> + ///<!ELEMENT CWS_EmailAFriend ANY> + ///<!ATTLIST CWS_EmailAFriend id ID #REQUIRED> + ///<!ELEMENT CWS_EventItem ANY> + ///<!ATTLIST CWS_EventItem id ID #REQUIRED> + ///<!ELEMENT CWS_Galleries ANY> + ///<!ATTLIST CWS_Galleries id ID #REQUIRED> + ///<!ELEMENT CWS_Gallery ANY> + ///<!ATTLIST CWS_Gallery id ID #REQUIRED> + ///<!ELEMENT CWS_Home ANY> + ///<!ATTLIST CWS_Home id ID #REQUIRED> + ///<!ELEMENT CWS_NewsEventsList ANY> + /// [rest of string was truncated]";. + /// + internal static string umbraco_sort { + get { + return ResourceManager.GetString("umbraco_sort", resourceCulture); + } + } + } +} diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/AdvancedMigrationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/AdvancedMigrationTests.cs index fe33fd5147..792f40ac2e 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/AdvancedMigrationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/AdvancedMigrationTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs index 40bdd6cf67..765eea85c6 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageInstallationTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageInstallationTest.cs index 10df853cef..5f612c8c27 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageInstallationTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageInstallationTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.IO; using System.Linq; using System.Xml.Linq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs index 393f28668e..51b1a3a179 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoBulkInsertTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoBulkInsertTests.cs index 48aa0e2849..20631f8e19 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoBulkInsertTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoBulkInsertTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Data; using System.Linq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoFetchTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoFetchTests.cs index d342a1b3cc..c1bc1adc01 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoFetchTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoFetchTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using NPoco; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/CacheInstructionRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/CacheInstructionRepositoryTest.cs index 4250a3c057..e191a005a4 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/CacheInstructionRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/CacheInstructionRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Models; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs index aae69e2f61..d769bfc4c1 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DictionaryRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DictionaryRepositoryTest.cs index 628fa419c2..26f0c123a9 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DictionaryRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DictionaryRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentRepositoryTest.cs index 9870926544..51a1a92376 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/EntityRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/EntityRepositoryTest.cs index 139a98a57a..6ab977b783 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/EntityRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/EntityRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/KeyValueRepositoryTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/KeyValueRepositoryTests.cs index d633c08872..6fc43e2f63 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/KeyValueRepositoryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/KeyValueRepositoryTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Microsoft.Extensions.Logging; using NUnit.Framework; using Umbraco.Cms.Core.Models; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/LanguageRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/LanguageRepositoryTest.cs index 3d9b6c30e1..3fbd76a87f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/LanguageRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/LanguageRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Globalization; using System.Linq; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaRepositoryTest.cs index afe228a8fb..ce60146635 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using Microsoft.Extensions.Logging; using Moq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaTypeRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaTypeRepositoryTest.cs index aa783317ac..70a7ca2dbc 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaTypeRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaTypeRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using Microsoft.Extensions.Logging; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MemberRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MemberRepositoryTest.cs index b986ad7168..034e076ae5 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MemberRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MemberRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using System.Linq; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MemberTypeRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MemberTypeRepositoryTest.cs index 6562f21d5e..5ab4ef3e8b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MemberTypeRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MemberTypeRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using Microsoft.Extensions.Logging; using Moq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/NotificationsRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/NotificationsRepositoryTest.cs index 05b9946425..2cab05cba5 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/NotificationsRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/NotificationsRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Globalization; using System.Linq; using Moq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PartialViewRepositoryTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PartialViewRepositoryTests.cs index 6f59f62e55..5f70ae04bf 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PartialViewRepositoryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PartialViewRepositoryTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.IO; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PublicAccessRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PublicAccessRepositoryTest.cs index a7c04d2503..477738ef4f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PublicAccessRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PublicAccessRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RedirectUrlRepositoryTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RedirectUrlRepositoryTests.cs index e6e06a684f..82e9b947ab 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RedirectUrlRepositoryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RedirectUrlRepositoryTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using Microsoft.Extensions.Logging; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RelationRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RelationRepositoryTest.cs index 3b9768088f..402aa0b653 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RelationRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RelationRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ScriptRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ScriptRepositoryTest.cs index 5897052752..5d5498981a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ScriptRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ScriptRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.IO; using System.Linq; using System.Text; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ServerRegistrationRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ServerRegistrationRepositoryTest.cs index 4611f69882..05b81cacf7 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ServerRegistrationRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ServerRegistrationRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Data.Common; using System.Linq; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/StylesheetRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/StylesheetRepositoryTest.cs index dcc672dee9..97f0cc7fd1 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/StylesheetRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/StylesheetRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Data; using System.IO; using System.Linq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TemplateRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TemplateRepositoryTest.cs index e0665aaf6d..ce267555e4 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TemplateRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TemplateRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.IO; using System.Linq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/UserRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/UserRepositoryTest.cs index 4886a7b497..538eeb328a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/UserRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/UserRepositoryTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/SyntaxProvider/SqlServerSyntaxProviderTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/SyntaxProvider/SqlServerSyntaxProviderTests.cs index 0d8e703604..be90d8695b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/SyntaxProvider/SqlServerSyntaxProviderTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/SyntaxProvider/SqlServerSyntaxProviderTests.cs @@ -1,4 +1,3 @@ -using System; using System.Diagnostics; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/UnitOfWorkTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/UnitOfWorkTests.cs index 92de5a9c17..f14661a976 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/UnitOfWorkTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/UnitOfWorkTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.DistributedLocking; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeFileSystemsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeFileSystemsTests.cs index d9832439fb..89ce8389cd 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeFileSystemsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeFileSystemsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.IO; using System.Text; using System.Threading.Tasks; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeTests.cs index 1f03b8ea49..a2ba3bb4c4 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedNuCacheTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedNuCacheTests.cs index 89e1543b1e..9186f44cf1 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedNuCacheTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedNuCacheTests.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.AspNetCore.Http; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/SupressNotificationsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/SupressNotificationsTests.cs index 36c599ce1d..ec573cbb2a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/SupressNotificationsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/SupressNotificationsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/AuditServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/AuditServiceTests.cs index e19c8414c9..f0e994f683 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/AuditServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/AuditServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using Microsoft.Extensions.DependencyInjection; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/CacheInstructionServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/CacheInstructionServiceTests.cs index ef7978f585..cb62dd32a3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/CacheInstructionServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/CacheInstructionServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using System.Threading; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ConsentServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ConsentServiceTests.cs index 2b5508cc6b..9e6d7f883a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ConsentServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ConsentServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Models; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs index fb25666efb..20e38be130 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs @@ -3,7 +3,6 @@ #pragma warning disable SA1124 // Do not use regions (justification: regions are currently adding some useful organisation to this file) -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs index 586eeb0873..e087f73104 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Configuration.Models; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePerformanceTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePerformanceTest.cs index bafd0aa138..b2507bf4f5 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePerformanceTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePerformanceTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs index e5ef5789db..695b75099e 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs index ebf161072d..15005f2e08 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Models; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTests.cs index d489e6a26c..f399a00a3d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs index 9e6c17f6ad..bb24410e7b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs index d4b9279487..de214a9d13 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using Microsoft.Extensions.DependencyInjection; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentVersionCleanupServiceTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentVersionCleanupServiceTest.cs index 3e58ca9030..e553d6165d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentVersionCleanupServiceTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentVersionCleanupServiceTest.cs @@ -1,4 +1,3 @@ -using System; using System.Diagnostics; using NUnit.Framework; using Umbraco.Cms.Core.Models; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DataTypeServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DataTypeServiceTests.cs index 21b9c0a68a..7e07823c64 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DataTypeServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DataTypeServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Models; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs index 3003d28f4c..f19f86a6fc 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityXmlSerializerTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityXmlSerializerTests.cs index 6ba1356acd..1ef9ac6ecf 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityXmlSerializerTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityXmlSerializerTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ExternalLoginServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ExternalLoginServiceTests.cs index f9990fbedf..c82657b980 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ExternalLoginServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ExternalLoginServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Security; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/Importing/ImportResources.Designer.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/Importing/ImportResources.Designer.cs index 96deac66bd..ca40735bf1 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/Importing/ImportResources.Designer.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/Importing/ImportResources.Designer.cs @@ -1,372 +1,370 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.Importing { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class ImportResources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal ImportResources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.Importing.ImportRes" + - "ources", typeof(ImportResources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> - ///<umbPackage> - /// <files /> - /// <info> - /// <package> - /// <name>CheckboxListTest</name> - /// </package> - /// </info> - /// <Documents> - /// <DocumentSet importMode="root"> - /// <NewType key="9c9b55d0-2fbf-4f12-afea-023bd7b2519d" id="1148" parentID="-1" level="1" creatorID="0" sortOrder="9" createDate="2013-07-23T12:06:07" updateDate="2013-07-23T15:56:37" nodeName="DoIt" urlName="doit" path="-1,1148" isDoc="" nodeType="1134" creatorName="admin" writerName= [rest of string was truncated]";. - /// - internal static string CheckboxList_Content_Package { - get { - return ResourceManager.GetString("CheckboxList_Content_Package", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> - ///<umbPackage> - /// <files /> - /// <info> - /// <package> - /// <name>Compositions Packaged</name> - /// </package> - /// </info> - /// <Documents> - /// <DocumentSet importMode="root"> - /// <umbHomePage key="9c9b55d0-2fbf-4f12-afea-023bd7b2519d" id="1068" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2014-11-26T12:52:35" updateDate="2014-11-26T12:52:36" nodeName="Home" urlName="home" path="-1,1068" isDoc="" nodeType="1056" creatorName="Morten Ch [rest of string was truncated]";. - /// - internal static string CompositionsTestPackage { - get { - return ResourceManager.GetString("CompositionsTestPackage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> - ///<umbPackage> - /// <files /> - /// <info> - /// <package> - /// <name>Composite Test</name> - /// </package> - /// </info> - /// <Documents> - /// <DocumentSet importMode="root"> - /// <CompositeTest id="1083" parentID="-1" level="1" creatorID="0" sortOrder="1" createDate="2014-11-26T15:02:43" updateDate="2014-11-26T15:02:43" nodeName="Composite test" urlName="composite-test" path="-1,1083" isDoc="" nodeType="1082" creatorName="Niels Hartvig" writerName="Niels Hart [rest of string was truncated]";. - /// - internal static string CompositionsTestPackage_Random { - get { - return ResourceManager.GetString("CompositionsTestPackage_Random", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> - ///<umbPackage> - /// <files /> - /// <info> - /// <package> - /// <name>Dictionary-Package</name> - /// </package> - /// </info> - /// <DictionaryItems> - /// <DictionaryItem Key="28f2e02a-8c66-4fcd-85e3-8524d551c0d3" Name="Parent"> - /// <Value LanguageId="2" LanguageCultureAlias="nb-NO"><![CDATA[ForelderVerdi]]></Value> - /// <Value LanguageId="3" LanguageCultureAlias="en-GB"><![CDATA[ParentValue]]></Value> - /// <DictionaryItem Key="e7dba0a9-d517-4ba4-8e18-2764d392c611" Name=" [rest of string was truncated]";. - /// - internal static string Dictionary_Package { - get { - return ResourceManager.GetString("Dictionary_Package", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> - ///<umbPackage> - /// <info> - /// <package> - /// <name>Fanoe</name> - /// </package> - /// </info> - /// <Documents> - /// <DocumentSet importMode="root"> - /// <Home id="1057" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2014-11-25T12:23:30" updateDate="2014-12-01T13:45:08" nodeName="Home" urlName="home" path="-1,1057" isDoc="" nodeType="1055" creatorName="Rune Strand" writerName="Rune Strand" writerID="0" template="1054" nodeTypeAlias="Home"> [rest of string was truncated]";. - /// - internal static string Fanoe_Package { - get { - return ResourceManager.GetString("Fanoe_Package", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> - ///<umbPackage> - /// <files /> - /// <info> - /// <package> - /// <name>DocTypeError</name> - /// </package> - /// </info> - /// <DocumentTypes> - /// <DocumentType> - /// <Info> - /// <Name>MR Basisseite</Name> - /// <Key>02e4e119-2eeb-4b92-9880-0c35d66a16b2</Key> - /// <Alias>MRBasePage</Alias> - /// <Icon>folder.gif</Icon> - /// <Thumbnail>folder.png</Thumbnail> - /// <Description>Basistyp für alle Seiten der MR-Racing Website.</Description> - /// [rest of string was truncated]";. - /// - internal static string InheritedDocTypes_Package { - get { - return ResourceManager.GetString("InheritedDocTypes_Package", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> - ///<umbPackage> - /// <files /> - /// <info> - /// <package> - /// <name>Package With MediaTypes And Media + Folder</name> - /// </package> - /// </info> - /// <DocumentTypes /> - /// <MediaTypes> - /// <MediaType> - /// <Info> - /// <Name>Folder</Name> - /// <Key>c3ddc08e-3b5e-42b2-9f0b-6e5c79a2e2e0</Key> - /// <Alias>Folder</Alias> - /// <Icon>icon-folder</Icon> - /// <Thumbnail>icon-folder</Thumbnail> - /// <Description /> - /// <AllowAtRoot>True</AllowAtRoot> - /// [rest of string was truncated]";. - /// - internal static string MediaTypesAndMedia_Package_xml { - get { - return ResourceManager.GetString("MediaTypesAndMedia_Package.xml", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> - ///<DocumentType> - /// <Info> - /// <Name>test</Name> - /// <Key>150ead17-d359-42a2-ac33-6504cc52ced1</Key> - /// <Alias>test</Alias> - /// <Icon>folder.gif</Icon> - /// <Thumbnail>folder.png</Thumbnail> - /// <Description> - /// </Description> - /// <AllowAtRoot>False</AllowAtRoot> - /// <AllowedTemplates> - /// <Template>test</Template> - /// </AllowedTemplates> - /// <DefaultTemplate>test</DefaultTemplate> - /// </Info> - /// <Structure> - /// <DocumentType>test</DocumentType> - /// </Str [rest of string was truncated]";. - /// - internal static string SingleDocType { - get { - return ResourceManager.GetString("SingleDocType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> - ///<DocumentType> - /// <Info> - /// <Name>test</Name> - /// <Key>150ead17-d359-42a2-ac33-6504cc52ced1</Key> - /// <Alias>test</Alias> - /// <Icon>folder.gif</Icon> - /// <Thumbnail>folder.png</Thumbnail> - /// <Description> - /// </Description> - /// <AllowAtRoot>False</AllowAtRoot> - /// <AllowedTemplates> - /// <Template>test</Template> - /// </AllowedTemplates> - /// <DefaultTemplate>test</DefaultTemplate> - /// </Info> - /// <Structure> - /// <DocumentType>test</DocumentType> - /// </Str [rest of string was truncated]";. - /// - internal static string SingleDocType_WithCleanupPolicy { - get { - return ResourceManager.GetString("SingleDocType_WithCleanupPolicy", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> - ///<umbPackage> - /// <info> - /// <package> - /// <name>StandardWebsiteMVC</name> - /// </package> - /// </info> - /// <Documents> - /// <DocumentSet importMode="root"> - /// <Homepage key="9c9b55d0-2fbf-4f12-afea-023bd7b2519d" id="1072" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2013-02-17T09:04:39" updateDate="2013-02-17T09:10:47" nodeName="Home" urlName="home" path="-1,1072" isDoc="" nodeType="1062" creatorName="admin" writerName="admin" wr [rest of string was truncated]";. - /// - internal static string StandardMvc_Package { - get { - return ResourceManager.GetString("StandardMvc_Package", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> - ///<umbPackage> - /// <files /> - /// <info> - /// <package> - /// <name>Template-Update</name> - /// </package> - /// </info> - /// <DocumentTypes /> - /// <Templates> - /// <Template> - /// <Name>Homepage</Name> - /// <Alias>umbHomepage</Alias> - /// <Master>umbMaster</Master> - /// <Design> - /// <![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" %> - ///<asp:content id="Content1" contentplaceholderid="cp_content [rest of string was truncated]";. - /// - internal static string TemplateOnly_Package { - get { - return ResourceManager.GetString("TemplateOnly_Package", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> - ///<umbPackage> - /// <files /> - /// <info> - /// <package> - /// <name>Template-Update</name> - /// </package> - /// </info> - /// <DocumentTypes /> - /// <Templates> - /// <Template> - /// <Name>Homepage</Name> - /// <Alias>umbHomepage</Alias> - /// <Master>umbMaster</Master> - /// <Design> - /// <![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" %> - ///<asp:content id="Content1" contentplaceholderid="cp_content [rest of string was truncated]";. - /// - internal static string TemplateOnly_Updated_Package { - get { - return ResourceManager.GetString("TemplateOnly_Updated_Package", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> - ///<umbPackage> - /// <info> - /// <package> - /// <name>uBlogsy</name> - /// </package> - /// </info> - /// <Documents> - /// <DocumentSet importMode="root"> - /// <uBlogsySiteRoot id="1266" parentID="-1" level="1" creatorID="0" sortOrder="1" createDate="2013-02-21T18:38:53" updateDate="2013-03-18T22:35:23" nodeName="Sample Site Root" urlName="sample-site-root" path="-1,1266" isDoc="" nodeType="1263" creatorName="admin" writerName="admin" writerID="0" template="12 [rest of string was truncated]";. - /// - internal static string uBlogsy_Package { - get { - return ResourceManager.GetString("uBlogsy_Package", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> - ///<umbPackage> - /// <info> - /// <package> - /// <name>XSLTsearch</name> - /// </package> - /// </info> - /// <Documents> - /// <DocumentSet importMode="root"> - /// <XSLTsearch id="1090" parentID="-1" level="1" writerID="0" creatorID="0" nodeType="1087" template="1086" sortOrder="39" createDate="2010-11-09T13:45:22" updateDate="2010-11-09T14:18:04" nodeName="Search" urlName="search" writerName="Administrator" creatorName="Administrator" path="-1,1090" isDoc=""> /// [rest of string was truncated]";. - /// - internal static string XsltSearch_Package { - get { - return ResourceManager.GetString("XsltSearch_Package", resourceCulture); - } - } - } -} +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.Importing { + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class ImportResources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal ImportResources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.Importing.ImportRes" + + "ources", typeof(ImportResources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> + ///<umbPackage> + /// <files /> + /// <info> + /// <package> + /// <name>CheckboxListTest</name> + /// </package> + /// </info> + /// <Documents> + /// <DocumentSet importMode="root"> + /// <NewType key="9c9b55d0-2fbf-4f12-afea-023bd7b2519d" id="1148" parentID="-1" level="1" creatorID="0" sortOrder="9" createDate="2013-07-23T12:06:07" updateDate="2013-07-23T15:56:37" nodeName="DoIt" urlName="doit" path="-1,1148" isDoc="" nodeType="1134" creatorName="admin" writerName= [rest of string was truncated]";. + /// + internal static string CheckboxList_Content_Package { + get { + return ResourceManager.GetString("CheckboxList_Content_Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> + ///<umbPackage> + /// <files /> + /// <info> + /// <package> + /// <name>Compositions Packaged</name> + /// </package> + /// </info> + /// <Documents> + /// <DocumentSet importMode="root"> + /// <umbHomePage key="9c9b55d0-2fbf-4f12-afea-023bd7b2519d" id="1068" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2014-11-26T12:52:35" updateDate="2014-11-26T12:52:36" nodeName="Home" urlName="home" path="-1,1068" isDoc="" nodeType="1056" creatorName="Morten Ch [rest of string was truncated]";. + /// + internal static string CompositionsTestPackage { + get { + return ResourceManager.GetString("CompositionsTestPackage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> + ///<umbPackage> + /// <files /> + /// <info> + /// <package> + /// <name>Composite Test</name> + /// </package> + /// </info> + /// <Documents> + /// <DocumentSet importMode="root"> + /// <CompositeTest id="1083" parentID="-1" level="1" creatorID="0" sortOrder="1" createDate="2014-11-26T15:02:43" updateDate="2014-11-26T15:02:43" nodeName="Composite test" urlName="composite-test" path="-1,1083" isDoc="" nodeType="1082" creatorName="Niels Hartvig" writerName="Niels Hart [rest of string was truncated]";. + /// + internal static string CompositionsTestPackage_Random { + get { + return ResourceManager.GetString("CompositionsTestPackage_Random", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> + ///<umbPackage> + /// <files /> + /// <info> + /// <package> + /// <name>Dictionary-Package</name> + /// </package> + /// </info> + /// <DictionaryItems> + /// <DictionaryItem Key="28f2e02a-8c66-4fcd-85e3-8524d551c0d3" Name="Parent"> + /// <Value LanguageId="2" LanguageCultureAlias="nb-NO"><![CDATA[ForelderVerdi]]></Value> + /// <Value LanguageId="3" LanguageCultureAlias="en-GB"><![CDATA[ParentValue]]></Value> + /// <DictionaryItem Key="e7dba0a9-d517-4ba4-8e18-2764d392c611" Name=" [rest of string was truncated]";. + /// + internal static string Dictionary_Package { + get { + return ResourceManager.GetString("Dictionary_Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> + ///<umbPackage> + /// <info> + /// <package> + /// <name>Fanoe</name> + /// </package> + /// </info> + /// <Documents> + /// <DocumentSet importMode="root"> + /// <Home id="1057" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2014-11-25T12:23:30" updateDate="2014-12-01T13:45:08" nodeName="Home" urlName="home" path="-1,1057" isDoc="" nodeType="1055" creatorName="Rune Strand" writerName="Rune Strand" writerID="0" template="1054" nodeTypeAlias="Home"> [rest of string was truncated]";. + /// + internal static string Fanoe_Package { + get { + return ResourceManager.GetString("Fanoe_Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> + ///<umbPackage> + /// <files /> + /// <info> + /// <package> + /// <name>DocTypeError</name> + /// </package> + /// </info> + /// <DocumentTypes> + /// <DocumentType> + /// <Info> + /// <Name>MR Basisseite</Name> + /// <Key>02e4e119-2eeb-4b92-9880-0c35d66a16b2</Key> + /// <Alias>MRBasePage</Alias> + /// <Icon>folder.gif</Icon> + /// <Thumbnail>folder.png</Thumbnail> + /// <Description>Basistyp für alle Seiten der MR-Racing Website.</Description> + /// [rest of string was truncated]";. + /// + internal static string InheritedDocTypes_Package { + get { + return ResourceManager.GetString("InheritedDocTypes_Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?> + ///<umbPackage> + /// <files /> + /// <info> + /// <package> + /// <name>Package With MediaTypes And Media + Folder</name> + /// </package> + /// </info> + /// <DocumentTypes /> + /// <MediaTypes> + /// <MediaType> + /// <Info> + /// <Name>Folder</Name> + /// <Key>c3ddc08e-3b5e-42b2-9f0b-6e5c79a2e2e0</Key> + /// <Alias>Folder</Alias> + /// <Icon>icon-folder</Icon> + /// <Thumbnail>icon-folder</Thumbnail> + /// <Description /> + /// <AllowAtRoot>True</AllowAtRoot> + /// [rest of string was truncated]";. + /// + internal static string MediaTypesAndMedia_Package_xml { + get { + return ResourceManager.GetString("MediaTypesAndMedia_Package.xml", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> + ///<DocumentType> + /// <Info> + /// <Name>test</Name> + /// <Key>150ead17-d359-42a2-ac33-6504cc52ced1</Key> + /// <Alias>test</Alias> + /// <Icon>folder.gif</Icon> + /// <Thumbnail>folder.png</Thumbnail> + /// <Description> + /// </Description> + /// <AllowAtRoot>False</AllowAtRoot> + /// <AllowedTemplates> + /// <Template>test</Template> + /// </AllowedTemplates> + /// <DefaultTemplate>test</DefaultTemplate> + /// </Info> + /// <Structure> + /// <DocumentType>test</DocumentType> + /// </Str [rest of string was truncated]";. + /// + internal static string SingleDocType { + get { + return ResourceManager.GetString("SingleDocType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> + ///<DocumentType> + /// <Info> + /// <Name>test</Name> + /// <Key>150ead17-d359-42a2-ac33-6504cc52ced1</Key> + /// <Alias>test</Alias> + /// <Icon>folder.gif</Icon> + /// <Thumbnail>folder.png</Thumbnail> + /// <Description> + /// </Description> + /// <AllowAtRoot>False</AllowAtRoot> + /// <AllowedTemplates> + /// <Template>test</Template> + /// </AllowedTemplates> + /// <DefaultTemplate>test</DefaultTemplate> + /// </Info> + /// <Structure> + /// <DocumentType>test</DocumentType> + /// </Str [rest of string was truncated]";. + /// + internal static string SingleDocType_WithCleanupPolicy { + get { + return ResourceManager.GetString("SingleDocType_WithCleanupPolicy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> + ///<umbPackage> + /// <info> + /// <package> + /// <name>StandardWebsiteMVC</name> + /// </package> + /// </info> + /// <Documents> + /// <DocumentSet importMode="root"> + /// <Homepage key="9c9b55d0-2fbf-4f12-afea-023bd7b2519d" id="1072" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2013-02-17T09:04:39" updateDate="2013-02-17T09:10:47" nodeName="Home" urlName="home" path="-1,1072" isDoc="" nodeType="1062" creatorName="admin" writerName="admin" wr [rest of string was truncated]";. + /// + internal static string StandardMvc_Package { + get { + return ResourceManager.GetString("StandardMvc_Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> + ///<umbPackage> + /// <files /> + /// <info> + /// <package> + /// <name>Template-Update</name> + /// </package> + /// </info> + /// <DocumentTypes /> + /// <Templates> + /// <Template> + /// <Name>Homepage</Name> + /// <Alias>umbHomepage</Alias> + /// <Master>umbMaster</Master> + /// <Design> + /// <![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" %> + ///<asp:content id="Content1" contentplaceholderid="cp_content [rest of string was truncated]";. + /// + internal static string TemplateOnly_Package { + get { + return ResourceManager.GetString("TemplateOnly_Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> + ///<umbPackage> + /// <files /> + /// <info> + /// <package> + /// <name>Template-Update</name> + /// </package> + /// </info> + /// <DocumentTypes /> + /// <Templates> + /// <Template> + /// <Name>Homepage</Name> + /// <Alias>umbHomepage</Alias> + /// <Master>umbMaster</Master> + /// <Design> + /// <![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" %> + ///<asp:content id="Content1" contentplaceholderid="cp_content [rest of string was truncated]";. + /// + internal static string TemplateOnly_Updated_Package { + get { + return ResourceManager.GetString("TemplateOnly_Updated_Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> + ///<umbPackage> + /// <info> + /// <package> + /// <name>uBlogsy</name> + /// </package> + /// </info> + /// <Documents> + /// <DocumentSet importMode="root"> + /// <uBlogsySiteRoot id="1266" parentID="-1" level="1" creatorID="0" sortOrder="1" createDate="2013-02-21T18:38:53" updateDate="2013-03-18T22:35:23" nodeName="Sample Site Root" urlName="sample-site-root" path="-1,1266" isDoc="" nodeType="1263" creatorName="admin" writerName="admin" writerID="0" template="12 [rest of string was truncated]";. + /// + internal static string uBlogsy_Package { + get { + return ResourceManager.GetString("uBlogsy_Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?> + ///<umbPackage> + /// <info> + /// <package> + /// <name>XSLTsearch</name> + /// </package> + /// </info> + /// <Documents> + /// <DocumentSet importMode="root"> + /// <XSLTsearch id="1090" parentID="-1" level="1" writerID="0" creatorID="0" nodeType="1087" template="1086" sortOrder="39" createDate="2010-11-09T13:45:22" updateDate="2010-11-09T14:18:04" nodeName="Search" urlName="search" writerName="Administrator" creatorName="Administrator" path="-1,1090" isDoc=""> + /// [rest of string was truncated]";. + /// + internal static string XsltSearch_Package { + get { + return ResourceManager.GetString("XsltSearch_Package", resourceCulture); + } + } + } +} diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LocalizationServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LocalizationServiceTests.cs index 2ca4af5fae..4924ee51f7 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LocalizationServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LocalizationServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MacroServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MacroServiceTests.cs index 9353644daf..d3ae791f52 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MacroServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MacroServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using Microsoft.Extensions.Logging; using Moq; @@ -22,9 +21,9 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] public class MacroServiceTests : UmbracoIntegrationTest { - + private IMacroService MacroService => GetRequiredService(); - + [SetUp] public void SetupTest() { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaServiceTests.cs index b17bc2c4fe..b20075925d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using System.Reflection; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeServiceTests.cs index 3088e7c0da..caceb8e2cb 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberServiceTests.cs index 1b5e1b5e33..5375d87686 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.IO; using System.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberTypeServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberTypeServiceTests.cs index 0f010382e5..342886d3ed 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberTypeServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberTypeServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/NuCacheRebuildTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/NuCacheRebuildTests.cs index 5604419623..f9d981933d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/NuCacheRebuildTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/NuCacheRebuildTests.cs @@ -1,4 +1,3 @@ -using System; using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.PublishedCache; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/PublicAccessServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/PublicAccessServiceTests.cs index 0b97d5d0d5..9841165509 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/PublicAccessServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/PublicAccessServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Models; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RelationServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RelationServiceTests.cs index a7f79dec64..06c39098ee 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RelationServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RelationServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ThreadSafetyServiceTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ThreadSafetyServiceTest.cs index 3220f99b39..d74ba7583d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ThreadSafetyServiceTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ThreadSafetyServiceTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using System.Threading; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/UserServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/UserServiceTests.cs index 4eb0bf1ce0..8884622bf2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/UserServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/UserServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj b/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj index 6e88306e11..43dd49b2a9 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj +++ b/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj @@ -22,7 +22,6 @@ - diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/ContentModelValidatorTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/ContentModelValidatorTests.cs index c15c9b5b39..c6cdf01074 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/ContentModelValidatorTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/ContentModelValidatorTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventFilterTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventFilterTests.cs index e627a3300f..ec4a2598f1 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventFilterTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/OutgoingEditorModelEventFilterTests.cs @@ -1,5 +1,4 @@ -using System; -using System.Linq; +using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; diff --git a/tests/Umbraco.Tests.UnitTests/AutoFixture/AutoMoqDataAttribute.cs b/tests/Umbraco.Tests.UnitTests/AutoFixture/AutoMoqDataAttribute.cs index b89a53cfe0..f076798cd1 100644 --- a/tests/Umbraco.Tests.UnitTests/AutoFixture/AutoMoqDataAttribute.cs +++ b/tests/Umbraco.Tests.UnitTests/AutoFixture/AutoMoqDataAttribute.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using AutoFixture.NUnit3; namespace Umbraco.Cms.Tests.UnitTests.AutoFixture; diff --git a/tests/Umbraco.Tests.UnitTests/AutoFixture/Customizations/UmbracoCustomizations.cs b/tests/Umbraco.Tests.UnitTests/AutoFixture/Customizations/UmbracoCustomizations.cs index 7b840b18da..88d344796c 100644 --- a/tests/Umbraco.Tests.UnitTests/AutoFixture/Customizations/UmbracoCustomizations.cs +++ b/tests/Umbraco.Tests.UnitTests/AutoFixture/Customizations/UmbracoCustomizations.cs @@ -1,4 +1,3 @@ -using System; using System.Linq; using AutoFixture; using AutoFixture.Kernel; diff --git a/tests/Umbraco.Tests.UnitTests/AutoFixture/InlineAutoMoqDataAttribute.cs b/tests/Umbraco.Tests.UnitTests/AutoFixture/InlineAutoMoqDataAttribute.cs index 2fc0cf6101..d0c900c4fc 100644 --- a/tests/Umbraco.Tests.UnitTests/AutoFixture/InlineAutoMoqDataAttribute.cs +++ b/tests/Umbraco.Tests.UnitTests/AutoFixture/InlineAutoMoqDataAttribute.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using AutoFixture.NUnit3; namespace Umbraco.Cms.Tests.UnitTests.AutoFixture; diff --git a/tests/Umbraco.Tests.UnitTests/TestHelpers/CompositionExtensions.cs b/tests/Umbraco.Tests.UnitTests/TestHelpers/CompositionExtensions.cs index ab08f12ce7..462c43ef31 100644 --- a/tests/Umbraco.Tests.UnitTests/TestHelpers/CompositionExtensions.cs +++ b/tests/Umbraco.Tests.UnitTests/TestHelpers/CompositionExtensions.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core.DependencyInjection; diff --git a/tests/Umbraco.Tests.UnitTests/TestHelpers/PublishedSnapshotServiceTestBase.cs b/tests/Umbraco.Tests.UnitTests/TestHelpers/PublishedSnapshotServiceTestBase.cs index dbc862e39c..2828e812d5 100644 --- a/tests/Umbraco.Tests.UnitTests/TestHelpers/PublishedSnapshotServiceTestBase.cs +++ b/tests/Umbraco.Tests.UnitTests/TestHelpers/PublishedSnapshotServiceTestBase.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Data; using System.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/TestHelpers/TestHelper.cs b/tests/Umbraco.Tests.UnitTests/TestHelpers/TestHelper.cs index cfc57ee9ff..33b89f1738 100644 --- a/tests/Umbraco.Tests.UnitTests/TestHelpers/TestHelper.cs +++ b/tests/Umbraco.Tests.UnitTests/TestHelpers/TestHelper.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; diff --git a/tests/Umbraco.Tests.UnitTests/TestHelpers/TestNuCacheContentService.cs b/tests/Umbraco.Tests.UnitTests/TestHelpers/TestNuCacheContentService.cs index f31b64c8cc..34f111601a 100644 --- a/tests/Umbraco.Tests.UnitTests/TestHelpers/TestNuCacheContentService.cs +++ b/tests/Umbraco.Tests.UnitTests/TestHelpers/TestNuCacheContentService.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Umbraco.Cms.Core.Models; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Management/Filters/RequireRuntimeLevelAttributeTest.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Management/Filters/RequireRuntimeLevelAttributeTest.cs deleted file mode 100644 index 116c684d1d..0000000000 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Cms.Api.Management/Filters/RequireRuntimeLevelAttributeTest.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Abstractions; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.AspNetCore.Routing; -using Moq; -using NUnit.Framework; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Services; -using Umbraco.Cms.Api.Management.Filters; - -namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Cms.Api.Management.Filters; - -[TestFixture] -public class RequireRuntimeLevelAttributeTest -{ - [Test] - [TestCase(RuntimeLevel.Install, RuntimeLevel.Run, true)] - [TestCase(RuntimeLevel.Install, RuntimeLevel.Unknown, true)] - [TestCase(RuntimeLevel.Install, RuntimeLevel.Boot, true)] - [TestCase(RuntimeLevel.Install, RuntimeLevel.Upgrade, true)] - [TestCase(RuntimeLevel.Run, RuntimeLevel.Upgrade, true)] - [TestCase(RuntimeLevel.Install, RuntimeLevel.Install, false)] - [TestCase(RuntimeLevel.Upgrade, RuntimeLevel.Upgrade, false)] - public void BlocksWhenIncorrectRuntime(RuntimeLevel requiredLevel, RuntimeLevel actualLevel, bool shouldFail) - { - var executionContext = CreateActionExecutingContext(actualLevel); - - var sut = new RequireRuntimeLevelAttribute(requiredLevel); - sut.OnActionExecuting(executionContext); - - if (shouldFail) - { - AssertFailure(executionContext); - return; - } - - // Assert success, result being null == we haven't short circuited. - Assert.IsNull(executionContext.Result); - } - - private void AssertFailure(ActionExecutingContext executionContext) - { - var result = executionContext.Result; - Assert.IsInstanceOf(result); - - var objectResult = (ObjectResult)result; - - Assert.AreEqual(StatusCodes.Status428PreconditionRequired, objectResult?.StatusCode); - Assert.IsInstanceOf(objectResult?.Value); - } - - private ActionExecutingContext CreateActionExecutingContext(RuntimeLevel targetRuntimeLevel) - { - var actionContext = new ActionContext() - { - HttpContext = new DefaultHttpContext(), - RouteData = new RouteData(), - ActionDescriptor = new ActionDescriptor() - }; - - var executingContext = new ActionExecutingContext( - actionContext, - new List(), - new Dictionary(), - new()); - - var fakeRuntime = new Mock(); - fakeRuntime.Setup(x => x.Level).Returns(targetRuntimeLevel); - - var fakeServiceProvider = new Mock(); - fakeServiceProvider.Setup(x => x.GetService(typeof(IRuntimeState))).Returns(fakeRuntime.Object); - actionContext.HttpContext.RequestServices = fakeServiceProvider.Object; - - return executingContext; - } -} diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/BackOffice/UmbracoBackOfficeIdentityTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/BackOffice/UmbracoBackOfficeIdentityTests.cs index 8ec8634970..d1e980b19c 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/BackOffice/UmbracoBackOfficeIdentityTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/BackOffice/UmbracoBackOfficeIdentityTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using System.Security.Claims; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/AppCacheTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/AppCacheTests.cs index 66c8d7a75c..f818fa49e8 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/AppCacheTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/AppCacheTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Cache; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/DeepCloneAppCacheTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/DeepCloneAppCacheTests.cs index 4994fcb221..4eed8e0d41 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/DeepCloneAppCacheTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/DeepCloneAppCacheTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using System.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/DefaultCachePolicyTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/DefaultCachePolicyTests.cs index 56bcbac1ee..1a296a95cb 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/DefaultCachePolicyTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/DefaultCachePolicyTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/FullDataSetCachePolicyTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/FullDataSetCachePolicyTests.cs index d49327c58b..73cd6eccd7 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/FullDataSetCachePolicyTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/FullDataSetCachePolicyTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections; using System.Collections.Generic; using System.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/RefresherTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/RefresherTests.cs index 6fcd37adb7..92ef2b5c9f 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/RefresherTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/RefresherTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Newtonsoft.Json; using NUnit.Framework; using Umbraco.Cms.Core.Cache; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/RuntimeAppCacheTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/RuntimeAppCacheTests.cs index 1b7efdd923..f7bc8aec67 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/RuntimeAppCacheTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/RuntimeAppCacheTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Threading; using NUnit.Framework; using Umbraco.Cms.Core.Cache; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/SingleItemsOnlyCachePolicyTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/SingleItemsOnlyCachePolicyTests.cs index 5200d0fd88..ef2ce5b72c 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/SingleItemsOnlyCachePolicyTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/SingleItemsOnlyCachePolicyTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/ValueEditorCacheTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/ValueEditorCacheTests.cs index 5bf72b8500..2568fe6b5e 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/ValueEditorCacheTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Cache/ValueEditorCacheTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ClaimsIdentityExtensionsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ClaimsIdentityExtensionsTests.cs index 27dd384af7..167c92b0fd 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ClaimsIdentityExtensionsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ClaimsIdentityExtensionsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Security.Claims; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Collections/OrderedHashSetTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Collections/OrderedHashSetTests.cs index b4f8e0504e..c5e4dfd049 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Collections/OrderedHashSetTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Collections/OrderedHashSetTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core.Collections; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs index 47ea784fdc..a289f03131 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -87,7 +86,7 @@ public class ComponentTests new TestOptionsMonitor(coreDebug), mediaFileManager, loggerFactory, - + eventAggregator); mock.Setup(x => x.GetService(typeof(ILogger))).Returns(logger); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/CollectionBuildersTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/CollectionBuildersTests.cs index dd6c676b88..c426d4b24e 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/CollectionBuildersTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/CollectionBuildersTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Configuration; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/LazyCollectionBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/LazyCollectionBuilderTests.cs index 14b2e07342..db1945052f 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/LazyCollectionBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/LazyCollectionBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Configuration; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeFinderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeFinderTests.cs index e3bca4fb4f..3089d89893 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeFinderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeFinderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using System.Reflection; using System.Xml; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeHelperTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeHelperTests.cs index e24ade5ec4..7a92f99106 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeHelperTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeHelperTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderExtensions.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderExtensions.cs index 66b5b78212..9a28241d10 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderExtensions.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderExtensions.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using Umbraco.Cms.Core.Composing; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderTests.cs index af6dbb1f1c..ffd30d1111 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.IO; using System.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/ConfigureConnectionStringsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/ConfigureConnectionStringsTests.cs index 111892cd65..bcfdeb2433 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/ConfigureConnectionStringsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/ConfigureConnectionStringsTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/Validation/GlobalSettingsValidatorTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/Validation/GlobalSettingsValidatorTests.cs index 7316c35b01..3b7d7355b6 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/Validation/GlobalSettingsValidatorTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/Validation/GlobalSettingsValidatorTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.Configuration.Models.Validation; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/Validation/HealthChecksSettingsValidatorTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/Validation/HealthChecksSettingsValidatorTests.cs index a2b900d859..a2c2f6cc4e 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/Validation/HealthChecksSettingsValidatorTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/Validation/HealthChecksSettingsValidatorTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core.Configuration; using Umbraco.Cms.Core.Configuration.Models; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/TryConvertToTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/TryConvertToTests.cs index 307c06d6aa..08b080b7b0 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/TryConvertToTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/TryConvertToTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Globalization; using NUnit.Framework; using Umbraco.Extensions; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/UdiTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/UdiTests.cs index e18993ede1..98bf4a608c 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/UdiTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/UdiTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using System.Reflection; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreXml/NavigableNavigatorTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreXml/NavigableNavigatorTests.cs index 69d5c21ace..ab838d358f 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreXml/NavigableNavigatorTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreXml/NavigableNavigatorTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Globalization; using System.IO; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DelegateExtensionsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DelegateExtensionsTests.cs index 199f7ad6d5..8c5ba62e0d 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DelegateExtensionsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DelegateExtensionsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Lucene.Net.Index; using NUnit.Framework; using Umbraco.Cms.Core; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/ImageCropperValueConverterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/ImageCropperValueConverterTests.cs index 0daa6df884..29d99b6e68 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/ImageCropperValueConverterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/ImageCropperValueConverterTests.cs @@ -1,4 +1,3 @@ -using System; using System.Linq; using Microsoft.Extensions.Logging; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/NestedContentValueConverterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/NestedContentValueConverterTests.cs index a6c6f91997..c8d2b5d9ad 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/NestedContentValueConverterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/NestedContentValueConverterTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/PropertyValueConverterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/PropertyValueConverterTests.cs index cb81be658a..8ee2cac5cf 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/PropertyValueConverterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/PropertyValueConverterTests.cs @@ -1,4 +1,3 @@ -using System; using Moq; using NUnit.Framework; using Umbraco.Cms.Core.Models.PublishedContent; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Deploy/ArtifactBaseTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Deploy/ArtifactBaseTests.cs index 788fa63a6d..f029c42749 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Deploy/ArtifactBaseTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Deploy/ArtifactBaseTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/EnumExtensionsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/EnumExtensionsTests.cs index dd5b32031f..9d44472a08 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/EnumExtensionsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/EnumExtensionsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core.Trees; using Umbraco.Extensions; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/EnumerableExtensionsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/EnumerableExtensionsTests.cs index ffdf180442..4ecb3dbe27 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/EnumerableExtensionsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/EnumerableExtensionsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/ClaimsPrincipalExtensionsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/ClaimsPrincipalExtensionsTests.cs index 1b3d650223..9d5c4bb48a 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/ClaimsPrincipalExtensionsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/ClaimsPrincipalExtensionsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using System.Security.Claims; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/ConfigurationExtensionsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/ConfigurationExtensionsTests.cs index cd1ec39dc9..f6a37edcdc 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/ConfigurationExtensionsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/ConfigurationExtensionsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Microsoft.Extensions.Configuration; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/UriExtensionsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/UriExtensionsTests.cs index 3b95bcf724..bdee9a4b95 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/UriExtensionsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/UriExtensionsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Extensions; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/GuidUtilsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/GuidUtilsTests.cs index fbdc6b773e..b01bb354e4 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/GuidUtilsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/GuidUtilsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/HashCodeCombinerTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/HashCodeCombinerTests.cs index 13499db2ea..abc1d71eb9 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/HashCodeCombinerTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/HashCodeCombinerTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.IO; using System.Reflection; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/HashGeneratorTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/HashGeneratorTests.cs index f2008799a4..6993a38276 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/HashGeneratorTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/HashGeneratorTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.IO; using System.Reflection; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/HexEncoderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/HexEncoderTests.cs index 90ef482efb..63edfbe139 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/HexEncoderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/HexEncoderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Text; using NUnit.Framework; using Umbraco.Cms.Core; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/IO/AbstractFileSystemTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/IO/AbstractFileSystemTests.cs index 597d5c0f84..3eca4f3751 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/IO/AbstractFileSystemTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/IO/AbstractFileSystemTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.IO; using System.Linq; using System.Text; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/IO/PhysicalFileSystemTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/IO/PhysicalFileSystemTests.cs index 59f8fcd45c..396ad94415 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/IO/PhysicalFileSystemTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/IO/PhysicalFileSystemTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.IO; using System.Text; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestContentAppTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestContentAppTests.cs index 350c1f1944..f85bfd1cd0 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestContentAppTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestContentAppTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using Moq; using Newtonsoft.Json; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestParserTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestParserTests.cs index 71d1a25228..d1e08dca45 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestParserTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestParserTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using System.Text; using Microsoft.Extensions.Logging; @@ -517,12 +516,12 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2 view: '~/App_Plugins/MyPackage/PropertyEditors/MyEditor.html', supportsReadOnly: true }]}"; - + var manifest = _parser.ParseManifest(json); Assert.IsTrue(manifest.ParameterEditors.FirstOrDefault().SupportsReadOnly); } - + [Test] public void CanParseManifest_PropertyEditors_SupportsReadOnly() { @@ -558,7 +557,7 @@ javascript: ['~/test.js',/*** some note about stuff asd09823-4**09234*/ '~/test2 ] } }]}"; - + var manifest = _parser.ParseManifest(json); Assert.IsTrue(manifest.PropertyEditors.FirstOrDefault().SupportsReadOnly); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/Collections/Item.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/Collections/Item.cs index a817a08b0a..15a74df3bf 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/Collections/Item.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/Collections/Item.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/Collections/OrderItem.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/Collections/OrderItem.cs index 82a5ef9ff3..78380138d0 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/Collections/OrderItem.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/Collections/OrderItem.cs @@ -1,8 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; - namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Models.Collections; public class OrderItem : Item diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentExtensionsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentExtensionsTests.cs index c2f3d9af79..45630777f0 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentExtensionsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentExtensionsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentScheduleTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentScheduleTests.cs index 2408672744..78bfa0a3f8 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentScheduleTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentScheduleTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Models; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentTests.cs index a2da904889..ba9bbdd485 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentTypeTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentTypeTests.cs index 53157fd5ea..5bc8715c18 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentTypeTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/ContentTypeTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using System.Linq; using Newtonsoft.Json; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/MacroTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/MacroTests.cs index 63a3002ebe..2e64f03337 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/MacroTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/MacroTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Models; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/MemberGroupTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/MemberGroupTests.cs index dce4f77906..1d1b55d309 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/MemberGroupTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/MemberGroupTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using Newtonsoft.Json; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/PropertyTypeTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/PropertyTypeTests.cs index 148821175d..6be07d9ebc 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/PropertyTypeTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/PropertyTypeTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using System.Linq; using System.Reflection; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/RelationTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/RelationTests.cs index 0b44273e37..b37085ba54 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/RelationTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/RelationTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using Newtonsoft.Json; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/RelationTypeTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/RelationTypeTests.cs index f5f01cd2f9..71540b9116 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/RelationTypeTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/RelationTypeTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Newtonsoft.Json; using NUnit.Framework; using Umbraco.Cms.Core.Models; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/StylesheetTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/StylesheetTests.cs index 5987f2e087..ab3019af12 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/StylesheetTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/StylesheetTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using System.Linq; using Newtonsoft.Json; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/TemplateTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/TemplateTests.cs index b555d9d037..19a8405e6e 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/TemplateTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/TemplateTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using System.Linq; using System.Reflection; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/UserExtensionsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/UserExtensionsTests.cs index 66c5867c98..7600695ddd 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/UserExtensionsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/UserExtensionsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/VariationTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/VariationTests.cs index 7226895784..d7580be8ff 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/VariationTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/VariationTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Moq; using NUnit.Framework; using Umbraco.Cms.Core; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Packaging/PendingPackageMigrationsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Packaging/PendingPackageMigrationsTests.cs index 06acacf372..09dd43d066 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Packaging/PendingPackageMigrationsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Packaging/PendingPackageMigrationsTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using Microsoft.Extensions.Logging; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockEditorComponentTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockEditorComponentTests.cs index 86a97815b3..55c172afa7 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockEditorComponentTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockEditorComponentTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging; @@ -434,7 +433,7 @@ public class BlockEditorComponentTests ""contentTypeKey"": ""36ccf44a-aac8-40a6-8685-73ab03bc9709"", ""udi"": ""umb://element/90549d94555647fdbe4d111c7178ada4"", ""title"": ""One more element one - 12 cols"", - ""subFeatures"": " + subFeatures.OrIfNullOrWhiteSpace(@"""""") + @" + ""subFeatures"": " + subFeatures.OrIfNullOrWhiteSpace(@"""""") + @" }, { ""contentTypeKey"": ""5cc488aa-ba24-41f2-a01e-8f2d1982f865"", ""udi"": ""umb://element/5fc866c590be4d01a28a979472a1ffee"", diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/ConvertersTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/ConvertersTests.cs index d15659c77a..0e8138e60c 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/ConvertersTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/ConvertersTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Configuration; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollectionTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollectionTests.cs index 46ed8af979..6108f59e2e 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollectionTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollectionTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/NestedContentPropertyComponentTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/NestedContentPropertyComponentTests.cs index 8e9743ee84..bf994155b4 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/NestedContentPropertyComponentTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/NestedContentPropertyComponentTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/PropertyEditorValueConverterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/PropertyEditorValueConverterTests.cs index ccc46e5423..b3537c4659 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/PropertyEditorValueConverterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/PropertyEditorValueConverterTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/PropertyEditorValueEditorTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/PropertyEditorValueEditorTests.cs index e8eda1e595..3fe9445eca 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/PropertyEditorValueEditorTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/PropertyEditorValueEditorTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Moq; using NUnit.Framework; using Umbraco.Cms.Core.Models; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/ConvertersTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/ConvertersTests.cs index bb21e04633..eac0efc11d 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/ConvertersTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/ConvertersTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/ModelTypeTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/ModelTypeTests.cs index d850d00d3d..eaab03c9b8 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/ModelTypeTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/ModelTypeTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using NUnit.Framework; using Umbraco.Cms.Core.Models.PublishedContent; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/NestedContentTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/NestedContentTests.cs index f6425607d3..86f40b624c 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/NestedContentTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/NestedContentTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/PropertyCacheLevelTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/PropertyCacheLevelTests.cs index cce1f0cf8c..6c971f6a7a 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/PropertyCacheLevelTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/PropertyCacheLevelTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ReflectionUtilitiesTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ReflectionUtilitiesTests.cs index c29116c8bd..623efcfcc0 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ReflectionUtilitiesTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ReflectionUtilitiesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using System.Reflection; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/ContentFinderByUrlAliasTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/ContentFinderByUrlAliasTests.cs index 0ebd5ef955..1977c918a5 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/ContentFinderByUrlAliasTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/ContentFinderByUrlAliasTests.cs @@ -1,4 +1,3 @@ -using System; using System.Threading.Tasks; using AutoFixture.NUnit3; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/ContentFinderByUrlTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/ContentFinderByUrlTests.cs index f0417b663e..8eaecd7a1f 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/ContentFinderByUrlTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/ContentFinderByUrlTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/PublishedRouterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/PublishedRouterTests.cs index 4055cf9fde..da5c641b2a 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/PublishedRouterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/PublishedRouterTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.ObjectModel; using System.Linq; using System.Threading.Tasks; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/SiteDomainMapperTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/SiteDomainMapperTests.cs index a0361f0222..b28e0eb6a5 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/SiteDomainMapperTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/SiteDomainMapperTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Routing; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UmbracoRequestPathsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UmbracoRequestPathsTests.cs index 4ed6ce842c..d4856c2b12 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UmbracoRequestPathsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UmbracoRequestPathsTests.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Options; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UriUtilityTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UriUtilityTests.cs index 04ab83801d..906ee0e808 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UriUtilityTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UriUtilityTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Moq; using NUnit.Framework; using Umbraco.Cms.Core.Configuration.Models; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UrlProviderWithoutHideTopLevelNodeFromPathTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UrlProviderWithoutHideTopLevelNodeFromPathTests.cs index 3a00616215..7c8a1dc883 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UrlProviderWithoutHideTopLevelNodeFromPathTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UrlProviderWithoutHideTopLevelNodeFromPathTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UrlsProviderWithDomainsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UrlsProviderWithDomainsTests.cs index dffbe656d2..70084e28c6 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UrlsProviderWithDomainsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UrlsProviderWithDomainsTests.cs @@ -1,4 +1,3 @@ -using System; using System.Linq; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UrlsWithNestedDomains.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UrlsWithNestedDomains.cs index 41c485e732..9edce34707 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UrlsWithNestedDomains.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/UrlsWithNestedDomains.cs @@ -1,4 +1,3 @@ -using System; using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/WebPathTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/WebPathTests.cs index 098e047981..4072e3df8b 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/WebPathTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Routing/WebPathTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core.Routing; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scheduling/ContentVersionCleanupTest.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scheduling/ContentVersionCleanupTest.cs index 496b0ad42d..6f2d1af7e4 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scheduling/ContentVersionCleanupTest.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scheduling/ContentVersionCleanupTest.cs @@ -1,4 +1,3 @@ -using System; using System.Threading.Tasks; using AutoFixture.NUnit3; using Microsoft.Extensions.Options; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scoping/EventNameExtractorTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scoping/EventNameExtractorTests.cs index d20a30e661..9e0a7b103f 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scoping/EventNameExtractorTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scoping/EventNameExtractorTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core.Events; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scoping/ScopedNotificationPublisherTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scoping/ScopedNotificationPublisherTests.cs index 1a76d92bc7..927706ed89 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scoping/ScopedNotificationPublisherTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scoping/ScopedNotificationPublisherTests.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; @@ -98,7 +97,7 @@ public class ScopedNotificationPublisherTests new TestOptionsMonitor(new CoreDebugSettings()), mediaFileManager, loggerFactory, - + eventAggregatorMock.Object); } } diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Security/LegacyPasswordSecurityTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Security/LegacyPasswordSecurityTests.cs index fc9abecc10..d8cd848626 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Security/LegacyPasswordSecurityTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Security/LegacyPasswordSecurityTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Security.Cryptography; using System.Text; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentVersionCleanupServiceTest.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentVersionCleanupServiceTest.cs index 3684eba470..d4ae75f488 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentVersionCleanupServiceTest.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentVersionCleanupServiceTest.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/DefaultContentVersionCleanupPolicyTest.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/DefaultContentVersionCleanupPolicyTest.cs index e7879afea2..b0fc8cbb43 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/DefaultContentVersionCleanupPolicyTest.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/DefaultContentVersionCleanupPolicyTest.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using AutoFixture.NUnit3; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ShortStringHelper/DefaultShortStringHelperTestsWithoutSetup.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ShortStringHelper/DefaultShortStringHelperTestsWithoutSetup.cs index 9d7d95554a..f45c12db3f 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ShortStringHelper/DefaultShortStringHelperTestsWithoutSetup.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ShortStringHelper/DefaultShortStringHelperTestsWithoutSetup.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using System.Text; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ShortStringHelper/StringExtensionsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ShortStringHelper/StringExtensionsTests.cs index bd02bead1c..6e959e45f4 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ShortStringHelper/StringExtensionsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/ShortStringHelper/StringExtensionsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -333,7 +332,7 @@ public class StringExtensionsTests var output = input.ReplaceFirst(search, replacement); Assert.AreEqual(expected, output); } - + [Test] public void IsFullPath() { diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/TaskHelperTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/TaskHelperTests.cs index 2f29b10243..66ed94e5ce 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/TaskHelperTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/TaskHelperTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Threading; using System.Threading.Tasks; using AutoFixture.NUnit3; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Telemetry/SiteIdentifierServiceTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Telemetry/SiteIdentifierServiceTests.cs index d8c9e9f39c..4f47588655 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Telemetry/SiteIdentifierServiceTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Telemetry/SiteIdentifierServiceTests.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Telemetry/TelemetryServiceTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Telemetry/TelemetryServiceTests.cs index 83aa368d70..e8f381699a 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Telemetry/TelemetryServiceTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Telemetry/TelemetryServiceTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlImageSourceParserTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlImageSourceParserTests.cs index 2da75ed64d..25aa4841ea 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlImageSourceParserTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlImageSourceParserTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using System.Linq; using Microsoft.Extensions.Options; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs index 21180fca0f..c9d3f3ab9b 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/HtmlLocalLinkParserTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using Microsoft.Extensions.Options; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/VersionExtensionTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/VersionExtensionTests.cs index 06fcae14bc..460fe19622 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/VersionExtensionTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/VersionExtensionTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Extensions; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Web/Routing/PublishedRequestBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Web/Routing/PublishedRequestBuilderTests.cs index 0246d3e38b..7f2e483055 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Web/Routing/PublishedRequestBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Web/Routing/PublishedRequestBuilderTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/BackOffice/BackOfficeClaimsPrincipalFactoryTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/BackOffice/BackOfficeClaimsPrincipalFactoryTests.cs index 2db6b97121..1a8cecee6b 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/BackOffice/BackOfficeClaimsPrincipalFactoryTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/BackOffice/BackOfficeClaimsPrincipalFactoryTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Security.Claims; using System.Threading.Tasks; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Examine/UmbracoContentValueSetValidatorTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Examine/UmbracoContentValueSetValidatorTests.cs index e53cb0c04e..9bfa092180 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Examine/UmbracoContentValueSetValidatorTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Examine/UmbracoContentValueSetValidatorTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Examine; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HealthChecks/HealthCheckResultsTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HealthChecks/HealthCheckResultsTests.cs index 3a790696da..6a5189ab6a 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HealthChecks/HealthCheckResultsTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HealthChecks/HealthCheckResultsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Threading.Tasks; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/HealthCheckNotifierTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/HealthCheckNotifierTests.cs index 86ad79fbee..626129b3b7 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/HealthCheckNotifierTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/HealthCheckNotifierTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/KeepAliveTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/KeepAliveTests.cs index 09421bdd81..f0ef4cd278 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/KeepAliveTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/KeepAliveTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Net; using System.Net.Http; using System.Threading; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/LogScrubberTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/LogScrubberTests.cs index 4e67e2952f..553a4f451c 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/LogScrubberTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/LogScrubberTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Data; using System.Threading.Tasks; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBaseTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBaseTests.cs index ae260d09f8..394d763ed6 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBaseTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBaseTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Microsoft.Extensions.Logging; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/ScheduledPublishingTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/ScheduledPublishingTests.cs index b0a5c865e5..609dfbb7fa 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/ScheduledPublishingTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/ScheduledPublishingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Data; using System.Threading.Tasks; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/ServerRegistration/TouchServerTaskTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/ServerRegistration/TouchServerTaskTests.cs index 4ad5aa8bb2..b379f8d34b 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/ServerRegistration/TouchServerTaskTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/ServerRegistration/TouchServerTaskTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs index b89781d4cf..851afc269b 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/TempFileCleanupTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.IO; using System.Threading.Tasks; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Logging/LogviewerTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Logging/LogviewerTests.cs index 9c10e7117d..65307cd143 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Logging/LogviewerTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Logging/LogviewerTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Mapping/MappingTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Mapping/MappingTests.cs index c02fa62b55..fdcfead517 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Mapping/MappingTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Mapping/MappingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Data; using System.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/AlterMigrationTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/AlterMigrationTests.cs index 71d5d641f8..516e7f80c1 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/AlterMigrationTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/AlterMigrationTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using System.Linq; using Microsoft.Extensions.Logging; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/MigrationPlanTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/MigrationPlanTests.cs index 59d6539b4f..398aa263eb 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/MigrationPlanTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/MigrationPlanTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging.Abstractions; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/MigrationTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/MigrationTests.cs index 65feecb943..1e4ddd6f34 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/MigrationTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/MigrationTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Data; using Microsoft.Extensions.Logging; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/Stubs/Dummy.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/Stubs/Dummy.cs index 4c2aea2bd4..1a1c5eafbd 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/Stubs/Dummy.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Migrations/Stubs/Dummy.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Umbraco.Cms.Infrastructure.Migrations; namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Infrastructure.Migrations.Stubs; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Models/PathValidationTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Models/PathValidationTests.cs index 11a4c87ce5..303f2d396d 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Models/PathValidationTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Models/PathValidationTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Microsoft.Extensions.Logging; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/BulkDataReaderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/BulkDataReaderTests.cs index 38436ba338..069f145abe 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/BulkDataReaderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/BulkDataReaderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Data; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoSqlTemplateTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoSqlTemplateTests.cs index c638e15784..708a6a3ba4 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoSqlTemplateTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoSqlTemplateTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using Microsoft.Extensions.Options; using Moq; using NPoco; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoSqlTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoSqlTests.cs index 4de8aef70e..e2bbe11af2 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoSqlTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoSqlTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using NUnit.Framework; using Umbraco.Cms.Core; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/ContentTypeRepositorySqlClausesTest.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/ContentTypeRepositorySqlClausesTest.cs index b8f558d9d3..168e510ed4 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/ContentTypeRepositorySqlClausesTest.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/ContentTypeRepositorySqlClausesTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using NUnit.Framework; using Umbraco.Cms.Core; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/DataTypeDefinitionRepositorySqlClausesTest.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/DataTypeDefinitionRepositorySqlClausesTest.cs index cd0268f945..7517742eeb 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/DataTypeDefinitionRepositorySqlClausesTest.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/DataTypeDefinitionRepositorySqlClausesTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using NPoco; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/ExpressionTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/ExpressionTests.cs index 515a221b7b..e6f2243147 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/ExpressionTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/ExpressionTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/MediaRepositorySqlClausesTest.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/MediaRepositorySqlClausesTest.cs index a440639cce..58a49e8e43 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/MediaRepositorySqlClausesTest.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/MediaRepositorySqlClausesTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using NPoco; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/MediaTypeRepositorySqlClausesTest.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/MediaTypeRepositorySqlClausesTest.cs index a10c7826c4..a0867852d4 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/MediaTypeRepositorySqlClausesTest.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Persistence/Querying/MediaTypeRepositorySqlClausesTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Diagnostics; using NPoco; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/ContentSerializationTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/ContentSerializationTests.cs index 9c191d2468..9b45e85b7e 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/ContentSerializationTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/ContentSerializationTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedContentDataTableTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedContentDataTableTests.cs index 7bf07a21f3..c5e1830381 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedContentDataTableTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedContentDataTableTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedContentLanguageVariantTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedContentLanguageVariantTests.cs index 37a5f08286..4faacab0c7 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedContentLanguageVariantTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedContentLanguageVariantTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedContentTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedContentTests.cs index 83908390e9..984085e754 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedContentTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedContentTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedSnapshotServiceCollectionTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedSnapshotServiceCollectionTests.cs index ac22b112cd..a007079ca9 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedSnapshotServiceCollectionTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedSnapshotServiceCollectionTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedSnapshotServiceContentTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedSnapshotServiceContentTests.cs index 5c1312ae8f..570cd19566 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedSnapshotServiceContentTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/PublishedCache/PublishedSnapshotServiceContentTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using Moq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Scoping/ScopeUnitTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Scoping/ScopeUnitTests.cs index 77eba6533f..c547b1af3e 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Scoping/ScopeUnitTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Scoping/ScopeUnitTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberRoleStoreTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberRoleStoreTests.cs index c7f8c4c2f5..e97b438c05 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberRoleStoreTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberRoleStoreTests.cs @@ -1,4 +1,3 @@ -using System; using System.Linq; using System.Threading; using System.Threading.Tasks; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberUserStoreTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberUserStoreTests.cs index 9e2a769e74..b631e2140f 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberUserStoreTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberUserStoreTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Data; using System.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/NoOpLookupNormalizerTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/NoOpLookupNormalizerTests.cs index 669790b28b..a68b0856ec 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/NoOpLookupNormalizerTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/NoOpLookupNormalizerTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core.Security; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Serialization/AutoInterningStringConverterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Serialization/AutoInterningStringConverterTests.cs index ee9c147a42..442628d619 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Serialization/AutoInterningStringConverterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Serialization/AutoInterningStringConverterTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Services/AmbiguousEventTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Services/AmbiguousEventTests.cs index 9acf9ab8ab..66b3add5c7 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Services/AmbiguousEventTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Services/AmbiguousEventTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Reflection; using System.Text; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Services/LocalizedTextServiceTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Services/LocalizedTextServiceTests.cs index 47d1248115..915dd593fe 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Services/LocalizedTextServiceTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Services/LocalizedTextServiceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.ModelsBuilder.Embedded/BuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.ModelsBuilder.Embedded/BuilderTests.cs index 614d24b2d7..3327e6f27d 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.ModelsBuilder.Embedded/BuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.ModelsBuilder.Embedded/BuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.ModelsBuilder.Embedded/UmbracoApplicationTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.ModelsBuilder.Embedded/UmbracoApplicationTests.cs index fcacaadeee..3f45ed28c9 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.ModelsBuilder.Embedded/UmbracoApplicationTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.ModelsBuilder.Embedded/UmbracoApplicationTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using NUnit.Framework; using Umbraco.Cms.Infrastructure.ModelsBuilder; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.New.Cms.Core/Services/InstallServiceTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.New.Cms.Core/Services/InstallServiceTests.cs deleted file mode 100644 index cd40293bfd..0000000000 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.New.Cms.Core/Services/InstallServiceTests.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; -using Moq; -using NUnit.Framework; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Services; -using Umbraco.New.Cms.Core.Installer; -using Umbraco.New.Cms.Core.Models.Installer; -using Umbraco.New.Cms.Core.Services.Installer; - -namespace Umbraco.Cms.Tests.UnitTests.Umbraco.New.Cms.Core.Services; - -[TestFixture] -public class InstallServiceTests -{ - [Test] - public void RequiresInstallRuntimeToInstall() - { - var runtimeStateMock = new Mock(); - runtimeStateMock.Setup(x => x.Level).Returns(RuntimeLevel.Run); - var stepCollection = new NewInstallStepCollection(Enumerable.Empty); - - var sut = new InstallService(Mock.Of>(), stepCollection, runtimeStateMock.Object); - - Assert.ThrowsAsync(async () => await sut.Install(new InstallData())); - } - - [Test] - public async Task OnlyRunsStepsThatRequireExecution() - { - var steps = new[] - { - new TestInstallStep { ShouldRun = true }, - new TestInstallStep { ShouldRun = false }, - new TestInstallStep { ShouldRun = true }, - }; - - var sut = CreateInstallService(steps); - await sut.Install(new InstallData()); - - foreach (var step in steps) - { - Assert.AreEqual(step.ShouldRun, step.HasRun); - } - } - - [Test] - public async Task StepsRunInCollectionOrder() - { - List runOrder = new List(); - - var steps = new[] - { - new TestInstallStep { Id = 1 }, - new TestInstallStep { Id = 2 }, - new TestInstallStep { Id = 3 }, - }; - - // Add an method delegate that will add the step itself, that way we can know the executed order. - foreach (var step in steps) - { - step.AdditionalExecution = _ => - { - runOrder.Add(step); - return Task.CompletedTask; - }; - } - - var sut = CreateInstallService(steps); - await sut.Install(new InstallData()); - - // The ID's are strictly not necessary, but it makes potential debugging easier. - var expectedRunOrder = steps.Select(x => x.Id); - var actualRunOrder = runOrder.Select(x => x.Id); - Assert.AreEqual(expectedRunOrder, actualRunOrder); - } - - private InstallService CreateInstallService(IEnumerable steps) - { - var logger = Mock.Of>(); - var stepCollection = new NewInstallStepCollection(() => steps); - var runtimeStateMock = new Mock(); - runtimeStateMock.Setup(x => x.Level).Returns(RuntimeLevel.Install); - - return new InstallService(logger, stepCollection, runtimeStateMock.Object); - } - - private class TestInstallStep : IInstallStep - { - public bool HasRun; - - public bool ShouldRun = true; - - public int Id; - - public Func AdditionalExecution; - - public Task ExecuteAsync(InstallData model) - { - HasRun = true; - - AdditionalExecution?.Invoke(model); - return Task.CompletedTask; - } - - public Task RequiresExecutionAsync(InstallData model) => Task.FromResult(ShouldRun); - } -} diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.New.Cms.Core/Services/UpgradeServiceTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.New.Cms.Core/Services/UpgradeServiceTests.cs deleted file mode 100644 index d2934f9c81..0000000000 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.New.Cms.Core/Services/UpgradeServiceTests.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Extensions.Logging; -using Moq; -using NUnit.Framework; -using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Services; -using Umbraco.New.Cms.Core.Installer; -using UpgradeService = Umbraco.New.Cms.Core.Services.Installer.UpgradeService; - -namespace Umbraco.Cms.Tests.UnitTests.Umbraco.New.Cms.Core.Services; - -[TestFixture] -public class UpgradeServiceTests -{ - - [Test] - [TestCase(RuntimeLevel.Install)] - [TestCase(RuntimeLevel.Boot)] - [TestCase(RuntimeLevel.Run)] - [TestCase(RuntimeLevel.Unknown)] - public void RequiresUpgradeRuntimeToUpgrade(RuntimeLevel level) - { - var sut = CreateUpgradeService(Enumerable.Empty(), level); - - Assert.ThrowsAsync(async () => await sut.Upgrade()); - } - - [Test] - public async Task OnlyRunsStepsThatRequireExecution() - { - var steps = new[] - { - new TestUpgradeStep { ShouldRun = true }, - new TestUpgradeStep { ShouldRun = false }, - new TestUpgradeStep { ShouldRun = true }, - }; - - var sut = CreateUpgradeService(steps); - - await sut.Upgrade(); - - foreach (var step in steps) - { - Assert.AreEqual(step.ShouldRun, step.HasRun); - } - } - - [Test] - public async Task StepsRunInCollectionOrder() - { - List runOrder = new List(); - - var steps = new[] - { - new TestUpgradeStep { Id = 1 }, - new TestUpgradeStep { Id = 2 }, - new TestUpgradeStep { Id = 3 }, - }; - - // Add an method delegate that will add the step itself, that way we can know the executed order. - foreach (var step in steps) - { - step.AdditionalExecution = () => runOrder.Add(step); - } - - var sut = CreateUpgradeService(steps); - await sut.Upgrade(); - - // The ID's are strictly not necessary, but it makes potential debugging easier. - var expectedRunOrder = steps.Select(x => x.Id); - var actualRunOrder = runOrder.Select(x => x.Id); - Assert.AreEqual(expectedRunOrder, actualRunOrder); - } - - private UpgradeService CreateUpgradeService(IEnumerable steps, RuntimeLevel runtimeLevel = RuntimeLevel.Upgrade) - { - var logger = Mock.Of>(); - var stepCollection = new UpgradeStepCollection(() => steps); - var runtimeStateMock = new Mock(); - runtimeStateMock.Setup(x => x.Level).Returns(runtimeLevel); - - return new UpgradeService(stepCollection, runtimeStateMock.Object, logger); - } - - private class TestUpgradeStep : IUpgradeStep - { - public bool HasRun; - - public bool ShouldRun = true; - - public int Id; - - public Action AdditionalExecution; - - public Task ExecuteAsync() - { - HasRun = true; - - AdditionalExecution?.Invoke(); - return Task.CompletedTask; - } - - public Task RequiresExecutionAsync() => Task.FromResult(ShouldRun); - } -} diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.New.Cms.Infrastructure/Factories/DatabaseSettingsFactoryTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.New.Cms.Infrastructure/Factories/DatabaseSettingsFactoryTests.cs deleted file mode 100644 index 3494e27f01..0000000000 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.New.Cms.Infrastructure/Factories/DatabaseSettingsFactoryTests.cs +++ /dev/null @@ -1,184 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.Extensions.Logging.Abstractions; -using Moq; -using NUnit.Framework; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.Install.Models; -using Umbraco.Cms.Core.Mapping; -using Umbraco.Cms.Core.Scoping; -using Umbraco.Cms.Infrastructure.Persistence; -using Umbraco.Cms.Api.Management.Mapping.Installer; -using Umbraco.Cms.Tests.Common; -using Umbraco.New.Cms.Core.Models.Installer; -using Umbraco.New.Cms.Infrastructure.Factories.Installer; - -namespace Umbraco.Cms.Tests.UnitTests.Umbraco.New.Cms.Infrastructure.Factories; - -[TestFixture] -public class DatabaseSettingsFactoryTests -{ - [Test] - public void CanBuildDatabaseSettings() - { - var metadata = CreateTestMetadata(); - var connectionString = new TestOptionsMonitor(new ConnectionStrings()); - var mapper = CreateMapper(); - - var factory = new DatabaseSettingsFactory(metadata, connectionString, mapper); - - var settingsModels = factory.GetDatabaseSettings(); - Assert.AreEqual(metadata.Count, settingsModels.Count); - AssertMapping(metadata, settingsModels); - } - - [Test] - public void IsConfiguredSetCorrectly() - { - var connectionString = new ConnectionStrings - { - ConnectionString = "SomeConnectionString", - ProviderName = "HostedTestMeta", - }; - var optionsMonitor = new TestOptionsMonitor(connectionString); - var mapper = CreateMapper(); - var metadata = CreateTestMetadata(); - - var factory = new DatabaseSettingsFactory(metadata, optionsMonitor, mapper); - - var settingsModels = factory.GetDatabaseSettings(); - - Assert.AreEqual(1, settingsModels.Count, "Expected only one database settings model, if a database is preconfigured we should only return the configured one."); - AssertMapping(metadata, settingsModels); - Assert.IsTrue(settingsModels.First().IsConfigured); - } - - [Test] - public void SpecifiedProviderMustExist() - { - var connectionString = new ConnectionStrings - { - ConnectionString = "SomeConnectionString", - ProviderName = "NoneExistentProvider", - }; - var optionsMonitor = new TestOptionsMonitor(connectionString); - var mapper = CreateMapper(); - var metadata = CreateTestMetadata(); - - var factory = new DatabaseSettingsFactory(metadata, optionsMonitor, mapper); - Assert.Throws(() => factory.GetDatabaseSettings()); - } - - /// - /// Asserts that the mapping is correct, in other words that the values in DatabaseSettingsModel is as expected. - /// - private void AssertMapping( - IEnumerable expected, - ICollection actual) - { - expected = expected.ToList(); - foreach (var model in actual) - { - var metadata = expected.FirstOrDefault(x => x.Id == model.Id); - Assert.IsNotNull(metadata); - - Assert.Multiple(() => - { - Assert.AreEqual(metadata?.SortOrder, model.SortOrder); - Assert.AreEqual(metadata.DisplayName, model.DisplayName); - Assert.AreEqual(metadata.DefaultDatabaseName, model.DefaultDatabaseName); - Assert.AreEqual(metadata.ProviderName ?? string.Empty, model.ProviderName); - Assert.AreEqual(metadata.RequiresServer, model.RequiresServer); - Assert.AreEqual(metadata.ServerPlaceholder ?? string.Empty, model.ServerPlaceholder); - Assert.AreEqual(metadata.RequiresCredentials, model.RequiresCredentials); - Assert.AreEqual(metadata.SupportsIntegratedAuthentication, model.SupportsIntegratedAuthentication); - Assert.AreEqual(metadata.RequiresConnectionTest, model.RequiresConnectionTest); - }); - } - } - - private IUmbracoMapper CreateMapper() - { - var mapper = new UmbracoMapper( - new MapDefinitionCollection(Enumerable.Empty), - Mock.Of(), - NullLogger.Instance); - - var definition = new InstallerViewModelsMapDefinition(); - definition.DefineMaps(mapper); - return mapper; - } - - private List CreateTestMetadata() - { - - var metadata = new List - { - new TestDatabaseProviderMetadata - { - Id = Guid.Parse("EC8ACD63-8CDE-4CA5-B2A3-06322720F274"), - SortOrder = 1, - DisplayName = "FirstMetadata", - DefaultDatabaseName = "TestDatabase", - IsAvailable = true, - GenerateConnectionStringDelegate = _ => "FirstTestMetadataConnectionString", - ProviderName = "SimpleTestMeta" - }, - new TestDatabaseProviderMetadata - { - Id = Guid.Parse("C5AB4E1D-B7E4-47E5-B1A4-C9343B5F59CA"), - SortOrder = 2, - DisplayName = "SecondMetadata", - DefaultDatabaseName = "HostedTest", - IsAvailable = true, - RequiresServer = true, - ServerPlaceholder = "SomeServerPlaceholder", - RequiresCredentials = true, - RequiresConnectionTest = true, - ForceCreateDatabase = true, - GenerateConnectionStringDelegate = _ => "HostedDatabaseConnectionString", - ProviderName = "HostedTestMeta" - }, - }; - - return metadata; - } - - #nullable enable - public class TestDatabaseProviderMetadata : IDatabaseProviderMetadata - { - public Guid Id { get; set; } - - public int SortOrder { get; set; } - - public string DisplayName { get; set; } = string.Empty; - - public string DefaultDatabaseName { get; set; } = string.Empty; - - public string? ProviderName { get; set; } - - public bool SupportsQuickInstall { get; set; } - - public bool IsAvailable { get; set; } - - public bool RequiresServer { get; set; } - - public string? ServerPlaceholder { get; set; } - - public bool RequiresCredentials { get; set; } - - public bool SupportsIntegratedAuthentication { get; set; } - - public bool RequiresConnectionTest { get; set; } - - public bool ForceCreateDatabase { get; set; } - - public Func GenerateConnectionStringDelegate { get; set; } = - _ => "ConnectionString"; - - public bool CanRecognizeConnectionString(string? connectionString) => false; - - public string? GenerateConnectionString(DatabaseModel databaseModel) => GenerateConnectionStringDelegate(databaseModel); - } -} diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.PublishedCache.NuCache/SnapDictionaryTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.PublishedCache.NuCache/SnapDictionaryTests.cs index b7e0823561..c34765fa3a 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.PublishedCache.NuCache/SnapDictionaryTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.PublishedCache.NuCache/SnapDictionaryTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using System.Threading.Tasks; using Moq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/ContentTypeBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/ContentTypeBuilderTests.cs index 1f8d1c136c..b23cd5209e 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/ContentTypeBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/ContentTypeBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core.Models; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/DocumentEntitySlimBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/DocumentEntitySlimBuilderTests.cs index d2ae193ccb..062d8aa7b0 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/DocumentEntitySlimBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/DocumentEntitySlimBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using NUnit.Framework; using Umbraco.Cms.Tests.Common.Builders; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MacroBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MacroBuilderTests.cs index 37f2cd1953..57aac4541f 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MacroBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MacroBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MediaTypeBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MediaTypeBuilderTests.cs index 70b68d4500..36cd29bee9 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MediaTypeBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MediaTypeBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Linq; using NUnit.Framework; using Umbraco.Cms.Core; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MemberBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MemberBuilderTests.cs index 7323709e3c..b173ba6ce5 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MemberBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MemberBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MemberGroupBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MemberGroupBuilderTests.cs index 76a230c6a0..8d52cbb0bc 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MemberGroupBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MemberGroupBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using NUnit.Framework; using Umbraco.Cms.Tests.Common.Builders; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MemberTypeBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MemberTypeBuilderTests.cs index 52fb71d820..dcc61d59ff 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MemberTypeBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/MemberTypeBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Linq; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/PropertyBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/PropertyBuilderTests.cs index a2aec5a216..4884fe371a 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/PropertyBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/PropertyBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/PropertyGroupBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/PropertyGroupBuilderTests.cs index ab1740151d..8c0327e169 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/PropertyGroupBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/PropertyGroupBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/PropertyTypeBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/PropertyTypeBuilderTests.cs index 903fd50b0f..3b4c41bce4 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/PropertyTypeBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/PropertyTypeBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Tests.Common.Builders; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/RelationBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/RelationBuilderTests.cs index 907a0d56a9..8b073bfe23 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/RelationBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/RelationBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Tests.Common.Builders; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/RelationTypeBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/RelationTypeBuilderTests.cs index 6e15d908ea..d176251a1e 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/RelationTypeBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/RelationTypeBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/TemplateBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/TemplateBuilderTests.cs index f8b5b4fd6d..29551ee06b 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/TemplateBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/TemplateBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Tests.Common.Builders; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/UserBuilderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/UserBuilderTests.cs index 455868358f..52938dd53f 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/UserBuilderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.Common/Builders/UserBuilderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj index 293af7db2c..10ad774c34 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj @@ -18,7 +18,6 @@ - diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Authorization/ContentPermissionsQueryStringHandlerTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Authorization/ContentPermissionsQueryStringHandlerTests.cs index 32cfd66439..c562eb67ea 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Authorization/ContentPermissionsQueryStringHandlerTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Authorization/ContentPermissionsQueryStringHandlerTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Security.Claims; using System.Threading.Tasks; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Authorization/MediaPermissionsQueryStringHandlerTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Authorization/MediaPermissionsQueryStringHandlerTests.cs index b01ce38dfb..08ae10b071 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Authorization/MediaPermissionsQueryStringHandlerTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Authorization/MediaPermissionsQueryStringHandlerTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Security.Claims; using System.Threading.Tasks; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs index 0a1b2f3240..b7b9b85c94 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/ContentControllerTests.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Globalization; using System.Linq; using Microsoft.AspNetCore.Authorization; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs index 83d39a4245..b9c6a63812 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/MemberControllerUnitTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Data; using System.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Filters/AppendUserModifiedHeaderAttributeTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Filters/AppendUserModifiedHeaderAttributeTests.cs index 5a4f153a26..e71570e311 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Filters/AppendUserModifiedHeaderAttributeTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Filters/AppendUserModifiedHeaderAttributeTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Filters/ContentModelValidatorTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Filters/ContentModelValidatorTests.cs index 97181a743e..e1175c789b 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Filters/ContentModelValidatorTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Filters/ContentModelValidatorTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.ComponentModel.DataAnnotations; using Newtonsoft.Json; using Newtonsoft.Json.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Extensions/HttpContextExtensionTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Extensions/HttpContextExtensionTests.cs index a687121b80..d0f4a10536 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Extensions/HttpContextExtensionTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Extensions/HttpContextExtensionTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Text; using Microsoft.AspNetCore.Http; using NUnit.Framework; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/ImageCropperTest.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/ImageCropperTest.cs index 711914a01e..ed513270a5 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/ImageCropperTest.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/ImageCropperTest.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Globalization; using System.Linq; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/ModelBinders/ContentModelBinderTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/ModelBinders/ContentModelBinderTests.cs index ca9d538340..d0afeddd2b 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/ModelBinders/ContentModelBinderTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/ModelBinders/ContentModelBinderTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing/RoutableDocumentFilterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing/RoutableDocumentFilterTests.cs index 05a888923c..a943e5187b 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing/RoutableDocumentFilterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing/RoutableDocumentFilterTests.cs @@ -1,4 +1,3 @@ -using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing/TestRouteBuilder.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing/TestRouteBuilder.cs index ed9877b976..10c87dcbab 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing/TestRouteBuilder.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing/TestRouteBuilder.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Collections.Generic; using System.Diagnostics; using System.Threading.Tasks; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Security/MemberSignInManagerTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Security/MemberSignInManagerTests.cs index cf88a7c962..a17f748f0c 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Security/MemberSignInManagerTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Security/MemberSignInManagerTests.cs @@ -1,4 +1,3 @@ -using System; using System.Linq; using System.Net; using System.Threading.Tasks; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Security/PublicAccessCheckerTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Security/PublicAccessCheckerTests.cs index 260a685559..681882e332 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Security/PublicAccessCheckerTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Security/PublicAccessCheckerTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using System.Security.Claims; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Views/UmbracoViewPageTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Views/UmbracoViewPageTests.cs index bcc4ea1321..634b326911 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Views/UmbracoViewPageTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Views/UmbracoViewPageTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ViewFeatures; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/AspNetCoreHostingEnvironmentTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/AspNetCoreHostingEnvironmentTests.cs index 35fdd34103..5fac76d424 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/AspNetCoreHostingEnvironmentTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/AspNetCoreHostingEnvironmentTests.cs @@ -1,7 +1,6 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System; using NUnit.Framework; using Umbraco.Cms.Core.Strings; using Umbraco.Cms.Tests.UnitTests.AutoFixture; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/Routing/UmbracoRouteValueTransformerTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/Routing/UmbracoRouteValueTransformerTests.cs index ec42030e7c..30b40607f4 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/Routing/UmbracoRouteValueTransformerTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/Routing/UmbracoRouteValueTransformerTests.cs @@ -1,4 +1,3 @@ -using System; using System.Reflection; using System.Threading.Tasks; using Microsoft.AspNetCore.DataProtection; diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/Routing/UmbracoRouteValuesFactoryTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/Routing/UmbracoRouteValuesFactoryTests.cs index a7e9643221..4c159aafe0 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/Routing/UmbracoRouteValuesFactoryTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Website/Routing/UmbracoRouteValuesFactoryTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Reflection; using System.Threading.Tasks; diff --git a/umbraco.sln b/umbraco.sln index 8a9c1ddecc..236e8627ba 100644 --- a/umbraco.sln +++ b/umbraco.sln @@ -95,19 +95,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Templates", "templa EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Cms", "src\Umbraco.Cms\Umbraco.Cms.csproj", "{92EAA57A-CC99-4F5D-9D9C-B865293F6000}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NewBackoffice", "NewBackoffice", "{995D9EFA-8BB1-4333-80AD-C525A06FD984}" - ProjectSection(SolutionItems) = preProject - .github\New BackOffice - README.md = .github\New BackOffice - README.md - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Cms.Api.Management", "src\Umbraco.Cms.Api.Management\Umbraco.Cms.Api.Management.csproj", "{0946531B-F06D-415B-A4E3-6CBFF5DB1C12}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.New.Cms.Core", "src\Umbraco.New.Cms.Core\Umbraco.New.Cms.Core.csproj", "{CBCE0A1E-BF29-49A6-9581-EAB3587D823A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.New.Cms.Infrastructure", "src\Umbraco.New.Cms.Infrastructure\Umbraco.New.Cms.Infrastructure.csproj", "{2D978DAF-8F48-4D59-8FEA-7EF0F40DBC2C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.New.Cms.Web.Common", "src\Umbraco.New.Cms.Web.Common\Umbraco.New.Cms.Web.Common.csproj", "{5ED13EC6-399E-49D5-9D26-86501729B08D}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Cms.Targets", "src\Umbraco.Cms.Targets\Umbraco.Cms.Targets.csproj", "{B51C10FC-FD20-451E-90DD-A117133403DF}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E5D4B5F9-6CCE-46CE-8985-9A350445F92B}" @@ -284,30 +271,6 @@ Global {92EAA57A-CC99-4F5D-9D9C-B865293F6000}.Release|Any CPU.Build.0 = Release|Any CPU {92EAA57A-CC99-4F5D-9D9C-B865293F6000}.SkipTests|Any CPU.ActiveCfg = Debug|Any CPU {92EAA57A-CC99-4F5D-9D9C-B865293F6000}.SkipTests|Any CPU.Build.0 = Debug|Any CPU - {0946531B-F06D-415B-A4E3-6CBFF5DB1C12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0946531B-F06D-415B-A4E3-6CBFF5DB1C12}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0946531B-F06D-415B-A4E3-6CBFF5DB1C12}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0946531B-F06D-415B-A4E3-6CBFF5DB1C12}.Release|Any CPU.Build.0 = Release|Any CPU - {0946531B-F06D-415B-A4E3-6CBFF5DB1C12}.SkipTests|Any CPU.ActiveCfg = Debug|Any CPU - {0946531B-F06D-415B-A4E3-6CBFF5DB1C12}.SkipTests|Any CPU.Build.0 = Debug|Any CPU - {CBCE0A1E-BF29-49A6-9581-EAB3587D823A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CBCE0A1E-BF29-49A6-9581-EAB3587D823A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CBCE0A1E-BF29-49A6-9581-EAB3587D823A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CBCE0A1E-BF29-49A6-9581-EAB3587D823A}.Release|Any CPU.Build.0 = Release|Any CPU - {CBCE0A1E-BF29-49A6-9581-EAB3587D823A}.SkipTests|Any CPU.ActiveCfg = Debug|Any CPU - {CBCE0A1E-BF29-49A6-9581-EAB3587D823A}.SkipTests|Any CPU.Build.0 = Debug|Any CPU - {2D978DAF-8F48-4D59-8FEA-7EF0F40DBC2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2D978DAF-8F48-4D59-8FEA-7EF0F40DBC2C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2D978DAF-8F48-4D59-8FEA-7EF0F40DBC2C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2D978DAF-8F48-4D59-8FEA-7EF0F40DBC2C}.Release|Any CPU.Build.0 = Release|Any CPU - {2D978DAF-8F48-4D59-8FEA-7EF0F40DBC2C}.SkipTests|Any CPU.ActiveCfg = Debug|Any CPU - {2D978DAF-8F48-4D59-8FEA-7EF0F40DBC2C}.SkipTests|Any CPU.Build.0 = Debug|Any CPU - {5ED13EC6-399E-49D5-9D26-86501729B08D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5ED13EC6-399E-49D5-9D26-86501729B08D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5ED13EC6-399E-49D5-9D26-86501729B08D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5ED13EC6-399E-49D5-9D26-86501729B08D}.Release|Any CPU.Build.0 = Release|Any CPU - {5ED13EC6-399E-49D5-9D26-86501729B08D}.SkipTests|Any CPU.ActiveCfg = Debug|Any CPU - {5ED13EC6-399E-49D5-9D26-86501729B08D}.SkipTests|Any CPU.Build.0 = Debug|Any CPU {B51C10FC-FD20-451E-90DD-A117133403DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B51C10FC-FD20-451E-90DD-A117133403DF}.Debug|Any CPU.Build.0 = Debug|Any CPU {B51C10FC-FD20-451E-90DD-A117133403DF}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -345,10 +308,6 @@ Global {9102ABDF-E537-4E46-B525-C9ED4833EED0} = {B5BD12C1-A454-435E-8A46-FF4A364C0382} {2A5027D9-F71D-4957-929E-F7A56AA1B95A} = {05878304-40EB-4F84-B40B-91BDB70DE094} {05C1D0C8-C592-468F-AF8F-A299B9B3A903} = {6D72A60B-0542-4AA9-A493-DD4179E838A1} - {0946531B-F06D-415B-A4E3-6CBFF5DB1C12} = {995D9EFA-8BB1-4333-80AD-C525A06FD984} - {CBCE0A1E-BF29-49A6-9581-EAB3587D823A} = {995D9EFA-8BB1-4333-80AD-C525A06FD984} - {2D978DAF-8F48-4D59-8FEA-7EF0F40DBC2C} = {995D9EFA-8BB1-4333-80AD-C525A06FD984} - {5ED13EC6-399E-49D5-9D26-86501729B08D} = {995D9EFA-8BB1-4333-80AD-C525A06FD984} {20CE9C97-9314-4A19-BCF1-D12CF49B7205} = {E5D4B5F9-6CCE-46CE-8985-9A350445F92B} {F2BF84D9-0A14-40AF-A0F3-B9BBBBC16A44} = {20CE9C97-9314-4A19-BCF1-D12CF49B7205} {2B47AD9F-FFF1-448A-88F1-D4F568811738} = {F2BF84D9-0A14-40AF-A0F3-B9BBBBC16A44}