diff --git a/src/Umbraco.Cms.Api.Common/Configuration/ConfigureUmbracoSwaggerGenOptions.cs b/src/Umbraco.Cms.Api.Common/Configuration/ConfigureUmbracoSwaggerGenOptions.cs index d569d0a6a5..e4b60877f1 100644 --- a/src/Umbraco.Cms.Api.Common/Configuration/ConfigureUmbracoSwaggerGenOptions.cs +++ b/src/Umbraco.Cms.Api.Common/Configuration/ConfigureUmbracoSwaggerGenOptions.cs @@ -7,7 +7,6 @@ using Microsoft.Extensions.Options; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; using Umbraco.Cms.Api.Common.OpenApi; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Extensions; namespace Umbraco.Cms.Api.Common.Configuration; @@ -18,13 +17,6 @@ public class ConfigureUmbracoSwaggerGenOptions : IConfigureOptions()) - { } - public ConfigureUmbracoSwaggerGenOptions( IOperationIdSelector operationIdSelector, ISchemaIdSelector schemaIdSelector, diff --git a/src/Umbraco.Cms.Api.Common/OpenApi/IOperationIdSelector.cs b/src/Umbraco.Cms.Api.Common/OpenApi/IOperationIdSelector.cs index 3f97e78165..441279a66b 100644 --- a/src/Umbraco.Cms.Api.Common/OpenApi/IOperationIdSelector.cs +++ b/src/Umbraco.Cms.Api.Common/OpenApi/IOperationIdSelector.cs @@ -5,8 +5,5 @@ namespace Umbraco.Cms.Api.Common.OpenApi; public interface IOperationIdSelector { - [Obsolete("Use overload that only takes ApiDescription instead. This will be removed in Umbraco 15.")] - string? OperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions); - string? OperationId(ApiDescription apiDescription); } diff --git a/src/Umbraco.Cms.Api.Common/OpenApi/OperationIdSelector.cs b/src/Umbraco.Cms.Api.Common/OpenApi/OperationIdSelector.cs index 3c00a126be..8a599b2721 100644 --- a/src/Umbraco.Cms.Api.Common/OpenApi/OperationIdSelector.cs +++ b/src/Umbraco.Cms.Api.Common/OpenApi/OperationIdSelector.cs @@ -16,9 +16,6 @@ public class OperationIdSelector : IOperationIdSelector public OperationIdSelector(IEnumerable operationIdHandlers) => _operationIdHandlers = operationIdHandlers; - [Obsolete("Use overload that only takes ApiDescription instead. This will be removed in Umbraco 15.")] - public virtual string? OperationId(ApiDescription apiDescription, ApiVersioningOptions apiVersioningOptions) => OperationId(apiDescription); - public virtual string? OperationId(ApiDescription apiDescription) { IOperationIdHandler? handler = _operationIdHandlers.FirstOrDefault(h => h.CanHandle(apiDescription)); diff --git a/src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByIdContentApiController.cs b/src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByIdContentApiController.cs index 523c496956..775b81803d 100644 --- a/src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByIdContentApiController.cs +++ b/src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByIdContentApiController.cs @@ -1,4 +1,3 @@ -using System.Diagnostics; using Asp.Versioning; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -8,7 +7,6 @@ using Umbraco.Cms.Core.Models.PublishedContent; namespace Umbraco.Cms.Api.Delivery.Controllers.Content; -[ApiVersion("1.0")] [ApiVersion("2.0")] public class ByIdContentApiController : ContentApiItemControllerBase { @@ -21,16 +19,6 @@ public class ByIdContentApiController : ContentApiItemControllerBase : base(apiPublishedContentCache, apiContentResponseBuilder) => _requestMemberAccessService = requestMemberAccessService; - [HttpGet("item/{id:guid}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IApiContentResponse), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - [Obsolete("Please use version 2 of this API. Will be removed in V15.")] - public async Task ById(Guid id) - => await HandleRequest(id); - /// /// Gets a content item by id. /// diff --git a/src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByIdsContentApiController.cs b/src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByIdsContentApiController.cs index 7eb653e9d2..150a1828ef 100644 --- a/src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByIdsContentApiController.cs +++ b/src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByIdsContentApiController.cs @@ -8,7 +8,6 @@ using Umbraco.Extensions; namespace Umbraco.Cms.Api.Delivery.Controllers.Content; -[ApiVersion("1.0")] [ApiVersion("2.0")] public class ByIdsContentApiController : ContentApiItemControllerBase { @@ -21,15 +20,6 @@ public class ByIdsContentApiController : ContentApiItemControllerBase : base(apiPublishedContentCache, apiContentResponseBuilder) => _requestMemberAccessService = requestMemberAccessService; - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [Obsolete("Please use version 2 of this API. Will be removed in V15.")] - public async Task Item([FromQuery(Name = "id")] HashSet ids) - => await HandleRequest(ids); - /// /// Gets content items by ids. /// diff --git a/src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByRouteContentApiController.cs b/src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByRouteContentApiController.cs index 2b94e1169f..7bc549fe33 100644 --- a/src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByRouteContentApiController.cs +++ b/src/Umbraco.Cms.Api.Delivery/Controllers/Content/ByRouteContentApiController.cs @@ -1,17 +1,13 @@ using Asp.Versioning; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core; using Umbraco.Cms.Core.DeliveryApi; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models.DeliveryApi; using Umbraco.Cms.Core.Models.PublishedContent; -using Umbraco.Cms.Core.Services; namespace Umbraco.Cms.Api.Delivery.Controllers.Content; -[ApiVersion("1.0")] [ApiVersion("2.0")] public class ByRouteContentApiController : ContentApiItemControllerBase { @@ -21,45 +17,6 @@ public class ByRouteContentApiController : ContentApiItemControllerBase private readonly IRequestMemberAccessService _requestMemberAccessService; private const string PreviewContentRequestPathPrefix = $"/{Constants.DeliveryApi.Routing.PreviewContentPathPrefix}"; - [Obsolete($"Please use the constructor that accepts {nameof(IApiContentPathResolver)}. Will be removed in V15.")] - public ByRouteContentApiController( - IApiPublishedContentCache apiPublishedContentCache, - IApiContentResponseBuilder apiContentResponseBuilder, - IRequestRoutingService requestRoutingService, - IRequestRedirectService requestRedirectService, - IRequestPreviewService requestPreviewService, - IRequestMemberAccessService requestMemberAccessService) - : this( - apiPublishedContentCache, - apiContentResponseBuilder, - requestRedirectService, - requestPreviewService, - requestMemberAccessService, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [Obsolete($"Please use the non-obsolete constructor. Will be removed in V15.")] - public ByRouteContentApiController( - IApiPublishedContentCache apiPublishedContentCache, - IApiContentResponseBuilder apiContentResponseBuilder, - IPublicAccessService publicAccessService, - IRequestRoutingService requestRoutingService, - IRequestRedirectService requestRedirectService, - IRequestPreviewService requestPreviewService, - IRequestMemberAccessService requestMemberAccessService, - IApiContentPathResolver apiContentPathResolver) - : this( - apiPublishedContentCache, - apiContentResponseBuilder, - requestRedirectService, - requestPreviewService, - requestMemberAccessService, - apiContentPathResolver) - { - } - - [ActivatorUtilitiesConstructor] public ByRouteContentApiController( IApiPublishedContentCache apiPublishedContentCache, IApiContentResponseBuilder apiContentResponseBuilder, @@ -75,16 +32,6 @@ public class ByRouteContentApiController : ContentApiItemControllerBase _apiContentPathResolver = apiContentPathResolver; } - [HttpGet("item/{*path}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IApiContentResponse), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status401Unauthorized)] - [ProducesResponseType(StatusCodes.Status403Forbidden)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - [Obsolete("Please use version 2 of this API. Will be removed in V15.")] - public async Task ByRoute(string path = "") - => await HandleRequest(path); - /// /// Gets a content item by route. /// diff --git a/src/Umbraco.Cms.Api.Delivery/Controllers/Content/QueryContentApiController.cs b/src/Umbraco.Cms.Api.Delivery/Controllers/Content/QueryContentApiController.cs index bfa45f23ec..c46329d914 100644 --- a/src/Umbraco.Cms.Api.Delivery/Controllers/Content/QueryContentApiController.cs +++ b/src/Umbraco.Cms.Api.Delivery/Controllers/Content/QueryContentApiController.cs @@ -12,7 +12,6 @@ using Umbraco.Extensions; namespace Umbraco.Cms.Api.Delivery.Controllers.Content; -[ApiVersion("1.0")] [ApiVersion("2.0")] public class QueryContentApiController : ContentApiControllerBase { @@ -30,20 +29,6 @@ public class QueryContentApiController : ContentApiControllerBase _requestMemberAccessService = requestMemberAccessService; } - [HttpGet] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - [Obsolete("Please use version 2 of this API. Will be removed in V15.")] - public async Task Query( - string? fetch, - [FromQuery] string[] filter, - [FromQuery] string[] sort, - int skip = 0, - int take = 10) - => await HandleRequest(fetch, filter, sort, skip, take); - /// /// Gets a paginated list of content item(s) from query. /// diff --git a/src/Umbraco.Cms.Api.Delivery/Controllers/Media/ByIdMediaApiController.cs b/src/Umbraco.Cms.Api.Delivery/Controllers/Media/ByIdMediaApiController.cs index d790f7f948..0c82a652ef 100644 --- a/src/Umbraco.Cms.Api.Delivery/Controllers/Media/ByIdMediaApiController.cs +++ b/src/Umbraco.Cms.Api.Delivery/Controllers/Media/ByIdMediaApiController.cs @@ -8,7 +8,6 @@ using Umbraco.Cms.Infrastructure.DeliveryApi; namespace Umbraco.Cms.Api.Delivery.Controllers.Media; -[ApiVersion("1.0")] [ApiVersion("2.0")] public class ByIdMediaApiController : MediaApiControllerBase { @@ -19,14 +18,6 @@ public class ByIdMediaApiController : MediaApiControllerBase { } - [HttpGet("item/{id:guid}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IApiMediaWithCropsResponse), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - [Obsolete("Please use version 2 of this API. Will be removed in V15.")] - public Task ById(Guid id) - => Task.FromResult(HandleRequest(id)); - /// /// Gets a media item by id. /// diff --git a/src/Umbraco.Cms.Api.Delivery/Controllers/Media/ByIdsMediaApiController.cs b/src/Umbraco.Cms.Api.Delivery/Controllers/Media/ByIdsMediaApiController.cs index 0bf4b89c12..45fad21cf9 100644 --- a/src/Umbraco.Cms.Api.Delivery/Controllers/Media/ByIdsMediaApiController.cs +++ b/src/Umbraco.Cms.Api.Delivery/Controllers/Media/ByIdsMediaApiController.cs @@ -9,7 +9,6 @@ using Umbraco.Extensions; namespace Umbraco.Cms.Api.Delivery.Controllers.Media; -[ApiVersion("1.0")] [ApiVersion("2.0")] public class ByIdsMediaApiController : MediaApiControllerBase { @@ -18,13 +17,6 @@ public class ByIdsMediaApiController : MediaApiControllerBase { } - [HttpGet("item")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - [Obsolete("Please use version 2 of this API. Will be removed in V15.")] - public Task Item([FromQuery(Name = "id")] HashSet ids) - => Task.FromResult(HandleRequest(ids)); - /// /// Gets media items by ids. /// diff --git a/src/Umbraco.Cms.Api.Delivery/Controllers/Media/ByPathMediaApiController.cs b/src/Umbraco.Cms.Api.Delivery/Controllers/Media/ByPathMediaApiController.cs index 982a727991..c2b91d0fd1 100644 --- a/src/Umbraco.Cms.Api.Delivery/Controllers/Media/ByPathMediaApiController.cs +++ b/src/Umbraco.Cms.Api.Delivery/Controllers/Media/ByPathMediaApiController.cs @@ -9,7 +9,6 @@ using Umbraco.Cms.Infrastructure.DeliveryApi; namespace Umbraco.Cms.Api.Delivery.Controllers.Media; -[ApiVersion("1.0")] [ApiVersion("2.0")] public class ByPathMediaApiController : MediaApiControllerBase { @@ -22,14 +21,6 @@ public class ByPathMediaApiController : MediaApiControllerBase : base(publishedMediaCache, apiMediaWithCropsResponseBuilder) => _apiMediaQueryService = apiMediaQueryService; - [HttpGet("item/{*path}")] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(IApiMediaWithCropsResponse), StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - [Obsolete("Please use version 2 of this API. Will be removed in V15.")] - public Task ByPath(string path) - => Task.FromResult(HandleRequest(path)); - /// /// Gets a media item by its path. /// diff --git a/src/Umbraco.Cms.Api.Delivery/Controllers/Media/QueryMediaApiController.cs b/src/Umbraco.Cms.Api.Delivery/Controllers/Media/QueryMediaApiController.cs index 0440126d63..7c7238c850 100644 --- a/src/Umbraco.Cms.Api.Delivery/Controllers/Media/QueryMediaApiController.cs +++ b/src/Umbraco.Cms.Api.Delivery/Controllers/Media/QueryMediaApiController.cs @@ -14,7 +14,6 @@ using Umbraco.Extensions; namespace Umbraco.Cms.Api.Delivery.Controllers.Media; -[ApiVersion("1.0")] [ApiVersion("2.0")] public class QueryMediaApiController : MediaApiControllerBase { @@ -27,19 +26,6 @@ public class QueryMediaApiController : MediaApiControllerBase : base(publishedMediaCache, apiMediaWithCropsResponseBuilder) => _apiMediaQueryService = apiMediaQueryService; - [HttpGet] - [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [Obsolete("Please use version 2 of this API. Will be removed in V15.")] - public Task Query( - string? fetch, - [FromQuery] string[] filter, - [FromQuery] string[] sort, - int skip = 0, - int take = 10) - => Task.FromResult(HandleRequest(fetch, filter, sort, skip, take)); - /// /// Gets a paginated list of media item(s) from query. /// diff --git a/src/Umbraco.Cms.Api.Delivery/Controllers/Security/MemberController.cs b/src/Umbraco.Cms.Api.Delivery/Controllers/Security/MemberController.cs index a5b085073b..139b9b2263 100644 --- a/src/Umbraco.Cms.Api.Delivery/Controllers/Security/MemberController.cs +++ b/src/Umbraco.Cms.Api.Delivery/Controllers/Security/MemberController.cs @@ -5,7 +5,6 @@ using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using OpenIddict.Abstractions; @@ -13,7 +12,6 @@ using OpenIddict.Server.AspNetCore; using Umbraco.Cms.Api.Delivery.Routing; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Security; using Umbraco.Cms.Web.Common.Security; using Umbraco.Extensions; @@ -33,31 +31,6 @@ public class MemberController : DeliveryApiControllerBase private readonly DeliveryApiSettings _deliveryApiSettings; private readonly ILogger _logger; - - [Obsolete("Please use the non-obsolete constructor. Will be removed in V16.")] - public MemberController( - IHttpContextAccessor httpContextAccessor, - IMemberSignInManager memberSignInManager, - IMemberManager memberManager, - IOptions deliveryApiSettings, - ILogger logger) - : this(memberSignInManager, memberManager, StaticServiceProvider.Instance.GetRequiredService(), deliveryApiSettings, logger) - { - } - - [Obsolete("Please use the non-obsolete constructor. Will be removed in V16.")] - public MemberController( - IHttpContextAccessor httpContextAccessor, - IMemberSignInManager memberSignInManager, - IMemberManager memberManager, - IMemberClientCredentialsManager memberClientCredentialsManager, - IOptions deliveryApiSettings, - ILogger logger) - : this(memberSignInManager, memberManager, memberClientCredentialsManager, deliveryApiSettings, logger) - { - } - - [ActivatorUtilitiesConstructor] public MemberController( IMemberSignInManager memberSignInManager, IMemberManager memberManager, diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/Collection/ByKeyDocumentCollectionController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/Collection/ByKeyDocumentCollectionController.cs index 6f2dd43824..f55c666cfc 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/Collection/ByKeyDocumentCollectionController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/Collection/ByKeyDocumentCollectionController.cs @@ -1,12 +1,10 @@ using Asp.Versioning; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Api.Common.ViewModels.Pagination; using Umbraco.Cms.Api.Management.Factories; using Umbraco.Cms.Api.Management.ViewModels.Document.Collection; using Umbraco.Cms.Core; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Mapping; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Security; @@ -22,20 +20,6 @@ public class ByKeyDocumentCollectionController : DocumentCollectionControllerBas private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; private readonly IDocumentCollectionPresentationFactory _documentCollectionPresentationFactory; - [Obsolete("Please use the constructor taking all parameters.")] - public ByKeyDocumentCollectionController( - IContentListViewService contentListViewService, - IBackOfficeSecurityAccessor backOfficeSecurityAccessor, - IUmbracoMapper mapper) - : this( - contentListViewService, - backOfficeSecurityAccessor, - mapper, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [ActivatorUtilitiesConstructor] public ByKeyDocumentCollectionController( IContentListViewService contentListViewService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor, diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/Item/SearchDocumentItemController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/Item/SearchDocumentItemController.cs index 840b1d2193..2c168b37e7 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/Item/SearchDocumentItemController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/Item/SearchDocumentItemController.cs @@ -21,28 +21,6 @@ public class SearchDocumentItemController : DocumentItemControllerBase _documentPresentationFactory = documentPresentationFactory; } - [NonAction] - [Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")] - public Task Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100) - => SearchFromParent(cancellationToken, query, skip, take); - - [NonAction] - [Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")] - public async Task SearchFromParent(CancellationToken cancellationToken, string query, int skip = 0, int take = 100, Guid? parentId = null) - => await SearchWithTrashed(cancellationToken, query, null, skip, take, parentId); - - [NonAction] - [Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")] - [ProducesResponseType(typeof(PagedModel), StatusCodes.Status200OK)] - public Task SearchFromParentWithAllowedTypes( - CancellationToken cancellationToken, - string query, - int skip = 0, - int take = 100, - Guid? parentId = null, - [FromQuery] IEnumerable? allowedDocumentTypes = null) - => SearchWithTrashed(cancellationToken, query, null, skip, take, parentId, allowedDocumentTypes); - [HttpGet("search")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(PagedModel), StatusCodes.Status200OK)] diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateUpdateDocumentController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateUpdateDocumentController.cs index 05f029f582..40df8d6a83 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateUpdateDocumentController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Document/ValidateUpdateDocumentController.cs @@ -1,4 +1,4 @@ -using Asp.Versioning; +using Asp.Versioning; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -11,7 +11,6 @@ using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Api.Management.Controllers.Document; -[ApiVersion("1.0")] [ApiVersion("1.1")] public class ValidateUpdateDocumentController : UpdateDocumentControllerBase { @@ -28,31 +27,6 @@ public class ValidateUpdateDocumentController : UpdateDocumentControllerBase _documentEditingPresentationFactory = documentEditingPresentationFactory; } - [HttpPut("{id:guid}/validate")] - [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] - [Obsolete("Please use version 1.1 of this API. Will be removed in V16.")] - public async Task Validate(CancellationToken cancellationToken, Guid id, UpdateDocumentRequestModel requestModel) - => await HandleRequest(id, requestModel, async () => - { - var validateUpdateDocumentRequestModel = new ValidateUpdateDocumentRequestModel - { - Values = requestModel.Values, - Variants = requestModel.Variants, - Template = requestModel.Template, - Cultures = null - }; - - ValidateContentUpdateModel model = _documentEditingPresentationFactory.MapValidateUpdateModel(validateUpdateDocumentRequestModel); - Attempt result = await _contentEditingService.ValidateUpdateAsync(id, model); - - return result.Success - ? Ok() - : DocumentEditingOperationStatusResult(result.Status, requestModel, result.Result); - }); - [HttpPut("{id:guid}/validate")] [MapToApiVersion("1.1")] [ProducesResponseType(StatusCodes.Status200OK)] diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/AllowedChildrenDocumentTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/AllowedChildrenDocumentTypeController.cs index f7403cb463..d44bd7ffd0 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/AllowedChildrenDocumentTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/AllowedChildrenDocumentTypeController.cs @@ -23,15 +23,6 @@ public class AllowedChildrenDocumentTypeController : DocumentTypeControllerBase _umbracoMapper = umbracoMapper; } - [NonAction] - [Obsolete("Use the non obsoleted method instead. Scheduled to be removed in v16")] - public async Task AllowedChildrenByKey( - CancellationToken cancellationToken, - Guid id, - int skip = 0, - int take = 100) - => await AllowedChildrenByKey(cancellationToken, id, null, skip, take); - [HttpGet("{id:guid}/allowed-children")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/ConfigurationDocumentTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/ConfigurationDocumentTypeController.cs index c1a4e41a75..74c5c58946 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/ConfigurationDocumentTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DocumentType/ConfigurationDocumentTypeController.cs @@ -1,14 +1,9 @@ -using Asp.Versioning; +using Asp.Versioning; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; using Umbraco.Cms.Api.Management.Factories; using Umbraco.Cms.Api.Management.ViewModels.DocumentType; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; -using Umbraco.Cms.Core.Features; using Umbraco.Cms.Web.Common.Authorization; namespace Umbraco.Cms.Api.Management.Controllers.DocumentType; @@ -19,30 +14,8 @@ public class ConfigurationDocumentTypeController : DocumentTypeControllerBase { private readonly IConfigurationPresentationFactory _configurationPresentationFactory; - [ActivatorUtilitiesConstructor] public ConfigurationDocumentTypeController(IConfigurationPresentationFactory configurationPresentationFactory) - { - _configurationPresentationFactory = configurationPresentationFactory; - } - - [Obsolete("Use the constructor that only accepts IConfigurationPresentationFactory, scheduled for removal in V16")] - public ConfigurationDocumentTypeController( - UmbracoFeatures umbracoFeatures, - IOptionsSnapshot dataTypesSettings, - IOptionsSnapshot segmentSettings, - IConfigurationPresentationFactory configurationPresentationFactory) - : this(configurationPresentationFactory) - { - } - - [Obsolete("Use the constructor that only accepts IConfigurationPresentationFactory, scheduled for removal in V16")] - public ConfigurationDocumentTypeController( - UmbracoFeatures umbracoFeatures, - IOptionsSnapshot dataTypesSettings, - IOptionsSnapshot segmentSettings) - : this(StaticServiceProvider.Instance.GetRequiredService()) - { - } + => _configurationPresentationFactory = configurationPresentationFactory; [HttpGet("configuration")] [MapToApiVersion("1.0")] diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DocumentVersion/RollbackDocumentVersionController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DocumentVersion/RollbackDocumentVersionController.cs index 1c024f3ef9..64f2f09bb3 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DocumentVersion/RollbackDocumentVersionController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DocumentVersion/RollbackDocumentVersionController.cs @@ -2,10 +2,8 @@ using Asp.Versioning; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Actions; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Security; using Umbraco.Cms.Core.Security.Authorization; @@ -23,7 +21,6 @@ public class RollbackDocumentVersionController : DocumentVersionControllerBase private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; private readonly IAuthorizationService _authorizationService; - [ActivatorUtilitiesConstructor] public RollbackDocumentVersionController( IContentVersionService contentVersionService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor, @@ -34,18 +31,6 @@ public class RollbackDocumentVersionController : DocumentVersionControllerBase _authorizationService = authorizationService; } - // TODO (V16): Remove this constructor. - [Obsolete("Please use the constructor taking all parameters. This constructor will be removed in V16.")] - public RollbackDocumentVersionController( - IContentVersionService contentVersionService, - IBackOfficeSecurityAccessor backOfficeSecurityAccessor) - : this( - contentVersionService, - backOfficeSecurityAccessor, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - [MapToApiVersion("1.0")] [HttpPost("{id:guid}/rollback")] [ProducesResponseType(StatusCodes.Status200OK)] diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/Collection/ByKeyMediaCollectionController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/Collection/ByKeyMediaCollectionController.cs index 6a37c2ad40..ba6eb5c8b3 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/Collection/ByKeyMediaCollectionController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Media/Collection/ByKeyMediaCollectionController.cs @@ -1,12 +1,10 @@ using Asp.Versioning; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Api.Common.ViewModels.Pagination; using Umbraco.Cms.Api.Management.Factories; using Umbraco.Cms.Api.Management.ViewModels.Media.Collection; using Umbraco.Cms.Core; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Mapping; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Security; @@ -22,20 +20,6 @@ public class ByKeyMediaCollectionController : MediaCollectionControllerBase private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; private readonly IMediaCollectionPresentationFactory _mediaCollectionPresentationFactory; - [Obsolete("Please use the constructor taking all parameters.")] - public ByKeyMediaCollectionController( - IMediaListViewService mediaListViewService, - IBackOfficeSecurityAccessor backOfficeSecurityAccessor, - IUmbracoMapper mapper) - : this( - mediaListViewService, - backOfficeSecurityAccessor, - mapper, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [ActivatorUtilitiesConstructor] public ByKeyMediaCollectionController( IMediaListViewService mediaListViewService, IBackOfficeSecurityAccessor backOfficeSecurityAccessor, diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/ConfigurationMediaController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/ConfigurationMediaController.cs index 0793dd64d3..9d61eac439 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/ConfigurationMediaController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Media/ConfigurationMediaController.cs @@ -1,4 +1,4 @@ -using Asp.Versioning; +using Asp.Versioning; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Umbraco.Cms.Api.Management.Factories; @@ -7,6 +7,7 @@ using Umbraco.Cms.Api.Management.ViewModels.Media; namespace Umbraco.Cms.Api.Management.Controllers.Media; [ApiVersion("1.0")] +[Obsolete("No longer used. Scheduled for removal in Umbraco 18.")] public class ConfigurationMediaController : MediaControllerBase { private readonly IConfigurationPresentationFactory _configurationPresentationFactory; diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Media/Item/SearchMediaItemController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Media/Item/SearchMediaItemController.cs index 0ae5b56755..33ec2436bb 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Media/Item/SearchMediaItemController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Media/Item/SearchMediaItemController.cs @@ -21,17 +21,6 @@ public class SearchMediaItemController : MediaItemControllerBase _mediaPresentationFactory = mediaPresentationFactory; } - [NonAction] - [Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")] - public async Task Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100) - => await SearchFromParent(cancellationToken, query, skip, take, null); - - [NonAction] - [Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")] - [ProducesResponseType(typeof(PagedModel), StatusCodes.Status200OK)] - public async Task SearchFromParent(CancellationToken cancellationToken, string query, int skip = 0, int take = 100, Guid? parentId = null) - => await SearchFromParentWithAllowedTypes(cancellationToken, query, skip, take, parentId); - [NonAction] [Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")] public Task SearchFromParentWithAllowedTypes(CancellationToken cancellationToken, string query, int skip = 0, int take = 100, Guid? parentId = null, [FromQuery]IEnumerable? allowedMediaTypes = null) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/AllowedChildrenMediaTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/MediaType/AllowedChildrenMediaTypeController.cs index 71ee63d6e3..1981332c68 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/MediaType/AllowedChildrenMediaTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/MediaType/AllowedChildrenMediaTypeController.cs @@ -23,15 +23,6 @@ public class AllowedChildrenMediaTypeController : MediaTypeControllerBase _umbracoMapper = umbracoMapper; } - [NonAction] - [Obsolete("Use the non obsoleted method instead. Scheduled for removal in Umbraco 16.")] - public async Task AllowedChildrenByKey( - CancellationToken cancellationToken, - Guid id, - int skip = 0, - int take = 100) - => await AllowedChildrenByKey(cancellationToken, id, null, skip, take); - [HttpGet("{id:guid}/allowed-children")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Member/Item/SearchMemberItemController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Member/Item/SearchMemberItemController.cs index eac1a3909e..077bdf5278 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Member/Item/SearchMemberItemController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Member/Item/SearchMemberItemController.cs @@ -21,11 +21,6 @@ public class SearchMemberItemController : MemberItemControllerBase _memberPresentationFactory = memberPresentationFactory; } - [NonAction] - [Obsolete("Scheduled to be removed in v16, use the non obsoleted method instead")] - public Task Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100) - => SearchWithAllowedTypes(cancellationToken, query, skip, take); - [HttpGet("search")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(PagedModel), StatusCodes.Status200OK)] diff --git a/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/BuildModelsBuilderController.cs b/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/BuildModelsBuilderController.cs index bd4af3e97b..bf6c52fbb6 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/BuildModelsBuilderController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/ModelsBuilder/BuildModelsBuilderController.cs @@ -19,7 +19,6 @@ public class BuildModelsBuilderController : ModelsBuilderControllerBase private readonly ModelsGenerationError _mbErrors; private readonly IModelsGenerator _modelGenerator; - [ActivatorUtilitiesConstructor] public BuildModelsBuilderController( IOptionsMonitor modelsBuilderSettings, ModelsGenerationError mbErrors, @@ -32,26 +31,6 @@ public class BuildModelsBuilderController : ModelsBuilderControllerBase modelsBuilderSettings.OnChange(x => _modelsBuilderSettings = x); } - [Obsolete("Please use the constructor that accepts IModelsGenerator only. Will be removed in V16.")] - public BuildModelsBuilderController( - IOptionsMonitor modelsBuilderSettings, - ModelsGenerationError mbErrors, - ModelsGenerator modelGenerator) - : this(modelsBuilderSettings, mbErrors, (IModelsGenerator)modelGenerator) - { - } - - // this constructor is required for the DI, otherwise it'll throw an "Ambiguous Constructor" errors at boot time. - [Obsolete("Please use the constructor that accepts IModelsGenerator only. Will be removed in V16.")] - public BuildModelsBuilderController( - IOptionsMonitor modelsBuilderSettings, - ModelsGenerationError mbErrors, - IModelsGenerator modelGenerator, - ModelsGenerator notUsed) - : this(modelsBuilderSettings, mbErrors, modelGenerator) - { - } - [HttpPost("build")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status428PreconditionRequired)] 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 ef759ca5a4..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/CollectPublishedCacheController.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Asp.Versioning; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -namespace Umbraco.Cms.Api.Management.Controllers.PublishedCache; - -[Obsolete("This controller no longer serves a purpose")] -[ApiVersion("1.0")] -public class CollectPublishedCacheController : PublishedCacheControllerBase -{ - [HttpPost("collect")] - [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status501NotImplemented)] - public async Task Collect(CancellationToken cancellationToken) - { - return StatusCode(StatusCodes.Status501NotImplemented); - } -} 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 e4c287f762..0000000000 --- a/src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/StatusPublishedCacheController.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Asp.Versioning; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -namespace Umbraco.Cms.Api.Management.Controllers.PublishedCache; - -[ApiVersion("1.0")] -[Obsolete("This no longer relevant since snapshots are no longer used")] -public class StatusPublishedCacheController : PublishedCacheControllerBase -{ - [HttpGet("status")] - [MapToApiVersion("1.0")] - [ProducesResponseType(StatusCodes.Status501NotImplemented)] - public Task> Status(CancellationToken cancellationToken) - => Task.FromResult>(StatusCode(StatusCodes.Status501NotImplemented)); -} diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Server/ConfigurationServerController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Server/ConfigurationServerController.cs index 05c35f32cb..48a5c7d288 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Server/ConfigurationServerController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Server/ConfigurationServerController.cs @@ -1,13 +1,11 @@ -using Asp.Versioning; +using Asp.Versioning; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Umbraco.Cms.Api.Management.Security; using Umbraco.Cms.Api.Management.ViewModels.Server; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; namespace Umbraco.Cms.Api.Management.Controllers.Server; @@ -18,19 +16,6 @@ public class ConfigurationServerController : ServerControllerBase private readonly GlobalSettings _globalSettings; private readonly IBackOfficeExternalLoginProviders _externalLoginProviders; - [Obsolete("Use the constructor that accepts all arguments. Will be removed in V16.")] - public ConfigurationServerController(IOptions securitySettings) - : this(securitySettings, StaticServiceProvider.Instance.GetRequiredService>()) - { - } - - [Obsolete("Use the constructor that accepts all arguments. Will be removed in V16.")] - public ConfigurationServerController(IOptions securitySettings, IOptions globalSettings) - : this(securitySettings, globalSettings, StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [ActivatorUtilitiesConstructor] public ConfigurationServerController(IOptions securitySettings, IOptions globalSettings, IBackOfficeExternalLoginProviders externalLoginProviders) { _securitySettings = securitySettings.Value; diff --git a/src/Umbraco.Cms.Api.Management/Controllers/User/Current/ConfigurationCurrentUserController.cs b/src/Umbraco.Cms.Api.Management/Controllers/User/Current/ConfigurationCurrentUserController.cs index 5d368c42c6..6e93a1524f 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/User/Current/ConfigurationCurrentUserController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/User/Current/ConfigurationCurrentUserController.cs @@ -1,4 +1,4 @@ -using Asp.Versioning; +using Asp.Versioning; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -18,10 +18,10 @@ public class ConfigurationCurrentUserController : CurrentUserControllerBase [MapToApiVersion("1.0")] [HttpGet("configuration")] - [ProducesResponseType(typeof(CurrenUserConfigurationResponseModel), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(CurrentUserConfigurationResponseModel), StatusCodes.Status200OK)] public async Task Configuration(CancellationToken cancellationToken) { - CurrenUserConfigurationResponseModel model = await _userPresentationFactory.CreateCurrentUserConfigurationModelAsync(); + CurrentUserConfigurationResponseModel model = await _userPresentationFactory.CreateCurrentUserConfigurationModelAsync(); return Ok(model); } } diff --git a/src/Umbraco.Cms.Api.Management/DependencyInjection/SearchManagementBuilderExtensions.cs b/src/Umbraco.Cms.Api.Management/DependencyInjection/SearchManagementBuilderExtensions.cs index e229d51ee9..5852907b88 100644 --- a/src/Umbraco.Cms.Api.Management/DependencyInjection/SearchManagementBuilderExtensions.cs +++ b/src/Umbraco.Cms.Api.Management/DependencyInjection/SearchManagementBuilderExtensions.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Infrastructure.Examine; using Umbraco.Cms.Api.Management.Factories; @@ -17,8 +17,8 @@ public static class SearchManagementBuilderExtensions // Add factories builder.Services.AddTransient(); - builder.Services.AddTransient(); builder.Services.AddTransient(); + return builder; } } diff --git a/src/Umbraco.Cms.Api.Management/DependencyInjection/UmbracoBuilder.BackOffice.cs b/src/Umbraco.Cms.Api.Management/DependencyInjection/UmbracoBuilder.BackOffice.cs index c8114a6384..ef0a1548b8 100644 --- a/src/Umbraco.Cms.Api.Management/DependencyInjection/UmbracoBuilder.BackOffice.cs +++ b/src/Umbraco.Cms.Api.Management/DependencyInjection/UmbracoBuilder.BackOffice.cs @@ -32,7 +32,6 @@ public static partial class UmbracoBuilderExtensions .AddMembersIdentity() .AddUmbracoProfiler() .AddMvcAndRazor(configureMvc) - .AddWebServer() .AddRecurringBackgroundJobs() .AddUmbracoHybridCache() .AddDistributedCache() diff --git a/src/Umbraco.Cms.Api.Management/Factories/ConfigurationPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/ConfigurationPresentationFactory.cs index 7efc4ff90f..31c10ae4ca 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/ConfigurationPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/ConfigurationPresentationFactory.cs @@ -1,4 +1,3 @@ -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Umbraco.Cms.Api.Management.ViewModels.Document; using Umbraco.Cms.Api.Management.ViewModels.DocumentType; @@ -7,7 +6,6 @@ using Umbraco.Cms.Api.Management.ViewModels.MediaType; using Umbraco.Cms.Api.Management.ViewModels.Member; using Umbraco.Cms.Api.Management.ViewModels.MemberType; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Features; using Umbraco.Cms.Core.Services; @@ -35,21 +33,6 @@ public class ConfigurationPresentationFactory : IConfigurationPresentationFactor _segmentSettings = segmentSettings.Value; } - [Obsolete("Use the constructor with all dependencies")] - public ConfigurationPresentationFactory( - IReservedFieldNamesService reservedFieldNamesService, - IOptions contentSettings, - IOptions segmentSettings) - : this( - reservedFieldNamesService, - contentSettings, - segmentSettings, - StaticServiceProvider.Instance.GetRequiredService>(), - StaticServiceProvider.Instance.GetRequiredService() - ) - { - } - public DocumentConfigurationResponseModel CreateDocumentConfigurationResponseModel() => new() { @@ -57,7 +40,6 @@ public class ConfigurationPresentationFactory : IConfigurationPresentationFactor DisableUnpublishWhenReferenced = _contentSettings.DisableUnpublishWhenReferenced, AllowEditInvariantFromNonDefault = _contentSettings.AllowEditInvariantFromNonDefault, AllowNonExistingSegmentsCreation = _segmentSettings.AllowCreation, - ReservedFieldNames = _reservedFieldNamesService.GetDocumentReservedFieldNames(), }; public DocumentTypeConfigurationResponseModel CreateDocumentTypeConfigurationResponseModel() => @@ -70,10 +52,7 @@ public class ConfigurationPresentationFactory : IConfigurationPresentationFactor }; public MemberConfigurationResponseModel CreateMemberConfigurationResponseModel() => - new() - { - ReservedFieldNames = _reservedFieldNamesService.GetMemberReservedFieldNames(), - }; + new(); public MemberTypeConfigurationResponseModel CreateMemberTypeConfigurationResponseModel() => new() @@ -86,7 +65,6 @@ public class ConfigurationPresentationFactory : IConfigurationPresentationFactor { DisableDeleteWhenReferenced = _contentSettings.DisableDeleteWhenReferenced, DisableUnpublishWhenReferenced = _contentSettings.DisableUnpublishWhenReferenced, - ReservedFieldNames = _reservedFieldNamesService.GetMediaReservedFieldNames(), }; public MediaTypeConfigurationResponseModel CreateMediaTypeConfigurationResponseModel() => diff --git a/src/Umbraco.Cms.Api.Management/Factories/DataTypePresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/DataTypePresentationFactory.cs index 944cc7c5cd..d5967b532b 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/DataTypePresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/DataTypePresentationFactory.cs @@ -1,8 +1,5 @@ - -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Api.Management.ViewModels.DataType; using Umbraco.Cms.Core; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.PropertyEditors; using Umbraco.Cms.Core.Serialization; @@ -34,21 +31,6 @@ public class DataTypePresentationFactory : IDataTypePresentationFactory _timeProvider = timeProvider; } - [Obsolete("Use constructor that takes a TimeProvider")] - public DataTypePresentationFactory( - IDataTypeContainerService dataTypeContainerService, - PropertyEditorCollection propertyEditorCollection, - IDataValueEditorFactory dataValueEditorFactory, - IConfigurationEditorJsonSerializer configurationEditorJsonSerializer) - : this( - dataTypeContainerService, - propertyEditorCollection, - dataValueEditorFactory, - configurationEditorJsonSerializer, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - /// public async Task> CreateAsync(CreateDataTypeRequestModel requestModel) { diff --git a/src/Umbraco.Cms.Api.Management/Factories/DocumentUrlFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/DocumentUrlFactory.cs index ba6ebfaf9a..9982b653b9 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/DocumentUrlFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/DocumentUrlFactory.cs @@ -1,9 +1,6 @@ -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Api.Management.ViewModels.Document; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Routing; -using Umbraco.Cms.Core.Services; namespace Umbraco.Cms.Api.Management.Factories; @@ -12,23 +9,8 @@ public class DocumentUrlFactory : IDocumentUrlFactory private readonly IPublishedUrlInfoProvider _publishedUrlInfoProvider; - [Obsolete("Use the constructor that takes all dependencies, scheduled for removal in v16")] - public DocumentUrlFactory(IDocumentUrlService documentUrlService) - : this(StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [Obsolete("Use the constructor that takes all dependencies, scheduled for removal in v16")] - public DocumentUrlFactory(IDocumentUrlService documentUrlService, IPublishedUrlInfoProvider publishedUrlInfoProvider) - : this(publishedUrlInfoProvider) - { - - } - public DocumentUrlFactory(IPublishedUrlInfoProvider publishedUrlInfoProvider) - { - _publishedUrlInfoProvider = publishedUrlInfoProvider; - } + => _publishedUrlInfoProvider = publishedUrlInfoProvider; public async Task> CreateUrlsAsync(IContent content) { diff --git a/src/Umbraco.Cms.Api.Management/Factories/IConfigurationPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/IConfigurationPresentationFactory.cs index 3914a0e058..14870f0357 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/IConfigurationPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/IConfigurationPresentationFactory.cs @@ -1,4 +1,4 @@ -using Umbraco.Cms.Api.Management.ViewModels.Document; +using Umbraco.Cms.Api.Management.ViewModels.Document; using Umbraco.Cms.Api.Management.ViewModels.DocumentType; using Umbraco.Cms.Api.Management.ViewModels.Media; using Umbraco.Cms.Api.Management.ViewModels.MediaType; @@ -19,6 +19,7 @@ public interface IConfigurationPresentationFactory MemberTypeConfigurationResponseModel CreateMemberTypeConfigurationResponseModel() => throw new NotImplementedException(); + [Obsolete("No longer used. Scheduled for removal in Umbraco 18.")] MediaConfigurationResponseModel CreateMediaConfigurationResponseModel(); MediaTypeConfigurationResponseModel CreateMediaTypeConfigurationResponseModel() diff --git a/src/Umbraco.Cms.Api.Management/Factories/IUserPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/IUserPresentationFactory.cs index a1e8a79edf..ac33b042eb 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/IUserPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/IUserPresentationFactory.cs @@ -1,4 +1,4 @@ -using Umbraco.Cms.Api.Management.ViewModels.User; +using Umbraco.Cms.Api.Management.ViewModels.User; using Umbraco.Cms.Api.Management.ViewModels.User.Current; using Umbraco.Cms.Api.Management.ViewModels.User.Item; using Umbraco.Cms.Core.Models; @@ -22,7 +22,7 @@ public interface IUserPresentationFactory Task CreateUserConfigurationModelAsync(); - Task CreateCurrentUserConfigurationModelAsync(); + Task CreateCurrentUserConfigurationModelAsync(); UserItemResponseModel CreateItemResponseModel(IUser user); diff --git a/src/Umbraco.Cms.Api.Management/Factories/UserGroupPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/UserGroupPresentationFactory.cs index 794cfa9bd9..099074aba5 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/UserGroupPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/UserGroupPresentationFactory.cs @@ -1,10 +1,8 @@ -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Umbraco.Cms.Api.Management.Mapping; using Umbraco.Cms.Api.Management.ViewModels; using Umbraco.Cms.Api.Management.ViewModels.UserGroup; using Umbraco.Cms.Core; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Membership; using Umbraco.Cms.Core.Services; @@ -23,16 +21,6 @@ public class UserGroupPresentationFactory : IUserGroupPresentationFactory private readonly IPermissionPresentationFactory _permissionPresentationFactory; private readonly ILogger _logger; - [Obsolete("Use the new constructor instead, will be removed in v16.")] - public UserGroupPresentationFactory( - IEntityService entityService, - IShortStringHelper shortStringHelper, - ILanguageService languageService, - IPermissionPresentationFactory permissionPresentationFactory) - : this(entityService, shortStringHelper, languageService, permissionPresentationFactory, StaticServiceProvider.Instance.GetRequiredService>()) - { - } - public UserGroupPresentationFactory( IEntityService entityService, IShortStringHelper shortStringHelper, diff --git a/src/Umbraco.Cms.Api.Management/Factories/UserPresentationFactory.cs b/src/Umbraco.Cms.Api.Management/Factories/UserPresentationFactory.cs index baa67a3299..03994e1be7 100644 --- a/src/Umbraco.Cms.Api.Management/Factories/UserPresentationFactory.cs +++ b/src/Umbraco.Cms.Api.Management/Factories/UserPresentationFactory.cs @@ -136,12 +136,11 @@ public class UserPresentationFactory : IUserPresentationFactory return Task.FromResult(inviteModel); } - public Task CreateCurrentUserConfigurationModelAsync() + public Task CreateCurrentUserConfigurationModelAsync() { - var model = new CurrenUserConfigurationResponseModel + var model = new CurrentUserConfigurationResponseModel { KeepUserLoggedIn = _securitySettings.KeepUserLoggedIn, - UsernameIsEmail = _securitySettings.UsernameIsEmail, PasswordConfiguration = _passwordConfigurationPresentationFactory.CreatePasswordConfigurationResponseModel(), // You should not be able to change any password or set 2fa if any providers has deny local login set. diff --git a/src/Umbraco.Cms.Api.Management/Middleware/BackOfficeAuthorizationInitializationMiddleware.cs b/src/Umbraco.Cms.Api.Management/Middleware/BackOfficeAuthorizationInitializationMiddleware.cs index 7c6d109979..e4d3c236de 100644 --- a/src/Umbraco.Cms.Api.Management/Middleware/BackOfficeAuthorizationInitializationMiddleware.cs +++ b/src/Umbraco.Cms.Api.Management/Middleware/BackOfficeAuthorizationInitializationMiddleware.cs @@ -1,9 +1,8 @@ -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Hosting; using Umbraco.Cms.Core.Routing; using Umbraco.Cms.Core.Services; @@ -22,19 +21,6 @@ public class BackOfficeAuthorizationInitializationMiddleware : IMiddleware private readonly IRuntimeState _runtimeState; private readonly WebRoutingSettings _webRoutingSettings; - [Obsolete("Use the non-obsolete constructor. This will be removed in Umbraco 16.")] - public BackOfficeAuthorizationInitializationMiddleware( - UmbracoRequestPaths umbracoRequestPaths, - IServiceProvider serviceProvider, - IRuntimeState runtimeState) - : this( - umbracoRequestPaths, - serviceProvider, - runtimeState, - StaticServiceProvider.Instance.GetRequiredService>()) - { - } - [Obsolete("Use the non-obsolete constructor. This will be removed in Umbraco 17.")] public BackOfficeAuthorizationInitializationMiddleware( UmbracoRequestPaths umbracoRequestPaths, diff --git a/src/Umbraco.Cms.Api.Management/OpenApi.json b/src/Umbraco.Cms.Api.Management/OpenApi.json index e2f18da0cd..7a7bfbe316 100644 --- a/src/Umbraco.Cms.Api.Management/OpenApi.json +++ b/src/Umbraco.Cms.Api.Management/OpenApi.json @@ -9305,149 +9305,6 @@ ] } }, - "/umbraco/management/api/v1/document/{id}/validate": { - "put": { - "tags": [ - "Document" - ], - "operationId": "PutDocumentByIdValidate", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/UpdateDocumentRequestModel" - } - ] - } - }, - "text/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/UpdateDocumentRequestModel" - } - ] - } - }, - "application/*+json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/UpdateDocumentRequestModel" - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "OK", - "headers": { - "Umb-Notifications": { - "description": "The list of notifications produced during the request.", - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/NotificationHeaderModel" - }, - "nullable": true - } - } - } - }, - "400": { - "description": "Bad Request", - "headers": { - "Umb-Notifications": { - "description": "The list of notifications produced during the request.", - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/NotificationHeaderModel" - }, - "nullable": true - } - } - }, - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/ProblemDetails" - } - ] - } - } - } - }, - "404": { - "description": "Not Found", - "headers": { - "Umb-Notifications": { - "description": "The list of notifications produced during the request.", - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/NotificationHeaderModel" - }, - "nullable": true - } - } - }, - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/ProblemDetails" - } - ] - } - } - } - }, - "401": { - "description": "The resource is protected and requires an authentication token" - }, - "403": { - "description": "The authenticated user does not have access to this resource", - "headers": { - "Umb-Notifications": { - "description": "The list of notifications produced during the request.", - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/NotificationHeaderModel" - }, - "nullable": true - } - } - } - } - }, - "deprecated": true, - "security": [ - { - "Backoffice User": [ ] - } - ] - } - }, "/umbraco/management/api/v1.1/document/{id}/validate": { "put": { "tags": [ @@ -16956,6 +16813,7 @@ "description": "The authenticated user does not have access to this resource" } }, + "deprecated": true, "security": [ { "Backoffice User": [ ] @@ -22929,40 +22787,6 @@ ] } }, - "/umbraco/management/api/v1/published-cache/collect": { - "post": { - "tags": [ - "Published Cache" - ], - "operationId": "PostPublishedCacheCollect", - "responses": { - "501": { - "description": "Not Implemented", - "headers": { - "Umb-Notifications": { - "description": "The list of notifications produced during the request.", - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/NotificationHeaderModel" - }, - "nullable": true - } - } - } - }, - "401": { - "description": "The resource is protected and requires an authentication token" - } - }, - "deprecated": true, - "security": [ - { - "Backoffice User": [ ] - } - ] - } - }, "/umbraco/management/api/v1/published-cache/rebuild": { "post": { "tags": [ @@ -23061,28 +22885,6 @@ ] } }, - "/umbraco/management/api/v1/published-cache/status": { - "get": { - "tags": [ - "Published Cache" - ], - "operationId": "GetPublishedCacheStatus", - "responses": { - "501": { - "description": "Not Implemented" - }, - "401": { - "description": "The resource is protected and requires an authentication token" - } - }, - "deprecated": true, - "security": [ - { - "Backoffice User": [ ] - } - ] - } - }, "/umbraco/management/api/v1/redirect-management": { "get": { "tags": [ @@ -32118,7 +31920,7 @@ "schema": { "oneOf": [ { - "$ref": "#/components/schemas/CurrenUserConfigurationResponseModel" + "$ref": "#/components/schemas/CurrentUserConfigurationResponseModel" } ] } @@ -36063,23 +35865,18 @@ }, "additionalProperties": false }, - "CurrenUserConfigurationResponseModel": { + "CurrentUserConfigurationResponseModel": { "required": [ "allowChangePassword", "allowTwoFactor", "keepUserLoggedIn", - "passwordConfiguration", - "usernameIsEmail" + "passwordConfiguration" ], "type": "object", "properties": { "keepUserLoggedIn": { "type": "boolean" }, - "usernameIsEmail": { - "type": "boolean", - "deprecated": true - }, "passwordConfiguration": { "oneOf": [ { @@ -36939,8 +36736,7 @@ "allowEditInvariantFromNonDefault", "allowNonExistingSegmentsCreation", "disableDeleteWhenReferenced", - "disableUnpublishWhenReferenced", - "reservedFieldNames" + "disableUnpublishWhenReferenced" ], "type": "object", "properties": { @@ -36955,14 +36751,6 @@ }, "allowNonExistingSegmentsCreation": { "type": "boolean" - }, - "reservedFieldNames": { - "uniqueItems": true, - "type": "array", - "items": { - "type": "string" - }, - "deprecated": true } }, "additionalProperties": false @@ -39146,8 +38934,7 @@ "MediaConfigurationResponseModel": { "required": [ "disableDeleteWhenReferenced", - "disableUnpublishWhenReferenced", - "reservedFieldNames" + "disableUnpublishWhenReferenced" ], "type": "object", "properties": { @@ -39156,14 +38943,6 @@ }, "disableUnpublishWhenReferenced": { "type": "boolean" - }, - "reservedFieldNames": { - "uniqueItems": true, - "type": "array", - "items": { - "type": "string" - }, - "deprecated": true } }, "additionalProperties": false @@ -39991,20 +39770,7 @@ "additionalProperties": false }, "MemberConfigurationResponseModel": { - "required": [ - "reservedFieldNames" - ], "type": "object", - "properties": { - "reservedFieldNames": { - "uniqueItems": true, - "type": "array", - "items": { - "type": "string" - }, - "deprecated": true - } - }, "additionalProperties": false }, "MemberGroupItemResponseModel": { diff --git a/src/Umbraco.Cms.Api.Management/Security/BackOfficeSignInManager.cs b/src/Umbraco.Cms.Api.Management/Security/BackOfficeSignInManager.cs index e5c36cf77c..1695d0f1e1 100644 --- a/src/Umbraco.Cms.Api.Management/Security/BackOfficeSignInManager.cs +++ b/src/Umbraco.Cms.Api.Management/Security/BackOfficeSignInManager.cs @@ -2,12 +2,10 @@ using System.Security.Claims; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Security; @@ -50,37 +48,6 @@ public class BackOfficeSignInManager : UmbracoSignInManager claimsFactory, - IOptions optionsAccessor, - IOptions globalSettings, - ILogger> logger, - IAuthenticationSchemeProvider schemes, - IUserConfirmation confirmation, - IEventAggregator eventAggregator, - IOptions securitySettings) - : this( - userManager, - contextAccessor, - externalLogins, - claimsFactory, - optionsAccessor, - globalSettings, - logger, - schemes, - confirmation, - eventAggregator, - securitySettings, - StaticServiceProvider.Instance.GetRequiredService>(), - StaticServiceProvider.Instance.GetRequiredService() - ) - { - } - protected override string AuthenticationType => _backOfficeAuthenticationTypeSettings.Value.AuthenticationType; protected override string ExternalAuthenticationType => _backOfficeAuthenticationTypeSettings.Value.ExternalAuthenticationType; diff --git a/src/Umbraco.Cms.Api.Management/Security/ExternalSignInAutoLinkOptions.cs b/src/Umbraco.Cms.Api.Management/Security/ExternalSignInAutoLinkOptions.cs index c8fc4d6107..fd3dc4e232 100644 --- a/src/Umbraco.Cms.Api.Management/Security/ExternalSignInAutoLinkOptions.cs +++ b/src/Umbraco.Cms.Api.Management/Security/ExternalSignInAutoLinkOptions.cs @@ -17,7 +17,7 @@ public class ExternalSignInAutoLinkOptions /// Initializes a new instance of the class. /// /// - /// If null, the default will be the 'editor' group + /// If null, the default will be no groups. /// /// public ExternalSignInAutoLinkOptions( @@ -26,7 +26,7 @@ public class ExternalSignInAutoLinkOptions string? defaultCulture = null, bool allowManualLinking = true) { - DefaultUserGroups = defaultUserGroups ?? new[] { SecurityConstants.EditorGroupAlias }; + DefaultUserGroups = defaultUserGroups ?? []; AutoLinkExternalAccount = autoLinkExternalAccount; AllowManualLinking = allowManualLinking; _defaultCulture = defaultCulture; diff --git a/src/Umbraco.Cms.Api.Management/Security/TwoFactorLoginViewOptions.cs b/src/Umbraco.Cms.Api.Management/Security/TwoFactorLoginViewOptions.cs deleted file mode 100644 index d045797f10..0000000000 --- a/src/Umbraco.Cms.Api.Management/Security/TwoFactorLoginViewOptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Umbraco.Cms.Api.Management.Security; - -/// -/// Options used as named options for 2fa providers -/// -public class TwoFactorLoginViewOptions -{ - /// - /// Gets or sets the path of the view to show when setting up this 2fa provider - /// - [Obsolete("Register the view in the backoffice instead. This will be removed in version 15.")] - public string? SetupViewPath { get; set; } -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentConfigurationResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentConfigurationResponseModel.cs index f6673bcd5b..3fb63dadda 100644 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentConfigurationResponseModel.cs +++ b/src/Umbraco.Cms.Api.Management/ViewModels/Document/DocumentConfigurationResponseModel.cs @@ -1,4 +1,4 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Document; +namespace Umbraco.Cms.Api.Management.ViewModels.Document; public class DocumentConfigurationResponseModel { @@ -9,7 +9,4 @@ public class DocumentConfigurationResponseModel public required bool AllowEditInvariantFromNonDefault { get; set; } public required bool AllowNonExistingSegmentsCreation { get; set; } - - [Obsolete("Use DocumentTypeConfigurationResponseModel.ReservedFieldNames from the ConfigurationDocumentTypeController endpoint instead.")] - public required ISet ReservedFieldNames { get; set; } } diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Media/MediaConfigurationResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Media/MediaConfigurationResponseModel.cs index ff723b658f..913f245075 100644 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Media/MediaConfigurationResponseModel.cs +++ b/src/Umbraco.Cms.Api.Management/ViewModels/Media/MediaConfigurationResponseModel.cs @@ -1,11 +1,8 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Media; +namespace Umbraco.Cms.Api.Management.ViewModels.Media; public class MediaConfigurationResponseModel { public required bool DisableDeleteWhenReferenced { get; set; } public required bool DisableUnpublishWhenReferenced { get; set; } - - [Obsolete("Use MediaTypeConfigurationResponseModel.ReservedFieldNames from the ConfigurationMediaTypeController endpoint instead.")] - public required ISet ReservedFieldNames { get; set; } } diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Member/MemberConfigurationResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Member/MemberConfigurationResponseModel.cs index a3434583bd..701d1fbe69 100644 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Member/MemberConfigurationResponseModel.cs +++ b/src/Umbraco.Cms.Api.Management/ViewModels/Member/MemberConfigurationResponseModel.cs @@ -1,7 +1,6 @@ -namespace Umbraco.Cms.Api.Management.ViewModels.Member; +namespace Umbraco.Cms.Api.Management.ViewModels.Member; +[Obsolete("No longer used. Scheduled for removal in Umbraco 18.")] public class MemberConfigurationResponseModel { - [Obsolete("Use MemberTypeConfigurationResponseModel.ReservedFieldNames from the ConfigurationMemberTypeController endpoint instead.")] - public required ISet ReservedFieldNames { get; set; } } diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/Server/VersionResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/Server/VersionResponseModel.cs deleted file mode 100644 index d421d99095..0000000000 --- a/src/Umbraco.Cms.Api.Management/ViewModels/Server/VersionResponseModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Umbraco.Cms.Api.Management.ViewModels.Server; - -[Obsolete("Not used. Will be removed in V15.")] -public class VersionResponseModel -{ - [Required] - public string Version { get; set; } = string.Empty; -} diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/User/Current/CurrenUserConfigurationResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/User/Current/CurrentUserConfigurationResponseModel.cs similarity index 54% rename from src/Umbraco.Cms.Api.Management/ViewModels/User/Current/CurrenUserConfigurationResponseModel.cs rename to src/Umbraco.Cms.Api.Management/ViewModels/User/Current/CurrentUserConfigurationResponseModel.cs index e8621949d3..d0a26d92b8 100644 --- a/src/Umbraco.Cms.Api.Management/ViewModels/User/Current/CurrenUserConfigurationResponseModel.cs +++ b/src/Umbraco.Cms.Api.Management/ViewModels/User/Current/CurrentUserConfigurationResponseModel.cs @@ -2,14 +2,10 @@ using Umbraco.Cms.Api.Management.ViewModels.Security; namespace Umbraco.Cms.Api.Management.ViewModels.User.Current; -// TODO (V16): Correct the spelling on this class name, it should be CurrentUserConfigurationResponseModel. -public class CurrenUserConfigurationResponseModel +public class CurrentUserConfigurationResponseModel { public bool KeepUserLoggedIn { get; set; } - [Obsolete("Use the UserConfigurationResponseModel instead. This will be removed in V15.")] - public bool UsernameIsEmail { get; set; } - public required PasswordConfigurationResponseModel PasswordConfiguration { get; set; } public bool AllowChangePassword { get; set; } diff --git a/src/Umbraco.Core/Configuration/IConfigManipulator.cs b/src/Umbraco.Core/Configuration/IConfigManipulator.cs index 8f5e0c0472..3fde58c16e 100644 --- a/src/Umbraco.Core/Configuration/IConfigManipulator.cs +++ b/src/Umbraco.Core/Configuration/IConfigManipulator.cs @@ -2,30 +2,11 @@ namespace Umbraco.Cms.Core.Configuration; public interface IConfigManipulator { - [Obsolete("Use RemoveConnectionStringAsync instead, scheduled for removal in V16.")] - void RemoveConnectionString(); - - [Obsolete("Use SaveConnectionStringAsync instead, scheduled for removal in V16.")] - void SaveConnectionString(string connectionString, string? providerName); - - [Obsolete("Use SaveConfigValueAsync instead, scheduled for removal in V16.")] - void SaveConfigValue(string itemPath, object value); - - [Obsolete("Use SaveDisableRedirectUrlTrackingAsync instead, scheduled for removal in V16.")] - void SaveDisableRedirectUrlTracking(bool disable); - - [Obsolete("Use SetGlobalIdAsync instead, scheduled for removal in V16.")] - void SetGlobalId(string id); - /// /// Removes the connection string from the configuration file /// /// - Task RemoveConnectionStringAsync() - { - RemoveConnectionString(); - return Task.CompletedTask; - } + Task RemoveConnectionStringAsync(); /// /// Saves the connection string to the configuration file @@ -33,11 +14,7 @@ public interface IConfigManipulator /// /// /// - Task SaveConnectionStringAsync(string connectionString, string? providerName) - { - SaveConnectionString(connectionString, providerName); - return Task.CompletedTask; - } + Task SaveConnectionStringAsync(string connectionString, string? providerName); /// /// Updates a value in the configuration file. @@ -46,11 +23,7 @@ public interface IConfigManipulator /// Path to update, uses : as the separator. /// The new value. /// - Task SaveConfigValueAsync(string itemPath, object value) - { - SaveConfigValue(itemPath, value); - return Task.CompletedTask; - } + Task SaveConfigValueAsync(string itemPath, object value); /// /// Updates the disableRedirectUrlTracking value in the configuration file. @@ -60,11 +33,7 @@ public interface IConfigManipulator /// /// The value to save. /// - Task SaveDisableRedirectUrlTrackingAsync(bool disable) - { - SaveDisableRedirectUrlTracking(disable); - return Task.CompletedTask; - } + Task SaveDisableRedirectUrlTrackingAsync(bool disable); /// /// Sets the global id in the configuration file. @@ -74,9 +43,5 @@ public interface IConfigManipulator /// /// The ID to save. /// - Task SetGlobalIdAsync(string id) - { - SetGlobalId(id); - return Task.CompletedTask; - } + Task SetGlobalIdAsync(string id); } diff --git a/src/Umbraco.Core/Configuration/Models/ContentDashboardSettings.cs b/src/Umbraco.Core/Configuration/Models/ContentDashboardSettings.cs deleted file mode 100644 index b11dcd246c..0000000000 --- a/src/Umbraco.Core/Configuration/Models/ContentDashboardSettings.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel; -using Umbraco.Cms.Core.Configuration.Models; - -namespace Umbraco.Cms.Core.Configuration; - -/// -/// Typed configuration options for content dashboard settings. -/// -[Obsolete("Scheduled for removal in v16, dashboard manipulation is now done trough frontend extensions.")] -[UmbracoOptions(Constants.Configuration.ConfigContentDashboard)] -public class ContentDashboardSettings -{ - private const string DefaultContentDashboardPath = "cms"; - - /// - /// Gets a value indicating whether the content dashboard should be available to all users. - /// - /// - /// true if the dashboard is visible for all user groups; otherwise, false - /// and the default access rules for that dashboard will be in use. - /// - public bool AllowContentDashboardAccessToAllUsers { get; set; } = true; - - /// - /// Gets the path to use when constructing the URL for retrieving data for the content dashboard. - /// - /// The URL path. - [DefaultValue(DefaultContentDashboardPath)] - public string ContentDashboardPath { get; set; } = DefaultContentDashboardPath; - - /// - /// Gets the allowed addresses to retrieve data for the content dashboard. - /// - public ISet ContentDashboardUrlAllowlist { get; set; } = new HashSet(); -} diff --git a/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs b/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs index 036f57074f..d02555c850 100644 --- a/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs @@ -25,7 +25,6 @@ public class GlobalSettings internal const string StaticUmbracoCssPath = "~/css"; internal const string StaticUmbracoScriptsPath = "~/scripts"; internal const string StaticUmbracoMediaPath = "~/media"; - internal const bool StaticInstallMissingDatabase = false; internal const bool StaticDisableElectionForSingleServer = false; internal const string StaticNoNodesViewPath = "~/umbraco/UmbracoWebsite/NoNodes.cshtml"; internal const string StaticDistributedLockingReadLockDefaultTimeout = "00:01:00"; @@ -114,13 +113,6 @@ public class GlobalSettings /// public string UmbracoMediaPhysicalRootPath { get; set; } = null!; - /// - /// Gets or sets a value indicating whether to install the database when it is missing. - /// - [Obsolete("This option will be removed in V16.")] - [DefaultValue(StaticInstallMissingDatabase)] - public bool InstallMissingDatabase { get; set; } = StaticInstallMissingDatabase; - /// /// Gets or sets a value indicating whether to disable the election for a single server. /// diff --git a/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs b/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs index 0095a8f165..9a40e1d080 100644 --- a/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/NuCacheSettings.cs @@ -13,15 +13,8 @@ public class NuCacheSettings { internal const string StaticNuCacheSerializerType = "MessagePack"; internal const int StaticSqlPageSize = 1000; - internal const int StaticKitBatchSize = 1; internal const bool StaticUsePagedSqlQuery = true; - /// - /// Gets or sets a value defining the BTree block size. - /// - [Obsolete("This property is no longer used. Scheduled for removal in v16")] - public int? BTreeBlockSize { get; set; } - /// /// The serializer type that nucache uses to persist documents in the database. /// @@ -34,16 +27,6 @@ public class NuCacheSettings [DefaultValue(StaticSqlPageSize)] public int SqlPageSize { get; set; } = StaticSqlPageSize; - /// - /// The size to use for nucache Kit batches. Higher value means more content loaded into memory at a time. - /// - [DefaultValue(StaticKitBatchSize)] - [Obsolete("This property is no longer used")] - public int KitBatchSize { get; set; } = StaticKitBatchSize; - - [Obsolete("This property is no longer used")] - public bool UnPublishedContentCompression { get; set; } = false; - [DefaultValue(StaticUsePagedSqlQuery)] public bool UsePagedSqlQuery { get; set; } = true; } diff --git a/src/Umbraco.Core/Configuration/Models/RuntimeMinificationCacheBuster.cs b/src/Umbraco.Core/Configuration/Models/RuntimeMinificationCacheBuster.cs deleted file mode 100644 index b86b57ee3a..0000000000 --- a/src/Umbraco.Core/Configuration/Models/RuntimeMinificationCacheBuster.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Umbraco.Cms.Core.Configuration.Models; - -[Obsolete("Runtime minification is no longer supported. Will be removed entirely in V16.")] -public enum RuntimeMinificationCacheBuster -{ - Version, - AppDomain, - Timestamp, -} diff --git a/src/Umbraco.Core/Configuration/Models/RuntimeMinificationSettings.cs b/src/Umbraco.Core/Configuration/Models/RuntimeMinificationSettings.cs deleted file mode 100644 index cff3d9d5da..0000000000 --- a/src/Umbraco.Core/Configuration/Models/RuntimeMinificationSettings.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel; - -namespace Umbraco.Cms.Core.Configuration.Models; - -[Obsolete("Runtime minification is no longer supported. Will be removed entirely in V16.")] -[UmbracoOptions(Constants.Configuration.ConfigRuntimeMinification)] -public class RuntimeMinificationSettings -{ - internal const bool StaticUseInMemoryCache = false; - internal const string StaticCacheBuster = "Version"; - internal const string? StaticVersion = null; - - /// - /// Use in memory cache - /// - [DefaultValue(StaticUseInMemoryCache)] - public bool UseInMemoryCache { get; set; } = StaticUseInMemoryCache; - - /// - /// The cache buster type to use - /// - [DefaultValue(StaticCacheBuster)] - public RuntimeMinificationCacheBuster CacheBuster { get; set; } = Enum.Parse(StaticCacheBuster); - - /// - /// The unique version string used if CacheBuster is 'Version'. - /// - [DefaultValue(StaticVersion)] - public string? Version { get; set; } = StaticVersion; -} diff --git a/src/Umbraco.Core/Configuration/ModelsBuilderConfigExtensions.cs b/src/Umbraco.Core/Configuration/ModelsBuilderConfigExtensions.cs index 2cbfb547e1..b8ad9f099c 100644 --- a/src/Umbraco.Core/Configuration/ModelsBuilderConfigExtensions.cs +++ b/src/Umbraco.Core/Configuration/ModelsBuilderConfigExtensions.cs @@ -2,7 +2,6 @@ using Microsoft.Extensions.Hosting; using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.Exceptions; using Umbraco.Cms.Core.Extensions; -using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment; namespace Umbraco.Extensions; @@ -25,22 +24,6 @@ public static class ModelsBuilderConfigExtensions return _modelsDirectoryAbsolute; } - [Obsolete("Use the non obsoleted equivalent instead. Scheduled for removal in v16")] - public static string ModelsDirectoryAbsolute( - this ModelsBuilderSettings modelsBuilderConfig, - IHostingEnvironment hostingEnvironment) - { - if (_modelsDirectoryAbsolute is null) - { - var modelsDirectory = modelsBuilderConfig.ModelsDirectory; - var root = hostingEnvironment.MapPathContentRoot("~/"); - - _modelsDirectoryAbsolute = GetModelsDirectory(root, modelsDirectory, modelsBuilderConfig.AcceptUnsafeModelsDirectory); - } - - return _modelsDirectoryAbsolute; - } - // internal for tests internal static string GetModelsDirectory(string root, string config, bool acceptUnsafe) { diff --git a/src/Umbraco.Core/Constants-Configuration.cs b/src/Umbraco.Core/Constants-Configuration.cs index 60b3397eeb..7b6494ac24 100644 --- a/src/Umbraco.Core/Constants-Configuration.cs +++ b/src/Umbraco.Core/Constants-Configuration.cs @@ -48,10 +48,6 @@ public static partial class Constants public const string ConfigRequestHandler = ConfigPrefix + "RequestHandler"; public const string ConfigRuntime = ConfigPrefix + "Runtime"; public const string ConfigRuntimeMode = ConfigRuntime + ":Mode"; - [Obsolete("Runtime minification is no longer supported. Will be removed entirely in V16.")] - public const string ConfigRuntimeMinification = ConfigPrefix + "RuntimeMinification"; - [Obsolete("Runtime minification is no longer supported. Will be removed entirely in V16.")] - public const string ConfigRuntimeMinificationVersion = ConfigRuntimeMinification + ":Version"; public const string ConfigSecurity = ConfigPrefix + "Security"; public const string ConfigBasicAuth = ConfigPrefix + "BasicAuth"; public const string ConfigTypeFinder = ConfigPrefix + "TypeFinder"; diff --git a/src/Umbraco.Core/Constants-HealthChecks.cs b/src/Umbraco.Core/Constants-HealthChecks.cs index d4b35f4e04..703b5017cf 100644 --- a/src/Umbraco.Core/Constants-HealthChecks.cs +++ b/src/Umbraco.Core/Constants-HealthChecks.cs @@ -49,8 +49,6 @@ public static partial class Constants public const string ClickJackingCheck = "https://umbra.co/healthchecks-click-jacking"; public const string HstsCheck = "https://umbra.co/healthchecks-hsts"; public const string NoSniffCheck = "https://umbra.co/healthchecks-no-sniff"; - [Obsolete("This link is not used anymore in the XSS protected check.")] - public const string XssProtectionCheck = "https://umbra.co/healthchecks-xss-protection"; public const string ExcessiveHeadersCheck = "https://umbra.co/healthchecks-excessive-headers"; public const string CspHeaderCheck = "https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP"; diff --git a/src/Umbraco.Core/Constants-Icons.cs b/src/Umbraco.Core/Constants-Icons.cs index cf2c263d83..249abfadd2 100644 --- a/src/Umbraco.Core/Constants-Icons.cs +++ b/src/Umbraco.Core/Constants-Icons.cs @@ -114,12 +114,6 @@ public static partial class Constants /// public const string Package = "icon-box"; - /// - /// System packages icon. - /// - [Obsolete("Use Package icon instead.")] - public const string Packages = "icon-box"; - /// /// System property editor icon /// diff --git a/src/Umbraco.Core/Constants-Security.cs b/src/Umbraco.Core/Constants-Security.cs index df6f26ca1a..eb77642f1b 100644 --- a/src/Umbraco.Core/Constants-Security.cs +++ b/src/Umbraco.Core/Constants-Security.cs @@ -34,18 +34,6 @@ public static partial class Constants public const string AdminGroupAlias = "admin"; - [Obsolete("Use EditorGroupKey instead. Scheduled for removal in V15.")] - public const string EditorGroupAlias = "editor"; - - [Obsolete("Use SensitiveDataGroupKey instead. Scheduled for removal in V15.")] - public const string SensitiveDataGroupAlias = "sensitiveData"; - - [Obsolete("Use TranslatorGroupKey instead. Scheduled for removal in V15.")] - public const string TranslatorGroupAlias = "translator"; - - [Obsolete("Use WriterGroupKey instead. Scheduled for removal in V15.")] - public const string WriterGroupAlias = "writer"; - /// /// The key of the admin group /// diff --git a/src/Umbraco.Core/Constants-Telemetry.cs b/src/Umbraco.Core/Constants-Telemetry.cs index f1c6a6c52a..ced112d462 100644 --- a/src/Umbraco.Core/Constants-Telemetry.cs +++ b/src/Umbraco.Core/Constants-Telemetry.cs @@ -21,8 +21,6 @@ public static partial class Constants public static string OsLanguage = "OsLanguage"; public static string WebServer = "WebServer"; public static string ModelsBuilderMode = "ModelBuilderMode"; - [Obsolete($"UmbracoPath is no longer configurable, scheduled for removal in V12")] - public static string CustomUmbracoPath = "CustomUmbracoPath"; public static string AspEnvironment = "AspEnvironment"; public static string IsDebug = "IsDebug"; public static string DatabaseProvider = "DatabaseProvider"; diff --git a/src/Umbraco.Core/DeliveryApi/IApiRichTextElementParser.cs b/src/Umbraco.Core/DeliveryApi/IApiRichTextElementParser.cs index 4b1b1e92d3..a43fcd0a60 100644 --- a/src/Umbraco.Core/DeliveryApi/IApiRichTextElementParser.cs +++ b/src/Umbraco.Core/DeliveryApi/IApiRichTextElementParser.cs @@ -1,10 +1,9 @@ -using Umbraco.Cms.Core.Models.Blocks; +using Umbraco.Cms.Core.Models.Blocks; using Umbraco.Cms.Core.Models.DeliveryApi; namespace Umbraco.Cms.Core.DeliveryApi; public interface IApiRichTextElementParser { - IRichTextElement? Parse(string html, RichTextBlockModel? richTextBlockModel); } diff --git a/src/Umbraco.Core/DependencyInjection/IUmbracoBuilder.cs b/src/Umbraco.Core/DependencyInjection/IUmbracoBuilder.cs index 2629aceb6f..23f59d57b7 100644 --- a/src/Umbraco.Core/DependencyInjection/IUmbracoBuilder.cs +++ b/src/Umbraco.Core/DependencyInjection/IUmbracoBuilder.cs @@ -3,7 +3,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Composing; -using Umbraco.Cms.Core.Hosting; using Umbraco.Cms.Core.Logging; namespace Umbraco.Cms.Core.DependencyInjection; @@ -22,16 +21,6 @@ public interface IUmbracoBuilder /// ILoggerFactory BuilderLoggerFactory { get; } - /// - /// A hosting environment created specifically for the . This is NOT the same - /// instance that will be resolved from DI. Use only if required during configuration. - /// - /// - /// This may be null. - /// - [Obsolete("This property will be removed in a future version, please find an alternative approach.")] - IHostingEnvironment? BuilderHostingEnvironment { get; } - IProfiler Profiler { get; } AppCaches AppCaches { get; } diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs index f761007146..356cc4cd5b 100644 --- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs +++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs @@ -40,7 +40,6 @@ public static partial class UmbracoBuilderExtensions .Append() .Append() .Append() - .Append() /*.Append() // disabled, this is an odd finder */ .Append() .Append(); diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs index f5aad4d0fb..532dd90903 100644 --- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs +++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs @@ -79,10 +79,8 @@ public static partial class UmbracoBuilderExtensions .AddUmbracoOptions() .AddUmbracoOptions() .AddUmbracoOptions() - .AddUmbracoOptions() .AddUmbracoOptions() .AddUmbracoOptions() - .AddUmbracoOptions() .AddUmbracoOptions() .AddUmbracoOptions() .AddUmbracoOptions() diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs index 3d36c67d3a..57d486d467 100644 --- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs +++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs @@ -48,7 +48,6 @@ using Umbraco.Cms.Core.Telemetry; using Umbraco.Cms.Core.Templates; using Umbraco.Cms.Core.Web; using Umbraco.Extensions; -using Umbraco.Cms.Core.Services.Filters; namespace Umbraco.Cms.Core.DependencyInjection { @@ -65,10 +64,6 @@ namespace Umbraco.Cms.Core.DependencyInjection /// public ILoggerFactory BuilderLoggerFactory { get; } - /// - [Obsolete("Only here to comply with obsolete implementation. Scheduled for removal in v16")] - public IHostingEnvironment? BuilderHostingEnvironment { get; } - public IProfiler Profiler { get; } public AppCaches AppCaches { get; } @@ -77,33 +72,9 @@ namespace Umbraco.Cms.Core.DependencyInjection /// Initializes a new instance of the class primarily for testing. /// public UmbracoBuilder(IServiceCollection services, IConfiguration config, TypeLoader typeLoader) - : this(services, config, typeLoader, NullLoggerFactory.Instance, new NoopProfiler(), AppCaches.Disabled, null) + : this(services, config, typeLoader, NullLoggerFactory.Instance, new NoopProfiler(), AppCaches.Disabled) { } - /// - /// Initializes a new instance of the class. - /// - [Obsolete("Use a non obsolete constructor instead. Scheduled for removal in v16")] - public UmbracoBuilder( - IServiceCollection services, - IConfiguration config, - TypeLoader typeLoader, - ILoggerFactory loggerFactory, - IProfiler profiler, - AppCaches appCaches, - IHostingEnvironment? hostingEnvironment) - { - Services = services; - Config = config; - BuilderLoggerFactory = loggerFactory; - BuilderHostingEnvironment = hostingEnvironment; - Profiler = profiler; - AppCaches = appCaches; - TypeLoader = typeLoader; - - AddCoreServices(); - } - /// /// Initializes a new instance of the class. /// @@ -399,7 +370,6 @@ namespace Umbraco.Cms.Core.DependencyInjection Services.AddUnique(provider => new CultureImpactFactory(provider.GetRequiredService>())); Services.AddUnique(); - Services.AddUnique(); Services.AddUnique(); // Register filestream security analyzers diff --git a/src/Umbraco.Core/Handlers/AuditNotificationsHandler.cs b/src/Umbraco.Core/Handlers/AuditNotificationsHandler.cs index 89b15d7f37..0edd217540 100644 --- a/src/Umbraco.Core/Handlers/AuditNotificationsHandler.cs +++ b/src/Umbraco.Core/Handlers/AuditNotificationsHandler.cs @@ -1,8 +1,6 @@ using System.Text; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Entities; @@ -55,28 +53,6 @@ public sealed class AuditNotificationsHandler : _globalSettings = globalSettings.CurrentValue; } - [Obsolete("Use constructor that takes IUserGroupService, scheduled for removal in V15.")] - public AuditNotificationsHandler( - IAuditService auditService, - IUserService userService, - IEntityService entityService, - IIpResolver ipResolver, - IOptionsMonitor globalSettings, - IBackOfficeSecurityAccessor backOfficeSecurityAccessor, - IMemberService memberService) - : this( - auditService, - userService, - entityService, - ipResolver, - globalSettings, - backOfficeSecurityAccessor, - memberService, - StaticServiceProvider.Instance.GetRequiredService() - ) - { - } - private IUser CurrentPerformingUser { get diff --git a/src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs b/src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs index 751998c85a..5de27027d5 100644 --- a/src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs +++ b/src/Umbraco.Core/HealthChecks/Checks/Security/BaseHttpHeaderCheck.cs @@ -20,19 +20,6 @@ public abstract class BaseHttpHeaderCheck : HealthCheck private readonly bool _metaTagOptionAvailable; private readonly bool _shouldNotExist; - /// - /// Initializes a new instance of the class. - /// - [Obsolete("Use constructor that takes all parameters instead.")] - protected BaseHttpHeaderCheck( - IHostingEnvironment hostingEnvironment, - ILocalizedTextService textService, - string header, - string localizedTextPrefix, - bool metaTagOptionAvailable) - : this(hostingEnvironment, textService, header, localizedTextPrefix, metaTagOptionAvailable, false) - { } - protected BaseHttpHeaderCheck( IHostingEnvironment hostingEnvironment, ILocalizedTextService textService, diff --git a/src/Umbraco.Core/HealthChecks/Checks/Security/ClickJackingCheck.cs b/src/Umbraco.Core/HealthChecks/Checks/Security/ClickJackingCheck.cs index 2d15e49e6a..0936ee5fd4 100644 --- a/src/Umbraco.Core/HealthChecks/Checks/Security/ClickJackingCheck.cs +++ b/src/Umbraco.Core/HealthChecks/Checks/Security/ClickJackingCheck.cs @@ -20,7 +20,7 @@ public class ClickJackingCheck : BaseHttpHeaderCheck /// Initializes a new instance of the class. /// public ClickJackingCheck(IHostingEnvironment hostingEnvironment, ILocalizedTextService textService) - : base(hostingEnvironment, textService, "X-Frame-Options", "clickJacking", true) + : base(hostingEnvironment, textService, "X-Frame-Options", "clickJacking", true, false) { } diff --git a/src/Umbraco.Core/HealthChecks/Checks/Security/HstsCheck.cs b/src/Umbraco.Core/HealthChecks/Checks/Security/HstsCheck.cs index 1535316fea..0f5427f7c9 100644 --- a/src/Umbraco.Core/HealthChecks/Checks/Security/HstsCheck.cs +++ b/src/Umbraco.Core/HealthChecks/Checks/Security/HstsCheck.cs @@ -33,7 +33,7 @@ public class HstsCheck : BaseHttpHeaderCheck /// but then you should include subdomains and I wouldn't suggest to do that for Umbraco-sites. /// public HstsCheck(IHostingEnvironment hostingEnvironment, ILocalizedTextService textService) - : base(hostingEnvironment, textService, "Strict-Transport-Security", LocalizationPrefix, true) + : base(hostingEnvironment, textService, "Strict-Transport-Security", LocalizationPrefix, true, false) { _hostingEnvironment = hostingEnvironment; _textService = textService; diff --git a/src/Umbraco.Core/HealthChecks/Checks/Security/NoSniffCheck.cs b/src/Umbraco.Core/HealthChecks/Checks/Security/NoSniffCheck.cs index b36201d5aa..46fa379cd7 100644 --- a/src/Umbraco.Core/HealthChecks/Checks/Security/NoSniffCheck.cs +++ b/src/Umbraco.Core/HealthChecks/Checks/Security/NoSniffCheck.cs @@ -20,7 +20,7 @@ public class NoSniffCheck : BaseHttpHeaderCheck /// Initializes a new instance of the class. /// public NoSniffCheck(IHostingEnvironment hostingEnvironment, ILocalizedTextService textService) - : base(hostingEnvironment, textService, "X-Content-Type-Options", "noSniff", false) + : base(hostingEnvironment, textService, "X-Content-Type-Options", "noSniff", false, false) { } diff --git a/src/Umbraco.Core/IO/MediaFileManager.cs b/src/Umbraco.Core/IO/MediaFileManager.cs index f67c5363c1..fe9f829567 100644 --- a/src/Umbraco.Core/IO/MediaFileManager.cs +++ b/src/Umbraco.Core/IO/MediaFileManager.cs @@ -31,18 +31,6 @@ public sealed class MediaFileManager FileSystem = fileSystem; } - [Obsolete("Use the ctr that doesn't include unused parameters.")] - public MediaFileManager( - IFileSystem fileSystem, - IMediaPathScheme mediaPathScheme, - ILogger logger, - IShortStringHelper shortStringHelper, - IServiceProvider serviceProvider, - IOptions contentSettings) - : this(fileSystem, mediaPathScheme, logger, shortStringHelper, serviceProvider) - { - } - /// /// Gets the media filesystem. /// diff --git a/src/Umbraco.Core/IO/ViewHelper.cs b/src/Umbraco.Core/IO/ViewHelper.cs index 059ce2a2e9..49c608ce7c 100644 --- a/src/Umbraco.Core/IO/ViewHelper.cs +++ b/src/Umbraco.Core/IO/ViewHelper.cs @@ -18,14 +18,6 @@ public class ViewHelper : IViewHelper _defaultViewContentProvider = defaultViewContentProvider ?? throw new ArgumentNullException(nameof(defaultViewContentProvider)); } - [Obsolete("Inject IDefaultViewContentProvider instead")] - public static string GetDefaultFileContent(string? layoutPageAlias = null, string? modelClassName = null, string? modelNamespace = null, string? modelNamespaceAlias = null) - { - IDefaultViewContentProvider viewContentProvider = - StaticServiceProvider.Instance.GetRequiredService(); - return viewContentProvider.GetDefaultFileContent(layoutPageAlias, modelClassName, modelNamespace, modelNamespaceAlias); - } - public bool ViewExists(ITemplate t) => t.Alias is not null && _viewFileSystem.FileExists(ViewPath(t.Alias)); public string GetFileContents(ITemplate t) diff --git a/src/Umbraco.Core/Media/EmbedProviders/DailyMotion.cs b/src/Umbraco.Core/Media/EmbedProviders/DailyMotion.cs index 0f2abd3b8e..2ce637cd7b 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/DailyMotion.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/DailyMotion.cs @@ -25,18 +25,4 @@ public class DailyMotion : OEmbedProviderBase public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) => await GetXmlBasedMarkupAsync(url, maxWidth, maxHeight, cancellationToken); - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - - public override async Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - { - var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight); - XmlDocument xmlDocument = await base.GetXmlResponseAsync(requestUrl, cancellationToken); - - return GetXmlProperty(xmlDocument, "/oembed/html"); - } - - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); } diff --git a/src/Umbraco.Core/Media/EmbedProviders/Flickr.cs b/src/Umbraco.Core/Media/EmbedProviders/Flickr.cs index 0d7d8b3a0f..4d10b9db98 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Flickr.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Flickr.cs @@ -20,10 +20,6 @@ public class Flickr : OEmbedProviderBase public override Dictionary RequestParams => new(); - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) { var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight); @@ -36,8 +32,4 @@ public class Flickr : OEmbedProviderBase return string.Format("\"{3}\"", imageUrl, imageWidth, imageHeight, WebUtility.HtmlEncode(imageTitle)); } - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - public override async Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - => await GetMarkupAsync(url, maxWidth, maxHeight, cancellationToken); } diff --git a/src/Umbraco.Core/Media/EmbedProviders/GettyImages.cs b/src/Umbraco.Core/Media/EmbedProviders/GettyImages.cs index 41364111af..5c48c31fc6 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/GettyImages.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/GettyImages.cs @@ -20,19 +20,6 @@ public class GettyImages : OEmbedProviderBase public override Dictionary RequestParams => new(); - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) => await GetJsonBasedMarkupAsync(url, maxWidth, maxHeight, cancellationToken); - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - public override async Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - { - var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight); - OEmbedResponse? oembed = await base.GetJsonResponseAsync(requestUrl, cancellationToken); - - return oembed?.GetHtml(); - } } diff --git a/src/Umbraco.Core/Media/EmbedProviders/Giphy.cs b/src/Umbraco.Core/Media/EmbedProviders/Giphy.cs index 1e8b2c96c8..0ec933f5be 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Giphy.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Giphy.cs @@ -18,19 +18,6 @@ public class Giphy : OEmbedProviderBase public override Dictionary RequestParams => new(); - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) => await GetJsonBasedMarkupAsync(url, maxWidth, maxHeight, cancellationToken); - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - public override async Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - { - var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight); - OEmbedResponse? oembed = await base.GetJsonResponseAsync(requestUrl, cancellationToken); - - return oembed?.GetHtml(); - } } diff --git a/src/Umbraco.Core/Media/EmbedProviders/Hulu.cs b/src/Umbraco.Core/Media/EmbedProviders/Hulu.cs index 4e4d53e6ad..fee7bb6d98 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Hulu.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Hulu.cs @@ -18,19 +18,6 @@ public class Hulu : OEmbedProviderBase public override Dictionary RequestParams => new(); - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) => await GetJsonBasedMarkupAsync(url, maxWidth, maxHeight, cancellationToken); - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - public override async Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - { - var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight); - OEmbedResponse? oembed = await base.GetJsonResponseAsync(requestUrl, cancellationToken); - - return oembed?.GetHtml(); - } } diff --git a/src/Umbraco.Core/Media/EmbedProviders/Issuu.cs b/src/Umbraco.Core/Media/EmbedProviders/Issuu.cs index 42120b70c5..c98887849c 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Issuu.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Issuu.cs @@ -26,19 +26,6 @@ public class Issuu : OEmbedProviderBase { "format", "xml" }, }; - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) => await GetXmlBasedMarkupAsync(url, maxWidth, maxHeight, cancellationToken); - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - public override async Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - { - var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight); - XmlDocument xmlDocument = await base.GetXmlResponseAsync(requestUrl, cancellationToken); - - return GetXmlProperty(xmlDocument, "/oembed/html"); - } } diff --git a/src/Umbraco.Core/Media/EmbedProviders/Kickstarter.cs b/src/Umbraco.Core/Media/EmbedProviders/Kickstarter.cs index a54c03455f..ba4041c807 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Kickstarter.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Kickstarter.cs @@ -18,19 +18,6 @@ public class Kickstarter : OEmbedProviderBase public override Dictionary RequestParams => new(); - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) => await GetJsonBasedMarkupAsync(url, maxWidth, maxHeight, cancellationToken); - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - public override async Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - { - var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight); - OEmbedResponse? oembed = await base.GetJsonResponseAsync(requestUrl, cancellationToken); - - return oembed?.GetHtml(); - } } diff --git a/src/Umbraco.Core/Media/EmbedProviders/LottieFiles.cs b/src/Umbraco.Core/Media/EmbedProviders/LottieFiles.cs index 8ce00feea7..7da886d495 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/LottieFiles.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/LottieFiles.cs @@ -19,10 +19,6 @@ public class LottieFiles : OEmbedProviderBase public override Dictionary RequestParams => new(); - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) { var requestUrl = GetEmbedProviderUrl(url, maxWidth, maxHeight); @@ -51,12 +47,4 @@ public class LottieFiles : OEmbedProviderBase return html; } - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - public override async Task GeOEmbedDataAsync( - string url, - int? maxWidth, - int? maxHeight, - CancellationToken cancellationToken) - => await GetMarkupAsync(url, maxWidth, maxHeight, cancellationToken); } diff --git a/src/Umbraco.Core/Media/EmbedProviders/OEmbedProviderBase.cs b/src/Umbraco.Core/Media/EmbedProviders/OEmbedProviderBase.cs index 369b6d7249..00468a099c 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/OEmbedProviderBase.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/OEmbedProviderBase.cs @@ -18,15 +18,8 @@ public abstract class OEmbedProviderBase : IEmbedProvider public abstract Dictionary RequestParams { get; } - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public abstract string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0); - public abstract Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken); - [Obsolete("Cleanup, only proxied to by GetMarkupAsync implementations. Planned for removal in v16")] - public virtual Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - => Task.FromResult(GetMarkup(url, maxWidth ?? 0, maxHeight ?? 0)); - public virtual string GetEmbedProviderUrl(string url, int? maxWidth, int? maxHeight) => GetEmbedProviderUrl(url, maxWidth ?? 0, maxHeight ?? 0); public virtual string GetEmbedProviderUrl(string url, int maxWidth, int maxHeight) diff --git a/src/Umbraco.Core/Media/EmbedProviders/Slideshare.cs b/src/Umbraco.Core/Media/EmbedProviders/Slideshare.cs index f7b5a0830c..48de83aeb3 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Slideshare.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Slideshare.cs @@ -19,19 +19,6 @@ public class Slideshare : OEmbedProviderBase public override Dictionary RequestParams => new(); - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) => await GetXmlBasedMarkupAsync(url, maxWidth, maxHeight, cancellationToken); - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - public override async Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - { - var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight); - XmlDocument xmlDocument = await base.GetXmlResponseAsync(requestUrl, cancellationToken); - - return GetXmlProperty(xmlDocument, "/oembed/html"); - } } diff --git a/src/Umbraco.Core/Media/EmbedProviders/SoundCloud.cs b/src/Umbraco.Core/Media/EmbedProviders/SoundCloud.cs index ab8e7ab0a5..94a82f6957 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/SoundCloud.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/SoundCloud.cs @@ -19,20 +19,6 @@ public class Soundcloud : OEmbedProviderBase public override Dictionary RequestParams => new(); - - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) => await GetXmlBasedMarkupAsync(url, maxWidth, maxHeight, cancellationToken); - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - public override async Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - { - var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight); - XmlDocument xmlDocument = await base.GetXmlResponseAsync(requestUrl, cancellationToken); - - return GetXmlProperty(xmlDocument, "/oembed/html"); - } } diff --git a/src/Umbraco.Core/Media/EmbedProviders/Ted.cs b/src/Umbraco.Core/Media/EmbedProviders/Ted.cs index a68df4f6fb..eb3fd3d110 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Ted.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Ted.cs @@ -19,20 +19,6 @@ public class Ted : OEmbedProviderBase public override Dictionary RequestParams => new(); - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) => await GetXmlBasedMarkupAsync(url, maxWidth, maxHeight, cancellationToken); - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - public override async Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - { - var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight); - XmlDocument xmlDocument = await base.GetXmlResponseAsync(requestUrl, cancellationToken); - - return GetXmlProperty(xmlDocument, "/oembed/html"); - } - } diff --git a/src/Umbraco.Core/Media/EmbedProviders/Twitter.cs b/src/Umbraco.Core/Media/EmbedProviders/Twitter.cs deleted file mode 100644 index 3b57f0c44d..0000000000 --- a/src/Umbraco.Core/Media/EmbedProviders/Twitter.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Umbraco.Cms.Core.Serialization; - -namespace Umbraco.Cms.Core.Media.EmbedProviders; - -/// -/// Embed Provider for Twitter the popular online service for microblogging and social networking. -/// -[Obsolete("Please use X instead, scheduled for removal in v16")] -public class Twitter : OEmbedProviderBase -{ - public Twitter(IJsonSerializer jsonSerializer) - : base(jsonSerializer) - { - } - - public override string ApiEndpoint => "http://publish.twitter.com/oembed"; - - public override string[] UrlSchemeRegex => new[] { @"twitter.com/.*/status/.*" }; - - public override Dictionary RequestParams => new(); - - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - => await GetJsonBasedMarkupAsync(url, maxWidth, maxHeight, cancellationToken); - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - public override async Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - { - var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight); - OEmbedResponse? oembed = await base.GetJsonResponseAsync(requestUrl, cancellationToken); - - return oembed?.GetHtml(); - } -} diff --git a/src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs b/src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs index 2f6816f4c1..d5f85f71dd 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs @@ -19,19 +19,6 @@ public class Vimeo : OEmbedProviderBase public override Dictionary RequestParams => new(); - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) => await GetXmlBasedMarkupAsync(url, maxWidth, maxHeight, cancellationToken); - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - public override async Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - { - var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight); - XmlDocument xmlDocument = await base.GetXmlResponseAsync(requestUrl, cancellationToken); - - return GetXmlProperty(xmlDocument, "/oembed/html"); - } } diff --git a/src/Umbraco.Core/Media/EmbedProviders/X.cs b/src/Umbraco.Core/Media/EmbedProviders/X.cs index 391796dc51..5d4852e722 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/X.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/X.cs @@ -18,10 +18,6 @@ public class X : OEmbedProviderBase public override Dictionary RequestParams => new(); - [Obsolete("Use GetMarkupAsync instead. This will be removed in v16.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) => await GetJsonBasedMarkupAsync(url, maxWidth, maxHeight, cancellationToken); } diff --git a/src/Umbraco.Core/Media/EmbedProviders/Youtube.cs b/src/Umbraco.Core/Media/EmbedProviders/Youtube.cs index ab093771d7..50dd1de659 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Youtube.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Youtube.cs @@ -22,19 +22,6 @@ public class YouTube : OEmbedProviderBase { "format", "json" }, }; - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - public override string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0) - => GetMarkupAsync(url, maxWidth, maxHeight, CancellationToken.None).GetAwaiter().GetResult(); - public override async Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) => await GetJsonBasedMarkupAsync(url, maxWidth, maxHeight, cancellationToken); - - [Obsolete("Use GetMarkupAsync instead. Planned for removal in v16")] - public override async Task GeOEmbedDataAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) - { - var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight); - OEmbedResponse? oembed = await base.GetJsonResponseAsync(requestUrl, cancellationToken); - - return oembed?.GetHtml(); - } } diff --git a/src/Umbraco.Core/Media/IEmbedProvider.cs b/src/Umbraco.Core/Media/IEmbedProvider.cs index 64e0947abd..aed82213bd 100644 --- a/src/Umbraco.Core/Media/IEmbedProvider.cs +++ b/src/Umbraco.Core/Media/IEmbedProvider.cs @@ -18,8 +18,5 @@ public interface IEmbedProvider /// ?key=value&key2=value2 Dictionary RequestParams { get; } - [Obsolete("Use GetMarkupAsync instead. This will be removed in Umbraco 15.")] - string? GetMarkup(string url, int maxWidth = 0, int maxHeight = 0); - - Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken) => Task.FromResult(GetMarkup(url, maxWidth ?? 0, maxHeight ?? 0)); + Task GetMarkupAsync(string url, int? maxWidth, int? maxHeight, CancellationToken cancellationToken); } diff --git a/src/Umbraco.Core/Models/Blocks/BlockEditorDataConverter.cs b/src/Umbraco.Core/Models/Blocks/BlockEditorDataConverter.cs index 5e263cf4c0..b3bc74e54c 100644 --- a/src/Umbraco.Core/Models/Blocks/BlockEditorDataConverter.cs +++ b/src/Umbraco.Core/Models/Blocks/BlockEditorDataConverter.cs @@ -2,8 +2,6 @@ // See LICENSE for more details. using System.Diagnostics.CodeAnalysis; -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Serialization; namespace Umbraco.Cms.Core.Models.Blocks; @@ -17,18 +15,6 @@ public abstract class BlockEditorDataConverter { private readonly IJsonSerializer _jsonSerializer; - [Obsolete("Use the non-obsolete constructor. Will be removed in V15.")] - protected BlockEditorDataConverter(string propertyEditorAlias) - : this(propertyEditorAlias, StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [Obsolete("Use the non-obsolete constructor. Will be removed in V15.")] - protected BlockEditorDataConverter(string propertyEditorAlias, IJsonSerializer jsonSerializer) - : this(jsonSerializer) - { - } - protected BlockEditorDataConverter(IJsonSerializer jsonSerializer) => _jsonSerializer = jsonSerializer; diff --git a/src/Umbraco.Core/Models/CacheSettings.cs b/src/Umbraco.Core/Models/CacheSettings.cs index e5c0d8827e..d80ab48c88 100644 --- a/src/Umbraco.Core/Models/CacheSettings.cs +++ b/src/Umbraco.Core/Models/CacheSettings.cs @@ -1,4 +1,4 @@ -using System.ComponentModel; +using System.ComponentModel; using Umbraco.Cms.Core.Configuration.Models; namespace Umbraco.Cms.Core.Models; @@ -8,7 +8,6 @@ public class CacheSettings { internal const int StaticDocumentBreadthFirstSeedCount = 100; internal const int StaticMediaBreadthFirstSeedCount = 100; - internal const string StaticSeedCacheDuration = "365.00:00:00"; /// /// Gets or sets a value for the collection of content type ids to always have in the cache. @@ -22,10 +21,6 @@ public class CacheSettings [DefaultValue(StaticMediaBreadthFirstSeedCount)] public int MediaBreadthFirstSeedCount { get; set; } = StaticDocumentBreadthFirstSeedCount; - [Obsolete("Use Cache:Entry:Document:SeedCacheDuration instead")] - [DefaultValue(StaticSeedCacheDuration)] - public TimeSpan SeedCacheDuration { get; set; } = TimeSpan.Parse(StaticSeedCacheDuration); - public CacheEntry Entry { get; set; } = new CacheEntry(); public class CacheEntry diff --git a/src/Umbraco.Core/Models/ContentRepositoryExtensions.cs b/src/Umbraco.Core/Models/ContentRepositoryExtensions.cs index 33a4566ce5..c922cea2b3 100644 --- a/src/Umbraco.Core/Models/ContentRepositoryExtensions.cs +++ b/src/Umbraco.Core/Models/ContentRepositoryExtensions.cs @@ -1,5 +1,3 @@ -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.PropertyEditors; @@ -290,10 +288,6 @@ public static class ContentRepositoryExtensions } } - [Obsolete("Please use the overload that accepts all parameters. Will be removed in V16.")] - public static bool PublishCulture(this IContent content, CultureImpact? impact) - => PublishCulture(content, impact, DateTime.Now, StaticServiceProvider.Instance.GetRequiredService()); - /// /// Sets the publishing values for names and properties. /// diff --git a/src/Umbraco.Core/Models/PropertyTagsExtensions.cs b/src/Umbraco.Core/Models/PropertyTagsExtensions.cs index 93df6818ab..9a39d19cd7 100644 --- a/src/Umbraco.Core/Models/PropertyTagsExtensions.cs +++ b/src/Umbraco.Core/Models/PropertyTagsExtensions.cs @@ -22,7 +22,7 @@ public static class PropertyTagsExtensions } IDataEditor? editor = propertyEditors[property.PropertyType?.PropertyEditorAlias]; - TagsPropertyEditorAttribute? tagAttribute = editor?.GetTagAttribute(); + TagsPropertyEditorAttribute? tagAttribute = GetTagAttribute(editor); var configurationObject = property.PropertyType is null ? null @@ -37,6 +37,9 @@ public static class PropertyTagsExtensions return configuration; } + private static TagsPropertyEditorAttribute? GetTagAttribute(IDataEditor? editor) + => editor?.GetType().GetCustomAttribute(false); + /// /// Assign tags. /// diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedDataType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedDataType.cs index f8f97da1b6..e9e51a49e1 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedDataType.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedDataType.cs @@ -18,12 +18,6 @@ public class PublishedDataType { private readonly Lazy _lazyConfiguration; - [Obsolete("Please use the constructor that accepts editor UI alias too. Scheduled for removal in V16.")] - public PublishedDataType(int id, string editorAlias, Lazy lazyConfiguration) - : this(id, editorAlias, editorAlias, lazyConfiguration) - { - } - /// /// Initializes a new instance of the class. /// diff --git a/src/Umbraco.Core/Models/UserExtensions.cs b/src/Umbraco.Core/Models/UserExtensions.cs index f001797a4e..1774c8db89 100644 --- a/src/Umbraco.Core/Models/UserExtensions.cs +++ b/src/Umbraco.Core/Models/UserExtensions.cs @@ -137,7 +137,7 @@ public static class UserExtensions throw new ArgumentNullException("user"); } - return user.Groups != null && user.Groups.Any(x => x.Alias == Constants.Security.SensitiveDataGroupAlias); + return user.Groups != null && user.Groups.Any(x => x.Key == Constants.Security.SensitiveDataGroupKey); } /// diff --git a/src/Umbraco.Core/MonitorLock.cs b/src/Umbraco.Core/MonitorLock.cs deleted file mode 100644 index 251f8a2812..0000000000 --- a/src/Umbraco.Core/MonitorLock.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace Umbraco.Cms.Core; - -/// -/// Provides an equivalent to the c# lock statement, to be used in a using block. -/// -/// Ie replace lock (o) {...} by using (new MonitorLock(o)) { ... } -[Obsolete("Use System.Threading.Lock instead. This will be removed in Umbraco 16")] -public class MonitorLock : IDisposable -{ - private readonly bool _entered; - private readonly object _locker; - - /// - /// Initializes a new instance of the class with an object to lock. - /// - /// The object to lock. - /// Should always be used within a using block. - public MonitorLock(object locker) - { - _locker = locker; - _entered = false; - Monitor.Enter(_locker, ref _entered); - } - - void IDisposable.Dispose() - { - if (_entered) - { - Monitor.Exit(_locker); - } - } -} diff --git a/src/Umbraco.Core/Persistence/Repositories/IDataTypeUsageRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IDataTypeUsageRepository.cs index 3c3b00e479..5de73ca05d 100644 --- a/src/Umbraco.Core/Persistence/Repositories/IDataTypeUsageRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/IDataTypeUsageRepository.cs @@ -2,7 +2,5 @@ namespace Umbraco.Cms.Core.Persistence.Repositories; public interface IDataTypeUsageRepository { - [Obsolete("Please use HasSavedValuesAsync. Scheduled for removable in Umbraco 15.")] - bool HasSavedValues(int dataTypeId); Task HasSavedValuesAsync(Guid dataTypeKey); } diff --git a/src/Umbraco.Core/Persistence/Repositories/IPropertyTypeUsageRepository.cs b/src/Umbraco.Core/Persistence/Repositories/IPropertyTypeUsageRepository.cs index fd34c3e7e8..7aa05fc1ff 100644 --- a/src/Umbraco.Core/Persistence/Repositories/IPropertyTypeUsageRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/IPropertyTypeUsageRepository.cs @@ -2,8 +2,6 @@ namespace Umbraco.Cms.Core.Persistence.Repositories; public interface IPropertyTypeUsageRepository { - [Obsolete("Please use HasSavedPropertyValuesAsync. Scheduled for removable in Umbraco 15.")] - bool HasSavedPropertyValues(string propertyTypeAlias); Task HasSavedPropertyValuesAsync(Guid contentTypeKey, string propertyAlias); Task ContentTypeExistAsync(Guid contentTypeKey); } diff --git a/src/Umbraco.Core/Persistence/Repositories/ITrackedReferencesRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ITrackedReferencesRepository.cs index 01bff9f356..c437d1df82 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ITrackedReferencesRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ITrackedReferencesRepository.cs @@ -4,52 +4,6 @@ namespace Umbraco.Cms.Core.Persistence.Repositories; public interface ITrackedReferencesRepository { - /// - /// Gets a page of items which are in relation with the current item. - /// Basically, shows the items which depend on the current item. - /// - /// The identifier of the entity to retrieve relations for. - /// The page index. - /// The page size. - /// - /// A boolean indicating whether to filter only the RelationTypes which are - /// dependencies (isDependency field is set to true). - /// - /// The total count of the items with reference to the current item. - /// An enumerable list of objects. - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - IEnumerable GetPagedRelationsForItem(int id, long pageIndex, int pageSize, bool filterMustBeIsDependency, out long totalRecords); - - /// - /// Gets a page of items used in any kind of relation from selected integer ids. - /// - /// The identifiers of the entities to check for relations. - /// The page index. - /// The page size. - /// - /// A boolean indicating whether to filter only the RelationTypes which are - /// dependencies (isDependency field is set to true). - /// - /// The total count of the items in any kind of relation. - /// An enumerable list of objects. - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - IEnumerable GetPagedItemsWithRelations(int[] ids, long pageIndex, int pageSize, bool filterMustBeIsDependency, out long totalRecords); - - /// - /// Gets a page of the descending items that have any references, given a parent id. - /// - /// The unique identifier of the parent to retrieve descendants for. - /// The page index. - /// The page size. - /// - /// A boolean indicating whether to filter only the RelationTypes which are - /// dependencies (isDependency field is set to true). - /// - /// The total count of descending items. - /// An enumerable list of objects. - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - IEnumerable GetPagedDescendantsInReferences(int parentId, long pageIndex, int pageSize, bool filterMustBeIsDependency, out long totalRecords); - /// /// Gets a page of items which are in relation with the current item. /// Basically, shows the items which depend on the current item. @@ -70,14 +24,6 @@ public interface ITrackedReferencesRepository bool filterMustBeIsDependency, out long totalRecords); - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - IEnumerable GetPagedRelationsForItem( - int id, - long skip, - long take, - bool filterMustBeIsDependency, - out long totalRecords); - /// /// Gets a page of items used in any kind of relation from selected integer ids. /// @@ -97,14 +43,6 @@ public interface ITrackedReferencesRepository bool filterMustBeIsDependency, out long totalRecords); - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - IEnumerable GetPagedItemsWithRelations( - int[] ids, - long skip, - long take, - bool filterMustBeIsDependency, - out long totalRecords); - /// /// Gets a page of the descending items that have any references, given a parent id. /// @@ -124,14 +62,6 @@ public interface ITrackedReferencesRepository bool filterMustBeIsDependency, out long totalRecords); - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - IEnumerable GetPagedDescendantsInReferences( - int parentId, - long skip, - long take, - bool filterMustBeIsDependency, - out long totalRecords); - Task> GetPagedNodeKeysWithDependantReferencesAsync( ISet keys, Guid nodeObjectTypeId, diff --git a/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs b/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs index 5f06db2b3c..211d36f65f 100644 --- a/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/DataValueEditor.cs @@ -1,4 +1,4 @@ -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.Globalization; using System.Runtime.Serialization; using System.Xml.Linq; @@ -9,7 +9,6 @@ using Umbraco.Cms.Core.Models.Editors; using Umbraco.Cms.Core.Models.Validation; using Umbraco.Cms.Core.PropertyEditors.Validators; using Umbraco.Cms.Core.Serialization; -using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Strings; using Umbraco.Extensions; @@ -24,26 +23,6 @@ public class DataValueEditor : IDataValueEditor private readonly IJsonSerializer? _jsonSerializer; private readonly IShortStringHelper _shortStringHelper; - [Obsolete($"Use the constructor that does not accept {nameof(ILocalizedTextService)}. Will be removed in V15.")] - public DataValueEditor( - ILocalizedTextService localizedTextService, - IShortStringHelper shortStringHelper, - IJsonSerializer? jsonSerializer) // for tests, and manifest - : this(shortStringHelper, jsonSerializer) - { - } - - [Obsolete($"Use the constructor that does not accept {nameof(ILocalizedTextService)}. Will be removed in V15.")] - public DataValueEditor( - ILocalizedTextService localizedTextService, - IShortStringHelper shortStringHelper, - IJsonSerializer jsonSerializer, - IIOHelper ioHelper, - DataEditorAttribute attribute) - : this(shortStringHelper, jsonSerializer, ioHelper, attribute) - { - } - /// /// Initializes a new instance of the class. /// diff --git a/src/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollection.cs b/src/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollection.cs index 86c9c48fc0..4a83a65405 100644 --- a/src/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollection.cs +++ b/src/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollection.cs @@ -114,9 +114,6 @@ public class DataValueReferenceFactoryCollection : BuilderCollectionBase /// All relation type aliases that are automatically tracked. /// - [Obsolete("Use GetAllAutomaticRelationTypesAliases. This will be removed in Umbraco 15.")] - public ISet GetAutomaticRelationTypesAliases(PropertyEditorCollection propertyEditors) => - GetAllAutomaticRelationTypesAliases(propertyEditors); public ISet GetAllAutomaticRelationTypesAliases(PropertyEditorCollection propertyEditors) { // Always add default automatic relation types @@ -130,23 +127,6 @@ public class DataValueReferenceFactoryCollection : BuilderCollectionBase GetAutomaticRelationTypesAliases(IPropertyCollection properties, PropertyEditorCollection propertyEditors) - { - // Always add default automatic relation types - var automaticRelationTypeAliases = new HashSet(Constants.Conventions.RelationTypes.AutomaticRelationTypes); - - // Only add relation types that are used in the properties - foreach (IProperty property in properties) - { - if (propertyEditors.TryGet(property.PropertyType.PropertyEditorAlias, out IDataEditor? dataEditor)) - { - automaticRelationTypeAliases.UnionWith(GetAutomaticRelationTypesAliasesEnumerable(dataEditor)); - } - } - - return automaticRelationTypeAliases; - } /// /// Gets the automatic relation types aliases. diff --git a/src/Umbraco.Core/PropertyEditors/DateValueEditor.cs b/src/Umbraco.Core/PropertyEditors/DateValueEditor.cs index 25cb2c42ed..d0c578d32b 100644 --- a/src/Umbraco.Core/PropertyEditors/DateValueEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/DateValueEditor.cs @@ -15,12 +15,11 @@ namespace Umbraco.Cms.Core.PropertyEditors; internal class DateValueEditor : DataValueEditor { public DateValueEditor( - ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, IJsonSerializer jsonSerializer, IIOHelper ioHelper, DataEditorAttribute attribute) - : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute) => + : base(shortStringHelper, jsonSerializer, ioHelper, attribute) => Validators.Add(new DateTimeValidator()); public override object ToEditor(IProperty property, string? culture = null, string? segment = null) diff --git a/src/Umbraco.Core/PropertyEditors/MarkDownPropertyValueEditor.cs b/src/Umbraco.Core/PropertyEditors/MarkDownPropertyValueEditor.cs index 9b8d5cffad..2a7a97b027 100644 --- a/src/Umbraco.Core/PropertyEditors/MarkDownPropertyValueEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/MarkDownPropertyValueEditor.cs @@ -1,4 +1,4 @@ -using Umbraco.Cms.Core.IO; +using Umbraco.Cms.Core.IO; using Umbraco.Cms.Core.Models.Editors; using Umbraco.Cms.Core.Security; using Umbraco.Cms.Core.Serialization; @@ -13,13 +13,12 @@ internal class MarkDownPropertyValueEditor : DataValueEditor private readonly IMarkdownSanitizer _markdownSanitizer; public MarkDownPropertyValueEditor( - ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, IJsonSerializer jsonSerializer, IIOHelper ioHelper, DataEditorAttribute attribute, IMarkdownSanitizer markdownSanitizer) - : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute) => _markdownSanitizer = markdownSanitizer; + : base(shortStringHelper, jsonSerializer, ioHelper, attribute) => _markdownSanitizer = markdownSanitizer; public override object? FromEditor(ContentPropertyData editorValue, object? currentValue) { diff --git a/src/Umbraco.Core/PropertyEditors/PropertyEditorTagsExtensions.cs b/src/Umbraco.Core/PropertyEditors/PropertyEditorTagsExtensions.cs deleted file mode 100644 index 8206ab538b..0000000000 --- a/src/Umbraco.Core/PropertyEditors/PropertyEditorTagsExtensions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Umbraco.Cms.Core.PropertyEditors; - -namespace Umbraco.Extensions; - -/// -/// Provides extension methods for the interface to manage tags. -/// -[Obsolete] -public static class PropertyEditorTagsExtensions -{ - /// - /// Determines whether an editor supports tags. - /// - public static bool IsTagsEditor(this IDataEditor editor) - => editor.GetTagAttribute() != null; - - /// - /// Gets the tags configuration attribute of an editor. - /// - public static TagsPropertyEditorAttribute? GetTagAttribute(this IDataEditor? editor) - => editor?.GetType().GetCustomAttribute(false); -} diff --git a/src/Umbraco.Core/PropertyEditors/RadioValueEditor.cs b/src/Umbraco.Core/PropertyEditors/RadioValueEditor.cs index 24ec00a215..1672c7b464 100644 --- a/src/Umbraco.Core/PropertyEditors/RadioValueEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/RadioValueEditor.cs @@ -1,7 +1,6 @@ using Umbraco.Cms.Core.IO; using Umbraco.Cms.Core.PropertyEditors.Validators; using Umbraco.Cms.Core.Serialization; -using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Strings; namespace Umbraco.Cms.Core.PropertyEditors; @@ -10,11 +9,10 @@ namespace Umbraco.Cms.Core.PropertyEditors; public class RadioValueEditor : DataValueEditor { public RadioValueEditor( - ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, IJsonSerializer jsonSerializer, IIOHelper ioHelper, DataEditorAttribute attribute) - : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute) => + : base(shortStringHelper, jsonSerializer, ioHelper, attribute) => Validators.Add(new RadioValueValidator()); } diff --git a/src/Umbraco.Core/PropertyEditors/TextOnlyValueEditor.cs b/src/Umbraco.Core/PropertyEditors/TextOnlyValueEditor.cs index fb1cddefe6..97b0643e58 100644 --- a/src/Umbraco.Core/PropertyEditors/TextOnlyValueEditor.cs +++ b/src/Umbraco.Core/PropertyEditors/TextOnlyValueEditor.cs @@ -26,21 +26,6 @@ public class TextOnlyValueEditor : DataValueEditor : base(shortStringHelper, jsonSerializer, ioHelper, attribute) => Validators.Add(new LengthValidator(localizedTextService)); - [Obsolete($"Use the constructor that accepts {nameof(ILocalizedTextService)}. Will be removed in V16.")] - public TextOnlyValueEditor( - DataEditorAttribute attribute, - IShortStringHelper shortStringHelper, - IJsonSerializer jsonSerializer, - IIOHelper ioHelper) - : this( - attribute, - StaticServiceProvider.Instance.GetRequiredService(), - shortStringHelper, - jsonSerializer, - ioHelper) - { - } - /// /// A method used to format the database value to a value that can be used by the editor /// diff --git a/src/Umbraco.Core/PropertyEditors/Validators/RegexValidator.cs b/src/Umbraco.Core/PropertyEditors/Validators/RegexValidator.cs index f1fe0a199e..2e39ce255e 100644 --- a/src/Umbraco.Core/PropertyEditors/Validators/RegexValidator.cs +++ b/src/Umbraco.Core/PropertyEditors/Validators/RegexValidator.cs @@ -4,7 +4,6 @@ using System.ComponentModel.DataAnnotations; using System.Text.RegularExpressions; using Umbraco.Cms.Core.Models.Validation; -using Umbraco.Cms.Core.Services; namespace Umbraco.Cms.Core.PropertyEditors.Validators; @@ -15,18 +14,6 @@ public sealed class RegexValidator : IValueFormatValidator, IValueValidator { private string _regex; - [Obsolete($"Use the constructor that does not accept {nameof(ILocalizedTextService)}. Will be removed in V15.")] - public RegexValidator(ILocalizedTextService textService) - : this(string.Empty) - { - } - - [Obsolete($"Use the constructor that does not accept {nameof(ILocalizedTextService)}. Will be removed in V15.")] - public RegexValidator(ILocalizedTextService textService, string regex) - : this(regex) - { - } - /// /// Initializes a new instance of the class. /// diff --git a/src/Umbraco.Core/PropertyEditors/Validators/RequiredValidator.cs b/src/Umbraco.Core/PropertyEditors/Validators/RequiredValidator.cs index 45389caec4..1033515820 100644 --- a/src/Umbraco.Core/PropertyEditors/Validators/RequiredValidator.cs +++ b/src/Umbraco.Core/PropertyEditors/Validators/RequiredValidator.cs @@ -1,6 +1,5 @@ using System.ComponentModel.DataAnnotations; using Umbraco.Cms.Core.Models.Validation; -using Umbraco.Cms.Core.Services; using Umbraco.Extensions; namespace Umbraco.Cms.Core.PropertyEditors.Validators; @@ -10,12 +9,6 @@ namespace Umbraco.Cms.Core.PropertyEditors.Validators; /// public class RequiredValidator : IValueRequiredValidator, IValueValidator { - [Obsolete($"Use the constructor that does not accept {nameof(ILocalizedTextService)}. Will be removed in V15.")] - public RequiredValidator(ILocalizedTextService textService) - : this() - { - } - public RequiredValidator() { } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/MemberPickerValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/MemberPickerValueConverter.cs index 6fdf5d3246..8238bca830 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/MemberPickerValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/MemberPickerValueConverter.cs @@ -82,7 +82,7 @@ public class MemberPickerValueConverter : PropertyValueConverterBase, IDeliveryA return null; } - IMember? m = _memberService.GetByKey(sourceUdi.Guid); + IMember? m = _memberService.GetById(sourceUdi.Guid); if (m == null) { return null; diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs index 22e3067244..96e84bfb83 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs @@ -131,7 +131,7 @@ public class MultiNodeTreePickerValueConverter : PropertyValueConverterBase, IDe UmbracoObjectTypes.Member, id => { - IMember? m = _memberService.GetByKey(guidUdi.Guid); + IMember? m = _memberService.GetById(guidUdi.Guid); if (m == null) { return null; diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs index 28eedeb797..03e7c1092a 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/SliderValueConverter.cs @@ -19,21 +19,6 @@ public class SliderValueConverter : PropertyValueConverterBase public SliderValueConverter() { } - /// - /// Initializes a new instance of the class. - /// - /// The data type service. - [Obsolete("The IDataTypeService is not used anymore. This constructor will be removed in a future version.")] - public SliderValueConverter(IDataTypeService dataTypeService) - { } - - /// - /// Clears the data type configuration caches. - /// - [Obsolete("Caching of data type configuration is not done anymore. This method will be removed in a future version.")] - public static void ClearCaches() - { } - /// public override bool IsConverter(IPublishedPropertyType propertyType) => propertyType.EditorAlias.InvariantEquals(Constants.PropertyEditors.Aliases.Slider); diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/TagsValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/TagsValueConverter.cs index 2dd1c1d56e..57ebf20114 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/TagsValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/TagsValueConverter.cs @@ -23,23 +23,6 @@ public class TagsValueConverter : PropertyValueConverterBase public TagsValueConverter(IJsonSerializer jsonSerializer) => _jsonSerializer = jsonSerializer ?? throw new ArgumentNullException(nameof(jsonSerializer)); - /// - /// Initializes a new instance of the class. - /// - /// The data type service. - /// The JSON serializer. - [Obsolete("The IDataTypeService is not used anymore. This constructor will be removed in a future version.")] - public TagsValueConverter(IDataTypeService dataTypeService, IJsonSerializer jsonSerializer) - : this(jsonSerializer) - { } - - /// - /// Clears the data type configuration caches. - /// - [Obsolete("Caching of data type configuration is not done anymore. This method will be removed in a future version.")] - public static void ClearCaches() - { } - /// public override bool IsConverter(IPublishedPropertyType propertyType) => propertyType.EditorAlias.InvariantEquals(Constants.PropertyEditors.Aliases.Tags); diff --git a/src/Umbraco.Core/PublishedCache/IPublishedCache.cs b/src/Umbraco.Core/PublishedCache/IPublishedCache.cs index 2a8809deb6..c07baf4ca6 100644 --- a/src/Umbraco.Core/PublishedCache/IPublishedCache.cs +++ b/src/Umbraco.Core/PublishedCache/IPublishedCache.cs @@ -95,37 +95,4 @@ public interface IPublishedCache /// Considers published or unpublished content depending on defaults. [Obsolete("Scheduled for removal in v17")] bool HasContent(); - - /// - /// Gets a content type identified by its unique identifier. - /// - /// The content type unique identifier. - /// The content type, or null. - [Obsolete("Please use the IContentTypeCacheService instead, scheduled for removal in V16")] - IPublishedContentType? GetContentType(int id); - - /// - /// Gets a content type identified by its alias. - /// - /// The content type alias. - /// The content type, or null. - /// The alias is case-insensitive. - [Obsolete("Please use the IContentTypeCacheService instead, scheduled for removal in V16")] - IPublishedContentType? GetContentType(string alias); - - /// - /// Gets contents of a given content type. - /// - /// The content type. - /// The contents. - [Obsolete] - IEnumerable GetByContentType(IPublishedContentType contentType); - - /// - /// Gets a content type identified by its alias. - /// - /// The content type key. - /// The content type, or null. - [Obsolete("Please use the IContentTypeCacheService instead, scheduled for removal in V16")] - IPublishedContentType? GetContentType(Guid key); } diff --git a/src/Umbraco.Core/PublishedCache/PublishedCacheBase.cs b/src/Umbraco.Core/PublishedCache/PublishedCacheBase.cs index 2abba65d4a..a37dba82c7 100644 --- a/src/Umbraco.Core/PublishedCache/PublishedCacheBase.cs +++ b/src/Umbraco.Core/PublishedCache/PublishedCacheBase.cs @@ -1,7 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core.Models.PublishedContent; -using Umbraco.Extensions; -using StaticServiceProvider = Umbraco.Cms.Core.DependencyInjection.StaticServiceProvider; namespace Umbraco.Cms.Core.PublishedCache; @@ -9,19 +6,6 @@ public abstract class PublishedCacheBase : IPublishedCache { private readonly IVariationContextAccessor? _variationContextAccessor; - - [Obsolete("Use ctor with all parameters. This will be removed in V15")] - public PublishedCacheBase(IVariationContextAccessor variationContextAccessor) - : this(variationContextAccessor, false) - { - } - - [Obsolete("Use ctor with all parameters. This will be removed in V15")] - protected PublishedCacheBase(bool previewDefault) - : this(StaticServiceProvider.Instance.GetRequiredService(), previewDefault) - { - } - public PublishedCacheBase(IVariationContextAccessor variationContextAccessor, bool previewDefault) { _variationContextAccessor = variationContextAccessor; @@ -57,12 +41,4 @@ public abstract class PublishedCacheBase : IPublishedCache public abstract bool HasContent(bool preview); public bool HasContent() => HasContent(PreviewDefault); - - public abstract IPublishedContentType? GetContentType(int id); - - public abstract IPublishedContentType? GetContentType(string alias); - - public abstract IPublishedContentType? GetContentType(Guid key); - - public virtual IEnumerable GetByContentType(IPublishedContentType contentType) => throw new NotImplementedException(); } diff --git a/src/Umbraco.Core/Routing/ContentFinderByIdPath.cs b/src/Umbraco.Core/Routing/ContentFinderByIdPath.cs deleted file mode 100644 index b1386dd17a..0000000000 --- a/src/Umbraco.Core/Routing/ContentFinderByIdPath.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System.Globalization; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.Models.PublishedContent; -using Umbraco.Cms.Core.Web; - -namespace Umbraco.Cms.Core.Routing; - -/// -/// Provides an implementation of that handles page identifiers. -/// -/// -/// Handles /1234 where 1234 is the identified of a document. -/// -[Obsolete("Use ContentFinderByKeyPath instead. This will be removed in Umbraco 15.")] -public class ContentFinderByIdPath : ContentFinderByIdentifierPathBase, IContentFinder -{ - private readonly ILogger _logger; - private readonly IUmbracoContextAccessor _umbracoContextAccessor; - private WebRoutingSettings _webRoutingSettings; - - protected override string FailureLogMessageTemplate => "Not a node id"; - - /// - /// Initializes a new instance of the class. - /// - public ContentFinderByIdPath( - IOptionsMonitor webRoutingSettings, - ILogger logger, - IRequestAccessor requestAccessor, - IUmbracoContextAccessor umbracoContextAccessor) - : base(requestAccessor, logger) - { - _webRoutingSettings = webRoutingSettings.CurrentValue ?? - throw new ArgumentNullException(nameof(webRoutingSettings)); - _logger = logger ?? throw new ArgumentNullException(nameof(logger)); - _umbracoContextAccessor = - umbracoContextAccessor ?? throw new ArgumentNullException(nameof(umbracoContextAccessor)); - - webRoutingSettings.OnChange(x => _webRoutingSettings = x); - } - - /// - /// Tries to find and assign an Umbraco document to a PublishedRequest. - /// - /// The PublishedRequest. - /// A value indicating whether an Umbraco document was found and assigned. - public Task TryFindContent(IPublishedRequestBuilder frequest) - { - if (!_umbracoContextAccessor.TryGetUmbracoContext(out IUmbracoContext? umbracoContext)) - { - return Task.FromResult(false); - } - - if (umbracoContext.InPreviewMode == false && _webRoutingSettings.DisableFindContentByIdentifierPath) - { - return Task.FromResult(false); - } - - var path = frequest.AbsolutePathDecoded; - - // no id if "/" - if (path == "/") - { - return LogAndReturnFailure(); - } - - var noSlashPath = path.Substring(1); - - if (int.TryParse(noSlashPath, NumberStyles.Integer, CultureInfo.InvariantCulture, out var nodeId) == false) - { - return LogAndReturnFailure(); - } - - // NodeId cannot be negative or 0 - if (nodeId < 1) - { - return LogAndReturnFailure(); - } - - if (_logger.IsEnabled(LogLevel.Debug)) - { - _logger.LogDebug("Id={NodeId}", nodeId); - } - - IPublishedContent? node = umbracoContext.Content?.GetById(nodeId); - - if (node is null) - { - return LogAndReturnFailure(); - } - - ResolveAndSetCultureOnRequest(frequest); - ResolveAndSetSegmentOnRequest(frequest); - - frequest.SetPublishedContent(node); - if (_logger.IsEnabled(LogLevel.Debug)) - { - _logger.LogDebug("Found node with id={PublishedContentId}", node.Id); - } - - return Task.FromResult(true); - } -} diff --git a/src/Umbraco.Core/Routing/DefaultMediaUrlProvider.cs b/src/Umbraco.Core/Routing/DefaultMediaUrlProvider.cs index b9824731bf..59113ad5ed 100644 --- a/src/Umbraco.Core/Routing/DefaultMediaUrlProvider.cs +++ b/src/Umbraco.Core/Routing/DefaultMediaUrlProvider.cs @@ -1,5 +1,3 @@ -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.PropertyEditors; @@ -11,22 +9,14 @@ namespace Umbraco.Cms.Core.Routing; public class DefaultMediaUrlProvider : IMediaUrlProvider { private readonly MediaUrlGeneratorCollection _mediaPathGenerators; - private readonly UriUtility _uriUtility; private readonly IUrlAssembler _urlAssembler; - public DefaultMediaUrlProvider(MediaUrlGeneratorCollection mediaPathGenerators, UriUtility uriUtility, IUrlAssembler urlAssembler) + public DefaultMediaUrlProvider(MediaUrlGeneratorCollection mediaPathGenerators, IUrlAssembler urlAssembler) { - _mediaPathGenerators = mediaPathGenerators ?? throw new ArgumentNullException(nameof(mediaPathGenerators)); - _uriUtility = uriUtility; + _mediaPathGenerators = mediaPathGenerators; _urlAssembler = urlAssembler; } - [Obsolete("Use the constructor that has the IUrlAssembler instead. Scheduled to be removed in v15")] - public DefaultMediaUrlProvider(MediaUrlGeneratorCollection mediaPathGenerators, UriUtility uriUtility) - : this(mediaPathGenerators, uriUtility, StaticServiceProvider.Instance.GetRequiredService()) - { - } - /// public virtual UrlInfo? GetMediaUrl( IPublishedContent content, diff --git a/src/Umbraco.Core/Routing/Domain.cs b/src/Umbraco.Core/Routing/Domain.cs index 8c77b5661b..0a08291a33 100644 --- a/src/Umbraco.Core/Routing/Domain.cs +++ b/src/Umbraco.Core/Routing/Domain.cs @@ -5,19 +5,6 @@ namespace Umbraco.Cms.Core.Routing; /// public class Domain { - /// - /// Initializes a new instance of the class. - /// - /// The unique identifier of the domain. - /// The name of the domain. - /// The identifier of the content which supports the domain. - /// The culture of the domain. - /// A value indicating whether the domain is a wildcard domain. - [Obsolete("Use the constructor specifying all properties instead. This constructor will be removed in a future version.")] - public Domain(int id, string name, int contentId, string? culture, bool isWildcard) - : this(id, name, contentId, culture, isWildcard, -1) - { } - /// /// Initializes a new instance of the class. /// diff --git a/src/Umbraco.Core/Routing/PublishedRequest.cs b/src/Umbraco.Core/Routing/PublishedRequest.cs index 79fc04725d..f3ef192fec 100644 --- a/src/Umbraco.Core/Routing/PublishedRequest.cs +++ b/src/Umbraco.Core/Routing/PublishedRequest.cs @@ -5,39 +5,6 @@ namespace Umbraco.Cms.Core.Routing; public class PublishedRequest : IPublishedRequest { - [Obsolete("Please use the constructor that accepts a segment. Will be removed in V16.")] - public PublishedRequest( - Uri uri, - string absolutePathDecoded, - IPublishedContent? publishedContent, - bool isInternalRedirect, - ITemplate? template, - DomainAndUri? domain, - string? culture, - string? redirectUrl, - int? responseStatusCode, - IReadOnlyList? cacheExtensions, - IReadOnlyDictionary? headers, - bool setNoCacheHeader, - bool ignorePublishedContentCollisions) - : this( - uri, - absolutePathDecoded, - publishedContent, - isInternalRedirect, - template, - domain, - culture, - segment: null, - redirectUrl, - responseStatusCode, - cacheExtensions, - headers, - setNoCacheHeader, - ignorePublishedContentCollisions) - { - } - /// /// Initializes a new instance of the class. /// diff --git a/src/Umbraco.Core/Security/ContentPermissions.cs b/src/Umbraco.Core/Security/ContentPermissions.cs index cc03485e17..4a7aceda27 100644 --- a/src/Umbraco.Core/Security/ContentPermissions.cs +++ b/src/Umbraco.Core/Security/ContentPermissions.cs @@ -70,86 +70,6 @@ public class ContentPermissions formattedPath.Contains(string.Concat(",", x.ToString(CultureInfo.InvariantCulture), ","))); } - [Obsolete($"Please use {nameof(IContentPermissionService)} instead, scheduled for removal in V15.")] - public ContentAccess CheckPermissions( - IContent content, - IUser user, - string permissionToCheck) => CheckPermissions(content, user, new HashSet(){ permissionToCheck }); - - [Obsolete($"Please use {nameof(IContentPermissionService)} instead, scheduled for removal in V15.")] - public ContentAccess CheckPermissions( - IContent? content, - IUser? user, - IReadOnlySet permissionsToCheck) - { - if (user == null) - { - throw new ArgumentNullException(nameof(user)); - } - - if (content == null) - { - return ContentAccess.NotFound; - } - - var hasPathAccess = user.HasPathAccess(content, _entityService, _appCaches); - - if (hasPathAccess == false) - { - return ContentAccess.Denied; - } - - if (permissionsToCheck == null || permissionsToCheck.Count == 0) - { - return ContentAccess.Granted; - } - - // get the implicit/inherited permissions for the user for this path - return CheckPermissionsPath(content.Path, user, permissionsToCheck) - ? ContentAccess.Granted - : ContentAccess.Denied; - } - - [Obsolete($"Please use {nameof(IContentPermissionService)} instead, scheduled for removal in V15.")] - public ContentAccess CheckPermissions( - IUmbracoEntity entity, - IUser? user, - string permissionToCheck) => CheckPermissions(entity, user, new HashSet(){ permissionToCheck }); - - [Obsolete($"Please use {nameof(IContentPermissionService)} instead, scheduled for removal in V15.")] - public ContentAccess CheckPermissions( - IUmbracoEntity entity, - IUser? user, - IReadOnlySet permissionsToCheck) - { - if (user == null) - { - throw new ArgumentNullException(nameof(user)); - } - - if (entity == null) - { - return ContentAccess.NotFound; - } - - var hasPathAccess = user.HasContentPathAccess(entity, _entityService, _appCaches); - - if (hasPathAccess == false) - { - return ContentAccess.Denied; - } - - if (permissionsToCheck == null || permissionsToCheck.Count == 0) - { - return ContentAccess.Granted; - } - - // get the implicit/inherited permissions for the user for this path - return CheckPermissionsPath(entity.Path, user, permissionsToCheck) - ? ContentAccess.Granted - : ContentAccess.Denied; - } - /// /// Checks if the user has access to the specified node and permissions set /// diff --git a/src/Umbraco.Core/Security/IBackofficeSecurity.cs b/src/Umbraco.Core/Security/IBackofficeSecurity.cs index d0a60e18d8..ba880ff9e5 100644 --- a/src/Umbraco.Core/Security/IBackofficeSecurity.cs +++ b/src/Umbraco.Core/Security/IBackofficeSecurity.cs @@ -15,15 +15,6 @@ public interface IBackOfficeSecurity // This one isn't as easy to remove as the others below. IUser? CurrentUser { get; } - /// - /// Gets the current user's id. - /// - /// The current user's Id that has been authenticated for the request. - /// If authentication hasn't taken place this will be unsuccessful. - // TODO: This should just be an extension method on ClaimsIdentity - [Obsolete("Scheduled for removal in V15")] - Attempt GetUserId(); - /// /// Checks if the specified user as access to the app /// diff --git a/src/Umbraco.Core/Security/LegacyPasswordSecurity.cs b/src/Umbraco.Core/Security/LegacyPasswordSecurity.cs index f50d0b5bdb..4b3ee31d92 100644 --- a/src/Umbraco.Core/Security/LegacyPasswordSecurity.cs +++ b/src/Umbraco.Core/Security/LegacyPasswordSecurity.cs @@ -1,4 +1,3 @@ -using System.ComponentModel; using System.Security.Cryptography; using System.Text; using Umbraco.Extensions; @@ -23,26 +22,8 @@ public class LegacyPasswordSecurity } } - // TODO: Remove v11 // Used for tests - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("We shouldn't be altering our public API to make test code easier, removing v11")] - public string HashPasswordForStorage(string algorithmType, string password) - { - if (string.IsNullOrWhiteSpace(password)) - { - throw new ArgumentException("password cannot be empty", nameof(password)); - } - - var hashed = HashNewPassword(algorithmType, password, out string salt); - return FormatPasswordForStorage(algorithmType, hashed, salt); - } - - // TODO: Remove v11 - // Used for tests - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("We shouldn't be altering our public API to make test code easier, removing v11")] - public string FormatPasswordForStorage(string algorithmType, string hashedPassword, string salt) + internal string FormatPasswordForStorage(string algorithmType, string hashedPassword, string salt) { if (!SupportHashAlgorithm(algorithmType)) { @@ -103,14 +84,7 @@ public class LegacyPasswordSecurity /// /// Create a new password hash and a new salt /// - /// The hashing algorithm for the password. - /// - /// - /// - // TODO: Do we need this method? We shouldn't be using this class to create new password hashes for storage - // TODO: Remove v11 - [Obsolete("We shouldn't be altering our public API to make test code easier, removing v11")] - public string HashNewPassword(string algorithm, string newPassword, out string salt) + internal string HashNewPassword(string algorithm, string newPassword, out string salt) { salt = GenerateSalt(); return HashPassword(algorithm, newPassword, salt); diff --git a/src/Umbraco.Core/Services/AuditService.cs b/src/Umbraco.Core/Services/AuditService.cs index 855e3261cd..6af3d15675 100644 --- a/src/Umbraco.Core/Services/AuditService.cs +++ b/src/Umbraco.Core/Services/AuditService.cs @@ -1,6 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Membership; @@ -18,49 +16,6 @@ public sealed class AuditService : RepositoryService, IAuditService private readonly IEntityService _entityService; private readonly Lazy _isAvailable; - [Obsolete("Use the non-obsolete constructor. Will be removed in V15.")] - public AuditService( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IAuditRepository auditRepository, - IAuditEntryRepository auditEntryRepository, - IUserService userService, - IEntityRepository entityRepository) - : this( - provider, - loggerFactory, - eventMessagesFactory, - auditRepository, - auditEntryRepository, - userService, - StaticServiceProvider.Instance.GetRequiredService() - ) - { - } - - [Obsolete("Use the non-obsolete constructor. Will be removed in V15.")] - public AuditService( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IAuditRepository auditRepository, - IAuditEntryRepository auditEntryRepository, - IUserService userService, - IEntityRepository entityRepository, - IEntityService entityService) - : this( - provider, - loggerFactory, - eventMessagesFactory, - auditRepository, - auditEntryRepository, - userService, - entityService - ) - { - } - public AuditService( ICoreScopeProvider provider, ILoggerFactory loggerFactory, diff --git a/src/Umbraco.Core/Services/ContentEditingService.cs b/src/Umbraco.Core/Services/ContentEditingService.cs index 08af77d3e7..2b81027cd2 100644 --- a/src/Umbraco.Core/Services/ContentEditingService.cs +++ b/src/Umbraco.Core/Services/ContentEditingService.cs @@ -64,15 +64,6 @@ internal sealed class ContentEditingService return Task.FromResult(content); } - [Obsolete("Please use the validate update method that is not obsoleted. Will be removed in V16.")] - public async Task> ValidateUpdateAsync(Guid key, ContentUpdateModel updateModel) - { - IContent? content = ContentService.GetById(key); - return content is not null - ? await ValidateCulturesAndPropertiesAsync(updateModel, content.ContentType.Key) - : Attempt.FailWithStatus(ContentEditingOperationStatus.NotFound, new ContentValidationResult()); - } - public async Task> ValidateUpdateAsync(Guid key, ValidateContentUpdateModel updateModel) { IContent? content = ContentService.GetById(key); diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index c76e89381a..de47ce762d 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -159,72 +159,6 @@ public class ContentService : RepositoryService, IContentService { } - [Obsolete("Use non-obsolete constructor. Scheduled for removal in V16.")] - public ContentService( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IDocumentRepository documentRepository, - IEntityRepository entityRepository, - IAuditRepository auditRepository, - IContentTypeRepository contentTypeRepository, - IDocumentBlueprintRepository documentBlueprintRepository, - ILanguageRepository languageRepository, - Lazy propertyValidationService, - IShortStringHelper shortStringHelper, - ICultureImpactFactory cultureImpactFactory, - IUserIdKeyResolver userIdKeyResolver) - : this( - provider, - loggerFactory, - eventMessagesFactory, - documentRepository, - entityRepository, - auditRepository, - contentTypeRepository, - documentBlueprintRepository, - languageRepository, - propertyValidationService, - shortStringHelper, - cultureImpactFactory, - userIdKeyResolver, - StaticServiceProvider.Instance.GetRequiredService() - ) - { - } - - [Obsolete("Use non-obsolete constructor. Scheduled for removal in V16.")] - public ContentService( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IDocumentRepository documentRepository, - IEntityRepository entityRepository, - IAuditRepository auditRepository, - IContentTypeRepository contentTypeRepository, - IDocumentBlueprintRepository documentBlueprintRepository, - ILanguageRepository languageRepository, - Lazy propertyValidationService, - IShortStringHelper shortStringHelper, - ICultureImpactFactory cultureImpactFactory) - : this( - provider, - loggerFactory, - eventMessagesFactory, - documentRepository, - entityRepository, - auditRepository, - contentTypeRepository, - documentBlueprintRepository, - languageRepository, - propertyValidationService, - shortStringHelper, - cultureImpactFactory, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService()) - { - } - #endregion #region Static queries @@ -1237,14 +1171,7 @@ public class ContentService : RepositoryService, IContentService return OperationResult.Succeed(eventMessages); } - [Obsolete($"This method no longer saves content, only publishes it. Please use {nameof(Publish)} instead. Will be removed in V16")] - public PublishResult SaveAndPublish(IContent content, string culture = "*", int userId = Constants.Security.SuperUserId) - => Publish(content, new[] { culture }, userId); - - [Obsolete($"This method no longer saves content, only publishes it. Please use {nameof(Publish)} instead. Will be removed in V16")] - public PublishResult SaveAndPublish(IContent content, string[] cultures, int userId = Constants.Security.SuperUserId) - => Publish(content, cultures, userId); - + /// public PublishResult Publish(IContent content, string[] cultures, int userId = Constants.Security.SuperUserId) { if (content == null) @@ -2082,65 +2009,8 @@ public class ContentService : RepositoryService, IContentService return cultures; } - [Obsolete($"This method no longer saves content, only publishes it. Please use {nameof(PublishBranch)} instead. Will be removed in V16")] - public IEnumerable SaveAndPublishBranch(IContent content, bool force, string culture = "*", int userId = Constants.Security.SuperUserId) - { - // note: EditedValue and PublishedValue are objects here, so it is important to .Equals() - // and not to == them, else we would be comparing references, and that is a bad thing - - // determines whether the document is edited, and thus needs to be published, - // for the specified culture (it may be edited for other cultures and that - // should not trigger a publish). - - // determines cultures to be published - // can be: null (content is not impacted), an empty set (content is impacted but already published), or cultures - HashSet? ShouldPublish(IContent c) - { - var isRoot = c.Id == content.Id; - HashSet? culturesToPublish = null; - - PublishBranchFilter publishBranchFilter = force ? PublishBranchFilter.IncludeUnpublished : PublishBranchFilter.Default; - - // invariant content type - if (!c.ContentType.VariesByCulture()) - { - return PublishBranch_ShouldPublish(ref culturesToPublish, "*", c.Published, c.Edited, isRoot, publishBranchFilter); - } - - // variant content type, specific culture - if (culture != "*") - { - return PublishBranch_ShouldPublish(ref culturesToPublish, culture, c.IsCulturePublished(culture), c.IsCultureEdited(culture), isRoot, publishBranchFilter); - } - - // variant content type, all cultures - if (c.Published) - { - // then some (and maybe all) cultures will be 'already published' (unless forcing), - // others will have to 'republish this culture' - foreach (var x in c.AvailableCultures) - { - PublishBranch_ShouldPublish(ref culturesToPublish, x, c.IsCulturePublished(x), c.IsCultureEdited(x), isRoot, publishBranchFilter); - } - - return culturesToPublish; - } - - // if not published, publish if force/root else do nothing - return force || isRoot - ? new HashSet { "*" } // "*" means 'publish all' - : null; // null means 'nothing to do' - } - - return PublishBranch(content, ShouldPublish, PublishBranch_PublishCultures, userId); - } - - [Obsolete($"This method no longer saves content, only publishes it. Please use {nameof(PublishBranch)} instead. Will be removed in V16")] - public IEnumerable SaveAndPublishBranch(IContent content, bool force, string[] cultures, int userId = Constants.Security.SuperUserId) - => PublishBranch(content, force ? PublishBranchFilter.IncludeUnpublished : PublishBranchFilter.Default, cultures, userId); - /// - [Obsolete("This method is not longer used as the 'force' parameter has been split into publishing unpublished and force re-published. Please use the overload containing parameters for those options instead. Will be removed in V16")] + [Obsolete("This method is not longer used as the 'force' parameter has been split into publishing unpublished and force re-published. Please use the overload containing parameters for those options instead. Scheduled for removal in V17")] public IEnumerable PublishBranch(IContent content, bool force, string[] cultures, int userId = Constants.Security.SuperUserId) => PublishBranch(content, force ? PublishBranchFilter.IncludeUnpublished : PublishBranchFilter.Default, cultures, userId); diff --git a/src/Umbraco.Core/Services/ContentTypeEditing/ContentTypeEditingService.cs b/src/Umbraco.Core/Services/ContentTypeEditing/ContentTypeEditingService.cs index a63d566c35..a9455d9a55 100644 --- a/src/Umbraco.Core/Services/ContentTypeEditing/ContentTypeEditingService.cs +++ b/src/Umbraco.Core/Services/ContentTypeEditing/ContentTypeEditingService.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentEditing; @@ -53,24 +53,6 @@ internal sealed class ContentTypeEditingService : ContentTypeEditingServiceBase< { } - [Obsolete("Use the constructor that is not marked obsolete, will be removed in v16")] - public ContentTypeEditingService( - IContentTypeService contentTypeService, - ITemplateService templateService, - IDataTypeService dataTypeService, - IEntityService entityService, - IShortStringHelper shortStringHelper) - : this( - contentTypeService, - templateService, - dataTypeService, - entityService, - shortStringHelper, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService()) - { - } - public async Task> CreateAsync(ContentTypeCreateModel model, Guid userKey) { Attempt result = await ValidateAndMapForCreationAsync(model, model.Key, model.ContainerKey); diff --git a/src/Umbraco.Core/Services/ContentTypeEditing/MediaTypeEditingService.cs b/src/Umbraco.Core/Services/ContentTypeEditing/MediaTypeEditingService.cs index 069f72cb12..8a626215b4 100644 --- a/src/Umbraco.Core/Services/ContentTypeEditing/MediaTypeEditingService.cs +++ b/src/Umbraco.Core/Services/ContentTypeEditing/MediaTypeEditingService.cs @@ -1,5 +1,3 @@ -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Media; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentTypeEditing; @@ -33,22 +31,6 @@ internal sealed class MediaTypeEditingService : ContentTypeEditingServiceBase(); - } - public async Task> CreateAsync(MediaTypeCreateModel model, Guid userKey) { Attempt result = await ValidateAndMapForCreationAsync(model, model.Key, model.ContainerKey); diff --git a/src/Umbraco.Core/Services/ContentTypeEditing/MemberTypeEditingService.cs b/src/Umbraco.Core/Services/ContentTypeEditing/MemberTypeEditingService.cs index dd566b6a2b..64d7bf84bb 100644 --- a/src/Umbraco.Core/Services/ContentTypeEditing/MemberTypeEditingService.cs +++ b/src/Umbraco.Core/Services/ContentTypeEditing/MemberTypeEditingService.cs @@ -1,5 +1,3 @@ -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentTypeEditing; using Umbraco.Cms.Core.Models.Membership; @@ -29,21 +27,6 @@ internal sealed class MemberTypeEditingService : ContentTypeEditingServiceBase(); - } - public async Task> CreateAsync(MemberTypeCreateModel model, Guid userKey) { Attempt result = await ValidateAndMapForCreationAsync(model, model.Key, containerKey: null); diff --git a/src/Umbraco.Core/Services/ContentTypeService.cs b/src/Umbraco.Core/Services/ContentTypeService.cs index 1a4ea449c0..6840d18bfe 100644 --- a/src/Umbraco.Core/Services/ContentTypeService.cs +++ b/src/Umbraco.Core/Services/ContentTypeService.cs @@ -1,6 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Notifications; @@ -43,56 +41,6 @@ public class ContentTypeService : ContentTypeServiceBase ContentService = contentService; - [Obsolete("Use the ctor specifying all dependencies instead")] - public ContentTypeService( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IContentService contentService, - IContentTypeRepository repository, - IAuditRepository auditRepository, - IDocumentTypeContainerRepository entityContainerRepository, - IEntityRepository entityRepository, - IEventAggregator eventAggregator) - : this( - provider, - loggerFactory, - eventMessagesFactory, - contentService, - repository, - auditRepository, - entityContainerRepository, - entityRepository, - eventAggregator, - StaticServiceProvider.Instance.GetRequiredService()) - { } - - [Obsolete("Use the ctor specifying all dependencies instead")] - public ContentTypeService( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IContentService contentService, - IContentTypeRepository repository, - IAuditRepository auditRepository, - IDocumentTypeContainerRepository entityContainerRepository, - IEntityRepository entityRepository, - IEventAggregator eventAggregator, - IUserIdKeyResolver userIdKeyResolver) - : this( - provider, - loggerFactory, - eventMessagesFactory, - contentService, - repository, - auditRepository, - entityContainerRepository, - entityRepository, - eventAggregator, - userIdKeyResolver, - StaticServiceProvider.Instance.GetRequiredService()) - { } - protected override int[] ReadLockIds => ContentTypeLocks.ReadLockIds; protected override int[] WriteLockIds => ContentTypeLocks.WriteLockIds; diff --git a/src/Umbraco.Core/Services/ContentTypeServiceBaseOfTRepositoryTItemTService.cs b/src/Umbraco.Core/Services/ContentTypeServiceBaseOfTRepositoryTItemTService.cs index dca44e5d71..59b483e0d3 100644 --- a/src/Umbraco.Core/Services/ContentTypeServiceBaseOfTRepositoryTItemTService.cs +++ b/src/Umbraco.Core/Services/ContentTypeServiceBaseOfTRepositoryTItemTService.cs @@ -1,8 +1,6 @@ using System.Globalization; using System.Runtime.InteropServices; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Exceptions; using Umbraco.Cms.Core.Models; @@ -51,54 +49,6 @@ public abstract class ContentTypeServiceBase : ContentTypeSe _contentTypeFilters = contentTypeFilters; } - [Obsolete("Use the ctor specifying all dependencies instead")] - protected ContentTypeServiceBase( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - TRepository repository, - IAuditRepository auditRepository, - IEntityContainerRepository containerRepository, - IEntityRepository entityRepository, - IEventAggregator eventAggregator) - : this( - provider, - loggerFactory, - eventMessagesFactory, - repository, - auditRepository, - containerRepository, - entityRepository, - eventAggregator, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [Obsolete("Use the ctor specifying all dependencies instead")] - protected ContentTypeServiceBase( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - TRepository repository, - IAuditRepository auditRepository, - IEntityContainerRepository containerRepository, - IEntityRepository entityRepository, - IEventAggregator eventAggregator, - IUserIdKeyResolver userIdKeyResolver) - : this( - provider, - loggerFactory, - eventMessagesFactory, - repository, - auditRepository, - containerRepository, - entityRepository, - eventAggregator, - userIdKeyResolver, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - protected TRepository Repository { get; } protected abstract int[] WriteLockIds { get; } protected abstract int[] ReadLockIds { get; } diff --git a/src/Umbraco.Core/Services/ContentVersionService.cs b/src/Umbraco.Core/Services/ContentVersionService.cs index 0451409a4b..9d5d569b3a 100644 --- a/src/Umbraco.Core/Services/ContentVersionService.cs +++ b/src/Umbraco.Core/Services/ContentVersionService.cs @@ -1,6 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Extensions; using Umbraco.Cms.Core.Models; @@ -52,28 +50,6 @@ internal class ContentVersionService : IContentVersionService _userIdKeyResolver = userIdKeyResolver; } - [Obsolete("Use the non obsolete constructor instead. Scheduled to be removed in v15")] - public ContentVersionService( - ILogger logger, - IDocumentVersionRepository documentVersionRepository, - IContentVersionCleanupPolicy contentVersionCleanupPolicy, - ICoreScopeProvider scopeProvider, - IEventMessagesFactory eventMessagesFactory, - IAuditRepository auditRepository, - ILanguageRepository languageRepository) - { - _logger = logger; - _documentVersionRepository = documentVersionRepository; - _contentVersionCleanupPolicy = contentVersionCleanupPolicy; - _scopeProvider = scopeProvider; - _eventMessagesFactory = eventMessagesFactory; - _auditRepository = auditRepository; - _languageRepository = languageRepository; - _entityService = StaticServiceProvider.Instance.GetRequiredService(); - _contentService = StaticServiceProvider.Instance.GetRequiredService(); - _userIdKeyResolver = StaticServiceProvider.Instance.GetRequiredService(); - } - /// public IReadOnlyCollection PerformContentVersionCleanup(DateTime asAtDate) => @@ -81,23 +57,6 @@ internal class ContentVersionService : IContentVersionService // Members - ignored CleanupDocumentVersions(asAtDate); - /// - [Obsolete("Use the async version instead. Scheduled to be removed in v15")] - public IEnumerable? GetPagedContentVersions(int contentId, long pageIndex, int pageSize, out long totalRecords, string? culture = null) - { - if (pageIndex < 0) - { - throw new ArgumentOutOfRangeException(nameof(pageIndex)); - } - - if (pageSize <= 0) - { - throw new ArgumentOutOfRangeException(nameof(pageSize)); - } - - return HandleGetPagedContentVersions(contentId, pageIndex, pageSize, out totalRecords, culture); - } - public ContentVersionMeta? Get(int versionId) { using (ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true)) @@ -107,11 +66,6 @@ internal class ContentVersionService : IContentVersionService } } - /// - [Obsolete("Use the async version instead. Scheduled to be removed in v15")] - public void SetPreventCleanup(int versionId, bool preventCleanup, int userId = Constants.Security.SuperUserId) - => HandleSetPreventCleanup(versionId, preventCleanup, userId); - public Task?, ContentVersionOperationStatus>> GetPagedContentVersionsAsync(Guid contentId, string? culture, int skip, int take) { IEntitySlim? document = _entityService.Get(contentId, UmbracoObjectTypes.Document); diff --git a/src/Umbraco.Core/Services/DataTypeService.cs b/src/Umbraco.Core/Services/DataTypeService.cs index 60e28240a0..71515b28b2 100644 --- a/src/Umbraco.Core/Services/DataTypeService.cs +++ b/src/Umbraco.Core/Services/DataTypeService.cs @@ -681,14 +681,6 @@ namespace Umbraco.Cms.Core.Services.Implement return Attempt.SucceedWithStatus(DataTypeOperationStatus.Success, dataType); } - /// - [Obsolete("Please use GetReferencesAsync. Will be deleted in V15.")] - public IReadOnlyDictionary> GetReferences(int id) - { - using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true); - return _dataTypeRepository.FindUsages(id); - } - /// public Task>, DataTypeOperationStatus>> GetReferencesAsync(Guid id) { diff --git a/src/Umbraco.Core/Services/DataTypeUsageService.cs b/src/Umbraco.Core/Services/DataTypeUsageService.cs index 9773ec2a32..58e53a8803 100644 --- a/src/Umbraco.Core/Services/DataTypeUsageService.cs +++ b/src/Umbraco.Core/Services/DataTypeUsageService.cs @@ -1,5 +1,3 @@ -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Persistence.Repositories; using Umbraco.Cms.Core.Scoping; @@ -13,15 +11,6 @@ public class DataTypeUsageService : IDataTypeUsageService private readonly IDataTypeService _dataTypeService; private readonly ICoreScopeProvider _scopeProvider; - - [Obsolete("Use non-obsolete constructor. This will be removed in Umbraco 15.")] - public DataTypeUsageService( - IDataTypeUsageRepository dataTypeUsageRepository, - ICoreScopeProvider scopeProvider) - : this(dataTypeUsageRepository, StaticServiceProvider.Instance.GetRequiredService(), scopeProvider) - { - } - public DataTypeUsageService( IDataTypeUsageRepository dataTypeUsageRepository, IDataTypeService dataTypeService, @@ -32,15 +21,6 @@ public class DataTypeUsageService : IDataTypeUsageService _scopeProvider = scopeProvider; } - /// - [Obsolete("Please use HasSavedValuesAsync. Scheduled for removable in Umbraco 15.")] - public bool HasSavedValues(int dataTypeId) - { - using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true); - - return _dataTypeUsageRepository.HasSavedValues(dataTypeId); - } - /// public async Task> HasSavedValuesAsync(Guid dataTypeKey) { diff --git a/src/Umbraco.Core/Services/DomainService.cs b/src/Umbraco.Core/Services/DomainService.cs index 16eb225aa5..1bcfd9cf82 100644 --- a/src/Umbraco.Core/Services/DomainService.cs +++ b/src/Umbraco.Core/Services/DomainService.cs @@ -1,12 +1,9 @@ -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentEditing; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Persistence.Repositories; -using Umbraco.Cms.Core.Routing; using Umbraco.Cms.Core.Scoping; using Umbraco.Cms.Core.Services.OperationStatus; using Umbraco.Extensions; @@ -19,22 +16,6 @@ public class DomainService : RepositoryService, IDomainService private readonly ILanguageService _languageService; private readonly IContentService _contentService; - [Obsolete("Please use the constructor that accepts ILanguageService and IContentService. Will be removed in V15.")] - public DomainService( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IDomainRepository domainRepository) - : this( - provider, - loggerFactory, - eventMessagesFactory, - domainRepository, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService()) - { - } - public DomainService( ICoreScopeProvider provider, ILoggerFactory loggerFactory, diff --git a/src/Umbraco.Core/Services/FileService.cs b/src/Umbraco.Core/Services/FileService.cs index b9c435ebab..eae1944b5d 100644 --- a/src/Umbraco.Core/Services/FileService.cs +++ b/src/Umbraco.Core/Services/FileService.cs @@ -1,10 +1,7 @@ using System.Text.RegularExpressions; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Hosting; using Umbraco.Cms.Core.Models; @@ -34,37 +31,6 @@ public class FileService : RepositoryService, IFileService private readonly ITemplateRepository _templateRepository; private readonly IUserIdKeyResolver _userIdKeyResolver; - [Obsolete("Use other ctor - will be removed in Umbraco 15")] - public FileService( - ICoreScopeProvider uowProvider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IStylesheetRepository stylesheetRepository, - IScriptRepository scriptRepository, - ITemplateRepository templateRepository, - IPartialViewRepository partialViewRepository, - IAuditRepository auditRepository, - IShortStringHelper shortStringHelper, - IOptions globalSettings, - IHostingEnvironment hostingEnvironment) - : this( - uowProvider, - loggerFactory, - eventMessagesFactory, - stylesheetRepository, - scriptRepository, - partialViewRepository, - auditRepository, - hostingEnvironment, - StaticServiceProvider.Instance.GetRequiredService(), - templateRepository, - StaticServiceProvider.Instance.GetRequiredService(), - shortStringHelper, - globalSettings) - { - } - - [ActivatorUtilitiesConstructor] public FileService( ICoreScopeProvider uowProvider, ILoggerFactory loggerFactory, @@ -77,7 +43,6 @@ public class FileService : RepositoryService, IFileService ITemplateService templateService, ITemplateRepository templateRepository, IUserIdKeyResolver userIdKeyResolver, - // We need these else it will be ambigious ctors IShortStringHelper shortStringHelper, IOptions globalSettings) : base(uowProvider, loggerFactory, eventMessagesFactory) diff --git a/src/Umbraco.Core/Services/IContentEditingService.cs b/src/Umbraco.Core/Services/IContentEditingService.cs index 260e5ae934..18f8777bb8 100644 --- a/src/Umbraco.Core/Services/IContentEditingService.cs +++ b/src/Umbraco.Core/Services/IContentEditingService.cs @@ -1,4 +1,4 @@ -using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentEditing; using Umbraco.Cms.Core.Services.OperationStatus; @@ -10,9 +10,6 @@ public interface IContentEditingService Task> ValidateCreateAsync(ContentCreateModel createModel); - [Obsolete("Please use the validate update method that is not obsoleted. Will be removed in V16.")] - Task> ValidateUpdateAsync(Guid key, ContentUpdateModel updateModel); - Task> ValidateUpdateAsync(Guid key, ValidateContentUpdateModel updateModel); Task> CreateAsync(ContentCreateModel createModel, Guid userKey); diff --git a/src/Umbraco.Core/Services/IContentService.cs b/src/Umbraco.Core/Services/IContentService.cs index 0009a0d053..ea14e6771a 100644 --- a/src/Umbraco.Core/Services/IContentService.cs +++ b/src/Umbraco.Core/Services/IContentService.cs @@ -1,7 +1,5 @@ using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core.DependencyInjection; -using Umbraco.Cms.Core.Events; - using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Membership; using Umbraco.Cms.Core.Persistence.Querying; @@ -319,21 +317,6 @@ public interface IContentService : IContentServiceBase /// OperationResult Move(IContent content, int parentId, int userId = Constants.Security.SuperUserId); - /// - /// Attempts to move the to under the node with id . - /// - /// The that shall be moved. - /// The id of the new parent node. - /// Id of the user attempting to move . - /// Success if moving succeeded, otherwise Failed. - [Obsolete("Adds return type to Move method. Will be removed in V14, as the original method will be adjusted.")] - OperationResult - AttemptMove(IContent content, int parentId, int userId = Constants.Security.SuperUserId) - { - Move(content, parentId, userId); - return OperationResult.Succeed(new EventMessages()); - } - /// /// Copies a document. /// @@ -380,12 +363,6 @@ public interface IContentService : IContentServiceBase #region Publish Document - [Obsolete($"This method no longer saves content, only publishes it. Please use {nameof(Publish)} instead. Will be removed in V16")] - PublishResult SaveAndPublish(IContent content, string culture = "*", int userId = Constants.Security.SuperUserId); - - [Obsolete($"This method no longer saves content, only publishes it. Please use {nameof(Publish)} instead. Will be removed in V16")] - PublishResult SaveAndPublish(IContent content, string[] cultures, int userId = Constants.Security.SuperUserId); - /// /// Publishes a document. /// @@ -399,12 +376,6 @@ public interface IContentService : IContentServiceBase /// The identifier of the user performing the action. PublishResult Publish(IContent content, string[] cultures, int userId = Constants.Security.SuperUserId); - [Obsolete($"This method no longer saves content, only publishes it. Please use {nameof(PublishBranch)} instead. Will be removed in V16")] - IEnumerable SaveAndPublishBranch(IContent content, bool force, string culture = "*", int userId = Constants.Security.SuperUserId); - - [Obsolete($"This method no longer saves content, only publishes it. Please use {nameof(PublishBranch)} instead. Will be removed in V16")] - IEnumerable SaveAndPublishBranch(IContent content, bool force, string[] cultures, int userId = Constants.Security.SuperUserId); - /// /// Publishes a document branch. /// @@ -434,10 +405,7 @@ public interface IContentService : IContentServiceBase /// The root of the branch is always published, regardless of . /// /// - IEnumerable PublishBranch(IContent content, PublishBranchFilter publishBranchFilter, string[] cultures, int userId = Constants.Security.SuperUserId) -#pragma warning disable CS0618 // Type or member is obsolete - => SaveAndPublishBranch(content, publishBranchFilter.HasFlag(PublishBranchFilter.IncludeUnpublished), cultures, userId); -#pragma warning restore CS0618 // Type or member is obsolete + IEnumerable PublishBranch(IContent content, PublishBranchFilter publishBranchFilter, string[] cultures, int userId = Constants.Security.SuperUserId); /// /// Unpublishes a document. diff --git a/src/Umbraco.Core/Services/IContentVersionService.cs b/src/Umbraco.Core/Services/IContentVersionService.cs index 211f416604..874e561b3f 100644 --- a/src/Umbraco.Core/Services/IContentVersionService.cs +++ b/src/Umbraco.Core/Services/IContentVersionService.cs @@ -10,19 +10,6 @@ public interface IContentVersionService /// IReadOnlyCollection PerformContentVersionCleanup(DateTime asAtDate); - /// - /// Gets paginated content versions for given content id paginated. - /// - /// Thrown when is invalid. - [Obsolete("Use the async version instead. Scheduled to be removed in v15")] - IEnumerable? GetPagedContentVersions(int contentId, long pageIndex, int pageSize, out long totalRecords, string? culture = null); - - /// - /// Updates preventCleanup value for given content version. - /// - [Obsolete("Use the async version instead. Scheduled to be removed in v15")] - void SetPreventCleanup(int versionId, bool preventCleanup, int userId = -1); - ContentVersionMeta? Get(int versionId); Task?, ContentVersionOperationStatus>> GetPagedContentVersionsAsync(Guid contentId, string? culture, int skip, int take); Task> GetAsync(Guid versionId); diff --git a/src/Umbraco.Core/Services/IDataTypeService.cs b/src/Umbraco.Core/Services/IDataTypeService.cs index 3a4576552c..592c6c49cc 100644 --- a/src/Umbraco.Core/Services/IDataTypeService.cs +++ b/src/Umbraco.Core/Services/IDataTypeService.cs @@ -9,15 +9,6 @@ namespace Umbraco.Cms.Core.Services; /// public interface IDataTypeService : IService { - /// - /// Returns a dictionary of content type s and the property type aliases that use a - /// - /// - /// - /// - [Obsolete("Please use GetReferencesAsync. Will be deleted in V15.")] - IReadOnlyDictionary> GetReferences(int id); - IReadOnlyDictionary> GetListViewReferences(int id) => throw new NotImplementedException(); /// diff --git a/src/Umbraco.Core/Services/IDataTypeUsageService.cs b/src/Umbraco.Core/Services/IDataTypeUsageService.cs index c7bb2e7636..405b8f49b1 100644 --- a/src/Umbraco.Core/Services/IDataTypeUsageService.cs +++ b/src/Umbraco.Core/Services/IDataTypeUsageService.cs @@ -4,10 +4,6 @@ namespace Umbraco.Cms.Core.Services; public interface IDataTypeUsageService { - - [Obsolete("Please use HasSavedValuesAsync. Scheduled for removable in Umbraco 15.")] - bool HasSavedValues(int dataTypeId); - /// /// Checks if there are any saved property values using a given data type. /// diff --git a/src/Umbraco.Core/Services/IMemberService.cs b/src/Umbraco.Core/Services/IMemberService.cs index 710425e2c8..a84d7de07d 100644 --- a/src/Umbraco.Core/Services/IMemberService.cs +++ b/src/Umbraco.Core/Services/IMemberService.cs @@ -266,7 +266,8 @@ public interface IMemberService : IMembershipMemberService, IContentServiceBase< /// /// /// - IMember? GetByKey(Guid id); + [Obsolete($"Use {nameof(GetById)}. Scheduled for removal in Umbraco 18.")] + IMember? GetByKey(Guid id) => GetById(id); /// /// Gets a Member by its integer id diff --git a/src/Umbraco.Core/Services/IMetricsConsentService.cs b/src/Umbraco.Core/Services/IMetricsConsentService.cs index e210a8925d..d40b2107d0 100644 --- a/src/Umbraco.Core/Services/IMetricsConsentService.cs +++ b/src/Umbraco.Core/Services/IMetricsConsentService.cs @@ -6,8 +6,5 @@ public interface IMetricsConsentService { TelemetryLevel GetConsentLevel(); - [Obsolete("Please use SetConsentLevelAsync instead, scheduled for removal in V15")] - void SetConsentLevel(TelemetryLevel telemetryLevel); - Task SetConsentLevelAsync(TelemetryLevel telemetryLevel); } diff --git a/src/Umbraco.Core/Services/IPackageDataInstallation.cs b/src/Umbraco.Core/Services/IPackageDataInstallation.cs index 957c2d1349..3d285c7156 100644 --- a/src/Umbraco.Core/Services/IPackageDataInstallation.cs +++ b/src/Umbraco.Core/Services/IPackageDataInstallation.cs @@ -1,6 +1,5 @@ using System.Xml.Linq; using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.ContentEditing; using Umbraco.Cms.Core.Models.Packaging; using Umbraco.Cms.Core.Packaging; @@ -65,10 +64,7 @@ public interface IPackageDataInstallation /// An enumerable list of generated languages IReadOnlyList ImportLanguages(IEnumerable languageElements, int userId); - [Obsolete("Use Async version instead, Scheduled to be removed in v17")] - IEnumerable ImportTemplate(XElement templateElement, int userId); - - Task> ImportTemplateAsync(XElement templateElement, int userId) => Task.FromResult(ImportTemplate(templateElement, userId)); + Task> ImportTemplateAsync(XElement templateElement, int userId); /// /// Imports and saves package xml as @@ -76,16 +72,7 @@ public interface IPackageDataInstallation /// Xml to import /// Optional user id /// An enumerable list of generated Templates - [Obsolete("Use Async version instead, Scheduled to be removed in v17")] - IReadOnlyList ImportTemplates(IReadOnlyCollection templateElements, int userId); - - /// - /// Imports and saves package xml as - /// - /// Xml to import - /// Optional user id - /// An enumerable list of generated Templates - Task> ImportTemplatesAsync(IReadOnlyCollection templateElements, int userId) => Task.FromResult(ImportTemplates(templateElements, userId)); + Task> ImportTemplatesAsync(IReadOnlyCollection templateElements, int userId); Guid GetContentTypeKey(XElement contentType); diff --git a/src/Umbraco.Core/Services/IPackagingService.cs b/src/Umbraco.Core/Services/IPackagingService.cs index e4f71a85ac..d2a175824d 100644 --- a/src/Umbraco.Core/Services/IPackagingService.cs +++ b/src/Umbraco.Core/Services/IPackagingService.cs @@ -29,17 +29,7 @@ public interface IPackagingService : IService /// Returns the advertised installed packages /// /// - [Obsolete("Use GetAllInstalledPackagesAsync instead. Scheduled for removal in Umbraco 15.")] - IEnumerable GetAllInstalledPackages(); - - /// - /// Returns the advertised installed packages - /// - /// - Task> GetAllInstalledPackagesAsync() -#pragma warning disable CS0618 // Type or member is obsolete - => Task.FromResult(GetAllInstalledPackages()); -#pragma warning restore CS0618 // Type or member is obsolete + Task> GetAllInstalledPackagesAsync(); /// /// Returns installed packages collected from the package migration plans. @@ -48,20 +38,12 @@ public interface IPackagingService : IService InstalledPackage? GetInstalledPackageByName(string packageName); - [Obsolete("Use GetCreatedPackagesAsync instead. Scheduled for removal in Umbraco 15.")] - IEnumerable GetAllCreatedPackages(); - /// /// Returns the created packages as a paged model. /// /// The amount of items to skip. /// The amount of items to take. - Task> GetCreatedPackagesAsync(int skip, int take) - { - PackageDefinition[] packages = GetAllCreatedPackages().WhereNotNull().ToArray(); - var pagedModel = new PagedModel(packages.Length, packages.Skip(skip).Take(take)); - return Task.FromResult(pagedModel); - } + Task> GetCreatedPackagesAsync(int skip, int take); /// /// Returns a created package by id @@ -77,9 +59,6 @@ public interface IPackagingService : IService /// The package or null if the package was not found. Task GetCreatedPackageByKeyAsync(Guid key); - [Obsolete("Use DeleteCreatedPackageAsync instead. Scheduled for removal in Umbraco 15.")] - void DeleteCreatedPackage(int id, int userId = Constants.Security.SuperUserId); - /// /// Deletes a created package by key. /// @@ -87,13 +66,6 @@ public interface IPackagingService : IService /// Key of the user deleting the package. Task> DeleteCreatedPackageAsync(Guid key, Guid userKey); - /// - /// Persists a package definition to storage - /// - /// - [Obsolete("Use CreateCreatedPackageAsync or UpdateCreatedPackageAsync instead. Scheduled for removal in Umbraco 15.")] - bool SaveCreatedPackage(PackageDefinition definition); - /// /// Creates a new package. /// diff --git a/src/Umbraco.Core/Services/IPropertyTypeUsageService.cs b/src/Umbraco.Core/Services/IPropertyTypeUsageService.cs index 088d3b037b..df061ca628 100644 --- a/src/Umbraco.Core/Services/IPropertyTypeUsageService.cs +++ b/src/Umbraco.Core/Services/IPropertyTypeUsageService.cs @@ -4,14 +4,6 @@ namespace Umbraco.Cms.Core.Services; public interface IPropertyTypeUsageService { - /// - /// Checks if a property type has any saved property values associated with it. - /// - /// The alias of the property type to check. - /// True if the property type has any property values, otherwise false. - [Obsolete("Please use HasSavedPropertyValuesAsync. Scheduled for removable in Umbraco 15.")] - bool HasSavedPropertyValues(string propertyTypeAlias); - /// /// Checks if a property type has any saved property values associated with it. /// diff --git a/src/Umbraco.Core/Services/IPropertyValidationService.cs b/src/Umbraco.Core/Services/IPropertyValidationService.cs index 04ef31fb6a..5937aab40e 100644 --- a/src/Umbraco.Core/Services/IPropertyValidationService.cs +++ b/src/Umbraco.Core/Services/IPropertyValidationService.cs @@ -17,9 +17,6 @@ public interface IPropertyValidationService /// bool IsPropertyValid(IProperty property, PropertyValidationContext validationContext); - [Obsolete("Please use the overload that accepts a PropertyValidationContext. Will be removed in V16.")] - bool IsPropertyValid(IProperty property, string culture = "*", string segment = "*"); - /// /// Validates a property value. /// @@ -40,19 +37,4 @@ public interface IPropertyValidationService IPropertyType propertyType, object? postedValue, PropertyValidationContext validationContext); - - [Obsolete("Please use the overload that accepts a PropertyValidationContext. Will be removed in V16.")] - IEnumerable ValidatePropertyValue( - IDataEditor editor, - IDataType dataType, - object? postedValue, - bool isRequired, - string? validationRegExp, - string? isRequiredMessage, - string? validationRegExpMessage); - - [Obsolete("Please use the overload that accepts a PropertyValidationContext. Will be removed in V16.")] - IEnumerable ValidatePropertyValue( - IPropertyType propertyType, - object? postedValue); } diff --git a/src/Umbraco.Core/Services/ITemporaryMediaService.cs b/src/Umbraco.Core/Services/ITemporaryMediaService.cs deleted file mode 100644 index 2b4f00ab78..0000000000 --- a/src/Umbraco.Core/Services/ITemporaryMediaService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Umbraco.Cms.Core.Models; - -namespace Umbraco.Cms.Core.Services; - -[Obsolete($"This service has been superseded by {nameof(IMediaImportService)}. Will be removed in V16.")] -public interface ITemporaryMediaService -{ - public IMedia Save(string temporaryLocation, Guid? startNode, string? mediaTypeAlias); -} diff --git a/src/Umbraco.Core/Services/ITrackedReferencesService.cs b/src/Umbraco.Core/Services/ITrackedReferencesService.cs index c60156d31b..857eb21af1 100644 --- a/src/Umbraco.Core/Services/ITrackedReferencesService.cs +++ b/src/Umbraco.Core/Services/ITrackedReferencesService.cs @@ -4,52 +4,6 @@ namespace Umbraco.Cms.Core.Services; public interface ITrackedReferencesService { - /// - /// Gets a paged result of items which are in relation with the current item. - /// Basically, shows the items which depend on the current item. - /// - /// The identifier of the entity to retrieve relations for. - /// The page index. - /// The page size. - /// - /// A boolean indicating whether to filter only the RelationTypes which are - /// dependencies (isDependency field is set to true). - /// - /// A paged result of objects. - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - PagedResult GetPagedRelationsForItem(int id, long pageIndex, int pageSize, bool filterMustBeIsDependency); - - /// - /// Gets a paged result of the descending items that have any references, given a parent id. - /// - /// The unique identifier of the parent to retrieve descendants for. - /// The page index. - /// The page size. - /// - /// A boolean indicating whether to filter only the RelationTypes which are - /// dependencies (isDependency field is set to true). - /// - /// A paged result of objects. - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - PagedResult GetPagedDescendantsInReferences(int parentId, long pageIndex, int pageSize, bool filterMustBeIsDependency); - - /// - /// Gets a paged result of items used in any kind of relation from selected integer ids. - /// - /// The identifiers of the entities to check for relations. - /// The page index. - /// The page size. - /// - /// A boolean indicating whether to filter only the RelationTypes which are - /// dependencies (isDependency field is set to true). - /// - /// A paged result of objects. - [Obsolete("Use method that takes key (Guid) instead of id (int). This will be removed in Umbraco 15.")] - PagedResult GetPagedItemsWithRelations(int[] ids, long pageIndex, int pageSize, bool filterMustBeIsDependency); - - [Obsolete("Use method that takes key (Guid) instead of id (int). This will be removed in Umbraco 15.")] - PagedModel GetPagedRelationsForItem(int id, long skip, long take, bool filterMustBeIsDependency); - /// /// Gets a paged result of items which are in relation with the current item. /// Basically, shows the items which depend on the current item. @@ -64,9 +18,6 @@ public interface ITrackedReferencesService /// A paged result of objects. Task> GetPagedRelationsForItemAsync(Guid key, long skip, long take, bool filterMustBeIsDependency); - [Obsolete("Use method that takes key (Guid) instead of id (int). This will be removed in Umbraco 15.")] - PagedModel GetPagedDescendantsInReferences(int parentId, long skip, long take, bool filterMustBeIsDependency); - /// /// Gets a paged result of the descending items that have any references, given a parent id. /// @@ -80,10 +31,6 @@ public interface ITrackedReferencesService /// A paged result of objects. Task> GetPagedDescendantsInReferencesAsync(Guid parentKey, long skip, long take, bool filterMustBeIsDependency); - [Obsolete("Use method that takes keys (Guid) instead of ids (int). This will be removed in Umbraco 15.")] - PagedModel GetPagedItemsWithRelations(int[] ids, long skip, long take, - bool filterMustBeIsDependency); - /// /// Gets a paged result of items used in any kind of relation from selected integer ids. /// @@ -95,12 +42,7 @@ public interface ITrackedReferencesService /// dependencies (isDependency field is set to true). /// /// A paged result of objects. - Task> GetPagedItemsWithRelationsAsync(ISet keys, long skip, long take, - bool filterMustBeIsDependency); + Task> GetPagedItemsWithRelationsAsync(ISet keys, long skip, long take, bool filterMustBeIsDependency); - Task> GetPagedKeysWithDependentReferencesAsync(ISet keys, Guid nodeObjectTypeId, long skip, long take) - { - PagedModel pagedItems = GetPagedItemsWithRelationsAsync(keys, skip, take, true).GetAwaiter().GetResult(); - return Task.FromResult(new PagedModel(pagedItems.Total, pagedItems.Items.Select(i => i.NodeKey))); - } + Task> GetPagedKeysWithDependentReferencesAsync(ISet keys, Guid nodeObjectTypeId, long skip, long take); } diff --git a/src/Umbraco.Core/Services/ITwoFactorLoginService.cs b/src/Umbraco.Core/Services/ITwoFactorLoginService.cs index a5ad0d84e8..91e3299a0b 100644 --- a/src/Umbraco.Core/Services/ITwoFactorLoginService.cs +++ b/src/Umbraco.Core/Services/ITwoFactorLoginService.cs @@ -22,16 +22,6 @@ public interface ITwoFactorLoginService : IService /// Task GetSecretForUserAndProviderAsync(Guid userOrMemberKey, string providerName); - /// - /// Gets the setup info for a specific user or member and a specific provider. - /// - /// - /// The returned type can be anything depending on the setup providers. You will need to cast it to the type handled by - /// the provider. - /// - [Obsolete("Use IUserTwoFactorLoginService.GetSetupInfoAsync. This will be removed in Umbraco 15.")] - Task GetSetupInfoAsync(Guid userOrMemberKey, string providerName); - /// /// Gets all registered providers names. /// @@ -56,17 +46,4 @@ public interface ITwoFactorLoginService : IService /// Gets all the enabled 2FA providers for the user or member with the specified key. /// Task> GetEnabledTwoFactorProviderNamesAsync(Guid userOrMemberKey); - - /// - /// Disables 2FA with Code. - /// - [Obsolete("Use IUserTwoFactorLoginService.DisableByCodeAsync. This will be removed in Umbraco 15.")] - Task DisableWithCodeAsync(string providerName, Guid userOrMemberKey, string code); - - /// - /// Validates and Saves. - /// - [Obsolete("Use IUserTwoFactorLoginService.ValidateAndSaveAsync. This will be removed in Umbraco 15.")] - Task ValidateAndSaveAsync(string providerName, Guid userKey, string secret, string code); - } diff --git a/src/Umbraco.Core/Services/IUserService.cs b/src/Umbraco.Core/Services/IUserService.cs index cd600a083d..116e9301ab 100644 --- a/src/Umbraco.Core/Services/IUserService.cs +++ b/src/Umbraco.Core/Services/IUserService.cs @@ -322,66 +322,6 @@ public interface IUserService : IMembershipUserService /// IEnumerable GetAllNotInGroup(int groupId); - #region User groups - - /// - /// Gets all UserGroups or those specified as parameters - /// - /// Optional Ids of UserGroups to retrieve - /// An enumerable list of - [Obsolete("Use IUserGroupService.GetAsync instead, scheduled for removal in V15.")] - IEnumerable GetAllUserGroups(params int[] ids); - - /// - /// Gets a UserGroup by its Alias - /// - /// Alias of the UserGroup to retrieve - /// - /// - /// - [Obsolete("Use IUserGroupService.GetAsync instead, scheduled for removal in V15.")] - IEnumerable GetUserGroupsByAlias(params string[] alias); - - /// - /// Gets a UserGroup by its Alias - /// - /// Name of the UserGroup to retrieve - /// - /// - /// - [Obsolete("Use IUserGroupService.GetAsync instead, scheduled for removal in V15.")] - IUserGroup? GetUserGroupByAlias(string name); - - /// - /// Gets a UserGroup by its Id - /// - /// Id of the UserGroup to retrieve - /// - /// - /// - [Obsolete("Use IUserGroupService.GetAsync instead, scheduled for removal in V15.")] - IUserGroup? GetUserGroupById(int id); - - /// - /// Saves a UserGroup - /// - /// UserGroup to save - /// - /// If null than no changes are made to the users who are assigned to this group, however if a value is passed in - /// than all users will be removed from this group and only these users will be added - /// - [Obsolete("Use IUserGroupService.CreateAsync and IUserGroupService.UpdateAsync instead, scheduled for removal in V15.")] - void Save(IUserGroup userGroup, int[]? userIds = null); - - /// - /// Deletes a UserGroup - /// - /// UserGroup to delete - [Obsolete("Use IUserGroupService.DeleteAsync instead, scheduled for removal in V15.")] - void DeleteUserGroup(IUserGroup userGroup); - - #endregion - /// /// Verifies the reset code sent from the reset password mail for a given user. /// diff --git a/src/Umbraco.Core/Services/MediaService.cs b/src/Umbraco.Core/Services/MediaService.cs index 93431618b2..c98ba53267 100644 --- a/src/Umbraco.Core/Services/MediaService.cs +++ b/src/Umbraco.Core/Services/MediaService.cs @@ -1,7 +1,5 @@ using System.Globalization; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.IO; using Umbraco.Cms.Core.Models; @@ -12,7 +10,6 @@ using Umbraco.Cms.Core.Persistence.Querying; using Umbraco.Cms.Core.Persistence.Repositories; using Umbraco.Cms.Core.Scoping; using Umbraco.Cms.Core.Services.Changes; -using Umbraco.Cms.Core.Services.Navigation; using Umbraco.Cms.Core.Strings; using Umbraco.Extensions; @@ -55,30 +52,6 @@ namespace Umbraco.Cms.Core.Services _shortStringHelper = shortStringHelper; _userIdKeyResolver = userIdKeyResolver; } - [Obsolete("Use constructor that takes IUserIdKeyResolver as a parameter, scheduled for removal in V15")] - public MediaService( - ICoreScopeProvider provider, - MediaFileManager mediaFileManager, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IMediaRepository mediaRepository, - IAuditRepository auditRepository, - IMediaTypeRepository mediaTypeRepository, - IEntityRepository entityRepository, - IShortStringHelper shortStringHelper) - : this( - provider, - mediaFileManager, - loggerFactory, - eventMessagesFactory, - mediaRepository, - auditRepository, - mediaTypeRepository, - entityRepository, - shortStringHelper, - StaticServiceProvider.Instance.GetRequiredService()) - { - } #endregion diff --git a/src/Umbraco.Core/Services/MediaTypeService.cs b/src/Umbraco.Core/Services/MediaTypeService.cs index e6dcf15939..2ab943a9c7 100644 --- a/src/Umbraco.Core/Services/MediaTypeService.cs +++ b/src/Umbraco.Core/Services/MediaTypeService.cs @@ -1,6 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Notifications; @@ -39,57 +37,6 @@ public class MediaTypeService : ContentTypeServiceBase MediaService = mediaService; - [Obsolete("Use the constructor with all dependencies instead")] - public MediaTypeService( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IMediaService mediaService, - IMediaTypeRepository mediaTypeRepository, - IAuditRepository auditRepository, - IMediaTypeContainerRepository entityContainerRepository, - IEntityRepository entityRepository, - IEventAggregator eventAggregator) - : this( - provider, - loggerFactory, - eventMessagesFactory, - mediaService, - mediaTypeRepository, - auditRepository, - entityContainerRepository, - entityRepository, - eventAggregator, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [Obsolete("Use the constructor with all dependencies instead")] - public MediaTypeService( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IMediaService mediaService, - IMediaTypeRepository mediaTypeRepository, - IAuditRepository auditRepository, - IMediaTypeContainerRepository entityContainerRepository, - IEntityRepository entityRepository, - IEventAggregator eventAggregator, - IUserIdKeyResolver userIdKeyResolver) - : this( - provider, - loggerFactory, - eventMessagesFactory, - mediaService, - mediaTypeRepository, - auditRepository, - entityContainerRepository, - entityRepository, - eventAggregator, - userIdKeyResolver, - StaticServiceProvider.Instance.GetRequiredService()) - { - } protected override int[] ReadLockIds => MediaTypeLocks.ReadLockIds; diff --git a/src/Umbraco.Core/Services/MemberService.cs b/src/Umbraco.Core/Services/MemberService.cs index ee09f7d93a..86efb2abfd 100644 --- a/src/Umbraco.Core/Services/MemberService.cs +++ b/src/Umbraco.Core/Services/MemberService.cs @@ -338,10 +338,6 @@ namespace Umbraco.Cms.Core.Services return GetMemberFromRepository(id); } - [Obsolete($"Use {nameof(GetById)}. Will be removed in V15.")] - public IMember? GetByKey(Guid id) - => GetById(id); - /// /// Gets a list of paged objects /// @@ -395,7 +391,7 @@ namespace Umbraco.Cms.Core.Services Attempt asGuid = id.TryConvertTo(); if (asGuid.Success) { - return GetByKey(asGuid.Result); + return GetById(asGuid.Result); } Attempt asInt = id.TryConvertTo(); @@ -854,7 +850,7 @@ namespace Umbraco.Cms.Core.Services return OperationResult.Attempt.Succeed(evtMsgs); } - [Obsolete($"Use the {nameof(Save)} method that yields an Attempt. Will be removed in V15.")] + /// public void Save(IEnumerable members) => Save(members, Constants.Security.SuperUserId); diff --git a/src/Umbraco.Core/Services/MemberTypeService.cs b/src/Umbraco.Core/Services/MemberTypeService.cs index 8d62ee1ab8..c8313ad618 100644 --- a/src/Umbraco.Core/Services/MemberTypeService.cs +++ b/src/Umbraco.Core/Services/MemberTypeService.cs @@ -1,6 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Notifications; @@ -44,58 +42,6 @@ public class MemberTypeService : ContentTypeServiceBase()) - { - } - - [Obsolete("Please use the constructor taking all parameters. This constructor will be removed in V16.")] - public MemberTypeService( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IMemberService memberService, - IMemberTypeRepository memberTypeRepository, - IAuditRepository auditRepository, - IMemberTypeContainerRepository entityContainerRepository, - IEntityRepository entityRepository, - IEventAggregator eventAggregator, - IUserIdKeyResolver userIdKeyResolver) - : this( - provider, - loggerFactory, - eventMessagesFactory, - memberService, - memberTypeRepository, - auditRepository, - entityContainerRepository, - entityRepository, - eventAggregator, - userIdKeyResolver, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - // beware! order is important to avoid deadlocks protected override int[] ReadLockIds { get; } = { Constants.Locks.MemberTypes }; diff --git a/src/Umbraco.Core/Services/MetricsConsentService.cs b/src/Umbraco.Core/Services/MetricsConsentService.cs index 3a560e76d2..3a0cc46a0d 100644 --- a/src/Umbraco.Core/Services/MetricsConsentService.cs +++ b/src/Umbraco.Core/Services/MetricsConsentService.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Membership; using Umbraco.Cms.Core.Security; @@ -39,9 +39,6 @@ public class MetricsConsentService : IMetricsConsentService return analyticsLevel; } - [Obsolete("Please use SetConsentLevelAsync instead, scheduled for removal in V15")] - public void SetConsentLevel(TelemetryLevel telemetryLevel) => SetConsentLevelAsync(telemetryLevel).GetAwaiter().GetResult(); - public async Task SetConsentLevelAsync(TelemetryLevel telemetryLevel) { IUser? currentUser = _backOfficeSecurityAccessor.BackOfficeSecurity?.CurrentUser ?? await _userService.GetAsync(Constants.Security.SuperUserKey); diff --git a/src/Umbraco.Core/Services/PropertyTypeUsageService.cs b/src/Umbraco.Core/Services/PropertyTypeUsageService.cs index 3b9bba53ef..d22bdeb440 100644 --- a/src/Umbraco.Core/Services/PropertyTypeUsageService.cs +++ b/src/Umbraco.Core/Services/PropertyTypeUsageService.cs @@ -1,5 +1,3 @@ -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Persistence.Repositories; using Umbraco.Cms.Core.Scoping; using Umbraco.Cms.Core.Services.OperationStatus; @@ -12,14 +10,6 @@ public class PropertyTypeUsageService : IPropertyTypeUsageService private readonly IContentTypeService _contentTypeService; private readonly ICoreScopeProvider _scopeProvider; - [Obsolete("Use non-obsolete constructor. This will be removed in Umbraco 15.")] - public PropertyTypeUsageService( - IPropertyTypeUsageRepository propertyTypeUsageRepository, - ICoreScopeProvider scopeProvider): this(propertyTypeUsageRepository, StaticServiceProvider.Instance.GetRequiredService(), scopeProvider) - { - - } - public PropertyTypeUsageService( IPropertyTypeUsageRepository propertyTypeUsageRepository, IContentTypeService contentTypeService, @@ -30,15 +20,6 @@ public class PropertyTypeUsageService : IPropertyTypeUsageService _scopeProvider = scopeProvider; } - /// - [Obsolete("Please use HasSavedPropertyValuesAsync. Scheduled for removable in Umbraco 15.")] - public bool HasSavedPropertyValues(string propertyTypeAlias) - { - using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true); - - return _propertyTypeUsageRepository.HasSavedPropertyValues(propertyTypeAlias); - } - /// public async Task> HasSavedPropertyValuesAsync(Guid contentTypeKey, string propertyAlias) { diff --git a/src/Umbraco.Core/Services/PropertyValidationService.cs b/src/Umbraco.Core/Services/PropertyValidationService.cs index 1bed040ba1..5d759d90f0 100644 --- a/src/Umbraco.Core/Services/PropertyValidationService.cs +++ b/src/Umbraco.Core/Services/PropertyValidationService.cs @@ -1,7 +1,5 @@ using System.ComponentModel.DataAnnotations; -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Dictionary; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Validation; @@ -18,16 +16,6 @@ public class PropertyValidationService : IPropertyValidationService private readonly IValueEditorCache _valueEditorCache; private readonly ICultureDictionary _cultureDictionary; - [Obsolete("Use the constructor that accepts ICultureDictionary. Will be removed in V15.")] - public PropertyValidationService( - PropertyEditorCollection propertyEditors, - IDataTypeService dataTypeService, - ILocalizedTextService textService, - IValueEditorCache valueEditorCache) - : this(propertyEditors, dataTypeService, textService, valueEditorCache, StaticServiceProvider.Instance.GetRequiredService()) - { - } - public PropertyValidationService( PropertyEditorCollection propertyEditors, IDataTypeService dataTypeService, @@ -69,12 +57,6 @@ public class PropertyValidationService : IPropertyValidationService return ValidatePropertyValue(dataEditor, dataType, postedValue, propertyType.Mandatory, propertyType.ValidationRegExp, propertyType.MandatoryMessage, propertyType.ValidationRegExpMessage, validationContext); } - [Obsolete("Please use the overload that accepts a PropertyValidationContext. Will be removed in V16.")] - public IEnumerable ValidatePropertyValue( - IPropertyType propertyType, - object? postedValue) - => ValidatePropertyValue(propertyType, postedValue, PropertyValidationContext.Empty()); - /// public IEnumerable ValidatePropertyValue( IDataEditor editor, @@ -111,17 +93,6 @@ public class PropertyValidationService : IPropertyValidationService } } - [Obsolete("Please use the overload that accepts a PropertyValidationContext. Will be removed in V16.")] - public IEnumerable ValidatePropertyValue( - IDataEditor editor, - IDataType dataType, - object? postedValue, - bool isRequired, - string? validationRegExp, - string? isRequiredMessage, - string? validationRegExpMessage) - => ValidatePropertyValue(editor, dataType, postedValue, isRequired, validationRegExp, isRequiredMessage, validationRegExpMessage, PropertyValidationContext.Empty()); - /// public bool IsPropertyDataValid(IContent content, out IProperty[] invalidProperties, CultureImpact? impact) { @@ -175,10 +146,6 @@ public class PropertyValidationService : IPropertyValidationService return invalidProperties.Length == 0; } - [Obsolete("Please use the overload that accepts a PropertyValidationContext. Will be removed in V16.")] - public bool IsPropertyValid(IProperty property, string culture = "*", string segment = "*") - => IsPropertyValid(property, PropertyValidationContext.CultureAndSegment(culture, segment)); - /// public bool IsPropertyValid(IProperty property, PropertyValidationContext validationContext) { diff --git a/src/Umbraco.Core/Services/PublicAccessService.cs b/src/Umbraco.Core/Services/PublicAccessService.cs index 24bdbc78c0..61a6b186f0 100644 --- a/src/Umbraco.Core/Services/PublicAccessService.cs +++ b/src/Umbraco.Core/Services/PublicAccessService.cs @@ -1,8 +1,6 @@ using System.Globalization; using System.Runtime.InteropServices; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Entities; @@ -21,25 +19,6 @@ internal class PublicAccessService : RepositoryService, IPublicAccessService private readonly IContentService _contentService; private readonly IIdKeyMap _idKeyMap; - [Obsolete("Please use the constructor that accepts all parameter. Will be removed in V16.")] - public PublicAccessService( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IPublicAccessRepository publicAccessRepository, - IEntityService entityService, - IContentService contentService) - : this( - provider, - loggerFactory, - eventMessagesFactory, - publicAccessRepository, - entityService, - contentService, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - public PublicAccessService( ICoreScopeProvider provider, ILoggerFactory loggerFactory, diff --git a/src/Umbraco.Core/Services/RelationService.cs b/src/Umbraco.Core/Services/RelationService.cs index f912da7283..9166b1b548 100644 --- a/src/Umbraco.Core/Services/RelationService.cs +++ b/src/Umbraco.Core/Services/RelationService.cs @@ -1,6 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Entities; @@ -21,27 +19,6 @@ public class RelationService : RepositoryService, IRelationService private readonly IRelationRepository _relationRepository; private readonly IRelationTypeRepository _relationTypeRepository; - [Obsolete("Please use ctor that takes all parameters, scheduled for removal in V15")] - public RelationService( - ICoreScopeProvider uowProvider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IEntityService entityService, - IRelationRepository relationRepository, - IRelationTypeRepository relationTypeRepository, - IAuditRepository auditRepository) - : this( - uowProvider, - loggerFactory, - eventMessagesFactory, - entityService, - relationRepository, - relationTypeRepository, - auditRepository, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - public RelationService( ICoreScopeProvider uowProvider, ILoggerFactory loggerFactory, diff --git a/src/Umbraco.Core/Services/TemporaryMediaService.cs b/src/Umbraco.Core/Services/TemporaryMediaService.cs deleted file mode 100644 index 41f45e0a69..0000000000 --- a/src/Umbraco.Core/Services/TemporaryMediaService.cs +++ /dev/null @@ -1,106 +0,0 @@ -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.Extensions; -using Umbraco.Cms.Core.IO; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.Membership; -using Umbraco.Cms.Core.PropertyEditors; -using Umbraco.Cms.Core.Security; -using Umbraco.Cms.Core.Strings; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Core.Services; - -[Obsolete($"This service has been superseded by {nameof(IMediaImportService)}. Will be removed in V16.")] -public class TemporaryMediaService : ITemporaryMediaService -{ - private readonly IShortStringHelper _shortStringHelper; - private readonly MediaFileManager _mediaFileManager; - private readonly IMediaService _mediaService; - private readonly MediaUrlGeneratorCollection _mediaUrlGenerators; - private readonly IContentTypeBaseServiceProvider _contentTypeBaseServiceProvider; - private readonly IHostEnvironment _hostingEnvironment; - private readonly ILogger _logger; - private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; - private readonly IEntityService _entityService; - private readonly AppCaches _appCaches; - - public TemporaryMediaService( - IShortStringHelper shortStringHelper, - MediaFileManager mediaFileManager, - IMediaService mediaService, - MediaUrlGeneratorCollection mediaUrlGenerators, - IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, - IHostEnvironment hostingEnvironment, - ILogger logger, - IBackOfficeSecurityAccessor backOfficeSecurityAccessor, - IEntityService entityService, - AppCaches appCaches) - { - _shortStringHelper = shortStringHelper; - _mediaFileManager = mediaFileManager; - _mediaService = mediaService; - _mediaUrlGenerators = mediaUrlGenerators; - _contentTypeBaseServiceProvider = contentTypeBaseServiceProvider; - _hostingEnvironment = hostingEnvironment; - _logger = logger; - _backOfficeSecurityAccessor = backOfficeSecurityAccessor; - _entityService = entityService; - _appCaches = appCaches; - } - - public IMedia Save(string temporaryLocation, Guid? startNode, string? mediaTypeAlias) - { - IUser? user = _backOfficeSecurityAccessor?.BackOfficeSecurity?.CurrentUser; - int userId = user?.Id ?? Constants.Security.SuperUserId; - var absoluteTempImagePath = _hostingEnvironment.MapPathContentRoot(temporaryLocation); - var fileName = Path.GetFileName(absoluteTempImagePath); - var safeFileName = fileName.ToSafeFileName(_shortStringHelper); - var mediaItemName = safeFileName.ToFriendlyName(); - - IMedia mediaFile; - - if (startNode is null) - { - int[]? userStartNodes = user?.CalculateMediaStartNodeIds(_entityService, _appCaches); - - mediaFile = _mediaService.CreateMedia(mediaItemName, userStartNodes != null && userStartNodes.Any() ? userStartNodes[0] : Constants.System.Root, mediaTypeAlias ?? Constants.Conventions.MediaTypes.File, userId); - } - else - { - mediaFile = _mediaService.CreateMedia(mediaItemName, startNode.Value, mediaTypeAlias ?? Constants.Conventions.MediaTypes.File, userId); - } - - var fileInfo = new FileInfo(absoluteTempImagePath); - - FileStream? fileStream = fileInfo.OpenReadWithRetry(); - if (fileStream is null) - { - throw new InvalidOperationException("Could not acquire file stream"); - } - - using (fileStream) - { - mediaFile.SetValue(_mediaFileManager, _mediaUrlGenerators, _shortStringHelper, _contentTypeBaseServiceProvider, Constants.Conventions.Media.File, safeFileName, fileStream); - } - - _mediaService.Save(mediaFile, userId); - - // Delete temp file now that we have persisted it - var folderName = Path.GetDirectoryName(absoluteTempImagePath); - try - { - if (folderName is not null) - { - Directory.Delete(folderName, true); - } - } - catch (Exception ex) - { - _logger.LogError(ex, "Could not delete temp file or folder {FileName}", absoluteTempImagePath); - } - - return mediaFile; - } -} diff --git a/src/Umbraco.Core/Services/TrackedReferencesService.cs b/src/Umbraco.Core/Services/TrackedReferencesService.cs index d8103e6982..b193ee07be 100644 --- a/src/Umbraco.Core/Services/TrackedReferencesService.cs +++ b/src/Umbraco.Core/Services/TrackedReferencesService.cs @@ -1,5 +1,3 @@ -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Persistence.Repositories; using Umbraco.Cms.Core.Scoping; @@ -23,66 +21,6 @@ public class TrackedReferencesService : ITrackedReferencesService _entityService = entityService; } - [Obsolete("Please use ctor that does not take an IEntityService, scheduled for removal in V15")] - public TrackedReferencesService( - ITrackedReferencesRepository trackedReferencesRepository, - ICoreScopeProvider scopeProvider): this(trackedReferencesRepository, scopeProvider, StaticServiceProvider.Instance.GetRequiredService()) - { - - } - - /// - /// Gets a paged result of items which are in relation with the current item. - /// Basically, shows the items which depend on the current item. - /// - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - public PagedResult GetPagedRelationsForItem(int id, long pageIndex, int pageSize, bool filterMustBeIsDependency) - { - using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true); - IEnumerable items = _trackedReferencesRepository.GetPagedRelationsForItem(id, pageIndex, pageSize, filterMustBeIsDependency, out var totalItems); - - return new PagedResult(totalItems, pageIndex + 1, pageSize) { Items = items }; - } - - /// - /// Gets a paged result of items used in any kind of relation from selected integer ids. - /// - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - public PagedResult GetPagedItemsWithRelations(int[] ids, long pageIndex, int pageSize, bool filterMustBeIsDependency) - { - using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true); - IEnumerable items = _trackedReferencesRepository.GetPagedItemsWithRelations(ids, pageIndex, pageSize, filterMustBeIsDependency, out var totalItems); - - return new PagedResult(totalItems, pageIndex + 1, pageSize) { Items = items }; - } - - /// - /// Gets a paged result of the descending items that have any references, given a parent id. - /// - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - public PagedResult GetPagedDescendantsInReferences(int parentId, long pageIndex, int pageSize, bool filterMustBeIsDependency) - { - using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true); - - IEnumerable items = _trackedReferencesRepository.GetPagedDescendantsInReferences( - parentId, - pageIndex, - pageSize, - filterMustBeIsDependency, - out var totalItems); - return new PagedResult(totalItems, pageIndex + 1, pageSize) { Items = items }; - } - - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - public PagedModel GetPagedRelationsForItem(int id, long skip, long take, bool filterMustBeIsDependency) - { - using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true); - IEnumerable items = _trackedReferencesRepository.GetPagedRelationsForItem(id, skip, take, filterMustBeIsDependency, out var totalItems); - var pagedModel = new PagedModel(totalItems, items); - - return pagedModel; - } - public Task> GetPagedRelationsForItemAsync(Guid key, long skip, long take, bool filterMustBeIsDependency) { using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true); @@ -92,22 +30,6 @@ public class TrackedReferencesService : ITrackedReferencesService return Task.FromResult(pagedModel); } - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - public PagedModel GetPagedDescendantsInReferences(int parentId, long skip, long take, bool filterMustBeIsDependency) - { - using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true); - - IEnumerable items = _trackedReferencesRepository.GetPagedDescendantsInReferences( - parentId, - skip, - take, - filterMustBeIsDependency, - out var totalItems); - var pagedModel = new PagedModel(totalItems, items); - - return pagedModel; - } - public Task> GetPagedDescendantsInReferencesAsync(Guid parentKey, long skip, long take, bool filterMustBeIsDependency) { using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true); @@ -123,16 +45,6 @@ public class TrackedReferencesService : ITrackedReferencesService return Task.FromResult(pagedModel); } - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - public PagedModel GetPagedItemsWithRelations(int[] ids, long skip, long take, bool filterMustBeIsDependency) - { - using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true); - IEnumerable items = _trackedReferencesRepository.GetPagedItemsWithRelations(ids, skip, take, filterMustBeIsDependency, out var totalItems); - var pagedModel = new PagedModel(totalItems, items); - - return pagedModel; - } - public Task> GetPagedItemsWithRelationsAsync(ISet keys, long skip, long take, bool filterMustBeIsDependency) { using ICoreScope scope = _scopeProvider.CreateCoreScope(autoComplete: true); diff --git a/src/Umbraco.Core/Services/TwoFactorLoginService.cs b/src/Umbraco.Core/Services/TwoFactorLoginService.cs index cb888c61e8..b2ea06a38c 100644 --- a/src/Umbraco.Core/Services/TwoFactorLoginService.cs +++ b/src/Umbraco.Core/Services/TwoFactorLoginService.cs @@ -50,58 +50,6 @@ public class TwoFactorLoginService : ITwoFactorLoginService public async Task> GetEnabledTwoFactorProviderNamesAsync(Guid userOrMemberKey) => await GetEnabledProviderNamesAsync(userOrMemberKey); - /// - [Obsolete("Use DisableByCodeWithStatusAsync. This will be removed in Umbraco 15.")] - public async Task DisableWithCodeAsync(string providerName, Guid userOrMemberKey, string code) - { - var secret = await GetSecretForUserAndProviderAsync(userOrMemberKey, providerName); - - if (!_twoFactorSetupGenerators.TryGetValue(providerName, out ITwoFactorProvider? generator)) - { - throw new InvalidOperationException($"No ITwoFactorSetupGenerator found for provider: {providerName}"); - } - - var isValid = secret is not null && generator.ValidateTwoFactorPIN(secret, code); - - if (!isValid) - { - return false; - } - - return await DisableAsync(userOrMemberKey, providerName); - } - - [Obsolete("Use ValidateAndSaveWithStatusAsync. This will be removed in Umbraco 15.")] - public async Task ValidateAndSaveAsync(string providerName, Guid userOrMemberKey, string secret, string code) - { - try - { - var isValid = ValidateTwoFactorSetup(providerName, secret, code); - if (isValid == false) - { - return false; - } - - var twoFactorLogin = new TwoFactorLogin - { - Confirmed = true, - Secret = secret, - UserOrMemberKey = userOrMemberKey, - ProviderName = providerName, - }; - - await SaveAsync(twoFactorLogin); - - return true; - } - catch (Exception ex) - { - _logger.LogError(ex, "Could not log in with the provided one-time-password"); - } - - return false; - } - /// public async Task IsTwoFactorEnabledAsync(Guid userOrMemberKey) => (await GetEnabledProviderNamesAsync(userOrMemberKey)).Any(); @@ -114,28 +62,6 @@ public class TwoFactorLoginService : ITwoFactorLoginService .FirstOrDefault(x => x.ProviderName == providerName)?.Secret; } - /// - [Obsolete("Use GetSetupInfoWithStatusAsync(). This will be removed in Umbraco 15.")] - public async Task GetSetupInfoAsync(Guid userOrMemberKey, string providerName) - { - var secret = await GetSecretForUserAndProviderAsync(userOrMemberKey, providerName); - - // Dont allow to generate a new secrets if user already has one - if (!string.IsNullOrEmpty(secret)) - { - return default; - } - - secret = GenerateSecret(); - - if (!_twoFactorSetupGenerators.TryGetValue(providerName, out ITwoFactorProvider? generator)) - { - throw new InvalidOperationException($"No ITwoFactorSetupGenerator found for provider: {providerName}"); - } - - return await generator.GetSetupDataAsync(userOrMemberKey, secret); - } - /// public IEnumerable GetAllProviderNames() => _twoFactorSetupGenerators.Keys; diff --git a/src/Umbraco.Core/Services/UserService.cs b/src/Umbraco.Core/Services/UserService.cs index 659a98ea07..cd9acf2bfa 100644 --- a/src/Umbraco.Core/Services/UserService.cs +++ b/src/Umbraco.Core/Services/UserService.cs @@ -7,7 +7,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Editors; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Exceptions; @@ -53,49 +52,6 @@ internal partial class UserService : RepositoryService, IUserService private readonly ContentSettings _contentSettings; private readonly IUserIdKeyResolver _userIdKeyResolver; - [Obsolete("Use the constructor that takes an IUserIdKeyResolver instead. Scheduled for removal in V15.")] - public UserService( - ICoreScopeProvider provider, - ILoggerFactory loggerFactory, - IEventMessagesFactory eventMessagesFactory, - IUserRepository userRepository, - IUserGroupRepository userGroupRepository, - IOptions globalSettings, - IOptions securitySettings, - UserEditorAuthorizationHelper userEditorAuthorizationHelper, - IServiceScopeFactory serviceScopeFactory, - IEntityService entityService, - ILocalLoginSettingProvider localLoginSettingProvider, - IUserInviteSender inviteSender, - MediaFileManager mediaFileManager, - ITemporaryFileService temporaryFileService, - IShortStringHelper shortStringHelper, - IOptions contentSettings, - IIsoCodeValidator isoCodeValidator, - IUserForgotPasswordSender forgotPasswordSender) - : this( - provider, - loggerFactory, - eventMessagesFactory, - userRepository, - userGroupRepository, - globalSettings, - securitySettings, - userEditorAuthorizationHelper, - serviceScopeFactory, - entityService, - localLoginSettingProvider, - inviteSender, - mediaFileManager, - temporaryFileService, - shortStringHelper, - contentSettings, - isoCodeValidator, - forgotPasswordSender, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - public UserService( ICoreScopeProvider provider, ILoggerFactory loggerFactory, @@ -226,23 +182,6 @@ internal partial class UserService : RepositoryService, IUserService /// IUser IMembershipMemberService.CreateWithIdentity(string username, string email, string passwordValue, string memberTypeAlias, bool isApproved) => CreateUserWithIdentity(username, email, passwordValue, isApproved); - /// - /// Gets a User by its integer id - /// - /// Id - /// - /// - /// - [Obsolete("Please use GetAsync instead. Scheduled for removal in V15.")] - public IUser? GetById(int id) - { - using (ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true)) - { - Guid userKey = _userIdKeyResolver.GetAsync(id).GetAwaiter().GetResult(); - return _userRepository.Get(userKey); - } - } - /// /// Creates and persists a Member /// @@ -323,7 +262,25 @@ internal partial class UserService : RepositoryService, IUserService public IUser? GetByProviderKey(object id) { Attempt asInt = id.TryConvertTo(); - return asInt.Success ? GetById(asInt.Result) : null; + Guid? userKey = null; + if (asInt.Success) + { + userKey = _userIdKeyResolver.GetAsync(asInt.Result).GetAwaiter().GetResult(); + } + else if (Guid.TryParse(id.ToString(), out Guid idAsGuid)) + { + userKey = idAsGuid; + } + + if (userKey.HasValue is false) + { + return null; + } + + using (ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true)) + { + return _userRepository.Get(userKey.Value); + } } /// @@ -470,13 +427,6 @@ internal partial class UserService : RepositoryService, IUserService } } - /// - /// This is just the default user group that the membership provider will use - /// - /// - [Obsolete("No (backend) code path is using this anymore, so it can not be considered the default. Planned for removal in V16.")] - public string GetDefaultMemberType() => Constants.Security.WriterGroupAlias; - /// /// Finds a list of objects by a partial email string /// @@ -1938,173 +1888,6 @@ internal partial class UserService : RepositoryService, IUserService } } - /// - /// Gets all UserGroups or those specified as parameters - /// - /// Optional Ids of UserGroups to retrieve - /// An enumerable list of - [Obsolete("Use IUserGroupService.GetAsync instead, scheduled for removal in V15.")] - public IEnumerable GetAllUserGroups(params int[] ids) - { - using (ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true)) - { - return _userGroupRepository.GetMany(ids).OrderBy(x => x.Name); - } - } - - [Obsolete("Use IUserGroupService.GetAsync instead, scheduled for removal in V15.")] - public IEnumerable GetUserGroupsByAlias(params string[] aliases) - { - if (aliases.Length == 0) - { - return Enumerable.Empty(); - } - - using (ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true)) - { - IQuery query = Query().Where(x => aliases.SqlIn(x.Alias)); - IEnumerable contents = _userGroupRepository.Get(query); - return contents?.WhereNotNull().ToArray() ?? Enumerable.Empty(); - } - } - - /// - /// Gets a UserGroup by its Alias - /// - /// Alias of the UserGroup to retrieve - /// - /// - /// - [Obsolete("Use IUserGroupService.GetAsync instead, scheduled for removal in V15.")] - public IUserGroup? GetUserGroupByAlias(string alias) - { - if (string.IsNullOrWhiteSpace(alias)) - { - throw new ArgumentException("Value cannot be null or whitespace.", "alias"); - } - - using (ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true)) - { - IQuery query = Query().Where(x => x.Alias == alias); - IEnumerable contents = _userGroupRepository.Get(query); - return contents?.FirstOrDefault(); - } - } - - /// - /// Gets a UserGroup by its Id - /// - /// Id of the UserGroup to retrieve - /// - /// - /// - [Obsolete("Use IUserGroupService.GetAsync instead, scheduled for removal in V15.")] - public IUserGroup? GetUserGroupById(int id) - { - using (ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true)) - { - return _userGroupRepository.Get(id); - } - } - - /// - /// Saves a UserGroup. - /// - /// UserGroup to save. - /// - /// If null than no changes are made to the users who are assigned to this group, however if a value is passed in - /// than all users will be removed from this group and only these users will be added. - [Obsolete("Use IUserGroupService.CreateAsync and IUserGroupService.UpdateAsync instead, scheduled for removal in V15.")] - public void Save(IUserGroup userGroup, int[]? userIds = null) - { - EventMessages evtMsgs = EventMessagesFactory.Get(); - - using (ICoreScope scope = ScopeProvider.CreateCoreScope()) - { - // we need to figure out which users have been added / removed, for audit purposes - IUser[] empty = Array.Empty(); - IUser[] addedUsers = empty; - IUser[] removedUsers = empty; - - if (userIds != null) - { - IUser[] groupUsers = - userGroup.HasIdentity ? _userRepository.GetAllInGroup(userGroup.Id).ToArray() : empty; - var xGroupUsers = groupUsers.ToDictionary(x => x.Id, x => x); - var groupIds = groupUsers.Select(x => x.Id).ToArray(); - var addedUserKeys = new List(); - foreach (var userId in userIds.Except(groupIds)) - { - Guid userKey = _userIdKeyResolver.GetAsync(userId).GetAwaiter().GetResult(); - addedUserKeys.Add(userKey); - } - - IEnumerable addedUserIds = userIds.Except(groupIds); - - addedUsers = addedUserIds.Count() > 0 - ? _userRepository.GetMany(addedUserKeys.ToArray()).Where(x => x.Id != 0).ToArray() - : new IUser[] { }; - removedUsers = groupIds.Except(userIds).Select(x => xGroupUsers[x]).Where(x => x.Id != 0).ToArray(); - } - - var userGroupWithUsers = new UserGroupWithUsers(userGroup, addedUsers, removedUsers); - - // this is the default/expected notification for the IUserGroup entity being saved - var savingNotification = new UserGroupSavingNotification(userGroup, evtMsgs); - if (scope.Notifications.PublishCancelable(savingNotification)) - { - scope.Complete(); - return; - } - - // this is an additional notification for special auditing - var savingUserGroupWithUsersNotification = - new UserGroupWithUsersSavingNotification(userGroupWithUsers, evtMsgs); - if (scope.Notifications.PublishCancelable(savingUserGroupWithUsersNotification)) - { - scope.Complete(); - return; - } - - _userGroupRepository.AddOrUpdateGroupWithUsers(userGroup, userIds); - - scope.Notifications.Publish( - new UserGroupSavedNotification(userGroup, evtMsgs).WithStateFrom(savingNotification)); - scope.Notifications.Publish( - new UserGroupWithUsersSavedNotification(userGroupWithUsers, evtMsgs).WithStateFrom( - savingUserGroupWithUsersNotification)); - - scope.Complete(); - } - } - - /// - /// Deletes a UserGroup - /// - /// UserGroup to delete - [Obsolete("Use IUserGroupService.DeleteAsync instead, scheduled for removal in V15.")] - public void DeleteUserGroup(IUserGroup userGroup) - { - EventMessages evtMsgs = EventMessagesFactory.Get(); - - using (ICoreScope scope = ScopeProvider.CreateCoreScope()) - { - var deletingNotification = new UserGroupDeletingNotification(userGroup, evtMsgs); - if (scope.Notifications.PublishCancelable(deletingNotification)) - { - scope.Complete(); - return; - } - - _userGroupRepository.Delete(userGroup); - - scope.Notifications.Publish( - new UserGroupDeletedNotification(userGroup, evtMsgs).WithStateFrom(deletingNotification)); - - scope.Complete(); - } - } - public async Task> VerifyPasswordResetAsync(Guid userKey, string token) { var decoded = token.FromUrlBase64(); diff --git a/src/Umbraco.Core/Services/UserServiceExtensions.cs b/src/Umbraco.Core/Services/UserServiceExtensions.cs index bba70566a5..ec88d57653 100644 --- a/src/Umbraco.Core/Services/UserServiceExtensions.cs +++ b/src/Umbraco.Core/Services/UserServiceExtensions.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Globalization; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models.Membership; @@ -86,7 +85,4 @@ public static class UserServiceExtensions return asProfile ?? new UserProfile(user.Id, user.Name); }); } - - [Obsolete("Use IUserService.GetAsync that takes a Guid instead. Scheduled for removal in V15.")] - public static IUser? GetByKey(this IUserService userService, Guid key) => userService.GetAsync(key).GetAwaiter().GetResult(); } diff --git a/src/Umbraco.Core/Services/WebProfilerService.cs b/src/Umbraco.Core/Services/WebProfilerService.cs index 9a42e0ee57..af89c8bf1a 100644 --- a/src/Umbraco.Core/Services/WebProfilerService.cs +++ b/src/Umbraco.Core/Services/WebProfilerService.cs @@ -45,15 +45,5 @@ internal sealed class WebProfilerService : IWebProfilerService { //FIXME when we can get current user return Attempt.Succeed(-1); - -#pragma warning disable CS0162 // Unreachable code detected -#pragma warning disable CS0618 // Type or member is obsolete - Attempt? userIdAttempt = _backOfficeSecurityAccessor?.BackOfficeSecurity?.GetUserId(); -#pragma warning restore CS0618 // Type or member is obsolete -#pragma warning restore CS0162 // Unreachable code detected - - return (userIdAttempt.HasValue && userIdAttempt.Value.Success) - ? Attempt.Succeed(userIdAttempt.Value.Result) - : Attempt.Fail(0); } } diff --git a/src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs b/src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs index 74bc2fa9e8..ed16192bd1 100644 --- a/src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs +++ b/src/Umbraco.Core/Strings/Utf8ToAsciiConverter.cs @@ -11,11 +11,13 @@ namespace Umbraco.Cms.Core.Strings; /// public static class Utf8ToAsciiConverter { - [Obsolete("Use ToAsciiString(ReadOnlySpan..) instead")] - public static string ToAsciiString(string text, char fail = '?') - { - return ToAsciiString(text.AsSpan(), fail); - } + /// + /// Converts an Utf8 string into an Ascii string. + /// + /// The text to convert. + /// The character to use to replace characters that cannot properly be converted. + /// The converted text. + public static string ToAsciiString(string text, char fail = '?') => ToAsciiString(text.AsSpan(), fail); /// /// Converts an Utf8 string into an Ascii string. diff --git a/src/Umbraco.Core/Telemetry/ITelemetryService.cs b/src/Umbraco.Core/Telemetry/ITelemetryService.cs index b018cd4c40..6832a378e0 100644 --- a/src/Umbraco.Core/Telemetry/ITelemetryService.cs +++ b/src/Umbraco.Core/Telemetry/ITelemetryService.cs @@ -7,9 +7,6 @@ namespace Umbraco.Cms.Core.Telemetry; /// public interface ITelemetryService { - [Obsolete("Please use GetTelemetryReportDataAsync. Will be removed in V15.")] - bool TryGetTelemetryReportData(out TelemetryReportData? telemetryReportData); - /// /// Attempts to get the /// diff --git a/src/Umbraco.Core/Telemetry/TelemetryService.cs b/src/Umbraco.Core/Telemetry/TelemetryService.cs index c1ce0dfcc1..5a31fec4f6 100644 --- a/src/Umbraco.Core/Telemetry/TelemetryService.cs +++ b/src/Umbraco.Core/Telemetry/TelemetryService.cs @@ -36,14 +36,6 @@ internal class TelemetryService : ITelemetryService _metricsConsentService = metricsConsentService; } - [Obsolete("Please use GetTelemetryReportDataAsync. Will be removed in V15.")] - public bool TryGetTelemetryReportData(out TelemetryReportData? telemetryReportData) - { - telemetryReportData = GetTelemetryReportDataAsync().GetAwaiter().GetResult(); - - return telemetryReportData != null; - } - /// public async Task GetTelemetryReportDataAsync() { diff --git a/src/Umbraco.Core/UdiParserServiceConnectors.cs b/src/Umbraco.Core/UdiParserServiceConnectors.cs deleted file mode 100644 index ec30d7f1c8..0000000000 --- a/src/Umbraco.Core/UdiParserServiceConnectors.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Umbraco.Cms.Core.Composing; -using Umbraco.Cms.Core.Deploy; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Core; - -[Obsolete("This class will be removed in a future version.")] -public static class UdiParserServiceConnectors -{ - private static readonly Lock ScanLocker = new(); - - // notes - see U4-10409 - // if this class is used during application pre-start it cannot scans the assemblies, - // this is addressed by lazily-scanning, with the following caveats: - // - parsing a root udi still requires a scan and therefore still breaks - // - parsing an invalid udi ("umb://should-be-guid/") corrupts KnowUdiTypes - private static volatile bool _scanned; - - /// - /// Scan for deploy in assemblies for known UDI types. - /// - /// - [Obsolete("Use UdiParser.RegisterUdiType() instead. This method will be removed in a future version.")] - public static void ScanDeployServiceConnectorsForUdiTypes(TypeLoader typeLoader) - { - if (typeLoader is null) - { - throw new ArgumentNullException(nameof(typeLoader)); - } - - if (_scanned) - { - return; - } - - lock (ScanLocker) - { - // Scan for unknown UDI types - // there is no way we can get the "registered" service connectors, as registration - // happens in Deploy, not in Core, and the Udi class belongs to Core - therefore, we - // just pick every service connectors - just making sure that not two of them - // would register the same entity type, with different udi types (would not make - // much sense anyways) - IEnumerable connectors = typeLoader.GetTypes(); - var result = new Dictionary(); - foreach (Type connector in connectors) - { - IEnumerable - attrs = connector.GetCustomAttributes(false); - foreach (UdiDefinitionAttribute attr in attrs) - { - if (result.TryGetValue(attr.EntityType, out UdiType udiType) && udiType != attr.UdiType) - { - throw new Exception(string.Format( - "Entity type \"{0}\" is declared by more than one IServiceConnector, with different UdiTypes.", - attr.EntityType)); - } - - result[attr.EntityType] = attr.UdiType; - } - } - - // merge these into the known list - foreach (KeyValuePair item in result) - { - UdiParser.RegisterUdiType(item.Key, item.Value); - } - - _scanned = true; - } - } - - /// - /// Registers a single to add it's UDI type. - /// - /// - [Obsolete("Use UdiParser.RegisterUdiType() instead. This method will be removed in a future version.")] - public static void RegisterServiceConnector() - where T : IServiceConnector - { - var result = new Dictionary(); - Type connector = typeof(T); - IEnumerable attrs = connector.GetCustomAttributes(false); - foreach (UdiDefinitionAttribute attr in attrs) - { - if (result.TryGetValue(attr.EntityType, out UdiType udiType) && udiType != attr.UdiType) - { - throw new Exception(string.Format( - "Entity type \"{0}\" is declared by more than one IServiceConnector, with different UdiTypes.", - attr.EntityType)); - } - - result[attr.EntityType] = attr.UdiType; - } - - // merge these into the known list - foreach (KeyValuePair item in result) - { - UdiParser.RegisterUdiType(item.Key, item.Value); - } - } -} diff --git a/src/Umbraco.Core/Web/ICookieManager.cs b/src/Umbraco.Core/Web/ICookieManager.cs index 992c8fc827..acadf078b0 100644 --- a/src/Umbraco.Core/Web/ICookieManager.cs +++ b/src/Umbraco.Core/Web/ICookieManager.cs @@ -6,9 +6,6 @@ public interface ICookieManager string? GetCookieValue(string cookieName); - [Obsolete("Use overload with the httpOnly parameter instead. Scheduled for removal in V16.")] - void SetCookieValue(string cookieName, string value) => SetCookieValue(cookieName, value, false); - void SetCookieValue(string cookieName, string value, bool httpOnly); bool HasCookie(string cookieName); diff --git a/src/Umbraco.Core/Xml/DynamicContext.cs b/src/Umbraco.Core/Xml/DynamicContext.cs deleted file mode 100644 index 3cd638dd1c..0000000000 --- a/src/Umbraco.Core/Xml/DynamicContext.cs +++ /dev/null @@ -1,312 +0,0 @@ -using System.Xml; -using System.Xml.XPath; -using System.Xml.Xsl; - -// source: mvpxml.codeplex.com - -namespace Umbraco.Cms.Core.Xml -{ - /// - /// Provides the evaluation context for fast execution and custom - /// variables resolution. - /// - /// - /// This class is responsible for resolving variables during dynamic expression execution. - /// Discussed in http://weblogs.asp.net/cazzu/archive/2003/10/07/30888.aspx - /// Author: Daniel Cazzulino, blog - /// - [Obsolete("The current implementation is not used anymore and will be removed entirely in a future version. Scheduled for removal in v15")] - public class DynamicContext : XsltContext - { - #region Private vars - - private readonly IDictionary _variables = - new Dictionary(); - - #endregion Private - - #region Constructors & Initialization - - /// - /// Initializes a new instance of the class. - /// - public DynamicContext() - : base(new NameTable()) - { - } - - /// - /// Initializes a new instance of the - /// class with the specified . - /// - /// The NameTable to use. - public DynamicContext(NameTable table) - : base(table) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// A previously filled context with the namespaces to use. - public DynamicContext(XmlNamespaceManager context) - : this(context, new NameTable()) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// A previously filled context with the namespaces to use. - /// The NameTable to use. - public DynamicContext(XmlNamespaceManager context, NameTable table) - : base(table) - { - object xml = table.Add(XmlNamespaces.Xml); - object xmlns = table.Add(XmlNamespaces.XmlNs); - - if (context == null) - { - return; - } - - foreach (string prefix in context) - { - var uri = context.LookupNamespace(prefix); - // Use fast object reference comparison to omit forbidden namespace declarations. - if (Equals(uri, xml) || Equals(uri, xmlns)) - { - continue; - } - - if (uri == null) - { - continue; - } - - base.AddNamespace(prefix, uri); - } - } - - #endregion Constructors & Initialization - - #region Common Overrides - - /// - /// Implementation equal to . - /// - public override int CompareDocument(string baseUri, string nextbaseUri) => - string.Compare(baseUri, nextbaseUri, false, System.Globalization.CultureInfo.InvariantCulture); - - /// - /// Same as . - /// - public override string? LookupNamespace(string prefix) - { - var key = NameTable?.Get(prefix); - return key == null ? null : base.LookupNamespace(key); - } - - /// - /// Same as . - /// - public override string? LookupPrefix(string uri) - { - var key = NameTable?.Get(uri); - return key == null ? null : base.LookupPrefix(key); - } - - /// - /// Same as . - /// - public override bool PreserveWhitespace(XPathNavigator node) - { - return true; - } - - /// - /// Same as . - /// - public override bool Whitespace - { - get { return true; } - } - - #endregion Common Overrides - - #region Variable Handling Code - - /// - /// Adds the variable to the dynamic evaluation context. - /// - /// The name of the variable to add to the context. - /// The value of the variable to add to the context. - /// - /// Value type conversion for XPath evaluation is as follows: - /// - /// - /// CLR Type - /// XPath type - /// - /// - /// System.String - /// XPathResultType.String - /// - /// - /// System.Double (or types that can be converted to) - /// XPathResultType.Number - /// - /// - /// System.Boolean - /// XPathResultType.Boolean - /// - /// - /// System.Xml.XPath.XPathNavigator - /// XPathResultType.Navigator - /// - /// - /// System.Xml.XPath.XPathNodeIterator - /// XPathResultType.NodeSet - /// - /// - /// Others - /// XPathResultType.Any - /// - /// - /// See the topic "Compile, Select, Evaluate, and Matches with - /// XPath and XPathExpressions" in MSDN documentation for additional information. - /// - /// The is null. - public void AddVariable(string name, object value) - { - if (value == null) - { - throw new ArgumentNullException("value"); - } - - _variables[name] = new DynamicVariable(name, value); - } - - /// - /// See . Not used in our implementation. - /// - public override IXsltContextFunction ResolveFunction(string prefix, string name, XPathResultType[] argTypes) => throw new NotImplementedException(); - - /// - /// Resolves the dynamic variables added to the context. See . - /// - public override IXsltContextVariable ResolveVariable(string prefix, string name) - { - IXsltContextVariable var; - _variables.TryGetValue(name, out var!); - return var; - } - - #endregion Variable Handling Code - - #region Internal DynamicVariable class - - /// - /// Represents a variable during dynamic expression execution. - /// - internal class DynamicVariable : IXsltContextVariable - { - private readonly object _value; - - #region Public Members - - public string Name { get; } - - /// - /// Initializes a new instance of the class. - /// - /// The name of the variable. - /// The value of the variable. - public DynamicVariable(string name, object value) - { - - Name = name; - _value = value; - - if (value is string) - { - _type = XPathResultType.String; - } - else if (value is bool) - { - _type = XPathResultType.Boolean; - } - else if (value is XPathNavigator) - { - _type = XPathResultType.Navigator; - } - else if (value is XPathNodeIterator) - { - _type = XPathResultType.NodeSet; - } - else - { - // Try to convert to double (native XPath numeric type) - if (value is double) - { - _type = XPathResultType.Number; - } - else - { - if (value is IConvertible) - { - try - { - _value = Convert.ToDouble(value); - // We succeeded, so it's a number. - _type = XPathResultType.Number; - } - catch (FormatException) - { - _type = XPathResultType.Any; - } - catch (OverflowException) - { - _type = XPathResultType.Any; - } - } - else - { - _type = XPathResultType.Any; - } - } - } - } - - #endregion Public Members - - #region IXsltContextVariable Implementation - - XPathResultType IXsltContextVariable.VariableType - { - get { return _type; } - } - - private readonly XPathResultType _type; - - object IXsltContextVariable.Evaluate(XsltContext context) - { - return _value; - } - - bool IXsltContextVariable.IsLocal - { - get { return false; } - } - - bool IXsltContextVariable.IsParam - { - get { return false; } - } - - #endregion IXsltContextVariable Implementation - } - - #endregion Internal DynamicVariable class - } -} diff --git a/src/Umbraco.Core/Xml/XmlHelper.cs b/src/Umbraco.Core/Xml/XmlHelper.cs deleted file mode 100644 index 156d8e5b31..0000000000 --- a/src/Umbraco.Core/Xml/XmlHelper.cs +++ /dev/null @@ -1,528 +0,0 @@ -using System.Text.RegularExpressions; -using System.Xml; -using System.Xml.XPath; -using Umbraco.Cms.Core.Hosting; - -namespace Umbraco.Cms.Core.Xml; - -/// -/// The XmlHelper class contains general helper methods for working with xml in umbraco. -/// -[Obsolete("The current implementation is not used anymore and will be removed entirely in a future version. Scheduled for removal in v15")] -public class XmlHelper -{ - /// - /// Creates or sets an attribute on the XmlNode if an Attributes collection is available - /// - /// - /// - /// - /// - public static void SetAttribute(XmlDocument xml, XmlNode n, string name, string value) - { - if (xml == null) - { - throw new ArgumentNullException(nameof(xml)); - } - - if (n == null) - { - throw new ArgumentNullException(nameof(n)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (string.IsNullOrWhiteSpace(name)) - { - throw new ArgumentException( - "Value can't be empty or consist only of white-space characters.", - nameof(name)); - } - - if (n.Attributes == null) - { - return; - } - - if (n.Attributes[name] == null) - { - XmlAttribute a = xml.CreateAttribute(name); - a.Value = value; - n.Attributes.Append(a); - } - else - { - n.Attributes[name]!.Value = value; - } - } - - /// - /// Gets a value indicating whether a specified string contains only xml whitespace characters. - /// - /// The string. - /// true if the string contains only xml whitespace characters. - /// As per XML 1.1 specs, space, \t, \r and \n. - public static bool IsXmlWhitespace(string s) - { - // as per xml 1.1 specs - anything else is significant whitespace - s = s.Trim(Constants.CharArrays.XmlWhitespaceChars); - return s.Length == 0; - } - - /// - /// Creates a new XPathDocument from an xml string. - /// - /// The xml string. - /// An XPathDocument created from the xml string. - public static XPathDocument CreateXPathDocument(string xml) => - new XPathDocument(new XmlTextReader(new StringReader(xml))); - - /// - /// Tries to create a new XPathDocument from an xml string. - /// - /// The xml string. - /// The XPath document. - /// A value indicating whether it has been possible to create the document. - public static bool TryCreateXPathDocument(string xml, out XPathDocument? doc) - { - try - { - doc = CreateXPathDocument(xml); - return true; - } - catch (Exception) - { - doc = null; - return false; - } - } - - /// - /// Tries to create a new XPathDocument from a property value. - /// - /// The value of the property. - /// The XPath document. - /// A value indicating whether it has been possible to create the document. - /// The value can be anything... Performance-wise, this is bad. - public static bool TryCreateXPathDocumentFromPropertyValue(object value, out XPathDocument? doc) - { - // DynamicNode.ConvertPropertyValueByDataType first cleans the value by calling - // XmlHelper.StripDashesInElementOrAttributeName - this is because the XML is - // to be returned as a DynamicXml and element names such as "value-item" are - // invalid and must be converted to "valueitem". But we don't have that sort of - // problem here - and we don't need to bother with dashes nor dots, etc. - doc = null; - if (value is not string xml) - { - return false; // no a string - } - - if (CouldItBeXml(xml) == false) - { - return false; // string does not look like it's xml - } - - if (IsXmlWhitespace(xml)) - { - return false; // string is whitespace, xml-wise - } - - if (TryCreateXPathDocument(xml, out doc) == false) - { - return false; // string can't be parsed into xml - } - - XPathNavigator nav = doc!.CreateNavigator(); - if (nav.MoveToFirstChild()) - { - // SD: This used to do this but the razor macros and the entire razor macros section is gone, it was all legacy, it seems this method isn't even - // used apart from for tests so don't think this matters. In any case, we no longer check for this! - - // var name = nav.LocalName; // must not match an excluded tag - // if (UmbracoConfig.For.UmbracoSettings().Scripting.NotDynamicXmlDocumentElements.All(x => x.Element.InvariantEquals(name) == false)) return true; - return true; - } - - doc = null; - return false; - } - - /// - /// Sorts the children of a parentNode. - /// - /// The parent node. - /// An XPath expression to select children of to sort. - /// A function returning the value to order the nodes by. - public static void SortNodes( - XmlNode parentNode, - string childNodesXPath, - Func orderBy) - { - XmlNode[]? sortedChildNodes = parentNode.SelectNodes(childNodesXPath)?.Cast() - .OrderBy(orderBy) - .ToArray(); - - // append child nodes to last position, in sort-order - // so all child nodes will go after the property nodes - if (sortedChildNodes is not null) - { - foreach (XmlNode node in sortedChildNodes) - { - parentNode.AppendChild(node); // moves the node to the last position - } - } - } - - /// - /// Sorts a single child node of a parentNode. - /// - /// The parent node. - /// An XPath expression to select children of to sort. - /// The child node to sort. - /// A function returning the value to order the nodes by. - /// A value indicating whether sorting was needed. - /// - /// Assuming all nodes but are sorted, this will move the node to - /// the right position without moving all the nodes (as SortNodes would do) - should improve perfs. - /// - public static bool SortNode( - XmlNode parentNode, - string childNodesXPath, - XmlNode node, - Func orderBy) - { - var nodeSortOrder = orderBy(node); - Tuple[]? childNodesAndOrder = parentNode.SelectNodes(childNodesXPath)?.Cast() - .Select(x => Tuple.Create(x, orderBy(x))).ToArray(); - - // only one node = node is in the right place already, obviously - if (childNodesAndOrder is null || childNodesAndOrder.Length == 1) - { - return false; - } - - // find the first node with a sortOrder > node.sortOrder - var i = 0; - while (i < childNodesAndOrder.Length && childNodesAndOrder[i].Item2 <= nodeSortOrder) - { - i++; - } - - // if one was found - if (i < childNodesAndOrder.Length) - { - // and node is just before, we're done already - // else we need to move it right before the node that was found - if (i == 0 || childNodesAndOrder[i - 1].Item1 != node) - { - parentNode.InsertBefore(node, childNodesAndOrder[i].Item1); - return true; - } - } - else // i == childNodesAndOrder.Length && childNodesAndOrder.Length > 1 - { - // and node is the last one, we're done already - // else we need to append it as the last one - // (and i > 1, see above) - if (childNodesAndOrder[i - 1].Item1 != node) - { - parentNode.AppendChild(node); - return true; - } - } - - return false; - } - - /// - /// Opens a file as a XmlDocument. - /// - /// The relative file path. ie. /config/umbraco.config - /// - /// Returns a XmlDocument class - public static XmlDocument OpenAsXmlDocument(string filePath, IHostingEnvironment hostingEnvironment) - { - using (var reader = - new XmlTextReader(hostingEnvironment.MapPathContentRoot(filePath)) - { - WhitespaceHandling = WhitespaceHandling.All, - }) - { - var xmlDoc = new XmlDocument(); - - // Load the file into the XmlDocument - xmlDoc.Load(reader); - - return xmlDoc; - } - } - - /// - /// creates a XmlAttribute with the specified name and value - /// - /// The xmldocument. - /// The name of the attribute. - /// The value of the attribute. - /// a XmlAttribute - public static XmlAttribute AddAttribute(XmlDocument xd, string name, string value) - { - if (xd == null) - { - throw new ArgumentNullException(nameof(xd)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (string.IsNullOrWhiteSpace(name)) - { - throw new ArgumentException( - "Value can't be empty or consist only of white-space characters.", - nameof(name)); - } - - XmlAttribute temp = xd.CreateAttribute(name); - temp.Value = value; - return temp; - } - - /// - /// Creates a text XmlNode with the specified name and value - /// - /// The xmldocument. - /// The node name. - /// The node value. - /// a XmlNode - public static XmlNode AddTextNode(XmlDocument xd, string name, string value) - { - if (xd == null) - { - throw new ArgumentNullException(nameof(xd)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (string.IsNullOrWhiteSpace(name)) - { - throw new ArgumentException( - "Value can't be empty or consist only of white-space characters.", - nameof(name)); - } - - XmlNode temp = xd.CreateNode(XmlNodeType.Element, name, string.Empty); - temp.AppendChild(xd.CreateTextNode(value)); - return temp; - } - - /// - /// Sets or Creates a text XmlNode with the specified name and value - /// - /// The xmldocument. - /// The node to set or create the child text node on - /// The node name. - /// The node value. - /// a XmlNode - public static XmlNode SetTextNode(XmlDocument xd, XmlNode parent, string name, string value) - { - if (xd == null) - { - throw new ArgumentNullException(nameof(xd)); - } - - if (parent == null) - { - throw new ArgumentNullException(nameof(parent)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (string.IsNullOrWhiteSpace(name)) - { - throw new ArgumentException( - "Value can't be empty or consist only of white-space characters.", - nameof(name)); - } - - XmlNode? child = parent.SelectSingleNode(name); - if (child != null) - { - child.InnerText = value; - return child; - } - - return AddTextNode(xd, name, value); - } - - /// - /// Sets or creates an Xml node from its inner Xml. - /// - /// The xmldocument. - /// The node to set or create the child text node on - /// The node name. - /// The node inner Xml. - /// a XmlNode - public static XmlNode SetInnerXmlNode(XmlDocument xd, XmlNode parent, string name, string value) - { - if (xd == null) - { - throw new ArgumentNullException(nameof(xd)); - } - - if (parent == null) - { - throw new ArgumentNullException(nameof(parent)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (string.IsNullOrWhiteSpace(name)) - { - throw new ArgumentException( - "Value can't be empty or consist only of white-space characters.", - nameof(name)); - } - - XmlNode child = parent.SelectSingleNode(name) ?? xd.CreateNode(XmlNodeType.Element, name, string.Empty); - child.InnerXml = value; - return child; - } - - /// - /// Creates a cdata XmlNode with the specified name and value - /// - /// The xmldocument. - /// The node name. - /// The node value. - /// A XmlNode - public static XmlNode AddCDataNode(XmlDocument xd, string name, string value) - { - if (xd == null) - { - throw new ArgumentNullException(nameof(xd)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (string.IsNullOrWhiteSpace(name)) - { - throw new ArgumentException( - "Value can't be empty or consist only of white-space characters.", - nameof(name)); - } - - XmlNode temp = xd.CreateNode(XmlNodeType.Element, name, string.Empty); - temp.AppendChild(xd.CreateCDataSection(value)); - return temp; - } - - /// - /// Sets or Creates a cdata XmlNode with the specified name and value - /// - /// The xmldocument. - /// The node to set or create the child text node on - /// The node name. - /// The node value. - /// a XmlNode - public static XmlNode SetCDataNode(XmlDocument xd, XmlNode parent, string name, string value) - { - if (xd == null) - { - throw new ArgumentNullException(nameof(xd)); - } - - if (parent == null) - { - throw new ArgumentNullException(nameof(parent)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (string.IsNullOrWhiteSpace(name)) - { - throw new ArgumentException( - "Value can't be empty or consist only of white-space characters.", - nameof(name)); - } - - XmlNode? child = parent.SelectSingleNode(name); - if (child != null) - { - child.InnerXml = ""; - return child; - } - - return AddCDataNode(xd, name, value); - } - - /// - /// Gets the value of a XmlNode - /// - /// The XmlNode. - /// the value as a string - public static string GetNodeValue(XmlNode n) - { - var value = string.Empty; - if (n == null || n.FirstChild == null) - { - return value; - } - - value = n.FirstChild.Value ?? n.InnerXml; - return value.Replace("", "", "]]>"); - } - - /// - /// Determines whether the specified string appears to be XML. - /// - /// The XML string. - /// - /// true if the specified string appears to be XML; otherwise, false. - /// - public static bool CouldItBeXml(string? xml) - { - if (string.IsNullOrEmpty(xml)) - { - return false; - } - - xml = xml.Trim(); - return xml.StartsWith('<') && xml.EndsWith('>') && xml.Contains('/'); - } - - /// - /// Return a dictionary of attributes found for a string based tag - /// - /// - /// - public static Dictionary GetAttributesFromElement(string tag) - { - MatchCollection m = - Regex.Matches(tag, "(?\\S*)=\"(?[^\"]*)\"", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); - - // fix for issue 14862: return lowercase attributes for case insensitive matching - var d = m.ToDictionary( - attributeSet => attributeSet.Groups["attributeName"].Value.ToString().ToLower(), - attributeSet => attributeSet.Groups["attributeValue"].Value.ToString()); - return d; - } -} diff --git a/src/Umbraco.Examine.Lucene/DeliveryApiContentIndex.cs b/src/Umbraco.Examine.Lucene/DeliveryApiContentIndex.cs index 3195a6df7c..87a49cf613 100644 --- a/src/Umbraco.Examine.Lucene/DeliveryApiContentIndex.cs +++ b/src/Umbraco.Examine.Lucene/DeliveryApiContentIndex.cs @@ -20,17 +20,6 @@ public class DeliveryApiContentIndex : UmbracoExamineIndex // The special path and icon value transformations are not needed in this case protected override bool ApplySpecialValueTransformations => false; - [Obsolete("Use the constructor that takes an IDeliveryApiCompositeIdHandler instead, scheduled for removal in v15")] - public DeliveryApiContentIndex( - ILoggerFactory loggerFactory, - string name, - IOptionsMonitor indexOptions, - IHostingEnvironment hostingEnvironment, - IRuntimeState runtimeState) - : this(loggerFactory, name, indexOptions, hostingEnvironment, runtimeState, StaticServiceProvider.Instance.GetRequiredService()) - { - } - public DeliveryApiContentIndex( ILoggerFactory loggerFactory, string name, diff --git a/src/Umbraco.Infrastructure/BackgroundJobs/Jobs/ReportSiteJob.cs b/src/Umbraco.Infrastructure/BackgroundJobs/Jobs/ReportSiteJob.cs index c04a876f6c..7a5c1549b9 100644 --- a/src/Umbraco.Infrastructure/BackgroundJobs/Jobs/ReportSiteJob.cs +++ b/src/Umbraco.Infrastructure/BackgroundJobs/Jobs/ReportSiteJob.cs @@ -29,18 +29,6 @@ public class ReportSiteJob : IRecurringBackgroundJob private readonly IJsonSerializer _jsonSerializer; private readonly IHttpClientFactory _httpClientFactory; - [Obsolete("Use the constructor with IHttpClientFactory instead.")] - public ReportSiteJob( - ILogger logger, - ITelemetryService telemetryService, - IJsonSerializer jsonSerializer) - : this( - logger, - telemetryService, - jsonSerializer, - StaticServiceProvider.Instance.GetRequiredService()) - { } - public ReportSiteJob( ILogger logger, ITelemetryService telemetryService, diff --git a/src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs b/src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs index b294b7c021..1978d554dd 100644 --- a/src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs +++ b/src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs @@ -30,9 +30,6 @@ internal class JsonConfigManipulator : IConfigManipulator _logger = logger; } - public void RemoveConnectionString() - => RemoveConnectionStringAsync().GetAwaiter().GetResult(); - /// public async Task RemoveConnectionStringAsync() { @@ -52,9 +49,6 @@ internal class JsonConfigManipulator : IConfigManipulator await SaveJsonAsync(provider, jsonNode); } - public void SaveConnectionString(string connectionString, string? providerName) - => SaveConnectionStringAsync(connectionString, providerName).GetAwaiter().GetResult(); - /// public async Task SaveConnectionStringAsync(string connectionString, string? providerName) { @@ -76,9 +70,6 @@ internal class JsonConfigManipulator : IConfigManipulator await SaveJsonAsync(provider, node); } - public void SaveConfigValue(string key, object value) - => SaveConfigValueAsync(key, value).GetAwaiter().GetResult(); - /// public async Task SaveConfigValueAsync(string itemPath, object value) { @@ -106,16 +97,10 @@ internal class JsonConfigManipulator : IConfigManipulator await SaveJsonAsync(provider, node); } - public void SaveDisableRedirectUrlTracking(bool disable) - => SaveDisableRedirectUrlTrackingAsync(disable).GetAwaiter().GetResult(); - /// public async Task SaveDisableRedirectUrlTrackingAsync(bool disable) => await CreateOrUpdateConfigValueAsync(DisableRedirectUrlTrackingPath, disable); - public void SetGlobalId(string id) - => SetGlobalIdAsync(id).GetAwaiter().GetResult(); - /// public async Task SetGlobalIdAsync(string id) => await CreateOrUpdateConfigValueAsync(GlobalIdPath, id); diff --git a/src/Umbraco.Infrastructure/DeliveryApi/ApiRichTextElementParser.cs b/src/Umbraco.Infrastructure/DeliveryApi/ApiRichTextElementParser.cs index 52777cd860..54dc6b0b85 100644 --- a/src/Umbraco.Infrastructure/DeliveryApi/ApiRichTextElementParser.cs +++ b/src/Umbraco.Infrastructure/DeliveryApi/ApiRichTextElementParser.cs @@ -1,4 +1,4 @@ -using HtmlAgilityPack; +using HtmlAgilityPack; using Microsoft.Extensions.Logging; using Umbraco.Cms.Core.DeliveryApi; using Umbraco.Cms.Core.Models.Blocks; @@ -34,9 +34,6 @@ internal sealed class ApiRichTextElementParser : ApiRichTextParserBase, IApiRich _logger = logger; } - [Obsolete($"Please use the overload that accepts {nameof(RichTextBlockModel)}. Will be removed in V15.")] - public IRichTextElement? Parse(string html) => Parse(html, null); - public IRichTextElement? Parse(string html, RichTextBlockModel? richTextBlockModel) { try diff --git a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Examine.cs b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Examine.cs index 91413064f5..887b9e4305 100644 --- a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Examine.cs +++ b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Examine.cs @@ -44,7 +44,9 @@ public static partial class UmbracoBuilderExtensions true, factory.GetRequiredService(), factory.GetRequiredService(), - factory.GetRequiredService>())); + factory.GetRequiredService>(), + factory.GetRequiredService(), + factory.GetRequiredService())); builder.Services.AddUnique(factory => new ContentValueSetBuilder( factory.GetRequiredService(), @@ -55,7 +57,9 @@ public static partial class UmbracoBuilderExtensions false, factory.GetRequiredService(), factory.GetRequiredService(), - factory.GetRequiredService>())); + factory.GetRequiredService>(), + factory.GetRequiredService(), + factory.GetRequiredService())); builder.Services.AddUnique, MediaValueSetBuilder>(); builder.Services.AddUnique, MemberValueSetBuilder>(); builder.Services.AddUnique(); @@ -63,10 +67,10 @@ public static partial class UmbracoBuilderExtensions builder.Services.AddUnique(); builder.Services.AddSingleton(); - builder.Services.AddSingleton(); //TODO remove in Umbraco 15. Only the interface should be in the service provider - builder.Services.AddUnique(); + builder.Services.AddTransient(); + builder.AddNotificationHandler(); builder.AddNotificationHandler(); builder.AddNotificationHandler(); diff --git a/src/Umbraco.Infrastructure/Events/RelateOnTrashNotificationHandler.cs b/src/Umbraco.Infrastructure/Events/RelateOnTrashNotificationHandler.cs index 48113586b0..1c2064a78f 100644 --- a/src/Umbraco.Infrastructure/Events/RelateOnTrashNotificationHandler.cs +++ b/src/Umbraco.Infrastructure/Events/RelateOnTrashNotificationHandler.cs @@ -2,8 +2,6 @@ // See LICENSE for more details. using System.Globalization; -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Scoping; @@ -27,17 +25,6 @@ public sealed class RelateOnTrashNotificationHandler : private readonly IBackOfficeSecurityAccessor _backOfficeSecurityAccessor; private readonly ILocalizedTextService _textService; - [Obsolete("Use the new constructor instead, will be removed in V16")] - public RelateOnTrashNotificationHandler( - IRelationService relationService, - IEntityService entityService, - ILocalizedTextService textService, - IAuditService auditService, - IScopeProvider scopeProvider) - : this(relationService, entityService, textService, auditService, scopeProvider, StaticServiceProvider.Instance.GetRequiredService()) - { - } - public RelateOnTrashNotificationHandler( IRelationService relationService, IEntityService entityService, diff --git a/src/Umbraco.Infrastructure/Examine/ContentValueSetBuilder.cs b/src/Umbraco.Infrastructure/Examine/ContentValueSetBuilder.cs index a6aaedca4c..faf6d7d2ae 100644 --- a/src/Umbraco.Infrastructure/Examine/ContentValueSetBuilder.cs +++ b/src/Umbraco.Infrastructure/Examine/ContentValueSetBuilder.cs @@ -1,7 +1,5 @@ using Examine; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Membership; using Umbraco.Cms.Core.PropertyEditors; @@ -32,35 +30,6 @@ public class ContentValueSetBuilder : BaseValueSetBuilder, IContentVal private readonly IDocumentUrlService _documentUrlService; private readonly ILanguageService _languageService; - [Obsolete("Use the non-obsolete constructor. This will be removed in Umbraco 16.")] - public ContentValueSetBuilder( - PropertyEditorCollection propertyEditors, - UrlSegmentProviderCollection urlSegmentProviders, - IUserService userService, - IShortStringHelper shortStringHelper, - ICoreScopeProvider scopeProvider, - bool publishedValuesOnly, - ILocalizationService localizationService, - IContentTypeService contentTypeService, - ILogger logger) - : this( - propertyEditors, - urlSegmentProviders, - userService, - shortStringHelper, - scopeProvider, - publishedValuesOnly, - localizationService, - contentTypeService, - logger, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService() - ) - { - - } - - [Obsolete("Use the non-obsolete constructor. This will be removed in Umbraco 16.")] public ContentValueSetBuilder( PropertyEditorCollection propertyEditors, UrlSegmentProviderCollection urlSegmentProviders, @@ -85,6 +54,7 @@ public class ContentValueSetBuilder : BaseValueSetBuilder, IContentVal _documentUrlService = documentUrlService; _languageService = languageService; } + /// public override IEnumerable GetValueSets(params IContent[] content) { diff --git a/src/Umbraco.Infrastructure/Examine/Deferred/DeliveryApiContentIndexHandleContentTypeChanges.cs b/src/Umbraco.Infrastructure/Examine/Deferred/DeliveryApiContentIndexHandleContentTypeChanges.cs index 0cdfc10db6..ecc34de76d 100644 --- a/src/Umbraco.Infrastructure/Examine/Deferred/DeliveryApiContentIndexHandleContentTypeChanges.cs +++ b/src/Umbraco.Infrastructure/Examine/Deferred/DeliveryApiContentIndexHandleContentTypeChanges.cs @@ -1,9 +1,6 @@ -using Examine; +using Examine; using Examine.Search; -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core; using Umbraco.Cms.Core.DeliveryApi; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Services.Changes; @@ -23,17 +20,6 @@ internal sealed class DeliveryApiContentIndexHandleContentTypeChanges : Delivery private readonly IBackgroundTaskQueue _backgroundTaskQueue; private readonly IDeliveryApiCompositeIdHandler _deliveryApiCompositeIdHandler; - [Obsolete("Use the constructor that takes an IDeliveryApiCompositeIdHandler instead, scheduled for removal in v15")] - public DeliveryApiContentIndexHandleContentTypeChanges( - IList> changes, - DeliveryApiIndexingHandler deliveryApiIndexingHandler, - IDeliveryApiContentIndexValueSetBuilder deliveryApiContentIndexValueSetBuilder, - IContentService contentService, - IBackgroundTaskQueue backgroundTaskQueue) - : this(changes, deliveryApiIndexingHandler, deliveryApiContentIndexValueSetBuilder, contentService, backgroundTaskQueue, StaticServiceProvider.Instance.GetRequiredService()) - { - } - public DeliveryApiContentIndexHandleContentTypeChanges( IList> changes, DeliveryApiIndexingHandler deliveryApiIndexingHandler, diff --git a/src/Umbraco.Infrastructure/Examine/DeliveryApiContentIndexValueSetBuilder.cs b/src/Umbraco.Infrastructure/Examine/DeliveryApiContentIndexValueSetBuilder.cs index f55046b07a..7c76eaddd3 100644 --- a/src/Umbraco.Infrastructure/Examine/DeliveryApiContentIndexValueSetBuilder.cs +++ b/src/Umbraco.Infrastructure/Examine/DeliveryApiContentIndexValueSetBuilder.cs @@ -25,52 +25,6 @@ internal sealed class DeliveryApiContentIndexValueSetBuilder : IDeliveryApiConte private readonly ICoreScopeProvider _coreScopeProvider; private DeliveryApiSettings _deliveryApiSettings; - [Obsolete("Please use ctor that takes an IDeliveryApiCompositeIdHandler. Scheduled for removal in v15")] - public DeliveryApiContentIndexValueSetBuilder( - ContentIndexHandlerCollection contentIndexHandlerCollection, - IContentService contentService, - IPublicAccessService publicAccessService, - ILogger logger, - IDeliveryApiContentIndexFieldDefinitionBuilder deliveryApiContentIndexFieldDefinitionBuilder, - IOptionsMonitor deliveryApiSettings, - IMemberService memberService) - : this( - contentIndexHandlerCollection, - contentService, - publicAccessService, - logger, - deliveryApiContentIndexFieldDefinitionBuilder, - deliveryApiSettings, - memberService, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService() - ) - { - } - [Obsolete("Please use ctor that takes an IDeliveryApiCompositeIdHandler. Scheduled for removal in v15")] - public DeliveryApiContentIndexValueSetBuilder( - ContentIndexHandlerCollection contentIndexHandlerCollection, - IContentService contentService, - IPublicAccessService publicAccessService, - ILogger logger, - IDeliveryApiContentIndexFieldDefinitionBuilder deliveryApiContentIndexFieldDefinitionBuilder, - IOptionsMonitor deliveryApiSettings, - IMemberService memberService, - IDeliveryApiCompositeIdHandler deliveryApiCompositeIdHandle) - :this( - contentIndexHandlerCollection, - contentService, - publicAccessService, - logger, - deliveryApiContentIndexFieldDefinitionBuilder, - deliveryApiSettings, - memberService, - deliveryApiCompositeIdHandle, - StaticServiceProvider.Instance.GetRequiredService()) - { - - } - public DeliveryApiContentIndexValueSetBuilder( ContentIndexHandlerCollection contentIndexHandlerCollection, IContentService contentService, diff --git a/src/Umbraco.Infrastructure/Examine/DeliveryApiIndexingHandler.cs b/src/Umbraco.Infrastructure/Examine/DeliveryApiIndexingHandler.cs index 750cb4780b..9e3fd90f7d 100644 --- a/src/Umbraco.Infrastructure/Examine/DeliveryApiIndexingHandler.cs +++ b/src/Umbraco.Infrastructure/Examine/DeliveryApiIndexingHandler.cs @@ -1,8 +1,9 @@ -using Examine; +using Examine; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration.Models; +using Umbraco.Cms.Core.DeliveryApi; using Umbraco.Cms.Core.Scoping; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Services.Changes; @@ -28,6 +29,8 @@ internal sealed class DeliveryApiIndexingHandler : IDeliveryApiIndexingHandler private readonly IDeliveryApiContentIndexValueSetBuilder _deliveryApiContentIndexValueSetBuilder; private readonly IDeliveryApiContentIndexHelper _deliveryApiContentIndexHelper; private readonly IBackgroundTaskQueue _backgroundTaskQueue; + private readonly IDeliveryApiCompositeIdHandler _deliveryApiCompositeIdHandler; + public DeliveryApiIndexingHandler( ExamineIndexingMainDomHandler mainDomHandler, @@ -39,7 +42,8 @@ internal sealed class DeliveryApiIndexingHandler : IDeliveryApiIndexingHandler IPublicAccessService publicAccessService, IDeliveryApiContentIndexValueSetBuilder deliveryApiContentIndexValueSetBuilder, IDeliveryApiContentIndexHelper deliveryApiContentIndexHelper, - IBackgroundTaskQueue backgroundTaskQueue) + IBackgroundTaskQueue backgroundTaskQueue, + IDeliveryApiCompositeIdHandler deliveryApiCompositeIdHandler) { _mainDomHandler = mainDomHandler; _examineManager = examineManager; @@ -50,6 +54,8 @@ internal sealed class DeliveryApiIndexingHandler : IDeliveryApiIndexingHandler _deliveryApiContentIndexValueSetBuilder = deliveryApiContentIndexValueSetBuilder; _deliveryApiContentIndexHelper = deliveryApiContentIndexHelper; _backgroundTaskQueue = backgroundTaskQueue; + _deliveryApiCompositeIdHandler = deliveryApiCompositeIdHandler; + _enabled = new Lazy(IsEnabled); _deliveryApiSettings = deliveryApiSettings.CurrentValue; deliveryApiSettings.OnChange(settings => _deliveryApiSettings = settings); @@ -79,7 +85,8 @@ internal sealed class DeliveryApiIndexingHandler : IDeliveryApiIndexingHandler this, _deliveryApiContentIndexValueSetBuilder, _contentService, - _backgroundTaskQueue); + _backgroundTaskQueue, + _deliveryApiCompositeIdHandler); Execute(deferred); } diff --git a/src/Umbraco.Infrastructure/Examine/ExamineIndexRebuilder.cs b/src/Umbraco.Infrastructure/Examine/ExamineIndexRebuilder.cs index bcaa77da70..edf8deca86 100644 --- a/src/Umbraco.Infrastructure/Examine/ExamineIndexRebuilder.cs +++ b/src/Umbraco.Infrastructure/Examine/ExamineIndexRebuilder.cs @@ -10,8 +10,7 @@ using Umbraco.Cms.Infrastructure.HostedServices; namespace Umbraco.Cms.Infrastructure.Examine; -[Obsolete("This will be removed in Umbraco 15. Use IIndexRebuilder instead.")] // Main reason for this is to remove it form the service container. Maybe even make this internal -public class ExamineIndexRebuilder : IIndexRebuilder +internal class ExamineIndexRebuilder : IIndexRebuilder { private readonly IBackgroundTaskQueue _backgroundTaskQueue; private readonly IExamineManager _examineManager; diff --git a/src/Umbraco.Infrastructure/Examine/RebuildOnStartupHandler.cs b/src/Umbraco.Infrastructure/Examine/RebuildOnStartupHandler.cs index 1fb172c452..75753c229a 100644 --- a/src/Umbraco.Infrastructure/Examine/RebuildOnStartupHandler.cs +++ b/src/Umbraco.Infrastructure/Examine/RebuildOnStartupHandler.cs @@ -28,27 +28,6 @@ public sealed class RebuildOnStartupHandler : INotificationHandler, this will be removed in V16")] - public UnattendedUpgrader( - IProfilingLogger profilingLogger, - IUmbracoVersion umbracoVersion, - DatabaseBuilder databaseBuilder, - IRuntimeState runtimeState, - PackageMigrationRunner packageMigrationRunner) - : this( - profilingLogger, - umbracoVersion, - databaseBuilder, - runtimeState, - packageMigrationRunner, - StaticServiceProvider.Instance.GetRequiredService>()) - { - } - public async Task HandleAsync(RuntimeUnattendedUpgradeNotification notification, CancellationToken cancellationToken) { if (_runtimeState.RunUnattendedBootLogic()) diff --git a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs index 4915e68efa..7c6fea930d 100644 --- a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs +++ b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs @@ -190,7 +190,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install throw new InstallException("Didn't retrieve updated connection string within 10 seconds, try manual configuration instead."); } - Configure(_globalSettings.CurrentValue.InstallMissingDatabase || providerMeta.ForceCreateDatabase); + Configure(providerMeta.ForceCreateDatabase); } return true; diff --git a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs index 379a3a91da..b495bf7b00 100644 --- a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs +++ b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs @@ -20,6 +20,14 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install; internal class DatabaseDataCreator { + internal const string EditorGroupAlias = "editor"; + + internal const string SensitiveDataGroupAlias = "sensitiveData"; + + internal const string TranslatorGroupAlias = "translator"; + + internal const string WriterGroupAlias = "writer"; + internal static readonly LogViewerQueryDto[] _defaultLogQueries = [ new() @@ -1217,7 +1225,7 @@ internal class DatabaseDataCreator Key = Constants.Security.WriterGroupKey, StartMediaId = -1, StartContentId = -1, - Alias = Constants.Security.WriterGroupAlias, + Alias = WriterGroupAlias, Name = "Writers", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, @@ -1234,7 +1242,7 @@ internal class DatabaseDataCreator Key = Constants.Security.EditorGroupKey, StartMediaId = -1, StartContentId = -1, - Alias = Constants.Security.EditorGroupAlias, + Alias = EditorGroupAlias, Name = "Editors", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, @@ -1251,7 +1259,7 @@ internal class DatabaseDataCreator Key = Constants.Security.TranslatorGroupKey, StartMediaId = -1, StartContentId = -1, - Alias = Constants.Security.TranslatorGroupAlias, + Alias = TranslatorGroupAlias, Name = "Translators", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, @@ -1266,7 +1274,7 @@ internal class DatabaseDataCreator { Id = 5, Key = Constants.Security.SensitiveDataGroupKey, - Alias = Constants.Security.SensitiveDataGroupAlias, + Alias = SensitiveDataGroupAlias, Name = "Sensitive data", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, diff --git a/src/Umbraco.Infrastructure/Migrations/MigrationBase.cs b/src/Umbraco.Infrastructure/Migrations/MigrationBase.cs index 9e539a06a9..2bfc31231f 100644 --- a/src/Umbraco.Infrastructure/Migrations/MigrationBase.cs +++ b/src/Umbraco.Infrastructure/Migrations/MigrationBase.cs @@ -1,7 +1,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations; /// -[Obsolete("Use AsyncMigrationBase instead. This class will be removed in a future version.")] +[Obsolete("Use AsyncMigrationBase instead. Scheduled for removal in Umbraco 17.")] public abstract class MigrationBase : AsyncMigrationBase { /// diff --git a/src/Umbraco.Infrastructure/ModelsBuilder/Building/ModelsGenerator.cs b/src/Umbraco.Infrastructure/ModelsBuilder/Building/ModelsGenerator.cs index 408d89d143..e192f329e4 100644 --- a/src/Umbraco.Infrastructure/ModelsBuilder/Building/ModelsGenerator.cs +++ b/src/Umbraco.Infrastructure/ModelsBuilder/Building/ModelsGenerator.cs @@ -1,11 +1,8 @@ using System.Text; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Extensions; -using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment; namespace Umbraco.Cms.Infrastructure.ModelsBuilder.Building; @@ -16,30 +13,6 @@ public class ModelsGenerator : IModelsGenerator private readonly UmbracoServices _umbracoService; private ModelsBuilderSettings _config; - [Obsolete("Use a not obsoleted constructor instead. Scheduled for removal in v16")] - public ModelsGenerator(UmbracoServices umbracoService, IOptionsMonitor config, - OutOfDateModelsStatus outOfDateModels, IHostingEnvironment hostingEnvironment) - { - _umbracoService = umbracoService; - _config = config.CurrentValue; - _outOfDateModels = outOfDateModels; - config.OnChange(x => _config = x); - - _hostEnvironment = StaticServiceProvider.Instance.GetRequiredService(); - } - - [Obsolete("Use a not obsoleted constructor instead. Scheduled for removal in v16")] - public ModelsGenerator(UmbracoServices umbracoService, IOptionsMonitor config, - OutOfDateModelsStatus outOfDateModels, IHostingEnvironment hostingEnvironment, IHostEnvironment hostEnvironment) - { - _umbracoService = umbracoService; - _config = config.CurrentValue; - _outOfDateModels = outOfDateModels; - config.OnChange(x => _config = x); - - _hostEnvironment = hostEnvironment; - } - public ModelsGenerator(UmbracoServices umbracoService, IOptionsMonitor config, OutOfDateModelsStatus outOfDateModels, IHostEnvironment hostEnvironment) { diff --git a/src/Umbraco.Infrastructure/ModelsBuilder/ModelsGenerationError.cs b/src/Umbraco.Infrastructure/ModelsBuilder/ModelsGenerationError.cs index e7ee821875..46c72ed1ee 100644 --- a/src/Umbraco.Infrastructure/ModelsBuilder/ModelsGenerationError.cs +++ b/src/Umbraco.Infrastructure/ModelsBuilder/ModelsGenerationError.cs @@ -1,11 +1,8 @@ using System.Text; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Extensions; -using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment; namespace Umbraco.Cms.Infrastructure.ModelsBuilder; @@ -14,31 +11,6 @@ public sealed class ModelsGenerationError private readonly IHostEnvironment _hostEnvironment; private ModelsBuilderSettings _config; - /// - /// Initializes a new instance of the class. - /// - [Obsolete("Use a not obsoleted constructor instead. Scheduled for removal in v16")] - public ModelsGenerationError(IOptionsMonitor config, IHostingEnvironment hostingEnvironment) - { - _config = config.CurrentValue; - config.OnChange(x => _config = x); - _hostEnvironment = StaticServiceProvider.Instance.GetRequiredService(); - } - - /// - /// Initializes a new instance of the class. - /// - [Obsolete("Use a not obsoleted constructor instead. Scheduled for removal in v16")] - public ModelsGenerationError( - IOptionsMonitor config, - IHostingEnvironment hostingEnvironment, - IHostEnvironment hostEnvironment) - { - _config = config.CurrentValue; - config.OnChange(x => _config = x); - _hostEnvironment = hostEnvironment; - } - public ModelsGenerationError(IOptionsMonitor config, IHostEnvironment hostEnvironment) { _config = config.CurrentValue; diff --git a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs index 2915d8e835..977497c084 100644 --- a/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs +++ b/src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs @@ -78,42 +78,6 @@ namespace Umbraco.Cms.Infrastructure.Packaging _templateService = templateService; } - [Obsolete("Please use new constructor, scheduled for removal in v15")] - public PackageDataInstallation( - IDataValueEditorFactory dataValueEditorFactory, - ILogger logger, - IFileService fileService, - ILocalizationService localizationService, - IDataTypeService dataTypeService, - IEntityService entityService, - IContentTypeService contentTypeService, - IContentService contentService, - PropertyEditorCollection propertyEditors, - IScopeProvider scopeProvider, - IShortStringHelper shortStringHelper, - IConfigurationEditorJsonSerializer serializer, - IMediaService mediaService, - IMediaTypeService mediaTypeService) - : this( - dataValueEditorFactory, - logger, - fileService, - localizationService, - dataTypeService, - entityService, - contentTypeService, - contentService, - propertyEditors, - scopeProvider, - shortStringHelper, - serializer, - mediaService, - mediaTypeService, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService()) - { - } - // Also remove factory service registration when this constructor is removed [Obsolete("Use the constructor with Infrastructure.IScopeProvider and without global settings and hosting environment instead.")] public PackageDataInstallation( @@ -166,7 +130,7 @@ namespace Umbraco.Cms.Infrastructure.Packaging out IEnumerable dataTypeEntityContainersInstalled), LanguagesInstalled = ImportLanguages(compiledPackage.Languages, userId), DictionaryItemsInstalled = ImportDictionaryItems(compiledPackage.DictionaryItems, userId), - TemplatesInstalled = ImportTemplates(compiledPackage.Templates.ToList(), userId), + TemplatesInstalled = ImportTemplatesAsync(compiledPackage.Templates.ToList(), userId).GetAwaiter().GetResult(), DocumentTypesInstalled = ImportDocumentTypes(compiledPackage.DocumentTypes, userId, out IEnumerable documentTypeEntityContainersInstalled), @@ -1709,18 +1673,9 @@ namespace Umbraco.Cms.Infrastructure.Packaging #region Templates - [Obsolete("Use Async version instead, Scheduled to be removed in v17")] - public IEnumerable ImportTemplate(XElement templateElement, int userId) - => ImportTemplates(new[] { templateElement }, userId); - public async Task> ImportTemplateAsync(XElement templateElement, int userId) => ImportTemplatesAsync(new[] {templateElement}, userId).GetAwaiter().GetResult(); - - [Obsolete("Use Async version instead, Scheduled to be removed in v17")] - public IReadOnlyList ImportTemplates(IReadOnlyCollection templateElements, int userId) - => ImportTemplatesAsync(templateElements, userId).GetAwaiter().GetResult(); - /// /// Imports and saves package xml as /// diff --git a/src/Umbraco.Infrastructure/Persistence/DatabaseProviderMetadataExtensions.cs b/src/Umbraco.Infrastructure/Persistence/DatabaseProviderMetadataExtensions.cs index f2ed8c4cf2..005345b40f 100644 --- a/src/Umbraco.Infrastructure/Persistence/DatabaseProviderMetadataExtensions.cs +++ b/src/Umbraco.Infrastructure/Persistence/DatabaseProviderMetadataExtensions.cs @@ -20,7 +20,7 @@ public static class DatabaseProviderMetadataExtensions => databaseProviderMetadata.Where(x => (!onlyQuickInstall || x.SupportsQuickInstall) && x.IsAvailable).OrderBy(x => x.SortOrder); /// - /// Determines whether a database can be created for the specified provider name while ignoring the value of . + /// Determines whether a database can be created for the specified provider name. /// /// The database provider metadata. /// The database factory. diff --git a/src/Umbraco.Infrastructure/Persistence/DbProviderFactoryCreator.cs b/src/Umbraco.Infrastructure/Persistence/DbProviderFactoryCreator.cs index acb90da5b2..0f2c67c739 100644 --- a/src/Umbraco.Infrastructure/Persistence/DbProviderFactoryCreator.cs +++ b/src/Umbraco.Infrastructure/Persistence/DbProviderFactoryCreator.cs @@ -13,23 +13,6 @@ public class DbProviderFactoryCreator : IDbProviderFactoryCreator private readonly IDictionary _providerSpecificMapperFactories; private readonly IDictionary _syntaxProviders; - [Obsolete("Please use an alternative constructor.")] - public DbProviderFactoryCreator( - Func getFactory, - IEnumerable syntaxProviders, - IEnumerable bulkSqlInsertProviders, - IEnumerable databaseCreators, - IEnumerable providerSpecificMapperFactories) - : this( - getFactory, - syntaxProviders, - bulkSqlInsertProviders, - databaseCreators, - providerSpecificMapperFactories, - Enumerable.Empty()) - { - } - public DbProviderFactoryCreator( Func getFactory, IEnumerable syntaxProviders, diff --git a/src/Umbraco.Infrastructure/Persistence/IUmbracoDatabaseFactory.cs b/src/Umbraco.Infrastructure/Persistence/IUmbracoDatabaseFactory.cs index 8bb717e577..22bd4cda90 100644 --- a/src/Umbraco.Infrastructure/Persistence/IUmbracoDatabaseFactory.cs +++ b/src/Umbraco.Infrastructure/Persistence/IUmbracoDatabaseFactory.cs @@ -72,10 +72,6 @@ public interface IUmbracoDatabaseFactory : IDisposable /// void Configure(ConnectionStrings umbracoConnectionString); - [Obsolete("Please use alternative Configure method.")] - void Configure(string connectionString, string providerName) => - Configure(new ConnectionStrings { ConnectionString = connectionString, ProviderName = providerName }); - /// /// Configures the database factory for upgrades. /// diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/CreatedPackageSchemaRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/CreatedPackageSchemaRepository.cs index 75b1fcaff0..23556d9882 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/CreatedPackageSchemaRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/CreatedPackageSchemaRepository.cs @@ -1,12 +1,8 @@ using System.ComponentModel.DataAnnotations; using System.IO.Compression; using System.Xml.Linq; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; using NPoco; using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Hosting; using Umbraco.Cms.Core.IO; using Umbraco.Cms.Core.Models; @@ -80,81 +76,6 @@ public class CreatedPackageSchemaRepository : ICreatedPackagesRepository _tempFolderPath = tempFolderPath ?? Constants.SystemDirectories.TempData + "/PackageFiles"; } - [Obsolete("use ctor with all dependencies instead")] - public CreatedPackageSchemaRepository( - IUmbracoDatabaseFactory umbracoDatabaseFactory, - IHostingEnvironment hostingEnvironment, - IOptions globalSettings, - FileSystems fileSystems, - IEntityXmlSerializer serializer, - IDataTypeService dataTypeService, - ILocalizationService localizationService, - IFileService fileService, - IMediaService mediaService, - IMediaTypeService mediaTypeService, - IContentService contentService, - MediaFileManager mediaFileManager, - IContentTypeService contentTypeService, - IScopeAccessor scopeAccessor, - string? mediaFolderPath = null, - string? tempFolderPath = null) - : this( - hostingEnvironment, - fileSystems, - serializer, - dataTypeService, - fileService, - mediaService, - mediaTypeService, - contentService, - mediaFileManager, - contentTypeService, - scopeAccessor, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - mediaFolderPath, - tempFolderPath) - { - } - - [Obsolete("use ctor with all dependencies instead")] - public CreatedPackageSchemaRepository( - IUmbracoDatabaseFactory umbracoDatabaseFactory, - IHostingEnvironment hostingEnvironment, - IOptions globalSettings, - FileSystems fileSystems, - IEntityXmlSerializer serializer, - IDataTypeService dataTypeService, - ILocalizationService localizationService, - IFileService fileService, - IMediaService mediaService, - IMediaTypeService mediaTypeService, - IContentService contentService, - MediaFileManager mediaFileManager, - IContentTypeService contentTypeService, - string? mediaFolderPath = null, - string? tempFolderPath = null) - : this( - umbracoDatabaseFactory, - hostingEnvironment, - globalSettings, - fileSystems, - serializer, - dataTypeService, - localizationService, - fileService, - mediaService, - mediaTypeService, - contentService, - mediaFileManager, - contentTypeService, - StaticServiceProvider.Instance.GetRequiredService(), - mediaFolderPath, - tempFolderPath) - { - } - private IUmbracoDatabase Database => _scopeAccessor.AmbientScope?.Database ?? throw new InvalidOperationException("A scope is required to query the database"); public IEnumerable GetAll() diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DataTypeUsageRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DataTypeUsageRepository.cs index dd58cd0716..fc6b01f336 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DataTypeUsageRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DataTypeUsageRepository.cs @@ -15,29 +15,6 @@ public class DataTypeUsageRepository : IDataTypeUsageRepository _scopeAccessor = scopeAccessor; } - [Obsolete("Please use HasSavedValuesAsync. Scheduled for removable in Umbraco 15.")] - public bool HasSavedValues(int dataTypeId) - { - IUmbracoDatabase? database = _scopeAccessor.AmbientScope?.Database; - - if (database is null) - { - throw new InvalidOperationException("A scope is required to query the database"); - } - - Sql selectQuery = database.SqlContext.Sql() - .SelectAll() - .From("pt") - .InnerJoin("pd") - .On((left, right) => left.PropertyTypeId == right.Id, "pd", "pt") - .Where(pt => pt.DataTypeId == dataTypeId, "pt"); - - Sql hasValueQuery = database.SqlContext.Sql() - .SelectAnyIfExists(selectQuery); - - return database.ExecuteScalar(hasValueQuery); - } - public Task HasSavedValuesAsync(Guid dataTypeKey) { IUmbracoDatabase? database = _scopeAccessor.AmbientScope?.Database; diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/PropertyTypeUsageRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/PropertyTypeUsageRepository.cs index dc7ba7e1bd..e2dcbf77c7 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/PropertyTypeUsageRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/PropertyTypeUsageRepository.cs @@ -22,29 +22,6 @@ internal class PropertyTypeUsageRepository : IPropertyTypeUsageRepository _scopeAccessor = scopeAccessor; } - [Obsolete("Please use HasSavedPropertyValuesAsync. Scheduled for removable in Umbraco 15.")] - public bool HasSavedPropertyValues(string propertyTypeAlias) - { - IUmbracoDatabase? database = _scopeAccessor.AmbientScope?.Database; - - if (database is null) - { - throw new InvalidOperationException("A scope is required to query the database"); - } - - Sql selectQuery = database.SqlContext.Sql() - .SelectAll() - .From("m") - .InnerJoin("p") - .On((left, right) => left.PropertyTypeId == right.Id, "p", "m") - .Where(m => m.Alias == propertyTypeAlias, "m"); - - Sql hasValuesQuery = database.SqlContext.Sql() - .SelectAnyIfExists(selectQuery); - - return database.ExecuteScalar(hasValuesQuery); - } - public Task HasSavedPropertyValuesAsync(Guid contentTypeKey, string propertyAlias) { IUmbracoDatabase? database = _scopeAccessor.AmbientScope?.Database; diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TrackedReferencesRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TrackedReferencesRepository.cs index 2b7a43589c..3f97d951ef 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TrackedReferencesRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TrackedReferencesRepository.cs @@ -19,71 +19,6 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement _umbracoMapper = umbracoMapper; } - /// - /// Gets a page of items used in any kind of relation from selected integer ids. - /// - public IEnumerable GetPagedItemsWithRelations(int[] ids, long pageIndex, int pageSize, - bool filterMustBeIsDependency, out long totalRecords) - { - Sql innerUnionSql = GetInnerUnionSql(); - - Sql? sql = _scopeAccessor.AmbientScope?.Database.SqlContext.Sql() - .SelectDistinct( - "[x].[id] as nodeId", - "[n].[uniqueId] as nodeKey", - "[n].[text] as nodeName", - "[n].[nodeObjectType] as nodeObjectType", - "[d].[published] as nodePublished", - "[ct].[icon] as contentTypeIcon", - "[ct].[alias] as contentTypeAlias", - "[ctn].[text] as contentTypeName", - "[x].[alias] as relationTypeAlias", - "[x].[name] as relationTypeName", - "[x].[isDependency] as relationTypeIsDependency", - "[x].[dual] as relationTypeIsBidirectional") - .From("n") - .InnerJoinNested(innerUnionSql, "x") - .On((n, x) => n.NodeId == x.Id, "n", "x") - .LeftJoin("c") - .On( - (left, right) => left.NodeId == right.NodeId, - aliasLeft: "n", - aliasRight: "c") - .LeftJoin("ct") - .On( - (left, right) => left.ContentTypeId == right.NodeId, - aliasLeft: "c", - aliasRight: "ct") - .LeftJoin("ctn") - .On( - (left, right) => left.NodeId == right.NodeId, - aliasLeft: "ct", - aliasRight: "ctn") - .LeftJoin("d") - .On( - (left, right) => left.NodeId == right.NodeId, - aliasLeft: "n", - aliasRight: "d"); - - if (ids.Any()) - { - sql = sql?.Where(x => ids.Contains(x.NodeId), "n"); - } - - if (filterMustBeIsDependency) - { - sql = sql?.Where(rt => rt.IsDependency, "x"); - } - - // Ordering is required for paging - sql = sql?.OrderBy(x => x.Alias, "x"); - - Page? pagedResult = _scopeAccessor.AmbientScope?.Database.Page(pageIndex + 1, pageSize, sql); - totalRecords = Convert.ToInt32(pagedResult?.TotalItems); - - return pagedResult?.Items.Select(MapDtoToEntity) ?? Enumerable.Empty(); - } - private Sql GetInnerUnionSql() { if (_scopeAccessor.AmbientScope is null) @@ -131,146 +66,6 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement return innerUnionSql; } - /// - /// Gets a page of the descending items that have any references, given a parent id. - /// - public IEnumerable GetPagedDescendantsInReferences( - int parentId, - long pageIndex, - int pageSize, - bool filterMustBeIsDependency, - out long totalRecords) - { - SqlSyntax.ISqlSyntaxProvider? syntax = _scopeAccessor.AmbientScope?.Database.SqlContext.SqlSyntax; - - // Gets the path of the parent with ",%" added - Sql? subsubQuery = _scopeAccessor.AmbientScope?.Database.SqlContext.Sql() - .Select(syntax?.GetConcat("[node].[path]", "',%'")) - .From("node") - .Where(x => x.NodeId == parentId, "node"); - - // Gets the descendants of the parent node - Sql? subQuery = _scopeAccessor.AmbientScope?.Database.SqlContext.Sql() - .Select(x => x.NodeId) - .From() - .WhereLike(x => x.Path, subsubQuery); - - Sql innerUnionSql = GetInnerUnionSql(); - - Sql? sql = _scopeAccessor.AmbientScope?.Database.SqlContext.Sql().SelectDistinct( - "[x].[id] as nodeId", - "[n].[uniqueId] as nodeKey", - "[n].[text] as nodeName", - "[n].[nodeObjectType] as nodeObjectType", - "[d].[published] as nodePublished", - "[ct].[icon] as contentTypeIcon", - "[ct].[alias] as contentTypeAlias", - "[ctn].[text] as contentTypeName", - "[x].[alias] as relationTypeAlias", - "[x].[name] as relationTypeName", - "[x].[isDependency] as relationTypeIsDependency", - "[x].[dual] as relationTypeIsBidirectional") - .From("n") - .InnerJoinNested(innerUnionSql, "x") - .On((n, x) => n.NodeId == x.Id, "n", "x") - .LeftJoin("c") - .On( - (left, right) => left.NodeId == right.NodeId, - aliasLeft: "n", - aliasRight: "c") - .LeftJoin("ct") - .On( - (left, right) => left.ContentTypeId == right.NodeId, - aliasLeft: "c", - aliasRight: "ct") - .LeftJoin("ctn") - .On( - (left, right) => left.NodeId == right.NodeId, - aliasLeft: "ct", - aliasRight: "ctn") - .LeftJoin("d") - .On( - (left, right) => left.NodeId == right.NodeId, - aliasLeft: "n", - aliasRight: "d"); - - sql = sql?.WhereIn((System.Linq.Expressions.Expression>)(x => x.NodeId), subQuery, "n"); - - if (filterMustBeIsDependency) - { - sql = sql?.Where(rt => rt.IsDependency, "x"); - } - - // Ordering is required for paging - sql = sql?.OrderBy(x => x.Alias, "x"); - - Page? pagedResult = _scopeAccessor.AmbientScope?.Database.Page(pageIndex + 1, pageSize, sql); - totalRecords = Convert.ToInt32(pagedResult?.TotalItems); - - return pagedResult?.Items.Select(MapDtoToEntity) ?? Enumerable.Empty(); - } - - - /// - /// Gets a page of items which are in relation with the current item. - /// Basically, shows the items which depend on the current item. - /// - public IEnumerable GetPagedRelationsForItem(int id, long pageIndex, int pageSize, - bool filterMustBeIsDependency, out long totalRecords) - { - Sql innerUnionSql = GetInnerUnionSql(); - Sql? sql = _scopeAccessor.AmbientScope?.Database.SqlContext.Sql().SelectDistinct( - "[x].[otherId] as nodeId", - "[n].[uniqueId] as nodeKey", - "[n].[text] as nodeName", - "[n].[nodeObjectType] as nodeObjectType", - "[d].[published] as nodePublished", - "[ct].[icon] as contentTypeIcon", - "[ct].[alias] as contentTypeAlias", - "[ctn].[text] as contentTypeName", - "[x].[alias] as relationTypeAlias", - "[x].[name] as relationTypeName", - "[x].[isDependency] as relationTypeIsDependency", - "[x].[dual] as relationTypeIsBidirectional") - .From("n") - .InnerJoinNested(innerUnionSql, "x") - .On((n, x) => n.NodeId == x.OtherId, "n", "x") - .LeftJoin("c") - .On( - (left, right) => left.NodeId == right.NodeId, - aliasLeft: "n", - aliasRight: "c") - .LeftJoin("ct") - .On( - (left, right) => left.ContentTypeId == right.NodeId, - aliasLeft: "c", - aliasRight: "ct") - .LeftJoin("ctn") - .On( - (left, right) => left.NodeId == right.NodeId, - aliasLeft: "ct", - aliasRight: "ctn") - .LeftJoin("d") - .On( - (left, right) => left.NodeId == right.NodeId, - aliasLeft: "n", - aliasRight: "d") - .Where(x => x.Id == id, "x"); - - if (filterMustBeIsDependency) - { - sql = sql?.Where(rt => rt.IsDependency, "x"); - } - - // Ordering is required for paging - sql = sql?.OrderBy(x => x.Alias, "x"); - - Page? pagedResult = _scopeAccessor.AmbientScope?.Database.Page(pageIndex + 1, pageSize, sql); - totalRecords = Convert.ToInt32(pagedResult?.TotalItems); - - return pagedResult?.Items.Select(MapDtoToEntity) ?? Enumerable.Empty(); - } - public IEnumerable GetPagedRelationsForItem( Guid key, long skip, @@ -346,73 +141,6 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement return _umbracoMapper.MapEnumerable(pagedResult); } - [Obsolete("Use overload that takes key instead of id. This will be removed in Umbraco 15.")] - public IEnumerable GetPagedRelationsForItem( - int id, - long skip, - long take, - bool filterMustBeIsDependency, - out long totalRecords) - { - Sql innerUnionSql = GetInnerUnionSql(); - Sql? sql = _scopeAccessor.AmbientScope?.Database.SqlContext.Sql().SelectDistinct( - "[x].[otherId] as nodeId", - "[n].[uniqueId] as nodeKey", - "[n].[text] as nodeName", - "[n].[nodeObjectType] as nodeObjectType", - "[ct].[icon] as contentTypeIcon", - "[ct].[alias] as contentTypeAlias", - "[ctn].[text] as contentTypeName", - "[x].[alias] as relationTypeAlias", - "[x].[name] as relationTypeName", - "[x].[isDependency] as relationTypeIsDependency", - "[x].[dual] as relationTypeIsBidirectional") - .From("n") - .InnerJoinNested(innerUnionSql, "x") - .On((n, x) => n.NodeId == x.OtherId, "n", "x") - .LeftJoin("c").On( - (left, right) => left.NodeId == right.NodeId, - aliasLeft: "n", - aliasRight: "c") - .LeftJoin("ct") - .On( - (left, right) => left.ContentTypeId == right.NodeId, - aliasLeft: "c", - aliasRight: "ct") - .LeftJoin("ctn").On( - (left, right) => left.NodeId == right.NodeId, - aliasLeft: "ct", - aliasRight: "ctn") - .Where(x => x.Id == id, "x"); - - if (filterMustBeIsDependency) - { - sql = sql?.Where(rt => rt.IsDependency, "x"); - } - - // find the count before ordering - totalRecords = _scopeAccessor.AmbientScope?.Database.Count(sql!) ?? 0; - - RelationItemDto[] pagedResult; - - //Only to all this, if there is items - if (totalRecords > 0) - { - // Ordering is required for paging - sql = sql?.OrderBy(x => x.Alias, "x"); - - pagedResult = - _scopeAccessor.AmbientScope?.Database.SkipTake(skip, take, sql).ToArray() ?? - Array.Empty(); - } - else - { - pagedResult = Array.Empty(); - } - - return _umbracoMapper.MapEnumerable(pagedResult); - } - public IEnumerable GetPagedItemsWithRelations( ISet keys, long skip, @@ -606,155 +334,6 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement return _umbracoMapper.MapEnumerable(pagedResult); } - [Obsolete("Use overload that takes keys instead of ids. This will be removed in Umbraco 15.")] - public IEnumerable GetPagedItemsWithRelations( - int[] ids, - long skip, - long take, - bool filterMustBeIsDependency, - out long totalRecords) - { - Sql innerUnionSql = GetInnerUnionSql(); - Sql? sql = _scopeAccessor.AmbientScope?.Database.SqlContext.Sql().SelectDistinct( - "[x].[id] as nodeId", - "[n].[uniqueId] as nodeKey", - "[n].[text] as nodeName", - "[n].[nodeObjectType] as nodeObjectType", - "[ct].[icon] as contentTypeIcon", - "[ct].[alias] as contentTypeAlias", - "[ctn].[text] as contentTypeName", - "[x].[alias] as relationTypeAlias", - "[x].[name] as relationTypeName", - "[x].[isDependency] as relationTypeIsDependency", - "[x].[dual] as relationTypeIsBidirectional") - .From("n") - .InnerJoinNested(innerUnionSql, "x") - .On((n, x) => n.NodeId == x.Id, "n", "x") - .LeftJoin("c") - .On((left, right) => left.NodeId == right.NodeId, aliasLeft: "n", aliasRight: "c") - .LeftJoin("ct") - .On((left, right) => left.ContentTypeId == right.NodeId, aliasLeft: "c", - aliasRight: "ct") - .LeftJoin("ctn") - .On((left, right) => left.NodeId == right.NodeId, aliasLeft: "ct", - aliasRight: "ctn"); - if (ids.Any()) - { - sql = sql?.Where(x => ids.Contains(x.NodeId), "n"); - } - - if (filterMustBeIsDependency) - { - sql = sql?.Where(rt => rt.IsDependency, "x"); - } - - // find the count before ordering - totalRecords = _scopeAccessor.AmbientScope?.Database.Count(sql!) ?? 0; - - RelationItemDto[] pagedResult; - - //Only to all this, if there is items - if (totalRecords > 0) - { - // Ordering is required for paging - sql = sql?.OrderBy(x => x.Alias, "x"); - - pagedResult = - _scopeAccessor.AmbientScope?.Database.SkipTake(skip, take, sql).ToArray() ?? - Array.Empty(); - } - else - { - pagedResult = Array.Empty(); - } - - return _umbracoMapper.MapEnumerable(pagedResult); - } - - public IEnumerable GetPagedDescendantsInReferences( - int parentId, - long skip, - long take, - bool filterMustBeIsDependency, - out long totalRecords) - { - SqlSyntax.ISqlSyntaxProvider? syntax = _scopeAccessor.AmbientScope?.Database.SqlContext.SqlSyntax; - - // Gets the path of the parent with ",%" added - Sql? subsubQuery = _scopeAccessor.AmbientScope?.Database.SqlContext.Sql() - .Select(syntax?.GetConcat("[node].[path]", "',%'")) - .From("node") - .Where(x => x.NodeId == parentId, "node"); - - // Gets the descendants of the parent node - Sql? subQuery = _scopeAccessor.AmbientScope?.Database.SqlContext.Sql() - .Select(x => x.NodeId) - .From() - .WhereLike(x => x.Path, subsubQuery); - - Sql innerUnionSql = GetInnerUnionSql(); - Sql? sql = _scopeAccessor.AmbientScope?.Database.SqlContext.Sql().SelectDistinct( - "[x].[id] as nodeId", - "[n].[uniqueId] as nodeKey", - "[n].[text] as nodeName", - "[n].[nodeObjectType] as nodeObjectType", - "[ct].[icon] as contentTypeIcon", - "[ct].[alias] as contentTypeAlias", - "[ctn].[text] as contentTypeName", - "[x].[alias] as relationTypeAlias", - "[x].[name] as relationTypeName", - "[x].[isDependency] as relationTypeIsDependency", - "[x].[dual] as relationTypeIsBidirectional") - .From("n") - .InnerJoinNested(innerUnionSql, "x") - .On((n, x) => n.NodeId == x.Id, "n", "x") - .LeftJoin("c").On( - (left, right) => left.NodeId == right.NodeId, - aliasLeft: "n", - aliasRight: "c") - .LeftJoin("ct") - .On( - (left, right) => left.ContentTypeId == right.NodeId, - aliasLeft: "c", - aliasRight: "ct") - .LeftJoin("ctn") - .On( - (left, right) => left.NodeId == right.NodeId, - aliasLeft: "ct", - aliasRight: "ctn"); - sql = sql?.WhereIn( - (System.Linq.Expressions.Expression>)(x => x.NodeId), - subQuery, - "n"); - - if (filterMustBeIsDependency) - { - sql = sql?.Where(rt => rt.IsDependency, "x"); - } - - // find the count before ordering - totalRecords = _scopeAccessor.AmbientScope?.Database.Count(sql!) ?? 0; - - RelationItemDto[] pagedResult; - - //Only to all this, if there is items - if (totalRecords > 0) - { - // Ordering is required for paging - sql = sql?.OrderBy(x => x.Alias, "x"); - - pagedResult = - _scopeAccessor.AmbientScope?.Database.SkipTake(skip, take, sql).ToArray() ?? - Array.Empty(); - } - else - { - pagedResult = Array.Empty(); - } - - return _umbracoMapper.MapEnumerable(pagedResult); - } - private class UnionHelperDto { [Column("id")] public int Id { get; set; } diff --git a/src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyValueEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyValueEditor.cs index d157b223b3..a129dce83f 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyValueEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/BlockEditorPropertyValueEditor.cs @@ -20,25 +20,6 @@ public abstract class BlockEditorPropertyValueEditor : BlockVal where TValue : BlockValue, new() where TLayout : class, IBlockLayoutItem, new() { - [Obsolete("Please use the non-obsolete constructor. Will be removed in V16.")] - protected BlockEditorPropertyValueEditor( - DataEditorAttribute attribute, - PropertyEditorCollection propertyEditors, - DataValueReferenceFactoryCollection dataValueReferenceFactories, - IDataTypeConfigurationCache dataTypeConfigurationCache, - ILocalizedTextService textService, - ILogger> logger, - IShortStringHelper shortStringHelper, - IJsonSerializer jsonSerializer, - IIOHelper ioHelper) - : this(propertyEditors, dataValueReferenceFactories, dataTypeConfigurationCache, shortStringHelper, jsonSerializer, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - ioHelper, - attribute) - { - } - protected BlockEditorPropertyValueEditor( PropertyEditorCollection propertyEditors, DataValueReferenceFactoryCollection dataValueReferenceFactories, diff --git a/src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditor.cs index 816fad7098..fb1e7e3b87 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditor.cs @@ -30,20 +30,6 @@ public class BlockListPropertyEditor : BlockListPropertyEditorBase : base(dataValueEditorFactory, blockValuePropertyIndexValueFactory, jsonSerializer) => _ioHelper = ioHelper; - /// - /// Initializes a new instance of the class. - /// - [Obsolete("Use constructor that doesn't take PropertyEditorCollection, scheduled for removal in V15")] - public BlockListPropertyEditor( - IDataValueEditorFactory dataValueEditorFactory, - PropertyEditorCollection propertyEditors, - IIOHelper ioHelper, - IBlockValuePropertyIndexValueFactory blockValuePropertyIndexValueFactory, - IJsonSerializer jsonSerializer) - : this(dataValueEditorFactory, ioHelper, blockValuePropertyIndexValueFactory, jsonSerializer) - { - } - /// public override bool SupportsConfigurableElements => true; diff --git a/src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditorBase.cs b/src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditorBase.cs index feb44a784c..8c3e54ce12 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditorBase.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditorBase.cs @@ -1,5 +1,4 @@ using System.ComponentModel.DataAnnotations; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Cache.PropertyEditors; @@ -12,7 +11,6 @@ using Umbraco.Cms.Core.Serialization; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Strings; using Umbraco.Cms.Infrastructure.PropertyEditors.Validators; -using StaticServiceProvider = Umbraco.Cms.Core.DependencyInjection.StaticServiceProvider; namespace Umbraco.Cms.Core.PropertyEditors; @@ -24,15 +22,6 @@ public abstract class BlockListPropertyEditorBase : DataEditor private readonly IBlockValuePropertyIndexValueFactory _blockValuePropertyIndexValueFactory; private readonly IJsonSerializer _jsonSerializer; - /// - /// Initializes a new instance of the class. - /// - [Obsolete("Use non-obsoleted ctor. This will be removed in Umbraco 15.")] - protected BlockListPropertyEditorBase(IDataValueEditorFactory dataValueEditorFactory, IBlockValuePropertyIndexValueFactory blockValuePropertyIndexValueFactory) - : this(dataValueEditorFactory,blockValuePropertyIndexValueFactory, StaticServiceProvider.Instance.GetRequiredService()) - { - } - /// /// Initializes a new instance of the class. /// diff --git a/src/Umbraco.Infrastructure/PropertyEditors/BlockValuePropertyValueEditorBase.cs b/src/Umbraco.Infrastructure/PropertyEditors/BlockValuePropertyValueEditorBase.cs index 00bc627d60..c94cc9ce45 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/BlockValuePropertyValueEditorBase.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/BlockValuePropertyValueEditorBase.cs @@ -1,7 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.IO; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Blocks; @@ -25,31 +22,6 @@ public abstract class BlockValuePropertyValueEditorBase : DataV private BlockEditorValues? _blockEditorValues; private readonly ILanguageService _languageService; - [Obsolete("Please use the non-obsolete constructor. Will be removed in V16.")] - protected BlockValuePropertyValueEditorBase( - DataEditorAttribute attribute, - PropertyEditorCollection propertyEditors, - IDataTypeConfigurationCache dataTypeConfigurationCache, - ILocalizedTextService textService, - ILogger logger, - IShortStringHelper shortStringHelper, - IJsonSerializer jsonSerializer, - IIOHelper ioHelper, - DataValueReferenceFactoryCollection dataValueReferenceFactoryCollection) - : this( - propertyEditors, - dataTypeConfigurationCache, - shortStringHelper, - jsonSerializer, - dataValueReferenceFactoryCollection, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - ioHelper, - attribute - ) - { - } - protected BlockValuePropertyValueEditorBase( PropertyEditorCollection propertyEditors, IDataTypeConfigurationCache dataTypeConfigurationCache, diff --git a/src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyValueEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyValueEditor.cs index 5040d14bbe..1150fa09a2 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyValueEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyValueEditor.cs @@ -32,7 +32,6 @@ internal class FileUploadPropertyValueEditor : DataValueEditor public FileUploadPropertyValueEditor( DataEditorAttribute attribute, MediaFileManager mediaFileManager, - ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, IOptionsMonitor contentSettings, IJsonSerializer jsonSerializer, @@ -40,7 +39,7 @@ internal class FileUploadPropertyValueEditor : DataValueEditor ITemporaryFileService temporaryFileService, IScopeProvider scopeProvider, IFileStreamSecurityValidator fileStreamSecurityValidator) - : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute) + : base(shortStringHelper, jsonSerializer, ioHelper, attribute) { _mediaFileManager = mediaFileManager ?? throw new ArgumentNullException(nameof(mediaFileManager)); _jsonSerializer = jsonSerializer; diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyValueEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyValueEditor.cs index ffbdacc16a..28a3ec87bc 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyValueEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyValueEditor.cs @@ -37,7 +37,6 @@ internal class ImageCropperPropertyValueEditor : DataValueEditor // TODO: core v DataEditorAttribute attribute, ILogger logger, MediaFileManager mediaFileSystem, - ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, IOptionsMonitor contentSettings, IJsonSerializer jsonSerializer, @@ -46,7 +45,7 @@ internal class ImageCropperPropertyValueEditor : DataValueEditor // TODO: core v IScopeProvider scopeProvider, IFileStreamSecurityValidator fileStreamSecurityValidator, IDataTypeConfigurationCache dataTypeConfigurationCache) - : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute) + : base(shortStringHelper, jsonSerializer, ioHelper, attribute) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _mediaFileManager = mediaFileSystem ?? throw new ArgumentNullException(nameof(mediaFileSystem)); diff --git a/src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerValueEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerValueEditor.cs index 185f66daac..37697701c8 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerValueEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerValueEditor.cs @@ -37,7 +37,7 @@ public class MultiUrlPickerValueEditor : DataValueEditor, IDataValueReference IIOHelper ioHelper, IContentService contentService, IMediaService mediaService) - : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute) + : base(shortStringHelper, jsonSerializer, ioHelper, attribute) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _publishedUrlProvider = publishedUrlProvider; diff --git a/src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs b/src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs index d8bc7e5553..f0d2631773 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs @@ -38,56 +38,6 @@ public sealed class RichTextEditorPastedImages private readonly AppCaches _appCaches; private readonly IUserService _userService; - [Obsolete("Please use the non-obsolete constructor. Will be removed in V16.")] - public RichTextEditorPastedImages( - IUmbracoContextAccessor umbracoContextAccessor, - ILogger logger, - IHostingEnvironment hostingEnvironment, - IMediaService mediaService, - IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, - MediaFileManager mediaFileManager, - MediaUrlGeneratorCollection mediaUrlGenerators, - IShortStringHelper shortStringHelper, - IPublishedUrlProvider publishedUrlProvider) - : this( - umbracoContextAccessor, - logger, - hostingEnvironment, - mediaService, - contentTypeBaseServiceProvider, - mediaFileManager, - mediaUrlGenerators, - shortStringHelper, - publishedUrlProvider, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService>()) - { - } - - [Obsolete("Please use the non-obsolete constructor. Will be removed in V16.")] - public RichTextEditorPastedImages( - IUmbracoContextAccessor umbracoContextAccessor, - ILogger logger, - IHostingEnvironment hostingEnvironment, - IMediaService mediaService, - IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, - MediaFileManager mediaFileManager, - MediaUrlGeneratorCollection mediaUrlGenerators, - IShortStringHelper shortStringHelper, - IPublishedUrlProvider publishedUrlProvider, - ITemporaryFileService temporaryFileService, - IScopeProvider scopeProvider, - IMediaImportService mediaImportService, - IImageUrlGenerator imageUrlGenerator, - IOptions contentSettings) - : this(umbracoContextAccessor, publishedUrlProvider, temporaryFileService, scopeProvider, mediaImportService, imageUrlGenerator) - { - } - - // highest overload to be picked by DI, pointing to newest ctor [Obsolete("Please use the non-obsolete constructor. Will be removed in V17.")] public RichTextEditorPastedImages( IUmbracoContextAccessor umbracoContextAccessor, @@ -155,18 +105,6 @@ public sealed class RichTextEditorPastedImages _userService = StaticServiceProvider.Instance.GetRequiredService(); } - [Obsolete($"Please use {nameof(FindAndPersistPastedTempImagesAsync)}. Will be removed in V16.")] - public string FindAndPersistPastedTempImages(string html, Guid mediaParentFolder, int userId, IImageUrlGenerator imageUrlGenerator) - => FindAndPersistPastedTempImages(html, mediaParentFolder, userId); - - [Obsolete($"Please use {nameof(FindAndPersistPastedTempImagesAsync)}. Will be removed in V16.")] - public string FindAndPersistPastedTempImages(string html, Guid mediaParentFolder, int userId) - { - IUser user = _userService.GetUserById(userId) - ?? throw new ArgumentException($"Could not find a user with the specified user key ({userId})", nameof(userId)); - return FindAndPersistPastedTempImagesAsync(html, mediaParentFolder, user.Key).GetAwaiter().GetResult(); - } - /// /// Used by the RTE (and grid RTE) for drag/drop/persisting images. /// diff --git a/src/Umbraco.Infrastructure/PropertyEditors/Validators/RichTextRequiredValidator.cs b/src/Umbraco.Infrastructure/PropertyEditors/Validators/RichTextRequiredValidator.cs index b239f0bda5..89f27f43ff 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/Validators/RichTextRequiredValidator.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/Validators/RichTextRequiredValidator.cs @@ -10,7 +10,7 @@ internal class RichTextRequiredValidator : RequiredValidator, IRichTextRequiredV private readonly IJsonSerializer _jsonSerializer; private readonly ILogger _logger; - public RichTextRequiredValidator(ILocalizedTextService textService, IJsonSerializer jsonSerializer, ILogger logger) : base(textService) + public RichTextRequiredValidator(ILocalizedTextService textService, IJsonSerializer jsonSerializer, ILogger logger) : base() { _jsonSerializer = jsonSerializer; _logger = logger; diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockEditorVarianceHandler.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockEditorVarianceHandler.cs index 815bc0f1b0..93bb0cc1a2 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockEditorVarianceHandler.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockEditorVarianceHandler.cs @@ -1,5 +1,3 @@ -using Microsoft.Extensions.DependencyInjection; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Blocks; using Umbraco.Cms.Core.Models.PublishedContent; @@ -13,12 +11,6 @@ public sealed class BlockEditorVarianceHandler private readonly ILanguageService _languageService; private readonly IContentTypeService _contentTypeService; - [Obsolete("Please use the constructor that accepts IContentTypeService. Will be removed in V16.")] - public BlockEditorVarianceHandler(ILanguageService languageService) - : this(languageService, StaticServiceProvider.Instance.GetRequiredService()) - { - } - public BlockEditorVarianceHandler(ILanguageService languageService, IContentTypeService contentTypeService) { _languageService = languageService; diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockGridPropertyValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockGridPropertyValueConverter.cs index 822632aaf3..7ed28e6ca0 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockGridPropertyValueConverter.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockGridPropertyValueConverter.cs @@ -1,9 +1,7 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core.DeliveryApi; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Logging; using Umbraco.Cms.Core.Models.Blocks; using Umbraco.Cms.Core.Models.DeliveryApi; @@ -25,19 +23,6 @@ namespace Umbraco.Cms.Core.PropertyEditors.ValueConverters private readonly IVariationContextAccessor _variationContextAccessor; private readonly BlockEditorVarianceHandler _blockEditorVarianceHandler; - [Obsolete("Use the constructor that takes all parameters, scheduled for removal in V16")] - public BlockGridPropertyValueConverter( - IProfilingLogger proflog, - BlockEditorConverter blockConverter, - IJsonSerializer jsonSerializer, - IApiElementBuilder apiElementBuilder, - BlockGridPropertyValueConstructorCache constructorCache) - : this(proflog, blockConverter, jsonSerializer, apiElementBuilder, constructorCache, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService()) - { - } - public BlockGridPropertyValueConverter( IProfilingLogger proflog, BlockEditorConverter blockConverter, diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs index ccd637f007..b7b4576b3c 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/BlockListPropertyValueConverter.cs @@ -1,9 +1,7 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core.DeliveryApi; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Logging; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Blocks; @@ -29,12 +27,6 @@ public class BlockListPropertyValueConverter : PropertyValueConverterBase, IDeli private readonly IVariationContextAccessor _variationContextAccessor; private readonly BlockEditorVarianceHandler _blockEditorVarianceHandler; - [Obsolete("Use the constructor that takes all parameters, scheduled for removal in V16")] - public BlockListPropertyValueConverter(IProfilingLogger proflog, BlockEditorConverter blockConverter, IContentTypeService contentTypeService, IApiElementBuilder apiElementBuilder, IJsonSerializer jsonSerializer, BlockListPropertyValueConstructorCache constructorCache) - : this(proflog, blockConverter, contentTypeService, apiElementBuilder, jsonSerializer, constructorCache, StaticServiceProvider.Instance.GetRequiredService(), StaticServiceProvider.Instance.GetRequiredService()) - { - } - public BlockListPropertyValueConverter( IProfilingLogger proflog, BlockEditorConverter blockConverter, diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs index 60594fd9e8..9cb5d57474 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ImageCropperValueConverter.cs @@ -1,9 +1,7 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models.DeliveryApi; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.PropertyEditors.DeliveryApi; @@ -28,12 +26,6 @@ public class ImageCropperValueConverter : PropertyValueConverterBase, IDeliveryA _jsonSerializer = jsonSerializer; } - [Obsolete("Use the constructor specifying all dependencies, scheduled for removal in V16")] - public ImageCropperValueConverter(ILogger logger) - : this(logger, StaticServiceProvider.Instance.GetRequiredService()) - { - } - /// public override bool IsConverter(IPublishedPropertyType propertyType) => propertyType.EditorAlias.InvariantEquals(Constants.PropertyEditors.Aliases.ImageCropper); diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/RteBlockRenderingValueConverter.cs b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/RteBlockRenderingValueConverter.cs index 58bf1bf05b..c6b38cb35c 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/RteBlockRenderingValueConverter.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/RteBlockRenderingValueConverter.cs @@ -4,20 +4,18 @@ using System.Globalization; using System.Text.RegularExpressions; using HtmlAgilityPack; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Blocks; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.Models.PublishedContent; -using Umbraco.Cms.Core.PropertyEditors.DeliveryApi; -using Umbraco.Cms.Core.Strings; -using Umbraco.Cms.Core.Templates; using Umbraco.Cms.Core.DeliveryApi; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models.Blocks; using Umbraco.Cms.Core.Models.DeliveryApi; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.PropertyEditors.DeliveryApi; using Umbraco.Cms.Core.Serialization; +using Umbraco.Cms.Core.Strings; +using Umbraco.Cms.Core.Templates; using Umbraco.Cms.Infrastructure.Extensions; using Umbraco.Extensions; @@ -45,18 +43,6 @@ public class RteBlockRenderingValueConverter : SimpleTinyMceValueConverter, IDel private readonly BlockEditorVarianceHandler _blockEditorVarianceHandler; private DeliveryApiSettings _deliveryApiSettings; - [Obsolete("Use the constructor that takes all parameters, scheduled for removal in V16")] - public RteBlockRenderingValueConverter(HtmlLocalLinkParser linkParser, HtmlUrlParser urlParser, HtmlImageSourceParser imageSourceParser, - IApiRichTextElementParser apiRichTextElementParser, IApiRichTextMarkupParser apiRichTextMarkupParser, - IPartialViewBlockEngine partialViewBlockEngine, BlockEditorConverter blockEditorConverter, IJsonSerializer jsonSerializer, - IApiElementBuilder apiElementBuilder, RichTextBlockPropertyValueConstructorCache constructorCache, ILogger logger, - IOptionsMonitor deliveryApiSettingsMonitor) - : this(linkParser, urlParser, imageSourceParser, apiRichTextElementParser, apiRichTextMarkupParser, partialViewBlockEngine, blockEditorConverter, jsonSerializer, - apiElementBuilder, constructorCache, logger, StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService(), deliveryApiSettingsMonitor) - { - } - public RteBlockRenderingValueConverter(HtmlLocalLinkParser linkParser, HtmlUrlParser urlParser, HtmlImageSourceParser imageSourceParser, IApiRichTextElementParser apiRichTextElementParser, IApiRichTextMarkupParser apiRichTextMarkupParser, IPartialViewBlockEngine partialViewBlockEngine, BlockEditorConverter blockEditorConverter, IJsonSerializer jsonSerializer, diff --git a/src/Umbraco.Infrastructure/PublishedContentQueryAccessor.cs b/src/Umbraco.Infrastructure/PublishedContentQueryAccessor.cs index 3b4bffd20f..425455eb0f 100644 --- a/src/Umbraco.Infrastructure/PublishedContentQueryAccessor.cs +++ b/src/Umbraco.Infrastructure/PublishedContentQueryAccessor.cs @@ -8,10 +8,6 @@ public class PublishedContentQueryAccessor : IPublishedContentQueryAccessor { private readonly IScopedServiceProvider _scopedServiceProvider; - [Obsolete("Please use alternative constructor")] - public PublishedContentQueryAccessor(IServiceProvider serviceProvider) => - _scopedServiceProvider = serviceProvider.GetRequiredService(); - public PublishedContentQueryAccessor(IScopedServiceProvider scopedServiceProvider) => _scopedServiceProvider = scopedServiceProvider; diff --git a/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs b/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs index d28829dd4d..994241990d 100644 --- a/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs +++ b/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs @@ -1,5 +1,3 @@ -using System.ComponentModel; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Umbraco.Cms.Core; @@ -69,64 +67,6 @@ public class CoreRuntime : IRuntime _logger = _loggerFactory.CreateLogger(); } - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete] - public CoreRuntime( - ILoggerFactory loggerFactory, - IRuntimeState state, - ComponentCollection components, - IApplicationShutdownRegistry applicationShutdownRegistry, - IProfilingLogger profilingLogger, - IMainDom mainDom, - IUmbracoDatabaseFactory databaseFactory, - IEventAggregator eventAggregator, - IHostingEnvironment hostingEnvironment, - IUmbracoVersion umbracoVersion, - IServiceProvider? serviceProvider) - : this( - state, - loggerFactory, - components, - applicationShutdownRegistry, - profilingLogger, - mainDom, - databaseFactory, - eventAggregator, - hostingEnvironment, - umbracoVersion, - serviceProvider, - serviceProvider?.GetRequiredService()) - { - } - - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete] - public CoreRuntime( - ILoggerFactory loggerFactory, - IRuntimeState state, - ComponentCollection components, - IApplicationShutdownRegistry applicationShutdownRegistry, - IProfilingLogger profilingLogger, - IMainDom mainDom, - IUmbracoDatabaseFactory databaseFactory, - IEventAggregator eventAggregator, - IHostingEnvironment hostingEnvironment, - IUmbracoVersion umbracoVersion) - : this( - loggerFactory, - state, - components, - applicationShutdownRegistry, - profilingLogger, - mainDom, - databaseFactory, - eventAggregator, - hostingEnvironment, - umbracoVersion, - null) - { - } - /// /// Gets the state of the Umbraco runtime. /// diff --git a/src/Umbraco.Infrastructure/Runtime/RuntimeModeValidators/RuntimeMinificationValidator.cs b/src/Umbraco.Infrastructure/Runtime/RuntimeModeValidators/RuntimeMinificationValidator.cs deleted file mode 100644 index ce593704fc..0000000000 --- a/src/Umbraco.Infrastructure/Runtime/RuntimeModeValidators/RuntimeMinificationValidator.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using Microsoft.Extensions.Options; -using Umbraco.Cms.Core.Configuration.Models; - -namespace Umbraco.Cms.Infrastructure.Runtime.RuntimeModeValidators; - -/// -/// Validates whether the runtime minification cache buster is not set to when in production runtime mode. -/// -/// -[Obsolete("Runtime minification is no longer supported, so this is no longer relevant. Will be removed entirely in V16.")] -public class RuntimeMinificationValidator : RuntimeModeProductionValidatorBase -{ - private readonly IOptionsMonitor _runtimeMinificationSettings; - - /// - /// Initializes a new instance of the class. - /// - /// The runtime minification settings. - public RuntimeMinificationValidator(IOptionsMonitor runtimeMinificationSettings) - => _runtimeMinificationSettings = runtimeMinificationSettings; - - /// - protected override bool Validate([NotNullWhen(false)] out string? validationErrorMessage) - { - if (_runtimeMinificationSettings.CurrentValue.CacheBuster == RuntimeMinificationCacheBuster.Timestamp) - { - validationErrorMessage = "Runtime minification setting needs to be set to a fixed cache buster (like Version or AppDomain) in production mode."; - return false; - } - - validationErrorMessage = null; - return true; - } -} diff --git a/src/Umbraco.Infrastructure/Runtime/RuntimeState.cs b/src/Umbraco.Infrastructure/Runtime/RuntimeState.cs index 9e0b0dc781..04ba9a2584 100644 --- a/src/Umbraco.Infrastructure/Runtime/RuntimeState.cs +++ b/src/Umbraco.Infrastructure/Runtime/RuntimeState.cs @@ -149,7 +149,7 @@ public class RuntimeState : IRuntimeState _logger.LogDebug("Could not connect to database."); } - if (_globalSettings.Value.InstallMissingDatabase || _databaseProviderMetadata.CanForceCreateDatabase(_databaseFactory)) + if (_databaseProviderMetadata.CanForceCreateDatabase(_databaseFactory)) { // ok to install on a configured but missing database Level = RuntimeLevel.BootFailed; @@ -311,7 +311,7 @@ public class RuntimeState : IRuntimeState // anything other than install wants a database - see if we can connect // (since this is an already existing database, assume localdb is ready) bool canConnect; - var tries = _globalSettings.Value.InstallMissingDatabase ? 2 : 5; + var tries = 5; for (var i = 0; ;) { canConnect = databaseFactory.CanConnect; diff --git a/src/Umbraco.Infrastructure/Scoping/Scope.cs b/src/Umbraco.Infrastructure/Scoping/Scope.cs index ca7cd28ef2..55c45bd881 100644 --- a/src/Umbraco.Infrastructure/Scoping/Scope.cs +++ b/src/Umbraco.Infrastructure/Scoping/Scope.cs @@ -196,17 +196,6 @@ namespace Umbraco.Cms.Infrastructure.Scoping { } - [Obsolete("Scopes are never stored on HttpContext.Items anymore, so CallContext is always true.")] - // a value indicating whether to force call-context - public bool CallContext - { - get => true; - set - { - // NOOP - always true. - } - } - // a value indicating whether the scope is detachable // ie whether it was created by CreateDetachedScope public bool Detachable { get; } diff --git a/src/Umbraco.Infrastructure/Scoping/ScopeContextualBase.cs b/src/Umbraco.Infrastructure/Scoping/ScopeContextualBase.cs index f31333237c..4f73c54ba0 100644 --- a/src/Umbraco.Infrastructure/Scoping/ScopeContextualBase.cs +++ b/src/Umbraco.Infrastructure/Scoping/ScopeContextualBase.cs @@ -15,22 +15,6 @@ public abstract class ScopeContextualBase : IDisposable private bool _scoped; /// - /// Gets a contextual object. - /// - /// The type of the object. - /// A scope provider. - /// A context key for the object. - /// A function producing the contextual object. - /// The contextual object. - /// - /// - /// - [Obsolete("Please use the Get method that accepts an Umbraco.Cms.Core.Scoping.ICoreScopeProvider instead.")] - public static T? Get(IScopeProvider scopeProvider, string key, Func ctor) - where T : ScopeContextualBase - => Get((ICoreScopeProvider)scopeProvider, key, ctor); - - /// /// Gets a contextual object. /// /// The type of the object. diff --git a/src/Umbraco.Infrastructure/Scoping/ScopeProvider.cs b/src/Umbraco.Infrastructure/Scoping/ScopeProvider.cs index 9454443ecd..6a30bd21ac 100644 --- a/src/Umbraco.Infrastructure/Scoping/ScopeProvider.cs +++ b/src/Umbraco.Infrastructure/Scoping/ScopeProvider.cs @@ -150,7 +150,6 @@ namespace Umbraco.Cms.Infrastructure.Scoping otherScope.Attached = true; otherScope.OrigScope = AmbientScope; otherScope.OrigContext = AmbientContext; - otherScope.CallContext = callContext; PushAmbientScopeContext(otherScope.Context); PushAmbientScope(otherScope); diff --git a/src/Umbraco.Infrastructure/Security/MemberPasswordHasher.cs b/src/Umbraco.Infrastructure/Security/MemberPasswordHasher.cs index 10b5974c52..7caf52fc29 100644 --- a/src/Umbraco.Infrastructure/Security/MemberPasswordHasher.cs +++ b/src/Umbraco.Infrastructure/Security/MemberPasswordHasher.cs @@ -1,11 +1,9 @@ using System.Security.Cryptography; using System.Text; using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Serialization; using Umbraco.Extensions; @@ -23,16 +21,6 @@ public class MemberPasswordHasher : UmbracoPasswordHasher private readonly IOptions _legacyMachineKeySettings; private readonly ILogger _logger; - [Obsolete("Use ctor with all params")] - public MemberPasswordHasher(LegacyPasswordSecurity legacyPasswordHasher, IJsonSerializer jsonSerializer) - : this( - legacyPasswordHasher, - jsonSerializer, - StaticServiceProvider.Instance.GetRequiredService>(), - StaticServiceProvider.Instance.GetRequiredService>()) - { - } - public MemberPasswordHasher( LegacyPasswordSecurity legacyPasswordHasher, IJsonSerializer jsonSerializer, diff --git a/src/Umbraco.Infrastructure/Security/MemberUserStore.cs b/src/Umbraco.Infrastructure/Security/MemberUserStore.cs index 6dddd08756..b86458427f 100644 --- a/src/Umbraco.Infrastructure/Security/MemberUserStore.cs +++ b/src/Umbraco.Infrastructure/Security/MemberUserStore.cs @@ -246,7 +246,7 @@ public class MemberUserStore : UmbracoUserStore [EditorBrowsable(EditorBrowsableState.Never)] public override Task AddClaimsAsync(TUser user, IEnumerable claims, CancellationToken cancellationToken = default) => throw new NotImplementedException(); - [Obsolete("Use TryConvertIdentityIdToInt instead. Scheduled for removal in V15.")] - protected static int UserIdToInt(string? userId) - { - if (int.TryParse(userId, NumberStyles.Integer, CultureInfo.InvariantCulture, out var result)) - { - return result; - } - - if (Guid.TryParse(userId, out Guid key)) - { - // Reverse the IntExtensions.ToGuid - return BitConverter.ToInt32(key.ToByteArray(), 0); - } - - throw new InvalidOperationException($"Unable to convert user ID ({userId})to int using InvariantCulture"); - } - protected abstract Task ResolveEntityIdFromIdentityId(string? identityId); protected static bool TryConvertIdentityIdToInt(string? userId, out int intId) diff --git a/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs b/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs index 2e3a3a5776..cd82fa6c8b 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs @@ -2,10 +2,8 @@ using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Runtime.Loader; using System.Xml.Linq; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Hosting; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Extensions; using Umbraco.Cms.Core.Manifest; @@ -38,30 +36,6 @@ public class PackagingService : IPackagingService private readonly IHostEnvironment _hostEnvironment; private readonly IUserService _userService; - [Obsolete("Use the constructor with IPackageManifestReader instead.")] - public PackagingService( - IAuditService auditService, - ICreatedPackagesRepository createdPackages, - IPackageInstallation packageInstallation, - IEventAggregator eventAggregator, - IKeyValueService keyValueService, - ICoreScopeProvider coreScopeProvider, - PackageMigrationPlanCollection packageMigrationPlans, - IHostEnvironment hostEnvironment, - IUserService userService) - : this( - auditService, - createdPackages, - packageInstallation, - eventAggregator, - keyValueService, - coreScopeProvider, - packageMigrationPlans, - StaticServiceProvider.Instance.GetRequiredService(), - hostEnvironment, - userService) - { } - public PackagingService( IAuditService auditService, ICreatedPackagesRepository createdPackages, @@ -131,21 +105,6 @@ public class PackagingService : IPackagingService #region Created/Installed Package Repositories - [Obsolete("Use DeleteCreatedPackageAsync instead. Scheduled for removal in Umbraco 15.")] - public void DeleteCreatedPackage(int id, int userId = Constants.Security.SuperUserId) - { - Guid key, currentUserKey; - - using (ICoreScope scope = _coreScopeProvider.CreateCoreScope(autoComplete: true)) - { - PackageDefinition? package = GetCreatedPackageById(id); - key = package?.PackageId ?? Guid.Empty; - currentUserKey = _userService.GetUserById(id)?.Key ?? Constants.Security.SuperUserKey; - } - - DeleteCreatedPackageAsync(key, currentUserKey).GetAwaiter().GetResult(); - } - /// public async Task> DeleteCreatedPackageAsync(Guid key, Guid userKey) { @@ -165,14 +124,6 @@ public class PackagingService : IPackagingService return Attempt.SucceedWithStatus(PackageOperationStatus.Success, package); } - public IEnumerable GetAllCreatedPackages() - { - using ICoreScope scope = _coreScopeProvider.CreateCoreScope(autoComplete: true); - - return _createdPackages.GetAll(); - } - - [Obsolete("Use GetCreatedPackagesAsync instead. Scheduled for removal in Umbraco 15.")] public PackageDefinition? GetCreatedPackageById(int id) { using ICoreScope scope = _coreScopeProvider.CreateCoreScope(autoComplete: true); @@ -198,17 +149,6 @@ public class PackagingService : IPackagingService return Task.FromResult(_createdPackages.GetByKey(key)); } - [Obsolete("Use CreateCreatedPackageAsync or UpdateCreatedPackageAsync instead. Scheduled for removal in Umbraco 15.")] - public bool SaveCreatedPackage(PackageDefinition definition) - { - using ICoreScope scope = _coreScopeProvider.CreateCoreScope(); - - var success = _createdPackages.SavePackage(definition); - scope.Complete(); - - return success; - } - /// public async Task> CreateCreatedPackageAsync(PackageDefinition package, Guid userKey) { @@ -256,11 +196,7 @@ public class PackagingService : IPackagingService } public InstalledPackage? GetInstalledPackageByName(string packageName) - => GetAllInstalledPackages().Where(x => x.PackageName?.InvariantEquals(packageName) ?? false).FirstOrDefault(); - - [Obsolete("Use GetAllInstalledPackagesAsync instead. Scheduled for removal in Umbraco 15.")] - public IEnumerable GetAllInstalledPackages() - => GetAllInstalledPackagesAsync().GetAwaiter().GetResult(); + => GetAllInstalledPackagesAsync().GetAwaiter().GetResult().Where(x => x.PackageName?.InvariantEquals(packageName) ?? false).FirstOrDefault(); public async Task> GetAllInstalledPackagesAsync() { diff --git a/src/Umbraco.Infrastructure/Services/MemberEditingService.cs b/src/Umbraco.Infrastructure/Services/MemberEditingService.cs index efae531d3e..778cf7d33d 100644 --- a/src/Umbraco.Infrastructure/Services/MemberEditingService.cs +++ b/src/Umbraco.Infrastructure/Services/MemberEditingService.cs @@ -1,9 +1,7 @@ using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentEditing; using Umbraco.Cms.Core.Models.Membership; @@ -25,29 +23,6 @@ internal sealed class MemberEditingService : IMemberEditingService private readonly IMemberGroupService _memberGroupService; private readonly SecuritySettings _securitySettings; - [Obsolete("Use the constructor that takes all parameters. Scheduled for removal in V16.")] - public MemberEditingService( - IMemberService memberService, - IMemberTypeService memberTypeService, - IMemberContentEditingService memberContentEditingService, - IMemberManager memberManager, - ITwoFactorLoginService twoFactorLoginService, - IPasswordChanger passwordChanger, - ILogger logger, - IMemberGroupService memberGroupService) - : this( - memberService, - memberTypeService, - memberContentEditingService, - memberManager, - twoFactorLoginService, - passwordChanger, - logger, - memberGroupService, - StaticServiceProvider.Instance.GetRequiredService>()) - { - } - public MemberEditingService( IMemberService memberService, IMemberTypeService memberTypeService, @@ -71,7 +46,7 @@ internal sealed class MemberEditingService : IMemberEditingService } public Task GetAsync(Guid key) - => Task.FromResult(_memberService.GetByKey(key)); + => Task.FromResult(_memberService.GetById(key)); public async Task> ValidateCreateAsync(MemberCreateModel createModel) => await _memberContentEditingService.ValidateAsync(createModel, createModel.ContentTypeKey); @@ -140,7 +115,7 @@ internal sealed class MemberEditingService : IMemberEditingService { var status = new MemberEditingStatus(); - IMember? member = _memberService.GetByKey(key); + IMember? member = _memberService.GetById(key); if (member is null) { status.ContentEditingOperationStatus = ContentEditingOperationStatus.NotFound; diff --git a/src/Umbraco.Infrastructure/Sync/ServerMessengerBase.cs b/src/Umbraco.Infrastructure/Sync/ServerMessengerBase.cs index 8377c9028d..35ffbc4985 100644 --- a/src/Umbraco.Infrastructure/Sync/ServerMessengerBase.cs +++ b/src/Umbraco.Infrastructure/Sync/ServerMessengerBase.cs @@ -1,8 +1,6 @@ -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Serialization; using Umbraco.Cms.Core.Sync; @@ -26,14 +24,6 @@ public abstract class ServerMessengerBase : IServerMessenger _jsonSerializer = jsonSerializer; } - [Obsolete("Use constructor that takes IJsonSerializer, scheduled for removal in V16")] - protected ServerMessengerBase(bool distributedEnabled) - : this( - distributedEnabled, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - /// /// Gets or sets a value indicating whether distributed calls are made when messaging a cache refresher. /// diff --git a/src/Umbraco.Infrastructure/Telemetry/Providers/UserTelemetryProvider.cs b/src/Umbraco.Infrastructure/Telemetry/Providers/UserTelemetryProvider.cs index f9ddfb8cb3..c61139c72f 100644 --- a/src/Umbraco.Infrastructure/Telemetry/Providers/UserTelemetryProvider.cs +++ b/src/Umbraco.Infrastructure/Telemetry/Providers/UserTelemetryProvider.cs @@ -1,6 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Infrastructure.Telemetry.Interfaces; @@ -12,13 +10,6 @@ public class UserTelemetryProvider : IDetailedTelemetryProvider private readonly IUserGroupService _userGroupService; private readonly IUserService _userService; - [Obsolete("Use constructor that takes IUserGroupService, scheduled for removal in V15")] - public UserTelemetryProvider(IUserService userService) - : this(userService, StaticServiceProvider.Instance.GetRequiredService()) - { - } - - [Obsolete("Use constructor that only takes IUserGroupService, scheduled for removal in V15")] public UserTelemetryProvider(IUserService userService, IUserGroupService userGroupService) { _userService = userService; diff --git a/src/Umbraco.PublishedCache.HybridCache/DocumentCache.cs b/src/Umbraco.PublishedCache.HybridCache/DocumentCache.cs index d5c173bba9..c6570845dc 100644 --- a/src/Umbraco.PublishedCache.HybridCache/DocumentCache.cs +++ b/src/Umbraco.PublishedCache.HybridCache/DocumentCache.cs @@ -1,6 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.PublishedCache; using Umbraco.Cms.Core.Routing; @@ -34,7 +32,6 @@ public sealed class DocumentCache : IPublishedContentCache public async Task GetByIdAsync(int id, bool? preview = null) => await _documentCacheService.GetByIdAsync(id, preview); - public async Task GetByIdAsync(Guid key, bool? preview = null) => await _documentCacheService.GetByKeyAsync(key, preview); public IPublishedContent? GetById(bool preview, int contentId) => GetByIdAsync(contentId, preview).GetAwaiter().GetResult(); @@ -46,12 +43,6 @@ public sealed class DocumentCache : IPublishedContentCache public IPublishedContent? GetById(Guid contentId) => GetByIdAsync(contentId).GetAwaiter().GetResult(); - public IPublishedContentType? GetContentType(int id) => _publishedContentTypeCache.Get(PublishedItemType.Content, id); - - public IPublishedContentType? GetContentType(string alias) => _publishedContentTypeCache.Get(PublishedItemType.Content, alias); - - public IPublishedContentType? GetContentType(Guid key) => _publishedContentTypeCache.Get(PublishedItemType.Content, key); - // TODO: These are all obsolete and should be removed [Obsolete("Scheduled for removal in v17")] @@ -98,10 +89,6 @@ public sealed class DocumentCache : IPublishedContentCache [Obsolete("Scheduled for removal in v17")] public bool HasContent() => _documentUrlService.HasAny(); - [Obsolete] - public IEnumerable GetByContentType(IPublishedContentType contentType) - => _documentCacheService.GetByContentType(contentType); - [Obsolete("Use IPublishedUrlProvider.GetUrl instead, scheduled for removal in v17")] public IPublishedContent? GetByRoute(bool preview, string route, bool? hideTopLevelNode = null, string? culture = null) { diff --git a/src/Umbraco.PublishedCache.HybridCache/MediaCache.cs b/src/Umbraco.PublishedCache.HybridCache/MediaCache.cs index 4cb70638d1..95a98fabf9 100644 --- a/src/Umbraco.PublishedCache.HybridCache/MediaCache.cs +++ b/src/Umbraco.PublishedCache.HybridCache/MediaCache.cs @@ -1,4 +1,4 @@ -using Umbraco.Cms.Core; +using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.PublishedCache; using Umbraco.Cms.Core.Services.Navigation; @@ -34,12 +34,6 @@ public sealed class MediaCache : IPublishedMediaCache public IPublishedContent? GetById(Guid contentId) => GetByIdAsync(contentId).GetAwaiter().GetResult(); - public IPublishedContentType? GetContentType(Guid key) => _publishedContentTypeCache.Get(PublishedItemType.Media, key); - - public IPublishedContentType GetContentType(int id) => _publishedContentTypeCache.Get(PublishedItemType.Media, id); - - public IPublishedContentType GetContentType(string alias) => _publishedContentTypeCache.Get(PublishedItemType.Media, alias); - [Obsolete("Scheduled for removal in v17")] public IPublishedContent? GetById(bool preview, Udi contentId) { @@ -86,7 +80,4 @@ public sealed class MediaCache : IPublishedMediaCache _mediaNavigationQueryService.TryGetRootKeys(out IEnumerable rootKeys); return rootKeys.Any(); } - - public IEnumerable GetByContentType(IPublishedContentType contentType) => - _mediaCacheService.GetByContentType(contentType); } diff --git a/src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs b/src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs index 2070b59bb7..936609db54 100644 --- a/src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs +++ b/src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilderExtensions.cs @@ -119,8 +119,7 @@ public static partial class UmbracoBuilderExtensions TypeLoader typeLoader = services.AddTypeLoader(Assembly.GetEntryAssembly(), loggerFactory, config); - IHostingEnvironment tempHostingEnvironment = GetTemporaryHostingEnvironment(webHostEnvironment, config); - return new UmbracoBuilder(services, config, typeLoader, loggerFactory, profiler, appCaches, tempHostingEnvironment); + return new UmbracoBuilder(services, config, typeLoader, loggerFactory, profiler, appCaches); } /// @@ -327,40 +326,6 @@ public static partial class UmbracoBuilderExtensions return builder; } - [Obsolete("This is not necessary any more. This will be removed in v16")] - public static IUmbracoBuilder AddWebServer(this IUmbracoBuilder builder) - { - builder.Services.Configure(options => - { - options.AllowSynchronousIO = true; - }); - - try - { - // See https://github.com/umbraco/Umbraco-CMS/pull/17886. This is a workaround for non-windows machines - // they won't have IIS available and trying to set this option will throw an exception. - // - // We're deferring this call to a method because if we just try to set the options here, we still get a - // TypeLoadException on non-windows machines. - // This workaround came from this comment: https://stackoverflow.com/a/3346975 - AllowSynchronousIOForIIS(builder); - } - catch (TypeLoadException) - { - // Ignoring this exception because it's expected on non-windows machines - } - return builder; - } - - // Prevents the compiler from inlining the method - [MethodImpl(MethodImplOptions.NoInlining)] - private static void AllowSynchronousIOForIIS(IUmbracoBuilder builder) => - builder.Services.Configure( - options => - { - options.AllowSynchronousIO = true; - }); - private static IProfiler GetWebProfiler(IConfiguration config, IHttpContextAccessor httpContextAccessor) { var isDebug = config.GetValue($"{Constants.Configuration.ConfigHosting}:Debug"); diff --git a/src/Umbraco.Web.Common/Extensions/LinkGeneratorExtensions.cs b/src/Umbraco.Web.Common/Extensions/LinkGeneratorExtensions.cs index 276925e796..4b4a359409 100644 --- a/src/Umbraco.Web.Common/Extensions/LinkGeneratorExtensions.cs +++ b/src/Umbraco.Web.Common/Extensions/LinkGeneratorExtensions.cs @@ -4,7 +4,6 @@ using System.Reflection; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Routing; using Umbraco.Cms.Core; -using Umbraco.Cms.Core.Hosting; using Umbraco.Cms.Core.Web.Mvc; using Umbraco.Cms.Web.Common.Controllers; @@ -12,37 +11,6 @@ namespace Umbraco.Extensions; public static class LinkGeneratorExtensions { - /// - /// Return the Url for a Web Api service - /// - /// The - [Obsolete("This will be removed in Umbraco 15.")] - public static string? GetUmbracoApiService(this LinkGenerator linkGenerator, string actionName, object? id = null) - where T : UmbracoApiControllerBase => linkGenerator.GetUmbracoControllerUrl( - actionName, - typeof(T), - new Dictionary { ["id"] = id }); - - [Obsolete("This will be removed in Umbraco 15.")] - public static string? GetUmbracoApiService(this LinkGenerator linkGenerator, string actionName, IDictionary? values) - where T : UmbracoApiControllerBase => linkGenerator.GetUmbracoControllerUrl(actionName, typeof(T), values); - - [Obsolete("This will be removed in Umbraco 15.")] - public static string? GetUmbracoApiServiceBaseUrl( - this LinkGenerator linkGenerator, - Expression> methodSelector) - where T : UmbracoApiControllerBase - { - MethodInfo? method = ExpressionHelper.GetMethodInfo(methodSelector); - if (method == null) - { - throw new MissingMethodException("Could not find the method " + methodSelector + " on type " + typeof(T) + - " or the result "); - } - - return linkGenerator.GetUmbracoApiService(method.Name)?.TrimEnd(method.Name); - } - /// /// Return the Url for an Umbraco controller /// @@ -131,26 +99,4 @@ public static class LinkGeneratorExtensions return linkGenerator.GetUmbracoControllerUrl(actionName, ControllerExtensions.GetControllerName(controllerType), area, values); } - - [Obsolete("This will be removed in Umbraco 15.")] - public static string? GetUmbracoApiService( - this LinkGenerator linkGenerator, - Expression> methodSelector) - where T : UmbracoApiController - { - MethodInfo? method = ExpressionHelper.GetMethodInfo(methodSelector); - IDictionary? methodParams = ExpressionHelper.GetMethodParams(methodSelector); - if (method == null) - { - throw new MissingMethodException( - $"Could not find the method {methodSelector} on type {typeof(T)} or the result "); - } - - if (methodParams?.Any() == false) - { - return linkGenerator.GetUmbracoApiService(method.Name); - } - - return linkGenerator.GetUmbracoApiService(method.Name, methodParams); - } } diff --git a/src/Umbraco.Web.Common/Extensions/ServiceCollectionExtensions.cs b/src/Umbraco.Web.Common/Extensions/ServiceCollectionExtensions.cs index ce75b4b1b5..e776270d75 100644 --- a/src/Umbraco.Web.Common/Extensions/ServiceCollectionExtensions.cs +++ b/src/Umbraco.Web.Common/Extensions/ServiceCollectionExtensions.cs @@ -28,49 +28,6 @@ namespace Umbraco.Extensions; public static class ServiceCollectionExtensions { - /// - /// Create and configure the logger - /// - [Obsolete("Use the extension method that takes an IHostEnvironment instance instead.")] - public static IServiceCollection AddLogger( - this IServiceCollection services, - IHostingEnvironment hostingEnvironment, - ILoggingConfiguration loggingConfiguration, - IConfiguration configuration) - { - // Create a serilog logger - var logger = SerilogLogger.CreateWithDefaultConfiguration(hostingEnvironment, loggingConfiguration, configuration, out UmbracoFileConfiguration umbracoFileConfig); - services.AddSingleton(umbracoFileConfig); - - // This is nessasary to pick up all the loggins to MS ILogger. - Log.Logger = logger.SerilogLog; - - // Wire up all the bits that serilog needs. We need to use our own code since the Serilog ext methods don't cater to our needs since - // we don't want to use the global serilog `Log` object and we don't have our own ILogger implementation before the HostBuilder runs which - // is the only other option that these ext methods allow. - // I have created a PR to make this nicer https://github.com/serilog/serilog-extensions-hosting/pull/19 but we'll need to wait for that. - // Also see : https://github.com/serilog/serilog-extensions-hosting/blob/dev/src/Serilog.Extensions.Hosting/SerilogHostBuilderExtensions.cs - services.AddLogging(configure => - { - configure.AddSerilog(logger.SerilogLog); - }); - - // This won't (and shouldn't) take ownership of the logger. - services.AddSingleton(logger.SerilogLog); - - // Registered to provide two services... - var diagnosticContext = new DiagnosticContext(logger.SerilogLog); - - // Consumed by e.g. middleware - services.AddSingleton(diagnosticContext); - - // Consumed by user code - services.AddSingleton(diagnosticContext); - services.AddSingleton(loggingConfiguration); - - return services; - } - /// /// Create and configure the logger. /// @@ -173,7 +130,6 @@ public static class ServiceCollectionExtensions public static TypeLoader AddTypeLoader( this IServiceCollection services, Assembly entryAssembly, - IHostingEnvironment hostingEnvironment, ILoggerFactory loggerFactory, AppCaches appCaches, IConfiguration configuration, diff --git a/src/Umbraco.Web.Common/Extensions/UrlHelperExtensions.cs b/src/Umbraco.Web.Common/Extensions/UrlHelperExtensions.cs index 34bc870f94..6a9423c69e 100644 --- a/src/Umbraco.Web.Common/Extensions/UrlHelperExtensions.cs +++ b/src/Umbraco.Web.Common/Extensions/UrlHelperExtensions.cs @@ -21,100 +21,6 @@ namespace Umbraco.Extensions; public static class UrlHelperExtensions { - /// - /// Return the Url for a Web Api service - /// - /// - /// - /// - /// - /// - /// - [Obsolete("This will be removed in Umbraco 15.")] - public static string? GetUmbracoApiService( - this IUrlHelper url, - UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, - string actionName, - object? id = null) - where T : UmbracoApiController => - url.GetUmbracoApiService(umbracoApiControllerTypeCollection, actionName, typeof(T), id); - - [Obsolete("This will be removed in Umbraco 15.")] - public static string? GetUmbracoApiService( - this IUrlHelper url, - UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, - Expression> methodSelector) - where T : UmbracoApiController - { - MethodInfo? method = ExpressionHelper.GetMethodInfo(methodSelector); - IDictionary? methodParams = ExpressionHelper.GetMethodParams(methodSelector); - if (method == null) - { - throw new MissingMethodException("Could not find the method " + methodSelector + " on type " + typeof(T) + - " or the result "); - } - - if (methodParams?.Any() == false) - { - return url.GetUmbracoApiService(umbracoApiControllerTypeCollection, method.Name); - } - - return url.GetUmbracoApiService(umbracoApiControllerTypeCollection, method.Name, methodParams?.Values.First()); - } - - /// - /// Return the Url for a Web Api service - /// - /// - /// - /// - /// - /// - /// - [Obsolete("This will be removed in Umbraco 15.")] - public static string? GetUmbracoApiService( - this IUrlHelper url, - UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, - string actionName, - Type apiControllerType, - object? id = null) - { - if (actionName == null) - { - throw new ArgumentNullException(nameof(actionName)); - } - - if (string.IsNullOrWhiteSpace(actionName)) - { - throw new ArgumentException( - "Value can't be empty or consist only of white-space characters.", - nameof(actionName)); - } - - if (apiControllerType == null) - { - throw new ArgumentNullException(nameof(apiControllerType)); - } - - var area = string.Empty; - - Type? apiController = umbracoApiControllerTypeCollection.SingleOrDefault(x => x == apiControllerType); - if (apiController == null) - { - throw new InvalidOperationException("Could not find the umbraco api controller of type " + - apiControllerType.FullName); - } - - PluginControllerMetadata metaData = PluginController.GetMetadata(apiController); - if (metaData.AreaName.IsNullOrWhiteSpace() == false) - { - // set the area to the plugin area - area = metaData.AreaName; - } - - return url.GetUmbracoApiService(actionName, ControllerExtensions.GetControllerName(apiControllerType), area!, id); - } - /// /// Return the Url for a Web Api service /// @@ -183,39 +89,6 @@ public static class UrlHelperExtensions return url.Action(actionName, controllerName, new { area, id }); } - /// - /// Return the Base Url (not including the action) for a Web Api service - /// - /// - /// - /// - /// - /// - [Obsolete("This will be removed in Umbraco 15.")] - public static string? GetUmbracoApiServiceBaseUrl( - this IUrlHelper url, - UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, - string actionName) - where T : UmbracoApiController => - url.GetUmbracoApiService(umbracoApiControllerTypeCollection, actionName)?.TrimEnd(actionName); - - [Obsolete("This will be removed in Umbraco 15.")] - public static string? GetUmbracoApiServiceBaseUrl( - this IUrlHelper url, - UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, - Expression> methodSelector) - where T : UmbracoApiController - { - MethodInfo? method = ExpressionHelper.GetMethodInfo(methodSelector); - if (method == null) - { - throw new MissingMethodException("Could not find the method " + methodSelector + " on type " + typeof(T) + - " or the result "); - } - - return url.GetUmbracoApiService(umbracoApiControllerTypeCollection, method.Name)?.TrimEnd(method.Name); - } - /// /// Return the Url for an action with a cache-busting hash appended /// diff --git a/src/Umbraco.Web.Common/Extensions/ViewDataExtensions.cs b/src/Umbraco.Web.Common/Extensions/ViewDataExtensions.cs index 96c5e2f0f0..0402461ed7 100644 --- a/src/Umbraco.Web.Common/Extensions/ViewDataExtensions.cs +++ b/src/Umbraco.Web.Common/Extensions/ViewDataExtensions.cs @@ -122,14 +122,6 @@ public static class ViewDataExtensions this ViewDataDictionary viewData, BackOfficeExternalLoginProviderErrors errors) => viewData[TokenExternalSignInError] = errors; - [Obsolete("This is deprecated and will be removed in V15")] - public static string? GetPasswordResetCode(this ViewDataDictionary viewData) => - (string?)viewData[TokenPasswordResetCode]; - - [Obsolete("This is deprecated and will be removed in V15")] - public static void SetPasswordResetCode(this ViewDataDictionary viewData, string value) => - viewData[TokenPasswordResetCode] = value; - public static void SetTwoFactorProviderNames(this ViewDataDictionary viewData, IEnumerable providerNames) => viewData[TokenTwoFactorRequired] = providerNames; diff --git a/src/Umbraco.Web.Common/ModelsBuilder/InMemoryAuto/InMemoryModelFactory.cs b/src/Umbraco.Web.Common/ModelsBuilder/InMemoryAuto/InMemoryModelFactory.cs index a625be5d98..b44b6345e1 100644 --- a/src/Umbraco.Web.Common/ModelsBuilder/InMemoryAuto/InMemoryModelFactory.cs +++ b/src/Umbraco.Web.Common/ModelsBuilder/InMemoryAuto/InMemoryModelFactory.cs @@ -1,18 +1,14 @@ using System.Collections; using System.Reflection; using System.Reflection.Emit; -using System.Runtime.Loader; using System.Text; using System.Text.RegularExpressions; -using Microsoft.AspNetCore.Mvc.Razor; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Extensions; using Umbraco.Cms.Core.Hosting; using Umbraco.Cms.Core.Logging; @@ -53,56 +49,6 @@ namespace Umbraco.Cms.Web.Common.ModelsBuilder.InMemoryAuto private ModelsBuilderSettings _config; private bool _disposedValue; - [Obsolete("Use a not obsoleted constructor instead. Scheduled for removal in v16")] - public InMemoryModelFactory( - Lazy umbracoServices, - IProfilingLogger profilingLogger, - ILogger logger, - IOptionsMonitor config, - IHostingEnvironment hostingEnvironment, - IApplicationShutdownRegistry hostingLifetime, - IPublishedValueFallback publishedValueFallback, - InMemoryAssemblyLoadContextManager loadContextManager, - RuntimeCompilationCacheBuster runtimeCompilationCacheBuster) - { - _umbracoServices = umbracoServices; - _profilingLogger = profilingLogger; - _logger = logger; - _config = config.CurrentValue; - _hostEnvironment = StaticServiceProvider.Instance.GetRequiredService(); - _hostingLifetime = hostingLifetime; - _publishedValueFallback = publishedValueFallback; - _loadContextManager = loadContextManager; - _runtimeCompilationCacheBuster = runtimeCompilationCacheBuster; - _errors = new ModelsGenerationError(config, _hostEnvironment); - _ver = 1; // zero is for when we had no version - _skipver = -1; // nothing to skip - - if (!hostingEnvironment.IsHosted) - { - return; - } - - config.OnChange(x => _config = x); - _pureLiveDirectory = new Lazy(PureLiveDirectoryAbsolute); - - if (!Directory.Exists(_pureLiveDirectory.Value)) - { - Directory.CreateDirectory(_pureLiveDirectory.Value); - } - - // BEWARE! if the watcher is not properly released then for some reason the - // BuildManager will start confusing types - using a 'registered object' here - // though we should probably plug into Umbraco's MainDom - which is internal - _hostingLifetime.RegisterObject(this); - _watcher = new FileSystemWatcher(_pureLiveDirectory.Value); - _watcher.Changed += WatcherOnChanged; - _watcher.EnableRaisingEvents = true; - - // get it here, this need to be fast - _debugLevel = _config.DebugLevel; - } - public InMemoryModelFactory( Lazy umbracoServices, IProfilingLogger profilingLogger, diff --git a/src/Umbraco.Web.Common/Security/MemberSignInManager.cs b/src/Umbraco.Web.Common/Security/MemberSignInManager.cs index 2b8f6a7619..674180f21a 100644 --- a/src/Umbraco.Web.Common/Security/MemberSignInManager.cs +++ b/src/Umbraco.Web.Common/Security/MemberSignInManager.cs @@ -2,12 +2,10 @@ using System.Security.Claims; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Security; @@ -41,33 +39,6 @@ public class MemberSignInManager : UmbracoSignInManager, IMe _eventAggregator = eventAggregator; } - [Obsolete("Use non-obsolete constructor. This is scheduled for removal in V15.")] - public MemberSignInManager( - UserManager memberManager, - IHttpContextAccessor contextAccessor, - IUserClaimsPrincipalFactory claimsFactory, - IOptions optionsAccessor, - ILogger> logger, - IAuthenticationSchemeProvider schemes, - IUserConfirmation confirmation, - IMemberExternalLoginProviders memberExternalLoginProviders, - IEventAggregator eventAggregator, - IOptions securitySettings) - : this( - memberManager, - contextAccessor, - claimsFactory, - optionsAccessor, - logger, - schemes, - confirmation, - memberExternalLoginProviders, - eventAggregator, - securitySettings, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - // use default scheme for members protected override string AuthenticationType => IdentityConstants.ApplicationScheme; diff --git a/src/Umbraco.Web.Common/Security/UmbracoSignInManager.cs b/src/Umbraco.Web.Common/Security/UmbracoSignInManager.cs index b0b2622e16..d49c2ae238 100644 --- a/src/Umbraco.Web.Common/Security/UmbracoSignInManager.cs +++ b/src/Umbraco.Web.Common/Security/UmbracoSignInManager.cs @@ -29,30 +29,6 @@ public abstract class UmbracoSignInManager : SignInManager // borrowed from https://github.com/dotnet/aspnetcore/blob/master/src/Identity/Core/src/SignInManager.cs protected const string UmbracoSignInMgrXsrfKey = "XsrfId"; - - [Obsolete("Use non-obsolete constructor. This is scheduled for removal in V15.")] - public UmbracoSignInManager( - UserManager userManager, - IHttpContextAccessor contextAccessor, - IUserClaimsPrincipalFactory claimsFactory, - IOptions optionsAccessor, - ILogger> logger, - IAuthenticationSchemeProvider schemes, - IUserConfirmation confirmation, - IOptions securitySettingsOptions) - : this( - userManager, - contextAccessor, - claimsFactory, - optionsAccessor, - logger, - schemes, - confirmation, - securitySettingsOptions, - StaticServiceProvider.Instance.GetRequiredService()) - { - } - public UmbracoSignInManager( UserManager userManager, IHttpContextAccessor contextAccessor, diff --git a/src/Umbraco.Web.UI.Client/src/external/backend-api/src/sdk.gen.ts b/src/Umbraco.Web.UI.Client/src/external/backend-api/src/sdk.gen.ts index 9b36b8ffd2..424deb2926 100644 --- a/src/Umbraco.Web.UI.Client/src/external/backend-api/src/sdk.gen.ts +++ b/src/Umbraco.Web.UI.Client/src/external/backend-api/src/sdk.gen.ts @@ -3,7 +3,7 @@ import type { CancelablePromise } from './core/CancelablePromise'; import { OpenAPI } from './core/OpenAPI'; import { request as __request } from './core/request'; -import type { GetCultureData, GetCultureResponse, PostDataTypeData, PostDataTypeResponse, GetDataTypeByIdData, GetDataTypeByIdResponse, DeleteDataTypeByIdData, DeleteDataTypeByIdResponse, PutDataTypeByIdData, PutDataTypeByIdResponse, PostDataTypeByIdCopyData, PostDataTypeByIdCopyResponse, GetDataTypeByIdIsUsedData, GetDataTypeByIdIsUsedResponse, PutDataTypeByIdMoveData, PutDataTypeByIdMoveResponse, GetDataTypeByIdReferencesData, GetDataTypeByIdReferencesResponse, GetDataTypeConfigurationResponse, PostDataTypeFolderData, PostDataTypeFolderResponse, GetDataTypeFolderByIdData, GetDataTypeFolderByIdResponse, DeleteDataTypeFolderByIdData, DeleteDataTypeFolderByIdResponse, PutDataTypeFolderByIdData, PutDataTypeFolderByIdResponse, GetFilterDataTypeData, GetFilterDataTypeResponse, GetItemDataTypeData, GetItemDataTypeResponse, GetItemDataTypeSearchData, GetItemDataTypeSearchResponse, GetTreeDataTypeAncestorsData, GetTreeDataTypeAncestorsResponse, GetTreeDataTypeChildrenData, GetTreeDataTypeChildrenResponse, GetTreeDataTypeRootData, GetTreeDataTypeRootResponse, GetDictionaryData, GetDictionaryResponse, PostDictionaryData, PostDictionaryResponse, GetDictionaryByIdData, GetDictionaryByIdResponse, DeleteDictionaryByIdData, DeleteDictionaryByIdResponse, PutDictionaryByIdData, PutDictionaryByIdResponse, GetDictionaryByIdExportData, GetDictionaryByIdExportResponse, PutDictionaryByIdMoveData, PutDictionaryByIdMoveResponse, PostDictionaryImportData, PostDictionaryImportResponse, GetItemDictionaryData, GetItemDictionaryResponse, GetTreeDictionaryAncestorsData, GetTreeDictionaryAncestorsResponse, GetTreeDictionaryChildrenData, GetTreeDictionaryChildrenResponse, GetTreeDictionaryRootData, GetTreeDictionaryRootResponse, GetCollectionDocumentByIdData, GetCollectionDocumentByIdResponse, PostDocumentData, PostDocumentResponse, GetDocumentByIdData, GetDocumentByIdResponse, DeleteDocumentByIdData, DeleteDocumentByIdResponse, PutDocumentByIdData, PutDocumentByIdResponse, GetDocumentByIdAuditLogData, GetDocumentByIdAuditLogResponse, PostDocumentByIdCopyData, PostDocumentByIdCopyResponse, GetDocumentByIdDomainsData, GetDocumentByIdDomainsResponse, PutDocumentByIdDomainsData, PutDocumentByIdDomainsResponse, PutDocumentByIdMoveData, PutDocumentByIdMoveResponse, PutDocumentByIdMoveToRecycleBinData, PutDocumentByIdMoveToRecycleBinResponse, GetDocumentByIdNotificationsData, GetDocumentByIdNotificationsResponse, PutDocumentByIdNotificationsData, PutDocumentByIdNotificationsResponse, PostDocumentByIdPublicAccessData, PostDocumentByIdPublicAccessResponse, DeleteDocumentByIdPublicAccessData, DeleteDocumentByIdPublicAccessResponse, GetDocumentByIdPublicAccessData, GetDocumentByIdPublicAccessResponse, PutDocumentByIdPublicAccessData, PutDocumentByIdPublicAccessResponse, PutDocumentByIdPublishData, PutDocumentByIdPublishResponse, PutDocumentByIdPublishWithDescendantsData, PutDocumentByIdPublishWithDescendantsResponse, GetDocumentByIdPublishedData, GetDocumentByIdPublishedResponse, GetDocumentByIdReferencedByData, GetDocumentByIdReferencedByResponse, GetDocumentByIdReferencedDescendantsData, GetDocumentByIdReferencedDescendantsResponse, PutDocumentByIdUnpublishData, PutDocumentByIdUnpublishResponse, PutDocumentByIdValidateData, PutDocumentByIdValidateResponse, PutUmbracoManagementApiV11DocumentByIdValidate11Data, PutUmbracoManagementApiV11DocumentByIdValidate11Response, GetDocumentAreReferencedData, GetDocumentAreReferencedResponse, GetDocumentConfigurationResponse, PutDocumentSortData, PutDocumentSortResponse, GetDocumentUrlsData, GetDocumentUrlsResponse, PostDocumentValidateData, PostDocumentValidateResponse, GetItemDocumentData, GetItemDocumentResponse, GetItemDocumentSearchData, GetItemDocumentSearchResponse, DeleteRecycleBinDocumentResponse, DeleteRecycleBinDocumentByIdData, DeleteRecycleBinDocumentByIdResponse, GetRecycleBinDocumentByIdOriginalParentData, GetRecycleBinDocumentByIdOriginalParentResponse, PutRecycleBinDocumentByIdRestoreData, PutRecycleBinDocumentByIdRestoreResponse, GetRecycleBinDocumentChildrenData, GetRecycleBinDocumentChildrenResponse, GetRecycleBinDocumentRootData, GetRecycleBinDocumentRootResponse, GetTreeDocumentAncestorsData, GetTreeDocumentAncestorsResponse, GetTreeDocumentChildrenData, GetTreeDocumentChildrenResponse, GetTreeDocumentRootData, GetTreeDocumentRootResponse, PostDocumentBlueprintData, PostDocumentBlueprintResponse, GetDocumentBlueprintByIdData, GetDocumentBlueprintByIdResponse, DeleteDocumentBlueprintByIdData, DeleteDocumentBlueprintByIdResponse, PutDocumentBlueprintByIdData, PutDocumentBlueprintByIdResponse, PutDocumentBlueprintByIdMoveData, PutDocumentBlueprintByIdMoveResponse, PostDocumentBlueprintFolderData, PostDocumentBlueprintFolderResponse, GetDocumentBlueprintFolderByIdData, GetDocumentBlueprintFolderByIdResponse, DeleteDocumentBlueprintFolderByIdData, DeleteDocumentBlueprintFolderByIdResponse, PutDocumentBlueprintFolderByIdData, PutDocumentBlueprintFolderByIdResponse, PostDocumentBlueprintFromDocumentData, PostDocumentBlueprintFromDocumentResponse, GetItemDocumentBlueprintData, GetItemDocumentBlueprintResponse, GetTreeDocumentBlueprintAncestorsData, GetTreeDocumentBlueprintAncestorsResponse, GetTreeDocumentBlueprintChildrenData, GetTreeDocumentBlueprintChildrenResponse, GetTreeDocumentBlueprintRootData, GetTreeDocumentBlueprintRootResponse, PostDocumentTypeData, PostDocumentTypeResponse, GetDocumentTypeByIdData, GetDocumentTypeByIdResponse, DeleteDocumentTypeByIdData, DeleteDocumentTypeByIdResponse, PutDocumentTypeByIdData, PutDocumentTypeByIdResponse, GetDocumentTypeByIdAllowedChildrenData, GetDocumentTypeByIdAllowedChildrenResponse, GetDocumentTypeByIdBlueprintData, GetDocumentTypeByIdBlueprintResponse, GetDocumentTypeByIdCompositionReferencesData, GetDocumentTypeByIdCompositionReferencesResponse, PostDocumentTypeByIdCopyData, PostDocumentTypeByIdCopyResponse, GetDocumentTypeByIdExportData, GetDocumentTypeByIdExportResponse, PutDocumentTypeByIdImportData, PutDocumentTypeByIdImportResponse, PutDocumentTypeByIdMoveData, PutDocumentTypeByIdMoveResponse, GetDocumentTypeAllowedAtRootData, GetDocumentTypeAllowedAtRootResponse, PostDocumentTypeAvailableCompositionsData, PostDocumentTypeAvailableCompositionsResponse, GetDocumentTypeConfigurationResponse, PostDocumentTypeFolderData, PostDocumentTypeFolderResponse, GetDocumentTypeFolderByIdData, GetDocumentTypeFolderByIdResponse, DeleteDocumentTypeFolderByIdData, DeleteDocumentTypeFolderByIdResponse, PutDocumentTypeFolderByIdData, PutDocumentTypeFolderByIdResponse, PostDocumentTypeImportData, PostDocumentTypeImportResponse, GetItemDocumentTypeData, GetItemDocumentTypeResponse, GetItemDocumentTypeSearchData, GetItemDocumentTypeSearchResponse, GetTreeDocumentTypeAncestorsData, GetTreeDocumentTypeAncestorsResponse, GetTreeDocumentTypeChildrenData, GetTreeDocumentTypeChildrenResponse, GetTreeDocumentTypeRootData, GetTreeDocumentTypeRootResponse, GetDocumentVersionData, GetDocumentVersionResponse, GetDocumentVersionByIdData, GetDocumentVersionByIdResponse, PutDocumentVersionByIdPreventCleanupData, PutDocumentVersionByIdPreventCleanupResponse, PostDocumentVersionByIdRollbackData, PostDocumentVersionByIdRollbackResponse, PostDynamicRootQueryData, PostDynamicRootQueryResponse, GetDynamicRootStepsResponse, GetHealthCheckGroupData, GetHealthCheckGroupResponse, GetHealthCheckGroupByNameData, GetHealthCheckGroupByNameResponse, PostHealthCheckGroupByNameCheckData, PostHealthCheckGroupByNameCheckResponse, PostHealthCheckExecuteActionData, PostHealthCheckExecuteActionResponse, GetHelpData, GetHelpResponse, GetImagingResizeUrlsData, GetImagingResizeUrlsResponse, GetImportAnalyzeData, GetImportAnalyzeResponse, GetIndexerData, GetIndexerResponse, GetIndexerByIndexNameData, GetIndexerByIndexNameResponse, PostIndexerByIndexNameRebuildData, PostIndexerByIndexNameRebuildResponse, GetInstallSettingsResponse, PostInstallSetupData, PostInstallSetupResponse, PostInstallValidateDatabaseData, PostInstallValidateDatabaseResponse, GetItemLanguageData, GetItemLanguageResponse, GetItemLanguageDefaultResponse, GetLanguageData, GetLanguageResponse, PostLanguageData, PostLanguageResponse, GetLanguageByIsoCodeData, GetLanguageByIsoCodeResponse, DeleteLanguageByIsoCodeData, DeleteLanguageByIsoCodeResponse, PutLanguageByIsoCodeData, PutLanguageByIsoCodeResponse, GetLogViewerLevelData, GetLogViewerLevelResponse, GetLogViewerLevelCountData, GetLogViewerLevelCountResponse, GetLogViewerLogData, GetLogViewerLogResponse, GetLogViewerMessageTemplateData, GetLogViewerMessageTemplateResponse, GetLogViewerSavedSearchData, GetLogViewerSavedSearchResponse, PostLogViewerSavedSearchData, PostLogViewerSavedSearchResponse, GetLogViewerSavedSearchByNameData, GetLogViewerSavedSearchByNameResponse, DeleteLogViewerSavedSearchByNameData, DeleteLogViewerSavedSearchByNameResponse, GetLogViewerValidateLogsSizeData, GetLogViewerValidateLogsSizeResponse, GetManifestManifestResponse, GetManifestManifestPrivateResponse, GetManifestManifestPublicResponse, GetCollectionMediaData, GetCollectionMediaResponse, GetItemMediaData, GetItemMediaResponse, GetItemMediaSearchData, GetItemMediaSearchResponse, PostMediaData, PostMediaResponse, GetMediaByIdData, GetMediaByIdResponse, DeleteMediaByIdData, DeleteMediaByIdResponse, PutMediaByIdData, PutMediaByIdResponse, GetMediaByIdAuditLogData, GetMediaByIdAuditLogResponse, PutMediaByIdMoveData, PutMediaByIdMoveResponse, PutMediaByIdMoveToRecycleBinData, PutMediaByIdMoveToRecycleBinResponse, GetMediaByIdReferencedByData, GetMediaByIdReferencedByResponse, GetMediaByIdReferencedDescendantsData, GetMediaByIdReferencedDescendantsResponse, PutMediaByIdValidateData, PutMediaByIdValidateResponse, GetMediaAreReferencedData, GetMediaAreReferencedResponse, GetMediaConfigurationResponse, PutMediaSortData, PutMediaSortResponse, GetMediaUrlsData, GetMediaUrlsResponse, PostMediaValidateData, PostMediaValidateResponse, DeleteRecycleBinMediaResponse, DeleteRecycleBinMediaByIdData, DeleteRecycleBinMediaByIdResponse, GetRecycleBinMediaByIdOriginalParentData, GetRecycleBinMediaByIdOriginalParentResponse, PutRecycleBinMediaByIdRestoreData, PutRecycleBinMediaByIdRestoreResponse, GetRecycleBinMediaChildrenData, GetRecycleBinMediaChildrenResponse, GetRecycleBinMediaRootData, GetRecycleBinMediaRootResponse, GetTreeMediaAncestorsData, GetTreeMediaAncestorsResponse, GetTreeMediaChildrenData, GetTreeMediaChildrenResponse, GetTreeMediaRootData, GetTreeMediaRootResponse, GetItemMediaTypeData, GetItemMediaTypeResponse, GetItemMediaTypeAllowedData, GetItemMediaTypeAllowedResponse, GetItemMediaTypeFoldersData, GetItemMediaTypeFoldersResponse, GetItemMediaTypeSearchData, GetItemMediaTypeSearchResponse, PostMediaTypeData, PostMediaTypeResponse, GetMediaTypeByIdData, GetMediaTypeByIdResponse, DeleteMediaTypeByIdData, DeleteMediaTypeByIdResponse, PutMediaTypeByIdData, PutMediaTypeByIdResponse, GetMediaTypeByIdAllowedChildrenData, GetMediaTypeByIdAllowedChildrenResponse, GetMediaTypeByIdCompositionReferencesData, GetMediaTypeByIdCompositionReferencesResponse, PostMediaTypeByIdCopyData, PostMediaTypeByIdCopyResponse, GetMediaTypeByIdExportData, GetMediaTypeByIdExportResponse, PutMediaTypeByIdImportData, PutMediaTypeByIdImportResponse, PutMediaTypeByIdMoveData, PutMediaTypeByIdMoveResponse, GetMediaTypeAllowedAtRootData, GetMediaTypeAllowedAtRootResponse, PostMediaTypeAvailableCompositionsData, PostMediaTypeAvailableCompositionsResponse, GetMediaTypeConfigurationResponse, PostMediaTypeFolderData, PostMediaTypeFolderResponse, GetMediaTypeFolderByIdData, GetMediaTypeFolderByIdResponse, DeleteMediaTypeFolderByIdData, DeleteMediaTypeFolderByIdResponse, PutMediaTypeFolderByIdData, PutMediaTypeFolderByIdResponse, PostMediaTypeImportData, PostMediaTypeImportResponse, GetTreeMediaTypeAncestorsData, GetTreeMediaTypeAncestorsResponse, GetTreeMediaTypeChildrenData, GetTreeMediaTypeChildrenResponse, GetTreeMediaTypeRootData, GetTreeMediaTypeRootResponse, GetFilterMemberData, GetFilterMemberResponse, GetItemMemberData, GetItemMemberResponse, GetItemMemberSearchData, GetItemMemberSearchResponse, PostMemberData, PostMemberResponse, GetMemberByIdData, GetMemberByIdResponse, DeleteMemberByIdData, DeleteMemberByIdResponse, PutMemberByIdData, PutMemberByIdResponse, PutMemberByIdValidateData, PutMemberByIdValidateResponse, GetMemberConfigurationResponse, PostMemberValidateData, PostMemberValidateResponse, GetItemMemberGroupData, GetItemMemberGroupResponse, GetMemberGroupData, GetMemberGroupResponse, PostMemberGroupData, PostMemberGroupResponse, GetMemberGroupByIdData, GetMemberGroupByIdResponse, DeleteMemberGroupByIdData, DeleteMemberGroupByIdResponse, PutMemberGroupByIdData, PutMemberGroupByIdResponse, GetTreeMemberGroupRootData, GetTreeMemberGroupRootResponse, GetItemMemberTypeData, GetItemMemberTypeResponse, GetItemMemberTypeSearchData, GetItemMemberTypeSearchResponse, PostMemberTypeData, PostMemberTypeResponse, GetMemberTypeByIdData, GetMemberTypeByIdResponse, DeleteMemberTypeByIdData, DeleteMemberTypeByIdResponse, PutMemberTypeByIdData, PutMemberTypeByIdResponse, GetMemberTypeByIdCompositionReferencesData, GetMemberTypeByIdCompositionReferencesResponse, PostMemberTypeByIdCopyData, PostMemberTypeByIdCopyResponse, PostMemberTypeAvailableCompositionsData, PostMemberTypeAvailableCompositionsResponse, GetMemberTypeConfigurationResponse, GetTreeMemberTypeRootData, GetTreeMemberTypeRootResponse, PostModelsBuilderBuildResponse, GetModelsBuilderDashboardResponse, GetModelsBuilderStatusResponse, GetObjectTypesData, GetObjectTypesResponse, GetOembedQueryData, GetOembedQueryResponse, PostPackageByNameRunMigrationData, PostPackageByNameRunMigrationResponse, GetPackageConfigurationResponse, GetPackageCreatedData, GetPackageCreatedResponse, PostPackageCreatedData, PostPackageCreatedResponse, GetPackageCreatedByIdData, GetPackageCreatedByIdResponse, DeletePackageCreatedByIdData, DeletePackageCreatedByIdResponse, PutPackageCreatedByIdData, PutPackageCreatedByIdResponse, GetPackageCreatedByIdDownloadData, GetPackageCreatedByIdDownloadResponse, GetPackageMigrationStatusData, GetPackageMigrationStatusResponse, GetItemPartialViewData, GetItemPartialViewResponse, PostPartialViewData, PostPartialViewResponse, GetPartialViewByPathData, GetPartialViewByPathResponse, DeletePartialViewByPathData, DeletePartialViewByPathResponse, PutPartialViewByPathData, PutPartialViewByPathResponse, PutPartialViewByPathRenameData, PutPartialViewByPathRenameResponse, PostPartialViewFolderData, PostPartialViewFolderResponse, GetPartialViewFolderByPathData, GetPartialViewFolderByPathResponse, DeletePartialViewFolderByPathData, DeletePartialViewFolderByPathResponse, GetPartialViewSnippetData, GetPartialViewSnippetResponse, GetPartialViewSnippetByIdData, GetPartialViewSnippetByIdResponse, GetTreePartialViewAncestorsData, GetTreePartialViewAncestorsResponse, GetTreePartialViewChildrenData, GetTreePartialViewChildrenResponse, GetTreePartialViewRootData, GetTreePartialViewRootResponse, DeletePreviewResponse, PostPreviewResponse, GetProfilingStatusResponse, PutProfilingStatusData, PutProfilingStatusResponse, GetPropertyTypeIsUsedData, GetPropertyTypeIsUsedResponse, PostPublishedCacheRebuildResponse, GetPublishedCacheRebuildStatusResponse, PostPublishedCacheReloadResponse, GetRedirectManagementData, GetRedirectManagementResponse, GetRedirectManagementByIdData, GetRedirectManagementByIdResponse, DeleteRedirectManagementByIdData, DeleteRedirectManagementByIdResponse, GetRedirectManagementStatusResponse, PostRedirectManagementStatusData, PostRedirectManagementStatusResponse, GetRelationByRelationTypeIdData, GetRelationByRelationTypeIdResponse, GetItemRelationTypeData, GetItemRelationTypeResponse, GetRelationTypeData, GetRelationTypeResponse, GetRelationTypeByIdData, GetRelationTypeByIdResponse, GetItemScriptData, GetItemScriptResponse, PostScriptData, PostScriptResponse, GetScriptByPathData, GetScriptByPathResponse, DeleteScriptByPathData, DeleteScriptByPathResponse, PutScriptByPathData, PutScriptByPathResponse, PutScriptByPathRenameData, PutScriptByPathRenameResponse, PostScriptFolderData, PostScriptFolderResponse, GetScriptFolderByPathData, GetScriptFolderByPathResponse, DeleteScriptFolderByPathData, DeleteScriptFolderByPathResponse, GetTreeScriptAncestorsData, GetTreeScriptAncestorsResponse, GetTreeScriptChildrenData, GetTreeScriptChildrenResponse, GetTreeScriptRootData, GetTreeScriptRootResponse, GetSearcherData, GetSearcherResponse, GetSearcherBySearcherNameQueryData, GetSearcherBySearcherNameQueryResponse, GetSecurityConfigurationResponse, PostSecurityForgotPasswordData, PostSecurityForgotPasswordResponse, PostSecurityForgotPasswordResetData, PostSecurityForgotPasswordResetResponse, PostSecurityForgotPasswordVerifyData, PostSecurityForgotPasswordVerifyResponse, GetSegmentData, GetSegmentResponse, GetServerConfigurationResponse, GetServerInformationResponse, GetServerStatusResponse, GetServerTroubleshootingResponse, GetServerUpgradeCheckResponse, GetItemStaticFileData, GetItemStaticFileResponse, GetTreeStaticFileAncestorsData, GetTreeStaticFileAncestorsResponse, GetTreeStaticFileChildrenData, GetTreeStaticFileChildrenResponse, GetTreeStaticFileRootData, GetTreeStaticFileRootResponse, GetItemStylesheetData, GetItemStylesheetResponse, PostStylesheetData, PostStylesheetResponse, GetStylesheetByPathData, GetStylesheetByPathResponse, DeleteStylesheetByPathData, DeleteStylesheetByPathResponse, PutStylesheetByPathData, PutStylesheetByPathResponse, PutStylesheetByPathRenameData, PutStylesheetByPathRenameResponse, PostStylesheetFolderData, PostStylesheetFolderResponse, GetStylesheetFolderByPathData, GetStylesheetFolderByPathResponse, DeleteStylesheetFolderByPathData, DeleteStylesheetFolderByPathResponse, GetTreeStylesheetAncestorsData, GetTreeStylesheetAncestorsResponse, GetTreeStylesheetChildrenData, GetTreeStylesheetChildrenResponse, GetTreeStylesheetRootData, GetTreeStylesheetRootResponse, GetTagData, GetTagResponse, GetTelemetryData, GetTelemetryResponse, GetTelemetryLevelResponse, PostTelemetryLevelData, PostTelemetryLevelResponse, GetItemTemplateData, GetItemTemplateResponse, GetItemTemplateSearchData, GetItemTemplateSearchResponse, PostTemplateData, PostTemplateResponse, GetTemplateByIdData, GetTemplateByIdResponse, DeleteTemplateByIdData, DeleteTemplateByIdResponse, PutTemplateByIdData, PutTemplateByIdResponse, GetTemplateConfigurationResponse, PostTemplateQueryExecuteData, PostTemplateQueryExecuteResponse, GetTemplateQuerySettingsResponse, GetTreeTemplateAncestorsData, GetTreeTemplateAncestorsResponse, GetTreeTemplateChildrenData, GetTreeTemplateChildrenResponse, GetTreeTemplateRootData, GetTreeTemplateRootResponse, PostTemporaryFileData, PostTemporaryFileResponse, GetTemporaryFileByIdData, GetTemporaryFileByIdResponse, DeleteTemporaryFileByIdData, DeleteTemporaryFileByIdResponse, GetTemporaryFileConfigurationResponse, PostUpgradeAuthorizeResponse, GetUpgradeSettingsResponse, GetFilterUserData, GetFilterUserResponse, GetItemUserData, GetItemUserResponse, PostUserData, PostUserResponse, DeleteUserData, DeleteUserResponse, GetUserData, GetUserResponse, GetUserByIdData, GetUserByIdResponse, DeleteUserByIdData, DeleteUserByIdResponse, PutUserByIdData, PutUserByIdResponse, GetUserById2FaData, GetUserById2FaResponse, DeleteUserById2FaByProviderNameData, DeleteUserById2FaByProviderNameResponse, GetUserByIdCalculateStartNodesData, GetUserByIdCalculateStartNodesResponse, PostUserByIdChangePasswordData, PostUserByIdChangePasswordResponse, PostUserByIdClientCredentialsData, PostUserByIdClientCredentialsResponse, GetUserByIdClientCredentialsData, GetUserByIdClientCredentialsResponse, DeleteUserByIdClientCredentialsByClientIdData, DeleteUserByIdClientCredentialsByClientIdResponse, PostUserByIdResetPasswordData, PostUserByIdResetPasswordResponse, DeleteUserAvatarByIdData, DeleteUserAvatarByIdResponse, PostUserAvatarByIdData, PostUserAvatarByIdResponse, GetUserConfigurationResponse, GetUserCurrentResponse, GetUserCurrent2FaResponse, DeleteUserCurrent2FaByProviderNameData, DeleteUserCurrent2FaByProviderNameResponse, PostUserCurrent2FaByProviderNameData, PostUserCurrent2FaByProviderNameResponse, GetUserCurrent2FaByProviderNameData, GetUserCurrent2FaByProviderNameResponse, PostUserCurrentAvatarData, PostUserCurrentAvatarResponse, PostUserCurrentChangePasswordData, PostUserCurrentChangePasswordResponse, GetUserCurrentConfigurationResponse, GetUserCurrentLoginProvidersResponse, GetUserCurrentPermissionsData, GetUserCurrentPermissionsResponse, GetUserCurrentPermissionsDocumentData, GetUserCurrentPermissionsDocumentResponse, GetUserCurrentPermissionsMediaData, GetUserCurrentPermissionsMediaResponse, PostUserDisableData, PostUserDisableResponse, PostUserEnableData, PostUserEnableResponse, PostUserInviteData, PostUserInviteResponse, PostUserInviteCreatePasswordData, PostUserInviteCreatePasswordResponse, PostUserInviteResendData, PostUserInviteResendResponse, PostUserInviteVerifyData, PostUserInviteVerifyResponse, PostUserSetUserGroupsData, PostUserSetUserGroupsResponse, PostUserUnlockData, PostUserUnlockResponse, PostUserDataData, PostUserDataResponse, GetUserDataData, GetUserDataResponse, PutUserDataData, PutUserDataResponse, GetUserDataByIdData, GetUserDataByIdResponse, GetFilterUserGroupData, GetFilterUserGroupResponse, GetItemUserGroupData, GetItemUserGroupResponse, DeleteUserGroupData, DeleteUserGroupResponse, PostUserGroupData, PostUserGroupResponse, GetUserGroupData, GetUserGroupResponse, GetUserGroupByIdData, GetUserGroupByIdResponse, DeleteUserGroupByIdData, DeleteUserGroupByIdResponse, PutUserGroupByIdData, PutUserGroupByIdResponse, DeleteUserGroupByIdUsersData, DeleteUserGroupByIdUsersResponse, PostUserGroupByIdUsersData, PostUserGroupByIdUsersResponse, GetItemWebhookData, GetItemWebhookResponse, GetWebhookData, GetWebhookResponse, PostWebhookData, PostWebhookResponse, GetWebhookByIdData, GetWebhookByIdResponse, DeleteWebhookByIdData, DeleteWebhookByIdResponse, PutWebhookByIdData, PutWebhookByIdResponse, GetWebhookByIdLogsData, GetWebhookByIdLogsResponse, GetWebhookEventsData, GetWebhookEventsResponse, GetWebhookLogsData, GetWebhookLogsResponse } from './types.gen'; +import type { GetCultureData, GetCultureResponse, PostDataTypeData, PostDataTypeResponse, GetDataTypeByIdData, GetDataTypeByIdResponse, DeleteDataTypeByIdData, DeleteDataTypeByIdResponse, PutDataTypeByIdData, PutDataTypeByIdResponse, PostDataTypeByIdCopyData, PostDataTypeByIdCopyResponse, GetDataTypeByIdIsUsedData, GetDataTypeByIdIsUsedResponse, PutDataTypeByIdMoveData, PutDataTypeByIdMoveResponse, GetDataTypeByIdReferencesData, GetDataTypeByIdReferencesResponse, GetDataTypeConfigurationResponse, PostDataTypeFolderData, PostDataTypeFolderResponse, GetDataTypeFolderByIdData, GetDataTypeFolderByIdResponse, DeleteDataTypeFolderByIdData, DeleteDataTypeFolderByIdResponse, PutDataTypeFolderByIdData, PutDataTypeFolderByIdResponse, GetFilterDataTypeData, GetFilterDataTypeResponse, GetItemDataTypeData, GetItemDataTypeResponse, GetItemDataTypeSearchData, GetItemDataTypeSearchResponse, GetTreeDataTypeAncestorsData, GetTreeDataTypeAncestorsResponse, GetTreeDataTypeChildrenData, GetTreeDataTypeChildrenResponse, GetTreeDataTypeRootData, GetTreeDataTypeRootResponse, GetDictionaryData, GetDictionaryResponse, PostDictionaryData, PostDictionaryResponse, GetDictionaryByIdData, GetDictionaryByIdResponse, DeleteDictionaryByIdData, DeleteDictionaryByIdResponse, PutDictionaryByIdData, PutDictionaryByIdResponse, GetDictionaryByIdExportData, GetDictionaryByIdExportResponse, PutDictionaryByIdMoveData, PutDictionaryByIdMoveResponse, PostDictionaryImportData, PostDictionaryImportResponse, GetItemDictionaryData, GetItemDictionaryResponse, GetTreeDictionaryAncestorsData, GetTreeDictionaryAncestorsResponse, GetTreeDictionaryChildrenData, GetTreeDictionaryChildrenResponse, GetTreeDictionaryRootData, GetTreeDictionaryRootResponse, GetCollectionDocumentByIdData, GetCollectionDocumentByIdResponse, PostDocumentData, PostDocumentResponse, GetDocumentByIdData, GetDocumentByIdResponse, DeleteDocumentByIdData, DeleteDocumentByIdResponse, PutDocumentByIdData, PutDocumentByIdResponse, GetDocumentByIdAuditLogData, GetDocumentByIdAuditLogResponse, PostDocumentByIdCopyData, PostDocumentByIdCopyResponse, GetDocumentByIdDomainsData, GetDocumentByIdDomainsResponse, PutDocumentByIdDomainsData, PutDocumentByIdDomainsResponse, PutDocumentByIdMoveData, PutDocumentByIdMoveResponse, PutDocumentByIdMoveToRecycleBinData, PutDocumentByIdMoveToRecycleBinResponse, GetDocumentByIdNotificationsData, GetDocumentByIdNotificationsResponse, PutDocumentByIdNotificationsData, PutDocumentByIdNotificationsResponse, PostDocumentByIdPublicAccessData, PostDocumentByIdPublicAccessResponse, DeleteDocumentByIdPublicAccessData, DeleteDocumentByIdPublicAccessResponse, GetDocumentByIdPublicAccessData, GetDocumentByIdPublicAccessResponse, PutDocumentByIdPublicAccessData, PutDocumentByIdPublicAccessResponse, PutDocumentByIdPublishData, PutDocumentByIdPublishResponse, PutDocumentByIdPublishWithDescendantsData, PutDocumentByIdPublishWithDescendantsResponse, GetDocumentByIdPublishedData, GetDocumentByIdPublishedResponse, GetDocumentByIdReferencedByData, GetDocumentByIdReferencedByResponse, GetDocumentByIdReferencedDescendantsData, GetDocumentByIdReferencedDescendantsResponse, PutDocumentByIdUnpublishData, PutDocumentByIdUnpublishResponse, PutUmbracoManagementApiV11DocumentByIdValidate11Data, PutUmbracoManagementApiV11DocumentByIdValidate11Response, GetDocumentAreReferencedData, GetDocumentAreReferencedResponse, GetDocumentConfigurationResponse, PutDocumentSortData, PutDocumentSortResponse, GetDocumentUrlsData, GetDocumentUrlsResponse, PostDocumentValidateData, PostDocumentValidateResponse, GetItemDocumentData, GetItemDocumentResponse, GetItemDocumentSearchData, GetItemDocumentSearchResponse, DeleteRecycleBinDocumentResponse, DeleteRecycleBinDocumentByIdData, DeleteRecycleBinDocumentByIdResponse, GetRecycleBinDocumentByIdOriginalParentData, GetRecycleBinDocumentByIdOriginalParentResponse, PutRecycleBinDocumentByIdRestoreData, PutRecycleBinDocumentByIdRestoreResponse, GetRecycleBinDocumentChildrenData, GetRecycleBinDocumentChildrenResponse, GetRecycleBinDocumentRootData, GetRecycleBinDocumentRootResponse, GetTreeDocumentAncestorsData, GetTreeDocumentAncestorsResponse, GetTreeDocumentChildrenData, GetTreeDocumentChildrenResponse, GetTreeDocumentRootData, GetTreeDocumentRootResponse, PostDocumentBlueprintData, PostDocumentBlueprintResponse, GetDocumentBlueprintByIdData, GetDocumentBlueprintByIdResponse, DeleteDocumentBlueprintByIdData, DeleteDocumentBlueprintByIdResponse, PutDocumentBlueprintByIdData, PutDocumentBlueprintByIdResponse, PutDocumentBlueprintByIdMoveData, PutDocumentBlueprintByIdMoveResponse, PostDocumentBlueprintFolderData, PostDocumentBlueprintFolderResponse, GetDocumentBlueprintFolderByIdData, GetDocumentBlueprintFolderByIdResponse, DeleteDocumentBlueprintFolderByIdData, DeleteDocumentBlueprintFolderByIdResponse, PutDocumentBlueprintFolderByIdData, PutDocumentBlueprintFolderByIdResponse, PostDocumentBlueprintFromDocumentData, PostDocumentBlueprintFromDocumentResponse, GetItemDocumentBlueprintData, GetItemDocumentBlueprintResponse, GetTreeDocumentBlueprintAncestorsData, GetTreeDocumentBlueprintAncestorsResponse, GetTreeDocumentBlueprintChildrenData, GetTreeDocumentBlueprintChildrenResponse, GetTreeDocumentBlueprintRootData, GetTreeDocumentBlueprintRootResponse, PostDocumentTypeData, PostDocumentTypeResponse, GetDocumentTypeByIdData, GetDocumentTypeByIdResponse, DeleteDocumentTypeByIdData, DeleteDocumentTypeByIdResponse, PutDocumentTypeByIdData, PutDocumentTypeByIdResponse, GetDocumentTypeByIdAllowedChildrenData, GetDocumentTypeByIdAllowedChildrenResponse, GetDocumentTypeByIdBlueprintData, GetDocumentTypeByIdBlueprintResponse, GetDocumentTypeByIdCompositionReferencesData, GetDocumentTypeByIdCompositionReferencesResponse, PostDocumentTypeByIdCopyData, PostDocumentTypeByIdCopyResponse, GetDocumentTypeByIdExportData, GetDocumentTypeByIdExportResponse, PutDocumentTypeByIdImportData, PutDocumentTypeByIdImportResponse, PutDocumentTypeByIdMoveData, PutDocumentTypeByIdMoveResponse, GetDocumentTypeAllowedAtRootData, GetDocumentTypeAllowedAtRootResponse, PostDocumentTypeAvailableCompositionsData, PostDocumentTypeAvailableCompositionsResponse, GetDocumentTypeConfigurationResponse, PostDocumentTypeFolderData, PostDocumentTypeFolderResponse, GetDocumentTypeFolderByIdData, GetDocumentTypeFolderByIdResponse, DeleteDocumentTypeFolderByIdData, DeleteDocumentTypeFolderByIdResponse, PutDocumentTypeFolderByIdData, PutDocumentTypeFolderByIdResponse, PostDocumentTypeImportData, PostDocumentTypeImportResponse, GetItemDocumentTypeData, GetItemDocumentTypeResponse, GetItemDocumentTypeSearchData, GetItemDocumentTypeSearchResponse, GetTreeDocumentTypeAncestorsData, GetTreeDocumentTypeAncestorsResponse, GetTreeDocumentTypeChildrenData, GetTreeDocumentTypeChildrenResponse, GetTreeDocumentTypeRootData, GetTreeDocumentTypeRootResponse, GetDocumentVersionData, GetDocumentVersionResponse, GetDocumentVersionByIdData, GetDocumentVersionByIdResponse, PutDocumentVersionByIdPreventCleanupData, PutDocumentVersionByIdPreventCleanupResponse, PostDocumentVersionByIdRollbackData, PostDocumentVersionByIdRollbackResponse, PostDynamicRootQueryData, PostDynamicRootQueryResponse, GetDynamicRootStepsResponse, GetHealthCheckGroupData, GetHealthCheckGroupResponse, GetHealthCheckGroupByNameData, GetHealthCheckGroupByNameResponse, PostHealthCheckGroupByNameCheckData, PostHealthCheckGroupByNameCheckResponse, PostHealthCheckExecuteActionData, PostHealthCheckExecuteActionResponse, GetHelpData, GetHelpResponse, GetImagingResizeUrlsData, GetImagingResizeUrlsResponse, GetImportAnalyzeData, GetImportAnalyzeResponse, GetIndexerData, GetIndexerResponse, GetIndexerByIndexNameData, GetIndexerByIndexNameResponse, PostIndexerByIndexNameRebuildData, PostIndexerByIndexNameRebuildResponse, GetInstallSettingsResponse, PostInstallSetupData, PostInstallSetupResponse, PostInstallValidateDatabaseData, PostInstallValidateDatabaseResponse, GetItemLanguageData, GetItemLanguageResponse, GetItemLanguageDefaultResponse, GetLanguageData, GetLanguageResponse, PostLanguageData, PostLanguageResponse, GetLanguageByIsoCodeData, GetLanguageByIsoCodeResponse, DeleteLanguageByIsoCodeData, DeleteLanguageByIsoCodeResponse, PutLanguageByIsoCodeData, PutLanguageByIsoCodeResponse, GetLogViewerLevelData, GetLogViewerLevelResponse, GetLogViewerLevelCountData, GetLogViewerLevelCountResponse, GetLogViewerLogData, GetLogViewerLogResponse, GetLogViewerMessageTemplateData, GetLogViewerMessageTemplateResponse, GetLogViewerSavedSearchData, GetLogViewerSavedSearchResponse, PostLogViewerSavedSearchData, PostLogViewerSavedSearchResponse, GetLogViewerSavedSearchByNameData, GetLogViewerSavedSearchByNameResponse, DeleteLogViewerSavedSearchByNameData, DeleteLogViewerSavedSearchByNameResponse, GetLogViewerValidateLogsSizeData, GetLogViewerValidateLogsSizeResponse, GetManifestManifestResponse, GetManifestManifestPrivateResponse, GetManifestManifestPublicResponse, GetCollectionMediaData, GetCollectionMediaResponse, GetItemMediaData, GetItemMediaResponse, GetItemMediaSearchData, GetItemMediaSearchResponse, PostMediaData, PostMediaResponse, GetMediaByIdData, GetMediaByIdResponse, DeleteMediaByIdData, DeleteMediaByIdResponse, PutMediaByIdData, PutMediaByIdResponse, GetMediaByIdAuditLogData, GetMediaByIdAuditLogResponse, PutMediaByIdMoveData, PutMediaByIdMoveResponse, PutMediaByIdMoveToRecycleBinData, PutMediaByIdMoveToRecycleBinResponse, GetMediaByIdReferencedByData, GetMediaByIdReferencedByResponse, GetMediaByIdReferencedDescendantsData, GetMediaByIdReferencedDescendantsResponse, PutMediaByIdValidateData, PutMediaByIdValidateResponse, GetMediaAreReferencedData, GetMediaAreReferencedResponse, GetMediaConfigurationResponse, PutMediaSortData, PutMediaSortResponse, GetMediaUrlsData, GetMediaUrlsResponse, PostMediaValidateData, PostMediaValidateResponse, DeleteRecycleBinMediaResponse, DeleteRecycleBinMediaByIdData, DeleteRecycleBinMediaByIdResponse, GetRecycleBinMediaByIdOriginalParentData, GetRecycleBinMediaByIdOriginalParentResponse, PutRecycleBinMediaByIdRestoreData, PutRecycleBinMediaByIdRestoreResponse, GetRecycleBinMediaChildrenData, GetRecycleBinMediaChildrenResponse, GetRecycleBinMediaRootData, GetRecycleBinMediaRootResponse, GetTreeMediaAncestorsData, GetTreeMediaAncestorsResponse, GetTreeMediaChildrenData, GetTreeMediaChildrenResponse, GetTreeMediaRootData, GetTreeMediaRootResponse, GetItemMediaTypeData, GetItemMediaTypeResponse, GetItemMediaTypeAllowedData, GetItemMediaTypeAllowedResponse, GetItemMediaTypeFoldersData, GetItemMediaTypeFoldersResponse, GetItemMediaTypeSearchData, GetItemMediaTypeSearchResponse, PostMediaTypeData, PostMediaTypeResponse, GetMediaTypeByIdData, GetMediaTypeByIdResponse, DeleteMediaTypeByIdData, DeleteMediaTypeByIdResponse, PutMediaTypeByIdData, PutMediaTypeByIdResponse, GetMediaTypeByIdAllowedChildrenData, GetMediaTypeByIdAllowedChildrenResponse, GetMediaTypeByIdCompositionReferencesData, GetMediaTypeByIdCompositionReferencesResponse, PostMediaTypeByIdCopyData, PostMediaTypeByIdCopyResponse, GetMediaTypeByIdExportData, GetMediaTypeByIdExportResponse, PutMediaTypeByIdImportData, PutMediaTypeByIdImportResponse, PutMediaTypeByIdMoveData, PutMediaTypeByIdMoveResponse, GetMediaTypeAllowedAtRootData, GetMediaTypeAllowedAtRootResponse, PostMediaTypeAvailableCompositionsData, PostMediaTypeAvailableCompositionsResponse, GetMediaTypeConfigurationResponse, PostMediaTypeFolderData, PostMediaTypeFolderResponse, GetMediaTypeFolderByIdData, GetMediaTypeFolderByIdResponse, DeleteMediaTypeFolderByIdData, DeleteMediaTypeFolderByIdResponse, PutMediaTypeFolderByIdData, PutMediaTypeFolderByIdResponse, PostMediaTypeImportData, PostMediaTypeImportResponse, GetTreeMediaTypeAncestorsData, GetTreeMediaTypeAncestorsResponse, GetTreeMediaTypeChildrenData, GetTreeMediaTypeChildrenResponse, GetTreeMediaTypeRootData, GetTreeMediaTypeRootResponse, GetFilterMemberData, GetFilterMemberResponse, GetItemMemberData, GetItemMemberResponse, GetItemMemberSearchData, GetItemMemberSearchResponse, PostMemberData, PostMemberResponse, GetMemberByIdData, GetMemberByIdResponse, DeleteMemberByIdData, DeleteMemberByIdResponse, PutMemberByIdData, PutMemberByIdResponse, PutMemberByIdValidateData, PutMemberByIdValidateResponse, GetMemberConfigurationResponse, PostMemberValidateData, PostMemberValidateResponse, GetItemMemberGroupData, GetItemMemberGroupResponse, GetMemberGroupData, GetMemberGroupResponse, PostMemberGroupData, PostMemberGroupResponse, GetMemberGroupByIdData, GetMemberGroupByIdResponse, DeleteMemberGroupByIdData, DeleteMemberGroupByIdResponse, PutMemberGroupByIdData, PutMemberGroupByIdResponse, GetTreeMemberGroupRootData, GetTreeMemberGroupRootResponse, GetItemMemberTypeData, GetItemMemberTypeResponse, GetItemMemberTypeSearchData, GetItemMemberTypeSearchResponse, PostMemberTypeData, PostMemberTypeResponse, GetMemberTypeByIdData, GetMemberTypeByIdResponse, DeleteMemberTypeByIdData, DeleteMemberTypeByIdResponse, PutMemberTypeByIdData, PutMemberTypeByIdResponse, GetMemberTypeByIdCompositionReferencesData, GetMemberTypeByIdCompositionReferencesResponse, PostMemberTypeByIdCopyData, PostMemberTypeByIdCopyResponse, PostMemberTypeAvailableCompositionsData, PostMemberTypeAvailableCompositionsResponse, GetMemberTypeConfigurationResponse, GetTreeMemberTypeRootData, GetTreeMemberTypeRootResponse, PostModelsBuilderBuildResponse, GetModelsBuilderDashboardResponse, GetModelsBuilderStatusResponse, GetObjectTypesData, GetObjectTypesResponse, GetOembedQueryData, GetOembedQueryResponse, PostPackageByNameRunMigrationData, PostPackageByNameRunMigrationResponse, GetPackageConfigurationResponse, GetPackageCreatedData, GetPackageCreatedResponse, PostPackageCreatedData, PostPackageCreatedResponse, GetPackageCreatedByIdData, GetPackageCreatedByIdResponse, DeletePackageCreatedByIdData, DeletePackageCreatedByIdResponse, PutPackageCreatedByIdData, PutPackageCreatedByIdResponse, GetPackageCreatedByIdDownloadData, GetPackageCreatedByIdDownloadResponse, GetPackageMigrationStatusData, GetPackageMigrationStatusResponse, GetItemPartialViewData, GetItemPartialViewResponse, PostPartialViewData, PostPartialViewResponse, GetPartialViewByPathData, GetPartialViewByPathResponse, DeletePartialViewByPathData, DeletePartialViewByPathResponse, PutPartialViewByPathData, PutPartialViewByPathResponse, PutPartialViewByPathRenameData, PutPartialViewByPathRenameResponse, PostPartialViewFolderData, PostPartialViewFolderResponse, GetPartialViewFolderByPathData, GetPartialViewFolderByPathResponse, DeletePartialViewFolderByPathData, DeletePartialViewFolderByPathResponse, GetPartialViewSnippetData, GetPartialViewSnippetResponse, GetPartialViewSnippetByIdData, GetPartialViewSnippetByIdResponse, GetTreePartialViewAncestorsData, GetTreePartialViewAncestorsResponse, GetTreePartialViewChildrenData, GetTreePartialViewChildrenResponse, GetTreePartialViewRootData, GetTreePartialViewRootResponse, DeletePreviewResponse, PostPreviewResponse, GetProfilingStatusResponse, PutProfilingStatusData, PutProfilingStatusResponse, GetPropertyTypeIsUsedData, GetPropertyTypeIsUsedResponse, PostPublishedCacheRebuildResponse, GetPublishedCacheRebuildStatusResponse, PostPublishedCacheReloadResponse, GetRedirectManagementData, GetRedirectManagementResponse, GetRedirectManagementByIdData, GetRedirectManagementByIdResponse, DeleteRedirectManagementByIdData, DeleteRedirectManagementByIdResponse, GetRedirectManagementStatusResponse, PostRedirectManagementStatusData, PostRedirectManagementStatusResponse, GetRelationByRelationTypeIdData, GetRelationByRelationTypeIdResponse, GetItemRelationTypeData, GetItemRelationTypeResponse, GetRelationTypeData, GetRelationTypeResponse, GetRelationTypeByIdData, GetRelationTypeByIdResponse, GetItemScriptData, GetItemScriptResponse, PostScriptData, PostScriptResponse, GetScriptByPathData, GetScriptByPathResponse, DeleteScriptByPathData, DeleteScriptByPathResponse, PutScriptByPathData, PutScriptByPathResponse, PutScriptByPathRenameData, PutScriptByPathRenameResponse, PostScriptFolderData, PostScriptFolderResponse, GetScriptFolderByPathData, GetScriptFolderByPathResponse, DeleteScriptFolderByPathData, DeleteScriptFolderByPathResponse, GetTreeScriptAncestorsData, GetTreeScriptAncestorsResponse, GetTreeScriptChildrenData, GetTreeScriptChildrenResponse, GetTreeScriptRootData, GetTreeScriptRootResponse, GetSearcherData, GetSearcherResponse, GetSearcherBySearcherNameQueryData, GetSearcherBySearcherNameQueryResponse, GetSecurityConfigurationResponse, PostSecurityForgotPasswordData, PostSecurityForgotPasswordResponse, PostSecurityForgotPasswordResetData, PostSecurityForgotPasswordResetResponse, PostSecurityForgotPasswordVerifyData, PostSecurityForgotPasswordVerifyResponse, GetSegmentData, GetSegmentResponse, GetServerConfigurationResponse, GetServerInformationResponse, GetServerStatusResponse, GetServerTroubleshootingResponse, GetServerUpgradeCheckResponse, GetItemStaticFileData, GetItemStaticFileResponse, GetTreeStaticFileAncestorsData, GetTreeStaticFileAncestorsResponse, GetTreeStaticFileChildrenData, GetTreeStaticFileChildrenResponse, GetTreeStaticFileRootData, GetTreeStaticFileRootResponse, GetItemStylesheetData, GetItemStylesheetResponse, PostStylesheetData, PostStylesheetResponse, GetStylesheetByPathData, GetStylesheetByPathResponse, DeleteStylesheetByPathData, DeleteStylesheetByPathResponse, PutStylesheetByPathData, PutStylesheetByPathResponse, PutStylesheetByPathRenameData, PutStylesheetByPathRenameResponse, PostStylesheetFolderData, PostStylesheetFolderResponse, GetStylesheetFolderByPathData, GetStylesheetFolderByPathResponse, DeleteStylesheetFolderByPathData, DeleteStylesheetFolderByPathResponse, GetTreeStylesheetAncestorsData, GetTreeStylesheetAncestorsResponse, GetTreeStylesheetChildrenData, GetTreeStylesheetChildrenResponse, GetTreeStylesheetRootData, GetTreeStylesheetRootResponse, GetTagData, GetTagResponse, GetTelemetryData, GetTelemetryResponse, GetTelemetryLevelResponse, PostTelemetryLevelData, PostTelemetryLevelResponse, GetItemTemplateData, GetItemTemplateResponse, GetItemTemplateSearchData, GetItemTemplateSearchResponse, PostTemplateData, PostTemplateResponse, GetTemplateByIdData, GetTemplateByIdResponse, DeleteTemplateByIdData, DeleteTemplateByIdResponse, PutTemplateByIdData, PutTemplateByIdResponse, GetTemplateConfigurationResponse, PostTemplateQueryExecuteData, PostTemplateQueryExecuteResponse, GetTemplateQuerySettingsResponse, GetTreeTemplateAncestorsData, GetTreeTemplateAncestorsResponse, GetTreeTemplateChildrenData, GetTreeTemplateChildrenResponse, GetTreeTemplateRootData, GetTreeTemplateRootResponse, PostTemporaryFileData, PostTemporaryFileResponse, GetTemporaryFileByIdData, GetTemporaryFileByIdResponse, DeleteTemporaryFileByIdData, DeleteTemporaryFileByIdResponse, GetTemporaryFileConfigurationResponse, PostUpgradeAuthorizeResponse, GetUpgradeSettingsResponse, GetFilterUserData, GetFilterUserResponse, GetItemUserData, GetItemUserResponse, PostUserData, PostUserResponse, DeleteUserData, DeleteUserResponse, GetUserData, GetUserResponse, GetUserByIdData, GetUserByIdResponse, DeleteUserByIdData, DeleteUserByIdResponse, PutUserByIdData, PutUserByIdResponse, GetUserById2FaData, GetUserById2FaResponse, DeleteUserById2FaByProviderNameData, DeleteUserById2FaByProviderNameResponse, GetUserByIdCalculateStartNodesData, GetUserByIdCalculateStartNodesResponse, PostUserByIdChangePasswordData, PostUserByIdChangePasswordResponse, PostUserByIdClientCredentialsData, PostUserByIdClientCredentialsResponse, GetUserByIdClientCredentialsData, GetUserByIdClientCredentialsResponse, DeleteUserByIdClientCredentialsByClientIdData, DeleteUserByIdClientCredentialsByClientIdResponse, PostUserByIdResetPasswordData, PostUserByIdResetPasswordResponse, DeleteUserAvatarByIdData, DeleteUserAvatarByIdResponse, PostUserAvatarByIdData, PostUserAvatarByIdResponse, GetUserConfigurationResponse, GetUserCurrentResponse, GetUserCurrent2FaResponse, DeleteUserCurrent2FaByProviderNameData, DeleteUserCurrent2FaByProviderNameResponse, PostUserCurrent2FaByProviderNameData, PostUserCurrent2FaByProviderNameResponse, GetUserCurrent2FaByProviderNameData, GetUserCurrent2FaByProviderNameResponse, PostUserCurrentAvatarData, PostUserCurrentAvatarResponse, PostUserCurrentChangePasswordData, PostUserCurrentChangePasswordResponse, GetUserCurrentConfigurationResponse, GetUserCurrentLoginProvidersResponse, GetUserCurrentPermissionsData, GetUserCurrentPermissionsResponse, GetUserCurrentPermissionsDocumentData, GetUserCurrentPermissionsDocumentResponse, GetUserCurrentPermissionsMediaData, GetUserCurrentPermissionsMediaResponse, PostUserDisableData, PostUserDisableResponse, PostUserEnableData, PostUserEnableResponse, PostUserInviteData, PostUserInviteResponse, PostUserInviteCreatePasswordData, PostUserInviteCreatePasswordResponse, PostUserInviteResendData, PostUserInviteResendResponse, PostUserInviteVerifyData, PostUserInviteVerifyResponse, PostUserSetUserGroupsData, PostUserSetUserGroupsResponse, PostUserUnlockData, PostUserUnlockResponse, PostUserDataData, PostUserDataResponse, GetUserDataData, GetUserDataResponse, PutUserDataData, PutUserDataResponse, GetUserDataByIdData, GetUserDataByIdResponse, GetFilterUserGroupData, GetFilterUserGroupResponse, GetItemUserGroupData, GetItemUserGroupResponse, DeleteUserGroupData, DeleteUserGroupResponse, PostUserGroupData, PostUserGroupResponse, GetUserGroupData, GetUserGroupResponse, GetUserGroupByIdData, GetUserGroupByIdResponse, DeleteUserGroupByIdData, DeleteUserGroupByIdResponse, PutUserGroupByIdData, PutUserGroupByIdResponse, DeleteUserGroupByIdUsersData, DeleteUserGroupByIdUsersResponse, PostUserGroupByIdUsersData, PostUserGroupByIdUsersResponse, GetItemWebhookData, GetItemWebhookResponse, GetWebhookData, GetWebhookResponse, PostWebhookData, PostWebhookResponse, GetWebhookByIdData, GetWebhookByIdResponse, DeleteWebhookByIdData, DeleteWebhookByIdResponse, PutWebhookByIdData, PutWebhookByIdResponse, GetWebhookByIdLogsData, GetWebhookByIdLogsResponse, GetWebhookEventsData, GetWebhookEventsResponse, GetWebhookLogsData, GetWebhookLogsResponse } from './types.gen'; export class CultureService { /** @@ -1313,33 +1313,6 @@ export class DocumentService { }); } - /** - * @deprecated - * @param data The data for the request. - * @param data.id - * @param data.requestBody - * @returns string OK - * @throws ApiError - */ - public static putDocumentByIdValidate(data: PutDocumentByIdValidateData): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/umbraco/management/api/v1/document/{id}/validate', - path: { - id: data.id - }, - body: data.requestBody, - mediaType: 'application/json', - responseHeader: 'Umb-Notifications', - errors: { - 400: 'Bad Request', - 401: 'The resource is protected and requires an authentication token', - 403: 'The authenticated user does not have access to this resource', - 404: 'Not Found' - } - }); - } - /** * @param data The data for the request. * @param data.id @@ -3795,6 +3768,7 @@ export class MediaService { } /** + * @deprecated * @returns unknown OK * @throws ApiError */ @@ -5989,21 +5963,6 @@ export class PropertyTypeService { } export class PublishedCacheService { - /** - * @deprecated - * @throws ApiError - */ - public static postPublishedCacheCollect(): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/umbraco/management/api/v1/published-cache/collect', - errors: { - 401: 'The resource is protected and requires an authentication token', - 501: 'Not Implemented' - } - }); - } - /** * @returns string OK * @throws ApiError @@ -6048,21 +6007,6 @@ export class PublishedCacheService { }); } - /** - * @deprecated - * @throws ApiError - */ - public static getPublishedCacheStatus(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/umbraco/management/api/v1/published-cache/status', - errors: { - 401: 'The resource is protected and requires an authentication token', - 501: 'Not Implemented' - } - }); - } - } export class RedirectManagementService { diff --git a/src/Umbraco.Web.UI.Client/src/external/backend-api/src/types.gen.ts b/src/Umbraco.Web.UI.Client/src/external/backend-api/src/types.gen.ts index 5e831e2da3..be037a53dc 100644 --- a/src/Umbraco.Web.UI.Client/src/external/backend-api/src/types.gen.ts +++ b/src/Umbraco.Web.UI.Client/src/external/backend-api/src/types.gen.ts @@ -444,6 +444,13 @@ export type CultureReponseModel = { englishName: string; }; +export type CurrentUserConfigurationResponseModel = { + keepUserLoggedIn: boolean; + passwordConfiguration: (PasswordConfigurationResponseModel); + allowChangePassword: boolean; + allowTwoFactor: boolean; +}; + export type CurrentUserResponseModel = { email: string; userName: string; @@ -465,17 +472,6 @@ export type CurrentUserResponseModel = { isAdmin: boolean; }; -export type CurrenUserConfigurationResponseModel = { - keepUserLoggedIn: boolean; - /** - * @deprecated - */ - usernameIsEmail: boolean; - passwordConfiguration: (PasswordConfigurationResponseModel); - allowChangePassword: boolean; - allowTwoFactor: boolean; -}; - export type DatabaseInstallRequestModel = { id: string; providerName: string; @@ -651,10 +647,6 @@ export type DocumentConfigurationResponseModel = { disableUnpublishWhenReferenced: boolean; allowEditInvariantFromNonDefault: boolean; allowNonExistingSegmentsCreation: boolean; - /** - * @deprecated - */ - reservedFieldNames: Array<(string)>; }; export type DocumentItemResponseModel = { @@ -1192,10 +1184,6 @@ export type MediaCollectionResponseModel = { export type MediaConfigurationResponseModel = { disableDeleteWhenReferenced: boolean; disableUnpublishWhenReferenced: boolean; - /** - * @deprecated - */ - reservedFieldNames: Array<(string)>; }; export type MediaItemResponseModel = { @@ -1378,10 +1366,7 @@ export type MediaVariantResponseModel = { }; export type MemberConfigurationResponseModel = { - /** - * @deprecated - */ - reservedFieldNames: Array<(string)>; + [key: string]: unknown; }; export type MemberGroupItemResponseModel = { @@ -3303,13 +3288,6 @@ export type PutDocumentByIdUnpublishData = { export type PutDocumentByIdUnpublishResponse = (string); -export type PutDocumentByIdValidateData = { - id: string; - requestBody?: (UpdateDocumentRequestModel); -}; - -export type PutDocumentByIdValidateResponse = (string); - export type PutUmbracoManagementApiV11DocumentByIdValidate11Data = { id: string; requestBody?: (ValidateUpdateDocumentRequestModel); @@ -5195,7 +5173,7 @@ export type PostUserCurrentChangePasswordData = { export type PostUserCurrentChangePasswordResponse = (string); -export type GetUserCurrentConfigurationResponse = ((CurrenUserConfigurationResponseModel)); +export type GetUserCurrentConfigurationResponse = ((CurrentUserConfigurationResponseModel)); export type GetUserCurrentLoginProvidersResponse = (Array<(UserExternalLoginProviderModel)>); diff --git a/src/Umbraco.Web.UI.Client/src/mocks/data/document/document.db.ts b/src/Umbraco.Web.UI.Client/src/mocks/data/document/document.db.ts index 214ed14921..4e91ff2f96 100644 --- a/src/Umbraco.Web.UI.Client/src/mocks/data/document/document.db.ts +++ b/src/Umbraco.Web.UI.Client/src/mocks/data/document/document.db.ts @@ -48,7 +48,6 @@ export class UmbDocumentMockDB extends UmbEntityMockDbBase allowNonExistingSegmentsCreation: true, disableDeleteWhenReferenced: true, disableUnpublishWhenReferenced: true, - reservedFieldNames: [], }; } } diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/types.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/types.ts index 736e5d2983..8ac522013c 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/types.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/types.ts @@ -2,7 +2,7 @@ import type { UmbUserEntityType } from './entity.js'; import type { UmbUserKindType } from './utils/index.js'; import type { UmbReferenceByUnique } from '@umbraco-cms/backoffice/models'; import { - type CurrenUserConfigurationResponseModel, + type CurrentUserConfigurationResponseModel, type UserConfigurationResponseModel, UserStateModel, type UserTwoFactorProviderModel, @@ -44,4 +44,4 @@ export type UmbUserMfaProviderModel = UserTwoFactorProviderModel; export type UmbUserConfigurationModel = UserConfigurationResponseModel; -export type UmbCurrentUserConfigurationModel = CurrenUserConfigurationResponseModel; +export type UmbCurrentUserConfigurationModel = CurrentUserConfigurationResponseModel; diff --git a/src/Umbraco.Web.Website/Controllers/UmbProfileController.cs b/src/Umbraco.Web.Website/Controllers/UmbProfileController.cs index d493bb7e02..a1fc4365b0 100644 --- a/src/Umbraco.Web.Website/Controllers/UmbProfileController.cs +++ b/src/Umbraco.Web.Website/Controllers/UmbProfileController.cs @@ -118,7 +118,7 @@ public class UmbProfileController : SurfaceController // now we can update the custom properties // TODO: Ideally we could do this all through our MemberIdentityUser - IMember? member = _memberService.GetByKey(currentMember.Key); + IMember? member = _memberService.GetById(currentMember.Key); if (member == null) { // should never happen diff --git a/src/Umbraco.Web.Website/Controllers/UmbRegisterController.cs b/src/Umbraco.Web.Website/Controllers/UmbRegisterController.cs index 3fb2a966c4..fc203ae6e6 100644 --- a/src/Umbraco.Web.Website/Controllers/UmbRegisterController.cs +++ b/src/Umbraco.Web.Website/Controllers/UmbRegisterController.cs @@ -139,7 +139,7 @@ public class UmbRegisterController : SurfaceController { // Update the custom properties // TODO: See TODO in MembersIdentityUser, Should we support custom member properties for persistence/retrieval? - IMember? member = _memberService.GetByKey(identityUser.Key); + IMember? member = _memberService.GetById(identityUser.Key); if (member == null) { // should never happen diff --git a/src/Umbraco.Web.Website/Extensions/LinkGeneratorExtensions.cs b/src/Umbraco.Web.Website/Extensions/LinkGeneratorExtensions.cs index f046261a79..14811b85da 100644 --- a/src/Umbraco.Web.Website/Extensions/LinkGeneratorExtensions.cs +++ b/src/Umbraco.Web.Website/Extensions/LinkGeneratorExtensions.cs @@ -2,12 +2,44 @@ using System.Linq.Expressions; using System.Reflection; using Microsoft.AspNetCore.Routing; using Umbraco.Cms.Core; +using Umbraco.Cms.Web.Common.Controllers; using Umbraco.Cms.Web.Website.Controllers; namespace Umbraco.Extensions; public static class LinkGeneratorExtensions { + /// + /// Return the Url for a Web Api service + /// + /// The + [Obsolete("This will be removed in Umbraco 15.")] + public static string? GetUmbracoApiService(this LinkGenerator linkGenerator, string actionName, object? id = null) + where T : UmbracoApiControllerBase => linkGenerator.GetUmbracoControllerUrl( + actionName, + typeof(T), + new Dictionary { ["id"] = id }); + + [Obsolete("This will be removed in Umbraco 15.")] + public static string? GetUmbracoApiService(this LinkGenerator linkGenerator, string actionName, IDictionary? values) + where T : UmbracoApiControllerBase => linkGenerator.GetUmbracoControllerUrl(actionName, typeof(T), values); + + [Obsolete("This will be removed in Umbraco 15.")] + public static string? GetUmbracoApiServiceBaseUrl( + this LinkGenerator linkGenerator, + Expression> methodSelector) + where T : UmbracoApiControllerBase + { + MethodInfo? method = ExpressionHelper.GetMethodInfo(methodSelector); + if (method == null) + { + throw new MissingMethodException("Could not find the method " + methodSelector + " on type " + typeof(T) + + " or the result "); + } + + return linkGenerator.GetUmbracoApiService(method.Name)?.TrimEnd(method.Name); + } + /// /// Return the Url for a Surface Controller /// @@ -43,4 +75,26 @@ public static class LinkGeneratorExtensions actionName, typeof(T), new Dictionary { ["id"] = id }); + + [Obsolete("This will be removed in Umbraco 15.")] + public static string? GetUmbracoApiService( + this LinkGenerator linkGenerator, + Expression> methodSelector) + where T : UmbracoApiController + { + MethodInfo? method = ExpressionHelper.GetMethodInfo(methodSelector); + IDictionary? methodParams = ExpressionHelper.GetMethodParams(methodSelector); + if (method == null) + { + throw new MissingMethodException( + $"Could not find the method {methodSelector} on type {typeof(T)} or the result "); + } + + if (methodParams?.Any() == false) + { + return linkGenerator.GetUmbracoApiService(method.Name); + } + + return linkGenerator.GetUmbracoApiService(method.Name, methodParams); + } } diff --git a/src/Umbraco.Web.Website/Models/ProfileModelBuilder.cs b/src/Umbraco.Web.Website/Models/ProfileModelBuilder.cs index 70f034fc79..7ca67352c6 100644 --- a/src/Umbraco.Web.Website/Models/ProfileModelBuilder.cs +++ b/src/Umbraco.Web.Website/Models/ProfileModelBuilder.cs @@ -79,7 +79,7 @@ public class ProfileModelBuilder : MemberModelBuilderBase } // TODO: This wouldn't be required if we support exposing custom member properties on the MemberIdentityUser at the ASP.NET Identity level. - IMember? persistedMember = _memberService.GetByKey(member.Key); + IMember? persistedMember = _memberService.GetById(member.Key); if (persistedMember == null) { // should never happen diff --git a/tests/Umbraco.Tests.Integration/ManagementApi/Factories/UserGroupPresentationFactoryTests.cs b/tests/Umbraco.Tests.Integration/ManagementApi/Factories/UserGroupPresentationFactoryTests.cs index 8a27922276..c31b9eb3f3 100644 --- a/tests/Umbraco.Tests.Integration/ManagementApi/Factories/UserGroupPresentationFactoryTests.cs +++ b/tests/Umbraco.Tests.Integration/ManagementApi/Factories/UserGroupPresentationFactoryTests.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using NUnit.Framework; using Umbraco.Cms.Api.Management.Factories; using Umbraco.Cms.Api.Management.Mapping.Permissions; @@ -20,7 +20,7 @@ namespace Umbraco.Cms.Tests.Integration.ManagementApi.Factories; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class UserGroupPresentationFactoryTests : UmbracoIntegrationTest +internal sealed class UserGroupPresentationFactoryTests : UmbracoIntegrationTest { public IUserGroupPresentationFactory UserGroupPresentationFactory => GetRequiredService(); public IUserGroupService UserGroupService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/ManagementApi/Policies/AllCultureControllerTests.cs b/tests/Umbraco.Tests.Integration/ManagementApi/Policies/AllCultureControllerTests.cs index e041b425bb..ccbb18db0f 100644 --- a/tests/Umbraco.Tests.Integration/ManagementApi/Policies/AllCultureControllerTests.cs +++ b/tests/Umbraco.Tests.Integration/ManagementApi/Policies/AllCultureControllerTests.cs @@ -9,13 +9,13 @@ namespace Umbraco.Cms.Tests.Integration.ManagementApi.Policies; /// /// [TestFixture] -public class AllCultureControllerTests : ManagementApiTest +internal sealed class AllCultureControllerTests : ManagementApiTest { protected override Expression> MethodSelector => x => x.GetAll(CancellationToken.None, 0, 100); [Test] - public virtual async Task As_Admin_I_Have_Access() + public async Task As_Admin_I_Have_Access() { await AuthenticateClientAsync(Client, "admin@umbraco.com", "1234567890", true); @@ -25,7 +25,7 @@ public class AllCultureControllerTests : ManagementApiTest } [Test] - public virtual async Task As_Editor_I_Have_Access() + public async Task As_Editor_I_Have_Access() { await AuthenticateClientAsync(Client, "editor@umbraco.com", "1234567890", false); @@ -35,7 +35,7 @@ public class AllCultureControllerTests : ManagementApiTest } [Test] - public virtual async Task Unauthourized_when_no_token_is_provided() + public async Task Unauthourized_when_no_token_is_provided() { var response = await Client.GetAsync(Url); diff --git a/tests/Umbraco.Tests.Integration/ManagementApi/Policies/CreateDocumentTests.cs b/tests/Umbraco.Tests.Integration/ManagementApi/Policies/CreateDocumentTests.cs index bf59619f65..1202ad8054 100644 --- a/tests/Umbraco.Tests.Integration/ManagementApi/Policies/CreateDocumentTests.cs +++ b/tests/Umbraco.Tests.Integration/ManagementApi/Policies/CreateDocumentTests.cs @@ -18,7 +18,7 @@ using Umbraco.Cms.Tests.Common.TestHelpers; namespace Umbraco.Cms.Tests.Integration.ManagementApi.Policies; [TestFixture] -public class CreateDocumentTests : ManagementApiTest +internal sealed class CreateDocumentTests : ManagementApiTest { private IUserGroupService UserGroupService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/ManagementApi/Policies/UpdateDocumentTests.cs b/tests/Umbraco.Tests.Integration/ManagementApi/Policies/UpdateDocumentTests.cs index b7d15f2fd2..b49d00cac4 100644 --- a/tests/Umbraco.Tests.Integration/ManagementApi/Policies/UpdateDocumentTests.cs +++ b/tests/Umbraco.Tests.Integration/ManagementApi/Policies/UpdateDocumentTests.cs @@ -8,7 +8,6 @@ using Umbraco.Cms.Core; using Umbraco.Cms.Core.Actions; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentEditing; -using Umbraco.Cms.Core.Models.ContentPublishing; using Umbraco.Cms.Core.Models.Membership; using Umbraco.Cms.Core.Serialization; using Umbraco.Cms.Core.Services; @@ -19,7 +18,7 @@ using Umbraco.Cms.Tests.Common.TestHelpers; namespace Umbraco.Cms.Tests.Integration.ManagementApi.Policies; -public class UpdateDocumentTests : ManagementApiTest +internal sealed class UpdateDocumentTests : ManagementApiTest { private IUserGroupService UserGroupService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/ManagementApi/Preview/EndPreviewTests.cs b/tests/Umbraco.Tests.Integration/ManagementApi/Preview/EndPreviewTests.cs index 88443584cc..ad37b208a6 100644 --- a/tests/Umbraco.Tests.Integration/ManagementApi/Preview/EndPreviewTests.cs +++ b/tests/Umbraco.Tests.Integration/ManagementApi/Preview/EndPreviewTests.cs @@ -1,4 +1,4 @@ -using System.Linq.Expressions; +using System.Linq.Expressions; using System.Net; using NUnit.Framework; using Umbraco.Cms.Api.Management.Controllers.Preview; @@ -6,14 +6,14 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.ManagementApi.Preview; -public class EndPreviewTests : ManagementApiTest +internal sealed class EndPreviewTests : ManagementApiTest { protected override Expression> MethodSelector => x => x.End(CancellationToken.None); [Test] - public virtual async Task As_Anonymous_I_Can_End_Preview_Mode() + public async Task As_Anonymous_I_Can_End_Preview_Mode() { var response = await Client.DeleteAsync(Url); diff --git a/tests/Umbraco.Tests.Integration/ManagementApi/Preview/EnterPreviewTests.cs b/tests/Umbraco.Tests.Integration/ManagementApi/Preview/EnterPreviewTests.cs index 37c7bcb5dc..c95474689c 100644 --- a/tests/Umbraco.Tests.Integration/ManagementApi/Preview/EnterPreviewTests.cs +++ b/tests/Umbraco.Tests.Integration/ManagementApi/Preview/EnterPreviewTests.cs @@ -1,4 +1,4 @@ -using System.Linq.Expressions; +using System.Linq.Expressions; using System.Net; using NUnit.Framework; using Umbraco.Cms.Api.Management.Controllers.Preview; @@ -6,14 +6,14 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.ManagementApi.Preview; -public class EnterPreviewTests : ManagementApiTest +internal sealed class EnterPreviewTests : ManagementApiTest { protected override Expression> MethodSelector => x => x.Enter(CancellationToken.None); [Test] - public virtual async Task As_Editor_I_Can_Enter_Preview_Mode() + public async Task As_Editor_I_Can_Enter_Preview_Mode() { await AuthenticateClientAsync(Client, "admin@umbraco.com", "1234567890", false); diff --git a/tests/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs b/tests/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs index 494d51ee58..134e06ef64 100644 --- a/tests/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs +++ b/tests/Umbraco.Tests.Integration/TestServerTest/UmbracoTestServerTestBase.cs @@ -13,7 +13,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Moq; using NUnit.Framework; -using Umbraco.Cms.Api.Common.Attributes; using Umbraco.Cms.Api.Delivery.Controllers.Content; using Umbraco.Cms.Api.Management.Controllers; using Umbraco.Cms.Api.Management.Controllers.ModelsBuilder; @@ -31,6 +30,7 @@ using Umbraco.Cms.Tests.Integration.DependencyInjection; using Umbraco.Cms.Tests.Integration.Testing; using Umbraco.Cms.Web.Common.Controllers; using Umbraco.Cms.Web.Website.Controllers; +using Umbraco.Extensions; namespace Umbraco.Cms.Tests.Integration.TestServerTest { @@ -237,11 +237,8 @@ namespace Umbraco.Cms.Tests.Integration.TestServerTest { services.AddTransient(); - Core.Hosting.IHostingEnvironment hostingEnvironment = TestHelper.GetHostingEnvironment(); - TypeLoader typeLoader = services.AddTypeLoader( GetType().Assembly, - hostingEnvironment, TestHelper.ConsoleLoggerFactory, AppCaches.NoCache, Configuration, @@ -249,7 +246,7 @@ namespace Umbraco.Cms.Tests.Integration.TestServerTest services.AddLogger(TestHelper.GetWebHostEnvironment(), Configuration); - var builder = new UmbracoBuilder(services, Configuration, typeLoader, TestHelper.ConsoleLoggerFactory, TestHelper.Profiler, AppCaches.NoCache, hostingEnvironment); + var builder = new UmbracoBuilder(services, Configuration, typeLoader, TestHelper.ConsoleLoggerFactory, TestHelper.Profiler, AppCaches.NoCache); builder.Services.AddTransient(sp => new TestDatabaseHostedLifecycleService(() => UseTestDatabase(sp))); builder @@ -281,7 +278,6 @@ namespace Umbraco.Cms.Tests.Integration.TestServerTest CustomMvcSetup(mvcBuilder); }) - .AddWebServer() .AddWebsite() .AddUmbracoSqlServerSupport() .AddUmbracoSqliteSupport() diff --git a/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs b/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs index 585f6b268c..7c70617fca 100644 --- a/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs +++ b/tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs @@ -151,12 +151,11 @@ public abstract class UmbracoIntegrationTest : UmbracoIntegrationTestBase var hostingEnvironment = TestHelper.GetHostingEnvironment(); var typeLoader = services.AddTypeLoader( GetType().Assembly, - hostingEnvironment, TestHelper.ConsoleLoggerFactory, AppCaches.NoCache, Configuration, TestHelper.Profiler); - var builder = new UmbracoBuilder(services, Configuration, typeLoader, TestHelper.ConsoleLoggerFactory, TestHelper.Profiler, AppCaches.NoCache, hostingEnvironment); + var builder = new UmbracoBuilder(services, Configuration, typeLoader, TestHelper.ConsoleLoggerFactory, TestHelper.Profiler, AppCaches.NoCache); builder.AddConfiguration() .AddUmbracoCore() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Cache/PublishedContentTypeCacheTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Cache/PublishedContentTypeCacheTests.cs index 71c450b54c..14b8ecf8d2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Cache/PublishedContentTypeCacheTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Cache/PublishedContentTypeCacheTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models.ContentTypeEditing; using Umbraco.Cms.Core.Models.PublishedContent; @@ -12,7 +12,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Cache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class PublishedContentTypeCacheTests : UmbracoIntegrationTestWithContentEditing +internal sealed class PublishedContentTypeCacheTests : UmbracoIntegrationTestWithContentEditing { protected override void CustomTestSetup(IUmbracoBuilder builder) => builder.AddUmbracoHybridCache(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/DeliveryApi/OpenApiContractTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/DeliveryApi/OpenApiContractTest.cs index c34c0f9d72..5626cbea20 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/DeliveryApi/OpenApiContractTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/DeliveryApi/OpenApiContractTest.cs @@ -8,7 +8,7 @@ using Umbraco.Cms.Tests.Integration.TestServerTest; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.DeliveryApi; [TestFixture] -public class OpenApiContractTest : UmbracoTestServerTestBase +internal sealed class OpenApiContractTest : UmbracoTestServerTestBase { private IHostingEnvironment HostingEnvironment => GetRequiredService(); @@ -46,245 +46,6 @@ public class OpenApiContractTest : UmbracoTestServerTestBase "version": "Latest" }, "paths": { - "/umbraco/delivery/api/v1/content": { - "get": { - "tags": [ - "Content" - ], - "operationId": "GetContent", - "parameters": [ - { - "name": "fetch", - "in": "query", - "description": "Specifies the content items to fetch. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "string" - }, - "examples": { - "Select all": { - "value": "" - }, - "Select all ancestors of a node by id": { - "value": "ancestors:id" - }, - "Select all ancestors of a node by path": { - "value": "ancestors:path" - }, - "Select all children of a node by id": { - "value": "children:id" - }, - "Select all children of a node by path": { - "value": "children:path" - }, - "Select all descendants of a node by id": { - "value": "descendants:id" - }, - "Select all descendants of a node by path": { - "value": "descendants:path" - } - } - }, - { - "name": "filter", - "in": "query", - "description": "Defines how to filter the fetched content items. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "examples": { - "Default filter": { - "value": "" - }, - "Filter by content type (equals)": { - "value": [ - "contentType:alias1" - ] - }, - "Filter by name (contains)": { - "value": [ - "name:nodeName" - ] - }, - "Filter by creation date (less than)": { - "value": [ - "createDate<2024-01-01" - ] - }, - "Filter by update date (greater than or equal)": { - "value": [ - "updateDate>:2023-01-01" - ] - } - } - }, - { - "name": "sort", - "in": "query", - "description": "Defines how to sort the found content items. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "examples": { - "Default sort": { - "value": "" - }, - "Sort by create date": { - "value": [ - "createDate:asc", - "createDate:desc" - ] - }, - "Sort by level": { - "value": [ - "level:asc", - "level:desc" - ] - }, - "Sort by name": { - "value": [ - "name:asc", - "name:desc" - ] - }, - "Sort by sort order": { - "value": [ - "sortOrder:asc", - "sortOrder:desc" - ] - }, - "Sort by update date": { - "value": [ - "updateDate:asc", - "updateDate:desc" - ] - } - } - }, - { - "name": "skip", - "in": "query", - "description": "Specifies the number of found content items to skip. Use this to control pagination of the response.", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "description": "Specifies the number of found content items to take. Use this to control pagination of the response.", - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { - "name": "expand", - "in": "query", - "description": "Defines the properties that should be expanded in the response. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "string" - }, - "examples": { - "Expand none": { - "value": "" - }, - "Expand all": { - "value": "all" - }, - "Expand specific property": { - "value": "property:alias1" - }, - "Expand specific properties": { - "value": "property:alias1,alias2" - } - } - }, - { - "name": "Accept-Language", - "in": "header", - "description": "Defines the language to return. Use this when querying language variant content items.", - "schema": { - "type": "string" - }, - "examples": { - "Default": { - "value": "" - }, - "English culture": { - "value": "en-us" - } - } - }, - { - "name": "Api-Key", - "in": "header", - "description": "API key specified through configuration to authorize access to the API.", - "schema": { - "type": "string" - } - }, - { - "name": "Preview", - "in": "header", - "description": "Whether to request draft content.", - "schema": { - "type": "boolean" - } - }, - { - "name": "Start-Item", - "in": "header", - "description": "URL segment or GUID of a root content item.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/PagedIApiContentResponseModel" - } - ] - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/ProblemDetails" - } - ] - } - } - } - }, - "404": { - "description": "Not Found" - } - }, - "deprecated": true - } - }, "/umbraco/delivery/api/v2/content": { "get": { "tags": [ @@ -548,223 +309,6 @@ public class OpenApiContractTest : UmbracoTestServerTestBase } } }, - "/umbraco/delivery/api/v1/content/item": { - "get": { - "tags": [ - "Content" - ], - "operationId": "GetContentItem", - "parameters": [ - { - "name": "id", - "in": "query", - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - { - "name": "expand", - "in": "query", - "description": "Defines the properties that should be expanded in the response. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "string" - }, - "examples": { - "Expand none": { - "value": "" - }, - "Expand all": { - "value": "all" - }, - "Expand specific property": { - "value": "property:alias1" - }, - "Expand specific properties": { - "value": "property:alias1,alias2" - } - } - }, - { - "name": "Accept-Language", - "in": "header", - "description": "Defines the language to return. Use this when querying language variant content items.", - "schema": { - "type": "string" - }, - "examples": { - "Default": { - "value": "" - }, - "English culture": { - "value": "en-us" - } - } - }, - { - "name": "Api-Key", - "in": "header", - "description": "API key specified through configuration to authorize access to the API.", - "schema": { - "type": "string" - } - }, - { - "name": "Preview", - "in": "header", - "description": "Whether to request draft content.", - "schema": { - "type": "boolean" - } - }, - { - "name": "Start-Item", - "in": "header", - "description": "URL segment or GUID of a root content item.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ApiContentResponseModel" - } - ] - } - } - } - } - }, - "401": { - "description": "Unauthorized" - }, - "403": { - "description": "Forbidden" - } - }, - "deprecated": true - } - }, - "/umbraco/delivery/api/v1/content/item/{path}": { - "get": { - "tags": [ - "Content" - ], - "operationId": "GetContentItemByPath", - "parameters": [ - { - "name": "path", - "in": "path", - "required": true, - "schema": { - "type": "string", - "default": "" - } - }, - { - "name": "expand", - "in": "query", - "description": "Defines the properties that should be expanded in the response. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "string" - }, - "examples": { - "Expand none": { - "value": "" - }, - "Expand all": { - "value": "all" - }, - "Expand specific property": { - "value": "property:alias1" - }, - "Expand specific properties": { - "value": "property:alias1,alias2" - } - } - }, - { - "name": "Accept-Language", - "in": "header", - "description": "Defines the language to return. Use this when querying language variant content items.", - "schema": { - "type": "string" - }, - "examples": { - "Default": { - "value": "" - }, - "English culture": { - "value": "en-us" - } - } - }, - { - "name": "Api-Key", - "in": "header", - "description": "API key specified through configuration to authorize access to the API.", - "schema": { - "type": "string" - } - }, - { - "name": "Preview", - "in": "header", - "description": "Whether to request draft content.", - "schema": { - "type": "boolean" - } - }, - { - "name": "Start-Item", - "in": "header", - "description": "URL segment or GUID of a root content item.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/ApiContentResponseModel" - } - ] - } - } - } - }, - "401": { - "description": "Unauthorized" - }, - "403": { - "description": "Forbidden" - }, - "404": { - "description": "Not Found" - } - }, - "deprecated": true - } - }, "/umbraco/delivery/api/v2/content/item/{path}": { "get": { "tags": [ @@ -896,113 +440,6 @@ public class OpenApiContractTest : UmbracoTestServerTestBase } } }, - "/umbraco/delivery/api/v1/content/item/{id}": { - "get": { - "tags": [ - "Content" - ], - "operationId": "GetContentItemById", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "expand", - "in": "query", - "description": "Defines the properties that should be expanded in the response. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "string" - }, - "examples": { - "Expand none": { - "value": "" - }, - "Expand all": { - "value": "all" - }, - "Expand specific property": { - "value": "property:alias1" - }, - "Expand specific properties": { - "value": "property:alias1,alias2" - } - } - }, - { - "name": "Accept-Language", - "in": "header", - "description": "Defines the language to return. Use this when querying language variant content items.", - "schema": { - "type": "string" - }, - "examples": { - "Default": { - "value": "" - }, - "English culture": { - "value": "en-us" - } - } - }, - { - "name": "Api-Key", - "in": "header", - "description": "API key specified through configuration to authorize access to the API.", - "schema": { - "type": "string" - } - }, - { - "name": "Preview", - "in": "header", - "description": "Whether to request draft content.", - "schema": { - "type": "boolean" - } - }, - { - "name": "Start-Item", - "in": "header", - "description": "URL segment or GUID of a root content item.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/ApiContentResponseModel" - } - ] - } - } - } - }, - "401": { - "description": "Unauthorized" - }, - "403": { - "description": "Forbidden" - }, - "404": { - "description": "Not Found" - } - }, - "deprecated": true - } - }, "/umbraco/delivery/api/v2/content/item/{id}": { "get": { "tags": [ @@ -1268,182 +705,6 @@ public class OpenApiContractTest : UmbracoTestServerTestBase } } }, - "/umbraco/delivery/api/v1/media": { - "get": { - "tags": [ - "Media" - ], - "operationId": "GetMedia", - "parameters": [ - { - "name": "fetch", - "in": "query", - "description": "Specifies the media items to fetch. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api/media-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "string" - }, - "examples": { - "Select all children at root level": { - "value": "children:/" - }, - "Select all children of a media item by id": { - "value": "children:id" - }, - "Select all children of a media item by path": { - "value": "children:path" - } - } - }, - { - "name": "filter", - "in": "query", - "description": "Defines how to filter the fetched media items. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api/media-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "examples": { - "Default filter": { - "value": "" - }, - "Filter by media type": { - "value": [ - "mediaType:alias1" - ] - }, - "Filter by name": { - "value": [ - "name:nodeName" - ] - } - } - }, - { - "name": "sort", - "in": "query", - "description": "Defines how to sort the found media items. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api/media-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "examples": { - "Default sort": { - "value": "" - }, - "Sort by create date": { - "value": [ - "createDate:asc", - "createDate:desc" - ] - }, - "Sort by name": { - "value": [ - "name:asc", - "name:desc" - ] - }, - "Sort by sort order": { - "value": [ - "sortOrder:asc", - "sortOrder:desc" - ] - }, - "Sort by update date": { - "value": [ - "updateDate:asc", - "updateDate:desc" - ] - } - } - }, - { - "name": "skip", - "in": "query", - "description": "Specifies the number of found media items to skip. Use this to control pagination of the response.", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - } - }, - { - "name": "take", - "in": "query", - "description": "Specifies the number of found media items to take. Use this to control pagination of the response.", - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - } - }, - { - "name": "expand", - "in": "query", - "description": "Defines the properties that should be expanded in the response. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api/media-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "string" - }, - "examples": { - "Expand none": { - "value": "" - }, - "Expand all": { - "value": "all" - }, - "Expand specific property": { - "value": "property:alias1" - }, - "Expand specific properties": { - "value": "property:alias1,alias2" - } - } - }, - { - "name": "Api-Key", - "in": "header", - "description": "API key specified through configuration to authorize access to the API.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/PagedIApiMediaWithCropsResponseModel" - } - ] - } - } - } - }, - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/ProblemDetails" - } - ] - } - } - } - } - }, - "deprecated": true - } - }, "/umbraco/delivery/api/v2/media": { "get": { "tags": [ @@ -1644,146 +905,6 @@ public class OpenApiContractTest : UmbracoTestServerTestBase } } }, - "/umbraco/delivery/api/v1/media/item": { - "get": { - "tags": [ - "Media" - ], - "operationId": "GetMediaItem", - "parameters": [ - { - "name": "id", - "in": "query", - "schema": { - "uniqueItems": true, - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - { - "name": "expand", - "in": "query", - "description": "Defines the properties that should be expanded in the response. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api/media-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "string" - }, - "examples": { - "Expand none": { - "value": "" - }, - "Expand all": { - "value": "all" - }, - "Expand specific property": { - "value": "property:alias1" - }, - "Expand specific properties": { - "value": "property:alias1,alias2" - } - } - }, - { - "name": "Api-Key", - "in": "header", - "description": "API key specified through configuration to authorize access to the API.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/ApiMediaWithCropsResponseModel" - } - ] - } - } - } - } - } - }, - "deprecated": true - } - }, - "/umbraco/delivery/api/v1/media/item/{path}": { - "get": { - "tags": [ - "Media" - ], - "operationId": "GetMediaItemByPath", - "parameters": [ - { - "name": "path", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "expand", - "in": "query", - "description": "Defines the properties that should be expanded in the response. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api/media-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "string" - }, - "examples": { - "Expand none": { - "value": "" - }, - "Expand all": { - "value": "all" - }, - "Expand specific property": { - "value": "property:alias1" - }, - "Expand specific properties": { - "value": "property:alias1,alias2" - } - } - }, - { - "name": "Api-Key", - "in": "header", - "description": "API key specified through configuration to authorize access to the API.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/ApiMediaWithCropsResponseModel" - } - ] - } - } - } - }, - "404": { - "description": "Not Found" - } - }, - "deprecated": true - } - }, "/umbraco/delivery/api/v2/media/item/{path}": { "get": { "tags": [ @@ -1876,75 +997,6 @@ public class OpenApiContractTest : UmbracoTestServerTestBase } } }, - "/umbraco/delivery/api/v1/media/item/{id}": { - "get": { - "tags": [ - "Media" - ], - "operationId": "GetMediaItemById", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "expand", - "in": "query", - "description": "Defines the properties that should be expanded in the response. Refer to [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api/media-delivery-api#query-parameters) for more details on this.", - "schema": { - "type": "string" - }, - "examples": { - "Expand none": { - "value": "" - }, - "Expand all": { - "value": "all" - }, - "Expand specific property": { - "value": "property:alias1" - }, - "Expand specific properties": { - "value": "property:alias1,alias2" - } - } - }, - { - "name": "Api-Key", - "in": "header", - "description": "API key specified through configuration to authorize access to the API.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/ApiMediaWithCropsResponseModel" - } - ] - } - } - } - }, - "404": { - "description": "Not Found" - } - }, - "deprecated": true - } - }, "/umbraco/delivery/api/v2/media/item/{id}": { "get": { "tags": [ diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs index 80809fb77c..5a81812777 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs @@ -11,7 +11,7 @@ using Umbraco.Cms.Tests.Integration.TestServerTest; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Events; [TestFixture] -public class EventAggregatorTests : UmbracoTestServerTestBase +internal sealed class EventAggregatorTests : UmbracoTestServerTestBase { protected override void ConfigureTestServices(IServiceCollection services) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/FileSystemsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/FileSystemsTests.cs index f34e4d1d04..498e6b1f61 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/FileSystemsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/FileSystemsTests.cs @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.IO; [TestFixture] [UmbracoTest] -public class FileSystemsTests : UmbracoIntegrationTest +internal sealed class FileSystemsTests : UmbracoIntegrationTest { [Test] public void Can_Get_MediaFileManager() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/ShadowFileSystemTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/ShadowFileSystemTests.cs index 73f83fe8fb..e994e88866 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/ShadowFileSystemTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/IO/ShadowFileSystemTests.cs @@ -19,7 +19,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.IO; [TestFixture] [UmbracoTest] -public class ShadowFileSystemTests : UmbracoIntegrationTest +internal sealed class ShadowFileSystemTests : UmbracoIntegrationTest { [SetUp] public void SetUp() => ClearFiles(HostingEnvironment); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs index 3031a6e6a1..25283be71c 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Packaging/CreatedPackagesRepositoryTests.cs @@ -26,7 +26,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Packaging; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)] -public class CreatedPackagesRepositoryTests : UmbracoIntegrationTest +internal sealed class CreatedPackagesRepositoryTests : UmbracoIntegrationTest { [SetUp] public void SetupTestData() => _testBaseFolder = Guid.NewGuid(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContent/PublishContentTypeFactoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContent/PublishContentTypeFactoryTest.cs index c8805492a9..025281e566 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContent/PublishContentTypeFactoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContent/PublishContentTypeFactoryTest.cs @@ -17,7 +17,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.PublishedContent; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class PublishContentTypeFactoryTest : UmbracoIntegrationTest +internal sealed class PublishContentTypeFactoryTest : UmbracoIntegrationTest { protected override void CustomTestSetup(IUmbracoBuilder builder) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContentQueryAccessorTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContentQueryAccessorTests.cs index aca58313df..82a6994445 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContentQueryAccessorTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/PublishedContentQueryAccessorTests.cs @@ -9,7 +9,7 @@ using Umbraco.Cms.Tests.Integration.TestServerTest; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core; [TestFixture] -public class PublishedContentQueryAccessorTests : UmbracoTestServerTestBase +internal sealed class PublishedContentQueryAccessorTests : UmbracoTestServerTestBase { [Test] [LongRunning] diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/RuntimeStateTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/RuntimeStateTests.cs index 09408824a3..9903c5a25e 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/RuntimeStateTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/RuntimeStateTests.cs @@ -19,7 +19,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class RuntimeStateTests : UmbracoIntegrationTest +internal sealed class RuntimeStateTests : UmbracoIntegrationTest { private IRuntimeState RuntimeState => Services.GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentEditingServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentEditingServiceTests.cs index c5651486bc..33c8190eb9 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentEditingServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentEditingServiceTests.cs @@ -16,7 +16,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true, WithApplication = true)] -public class ContentEditingServiceTests : UmbracoIntegrationTestWithContent +internal sealed class ContentEditingServiceTests : UmbracoIntegrationTestWithContent { [SetUp] public void Setup() => ContentRepositoryBase.ThrowOnWarning = true; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentPublishingServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentPublishingServiceTests.cs index 0853bca8c5..5bda41928b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentPublishingServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentPublishingServiceTests.cs @@ -19,7 +19,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true, WithApplication = true)] -public class ContentPublishingServiceTests : UmbracoIntegrationTestWithContent +internal sealed class ContentPublishingServiceTests : UmbracoIntegrationTestWithContent { private const string UnknownCulture = "ke-Ke"; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentServiceTests.cs index f75a1c8943..fa47ff3806 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentServiceTests.cs @@ -35,7 +35,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true, WithApplication = true)] -public class ContentServiceTests : UmbracoIntegrationTestWithContent +internal sealed class ContentServiceTests : UmbracoIntegrationTestWithContent { [SetUp] public void Setup() => ContentRepositoryBase.ThrowOnWarning = true; @@ -1913,11 +1913,11 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent [Test] [LongRunning] - public void Ensures_Permissions_Are_Retained_For_Copied_Descendants_With_Explicit_Permissions() + public async Task Ensures_Permissions_Are_Retained_For_Copied_Descendants_With_Explicit_Permissions() { // Arrange var userGroup = UserGroupBuilder.CreateUserGroup("1"); - UserService.Save(userGroup); + await UserGroupService.CreateAsync(userGroup, Constants.Security.SuperUserKey); var template = TemplateBuilder.CreateTextPageTemplate(); FileService.SaveTemplate(template); @@ -1954,11 +1954,11 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent [Test] [LongRunning] - public void Ensures_Permissions_Are_Inherited_For_Copied_Descendants() + public async Task Ensures_Permissions_Are_Inherited_For_Copied_Descendants() { // Arrange var userGroup = UserGroupBuilder.CreateUserGroup("1"); - UserService.Save(userGroup); + await UserGroupService.CreateAsync(userGroup, Constants.Security.SuperUserKey); var template = TemplateBuilder.CreateTextPageTemplate(); FileService.SaveTemplate(template); @@ -1969,7 +1969,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent { new(contentType.Key, 0, contentType.Alias) }; - ContentTypeService.Save(contentType); + await ContentTypeService.UpdateAsync(contentType, Constants.Security.SuperUserKey); var parentPage = ContentBuilder.CreateSimpleContent(contentType); ContentService.Save(parentPage); @@ -2060,7 +2060,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent var editorGroup = await UserGroupService.GetAsync(Constants.Security.EditorGroupKey); editorGroup.StartContentId = content1.Id; - UserService.Save(editorGroup); + await UserGroupService.UpdateAsync(editorGroup, Constants.Security.SuperUserKey); var admin = await UserService.GetAsync(Constants.Security.SuperUserKey); admin.StartContentIds = new[] { content1.Id }; @@ -2075,7 +2075,7 @@ public class ContentServiceTests : UmbracoIntegrationTestWithContent Assert.IsTrue(PublicAccessService.AddRule(content1, "test2", "test2").Success); var user = await UserService.GetAsync(Constants.Security.SuperUserKey); - var userGroup = UserService.GetUserGroupByAlias(user.Groups.First().Alias); + var userGroup = await UserGroupService.GetAsync(user.Groups.First().Alias); Assert.IsNotNull(NotificationService.CreateNotification(user, content1, "X")); ContentService.SetPermission(content1, "A", new[] { userGroup.Id }); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderDisabledTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderDisabledTests.cs index fa9dbbeddb..87a2d48ca0 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderDisabledTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderDisabledTests.cs @@ -5,7 +5,7 @@ using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public class +internal sealed class ContentTypeEditingServiceModelsBuilderDisabledTests : ContentTypeEditingServiceModelsBuilderDisabledTestsBase { // test some properties from IPublishedContent diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderDisabledTestsBase.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderDisabledTestsBase.cs index 55e632ba8a..3b32882102 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderDisabledTestsBase.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderDisabledTestsBase.cs @@ -6,6 +6,6 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; /// Unlike this testbase does not configure the modelsbuilder based /// which has the same effect as disabling it completely as only loads in that part anyway. /// -public class ContentTypeEditingServiceModelsBuilderDisabledTestsBase : ContentTypeEditingServiceTestsBase +internal class ContentTypeEditingServiceModelsBuilderDisabledTestsBase : ContentTypeEditingServiceTestsBase { } diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderEnabledTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderEnabledTests.cs index 88be628734..47d2e556f5 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderEnabledTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderEnabledTests.cs @@ -5,7 +5,7 @@ using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public class ContentTypeEditingServiceModelsBuilderEnabledTests : ContentTypeEditingServiceModelsBuilderEnabledTestsBase +internal sealed class ContentTypeEditingServiceModelsBuilderEnabledTests : ContentTypeEditingServiceModelsBuilderEnabledTestsBase { // test some properties from IPublishedContent [TestCaseSource(nameof(DifferentCapitalizedAlias), new object[] { nameof(IPublishedContent.Id) })] diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderEnabledTestsBase.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderEnabledTestsBase.cs index 5709bec3c7..19c6d6d785 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderEnabledTestsBase.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceModelsBuilderEnabledTestsBase.cs @@ -6,7 +6,7 @@ using Umbraco.Cms.Infrastructure.ModelsBuilder.Options; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public class ContentTypeEditingServiceModelsBuilderEnabledTestsBase : ContentTypeEditingServiceTestsBase +internal class ContentTypeEditingServiceModelsBuilderEnabledTestsBase : ContentTypeEditingServiceTestsBase { protected override void CustomTestSetup(IUmbracoBuilder builder) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.Create.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.Create.cs index bac636136f..b8c671710b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.Create.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.Create.cs @@ -7,7 +7,7 @@ using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class ContentTypeEditingServiceTests +internal sealed partial class ContentTypeEditingServiceTests { [TestCase(false)] [TestCase(true)] diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.GetAvailableCompositions.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.GetAvailableCompositions.cs index 356d78d931..ba51b90bd5 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.GetAvailableCompositions.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.GetAvailableCompositions.cs @@ -1,11 +1,11 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentTypeEditing; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class ContentTypeEditingServiceTests +internal sealed partial class ContentTypeEditingServiceTests { [TestCase(true)] [TestCase(false)] diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.Update.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.Update.cs index 31be783629..00c9cb2623 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.Update.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.Update.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentTypeEditing; @@ -6,7 +6,7 @@ using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class ContentTypeEditingServiceTests +internal sealed partial class ContentTypeEditingServiceTests { [TestCase(false)] [TestCase(true)] diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.cs index 8c99309a12..628073d6e3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTests.cs @@ -1,5 +1,5 @@ -namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; +namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class ContentTypeEditingServiceTests : ContentTypeEditingServiceTestsBase +internal sealed partial class ContentTypeEditingServiceTests : ContentTypeEditingServiceTestsBase { } diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTestsBase.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTestsBase.cs index f478904684..48f58e2748 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTestsBase.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ContentTypeEditingServiceTestsBase.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models.ContentTypeEditing; using Umbraco.Cms.Core.Services; @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true, WithApplication = true)] -public abstract class ContentTypeEditingServiceTestsBase : UmbracoIntegrationTest +internal abstract class ContentTypeEditingServiceTestsBase : UmbracoIntegrationTest { protected IContentTypeEditingService ContentTypeEditingService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Copy.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Copy.cs index 08327d200a..66302a40da 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Copy.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Copy.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class DocumentNavigationServiceTests +internal sealed partial class DocumentNavigationServiceTests { [Test] [TestCase("A1B1B217-B02F-4307-862C-A5E22DB729EB", "A1B1B217-B02F-4307-862C-A5E22DB729EB")] // Grandchild 2 to itself diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Create.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Create.cs index 79f1e7a42a..9c0945ce88 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Create.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Create.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class DocumentNavigationServiceTests +internal sealed partial class DocumentNavigationServiceTests { [Test] public async Task Structure_Updates_When_Creating_Content_At_Root() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Delete.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Delete.cs index e7fb137e19..dff659143f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Delete.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Delete.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class DocumentNavigationServiceTests +internal sealed partial class DocumentNavigationServiceTests { [Test] [TestCase("E48DD82A-7059-418E-9B82-CDD5205796CF")] // Root diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.DeleteFromRecycleBin.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.DeleteFromRecycleBin.cs index ee9f2815aa..bb074d10ae 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.DeleteFromRecycleBin.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.DeleteFromRecycleBin.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class DocumentNavigationServiceTests +internal sealed partial class DocumentNavigationServiceTests { [Test] public async Task Structure_Updates_When_Deleting_From_Recycle_Bin() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Move.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Move.cs index 54abc92ce5..4f644b4b77 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Move.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Move.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class DocumentNavigationServiceTests +internal sealed partial class DocumentNavigationServiceTests { [Test] [TestCase("E856AC03-C23E-4F63-9AA9-681B42A58573", "60E0E5C4-084E-4144-A560-7393BEAD2E96")] // Grandchild 1 to Child 2 diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.MoveToRecycleBin.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.MoveToRecycleBin.cs index eeeaf39368..c89eb351d5 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.MoveToRecycleBin.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.MoveToRecycleBin.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class DocumentNavigationServiceTests +internal sealed partial class DocumentNavigationServiceTests { [Test] public async Task Parent_And_Descendants_Are_Updated_When_Content_Is_Moved_To_Recycle_Bin() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Rebuild.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Rebuild.cs index 52f9bb77bd..89a669dd33 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Rebuild.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Rebuild.cs @@ -7,7 +7,7 @@ using Umbraco.Cms.Core.Services.Navigation; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class DocumentNavigationServiceTests +internal sealed partial class DocumentNavigationServiceTests { [Test] public async Task Structure_Can_Rebuild() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Restore.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Restore.cs index c4a6a2a3de..2947e9f511 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Restore.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Restore.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class DocumentNavigationServiceTests +internal sealed partial class DocumentNavigationServiceTests { [Test] [TestCase("E856AC03-C23E-4F63-9AA9-681B42A58573", "C6173927-0C59-4778-825D-D7B9F45D8DDE")] // Grandchild 1 to Child 1 diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Sort.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Sort.cs index bf1768d0c0..fcc0f8af1a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Sort.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Sort.cs @@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Models.ContentEditing; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class DocumentNavigationServiceTests +internal sealed partial class DocumentNavigationServiceTests { [Test] public async Task Structure_Updates_When_Reversing_Children_Sort_Order() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Update.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Update.cs index 8ed720000e..c16f5b4fa2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Update.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.Update.cs @@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Models.ContentEditing; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class DocumentNavigationServiceTests +internal sealed partial class DocumentNavigationServiceTests { [Test] public async Task Structure_Does_Not_Update_When_Updating_Content() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.cs index d1ad93da3a..883b4aabf6 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTests.cs @@ -6,7 +6,7 @@ using Umbraco.Cms.Tests.Common.Builders; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class DocumentNavigationServiceTests : DocumentNavigationServiceTestsBase +internal sealed partial class DocumentNavigationServiceTests : DocumentNavigationServiceTestsBase { [SetUp] public async Task Setup() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTestsBase.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTestsBase.cs index 4e7ea473de..93836955a9 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTestsBase.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentNavigationServiceTestsBase.cs @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public abstract class DocumentNavigationServiceTestsBase : UmbracoIntegrationTest +internal abstract class DocumentNavigationServiceTestsBase : UmbracoIntegrationTest { protected IContentTypeService ContentTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentUrlServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentUrlServiceTests.cs index 3f015e5a94..382dca172f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentUrlServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentUrlServiceTests.cs @@ -14,7 +14,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Logger = UmbracoTestOptions.Logger.Mock)] -public class DocumentUrlServiceTests : UmbracoIntegrationTestWithContent +internal sealed class DocumentUrlServiceTests : UmbracoIntegrationTestWithContent { private const string SubSubPage2Key = "48AE405E-5142-4EBE-929F-55EB616F51F2"; private const string SubSubPage3Key = "AACF2979-3F53-4184-B071-BA34D3338497"; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentUrlServiceTests_HideTopLevel_False.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentUrlServiceTests_HideTopLevel_False.cs index 5158e421c1..e741e4125e 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentUrlServiceTests_HideTopLevel_False.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DocumentUrlServiceTests_HideTopLevel_False.cs @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Logger = UmbracoTestOptions.Logger.Console)] -public class DocumentUrlServiceTests_HideTopLevel_False : UmbracoIntegrationTestWithContent +internal sealed class DocumentUrlServiceTests_HideTopLevel_False : UmbracoIntegrationTestWithContent { protected IDocumentUrlService DocumentUrlService => GetRequiredService(); protected ILanguageService LanguageService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DynamicRootServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DynamicRootServiceTests.cs index ceb5806449..9bbb3c55fb 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DynamicRootServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/DynamicRootServiceTests.cs @@ -19,7 +19,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] [SuppressMessage("ReSharper", "NotNullOrRequiredMemberIsNotInitialized")] -public class DynamicRootServiceTests : UmbracoIntegrationTest +internal sealed class DynamicRootServiceTests : UmbracoIntegrationTest { public enum DynamicRootOrigin { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ElementSwitchValidatorTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ElementSwitchValidatorTests.cs index d72630a52b..916ae02cea 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ElementSwitchValidatorTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/ElementSwitchValidatorTests.cs @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class ElementSwitchValidatorTests : UmbracoIntegrationTest +internal sealed class ElementSwitchValidatorTests : UmbracoIntegrationTest { private IElementSwitchValidator ElementSwitchValidator => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/LogViewerServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/LogViewerServiceTests.cs index cf1a0f7c95..b5633a4071 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/LogViewerServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/LogViewerServiceTests.cs @@ -8,7 +8,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class LogViewerServiceTests : UmbracoIntegrationTest +internal sealed class LogViewerServiceTests : UmbracoIntegrationTest { private ILogViewerService LogViewerService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaEditingServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaEditingServiceTests.cs index aaa4b12848..8bed77aaa3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaEditingServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaEditingServiceTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentEditing; @@ -11,7 +11,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class MediaEditingServiceTests : UmbracoIntegrationTest +internal sealed class MediaEditingServiceTests : UmbracoIntegrationTest { protected IMediaTypeService MediaTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Create.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Create.cs index 9b1baa3c71..78c393a466 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Create.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Create.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaNavigationServiceTests +internal sealed partial class MediaNavigationServiceTests { [Test] public async Task Structure_Updates_When_Creating_Media_At_Root() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Delete.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Delete.cs index c728d6a6d3..7aeeddfde0 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Delete.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Delete.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaNavigationServiceTests +internal sealed partial class MediaNavigationServiceTests { [Test] [TestCase("1CD97C02-8534-4B72-AE9E-AE52EC94CF31")] // Album diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.DeleteFromRecycleBin.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.DeleteFromRecycleBin.cs index c5a69b30f3..d89429a1fe 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.DeleteFromRecycleBin.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.DeleteFromRecycleBin.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaNavigationServiceTests +internal sealed partial class MediaNavigationServiceTests { [Test] public async Task Structure_Updates_When_Deleting_From_Recycle_Bin() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Move.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Move.cs index a54455f630..d4d24863a8 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Move.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Move.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaNavigationServiceTests +internal sealed partial class MediaNavigationServiceTests { [Test] [TestCase("62BCE72F-8C18-420E-BCAC-112B5ECC95FD", "139DC977-E50F-4382-9728-B278C4B7AC6A")] // Image 4 to Sub-album 1 diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.MoveToRecycleBin.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.MoveToRecycleBin.cs index 244e2be5dc..c3412ea8a2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.MoveToRecycleBin.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.MoveToRecycleBin.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaNavigationServiceTests +internal sealed partial class MediaNavigationServiceTests { [Test] public async Task Structure_Updates_When_Moving_Media_To_Recycle_Bin() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Rebuild.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Rebuild.cs index c5e1487a7e..f5c94049b1 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Rebuild.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Rebuild.cs @@ -7,7 +7,7 @@ using Umbraco.Cms.Core.Services.Navigation; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaNavigationServiceTests +internal sealed partial class MediaNavigationServiceTests { [Test] public async Task Structure_Can_Rebuild() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Restore.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Restore.cs index c0ff408125..afa7f68fdb 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Restore.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Restore.cs @@ -3,7 +3,7 @@ using Umbraco.Cms.Core; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaNavigationServiceTests +internal sealed partial class MediaNavigationServiceTests { [Test] [TestCase("62BCE72F-8C18-420E-BCAC-112B5ECC95FD", "139DC977-E50F-4382-9728-B278C4B7AC6A")] // Image 4 to Sub-album 1 diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Sort.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Sort.cs index 99f6e8f258..f3379bf7db 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Sort.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Sort.cs @@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Models.ContentEditing; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaNavigationServiceTests +internal sealed partial class MediaNavigationServiceTests { [Test] public async Task Structure_Updates_When_Reversing_Children_Sort_Order() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Update.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Update.cs index 0c24dbd0c8..875f90d495 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Update.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.Update.cs @@ -4,9 +4,9 @@ using Umbraco.Cms.Core.Models.ContentEditing; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaNavigationServiceTests +internal sealed partial class MediaNavigationServiceTests { -[Test] + [Test] public async Task Structure_Does_Not_Update_When_Updating_Media() { // Arrange diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.cs index dc72facf28..25ffd35828 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTests.cs @@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Scoping; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaNavigationServiceTests : MediaNavigationServiceTestsBase +internal sealed partial class MediaNavigationServiceTests : MediaNavigationServiceTestsBase { [SetUp] public async Task Setup() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTestsBase.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTestsBase.cs index 6952823b9c..e1e1a16280 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTestsBase.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaNavigationServiceTestsBase.cs @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public abstract class MediaNavigationServiceTestsBase : UmbracoIntegrationTest +internal abstract class MediaNavigationServiceTestsBase : UmbracoIntegrationTest { protected IMediaTypeService MediaTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.Create.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.Create.cs index 7e520c3bce..6951cc0810 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.Create.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.Create.cs @@ -5,7 +5,7 @@ using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaTypeEditingServiceTests +internal sealed partial class MediaTypeEditingServiceTests { [Test] public async Task Can_Create_With_All_Basic_Settings() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.GetAvailableCompositions.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.GetAvailableCompositions.cs index 3717c42280..a31331e1ba 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.GetAvailableCompositions.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.GetAvailableCompositions.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; @@ -9,7 +9,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; /// even though those share a base implementation. /// For a more detailed test suite on compositions, check . /// -public partial class MediaTypeEditingServiceTests +internal sealed partial class MediaTypeEditingServiceTests { [Test] public async Task Can_Get_Available_Compositions_Only_From_Media_Type_Key() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.GetFolderMediaTypes.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.GetFolderMediaTypes.cs index a86900e766..859464010d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.GetFolderMediaTypes.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.GetFolderMediaTypes.cs @@ -1,10 +1,10 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaTypeEditingServiceTests +internal sealed partial class MediaTypeEditingServiceTests { [Test] public async Task Can_Get_Default_Folder_Media_Type() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.GetMediaTypesForFileExtension.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.GetMediaTypesForFileExtension.cs index d5cbcf049c..77c54d33f0 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.GetMediaTypesForFileExtension.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.GetMediaTypesForFileExtension.cs @@ -1,10 +1,10 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Services; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaTypeEditingServiceTests +internal sealed partial class MediaTypeEditingServiceTests { [TestCase("jpg", Constants.Conventions.MediaTypes.Image)] [TestCase("png", Constants.Conventions.MediaTypes.Image)] diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.Update.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.Update.cs index 8b1b7cfc78..8bec94dfd4 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.Update.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.Update.cs @@ -1,11 +1,11 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class MediaTypeEditingServiceTests +internal sealed partial class MediaTypeEditingServiceTests { [Test] public async Task Can_Update_All_Basic_Settings() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.cs index 29a1264182..6219e862d4 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MediaTypeEditingServiceTests.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core.Media; using Umbraco.Cms.Core.Models; @@ -8,7 +8,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; /// Tests for the media type editing service. Please notice that a lot of functional test is covered by the content type /// editing service tests, since these services share the same base implementation. /// -public partial class MediaTypeEditingServiceTests : ContentTypeEditingServiceTestsBase +internal sealed partial class MediaTypeEditingServiceTests : ContentTypeEditingServiceTestsBase { protected override void ConfigureTestServices(IServiceCollection services) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MemberGroupServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MemberGroupServiceTests.cs index cdf64709ff..46b43868d3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MemberGroupServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MemberGroupServiceTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Services.OperationStatus; @@ -12,7 +12,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class MemberGroupServiceTests : UmbracoIntegrationTest +internal sealed class MemberGroupServiceTests : UmbracoIntegrationTest { private IMemberGroupService MemberGroupService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MemberTypeEditingServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MemberTypeEditingServiceTests.cs index 5f87ca923f..57dc3b7bcc 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MemberTypeEditingServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MemberTypeEditingServiceTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentTypeEditing; @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; /// Tests for the member type editing service. Please notice that a lot of functional test is covered by the content type /// editing service tests, since these services share the same base implementation. /// -public class MemberTypeEditingServiceTests : ContentTypeEditingServiceTestsBase +internal sealed class MemberTypeEditingServiceTests : ContentTypeEditingServiceTestsBase { private IMemberTypeEditingService MemberTypeEditingService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MetricsConsentServiceTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MetricsConsentServiceTest.cs index b3c55c5dea..178de73e50 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MetricsConsentServiceTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/MetricsConsentServiceTest.cs @@ -8,7 +8,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class MetricsConsentServiceTest : UmbracoIntegrationTest +internal sealed class MetricsConsentServiceTest : UmbracoIntegrationTest { private IMetricsConsentService MetricsConsentService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishStatusServiceTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishStatusServiceTest.cs index 3fbf0b4628..bca82448b2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishStatusServiceTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishStatusServiceTest.cs @@ -1,33 +1,23 @@ -using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using NUnit.Framework; using Umbraco.Cms.Core.Cache; -using Umbraco.Cms.Core.Handlers; using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.ContentEditing; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Persistence.Repositories; using Umbraco.Cms.Core.Scoping; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Services.Navigation; using Umbraco.Cms.Core.Sync; -using Umbraco.Cms.Infrastructure.DependencyInjection; -using Umbraco.Cms.Infrastructure.Examine; -using Umbraco.Cms.Infrastructure.Examine.DependencyInjection; -using Umbraco.Cms.Infrastructure.HostedServices; -using Umbraco.Cms.Infrastructure.Search; -using Umbraco.Cms.Tests.Common.Attributes; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Testing; using Umbraco.Cms.Tests.Integration.Testing; using Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Scoping; -using Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Logger = UmbracoTestOptions.Logger.Mock)] -public class PublishStatusServiceTest : UmbracoIntegrationTestWithContent +internal sealed class PublishStatusServiceTest : UmbracoIntegrationTestWithContent { protected IPublishStatusQueryService PublishStatusQueryService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishedUrlInfoProviderTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishedUrlInfoProviderTests.cs index 2fa0fccbac..b359a0557d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishedUrlInfoProviderTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishedUrlInfoProviderTests.cs @@ -4,7 +4,7 @@ using Umbraco.Cms.Tests.Common.Builders; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public class PublishedUrlInfoProviderTests : PublishedUrlInfoProviderTestsBase +internal sealed class PublishedUrlInfoProviderTests : PublishedUrlInfoProviderTestsBase { [Test] diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishedUrlInfoProviderTestsBase.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishedUrlInfoProviderTestsBase.cs index 1a27d998af..e6c33d705f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishedUrlInfoProviderTestsBase.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishedUrlInfoProviderTestsBase.cs @@ -18,7 +18,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Logger = UmbracoTestOptions.Logger.Mock)] -public abstract class PublishedUrlInfoProviderTestsBase : UmbracoIntegrationTestWithContent +internal abstract class PublishedUrlInfoProviderTestsBase : UmbracoIntegrationTestWithContent { protected IDocumentUrlService DocumentUrlService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishedUrlInfoProvider_hidetoplevel_false.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishedUrlInfoProvider_hidetoplevel_false.cs index cc68a4bdb0..7caa63fda6 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishedUrlInfoProvider_hidetoplevel_false.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/PublishedUrlInfoProvider_hidetoplevel_false.cs @@ -6,7 +6,7 @@ using Umbraco.Cms.Tests.Common.Builders; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public class PublishedUrlInfoProvider_hidetoplevel_false : PublishedUrlInfoProviderTestsBase +internal sealed class PublishedUrlInfoProvider_hidetoplevel_false : PublishedUrlInfoProviderTestsBase { protected override void CustomTestSetup(IUmbracoBuilder builder) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/RelationServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/RelationServiceTests.cs index 607478ea0a..7ba732635e 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/RelationServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/RelationServiceTests.cs @@ -1,4 +1,4 @@ -using Castle.Components.DictionaryAdapter.Xml; +using Castle.Components.DictionaryAdapter.Xml; using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class RelationServiceTests : UmbracoIntegrationTest +internal sealed class RelationServiceTests : UmbracoIntegrationTest { private IRelationService RelationService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/TelemetryProviderTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/TelemetryProviderTests.cs index 306b2c58a0..210d66f28a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/TelemetryProviderTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/TelemetryProviderTests.cs @@ -21,7 +21,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class TelemetryProviderTests : UmbracoIntegrationTest +internal sealed class TelemetryProviderTests : UmbracoIntegrationTest { private IContentTypeService ContentTypeService => GetRequiredService(); @@ -48,6 +48,8 @@ public class TelemetryProviderTests : UmbracoIntegrationTest private IUserService UserService => GetRequiredService(); + private IUserGroupService UserGroupService => GetRequiredService(); + private IMediaService MediaService => GetRequiredService(); private IMediaTypeService MediaTypeService => GetRequiredService(); @@ -266,11 +268,11 @@ public class TelemetryProviderTests : UmbracoIntegrationTest } [Test] - public void UserTelemetry_Can_Get_With_Saved_UserGroups() + public async Task UserTelemetry_Can_Get_With_Saved_UserGroups() { var userGroup = BuildUserGroup("testGroup"); - UserService.Save(userGroup); + await UserGroupService.CreateAsync(userGroup, Constants.Security.SuperUserKey); var result = UserTelemetryProvider.GetInformation() .FirstOrDefault(x => x.Name == Constants.Telemetry.UserGroupCount); @@ -278,14 +280,13 @@ public class TelemetryProviderTests : UmbracoIntegrationTest } [Test] - public void UserTelemetry_Can_Get_More_UserGroups() + public async Task UserTelemetry_Can_Get_More_UserGroups() { var userGroups = BuildUserGroups(100); - foreach (var userGroup in userGroups) { - UserService.Save(userGroup); + await UserGroupService.CreateAsync(userGroup, Constants.Security.SuperUserKey); } var result = UserTelemetryProvider.GetInformation() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserGroupServiceValidationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserGroupServiceValidationTests.cs index d14b887b57..9d9f2e997e 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserGroupServiceValidationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserGroupServiceValidationTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models.Membership; using Umbraco.Cms.Core.Services; @@ -11,7 +11,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class UserGroupServiceValidationTests : UmbracoIntegrationTest +internal sealed class UserGroupServiceValidationTests : UmbracoIntegrationTest { private IUserGroupService UserGroupService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.ChangePassword.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.ChangePassword.cs index 5ed591d1d8..930602995b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.ChangePassword.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.ChangePassword.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.Models; @@ -8,7 +8,7 @@ using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class UserServiceCrudTests +internal sealed partial class UserServiceCrudTests { [Test] public async Task Can_Reset_Password() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Create.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Create.cs index c70a883179..0660597ffd 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Create.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Create.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.Models; @@ -8,7 +8,7 @@ using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class UserServiceCrudTests +internal sealed partial class UserServiceCrudTests { [Test] [TestCase("test@email.com", "test@email.com", true, true)] diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Delete.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Delete.cs index 98875c21ef..d63c803c95 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Delete.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Delete.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Membership; @@ -6,7 +6,7 @@ using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class UserServiceCrudTests +internal sealed partial class UserServiceCrudTests { [Test] public async Task Delete_Returns_Not_Found_If_Not_Found() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Filter.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Filter.cs index 71b557d4d2..8f9a0b5f2e 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Filter.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Filter.cs @@ -1,14 +1,15 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Membership; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Services.OperationStatus; +using Umbraco.Cms.Infrastructure.Migrations.Install; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class UserServiceCrudTests +internal sealed partial class UserServiceCrudTests { [Test] [TestCase(UserState.Disabled)] @@ -242,7 +243,7 @@ public partial class UserServiceCrudTests var userService = CreateUserService(); await CreateTestUsers(userService); - var writerGroup = await UserGroupService.GetAsync(Constants.Security.WriterGroupAlias); + var writerGroup = await UserGroupService.GetAsync(DatabaseDataCreator.WriterGroupAlias); var filter = new UserFilter { IncludedUserGroups = new HashSet { writerGroup!.Key } diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Get.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Get.cs index 6d33c92a8a..8b1e4b2ee2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Get.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Get.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.Models; @@ -7,7 +7,7 @@ using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class UserServiceCrudTests +internal sealed partial class UserServiceCrudTests { [Test] public async Task Only_Super_User_Can_Get_Super_user() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Invite.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Invite.cs index 538c260e2f..330c0ee62d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Invite.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Invite.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.Models; @@ -8,7 +8,7 @@ using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class UserServiceCrudTests +internal sealed partial class UserServiceCrudTests { [Test] [TestCase("test@email.com", "test@email.com", true, true)] diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.PartialUpdates.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.PartialUpdates.cs index 5eaf3b07ae..a016c2d918 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.PartialUpdates.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.PartialUpdates.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Membership; @@ -6,7 +6,7 @@ using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class UserServiceCrudTests +internal sealed partial class UserServiceCrudTests { [Test] public async Task Can_Enable_User() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Update.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Update.cs index 3850ada472..4b5cc29fee 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Update.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.Update.cs @@ -1,4 +1,4 @@ -using Moq; +using Moq; using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration.Models; @@ -10,7 +10,7 @@ using Umbraco.Cms.Core.Services.OperationStatus; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -public partial class UserServiceCrudTests +internal sealed partial class UserServiceCrudTests { private ISet GetKeysFromIds(IEnumerable? ids, UmbracoObjectTypes type) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.cs index 0dc52c0bab..c6533aeff3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/UserServiceCrudTests.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -23,7 +23,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public partial class UserServiceCrudTests : UmbracoIntegrationTestWithContent +internal sealed partial class UserServiceCrudTests : UmbracoIntegrationTestWithContent { private IUserGroupService UserGroupService => GetRequiredService(); @@ -82,7 +82,8 @@ public partial class UserServiceCrudTests : UmbracoIntegrationTestWithContent GetRequiredService(), GetRequiredService>(), GetRequiredService(), - GetRequiredService()); + GetRequiredService(), + GetRequiredService()); } diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookLogServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookLogServiceTests.cs index 12d0a234ca..71f31794a1 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookLogServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookLogServiceTests.cs @@ -11,7 +11,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class WebhookLogServiceTests : UmbracoIntegrationTest +internal sealed class WebhookLogServiceTests : UmbracoIntegrationTest { private IWebhookLogService WebhookLogService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookRequestServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookRequestServiceTests.cs index a4e2ded5df..f415b1d4ff 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookRequestServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookRequestServiceTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; @@ -9,7 +9,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class WebhookRequestServiceTests : UmbracoIntegrationTest +internal sealed class WebhookRequestServiceTests : UmbracoIntegrationTest { private IWebhookRequestService WebhookRequestService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookServiceTests.cs index fd367a8c26..c2569911a2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookServiceTests.cs @@ -7,12 +7,9 @@ using Umbraco.Cms.Tests.Integration.Testing; namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Services; -// TODO (V16): Make this test class internal (along with any others in this project). We should just expose the base classes and helpers. -// Could also consider moving the base classes to a different assembly, and shipping that, but not our tests. - [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class WebhookServiceTests : UmbracoIntegrationTest +internal sealed class WebhookServiceTests : UmbracoIntegrationTest { private IWebhookService WebhookService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Telemetry/TelemetryServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Telemetry/TelemetryServiceTests.cs index 20dd4ecb46..a92e7d7007 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Telemetry/TelemetryServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Telemetry/TelemetryServiceTests.cs @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Core.Telemetry; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class TelemetryServiceTests : UmbracoIntegrationTest +internal sealed class TelemetryServiceTests : UmbracoIntegrationTest { protected override void CustomTestSetup(IUmbracoBuilder builder) => builder.Services.Configure(options => options.Id = Guid.NewGuid().ToString()); @@ -68,10 +68,11 @@ public class TelemetryServiceTests : UmbracoIntegrationTest expectedData.AddRange(WebhookEventCollection.Select(eventInfo => $"{Constants.Telemetry.WebhookPrefix}{eventInfo.Alias}")); await MetricsConsentService.SetConsentLevelAsync(TelemetryLevel.Detailed); - var success = TelemetryService.TryGetTelemetryReportData(out var telemetryReportData); - var detailed = telemetryReportData.Detailed.ToArray(); + var telemetryReportData = await TelemetryService.GetTelemetryReportDataAsync(); + Assert.IsNotNull(telemetryReportData); + + var detailed = telemetryReportData!.Detailed.ToArray(); - Assert.IsTrue(success); Assert.Multiple(() => { Assert.IsNotNull(detailed); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/BackOfficeExamineSearcherTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/BackOfficeExamineSearcherTests.cs index 7df133a3ba..bb4f099ef0 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/BackOfficeExamineSearcherTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/BackOfficeExamineSearcherTests.cs @@ -1,4 +1,4 @@ -using Examine; +using Examine; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection; @@ -23,7 +23,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class BackOfficeExamineSearcherTests : ExamineBaseTest +internal sealed class BackOfficeExamineSearcherTests : ExamineBaseTest { [SetUp] public void Setup() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineDemoDataContentService.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineDemoDataContentService.cs index c0ccad55e6..3a66c1913c 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineDemoDataContentService.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineDemoDataContentService.cs @@ -4,7 +4,7 @@ using System.Xml.XPath; namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine; // TODO: This is ultra hack and still left over from legacy but still works for testing atm -public class ExamineDemoDataContentService +internal sealed class ExamineDemoDataContentService { public const int ProtectedNode = 1142; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineExternalIndexSearcherTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineExternalIndexSearcherTest.cs index a6e2891447..d3f27e5c16 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineExternalIndexSearcherTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineExternalIndexSearcherTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. using System.Globalization; @@ -21,7 +21,7 @@ using Umbraco.Cms.Infrastructure.Examine; namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine; -public class ExamineExternalIndexSearcherTest : IExamineExternalIndexSearcherTest +internal sealed class ExamineExternalIndexSearcherTest : IExamineExternalIndexSearcherTest { private readonly AppCaches _appCaches; private readonly ILanguageService _languageService; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineExternalIndexTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineExternalIndexTests.cs index 3859f5fd14..98a81924bd 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineExternalIndexTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/ExamineExternalIndexTests.cs @@ -1,4 +1,4 @@ -using Examine; +using Examine; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection; @@ -25,7 +25,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class ExamineExternalIndexTests : ExamineBaseTest +internal sealed class ExamineExternalIndexTests : ExamineBaseTest { private const string ContentName = "TestContent"; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexInitializer.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexInitializer.cs index 52dd0038bc..1d7cf2e841 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexInitializer.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexInitializer.cs @@ -37,6 +37,8 @@ public class IndexInitializer private readonly IScopeProvider _scopeProvider; private readonly IShortStringHelper _shortStringHelper; private readonly IContentTypeService _contentTypeService; + private readonly IDocumentUrlService _documentUrlService; + private readonly ILanguageService _languageService; public IndexInitializer( IShortStringHelper shortStringHelper, @@ -46,7 +48,9 @@ public class IndexInitializer ILoggerFactory loggerFactory, IOptions contentSettings, ILocalizationService localizationService, - IContentTypeService contentTypeService) + IContentTypeService contentTypeService, + IDocumentUrlService documentUrlService, + ILanguageService languageService) { _shortStringHelper = shortStringHelper; _propertyEditors = propertyEditors; @@ -56,67 +60,8 @@ public class IndexInitializer _contentSettings = contentSettings; _localizationService = localizationService; _contentTypeService = contentTypeService; - } - - [Obsolete("Use ctor that is not obsolete. This will be removed in Umbraco 15.")] - public IndexInitializer( - IShortStringHelper shortStringHelper, - PropertyEditorCollection propertyEditors, - MediaUrlGeneratorCollection mediaUrlGenerators, - IScopeProvider scopeProvider, - ILoggerFactory loggerFactory, - IOptions contentSettings, - ILocalizationService localizationService) - : this( - shortStringHelper, - propertyEditors, - mediaUrlGenerators, - scopeProvider, - loggerFactory, - contentSettings, - localizationService, StaticServiceProvider.Instance.GetRequiredService()) - { - - } - - [Obsolete("Use ctor that is not obsolete. This will be removed in Umbraco 15.")] - public IndexInitializer( - IShortStringHelper shortStringHelper, - PropertyEditorCollection propertyEditors, - MediaUrlGeneratorCollection mediaUrlGenerators, - IScopeProvider scopeProvider, - ILoggerFactory loggerFactory, - IOptions contentSettings, - IContentTypeService contentTypeService) - : this( - shortStringHelper, - propertyEditors, - mediaUrlGenerators, - scopeProvider, - loggerFactory, - contentSettings, - StaticServiceProvider.Instance.GetRequiredService(), contentTypeService) - { - } - - [Obsolete("Use ctor that is not obsolete. This will be removed in Umbraco 15.")] - public IndexInitializer( - IShortStringHelper shortStringHelper, - PropertyEditorCollection propertyEditors, - MediaUrlGeneratorCollection mediaUrlGenerators, - IScopeProvider scopeProvider, - ILoggerFactory loggerFactory, - IOptions contentSettings) - : this( - shortStringHelper, - propertyEditors, - mediaUrlGenerators, - scopeProvider, - loggerFactory, - contentSettings, - StaticServiceProvider.Instance.GetRequiredService(), - StaticServiceProvider.Instance.GetRequiredService()) - { + _documentUrlService = documentUrlService; + _languageService = languageService; } public ContentValueSetBuilder GetContentValueSetBuilder(bool publishedValuesOnly) @@ -130,7 +75,9 @@ public class IndexInitializer publishedValuesOnly, _localizationService, _contentTypeService, - _loggerFactory.CreateLogger()); + _loggerFactory.CreateLogger(), + _documentUrlService, + _languageService); return contentValueSetBuilder; } 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 856b0e8cf2..2e5fee24e5 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexTest.cs @@ -17,7 +17,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine; /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)] -public class IndexTest : ExamineBaseTest +internal sealed class IndexTest : ExamineBaseTest { private IDocumentUrlService DocumentUrlService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/PublishedContentQueryTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/PublishedContentQueryTests.cs index bdc5adfe80..93ec1370ab 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/PublishedContentQueryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/PublishedContentQueryTests.cs @@ -18,7 +18,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.None)] -public class PublishedContentQueryTests : ExamineBaseTest +internal sealed class PublishedContentQueryTests : ExamineBaseTest { private class TestIndex : LuceneIndex, IUmbracoIndex { 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 10b6b1366f..33d78707c2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/RandomIdRAMDirectory.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/RandomIdRAMDirectory.cs @@ -2,7 +2,7 @@ using Lucene.Net.Store; namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine; -public class RandomIdRAMDirectory : RAMDirectory +internal sealed class RandomIdRAMDirectory : RAMDirectory { private readonly string _lockId = Guid.NewGuid().ToString(); public override string GetLockID() => _lockId; 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 885c7d6851..4d4f306cb5 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/SearchTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/SearchTests.cs @@ -16,7 +16,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Logger = UmbracoTestOptions.Logger.Console)] -public class SearchTests : ExamineBaseTest +internal sealed class SearchTests : ExamineBaseTest { private IDocumentUrlService DocumentUrlService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/AdvancedMigrationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/AdvancedMigrationTests.cs index bf17957aad..b6fe2f48ed 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/AdvancedMigrationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/AdvancedMigrationTests.cs @@ -26,7 +26,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Migrations; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewEmptyPerTest)] -public class AdvancedMigrationTests : UmbracoIntegrationTest +internal sealed class AdvancedMigrationTests : UmbracoIntegrationTest { private IUmbracoVersion UmbracoVersion => GetRequiredService(); private IEventAggregator EventAggregator => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/Expressions/Create/Expressions/CreateTableExpressionTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/Expressions/Create/Expressions/CreateTableExpressionTests.cs index 9f44122f20..141a90b422 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/Expressions/Create/Expressions/CreateTableExpressionTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/Expressions/Create/Expressions/CreateTableExpressionTests.cs @@ -11,7 +11,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Migrations.Expres { [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewEmptyPerTest)] - public class CreateTableExpressionTests : UmbracoIntegrationTest + internal sealed class CreateTableExpressionTests : UmbracoIntegrationTest { [Test] public void Do_ForSimpleTableDefinition_TableIsCreated() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/PartialMigrationsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/PartialMigrationsTests.cs index dc0d4b0a4d..931daec76b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/PartialMigrationsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Migrations/PartialMigrationsTests.cs @@ -22,7 +22,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Migrations; // These tests depend on the key-value table, so we need a schema to run these tests. [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] [TestFixture] -public class PartialMigrationsTests : UmbracoIntegrationTest +internal sealed class PartialMigrationsTests : UmbracoIntegrationTest { public const string TableName = "testTable"; public const string ColumnName = "testColumn"; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/CreatedPackageSchemaTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/CreatedPackageSchemaTests.cs index f9bdbe5dac..f02cc4936b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/CreatedPackageSchemaTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/CreatedPackageSchemaTests.cs @@ -10,7 +10,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class CreatedPackageSchemaTests : UmbracoIntegrationTest +internal sealed class CreatedPackageSchemaTests : UmbracoIntegrationTest { private ICreatedPackagesRepository CreatedPackageSchemaRepository => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs index 8bf05e633d..5b62f36f42 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageDataInstallationTests.cs @@ -23,7 +23,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging; [TestFixture] [Category("Slow")] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, WithApplication = true)] -public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent +internal sealed class PackageDataInstallationTests : UmbracoIntegrationTestWithContent { private ILanguageService LanguageService => GetRequiredService(); @@ -87,7 +87,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent [Test] [LongRunning] - public void Can_Import_uBlogsy_ContentTypes_And_Verify_Structure() + public async Task Can_Import_uBlogsy_ContentTypes_And_Verify_Structure() { // Arrange var strXml = ImportResources.uBlogsy_Package; @@ -98,7 +98,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent // Act var dataTypes = PackageDataInstallation.ImportDataTypes(dataTypeElement.Elements("DataType").ToList(), -1); - var templates = PackageDataInstallation.ImportTemplates(templateElement.Elements("Template").ToList(), -1); + var templates = await PackageDataInstallation.ImportTemplatesAsync(templateElement.Elements("Template").ToList(), -1); var contentTypes = PackageDataInstallation.ImportDocumentTypes(docTypeElement.Elements("DocumentType"), -1); var numberOfTemplates = (from doc in templateElement.Elements("Template") select doc).Count(); @@ -135,7 +135,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent [Test] [LongRunning] - public void Can_Import_Inherited_ContentTypes_And_Verify_PropertyTypes_UniqueIds() + public async Task Can_Import_Inherited_ContentTypes_And_Verify_PropertyTypes_UniqueIds() { // Arrange var strXml = ImportResources.InheritedDocTypes_Package; @@ -146,7 +146,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent // Act var dataTypes = PackageDataInstallation.ImportDataTypes(dataTypeElement.Elements("DataType").ToList(), -1); - var templates = PackageDataInstallation.ImportTemplates(templateElement.Elements("Template").ToList(), -1); + var templates = await PackageDataInstallation.ImportTemplatesAsync(templateElement.Elements("Template").ToList(), -1); var contentTypes = PackageDataInstallation.ImportDocumentTypes(docTypeElement.Elements("DocumentType"), -1); // Assert @@ -162,7 +162,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent [Test] [LongRunning] - public void Can_Import_Inherited_ContentTypes_And_Verify_PropertyGroups_And_PropertyTypes() + public async Task Can_Import_Inherited_ContentTypes_And_Verify_PropertyGroups_And_PropertyTypes() { // Arrange var strXml = ImportResources.InheritedDocTypes_Package; @@ -173,7 +173,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent // Act var dataTypes = PackageDataInstallation.ImportDataTypes(dataTypeElement.Elements("DataType").ToList(), -1); - var templates = PackageDataInstallation.ImportTemplates(templateElement.Elements("Template").ToList(), -1); + var templates = await PackageDataInstallation.ImportTemplatesAsync(templateElement.Elements("Template").ToList(), -1); var contentTypes = PackageDataInstallation.ImportDocumentTypes(docTypeElement.Elements("DocumentType"), -1); var numberOfDocTypes = (from doc in docTypeElement.Elements("DocumentType") select doc).Count(); @@ -202,7 +202,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent [Test] [LongRunning] - public void Can_Import_Template_Package_Xml() + public async Task Can_Import_Template_Package_Xml() { // Arrange var strXml = ImportResources.StandardMvc_Package; @@ -212,7 +212,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent var init = FileService.GetTemplates().Count(); // Act - var templates = PackageDataInstallation.ImportTemplates(element.Elements("Template").ToList(), -1); + var templates = await PackageDataInstallation.ImportTemplatesAsync(element.Elements("Template").ToList(), -1); var numberOfTemplates = (from doc in element.Elements("Template") select doc).Count(); var allTemplates = FileService.GetTemplates(); @@ -226,7 +226,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent } [Test] - public void Can_Import_Single_Template() + public async Task Can_Import_Single_Template() { // Arrange var strXml = ImportResources.StandardMvc_Package; @@ -234,7 +234,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent var element = xml.Descendants("Templates").First(); // Act - var templates = PackageDataInstallation.ImportTemplate(element.Elements("Template").First(), -1); + var templates = await PackageDataInstallation.ImportTemplateAsync(element.Elements("Template").First(), -1); // Assert Assert.That(templates, Is.Not.Null); @@ -246,7 +246,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent } [Test] - public void Can_Import_Single_Template_With_Key() + public async Task Can_Import_Single_Template_With_Key() { // Arrange var strXml = ImportResources.StandardMvc_Package; @@ -258,7 +258,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent firstTemplateElement.Add(new XElement("Key", key)); // Act - var templates = PackageDataInstallation.ImportTemplate(firstTemplateElement, -1); + var templates = await PackageDataInstallation.ImportTemplateAsync(firstTemplateElement, -1); // Assert Assert.That(templates, Is.Not.Null); @@ -272,7 +272,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent [Test] [LongRunning] - public void Can_Import_StandardMvc_ContentTypes_Package_Xml() + public async Task Can_Import_StandardMvc_ContentTypes_Package_Xml() { // Arrange var strXml = ImportResources.StandardMvc_Package; @@ -284,7 +284,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent // Act var dataTypeDefinitions = PackageDataInstallation.ImportDataTypes(dataTypeElement.Elements("DataType").ToList(), -1); - var templates = PackageDataInstallation.ImportTemplates(templateElement.Elements("Template").ToList(), -1); + var templates = await PackageDataInstallation.ImportTemplatesAsync(templateElement.Elements("Template").ToList(), -1); var contentTypes = PackageDataInstallation.ImportDocumentTypes(docTypeElement.Elements("DocumentType"), -1); var numberOfDocTypes = (from doc in docTypeElement.Elements("DocumentType") select doc).Count(); @@ -311,7 +311,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent [Test] [LongRunning] - public void Can_Import_StandardMvc_ContentTypes_And_Templates_Xml() + public async Task Can_Import_StandardMvc_ContentTypes_And_Templates_Xml() { // Arrange var strXml = ImportResources.StandardMvc_Package; @@ -323,7 +323,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent // Act var dataTypeDefinitions = PackageDataInstallation.ImportDataTypes(dataTypeElement.Elements("DataType").ToList(), -1); - var templates = PackageDataInstallation.ImportTemplates(templateElement.Elements("Template").ToList(), -1); + var templates = await PackageDataInstallation.ImportTemplatesAsync(templateElement.Elements("Template").ToList(), -1); var contentTypes = PackageDataInstallation.ImportDocumentTypes(docTypeElement.Elements("DocumentType"), -1); var numberOfDocTypes = (from doc in docTypeElement.Elements("DocumentType") select doc).Count(); @@ -338,7 +338,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent [Test] [LongRunning] - public void Can_Import_Fanoe_Starterkit_ContentTypes_And_Templates_Xml() + public async Task Can_Import_Fanoe_Starterkit_ContentTypes_And_Templates_Xml() { // Arrange var strXml = ImportResources.Fanoe_Package; @@ -350,7 +350,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent // Act var dataTypeDefinitions = PackageDataInstallation.ImportDataTypes(dataTypeElement.Elements("DataType").ToList(), -1); - var templates = PackageDataInstallation.ImportTemplates(templateElement.Elements("Template").ToList(), -1); + var templates = await PackageDataInstallation.ImportTemplatesAsync(templateElement.Elements("Template").ToList(), -1); var contentTypes = PackageDataInstallation.ImportDocumentTypes(docTypeElement.Elements("DocumentType"), -1); var numberOfDocTypes = (from doc in docTypeElement.Elements("DocumentType") select doc).Count(); @@ -462,7 +462,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent } [Test] - public void Can_Import_Templates_Package_Xml_With_Invalid_Master() + public async Task Can_Import_Templates_Package_Xml_With_Invalid_Master() { // Arrange var strXml = ImportResources.XsltSearch_Package; @@ -470,7 +470,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent var templateElement = xml.Descendants("Templates").First(); // Act - var templates = PackageDataInstallation.ImportTemplates(templateElement.Elements("Template").ToList(), -1); + var templates = await PackageDataInstallation.ImportTemplatesAsync(templateElement.Elements("Template").ToList(), -1); var numberOfTemplates = (from doc in templateElement.Elements("Template") select doc).Count(); // Assert @@ -544,7 +544,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent } [Test] - public void Can_ReImport_Templates_To_Update() + public async Task Can_ReImport_Templates_To_Update() { var newPackageXml = XElement.Parse(ImportResources.TemplateOnly_Package); var updatedPackageXml = XElement.Parse(ImportResources.TemplateOnly_Updated_Package); @@ -559,9 +559,9 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent // Act var numberOfTemplates = (from doc in templateElement.Elements("Template") select doc).Count(); - var templates = PackageDataInstallation.ImportTemplates(templateElement.Elements("Template").ToList(), -1); + var templates = await PackageDataInstallation.ImportTemplatesAsync(templateElement.Elements("Template").ToList(), -1); var templatesAfterUpdate = - PackageDataInstallation.ImportTemplates(templateElementUpdated.Elements("Template").ToList(), -1); + await PackageDataInstallation.ImportTemplatesAsync(templateElementUpdated.Elements("Template").ToList(), -1); var allTemplates = fileService.GetTemplates(); // Assert @@ -694,7 +694,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent [Test] [LongRunning] - public void Can_Import_Package_With_Compositions() + public async Task Can_Import_Package_With_Compositions() { // Arrange var strXml = ImportResources.CompositionsTestPackage; @@ -703,7 +703,7 @@ public class PackageDataInstallationTests : UmbracoIntegrationTestWithContent var docTypeElement = xml.Descendants("DocumentTypes").First(); // Act - var templates = PackageDataInstallation.ImportTemplates(templateElement.Elements("Template").ToList(), -1); + var templates = await PackageDataInstallation.ImportTemplatesAsync(templateElement.Elements("Template").ToList(), -1); var contentTypes = PackageDataInstallation.ImportDocumentTypes(docTypeElement.Elements("DocumentType"), -1); var numberOfDocTypes = (from doc in docTypeElement.Elements("DocumentType") select doc).Count(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageInstallationTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageInstallationTest.cs index 81fb0b28e3..eecc04a964 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageInstallationTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Packaging/PackageInstallationTest.cs @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)] -public class PackageInstallationTest : UmbracoIntegrationTest +internal sealed class PackageInstallationTest : UmbracoIntegrationTest { private IHostingEnvironment HostingEnvironment => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs index 0f373088e4..d4409157df 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs @@ -18,7 +18,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence; [TestFixture] [Timeout(60000)] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Logger = UmbracoTestOptions.Logger.Console)] -public class LocksTests : UmbracoIntegrationTest +internal sealed class LocksTests : UmbracoIntegrationTest { [SetUp] protected void SetUp() 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 8280f821fa..67483586d2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoBulkInsertTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoBulkInsertTests.cs @@ -18,7 +18,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.NPoco // TODO: npoco - is this still appropriate? [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class NPocoBulkInsertTests : UmbracoIntegrationTest +internal sealed class NPocoBulkInsertTests : UmbracoIntegrationTest { private readonly TestHelper _testHelper = new(); 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 658b080521..b7996b779f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoFetchTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/NPocoTests/NPocoFetchTests.cs @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.NPoco [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, WithApplication = true)] -public class NPocoFetchTests : UmbracoIntegrationTest +internal sealed class NPocoFetchTests : UmbracoIntegrationTest { [SetUp] protected void SeedDatabase() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/AuditRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/AuditRepositoryTest.cs index 8e7eed1f28..e206abbd44 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/AuditRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/AuditRepositoryTest.cs @@ -17,7 +17,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Logger = UmbracoTestOptions.Logger.Console)] -public class AuditRepositoryTest : UmbracoIntegrationTest +internal sealed class AuditRepositoryTest : UmbracoIntegrationTest { [SetUp] public void Prepare() => _logger = LoggerFactory.CreateLogger(); 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 e191a005a4..604d9d5983 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/CacheInstructionRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/CacheInstructionRepositoryTest.cs @@ -14,7 +14,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Logger = UmbracoTestOptions.Logger.Console)] -public class CacheInstructionRepositoryTest : UmbracoIntegrationTest +internal sealed class CacheInstructionRepositoryTest : UmbracoIntegrationTest { private const string OriginIdentiy = "Test1"; private const string Instructions = "{}"; 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 51ade838c6..17cbab42ed 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ContentTypeRepositoryTest.cs @@ -29,7 +29,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Mapper = true, Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class ContentTypeRepositoryTest : UmbracoIntegrationTest +internal sealed class ContentTypeRepositoryTest : UmbracoIntegrationTest { [SetUp] public void SetUpData() => CreateTestData(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs index 60c175b070..66ac4278a3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs @@ -16,7 +16,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DataTypeDefinitionRepositoryTest : UmbracoIntegrationTest +internal sealed class DataTypeDefinitionRepositoryTest : UmbracoIntegrationTest { private IDataValueEditorFactory DataValueEditorFactory => GetRequiredService(); private IDataTypeService DataTypeService => GetRequiredService(); 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 b312e95b30..cb3414ad3a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DictionaryRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DictionaryRepositoryTest.cs @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DictionaryRepositoryTest : UmbracoIntegrationTest +internal sealed class DictionaryRepositoryTest : UmbracoIntegrationTest { [SetUp] public async Task SetUp() => await CreateTestData(); 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 e6ce8d467e..5b63a7271d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentRepositoryTest.cs @@ -31,7 +31,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DocumentRepositoryTest : UmbracoIntegrationTest +internal sealed class DocumentRepositoryTest : UmbracoIntegrationTest { [SetUp] public void SetUpData() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentVersionRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentVersionRepositoryTest.cs index fa4d95fd3f..d818c08b39 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentVersionRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DocumentVersionRepositoryTest.cs @@ -18,7 +18,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DocumentVersionRepositoryTest : UmbracoIntegrationTest +internal sealed class DocumentVersionRepositoryTest : UmbracoIntegrationTest { public IFileService FileService => GetRequiredService(); public IContentTypeService ContentTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DomainRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DomainRepositoryTest.cs index 262ba5dabc..e0885097af 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DomainRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/DomainRepositoryTest.cs @@ -20,7 +20,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DomainRepositoryTest : UmbracoIntegrationTest +internal sealed class DomainRepositoryTest : UmbracoIntegrationTest { private ILanguageRepository LanguageRepository => GetRequiredService(); 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 86b0363050..ea10317168 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/EntityRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/EntityRepositoryTest.cs @@ -20,7 +20,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Mapper = true, Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class EntityRepositoryTest : UmbracoIntegrationTest +internal sealed class EntityRepositoryTest : UmbracoIntegrationTest { [Test] [LongRunning] 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 6fc43e2f63..f860c11c7e 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/KeyValueRepositoryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/KeyValueRepositoryTests.cs @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class KeyValueRepositoryTests : UmbracoIntegrationTest +internal sealed class KeyValueRepositoryTests : UmbracoIntegrationTest { [Test] public void CanSetAndGet() 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 6527a5309e..676a74fe40 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/LanguageRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/LanguageRepositoryTest.cs @@ -19,7 +19,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class LanguageRepositoryTest : UmbracoIntegrationTest +internal sealed class LanguageRepositoryTest : UmbracoIntegrationTest { [SetUp] public void SetUp() => CreateTestData(); 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 932be80a01..213d6f804a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaRepositoryTest.cs @@ -26,7 +26,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class MediaRepositoryTest : UmbracoIntegrationTest +internal sealed class MediaRepositoryTest : UmbracoIntegrationTest { [SetUp] public void SetUpTestData() => CreateTestData(); 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 70a7ca2dbc..34a9245636 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaTypeRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MediaTypeRepositoryTest.cs @@ -19,7 +19,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class MediaTypeRepositoryTest : UmbracoIntegrationTest +internal sealed class MediaTypeRepositoryTest : UmbracoIntegrationTest { private IContentTypeCommonRepository CommonRepository => GetRequiredService(); 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 58dc4bb4b0..9f1a190284 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MemberRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MemberRepositoryTest.cs @@ -32,7 +32,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class MemberRepositoryTest : UmbracoIntegrationTest +internal sealed class MemberRepositoryTest : UmbracoIntegrationTest { private IPasswordHasher PasswordHasher => GetRequiredService(); 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 27d0cce985..0c1f071239 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MemberTypeRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/MemberTypeRepositoryTest.cs @@ -20,7 +20,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class MemberTypeRepositoryTest : UmbracoIntegrationTest +internal sealed class MemberTypeRepositoryTest : UmbracoIntegrationTest { private MemberTypeRepository CreateRepository(IScopeProvider provider) { 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 566dac5f40..9a491b3a64 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/NotificationsRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/NotificationsRepositoryTest.cs @@ -18,7 +18,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class NotificationsRepositoryTest : UmbracoIntegrationTest +internal sealed class NotificationsRepositoryTest : UmbracoIntegrationTest { [Test] public void CreateNotification() 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 60b1833360..9bf01f0daa 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PartialViewRepositoryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PartialViewRepositoryTests.cs @@ -18,7 +18,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.None)] -public class PartialViewRepositoryTests : UmbracoIntegrationTest +internal sealed class PartialViewRepositoryTests : UmbracoIntegrationTest { [SetUp] public void SetUp() => 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 0de919eac8..75d18639d3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PublicAccessRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/PublicAccessRepositoryTest.cs @@ -19,7 +19,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class PublicAccessRepositoryTest : UmbracoIntegrationTest +internal sealed class PublicAccessRepositoryTest : UmbracoIntegrationTest { private IContentTypeRepository ContentTypeRepository => GetRequiredService(); 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 db082a5d2c..f1cf2548a7 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RedirectUrlRepositoryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RedirectUrlRepositoryTests.cs @@ -17,7 +17,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class RedirectUrlRepositoryTests : UmbracoIntegrationTest +internal sealed class RedirectUrlRepositoryTests : UmbracoIntegrationTest { [SetUp] public void SetUp() => CreateTestData(); 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 def5d3cafc..c32b0be6a4 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RelationRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RelationRepositoryTest.cs @@ -22,7 +22,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class RelationRepositoryTest : UmbracoIntegrationTest +internal sealed class RelationRepositoryTest : UmbracoIntegrationTest { [SetUp] public void SetUp() => CreateTestData(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RelationTypeRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RelationTypeRepositoryTest.cs index 2fbf06bb6c..72b81aa1ba 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RelationTypeRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/RelationTypeRepositoryTest.cs @@ -17,7 +17,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class RelationTypeRepositoryTest : UmbracoIntegrationTest +internal sealed class RelationTypeRepositoryTest : UmbracoIntegrationTest { [SetUp] public void SetUp() => CreateTestData(); 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 4c9cd11394..81792f6ca2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ScriptRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ScriptRepositoryTest.cs @@ -21,7 +21,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.None)] -public class ScriptRepositoryTest : UmbracoIntegrationTest +internal sealed class ScriptRepositoryTest : UmbracoIntegrationTest { [SetUp] public void SetUpFileSystem() 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 05b81cacf7..2e23b703ca 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ServerRegistrationRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/ServerRegistrationRepositoryTest.cs @@ -16,7 +16,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class ServerRegistrationRepositoryTest : UmbracoIntegrationTest +internal sealed class ServerRegistrationRepositoryTest : UmbracoIntegrationTest { [SetUp] public void SetUp() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/SimilarNodeNameTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/SimilarNodeNameTests.cs index 573e018219..314c291dc4 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/SimilarNodeNameTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/SimilarNodeNameTests.cs @@ -7,7 +7,7 @@ using Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement; namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repositories; [TestFixture] -public class SimilarNodeNameTests +internal sealed class SimilarNodeNameTests { public void Name_Is_Suffixed() { 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 e5baca9776..8304b8a12d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/StylesheetRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/StylesheetRepositoryTest.cs @@ -22,7 +22,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.None, Logger = UmbracoTestOptions.Logger.Console)] -public class StylesheetRepositoryTest : UmbracoIntegrationTest +internal sealed class StylesheetRepositoryTest : UmbracoIntegrationTest { [SetUp] public void SetUpFileSystem() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TagRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TagRepositoryTest.cs index 297bd50699..0d2dd06524 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TagRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TagRepositoryTest.cs @@ -1,12 +1,12 @@ // Copyright (c) Umbraco. // See LICENSE for more details. -using System.Linq; using Microsoft.Extensions.Logging; using NUnit.Framework; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Persistence.Repositories; +using Umbraco.Cms.Core.PropertyEditors; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement; using Umbraco.Cms.Infrastructure.Scoping; @@ -18,7 +18,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class TagRepositoryTest : UmbracoIntegrationTest +internal sealed class TagRepositoryTest : UmbracoIntegrationTest { private IFileService FileService => GetRequiredService(); @@ -651,12 +651,12 @@ public class TagRepositoryTest : UmbracoIntegrationTest ContentTypeRepository.Save(contentType); var content1 = ContentBuilder.CreateSimpleContent(contentType); - content1.PublishCulture(CultureImpact.Invariant); + content1.PublishCulture(CultureImpact.Invariant, DateTime.Now, GetRequiredService()); content1.PublishedState = PublishedState.Publishing; DocumentRepository.Save(content1); var content2 = ContentBuilder.CreateSimpleContent(contentType); - content2.PublishCulture(CultureImpact.Invariant); + content2.PublishCulture(CultureImpact.Invariant, DateTime.Now, GetRequiredService()); content2.PublishedState = PublishedState.Publishing; content2.Trashed = true; DocumentRepository.Save(content2); 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 8e4a68af70..b3a8dfa119 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TemplateRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/TemplateRepositoryTest.cs @@ -32,7 +32,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class TemplateRepositoryTest : UmbracoIntegrationTest +internal sealed class TemplateRepositoryTest : UmbracoIntegrationTest { [TearDown] public void TearDown() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/UserGroupRepositoryTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/UserGroupRepositoryTest.cs index 1a7ec16d25..de0c418570 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/UserGroupRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/UserGroupRepositoryTest.cs @@ -18,7 +18,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class UserGroupRepositoryTest : UmbracoIntegrationTest +internal sealed class UserGroupRepositoryTest : UmbracoIntegrationTest { private IEnumerable PermissionMappers => GetRequiredService>(); 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 8cd5b9ae71..96575a67e7 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/UserRepositoryTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/Repositories/UserRepositoryTest.cs @@ -13,6 +13,7 @@ using Umbraco.Cms.Core.Models.Membership; using Umbraco.Cms.Core.Persistence.Repositories; using Umbraco.Cms.Core.Scoping; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Infrastructure.Migrations.Install; using Umbraco.Cms.Infrastructure.Persistence; using Umbraco.Cms.Infrastructure.Persistence.Dtos; using Umbraco.Cms.Infrastructure.Persistence.Mappers; @@ -29,7 +30,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.Repos [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, WithApplication = true, Logger = UmbracoTestOptions.Logger.Console)] -public class UserRepositoryTest : UmbracoIntegrationTest +internal sealed class UserRepositoryTest : UmbracoIntegrationTest { private IDocumentRepository DocumentRepository => GetRequiredService(); @@ -326,7 +327,7 @@ public class UserRepositoryTest : UmbracoIntegrationTest out var totalRecs, user => user.Id, Direction.Ascending, - excludeUserGroups: new[] { Constants.Security.TranslatorGroupAlias }, + excludeUserGroups: new[] { DatabaseDataCreator.TranslatorGroupAlias }, filter: provider.CreateQuery().Where(x => x.Id > -1)); // Assert @@ -363,8 +364,8 @@ public class UserRepositoryTest : UmbracoIntegrationTest out var totalRecs, user => user.Id, Direction.Ascending, - new[] { Constants.Security.AdminGroupAlias, Constants.Security.SensitiveDataGroupAlias }, - new[] { Constants.Security.TranslatorGroupAlias }, + new[] { Constants.Security.AdminGroupAlias, DatabaseDataCreator.SensitiveDataGroupAlias }, + new[] { DatabaseDataCreator.TranslatorGroupAlias }, filter: provider.CreateQuery().Where(x => x.Id == -1)); // Assert diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/SchemaValidationTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/SchemaValidationTest.cs index 12b0194e75..dd6cfb6c49 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/SchemaValidationTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/SchemaValidationTest.cs @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewEmptyPerTest)] -public class SchemaValidationTest : UmbracoIntegrationTest +internal sealed class SchemaValidationTest : UmbracoIntegrationTest { private IUmbracoVersion UmbracoVersion => GetRequiredService(); 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 3d419ff955..d4ad005b85 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/SyntaxProvider/SqlServerSyntaxProviderTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/SyntaxProvider/SqlServerSyntaxProviderTests.cs @@ -22,7 +22,7 @@ using Umbraco.Cms.Tests.Integration.Testing; namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence.SyntaxProvider; [TestFixture] -public class SqlServerSyntaxProviderTests : UmbracoIntegrationTest +internal sealed class SqlServerSyntaxProviderTests : UmbracoIntegrationTest { private ISqlContext SqlContext => GetRequiredService().SqlContext; private SqlServerSyntaxProvider GetSqlSyntax() => new(Options.Create(new GlobalSettings())); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/UnitOfWorkTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/UnitOfWorkTests.cs index f14661a976..9db375dee9 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/UnitOfWorkTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/UnitOfWorkTests.cs @@ -12,7 +12,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Persistence; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class UnitOfWorkTests : UmbracoIntegrationTest +internal sealed class UnitOfWorkTests : UmbracoIntegrationTest { [Test] public void ReadLockNonExisting() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockEditorBackwardsCompatibilityTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockEditorBackwardsCompatibilityTests.cs index 54970be556..601c8d4ebe 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockEditorBackwardsCompatibilityTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockEditorBackwardsCompatibilityTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Blocks; @@ -14,7 +14,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.PropertyEditors; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -internal class BlockEditorBackwardsCompatibilityTests : UmbracoIntegrationTest +internal sealed class BlockEditorBackwardsCompatibilityTests : UmbracoIntegrationTest { private IContentTypeService ContentTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockGridElementLevelVariationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockGridElementLevelVariationTests.cs index 07271391cc..bed4999995 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockGridElementLevelVariationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockGridElementLevelVariationTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Blocks; @@ -12,7 +12,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.PropertyEditors; // NOTE: These tests are in place to ensure that element level variation works for Block Grid. Element level variation // is tested more in-depth for Block List (see BlockListElementLevelVariationTests), but since the actual // implementation is shared between Block List and Block Grid, we won't repeat all those tests here. -internal class BlockGridElementLevelVariationTests : BlockEditorElementVariationTestBase +internal sealed class BlockGridElementLevelVariationTests : BlockEditorElementVariationTestBase { private IJsonSerializer JsonSerializer => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockListElementLevelVariationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockListElementLevelVariationTests.cs index b436d7f17c..37da73be28 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockListElementLevelVariationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockListElementLevelVariationTests.cs @@ -12,7 +12,7 @@ using Umbraco.Cms.Tests.Common.Builders.Extensions; namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.PropertyEditors; -internal partial class BlockListElementLevelVariationTests : BlockEditorElementVariationTestBase +internal sealed partial class BlockListElementLevelVariationTests : BlockEditorElementVariationTestBase { public static new void ConfigureAllowEditInvariantFromNonDefaultTrue(IUmbracoBuilder builder) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditorTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditorTests.cs index e892fc2b63..18ef8f1bbd 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditorTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockListPropertyEditorTests.cs @@ -14,7 +14,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.PropertyEditors; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -internal class BlockListPropertyEditorTests : UmbracoIntegrationTest +internal sealed class BlockListPropertyEditorTests : UmbracoIntegrationTest { private IContentTypeService ContentTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/PropertyIndexValueFactoryTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/PropertyIndexValueFactoryTests.cs index 3dbc0f2b15..bc0e43f3e5 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/PropertyIndexValueFactoryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/PropertyIndexValueFactoryTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Blocks; @@ -14,7 +14,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.PropertyEditors; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -internal class PropertyIndexValueFactoryTests : UmbracoIntegrationTest +internal sealed class PropertyIndexValueFactoryTests : UmbracoIntegrationTest { private IContentTypeService ContentTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImagesTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImagesTests.cs index 0b3e0afe67..6401a9c654 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImagesTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImagesTests.cs @@ -1,4 +1,4 @@ -using System.Text; +using System.Text; using HtmlAgilityPack; using Microsoft.Extensions.DependencyInjection; using Moq; @@ -18,7 +18,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.PropertyEditors; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -internal class RichTextEditorPastedImagesTests : UmbracoIntegrationTest +internal sealed class RichTextEditorPastedImagesTests : UmbracoIntegrationTest { private static readonly Guid GifFileKey = Guid.Parse("E625C7FA-6CA7-4A01-92CD-FB5C6F89973D"); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextElementLevelVariationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextElementLevelVariationTests.cs index a83f3b7735..d758cea18a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextElementLevelVariationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextElementLevelVariationTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Blocks; @@ -14,7 +14,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.PropertyEditors; // NOTE: These tests are in place to ensure that element level variation works for Rich Text. Element level variation // is tested more in-depth for Block List (see BlockListElementLevelVariationTests), but since the actual // implementation is shared between Block List and Rich Text, we won't repeat all those tests here. -internal class RichTextElementLevelVariationTests : BlockEditorElementVariationTestBase +internal sealed class RichTextElementLevelVariationTests : BlockEditorElementVariationTestBase { private IJsonSerializer JsonSerializer => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditorTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditorTests.cs index 08ef02f75a..5bffee22aa 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditorTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditorTests.cs @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.PropertyEditors; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -internal class RichTextPropertyEditorTests : UmbracoIntegrationTest +internal sealed class RichTextPropertyEditorTests : UmbracoIntegrationTest { private IContentTypeService ContentTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Runtime/FileSystemMainDomLockTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Runtime/FileSystemMainDomLockTests.cs index febc8f1e68..1b53c6316c 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Runtime/FileSystemMainDomLockTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Runtime/FileSystemMainDomLockTests.cs @@ -15,7 +15,7 @@ using Umbraco.Cms.Tests.Integration.Testing; namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Runtime; [TestFixture] -internal class FileSystemMainDomLockTests : UmbracoIntegrationTest +internal sealed class FileSystemMainDomLockTests : UmbracoIntegrationTest { [SetUp] public void SetUp() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/LegacyScopeProviderTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/LegacyScopeProviderTests.cs index dc12ed9dc7..fd1cc9e9b7 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/LegacyScopeProviderTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/LegacyScopeProviderTests.cs @@ -7,7 +7,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Scoping; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)] -public class LegacyScopeProviderTests : UmbracoIntegrationTest +internal sealed class LegacyScopeProviderTests : UmbracoIntegrationTest { [Test] public void CreateScope_Always_ReturnsLegacyIScope() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeFileSystemsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeFileSystemsTests.cs index 89ce8389cd..dfb0a8308d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeFileSystemsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeFileSystemsTests.cs @@ -20,7 +20,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Scoping; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewEmptyPerTest)] -public class ScopeFileSystemsTests : UmbracoIntegrationTest +internal sealed class ScopeFileSystemsTests : UmbracoIntegrationTest { [SetUp] public void SetUp() => ClearFiles(IOHelper); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeTests.cs index 00425a9cfe..d1bcb39684 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopeTests.cs @@ -22,7 +22,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Scoping { [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewEmptyPerFixture)] - public class ScopeTests : UmbracoIntegrationTest + internal sealed class ScopeTests : UmbracoIntegrationTest { private new ScopeProvider ScopeProvider => (ScopeProvider)base.ScopeProvider; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedNuCacheTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedNuCacheTests.cs index 7c9d234c16..3e05d58a8b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedNuCacheTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedNuCacheTests.cs @@ -21,7 +21,7 @@ namespace Umbraco.Tests.Scoping; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class ScopedNuCacheTests : UmbracoIntegrationTest +internal sealed class ScopedNuCacheTests : UmbracoIntegrationTest { private IContentService ContentService => GetRequiredService(); private Mock MockHttpContextAccessor { get; } = CreateMockHttpContextAccessor(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedRepositoryTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedRepositoryTests.cs index 833746d5f8..e7fb41baad 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedRepositoryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/ScopedRepositoryTests.cs @@ -21,7 +21,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Scoping; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class ScopedRepositoryTests : UmbracoIntegrationTest +internal sealed class ScopedRepositoryTests : UmbracoIntegrationTest { private IUserService UserService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/SuppressNotificationsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/SuppressNotificationsTests.cs index f85564bc46..7a51248e36 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/SuppressNotificationsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Scoping/SuppressNotificationsTests.cs @@ -14,7 +14,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Scoping; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class SuppressNotificationsTests : UmbracoIntegrationTest +internal sealed class SuppressNotificationsTests : UmbracoIntegrationTest { private IContentService ContentService => GetRequiredService(); private IContentTypeService ContentTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Security/BackOfficeUserStoreTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Security/BackOfficeUserStoreTests.cs index d0ac96abd7..4d88c26939 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Security/BackOfficeUserStoreTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Security/BackOfficeUserStoreTests.cs @@ -18,7 +18,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Security; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class BackOfficeUserStoreTests : UmbracoIntegrationTest +internal sealed class BackOfficeUserStoreTests : UmbracoIntegrationTest { private IEntityService EntityService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/AuditServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/AuditServiceTests.cs index f0e994f683..21f663a439 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/AuditServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/AuditServiceTests.cs @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class AuditServiceTests : UmbracoIntegrationTest +internal sealed class AuditServiceTests : UmbracoIntegrationTest { [Test] public void GetPage() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/CacheInstructionServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/CacheInstructionServiceTests.cs index 6e60c67a1f..7759874b8a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/CacheInstructionServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/CacheInstructionServiceTests.cs @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class CacheInstructionServiceTests : UmbracoIntegrationTest +internal sealed class CacheInstructionServiceTests : UmbracoIntegrationTest { private const string LocalIdentity = "localIdentity"; private const string AlternateIdentity = "alternateIdentity"; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/CachedDataTypeServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/CachedDataTypeServiceTests.cs index e04d68cb58..e174686087 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/CachedDataTypeServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/CachedDataTypeServiceTests.cs @@ -16,7 +16,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class CachedDataTypeServiceTests : UmbracoIntegrationTest +internal sealed class CachedDataTypeServiceTests : UmbracoIntegrationTest { private IDataValueEditorFactory DataValueEditorFactory => GetRequiredService(); private IDataTypeService DataTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ConsentServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ConsentServiceTests.cs index 9e6d7f883a..eb745f72ae 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ConsentServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ConsentServiceTests.cs @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)] -public class ConsentServiceTests : UmbracoIntegrationTest +internal sealed class ConsentServiceTests : UmbracoIntegrationTest { private IConsentService ConsentService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentBlueprintContainerServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentBlueprintContainerServiceTests.cs index c78c0b0612..ce1300fd14 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentBlueprintContainerServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentBlueprintContainerServiceTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.PropertyEditors; @@ -12,7 +12,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class ContentBlueprintContainerServiceTests : UmbracoIntegrationTest +internal sealed class ContentBlueprintContainerServiceTests : UmbracoIntegrationTest { private IContentBlueprintContainerService ContentBlueprintContainerService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs index 9ed8c37f15..4b35534de0 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentEventsTests.cs @@ -24,7 +24,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services { [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] - public class ContentEventsTests : UmbracoIntegrationTestWithContent + internal sealed class ContentEventsTests : UmbracoIntegrationTestWithContent { private CacheRefresherCollection CacheRefresherCollection => GetRequiredService(); @@ -2086,7 +2086,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services // all content type events #endregion - public class LocalServerMessenger : ServerMessengerBase + internal sealed class LocalServerMessenger : ServerMessengerBase { public LocalServerMessenger() : base(false, new SystemTextJsonSerializer()) diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentListViewServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentListViewServiceTests.cs index 68a8ee0e11..badcd49917 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentListViewServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentListViewServiceTests.cs @@ -11,7 +11,7 @@ using Umbraco.Cms.Tests.Common.Builders.Extensions; namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; -public class ContentListViewServiceTests : ContentListViewServiceTestsBase +internal sealed class ContentListViewServiceTests : ContentListViewServiceTestsBase { private static readonly Guid CustomListViewKey = new("AD8E2AAF-6801-408A-8CCF-EFAC0312729B"); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs index a36c08bebd..8e4bf6ffef 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceNotificationTests.cs @@ -23,7 +23,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; PublishedRepositoryEvents = true, WithApplication = true, Logger = UmbracoTestOptions.Logger.Console)] -public class ContentServiceNotificationTests : UmbracoIntegrationTest +internal sealed class ContentServiceNotificationTests : UmbracoIntegrationTest { [SetUp] public void SetupTest() @@ -544,7 +544,7 @@ public class ContentServiceNotificationTests : UmbracoIntegrationTest Assert.IsTrue(document.IsCulturePublished("en-US")); } - public class ContentNotificationHandler : + internal sealed class ContentNotificationHandler : INotificationHandler, INotificationHandler, INotificationHandler, diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePerformanceTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePerformanceTest.cs index bca229cbd9..7547e5c524 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePerformanceTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePerformanceTest.cs @@ -23,7 +23,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class ContentServicePerformanceTest : UmbracoIntegrationTest +internal sealed class ContentServicePerformanceTest : UmbracoIntegrationTest { [SetUp] public void SetUpData() => CreateTestData(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs index eeb67fab8d..1d5dddc0f3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServicePublishBranchTests.cs @@ -16,7 +16,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true, WithApplication = true)] -public class ContentServicePublishBranchTests : UmbracoIntegrationTest +internal sealed class ContentServicePublishBranchTests : UmbracoIntegrationTest { private IContentService ContentService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs index 33ce4b3ff2..29b79343b7 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs @@ -23,7 +23,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; PublishedRepositoryEvents = true, WithApplication = true, Logger = UmbracoTestOptions.Logger.Console)] -public class ContentServiceTagsTests : UmbracoIntegrationTest +internal sealed class ContentServiceTagsTests : UmbracoIntegrationTest { [SetUp] public void Setup() => ContentRepositoryBase.ThrowOnWarning = true; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeContainerServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeContainerServiceTests.cs index 1a5f7a2dad..4f21cc877f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeContainerServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeContainerServiceTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class ContentTypeContainerServiceTests : UmbracoIntegrationTest +internal sealed class ContentTypeContainerServiceTests : UmbracoIntegrationTest { private IContentTypeContainerService ContentTypeContainerService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs index a4246e7586..41064377a7 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceTests.cs @@ -21,7 +21,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true)] -public class ContentTypeServiceTests : UmbracoIntegrationTest +internal sealed class ContentTypeServiceTests : UmbracoIntegrationTest { private IFileService FileService => GetRequiredService(); @@ -2101,7 +2101,7 @@ public class ContentTypeServiceTests : UmbracoIntegrationTest return list.ToArray(); } - public class ContentNotificationHandler : INotificationHandler + internal sealed class ContentNotificationHandler : INotificationHandler { public static Action MovedContentToRecycleBin { get; set; } @@ -2109,7 +2109,7 @@ public class ContentTypeServiceTests : UmbracoIntegrationTest MovedContentToRecycleBin?.Invoke(notification); } - public class ContentTypeNotificationHandler : INotificationHandler + internal sealed class ContentTypeNotificationHandler : INotificationHandler { public static Action Deleted { get; set; } public void Handle(ContentTypeDeletedNotification notification) => Deleted?.Invoke(notification); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs index ebe6147156..d1c7ef22d6 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentTypeServiceVariantsTests.cs @@ -21,7 +21,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true)] -public class ContentTypeServiceVariantsTests : UmbracoIntegrationTest +internal sealed class ContentTypeServiceVariantsTests : UmbracoIntegrationTest { private ISqlContext SqlContext => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentValidationServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentValidationServiceTests.cs index 5640afeae2..413b30010a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentValidationServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentValidationServiceTests.cs @@ -17,7 +17,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true, WithApplication = true)] -public class ContentValidationServiceTests : UmbracoIntegrationTestWithContent +internal sealed class ContentValidationServiceTests : UmbracoIntegrationTestWithContent { private IContentValidationService ContentValidationService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DataTypeContainerServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DataTypeContainerServiceTests.cs index 02e3b82912..c5fe3408ef 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DataTypeContainerServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DataTypeContainerServiceTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.PropertyEditors; @@ -16,7 +16,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DataTypeContainerServiceTests : UmbracoIntegrationTest +internal sealed class DataTypeContainerServiceTests : UmbracoIntegrationTest { private IDataTypeContainerService DataTypeContainerService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DataTypeServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DataTypeServiceTests.cs index 1c2b46137b..8cb866bcdd 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DataTypeServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DataTypeServiceTests.cs @@ -20,7 +20,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DataTypeServiceTests : UmbracoIntegrationTest +internal sealed class DataTypeServiceTests : UmbracoIntegrationTest { private IDataValueEditorFactory DataValueEditorFactory => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DictionaryItemServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DictionaryItemServiceTests.cs index 0ee0f7ce6d..e22ec36a5f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DictionaryItemServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/DictionaryItemServiceTests.cs @@ -14,7 +14,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DictionaryItemServiceTests : UmbracoIntegrationTest +internal sealed class DictionaryItemServiceTests : UmbracoIntegrationTest { private Guid _parentItemId; private Guid _childItemId; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs index d18caf52b4..2c4a44252f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityServiceTests.cs @@ -22,7 +22,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerFixture)] -public class EntityServiceTests : UmbracoIntegrationTest +internal sealed class EntityServiceTests : UmbracoIntegrationTest { [SetUp] public async Task SetupTestData() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityXmlSerializerTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityXmlSerializerTests.cs index 8e68d4d3e2..d404268c3b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityXmlSerializerTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/EntityXmlSerializerTests.cs @@ -30,7 +30,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class EntityXmlSerializerTests : UmbracoIntegrationTest +internal sealed class EntityXmlSerializerTests : UmbracoIntegrationTest { private IEntityXmlSerializer Serializer => GetRequiredService(); private IContentService ContentService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ExternalLoginServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ExternalLoginServiceTests.cs index c82657b980..70f0d4abbb 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ExternalLoginServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ExternalLoginServiceTests.cs @@ -14,7 +14,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class ExternalLoginServiceTests : UmbracoIntegrationTest +internal sealed class ExternalLoginServiceTests : UmbracoIntegrationTest { private IUserService UserService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/FileServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/FileServiceTests.cs index 3f90a12d3a..74d1c27fb3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/FileServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/FileServiceTests.cs @@ -12,7 +12,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class FileServiceTests : UmbracoIntegrationTest +internal sealed class FileServiceTests : UmbracoIntegrationTest { private IFileService FileService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/KeyValueServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/KeyValueServiceTests.cs index b82eccc49e..6150b51779 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/KeyValueServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/KeyValueServiceTests.cs @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class KeyValueServiceTests : UmbracoIntegrationTest +internal sealed class KeyValueServiceTests : UmbracoIntegrationTest { private IKeyValueService KeyValueService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LanguageServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LanguageServiceTests.cs index b04dcdb379..faf23ace24 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LanguageServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LanguageServiceTests.cs @@ -12,7 +12,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class LanguageServiceTests : UmbracoIntegrationTest +internal sealed class LanguageServiceTests : UmbracoIntegrationTest { private ILanguageService LanguageService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LocalizationServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LocalizationServiceTests.cs index 41fce99e95..12ac27c652 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LocalizationServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/LocalizationServiceTests.cs @@ -22,7 +22,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class LocalizationServiceTests : UmbracoIntegrationTest +internal sealed class LocalizationServiceTests : UmbracoIntegrationTest { [SetUp] public void SetUp() => CreateTestData(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaListViewServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaListViewServiceTests.cs index 9868a507d0..c5c1b79d7a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaListViewServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaListViewServiceTests.cs @@ -14,7 +14,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; /// Tests for the media list view service. Please notice that a lot of functional test is covered by the content list /// view service tests, since these services share the same base implementation. /// -public class MediaListViewServiceTests : ContentListViewServiceTestsBase +internal sealed class MediaListViewServiceTests : ContentListViewServiceTestsBase { private IMediaListViewService MediaListViewService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaServiceTests.cs index b20075925d..75b0a7ed75 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaServiceTests.cs @@ -16,7 +16,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true)] -public class MediaServiceTests : UmbracoIntegrationTest +internal sealed class MediaServiceTests : UmbracoIntegrationTest { private IMediaService MediaService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeContainerServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeContainerServiceTests.cs index c2720019c8..e7d14fd7c3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeContainerServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeContainerServiceTests.cs @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class MediaTypeContainerServiceTests : UmbracoIntegrationTest +internal sealed class MediaTypeContainerServiceTests : UmbracoIntegrationTest { private IMediaTypeContainerService MediaTypeContainerService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeServiceTests.cs index a35a7db908..aa26e3b86b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaTypeServiceTests.cs @@ -16,7 +16,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true)] -public class MediaTypeServiceTests : UmbracoIntegrationTest +internal sealed class MediaTypeServiceTests : UmbracoIntegrationTest { private MediaService MediaService => (MediaService)GetRequiredService(); @@ -252,7 +252,7 @@ public class MediaTypeServiceTests : UmbracoIntegrationTest Assert.Throws(() => mediaType.Alias += "_updated"); } - public class ContentNotificationHandler : + internal sealed class ContentNotificationHandler : INotificationHandler { public static Action MovedMediaToRecycleBin { get; set; } diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberEditingServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberEditingServiceTests.cs index 0727f9c0ad..eef47821f9 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberEditingServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberEditingServiceTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentEditing; @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [Category("Slow")] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class MemberEditingServiceTests : UmbracoIntegrationTest +internal sealed class MemberEditingServiceTests : UmbracoIntegrationTest { private IMemberEditingService MemberEditingService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberServiceTests.cs index 19a2241e57..ce382ecf6c 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberServiceTests.cs @@ -19,7 +19,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [Category("Slow")] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true, WithApplication = true)] -public class MemberServiceTests : UmbracoIntegrationTest +internal sealed class MemberServiceTests : UmbracoIntegrationTest { private IMemberTypeService MemberTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberTypeServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberTypeServiceTests.cs index 342886d3ed..7c3995eea8 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberTypeServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MemberTypeServiceTests.cs @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true, WithApplication = true)] -public class MemberTypeServiceTests : UmbracoIntegrationTest +internal sealed class MemberTypeServiceTests : UmbracoIntegrationTest { private IMemberService MemberService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/NuCacheRebuildTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/NuCacheRebuildTests.cs index 5d1c434a45..842201b2b2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/NuCacheRebuildTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/NuCacheRebuildTests.cs @@ -13,7 +13,7 @@ // [TestFixture] // [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, PublishedRepositoryEvents = true, // WithApplication = true)] -// public class NuCacheRebuildTests : UmbracoIntegrationTest +// internal sealed class NuCacheRebuildTests : UmbracoIntegrationTest // { // private IFileService FileService => GetRequiredService(); // diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/PublicAccessServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/PublicAccessServiceTests.cs index 9841165509..0ebfbe1748 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/PublicAccessServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/PublicAccessServiceTests.cs @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class PublicAccessServiceTests : UmbracoIntegrationTest +internal sealed class PublicAccessServiceTests : UmbracoIntegrationTest { [SetUp] public void CreateTestData() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RedirectUrlServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RedirectUrlServiceTests.cs index 1d31815bef..4fa34ee982 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RedirectUrlServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RedirectUrlServiceTests.cs @@ -19,7 +19,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class RedirectUrlServiceTests : UmbracoIntegrationTestWithContent +internal sealed class RedirectUrlServiceTests : UmbracoIntegrationTestWithContent { private IContent _firstSubPage; private IContent _secondSubPage; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RelationServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RelationServiceTests.cs index 06c39098ee..951b6ecd2d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RelationServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/RelationServiceTests.cs @@ -16,7 +16,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class RelationServiceTests : UmbracoIntegrationTest +internal sealed class RelationServiceTests : UmbracoIntegrationTest { private IContentTypeService ContentTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TagServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TagServiceTests.cs index 266586a474..5e3d5aedbc 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TagServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TagServiceTests.cs @@ -20,7 +20,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class TagServiceTests : UmbracoIntegrationTest +internal sealed class TagServiceTests : UmbracoIntegrationTest { [SetUp] public void CreateTestData() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TemplateServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TemplateServiceTests.cs index b5a5a42dca..859244ac8b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TemplateServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TemplateServiceTests.cs @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class TemplateServiceTests : UmbracoIntegrationTest +internal sealed class TemplateServiceTests : UmbracoIntegrationTest { private ITemplateService TemplateService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ThreadSafetyServiceTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ThreadSafetyServiceTest.cs index 72c046ef36..c5334919e3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ThreadSafetyServiceTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ThreadSafetyServiceTest.cs @@ -32,7 +32,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services // causing it, getting into __sysObjects locks, no idea why [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Logger = UmbracoTestOptions.Logger.Console)] - public class ThreadSafetyServiceTest : UmbracoIntegrationTest + internal sealed class ThreadSafetyServiceTest : UmbracoIntegrationTest { private IContentService ContentService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TrackRelationsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TrackRelationsTests.cs index f992aa57b1..2a9fde92e1 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TrackRelationsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TrackRelationsTests.cs @@ -17,7 +17,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; PublishedRepositoryEvents = true, WithApplication = true, Boot = true)] -public class TrackRelationsTests : UmbracoIntegrationTestWithContent +internal sealed class TrackRelationsTests : UmbracoIntegrationTestWithContent { private IMediaTypeService MediaTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TrackedReferencesServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TrackedReferencesServiceTests.cs index 27517e23dd..b033345576 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TrackedReferencesServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/TrackedReferencesServiceTests.cs @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class TrackedReferencesServiceTests : UmbracoIntegrationTest +internal class TrackedReferencesServiceTests : UmbracoIntegrationTest { private IContentTypeService ContentTypeService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/UserIdKeyResolverTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/UserIdKeyResolverTests.cs index e66d4414a4..f2ca4fd818 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/UserIdKeyResolverTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/UserIdKeyResolverTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Membership; @@ -10,7 +10,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class UserIdKeyResolverTests : UmbracoIntegrationTest +internal sealed class UserIdKeyResolverTests : UmbracoIntegrationTest { private IUserService UserService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/UserServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/UserServiceTests.cs index 755b17d1c3..d5ef54ece6 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/UserServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/UserServiceTests.cs @@ -23,10 +23,12 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services; /// [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class UserServiceTests : UmbracoIntegrationTest +internal sealed class UserServiceTests : UmbracoIntegrationTest { private UserService UserService => (UserService)GetRequiredService(); + private IUserGroupService UserGroupService => GetRequiredService(); + private IContentTypeService ContentTypeService => GetRequiredService(); private IFileService FileService => GetRequiredService(); @@ -34,15 +36,15 @@ public class UserServiceTests : UmbracoIntegrationTest private IContentService ContentService => GetRequiredService(); [Test] - public void Get_User_Permissions_For_Unassigned_Permission_Nodes() + public async Task Get_User_Permissions_For_Unassigned_Permission_Nodes() { // Arrange - var user = CreateTestUser(out _); + var (user, _) = await CreateTestUserAndGroup(); var template = TemplateBuilder.CreateTextPageTemplate(); FileService.SaveTemplate(template); var contentType = ContentTypeBuilder.CreateSimpleContentType(defaultTemplateId: template.Id); - ContentTypeService.Save(contentType); + await ContentTypeService.UpdateAsync(contentType, Constants.Security.SuperUserKey); Content[] content = { @@ -62,15 +64,15 @@ public class UserServiceTests : UmbracoIntegrationTest } [Test] - public void Get_User_Permissions_For_Assigned_Permission_Nodes() + public async Task Get_User_Permissions_For_Assigned_Permission_Nodes() { // Arrange - var user = CreateTestUser(out var userGroup); + var (user, userGroup) = await CreateTestUserAndGroup(); var template = TemplateBuilder.CreateTextPageTemplate(); FileService.SaveTemplate(template); var contentType = ContentTypeBuilder.CreateSimpleContentType(defaultTemplateId: template.Id); - ContentTypeService.Save(contentType); + await ContentTypeService.UpdateAsync(contentType, Constants.Security.SuperUserKey); Content[] content = { @@ -96,15 +98,15 @@ public class UserServiceTests : UmbracoIntegrationTest } [Test] - public void Get_UserGroup_Assigned_Permissions() + public async Task Get_UserGroup_Assigned_Permissions() { // Arrange - var userGroup = CreateTestUserGroup(); + var userGroup = await CreateTestUserGroup(); var template = TemplateBuilder.CreateTextPageTemplate(); FileService.SaveTemplate(template); var contentType = ContentTypeBuilder.CreateSimpleContentType(defaultTemplateId: template.Id); - ContentTypeService.Save(contentType); + await ContentTypeService.UpdateAsync(contentType, Constants.Security.SuperUserKey); Content[] content = { @@ -131,15 +133,15 @@ public class UserServiceTests : UmbracoIntegrationTest } [Test] - public void Get_UserGroup_Assigned_And_Default_Permissions() + public async Task Get_UserGroup_Assigned_And_Default_Permissions() { // Arrange - var userGroup = CreateTestUserGroup(); + var userGroup = await CreateTestUserGroup(); var template = TemplateBuilder.CreateTextPageTemplate(); FileService.SaveTemplate(template); var contentType = ContentTypeBuilder.CreateSimpleContentType(defaultTemplateId: template.Id); - ContentTypeService.Save(contentType); + await ContentTypeService.UpdateAsync(contentType, Constants.Security.SuperUserKey); Content[] content = { @@ -165,12 +167,12 @@ public class UserServiceTests : UmbracoIntegrationTest } [Test] - public void Get_All_User_Permissions_For_All_Nodes_With_Explicit_Permission() + public async Task Get_All_User_Permissions_For_All_Nodes_With_Explicit_Permission() { // Arrange - var userGroup1 = CreateTestUserGroup(); - var userGroup2 = CreateTestUserGroup("test2", "Test 2"); - var userGroup3 = CreateTestUserGroup("test3", "Test 3"); + var userGroup1 = await CreateTestUserGroup(); + var userGroup2 = await CreateTestUserGroup("test2", "Test 2"); + var userGroup3 = await CreateTestUserGroup("test3", "Test 3"); var user = UserService.CreateUserWithIdentity("John Doe", "john@umbraco.io"); var defaultPermissionCount = userGroup3.Permissions.Count(); @@ -183,7 +185,7 @@ public class UserServiceTests : UmbracoIntegrationTest var template = TemplateBuilder.CreateTextPageTemplate(); FileService.SaveTemplate(template); var contentType = ContentTypeBuilder.CreateSimpleContentType(defaultTemplateId: template.Id); - ContentTypeService.Save(contentType); + await ContentTypeService.UpdateAsync(contentType, Constants.Security.SuperUserKey); Content[] content = { @@ -257,15 +259,15 @@ public class UserServiceTests : UmbracoIntegrationTest } [Test] - public void Get_All_User_Group_Permissions_For_All_Nodes() + public async Task Get_All_User_Group_Permissions_For_All_Nodes() { // Arrange - var userGroup = CreateTestUserGroup(); + var userGroup = await CreateTestUserGroup(); var template = TemplateBuilder.CreateTextPageTemplate(); FileService.SaveTemplate(template); var contentType = ContentTypeBuilder.CreateSimpleContentType(defaultTemplateId: template.Id); - ContentTypeService.Save(contentType); + await ContentTypeService.UpdateAsync(contentType, Constants.Security.SuperUserKey); Content[] content = { @@ -455,15 +457,15 @@ public class UserServiceTests : UmbracoIntegrationTest } [Test] - public void Get_User_Implicit_Permissions() + public async Task Get_User_Implicit_Permissions() { // Arrange - var userGroup = CreateTestUserGroup(); + var userGroup = await CreateTestUserGroup(); var template = TemplateBuilder.CreateTextPageTemplate(); FileService.SaveTemplate(template); var contentType = ContentTypeBuilder.CreateSimpleContentType(defaultTemplateId: template.Id); - ContentTypeService.Save(contentType); + await ContentTypeService.UpdateAsync(contentType, Constants.Security.SuperUserKey); var parent = ContentBuilder.CreateSimpleContent(contentType); ContentService.Save(parent); @@ -651,10 +653,10 @@ public class UserServiceTests : UmbracoIntegrationTest } [Test] - public void Get_All_Paged_Users_For_Group() + public async Task Get_All_Paged_Users_For_Group() { var userGroup = UserGroupBuilder.CreateUserGroup(); - UserService.Save(userGroup); + await UserGroupService.CreateAsync(userGroup, Constants.Security.SuperUserKey); var users = UserBuilder.CreateMulipleUsers(10).ToArray(); for (var i = 0; i < 10;) @@ -675,10 +677,10 @@ public class UserServiceTests : UmbracoIntegrationTest } [Test] - public void Get_All_Paged_Users_For_Group_With_Filter() + public async Task Get_All_Paged_Users_For_Group_With_Filter() { var userGroup = UserGroupBuilder.CreateUserGroup(); - UserService.Save(userGroup); + await UserGroupService.CreateAsync(userGroup, Constants.Security.SuperUserKey); var users = UserBuilder.CreateMulipleUsers(10).ToArray(); for (var i = 0; i < 10;) @@ -798,14 +800,14 @@ public class UserServiceTests : UmbracoIntegrationTest } [Test] - public void Can_Add_And_Remove_Sections_From_UserGroup() + public async Task Can_Add_And_Remove_Sections_From_UserGroup() { var userGroup = new UserGroup(ShortStringHelper) { Alias = "Group1", Name = "Group 1" }; userGroup.AddAllowedSection("content"); userGroup.AddAllowedSection("mediat"); - UserService.Save(userGroup); + await UserGroupService.CreateAsync(userGroup, Constants.Security.SuperUserKey); - var result1 = UserService.GetUserGroupById(userGroup.Id); + var result1 = await UserGroupService.GetAsync(userGroup.Id); Assert.AreEqual(2, result1.AllowedSections.Count()); @@ -814,9 +816,9 @@ public class UserServiceTests : UmbracoIntegrationTest userGroup.AddAllowedSection("test2"); userGroup.AddAllowedSection("test3"); userGroup.AddAllowedSection("test4"); - UserService.Save(userGroup); + await UserGroupService.UpdateAsync(userGroup, Constants.Security.SuperUserKey); - result1 = UserService.GetUserGroupById(userGroup.Id); + result1 = await UserGroupService.GetAsync(userGroup.Id); Assert.AreEqual(6, result1.AllowedSections.Count()); @@ -829,40 +831,40 @@ public class UserServiceTests : UmbracoIntegrationTest // now just re-add a couple result1.AddAllowedSection("test3"); result1.AddAllowedSection("test4"); - UserService.Save(result1); + await UserGroupService.UpdateAsync(result1, Constants.Security.SuperUserKey); // Assert // re-get - result1 = UserService.GetUserGroupById(userGroup.Id); + result1 = await UserGroupService.GetAsync(userGroup.Id); Assert.AreEqual(2, result1.AllowedSections.Count()); } [Test] - public void Can_Remove_Section_From_All_Assigned_UserGroups() + public async Task Can_Remove_Section_From_All_Assigned_UserGroups() { var userGroup1 = new UserGroup(ShortStringHelper) { Alias = "Group1", Name = "Group 1" }; var userGroup2 = new UserGroup(ShortStringHelper) { Alias = "Group2", Name = "Group 2" }; - UserService.Save(userGroup1); - UserService.Save(userGroup2); + await UserGroupService.CreateAsync(userGroup1, Constants.Security.SuperUserKey); + await UserGroupService.CreateAsync(userGroup2, Constants.Security.SuperUserKey); // adds some allowed sections userGroup1.AddAllowedSection("test"); userGroup2.AddAllowedSection("test"); - UserService.Save(userGroup1); - UserService.Save(userGroup2); + await UserGroupService.UpdateAsync(userGroup1, Constants.Security.SuperUserKey); + await UserGroupService.UpdateAsync(userGroup2, Constants.Security.SuperUserKey); // now clear the section from all users UserService.DeleteSectionFromAllUserGroups("test"); // Assert - var result1 = UserService.GetUserGroupById(userGroup1.Id); - var result2 = UserService.GetUserGroupById(userGroup2.Id); + var result1 = await UserGroupService.GetAsync(userGroup1.Id); + var result2 = await UserGroupService.GetAsync(userGroup2.Id); Assert.IsFalse(result1.AllowedSections.Contains("test")); Assert.IsFalse(result2.AllowedSections.Contains("test")); } [Test] - public void Can_Add_Section_To_All_UserGroups() + public async Task Can_Add_Section_To_All_UserGroups() { var userGroup1 = new UserGroup(ShortStringHelper) { Alias = "Group1", Name = "Group 1" }; userGroup1.AddAllowedSection("test"); @@ -871,14 +873,14 @@ public class UserServiceTests : UmbracoIntegrationTest userGroup2.AddAllowedSection("test"); var userGroup3 = new UserGroup(ShortStringHelper) { Alias = "Group3", Name = "Group 3" }; - UserService.Save(userGroup1); - UserService.Save(userGroup2); - UserService.Save(userGroup3); + await UserGroupService.CreateAsync(userGroup1, Constants.Security.SuperUserKey); + await UserGroupService.CreateAsync(userGroup2, Constants.Security.SuperUserKey); + await UserGroupService.CreateAsync(userGroup3, Constants.Security.SuperUserKey); // Assert - var result1 = UserService.GetUserGroupById(userGroup1.Id); - var result2 = UserService.GetUserGroupById(userGroup2.Id); - var result3 = UserService.GetUserGroupById(userGroup3.Id); + var result1 = await UserGroupService.GetAsync(userGroup1.Id); + var result2 = await UserGroupService.GetAsync(userGroup2.Id); + var result3 = await UserGroupService.GetAsync(userGroup3.Id); Assert.IsTrue(result1.AllowedSections.Contains("test")); Assert.IsTrue(result2.AllowedSections.Contains("test")); Assert.IsFalse(result3.AllowedSections.Contains("test")); @@ -887,13 +889,13 @@ public class UserServiceTests : UmbracoIntegrationTest foreach (var userGroup in new[] { userGroup1, userGroup2, userGroup3 }) { userGroup.AddAllowedSection("test"); - UserService.Save(userGroup); + await UserGroupService.UpdateAsync(userGroup, Constants.Security.SuperUserKey); } // Assert - result1 = UserService.GetUserGroupById(userGroup1.Id); - result2 = UserService.GetUserGroupById(userGroup2.Id); - result3 = UserService.GetUserGroupById(userGroup3.Id); + result1 = await UserGroupService.GetAsync(userGroup1.Id); + result2 = await UserGroupService.GetAsync(userGroup2.Id); + result3 = await UserGroupService.GetAsync(userGroup3.Id); Assert.IsTrue(result1.AllowedSections.Contains("test")); Assert.IsTrue(result2.AllowedSections.Contains("test")); Assert.IsTrue(result3.AllowedSections.Contains("test")); @@ -975,10 +977,10 @@ public class UserServiceTests : UmbracoIntegrationTest } [Test] - public void Get_User_By_Username() + public async Task Get_User_By_Username() { // Arrange - var originalUser = CreateTestUser(out _); + var (originalUser, _) = await CreateTestUserAndGroup(); // Act var updatedItem = (User)UserService.GetByUsername(originalUser.Username); @@ -999,11 +1001,11 @@ public class UserServiceTests : UmbracoIntegrationTest } [Test] - public void Can_Get_Assigned_StartNodes_For_User() + public async Task Can_Get_Assigned_StartNodes_For_User() { - var startContentItems = BuildContentItems(3); + var startContentItems = await BuildContentItems(3); - var testUserGroup = CreateTestUserGroup(); + var testUserGroup = await CreateTestUserGroup(); var userGroupId = testUserGroup.Id; @@ -1079,12 +1081,12 @@ public class UserServiceTests : UmbracoIntegrationTest Assert.AreEqual(expectedResult, result); } - private Content[] BuildContentItems(int numberToCreate) + private async Task BuildContentItems(int numberToCreate) { var template = TemplateBuilder.CreateTextPageTemplate(); FileService.SaveTemplate(template); var contentType = ContentTypeBuilder.CreateSimpleContentType(defaultTemplateId: template.Id); - ContentTypeService.Save(contentType); + await ContentTypeService.UpdateAsync(contentType, Constants.Security.SuperUserKey); var startContentItems = new List(); @@ -1098,9 +1100,9 @@ public class UserServiceTests : UmbracoIntegrationTest return startContentItems.ToArray(); } - private IUser CreateTestUser(out IUserGroup userGroup) + private async Task<(IUser, IUserGroup)> CreateTestUserAndGroup() { - userGroup = CreateTestUserGroup(); + var userGroup = await CreateTestUserGroup(); var user = UserService.CreateUserWithIdentity("test1", "test1@test.com"); @@ -1108,12 +1110,12 @@ public class UserServiceTests : UmbracoIntegrationTest UserService.Save(user); - return user; + return (user, userGroup); } private async Task CreateTestUser(UserKind userKind) { - var userGroup = CreateTestUserGroup(); + var userGroup = await CreateTestUserGroup(); var result = await UserService.CreateAsync( Constants.Security.SuperUserKey, @@ -1150,12 +1152,12 @@ public class UserServiceTests : UmbracoIntegrationTest return users; } - private UserGroup CreateTestUserGroup(string alias = "testGroup", string name = "Test Group") + private async Task CreateTestUserGroup(string alias = "testGroup", string name = "Test Group") { var permissions = "ABCDEFGHIJ1234567".ToCharArray().Select(x => x.ToString()).ToHashSet(); var userGroup = UserGroupBuilder.CreateUserGroup(alias, name, permissions: permissions); - UserService.Save(userGroup); + await UserGroupService.CreateAsync(userGroup, Constants.Security.SuperUserKey); return userGroup; } diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/DbContext/CustomDbContextUmbracoProviderTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/DbContext/CustomDbContextUmbracoProviderTests.cs index 1ba57c1a70..4a7c64ea5c 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/DbContext/CustomDbContextUmbracoProviderTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/DbContext/CustomDbContextUmbracoProviderTests.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using NUnit.Framework; @@ -9,7 +9,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Persistence.EFCore.DbContext; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Logger = UmbracoTestOptions.Logger.Console)] -public class CustomDbContextUmbracoProviderTests : UmbracoIntegrationTest +internal sealed class CustomDbContextUmbracoProviderTests : UmbracoIntegrationTest { [Test] public void Can_Register_Custom_DbContext_And_Resolve() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreLockTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreLockTests.cs index 2d1562f668..5e37203e14 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreLockTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreLockTests.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.DistributedLocking; @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Persistence.EFCore.Scoping; [TestFixture] [Timeout(60000)] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Logger = UmbracoTestOptions.Logger.Console)] -public class EFCoreLockTests : UmbracoIntegrationTest +internal sealed class EFCoreLockTests : UmbracoIntegrationTest { private IEFCoreScopeProvider EFScopeProvider => GetRequiredService>(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeInfrastructureScopeLockTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeInfrastructureScopeLockTests.cs index 262382cdda..d67130d489 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeInfrastructureScopeLockTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeInfrastructureScopeLockTests.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Events; @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Persistence.EFCore.Scoping; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class EFCoreScopeInfrastructureScopeLockTests : UmbracoIntegrationTest +internal sealed class EFCoreScopeInfrastructureScopeLockTests : UmbracoIntegrationTest { private IEFCoreScopeProvider EfCoreScopeProvider => GetRequiredService>(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeInfrastructureScopeTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeInfrastructureScopeTests.cs index 130b807c73..48413c26af 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeInfrastructureScopeTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeInfrastructureScopeTests.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using NUnit.Framework; using Umbraco.Cms.Infrastructure.Scoping; using Umbraco.Cms.Persistence.EFCore.Scoping; @@ -10,7 +10,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Persistence.EFCore.Scoping; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewEmptyPerTest)] -public class EFCoreScopeInfrastructureScopeTests : UmbracoIntegrationTest +internal sealed class EFCoreScopeInfrastructureScopeTests : UmbracoIntegrationTest { private IEFCoreScopeProvider EfCoreScopeProvider => GetRequiredService>(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeNotificationsTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeNotificationsTest.cs index f75d51d0e3..1a0014a418 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeNotificationsTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeNotificationsTest.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Persistence.EFCore.Scoping; @@ -10,7 +10,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Persistence.EFCore.Scoping; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewEmptyPerTest)] -public class EFCoreScopeNotificationsTest : UmbracoIntegrationTest +internal sealed class EFCoreScopeNotificationsTest : UmbracoIntegrationTest { protected override void CustomTestSetup(IUmbracoBuilder builder) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeTest.cs index 0d027fb6e0..de1d80910b 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopeTest.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Moq; using NUnit.Framework; @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Persistence.EFCore.Scoping; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewEmptyPerTest)] -public class EFCoreScopeTest : UmbracoIntegrationTest +internal sealed class EFCoreScopeTest : UmbracoIntegrationTest { private IEFCoreScopeProvider EfCoreScopeProvider => GetRequiredService>(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopedFileSystemsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopedFileSystemsTests.cs index df91eed751..4bb99d8b2c 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopedFileSystemsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Persistence.EFCore/Scoping/EFCoreScopedFileSystemsTests.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging; using Moq; using NUnit.Framework; using Umbraco.Cms.Core; @@ -14,7 +14,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Persistence.EFCore.Scoping; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Logger = UmbracoTestOptions.Logger.Console)] -public class EFCoreScopedFileSystemsTests : UmbracoIntegrationTest +internal sealed class EFCoreScopedFileSystemsTests : UmbracoIntegrationTest { [SetUp] public void SetUp() => ClearFiles(IOHelper); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheAncestryTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheAncestryTests.cs index ef9ccc81fe..2bead8722a 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheAncestryTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheAncestryTests.cs @@ -17,7 +17,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.PublishedCache.HybridCache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DocumentHybridCacheAncestryTests : UmbracoIntegrationTestWithContent +internal sealed class DocumentHybridCacheAncestryTests : UmbracoIntegrationTestWithContent { private IContentPublishingService ContentPublishingService => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheAncestryVariantTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheAncestryVariantTests.cs index b5701665af..ac6122a054 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheAncestryVariantTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheAncestryVariantTests.cs @@ -19,7 +19,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.PublishedCache.HybridCache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DocumentHybridCacheAncestryVariantTests : UmbracoIntegrationTest +internal sealed class DocumentHybridCacheAncestryVariantTests : UmbracoIntegrationTest { private string _englishIsoCode = "en-US"; private string _danishIsoCode = "da-DK"; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheDocumentTypeTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheDocumentTypeTests.cs index 17b55019db..1c684ea384 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheDocumentTypeTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheDocumentTypeTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Notifications; @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.PublishedCache.HybridCache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DocumentHybridCacheDocumentTypeTests : UmbracoIntegrationTestWithContentEditing +internal sealed class DocumentHybridCacheDocumentTypeTests : UmbracoIntegrationTestWithContentEditing { protected override void CustomTestSetup(IUmbracoBuilder builder) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheMockTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheMockTests.cs index 6b089a3732..e6ba41cefc 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheMockTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheMockTests.cs @@ -23,7 +23,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.PublishedCache.HybridCache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DocumentHybridCacheMockTests : UmbracoIntegrationTestWithContent +internal sealed class DocumentHybridCacheMockTests : UmbracoIntegrationTestWithContent { private IPublishedContentCache _mockedCache; private Mock _mockedNucacheRepository; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCachePropertyTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCachePropertyTest.cs index b5dff7085e..746da766bf 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCachePropertyTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCachePropertyTest.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Models; @@ -20,7 +20,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.PublishedCache.HybridCache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DocumentHybridCachePropertyTest : UmbracoIntegrationTest +internal sealed class DocumentHybridCachePropertyTest : UmbracoIntegrationTest { protected override void CustomTestSetup(IUmbracoBuilder builder) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheScopeTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheScopeTests.cs index 73c9024f23..6b143e9ce8 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheScopeTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheScopeTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Models.ContentPublishing; @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.PublishedCache.HybridCache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DocumentHybridCacheScopeTests : UmbracoIntegrationTestWithContentEditing +internal sealed class DocumentHybridCacheScopeTests : UmbracoIntegrationTestWithContentEditing { protected override void CustomTestSetup(IUmbracoBuilder builder) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheTemplateTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheTemplateTests.cs index c1291b1fff..7c5f1950bf 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheTemplateTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheTemplateTests.cs @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.PublishedCache.HybridCache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DocumentHybridCacheTemplateTests : UmbracoIntegrationTestWithContentEditing +internal sealed class DocumentHybridCacheTemplateTests : UmbracoIntegrationTestWithContentEditing { protected override void CustomTestSetup(IUmbracoBuilder builder) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheTests.cs index c757001136..f0c335b577 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Models.ContentEditing; @@ -15,7 +15,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.PublishedCache.HybridCache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DocumentHybridCacheTests : UmbracoIntegrationTestWithContentEditing +internal sealed class DocumentHybridCacheTests : UmbracoIntegrationTestWithContentEditing { protected override void CustomTestSetup(IUmbracoBuilder builder) { diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheVariantsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheVariantsTests.cs index a4572cf19c..40fa91afe1 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheVariantsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheVariantsTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Models; @@ -19,7 +19,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.PublishedCache.HybridCache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class DocumentHybridCacheVariantsTests : UmbracoIntegrationTest +internal sealed class DocumentHybridCacheVariantsTests : UmbracoIntegrationTest { private string _englishIsoCode = "en-US"; private string _danishIsoCode = "da-DK"; diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MediaHybridCacheMediaTypeTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MediaHybridCacheMediaTypeTests.cs index 60ac4157dd..947a21ed18 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MediaHybridCacheMediaTypeTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MediaHybridCacheMediaTypeTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Notifications; @@ -14,7 +14,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.PublishedCache.HybridCache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class MediaHybridCacheMediaTypeTests : UmbracoIntegrationTestWithMediaEditing +internal sealed class MediaHybridCacheMediaTypeTests : UmbracoIntegrationTestWithMediaEditing { private IPublishedMediaCache PublishedMediaHybridCache => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MediaHybridCacheScopeTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MediaHybridCacheScopeTests.cs index 2886520170..333a7ae175 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MediaHybridCacheScopeTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MediaHybridCacheScopeTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.PublishedCache; using Umbraco.Cms.Core.Scoping; @@ -9,7 +9,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.PublishedCache.HybridCache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class MediaHybridCacheScopeTests : UmbracoIntegrationTestWithMediaEditing +internal sealed class MediaHybridCacheScopeTests : UmbracoIntegrationTestWithMediaEditing { protected override void CustomTestSetup(IUmbracoBuilder builder) => builder.AddUmbracoHybridCache(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MediaHybridCacheTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MediaHybridCacheTests.cs index 37263d913d..692904fb52 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MediaHybridCacheTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MediaHybridCacheTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Models.ContentEditing; @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.PublishedCache.HybridCache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class MediaHybridCacheTests : UmbracoIntegrationTestWithMediaEditing +internal sealed class MediaHybridCacheTests : UmbracoIntegrationTestWithMediaEditing { private IPublishedMediaCache PublishedMediaHybridCache => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MemberHybridCacheTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MemberHybridCacheTests.cs index fae8e5bdb5..f3754bb5fd 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MemberHybridCacheTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/MemberHybridCacheTests.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.ContentEditing; @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.PublishedCache.HybridCache; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest)] -public class MemberHybridCacheTests : UmbracoIntegrationTest +internal sealed class MemberHybridCacheTests : UmbracoIntegrationTest { private IPublishedMemberCache PublishedMemberHybridCache => GetRequiredService(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/UmbracoBackOfficeServiceCollectionExtensionsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/UmbracoBackOfficeServiceCollectionExtensionsTests.cs index cc0baea33c..9bf8a59ae3 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/UmbracoBackOfficeServiceCollectionExtensionsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/UmbracoBackOfficeServiceCollectionExtensionsTests.cs @@ -12,7 +12,7 @@ using Umbraco.Extensions; namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.BackOffice; [TestFixture] -public class UmbracoBackOfficeServiceCollectionExtensionsTests : UmbracoIntegrationTest +internal sealed class UmbracoBackOfficeServiceCollectionExtensionsTests : UmbracoIntegrationTest { protected override void CustomTestSetup(IUmbracoBuilder builder) => builder.AddBackOfficeIdentity(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/UrlAndDomains/DomainAndUrlsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/UrlAndDomains/DomainAndUrlsTests.cs index ae1e877e15..97613323d1 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/UrlAndDomains/DomainAndUrlsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/UrlAndDomains/DomainAndUrlsTests.cs @@ -23,7 +23,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.BackOffice.UrlAndDomains; [TestFixture] [UmbracoTest(Database = UmbracoTestOptions.Database.NewSchemaPerTest, Mapper = true, WithApplication = true, Logger = UmbracoTestOptions.Logger.Console)] -public class DomainAndUrlsTests : UmbracoIntegrationTest +internal sealed class DomainAndUrlsTests : UmbracoIntegrationTest { [SetUp] public void Setup() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.Common/MembersServiceCollectionExtensionsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.Common/MembersServiceCollectionExtensionsTests.cs index 66fc0c8143..eb191eb81d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.Common/MembersServiceCollectionExtensionsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.Common/MembersServiceCollectionExtensionsTests.cs @@ -9,7 +9,7 @@ using Umbraco.Extensions; namespace Umbraco.Tests.Integration.Umbraco.Web.Common; [TestFixture] -public class MembersServiceCollectionExtensionsTests : UmbracoIntegrationTest +internal sealed class MembersServiceCollectionExtensionsTests : UmbracoIntegrationTest { protected override void CustomTestSetup(IUmbracoBuilder builder) => builder.AddMembersIdentity(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Routing/SurfaceControllerTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Routing/SurfaceControllerTests.cs index c48741b36a..8f77193589 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Routing/SurfaceControllerTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Routing/SurfaceControllerTests.cs @@ -1,4 +1,4 @@ -using System.Net; +using System.Net; using System.Reflection; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; @@ -18,7 +18,7 @@ using Umbraco.Extensions; namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.Website.Routing; [TestFixture] -public class SurfaceControllerTests : UmbracoTestServerTestBase +internal sealed class SurfaceControllerTests : UmbracoTestServerTestBase { [Test] public async Task Auto_Routes_For_Default_Action() diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Security/MemberAuthorizeTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Security/MemberAuthorizeTests.cs index 35bea8bc0e..003162ad1f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Security/MemberAuthorizeTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Web.Website/Security/MemberAuthorizeTests.cs @@ -21,7 +21,7 @@ using Umbraco.Cms.Web.Website.Controllers; namespace Umbraco.Cms.Tests.Integration.Umbraco.Web.Website.Security { - public class MemberAuthorizeTests : UmbracoTestServerTestBase + internal sealed class MemberAuthorizeTests : UmbracoTestServerTestBase { private Mock _memberManagerMock = new(); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs index bc8b8f8a5b..298b04dfbb 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs @@ -76,8 +76,7 @@ public class ComponentTests Mock.Of(), Mock.Of>(), Mock.Of(), - Mock.Of(), - Options.Create(new ContentSettings())); + Mock.Of()); var eventAggregator = Mock.Of(); var scopeProvider = new ScopeProvider( new AmbientScopeStack(), diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/DeliveryApiTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/DeliveryApiTests.cs index 08c09c92f2..0e785b1134 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/DeliveryApiTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/DeliveryApiTests.cs @@ -72,7 +72,7 @@ public class DeliveryApiTests { var mockPublishedContentTypeFactory = new Mock(); mockPublishedContentTypeFactory.Setup(x => x.GetDataType(It.IsAny())) - .Returns(new PublishedDataType(123, editorAlias, new Lazy(() => dataTypeConfiguration))); + .Returns(new PublishedDataType(123, editorAlias, editorAlias, new Lazy(() => dataTypeConfiguration))); var publishedPropType = new PublishedPropertyType( propertyTypeAlias, diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/ImageCropperValueConverterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/ImageCropperValueConverterTests.cs index f27eff76d6..dc77dedfd8 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/ImageCropperValueConverterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/ImageCropperValueConverterTests.cs @@ -16,7 +16,7 @@ public class ImageCropperValueConverterTests : PropertyValueConverterTests [Test] public void ImageCropperValueConverter_ConvertsValueToImageCropperValue() { - var publishedDataType = new PublishedDataType(123, "test", new Lazy(() => new ImageCropperConfiguration + var publishedDataType = new PublishedDataType(123, "test", "test", new Lazy(() => new ImageCropperConfiguration { Crops = new ImageCropperConfiguration.Crop[] { diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/MediaPickerWithCropsValueConverterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/MediaPickerWithCropsValueConverterTests.cs index 5c02e4b743..2f43f51bd6 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/MediaPickerWithCropsValueConverterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/MediaPickerWithCropsValueConverterTests.cs @@ -298,7 +298,7 @@ public class MediaPickerWithCropsValueConverterTests : PropertyValueConverterTes private IPublishedPropertyType SetupMediaPropertyType(bool multiSelect) { - var publishedDataType = new PublishedDataType(123, "test", new Lazy(() => new MediaPicker3Configuration + var publishedDataType = new PublishedDataType(123, "test", "test", new Lazy(() => new MediaPicker3Configuration { Multiple = multiSelect, EnableLocalFocalPoint = true, diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/MultiNodeTreePickerValueConverterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/MultiNodeTreePickerValueConverterTests.cs index 4b6c052392..57f3b5178f 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/MultiNodeTreePickerValueConverterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/MultiNodeTreePickerValueConverterTests.cs @@ -33,7 +33,7 @@ public class MultiNodeTreePickerValueConverterTests : PropertyValueConverterTest } private PublishedDataType MultiNodePickerPublishedDataType(bool multiSelect, string entityType) => - new PublishedDataType(123, "test", new Lazy(() => new MultiNodePickerConfiguration + new PublishedDataType(123, "test", "test", new Lazy(() => new MultiNodePickerConfiguration { MaxNumber = multiSelect ? 10 : 1, TreeSource = new MultiNodePickerConfigurationTreeSource diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/MultiUrlPickerValueConverterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/MultiUrlPickerValueConverterTests.cs index 4547078d15..2f7df14f2f 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/MultiUrlPickerValueConverterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/MultiUrlPickerValueConverterTests.cs @@ -20,7 +20,7 @@ public class MultiUrlPickerValueConverterTests : PropertyValueConverterTests [Test] public void MultiUrlPickerValueConverter_InSingleMode_ConvertsContentToLinksWithContentInfo() { - var publishedDataType = new PublishedDataType(123, "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); + var publishedDataType = new PublishedDataType(123, "test", "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); var publishedPropertyType = new Mock(); publishedPropertyType.SetupGet(p => p.DataType).Returns(publishedDataType); @@ -52,7 +52,7 @@ public class MultiUrlPickerValueConverterTests : PropertyValueConverterTests [Test] public void MultiUrlPickerValueConverter_InSingleMode_ConvertsMediaToLinksWithoutContentInfo() { - var publishedDataType = new PublishedDataType(123, "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); + var publishedDataType = new PublishedDataType(123, "test", "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); var publishedPropertyType = new Mock(); publishedPropertyType.SetupGet(p => p.DataType).Returns(publishedDataType); @@ -82,7 +82,7 @@ public class MultiUrlPickerValueConverterTests : PropertyValueConverterTests [Test] public void MultiUrlPickerValueConverter_InMultiMode_CanHandleMixedLinkTypes() { - var publishedDataType = new PublishedDataType(123, "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 10 })); + var publishedDataType = new PublishedDataType(123, "test", "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 10 })); var publishedPropertyType = new Mock(); publishedPropertyType.SetupGet(p => p.DataType).Returns(publishedDataType); @@ -135,7 +135,7 @@ public class MultiUrlPickerValueConverterTests : PropertyValueConverterTests [Test] public void MultiUrlPickerValueConverter_ConvertsExternalUrlToLinks() { - var publishedDataType = new PublishedDataType(123, "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); + var publishedDataType = new PublishedDataType(123, "test", "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); var publishedPropertyType = new Mock(); publishedPropertyType.SetupGet(p => p.DataType).Returns(publishedDataType); @@ -166,7 +166,7 @@ public class MultiUrlPickerValueConverterTests : PropertyValueConverterTests [Test] public void MultiUrlPickerValueConverter_AppliesExplicitConfigurationToMediaLink() { - var publishedDataType = new PublishedDataType(123, "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); + var publishedDataType = new PublishedDataType(123, "test", "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); var publishedPropertyType = new Mock(); publishedPropertyType.SetupGet(p => p.DataType).Returns(publishedDataType); @@ -199,7 +199,7 @@ public class MultiUrlPickerValueConverterTests : PropertyValueConverterTests [Test] public void MultiUrlPickerValueConverter_AppliesExplicitConfigurationToContentLink() { - var publishedDataType = new PublishedDataType(123, "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); + var publishedDataType = new PublishedDataType(123, "test", "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); var publishedPropertyType = new Mock(); publishedPropertyType.SetupGet(p => p.DataType).Returns(publishedDataType); @@ -231,7 +231,7 @@ public class MultiUrlPickerValueConverterTests : PropertyValueConverterTests [Test] public void MultiUrlPickerValueConverter_PrioritizesContentUrlOverConfiguredUrl() { - var publishedDataType = new PublishedDataType(123, "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); + var publishedDataType = new PublishedDataType(123, "test", "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); var publishedPropertyType = new Mock(); publishedPropertyType.SetupGet(p => p.DataType).Returns(publishedDataType); @@ -263,7 +263,7 @@ public class MultiUrlPickerValueConverterTests : PropertyValueConverterTests [TestCase(null)] public void MultiUrlPickerValueConverter_InSingleMode_ConvertsInvalidValueToEmptyArray(object? inter) { - var publishedDataType = new PublishedDataType(123, "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); + var publishedDataType = new PublishedDataType(123, "test", "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 1 })); var publishedPropertyType = new Mock(); publishedPropertyType.SetupGet(p => p.DataType).Returns(publishedDataType); @@ -279,7 +279,7 @@ public class MultiUrlPickerValueConverterTests : PropertyValueConverterTests [TestCase(null)] public void MultiUrlPickerValueConverter_InMultiMode_ConvertsInvalidValueToEmptyArray(object? inter) { - var publishedDataType = new PublishedDataType(123, "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 10 })); + var publishedDataType = new PublishedDataType(123, "test", "test", new Lazy(() => new MultiUrlPickerConfiguration { MaxNumber = 10 })); var publishedPropertyType = new Mock(); publishedPropertyType.SetupGet(p => p.DataType).Returns(publishedDataType); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/RichTextParserTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/RichTextParserTests.cs index cf26a8e92a..51c6a21ecf 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/RichTextParserTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/RichTextParserTests.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging; using Moq; using NUnit.Framework; using Umbraco.Cms.Core; @@ -25,7 +25,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse("

Hello

"); + var element = parser.Parse("

Hello

", RichTextBlockModel.Empty); Assert.IsNotNull(element); Assert.AreEqual("#root", element.Tag); } @@ -35,7 +35,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse("

Some text paragraph

") as RichTextRootElement; + var element = parser.Parse("

Some text paragraph

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); Assert.AreEqual(1, element.Elements.Count()); var paragraph = element.Elements.Single() as RichTextGenericElement; @@ -51,7 +51,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse("

Some text
More text
Even more text

") as RichTextRootElement; + var element = parser.Parse("

Some text
More text
Even more text

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); Assert.AreEqual(1, element.Elements.Count()); var paragraph = element.Elements.Single() as RichTextGenericElement; @@ -99,7 +99,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse("

Text in a data-something SPAN

") as RichTextRootElement; + var element = parser.Parse("

Text in a data-something SPAN

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); var span = element.Elements.OfType().Single().Elements.Single() as RichTextGenericElement; Assert.IsNotNull(span); @@ -117,7 +117,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse("

Text in a data-something SPAN

") as RichTextRootElement; + var element = parser.Parse("

Text in a data-something SPAN

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); var span = element.Elements.OfType().Single().Elements.Single() as RichTextGenericElement; Assert.IsNotNull(span); @@ -132,7 +132,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse($"

") as RichTextRootElement; + var element = parser.Parse($"

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); var link = element.Elements.OfType().Single().Elements.Single() as RichTextGenericElement; Assert.IsNotNull(link); @@ -151,7 +151,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse($"

") as RichTextRootElement; + var element = parser.Parse($"

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); var link = element.Elements.OfType().Single().Elements.Single() as RichTextGenericElement; Assert.IsNotNull(link); @@ -166,7 +166,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse($"

") as RichTextRootElement; + var element = parser.Parse($"

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); var link = element.Elements.OfType().Single().Elements.Single() as RichTextGenericElement; Assert.IsNotNull(link); @@ -181,7 +181,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse($"

This is the link text

") as RichTextRootElement; + var element = parser.Parse($"

This is the link text

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); var link = element.Elements.OfType().Single().Elements.Single() as RichTextGenericElement; Assert.IsNotNull(link); @@ -197,7 +197,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse($"

") as RichTextRootElement; + var element = parser.Parse($"

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); var link = element.Elements.OfType().Single().Elements.Single() as RichTextGenericElement; Assert.IsNotNull(link); @@ -210,7 +210,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse($"

") as RichTextRootElement; + var element = parser.Parse($"

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); var link = element.Elements.OfType().Single().Elements.Single() as RichTextGenericElement; Assert.IsNotNull(link); @@ -225,7 +225,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse($"

") as RichTextRootElement; + var element = parser.Parse($"

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); var link = element.Elements.OfType().Single().Elements.Single() as RichTextGenericElement; Assert.IsNotNull(link); @@ -240,7 +240,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse("

some textsome more text

") as RichTextRootElement; + var element = parser.Parse("

some textsome more text

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); var paragraph = element.Elements.Single() as RichTextGenericElement; Assert.IsNotNull(paragraph); @@ -259,7 +259,7 @@ public class RichTextParserTests : PropertyValueConverterTests var id = Guid.NewGuid(); var tagName = $"umb-rte-block{(inlineBlock ? "-inline" : string.Empty)}"; - var element = parser.Parse($"

<{tagName} data-content-key=\"{id:N}\">

") as RichTextRootElement; + var element = parser.Parse($"

<{tagName} data-content-key=\"{id:N}\">

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); var paragraph = element.Elements.Single() as RichTextGenericElement; Assert.IsNotNull(paragraph); @@ -333,7 +333,7 @@ public class RichTextParserTests : PropertyValueConverterTests var id1 = Guid.NewGuid(); var id2 = Guid.NewGuid(); - var element = parser.Parse($"

") as RichTextRootElement; + var element = parser.Parse($"

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); Assert.AreEqual(2, element.Elements.Count()); @@ -362,7 +362,7 @@ public class RichTextParserTests : PropertyValueConverterTests { var parser = CreateRichTextElementParser(); - var element = parser.Parse("

What follows from here is just a bunch of text.

") as RichTextRootElement; + var element = parser.Parse("

What follows from here is just a bunch of text.

", RichTextBlockModel.Empty) as RichTextRootElement; Assert.IsNotNull(element); var paragraphElement = element.Elements.Single() as RichTextGenericElement; Assert.IsNotNull(paragraphElement); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/VariationTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/VariationTests.cs index ef8b8733c7..2765ce6a4d 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/VariationTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Models/VariationTests.cs @@ -8,6 +8,7 @@ using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Dictionary; using Umbraco.Cms.Core.IO; using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Models.Validation; using Umbraco.Cms.Core.PropertyEditors; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Strings; @@ -565,13 +566,13 @@ public class VariationTests Assert.IsNull(prop.GetValue(published: true)); var propertyValidationService = GetPropertyValidationService(); - Assert.IsTrue(propertyValidationService.IsPropertyValid(prop)); + Assert.IsTrue(propertyValidationService.IsPropertyValid(prop, PropertyValidationContext.Empty())); propertyType.Mandatory = true; - Assert.IsTrue(propertyValidationService.IsPropertyValid(prop)); + Assert.IsTrue(propertyValidationService.IsPropertyValid(prop, PropertyValidationContext.Empty())); prop.SetValue(null); - Assert.IsFalse(propertyValidationService.IsPropertyValid(prop)); + Assert.IsFalse(propertyValidationService.IsPropertyValid(prop, PropertyValidationContext.Empty())); // can publish, even though invalid prop.PublishValues(); @@ -604,12 +605,12 @@ public class VariationTests var propertyValidationService = GetPropertyValidationService(); // "no value" is valid for non-mandatory properties - Assert.IsTrue(propertyValidationService.IsPropertyValid(prop, culture, segment)); + Assert.IsTrue(propertyValidationService.IsPropertyValid(prop, PropertyValidationContext.CultureAndSegment(culture, segment))); propertyType.Mandatory = true; // "no value" is NOT valid for mandatory properties - Assert.IsFalse(propertyValidationService.IsPropertyValid(prop, culture, segment)); + Assert.IsFalse(propertyValidationService.IsPropertyValid(prop, PropertyValidationContext.CultureAndSegment(culture, segment))); // can publish, even though invalid prop.PublishValues(); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockListPropertyValueConverterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockListPropertyValueConverterTests.cs index 3cd7b4bc39..2af6f28bab 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockListPropertyValueConverterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockListPropertyValueConverterTests.cs @@ -82,7 +82,7 @@ public class BlockListPropertyValueConverterTests : BlockPropertyValueConverterT var editor = CreateConverter(); var config = ConfigForMany(); - var dataType = new PublishedDataType(1, "test", new Lazy(() => config)); + var dataType = new PublishedDataType(1, "test", "test", new Lazy(() => config)); var propType = Mock.Of(x => x.DataType == dataType); var valueType = editor.GetPropertyValueType(propType); @@ -97,7 +97,7 @@ public class BlockListPropertyValueConverterTests : BlockPropertyValueConverterT var editor = CreateConverter(); var config = ConfigForSingle(); - var dataType = new PublishedDataType(1, "test", new Lazy(() => config)); + var dataType = new PublishedDataType(1, "test", "test", new Lazy(() => config)); var propType = Mock.Of(x => x.DataType == dataType); var valueType = editor.GetPropertyValueType(propType); @@ -112,7 +112,7 @@ public class BlockListPropertyValueConverterTests : BlockPropertyValueConverterT var editor = CreateConverter(); var config = ConfigForSingleBlockMode(); - var dataType = new PublishedDataType(1, "test", new Lazy(() => config)); + var dataType = new PublishedDataType(1, "test", "test", new Lazy(() => config)); var propType = Mock.Of(x => x.DataType == dataType); var valueType = editor.GetPropertyValueType(propType); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockPropertyValueConverterTestsBase.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockPropertyValueConverterTestsBase.cs index 6d9efe47d3..a1d6d2b5c0 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockPropertyValueConverterTestsBase.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/BlockPropertyValueConverterTestsBase.cs @@ -1,4 +1,4 @@ -using Moq; +using Moq; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.PublishedCache; @@ -51,7 +51,7 @@ public abstract class BlockPropertyValueConverterTestsBase(() => config)); + var dataType = new PublishedDataType(1, "test", "test", new Lazy(() => config)); var propertyType = Mock.Of(x => x.EditorAlias == PropertyEditorAlias && x.DataType == dataType); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/PropertyEditorValueConverterTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/PropertyEditorValueConverterTests.cs index 461edeef69..3b38fcbc9d 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/PropertyEditorValueConverterTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/PropertyEditorValueConverterTests.cs @@ -92,8 +92,7 @@ public class PropertyEditorValueConverterTests { var mockPublishedContentTypeFactory = new Mock(); mockPublishedContentTypeFactory.Setup(x => x.GetDataType(123)) - .Returns(new PublishedDataType(123, "test", - new Lazy(() => new DropDownFlexibleConfiguration { Multiple = true }))); + .Returns(new PublishedDataType(123, "test", "test", new Lazy(() => new DropDownFlexibleConfiguration { Multiple = true }))); var publishedPropType = new PublishedPropertyType( new PublishedContentType(Guid.NewGuid(), 1234, "test", PublishedItemType.Content, diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scoping/ScopedNotificationPublisherTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scoping/ScopedNotificationPublisherTests.cs index 927706ed89..73d43177ab 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scoping/ScopedNotificationPublisherTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scoping/ScopedNotificationPublisherTests.cs @@ -84,8 +84,7 @@ public class ScopedNotificationPublisherTests Mock.Of(), loggerFactory.CreateLogger(), Mock.Of(), - Mock.Of(), - Options.Create(new ContentSettings())); + Mock.Of()); eventAggregatorMock = new Mock(); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/UserGroupServiceTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/UserGroupServiceTests.cs index 314c38d9bb..1c41f0e180 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/UserGroupServiceTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/UserGroupServiceTests.cs @@ -13,6 +13,7 @@ using Umbraco.Cms.Core.Scoping; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Services.OperationStatus; using Umbraco.Cms.Core.Strings; +using Umbraco.Cms.Infrastructure.Migrations.Install; namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Services; @@ -90,11 +91,10 @@ public class UserGroupServiceTests }); } - // Obsoletion will be resolved when they are converted to internal consts. [TestCase(null, null, UserGroupOperationStatus.Success)] [TestCase(Constants.Security.AdminGroupKeyString, Constants.Security.AdminGroupAlias, UserGroupOperationStatus.CanNotUpdateAliasIsSystemUserGroup)] - [TestCase(Constants.Security.SensitiveDataGroupKeyString, Constants.Security.SensitiveDataGroupAlias, UserGroupOperationStatus.CanNotUpdateAliasIsSystemUserGroup)] - [TestCase(Constants.Security.TranslatorGroupString, Constants.Security.TranslatorGroupAlias, UserGroupOperationStatus.CanNotUpdateAliasIsSystemUserGroup)] + [TestCase(Constants.Security.SensitiveDataGroupKeyString, DatabaseDataCreator.SensitiveDataGroupAlias, UserGroupOperationStatus.CanNotUpdateAliasIsSystemUserGroup)] + [TestCase(Constants.Security.TranslatorGroupString, DatabaseDataCreator.TranslatorGroupAlias, UserGroupOperationStatus.CanNotUpdateAliasIsSystemUserGroup)] public async Task Can_Not_Update_SystemGroup_Alias(string? systemGroupKey, string? systemGroupAlias, UserGroupOperationStatus status) { // prep diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Xml/XmlHelperTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Xml/XmlHelperTests.cs deleted file mode 100644 index 7780c6271c..0000000000 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Xml/XmlHelperTests.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Umbraco. -// See LICENSE for more details. - -using System.Diagnostics; -using System.Xml; -using System.Xml.XPath; -using NUnit.Framework; -using Umbraco.Cms.Core.Xml; -using Umbraco.Cms.Tests.Common.Builders; -using Umbraco.Extensions; - -namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Xml; - -[TestFixture] -public class XmlHelperTests -{ - [SetUp] - public void SetUp() => _builder = new XmlDocumentBuilder(); - - private XmlDocumentBuilder _builder; - - [Ignore("This is a benchmark test so is ignored by default")] - [Test] - public void Sort_Nodes_Benchmark_Legacy() - { - var xml = _builder.Build(); - var original = xml.GetElementById(1173.ToString()); - Assert.IsNotNull(original); - - long totalTime = 0; - var watch = new Stopwatch(); - var iterations = 10000; - - for (var i = 0; i < iterations; i++) - { - // don't measure the time for clone! - var parentNode = original.Clone(); - watch.Start(); - LegacySortNodes(ref parentNode); - watch.Stop(); - totalTime += watch.ElapsedMilliseconds; - watch.Reset(); - - // Do assertions just to make sure it is working properly. - var currSort = 0; - foreach (var child in parentNode.SelectNodes("./* [@id]").Cast()) - { - Assert.AreEqual(currSort, int.Parse(child.Attributes["sortOrder"].Value)); - currSort++; - } - - // Ensure the parent node's properties still exist first. - Assert.AreEqual("content", parentNode.ChildNodes[0].Name); - Assert.AreEqual("umbracoUrlAlias", parentNode.ChildNodes[1].Name); - - // Then the child nodes should come straight after. - Assert.IsTrue(parentNode.ChildNodes[2].Attributes["id"] != null); - } - - Debug.WriteLine("Total time for " + iterations + " iterations is " + totalTime); - } - - [Ignore("This is a benchmark test so is ignored by default")] - [Test] - public void Sort_Nodes_Benchmark_New() - { - var xml = _builder.Build(); - var original = xml.GetElementById(1173.ToString()); - Assert.IsNotNull(original); - - long totalTime = 0; - var watch = new Stopwatch(); - var iterations = 10000; - - for (var i = 0; i < iterations; i++) - { - // don't measure the time for clone! - var parentNode = (XmlElement)original.Clone(); - watch.Start(); - XmlHelper.SortNodes( - parentNode, - "./* [@id]", - x => x.AttributeValue("sortOrder")); - watch.Stop(); - totalTime += watch.ElapsedMilliseconds; - watch.Reset(); - - // do assertions just to make sure it is working properly. - var currSort = 0; - foreach (var child in parentNode.SelectNodes("./* [@id]").Cast()) - { - Assert.AreEqual(currSort, int.Parse(child.Attributes["sortOrder"].Value)); - currSort++; - } - - // ensure the parent node's properties still exist first - Assert.AreEqual("content", parentNode.ChildNodes[0].Name); - Assert.AreEqual("umbracoUrlAlias", parentNode.ChildNodes[1].Name); - - // then the child nodes should come straight after - Assert.IsTrue(parentNode.ChildNodes[2].Attributes["id"] != null); - } - - Debug.WriteLine("Total time for " + iterations + " iterations is " + totalTime); - } - - [Test] - public void Sort_Nodes() - { - var xml = _builder.Build(); - var original = xml.GetElementById(1173.ToString()); - Assert.IsNotNull(original); - - var parentNode = (XmlElement)original.Clone(); - - XmlHelper.SortNodes( - parentNode, - "./* [@id]", - x => x.AttributeValue("sortOrder")); - - // do assertions just to make sure it is working properly. - var currSort = 0; - foreach (var child in parentNode.SelectNodes("./* [@id]").Cast()) - { - Assert.AreEqual(currSort, int.Parse(child.Attributes["sortOrder"].Value)); - currSort++; - } - - // ensure the parent node's properties still exist first - Assert.AreEqual("content", parentNode.ChildNodes[0].Name); - Assert.AreEqual("umbracoUrlAlias", parentNode.ChildNodes[1].Name); - - // then the child nodes should come straight after - Assert.IsTrue(parentNode.ChildNodes[2].Attributes["id"] != null); - } - - /// - /// This was the logic to sort before and now lives here just to show the benchmarks tests above. - /// - private static void LegacySortNodes(ref XmlNode parentNode) - { - var n = parentNode.CloneNode(true); - - // remove all children from original node - var xpath = "./* [@id]"; - foreach (XmlNode child in parentNode.SelectNodes(xpath)) - { - parentNode.RemoveChild(child); - } - - var nav = n.CreateNavigator(); - var expr = nav.Compile(xpath); - expr.AddSort("@sortOrder", XmlSortOrder.Ascending, XmlCaseOrder.None, string.Empty, XmlDataType.Number); - var iterator = nav.Select(expr); - while (iterator.MoveNext()) - { - parentNode.AppendChild( - ((IHasXmlNode)iterator.Current).GetNode()); - } - } -} diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Editors/UserEditorAuthorizationHelperTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Editors/UserEditorAuthorizationHelperTests.cs index f50a81418e..116ab2dfa3 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Editors/UserEditorAuthorizationHelperTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Editors/UserEditorAuthorizationHelperTests.cs @@ -13,6 +13,7 @@ using Umbraco.Cms.Core.Models.Entities; using Umbraco.Cms.Core.Models.Membership; using Umbraco.Cms.Core.Models.Membership.Permissions; using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Infrastructure.Migrations.Install; using Umbraco.Cms.Tests.Common.Builders; using Umbraco.Cms.Tests.Common.Builders.Extensions; @@ -108,9 +109,9 @@ public class UserEditorAuthorizationHelperTests [Test] [TestCase(Constants.Security.AdminGroupAlias, Constants.Security.AdminGroupAlias, ExpectedResult = true)] [TestCase(Constants.Security.AdminGroupAlias, "SomethingElse", ExpectedResult = true)] - [TestCase(Constants.Security.EditorGroupAlias, Constants.Security.AdminGroupAlias, ExpectedResult = false)] - [TestCase(Constants.Security.EditorGroupAlias, "SomethingElse", ExpectedResult = false)] - [TestCase(Constants.Security.EditorGroupAlias, Constants.Security.EditorGroupAlias, ExpectedResult = true)] + [TestCase(DatabaseDataCreator.EditorGroupAlias, Constants.Security.AdminGroupAlias, ExpectedResult = false)] + [TestCase(DatabaseDataCreator.EditorGroupAlias, "SomethingElse", ExpectedResult = false)] + [TestCase(DatabaseDataCreator.EditorGroupAlias, DatabaseDataCreator.EditorGroupAlias, ExpectedResult = true)] public bool Can_only_add_user_groups_you_are_part_of_yourself_unless_you_are_admin( string groupAlias, string groupToAdd) diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Scoping/ScopeUnitTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Scoping/ScopeUnitTests.cs index 4f3cd4775f..f725ec3be0 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Scoping/ScopeUnitTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Scoping/ScopeUnitTests.cs @@ -39,8 +39,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Infrastructure.Scoping Mock.Of(), loggerFactory.CreateLogger(), Mock.Of(), - Mock.Of(), - Options.Create(new ContentSettings())); + Mock.Of()); var databaseFactory = new Mock(); var database = new Mock(); var sqlContext = new Mock(); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberUserStoreTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberUserStoreTests.cs index 798de33e3b..8b388a482d 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberUserStoreTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/MemberUserStoreTests.cs @@ -243,7 +243,7 @@ public class MemberUserStoreTests }; _mockMemberService.Setup(x => x.GetById(mockMember.Id)).Returns(mockMember); - _mockMemberService.Setup(x => x.GetByKey(mockMember.Key)).Returns(mockMember); + _mockMemberService.Setup(x => x.GetById(mockMember.Key)).Returns(mockMember); _mockMemberService.Setup(x => x.Delete(mockMember, Constants.Security.SuperUserId)); // act @@ -252,7 +252,7 @@ public class MemberUserStoreTests // assert Assert.IsTrue(identityResult.Succeeded); Assert.IsTrue(!identityResult.Errors.Any()); - _mockMemberService.Verify(x => x.GetByKey(mockMember.Key)); + _mockMemberService.Verify(x => x.GetById(mockMember.Key)); _mockMemberService.Verify(x => x.Delete(mockMember, Constants.Security.SuperUserId)); _mockMemberService.VerifyNoOtherCalls(); } diff --git a/tools/Umbraco.JsonSchema/UmbracoCmsSchema.cs b/tools/Umbraco.JsonSchema/UmbracoCmsSchema.cs index f6d2be89a9..63ae6b1efa 100644 --- a/tools/Umbraco.JsonSchema/UmbracoCmsSchema.cs +++ b/tools/Umbraco.JsonSchema/UmbracoCmsSchema.cs @@ -59,18 +59,12 @@ internal class UmbracoCmsSchema public required UnattendedSettings Unattended { get; set; } - [Obsolete("Runtime minification is no longer supported. Will be removed entirely in V16.")] - public required RuntimeMinificationSettings RuntimeMinification { get; set; } - public required BasicAuthSettings BasicAuth { get; set; } public required PackageMigrationSettings PackageMigration { get; set; } public required LegacyPasswordMigrationSettings LegacyPasswordMigration { get; set; } - [Obsolete("Scheduled for removal in v16, dashboard manipulation is now done trough frontend extensions.")] - public required ContentDashboardSettings ContentDashboard { get; set; } - public required HelpPageSettings HelpPage { get; set; } public required InstallDefaultDataNamedOptions InstallDefaultData { get; set; }