From 638ba0c265bceda28c5aa27c170a70f90b3f68ba Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Fri, 4 Nov 2022 14:46:35 +0100 Subject: [PATCH] Use Swashbuckle instead of NSwag (#13350) * First attempt at OpenIddict * Making headway and more TODOs * Redo current policies for multiple schemas + clean up auth controller * Fix bad merge * Clean up some more test code * Fix spacing * Include AddAuthentication() in OpenIddict addition * A little more clean-up * Move application creation to its own implementation + prepare for middleware to handle valid callback URL * Enable refresh token flow * Fix bad merge from v11/dev * Support auth for Swagger and Postman in non-production environments + use default login screen for back-office logins * Add workaround to client side login handling so the OAuth return URL is not corrupted before redirection * Add temporary configuration handling for new backoffice * Restructure the code somewhat, move singular responsibility from management API project * Add recurring task for cleaning up old tokens in the DB * Fix bad merge + make auth controller align with the new management API structure * Explicitly handle the new management API path as a backoffice path (NOTE: this is potentially behaviorally breaking!) * Redo handle the new management API requests as backoffice requests, this time in a non-breaking way * Add/update TODOs * Replace NSwag with Swashbuckle and clean up unnecessary client secret workaround * Revert duplication of current auth policies for OpenIddict (as it breaks everything for V11 without the new management APIs) and introduce a dedicated PoC policy setup for OpenIddict. * Fix failing unit tests * A little niceness + export new OpenApi.json and fix path in contract unit test * Redo after merge with v11/dev + filter out unwanted mime types * Remove CreatedResult and NotFoundObjectResult where possible * Custom schema IDs - no more "ViewModel" postfix and make generic lists look less clunky too * A little more explanation for generic schema ID generation * Force Swashbuckle to use enum string names * Update OpenApi.json to match new enum string values * Add clarifying comment about weird looking construct --- .../Culture/CultureControllerBase.cs | 3 +- .../Tree/DataTypeTreeControllerBase.cs | 3 +- .../Dictionary/DictionaryControllerBase.cs | 3 +- .../Dictionary/ExportDictionaryController.cs | 4 +- .../Tree/DictionaryTreeControllerBase.cs | 3 +- .../DocumentRecycleBinControllerBase.cs | 3 +- .../Tree/DocumentTreeControllerBase.cs | 3 +- .../DocumentBlueprintTreeControllerBase.cs | 3 +- .../Tree/DocumentTypeTreeControllerBase.cs | 3 +- .../Controllers/Help/HelpControllerBase.cs | 3 +- .../Install/InstallControllerBase.cs | 3 +- .../Language/LanguageControllerBase.cs | 3 +- .../MediaRecycleBinControllerBase.cs | 3 +- .../Media/Tree/MediaTreeControllerBase.cs | 6 +- .../Tree/MediaTypeTreeControllerBase.cs | 3 +- .../Tree/MemberGroupTreeControllerBase.cs | 3 +- .../Tree/MemberTypeTreeControllerBase.cs | 3 +- .../GetModelsBuilderController.cs | 5 +- .../ModelsBuilderControllerBase.cs | 3 +- .../Tree/PartialViewTreeControllerBase.cs | 3 +- .../Profiling/ProfilingControllerBase.cs | 3 +- .../PublishedCacheControllerBase.cs | 3 +- .../Relation/RelationControllerBase.cs | 3 +- .../Tree/RelationTypeTreeControllerBase.cs | 3 +- .../Script/Tree/ScriptTreeControllerBase.cs | 3 +- .../Search/SearchControllerBase.cs | 3 +- .../Security/BackOfficeController.cs | 76 + .../Server/ServerControllerBase.cs | 3 +- .../Tree/StaticFileTreeControllerBase.cs | 3 +- .../Tree/StylesheetTreeControllerBase.cs | 3 +- .../Telemetry/AllTelemetryController.cs | 8 +- .../Telemetry/GetTelemetryController.cs | 4 +- .../Telemetry/SetTelemetryController.cs | 6 +- .../Telemetry/TelemetryControllerBase.cs | 3 +- .../Tree/TemplateTreeControllerBase.cs | 3 +- .../TrackedReferencesControllerBase.cs | 3 +- .../Upgrade/UpgradeControllerBase.cs | 3 +- .../BackOfficeAuthBuilderExtensions.cs | 145 + .../ManagementApiComposer.cs | 145 +- src/Umbraco.Cms.ManagementApi/OpenApi.json | 7656 ++++++++++------- .../OpenApi/EnumSchemaFilter.cs | 23 + .../OpenApi/MimeTypeDocumentFilter.cs | 33 + .../OpenApi/SchemaIdGenerator.cs | 26 + .../Security/BackOfficeApplicationManager.cs | 131 + .../Umbraco.Cms.ManagementApi.csproj | 6 + ...evelViewModel.cs => TelemetryViewModel.cs} | 2 +- .../Routing/UmbracoRequestPaths.cs | 1 + .../NewBackoffice/OpenAPIContractTest.cs | 2 +- 48 files changed, 5242 insertions(+), 3127 deletions(-) create mode 100644 src/Umbraco.Cms.ManagementApi/Controllers/Security/BackOfficeController.cs create mode 100644 src/Umbraco.Cms.ManagementApi/DependencyInjection/BackOfficeAuthBuilderExtensions.cs create mode 100644 src/Umbraco.Cms.ManagementApi/OpenApi/EnumSchemaFilter.cs create mode 100644 src/Umbraco.Cms.ManagementApi/OpenApi/MimeTypeDocumentFilter.cs create mode 100644 src/Umbraco.Cms.ManagementApi/OpenApi/SchemaIdGenerator.cs create mode 100644 src/Umbraco.Cms.ManagementApi/Security/BackOfficeApplicationManager.cs rename src/Umbraco.Cms.ManagementApi/ViewModels/Telemetry/{TelemetryLevelViewModel.cs => TelemetryViewModel.cs} (86%) diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Culture/CultureControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Culture/CultureControllerBase.cs index 7ea0b77ae285..3ab12578244f 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Culture/CultureControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Culture/CultureControllerBase.cs @@ -1,12 +1,11 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.New.Cms.Web.Common.Routing; namespace Umbraco.Cms.ManagementApi.Controllers.Culture; [ApiController] [VersionedApiBackOfficeRoute("culture")] -[OpenApiTag("Culture")] +[ApiExplorerSettings(GroupName = "Culture")] [ApiVersion("1.0")] public abstract class CultureControllerBase : ManagementApiControllerBase { diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/DataType/Tree/DataTypeTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/DataType/Tree/DataTypeTreeControllerBase.cs index 8c0c6598aefd..e5948770dbfc 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/DataType/Tree/DataTypeTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/DataType/Tree/DataTypeTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Entities; @@ -13,7 +12,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.DataType.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.DataType}")] -[OpenApiTag("Data Type")] +[ApiExplorerSettings(GroupName = "Data Type")] public class DataTypeTreeControllerBase : FolderTreeControllerBase { private readonly IDataTypeService _dataTypeService; diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Dictionary/DictionaryControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Dictionary/DictionaryControllerBase.cs index f102d497ac6c..cfdba7cec139 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Dictionary/DictionaryControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Dictionary/DictionaryControllerBase.cs @@ -1,12 +1,11 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.New.Cms.Web.Common.Routing; namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary; [ApiController] [VersionedApiBackOfficeRoute("dictionary")] -[OpenApiTag("Dictionary")] +[ApiExplorerSettings(GroupName = "Dictionary")] [ApiVersion("1.0")] // TODO: Add authentication public abstract class DictionaryControllerBase : ManagementApiControllerBase diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Dictionary/ExportDictionaryController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Dictionary/ExportDictionaryController.cs index f4944220d580..5145db107683 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Dictionary/ExportDictionaryController.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Dictionary/ExportDictionaryController.cs @@ -23,13 +23,13 @@ public ExportDictionaryController(ILocalizationService localizationService, IEnt [HttpGet("export/{key:guid}")] [MapToApiVersion("1.0")] [ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(NotFoundObjectResult), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(NotFoundResult), StatusCodes.Status404NotFound)] public async Task ExportDictionary(Guid key, bool includeChildren = false) { IDictionaryItem? dictionaryItem = _localizationService.GetDictionaryItemById(key); if (dictionaryItem is null) { - return await Task.FromResult(NotFound("No dictionary item found with id ")); + return await Task.FromResult(NotFound()); } XElement xml = _entityXmlSerializer.Serialize(dictionaryItem, includeChildren); diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Dictionary/Tree/DictionaryTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Dictionary/Tree/DictionaryTreeControllerBase.cs index c91a267c9f16..495978980987 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Dictionary/Tree/DictionaryTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Dictionary/Tree/DictionaryTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; @@ -12,7 +11,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Dictionary.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/dictionary")] -[OpenApiTag("Dictionary")] +[ApiExplorerSettings(GroupName = "Dictionary")] // NOTE: at the moment dictionary items (renamed to dictionary tree) aren't supported by EntityService, so we have little use of the // tree controller base. We'll keep it though, in the hope that we can mend EntityService. public class DictionaryTreeControllerBase : EntityTreeControllerBase diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Document/RecycleBin/DocumentRecycleBinControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Document/RecycleBin/DocumentRecycleBinControllerBase.cs index 106c636fe1e2..2edcb07a396d 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Document/RecycleBin/DocumentRecycleBinControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Document/RecycleBin/DocumentRecycleBinControllerBase.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Entities; @@ -17,7 +16,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Document.RecycleBin; [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.RecycleBin}/{Constants.UdiEntityType.Document}")] [RequireDocumentTreeRootAccess] [ProducesResponseType(StatusCodes.Status401Unauthorized)] -[OpenApiTag(nameof(Constants.UdiEntityType.Document))] +[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Document))] public class DocumentRecycleBinControllerBase : RecycleBinControllerBase { public DocumentRecycleBinControllerBase(IEntityService entityService) diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Document/Tree/DocumentTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Document/Tree/DocumentTreeControllerBase.cs index b69af50c31bb..b838c0379094 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Document/Tree/DocumentTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Document/Tree/DocumentTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Models; @@ -17,7 +16,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Document.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Document}")] -[OpenApiTag(nameof(Constants.UdiEntityType.Document))] +[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Document))] public abstract class DocumentTreeControllerBase : UserStartNodeTreeControllerBase { private readonly IPublicAccessService _publicAccessService; diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/DocumentBlueprint/Tree/DocumentBlueprintTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/DocumentBlueprint/Tree/DocumentBlueprintTreeControllerBase.cs index 1fe034b7b5e8..ad4e32cd870a 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/DocumentBlueprint/Tree/DocumentBlueprintTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/DocumentBlueprint/Tree/DocumentBlueprintTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Entities; @@ -13,7 +12,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.DocumentBlueprint.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.DocumentBlueprint}")] -[OpenApiTag("Document Blueprint")] +[ApiExplorerSettings(GroupName = "Document Blueprint")] public class DocumentBlueprintTreeControllerBase : EntityTreeControllerBase { private readonly IContentTypeService _contentTypeService; diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/DocumentType/Tree/DocumentTypeTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/DocumentType/Tree/DocumentTypeTreeControllerBase.cs index a80d69e7295d..91676b9f808a 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/DocumentType/Tree/DocumentTypeTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/DocumentType/Tree/DocumentTypeTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Entities; @@ -13,7 +12,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.DocumentType.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.DocumentType}")] -[OpenApiTag("Document Type")] +[ApiExplorerSettings(GroupName = "Document Type")] public class DocumentTypeTreeControllerBase : FolderTreeControllerBase { private readonly IContentTypeService _contentTypeService; diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Help/HelpControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Help/HelpControllerBase.cs index 7220b8738baa..9a50d45186a1 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Help/HelpControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Help/HelpControllerBase.cs @@ -1,12 +1,11 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.New.Cms.Web.Common.Routing; namespace Umbraco.Cms.ManagementApi.Controllers.Help; [ApiController] [VersionedApiBackOfficeRoute("help")] -[OpenApiTag("Help")] +[ApiExplorerSettings(GroupName = "Help")] [ApiVersion("1.0")] public abstract class HelpControllerBase : ManagementApiControllerBase { diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Install/InstallControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Install/InstallControllerBase.cs index 359e62b4b82d..04cd4885bb2d 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Install/InstallControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Install/InstallControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.ManagementApi.Filters; using Umbraco.New.Cms.Web.Common.Routing; @@ -8,7 +7,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Install; [ApiController] [VersionedApiBackOfficeRoute("install")] -[OpenApiTag("Install")] +[ApiExplorerSettings(GroupName = "Install")] [RequireRuntimeLevel(RuntimeLevel.Install)] public abstract class InstallControllerBase : ManagementApiControllerBase { diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Language/LanguageControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Language/LanguageControllerBase.cs index b84088906c87..c316486fede3 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Language/LanguageControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Language/LanguageControllerBase.cs @@ -1,12 +1,11 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.New.Cms.Web.Common.Routing; namespace Umbraco.Cms.ManagementApi.Controllers.Language; [ApiController] [VersionedApiBackOfficeRoute("language")] -[OpenApiTag("Language")] +[ApiExplorerSettings(GroupName = "Language")] [ApiVersion("1.0")] public abstract class LanguageControllerBase : ManagementApiControllerBase { diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Media/RecycleBin/MediaRecycleBinControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Media/RecycleBin/MediaRecycleBinControllerBase.cs index abd4c9c6bf53..787a12f95719 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Media/RecycleBin/MediaRecycleBinControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Media/RecycleBin/MediaRecycleBinControllerBase.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Entities; @@ -17,7 +16,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Media.RecycleBin; [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.RecycleBin}/{Constants.UdiEntityType.Media}")] [RequireMediaTreeRootAccess] [ProducesResponseType(StatusCodes.Status401Unauthorized)] -[OpenApiTag(nameof(Constants.UdiEntityType.Media))] +[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Media))] public class MediaRecycleBinControllerBase : RecycleBinControllerBase { public MediaRecycleBinControllerBase(IEntityService entityService) diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Media/Tree/MediaTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Media/Tree/MediaTreeControllerBase.cs index 44fb4464c773..67e90efe8e59 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Media/Tree/MediaTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Media/Tree/MediaTreeControllerBase.cs @@ -1,5 +1,5 @@ -using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Models; @@ -16,7 +16,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Media.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Media}")] -[OpenApiTag(nameof(Constants.UdiEntityType.Media))] +[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Media))] public class MediaTreeControllerBase : UserStartNodeTreeControllerBase { private readonly AppCaches _appCaches; diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/MediaType/Tree/MediaTypeTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/MediaType/Tree/MediaTypeTreeControllerBase.cs index 043434d0ab0a..d47691df4e71 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/MediaType/Tree/MediaTypeTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/MediaType/Tree/MediaTypeTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Entities; @@ -13,7 +12,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.MediaType.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.MediaType}")] -[OpenApiTag("Media Type")] +[ApiExplorerSettings(GroupName = "Media Type")] public class MediaTypeTreeControllerBase : FolderTreeControllerBase { private readonly IMediaTypeService _mediaTypeService; diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/MemberGroup/Tree/MemberGroupTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/MemberGroup/Tree/MemberGroupTreeControllerBase.cs index 6c4e5eb25a0a..455fcf64f799 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/MemberGroup/Tree/MemberGroupTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/MemberGroup/Tree/MemberGroupTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Entities; @@ -13,7 +12,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.MemberGroup.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.MemberGroup}")] -[OpenApiTag("Member Group")] +[ApiExplorerSettings(GroupName = "Member Group")] public class MemberGroupTreeControllerBase : EntityTreeControllerBase { public MemberGroupTreeControllerBase(IEntityService entityService) diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/MemberType/Tree/MemberTypeTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/MemberType/Tree/MemberTypeTreeControllerBase.cs index f52980b4ff91..2924ad3ba190 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/MemberType/Tree/MemberTypeTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/MemberType/Tree/MemberTypeTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Entities; @@ -13,7 +12,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.MemberType.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.MemberType}")] -[OpenApiTag("Member Type")] +[ApiExplorerSettings(GroupName = "Member Type")] public class MemberTypeTreeControllerBase : EntityTreeControllerBase { public MemberTypeTreeControllerBase(IEntityService entityService) diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/ModelsBuilder/GetModelsBuilderController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/ModelsBuilder/GetModelsBuilderController.cs index 09e5fcc1ac40..b2080ee61048 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/ModelsBuilder/GetModelsBuilderController.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/ModelsBuilder/GetModelsBuilderController.cs @@ -1,5 +1,4 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Umbraco.Cms.ManagementApi.Factories; using Umbraco.Cms.ManagementApi.ViewModels.ModelsBuilderDashboard; @@ -13,7 +12,7 @@ public class GetModelsBuilderController : ModelsBuilderControllerBase public GetModelsBuilderController(IModelsBuilderViewModelFactory modelsBuilderViewModelFactory) => _modelsBuilderViewModelFactory = modelsBuilderViewModelFactory; [HttpGet("dashboard")] - [ProducesResponseType(typeof(CreatedResult), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ModelsBuilderViewModel), StatusCodes.Status200OK)] [MapToApiVersion("1.0")] public async Task> GetDashboard() => await Task.FromResult(Ok(_modelsBuilderViewModelFactory.Create())); } diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/ModelsBuilder/ModelsBuilderControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/ModelsBuilder/ModelsBuilderControllerBase.cs index 6a09074c948b..aa428d6005e2 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/ModelsBuilder/ModelsBuilderControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/ModelsBuilder/ModelsBuilderControllerBase.cs @@ -1,12 +1,11 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.New.Cms.Web.Common.Routing; namespace Umbraco.Cms.ManagementApi.Controllers.ModelsBuilder; [ApiController] [VersionedApiBackOfficeRoute("models-builder")] -[OpenApiTag("Models Builder")] +[ApiExplorerSettings(GroupName = "Models Builder")] [ApiVersion("1.0")] public class ModelsBuilderControllerBase : ManagementApiControllerBase diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/PartialView/Tree/PartialViewTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/PartialView/Tree/PartialViewTreeControllerBase.cs index d74afbda9d9a..ba2420e85156 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/PartialView/Tree/PartialViewTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/PartialView/Tree/PartialViewTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.IO; using Umbraco.Cms.ManagementApi.Controllers.Tree; @@ -10,7 +9,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.PartialView.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.PartialView}")] -[OpenApiTag("Partial View")] +[ApiExplorerSettings(GroupName = "Partial View")] public class PartialViewTreeControllerBase : FileSystemTreeControllerBase { public PartialViewTreeControllerBase(FileSystems fileSystems) diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Profiling/ProfilingControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Profiling/ProfilingControllerBase.cs index c081f74fe0aa..f1919b250182 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Profiling/ProfilingControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Profiling/ProfilingControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.New.Cms.Web.Common.Routing; namespace Umbraco.Cms.ManagementApi.Controllers.Profiling; @@ -7,7 +6,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Profiling; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute("profiling")] -[OpenApiTag("Profiling")] +[ApiExplorerSettings(GroupName = "Profiling")] public class ProfilingControllerBase : ManagementApiControllerBase { } diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/PublishedCache/PublishedCacheControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/PublishedCache/PublishedCacheControllerBase.cs index 3fe18847f6b8..914775a563d5 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/PublishedCache/PublishedCacheControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/PublishedCache/PublishedCacheControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.New.Cms.Web.Common.Routing; namespace Umbraco.Cms.ManagementApi.Controllers.PublishedCache; @@ -7,7 +6,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.PublishedCache; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute("published-cache")] -[OpenApiTag("Published Cache")] +[ApiExplorerSettings(GroupName = "Published Cache")] public class PublishedCacheControllerBase : ManagementApiControllerBase { } diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Relation/RelationControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Relation/RelationControllerBase.cs index 7ec26735d19a..65266ef356a7 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Relation/RelationControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Relation/RelationControllerBase.cs @@ -1,12 +1,11 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.New.Cms.Web.Common.Routing; namespace Umbraco.Cms.ManagementApi.Controllers.Relation; [ApiController] [VersionedApiBackOfficeRoute("relation")] -[OpenApiTag("Relation")] +[ApiExplorerSettings(GroupName = "Relation")] [ApiVersion("1.0")] // TODO: Implement Authentication public abstract class RelationControllerBase : ManagementApiControllerBase diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/RelationType/Tree/RelationTypeTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/RelationType/Tree/RelationTypeTreeControllerBase.cs index 6f5f69e8bd02..c3497e7a1dfd 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/RelationType/Tree/RelationTypeTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/RelationType/Tree/RelationTypeTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Services; @@ -12,7 +11,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.RelationType.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.RelationType}")] -[OpenApiTag("Relation Type")] +[ApiExplorerSettings(GroupName = "Relation Type")] // NOTE: at the moment relation types aren't supported by EntityService, so we have little use of the // tree controller base. We'll keep it though, in the hope that we can mend EntityService. public class RelationTypeTreeControllerBase : EntityTreeControllerBase diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Script/Tree/ScriptTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Script/Tree/ScriptTreeControllerBase.cs index d8266f8226d4..f0f73981411f 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Script/Tree/ScriptTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Script/Tree/ScriptTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.IO; using Umbraco.Cms.ManagementApi.Controllers.Tree; @@ -10,7 +9,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Script.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Script}")] -[OpenApiTag(nameof(Constants.UdiEntityType.Script))] +[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Script))] public class ScriptTreeControllerBase : FileSystemTreeControllerBase { public ScriptTreeControllerBase(FileSystems fileSystems) diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Search/SearchControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Search/SearchControllerBase.cs index 2ab98aa2ff54..9d3befc0227c 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Search/SearchControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Search/SearchControllerBase.cs @@ -1,12 +1,11 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.New.Cms.Web.Common.Routing; namespace Umbraco.Cms.ManagementApi.Controllers.Search; [ApiController] [VersionedApiBackOfficeRoute("search")] -[OpenApiTag("Search")] +[ApiExplorerSettings(GroupName = "Search")] public class SearchControllerBase : ManagementApiControllerBase { } diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Security/BackOfficeController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Security/BackOfficeController.cs new file mode 100644 index 000000000000..74ce67ed032a --- /dev/null +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Security/BackOfficeController.cs @@ -0,0 +1,76 @@ +using System.Security.Claims; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using OpenIddict.Abstractions; +using OpenIddict.Server.AspNetCore; +using Umbraco.Cms.Core; +using Umbraco.Cms.Core.Security; +using Umbraco.Cms.Web.BackOffice.Security; +using Umbraco.Extensions; +using Umbraco.New.Cms.Web.Common.Routing; + +namespace Umbraco.Cms.ManagementApi.Controllers.Security; + +[ApiController] +[VersionedApiBackOfficeRoute(Paths.BackOfficeApiEndpointTemplate)] +[ApiExplorerSettings(GroupName = "Security")] +public class BackOfficeController : ManagementApiControllerBase +{ + private readonly IHttpContextAccessor _httpContextAccessor; + private readonly IBackOfficeSignInManager _backOfficeSignInManager; + private readonly IBackOfficeUserManager _backOfficeUserManager; + + public BackOfficeController(IHttpContextAccessor httpContextAccessor, IBackOfficeSignInManager backOfficeSignInManager, IBackOfficeUserManager backOfficeUserManager) + { + _httpContextAccessor = httpContextAccessor; + _backOfficeSignInManager = backOfficeSignInManager; + _backOfficeUserManager = backOfficeUserManager; + } + + [HttpGet("authorize")] + [HttpPost("authorize")] + [MapToApiVersion("1.0")] + public async Task Authorize() + { + HttpContext context = _httpContextAccessor.GetRequiredHttpContext(); + OpenIddictRequest? request = context.GetOpenIddictServerRequest(); + if (request == null) + { + return BadRequest("Unable to obtain OpenID data from the current request"); + } + + // retrieve the user principal stored in the authentication cookie. + AuthenticateResult cookieAuthResult = await HttpContext.AuthenticateAsync(Constants.Security.BackOfficeAuthenticationType); + if (cookieAuthResult.Succeeded && cookieAuthResult.Principal?.Identity?.Name != null) + { + BackOfficeIdentityUser? backOfficeUser = await _backOfficeUserManager.FindByNameAsync(cookieAuthResult.Principal.Identity.Name); + if (backOfficeUser != null) + { + ClaimsPrincipal backOfficePrincipal = await _backOfficeSignInManager.CreateUserPrincipalAsync(backOfficeUser); + backOfficePrincipal.SetClaim(OpenIddictConstants.Claims.Subject, backOfficeUser.Key.ToString()); + + // TODO: it is not optimal to append all claims to the token. + // the token size grows with each claim, although it is still smaller than the old cookie. + // see if we can find a better way so we do not risk leaking sensitive data in bearer tokens. + // maybe work with scopes instead? + Claim[] backOfficeClaims = backOfficePrincipal.Claims.ToArray(); + foreach (Claim backOfficeClaim in backOfficeClaims) + { + backOfficeClaim.SetDestinations(OpenIddictConstants.Destinations.AccessToken); + } + + if (request.GetScopes().Contains(OpenIddictConstants.Scopes.OfflineAccess)) + { + // "offline_access" scope is required to use refresh tokens + backOfficePrincipal.SetScopes(OpenIddictConstants.Scopes.OfflineAccess); + } + + return new SignInResult(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, backOfficePrincipal); + } + } + + return new ChallengeResult(new[] { Constants.Security.BackOfficeAuthenticationType }); + } +} diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Server/ServerControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Server/ServerControllerBase.cs index 9dd6b3a1929a..11674dcc2320 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Server/ServerControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Server/ServerControllerBase.cs @@ -1,12 +1,11 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.New.Cms.Web.Common.Routing; namespace Umbraco.Cms.ManagementApi.Controllers.Server; [ApiController] [VersionedApiBackOfficeRoute("server")] -[OpenApiTag("Server")] +[ApiExplorerSettings(GroupName = "Server")] public abstract class ServerControllerBase : ManagementApiControllerBase { diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/StaticFile/Tree/StaticFileTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/StaticFile/Tree/StaticFileTreeControllerBase.cs index 410559af56ce..a66898619a46 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/StaticFile/Tree/StaticFileTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/StaticFile/Tree/StaticFileTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.IO; using Umbraco.Cms.ManagementApi.Controllers.Tree; @@ -10,7 +9,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.StaticFile.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/static-file")] -[OpenApiTag("Static File")] +[ApiExplorerSettings(GroupName = "Static File")] public class StaticFileTreeControllerBase : FileSystemTreeControllerBase { private static readonly string[] _allowedRootFolders = { "App_Plugins", "wwwroot" }; diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Stylesheet/Tree/StylesheetTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Stylesheet/Tree/StylesheetTreeControllerBase.cs index 6ffe4052de9d..c0fe829806af 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Stylesheet/Tree/StylesheetTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Stylesheet/Tree/StylesheetTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.IO; using Umbraco.Cms.ManagementApi.Controllers.Tree; @@ -10,7 +9,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Stylesheet.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Stylesheet}")] -[OpenApiTag(nameof(Constants.UdiEntityType.Stylesheet))] +[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Stylesheet))] public class StylesheetTreeControllerBase : FileSystemTreeControllerBase { public StylesheetTreeControllerBase(FileSystems fileSystems) diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/AllTelemetryController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/AllTelemetryController.cs index 5520d204144a..7e3eed886b94 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/AllTelemetryController.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/AllTelemetryController.cs @@ -10,14 +10,14 @@ public class AllTelemetryController : TelemetryControllerBase { [HttpGet] [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] - public async Task> GetAll(int skip, int take) + [ProducesResponseType(typeof(PagedViewModel), StatusCodes.Status200OK)] + public async Task> GetAll(int skip, int take) { TelemetryLevel[] levels = Enum.GetValues(); - return await Task.FromResult(new PagedViewModel + return await Task.FromResult(new PagedViewModel { Total = levels.Length, - Items = levels.Skip(skip).Take(take).Select(level => new TelemetryLevelViewModel { TelemetryLevel = level }), + Items = levels.Skip(skip).Take(take).Select(level => new TelemetryViewModel { TelemetryLevel = level }), }); } } diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/GetTelemetryController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/GetTelemetryController.cs index 007554389ecb..3e6323343b45 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/GetTelemetryController.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/GetTelemetryController.cs @@ -13,6 +13,6 @@ public class GetTelemetryController : TelemetryControllerBase [HttpGet("level")] [MapToApiVersion("1.0")] - [ProducesResponseType(typeof(TelemetryLevelViewModel), StatusCodes.Status200OK)] - public async Task Get() => await Task.FromResult(new TelemetryLevelViewModel { TelemetryLevel = _metricsConsentService.GetConsentLevel() }); + [ProducesResponseType(typeof(TelemetryViewModel), StatusCodes.Status200OK)] + public async Task Get() => await Task.FromResult(new TelemetryViewModel { TelemetryLevel = _metricsConsentService.GetConsentLevel() }); } diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/SetTelemetryController.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/SetTelemetryController.cs index 5c9002335c4c..0687997ff0ba 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/SetTelemetryController.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/SetTelemetryController.cs @@ -15,9 +15,9 @@ public class SetTelemetryController : TelemetryControllerBase [MapToApiVersion("1.0")] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status200OK)] - public async Task SetConsentLevel(TelemetryLevelViewModel telemetryLevelViewModel) + public async Task SetConsentLevel(TelemetryViewModel telemetryViewModel) { - if (!Enum.IsDefined(telemetryLevelViewModel.TelemetryLevel)) + if (!Enum.IsDefined(telemetryViewModel.TelemetryLevel)) { var invalidModelProblem = new ProblemDetails { @@ -29,7 +29,7 @@ public async Task SetConsentLevel(TelemetryLevelViewModel telemet return BadRequest(invalidModelProblem); } - _metricsConsentService.SetConsentLevel(telemetryLevelViewModel.TelemetryLevel); + _metricsConsentService.SetConsentLevel(telemetryViewModel.TelemetryLevel); return await Task.FromResult(Ok()); } } diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/TelemetryControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/TelemetryControllerBase.cs index b95e35a7e8e4..ea5835b2ca82 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/TelemetryControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Telemetry/TelemetryControllerBase.cs @@ -1,12 +1,11 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.New.Cms.Web.Common.Routing; namespace Umbraco.Cms.ManagementApi.Controllers.Telemetry; [ApiController] [VersionedApiBackOfficeRoute("telemetry")] -[OpenApiTag("Telemetry")] +[ApiExplorerSettings(GroupName = "Telemetry")] [ApiVersion("1.0")] public abstract class TelemetryControllerBase : ManagementApiControllerBase { diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Template/Tree/TemplateTreeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Template/Tree/TemplateTreeControllerBase.cs index 1ca105c6aacc..c27206c66541 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Template/Tree/TemplateTreeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Template/Tree/TemplateTreeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Models.Entities; @@ -13,7 +12,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Template.Tree; [ApiVersion("1.0")] [ApiController] [VersionedApiBackOfficeRoute($"{Constants.Web.RoutePath.Tree}/{Constants.UdiEntityType.Template}")] -[OpenApiTag(nameof(Constants.UdiEntityType.Template))] +[ApiExplorerSettings(GroupName = nameof(Constants.UdiEntityType.Template))] public class TemplateTreeControllerBase : EntityTreeControllerBase { public TemplateTreeControllerBase(IEntityService entityService) diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/TrackedReference/TrackedReferencesControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/TrackedReference/TrackedReferencesControllerBase.cs index f473976c80a2..3b62a0fe69a2 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/TrackedReference/TrackedReferencesControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/TrackedReference/TrackedReferencesControllerBase.cs @@ -1,12 +1,11 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.New.Cms.Web.Common.Routing; namespace Umbraco.Cms.ManagementApi.Controllers.TrackedReference; [ApiController] [VersionedApiBackOfficeRoute("tracked-reference")] -[OpenApiTag("Tracked Reference")] +[ApiExplorerSettings(GroupName = "Tracked Reference")] [ApiVersion("1.0")] public abstract class TrackedReferenceControllerBase : ManagementApiControllerBase { diff --git a/src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/UpgradeControllerBase.cs b/src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/UpgradeControllerBase.cs index 084515aba2e2..6e8e056280ea 100644 --- a/src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/UpgradeControllerBase.cs +++ b/src/Umbraco.Cms.ManagementApi/Controllers/Upgrade/UpgradeControllerBase.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using NSwag.Annotations; using Umbraco.Cms.Core; using Umbraco.Cms.ManagementApi.Filters; using Umbraco.New.Cms.Web.Common.Routing; @@ -11,7 +10,7 @@ namespace Umbraco.Cms.ManagementApi.Controllers.Upgrade; [ApiController] [RequireRuntimeLevel(RuntimeLevel.Upgrade)] [VersionedApiBackOfficeRoute("upgrade")] -[OpenApiTag("Upgrade")] +[ApiExplorerSettings(GroupName = "Upgrade")] public abstract class UpgradeControllerBase : ManagementApiControllerBase { diff --git a/src/Umbraco.Cms.ManagementApi/DependencyInjection/BackOfficeAuthBuilderExtensions.cs b/src/Umbraco.Cms.ManagementApi/DependencyInjection/BackOfficeAuthBuilderExtensions.cs new file mode 100644 index 000000000000..5331acaaa9f8 --- /dev/null +++ b/src/Umbraco.Cms.ManagementApi/DependencyInjection/BackOfficeAuthBuilderExtensions.cs @@ -0,0 +1,145 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using OpenIddict.Validation.AspNetCore; +using Umbraco.Cms.Core; +using Umbraco.Cms.Core.DependencyInjection; +using Umbraco.Cms.ManagementApi.Middleware; +using Umbraco.Cms.ManagementApi.Security; +using Umbraco.Cms.Web.Common.Authorization; +using Umbraco.New.Cms.Infrastructure.HostedServices; +using Umbraco.New.Cms.Infrastructure.Security; + +namespace Umbraco.Cms.ManagementApi.DependencyInjection; + +public static class BackOfficeAuthBuilderExtensions +{ + public static IUmbracoBuilder AddBackOfficeAuthentication(this IUmbracoBuilder builder) + { + builder + .AddDbContext() + .AddOpenIddict(); + + return builder; + } + + private static IUmbracoBuilder AddDbContext(this IUmbracoBuilder builder) + { + builder.Services.AddDbContext(options => + { + // Configure the DB context + // TODO: use actual Umbraco DbContext once EF is implemented - and remove dependency on Microsoft.EntityFrameworkCore.InMemory + options.UseInMemoryDatabase(nameof(DbContext)); + + // Register the entity sets needed by OpenIddict. + options.UseOpenIddict(); + }); + + return builder; + } + + private static IUmbracoBuilder AddOpenIddict(this IUmbracoBuilder builder) + { + builder.Services.AddAuthentication(); + builder.Services.AddAuthorization(CreatePolicies); + + builder.Services.AddOpenIddict() + + // Register the OpenIddict core components. + .AddCore(options => + { + options + .UseEntityFrameworkCore() + .UseDbContext(); + }) + + // Register the OpenIddict server components. + .AddServer(options => + { + // Enable the authorization and token endpoints. + options + .SetAuthorizationEndpointUris(Controllers.Security.Paths.BackOfficeApiAuthorizationEndpoint) + .SetTokenEndpointUris(Controllers.Security.Paths.BackOfficeApiTokenEndpoint); + + // Enable authorization code flow with PKCE + options + .AllowAuthorizationCodeFlow() + .RequireProofKeyForCodeExchange() + .AllowRefreshTokenFlow(); + + // Register the encryption and signing credentials. + // - see https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html + options + // TODO: use actual certificates here, see docs above + .AddDevelopmentEncryptionCertificate() + .AddDevelopmentSigningCertificate() + .DisableAccessTokenEncryption(); + + // Register the ASP.NET Core host and configure for custom authentication endpoint. + options + .UseAspNetCore() + .EnableAuthorizationEndpointPassthrough(); + }) + + // Register the OpenIddict validation components. + .AddValidation(options => + { + // Import the configuration from the local OpenIddict server instance. + options.UseLocalServer(); + + // Register the ASP.NET Core host. + options.UseAspNetCore(); + }); + + builder.Services.AddTransient(); + builder.Services.AddSingleton(); + + builder.Services.AddHostedService(); + builder.Services.AddHostedService(); + + return builder; + } + + // TODO: remove this once EF is implemented + public class DatabaseManager : IHostedService + { + private readonly IServiceProvider _serviceProvider; + + public DatabaseManager(IServiceProvider serviceProvider) => _serviceProvider = serviceProvider; + + public async Task StartAsync(CancellationToken cancellationToken) + { + using IServiceScope scope = _serviceProvider.CreateScope(); + + DbContext context = scope.ServiceProvider.GetRequiredService(); + await context.Database.EnsureCreatedAsync(cancellationToken); + + // TODO: add BackOfficeAuthorizationInitializationMiddleware before UseAuthorization (to make it run for unauthorized API requests) and remove this + IBackOfficeApplicationManager backOfficeApplicationManager = scope.ServiceProvider.GetRequiredService(); + await backOfficeApplicationManager.EnsureBackOfficeApplicationAsync(new Uri("https://localhost:44331/"), cancellationToken); + } + + public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; + } + + // TODO: move this to an appropriate location and implement the policy scheme that should be used for the new management APIs + private static void CreatePolicies(AuthorizationOptions options) + { + void AddPolicy(string policyName, string claimType, params string[] allowedClaimValues) + { + options.AddPolicy($"New{policyName}", policy => + { + policy.AuthenticationSchemes.Add(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme); + policy.RequireClaim(claimType, allowedClaimValues); + }); + } + + // NOTE: these are ONLY sample policies that allow us to test the new management APIs + AddPolicy(AuthorizationPolicies.SectionAccessContent, Constants.Security.AllowedApplicationsClaimType, Constants.Applications.Content); + AddPolicy(AuthorizationPolicies.SectionAccessForContentTree, Constants.Security.AllowedApplicationsClaimType, Constants.Applications.Content); + AddPolicy(AuthorizationPolicies.SectionAccessForMediaTree, Constants.Security.AllowedApplicationsClaimType, Constants.Applications.Media); + AddPolicy(AuthorizationPolicies.SectionAccessMedia, Constants.Security.AllowedApplicationsClaimType, Constants.Applications.Media); + AddPolicy(AuthorizationPolicies.SectionAccessContentOrMedia, Constants.Security.AllowedApplicationsClaimType, Constants.Applications.Content, Constants.Applications.Media); + } +} diff --git a/src/Umbraco.Cms.ManagementApi/ManagementApiComposer.cs b/src/Umbraco.Cms.ManagementApi/ManagementApiComposer.cs index b73bc40ed290..fa1d34a30a23 100644 --- a/src/Umbraco.Cms.ManagementApi/ManagementApiComposer.cs +++ b/src/Umbraco.Cms.ManagementApi/ManagementApiComposer.cs @@ -3,22 +3,23 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.AspNetCore.Mvc.Versioning; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Serialization; -using NSwag.AspNetCore; +using Microsoft.OpenApi.Models; using Umbraco.Cms.Core.Composing; using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.ManagementApi.Configuration; using Umbraco.Cms.ManagementApi.DependencyInjection; +using Umbraco.Cms.ManagementApi.OpenApi; using Umbraco.Cms.Web.Common.ApplicationBuilder; using Umbraco.Extensions; +using Umbraco.New.Cms.Core; +using Umbraco.New.Cms.Core.Models.Configuration; using IHostingEnvironment = Umbraco.Cms.Core.Hosting.IHostingEnvironment; namespace Umbraco.Cms.ManagementApi; @@ -26,7 +27,7 @@ namespace Umbraco.Cms.ManagementApi; public class ManagementApiComposer : IComposer { private const string ApiTitle = "Umbraco Backoffice API"; - private const string ApiAllName = "All"; + private const string ApiDefaultDocumentName = "v1"; private ApiVersion DefaultApiVersion => new(1, 0); @@ -44,7 +45,8 @@ public void Compose(IUmbracoBuilder builder) .AddTrees() .AddFactories() .AddServices() - .AddMappers(); + .AddMappers() + .AddBackOfficeAuthentication(); services.AddApiVersioning(options => { @@ -55,16 +57,63 @@ public void Compose(IUmbracoBuilder builder) options.UseApiBehavior = false; }); - services.AddOpenApiDocument(options => + services.AddSwaggerGen(swaggerGenOptions => { - options.Title = ApiTitle; - options.Version = ApiAllName; - options.DocumentName = ApiAllName; - options.Description = "This shows all APIs available in this version of Umbraco - Including all the legacy apis that is available for backward compatibility"; - options.PostProcess = document => + swaggerGenOptions.SwaggerDoc( + ApiDefaultDocumentName, + new OpenApiInfo + { + Title = ApiTitle, + Version = DefaultApiVersion.ToString(), + Description = "This shows all APIs available in this version of Umbraco - including all the legacy apis that are available for backward compatibility" + }); + + swaggerGenOptions.DocInclusionPredicate((_, api) => !string.IsNullOrWhiteSpace(api.GroupName)); + + swaggerGenOptions.TagActionsBy(api => new [] { api.GroupName }); + + // see https://github.com/domaindrivendev/Swashbuckle.AspNetCore#change-operation-sort-order-eg-for-ui-sorting + string ActionSortKeySelector(ApiDescription apiDesc) + => $"{apiDesc.GroupName}_{apiDesc.ActionDescriptor.AttributeRouteInfo?.Template ?? apiDesc.ActionDescriptor.RouteValues["controller"]}_{apiDesc.ActionDescriptor.RouteValues["action"]}_{apiDesc.HttpMethod}"; + swaggerGenOptions.OrderActionsBy(ActionSortKeySelector); + + swaggerGenOptions.AddSecurityDefinition("OAuth", new OpenApiSecurityScheme { - document.Tags = document.Tags.OrderBy(tag => tag.Name).ToList(); - }; + In = ParameterLocation.Header, + Name = "Umbraco", + Type = SecuritySchemeType.OAuth2, + Description = "Umbraco Authentication", + Flows = new OpenApiOAuthFlows + { + AuthorizationCode = new OpenApiOAuthFlow + { + AuthorizationUrl = new Uri(Controllers.Security.Paths.BackOfficeApiAuthorizationEndpoint, UriKind.Relative), + TokenUrl = new Uri(Controllers.Security.Paths.BackOfficeApiTokenEndpoint, UriKind.Relative) + } + } + }); + + swaggerGenOptions.AddSecurityRequirement(new OpenApiSecurityRequirement + { + // this weird looking construct works because OpenApiSecurityRequirement + // is a specialization of Dictionary<,> + { + new OpenApiSecurityScheme + { + Reference = new OpenApiReference + { + Id = "OAuth", + Type = ReferenceType.SecurityScheme + } + }, + new List { } + } + }); + + swaggerGenOptions.DocumentFilter(); + swaggerGenOptions.SchemaFilter(); + + swaggerGenOptions.CustomSchemaIds(SchemaIdGenerator.Generate); }); services.AddVersionedApiExplorer(options => @@ -78,30 +127,47 @@ public void Compose(IUmbracoBuilder builder) services.AddControllers(); builder.Services.ConfigureOptions(); + // TODO: when this is moved to core, make the AddUmbracoOptions extension private again and remove core InternalsVisibleTo for Umbraco.Cms.ManagementApi + builder.AddUmbracoOptions(); + builder.Services.AddSingleton, NewBackOfficeSettingsValidator>(); + builder.Services.Configure(options => { options.AddFilter(new UmbracoPipelineFilter( "BackofficeSwagger", applicationBuilder => { - applicationBuilder.UseExceptionHandler(exceptionBuilder => exceptionBuilder.Run(async context => - { - Exception? exception = context.Features.Get()?.Error; - if (exception is null) + // Only use the API exception handler when we are requesting an API + applicationBuilder.UseWhen( + httpContext => { - return; - } + GlobalSettings? settings = httpContext.RequestServices.GetRequiredService>().Value; + IHostingEnvironment hostingEnvironment = httpContext.RequestServices.GetRequiredService(); + var officePath = settings.GetBackOfficePath(hostingEnvironment); - var response = new ProblemDetails + return httpContext.Request.Path.Value?.StartsWith($"{officePath}/management/api/") ?? false; + }, + innerBuilder => { - Title = exception.Message, - Detail = exception.StackTrace, - Status = StatusCodes.Status500InternalServerError, - Instance = exception.GetType().Name, - Type = "Error", - }; - await context.Response.WriteAsJsonAsync(response); - })); + innerBuilder.UseExceptionHandler(exceptionBuilder => exceptionBuilder.Run(async context => + { + Exception? exception = context.Features.Get()?.Error; + if (exception is null) + { + return; + } + + var response = new ProblemDetails + { + Title = exception.Message, + Detail = exception.StackTrace, + Status = StatusCodes.Status500InternalServerError, + Instance = exception.GetType().Name, + Type = "Error", + }; + await context.Response.WriteAsJsonAsync(response); + })); + }); }, applicationBuilder => { @@ -113,21 +179,18 @@ public void Compose(IUmbracoBuilder builder) GlobalSettings? settings = provider.GetRequiredService>().Value; IHostingEnvironment hostingEnvironment = provider.GetRequiredService(); var officePath = settings.GetBackOfficePath(hostingEnvironment); - // serve documents (same as app.UseSwagger()) - applicationBuilder.UseOpenApi(config => + + applicationBuilder.UseSwagger(swaggerOptions => { - config.Path = $"{officePath}/swagger/{{documentName}}/swagger.json"; + swaggerOptions.RouteTemplate = $"{officePath.TrimStart(Core.Constants.CharArrays.ForwardSlash)}/swagger/{{documentName}}/swagger.json"; }); - - // Serve Swagger UI - applicationBuilder.UseSwaggerUi3(config => + applicationBuilder.UseSwaggerUI(swaggerUiOptions => { - config.Path = officePath + "/swagger"; - config.SwaggerRoutes.Clear(); - var swaggerPath = $"{officePath}/swagger/{ApiAllName}/swagger.json"; - config.SwaggerRoutes.Add(new SwaggerUi3Route(ApiAllName, swaggerPath)); - config.OperationsSorter = "alpha"; - config.TagsSorter = "alpha"; + swaggerUiOptions.SwaggerEndpoint($"{officePath}/swagger/v1/swagger.json", $"{ApiTitle} {DefaultApiVersion}"); + swaggerUiOptions.RoutePrefix = $"{officePath.TrimStart(Core.Constants.CharArrays.ForwardSlash)}/swagger"; + + swaggerUiOptions.OAuthClientId(Constants.OauthClientIds.Swagger); + swaggerUiOptions.OAuthUsePkce(); }); } }, diff --git a/src/Umbraco.Cms.ManagementApi/OpenApi.json b/src/Umbraco.Cms.ManagementApi/OpenApi.json index e352c4d7da58..c0b9f4ef0b77 100644 --- a/src/Umbraco.Cms.ManagementApi/OpenApi.json +++ b/src/Umbraco.Cms.ManagementApi/OpenApi.json @@ -1,73 +1,41 @@ { - "x-generator": "NSwag v13.17.0.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))", - "openapi": "3.0.0", + "openapi": "3.0.1", "info": { "title": "Umbraco Backoffice API", - "description": "This shows all APIs available in this version of Umbraco - Including all the legacy apis that is available for backward compatibility", - "version": "All" + "description": "This shows all APIs available in this version of Umbraco - including all the legacy apis that are available for backward compatibility", + "version": "1.0" }, - "servers": [ - { - "url": "https://localhost:44331" - } - ], "paths": { - "/umbraco/management/api/v1/upgrade/authorize": { - "post": { + "/umbraco/management/api/v1/culture": { + "get": { "tags": [ - "Upgrade" + "Culture" ], - "operationId": "AuthorizeUpgrade_Authorize", - "responses": { - "200": { - "description": "" - }, - "428": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } + "parameters": [ + { + "name": "skip", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" } }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } + { + "name": "take", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" } } - } - } - }, - "/umbraco/management/api/v1/upgrade/settings": { - "get": { - "tags": [ - "Upgrade" ], - "operationId": "SettingsUpgrade_Settings", "responses": { "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpgradeSettingsViewModel" - } - } - } - }, - "428": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemDetails" + "$ref": "#/components/schemas/PagedCulture" } } } @@ -75,60 +43,54 @@ } } }, - "/umbraco/management/api/v1/tracked-reference/{id}": { + "/umbraco/management/api/v1/tree/data-type/children": { "get": { "tags": [ - "Tracked Reference" + "Data Type" ], - "summary": "Gets a page list of tracked references for the current item, so you can see where an item is being used.", - "description": "Used by info tabs on content, media etc. and for the delete and unpublish of single items.\nThis is basically finding parents of relations.", - "operationId": "ByIdTrackedReference_Get", "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "parentKey", + "in": "query", "schema": { - "type": "integer", - "format": "int32" - }, - "x-position": 1 + "type": "string", + "format": "uuid" + } }, { "name": "skip", "in": "query", "schema": { "type": "integer", - "format": "int64" - }, - "x-position": 2 + "format": "int32", + "default": 0 + } }, { "name": "take", "in": "query", "schema": { "type": "integer", - "format": "int64" - }, - "x-position": 3 + "format": "int32", + "default": 100 + } }, { - "name": "filterMustBeIsDependency", + "name": "foldersOnly", "in": "query", "schema": { "type": "boolean", - "nullable": true - }, - "x-position": 4 + "default": false + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfRelationItemViewModel" + "$ref": "#/components/schemas/PagedFolderTreeItem" } } } @@ -136,60 +98,34 @@ } } }, - "/umbraco/management/api/v1/tracked-reference/descendants/{parentId}": { + "/umbraco/management/api/v1/tree/data-type/item": { "get": { "tags": [ - "Tracked Reference" + "Data Type" ], - "summary": "Gets a page list of the child nodes of the current item used in any kind of relation.", - "description": "Used when deleting and unpublishing a single item to check if this item has any descending items that are in any\nkind of relation.\nThis is basically finding the descending items which are children in relations.", - "operationId": "DescendantsTrackedReference_Descendants", "parameters": [ { - "name": "parentId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "x-position": 1 - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int64" - }, - "x-position": 2 - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int64" - }, - "x-position": 3 - }, - { - "name": "filterMustBeIsDependency", + "name": "key", "in": "query", "schema": { - "type": "boolean", - "nullable": true - }, - "x-position": 4 + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfRelationItemViewModel" + "type": "array", + "items": { + "$ref": "#/components/schemas/FolderTreeItem" + } } } } @@ -197,65 +133,46 @@ } } }, - "/umbraco/management/api/v1/tracked-reference/item": { + "/umbraco/management/api/v1/tree/data-type/root": { "get": { "tags": [ - "Tracked Reference" + "Data Type" ], - "summary": "Gets a page list of the items used in any kind of relation from selected integer ids.", - "description": "Used when bulk deleting content/media and bulk unpublishing content (delete and unpublish on List view).\nThis is basically finding children of relations.", - "operationId": "ItemsTrackedReference_GetPagedReferencedItems", "parameters": [ - { - "name": "ids", - "in": "query", - "style": "form", - "explode": true, - "schema": { - "type": "array", - "nullable": true, - "items": { - "type": "integer", - "format": "int32" - } - }, - "x-position": 1 - }, { "name": "skip", "in": "query", "schema": { "type": "integer", - "format": "int64" - }, - "x-position": 2 + "format": "int32", + "default": 0 + } }, { "name": "take", "in": "query", "schema": { "type": "integer", - "format": "int64" - }, - "x-position": 3 + "format": "int32", + "default": 100 + } }, { - "name": "filterMustBeIsDependency", + "name": "foldersOnly", "in": "query", "schema": { "type": "boolean", - "nullable": true - }, - "x-position": 4 + "default": false + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfRelationItemViewModel" + "$ref": "#/components/schemas/PagedFolderTreeItem" } } } @@ -263,50 +180,36 @@ } } }, - "/umbraco/management/api/v1/tree/template/children": { + "/umbraco/management/api/v1/dictionary": { "get": { "tags": [ - "Template" + "Dictionary" ], - "operationId": "ChildrenTemplateTree_Children", "parameters": [ - { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "guid" - }, - "x-position": 1 - }, { "name": "skip", "in": "query", "schema": { "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 2 + "format": "int32" + } }, { "name": "take", "in": "query", "schema": { "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 3 + "format": "int32" + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfEntityTreeItemViewModel" + "$ref": "#/components/schemas/PagedDictionaryOverview" } } } @@ -314,40 +217,51 @@ } } }, - "/umbraco/management/api/v1/tree/template/item": { - "get": { + "/umbraco/management/api/v1/dictionary/{id}": { + "patch": { "tags": [ - "Template" + "Dictionary" ], - "operationId": "ItemsTemplateTree_Items", "parameters": [ { - "name": "key", - "x-originalName": "keys", - "in": "query", - "style": "form", - "explode": true, + "name": "id", + "in": "path", + "required": true, "schema": { - "type": "array", - "nullable": true, - "items": { - "type": "string", - "format": "guid" - } - }, - "x-position": 1 + "type": "string", + "format": "uuid" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/JsonPatch" + } + } + } + } + }, "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityTreeItemViewModel" - } + "$ref": "#/components/schemas/ContentResult" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundResult" } } } @@ -355,81 +269,70 @@ } } }, - "/umbraco/management/api/v1/tree/template/root": { + "/umbraco/management/api/v1/dictionary/{key}": { "get": { "tags": [ - "Template" + "Dictionary" ], - "operationId": "RootTemplateTree_Root", "parameters": [ { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 1 - }, - { - "name": "take", - "in": "query", + "name": "key", + "in": "path", + "required": true, "schema": { - "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 2 + "type": "string", + "format": "uuid" + } } ], "responses": { "200": { - "description": "", + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Dictionary" + } + } + } + }, + "404": { + "description": "Not Found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfEntityTreeItemViewModel" + "$ref": "#/components/schemas/NotFoundResult" } } } } } - } - }, - "/umbraco/management/api/v1/telemetry": { - "get": { + }, + "delete": { "tags": [ - "Telemetry" + "Dictionary" ], - "operationId": "AllTelemetry_GetAll", "parameters": [ { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - }, - "x-position": 1 - }, - { - "name": "take", - "in": "query", + "name": "key", + "in": "path", + "required": true, "schema": { - "type": "integer", - "format": "int32" - }, - "x-position": 2 + "type": "string", + "format": "uuid" + } } ], "responses": { "200": { - "description": "", + "description": "Success" + }, + "404": { + "description": "Not Found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfTelemetryLevelViewModel" + "$ref": "#/components/schemas/NotFoundResult" } } } @@ -437,45 +340,33 @@ } } }, - "/umbraco/management/api/v1/telemetry/level": { - "get": { - "tags": [ - "Telemetry" - ], - "operationId": "GetTelemetry_Get", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TelemetryLevelViewModel" - } - } - } - } - } - }, + "/umbraco/management/api/v1/dictionary/create": { "post": { "tags": [ - "Telemetry" + "Dictionary" ], - "operationId": "SetTelemetry_SetConsentLevel", "requestBody": { - "x-name": "telemetryLevelViewModel", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/TelemetryLevelViewModel" + "$ref": "#/components/schemas/DictionaryItem" } } - }, - "required": true, - "x-position": 1 + } }, "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatedResult" + } + } + } + }, "400": { - "description": "", + "description": "Bad Request", "content": { "application/json": { "schema": { @@ -483,57 +374,52 @@ } } } - }, - "200": { - "description": "" } } } }, - "/umbraco/management/api/v1/tree/stylesheet/children": { + "/umbraco/management/api/v1/dictionary/export/{key}": { "get": { "tags": [ - "Stylesheet" + "Dictionary" ], - "operationId": "ChildrenStylesheetTree_Children", "parameters": [ { - "name": "path", - "in": "query", + "name": "key", + "in": "path", + "required": true, "schema": { "type": "string", - "nullable": true - }, - "x-position": 1 - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 2 + "format": "uuid" + } }, { - "name": "take", + "name": "includeChildren", "in": "query", "schema": { - "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 3 + "type": "boolean", + "default": false + } } ], "responses": { "200": { - "description": "", + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "description": "Not Found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfFileSystemTreeItemViewModel" + "$ref": "#/components/schemas/NotFoundResult" } } } @@ -541,39 +427,45 @@ } } }, - "/umbraco/management/api/v1/tree/stylesheet/item": { - "get": { + "/umbraco/management/api/v1/dictionary/import": { + "post": { "tags": [ - "Stylesheet" + "Dictionary" ], - "operationId": "ItemsStylesheetTree_Items", "parameters": [ { - "name": "path", - "x-originalName": "paths", + "name": "file", "in": "query", - "style": "form", - "explode": true, "schema": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - }, - "x-position": 1 + "type": "string" + } + }, + { + "name": "parentId", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileSystemTreeItemViewModel" - } + "$ref": "#/components/schemas/ContentResult" + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundResult" } } } @@ -581,41 +473,31 @@ } } }, - "/umbraco/management/api/v1/tree/stylesheet/root": { - "get": { + "/umbraco/management/api/v1/dictionary/upload": { + "post": { "tags": [ - "Stylesheet" - ], - "operationId": "RootStylesheetTree_Root", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 1 - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 2 - } + "Dictionary" ], + "requestBody": { + "content": { } + }, "responses": { "200": { - "description": "", + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DictionaryImport" + } + } + } + }, + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfFileSystemTreeItemViewModel" + "$ref": "#/components/schemas/ProblemDetails" } } } @@ -623,21 +505,19 @@ } } }, - "/umbraco/management/api/v1/tree/static-file/children": { + "/umbraco/management/api/v1/tree/dictionary/children": { "get": { "tags": [ - "Static File" + "Dictionary" ], - "operationId": "ChildrenStaticFileTree_Children", "parameters": [ { - "name": "path", + "name": "parentKey", "in": "query", "schema": { "type": "string", - "nullable": true - }, - "x-position": 1 + "format": "uuid" + } }, { "name": "skip", @@ -646,8 +526,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 2 + } }, { "name": "take", @@ -656,17 +535,16 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 3 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfFileSystemTreeItemViewModel" + "$ref": "#/components/schemas/PagedEntityTreeItem" } } } @@ -674,38 +552,33 @@ } } }, - "/umbraco/management/api/v1/tree/static-file/item": { + "/umbraco/management/api/v1/tree/dictionary/item": { "get": { "tags": [ - "Static File" + "Dictionary" ], - "operationId": "ItemsStaticFileTree_Items", "parameters": [ { - "name": "path", - "x-originalName": "paths", + "name": "key", "in": "query", - "style": "form", - "explode": true, "schema": { "type": "array", - "nullable": true, "items": { - "type": "string" + "type": "string", + "format": "uuid" } - }, - "x-position": 1 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/FileSystemTreeItemViewModel" + "$ref": "#/components/schemas/FolderTreeItem" } } } @@ -714,12 +587,11 @@ } } }, - "/umbraco/management/api/v1/tree/static-file/root": { + "/umbraco/management/api/v1/tree/dictionary/root": { "get": { "tags": [ - "Static File" + "Dictionary" ], - "operationId": "RootStaticFileTree_Root", "parameters": [ { "name": "skip", @@ -728,8 +600,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 1 + } }, { "name": "take", @@ -738,17 +609,16 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 2 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfFileSystemTreeItemViewModel" + "$ref": "#/components/schemas/PagedEntityTreeItem" } } } @@ -756,29 +626,34 @@ } } }, - "/umbraco/management/api/v1/server/status": { + "/umbraco/management/api/v1/tree/document-blueprint/item": { "get": { "tags": [ - "Server" + "Document Blueprint" ], - "operationId": "StatusServer_Get", - "responses": { - "400": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } + "parameters": [ + { + "name": "key", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" } } - }, + } + ], + "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ServerStatusViewModel" + "type": "array", + "items": { + "$ref": "#/components/schemas/DocumentBlueprintTreeItem" + } } } } @@ -786,29 +661,38 @@ } } }, - "/umbraco/management/api/v1/server/version": { + "/umbraco/management/api/v1/tree/document-blueprint/root": { "get": { "tags": [ - "Server" + "Document Blueprint" ], - "operationId": "VersionServer_Get", - "responses": { - "400": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } + "parameters": [ + { + "name": "skip", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 0 } }, + { + "name": "take", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 100 + } + } + ], + "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VersionViewModel" + "$ref": "#/components/schemas/PagedDocumentBlueprintTreeItem" } } } @@ -816,84 +700,54 @@ } } }, - "/umbraco/management/api/v1/search/index/{indexName}": { + "/umbraco/management/api/v1/tree/document-type/children": { "get": { "tags": [ - "Search" + "Document Type" ], - "summary": "Check if the index has been rebuilt", - "description": "This is kind of rudimentary since there's no way we can know that the index has rebuilt, we\nhave a listener for the index op complete so we'll just check if that key is no longer there in the runtime cache", - "operationId": "IndexDetailsSearch_Index", "parameters": [ { - "name": "indexName", - "in": "path", - "required": true, + "name": "parentKey", + "in": "query", "schema": { "type": "string", - "nullable": true - }, - "x-position": 1 - } - ], - "responses": { - "400": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } + "format": "uuid" } }, - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IndexViewModel" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/search/index": { - "get": { - "tags": [ - "Search" - ], - "summary": "Get the details for indexers", - "operationId": "IndexListSearch_Indexes", - "parameters": [ { "name": "skip", "in": "query", "schema": { "type": "integer", - "format": "int32" - }, - "x-position": 1 + "format": "int32", + "default": 0 + } }, { "name": "take", "in": "query", "schema": { "type": "integer", - "format": "int32" - }, - "x-position": 2 + "format": "int32", + "default": 100 + } + }, + { + "name": "foldersOnly", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfIndexViewModel" + "$ref": "#/components/schemas/PagedDocumentTypeTreeItem" } } } @@ -901,43 +755,34 @@ } } }, - "/umbraco/management/api/v1/search/index/{indexName}/rebuild": { - "post": { + "/umbraco/management/api/v1/tree/document-type/item": { + "get": { "tags": [ - "Search" + "Document Type" ], - "summary": "Rebuilds the index", - "operationId": "IndexRebuildSearch_Rebuild", "parameters": [ { - "name": "indexName", - "in": "path", - "required": true, + "name": "key", + "in": "query", "schema": { - "type": "string", - "nullable": true - }, - "x-position": 1 + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } } ], "responses": { - "400": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, "200": { - "description": "", + "description": "Success", "content": { - "application/octet-stream": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "type": "array", + "items": { + "$ref": "#/components/schemas/DocumentTypeTreeItem" + } } } } @@ -945,40 +790,46 @@ } } }, - "/umbraco/management/api/v1/search/searcher": { + "/umbraco/management/api/v1/tree/document-type/root": { "get": { "tags": [ - "Search" + "Document Type" ], - "summary": "Get the details for searchers", - "operationId": "SearcherListSearch_Searchers", "parameters": [ { "name": "skip", "in": "query", "schema": { "type": "integer", - "format": "int32" - }, - "x-position": 1 + "format": "int32", + "default": 0 + } }, { "name": "take", "in": "query", "schema": { "type": "integer", - "format": "int32" - }, - "x-position": 2 + "format": "int32", + "default": 100 + } + }, + { + "name": "foldersOnly", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfSearcherViewModel" + "$ref": "#/components/schemas/PagedDocumentTypeTreeItem" } } } @@ -986,68 +837,56 @@ } } }, - "/umbraco/management/api/v1/search/searcher/{searcherName}/search": { + "/umbraco/management/api/v1/recycle-bin/document/children": { "get": { "tags": [ - "Search" + "Document" ], - "operationId": "SearcherSearchSearch_GetSearchResults", "parameters": [ { - "name": "searcherName", - "in": "path", - "required": true, - "schema": { - "type": "string", - "nullable": true - }, - "x-position": 1 - }, - { - "name": "query", + "name": "parentKey", "in": "query", "schema": { "type": "string", - "nullable": true - }, - "x-position": 2 + "format": "uuid" + } }, { "name": "skip", "in": "query", "schema": { "type": "integer", - "format": "int32" - }, - "x-position": 3 + "format": "int32", + "default": 0 + } }, { "name": "take", "in": "query", "schema": { "type": "integer", - "format": "int32" - }, - "x-position": 4 + "format": "int32", + "default": 100 + } } ], "responses": { - "200": { - "description": "", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfPagedViewModelOfSearchResultViewModel" + "$ref": "#/components/schemas/ProblemDetails" } } } }, - "404": { - "description": "", + "200": { + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemDetails" + "$ref": "#/components/schemas/PagedRecycleBinItem" } } } @@ -1055,22 +894,12 @@ } } }, - "/umbraco/management/api/v1/tree/script/children": { + "/umbraco/management/api/v1/recycle-bin/document/root": { "get": { "tags": [ - "Script" + "Document" ], - "operationId": "ChildrenScriptTree_Children", "parameters": [ - { - "name": "path", - "in": "query", - "schema": { - "type": "string", - "nullable": true - }, - "x-position": 1 - }, { "name": "skip", "in": "query", @@ -1078,8 +907,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 2 + } }, { "name": "take", @@ -1088,57 +916,26 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 3 + } } ], "responses": { - "200": { - "description": "", + "401": { + "description": "Unauthorized", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfFileSystemTreeItemViewModel" + "$ref": "#/components/schemas/ProblemDetails" } } } - } - } - } - }, - "/umbraco/management/api/v1/tree/script/item": { - "get": { - "tags": [ - "Script" - ], - "operationId": "ItemsScriptTree_Items", - "parameters": [ - { - "name": "path", - "x-originalName": "paths", - "in": "query", - "style": "form", - "explode": true, - "schema": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - }, - "x-position": 1 - } - ], - "responses": { + }, "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileSystemTreeItemViewModel" - } + "$ref": "#/components/schemas/PagedRecycleBinItem" } } } @@ -1146,13 +943,20 @@ } } }, - "/umbraco/management/api/v1/tree/script/root": { + "/umbraco/management/api/v1/tree/document/children": { "get": { "tags": [ - "Script" + "Document" ], - "operationId": "RootScriptTree_Root", "parameters": [ + { + "name": "parentKey", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, { "name": "skip", "in": "query", @@ -1160,8 +964,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 1 + } }, { "name": "take", @@ -1170,17 +973,31 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 2 + } + }, + { + "name": "dataTypeKey", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "culture", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfFileSystemTreeItemViewModel" + "$ref": "#/components/schemas/PagedDocumentTreeItem" } } } @@ -1188,59 +1005,49 @@ } } }, - "/umbraco/management/api/v1/relation/child-relation/{childId}": { + "/umbraco/management/api/v1/tree/document/item": { "get": { "tags": [ - "Relation" + "Document" ], - "operationId": "ByChildRelation_ByChild", "parameters": [ { - "name": "childId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "x-position": 1 - }, - { - "name": "skip", + "name": "key", "in": "query", "schema": { - "type": "integer", - "format": "int32" - }, - "x-position": 2 + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } }, { - "name": "take", + "name": "dataTypeKey", "in": "query", "schema": { - "type": "integer", - "format": "int32" - }, - "x-position": 3 + "type": "string", + "format": "uuid" + } }, { - "name": "relationTypeAlias", + "name": "culture", "in": "query", "schema": { - "type": "string", - "default": "", - "nullable": true - }, - "x-position": 4 + "type": "string" + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfRelationViewModel" + "type": "array", + "items": { + "$ref": "#/components/schemas/DocumentTreeItem" + } } } } @@ -1248,83 +1055,53 @@ } } }, - "/umbraco/management/api/v1/relation/{id}": { + "/umbraco/management/api/v1/tree/document/root": { "get": { "tags": [ - "Relation" + "Document" ], - "operationId": "ByIdRelation_ById", "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "skip", + "in": "query", "schema": { "type": "integer", - "format": "int32" - }, - "x-position": 1 - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RelationViewModel" - } - } + "format": "int32", + "default": 0 } }, - "404": { - "description": "", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } - } + { + "name": "take", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 100 } - } - } - } - }, - "/umbraco/management/api/v1/tree/relation-type/item": { - "get": { - "tags": [ - "Relation Type" - ], - "operationId": "ItemsRelationTypeTree_Items", - "parameters": [ + }, { - "name": "key", - "x-originalName": "keys", + "name": "dataTypeKey", "in": "query", - "style": "form", - "explode": true, "schema": { - "type": "array", - "nullable": true, - "items": { - "type": "string", - "format": "guid" - } - }, - "x-position": 1 + "type": "string", + "format": "uuid" + } + }, + { + "name": "culture", + "in": "query", + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FolderTreeItemViewModel" - } + "$ref": "#/components/schemas/PagedDocumentTreeItem" } } } @@ -1332,171 +1109,216 @@ } } }, - "/umbraco/management/api/v1/tree/relation-type/root": { + "/umbraco/management/api/v1/help": { "get": { "tags": [ - "Relation Type" + "Help" ], - "operationId": "RootRelationTypeTree_Root", "parameters": [ + { + "name": "section", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "tree", + "in": "query", + "schema": { + "type": "string" + } + }, { "name": "skip", "in": "query", "schema": { "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 1 + "format": "int32" + } }, { "name": "take", "in": "query", "schema": { "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 2 + "format": "int32" + } + }, + { + "name": "baseUrl", + "in": "query", + "schema": { + "type": "string", + "default": "https://our.umbraco.com" + } } ], "responses": { - "200": { - "description": "", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfEntityTreeItemViewModel" + "$ref": "#/components/schemas/ProblemDetails" } } } - } - } - } - }, - "/umbraco/management/api/v1/published-cache/collect": { - "post": { - "tags": [ - "Published Cache" - ], - "operationId": "CollectPublishedCache_Collect", - "responses": { + }, "200": { - "description": "" + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PagedHelpPage" + } + } + } } } } }, - "/umbraco/management/api/v1/published-cache/rebuild": { - "post": { + "/umbraco/management/api/v1/install/settings": { + "get": { "tags": [ - "Published Cache" + "Install" ], - "operationId": "RebuildPublishedCache_Collect", "responses": { + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "428": { + "description": "Client Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, "200": { - "description": "" + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InstallSettings" + } + } + } } } } }, - "/umbraco/management/api/v1/published-cache/reload": { + "/umbraco/management/api/v1/install/setup": { "post": { "tags": [ - "Published Cache" + "Install" ], - "operationId": "ReloadPublishedCache_Reload", - "responses": { - "200": { - "description": "" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Install" + } + } } - } - } - }, - "/umbraco/management/api/v1/published-cache/status": { - "get": { - "tags": [ - "Published Cache" - ], - "operationId": "StatusPublishedCache_Status", + }, "responses": { - "200": { - "description": "", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "428": { + "description": "Client Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" } } } + }, + "200": { + "description": "Success" } } } }, - "/umbraco/management/api/v1/profiling/status": { - "get": { + "/umbraco/management/api/v1/install/validate-database": { + "post": { "tags": [ - "Profiling" + "Install" ], - "operationId": "StatusProfiling_Status", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DatabaseInstall" + } + } + } + }, "responses": { - "200": { - "description": "", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProfilingStatusViewModel" + "$ref": "#/components/schemas/ProblemDetails" } } } + }, + "200": { + "description": "Success" } } } }, - "/umbraco/management/api/v1/tree/partial-view/children": { + "/umbraco/management/api/v1/language": { "get": { "tags": [ - "Partial View" + "Language" ], - "operationId": "ChildrenPartialViewTree_Children", "parameters": [ - { - "name": "path", - "in": "query", - "schema": { - "type": "string", - "nullable": true - }, - "x-position": 1 - }, { "name": "skip", "in": "query", "schema": { "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 2 + "format": "int32" + } }, { "name": "take", "in": "query", "schema": { "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 3 + "format": "int32" + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfFileSystemTreeItemViewModel" + "$ref": "#/components/schemas/PagedLanguage" } } } @@ -1504,108 +1326,104 @@ } } }, - "/umbraco/management/api/v1/tree/partial-view/item": { + "/umbraco/management/api/v1/language/{id}": { "get": { "tags": [ - "Partial View" + "Language" ], - "operationId": "ItemsPartialViewTree_Items", "parameters": [ { - "name": "path", - "x-originalName": "paths", - "in": "query", - "style": "form", - "explode": true, + "name": "id", + "in": "path", + "required": true, "schema": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - }, - "x-position": 1 + "type": "integer", + "format": "int32" + } } ], "responses": { + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundResult" + } + } + } + }, "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FileSystemTreeItemViewModel" - } + "$ref": "#/components/schemas/Language" } } } } } - } - }, - "/umbraco/management/api/v1/tree/partial-view/root": { - "get": { + }, + "delete": { "tags": [ - "Partial View" + "Language" ], - "operationId": "RootPartialViewTree_Root", "parameters": [ { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 1 - }, - { - "name": "take", - "in": "query", + "name": "id", + "in": "path", + "required": true, "schema": { "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 2 + "format": "int32" + } } ], "responses": { - "200": { - "description": "", + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Not Found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfFileSystemTreeItemViewModel" + "$ref": "#/components/schemas/ProblemDetails" } } } + }, + "200": { + "description": "Success" } } } }, - "/umbraco/management/api/v1/models-builder/build": { + "/umbraco/management/api/v1/language/create": { "post": { "tags": [ - "Models Builder" + "Language" ], - "operationId": "BuildModelsBuilder_BuildModels", - "responses": { - "201": { - "description": "", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Language" } } - }, - "428": { - "description": "", + } + }, + "responses": { + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { @@ -1613,44 +1431,102 @@ } } } + }, + "201": { + "description": "Created" } } } }, - "/umbraco/management/api/v1/models-builder/dashboard": { - "get": { + "/umbraco/management/api/v1/language/update": { + "put": { "tags": [ - "Models Builder" + "Language" ], - "operationId": "GetModelsBuilder_GetDashboard", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Language" + } + } + } + }, "responses": { - "200": { - "description": "", + "404": { + "description": "Not Found", "content": { - "application/octet-stream": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/NotFoundResult" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" } } } + }, + "200": { + "description": "Success" } } } }, - "/umbraco/management/api/v1/models-builder/status": { + "/umbraco/management/api/v1/tree/media-type/children": { "get": { "tags": [ - "Models Builder" + "Media Type" + ], + "parameters": [ + { + "name": "parentKey", + "in": "query", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "skip", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 0 + } + }, + { + "name": "take", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 100 + } + }, + { + "name": "foldersOnly", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + } ], - "operationId": "StatusModelsBuilder_GetModelsOutOfDateStatus", "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OutOfDateStatusViewModel" + "$ref": "#/components/schemas/PagedFolderTreeItem" } } } @@ -1658,39 +1534,33 @@ } } }, - "/umbraco/management/api/v1/tree/member-type/item": { + "/umbraco/management/api/v1/tree/media-type/item": { "get": { "tags": [ - "Member Type" + "Media Type" ], - "operationId": "ItemsMemberTypeTree_Items", "parameters": [ { "name": "key", - "x-originalName": "keys", "in": "query", - "style": "form", - "explode": true, "schema": { "type": "array", - "nullable": true, "items": { "type": "string", - "format": "guid" + "format": "uuid" } - }, - "x-position": 1 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/EntityTreeItemViewModel" + "$ref": "#/components/schemas/FolderTreeItem" } } } @@ -1699,12 +1569,11 @@ } } }, - "/umbraco/management/api/v1/tree/member-type/root": { + "/umbraco/management/api/v1/tree/media-type/root": { "get": { "tags": [ - "Member Type" + "Media Type" ], - "operationId": "RootMemberTypeTree_Root", "parameters": [ { "name": "skip", @@ -1713,8 +1582,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 1 + } }, { "name": "take", @@ -1723,17 +1591,24 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 2 + } + }, + { + "name": "foldersOnly", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfEntityTreeItemViewModel" + "$ref": "#/components/schemas/PagedFolderTreeItem" } } } @@ -1741,40 +1616,56 @@ } } }, - "/umbraco/management/api/v1/tree/member-group/item": { + "/umbraco/management/api/v1/recycle-bin/media/children": { "get": { "tags": [ - "Member Group" + "Media" ], - "operationId": "ItemsMemberGroupTree_Items", "parameters": [ { - "name": "key", - "x-originalName": "keys", + "name": "parentKey", "in": "query", - "style": "form", - "explode": true, "schema": { - "type": "array", - "nullable": true, - "items": { - "type": "string", - "format": "guid" - } - }, - "x-position": 1 + "type": "string", + "format": "uuid" + } + }, + { + "name": "skip", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 0 + } + }, + { + "name": "take", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 100 + } } ], "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EntityTreeItemViewModel" - } + "$ref": "#/components/schemas/PagedRecycleBinItem" } } } @@ -1782,12 +1673,11 @@ } } }, - "/umbraco/management/api/v1/tree/member-group/root": { + "/umbraco/management/api/v1/recycle-bin/media/root": { "get": { "tags": [ - "Member Group" + "Media" ], - "operationId": "RootMemberGroupTree_Root", "parameters": [ { "name": "skip", @@ -1796,8 +1686,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 1 + } }, { "name": "take", @@ -1806,17 +1695,26 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 2 + } } ], "responses": { + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfEntityTreeItemViewModel" + "$ref": "#/components/schemas/PagedRecycleBinItem" } } } @@ -1829,16 +1727,14 @@ "tags": [ "Media" ], - "operationId": "ChildrenMediaTree_Children", "parameters": [ { "name": "parentKey", "in": "query", "schema": { "type": "string", - "format": "guid" - }, - "x-position": 1 + "format": "uuid" + } }, { "name": "skip", @@ -1847,8 +1743,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 2 + } }, { "name": "take", @@ -1857,27 +1752,24 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 3 + } }, { "name": "dataTypeKey", "in": "query", "schema": { "type": "string", - "format": "guid", - "nullable": true - }, - "x-position": 4 + "format": "uuid" + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfContentTreeItemViewModel" + "$ref": "#/components/schemas/PagedContentTreeItem" } } } @@ -1890,44 +1782,36 @@ "tags": [ "Media" ], - "operationId": "ItemsMediaTree_Items", "parameters": [ { "name": "key", - "x-originalName": "keys", "in": "query", - "style": "form", - "explode": true, "schema": { "type": "array", - "nullable": true, "items": { "type": "string", - "format": "guid" + "format": "uuid" } - }, - "x-position": 1 + } }, { "name": "dataTypeKey", "in": "query", "schema": { "type": "string", - "format": "guid", - "nullable": true - }, - "x-position": 2 + "format": "uuid" + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/ContentTreeItemViewModel" + "$ref": "#/components/schemas/ContentTreeItem" } } } @@ -1941,7 +1825,6 @@ "tags": [ "Media" ], - "operationId": "RootMediaTree_Root", "parameters": [ { "name": "skip", @@ -1950,8 +1833,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 1 + } }, { "name": "take", @@ -1960,27 +1842,24 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 2 + } }, { "name": "dataTypeKey", "in": "query", "schema": { "type": "string", - "format": "guid", - "nullable": true - }, - "x-position": 3 + "format": "uuid" + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfContentTreeItemViewModel" + "$ref": "#/components/schemas/PagedContentTreeItem" } } } @@ -1988,60 +1867,34 @@ } } }, - "/umbraco/management/api/v1/recycle-bin/media/children": { + "/umbraco/management/api/v1/tree/member-group/item": { "get": { "tags": [ - "Media" + "Member Group" ], - "operationId": "ChildrenMediaRecycleBin_Children", "parameters": [ { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "guid" - }, - "x-position": 1 - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 2 - }, - { - "name": "take", + "name": "key", "in": "query", "schema": { - "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 3 + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } } ], "responses": { - "401": { - "description": "", + "200": { + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedViewModelOfRecycleBinItemViewModel" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityTreeItem" + } } } } @@ -2049,12 +1902,11 @@ } } }, - "/umbraco/management/api/v1/recycle-bin/media/root": { + "/umbraco/management/api/v1/tree/member-group/root": { "get": { "tags": [ - "Media" + "Member Group" ], - "operationId": "RootMediaRecycleBin_Root", "parameters": [ { "name": "skip", @@ -2063,8 +1915,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 1 + } }, { "name": "take", @@ -2073,27 +1924,51 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 2 + } } ], "responses": { - "401": { - "description": "", + "200": { + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemDetails" + "$ref": "#/components/schemas/PagedEntityTreeItem" } } } - }, + } + } + } + }, + "/umbraco/management/api/v1/tree/member-type/item": { + "get": { + "tags": [ + "Member Type" + ], + "parameters": [ + { + "name": "key", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + ], + "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfRecycleBinItemViewModel" + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityTreeItem" + } } } } @@ -2101,22 +1976,12 @@ } } }, - "/umbraco/management/api/v1/tree/media-type/children": { + "/umbraco/management/api/v1/tree/member-type/root": { "get": { "tags": [ - "Media Type" + "Member Type" ], - "operationId": "ChildrenMediaTypeTree_Children", "parameters": [ - { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "guid" - }, - "x-position": 1 - }, { "name": "skip", "in": "query", @@ -2124,8 +1989,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 2 + } }, { "name": "take", @@ -2134,26 +1998,16 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 3 - }, - { - "name": "foldersOnly", - "in": "query", - "schema": { - "type": "boolean", - "default": false - }, - "x-position": 4 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfFolderTreeItemViewModel" + "$ref": "#/components/schemas/PagedEntityTreeItem" } } } @@ -2161,40 +2015,47 @@ } } }, - "/umbraco/management/api/v1/tree/media-type/item": { - "get": { + "/umbraco/management/api/v1/models-builder/build": { + "post": { "tags": [ - "Media Type" + "Models Builder" ], - "operationId": "ItemsMediaTypeTree_Items", - "parameters": [ - { - "name": "key", - "x-originalName": "keys", - "in": "query", - "style": "form", - "explode": true, - "schema": { - "type": "array", - "nullable": true, - "items": { - "type": "string", - "format": "guid" + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatedResult" + } } - }, - "x-position": 1 + } + }, + "428": { + "description": "Client Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } } + } + } + }, + "/umbraco/management/api/v1/models-builder/dashboard": { + "get": { + "tags": [ + "Models Builder" ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FolderTreeItemViewModel" - } + "$ref": "#/components/schemas/ModelsBuilder" } } } @@ -2202,50 +2063,18 @@ } } }, - "/umbraco/management/api/v1/tree/media-type/root": { + "/umbraco/management/api/v1/models-builder/status": { "get": { "tags": [ - "Media Type" - ], - "operationId": "RootMediaTypeTree_Root", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 1 - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 2 - }, - { - "name": "foldersOnly", - "in": "query", - "schema": { - "type": "boolean", - "default": false - }, - "x-position": 3 - } + "Models Builder" ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfFolderTreeItemViewModel" + "$ref": "#/components/schemas/OutOfDateStatus" } } } @@ -2253,40 +2082,45 @@ } } }, - "/umbraco/management/api/v1/language": { + "/umbraco/management/api/v1/tree/partial-view/children": { "get": { "tags": [ - "Language" + "Partial View" ], - "summary": "1\n Returns all currently configured languages.", - "operationId": "AllLanguage_GetAll", "parameters": [ + { + "name": "path", + "in": "query", + "schema": { + "type": "string" + } + }, { "name": "skip", "in": "query", "schema": { "type": "integer", - "format": "int32" - }, - "x-position": 1 + "format": "int32", + "default": 0 + } }, { "name": "take", "in": "query", "schema": { "type": "integer", - "format": "int32" - }, - "x-position": 2 + "format": "int32", + "default": 100 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfLanguageViewModel" + "$ref": "#/components/schemas/PagedFileSystemTreeItem" } } } @@ -2294,209 +2128,181 @@ } } }, - "/umbraco/management/api/v1/language/{id}": { + "/umbraco/management/api/v1/tree/partial-view/item": { "get": { "tags": [ - "Language" + "Partial View" ], - "operationId": "ByIdLanguage_ById", "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "path", + "in": "query", "schema": { - "type": "integer", - "format": "int32" - }, - "x-position": 1 + "type": "array", + "items": { + "type": "string" + } + } } ], "responses": { - "404": { - "description": "", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LanguageViewModel" + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemTreeItem" + } } } } } } - }, - "delete": { + } + }, + "/umbraco/management/api/v1/tree/partial-view/root": { + "get": { "tags": [ - "Language" + "Partial View" ], - "summary": "Deletes a language with a given ID", - "operationId": "DeleteLanguage_Delete", "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "skip", + "in": "query", "schema": { "type": "integer", - "format": "int32" - }, - "x-position": 1 + "format": "int32", + "default": 0 + } + }, + { + "name": "take", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 100 + } } ], "responses": { - "400": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, - "404": { - "description": "", + "200": { + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemDetails" + "$ref": "#/components/schemas/PagedFileSystemTreeItem" } } } - }, - "200": { - "description": "" } } } }, - "/umbraco/management/api/v1/language/create": { - "post": { + "/umbraco/management/api/v1/profiling/status": { + "get": { "tags": [ - "Language" + "Profiling" ], - "summary": "Creates or saves a language", - "operationId": "CreateLanguage_Create", - "requestBody": { - "x-name": "language", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LanguageViewModel" - } - } - }, - "required": true, - "x-position": 1 - }, "responses": { - "400": { - "description": "", + "200": { + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemDetails" + "$ref": "#/components/schemas/ProfilingStatus" } } } - }, - "201": { - "description": "" } } } }, - "/umbraco/management/api/v1/language/update": { - "put": { - "tags": [ - "Language" + "/umbraco/management/api/v1/published-cache/collect": { + "post": { + "tags": [ + "Published Cache" ], - "summary": "Updates a language", - "operationId": "UpdateLanguage_Update", - "requestBody": { - "x-name": "language", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LanguageViewModel" - } - } - }, - "required": true, - "x-position": 1 - }, "responses": { - "404": { - "description": "", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "400": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, "200": { - "description": "" + "description": "Success" } } } }, - "/umbraco/management/api/v1/install/settings": { + "/umbraco/management/api/v1/published-cache/rebuild": { + "post": { + "tags": [ + "Published Cache" + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/umbraco/management/api/v1/published-cache/reload": { + "post": { + "tags": [ + "Published Cache" + ], + "responses": { + "200": { + "description": "Success" + } + } + } + }, + "/umbraco/management/api/v1/published-cache/status": { "get": { "tags": [ - "Install" + "Published Cache" ], - "operationId": "SettingsInstall_Settings", "responses": { - "400": { - "description": "", + "200": { + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemDetails" + "type": "string" } } } - }, - "428": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } + } + } + } + }, + "/umbraco/management/api/v1/tree/relation-type/item": { + "get": { + "tags": [ + "Relation Type" + ], + "parameters": [ + { + "name": "key", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" } } - }, + } + ], + "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/InstallSettingsViewModel" + "type": "array", + "items": { + "$ref": "#/components/schemas/FolderTreeItem" + } } } } @@ -2504,110 +2310,99 @@ } } }, - "/umbraco/management/api/v1/install/setup": { - "post": { + "/umbraco/management/api/v1/tree/relation-type/root": { + "get": { "tags": [ - "Install" + "Relation Type" ], - "operationId": "SetupInstall_Setup", - "requestBody": { - "x-name": "installData", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InstallViewModel" - } + "parameters": [ + { + "name": "skip", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 0 } }, - "required": true, - "x-position": 1 - }, - "responses": { - "400": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } + { + "name": "take", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 100 } - }, - "428": { - "description": "", + } + ], + "responses": { + "200": { + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemDetails" + "$ref": "#/components/schemas/PagedEntityTreeItem" } } } - }, - "200": { - "description": "" } } } }, - "/umbraco/management/api/v1/install/validate-database": { - "post": { + "/umbraco/management/api/v1/relation/{id}": { + "get": { "tags": [ - "Install" + "Relation" ], - "operationId": "ValidateDatabaseInstall_ValidateDatabase", - "requestBody": { - "x-name": "viewModel", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DatabaseInstallViewModel" - } + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" } - }, - "required": true, - "x-position": 1 - }, + } + ], "responses": { - "400": { - "description": "", + "200": { + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemDetails" + "$ref": "#/components/schemas/Relation" } } } }, - "200": { - "description": "" + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundResult" + } + } + } } } } }, - "/umbraco/management/api/v1/help": { + "/umbraco/management/api/v1/relation/child-relation/{childId}": { "get": { "tags": [ - "Help" + "Relation" ], - "operationId": "GetHelp_Get", "parameters": [ { - "name": "section", - "in": "query", - "schema": { - "type": "string", - "nullable": true - }, - "x-position": 1 - }, - { - "name": "tree", - "in": "query", + "name": "childId", + "in": "path", + "required": true, "schema": { - "type": "string", - "nullable": true - }, - "x-position": 2 + "type": "integer", + "format": "int32" + } }, { "name": "skip", @@ -2615,8 +2410,7 @@ "schema": { "type": "integer", "format": "int32" - }, - "x-position": 3 + } }, { "name": "take", @@ -2624,37 +2418,24 @@ "schema": { "type": "integer", "format": "int32" - }, - "x-position": 4 + } }, { - "name": "baseUrl", + "name": "relationTypeAlias", "in": "query", "schema": { "type": "string", - "default": "https://our.umbraco.com", - "nullable": true - }, - "x-position": 5 + "default": "" + } } ], "responses": { - "400": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfHelpPageViewModel" + "$ref": "#/components/schemas/PagedRelation" } } } @@ -2662,21 +2443,18 @@ } } }, - "/umbraco/management/api/v1/tree/document/children": { + "/umbraco/management/api/v1/tree/script/children": { "get": { "tags": [ - "Document" + "Script" ], - "operationId": "ChildrenDocumentTree_Children", "parameters": [ { - "name": "parentKey", + "name": "path", "in": "query", "schema": { - "type": "string", - "format": "guid" - }, - "x-position": 1 + "type": "string" + } }, { "name": "skip", @@ -2685,8 +2463,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 2 + } }, { "name": "take", @@ -2695,36 +2472,16 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 3 - }, - { - "name": "dataTypeKey", - "in": "query", - "schema": { - "type": "string", - "format": "guid", - "nullable": true - }, - "x-position": 4 - }, - { - "name": "culture", - "in": "query", - "schema": { - "type": "string", - "nullable": true - }, - "x-position": 5 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfDocumentTreeItemViewModel" + "$ref": "#/components/schemas/PagedFileSystemTreeItem" } } } @@ -2732,58 +2489,32 @@ } } }, - "/umbraco/management/api/v1/tree/document/item": { + "/umbraco/management/api/v1/tree/script/item": { "get": { "tags": [ - "Document" + "Script" ], - "operationId": "ItemsDocumentTree_Items", "parameters": [ { - "name": "key", - "x-originalName": "keys", + "name": "path", "in": "query", - "style": "form", - "explode": true, "schema": { "type": "array", - "nullable": true, "items": { - "type": "string", - "format": "guid" + "type": "string" } - }, - "x-position": 1 - }, - { - "name": "dataTypeKey", - "in": "query", - "schema": { - "type": "string", - "format": "guid", - "nullable": true - }, - "x-position": 2 - }, - { - "name": "culture", - "in": "query", - "schema": { - "type": "string", - "nullable": true - }, - "x-position": 3 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/DocumentTreeItemViewModel" + "$ref": "#/components/schemas/FileSystemTreeItem" } } } @@ -2792,12 +2523,11 @@ } } }, - "/umbraco/management/api/v1/tree/document/root": { + "/umbraco/management/api/v1/tree/script/root": { "get": { "tags": [ - "Document" + "Script" ], - "operationId": "RootDocumentTree_Root", "parameters": [ { "name": "skip", @@ -2806,8 +2536,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 1 + } }, { "name": "take", @@ -2816,36 +2545,16 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 2 - }, - { - "name": "dataTypeKey", - "in": "query", - "schema": { - "type": "string", - "format": "guid", - "nullable": true - }, - "x-position": 3 - }, - { - "name": "culture", - "in": "query", - "schema": { - "type": "string", - "nullable": true - }, - "x-position": 4 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfDocumentTreeItemViewModel" + "$ref": "#/components/schemas/PagedFileSystemTreeItem" } } } @@ -2853,60 +2562,36 @@ } } }, - "/umbraco/management/api/v1/recycle-bin/document/children": { + "/umbraco/management/api/v1/search/index": { "get": { "tags": [ - "Document" + "Search" ], - "operationId": "ChildrenDocumentRecycleBin_Children", "parameters": [ - { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "guid" - }, - "x-position": 1 - }, { "name": "skip", "in": "query", "schema": { "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 2 + "format": "int32" + } }, { "name": "take", "in": "query", "schema": { "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 3 + "format": "int32" + } } ], "responses": { - "401": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfRecycleBinItemViewModel" + "$ref": "#/components/schemas/PagedIndex" } } } @@ -2914,37 +2599,24 @@ } } }, - "/umbraco/management/api/v1/recycle-bin/document/root": { + "/umbraco/management/api/v1/search/index/{indexName}": { "get": { "tags": [ - "Document" + "Search" ], - "operationId": "RootDocumentRecycleBin_Root", "parameters": [ { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 1 - }, - { - "name": "take", - "in": "query", + "name": "indexName", + "in": "path", + "required": true, "schema": { - "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 2 + "type": "string" + } } ], "responses": { - "401": { - "description": "", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { @@ -2954,11 +2626,11 @@ } }, "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfRecycleBinItemViewModel" + "$ref": "#/components/schemas/Index" } } } @@ -2966,100 +2638,38 @@ } } }, - "/umbraco/management/api/v1/tree/document-type/children": { - "get": { + "/umbraco/management/api/v1/search/index/{indexName}/rebuild": { + "post": { "tags": [ - "Document Type" + "Search" ], - "operationId": "ChildrenDocumentTypeTree_Children", "parameters": [ { - "name": "parentKey", - "in": "query", - "schema": { - "type": "string", - "format": "guid" - }, - "x-position": 1 - }, - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 2 - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 3 - }, - { - "name": "foldersOnly", - "in": "query", + "name": "indexName", + "in": "path", + "required": true, "schema": { - "type": "boolean", - "default": false - }, - "x-position": 4 + "type": "string" + } } ], "responses": { - "200": { - "description": "", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfDocumentTypeTreeItemViewModel" + "$ref": "#/components/schemas/ProblemDetails" } } } - } - } - } - }, - "/umbraco/management/api/v1/tree/document-type/item": { - "get": { - "tags": [ - "Document Type" - ], - "operationId": "ItemsDocumentTypeTree_Items", - "parameters": [ - { - "name": "key", - "x-originalName": "keys", - "in": "query", - "style": "form", - "explode": true, - "schema": { - "type": "array", - "nullable": true, - "items": { - "type": "string", - "format": "guid" - } - }, - "x-position": 1 - } - ], - "responses": { + }, "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DocumentTypeTreeItemViewModel" - } + "$ref": "#/components/schemas/OkResult" } } } @@ -3067,50 +2677,36 @@ } } }, - "/umbraco/management/api/v1/tree/document-type/root": { + "/umbraco/management/api/v1/search/searcher": { "get": { "tags": [ - "Document Type" + "Search" ], - "operationId": "RootDocumentTypeTree_Root", "parameters": [ { "name": "skip", "in": "query", "schema": { "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 1 + "format": "int32" + } }, { "name": "take", "in": "query", "schema": { "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 2 - }, - { - "name": "foldersOnly", - "in": "query", - "schema": { - "type": "boolean", - "default": false - }, - "x-position": 3 + "format": "int32" + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfDocumentTypeTreeItemViewModel" + "$ref": "#/components/schemas/PagedSearcher" } } } @@ -3118,82 +2714,61 @@ } } }, - "/umbraco/management/api/v1/tree/document-blueprint/item": { + "/umbraco/management/api/v1/search/searcher/{searcherName}/search": { "get": { "tags": [ - "Document Blueprint" + "Search" ], - "operationId": "ItemsDocumentBlueprintTree_Items", "parameters": [ { - "name": "key", - "x-originalName": "keys", + "name": "searcherName", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "query", "in": "query", - "style": "form", - "explode": true, "schema": { - "type": "array", - "nullable": true, - "items": { - "type": "string", - "format": "guid" - } - }, - "x-position": 1 - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DocumentBlueprintTreeItemViewModel" - } - } - } + "type": "string" } - } - } - } - }, - "/umbraco/management/api/v1/tree/document-blueprint/root": { - "get": { - "tags": [ - "Document Blueprint" - ], - "operationId": "RootDocumentBlueprintTree_Root", - "parameters": [ + }, { "name": "skip", "in": "query", "schema": { "type": "integer", - "format": "int32", - "default": 0 - }, - "x-position": 1 + "format": "int32" + } }, { "name": "take", "in": "query", "schema": { "type": "integer", - "format": "int32", - "default": 100 - }, - "x-position": 2 + "format": "int32" + } } ], "responses": { "200": { - "description": "", + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PagedPaged" + } + } + } + }, + "404": { + "description": "Not Found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfDocumentBlueprintTreeItemViewModel" + "$ref": "#/components/schemas/ProblemDetails" } } } @@ -3201,121 +2776,50 @@ } } }, - "/umbraco/management/api/v1/dictionary": { + "/umbraco/management/api/v1/security/back-office/authorize": { "get": { "tags": [ - "Dictionary" - ], - "summary": "Retrieves a list with all dictionary items", - "operationId": "AllDictionary_All", - "parameters": [ - { - "name": "skip", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - }, - "x-position": 1 - }, - { - "name": "take", - "in": "query", - "schema": { - "type": "integer", - "format": "int32" - }, - "x-position": 2 - } + "Security" ], "responses": { "200": { - "description": "The IEnumerable`1.\n ", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PagedViewModelOfDictionaryOverviewViewModel" - } - } - } + "description": "Success" + } + } + }, + "post": { + "tags": [ + "Security" + ], + "responses": { + "200": { + "description": "Success" } } } }, - "/umbraco/management/api/v1/dictionary/{key}": { + "/umbraco/management/api/v1/server/status": { "get": { "tags": [ - "Dictionary" - ], - "summary": "Gets a dictionary item by guid", - "operationId": "ByIdDictionary_ByKey", - "parameters": [ - { - "name": "key", - "in": "path", - "required": true, - "description": "The id.\n ", - "schema": { - "type": "string", - "format": "guid" - }, - "x-position": 1 - } + "Server" ], "responses": { - "200": { - "description": "The DictionaryDisplay. Returns a not found response when dictionary item does not exist\n ", + "400": { + "description": "Bad Request", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/DictionaryViewModel" + "$ref": "#/components/schemas/ProblemDetails" } } } }, - "404": { - "description": "", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Dictionary" - ], - "summary": "Deletes a data type with a given ID", - "operationId": "DeleteDictionary_Delete", - "parameters": [ - { - "name": "key", - "in": "path", - "required": true, - "description": "The key of the dictionary item to delete", - "schema": { - "type": "string", - "format": "guid" - }, - "x-position": 1 - } - ], - "responses": { "200": { - "description": "HttpResponseMessage\n " - }, - "404": { - "description": "", + "description": "Success", "content": { - "application/octet-stream": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/ServerStatus" } } } @@ -3323,44 +2827,28 @@ } } }, - "/umbraco/management/api/v1/dictionary/create": { - "post": { + "/umbraco/management/api/v1/server/version": { + "get": { "tags": [ - "Dictionary" + "Server" ], - "summary": "Creates a new dictionary item", - "operationId": "CreateDictionary_Create", - "requestBody": { - "x-name": "dictionaryViewModel", - "description": "The viewmodel to pass to the action", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DictionaryItemViewModel" - } - } - }, - "required": true, - "x-position": 1 - }, "responses": { - "201": { - "description": "The HttpResponseMessage.\n ", + "400": { + "description": "Bad Request", "content": { - "application/octet-stream": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/ProblemDetails" } } } }, - "400": { - "description": "", + "200": { + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemDetails" + "$ref": "#/components/schemas/Version" } } } @@ -3368,105 +2856,45 @@ } } }, - "/umbraco/management/api/v1/dictionary/export/{key}": { + "/umbraco/management/api/v1/tree/static-file/children": { "get": { "tags": [ - "Dictionary" + "Static File" ], - "operationId": "ExportDictionary_ExportDictionary", "parameters": [ { - "name": "key", - "in": "path", - "required": true, - "schema": { - "type": "string", - "format": "guid" - }, - "x-position": 1 - }, - { - "name": "includeChildren", + "name": "path", "in": "query", "schema": { - "type": "boolean", - "default": false - }, - "x-position": 2 - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } - } + "type": "string" } }, - "404": { - "description": "", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - } - } - } - }, - "/umbraco/management/api/v1/dictionary/import": { - "post": { - "tags": [ - "Dictionary" - ], - "operationId": "ImportDictionary_ImportDictionary", - "parameters": [ { - "name": "file", + "name": "skip", "in": "query", "schema": { - "type": "string", - "nullable": true - }, - "x-position": 1 + "type": "integer", + "format": "int32", + "default": 0 + } }, { - "name": "parentId", + "name": "take", "in": "query", "schema": { "type": "integer", "format": "int32", - "nullable": true - }, - "x-position": 2 + "default": 100 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "404": { - "description": "", - "content": { - "application/octet-stream": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "$ref": "#/components/schemas/PagedFileSystemTreeItem" } } } @@ -3474,58 +2902,33 @@ } } }, - "/umbraco/management/api/v1/dictionary/{id}": { - "patch": { + "/umbraco/management/api/v1/tree/static-file/item": { + "get": { "tags": [ - "Dictionary" + "Static File" ], - "operationId": "UpdateDictionary_Update", "parameters": [ { - "name": "id", - "in": "path", - "required": true, + "name": "path", + "in": "query", "schema": { - "type": "string", - "format": "guid" - }, - "x-position": 1 - } - ], - "requestBody": { - "x-name": "updateViewModel", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/JsonPatchViewModel" - } + "type": "array", + "items": { + "type": "string" } } - }, - "required": true, - "x-position": 2 - }, + } + ], "responses": { "200": { - "description": "", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "404": { - "description": "", + "description": "Success", "content": { - "application/octet-stream": { + "application/json": { "schema": { - "type": "string", - "format": "binary" + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemTreeItem" + } } } } @@ -3533,45 +2936,38 @@ } } }, - "/umbraco/management/api/v1/dictionary/upload": { - "post": { + "/umbraco/management/api/v1/tree/static-file/root": { + "get": { "tags": [ - "Dictionary" + "Static File" ], - "operationId": "UploadDictionary_Upload", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "type": "object", - "properties": { - "file": { - "type": "string", - "format": "binary", - "nullable": true - } - } - } + "parameters": [ + { + "name": "skip", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 0 + } + }, + { + "name": "take", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "default": 100 } } - }, + ], "responses": { "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DictionaryImportViewModel" - } - } - } - }, - "400": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProblemDetails" + "$ref": "#/components/schemas/PagedFileSystemTreeItem" } } } @@ -3579,21 +2975,18 @@ } } }, - "/umbraco/management/api/v1/tree/dictionary/children": { + "/umbraco/management/api/v1/tree/stylesheet/children": { "get": { "tags": [ - "Dictionary" + "Stylesheet" ], - "operationId": "ChildrenDictionaryTree_Children", "parameters": [ { - "name": "parentKey", + "name": "path", "in": "query", "schema": { - "type": "string", - "format": "guid" - }, - "x-position": 1 + "type": "string" + } }, { "name": "skip", @@ -3602,8 +2995,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 2 + } }, { "name": "take", @@ -3612,17 +3004,16 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 3 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfEntityTreeItemViewModel" + "$ref": "#/components/schemas/PagedFileSystemTreeItem" } } } @@ -3630,39 +3021,32 @@ } } }, - "/umbraco/management/api/v1/tree/dictionary/item": { + "/umbraco/management/api/v1/tree/stylesheet/item": { "get": { "tags": [ - "Dictionary" + "Stylesheet" ], - "operationId": "ItemsDictionaryTree_Items", "parameters": [ { - "name": "key", - "x-originalName": "keys", + "name": "path", "in": "query", - "style": "form", - "explode": true, "schema": { "type": "array", - "nullable": true, "items": { - "type": "string", - "format": "guid" + "type": "string" } - }, - "x-position": 1 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/FolderTreeItemViewModel" + "$ref": "#/components/schemas/FileSystemTreeItem" } } } @@ -3671,12 +3055,11 @@ } } }, - "/umbraco/management/api/v1/tree/dictionary/root": { + "/umbraco/management/api/v1/tree/stylesheet/root": { "get": { "tags": [ - "Dictionary" + "Stylesheet" ], - "operationId": "RootDictionaryTree_Root", "parameters": [ { "name": "skip", @@ -3685,8 +3068,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 1 + } }, { "name": "take", @@ -3695,17 +3077,16 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 2 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfEntityTreeItemViewModel" + "$ref": "#/components/schemas/PagedFileSystemTreeItem" } } } @@ -3713,21 +3094,104 @@ } } }, - "/umbraco/management/api/v1/tree/data-type/children": { + "/umbraco/management/api/v1/telemetry": { "get": { "tags": [ - "Data Type" + "Telemetry" + ], + "parameters": [ + { + "name": "skip", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + }, + { + "name": "take", + "in": "query", + "schema": { + "type": "integer", + "format": "int32" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PagedTelemetry" + } + } + } + } + } + } + }, + "/umbraco/management/api/v1/telemetry/level": { + "get": { + "tags": [ + "Telemetry" + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Telemetry" + } + } + } + } + } + }, + "post": { + "tags": [ + "Telemetry" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Telemetry" + } + } + } + }, + "responses": { + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "200": { + "description": "Success" + } + } + } + }, + "/umbraco/management/api/v1/tree/template/children": { + "get": { + "tags": [ + "Template" ], - "operationId": "ChildrenDataTypeTree_Children", "parameters": [ { "name": "parentKey", "in": "query", "schema": { "type": "string", - "format": "guid" - }, - "x-position": 1 + "format": "uuid" + } }, { "name": "skip", @@ -3736,8 +3200,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 2 + } }, { "name": "take", @@ -3746,26 +3209,16 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 3 - }, - { - "name": "foldersOnly", - "in": "query", - "schema": { - "type": "boolean", - "default": false - }, - "x-position": 4 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfFolderTreeItemViewModel" + "$ref": "#/components/schemas/PagedEntityTreeItem" } } } @@ -3773,39 +3226,33 @@ } } }, - "/umbraco/management/api/v1/tree/data-type/item": { + "/umbraco/management/api/v1/tree/template/item": { "get": { "tags": [ - "Data Type" + "Template" ], - "operationId": "ItemsDataTypeTree_Items", "parameters": [ { "name": "key", - "x-originalName": "keys", "in": "query", - "style": "form", - "explode": true, "schema": { "type": "array", - "nullable": true, "items": { "type": "string", - "format": "guid" + "format": "uuid" } - }, - "x-position": 1 + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/FolderTreeItemViewModel" + "$ref": "#/components/schemas/EntityTreeItem" } } } @@ -3814,12 +3261,11 @@ } } }, - "/umbraco/management/api/v1/tree/data-type/root": { + "/umbraco/management/api/v1/tree/template/root": { "get": { "tags": [ - "Data Type" + "Template" ], - "operationId": "RootDataTypeTree_Root", "parameters": [ { "name": "skip", @@ -3828,8 +3274,7 @@ "type": "integer", "format": "int32", "default": 0 - }, - "x-position": 1 + } }, { "name": "take", @@ -3838,26 +3283,69 @@ "type": "integer", "format": "int32", "default": 100 - }, - "x-position": 2 + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PagedEntityTreeItem" + } + } + } + } + } + } + }, + "/umbraco/management/api/v1/tracked-reference/{id}": { + "get": { + "tags": [ + "Tracked Reference" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } }, { - "name": "foldersOnly", + "name": "skip", "in": "query", "schema": { - "type": "boolean", - "default": false - }, - "x-position": 3 + "type": "integer", + "format": "int64" + } + }, + { + "name": "take", + "in": "query", + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "filterMustBeIsDependency", + "in": "query", + "schema": { + "type": "boolean" + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfFolderTreeItemViewModel" + "$ref": "#/components/schemas/PagedRelationItem" } } } @@ -3865,1473 +3353,3627 @@ } } }, - "/umbraco/management/api/v1/culture": { + "/umbraco/management/api/v1/tracked-reference/descendants/{parentId}": { "get": { "tags": [ - "Culture" + "Tracked Reference" ], - "summary": "Returns all cultures available for creating languages.", - "operationId": "AllCulture_GetAll", "parameters": [ + { + "name": "parentId", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + } + }, { "name": "skip", "in": "query", "schema": { "type": "integer", - "format": "int32" - }, - "x-position": 1 + "format": "int64" + } }, { "name": "take", "in": "query", "schema": { "type": "integer", - "format": "int32" - }, - "x-position": 2 + "format": "int64" + } + }, + { + "name": "filterMustBeIsDependency", + "in": "query", + "schema": { + "type": "boolean" + } } ], "responses": { "200": { - "description": "", + "description": "Success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PagedViewModelOfCultureViewModel" + "$ref": "#/components/schemas/PagedRelationItem" } } } } } } - } - }, - "components": { - "schemas": { - "ProblemDetails": { - "type": "object", - "additionalProperties": { - "nullable": true - }, - "properties": { - "type": { - "type": "string", - "nullable": true - }, - "title": { - "type": "string", - "nullable": true + }, + "/umbraco/management/api/v1/tracked-reference/item": { + "get": { + "tags": [ + "Tracked Reference" + ], + "parameters": [ + { + "name": "ids", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } }, - "status": { - "type": "integer", - "format": "int32", - "nullable": true + { + "name": "skip", + "in": "query", + "schema": { + "type": "integer", + "format": "int64" + } }, - "detail": { - "type": "string", - "nullable": true + { + "name": "take", + "in": "query", + "schema": { + "type": "integer", + "format": "int64" + } }, - "instance": { - "type": "string", - "nullable": true + { + "name": "filterMustBeIsDependency", + "in": "query", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PagedRelationItem" + } + } + } } } - }, - "UpgradeSettingsViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "currentState": { - "type": "string" - }, - "newState": { - "type": "string" - }, - "newVersion": { - "type": "string" + } + }, + "/umbraco/management/api/v1/upgrade/authorize": { + "post": { + "tags": [ + "Upgrade" + ], + "responses": { + "200": { + "description": "Success" }, - "oldVersion": { - "type": "string" + "428": { + "description": "Client Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } }, - "reportUrl": { - "type": "string" + "500": { + "description": "Server Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } } } - }, - "PagedViewModelOfRelationItemViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "total": { - "type": "integer", - "format": "int64" + } + }, + "/umbraco/management/api/v1/upgrade/settings": { + "get": { + "tags": [ + "Upgrade" + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpgradeSettings" + } + } + } }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RelationItemViewModel" + "428": { + "description": "Client Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } } } } - }, - "RelationItemViewModel": { + } + } + }, + "components": { + "schemas": { + "Assembly": { "type": "object", - "additionalProperties": false, "properties": { - "nodeKey": { - "type": "string", - "format": "guid" + "definedTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TypeInfo" + }, + "nullable": true, + "readOnly": true }, - "nodeName": { - "type": "string", - "nullable": true + "exportedTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Type" + }, + "nullable": true, + "readOnly": true }, - "nodeType": { + "codeBase": { "type": "string", - "nullable": true + "nullable": true, + "readOnly": true, + "deprecated": true }, - "contentTypeIcon": { - "type": "string", - "nullable": true + "entryPoint": { + "$ref": "#/components/schemas/MethodInfo" }, - "contentTypeAlias": { + "fullName": { "type": "string", - "nullable": true + "nullable": true, + "readOnly": true }, - "contentTypeName": { + "imageRuntimeVersion": { "type": "string", - "nullable": true + "nullable": true, + "readOnly": true }, - "relationTypeName": { + "isDynamic": { + "type": "boolean", + "readOnly": true + }, + "location": { "type": "string", - "nullable": true + "nullable": true, + "readOnly": true }, - "relationTypeIsBidirectional": { - "type": "boolean" + "reflectionOnly": { + "type": "boolean", + "readOnly": true }, - "relationTypeIsDependency": { - "type": "boolean" - } - } - }, - "PagedViewModelOfEntityTreeItemViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "total": { - "type": "integer", - "format": "int64" + "isCollectible": { + "type": "boolean", + "readOnly": true }, - "items": { + "isFullyTrusted": { + "type": "boolean", + "readOnly": true + }, + "customAttributes": { "type": "array", "items": { - "$ref": "#/components/schemas/EntityTreeItemViewModel" - } - } - } - }, - "EntityTreeItemViewModel": { - "allOf": [ - { - "$ref": "#/components/schemas/TreeItemViewModel" + "$ref": "#/components/schemas/CustomAttributeData" + }, + "nullable": true, + "readOnly": true }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "key": { - "type": "string", - "format": "guid" - }, - "isContainer": { - "type": "boolean" - }, - "parentKey": { - "type": "string", - "format": "guid", - "nullable": true - } - } - } - ] - }, - "TreeItemViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "type": "string" + "escapedCodeBase": { + "type": "string", + "nullable": true, + "readOnly": true, + "deprecated": true }, - "type": { - "type": "string" + "manifestModule": { + "$ref": "#/components/schemas/Module" }, - "icon": { - "type": "string" + "modules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Module" + }, + "nullable": true, + "readOnly": true }, - "hasChildren": { - "type": "boolean" + "globalAssemblyCache": { + "type": "boolean", + "readOnly": true, + "deprecated": true + }, + "hostContext": { + "type": "integer", + "format": "int64", + "readOnly": true + }, + "securityRuleSet": { + "$ref": "#/components/schemas/SecurityRuleSet" } - } + }, + "additionalProperties": false }, - "PagedViewModelOfTelemetryLevelViewModel": { + "BackOfficeNotification": { "type": "object", - "additionalProperties": false, "properties": { - "total": { - "type": "integer", - "format": "int64" + "header": { + "type": "string", + "nullable": true }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TelemetryLevelViewModel" - } + "message": { + "type": "string", + "nullable": true + }, + "notificationType": { + "$ref": "#/components/schemas/NotificationStyle" } - } + }, + "additionalProperties": false }, - "TelemetryLevelViewModel": { + "CallingConventions": { + "enum": [ + "Standard", + "VarArgs", + "Any", + "HasThis", + "ExplicitThis" + ], + "type": "integer", + "format": "int32" + }, + "ConsentLevel": { "type": "object", - "additionalProperties": false, "properties": { - "telemetryLevel": { + "level": { "$ref": "#/components/schemas/TelemetryLevel" + }, + "description": { + "type": "string", + "nullable": true } - } - }, - "TelemetryLevel": { - "type": "string", - "description": "", - "x-enumNames": [ - "Minimal", - "Basic", - "Detailed" - ], - "enum": [ - "Minimal", - "Basic", - "Detailed" - ] + }, + "additionalProperties": false }, - "PagedViewModelOfFileSystemTreeItemViewModel": { + "ConstructorInfo": { "type": "object", - "additionalProperties": false, "properties": { - "total": { - "type": "integer", - "format": "int64" + "name": { + "type": "string", + "nullable": true, + "readOnly": true }, - "items": { + "declaringType": { + "$ref": "#/components/schemas/Type" + }, + "reflectedType": { + "$ref": "#/components/schemas/Type" + }, + "module": { + "$ref": "#/components/schemas/Module" + }, + "customAttributes": { "type": "array", "items": { - "$ref": "#/components/schemas/FileSystemTreeItemViewModel" - } - } - } - }, - "FileSystemTreeItemViewModel": { - "allOf": [ - { - "$ref": "#/components/schemas/TreeItemViewModel" + "$ref": "#/components/schemas/CustomAttributeData" + }, + "nullable": true, + "readOnly": true }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "path": { - "type": "string" - }, - "isFolder": { - "type": "boolean" - } - } - } - ] - }, - "ServerStatusViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "serverStatus": { - "$ref": "#/components/schemas/RuntimeLevel" - } - } - }, - "RuntimeLevel": { - "type": "string", - "description": "Describes the levels in which the runtime can run.\n ", - "x-enumNames": [ - "Unknown", - "Boot", - "Install", - "Upgrade", - "Run", - "BootFailed" - ], - "enum": [ - "Unknown", - "Boot", - "Install", - "Upgrade", - "Run", - "BootFailed" - ] - }, - "VersionViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "version": { - "type": "string" + "isCollectible": { + "type": "boolean", + "readOnly": true + }, + "metadataToken": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "attributes": { + "$ref": "#/components/schemas/MethodAttributes" + }, + "methodImplementationFlags": { + "$ref": "#/components/schemas/MethodImplAttributes" + }, + "callingConvention": { + "$ref": "#/components/schemas/CallingConventions" + }, + "isAbstract": { + "type": "boolean", + "readOnly": true + }, + "isConstructor": { + "type": "boolean", + "readOnly": true + }, + "isFinal": { + "type": "boolean", + "readOnly": true + }, + "isHideBySig": { + "type": "boolean", + "readOnly": true + }, + "isSpecialName": { + "type": "boolean", + "readOnly": true + }, + "isStatic": { + "type": "boolean", + "readOnly": true + }, + "isVirtual": { + "type": "boolean", + "readOnly": true + }, + "isAssembly": { + "type": "boolean", + "readOnly": true + }, + "isFamily": { + "type": "boolean", + "readOnly": true + }, + "isFamilyAndAssembly": { + "type": "boolean", + "readOnly": true + }, + "isFamilyOrAssembly": { + "type": "boolean", + "readOnly": true + }, + "isPrivate": { + "type": "boolean", + "readOnly": true + }, + "isPublic": { + "type": "boolean", + "readOnly": true + }, + "isConstructedGenericMethod": { + "type": "boolean", + "readOnly": true + }, + "isGenericMethod": { + "type": "boolean", + "readOnly": true + }, + "isGenericMethodDefinition": { + "type": "boolean", + "readOnly": true + }, + "containsGenericParameters": { + "type": "boolean", + "readOnly": true + }, + "methodHandle": { + "$ref": "#/components/schemas/RuntimeMethodHandle" + }, + "isSecurityCritical": { + "type": "boolean", + "readOnly": true + }, + "isSecuritySafeCritical": { + "type": "boolean", + "readOnly": true + }, + "isSecurityTransparent": { + "type": "boolean", + "readOnly": true + }, + "memberType": { + "$ref": "#/components/schemas/MemberTypes" } - } + }, + "additionalProperties": false }, - "IndexViewModel": { + "ContentApp": { "type": "object", - "additionalProperties": false, "properties": { "name": { - "type": "string" + "type": "string", + "nullable": true }, - "healthStatus": { + "alias": { "type": "string", "nullable": true }, - "isHealthy": { - "type": "boolean" + "weight": { + "type": "integer", + "format": "int32" }, - "canRebuild": { - "type": "boolean" + "icon": { + "type": "string", + "nullable": true }, - "searcherName": { - "type": "string" + "view": { + "type": "string", + "nullable": true }, - "documentCount": { - "type": "integer", - "format": "int64" + "viewModel": { + "nullable": true }, - "fieldCount": { - "type": "integer", - "format": "int32" + "active": { + "type": "boolean" + }, + "badge": { + "$ref": "#/components/schemas/ContentAppBadge" } - } + }, + "additionalProperties": false }, - "PagedViewModelOfIndexViewModel": { + "ContentAppBadge": { "type": "object", - "additionalProperties": false, "properties": { - "total": { + "count": { "type": "integer", - "format": "int64" + "format": "int32" }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/IndexViewModel" - } + "type": { + "$ref": "#/components/schemas/ContentAppBadgeType" } - } + }, + "additionalProperties": false + }, + "ContentAppBadgeType": { + "enum": [ + "default", + "warning", + "alert" + ], + "type": "integer", + "format": "int32" }, - "PagedViewModelOfSearcherViewModel": { + "ContentResult": { "type": "object", - "additionalProperties": false, "properties": { - "total": { - "type": "integer", - "format": "int64" + "content": { + "type": "string", + "nullable": true }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SearcherViewModel" - } + "contentType": { + "type": "string", + "nullable": true + }, + "statusCode": { + "type": "integer", + "format": "int32", + "nullable": true } - } + }, + "additionalProperties": false }, - "SearcherViewModel": { + "ContentTreeItem": { "type": "object", - "additionalProperties": false, "properties": { "name": { - "type": "string" + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + }, + "icon": { + "type": "string", + "nullable": true + }, + "hasChildren": { + "type": "boolean" + }, + "key": { + "type": "string", + "format": "uuid" + }, + "isContainer": { + "type": "boolean" + }, + "parentKey": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "noAccess": { + "type": "boolean" } - } + }, + "additionalProperties": false }, - "PagedViewModelOfPagedViewModelOfSearchResultViewModel": { + "CreatedResult": { "type": "object", - "additionalProperties": false, "properties": { - "total": { - "type": "integer", - "format": "int64" + "value": { + "nullable": true }, - "items": { + "formatters": { "type": "array", "items": { - "$ref": "#/components/schemas/PagedViewModelOfSearchResultViewModel" - } + "$ref": "#/components/schemas/IOutputFormatter" + }, + "nullable": true + }, + "contentTypes": { + "type": "array", + "items": { + "type": "string" + }, + "nullable": true + }, + "declaredType": { + "$ref": "#/components/schemas/Type" + }, + "statusCode": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "location": { + "type": "string", + "nullable": true } - } + }, + "additionalProperties": false }, - "PagedViewModelOfSearchResultViewModel": { + "Culture": { "type": "object", - "additionalProperties": false, "properties": { - "total": { - "type": "integer", - "format": "int64" + "name": { + "type": "string", + "nullable": true }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SearchResultViewModel" - } + "englishName": { + "type": "string", + "nullable": true } - } + }, + "additionalProperties": false }, - "SearchResultViewModel": { + "CustomAttributeData": { "type": "object", - "additionalProperties": false, "properties": { - "id": { - "type": "string" + "attributeType": { + "$ref": "#/components/schemas/Type" }, - "score": { - "type": "number", - "format": "float" + "constructor": { + "$ref": "#/components/schemas/ConstructorInfo" }, - "fieldCount": { - "type": "integer", - "format": "int32" + "constructorArguments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeTypedArgument" + }, + "nullable": true, + "readOnly": true }, - "fields": { + "namedArguments": { "type": "array", "items": { - "$ref": "#/components/schemas/FieldViewModel" - } + "$ref": "#/components/schemas/CustomAttributeNamedArgument" + }, + "nullable": true, + "readOnly": true } - } + }, + "additionalProperties": false }, - "FieldViewModel": { + "CustomAttributeNamedArgument": { "type": "object", - "additionalProperties": false, "properties": { - "name": { - "type": "string" + "memberInfo": { + "$ref": "#/components/schemas/MemberInfo" }, - "values": { - "type": "array", - "items": { - "type": "string" - } + "typedValue": { + "$ref": "#/components/schemas/CustomAttributeTypedArgument" + }, + "memberName": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "isField": { + "type": "boolean", + "readOnly": true } - } + }, + "additionalProperties": false }, - "PagedViewModelOfRelationViewModel": { + "CustomAttributeTypedArgument": { "type": "object", - "additionalProperties": false, "properties": { - "total": { - "type": "integer", - "format": "int64" + "argumentType": { + "$ref": "#/components/schemas/Type" }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RelationViewModel" - } + "value": { + "nullable": true } - } + }, + "additionalProperties": false }, - "RelationViewModel": { + "DatabaseInstall": { + "required": [ + "id", + "providerName" + ], "type": "object", - "additionalProperties": false, "properties": { - "parentId": { - "type": "integer", - "readOnly": true, - "description": "Gets or sets the Parent Id of the Relation (Source).\n ", - "format": "int32" + "id": { + "type": "string", + "format": "uuid" }, - "parentName": { + "providerName": { + "minLength": 1, + "type": "string" + }, + "server": { "type": "string", - "readOnly": true, - "description": "Gets or sets the Parent Name of the relation (Source).\n ", "nullable": true }, - "childId": { - "type": "integer", - "readOnly": true, - "description": "Gets or sets the Child Id of the Relation (Destination).\n ", - "format": "int32" - }, - "childName": { + "name": { "type": "string", - "readOnly": true, - "description": "Gets or sets the Child Name of the relation (Destination).\n ", "nullable": true }, - "createDate": { + "username": { "type": "string", - "readOnly": true, - "description": "Gets or sets the date when the Relation was created.\n ", - "format": "date-time" + "nullable": true }, - "comment": { + "password": { "type": "string", - "readOnly": true, - "description": "Gets or sets a comment for the Relation.\n ", "nullable": true - } - } - }, - "FolderTreeItemViewModel": { - "allOf": [ - { - "$ref": "#/components/schemas/EntityTreeItemViewModel" }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "isFolder": { - "type": "boolean" - } - } - } - ] - }, - "ProfilingStatusViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "enabled": { + "useIntegratedAuthentication": { "type": "boolean" + }, + "connectionString": { + "type": "string", + "nullable": true } - } + }, + "additionalProperties": false }, - "OutOfDateStatusViewModel": { + "DatabaseSettings": { "type": "object", - "additionalProperties": false, "properties": { - "status": { - "$ref": "#/components/schemas/OutOfDateType" + "id": { + "type": "string", + "format": "uuid" + }, + "sortOrder": { + "type": "integer", + "format": "int32" + }, + "displayName": { + "type": "string", + "nullable": true + }, + "defaultDatabaseName": { + "type": "string", + "nullable": true + }, + "providerName": { + "type": "string", + "nullable": true + }, + "isConfigured": { + "type": "boolean" + }, + "requiresServer": { + "type": "boolean" + }, + "serverPlaceholder": { + "type": "string", + "nullable": true + }, + "requiresCredentials": { + "type": "boolean" + }, + "supportsIntegratedAuthentication": { + "type": "boolean" + }, + "requiresConnectionTest": { + "type": "boolean" } - } + }, + "additionalProperties": false }, - "OutOfDateType": { - "type": "integer", - "description": "", - "x-enumNames": [ - "OutOfDate", - "Current", - "Unknown" + "Dictionary": { + "required": [ + "name" ], - "enum": [ - 0, - 1, - 100 - ] - }, - "PagedViewModelOfContentTreeItemViewModel": { "type": "object", - "additionalProperties": false, "properties": { - "total": { - "type": "integer", - "format": "int64" + "parentId": { + "type": "string", + "format": "uuid", + "nullable": true }, - "items": { + "translations": { "type": "array", "items": { - "$ref": "#/components/schemas/ContentTreeItemViewModel" - } - } - } - }, - "ContentTreeItemViewModel": { - "allOf": [ - { - "$ref": "#/components/schemas/EntityTreeItemViewModel" + "$ref": "#/components/schemas/DictionaryTranslation" + }, + "nullable": true }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "noAccess": { - "type": "boolean" - } - } + "contentApps": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContentApp" + }, + "nullable": true + }, + "notifications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BackOfficeNotification" + }, + "nullable": true, + "readOnly": true + }, + "name": { + "minLength": 1, + "type": "string" + }, + "key": { + "type": "string", + "format": "uuid" + }, + "path": { + "type": "string", + "nullable": true } - ] + }, + "additionalProperties": false }, - "PagedViewModelOfRecycleBinItemViewModel": { + "DictionaryImport": { "type": "object", - "additionalProperties": false, "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { + "dictionaryItems": { "type": "array", "items": { - "$ref": "#/components/schemas/RecycleBinItemViewModel" - } + "$ref": "#/components/schemas/DictionaryItemsImport" + }, + "nullable": true + }, + "tempFileName": { + "type": "string", + "nullable": true } - } + }, + "additionalProperties": false }, - "RecycleBinItemViewModel": { + "DictionaryItem": { "type": "object", - "additionalProperties": false, "properties": { - "key": { + "parentId": { "type": "string", - "format": "guid" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "hasChildren": { - "type": "boolean" - }, - "isContainer": { - "type": "boolean" + "format": "uuid", + "nullable": true }, - "parentKey": { + "key": { "type": "string", - "format": "guid", - "nullable": true + "format": "uuid" } - } + }, + "additionalProperties": false }, - "PagedViewModelOfFolderTreeItemViewModel": { + "DictionaryItemsImport": { "type": "object", - "additionalProperties": false, "properties": { - "total": { - "type": "integer", - "format": "int64" + "name": { + "type": "string", + "nullable": true }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FolderTreeItemViewModel" - } + "level": { + "type": "integer", + "format": "int32" } - } + }, + "additionalProperties": false }, - "PagedViewModelOfLanguageViewModel": { + "DictionaryOverview": { "type": "object", - "additionalProperties": false, "properties": { - "total": { + "name": { + "type": "string", + "nullable": true + }, + "key": { + "type": "string", + "format": "uuid" + }, + "level": { "type": "integer", - "format": "int64" + "format": "int32" }, - "items": { + "translations": { "type": "array", "items": { - "$ref": "#/components/schemas/LanguageViewModel" - } + "$ref": "#/components/schemas/DictionaryTranslationOverview" + }, + "nullable": true, + "readOnly": true } - } + }, + "additionalProperties": false }, - "LanguageViewModel": { + "DictionaryTranslation": { "type": "object", - "additionalProperties": false, - "required": [ - "isoCode" - ], "properties": { "id": { "type": "integer", "format": "int32" }, - "isoCode": { + "key": { "type": "string", - "minLength": 1 + "format": "uuid" }, - "name": { + "displayName": { "type": "string", "nullable": true }, - "isDefault": { - "type": "boolean" + "isoCode": { + "type": "string", + "nullable": true }, - "isMandatory": { - "type": "boolean" + "translation": { + "type": "string", + "nullable": true }, - "fallbackLanguageId": { + "languageId": { "type": "integer", - "format": "int32", - "nullable": true + "format": "int32" } - } + }, + "additionalProperties": false }, - "InstallSettingsViewModel": { + "DictionaryTranslationOverview": { "type": "object", - "additionalProperties": false, "properties": { - "user": { - "$ref": "#/components/schemas/UserSettingsViewModel" + "displayName": { + "type": "string", + "nullable": true }, - "databases": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DatabaseSettingsViewModel" - } + "hasTranslation": { + "type": "boolean" } - } + }, + "additionalProperties": false }, - "UserSettingsViewModel": { + "DocumentBlueprintTreeItem": { "type": "object", - "additionalProperties": false, "properties": { - "minCharLength": { - "type": "integer", - "format": "int32" + "name": { + "type": "string", + "nullable": true }, - "minNonAlphaNumericLength": { - "type": "integer", - "format": "int32" + "type": { + "type": "string", + "nullable": true }, - "consentLevels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ConsentLevelViewModel" - } - } - } - }, - "ConsentLevelViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "level": { - "$ref": "#/components/schemas/TelemetryLevel" - }, - "description": { - "type": "string" - } - } - }, - "DatabaseSettingsViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "id": { + "icon": { "type": "string", - "format": "guid" - }, - "sortOrder": { - "type": "integer", - "format": "int32" - }, - "displayName": { - "type": "string" - }, - "defaultDatabaseName": { - "type": "string" - }, - "providerName": { - "type": "string" - }, - "isConfigured": { - "type": "boolean" + "nullable": true }, - "requiresServer": { + "hasChildren": { "type": "boolean" }, - "serverPlaceholder": { - "type": "string" + "key": { + "type": "string", + "format": "uuid" }, - "requiresCredentials": { + "isContainer": { "type": "boolean" }, - "supportsIntegratedAuthentication": { - "type": "boolean" + "parentKey": { + "type": "string", + "format": "uuid", + "nullable": true }, - "requiresConnectionTest": { - "type": "boolean" - } - } - }, - "InstallViewModel": { - "type": "object", - "additionalProperties": false, - "required": [ - "user", - "database" - ], - "properties": { - "user": { - "$ref": "#/components/schemas/UserInstallViewModel" + "documentTypeKey": { + "type": "string", + "format": "uuid" }, - "database": { - "$ref": "#/components/schemas/DatabaseInstallViewModel" + "documentTypeAlias": { + "type": "string", + "nullable": true }, - "telemetryLevel": { - "$ref": "#/components/schemas/TelemetryLevel" + "documentTypeName": { + "type": "string", + "nullable": true } - } + }, + "additionalProperties": false }, - "UserInstallViewModel": { + "DocumentTreeItem": { "type": "object", - "additionalProperties": false, - "required": [ - "name", - "email", - "password" - ], "properties": { "name": { "type": "string", - "maxLength": 255, - "minLength": 0 + "nullable": true }, - "email": { + "type": { "type": "string", - "format": "email", - "minLength": 1 + "nullable": true }, - "password": { + "icon": { "type": "string", - "minLength": 1 + "nullable": true }, - "subscribeToNewsletter": { + "hasChildren": { "type": "boolean" - } - } - }, - "DatabaseInstallViewModel": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "providerName" - ], - "properties": { - "id": { - "type": "string", - "format": "guid", - "minLength": 1 }, - "providerName": { + "key": { "type": "string", - "minLength": 1 + "format": "uuid" }, - "server": { + "isContainer": { + "type": "boolean" + }, + "parentKey": { "type": "string", + "format": "uuid", "nullable": true }, + "noAccess": { + "type": "boolean" + }, + "isProtected": { + "type": "boolean" + }, + "isPublished": { + "type": "boolean" + }, + "isEdited": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "DocumentTypeTreeItem": { + "type": "object", + "properties": { "name": { "type": "string", "nullable": true }, - "username": { + "type": { "type": "string", "nullable": true }, - "password": { + "icon": { "type": "string", "nullable": true }, - "useIntegratedAuthentication": { + "hasChildren": { "type": "boolean" }, - "connectionString": { + "key": { "type": "string", + "format": "uuid" + }, + "isContainer": { + "type": "boolean" + }, + "parentKey": { + "type": "string", + "format": "uuid", "nullable": true - } - } - }, - "PagedViewModelOfHelpPageViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "total": { - "type": "integer", - "format": "int64" }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/HelpPageViewModel" - } + "isFolder": { + "type": "boolean" + }, + "isElement": { + "type": "boolean" } - } + }, + "additionalProperties": false }, - "HelpPageViewModel": { + "EntityTreeItem": { "type": "object", - "additionalProperties": false, "properties": { "name": { "type": "string", "nullable": true }, - "description": { + "type": { "type": "string", "nullable": true }, - "url": { + "icon": { "type": "string", "nullable": true }, - "type": { + "hasChildren": { + "type": "boolean" + }, + "key": { "type": "string", + "format": "uuid" + }, + "isContainer": { + "type": "boolean" + }, + "parentKey": { + "type": "string", + "format": "uuid", "nullable": true } - } + }, + "additionalProperties": false }, - "PagedViewModelOfDocumentTreeItemViewModel": { + "EventAttributes": { + "enum": [ + "None", + "SpecialName", + "RTSpecialName", + "ReservedMask" + ], + "type": "integer", + "format": "int32" + }, + "EventInfo": { "type": "object", - "additionalProperties": false, "properties": { - "total": { - "type": "integer", - "format": "int64" + "name": { + "type": "string", + "nullable": true, + "readOnly": true }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DocumentTreeItemViewModel" - } - } - } - }, - "DocumentTreeItemViewModel": { - "allOf": [ - { - "$ref": "#/components/schemas/ContentTreeItemViewModel" + "declaringType": { + "$ref": "#/components/schemas/Type" }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "isProtected": { - "type": "boolean" - }, - "isPublished": { - "type": "boolean" - }, - "isEdited": { - "type": "boolean" - } - } - } - ] - }, - "PagedViewModelOfDocumentTypeTreeItemViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "total": { - "type": "integer", - "format": "int64" + "reflectedType": { + "$ref": "#/components/schemas/Type" }, - "items": { + "module": { + "$ref": "#/components/schemas/Module" + }, + "customAttributes": { "type": "array", "items": { - "$ref": "#/components/schemas/DocumentTypeTreeItemViewModel" - } - } - } - }, - "DocumentTypeTreeItemViewModel": { - "allOf": [ - { - "$ref": "#/components/schemas/FolderTreeItemViewModel" + "$ref": "#/components/schemas/CustomAttributeData" + }, + "nullable": true, + "readOnly": true }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "isElement": { - "type": "boolean" - } - } - } - ] - }, - "DocumentBlueprintTreeItemViewModel": { - "allOf": [ - { - "$ref": "#/components/schemas/EntityTreeItemViewModel" + "isCollectible": { + "type": "boolean", + "readOnly": true }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "documentTypeKey": { - "type": "string", - "format": "guid" - }, - "documentTypeAlias": { - "type": "string" - }, - "documentTypeName": { - "type": "string", - "nullable": true - } - } - } - ] - }, - "PagedViewModelOfDocumentBlueprintTreeItemViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "total": { + "metadataToken": { "type": "integer", - "format": "int64" + "format": "int32", + "readOnly": true }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DocumentBlueprintTreeItemViewModel" - } + "memberType": { + "$ref": "#/components/schemas/MemberTypes" + }, + "attributes": { + "$ref": "#/components/schemas/EventAttributes" + }, + "isSpecialName": { + "type": "boolean", + "readOnly": true + }, + "addMethod": { + "$ref": "#/components/schemas/MethodInfo" + }, + "removeMethod": { + "$ref": "#/components/schemas/MethodInfo" + }, + "raiseMethod": { + "$ref": "#/components/schemas/MethodInfo" + }, + "isMulticast": { + "type": "boolean", + "readOnly": true + }, + "eventHandlerType": { + "$ref": "#/components/schemas/Type" } - } + }, + "additionalProperties": false }, - "PagedViewModelOfDictionaryOverviewViewModel": { + "Field": { "type": "object", - "additionalProperties": false, "properties": { - "total": { - "type": "integer", - "format": "int64" + "name": { + "type": "string", + "nullable": true }, - "items": { + "values": { "type": "array", "items": { - "$ref": "#/components/schemas/DictionaryOverviewViewModel" - } + "type": "string" + }, + "nullable": true } - } + }, + "additionalProperties": false + }, + "FieldAttributes": { + "enum": [ + "PrivateScope", + "Private", + "FamANDAssem", + "Assembly", + "Family", + "FamORAssem", + "Public", + "FieldAccessMask", + "Static", + "InitOnly", + "Literal", + "NotSerialized", + "HasFieldRVA", + "SpecialName", + "RTSpecialName", + "HasFieldMarshal", + "PinvokeImpl", + "HasDefault", + "ReservedMask" + ], + "type": "integer", + "format": "int32" }, - "DictionaryOverviewViewModel": { + "FieldInfo": { "type": "object", - "additionalProperties": false, "properties": { "name": { "type": "string", - "description": "Gets or sets the key.\n ", - "nullable": true + "nullable": true, + "readOnly": true }, - "key": { - "type": "string", - "description": "Gets or sets the key.\n ", - "format": "guid" + "declaringType": { + "$ref": "#/components/schemas/Type" }, - "level": { - "type": "integer", - "description": "Gets or sets the level.\n ", - "format": "int32" + "reflectedType": { + "$ref": "#/components/schemas/Type" }, - "translations": { + "module": { + "$ref": "#/components/schemas/Module" + }, + "customAttributes": { "type": "array", - "description": "Sets the translations.\n ", "items": { - "$ref": "#/components/schemas/DictionaryTranslationOverviewViewModel" - } + "$ref": "#/components/schemas/CustomAttributeData" + }, + "nullable": true, + "readOnly": true + }, + "isCollectible": { + "type": "boolean", + "readOnly": true + }, + "metadataToken": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "memberType": { + "$ref": "#/components/schemas/MemberTypes" + }, + "attributes": { + "$ref": "#/components/schemas/FieldAttributes" + }, + "fieldType": { + "$ref": "#/components/schemas/Type" + }, + "isInitOnly": { + "type": "boolean", + "readOnly": true + }, + "isLiteral": { + "type": "boolean", + "readOnly": true + }, + "isNotSerialized": { + "type": "boolean", + "readOnly": true + }, + "isPinvokeImpl": { + "type": "boolean", + "readOnly": true + }, + "isSpecialName": { + "type": "boolean", + "readOnly": true + }, + "isStatic": { + "type": "boolean", + "readOnly": true + }, + "isAssembly": { + "type": "boolean", + "readOnly": true + }, + "isFamily": { + "type": "boolean", + "readOnly": true + }, + "isFamilyAndAssembly": { + "type": "boolean", + "readOnly": true + }, + "isFamilyOrAssembly": { + "type": "boolean", + "readOnly": true + }, + "isPrivate": { + "type": "boolean", + "readOnly": true + }, + "isPublic": { + "type": "boolean", + "readOnly": true + }, + "isSecurityCritical": { + "type": "boolean", + "readOnly": true + }, + "isSecuritySafeCritical": { + "type": "boolean", + "readOnly": true + }, + "isSecurityTransparent": { + "type": "boolean", + "readOnly": true + }, + "fieldHandle": { + "$ref": "#/components/schemas/RuntimeFieldHandle" } - } + }, + "additionalProperties": false }, - "DictionaryTranslationOverviewViewModel": { + "FileSystemTreeItem": { "type": "object", - "additionalProperties": false, "properties": { - "displayName": { + "name": { "type": "string", - "description": "Gets or sets the display name.\n ", "nullable": true }, - "hasTranslation": { + "type": { + "type": "string", + "nullable": true + }, + "icon": { + "type": "string", + "nullable": true + }, + "hasChildren": { + "type": "boolean" + }, + "path": { + "type": "string", + "nullable": true + }, + "isFolder": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "FolderTreeItem": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + }, + "icon": { + "type": "string", + "nullable": true + }, + "hasChildren": { + "type": "boolean" + }, + "key": { + "type": "string", + "format": "uuid" + }, + "isContainer": { + "type": "boolean" + }, + "parentKey": { + "type": "string", + "format": "uuid", + "nullable": true + }, + "isFolder": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "GenericParameterAttributes": { + "enum": [ + "None", + "Covariant", + "Contravariant", + "VarianceMask", + "ReferenceTypeConstraint", + "NotNullableValueTypeConstraint", + "DefaultConstructorConstraint", + "SpecialConstraintMask" + ], + "type": "integer", + "format": "int32" + }, + "HelpPage": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "description": { + "type": "string", + "nullable": true + }, + "url": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "ICustomAttributeProvider": { + "type": "object", + "additionalProperties": false + }, + "IOutputFormatter": { + "type": "object", + "additionalProperties": false + }, + "Index": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + }, + "healthStatus": { + "type": "string", + "nullable": true + }, + "isHealthy": { "type": "boolean", - "description": "Gets or sets a value indicating whether has translation.\n " + "readOnly": true + }, + "canRebuild": { + "type": "boolean" + }, + "searcherName": { + "type": "string", + "nullable": true + }, + "documentCount": { + "type": "integer", + "format": "int64" + }, + "fieldCount": { + "type": "integer", + "format": "int32" } - } + }, + "additionalProperties": false + }, + "Install": { + "required": [ + "database", + "user" + ], + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/UserInstall" + }, + "database": { + "$ref": "#/components/schemas/DatabaseInstall" + }, + "telemetryLevel": { + "$ref": "#/components/schemas/TelemetryLevel" + } + }, + "additionalProperties": false + }, + "InstallSettings": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/UserSettings" + }, + "databases": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DatabaseSettings" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "IntPtr": { + "type": "object", + "additionalProperties": false }, - "DictionaryViewModel": { + "JsonPatch": { "type": "object", - "description": "The dictionary display model\n ", - "additionalProperties": false, + "properties": { + "op": { + "type": "string", + "nullable": true + }, + "path": { + "type": "string", + "nullable": true + }, + "value": { + "nullable": true + } + }, + "additionalProperties": false + }, + "Language": { "required": [ - "name" + "isoCode" ], + "type": "object", "properties": { - "parentId": { + "id": { + "type": "integer", + "format": "int32" + }, + "isoCode": { + "minLength": 1, + "type": "string" + }, + "name": { "type": "string", - "description": "Gets or sets the parent id.\n ", - "format": "guid", "nullable": true }, - "translations": { + "isDefault": { + "type": "boolean" + }, + "isMandatory": { + "type": "boolean" + }, + "fallbackLanguageId": { + "type": "integer", + "format": "int32", + "nullable": true + } + }, + "additionalProperties": false + }, + "LayoutKind": { + "enum": [ + "Sequential", + "Explicit", + "Auto" + ], + "type": "integer", + "format": "int32" + }, + "MemberInfo": { + "type": "object", + "properties": { + "memberType": { + "$ref": "#/components/schemas/MemberTypes" + }, + "name": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "declaringType": { + "$ref": "#/components/schemas/Type" + }, + "reflectedType": { + "$ref": "#/components/schemas/Type" + }, + "module": { + "$ref": "#/components/schemas/Module" + }, + "customAttributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeData" + }, + "nullable": true, + "readOnly": true + }, + "isCollectible": { + "type": "boolean", + "readOnly": true + }, + "metadataToken": { + "type": "integer", + "format": "int32", + "readOnly": true + } + }, + "additionalProperties": false + }, + "MemberTypes": { + "enum": [ + "Constructor", + "Event", + "Field", + "Method", + "Property", + "TypeInfo", + "Custom", + "NestedType", + "All" + ], + "type": "integer", + "format": "int32" + }, + "MethodAttributes": { + "enum": [ + "ReuseSlot", + "PrivateScope", + "Private", + "FamANDAssem", + "Assembly", + "Family", + "FamORAssem", + "Public", + "MemberAccessMask", + "UnmanagedExport", + "Static", + "Final", + "Virtual", + "HideBySig", + "NewSlot", + "VtableLayoutMask", + "CheckAccessOnOverride", + "Abstract", + "SpecialName", + "RTSpecialName", + "PinvokeImpl", + "HasSecurity", + "RequireSecObject", + "ReservedMask" + ], + "type": "integer", + "format": "int32" + }, + "MethodBase": { + "type": "object", + "properties": { + "memberType": { + "$ref": "#/components/schemas/MemberTypes" + }, + "name": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "declaringType": { + "$ref": "#/components/schemas/Type" + }, + "reflectedType": { + "$ref": "#/components/schemas/Type" + }, + "module": { + "$ref": "#/components/schemas/Module" + }, + "customAttributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeData" + }, + "nullable": true, + "readOnly": true + }, + "isCollectible": { + "type": "boolean", + "readOnly": true + }, + "metadataToken": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "attributes": { + "$ref": "#/components/schemas/MethodAttributes" + }, + "methodImplementationFlags": { + "$ref": "#/components/schemas/MethodImplAttributes" + }, + "callingConvention": { + "$ref": "#/components/schemas/CallingConventions" + }, + "isAbstract": { + "type": "boolean", + "readOnly": true + }, + "isConstructor": { + "type": "boolean", + "readOnly": true + }, + "isFinal": { + "type": "boolean", + "readOnly": true + }, + "isHideBySig": { + "type": "boolean", + "readOnly": true + }, + "isSpecialName": { + "type": "boolean", + "readOnly": true + }, + "isStatic": { + "type": "boolean", + "readOnly": true + }, + "isVirtual": { + "type": "boolean", + "readOnly": true + }, + "isAssembly": { + "type": "boolean", + "readOnly": true + }, + "isFamily": { + "type": "boolean", + "readOnly": true + }, + "isFamilyAndAssembly": { + "type": "boolean", + "readOnly": true + }, + "isFamilyOrAssembly": { + "type": "boolean", + "readOnly": true + }, + "isPrivate": { + "type": "boolean", + "readOnly": true + }, + "isPublic": { + "type": "boolean", + "readOnly": true + }, + "isConstructedGenericMethod": { + "type": "boolean", + "readOnly": true + }, + "isGenericMethod": { + "type": "boolean", + "readOnly": true + }, + "isGenericMethodDefinition": { + "type": "boolean", + "readOnly": true + }, + "containsGenericParameters": { + "type": "boolean", + "readOnly": true + }, + "methodHandle": { + "$ref": "#/components/schemas/RuntimeMethodHandle" + }, + "isSecurityCritical": { + "type": "boolean", + "readOnly": true + }, + "isSecuritySafeCritical": { + "type": "boolean", + "readOnly": true + }, + "isSecurityTransparent": { + "type": "boolean", + "readOnly": true + } + }, + "additionalProperties": false + }, + "MethodImplAttributes": { + "enum": [ + "IL", + "Managed", + "Native", + "OPTIL", + "Runtime", + "CodeTypeMask", + "Unmanaged", + "ManagedMask", + "NoInlining", + "ForwardRef", + "Synchronized", + "NoOptimization", + "PreserveSig", + "AggressiveInlining", + "AggressiveOptimization", + "InternalCall", + "MaxMethodImplVal" + ], + "type": "integer", + "format": "int32" + }, + "MethodInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "declaringType": { + "$ref": "#/components/schemas/Type" + }, + "reflectedType": { + "$ref": "#/components/schemas/Type" + }, + "module": { + "$ref": "#/components/schemas/Module" + }, + "customAttributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeData" + }, + "nullable": true, + "readOnly": true + }, + "isCollectible": { + "type": "boolean", + "readOnly": true + }, + "metadataToken": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "attributes": { + "$ref": "#/components/schemas/MethodAttributes" + }, + "methodImplementationFlags": { + "$ref": "#/components/schemas/MethodImplAttributes" + }, + "callingConvention": { + "$ref": "#/components/schemas/CallingConventions" + }, + "isAbstract": { + "type": "boolean", + "readOnly": true + }, + "isConstructor": { + "type": "boolean", + "readOnly": true + }, + "isFinal": { + "type": "boolean", + "readOnly": true + }, + "isHideBySig": { + "type": "boolean", + "readOnly": true + }, + "isSpecialName": { + "type": "boolean", + "readOnly": true + }, + "isStatic": { + "type": "boolean", + "readOnly": true + }, + "isVirtual": { + "type": "boolean", + "readOnly": true + }, + "isAssembly": { + "type": "boolean", + "readOnly": true + }, + "isFamily": { + "type": "boolean", + "readOnly": true + }, + "isFamilyAndAssembly": { + "type": "boolean", + "readOnly": true + }, + "isFamilyOrAssembly": { + "type": "boolean", + "readOnly": true + }, + "isPrivate": { + "type": "boolean", + "readOnly": true + }, + "isPublic": { + "type": "boolean", + "readOnly": true + }, + "isConstructedGenericMethod": { + "type": "boolean", + "readOnly": true + }, + "isGenericMethod": { + "type": "boolean", + "readOnly": true + }, + "isGenericMethodDefinition": { + "type": "boolean", + "readOnly": true + }, + "containsGenericParameters": { + "type": "boolean", + "readOnly": true + }, + "methodHandle": { + "$ref": "#/components/schemas/RuntimeMethodHandle" + }, + "isSecurityCritical": { + "type": "boolean", + "readOnly": true + }, + "isSecuritySafeCritical": { + "type": "boolean", + "readOnly": true + }, + "isSecurityTransparent": { + "type": "boolean", + "readOnly": true + }, + "memberType": { + "$ref": "#/components/schemas/MemberTypes" + }, + "returnParameter": { + "$ref": "#/components/schemas/ParameterInfo" + }, + "returnType": { + "$ref": "#/components/schemas/Type" + }, + "returnTypeCustomAttributes": { + "$ref": "#/components/schemas/ICustomAttributeProvider" + } + }, + "additionalProperties": false + }, + "ModelsBuilder": { + "type": "object", + "properties": { + "mode": { + "$ref": "#/components/schemas/ModelsMode" + }, + "canGenerate": { + "type": "boolean" + }, + "outOfDateModels": { + "type": "boolean" + }, + "lastError": { + "type": "string", + "nullable": true + }, + "version": { + "type": "string", + "nullable": true + }, + "modelsNamespace": { + "type": "string", + "nullable": true + }, + "trackingOutOfDateModels": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "ModelsMode": { + "enum": [ + "Nothing", + "InMemoryAuto", + "SourceCodeManual", + "SourceCodeAuto" + ], + "type": "integer", + "format": "int32" + }, + "Module": { + "type": "object", + "properties": { + "assembly": { + "$ref": "#/components/schemas/Assembly" + }, + "fullyQualifiedName": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "name": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "mdStreamVersion": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "moduleVersionId": { + "type": "string", + "format": "uuid", + "readOnly": true + }, + "scopeName": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "moduleHandle": { + "$ref": "#/components/schemas/ModuleHandle" + }, + "customAttributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeData" + }, + "nullable": true, + "readOnly": true + }, + "metadataToken": { + "type": "integer", + "format": "int32", + "readOnly": true + } + }, + "additionalProperties": false + }, + "ModuleHandle": { + "type": "object", + "properties": { + "mdStreamVersion": { + "type": "integer", + "format": "int32", + "readOnly": true + } + }, + "additionalProperties": false + }, + "NotFoundResult": { + "type": "object", + "properties": { + "statusCode": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "NotificationStyle": { + "enum": [ + "Save", + "Info", + "Error", + "Success", + "Warning" + ], + "type": "integer", + "format": "int32" + }, + "OkResult": { + "type": "object", + "properties": { + "statusCode": { + "type": "integer", + "format": "int32" + } + }, + "additionalProperties": false + }, + "OutOfDateStatus": { + "type": "object", + "properties": { + "status": { + "$ref": "#/components/schemas/OutOfDateType" + } + }, + "additionalProperties": false + }, + "OutOfDateType": { + "enum": [ + "OutOfDate", + "Current", + "Unknown" + ], + "type": "integer", + "format": "int32" + }, + "PagedContentTreeItem": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContentTreeItem" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedCulture": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Culture" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedDictionaryOverview": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DictionaryOverview" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedDocumentBlueprintTreeItem": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DocumentBlueprintTreeItem" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedDocumentTreeItem": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DocumentTreeItem" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedDocumentTypeTreeItem": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DocumentTypeTreeItem" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedEntityTreeItem": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EntityTreeItem" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedFileSystemTreeItem": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileSystemTreeItem" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedFolderTreeItem": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FolderTreeItem" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedHelpPage": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/HelpPage" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedIndex": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Index" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedLanguage": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Language" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedPaged": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PagedSearchResult" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedRecycleBinItem": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RecycleBinItem" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedRelation": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Relation" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedRelationItem": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RelationItem" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedSearchResult": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SearchResult" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedSearcher": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Searcher" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "PagedTelemetry": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Telemetry" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "ParameterAttributes": { + "enum": [ + "None", + "In", + "Out", + "Lcid", + "Retval", + "Optional", + "HasDefault", + "HasFieldMarshal", + "Reserved3", + "Reserved4", + "ReservedMask" + ], + "type": "integer", + "format": "int32" + }, + "ParameterInfo": { + "type": "object", + "properties": { + "attributes": { + "$ref": "#/components/schemas/ParameterAttributes" + }, + "member": { + "$ref": "#/components/schemas/MemberInfo" + }, + "name": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "parameterType": { + "$ref": "#/components/schemas/Type" + }, + "position": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "isIn": { + "type": "boolean", + "readOnly": true + }, + "isLcid": { + "type": "boolean", + "readOnly": true + }, + "isOptional": { + "type": "boolean", + "readOnly": true + }, + "isOut": { + "type": "boolean", + "readOnly": true + }, + "isRetval": { + "type": "boolean", + "readOnly": true + }, + "defaultValue": { + "nullable": true, + "readOnly": true + }, + "rawDefaultValue": { + "nullable": true, + "readOnly": true + }, + "hasDefaultValue": { + "type": "boolean", + "readOnly": true + }, + "customAttributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeData" + }, + "nullable": true, + "readOnly": true + }, + "metadataToken": { + "type": "integer", + "format": "int32", + "readOnly": true + } + }, + "additionalProperties": false + }, + "ProblemDetails": { + "type": "object", + "properties": { + "type": { + "type": "string", + "nullable": true + }, + "title": { + "type": "string", + "nullable": true + }, + "status": { + "type": "integer", + "format": "int32", + "nullable": true + }, + "detail": { + "type": "string", + "nullable": true + }, + "instance": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": { } + }, + "ProfilingStatus": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "PropertyAttributes": { + "enum": [ + "None", + "SpecialName", + "RTSpecialName", + "HasDefault", + "Reserved2", + "Reserved3", + "Reserved4", + "ReservedMask" + ], + "type": "integer", + "format": "int32" + }, + "PropertyInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "declaringType": { + "$ref": "#/components/schemas/Type" + }, + "reflectedType": { + "$ref": "#/components/schemas/Type" + }, + "module": { + "$ref": "#/components/schemas/Module" + }, + "customAttributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeData" + }, + "nullable": true, + "readOnly": true + }, + "isCollectible": { + "type": "boolean", + "readOnly": true + }, + "metadataToken": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "memberType": { + "$ref": "#/components/schemas/MemberTypes" + }, + "propertyType": { + "$ref": "#/components/schemas/Type" + }, + "attributes": { + "$ref": "#/components/schemas/PropertyAttributes" + }, + "isSpecialName": { + "type": "boolean", + "readOnly": true + }, + "canRead": { + "type": "boolean", + "readOnly": true + }, + "canWrite": { + "type": "boolean", + "readOnly": true + }, + "getMethod": { + "$ref": "#/components/schemas/MethodInfo" + }, + "setMethod": { + "$ref": "#/components/schemas/MethodInfo" + } + }, + "additionalProperties": false + }, + "RecycleBinItem": { + "type": "object", + "properties": { + "key": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "nullable": true + }, + "type": { + "type": "string", + "nullable": true + }, + "icon": { + "type": "string", + "nullable": true + }, + "hasChildren": { + "type": "boolean" + }, + "isContainer": { + "type": "boolean" + }, + "parentKey": { + "type": "string", + "format": "uuid", + "nullable": true + } + }, + "additionalProperties": false + }, + "Relation": { + "type": "object", + "properties": { + "parentId": { + "type": "integer", + "format": "int32" + }, + "parentName": { + "type": "string", + "nullable": true + }, + "childId": { + "type": "integer", + "format": "int32" + }, + "childName": { + "type": "string", + "nullable": true + }, + "createDate": { + "type": "string", + "format": "date-time" + }, + "comment": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "RelationItem": { + "type": "object", + "properties": { + "nodeKey": { + "type": "string", + "format": "uuid" + }, + "nodeName": { + "type": "string", + "nullable": true + }, + "nodeType": { + "type": "string", + "nullable": true + }, + "contentTypeIcon": { + "type": "string", + "nullable": true + }, + "contentTypeAlias": { + "type": "string", + "nullable": true + }, + "contentTypeName": { + "type": "string", + "nullable": true + }, + "relationTypeName": { + "type": "string", + "nullable": true + }, + "relationTypeIsBidirectional": { + "type": "boolean" + }, + "relationTypeIsDependency": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "RuntimeFieldHandle": { + "type": "object", + "properties": { + "value": { + "$ref": "#/components/schemas/IntPtr" + } + }, + "additionalProperties": false + }, + "RuntimeLevel": { + "enum": [ + "Unknown", + "Boot", + "Install", + "Upgrade", + "Run", + "BootFailed" + ], + "type": "integer", + "format": "int32" + }, + "RuntimeMethodHandle": { + "type": "object", + "properties": { + "value": { + "$ref": "#/components/schemas/IntPtr" + } + }, + "additionalProperties": false + }, + "RuntimeTypeHandle": { + "type": "object", + "properties": { + "value": { + "$ref": "#/components/schemas/IntPtr" + } + }, + "additionalProperties": false + }, + "SearchResult": { + "type": "object", + "properties": { + "id": { + "type": "string", + "nullable": true + }, + "score": { + "type": "number", + "format": "float" + }, + "fieldCount": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Field" + }, + "nullable": true + } + }, + "additionalProperties": false + }, + "Searcher": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true + } + }, + "additionalProperties": false + }, + "SecurityRuleSet": { + "enum": [ + "None", + "Level1", + "Level2" + ], + "type": "integer", + "format": "int32" + }, + "ServerStatus": { + "type": "object", + "properties": { + "serverStatus": { + "$ref": "#/components/schemas/RuntimeLevel" + } + }, + "additionalProperties": false + }, + "StructLayoutAttribute": { + "type": "object", + "properties": { + "typeId": { + "nullable": true, + "readOnly": true + }, + "value": { + "$ref": "#/components/schemas/LayoutKind" + } + }, + "additionalProperties": false + }, + "Telemetry": { + "type": "object", + "properties": { + "telemetryLevel": { + "$ref": "#/components/schemas/TelemetryLevel" + } + }, + "additionalProperties": false + }, + "TelemetryLevel": { + "enum": [ + "Minimal", + "Basic", + "Detailed" + ], + "type": "integer", + "format": "int32" + }, + "Type": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "customAttributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeData" + }, + "nullable": true, + "readOnly": true + }, + "isCollectible": { + "type": "boolean", + "readOnly": true + }, + "metadataToken": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "isInterface": { + "type": "boolean", + "readOnly": true + }, + "memberType": { + "$ref": "#/components/schemas/MemberTypes" + }, + "namespace": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "assemblyQualifiedName": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "fullName": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "assembly": { + "$ref": "#/components/schemas/Assembly" + }, + "module": { + "$ref": "#/components/schemas/Module" + }, + "isNested": { + "type": "boolean", + "readOnly": true + }, + "declaringType": { + "$ref": "#/components/schemas/Type" + }, + "declaringMethod": { + "$ref": "#/components/schemas/MethodBase" + }, + "reflectedType": { + "$ref": "#/components/schemas/Type" + }, + "underlyingSystemType": { + "$ref": "#/components/schemas/Type" + }, + "isTypeDefinition": { + "type": "boolean", + "readOnly": true + }, + "isArray": { + "type": "boolean", + "readOnly": true + }, + "isByRef": { + "type": "boolean", + "readOnly": true + }, + "isPointer": { + "type": "boolean", + "readOnly": true + }, + "isConstructedGenericType": { + "type": "boolean", + "readOnly": true + }, + "isGenericParameter": { + "type": "boolean", + "readOnly": true + }, + "isGenericTypeParameter": { + "type": "boolean", + "readOnly": true + }, + "isGenericMethodParameter": { + "type": "boolean", + "readOnly": true + }, + "isGenericType": { + "type": "boolean", + "readOnly": true + }, + "isGenericTypeDefinition": { + "type": "boolean", + "readOnly": true + }, + "isSZArray": { + "type": "boolean", + "readOnly": true + }, + "isVariableBoundArray": { + "type": "boolean", + "readOnly": true + }, + "isByRefLike": { + "type": "boolean", + "readOnly": true + }, + "hasElementType": { + "type": "boolean", + "readOnly": true + }, + "genericTypeArguments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Type" + }, + "nullable": true, + "readOnly": true + }, + "genericParameterPosition": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "genericParameterAttributes": { + "$ref": "#/components/schemas/GenericParameterAttributes" + }, + "attributes": { + "$ref": "#/components/schemas/TypeAttributes" + }, + "isAbstract": { + "type": "boolean", + "readOnly": true + }, + "isImport": { + "type": "boolean", + "readOnly": true + }, + "isSealed": { + "type": "boolean", + "readOnly": true + }, + "isSpecialName": { + "type": "boolean", + "readOnly": true + }, + "isClass": { + "type": "boolean", + "readOnly": true + }, + "isNestedAssembly": { + "type": "boolean", + "readOnly": true + }, + "isNestedFamANDAssem": { + "type": "boolean", + "readOnly": true + }, + "isNestedFamily": { + "type": "boolean", + "readOnly": true + }, + "isNestedFamORAssem": { + "type": "boolean", + "readOnly": true + }, + "isNestedPrivate": { + "type": "boolean", + "readOnly": true + }, + "isNestedPublic": { + "type": "boolean", + "readOnly": true + }, + "isNotPublic": { + "type": "boolean", + "readOnly": true + }, + "isPublic": { + "type": "boolean", + "readOnly": true + }, + "isAutoLayout": { + "type": "boolean", + "readOnly": true + }, + "isExplicitLayout": { + "type": "boolean", + "readOnly": true + }, + "isLayoutSequential": { + "type": "boolean", + "readOnly": true + }, + "isAnsiClass": { + "type": "boolean", + "readOnly": true + }, + "isAutoClass": { + "type": "boolean", + "readOnly": true + }, + "isUnicodeClass": { + "type": "boolean", + "readOnly": true + }, + "isCOMObject": { + "type": "boolean", + "readOnly": true + }, + "isContextful": { + "type": "boolean", + "readOnly": true + }, + "isEnum": { + "type": "boolean", + "readOnly": true + }, + "isMarshalByRef": { + "type": "boolean", + "readOnly": true + }, + "isPrimitive": { + "type": "boolean", + "readOnly": true + }, + "isValueType": { + "type": "boolean", + "readOnly": true + }, + "isSignatureType": { + "type": "boolean", + "readOnly": true + }, + "isSecurityCritical": { + "type": "boolean", + "readOnly": true + }, + "isSecuritySafeCritical": { + "type": "boolean", + "readOnly": true + }, + "isSecurityTransparent": { + "type": "boolean", + "readOnly": true + }, + "structLayoutAttribute": { + "$ref": "#/components/schemas/StructLayoutAttribute" + }, + "typeInitializer": { + "$ref": "#/components/schemas/ConstructorInfo" + }, + "typeHandle": { + "$ref": "#/components/schemas/RuntimeTypeHandle" + }, + "guid": { + "type": "string", + "format": "uuid", + "readOnly": true + }, + "baseType": { + "$ref": "#/components/schemas/Type" + }, + "isSerializable": { + "type": "boolean", + "readOnly": true + }, + "containsGenericParameters": { + "type": "boolean", + "readOnly": true + }, + "isVisible": { + "type": "boolean", + "readOnly": true + } + }, + "additionalProperties": false + }, + "TypeAttributes": { + "enum": [ + "NotPublic", + "AutoLayout", + "AnsiClass", + "Class", + "Public", + "NestedPublic", + "NestedPrivate", + "NestedFamily", + "NestedAssembly", + "NestedFamANDAssem", + "NestedFamORAssem", + "VisibilityMask", + "SequentialLayout", + "ExplicitLayout", + "LayoutMask", + "Interface", + "ClassSemanticsMask", + "Abstract", + "Sealed", + "SpecialName", + "RTSpecialName", + "Import", + "Serializable", + "WindowsRuntime", + "UnicodeClass", + "AutoClass", + "CustomFormatClass", + "StringFormatMask", + "HasSecurity", + "ReservedMask", + "BeforeFieldInit", + "CustomFormatMask" + ], + "type": "integer", + "format": "int32" + }, + "TypeInfo": { + "type": "object", + "properties": { + "name": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "customAttributes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CustomAttributeData" + }, + "nullable": true, + "readOnly": true + }, + "isCollectible": { + "type": "boolean", + "readOnly": true + }, + "metadataToken": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "isInterface": { + "type": "boolean", + "readOnly": true + }, + "memberType": { + "$ref": "#/components/schemas/MemberTypes" + }, + "namespace": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "assemblyQualifiedName": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "fullName": { + "type": "string", + "nullable": true, + "readOnly": true + }, + "assembly": { + "$ref": "#/components/schemas/Assembly" + }, + "module": { + "$ref": "#/components/schemas/Module" + }, + "isNested": { + "type": "boolean", + "readOnly": true + }, + "declaringType": { + "$ref": "#/components/schemas/Type" + }, + "declaringMethod": { + "$ref": "#/components/schemas/MethodBase" + }, + "reflectedType": { + "$ref": "#/components/schemas/Type" + }, + "underlyingSystemType": { + "$ref": "#/components/schemas/Type" + }, + "isTypeDefinition": { + "type": "boolean", + "readOnly": true + }, + "isArray": { + "type": "boolean", + "readOnly": true + }, + "isByRef": { + "type": "boolean", + "readOnly": true + }, + "isPointer": { + "type": "boolean", + "readOnly": true + }, + "isConstructedGenericType": { + "type": "boolean", + "readOnly": true + }, + "isGenericParameter": { + "type": "boolean", + "readOnly": true + }, + "isGenericTypeParameter": { + "type": "boolean", + "readOnly": true + }, + "isGenericMethodParameter": { + "type": "boolean", + "readOnly": true + }, + "isGenericType": { + "type": "boolean", + "readOnly": true + }, + "isGenericTypeDefinition": { + "type": "boolean", + "readOnly": true + }, + "isSZArray": { + "type": "boolean", + "readOnly": true + }, + "isVariableBoundArray": { + "type": "boolean", + "readOnly": true + }, + "isByRefLike": { + "type": "boolean", + "readOnly": true + }, + "hasElementType": { + "type": "boolean", + "readOnly": true + }, + "genericTypeArguments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Type" + }, + "nullable": true, + "readOnly": true + }, + "genericParameterPosition": { + "type": "integer", + "format": "int32", + "readOnly": true + }, + "genericParameterAttributes": { + "$ref": "#/components/schemas/GenericParameterAttributes" + }, + "attributes": { + "$ref": "#/components/schemas/TypeAttributes" + }, + "isAbstract": { + "type": "boolean", + "readOnly": true + }, + "isImport": { + "type": "boolean", + "readOnly": true + }, + "isSealed": { + "type": "boolean", + "readOnly": true + }, + "isSpecialName": { + "type": "boolean", + "readOnly": true + }, + "isClass": { + "type": "boolean", + "readOnly": true + }, + "isNestedAssembly": { + "type": "boolean", + "readOnly": true + }, + "isNestedFamANDAssem": { + "type": "boolean", + "readOnly": true + }, + "isNestedFamily": { + "type": "boolean", + "readOnly": true + }, + "isNestedFamORAssem": { + "type": "boolean", + "readOnly": true + }, + "isNestedPrivate": { + "type": "boolean", + "readOnly": true + }, + "isNestedPublic": { + "type": "boolean", + "readOnly": true + }, + "isNotPublic": { + "type": "boolean", + "readOnly": true + }, + "isPublic": { + "type": "boolean", + "readOnly": true + }, + "isAutoLayout": { + "type": "boolean", + "readOnly": true + }, + "isExplicitLayout": { + "type": "boolean", + "readOnly": true + }, + "isLayoutSequential": { + "type": "boolean", + "readOnly": true + }, + "isAnsiClass": { + "type": "boolean", + "readOnly": true + }, + "isAutoClass": { + "type": "boolean", + "readOnly": true + }, + "isUnicodeClass": { + "type": "boolean", + "readOnly": true + }, + "isCOMObject": { + "type": "boolean", + "readOnly": true + }, + "isContextful": { + "type": "boolean", + "readOnly": true + }, + "isEnum": { + "type": "boolean", + "readOnly": true + }, + "isMarshalByRef": { + "type": "boolean", + "readOnly": true + }, + "isPrimitive": { + "type": "boolean", + "readOnly": true + }, + "isValueType": { + "type": "boolean", + "readOnly": true + }, + "isSignatureType": { + "type": "boolean", + "readOnly": true + }, + "isSecurityCritical": { + "type": "boolean", + "readOnly": true + }, + "isSecuritySafeCritical": { + "type": "boolean", + "readOnly": true + }, + "isSecurityTransparent": { + "type": "boolean", + "readOnly": true + }, + "structLayoutAttribute": { + "$ref": "#/components/schemas/StructLayoutAttribute" + }, + "typeInitializer": { + "$ref": "#/components/schemas/ConstructorInfo" + }, + "typeHandle": { + "$ref": "#/components/schemas/RuntimeTypeHandle" + }, + "guid": { + "type": "string", + "format": "uuid", + "readOnly": true + }, + "baseType": { + "$ref": "#/components/schemas/Type" + }, + "isSerializable": { + "type": "boolean", + "readOnly": true + }, + "containsGenericParameters": { + "type": "boolean", + "readOnly": true + }, + "isVisible": { + "type": "boolean", + "readOnly": true + }, + "genericTypeParameters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Type" + }, + "nullable": true, + "readOnly": true + }, + "declaredConstructors": { "type": "array", - "description": "Gets or sets the translations.\n ", "items": { - "$ref": "#/components/schemas/DictionaryTranslationViewModel" - } + "$ref": "#/components/schemas/ConstructorInfo" + }, + "nullable": true, + "readOnly": true }, - "contentApps": { + "declaredEvents": { "type": "array", - "description": "Apps for the dictionary item\n ", "items": { - "$ref": "#/components/schemas/ContentApp" - } + "$ref": "#/components/schemas/EventInfo" + }, + "nullable": true, + "readOnly": true }, - "notifications": { + "declaredFields": { "type": "array", - "description": "This is used to add custom localized messages/strings to the response for the app to use for localized UI purposes.\n ", "items": { - "$ref": "#/components/schemas/BackOfficeNotification" - } - }, - "name": { - "type": "string", - "minLength": 1 - }, - "key": { - "type": "string", - "description": "Gets or sets the Key for the object\n ", - "format": "guid" - }, - "path": { - "type": "string", - "description": "The path of the entity\n " - } - } - }, - "DictionaryTranslationViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "id": { - "type": "integer", - "format": "int32" + "$ref": "#/components/schemas/FieldInfo" + }, + "nullable": true, + "readOnly": true }, - "key": { - "type": "string", - "format": "guid" + "declaredMembers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MemberInfo" + }, + "nullable": true, + "readOnly": true }, - "displayName": { - "type": "string", - "description": "Gets or sets the display name.\n ", - "nullable": true + "declaredMethods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MethodInfo" + }, + "nullable": true, + "readOnly": true }, - "isoCode": { - "type": "string", - "description": "Gets or sets the ISO code.\n ", - "nullable": true + "declaredNestedTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TypeInfo" + }, + "nullable": true, + "readOnly": true }, - "translation": { - "type": "string", - "description": "Gets or sets the translation.\n " + "declaredProperties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PropertyInfo" + }, + "nullable": true, + "readOnly": true }, - "languageId": { - "type": "integer", - "description": "Gets or sets the language id.\n ", - "format": "int32" + "implementedInterfaces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Type" + }, + "nullable": true, + "readOnly": true } - } + }, + "additionalProperties": false }, - "ContentApp": { + "UpgradeSettings": { "type": "object", - "description": "Represents a content app.\n ", - "additionalProperties": false, "properties": { - "name": { + "currentState": { "type": "string", - "description": "Gets the name of the content app.\n ", "nullable": true }, - "alias": { + "newState": { "type": "string", - "description": "Gets the unique alias of the content app.\n ", "nullable": true }, - "weight": { - "type": "integer", - "description": "Gets or sets the weight of the content app.\n ", - "format": "int32" - }, - "icon": { + "newVersion": { "type": "string", - "description": "Gets the icon of the content app.\n ", "nullable": true }, - "view": { + "oldVersion": { "type": "string", - "description": "Gets the view for rendering the content app.\n ", - "nullable": true - }, - "viewModel": { - "description": "The view model specific to this app\n ", "nullable": true }, - "active": { - "type": "boolean", - "description": "Gets a value indicating whether the app is active.\n " - }, - "badge": { - "description": "Gets or sets the content app badge.\n ", + "reportUrl": { + "type": "string", "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ContentAppBadge" - } - ] - } - } - }, - "ContentAppBadge": { - "type": "object", - "description": "Represents a content app badge\n ", - "additionalProperties": false, - "properties": { - "count": { - "type": "integer", - "description": "Gets or sets the number displayed in the badge\n ", - "format": "int32" - }, - "type": { - "description": "Gets or sets the type of badge to display\n ", - "oneOf": [ - { - "$ref": "#/components/schemas/ContentAppBadgeType" - } - ] + "readOnly": true } - } + }, + "additionalProperties": false }, - "ContentAppBadgeType": { - "type": "integer", - "description": "Represent the content app badge types\n ", - "x-enumNames": [ - "Default", - "Warning", - "Alert" + "UserInstall": { + "required": [ + "email", + "name", + "password" ], - "enum": [ - 0, - 1, - 2 - ] - }, - "BackOfficeNotification": { "type": "object", - "additionalProperties": false, "properties": { - "header": { - "type": "string", - "nullable": true + "name": { + "maxLength": 255, + "minLength": 0, + "type": "string" }, - "message": { + "email": { + "minLength": 1, "type": "string", - "nullable": true + "format": "email" }, - "notificationType": { - "$ref": "#/components/schemas/NotificationStyle" - } - } - }, - "NotificationStyle": { - "type": "integer", - "description": "", - "x-enumNames": [ - "Save", - "Info", - "Error", - "Success", - "Warning" - ], - "enum": [ - 0, - 1, - 2, - 3, - 4 - ] - }, - "DictionaryItemViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "parentId": { - "type": "string", - "format": "guid", - "nullable": true + "password": { + "minLength": 1, + "type": "string" }, - "key": { - "type": "string", - "format": "guid" + "subscribeToNewsletter": { + "type": "boolean", + "readOnly": true } - } + }, + "additionalProperties": false }, - "JsonPatchViewModel": { + "UserSettings": { "type": "object", - "additionalProperties": false, "properties": { - "op": { - "type": "string" + "minCharLength": { + "type": "integer", + "format": "int32" }, - "path": { - "type": "string" + "minNonAlphaNumericLength": { + "type": "integer", + "format": "int32" }, - "value": {} - } - }, - "DictionaryImportViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "dictionaryItems": { + "consentLevels": { "type": "array", "items": { - "$ref": "#/components/schemas/DictionaryItemsImportViewModel" - } - }, - "tempFileName": { - "type": "string", + "$ref": "#/components/schemas/ConsentLevel" + }, "nullable": true } - } + }, + "additionalProperties": false }, - "DictionaryItemsImportViewModel": { + "Version": { "type": "object", - "additionalProperties": false, "properties": { - "name": { + "version": { "type": "string", "nullable": true - }, - "level": { - "type": "integer", - "format": "int32" - } - } - }, - "PagedViewModelOfCultureViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "total": { - "type": "integer", - "format": "int64" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CultureViewModel" - } } - } - }, - "CultureViewModel": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "type": "string" - }, - "englishName": { - "type": "string" + }, + "additionalProperties": false + } + }, + "securitySchemes": { + "OAuth": { + "type": "oauth2", + "description": "Umbraco Authentication", + "flows": { + "authorizationCode": { + "authorizationUrl": "/umbraco/management/api/v1.0/security/back-office/authorize", + "tokenUrl": "/umbraco/management/api/v1.0/security/back-office/token", + "scopes": { } } } } } }, - "tags": [ - { - "name": "Culture" - }, - { - "name": "Data Type" - }, - { - "name": "Dictionary" - }, - { - "name": "Document" - }, - { - "name": "Document Blueprint" - }, - { - "name": "Document Type" - }, - { - "name": "Help" - }, - { - "name": "Install" - }, - { - "name": "Language" - }, - { - "name": "Media" - }, - { - "name": "Media Type" - }, - { - "name": "Member Group" - }, - { - "name": "Member Type" - }, - { - "name": "Models Builder" - }, - { - "name": "Partial View" - }, - { - "name": "Profiling" - }, - { - "name": "Published Cache" - }, - { - "name": "Relation" - }, - { - "name": "Relation Type" - }, - { - "name": "Script" - }, - { - "name": "Search" - }, - { - "name": "Server" - }, - { - "name": "Static File" - }, - { - "name": "Stylesheet" - }, - { - "name": "Telemetry" - }, - { - "name": "Template" - }, - { - "name": "Tracked Reference" - }, + "security": [ { - "name": "Upgrade" + "OAuth": [ ] } ] } diff --git a/src/Umbraco.Cms.ManagementApi/OpenApi/EnumSchemaFilter.cs b/src/Umbraco.Cms.ManagementApi/OpenApi/EnumSchemaFilter.cs new file mode 100644 index 000000000000..2b8dd3f4696e --- /dev/null +++ b/src/Umbraco.Cms.ManagementApi/OpenApi/EnumSchemaFilter.cs @@ -0,0 +1,23 @@ +using System.Reflection; +using System.Runtime.Serialization; +using Microsoft.OpenApi.Any; +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace Umbraco.Cms.ManagementApi.OpenApi; + +public class EnumSchemaFilter : ISchemaFilter +{ + public void Apply(OpenApiSchema model, SchemaFilterContext context) + { + if (context.Type.IsEnum) + { + model.Enum.Clear(); + foreach (var name in Enum.GetNames(context.Type)) + { + var actualName = context.Type.GetField(name)?.GetCustomAttribute()?.Value ?? name; + model.Enum.Add(new OpenApiString(actualName)); + } + } + } +} diff --git a/src/Umbraco.Cms.ManagementApi/OpenApi/MimeTypeDocumentFilter.cs b/src/Umbraco.Cms.ManagementApi/OpenApi/MimeTypeDocumentFilter.cs new file mode 100644 index 000000000000..f49a89e22f36 --- /dev/null +++ b/src/Umbraco.Cms.ManagementApi/OpenApi/MimeTypeDocumentFilter.cs @@ -0,0 +1,33 @@ +using Microsoft.OpenApi.Models; +using Swashbuckle.AspNetCore.SwaggerGen; +using Umbraco.Extensions; + +namespace Umbraco.Cms.ManagementApi.OpenApi; + +/// +/// This filter explicitly removes all other mime types than application/json from the produced OpenAPI document +/// +public class MimeTypeDocumentFilter : IDocumentFilter +{ + public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) + { + OpenApiOperation[] operations = swaggerDoc.Paths + .SelectMany(path => path.Value.Operations.Values) + .ToArray(); + + void RemoveUnwantedMimeTypes(IDictionary content) => + content.RemoveAll(r => r.Key != "application/json"); + + OpenApiRequestBody[] requestBodies = operations.Select(operation => operation.RequestBody).WhereNotNull().ToArray(); + foreach (OpenApiRequestBody requestBody in requestBodies) + { + RemoveUnwantedMimeTypes(requestBody.Content); + } + + OpenApiResponse[] responses = operations.SelectMany(operation => operation.Responses.Values).WhereNotNull().ToArray(); + foreach (OpenApiResponse response in responses) + { + RemoveUnwantedMimeTypes(response.Content); + } + } +} diff --git a/src/Umbraco.Cms.ManagementApi/OpenApi/SchemaIdGenerator.cs b/src/Umbraco.Cms.ManagementApi/OpenApi/SchemaIdGenerator.cs new file mode 100644 index 000000000000..71c15620fd7c --- /dev/null +++ b/src/Umbraco.Cms.ManagementApi/OpenApi/SchemaIdGenerator.cs @@ -0,0 +1,26 @@ +using System.Text.RegularExpressions; +using Umbraco.Extensions; + +namespace Umbraco.Cms.ManagementApi.OpenApi; + +internal static class SchemaIdGenerator +{ + public static string Generate(Type type) + { + string SanitizedTypeName(Type t) => t.Name + // first grab the "non generic" part of any generic type name (i.e. "PagedViewModel`1" becomes "PagedViewModel") + .Split('`').First() + // then remove the "ViewModel" postfix from type names + .TrimEnd("ViewModel"); + + var name = SanitizedTypeName(type); + if (type.IsGenericType) + { + // append the generic type names, ultimately turning i.e. "PagedViewModel" into "PagedRelationItem" + name += string.Join(string.Empty, type.GenericTypeArguments.Select(SanitizedTypeName)); + } + + // make absolutely sure we don't pass any invalid named by removing all non-word chars + return Regex.Replace(name, @"[^\w]", string.Empty); + } +} diff --git a/src/Umbraco.Cms.ManagementApi/Security/BackOfficeApplicationManager.cs b/src/Umbraco.Cms.ManagementApi/Security/BackOfficeApplicationManager.cs new file mode 100644 index 000000000000..87f63f2f6eed --- /dev/null +++ b/src/Umbraco.Cms.ManagementApi/Security/BackOfficeApplicationManager.cs @@ -0,0 +1,131 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Options; +using OpenIddict.Abstractions; +using Umbraco.New.Cms.Core; +using Umbraco.New.Cms.Core.Models.Configuration; +using Umbraco.New.Cms.Infrastructure.Security; + +namespace Umbraco.Cms.ManagementApi.Security; + +public class BackOfficeApplicationManager : IBackOfficeApplicationManager +{ + private readonly IOpenIddictApplicationManager _applicationManager; + private readonly IWebHostEnvironment _webHostEnvironment; + private readonly Uri? _backOfficeHost; + + public BackOfficeApplicationManager( + IOpenIddictApplicationManager applicationManager, + IWebHostEnvironment webHostEnvironment, + IOptionsMonitor securitySettingsMonitor) + { + _applicationManager = applicationManager; + _webHostEnvironment = webHostEnvironment; + _backOfficeHost = securitySettingsMonitor.CurrentValue.BackOfficeHost; + } + + public async Task EnsureBackOfficeApplicationAsync(Uri backOfficeUrl, CancellationToken cancellationToken = default) + { + if (backOfficeUrl.IsAbsoluteUri is false) + { + throw new ArgumentException($"Expected an absolute URL, got: {backOfficeUrl}", nameof(backOfficeUrl)); + } + + await CreateOrUpdate( + new OpenIddictApplicationDescriptor + { + DisplayName = "Umbraco back-office access", + ClientId = Constants.OauthClientIds.BackOffice, + RedirectUris = + { + CallbackUrlFor(_backOfficeHost ?? backOfficeUrl, "/umbraco/login/callback/") + }, + Type = OpenIddictConstants.ClientTypes.Public, + Permissions = + { + OpenIddictConstants.Permissions.Endpoints.Authorization, + OpenIddictConstants.Permissions.Endpoints.Token, + OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode, + OpenIddictConstants.Permissions.GrantTypes.RefreshToken, + OpenIddictConstants.Permissions.ResponseTypes.Code + } + }, + cancellationToken); + + if (_webHostEnvironment.IsProduction()) + { + await Delete(Constants.OauthClientIds.Swagger, cancellationToken); + await Delete(Constants.OauthClientIds.Postman, cancellationToken); + } + else + { + await CreateOrUpdate( + new OpenIddictApplicationDescriptor + { + DisplayName = "Umbraco Swagger access", + ClientId = Constants.OauthClientIds.Swagger, + RedirectUris = + { + CallbackUrlFor(backOfficeUrl, "/umbraco/swagger/oauth2-redirect.html") + }, + Type = OpenIddictConstants.ClientTypes.Public, + Permissions = + { + OpenIddictConstants.Permissions.Endpoints.Authorization, + OpenIddictConstants.Permissions.Endpoints.Token, + OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode, + OpenIddictConstants.Permissions.ResponseTypes.Code + } + }, + cancellationToken); + + await CreateOrUpdate( + new OpenIddictApplicationDescriptor + { + DisplayName = "Umbraco Postman access", + ClientId = Constants.OauthClientIds.Postman, + RedirectUris = + { + new Uri("https://oauth.pstmn.io/v1/callback") + }, + Type = OpenIddictConstants.ClientTypes.Public, + Permissions = + { + OpenIddictConstants.Permissions.Endpoints.Authorization, + OpenIddictConstants.Permissions.Endpoints.Token, + OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode, + OpenIddictConstants.Permissions.ResponseTypes.Code + } + }, + cancellationToken); + } + } + + private async Task CreateOrUpdate(OpenIddictApplicationDescriptor clientDescriptor, CancellationToken cancellationToken) + { + var identifier = clientDescriptor.ClientId ?? + throw new ApplicationException($"ClientId is missing for application: {clientDescriptor.DisplayName ?? "(no name)"}"); + var client = await _applicationManager.FindByClientIdAsync(identifier, cancellationToken); + if (client is null) + { + await _applicationManager.CreateAsync(clientDescriptor, cancellationToken); + } + else + { + await _applicationManager.UpdateAsync(client, clientDescriptor, cancellationToken); + } + } + + private async Task Delete(string identifier, CancellationToken cancellationToken) + { + var client = await _applicationManager.FindByClientIdAsync(identifier, cancellationToken); + if (client is null) + { + return; + } + + await _applicationManager.DeleteAsync(client, cancellationToken); + } + + private static Uri CallbackUrlFor(Uri url, string relativePath) => new Uri( $"{url.GetLeftPart(UriPartial.Authority)}/{relativePath.TrimStart(Core.Constants.CharArrays.ForwardSlash)}"); +} diff --git a/src/Umbraco.Cms.ManagementApi/Umbraco.Cms.ManagementApi.csproj b/src/Umbraco.Cms.ManagementApi/Umbraco.Cms.ManagementApi.csproj index 592f328ec29e..eb0a8de7867a 100644 --- a/src/Umbraco.Cms.ManagementApi/Umbraco.Cms.ManagementApi.csproj +++ b/src/Umbraco.Cms.ManagementApi/Umbraco.Cms.ManagementApi.csproj @@ -11,6 +11,12 @@ + + + + + + diff --git a/src/Umbraco.Cms.ManagementApi/ViewModels/Telemetry/TelemetryLevelViewModel.cs b/src/Umbraco.Cms.ManagementApi/ViewModels/Telemetry/TelemetryViewModel.cs similarity index 86% rename from src/Umbraco.Cms.ManagementApi/ViewModels/Telemetry/TelemetryLevelViewModel.cs rename to src/Umbraco.Cms.ManagementApi/ViewModels/Telemetry/TelemetryViewModel.cs index d387be92e908..574ae863601f 100644 --- a/src/Umbraco.Cms.ManagementApi/ViewModels/Telemetry/TelemetryLevelViewModel.cs +++ b/src/Umbraco.Cms.ManagementApi/ViewModels/Telemetry/TelemetryViewModel.cs @@ -3,7 +3,7 @@ namespace Umbraco.Cms.ManagementApi.ViewModels.Telemetry; -public class TelemetryLevelViewModel +public class TelemetryViewModel { [JsonConverter(typeof(JsonStringEnumConverter))] public TelemetryLevel TelemetryLevel { get; set; } diff --git a/src/Umbraco.Core/Routing/UmbracoRequestPaths.cs b/src/Umbraco.Core/Routing/UmbracoRequestPaths.cs index fe1e83d2545f..17ffe2ce3883 100644 --- a/src/Umbraco.Core/Routing/UmbracoRequestPaths.cs +++ b/src/Umbraco.Core/Routing/UmbracoRequestPaths.cs @@ -51,6 +51,7 @@ public UmbracoRequestPaths(IOptions globalSettings, IHostingEnvi /// These are def back office: /// /Umbraco/BackOffice = back office /// /Umbraco/Preview = back office + /// /Umbraco/Management/Api = back office /// /// /// If it's not any of the above then we cannot determine if it's back office or front-end diff --git a/tests/Umbraco.Tests.Integration/NewBackoffice/OpenAPIContractTest.cs b/tests/Umbraco.Tests.Integration/NewBackoffice/OpenAPIContractTest.cs index a869f63bd343..c4c0bad3a966 100644 --- a/tests/Umbraco.Tests.Integration/NewBackoffice/OpenAPIContractTest.cs +++ b/tests/Umbraco.Tests.Integration/NewBackoffice/OpenAPIContractTest.cs @@ -35,7 +35,7 @@ public async Task Validate_OpenApi_Contract_is_implemented() var officePath = GlobalSettings.GetBackOfficePath(HostingEnvironment); var urlToContract = $"{officePath}/management/api/openapi.json"; - var swaggerPath = $"{officePath}/swagger/All/swagger.json"; + var swaggerPath = $"{officePath}/swagger/v1/swagger.json"; var apiContract = JObject.Parse(await Client.GetStringAsync(urlToContract)); var generatedJsonString = await Client.GetStringAsync(swaggerPath);