diff --git a/.gitignore b/.gitignore index 7fff577..681eea9 100644 --- a/.gitignore +++ b/.gitignore @@ -250,4 +250,8 @@ Cached/ build/_nuget src/Our.Umbraco.AuthU.TestHarness src/Our.Umbraco.AuthU.Web -src/Our.Umbraco.AuthU.Matt.* \ No newline at end of file +src/Our.Umbraco.AuthU.Matt.* + +# Ignore umbraco folders restored by nuget +src/Our.Umbraco.HeadRest/wwwroot/umbraco +src/Our.Umbraco.HeadRest/umbraco diff --git a/README.md b/README.md index a2ae99d..e6b2182 100644 --- a/README.md +++ b/README.md @@ -14,38 +14,31 @@ Out of the box HeadRest is configured to use UmbracoMapper to perform it's mappi PM> Install-Package Our.Umbraco.HeadRest ## Configuration -In order to configure HeadRest you will first of all need to create an Umbraco composer + compontent combination, resolving the HeadRest service from the DI container like so: +In order to configure HeadRest you will first of all need to create an Umbraco composer: + ````csharp - public class HeadRestConfigComponent : IComponent + public class HeadRestConfigComposer : IComposer { - private readonly HeadRest _headRest; - - public HeadRestConfigComponent(HeadRest headRest) - => _headRest = headRest; - - public void Initialize() + public void Compose(IUmbracoBuilder builder) { // Configuration goes here } - - public void Terminate() { } } - public class HeadRestConfigComposer : ComponentComposer - { } + public void Terminate() { } ```` -From within the `Initialize` method, you can then configure your endpoint(s) via the `ConfigureEndpoint` method on the resolved HeadRest service instance: +From within the `Compose` method, you can then configure your endpoint(s) via the `ConfigureEndpoint` method on a new instance of the HeadRest service: ````csharp ... - _headRest.ConfigureEndpoint(...); + new HeadRest().ConfigureEndpoint(...); ... ```` ### Basic Configuration For the most basic implementation, the following minimal configuration is all that is needed: ````csharp - _headRest.ConfigureEndpoint(new HeadRestOptions { + new HeadRest().ConfigureEndpoint(new HeadRestOptions { ViewModelMappings = new HeadRestViewModelMap() .For(HomePage.ModelTypeAlias).MapTo() ... @@ -57,7 +50,7 @@ This will create an API endpoint at the path `/`, and will be anchored to the fi ### Advanced Configuration For a more advanced implementation, the following configuration shows all the supported options. ````csharp - _headRest.ConfigureEndpoint("/api/", "/root//nodeTypeAlias[1]", new HeadRestOptions { + new HeadRest().ConfigureEndpoint("/api/", "/root//nodeTypeAlias[1]", new HeadRestOptions { Mode = HeadRestEndpointMode.Dedicated, ControllerType = typeof(HeadRestController), Mapper = ctx => AutoMapper.Map(ctx.Content, ctx.ContentType, ctx.ViewModelType), @@ -100,7 +93,7 @@ This will create an endpoint at the url `/api/`, and will be anchored to the nod ````csharp public class MyHeadRestMapDefinition : IMapDefinition { - public void DefineMaps(UmbracoMapper mapper) + public void DefineMaps(IUmbracoMapper mapper) { mapper.Define( (frm, ctx) => ..., // Constructor function @@ -108,9 +101,9 @@ This will create an endpoint at the url `/api/`, and will be anchored to the nod } } - public class MyHeadRestMapDefinisionComposer : IUserComposer + public class MyHeadRestMapDefinisionComposer : IComposer { - public void Compose(Composition composition) + public void Compose(IUmbracoBuilder builder) { composition.WithCollectionBuilder() .Add(); @@ -130,7 +123,7 @@ This will create an endpoint at the url `/api/`, and will be anchored to the nod | Supports mixed install | Yes. You can have a headless API + website in one install | No. Headless only install | | Supports custom backend code | Yes | No | | Client libraries available | None. Roll your own | .NET Framework, .NET Core, Node.js | -| Hosting | Installs to any Umbraco version (7.12+) | Umbraco Cloud service only | +| Hosting | Installs to any Umbraco version (9.0+) | Umbraco Cloud service only | | Support | Limited community support | HQ Supported | ## Contributing To This Project diff --git a/src/Our.Umbraco.HeadRest/Composing/HeadRestComponent.cs b/src/Our.Umbraco.HeadRest/Composing/HeadRestComponent.cs deleted file mode 100644 index e14ba30..0000000 --- a/src/Our.Umbraco.HeadRest/Composing/HeadRestComponent.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Web.Routing; -using Umbraco.Core.Composing; -using Umbraco.Web; - -namespace Our.Umbraco.HeadRest.Composing -{ - public class HeadRestComponent : IComponent - { - public void Initialize() - { - RouteTable.Routes.IgnoreStandardExclusions(); - } - - public void Terminate() - { } - } -} diff --git a/src/Our.Umbraco.HeadRest/Composing/HeadRestComposer.cs b/src/Our.Umbraco.HeadRest/Composing/HeadRestComposer.cs index 7f5997d..ab37079 100644 --- a/src/Our.Umbraco.HeadRest/Composing/HeadRestComposer.cs +++ b/src/Our.Umbraco.HeadRest/Composing/HeadRestComposer.cs @@ -1,26 +1,24 @@ -using Our.Umbraco.HeadRest.Mapping; +using Microsoft.Extensions.DependencyInjection; +using Our.Umbraco.HeadRest.Mapping; using Our.Umbraco.HeadRest.Web.Routing; -using Umbraco.Core; -using Umbraco.Core.Composing; -using Umbraco.Core.Mapping; -using Umbraco.Web.Routing; +using Umbraco.Cms.Core.Composing; +using Umbraco.Cms.Core.DependencyInjection; +using Umbraco.Cms.Core.Mapping; +using Umbraco.Cms.Core.Routing; namespace Our.Umbraco.HeadRest.Composing { - public class HeadRestComposer : IUserComposer + public class HeadRestComposer : IComposer { - public void Compose(Composition composition) + public void Compose(IUmbracoBuilder builder) { - composition.WithCollectionBuilder() + builder.WithCollectionBuilder() .InsertBefore(); - composition.WithCollectionBuilder() + builder.WithCollectionBuilder() .Add(); - composition.Register(); - - composition.Components() - .Append(); + builder.Services.AddTransient(); } } } diff --git a/src/Our.Umbraco.HeadRest/HeadRest.cs b/src/Our.Umbraco.HeadRest/HeadRest.cs index c6801a3..0816746 100644 --- a/src/Our.Umbraco.HeadRest/HeadRest.cs +++ b/src/Our.Umbraco.HeadRest/HeadRest.cs @@ -1,11 +1,18 @@ using System; -using System.Web.Routing; using System.Collections.Concurrent; -using Umbraco.Web; -using Umbraco.Core; -using Our.Umbraco.HeadRest.Web.Routing; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.Extensions.DependencyInjection; +using Our.Umbraco.HeadRest.Interfaces; using Our.Umbraco.HeadRest.Web.Controllers; -using Umbraco.Core.Mapping; +using Our.Umbraco.HeadRest.Web.Models; +using Our.Umbraco.HeadRest.Web.Routing; +using Umbraco.Cms.Core.DependencyInjection; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Core.Web; +using Umbraco.Cms.Web.Common.ApplicationBuilder; +using Umbraco.Extensions; namespace Our.Umbraco.HeadRest { @@ -18,30 +25,25 @@ public class HeadRest internal static ConcurrentDictionary Configs = new ConcurrentDictionary(); - private readonly UmbracoMapper _mapper; - - public HeadRest(UmbracoMapper mapper) - => _mapper = mapper; - - public void ConfigureEndpoint(HeadRestOptions options) + public void ConfigureEndpoint(IUmbracoBuilder builder, HeadRestOptions options) { - ConfigureEndpoint("/", "/root/*[@isDoc][1]", options); + ConfigureEndpoint("/", "/root/*[@isDoc][1]", builder, options); } - public void ConfigureEndpoint(string basePath, HeadRestOptions options) + public void ConfigureEndpoint(string basePath, IUmbracoBuilder builder, HeadRestOptions options) { - ConfigureEndpoint(basePath, "/root/*[@isDoc][1]", options); + ConfigureEndpoint(basePath, "/root/*[@isDoc][1]", builder, options); } - public void ConfigureEndpoint(string basePath, string rootNodeXPath, HeadRestOptions options) + public void ConfigureEndpoint(string basePath, string rootNodeXPath, IUmbracoBuilder builder, HeadRestOptions options) { - var config = _mapper.Map(options); + var config = new HeadRestConfig(options); config.BasePath = basePath; config.RootNodeXPath = rootNodeXPath; - ConfigureEndpoint(config); + ConfigureEndpoint(builder, config); } - private void ConfigureEndpoint(HeadRestConfig config) + private void ConfigureEndpoint(IUmbracoBuilder builder, HeadRestConfig config) { ValidateConfig(config); @@ -49,17 +51,28 @@ private void ConfigureEndpoint(HeadRestConfig config) { if (Configs.TryAdd(config.BasePath, config)) { - RouteTable.Routes.MapUmbracoRoute( - $"HeadRest_{config.BasePath.Trim('/').Replace("/", "_")}", - config.BasePath.EnsureEndsWith("/").TrimStart("/") + "{*"+ RoutePathKey + "}", - new + // from https://docs.umbraco.com/umbraco-cms/reference/routing/custom-routes + builder.Services.Configure(options => + { + var controllerName = config.ControllerType.Name; + options.AddFilter(new UmbracoPipelineFilter(controllerName) { - controller = config.ControllerType.Name.TrimEnd("Controller"), - action = "Index", - headRestConfig = config - }, - new HeadRestRouteHandler(config), - new { path = new UmbracoRoutesConstraint() }); + Endpoints = app => app.UseEndpoints(endpoints => + { + endpoints.MapControllerRoute( + $"HeadRest_{config.BasePath.Trim('/').Replace("/", "_")}", + config.BasePath.EnsureEndsWith("/").TrimStart("/") + "{*" + RoutePathKey + "}", + new + { + controller = config.ControllerType.Name.TrimEnd("Controller"), + action = "Index", + headRestConfig = config + }, + constraints: new { path = new UmbracoRoutesConstraint() } + ).ForUmbracoPage(FindContent); + }) + }); + }); } } } @@ -76,5 +89,46 @@ private static void ValidateConfig(HeadRestConfig config) throw new Exception("ViewModelMappings can not be null"); } } + + private static IPublishedContent FindContent(ActionExecutingContext actionExecutingContext) + { + var config = actionExecutingContext.RouteData.Values[HeadRest.ControllerConfigKey] as IHeadRestConfig; + + var nodeXPath = config.RootNodeXPath; + + if (actionExecutingContext.RouteData?.Values != null) + { + if (actionExecutingContext.RouteData.Values.ContainsKey(HeadRest.RoutePathKey) + && actionExecutingContext.RouteData.Values[HeadRest.RoutePathKey] != null) + { + var path = actionExecutingContext.RouteData.Values[HeadRest.RoutePathKey].ToString(); + + // Check for a configured custom route + if (config.CustomRouteMappings != null) + { + var match = config.CustomRouteMappings.GetRouteMapFor(path); + if (match != null) + { + path = match.Target; + + actionExecutingContext.RouteData.Values.Add(HeadRest.RouteMapMatchKey, match); + } + } + + // Construct xpath from path + var pathParts = path.Trim('/').Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + foreach (var pathPart in pathParts) + { + nodeXPath += $"/*[@urlName='{pathPart}'][1]"; + } + } + } + + var ctx = actionExecutingContext.HttpContext.RequestServices.GetRequiredService(); + + var node = ctx.GetRequiredUmbracoContext().Content.GetSingleByXPath(nodeXPath); + + return node ?? new NotFoundPublishedContent(); + } } } \ No newline at end of file diff --git a/src/Our.Umbraco.HeadRest/HeadRestConfig.cs b/src/Our.Umbraco.HeadRest/HeadRestConfig.cs index b13da58..12cbfb8 100644 --- a/src/Our.Umbraco.HeadRest/HeadRestConfig.cs +++ b/src/Our.Umbraco.HeadRest/HeadRestConfig.cs @@ -4,6 +4,17 @@ namespace Our.Umbraco.HeadRest { internal class HeadRestConfig : HeadRestOptions, IHeadRestConfig { + public HeadRestConfig() { } + + public HeadRestConfig(HeadRestOptions options) : base() + { + Mode = options.Mode; + ControllerType = options.ControllerType; + Mapper = options.Mapper; + ViewModelMappings = options.ViewModelMappings; + CustomRouteMappings = options.CustomRouteMappings; + } + public string BasePath { get; set; } public string RootNodeXPath { get; set; } } diff --git a/src/Our.Umbraco.HeadRest/HeadRestOptions.cs b/src/Our.Umbraco.HeadRest/HeadRestOptions.cs index 46aa171..05c775c 100644 --- a/src/Our.Umbraco.HeadRest/HeadRestOptions.cs +++ b/src/Our.Umbraco.HeadRest/HeadRestOptions.cs @@ -1,11 +1,13 @@ using System; using System.Linq; +using Microsoft.Extensions.DependencyInjection; +using NPoco; using Our.Umbraco.HeadRest.Interfaces; using Our.Umbraco.HeadRest.Web.Controllers; using Our.Umbraco.HeadRest.Web.Mapping; using Our.Umbraco.HeadRest.Web.Routing; -using Umbraco.Core.Composing; -using Umbraco.Core.Mapping; +using Umbraco.Cms.Core.Mapping; +using Umbraco.Extensions; namespace Our.Umbraco.HeadRest { @@ -21,7 +23,9 @@ public HeadRestOptions() { Mode = HeadRestEndpointMode.Dedicated; ControllerType = typeof(HeadRestController); - Mapper = (ctx) => { + Mapper = (ctx) => + { + var mapper = ctx.HttpContext.RequestServices.GetRequiredService(); // Currently have to call the UmbracoMapper.Map function // via reflection as there are no non-generic versions @@ -30,8 +34,8 @@ public HeadRestOptions() // on https://github.com/umbraco/Umbraco-CMS/issues/6250 // and if this ever changes, we should switch to use the // map methods instead - var mapFunc = typeof(UmbracoMapper).GetMethods() - .First(m => m.Name == "Map" + var mapFunc = mapper.GetType().GetMethods() + .First(m => m.Name == nameof(mapper.Map) && m.GetGenericArguments().Count() == 1 && m.GetParameters() .Select(p => p.ParameterType) @@ -44,8 +48,7 @@ public HeadRestOptions() var ctxAction = new Action(x => x.SetHeadRestMappingContext(ctx)); - return mapFunc.Invoke(Current.Mapper, new object[] { ctx.Content, ctxAction }); - + return mapFunc.Invoke(mapper, new object[] { ctx.Content, ctxAction }); }; } } diff --git a/src/Our.Umbraco.HeadRest/Mapping/HeadRestMapDefinition.cs b/src/Our.Umbraco.HeadRest/Mapping/HeadRestMapDefinition.cs index 4ed136b..b51f7c0 100644 --- a/src/Our.Umbraco.HeadRest/Mapping/HeadRestMapDefinition.cs +++ b/src/Our.Umbraco.HeadRest/Mapping/HeadRestMapDefinition.cs @@ -1,10 +1,10 @@ -using Umbraco.Core.Mapping; +using Umbraco.Cms.Core.Mapping; namespace Our.Umbraco.HeadRest.Mapping { public class HeadRestMapDefinition : IMapDefinition { - public void DefineMaps(UmbracoMapper mapper) + public void DefineMaps(IUmbracoMapper mapper) { mapper.Define( (src, ctx) => new HeadRestConfig(), diff --git a/src/Our.Umbraco.HeadRest/Our.Umbraco.HeadRest.csproj b/src/Our.Umbraco.HeadRest/Our.Umbraco.HeadRest.csproj index 868b5b0..4b17831 100644 --- a/src/Our.Umbraco.HeadRest/Our.Umbraco.HeadRest.csproj +++ b/src/Our.Umbraco.HeadRest/Our.Umbraco.HeadRest.csproj @@ -1,288 +1,22 @@ - - - - - Debug - AnyCPU - {AB6DCB6D-A8F0-4627-906C-77EB840276F1} - Library - Properties - Our.Umbraco.HeadRest - Our.Umbraco.HeadRest - v4.7.2 - 512 - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\ClientDependency.1.9.7\lib\net45\ClientDependency.Core.dll - - - ..\packages\ClientDependency-Mvc5.1.8.0.0\lib\net45\ClientDependency.Core.Mvc.dll - - - ..\packages\CSharpTest.Net.Collections.14.906.1403.1082\lib\net40\CSharpTest.Net.Collections.dll - - - ..\packages\Examine.1.0.0\lib\net452\Examine.dll - - - ..\packages\HtmlAgilityPack.1.8.14\lib\Net45\HtmlAgilityPack.dll - - - ..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll - - - ..\packages\ImageProcessor.2.7.0.100\lib\net452\ImageProcessor.dll - - - ..\packages\ImageProcessor.Web.4.8.7\lib\net45\ImageProcessor.Web.dll - - - ..\packages\LightInject.5.4.0\lib\net46\LightInject.dll - - - ..\packages\LightInject.Annotation.1.1.0\lib\net46\LightInject.Annotation.dll - - - ..\packages\LightInject.Mvc.2.0.0\lib\net46\LightInject.Mvc.dll - - - ..\packages\LightInject.Web.2.0.0\lib\net46\LightInject.Web.dll - - - ..\packages\LightInject.WebApi.2.0.0\lib\net46\LightInject.WebApi.dll - - - ..\packages\Log4Net.Async.2.0.4\lib\net40\Log4Net.Async.dll - - - ..\packages\Lucene.Net.3.0.3\lib\NET40\Lucene.Net.dll - - - ..\packages\Markdown.2.2.1\lib\net451\Markdown.dll - - - ..\packages\Microsoft.AspNet.Identity.Core.2.2.2\lib\net45\Microsoft.AspNet.Identity.Core.dll - - - ..\packages\Microsoft.AspNet.Identity.Owin.2.2.2\lib\net45\Microsoft.AspNet.Identity.Owin.dll - - - ..\packages\Microsoft.AspNet.SignalR.Core.2.4.0\lib\net45\Microsoft.AspNet.SignalR.Core.dll - - - ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - ..\packages\Microsoft.IO.RecyclableMemoryStream.1.2.2\lib\net45\Microsoft.IO.RecyclableMemoryStream.dll - - - ..\packages\Microsoft.Owin.4.0.1\lib\net45\Microsoft.Owin.dll - - - ..\packages\Microsoft.Owin.Host.SystemWeb.4.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll - - - ..\packages\Microsoft.Owin.Security.4.0.1\lib\net45\Microsoft.Owin.Security.dll - - - ..\packages\Microsoft.Owin.Security.Cookies.4.0.1\lib\net45\Microsoft.Owin.Security.Cookies.dll - - - ..\packages\Microsoft.Owin.Security.OAuth.4.0.1\lib\net45\Microsoft.Owin.Security.OAuth.dll - - - ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - - ..\packages\MiniProfiler.4.0.138\lib\net461\MiniProfiler.dll - - - ..\packages\MiniProfiler.Shared.4.0.138\lib\net461\MiniProfiler.Shared.dll - - - ..\packages\MySql.Data.6.9.12\lib\net45\MySql.Data.dll - - - ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\NPoco.3.9.4\lib\net45\NPoco.dll - - - ..\packages\Owin.1.0\lib\net40\Owin.dll - - - ..\packages\Semver.2.0.4\lib\net452\Semver.dll - - - ..\packages\Serilog.2.8.0\lib\net46\Serilog.dll - - - ..\packages\Serilog.Enrichers.Process.2.0.1\lib\net45\Serilog.Enrichers.Process.dll - - - ..\packages\Serilog.Enrichers.Thread.3.0.0\lib\net45\Serilog.Enrichers.Thread.dll - - - ..\packages\Serilog.Filters.Expressions.2.0.0\lib\net45\Serilog.Filters.Expressions.dll - - - ..\packages\Serilog.Formatting.Compact.1.0.0\lib\net45\Serilog.Formatting.Compact.dll - - - ..\packages\Serilog.Formatting.Compact.Reader.1.0.3\lib\net45\Serilog.Formatting.Compact.Reader.dll - - - ..\packages\Serilog.Settings.AppSettings.2.2.2\lib\net45\Serilog.Settings.AppSettings.dll - - - ..\packages\Serilog.Sinks.Async.1.3.0\lib\net45\Serilog.Sinks.Async.dll - - - ..\packages\Serilog.Sinks.File.4.0.0\lib\net45\Serilog.Sinks.File.dll - - - ..\packages\Serilog.Sinks.Map.1.0.0\lib\netstandard2.0\Serilog.Sinks.Map.dll - - - ..\packages\Superpower.2.0.0\lib\net45\Superpower.dll - - - - - - - - ..\packages\Umbraco.SqlServerCE.4.0.0.1\lib\net472\System.Data.SqlServerCe.dll - - - ..\packages\Umbraco.SqlServerCE.4.0.0.1\lib\net472\System.Data.SqlServerCe.Entity.dll - - - ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll - - - - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll - - - - - - - - ..\packages\System.Threading.Tasks.Dataflow.4.9.0\lib\netstandard2.0\System.Threading.Tasks.Dataflow.dll - - - - ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll - - - - - ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll - - - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll - - - ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll - - - ..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll - - - ..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll - - - ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll - - - ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll - - - ..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll - - - - - - - - - ..\packages\UmbracoCms.Core.8.1.3\lib\net472\Umbraco.Core.dll - - - ..\packages\UmbracoCms.Web.8.1.3\lib\net472\Umbraco.Examine.dll - - - ..\packages\UmbracoCms.Web.8.1.3\lib\net472\Umbraco.Web.dll - - - ..\packages\UmbracoCms.Web.8.1.3\lib\net472\Umbraco.Web.UI.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - - - + + - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + net5.0 + Debug;Release + false + true + Matt Brailsford + Matt Brailsford + 2.0.0 + Copyright © Matt Brailsford 2023 + https://github.com/mattbrailsford/umbraco-headrest + https://github.com/mattbrailsford/umbraco-headrest + HeadRest + Library - - + + + + + \ No newline at end of file diff --git a/src/Our.Umbraco.HeadRest/Properties/AssemblyInfo.cs b/src/Our.Umbraco.HeadRest/Properties/AssemblyInfo.cs deleted file mode 100644 index ee96ed1..0000000 --- a/src/Our.Umbraco.HeadRest/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Our.Umbraco.HeadRest")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Matt Brailsford")] -[assembly: AssemblyProduct("Our.Umbraco.HeadRest")] -[assembly: AssemblyCopyright("Copyright © Matt Brailsford 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ab6dcb6d-a8f0-4627-906c-77eb840276f1")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Our.Umbraco.HeadRest/Properties/VersionInfo.cs b/src/Our.Umbraco.HeadRest/Properties/VersionInfo.cs deleted file mode 100644 index 62f8b5a..0000000 --- a/src/Our.Umbraco.HeadRest/Properties/VersionInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyInformationalVersion("1.0.0-alpha-000100")] - - diff --git a/src/Our.Umbraco.HeadRest/Properties/launchSettings.json b/src/Our.Umbraco.HeadRest/Properties/launchSettings.json new file mode 100644 index 0000000..9bd6fb4 --- /dev/null +++ b/src/Our.Umbraco.HeadRest/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "Our.Umbraco.HeadRest": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:55715;http://localhost:55716" + } + } +} \ No newline at end of file diff --git a/src/Our.Umbraco.HeadRest/UmbracoMapperContextExtensions.cs b/src/Our.Umbraco.HeadRest/UmbracoMapperContextExtensions.cs index fe9ad58..ff497bf 100644 --- a/src/Our.Umbraco.HeadRest/UmbracoMapperContextExtensions.cs +++ b/src/Our.Umbraco.HeadRest/UmbracoMapperContextExtensions.cs @@ -1,5 +1,5 @@ using Our.Umbraco.HeadRest.Web.Mapping; -using Umbraco.Core.Mapping; +using Umbraco.Cms.Core.Mapping; namespace Our.Umbraco.HeadRest { diff --git a/src/Our.Umbraco.HeadRest/Web/Controllers/AuthorizedHeadRestController.cs b/src/Our.Umbraco.HeadRest/Web/Controllers/AuthorizedHeadRestController.cs index b73171e..be18b6e 100644 --- a/src/Our.Umbraco.HeadRest/Web/Controllers/AuthorizedHeadRestController.cs +++ b/src/Our.Umbraco.HeadRest/Web/Controllers/AuthorizedHeadRestController.cs @@ -1,15 +1,39 @@ -using System.Web.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Mvc.ViewEngines; +using Microsoft.Extensions.Logging; using Our.Umbraco.HeadRest.Web.Mvc; -using Umbraco.Web.Models; +using Umbraco.Cms.Core.Web; +using Umbraco.Cms.Web.Common.Controllers; namespace Our.Umbraco.HeadRest.Web.Controllers { public class AuthorizedHeadRestController : HeadRestController { - [HeadRestAuthorize] - public override ActionResult Index(ContentModel model) + public AuthorizedHeadRestController(ILogger logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor) + : base(logger, compositeViewEngine, umbracoContextAccessor) { - return base.Index(model); + + } + + [Authorize] + public override IActionResult Index() + { + return base.Index(); + } + + public override void OnActionExecuted(ActionExecutedContext context) + { + context.HttpContext.Response.StatusCode = 401; + + // This doesn't exist in netcore - do we need it? + // context.HttpContext.Response.SuppressFormsAuthenticationRedirect = true; + + context.Result = new HeadRestResult + { + Data = new { Message = "Not authorized" } + }; } } } diff --git a/src/Our.Umbraco.HeadRest/Web/Controllers/HeadRestController.cs b/src/Our.Umbraco.HeadRest/Web/Controllers/HeadRestController.cs index f11ab3c..5bcd452 100644 --- a/src/Our.Umbraco.HeadRest/Web/Controllers/HeadRestController.cs +++ b/src/Our.Umbraco.HeadRest/Web/Controllers/HeadRestController.cs @@ -1,17 +1,29 @@ using System; -using System.Web.Mvc; -using Umbraco.Web.Models; -using Umbraco.Web.Mvc; -using Our.Umbraco.HeadRest.Web.Mvc; -using Our.Umbraco.HeadRest.Web.Mapping; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.ViewEngines; +using Microsoft.Extensions.Logging; using Our.Umbraco.HeadRest.Interfaces; +using Our.Umbraco.HeadRest.Web.Mapping; using Our.Umbraco.HeadRest.Web.Models; +using Our.Umbraco.HeadRest.Web.Mvc; +using Umbraco.Cms.Core.Web; +using Umbraco.Cms.Web.Common.Controllers; +using Umbraco.Cms.Web.Common.Routing; +using Umbraco.Extensions; namespace Our.Umbraco.HeadRest.Web.Controllers { - [HeadRestExceptionFilter] - public class HeadRestController : RenderMvcController + [TypeFilter(typeof(HeadRestExceptionFilter))] + public class HeadRestController : UmbracoPageController { + private readonly IUmbracoContextAccessor _umbracoContextAccessor; + + public HeadRestController(ILogger logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor) + : base(logger, compositeViewEngine) + { + _umbracoContextAccessor = umbracoContextAccessor; + } + internal IHeadRestConfig Config { get @@ -20,10 +32,12 @@ internal IHeadRestConfig Config } } - public override ActionResult Index(ContentModel model) + public virtual IActionResult Index() { + var content = CurrentPage; + // Check for 404 - if (model.Content is NotFoundPublishedContent) + if (content is NotFoundPublishedContent) { Response.StatusCode = 404; @@ -34,25 +48,26 @@ public override ActionResult Index(ContentModel model) } // Process the model mapping request - var contentTypeAlias = model.Content.ContentType.Alias; + var umbracoContext = _umbracoContextAccessor.GetRequiredUmbracoContext(); + var contentTypeAlias = content.ContentType.Alias; var viewModelType = Config.ViewModelMappings.GetViewModelTypeFor(contentTypeAlias, new HeadRestPreMappingContext { Request = Request, HttpContext = HttpContext, - UmbracoContext = UmbracoContext + UmbracoContext = umbracoContext }); if (viewModelType == null) - throw new InvalidOperationException($"No view model map found for type '{contentTypeAlias}' at route {Request.Url}"); + throw new InvalidOperationException($"No view model map found for type '{contentTypeAlias}' at path {Request.Path}"); var viewModel = Config.Mapper.Invoke(new HeadRestMappingContext { - Content = model.Content, - ContentType = model.Content.GetType(), + Content = content, + ContentType = content.GetType(), ViewModelType = viewModelType, Request = Request, HttpContext = HttpContext, - UmbracoContext = UmbracoContext + UmbracoContext = umbracoContext }); return new HeadRestResult diff --git a/src/Our.Umbraco.HeadRest/Web/HttpRequestBaseExtensions.cs b/src/Our.Umbraco.HeadRest/Web/HttpRequestExtensions.cs similarity index 69% rename from src/Our.Umbraco.HeadRest/Web/HttpRequestBaseExtensions.cs rename to src/Our.Umbraco.HeadRest/Web/HttpRequestExtensions.cs index d04a497..855d88b 100644 --- a/src/Our.Umbraco.HeadRest/Web/HttpRequestBaseExtensions.cs +++ b/src/Our.Umbraco.HeadRest/Web/HttpRequestExtensions.cs @@ -1,19 +1,19 @@ -using Our.Umbraco.HeadRest.Web.Routing; -using System; +using System; using System.Collections.Generic; -using System.Web; +using Microsoft.AspNetCore.Http; +using Our.Umbraco.HeadRest.Web.Routing; namespace Our.Umbraco.HeadRest.Web { - public static class HttpRequestBaseExtensions + public static class HttpRequestExtensions { - public static string HeadRestRouteParam(this HttpRequestBase request, int index, string defaultValue = null) + public static string HeadRestRouteParam(this HttpRequest request, int index, string defaultValue = null) { var routeParams = request.HeadRestRouteParams(); return routeParams?[index]; } - public static TType HeadRestRouteParam(this HttpRequestBase request, int index, TType defaultValue = default(TType)) + public static TType HeadRestRouteParam(this HttpRequest request, int index, TType defaultValue = default(TType)) { var param = request.HeadRestRouteParam(index); if (param == null || string.IsNullOrWhiteSpace(param.ToString())) @@ -25,13 +25,13 @@ public static string HeadRestRouteParam(this HttpRequestBase request, int index, : defaultValue; } - public static string HeadRestRouteParam(this HttpRequestBase request, string name, string defaultValue = null) + public static string HeadRestRouteParam(this HttpRequest request, string name, string defaultValue = null) { var routeParams = request.HeadRestRouteParams(); return routeParams?[name]; } - public static TType HeadRestRouteParam(this HttpRequestBase request, string name, TType defaultValue = default(TType)) + public static TType HeadRestRouteParam(this HttpRequest request, string name, TType defaultValue = default(TType)) { var param = request.HeadRestRouteParam(name); if (param == null || string.IsNullOrWhiteSpace(param.ToString())) @@ -43,15 +43,16 @@ public static string HeadRestRouteParam(this HttpRequestBase request, string nam : defaultValue; } - private static HeadRestRouteParamsCollection HeadRestRouteParams(this HttpRequestBase request) + private static HeadRestRouteParamsCollection HeadRestRouteParams(this HttpRequest request) { - if (request.RequestContext?.RouteData?.Values == null) + var routeValues = request.HttpContext.Request.RouteValues; + if (routeValues?.Values == null) return null; - if (!request.RequestContext.RouteData.Values.ContainsKey(HeadRest.RouteMapMatchKey)) + if (!routeValues.ContainsKey(HeadRest.RouteMapMatchKey)) return null; - var routeMap = request.RequestContext.RouteData.Values[HeadRest.RouteMapMatchKey] as HeadRestRouteMapMatch; + var routeMap = routeValues[HeadRest.RouteMapMatchKey] as HeadRestRouteMapMatch; return routeMap?.Params; } diff --git a/src/Our.Umbraco.HeadRest/Web/Mapping/HeadRestMappingContext.cs b/src/Our.Umbraco.HeadRest/Web/Mapping/HeadRestMappingContext.cs index 06b4030..4f98cea 100644 --- a/src/Our.Umbraco.HeadRest/Web/Mapping/HeadRestMappingContext.cs +++ b/src/Our.Umbraco.HeadRest/Web/Mapping/HeadRestMappingContext.cs @@ -1,7 +1,7 @@ using System; -using System.Web; -using Umbraco.Core.Models.PublishedContent; -using Umbraco.Web; +using Microsoft.AspNetCore.Http; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.Web; namespace Our.Umbraco.HeadRest.Web.Mapping { @@ -18,9 +18,9 @@ public class HeadRestPreMappingContext public IPublishedContent Content { get; internal set; } public Type ContentType { get; internal set; } - public HttpRequestBase Request { get; internal set; } - public HttpContextBase HttpContext { get; internal set; } - public UmbracoContext UmbracoContext { get; internal set; } + public HttpRequest Request { get; internal set; } + public HttpContext HttpContext { get; internal set; } + public IUmbracoContext UmbracoContext { get; internal set; } internal HeadRestPreMappingContext() { } diff --git a/src/Our.Umbraco.HeadRest/Web/Models/NotFoundPublishedContent.cs b/src/Our.Umbraco.HeadRest/Web/Models/NotFoundPublishedContent.cs index 3fb9ef9..1feb6e0 100644 --- a/src/Our.Umbraco.HeadRest/Web/Models/NotFoundPublishedContent.cs +++ b/src/Our.Umbraco.HeadRest/Web/Models/NotFoundPublishedContent.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using Umbraco.Core.Models; -using Umbraco.Core.Models.PublishedContent; +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Models.PublishedContent; namespace Our.Umbraco.HeadRest.Web.Models { @@ -106,6 +106,8 @@ internal class NotFoundPublishedContentType : IPublishedContentType public IEnumerable PropertyTypes => Enumerable.Empty(); + public Guid Key => Guid.Empty; + public int GetPropertyIndex(string alias) => -1; public IPublishedPropertyType GetPropertyType(string alias) => null; diff --git a/src/Our.Umbraco.HeadRest/Web/Mvc/HeadRestAuthorizeAttribute.cs b/src/Our.Umbraco.HeadRest/Web/Mvc/HeadRestAuthorizeAttribute.cs deleted file mode 100644 index 01862e1..0000000 --- a/src/Our.Umbraco.HeadRest/Web/Mvc/HeadRestAuthorizeAttribute.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Web.Mvc; - -namespace Our.Umbraco.HeadRest.Web.Mvc -{ - internal class HeadRestAuthorizeAttribute : AuthorizeAttribute - { - protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext) - { - filterContext.HttpContext.Response.StatusCode = 401; - filterContext.HttpContext.Response.SuppressFormsAuthenticationRedirect = true; - filterContext.Result = new HeadRestResult - { - Data = new { Message = "Not authorized" } - }; - } - } -} diff --git a/src/Our.Umbraco.HeadRest/Web/Mvc/HeadRestExceptionFilterAttribute.cs b/src/Our.Umbraco.HeadRest/Web/Mvc/HeadRestExceptionFilter.cs similarity index 78% rename from src/Our.Umbraco.HeadRest/Web/Mvc/HeadRestExceptionFilterAttribute.cs rename to src/Our.Umbraco.HeadRest/Web/Mvc/HeadRestExceptionFilter.cs index e7e4f8f..8dc9c7f 100644 --- a/src/Our.Umbraco.HeadRest/Web/Mvc/HeadRestExceptionFilterAttribute.cs +++ b/src/Our.Umbraco.HeadRest/Web/Mvc/HeadRestExceptionFilter.cs @@ -1,8 +1,8 @@ -using System.Web.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; namespace Our.Umbraco.HeadRest.Web.Mvc { - internal class HeadRestExceptionFilterAttribute : FilterAttribute, IExceptionFilter + internal class HeadRestExceptionFilter : IExceptionFilter { public void OnException(ExceptionContext filterContext) { diff --git a/src/Our.Umbraco.HeadRest/Web/Mvc/HeadRestResult.cs b/src/Our.Umbraco.HeadRest/Web/Mvc/HeadRestResult.cs index 77b99bb..61b199e 100644 --- a/src/Our.Umbraco.HeadRest/Web/Mvc/HeadRestResult.cs +++ b/src/Our.Umbraco.HeadRest/Web/Mvc/HeadRestResult.cs @@ -1,15 +1,52 @@ -using Newtonsoft.Json; +using System; +using System.IO; +using System.Text; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; using Newtonsoft.Json.Serialization; -using Umbraco.Web.Mvc; namespace Our.Umbraco.HeadRest.Web.Mvc { - internal class HeadRestResult : JsonNetResult + internal class HeadRestResult : ActionResult { + public object Data { get; set; } + + public JsonSerializerSettings SerializerSettings { get; set; } + public Formatting Formatting { get; set; } + + /// + /// Default, unchanged JsonSerializerSettings + /// + public static readonly JsonSerializerSettings DefaultJsonSerializerSettings = new JsonSerializerSettings(); + public HeadRestResult() { - SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); - SerializerSettings.NullValueHandling = NullValueHandling.Ignore; + SerializerSettings = new JsonSerializerSettings() + { + ContractResolver = new CamelCasePropertyNamesContractResolver(), + NullValueHandling = NullValueHandling.Ignore + }; + } + + public override void ExecuteResult(ActionContext context) + { + if (context == null) + throw new ArgumentNullException(nameof(context)); + + var response = context.HttpContext.Response; + + response.ContentType = "application/json; charset=utf-8"; + + if (Data != null) + { + using (StreamWriter sw = new StreamWriter(response.Body, new UTF8Encoding(false))) + using (JsonTextWriter writer = new JsonTextWriter(sw) { Formatting = Formatting }) + { + var serializer = JsonSerializer.Create(SerializerSettings); + serializer.Serialize(writer, Data); + writer.Flush(); + } + } } } } diff --git a/src/Our.Umbraco.HeadRest/Web/Routing/HeadRestRouteHandler.cs b/src/Our.Umbraco.HeadRest/Web/Routing/HeadRestRouteHandler.cs deleted file mode 100644 index c59dcd8..0000000 --- a/src/Our.Umbraco.HeadRest/Web/Routing/HeadRestRouteHandler.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Our.Umbraco.HeadRest.Web.Models; -using System; -using System.Web.Routing; -using Umbraco.Core.Models.PublishedContent; -using Umbraco.Web; -using Umbraco.Web.Mvc; - -namespace Our.Umbraco.HeadRest.Web.Routing -{ - internal class HeadRestRouteHandler : UmbracoVirtualNodeRouteHandler - { - private HeadRestConfig _config; - - public HeadRestRouteHandler(HeadRestConfig config) - { - _config = config; - } - - protected override IPublishedContent FindContent(RequestContext requestContext, UmbracoContext umbracoContext) - { - var nodeXPath = _config.RootNodeXPath; - - if (requestContext?.RouteData?.Values != null) - { - if (requestContext.RouteData.Values.ContainsKey(HeadRest.RoutePathKey) - && requestContext.RouteData.Values[HeadRest.RoutePathKey] != null) - { - var path = requestContext.RouteData.Values[HeadRest.RoutePathKey].ToString(); - - // Check for a configured custom route - if (_config.CustomRouteMappings != null) - { - var match = _config.CustomRouteMappings.GetRouteMapFor(path); - if (match != null) - { - path = match.Target; - - requestContext.RouteData.Values.Add(HeadRest.RouteMapMatchKey, match); - } - } - - // Construct xpath from path - var pathParts = path.Trim('/').Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries); - foreach (var pathPart in pathParts) - { - nodeXPath += $"/*[@urlName='{pathPart}'][1]"; - } - } - } - - var node = umbracoContext.Content.GetSingleByXPath(nodeXPath); - - return node ?? new NotFoundPublishedContent(); - } - } -} diff --git a/src/Our.Umbraco.HeadRest/Web/Routing/HeadRestRouteMap.cs b/src/Our.Umbraco.HeadRest/Web/Routing/HeadRestRouteMap.cs index 7b9a890..41a791a 100644 --- a/src/Our.Umbraco.HeadRest/Web/Routing/HeadRestRouteMap.cs +++ b/src/Our.Umbraco.HeadRest/Web/Routing/HeadRestRouteMap.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Text.RegularExpressions; -using Umbraco.Core; +using Umbraco.Extensions; namespace Our.Umbraco.HeadRest.Web.Routing { diff --git a/src/Our.Umbraco.HeadRest/Web/Routing/HeadRestUrlProvider.cs b/src/Our.Umbraco.HeadRest/Web/Routing/HeadRestUrlProvider.cs index e0698dd..9cae1a7 100644 --- a/src/Our.Umbraco.HeadRest/Web/Routing/HeadRestUrlProvider.cs +++ b/src/Our.Umbraco.HeadRest/Web/Routing/HeadRestUrlProvider.cs @@ -1,44 +1,51 @@ using System; using System.Collections.Generic; using System.Linq; -using Umbraco.Core.Configuration; -using Umbraco.Core.Logging; -using Umbraco.Core; -using Umbraco.Core.Configuration.UmbracoSettings; -using Umbraco.Web; -using Umbraco.Web.Routing; -using Umbraco.Core.Models.PublishedContent; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.Routing; +using Umbraco.Cms.Core.Web; +using Umbraco.Extensions; namespace Our.Umbraco.HeadRest.Web.Routing { - internal class HeadRestUrlProvider : DefaultUrlProvider + internal class HeadRestUrlProvider : IUrlProvider { - public HeadRestUrlProvider(IRequestHandlerSection requestSettings, ILogger logger, - IGlobalSettings globalSettings, ISiteDomainHelper siteDomainHelper) - : base(requestSettings, logger, globalSettings, siteDomainHelper) - { } + private readonly IUmbracoContextAccessor _umbracoContextAccessor; + private readonly DefaultUrlProvider _defaultUrlProvider; - public override UrlInfo GetUrl(UmbracoContext umbracoContext, IPublishedContent content, UrlMode mode, string culture, Uri current) + public HeadRestUrlProvider(IUmbracoContextAccessor umbracoContextAccessor, DefaultUrlProvider defaultUrlProvider) { - var headRestUrl = GetHeadRestUrl(umbracoContext, content.Id, culture, HeadRestEndpointMode.Dedicated); + _umbracoContextAccessor = umbracoContextAccessor; + _defaultUrlProvider = defaultUrlProvider; + } + + public UrlInfo GetUrl(IPublishedContent content, UrlMode mode, string culture, Uri current) + { + var headRestUrl = GetHeadRestUrl(content.Id, culture, HeadRestEndpointMode.Dedicated); - return headRestUrl ?? base.GetUrl(umbracoContext, content, mode, culture, current); + return headRestUrl ?? _defaultUrlProvider.GetUrl(content, mode, culture, current); } - public override IEnumerable GetOtherUrls(UmbracoContext umbracoContext, int id, Uri current) + public IEnumerable GetOtherUrls(int id, Uri current) { - var headRestUrl = GetHeadRestUrl(umbracoContext, id, null, HeadRestEndpointMode.Mixed); + var headRestUrl = GetHeadRestUrl(id, null, HeadRestEndpointMode.Mixed); - return headRestUrl != null ? new[] { headRestUrl } : base.GetOtherUrls(umbracoContext, id, current); + return headRestUrl != null ? new[] { headRestUrl } : _defaultUrlProvider.GetOtherUrls(id, current); } - protected UrlInfo GetHeadRestUrl(UmbracoContext umbracoContext, int id, string culture, HeadRestEndpointMode endpointMode) + protected UrlInfo GetHeadRestUrl(int id, string culture, HeadRestEndpointMode endpointMode) { + var umbracoContext = _umbracoContextAccessor.GetRequiredUmbracoContext(); + var content = umbracoContext.Content.GetById(id); foreach (var headRestConfig in HeadRest.Configs.Values.Where(x => x.Mode == endpointMode)) { var rootNode = umbracoContext.Content.GetSingleByXPath(headRestConfig.RootNodeXPath); + + if (rootNode == null) + continue; + if (content.Path.StartsWith(rootNode.Path)) { var subUrl = string.Join("/", content.AncestorsOrSelf(true, x => x.Level > rootNode.Level) diff --git a/src/Our.Umbraco.HeadRest/Web/Routing/UmbracoRoutesConstraint.cs b/src/Our.Umbraco.HeadRest/Web/Routing/UmbracoRoutesConstraint.cs index 1bf491d..7a6d94f 100644 --- a/src/Our.Umbraco.HeadRest/Web/Routing/UmbracoRoutesConstraint.cs +++ b/src/Our.Umbraco.HeadRest/Web/Routing/UmbracoRoutesConstraint.cs @@ -1,7 +1,7 @@ -using System.Web.Routing; -using System.Web; -using System.Linq; +using System.Linq; using System.Text.RegularExpressions; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Routing; namespace Our.Umbraco.HeadRest.Web.Routing { @@ -13,7 +13,7 @@ internal class UmbracoRoutesConstraint : IRouteConstraint "^media/.*" }; - public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) + public bool Match(HttpContext httpContext, IRouter route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection) { return UmbracoReservedPaths.All(x => !Regex.IsMatch(("" + values["path"]), x)); } diff --git a/src/Our.Umbraco.HeadRest/app.config b/src/Our.Umbraco.HeadRest/app.config deleted file mode 100644 index 0d1387b..0000000 --- a/src/Our.Umbraco.HeadRest/app.config +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Our.Umbraco.HeadRest/appsettings-schema.Umbraco.Cms.json b/src/Our.Umbraco.HeadRest/appsettings-schema.Umbraco.Cms.json new file mode 100644 index 0000000..8cd9279 --- /dev/null +++ b/src/Our.Umbraco.HeadRest/appsettings-schema.Umbraco.Cms.json @@ -0,0 +1,1810 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "UmbracoCmsSchema", + "type": "object", + "properties": { + "Umbraco": { + "$ref": "#/definitions/UmbracoDefinition" + } + }, + "definitions": { + "UmbracoDefinition": { + "type": "object", + "description": "Configuration container for all Umbraco products.", + "properties": { + "CMS": { + "$ref": "#/definitions/UmbracoCmsDefinition" + } + } + }, + "UmbracoCmsDefinition": { + "type": "object", + "description": "Configuration of Umbraco CMS.", + "properties": { + "Content": { + "$ref": "#/definitions/ContentSettings" + }, + "Debug": { + "$ref": "#/definitions/CoreDebugSettings" + }, + "ExceptionFilter": { + "$ref": "#/definitions/ExceptionFilterSettings" + }, + "ModelsBuilder": { + "$ref": "#/definitions/ModelsBuilderSettings" + }, + "Global": { + "$ref": "#/definitions/GlobalSettings" + }, + "HealthChecks": { + "$ref": "#/definitions/HealthChecksSettings" + }, + "Hosting": { + "$ref": "#/definitions/HostingSettings" + }, + "Imaging": { + "$ref": "#/definitions/ImagingSettings" + }, + "Examine": { + "$ref": "#/definitions/IndexCreatorSettings" + }, + "KeepAlive": { + "$ref": "#/definitions/KeepAliveSettings" + }, + "Logging": { + "$ref": "#/definitions/LoggingSettings" + }, + "NuCache": { + "$ref": "#/definitions/NuCacheSettings" + }, + "RequestHandler": { + "$ref": "#/definitions/RequestHandlerSettings" + }, + "Runtime": { + "$ref": "#/definitions/RuntimeSettings" + }, + "Security": { + "$ref": "#/definitions/SecuritySettings" + }, + "Tours": { + "$ref": "#/definitions/TourSettings" + }, + "TypeFinder": { + "$ref": "#/definitions/TypeFinderSettings" + }, + "WebRouting": { + "$ref": "#/definitions/WebRoutingSettings" + }, + "Plugins": { + "$ref": "#/definitions/UmbracoPluginSettings" + }, + "Unattended": { + "$ref": "#/definitions/UnattendedSettings" + }, + "RichTextEditor": { + "$ref": "#/definitions/RichTextEditorSettings" + }, + "RuntimeMinification": { + "$ref": "#/definitions/RuntimeMinificationSettings" + }, + "BasicAuth": { + "$ref": "#/definitions/BasicAuthSettings" + }, + "PackageMigration": { + "$ref": "#/definitions/PackageMigrationSettings" + }, + "LegacyPasswordMigration": { + "$ref": "#/definitions/LegacyPasswordMigrationSettings" + }, + "ContentDashboard": { + "$ref": "#/definitions/ContentDashboardSettings" + }, + "HelpPage": { + "$ref": "#/definitions/HelpPageSettings" + }, + "DefaultDataCreation": { + "$ref": "#/definitions/InstallDefaultDataSettings" + }, + "DataTypes": { + "$ref": "#/definitions/DataTypesSettings" + }, + "Marketplace": { + "$ref": "#/definitions/MarketplaceSettings" + } + } + }, + "ContentSettings": { + "type": "object", + "description": "Typed configuration options for content settings.\n ", + "properties": { + "Notifications": { + "description": "Gets or sets a value for the content notification settings.\n ", + "oneOf": [ + { + "$ref": "#/definitions/ContentNotificationSettings" + } + ] + }, + "Imaging": { + "description": "Gets or sets a value for the content imaging settings.\n ", + "oneOf": [ + { + "$ref": "#/definitions/ContentImagingSettings" + } + ] + }, + "ResolveUrlsFromTextString": { + "type": "boolean", + "description": "Gets or sets a value indicating whether URLs should be resolved from text strings.\n ", + "default": false + }, + "Error404Collection": { + "type": "array", + "description": "Gets or sets a value for the collection of error pages.\n ", + "items": { + "$ref": "#/definitions/ContentErrorPage" + } + }, + "PreviewBadge": { + "type": "string", + "description": "Gets or sets a value for the preview badge mark-up.\n ", + "default": "\n \n \n " + }, + "MacroErrors": { + "description": "Gets or sets a value for the macro error behaviour.\n ", + "default": "Inline", + "oneOf": [ + { + "$ref": "#/definitions/MacroErrorBehaviour" + } + ] + }, + "ShowDeprecatedPropertyEditors": { + "type": "boolean", + "description": "Gets or sets a value indicating whether deprecated property editors should be shown.\n ", + "default": false + }, + "LoginBackgroundImage": { + "type": "string", + "description": "Gets or sets a value for the path to the login screen background image.\n ", + "default": "assets/img/login.svg" + }, + "LoginLogoImage": { + "type": "string", + "description": "Gets or sets a value for the path to the login screen logo image.\n ", + "default": "assets/img/application/umbraco_logo_white.svg" + }, + "HideBackOfficeLogo": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to hide the backoffice umbraco logo or not.\n ", + "default": false + }, + "DisableDeleteWhenReferenced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to disable the deletion of items referenced by other items.\n ", + "default": false + }, + "DisableUnpublishWhenReferenced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to disable the unpublishing of items referenced by other items.\n ", + "default": false + }, + "ContentVersionCleanupPolicy": { + "description": "Get or sets the model representing the global content version cleanup policy\n ", + "oneOf": [ + { + "$ref": "#/definitions/ContentVersionCleanupPolicySettings" + } + ] + }, + "AllowEditInvariantFromNonDefault": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to allow editing invariant properties from a non-default language variation.", + "default": false + }, + "AllowedUploadedFileExtensions": { + "type": "array", + "description": "Gets or sets a value for the collection of file extensions that are allowed for upload.\n ", + "items": { + "type": "string" + } + }, + "DisallowedUploadedFileExtensions": { + "type": "array", + "description": "Gets or sets a value for the collection of file extensions that are disallowed for upload.\n ", + "default": "ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd,xamlx", + "items": { + "type": "string" + } + } + } + }, + "ContentNotificationSettings": { + "type": "object", + "description": "Typed configuration options for content notification settings.\n ", + "properties": { + "Email": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the email address for notifications.\n " + }, + "DisableHtmlEmail": { + "type": "boolean", + "description": "Gets or sets a value indicating whether HTML email notifications should be disabled.\n ", + "default": false + } + } + }, + "ContentImagingSettings": { + "type": "object", + "description": "Typed configuration options for content imaging settings.\n ", + "properties": { + "ImageFileTypes": { + "type": "array", + "description": "Gets or sets a value for the collection of accepted image file extensions.\n ", + "default": "jpeg,jpg,gif,bmp,png,tiff,tif,webp", + "items": { + "type": "string" + } + }, + "AutoFillImageProperties": { + "type": "array", + "description": "Gets or sets a value for the imaging autofill following media file upload fields.\n ", + "items": { + "$ref": "#/definitions/ImagingAutoFillUploadField" + } + } + } + }, + "ImagingAutoFillUploadField": { + "type": "object", + "description": "Typed configuration options for image autofill upload settings.\n ", + "required": [ + "Alias", + "WidthFieldAlias", + "HeightFieldAlias", + "LengthFieldAlias", + "ExtensionFieldAlias" + ], + "properties": { + "Alias": { + "type": "string", + "description": "Gets or sets a value for the alias of the image upload property.\n ", + "minLength": 1 + }, + "WidthFieldAlias": { + "type": "string", + "description": "Gets or sets a value for the width field alias of the image upload property.\n ", + "minLength": 1 + }, + "HeightFieldAlias": { + "type": "string", + "description": "Gets or sets a value for the height field alias of the image upload property.\n ", + "minLength": 1 + }, + "LengthFieldAlias": { + "type": "string", + "description": "Gets or sets a value for the length field alias of the image upload property.\n ", + "minLength": 1 + }, + "ExtensionFieldAlias": { + "type": "string", + "description": "Gets or sets a value for the extension field alias of the image upload property.\n ", + "minLength": 1 + } + } + }, + "ContentErrorPage": { + "type": "object", + "description": "Typed configuration for a content error page.\n ", + "required": [ + "Culture" + ], + "properties": { + "ContentId": { + "type": "integer", + "description": "Gets or sets a value for the content Id.\n ", + "format": "int32" + }, + "ContentKey": { + "type": "string", + "description": "Gets or sets a value for the content key.\n ", + "format": "guid" + }, + "ContentXPath": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the content XPath.\n " + }, + "Culture": { + "type": "string", + "description": "Gets or sets a value for the content culture.\n ", + "minLength": 1 + } + } + }, + "MacroErrorBehaviour": { + "type": "string", + "description": "", + "x-enumNames": [ + "Inline", + "Silent", + "Throw", + "Content" + ], + "enum": [ + "Inline", + "Silent", + "Throw", + "Content" + ] + }, + "ContentVersionCleanupPolicySettings": { + "type": "object", + "description": "Model representing the global content version cleanup policy\n ", + "properties": { + "EnableCleanup": { + "type": "boolean", + "description": "Gets or sets a value indicating whether or not the cleanup job should be executed.\n ", + "default": false + }, + "KeepAllVersionsNewerThanDays": { + "type": "integer", + "description": "Gets or sets the number of days where all historical content versions are kept.\n ", + "format": "int32", + "default": 7 + }, + "KeepLatestVersionPerDayForDays": { + "type": "integer", + "description": "Gets or sets the number of days where the latest historical content version for that day are kept.\n ", + "format": "int32", + "default": 90 + } + } + }, + "CoreDebugSettings": { + "type": "object", + "description": "Typed configuration options for core debug settings.\n ", + "properties": { + "LogIncompletedScopes": { + "type": "boolean", + "description": "Gets or sets a value indicating whether incompleted scopes should be logged.\n ", + "default": false + }, + "DumpOnTimeoutThreadAbort": { + "type": "boolean", + "description": "Gets or sets a value indicating whether memory dumps on thread abort should be taken.\n ", + "default": false + } + } + }, + "ExceptionFilterSettings": { + "type": "object", + "description": "Typed configuration options for exception filter settings.\n ", + "properties": { + "Disabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the exception filter is disabled.\n ", + "default": false + } + } + }, + "ModelsBuilderSettings": { + "type": "object", + "description": "Typed configuration options for models builder settings.\n ", + "properties": { + "ModelsMode": { + "description": "Gets or sets a value for the models mode.\n ", + "default": "InMemoryAuto", + "oneOf": [ + { + "$ref": "#/definitions/ModelsMode" + } + ] + }, + "ModelsNamespace": { + "type": "string", + "description": "Gets or sets a value for models namespace.\n ", + "default": "Umbraco.Cms.Web.Common.PublishedModels" + }, + "FlagOutOfDateModels": { + "type": "boolean", + "description": "Gets or sets a value indicating whether we should flag out-of-date models.\n " + }, + "ModelsDirectory": { + "type": "string", + "description": "Gets or sets a value for the models directory.\n ", + "default": "~/umbraco/models" + }, + "AcceptUnsafeModelsDirectory": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to accept an unsafe value for ModelsDirectory.\n ", + "default": false + }, + "DebugLevel": { + "type": "integer", + "description": "Gets or sets a value indicating the debug log level.\n ", + "format": "int32", + "default": 0 + } + } + }, + "ModelsMode": { + "type": "string", + "description": "Defines the models generation modes.\n ", + "x-enumNames": [ + "Nothing", + "InMemoryAuto", + "SourceCodeManual", + "SourceCodeAuto" + ], + "enum": [ + "Nothing", + "InMemoryAuto", + "SourceCodeManual", + "SourceCodeAuto" + ] + }, + "GlobalSettings": { + "type": "object", + "description": "Typed configuration options for global settings.\n ", + "properties": { + "ReservedUrls": { + "type": "string", + "description": "Gets or sets a value for the reserved URLs (must end with a comma).\n ", + "default": "~/.well-known," + }, + "ReservedPaths": { + "type": "string", + "description": "Gets or sets a value for the reserved paths (must end with a comma).\n ", + "default": "~/app_plugins/,~/install/,~/mini-profiler-resources/,~/umbraco/," + }, + "TimeOut": { + "type": "string", + "description": "Gets or sets a value for the back-office login timeout.\n ", + "format": "duration", + "default": "00:20:00" + }, + "DefaultUILanguage": { + "type": "string", + "description": "Gets or sets a value for the default UI language.\n ", + "default": "en-US" + }, + "HideTopLevelNodeFromPath": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to hide the top level node from the path.\n ", + "default": true + }, + "UseHttps": { + "type": "boolean", + "description": "Gets or sets a value indicating whether HTTPS should be used.\n ", + "default": false + }, + "VersionCheckPeriod": { + "type": "integer", + "description": "Gets or sets a value for the version check period in days.\n ", + "format": "int32", + "default": 7 + }, + "IconsPath": { + "type": "string", + "description": "Gets or sets a value for the Umbraco icons path.\n ", + "default": "umbraco/assets/icons" + }, + "UmbracoCssPath": { + "type": "string", + "description": "Gets or sets a value for the Umbraco CSS path.\n ", + "default": "~/css" + }, + "UmbracoScriptsPath": { + "type": "string", + "description": "Gets or sets a value for the Umbraco scripts path.\n ", + "default": "~/scripts" + }, + "UmbracoMediaPath": { + "type": "string", + "description": "Gets or sets a value for the Umbraco media request path.\n ", + "default": "~/media" + }, + "UmbracoMediaPhysicalRootPath": { + "type": "string", + "description": "Gets or sets a value for the physical Umbraco media root path (falls back to UmbracoMediaPath when\nempty).\n " + }, + "InstallMissingDatabase": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to install the database when it is missing.\n ", + "default": false + }, + "DisableElectionForSingleServer": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to disable the election for a single server.\n ", + "default": false + }, + "DatabaseFactoryServerVersion": { + "type": "string", + "description": "Gets or sets a value for the database factory server version.\n " + }, + "MainDomLock": { + "type": "string", + "description": "Gets or sets a value for the main dom lock.\n " + }, + "MainDomKeyDiscriminator": { + "type": "string", + "description": "Gets or sets a value to discriminate MainDom boundaries.\n\n Generally the default should suffice but useful for advanced scenarios e.g. azure deployment slot based zero\n downtime deployments.\n\n " + }, + "MainDomReleaseSignalPollingInterval": { + "type": "integer", + "description": "Gets or sets the duration (in milliseconds) for which the MainDomLock release signal polling task should sleep.\n ", + "format": "int32", + "default": 2000 + }, + "Id": { + "type": "string", + "description": "Gets or sets the telemetry ID.\n " + }, + "NoNodesViewPath": { + "type": "string", + "description": "Gets or sets a value for the path to the no content view.\n ", + "default": "~/umbraco/UmbracoWebsite/NoNodes.cshtml" + }, + "DatabaseServerRegistrar": { + "description": "Gets or sets a value for the database server registrar settings.\n ", + "oneOf": [ + { + "$ref": "#/definitions/DatabaseServerRegistrarSettings" + } + ] + }, + "DatabaseServerMessenger": { + "description": "Gets or sets a value for the database server messenger settings.\n ", + "oneOf": [ + { + "$ref": "#/definitions/DatabaseServerMessengerSettings" + } + ] + }, + "Smtp": { + "description": "Gets or sets a value for the SMTP settings.\n ", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/SmtpSettings" + } + ] + }, + "SanitizeTinyMce": { + "type": "boolean", + "description": "Gets or sets a value indicating whether TinyMCE scripting sanitization should be applied.\n ", + "default": false + }, + "DistributedLockingReadLockDefaultTimeout": { + "type": "string", + "description": "Gets or sets a value representing the maximum time to wait whilst attempting to obtain a distributed read lock.\n ", + "format": "duration", + "default": "00:01:00" + }, + "DistributedLockingWriteLockDefaultTimeout": { + "type": "string", + "description": "Gets or sets a value representing the maximum time to wait whilst attempting to obtain a distributed write lock.\n ", + "format": "duration", + "default": "00:00:05" + }, + "DistributedLockingMechanism": { + "type": "string", + "description": "Gets or sets a value representing the DistributedLockingMechanism to use." + }, + "ForceCombineUrlPathLeftToRight": { + "type": "boolean", + "description": "Force url paths to be left to right, even when the culture has right to left text", + "default": true, + "x-example": "For the following hierarchy\n- Root (/ar)\n - 1 (/ar/1)\n - 2 (/ar/1/2)\n - 3 (/ar/1/2/3)\n - 3 (/ar/1/2/3/4)\nWhen forced\n- https://www.umbraco.com/ar/1/2/3/4\nwhen not\n- https://www.umbraco.com/ar/4/3/2/1" + } + } + }, + "DatabaseServerRegistrarSettings": { + "type": "object", + "description": "Typed configuration options for database server registrar settings.\n ", + "properties": { + "WaitTimeBetweenCalls": { + "type": "string", + "description": "Gets or sets a value for the amount of time to wait between calls to the database on the background thread.\n ", + "format": "duration", + "default": "00:01:00" + }, + "StaleServerTimeout": { + "type": "string", + "description": "Gets or sets a value for the time span to wait before considering a server stale, after it has last been accessed.\n ", + "format": "duration", + "default": "00:02:00" + } + } + }, + "DatabaseServerMessengerSettings": { + "type": "object", + "description": "Typed configuration options for database server messaging settings.\n ", + "properties": { + "MaxProcessingInstructionCount": { + "type": "integer", + "description": "Gets or sets a value for the maximum number of instructions that can be processed at startup; otherwise the server\ncold-boots (rebuilds its caches).\n ", + "format": "int32", + "default": 1000 + }, + "TimeToRetainInstructions": { + "type": "string", + "description": "Gets or sets a value for the time to keep instructions in the database; records older than this number will be\npruned.\n ", + "format": "duration", + "default": "2.00:00:00" + }, + "TimeBetweenSyncOperations": { + "type": "string", + "description": "Gets or sets a value for the time to wait between each sync operations.\n ", + "format": "duration", + "default": "00:00:05" + }, + "TimeBetweenPruneOperations": { + "type": "string", + "description": "Gets or sets a value for the time to wait between each prune operations.\n ", + "format": "duration", + "default": "00:01:00" + } + } + }, + "SmtpSettings": { + "type": "object", + "description": "Typed configuration options for SMTP settings.\n ", + "required": [ + "From" + ], + "properties": { + "From": { + "type": "string", + "description": "Gets or sets a value for the SMTP from address to use for messages.\n ", + "format": "email", + "minLength": 1 + }, + "Host": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the SMTP host.\n " + }, + "Port": { + "type": "integer", + "description": "Gets or sets a value for the SMTP port.\n ", + "format": "int32" + }, + "SecureSocketOptions": { + "description": "Gets or sets a value for the secure socket options.\n ", + "default": "Auto", + "oneOf": [ + { + "$ref": "#/definitions/SecureSocketOptions" + } + ] + }, + "PickupDirectoryLocation": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the SMTP pick-up directory.\n " + }, + "DeliveryMethod": { + "description": "Gets or sets a value for the SMTP delivery method.\n ", + "default": "Network", + "oneOf": [ + { + "$ref": "#/definitions/SmtpDeliveryMethod" + } + ] + }, + "Username": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the SMTP user name.\n " + }, + "Password": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the SMTP password.\n " + } + } + }, + "SecureSocketOptions": { + "type": "string", + "description": "Matches MailKit.Security.SecureSocketOptions and defined locally to avoid having to take\na dependency on this external library into Umbraco.Core.\n ", + "x-enumNames": [ + "None", + "Auto", + "SslOnConnect", + "StartTls", + "StartTlsWhenAvailable" + ], + "enum": [ + "None", + "Auto", + "SslOnConnect", + "StartTls", + "StartTlsWhenAvailable" + ] + }, + "SmtpDeliveryMethod": { + "type": "string", + "description": "", + "x-enumNames": [ + "Network", + "SpecifiedPickupDirectory", + "PickupDirectoryFromIis" + ], + "enum": [ + "Network", + "SpecifiedPickupDirectory", + "PickupDirectoryFromIis" + ] + }, + "HealthChecksSettings": { + "type": "object", + "description": "Typed configuration options for healthchecks settings.\n ", + "properties": { + "DisabledChecks": { + "type": "array", + "description": "Gets or sets a value for the collection of healthchecks that are disabled.\n ", + "items": { + "$ref": "#/definitions/DisabledHealthCheckSettings" + } + }, + "Notification": { + "description": "Gets or sets a value for the healthcheck notification settings.\n ", + "oneOf": [ + { + "$ref": "#/definitions/HealthChecksNotificationSettings" + } + ] + } + } + }, + "DisabledHealthCheckSettings": { + "type": "object", + "description": "Typed configuration options for disabled healthcheck settings.\n ", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets a value for the healthcheck Id to disable.\n ", + "format": "guid" + }, + "DisabledOn": { + "type": "string", + "description": "Gets or sets a value for the date the healthcheck was disabled.\n ", + "format": "date-time" + }, + "DisabledBy": { + "type": "integer", + "description": "Gets or sets a value for Id of the user that disabled the healthcheck.\n ", + "format": "int32" + } + } + }, + "HealthChecksNotificationSettings": { + "type": "object", + "description": "Typed configuration options for healthcheck notification settings.\n ", + "properties": { + "Enabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether health check notifications are enabled.\n ", + "default": false + }, + "FirstRunTime": { + "type": "string", + "description": "Gets or sets a value for the first run time of a healthcheck notification in crontab format.\n " + }, + "Period": { + "type": "string", + "description": "Gets or sets a value for the period of the healthcheck notification.\n ", + "format": "duration", + "default": "1.00:00:00" + }, + "NotificationMethods": { + "type": "object", + "description": "Gets or sets a value for the collection of health check notification methods.\n ", + "additionalProperties": { + "$ref": "#/definitions/HealthChecksNotificationMethodSettings" + } + }, + "DisabledChecks": { + "type": "array", + "description": "Gets or sets a value for the collection of health checks that are disabled for notifications.\n ", + "items": { + "$ref": "#/definitions/DisabledHealthCheckSettings" + } + } + } + }, + "HealthChecksNotificationMethodSettings": { + "type": "object", + "description": "Typed configuration options for healthcheck notification method settings.\n ", + "properties": { + "Enabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the health check notification method is enabled.\n ", + "default": false + }, + "Verbosity": { + "description": "Gets or sets a value for the health check notifications reporting verbosity.\n ", + "default": "Summary", + "oneOf": [ + { + "$ref": "#/definitions/HealthCheckNotificationVerbosity" + } + ] + }, + "FailureOnly": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the health check notifications should occur on failures only.\n ", + "default": false + }, + "Settings": { + "type": "object", + "description": "Gets or sets a value providing provider specific settings for the health check notification method.\n ", + "additionalProperties": { + "type": "string" + } + } + } + }, + "HealthCheckNotificationVerbosity": { + "type": "string", + "description": "", + "x-enumNames": [ + "Summary", + "Detailed" + ], + "enum": [ + "Summary", + "Detailed" + ] + }, + "HostingSettings": { + "type": "object", + "description": "Typed configuration options for hosting settings.\n ", + "properties": { + "ApplicationVirtualPath": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the application virtual path.\n " + }, + "LocalTempStorageLocation": { + "description": "Gets or sets a value for the location of temporary files.\n ", + "default": "Default", + "oneOf": [ + { + "$ref": "#/definitions/LocalTempStorage" + } + ] + }, + "Debug": { + "type": "boolean", + "description": "Gets or sets a value indicating whether umbraco is running in [debug mode].\n ", + "default": false + }, + "SiteName": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value specifying the name of the site.\n " + } + } + }, + "LocalTempStorage": { + "type": "string", + "description": "", + "x-enumNames": [ + "Unknown", + "Default", + "EnvironmentTemp" + ], + "enum": [ + "Unknown", + "Default", + "EnvironmentTemp" + ] + }, + "ImagingSettings": { + "type": "object", + "description": "Typed configuration options for imaging settings.\n ", + "properties": { + "Cache": { + "description": "Gets or sets a value for imaging cache settings.\n ", + "oneOf": [ + { + "$ref": "#/definitions/ImagingCacheSettings" + } + ] + }, + "Resize": { + "description": "Gets or sets a value for imaging resize settings.\n ", + "oneOf": [ + { + "$ref": "#/definitions/ImagingResizeSettings" + } + ] + } + } + }, + "ImagingCacheSettings": { + "type": "object", + "description": "Typed configuration options for image cache settings.\n ", + "properties": { + "BrowserMaxAge": { + "type": "string", + "description": "Gets or sets a value for the browser image cache maximum age.\n ", + "format": "duration", + "default": "7.00:00:00" + }, + "CacheMaxAge": { + "type": "string", + "description": "Gets or sets a value for the image cache maximum age.\n ", + "format": "duration", + "default": "365.00:00:00" + }, + "CacheHashLength": { + "type": "integer", + "description": "Gets or sets a value for the image cache hash length.\n ", + "default": 12 + }, + "CacheFolderDepth": { + "type": "integer", + "description": "Gets or sets a value for the image cache folder depth.\n ", + "default": 8 + }, + "CacheFolder": { + "type": "string", + "description": "Gets or sets a value for the image cache folder.\n ", + "default": "~/umbraco/Data/TEMP/MediaCache" + } + } + }, + "ImagingResizeSettings": { + "type": "object", + "description": "Typed configuration options for image resize settings.\n ", + "properties": { + "MaxWidth": { + "type": "integer", + "description": "Gets or sets a value for the maximim resize width.\n ", + "format": "int32", + "default": 5000 + }, + "MaxHeight": { + "type": "integer", + "description": "Gets or sets a value for the maximim resize height.\n ", + "format": "int32", + "default": 5000 + } + } + }, + "IndexCreatorSettings": { + "type": "object", + "description": "Typed configuration options for index creator settings.\n ", + "properties": { + "LuceneDirectoryFactory": { + "description": "Gets or sets a value for lucene directory factory type.\n ", + "oneOf": [ + { + "$ref": "#/definitions/LuceneDirectoryFactory" + } + ] + } + } + }, + "LuceneDirectoryFactory": { + "type": "string", + "description": "", + "x-enumNames": [ + "Default", + "SyncedTempFileSystemDirectoryFactory", + "TempFileSystemDirectoryFactory" + ], + "enum": [ + "Default", + "SyncedTempFileSystemDirectoryFactory", + "TempFileSystemDirectoryFactory" + ] + }, + "KeepAliveSettings": { + "type": "object", + "description": "Typed configuration options for keep alive settings.\n ", + "properties": { + "DisableKeepAliveTask": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the keep alive task is disabled.\n ", + "default": false + }, + "KeepAlivePingUrl": { + "type": "string", + "description": "Gets or sets a value for the keep alive ping URL.\n ", + "default": "~/api/keepalive/ping" + } + } + }, + "LoggingSettings": { + "type": "object", + "description": "Typed configuration options for logging settings.\n ", + "properties": { + "MaxLogAge": { + "type": "string", + "description": "Gets or sets a value for the maximum age of a log file.\n ", + "format": "duration", + "default": "1.00:00:00" + } + } + }, + "NuCacheSettings": { + "type": "object", + "description": "Typed configuration options for NuCache settings.\n ", + "properties": { + "BTreeBlockSize": { + "type": [ + "integer", + "null" + ], + "description": "Gets or sets a value defining the BTree block size.\n ", + "format": "int32" + }, + "NuCacheSerializerType": { + "description": "The serializer type that nucache uses to persist documents in the database.\n ", + "default": "MessagePack", + "oneOf": [ + { + "$ref": "#/definitions/NuCacheSerializerType" + } + ] + }, + "SqlPageSize": { + "type": "integer", + "description": "The paging size to use for nucache SQL queries.\n ", + "format": "int32", + "default": 1000 + }, + "KitBatchSize": { + "type": "integer", + "description": "The size to use for nucache Kit batches. Higher value means more content loaded into memory at a time.\n ", + "format": "int32", + "default": 1 + }, + "UnPublishedContentCompression": { + "type": "boolean" + } + } + }, + "NuCacheSerializerType": { + "type": "string", + "description": "The serializer type that nucache uses to persist documents in the database.\n ", + "x-enumNames": [ + "MessagePack", + "JSON" + ], + "enum": [ + "MessagePack", + "JSON" + ] + }, + "RequestHandlerSettings": { + "type": "object", + "description": "Typed configuration options for request handler settings.\n ", + "properties": { + "AddTrailingSlash": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to add a trailing slash to URLs.\n ", + "default": true + }, + "ConvertUrlsToAscii": { + "type": "string", + "description": "Gets or sets a value indicating whether to convert URLs to ASCII (valid values: \"true\", \"try\" or \"false\").\n ", + "default": "try" + }, + "EnableDefaultCharReplacements": { + "type": "boolean", + "description": "Disable all default character replacements\n ", + "default": true + }, + "UserDefinedCharCollection": { + "type": [ + "array", + "null" + ], + "description": "Add additional character replacements, or override defaults\n ", + "items": { + "$ref": "#/definitions/CharItem" + } + } + } + }, + "CharItem": { + "type": "object", + "properties": { + "Char": { + "type": "string", + "description": "The character to replace\n " + }, + "Replacement": { + "type": "string", + "description": "The replacement character\n " + } + } + }, + "RuntimeSettings": { + "type": "object", + "description": "Typed configuration options for runtime settings.", + "properties": { + "Mode": { + "description": "Gets or sets the runtime mode.", + "default": "BackofficeDevelopment", + "oneOf": [ + { + "$ref": "#/definitions/RuntimeMode" + } + ] + }, + "MaxQueryStringLength": { + "type": [ + "integer", + "null" + ], + "description": "Gets or sets a value for the maximum query string length.", + "format": "int32" + }, + "MaxRequestLength": { + "type": [ + "integer", + "null" + ], + "description": "Gets or sets a value for the maximum request length in kb.\n ", + "format": "int32" + } + } + }, + "RuntimeMode": { + "type": "string", + "description": "Represents the configured Umbraco runtime mode.", + "x-enumNames": [ + "BackofficeDevelopment", + "Development", + "Production" + ], + "enum": [ + "BackofficeDevelopment", + "Development", + "Production" + ] + }, + "SecuritySettings": { + "type": "object", + "description": "Typed configuration options for security settings.\n ", + "properties": { + "KeepUserLoggedIn": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to keep the user logged in.\n ", + "default": false + }, + "HideDisabledUsersInBackOffice": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to hide disabled users in the back-office.\n ", + "default": false + }, + "AllowPasswordReset": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to allow user password reset.\n ", + "default": true + }, + "AuthCookieName": { + "type": "string", + "description": "Gets or sets a value for the authorization cookie name.\n ", + "default": "UMB_UCONTEXT" + }, + "AuthCookieDomain": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the authorization cookie domain.\n " + }, + "UsernameIsEmail": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the user's email address is to be considered as their username.\n " + }, + "AllowedUserNameCharacters": { + "type": "string", + "description": "Gets or sets the set of allowed characters for a username\n ", + "default": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@+\\" + }, + "UserPassword": { + "description": "Gets or sets a value for the user password settings.\n ", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/UserPasswordConfigurationSettings" + } + ] + }, + "MemberPassword": { + "description": "Gets or sets a value for the member password settings.\n ", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/MemberPasswordConfigurationSettings" + } + ] + }, + "MemberBypassTwoFactorForExternalLogins": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to bypass the two factor requirement in Umbraco when using external login\nfor members. Thereby rely on the External login and potential 2FA at that provider.\n ", + "default": true + }, + "UserBypassTwoFactorForExternalLogins": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to bypass the two factor requirement in Umbraco when using external login\nfor users. Thereby rely on the External login and potential 2FA at that provider.\n ", + "default": true + } + } + }, + "UserPasswordConfigurationSettings": { + "type": "object", + "description": "Typed configuration options for user password settings.\n ", + "properties": { + "RequiredLength": { + "type": "integer", + "description": "Gets a value for the minimum required length for the password.\n ", + "format": "int32", + "default": 10 + }, + "RequireNonLetterOrDigit": { + "type": "boolean", + "description": "Gets a value indicating whether at least one non-letter or digit is required for the password.\n ", + "default": false + }, + "RequireDigit": { + "type": "boolean", + "description": "Gets a value indicating whether at least one digit is required for the password.\n ", + "default": false + }, + "RequireLowercase": { + "type": "boolean", + "description": "Gets a value indicating whether at least one lower-case character is required for the password.\n ", + "default": false + }, + "RequireUppercase": { + "type": "boolean", + "description": "Gets a value indicating whether at least one upper-case character is required for the password.\n ", + "default": false + }, + "HashAlgorithmType": { + "type": "string", + "description": "Gets a value for the password hash algorithm type.\n ", + "default": "PBKDF2.ASPNETCORE.V3" + }, + "MaxFailedAccessAttemptsBeforeLockout": { + "type": "integer", + "description": "Gets a value for the maximum failed access attempts before lockout.\n ", + "format": "int32", + "default": 5 + } + } + }, + "MemberPasswordConfigurationSettings": { + "type": "object", + "description": "Typed configuration options for member password settings.\n ", + "properties": { + "RequiredLength": { + "type": "integer", + "description": "Gets a value for the minimum required length for the password.\n ", + "format": "int32", + "default": 10 + }, + "RequireNonLetterOrDigit": { + "type": "boolean", + "description": "Gets a value indicating whether at least one non-letter or digit is required for the password.\n ", + "default": false + }, + "RequireDigit": { + "type": "boolean", + "description": "Gets a value indicating whether at least one digit is required for the password.\n ", + "default": false + }, + "RequireLowercase": { + "type": "boolean", + "description": "Gets a value indicating whether at least one lower-case character is required for the password.\n ", + "default": false + }, + "RequireUppercase": { + "type": "boolean", + "description": "Gets a value indicating whether at least one upper-case character is required for the password.\n ", + "default": false + }, + "HashAlgorithmType": { + "type": "string", + "description": "Gets a value for the password hash algorithm type.\n ", + "default": "PBKDF2.ASPNETCORE.V3" + }, + "MaxFailedAccessAttemptsBeforeLockout": { + "type": "integer", + "description": "Gets a value for the maximum failed access attempts before lockout.\n ", + "format": "int32", + "default": 5 + } + } + }, + "TourSettings": { + "type": "object", + "description": "Typed configuration options for tour settings.\n ", + "properties": { + "EnableTours": { + "type": "boolean", + "description": "Gets or sets a value indicating whether back-office tours are enabled.\n ", + "default": true + } + } + }, + "TypeFinderSettings": { + "type": "object", + "description": "Typed configuration options for type finder settings.\n ", + "required": [ + "AssembliesAcceptingLoadExceptions" + ], + "properties": { + "AssembliesAcceptingLoadExceptions": { + "type": "string", + "description": "Gets or sets a value for the assemblies that accept load exceptions during type finder operations.\n ", + "minLength": 1 + }, + "AdditionalEntryAssemblies": { + "type": [ + "array", + "null" + ], + "description": "By default the entry assemblies for scanning plugin types is the Umbraco DLLs. If you require\nscanning for plugins based on different root referenced assemblies you can add the assembly name to this list.\n ", + "items": { + "type": "string" + } + } + } + }, + "WebRoutingSettings": { + "type": "object", + "description": "Typed configuration options for web routing settings.\n ", + "properties": { + "TryMatchingEndpointsForAllPages": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to check if any routed endpoints match a front-end request before\nthe Umbraco dynamic router tries to map the request to an Umbraco content item.\n ", + "default": false + }, + "TrySkipIisCustomErrors": { + "type": "boolean", + "description": "Gets or sets a value indicating whether IIS custom errors should be skipped.\n ", + "default": false + }, + "InternalRedirectPreservesTemplate": { + "type": "boolean", + "description": "Gets or sets a value indicating whether an internal redirect should preserve the template.\n ", + "default": false + }, + "DisableAlternativeTemplates": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the use of alternative templates are disabled.\n ", + "default": false + }, + "ValidateAlternativeTemplates": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the use of alternative templates should be validated.\n ", + "default": false + }, + "DisableFindContentByIdPath": { + "type": "boolean", + "description": "Gets or sets a value indicating whether find content ID by path is disabled.\n ", + "default": false + }, + "DisableRedirectUrlTracking": { + "type": "boolean", + "description": "Gets or sets a value indicating whether redirect URL tracking is disabled.\n ", + "default": false + }, + "UrlProviderMode": { + "description": "Gets or sets a value for the URL provider mode (UrlMode).\n ", + "default": "Auto", + "oneOf": [ + { + "$ref": "#/definitions/UrlMode" + } + ] + }, + "UmbracoApplicationUrl": { + "type": "string", + "description": "Gets or sets a value for the Umbraco application URL.\n " + } + } + }, + "UrlMode": { + "type": "string", + "description": "Specifies the type of URLs that the URL provider should produce, Auto is the default.\n ", + "x-enumNames": [ + "Default", + "Relative", + "Absolute", + "Auto" + ], + "enum": [ + "Default", + "Relative", + "Absolute", + "Auto" + ] + }, + "UmbracoPluginSettings": { + "type": "object", + "description": "Typed configuration options for the plugins.\n ", + "properties": { + "BrowsableFileExtensions": { + "type": "array", + "description": "Gets or sets the allowed file extensions (including the period \".\") that should be accessible from the browser.\n ", + "items": { + "type": "string" + } + } + } + }, + "UnattendedSettings": { + "type": "object", + "description": "Typed configuration options for unattended settings.\n ", + "properties": { + "InstallUnattended": { + "type": "boolean", + "description": "Gets or sets a value indicating whether unattended installs are enabled.\n ", + "default": false + }, + "UpgradeUnattended": { + "type": "boolean", + "description": "Gets or sets a value indicating whether unattended upgrades are enabled.\n ", + "default": false + }, + "PackageMigrationsUnattended": { + "type": "boolean", + "description": "Gets or sets a value indicating whether unattended package migrations are enabled.\n " + }, + "UnattendedUserName": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value to use for creating a user with a name for Unattended Installs\n " + }, + "UnattendedUserEmail": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value to use for creating a user with an email for Unattended Installs\n ", + "format": "email" + }, + "UnattendedUserPassword": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value to use for creating a user with a password for Unattended Installs\n " + } + } + }, + "RichTextEditorSettings": { + "type": "object", + "properties": { + "Commands": { + "type": "array", + "description": "HTML RichText Editor TinyMCE Commands\n ", + "items": { + "$ref": "#/definitions/RichTextEditorCommand" + } + }, + "Plugins": { + "type": "array", + "description": "HTML RichText Editor TinyMCE Plugins\n ", + "items": { + "type": "string" + } + }, + "CustomConfig": { + "type": "object", + "description": "HTML RichText Editor TinyMCE Custom Config\n ", + "additionalProperties": { + "type": "string" + } + }, + "ValidElements": { + "type": "string", + "default": "+a[id|style|rel|data-id|data-udi|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|reversed|start|style|type],-ul[class|style],-li[class|style],br[class],img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel|data-id],-sub[style|class],-sup[style|class],-blockquote[dir|style|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align|style],hr[class|style],small[class|style],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[class|id|width|height|codebase|*],param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class],area[shape|coords|href|alt|target|class],bdo[class],button[class],iframe[*],figure,figcaption,video[*],audio[*],picture[*],source[*],canvas[*]" + }, + "InvalidElements": { + "type": "string", + "description": "Invalid HTML elements for RichText Editor\n ", + "default": "font" + } + } + }, + "RichTextEditorCommand": { + "type": "object", + "required": [ + "Alias", + "Name", + "Mode" + ], + "properties": { + "Alias": { + "type": "string", + "minLength": 1 + }, + "Name": { + "type": "string", + "minLength": 1 + }, + "Mode": { + "$ref": "#/definitions/RichTextEditorCommandMode" + } + } + }, + "RichTextEditorCommandMode": { + "type": "string", + "description": "", + "x-enumNames": [ + "Insert", + "Selection", + "All" + ], + "enum": [ + "Insert", + "Selection", + "All" + ] + }, + "RuntimeMinificationSettings": { + "type": "object", + "properties": { + "UseInMemoryCache": { + "type": "boolean", + "description": "Use in memory cache\n ", + "default": false + }, + "CacheBuster": { + "description": "The cache buster type to use\n ", + "default": "Version", + "oneOf": [ + { + "$ref": "#/definitions/RuntimeMinificationCacheBuster" + } + ] + }, + "Version": { + "type": [ + "null", + "string" + ], + "description": "The unique version string used if CacheBuster is 'Version'.\n " + } + } + }, + "RuntimeMinificationCacheBuster": { + "type": "string", + "description": "", + "x-enumNames": [ + "Version", + "AppDomain", + "Timestamp" + ], + "enum": [ + "Version", + "AppDomain", + "Timestamp" + ] + }, + "BasicAuthSettings": { + "type": "object", + "description": "Typed configuration options for basic authentication settings.", + "properties": { + "Enabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to keep the user logged in.", + "default": false + }, + "AllowedIPs": { + "type": "array", + "items": { + "type": "string" + } + }, + "SharedSecret": { + "$ref": "#/definitions/SharedSecret" + }, + "RedirectToLoginPage": { + "type": "boolean" + } + } + }, + "SharedSecret": { + "type": "object", + "properties": { + "HeaderName": { + "type": [ + "null", + "string" + ], + "default": "X-Authentication-Shared-Secret" + }, + "Value": { + "type": [ + "null", + "string" + ] + } + } + }, + "PackageMigrationSettings": { + "type": "object", + "description": "Typed configuration options for package migration settings.\n ", + "properties": { + "RunSchemaAndContentMigrations": { + "type": "boolean", + "description": "Gets or sets a value indicating whether package migration steps that install schema and content should run.\n ", + "default": true + }, + "AllowComponentOverrideOfRunSchemaAndContentMigrations": { + "type": "boolean", + "description": "Gets or sets a value indicating whether components can override the configured value for\nRunSchemaAndContentMigrations.\n ", + "default": true + } + } + }, + "LegacyPasswordMigrationSettings": { + "type": "object", + "description": "Typed configuration options for legacy machine key settings used for migration of members from a v8 solution.\n ", + "properties": { + "MachineKeyDecryptionKey": { + "type": "string", + "description": "Gets or sets the decryption hex-formatted string key found in legacy web.config machineKey configuration-element.\n ", + "default": "" + } + } + }, + "ContentDashboardSettings": { + "type": "object", + "description": "Typed configuration options for content dashboard settings.\n ", + "properties": { + "AllowContentDashboardAccessToAllUsers": { + "type": "boolean", + "description": "Gets a value indicating whether the content dashboard should be available to all users.\n " + }, + "ContentDashboardPath": { + "type": "string", + "description": "Gets the path to use when constructing the URL for retrieving data for the content dashboard.\n ", + "default": "cms" + }, + "ContentDashboardUrlAllowlist": { + "type": [ + "array", + "null" + ], + "description": "Gets the allowed addresses to retrieve data for the content dashboard.\n ", + "items": { + "type": "string" + } + } + } + }, + "HelpPageSettings": { + "type": "object", + "properties": { + "HelpPageUrlAllowList": { + "type": [ + "array", + "null" + ], + "description": "Gets or sets the allowed addresses to retrieve data for the content dashboard.\n ", + "items": { + "type": "string" + } + } + } + }, + "InstallDefaultDataSettings": { + "type": "object", + "description": "Typed configuration options for installation of default data.\n ", + "properties": { + "InstallData": { + "description": "Gets or sets a value indicating whether to create default data on installation.\n ", + "oneOf": [ + { + "$ref": "#/definitions/InstallDefaultDataOption" + } + ] + }, + "Values": { + "type": "array", + "description": "Gets or sets a value indicating which default data (languages, data types, etc.) should be created when\nInstallData is\nset to Values or ExceptValues.\n ", + "items": { + "type": "string" + } + } + } + }, + "InstallDefaultDataOption": { + "type": "string", + "description": "An enumeration of options available for control over installation of default Umbraco data.\n ", + "x-enumNames": [ + "None", + "Values", + "ExceptValues", + "All" + ], + "enum": [ + "None", + "Values", + "ExceptValues", + "All" + ] + }, + "DataTypesSettings": { + "type": "object", + "properties": { + "CanBeChanged": { + "description": "Gets or sets a value indicating if data types can be changed after they've been used.", + "default": "True", + "oneOf": [ + { + "$ref": "#/definitions/DataTypeChangeMode" + } + ] + } + } + }, + "DataTypeChangeMode": { + "type": "string", + "description": "", + "x-enumNames": [ + "True", + "False", + "FalseWithHelpText" + ], + "enum": [ + "True", + "False", + "FalseWithHelpText" + ] + }, + "MarketplaceSettings": { + "type": "object", + "description": "Configuration options for the Marketplace.", + "properties": { + "AdditionalParameters": { + "type": "object", + "description": "Gets or sets the additional parameters that are sent to the Marketplace.", + "additionalProperties": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/src/Our.Umbraco.HeadRest/appsettings-schema.json b/src/Our.Umbraco.HeadRest/appsettings-schema.json new file mode 100644 index 0000000..cc264cd --- /dev/null +++ b/src/Our.Umbraco.HeadRest/appsettings-schema.json @@ -0,0 +1,3880 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "definitions": { + "webOptimizer": { + "type": "object", + "description": "Settings for WebOptimizer.Core", + "properties": { + "enableCaching": { + "description": "Determines if the \"cache-control\" HTTP headers should be set and if conditional GET (304) requests should be supported. This could be helpful to disable while in development mode.", + "type": "boolean" + }, + "enableTagHelperBundling": { + "description": "Determines if `" + }, + "MacroErrors": { + "description": "Gets or sets a value for the macro error behaviour.", + "default": "Inline", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreMacrosMacroErrorBehaviour" + } + ] + }, + "DisallowedUploadFiles": { + "type": "array", + "description": "Gets or sets a value for the collection of file extensions that are disallowed for upload.", + "default": "ashx,aspx,ascx,config,cshtml,vbhtml,asmx,air,axd,xamlx", + "items": { + "type": "string" + } + }, + "AllowedUploadFiles": { + "type": "array", + "description": "Gets or sets a value for the collection of file extensions that are allowed for upload.", + "items": { + "type": "string" + } + }, + "ShowDeprecatedPropertyEditors": { + "type": "boolean", + "description": "Gets or sets a value indicating whether deprecated property editors should be shown.", + "default": false + }, + "LoginBackgroundImage": { + "type": "string", + "description": "Gets or sets a value for the path to the login screen background image.", + "default": "assets/img/login.jpg" + }, + "LoginLogoImage": { + "type": "string", + "description": "Gets or sets a value for the path to the login screen logo image.", + "default": "assets/img/application/umbraco_logo_white.svg" + }, + "HideBackOfficeLogo": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to hide the backoffice umbraco logo or not.", + "default": false + }, + "DisableDeleteWhenReferenced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to disable the deletion of items referenced by other items.", + "default": false + }, + "DisableUnpublishWhenReferenced": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to disable the unpublishing of items referenced by other items.", + "default": false + }, + "ContentVersionCleanupPolicy": { + "description": "Get or sets the model representing the global content version cleanup policy", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsContentVersionCleanupPolicySettings" + } + ] + } + } + }, + "UmbracoCmsCoreConfigurationModelsContentNotificationSettings": { + "type": "object", + "description": "Typed configuration options for content notification settings.", + "properties": { + "Email": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the email address for notifications." + }, + "DisableHtmlEmail": { + "type": "boolean", + "description": "Gets or sets a value indicating whether HTML email notifications should be disabled.", + "default": false + } + } + }, + "UmbracoCmsCoreConfigurationModelsContentImagingSettings": { + "type": "object", + "description": "Typed configuration options for content imaging settings.", + "properties": { + "ImageFileTypes": { + "type": "array", + "description": "Gets or sets a value for the collection of accepted image file extensions.", + "default": "jpeg,jpg,gif,bmp,png,tiff,tif,webp", + "items": { + "type": "string" + } + }, + "AutoFillImageProperties": { + "type": "array", + "description": "Gets or sets a value for the imaging autofill following media file upload fields.", + "items": { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsImagingAutoFillUploadField" + } + } + } + }, + "UmbracoCmsCoreConfigurationModelsImagingAutoFillUploadField": { + "allOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsValidationValidatableEntryBase" + }, + { + "type": "object", + "description": "Typed configuration options for image autofill upload settings.", + "required": [ + "Alias", + "WidthFieldAlias", + "HeightFieldAlias", + "LengthFieldAlias", + "ExtensionFieldAlias" + ], + "properties": { + "Alias": { + "type": "string", + "description": "Gets or sets a value for the alias of the image upload property.", + "minLength": 1 + }, + "WidthFieldAlias": { + "type": "string", + "description": "Gets or sets a value for the width field alias of the image upload property.", + "minLength": 1 + }, + "HeightFieldAlias": { + "type": "string", + "description": "Gets or sets a value for the height field alias of the image upload property.", + "minLength": 1 + }, + "LengthFieldAlias": { + "type": "string", + "description": "Gets or sets a value for the length field alias of the image upload property.", + "minLength": 1 + }, + "ExtensionFieldAlias": { + "type": "string", + "description": "Gets or sets a value for the extension field alias of the image upload property.", + "minLength": 1 + } + } + } + ] + }, + "UmbracoCmsCoreConfigurationModelsValidationValidatableEntryBase": { + "type": "object", + "description": "Provides a base class for configuration models that can be validated based on data annotations.", + "x-abstract": true + }, + "UmbracoCmsCoreConfigurationModelsContentErrorPage": { + "allOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsValidationValidatableEntryBase" + }, + { + "type": "object", + "description": "Typed configuration for a content error page.", + "required": [ + "Culture" + ], + "properties": { + "ContentId": { + "type": "integer", + "description": "Gets or sets a value for the content Id.", + "format": "int32" + }, + "ContentKey": { + "type": "string", + "description": "Gets or sets a value for the content key.", + "format": "guid" + }, + "ContentXPath": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the content XPath." + }, + "Culture": { + "type": "string", + "description": "Gets or sets a value for the content culture.", + "minLength": 1 + } + } + } + ] + }, + "UmbracoCmsCoreMacrosMacroErrorBehaviour": { + "type": "string", + "description": "", + "x-enumNames": [ + "Inline", + "Silent", + "Throw", + "Content" + ], + "enum": [ + "Inline", + "Silent", + "Throw", + "Content" + ] + }, + "UmbracoCmsCoreConfigurationModelsContentVersionCleanupPolicySettings": { + "type": "object", + "description": "Model representing the global content version cleanup policy", + "properties": { + "EnableCleanup": { + "type": "boolean", + "description": "Gets or sets a value indicating whether or not the cleanup job should be executed.", + "default": false + }, + "KeepAllVersionsNewerThanDays": { + "type": "integer", + "description": "Gets or sets the number of days where all historical content versions are kept.", + "format": "int32", + "default": 7 + }, + "KeepLatestVersionPerDayForDays": { + "type": "integer", + "description": "Gets or sets the number of days where the latest historical content version for that day are kept.", + "format": "int32", + "default": 90 + } + } + }, + "UmbracoCmsCoreConfigurationModelsCoreDebugSettings": { + "type": "object", + "description": "Typed configuration options for core debug settings.", + "properties": { + "LogIncompletedScopes": { + "type": "boolean", + "description": "Gets or sets a value indicating whether incompleted scopes should be logged.", + "default": false + }, + "DumpOnTimeoutThreadAbort": { + "type": "boolean", + "description": "Gets or sets a value indicating whether memory dumps on thread abort should be taken.", + "default": false + } + } + }, + "UmbracoCmsCoreConfigurationModelsExceptionFilterSettings": { + "type": "object", + "description": "Typed configuration options for exception filter settings.", + "properties": { + "Disabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the exception filter is disabled.", + "default": false + } + } + }, + "UmbracoCmsCoreConfigurationModelsModelsBuilderSettings": { + "type": "object", + "description": "Typed configuration options for models builder settings.", + "properties": { + "ModelsMode": { + "description": "Gets or sets a value for the models mode.", + "default": "InMemoryAuto", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsMode" + } + ] + }, + "ModelsNamespace": { + "type": "string", + "description": "Gets or sets a value for models namespace.", + "default": "Umbraco.Cms.Web.Common.PublishedModels" + }, + "FlagOutOfDateModels": { + "type": "boolean", + "description": "Gets or sets a value indicating whether we should flag out-of-date models." + }, + "ModelsDirectory": { + "type": "string", + "description": "Gets or sets a value for the models directory.", + "default": "~/umbraco/models" + }, + "AcceptUnsafeModelsDirectory": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to accept an unsafe value for ModelsDirectory.", + "default": false + }, + "DebugLevel": { + "type": "integer", + "description": "Gets or sets a value indicating the debug log level.", + "format": "int32", + "default": 0 + } + } + }, + "UmbracoCmsCoreConfigurationModelsMode": { + "type": "string", + "description": "Defines the models generation modes.", + "x-enumNames": [ + "Nothing", + "InMemoryAuto", + "SourceCodeManual", + "SourceCodeAuto" + ], + "enum": [ + "Nothing", + "InMemoryAuto", + "SourceCodeManual", + "SourceCodeAuto" + ] + }, + "UmbracoCmsCoreConfigurationModelsGlobalSettings": { + "type": "object", + "description": "Typed configuration options for global settings.", + "properties": { + "ReservedUrls": { + "type": "string", + "description": "Gets or sets a value for the reserved URLs (must end with a comma).", + "default": "~/.well-known," + }, + "ReservedPaths": { + "type": "string", + "description": "Gets or sets a value for the reserved paths (must end with a comma).", + "default": "~/app_plugins/,~/install/,~/mini-profiler-resources/,~/umbraco/," + }, + "TimeOut": { + "type": "string", + "description": "Gets or sets a value for the back-office login timeout.", + "format": "duration", + "default": "00:20:00" + }, + "DefaultUILanguage": { + "type": "string", + "description": "Gets or sets a value for the default UI language.", + "default": "en-US" + }, + "HideTopLevelNodeFromPath": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to hide the top level node from the path.", + "default": true + }, + "UseHttps": { + "type": "boolean", + "description": "Gets or sets a value indicating whether HTTPS should be used.", + "default": false + }, + "VersionCheckPeriod": { + "type": "integer", + "description": "Gets or sets a value for the version check period in days.", + "format": "int32", + "default": 7 + }, + "UmbracoPath": { + "type": "string", + "description": "Gets or sets a value for the Umbraco back-office path.", + "default": "~/umbraco" + }, + "IconsPath": { + "type": "string", + "description": "Gets or sets a value for the Umbraco icons path.", + "default": "umbraco/assets/icons" + }, + "UmbracoCssPath": { + "type": "string", + "description": "Gets or sets a value for the Umbraco CSS path.", + "default": "~/css" + }, + "UmbracoScriptsPath": { + "type": "string", + "description": "Gets or sets a value for the Umbraco scripts path.", + "default": "~/scripts" + }, + "UmbracoMediaPath": { + "type": "string", + "description": "Gets or sets a value for the Umbraco media request path.", + "default": "~/media" + }, + "UmbracoMediaPhysicalRootPath": { + "type": "string", + "description": "Gets or sets a value for the physical Umbraco media root path (falls back to UmbracoMediaPath when empty)." + }, + "InstallMissingDatabase": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to install the database when it is missing.", + "default": false + }, + "DisableElectionForSingleServer": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to disable the election for a single server.", + "default": false + }, + "DatabaseFactoryServerVersion": { + "type": "string", + "description": "Gets or sets a value for the database factory server version." + }, + "MainDomLock": { + "type": "string", + "description": "Gets or sets a value for the main dom lock." + }, + "MainDomKeyDiscriminator": { + "type": "string", + "description": "Gets or sets a value to discriminate MainDom boundaries.\n\nGenerally the default should suffice but useful for advanced scenarios e.g. azure deployment slot based zero downtime deployments." + }, + "MainDomReleaseSignalPollingInterval": { + "type": "integer", + "description": "Gets or sets the duration (in milliseconds) for which the MainDomLock release signal polling task should sleep.", + "format": "int32", + "default": 2000 + }, + "Id": { + "type": "string", + "description": "Gets or sets the telemetry ID." + }, + "NoNodesViewPath": { + "type": "string", + "description": "Gets or sets a value for the path to the no content view.", + "default": "~/umbraco/UmbracoWebsite/NoNodes.cshtml" + }, + "DatabaseServerRegistrar": { + "description": "Gets or sets a value for the database server registrar settings.", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsDatabaseServerRegistrarSettings" + } + ] + }, + "DatabaseServerMessenger": { + "description": "Gets or sets a value for the database server messenger settings.", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsDatabaseServerMessengerSettings" + } + ] + }, + "Smtp": { + "description": "Gets or sets a value for the SMTP settings.", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsSmtpSettings" + } + ] + }, + "SanitizeTinyMce": { + "type": "boolean", + "description": "Gets or sets a value indicating whether TinyMCE scripting sanitization should be applied.", + "default": false + }, + "DistributedLockingReadLockDefaultTimeout": { + "type": "string", + "description": "Gets or sets a value representing the maximum time to wait whilst attempting to obtain a distributed read lock.", + "format": "duration", + "default": "00:01:00" + }, + "DistributedLockingWriteLockDefaultTimeout": { + "type": "string", + "description": "Gets or sets a value representing the maximum time to wait whilst attempting to obtain a distributed write lock.", + "format": "duration", + "default": "00:00:05" + }, + "DistributedLockingMechanism": { + "type": "string", + "description": "Gets or sets a value representing the DistributedLockingMechanism to use." + } + } + }, + "UmbracoCmsCoreConfigurationModelsDatabaseServerRegistrarSettings": { + "type": "object", + "description": "Typed configuration options for database server registrar settings.", + "properties": { + "WaitTimeBetweenCalls": { + "type": "string", + "description": "Gets or sets a value for the amount of time to wait between calls to the database on the background thread.", + "format": "duration", + "default": "00:01:00" + }, + "StaleServerTimeout": { + "type": "string", + "description": "Gets or sets a value for the time span to wait before considering a server stale, after it has last been accessed.", + "format": "duration", + "default": "00:02:00" + } + } + }, + "UmbracoCmsCoreConfigurationModelsDatabaseServerMessengerSettings": { + "type": "object", + "description": "Typed configuration options for database server messaging settings.", + "properties": { + "MaxProcessingInstructionCount": { + "type": "integer", + "description": "Gets or sets a value for the maximum number of instructions that can be processed at startup; otherwise the server cold-boots (rebuilds its caches).", + "format": "int32", + "default": 1000 + }, + "TimeToRetainInstructions": { + "type": "string", + "description": "Gets or sets a value for the time to keep instructions in the database; records older than this number will be pruned.", + "format": "duration", + "default": "2.00:00:00" + }, + "TimeBetweenSyncOperations": { + "type": "string", + "description": "Gets or sets a value for the time to wait between each sync operations.", + "format": "duration", + "default": "00:00:05" + }, + "TimeBetweenPruneOperations": { + "type": "string", + "description": "Gets or sets a value for the time to wait between each prune operations.", + "format": "duration", + "default": "00:01:00" + } + } + }, + "UmbracoCmsCoreConfigurationModelsSmtpSettings": { + "allOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsValidationValidatableEntryBase" + }, + { + "type": "object", + "description": "Typed configuration options for SMTP settings.", + "required": [ + "From" + ], + "properties": { + "From": { + "type": "string", + "description": "Gets or sets a value for the SMTP from address to use for messages.", + "format": "email", + "minLength": 1 + }, + "Host": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the SMTP host." + }, + "Port": { + "type": "integer", + "description": "Gets or sets a value for the SMTP port.", + "format": "int32" + }, + "SecureSocketOptions": { + "description": "Gets or sets a value for the secure socket options.", + "default": "Auto", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsSecureSocketOptions" + } + ] + }, + "PickupDirectoryLocation": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the SMTP pick-up directory." + }, + "DeliveryMethod": { + "description": "Gets or sets a value for the SMTP delivery method.", + "default": "Network", + "oneOf": [ + { + "$ref": "#/definitions/SystemNetMailSmtpDeliveryMethod" + } + ] + }, + "Username": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the SMTP user name." + }, + "Password": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the SMTP password." + } + } + } + ] + }, + "UmbracoCmsCoreConfigurationModelsSecureSocketOptions": { + "type": "string", + "description": "Matches MailKit.Security.SecureSocketOptions and defined locally to avoid having to take\na dependency on this external library into Umbraco.Core.", + "x-enumNames": [ + "None", + "Auto", + "SslOnConnect", + "StartTls", + "StartTlsWhenAvailable" + ], + "enum": [ + "None", + "Auto", + "SslOnConnect", + "StartTls", + "StartTlsWhenAvailable" + ] + }, + "SystemNetMailSmtpDeliveryMethod": { + "type": "string", + "description": "", + "x-enumNames": [ + "Network", + "SpecifiedPickupDirectory", + "PickupDirectoryFromIis" + ], + "enum": [ + "Network", + "SpecifiedPickupDirectory", + "PickupDirectoryFromIis" + ] + }, + "UmbracoCmsCoreConfigurationModelsHealthChecksSettings": { + "type": "object", + "description": "Typed configuration options for healthchecks settings.", + "properties": { + "DisabledChecks": { + "type": "array", + "description": "Gets or sets a value for the collection of healthchecks that are disabled.", + "items": { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsDisabledHealthCheckSettings" + } + }, + "Notification": { + "description": "Gets or sets a value for the healthcheck notification settings.", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsHealthChecksNotificationSettings" + } + ] + } + } + }, + "UmbracoCmsCoreConfigurationModelsDisabledHealthCheckSettings": { + "type": "object", + "description": "Typed configuration options for disabled healthcheck settings.", + "properties": { + "Id": { + "type": "string", + "description": "Gets or sets a value for the healthcheck Id to disable.", + "format": "guid" + }, + "DisabledOn": { + "type": "string", + "description": "Gets or sets a value for the date the healthcheck was disabled.", + "format": "date-time" + }, + "DisabledBy": { + "type": "integer", + "description": "Gets or sets a value for Id of the user that disabled the healthcheck.", + "format": "int32" + } + } + }, + "UmbracoCmsCoreConfigurationModelsHealthChecksNotificationSettings": { + "type": "object", + "description": "Typed configuration options for healthcheck notification settings.", + "properties": { + "Enabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether health check notifications are enabled.", + "default": false + }, + "FirstRunTime": { + "type": "string", + "description": "Gets or sets a value for the first run time of a healthcheck notification in crontab format." + }, + "Period": { + "type": "string", + "description": "Gets or sets a value for the period of the healthcheck notification.", + "format": "duration", + "default": "1.00:00:00" + }, + "NotificationMethods": { + "type": "object", + "description": "Gets or sets a value for the collection of health check notification methods.", + "additionalProperties": { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsHealthChecksNotificationMethodSettings" + } + }, + "DisabledChecks": { + "type": "array", + "description": "Gets or sets a value for the collection of health checks that are disabled for notifications.", + "items": { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsDisabledHealthCheckSettings" + } + } + } + }, + "UmbracoCmsCoreConfigurationModelsHealthChecksNotificationMethodSettings": { + "type": "object", + "description": "Typed configuration options for healthcheck notification method settings.", + "properties": { + "Enabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the health check notification method is enabled.", + "default": false + }, + "Verbosity": { + "description": "Gets or sets a value for the health check notifications reporting verbosity.", + "default": "Summary", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreHealthChecksHealthCheckNotificationVerbosity" + } + ] + }, + "FailureOnly": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the health check notifications should occur on failures only.", + "default": false + }, + "Settings": { + "type": "object", + "description": "Gets or sets a value providing provider specific settings for the health check notification method.", + "additionalProperties": { + "type": "string" + } + } + } + }, + "UmbracoCmsCoreHealthChecksHealthCheckNotificationVerbosity": { + "type": "string", + "description": "", + "x-enumNames": [ + "Summary", + "Detailed" + ], + "enum": [ + "Summary", + "Detailed" + ] + }, + "UmbracoCmsCoreConfigurationModelsHostingSettings": { + "type": "object", + "description": "Typed configuration options for hosting settings.", + "properties": { + "ApplicationVirtualPath": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the application virtual path." + }, + "LocalTempStorageLocation": { + "description": "Gets or sets a value for the location of temporary files.", + "default": "Default", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationLocalTempStorage" + } + ] + }, + "Debug": { + "type": "boolean", + "description": "Gets or sets a value indicating whether umbraco is running in [debug mode].", + "default": false + }, + "SiteName": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value specifying the name of the site." + } + } + }, + "UmbracoCmsCoreConfigurationLocalTempStorage": { + "type": "string", + "description": "", + "x-enumNames": [ + "Unknown", + "Default", + "EnvironmentTemp" + ], + "enum": [ + "Unknown", + "Default", + "EnvironmentTemp" + ] + }, + "UmbracoCmsCoreConfigurationModelsImagingSettings": { + "type": "object", + "description": "Typed configuration options for imaging settings.", + "properties": { + "Cache": { + "description": "Gets or sets a value for imaging cache settings.", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsImagingCacheSettings" + } + ] + }, + "Resize": { + "description": "Gets or sets a value for imaging resize settings.", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsImagingResizeSettings" + } + ] + } + } + }, + "UmbracoCmsCoreConfigurationModelsImagingCacheSettings": { + "type": "object", + "description": "Typed configuration options for image cache settings.", + "properties": { + "BrowserMaxAge": { + "type": "string", + "description": "Gets or sets a value for the browser image cache maximum age.", + "format": "duration", + "default": "7.00:00:00" + }, + "CacheMaxAge": { + "type": "string", + "description": "Gets or sets a value for the image cache maximum age.", + "format": "duration", + "default": "365.00:00:00" + }, + "CacheHashLength": { + "type": "integer", + "description": "Gets or sets a value for the image cache hash length.", + "default": 12 + }, + "CacheFolderDepth": { + "type": "integer", + "description": "Gets or sets a value for the image cache folder depth.", + "default": 8 + }, + "CacheFolder": { + "type": "string", + "description": "Gets or sets a value for the image cache folder.", + "default": "~/umbraco/Data/TEMP/MediaCache" + } + } + }, + "UmbracoCmsCoreConfigurationModelsImagingResizeSettings": { + "type": "object", + "description": "Typed configuration options for image resize settings.", + "properties": { + "MaxWidth": { + "type": "integer", + "description": "Gets or sets a value for the maximim resize width.", + "format": "int32", + "default": 5000 + }, + "MaxHeight": { + "type": "integer", + "description": "Gets or sets a value for the maximim resize height.", + "format": "int32", + "default": 5000 + } + } + }, + "UmbracoCmsCoreConfigurationModelsIndexCreatorSettings": { + "type": "object", + "description": "Typed configuration options for index creator settings.", + "properties": { + "LuceneDirectoryFactory": { + "description": "Gets or sets a value for lucene directory factory type.", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsLuceneDirectoryFactory" + } + ] + } + } + }, + "UmbracoCmsCoreConfigurationModelsLuceneDirectoryFactory": { + "type": "string", + "description": "", + "x-enumNames": [ + "Default", + "SyncedTempFileSystemDirectoryFactory", + "TempFileSystemDirectoryFactory" + ], + "enum": [ + "Default", + "SyncedTempFileSystemDirectoryFactory", + "TempFileSystemDirectoryFactory" + ] + }, + "UmbracoCmsCoreConfigurationModelsKeepAliveSettings": { + "type": "object", + "description": "Typed configuration options for keep alive settings.", + "properties": { + "DisableKeepAliveTask": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the keep alive task is disabled.", + "default": false + }, + "KeepAlivePingUrl": { + "type": "string", + "description": "Gets or sets a value for the keep alive ping URL.", + "default": "~/api/keepalive/ping" + } + } + }, + "UmbracoCmsCoreConfigurationModelsLoggingSettings": { + "type": "object", + "description": "Typed configuration options for logging settings.", + "properties": { + "MaxLogAge": { + "type": "string", + "description": "Gets or sets a value for the maximum age of a log file.", + "format": "duration", + "default": "1.00:00:00" + } + } + }, + "UmbracoCmsCoreConfigurationModelsMemberPasswordConfigurationSettings": { + "type": "object", + "description": "Typed configuration options for member password settings.", + "properties": { + "RequiredLength": { + "type": "integer", + "description": "Gets a value for the minimum required length for the password.", + "format": "int32", + "default": 10 + }, + "RequireNonLetterOrDigit": { + "type": "boolean", + "description": "Gets a value indicating whether at least one non-letter or digit is required for the password.", + "default": false + }, + "RequireDigit": { + "type": "boolean", + "description": "Gets a value indicating whether at least one digit is required for the password.", + "default": false + }, + "RequireLowercase": { + "type": "boolean", + "description": "Gets a value indicating whether at least one lower-case character is required for the password.", + "default": false + }, + "RequireUppercase": { + "type": "boolean", + "description": "Gets a value indicating whether at least one upper-case character is required for the password.", + "default": false + }, + "HashAlgorithmType": { + "type": "string", + "description": "Gets a value for the password hash algorithm type.", + "default": "PBKDF2.ASPNETCORE.V3" + }, + "MaxFailedAccessAttemptsBeforeLockout": { + "type": "integer", + "description": "Gets a value for the maximum failed access attempts before lockout.", + "format": "int32", + "default": 5 + } + } + }, + "UmbracoCmsCoreConfigurationModelsNuCacheSettings": { + "type": "object", + "description": "Typed configuration options for NuCache settings.", + "properties": { + "BTreeBlockSize": { + "type": [ + "integer", + "null" + ], + "description": "Gets or sets a value defining the BTree block size.", + "format": "int32" + }, + "NuCacheSerializerType": { + "description": "The serializer type that nucache uses to persist documents in the database.", + "default": "MessagePack", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsNuCacheSerializerType" + } + ] + }, + "SqlPageSize": { + "type": "integer", + "description": "The paging size to use for nucache SQL queries.", + "format": "int32", + "default": 1000 + }, + "KitBatchSize": { + "type": "integer", + "description": "The size to use for nucache Kit batches. Higher value means more content loaded into memory at a time.", + "format": "int32", + "default": 1 + }, + "UnPublishedContentCompression": { + "type": "boolean" + } + } + }, + "UmbracoCmsCoreConfigurationModelsNuCacheSerializerType": { + "type": "string", + "description": "The serializer type that nucache uses to persist documents in the database.", + "x-enumNames": [ + "MessagePack", + "JSON" + ], + "enum": [ + "MessagePack", + "JSON" + ] + }, + "UmbracoCmsCoreConfigurationModelsRequestHandlerSettings": { + "type": "object", + "description": "Typed configuration options for request handler settings.", + "properties": { + "AddTrailingSlash": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to add a trailing slash to URLs.", + "default": true + }, + "ConvertUrlsToAscii": { + "type": "string", + "description": "Gets or sets a value indicating whether to convert URLs to ASCII (valid values: \"true\", \"try\" or \"false\").", + "default": "try" + }, + "EnableDefaultCharReplacements": { + "type": "boolean", + "description": "Disable all default character replacements", + "default": true + }, + "UserDefinedCharCollection": { + "type": [ + "array", + "null" + ], + "description": "Add additional character replacements, or override defaults", + "items": { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsCharItem" + } + } + } + }, + "UmbracoCmsCoreConfigurationModelsCharItem": { + "type": "object", + "properties": { + "Char": { + "type": "string", + "description": "The character to replace" + }, + "Replacement": { + "type": "string", + "description": "The replacement character" + } + } + }, + "UmbracoCmsCoreConfigurationModelsRuntimeSettings": { + "type": "object", + "description": "Typed configuration options for runtime settings.", + "properties": { + "MaxQueryStringLength": { + "type": [ + "integer", + "null" + ], + "description": "Gets or sets a value for the maximum query string length.", + "format": "int32" + }, + "MaxRequestLength": { + "type": [ + "integer", + "null" + ], + "description": "Gets or sets a value for the maximum request length in kb.", + "format": "int32" + } + } + }, + "UmbracoCmsCoreConfigurationModelsSecuritySettings": { + "type": "object", + "description": "Typed configuration options for security settings.", + "properties": { + "KeepUserLoggedIn": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to keep the user logged in.", + "default": false + }, + "HideDisabledUsersInBackOffice": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to hide disabled users in the back-office.", + "default": false + }, + "AllowPasswordReset": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to allow user password reset.", + "default": true + }, + "AuthCookieName": { + "type": "string", + "description": "Gets or sets a value for the authorization cookie name.", + "default": "UMB_UCONTEXT" + }, + "AuthCookieDomain": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value for the authorization cookie domain." + }, + "UsernameIsEmail": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the user's email address is to be considered as their username." + }, + "AllowedUserNameCharacters": { + "type": "string", + "description": "Gets or sets the set of allowed characters for a username", + "default": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@+\\" + }, + "UserPassword": { + "description": "Gets or sets a value for the user password settings.", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsUserPasswordConfigurationSettings" + } + ] + }, + "MemberPassword": { + "description": "Gets or sets a value for the member password settings.", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsMemberPasswordConfigurationSettings" + } + ] + }, + "MemberBypassTwoFactorForExternalLogins": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to bypass the two factor requirement in Umbraco when using external login for members. Thereby rely on the External login and potential 2FA at that provider.", + "default": true + }, + "UserBypassTwoFactorForExternalLogins": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to bypass the two factor requirement in Umbraco when using external login for users. Thereby rely on the External login and potential 2FA at that provider.", + "default": true + } + } + }, + "UmbracoCmsCoreConfigurationModelsUserPasswordConfigurationSettings": { + "type": "object", + "description": "Typed configuration options for user password settings.", + "properties": { + "RequiredLength": { + "type": "integer", + "description": "Gets a value for the minimum required length for the password.", + "format": "int32", + "default": 10 + }, + "RequireNonLetterOrDigit": { + "type": "boolean", + "description": "Gets a value indicating whether at least one non-letter or digit is required for the password.", + "default": false + }, + "RequireDigit": { + "type": "boolean", + "description": "Gets a value indicating whether at least one digit is required for the password.", + "default": false + }, + "RequireLowercase": { + "type": "boolean", + "description": "Gets a value indicating whether at least one lower-case character is required for the password.", + "default": false + }, + "RequireUppercase": { + "type": "boolean", + "description": "Gets a value indicating whether at least one upper-case character is required for the password.", + "default": false + }, + "HashAlgorithmType": { + "type": "string", + "description": "Gets a value for the password hash algorithm type.", + "default": "PBKDF2.ASPNETCORE.V3" + }, + "MaxFailedAccessAttemptsBeforeLockout": { + "type": "integer", + "description": "Gets a value for the maximum failed access attempts before lockout.", + "format": "int32", + "default": 5 + } + } + }, + "UmbracoCmsCoreConfigurationModelsTourSettings": { + "type": "object", + "description": "Typed configuration options for tour settings.", + "properties": { + "EnableTours": { + "type": "boolean", + "description": "Gets or sets a value indicating whether back-office tours are enabled.", + "default": true + } + } + }, + "UmbracoCmsCoreConfigurationModelsTypeFinderSettings": { + "type": "object", + "description": "Typed configuration options for type finder settings.", + "required": [ + "AssembliesAcceptingLoadExceptions" + ], + "properties": { + "AssembliesAcceptingLoadExceptions": { + "type": "string", + "description": "Gets or sets a value for the assemblies that accept load exceptions during type finder operations.", + "minLength": 1 + }, + "AdditionalEntryAssemblies": { + "type": [ + "array", + "null" + ], + "description": "By default the entry assemblies for scanning plugin types is the Umbraco DLLs. If you require\nscanning for plugins based on different root referenced assemblies you can add the assembly name to this list.", + "items": { + "type": "string" + } + } + } + }, + "UmbracoCmsCoreConfigurationModelsWebRoutingSettings": { + "type": "object", + "description": "Typed configuration options for web routing settings.", + "properties": { + "TryMatchingEndpointsForAllPages": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to check if any routed endpoints match a front-end request before\nthe Umbraco dynamic router tries to map the request to an Umbraco content item.", + "default": false + }, + "TrySkipIisCustomErrors": { + "type": "boolean", + "description": "Gets or sets a value indicating whether IIS custom errors should be skipped.", + "default": false + }, + "InternalRedirectPreservesTemplate": { + "type": "boolean", + "description": "Gets or sets a value indicating whether an internal redirect should preserve the template.", + "default": false + }, + "DisableAlternativeTemplates": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the use of alternative templates are disabled.", + "default": false + }, + "ValidateAlternativeTemplates": { + "type": "boolean", + "description": "Gets or sets a value indicating whether the use of alternative templates should be validated.", + "default": false + }, + "DisableFindContentByIdPath": { + "type": "boolean", + "description": "Gets or sets a value indicating whether find content ID by path is disabled.", + "default": false + }, + "DisableRedirectUrlTracking": { + "type": "boolean", + "description": "Gets or sets a value indicating whether redirect URL tracking is disabled.", + "default": false + }, + "UrlProviderMode": { + "description": "Gets or sets a value for the URL provider mode (UrlMode).", + "default": "Auto", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreModelsPublishedContentUrlMode" + } + ] + }, + "UmbracoApplicationUrl": { + "type": "string", + "description": "Gets or sets a value for the Umbraco application URL." + } + } + }, + "UmbracoCmsCoreModelsPublishedContentUrlMode": { + "type": "string", + "description": "Specifies the type of URLs that the URL provider should produce, Auto is the default.", + "x-enumNames": [ + "Default", + "Relative", + "Absolute", + "Auto" + ], + "enum": [ + "Default", + "Relative", + "Absolute", + "Auto" + ] + }, + "UmbracoCmsCoreConfigurationModelsUmbracoPluginSettings": { + "type": "object", + "description": "Typed configuration options for the plugins.", + "properties": { + "BrowsableFileExtensions": { + "type": "array", + "description": "Gets or sets the allowed file extensions (including the period \".\") that should be accessible from the browser.", + "items": { + "type": "string" + } + } + } + }, + "UmbracoCmsCoreConfigurationModelsUnattendedSettings": { + "type": "object", + "description": "Typed configuration options for unattended settings.", + "properties": { + "InstallUnattended": { + "type": "boolean", + "description": "Gets or sets a value indicating whether unattended installs are enabled.", + "default": false + }, + "UpgradeUnattended": { + "type": "boolean", + "description": "Gets or sets a value indicating whether unattended upgrades are enabled.", + "default": false + }, + "PackageMigrationsUnattended": { + "type": "boolean", + "description": "Gets or sets a value indicating whether unattended package migrations are enabled." + }, + "UnattendedUserName": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value to use for creating a user with a name for Unattended Installs" + }, + "UnattendedUserEmail": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value to use for creating a user with an email for Unattended Installs", + "format": "email" + }, + "UnattendedUserPassword": { + "type": [ + "null", + "string" + ], + "description": "Gets or sets a value to use for creating a user with a password for Unattended Installs" + } + } + }, + "UmbracoCmsCoreConfigurationModelsRichTextEditorSettings": { + "type": "object", + "properties": { + "Commands": { + "type": "array", + "description": "HTML RichText Editor TinyMCE Commands", + "items": { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsRichTextEditorCommand" + } + }, + "Plugins": { + "type": "array", + "description": "HTML RichText Editor TinyMCE Plugins", + "items": { + "type": "string" + } + }, + "CustomConfig": { + "type": "object", + "description": "HTML RichText Editor TinyMCE Custom Config", + "additionalProperties": { + "type": "string" + } + }, + "ValidElements": { + "type": "string", + "description": " ", + "default": "+a[id|style|rel|data-id|data-udi|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|reversed|start|style|type],-ul[class|style],-li[class|style],br[class],img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel|data-id],-sub[style|class],-sup[style|class],-blockquote[dir|style|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align|style],hr[class|style],small[class|style],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[class|id|width|height|codebase|*],param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class],area[shape|coords|href|alt|target|class],bdo[class],button[class],iframe[*],figure,figcaption" + }, + "InvalidElements": { + "type": "string", + "description": "Invalid HTML elements for RichText Editor", + "default": "font" + } + } + }, + "UmbracoCmsCoreConfigurationModelsRichTextEditorCommand": { + "type": "object", + "required": [ + "Alias", + "Name", + "Mode" + ], + "properties": { + "Alias": { + "type": "string", + "minLength": 1 + }, + "Name": { + "type": "string", + "minLength": 1 + }, + "Mode": { + "$ref": "#/definitions/UmbracoCmsCoreModelsContentEditingRichTextEditorCommandMode" + } + } + }, + "UmbracoCmsCoreModelsContentEditingRichTextEditorCommandMode": { + "type": "string", + "description": "", + "x-enumNames": [ + "Insert", + "Selection", + "All" + ], + "enum": [ + "Insert", + "Selection", + "All" + ] + }, + "UmbracoCmsCoreConfigurationModelsRuntimeMinificationSettings": { + "type": "object", + "properties": { + "UseInMemoryCache": { + "type": "boolean", + "description": "Use in memory cache", + "default": false + }, + "CacheBuster": { + "description": "The cache buster type to use", + "default": "Version", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsRuntimeMinificationCacheBuster" + } + ] + }, + "Version": { + "type": [ + "null", + "string" + ], + "description": "The unique version string used if CacheBuster is 'Version'." + } + } + }, + "UmbracoCmsCoreConfigurationModelsRuntimeMinificationCacheBuster": { + "type": "string", + "description": "", + "x-enumNames": [ + "Version", + "AppDomain", + "Timestamp" + ], + "enum": [ + "Version", + "AppDomain", + "Timestamp" + ] + }, + "UmbracoCmsCoreConfigurationModelsBasicAuthSettings": { + "type": "object", + "description": "Typed configuration options for basic authentication settings.", + "properties": { + "Enabled": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to keep the user logged in.", + "default": false + }, + "AllowedIPs": { + "type": "array", + "items": { + "type": "string" + } + }, + "SharedSecret": { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsSharedSecret" + }, + "RedirectToLoginPage": { + "type": "boolean" + } + } + }, + "UmbracoCmsCoreConfigurationModelsSharedSecret": { + "type": "object", + "properties": { + "HeaderName": { + "type": [ + "null", + "string" + ], + "default": "X-Authentication-Shared-Secret" + }, + "Value": { + "type": [ + "null", + "string" + ] + } + } + }, + "UmbracoCmsCoreConfigurationModelsPackageMigrationSettings": { + "type": "object", + "description": "Typed configuration options for package migration settings.", + "properties": { + "RunSchemaAndContentMigrations": { + "type": "boolean", + "description": "Gets or sets a value indicating whether package migration steps that install schema and content should run.", + "default": true + }, + "AllowComponentOverrideOfRunSchemaAndContentMigrations": { + "type": "boolean", + "description": "Gets or sets a value indicating whether components can override the configured value for RunSchemaAndContentMigrations.", + "default": true + } + } + }, + "UmbracoCmsCoreConfigurationModelsLegacyPasswordMigrationSettings": { + "type": "object", + "description": "Typed configuration options for legacy machine key settings used for migration of members from a v8 solution.", + "properties": { + "MachineKeyDecryptionKey": { + "type": "string", + "description": "Gets or sets the decryption hex-formatted string key found in legacy web.config machineKey configuration-element.", + "default": "" + } + } + }, + "UmbracoCmsCoreConfigurationContentDashboardSettings": { + "type": "object", + "description": "Typed configuration options for content dashboard settings.", + "properties": { + "AllowContentDashboardAccessToAllUsers": { + "type": "boolean", + "description": "Gets a value indicating whether the content dashboard should be available to all users." + }, + "ContentDashboardPath": { + "type": "string", + "description": "Gets the path to use when constructing the URL for retrieving data for the content dashboard.", + "default": "cms" + }, + "ContentDashboardUrlAllowlist": { + "type": [ + "array", + "null" + ], + "description": "Gets the allowed addresses to retrieve data for the content dashboard.", + "items": { + "type": "string" + } + } + } + }, + "UmbracoCmsCoreConfigurationModelsHelpPageSettings": { + "type": "object", + "properties": { + "HelpPageUrlAllowList": { + "type": [ + "array", + "null" + ], + "description": "Gets or sets the allowed addresses to retrieve data for the content dashboard.", + "items": { + "type": "string" + } + } + } + }, + "UmbracoCmsCoreConfigurationModelsInstallDefaultDataSettings": { + "type": "object", + "description": "Typed configuration options for installation of default data.", + "properties": { + "InstallData": { + "description": "Gets or sets a value indicating whether to create default data on installation.", + "oneOf": [ + { + "$ref": "#/definitions/UmbracoCmsCoreConfigurationModelsInstallDefaultDataOption" + } + ] + }, + "Values": { + "type": "array", + "description": "Gets or sets a value indicating which default data (languages, data types, etc.) should be created when InstallData is\nset to Values or ExceptValues.", + "items": { + "type": "string" + } + } + } + }, + "UmbracoCmsCoreConfigurationModelsInstallDefaultDataOption": { + "type": "string", + "description": "An enumeration of options available for control over installation of default Umbraco data.", + "x-enumNames": [ + "None", + "Values", + "ExceptValues", + "All" + ], + "enum": [ + "None", + "Values", + "ExceptValues", + "All" + ] + }, + "JsonSchemaFormsDefinition": { + "type": "object", + "description": "Configurations for the Umbraco Forms package to Umbraco CMS\n ", + "properties": { + "FormDesign": { + "$ref": "#/definitions/UmbracoFormsCoreConfigurationFormDesignSettings" + }, + "Options": { + "$ref": "#/definitions/UmbracoFormsCoreConfigurationPackageOptionSettings" + }, + "Security": { + "$ref": "#/definitions/UmbracoFormsCoreConfigurationSecuritySettings" + }, + "FieldTypes": { + "$ref": "#/definitions/JsonSchemaFieldTypesDefinition" + } + } + }, + "UmbracoFormsCoreConfigurationFormDesignSettings": { + "type": "object", + "properties": { + "Defaults": { + "$ref": "#/definitions/UmbracoFormsCoreConfigurationDefaultFormSettings" + }, + "DisableAutomaticAdditionOfDataConsentField": { + "type": "boolean" + }, + "DisableDefaultWorkflow": { + "type": "boolean" + }, + "MaxNumberOfColumnsInFormGroup": { + "type": "integer", + "format": "int32" + }, + "DefaultTheme": { + "type": "string" + }, + "DefaultEmailTemplate": { + "type": "string" + } + } + }, + "UmbracoFormsCoreConfigurationDefaultFormSettings": { + "type": "object", + "properties": { + "ManualApproval": { + "type": "boolean" + }, + "DisableStylesheet": { + "type": "boolean" + }, + "MarkFieldsIndicator": { + "$ref": "#/definitions/UmbracoFormsCoreEnumsFormFieldIndication" + }, + "Indicator": { + "type": "string" + }, + "RequiredErrorMessage": { + "type": "string" + }, + "InvalidErrorMessage": { + "type": "string" + }, + "ShowValidationSummary": { + "type": "boolean" + }, + "HideFieldValidationLabels": { + "type": "boolean" + }, + "MessageOnSubmit": { + "type": "string" + }, + "StoreRecordsLocally": { + "type": "boolean" + }, + "AutocompleteAttribute": { + "type": "string" + } + } + }, + "UmbracoFormsCoreEnumsFormFieldIndication": { + "type": "string", + "description": "", + "x-enumNames": [ + "NoIndicator", + "MarkMandatoryFields", + "MarkOptionalFields" + ], + "enum": [ + "NoIndicator", + "MarkMandatoryFields", + "MarkOptionalFields" + ] + }, + "UmbracoFormsCoreConfigurationPackageOptionSettings": { + "type": "object", + "properties": { + "IgnoreWorkFlowsOnEdit": { + "type": "string" + }, + "ExecuteWorkflowAsync": { + "type": "string" + }, + "AllowEditableFormSubmissions": { + "type": "boolean" + }, + "AppendQueryStringOnRedirectAfterFormSubmission": { + "type": "boolean" + } + } + }, + "UmbracoFormsCoreConfigurationSecuritySettings": { + "type": "object", + "properties": { + "DisallowedFileUploadExtensions": { + "type": "string" + }, + "EnableAntiForgeryToken": { + "type": "boolean" + }, + "SavePlainTextPasswords": { + "type": "boolean" + }, + "DisableFileUploadAccessProtection": { + "type": "boolean" + }, + "ManageSecurityWithUserGroups": { + "type": "boolean" + }, + "GrantAccessToNewFormsForUserGroups": { + "type": "string" + }, + "DefaultUserAccessToNewForms": { + "$ref": "#/definitions/UmbracoFormsCoreConfigurationFormAccess" + } + } + }, + "UmbracoFormsCoreConfigurationFormAccess": { + "type": "string", + "description": "", + "x-enumNames": [ + "Grant", + "Deny" + ], + "enum": [ + "Grant", + "Deny" + ] + }, + "JsonSchemaFieldTypesDefinition": { + "type": "object", + "description": "Configurations for the Umbraco Forms Field Types\n ", + "properties": { + "DatePicker": { + "$ref": "#/definitions/UmbracoFormsCoreConfigurationDatePickerSettings" + }, + "Recaptcha2": { + "$ref": "#/definitions/UmbracoFormsCoreConfigurationRecaptcha2Settings" + }, + "Recaptcha3": { + "$ref": "#/definitions/UmbracoFormsCoreConfigurationRecaptcha3Settings" + } + } + }, + "UmbracoFormsCoreConfigurationDatePickerSettings": { + "type": "object", + "properties": { + "DatePickerYearRange": { + "type": "integer", + "format": "int32" + } + } + }, + "UmbracoFormsCoreConfigurationRecaptcha2Settings": { + "type": "object", + "properties": { + "PublicKey": { + "type": "string" + }, + "PrivateKey": { + "type": "string" + } + } + }, + "UmbracoFormsCoreConfigurationRecaptcha3Settings": { + "type": "object", + "properties": { + "SiteKey": { + "type": "string" + }, + "PrivateKey": { + "type": "string" + } + } + }, + "JsonSchemaDeployDefinition": { + "type": "object", + "description": "Configurations for the Umbraco Deploy package to Umbraco CMS\n ", + "properties": { + "Settings": { + "$ref": "#/definitions/UmbracoDeployCoreConfigurationDeployConfigurationDeploySettings" + }, + "Project": { + "$ref": "#/definitions/UmbracoDeployCoreConfigurationDeployProjectConfigurationDeployProjectConfig" + }, + "Debug": { + "$ref": "#/definitions/UmbracoDeployCoreConfigurationDebugConfigurationDebugSettings" + } + } + }, + "UmbracoDeployCoreConfigurationDeployConfigurationDeploySettings": { + "type": "object", + "properties": { + "ApiKey": { + "type": "string" + }, + "ExcludedEntityTypes": { + "type": "array", + "items": { + "type": "string" + } + }, + "RelationTypes": { + "type": "array", + "items": { + "$ref": "#/definitions/UmbracoDeployCoreConfigurationDeployConfigurationRelationTypeSetting" + } + }, + "ValueConnectors": { + "type": "array", + "items": { + "$ref": "#/definitions/UmbracoDeployCoreConfigurationDeployConfigurationValueConnectorSetting" + } + }, + "Edition": { + "$ref": "#/definitions/UmbracoDeployCoreConfigurationEdition" + }, + "Kabum": { + "type": "string" + }, + "SessionTimeout": { + "type": "string", + "format": "duration" + }, + "SourceDeployTimeout": { + "type": "string", + "format": "duration" + }, + "DatabaseCommandTimeout": { + "type": "string", + "format": "duration" + }, + "EnableSignatureCacheReads": { + "type": "boolean" + }, + "HttpClientTimeout": { + "type": "string", + "format": "duration" + }, + "IgnoreBrokenDependencies": { + "type": "boolean" + }, + "IgnoreBrokenDependenciesBehavior": { + "$ref": "#/definitions/UmbracoDeployCoreConfigurationDeployConfigurationIgnoreBrokenDependenciesBehavior" + }, + "TransferFormsAsContent": { + "type": "boolean" + }, + "TransferDictionaryAsContent": { + "type": "boolean" + }, + "AllowMembersDeploymentOperations": { + "$ref": "#/definitions/UmbracoDeployCoreConfigurationDeployConfigurationMembersDeploymentOperations" + }, + "TransferMemberGroupsAsContent": { + "type": "boolean" + }, + "AcceptInvalidCertificates": { + "type": "boolean" + }, + "ExportMemberGroups": { + "type": "boolean" + } + } + }, + "UmbracoDeployCoreConfigurationDeployConfigurationRelationTypeSetting": { + "type": "object", + "properties": { + "Alias": { + "type": "string" + }, + "Mode": { + "$ref": "#/definitions/UmbracoDeployCoreCoreRelationMode" + } + } + }, + "UmbracoDeployCoreCoreRelationMode": { + "type": "string", + "description": "", + "x-enumNames": [ + "Exclude", + "Weak", + "Strong" + ], + "enum": [ + "Exclude", + "Weak", + "Strong" + ] + }, + "UmbracoDeployCoreConfigurationDeployConfigurationValueConnectorSetting": { + "type": "object", + "properties": { + "Alias": { + "type": "string" + }, + "TypeName": { + "type": "string" + } + } + }, + "UmbracoDeployCoreConfigurationEdition": { + "type": "string", + "description": "", + "x-enumNames": [ + "Default", + "BackOfficeOnly" + ], + "enum": [ + "Default", + "BackOfficeOnly" + ] + }, + "UmbracoDeployCoreConfigurationDeployConfigurationIgnoreBrokenDependenciesBehavior": { + "type": "string", + "description": "", + "x-enumFlags": true, + "x-enumNames": [ + "None", + "Restore", + "Transfer", + "All" + ], + "enum": [ + "None", + "Restore", + "Transfer", + "All" + ] + }, + "UmbracoDeployCoreConfigurationDeployConfigurationMembersDeploymentOperations": { + "type": "string", + "description": "", + "x-enumFlags": true, + "x-enumNames": [ + "None", + "Restore", + "Transfer", + "All" + ], + "enum": [ + "None", + "Restore", + "Transfer", + "All" + ] + }, + "UmbracoDeployCoreConfigurationDeployProjectConfigurationDeployProjectConfig": { + "type": "object", + "properties": { + "Workspaces": { + "type": "array", + "items": { + "$ref": "#/definitions/UmbracoDeployCoreConfigurationDeployProjectConfigurationWorkspace" + } + } + } + }, + "UmbracoDeployCoreConfigurationDeployProjectConfigurationWorkspace": { + "type": "object", + "properties": { + "Id": { + "type": "string", + "format": "guid" + }, + "Name": { + "type": "string" + }, + "Type": { + "type": "string" + }, + "Url": { + "type": "string" + } + } + }, + "UmbracoDeployCoreConfigurationDebugConfigurationDebugSettings": { + "type": "object", + "properties": { + "IsDebug": { + "type": "boolean" + }, + "IsSqlAzure": { + "type": "boolean" + }, + "EnvironmentId": { + "type": "string" + }, + "EnvironmentName": { + "type": "string" + }, + "IsRunningCloud": { + "type": "boolean" + }, + "IsRunningHosted": { + "type": "boolean" + }, + "PortalUrl": { + "type": "string" + } + } + } + }, + "patternProperties": { + "^WebOptimizer$": { + "$ref": "#/definitions/webOptimizer" + }, + "^webOptimizer$": { + "$ref": "#/definitions/webOptimizer" + }, + "^weboptimizer$": { + "$ref": "#/definitions/webOptimizer" + }, + "^(cdn|Cdn)$": { + "$ref": "#/definitions/cdn" + }, + "^(pwa|PWA|Pwa)$": { + "$ref": "#/definitions/pwa" + }, + "^(ElmahIo|Elmahio|elmahIo|elmahio)$": { + "$ref": "#/definitions/ElmahIo" + }, + "^(nlog|Nlog|NLog)$": { + "$ref": "#/definitions/NLog" + }, + "^(Umbraco|umbraco)$": { + "$ref": "#/definitions/umbraco" + } + }, + "properties": { + "Kestrel": { + "$ref": "#/definitions/kestrel" + }, + "Logging": { + "$ref": "#/definitions/logging" + }, + "AllowedHosts": { + "$ref": "#/definitions/allowedHosts" + }, + "ConnectionStrings": { + "$ref": "#/definitions/connectionStrings" + }, + "Umbraco": { + "description": "Gets or sets the Umbraco\n ", + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/definitions/JsonSchemaUmbracoDefinition" + } + ] + } + }, + "title": "JsonSchemaAppSettings", + "type": "object" +} \ No newline at end of file diff --git a/src/Our.Umbraco.HeadRest/packages.config b/src/Our.Umbraco.HeadRest/packages.config deleted file mode 100644 index f5d1bb8..0000000 --- a/src/Our.Umbraco.HeadRest/packages.config +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file