Commit Graph

18 Commits

Author SHA1 Message Date
Bjarke Berg
47d5ef88c4 Post merge fixes - Including temp workaround for .net8 efcore breaking change (Should be fixed again in preview 7) 2023-07-07 10:55:29 +02:00
Bjarke Berg
4aa7001fbf Merge remote-tracking branch 'origin/v12/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
2023-06-27 09:50:37 +02:00
Bjarke Berg
2973f9fe5a Add OpenIddict tables to database (#14449)
* Added migrations to install EF Core OpenIddict tables

* Handle Install of ef core data (Needs to be outside of transaction

* Cleanup and renaming, as these things will be reused for more than openiddict in the future

* Cleanup

* Extract db context setup

* Minor cleanup

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-06-26 13:50:57 +02:00
Bjarke Berg
22b2f79d15 Merge remote-tracking branch 'origin/v12/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderApiExtensions.cs
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
#	src/Umbraco.Web.Common/Profiler/WebProfiler.cs
2023-06-21 09:06:42 +02:00
Bjarke Berg
54479c9538 Updated nuget packages to latest versions (#14419) 2023-06-20 12:21:16 +02:00
Bjarke Berg
c84a3e2fe4 Merge remote-tracking branch 'origin/v12/dev' into release/14.0
# Conflicts:
#	src/Umbraco.Core/Manifest/PackageManifest.cs
#	src/Umbraco.Core/Telemetry/TelemetryService.cs
#	src/Umbraco.Infrastructure/Manifest/LegacyManifestParser.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/V_12_0_0/ResetCache.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/CreatedPackageSchemaRepository.cs
#	src/Umbraco.Infrastructure/Services/Implement/PackagingService.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/Telemetry/TelemetryServiceTests.cs
2023-06-08 10:07:29 +02:00
Mole
2dd7d610da Update OpenIdDict (#14340) 2023-06-06 10:15:53 +02:00
Mole
cd3f06349b Update OpenIdDict (#14340) 2023-06-06 10:15:31 +02:00
Bjarke Berg
8f5f7f72fa Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	version.json
2023-05-23 12:23:27 +02:00
Mole
1e6c220610 Downgrade OpenIdDict (#14279) 2023-05-22 12:29:16 +02:00
Bjarke Berg
27e5b55e05 Added OpenIddict dependencies for future usage (#14247) 2023-05-15 13:24:19 +02:00
Bjarke Berg
2922c1fc92 Merge remote-tracking branch 'origin/v12/dev' into v13/dev
# Conflicts:
#	src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderApiExtensions.cs
#	src/Umbraco.Cms.Api.Delivery/Controllers/DeliveryApiControllerBase.cs
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Web.Common/Configuration/ConfigureApiVersioningOptions.cs
#	tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Tabs/tabs.spec.ts
2023-05-12 11:42:15 +02:00
Kenn Jacobsen
f4ee0d027a Move all routing tokens (incl. API versioning) to Web.Common (#14231)
* Move all routing tokens (incl. API versioning) to Cms.Web.Common, so the site can start without adding the delivery API in Startup

* Fixed merge

* Fix backwards compat
2023-05-11 08:18:43 +02:00
Bjarke Berg
9187d92a2c Copied back swagger for delivery api from v13 implementation (#14222)
Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-05-10 13:29:45 +02:00
Bjarke Berg
417e92dad0 Updated API version package and moved attribute to each controller (#14209)
* Updated API version package and moved attribute to each controller as it cannot be inherited.

* Ignore "$type" on types implementing interfaces in the delivery api
2023-05-09 08:38:07 +02:00
Bjarke Berg
38947e0870 Added functionality to split det swagger doc into multiple definitions (#14126)
* Added functionality to split det swagger doc into multiple definitions. Most (maybe too much) is still shared between the apis.

* Fixed issue with duplicate operation ids when we have multiple versions of an endpoint

* use strong types instead of var

* Updated OpenApi.json

* Formatting

* formatting

* Delete old files that is not implemented in api.common

* Updated openAPi after merge

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-20 12:38:31 +02:00
Bjarke Berg
c06e89af64 Content Delivery API (#14051)
* Add the core parts of the headless PoC

* Add Content API project (WIP - loads of TODOs and dupes that need to be fixed!)

* Rename the content API project and namespaces

* Fixed bad merge

* Rename everything "Headless" to "ContentApi" or "Api"

* Refactor Content + Media: Key => Id, Name not nullable

* Make Content API property return value types independent of datatype configuration

* Clean up refactorings

* First stab at an expansion strategy using content picker as example implementation

* Use named JSON options for content API serialization

* Proper inclusion and registration of the content API

* Introduce API media builder

* Make MNTP return API content/media depending on configuration (instead of links) and support output expansion

* Content API: Get by controllers (#13740)

* Adding ContentApiControllerBase

* Adding get by id and url controllers

* Change route of get all test controller

* Rename to ContentApiController

* Refactoring

* Removing test controller

* Content API: Add start-node header value to deal with url collisions (#13746)

* Use start-node header value to deal with url collisions

* Cleanup

* Rename "url" param to "path"

* Adding a start node service to get the start-node header value

* Trim '/' from both beginning and end

* Content API: Support Accept-Language header (#13831)

* Move the content API JSON type resolver to an appropriate namespace

* Add localization based on Accept-Language header

* Content API: Output expansion  (#13848)

* Implement request based output expansion strategy + expansion output cache at property level

* Slighty leaner implementation for default output expansion strategy

* Clarify the code a bit

* Fix bad merge

* Encapsulate content API dependencies in the DI

* Support multi-site and multi-culture routing + a little rename/refactor (#13882)

* Support multi-site and multi-culture routing + a little rename/refactor

* Make the by route controller handle root nodes

* Rename Url to Path in API content output

* Add a few comments for magic route creation

* Rename services from "Default" to "Noop"

* Ensure that Umbraco can boot without adding "AddContentApi()" to ConfigureServices

* Moved incorrectly placed media builder

* Fix API routes (#13915)

* Fix multi URL picker value converter trying to access disposed objects in edge cases

* Delivery API: Content routing and structure (#13984)

* Introduce content route instead of content path, rename and rework start item (previously start node) handling

* Strip out start node path in generated route path

* Make the start-item header take precedence over the request domain

* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)

* Include umbraco properties (width, height, ...) in the Media Properties collection (#14023)

* Move umbraco properties (width, height, ...) to the Properties collection of the API Media model

* Don't output the umbracoFile property of media items

* Add content type deny list (#14025)

* Create a deny list of content types and utilize it for output generation

* Add unit tests

* Dedicated property cache level for Content API (#14027)

* Support redirect tracking (#14033)

* Create a deny list of content types and utilize it for output generation

* Add unit tests

* Handle redirect tracking in the content API

* Include start item routing info for redirects

* Add cultures and their routes to the API output (#14038)

* Create a deny list of content types and utilize it for output generation

* Add unit tests

* Handle redirect tracking in the content API

* Include start item routing info for redirects

* Add culture routes to root output (for HREFLANG support)

* Rename redirect service method to better match its purpose

* Review changes

* Delivery API: Query controller (#14041)

* Initial commit

* Custom ContentAPIFieldDefinitionCollection

* Make index IUmbracoContentIndex

* Add querying for children by parent id (key)

* Add missing interface

* Adding querying endpoint

* Test code

* Compose unpublishedValueSet, so that you get the correct data in the ContentAPI index

* Renaming

* Fix ancestorKeys index values

* Adding IApiQueryExtensionService to be able to query the ContentAPI index in a generic way

* Fix IApiQueryService and clean up QueryContentApiController using it

* Support querying for path

* Fix content API indexing

* Fix default sorting

* Implement concrete QueryOption implementations

* Introduce new ExecuteQuery that uses the Core OptionHandlers

* Implement ExecuteQuery

* Change ExecuteQuery signature and implementation

* Implement demo sorting and fetching

* Add query option handlers and collection builder for them

* Cleanup

* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"

This reverts commit 78e1f748e55383baecd123d06457111e18f13365.

* Revert "Delivery API: Content routing and structure (#13984)"

This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.

* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"

This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.

* Revert "Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)"

This reverts commit 78e1f748e55383baecd123d06457111e18f13365.

* Revert "Delivery API: Content routing and structure (#13984)"

This reverts commit a0292ae5350362dd6c1c5bc9763deda928c78a75.

* Revert "Fix multi URL picker value converter trying to access disposed objects in edge cases"

This reverts commit 6b7c37a5bf7871bee93a2b2640bbc6ef591f14db.

* Fix multi URL picker value converter trying to access disposed objects in edge cases

* Delivery API: Content routing and structure (#13984)

* Introduce content route instead of content path, rename and rework start item (previously start node) handling

* Strip out start node path in generated route path

* Make the start-item header take precedence over the request domain

* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)

* Test commit

* Refactored interfaces for the query handlers and for the selectors (that will handle the value of the fetch query option)

* Implemented a base class for the query options

* Refactored the names of the selectors and made use of the base class

* Refactored the ApiQueryService

* Refactored the QueryContentApiController.cs

* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)

* Fixing merge gone wrong

* Fix multi URL picker value converter trying to access disposed objects in edge cases

* Delivery API: Content routing and structure (#13984)

* Introduce content route instead of content path, rename and rework start item (previously start node) handling

* Strip out start node path in generated route path

* Make the start-item header take precedence over the request domain

* Conditionally enabling the delivery API + add protection and preview support + refactor all services to be singletons + ensure no-op implementations for all required services (#13992)

* Make fetching work with the new setup

* Moving files to dedicated folders

* Removing ? for array

* Rename selector query method

* Implement FilterHandler and some filters

* Implement SortHandler and sort some sorts

* Refactoring

* Adding more fields to index due to querying

* Appending filtering and sorting queries

* Implementing a new ISelectorHandler without Examine types

* Re-implementing the collection to have a dedicated one for the selectors

* Implementing a new IFilterHandler without Examine types & refactoring the filters implementing it

* Adding a new collection dedicated to filters

* Renaming the old collection

* Implementing a new ISortHandler without Examine types & refactoring the sorts implementing it

* Adding a new collection for the sorts & adding all collections to UmbracoBuilder.Collections

* Refactoring the service to use the new collections and types

* Refactoring the fields in ContentApiFieldDefinitionCollection

* Remove nullability in Handlers

* Don't return null for selector

* Add TODO for having the filters support negation

* Changing the SortType to FieldType with our custom types on the SortOption

* Fix AncestorsSelector

* Fix ApiQueryService

* Documentation

* Fix Swagger docs

* Refactor the QueryContentApiController

* Adding handling for the IApiContentResponse in the JsonTypeResolver

* Refactor the service to use a safe fallback value in Examine queries

* Adding Noop for the IApiQueryService

* Cleanup

* Remove comment

* Fix name field for indexing

* Don't inherit QueryOptionBase in filters

* Fix casing for API index constant + swap FIXME with TODO

* Add TODO for handling missing fetch with start-item header

* Rename query handler parameters to not leak source (i.e. query string)

---------

Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa <>
Co-authored-by: Zeegaan <nge@umbraco.dk>

* Delivery API: Adding pagination to query endpoint (#14083)

* Adding pagination to query endpoint

* Optimize the paging using Examine directly

* Fix comment

* Remove skip/take code duplication

---------

Co-authored-by: kjac <kja@umbraco.dk>

* Add missing CompatibilitySuppressions.xml

* Make Delivery API packable

* Make Api.Common packable

* Renamed extension method and namespace so it is discoverable

* Untangle ApiVersion configuration into api.common, so delivery api do not require the management api to boot.

* configure options in management api

* RTE output as JSON for Content API (#14067)

* Conditionally serve RTE output as JSON instead of HTML

* Fixed merge

* Rename to Delivery API (#14119)

* Rename ContentApi to DeliveryApi

* Rename delivery API index implementation

* Update comments from "Content API" to "Delivery API"

* Rename project from Content to Delivery

* Add dedicated controller base for content delivery API

* Rename delivery API content index to include "content" specifically

* Fix compat suppressions

---------

Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-04-19 11:21:31 +02:00
Kenn Jacobsen
801966f1ae Created a common library for the APIs (#13530)
* Created a common library for the APIs and moved stuff that is required for the new content API. Also moved the versioned backoffice API route handling to the management API where it belongs.

* Remove test auth attribute from Media
2022-12-09 08:52:17 +01:00