Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
6639280
add API interfaces
pokornyd Jul 22, 2025
f4eb512
adjust options builder, add core extension methods
pokornyd Jul 28, 2025
2cf02d5
restructure API definition, typed params and responses
pokornyd Jul 31, 2025
2ccbaf5
downgrade deps to v8.x
pokornyd Jul 31, 2025
ccb1a42
adjust options, mark obsolete and nullable
pokornyd Jul 31, 2025
f4f993c
refactor message handlers, enable nullable abstractions
pokornyd Jul 31, 2025
72b891f
fix package versions
pokornyd Aug 5, 2025
93607bc
remove client builder code
pokornyd Aug 8, 2025
7d95143
refactor delivery options and its validation
pokornyd Aug 8, 2025
b42ee39
cleanup unused factories and validators
pokornyd Aug 8, 2025
d4d3ea5
add default refit settings provider
pokornyd Aug 8, 2025
ce322d7
validate deliveryoptions
pokornyd Aug 8, 2025
bbe3bd1
rewrite service registration
pokornyd Aug 8, 2025
1d224b5
change queryparams to records
pokornyd Aug 11, 2025
2a85dfa
add global usings
pokornyd Aug 11, 2025
9ffc0b9
adjust refit interfaces
pokornyd Aug 11, 2025
296db85
interfaces to Abstractions proj, client refactor
pokornyd Aug 11, 2025
659ab38
fix resolving context accessors
pokornyd Aug 11, 2025
26d9dcd
implement base filtering
pokornyd Aug 14, 2025
ac8160a
strongly typed filtering
pokornyd Aug 19, 2025
2239d52
rename where to filter, refactor
pokornyd Aug 19, 2025
2c66607
remove newtonsoft in favor of system.text.json
pokornyd Aug 19, 2025
f382956
add json serializer and helpers
pokornyd Aug 19, 2025
fe3a4d4
use refit iapiresponse, add response processor
pokornyd Aug 19, 2025
d9223be
add wait-for-new-content header
pokornyd Aug 20, 2025
9717cc1
implement remaining response processing
pokornyd Aug 20, 2025
f620520
centralize response processing on IDeliveryResult
pokornyd Aug 29, 2025
e6fbb9f
add executeAll method to item listing
pokornyd Aug 31, 2025
4502cd0
add dynamicItem return type
pokornyd Aug 31, 2025
3f077cd
remove sync related logic
pokornyd Sep 1, 2025
73f5f1c
remove legacy response models
pokornyd Sep 1, 2025
a6ffca6
support dynamic elements, add elementCodename attr
pokornyd Sep 2, 2025
d1b8e29
revamp API and response models
pokornyd Sep 4, 2025
4bf2f58
remove unused feed-related classes
pokornyd Sep 4, 2025
7a47939
add JsonConverterFactory, refactor response models
pokornyd Sep 4, 2025
7159261
rename dynamic queries, bump anglesharp
pokornyd Sep 8, 2025
a082ded
Add TResult parameter to IIPropertyValueConverter
pokornyd Sep 8, 2025
5354067
allow opting into string rich text resolution on client and query level
pokornyd Sep 8, 2025
f9c05d2
add dynamic elements dictionary to default IContentItem
pokornyd Sep 10, 2025
d91431b
make IContentItem dynamic, adjust queries
pokornyd Sep 10, 2025
8373f0a
adjust folder structure
pokornyd Sep 11, 2025
f193e64
register model resolution, add rt postprocessing
pokornyd Sep 11, 2025
a9d6573
revamp generated models
pokornyd Sep 11, 2025
dbd191e
adjust used in queries and response
pokornyd Sep 12, 2025
5b5917c
slight refactor, unused cleanup
pokornyd Sep 12, 2025
245d30f
adjust tests
pokornyd Sep 12, 2025
e0cb16b
lint & format
pokornyd Sep 12, 2025
9dc316c
refactor RT, models and auth handler, fix related tests
pokornyd Sep 14, 2025
3fc4974
add filtering to enum query
pokornyd Sep 16, 2025
382f744
remove DI extensions and related tests
pokornyd Sep 16, 2025
1ab195b
fix response types for tax and types queries
pokornyd Sep 18, 2025
85cadd7
change response models to init only records
pokornyd Sep 18, 2025
8212591
refactor caching, add cached queries
pokornyd Sep 18, 2025
22254d4
refactor reactive imple
pokornyd Sep 18, 2025
2273da1
fix failing tests, adjust test data
pokornyd Sep 18, 2025
30c1718
drop observable package and related tests
pokornyd Sep 23, 2025
30d84a6
fix filtering queryparam generation
pokornyd Sep 23, 2025
0814a63
make options mutable, refactor extensions, add asset element mapping
pokornyd Sep 30, 2025
86a05ce
merge element conversion and deserialization
pokornyd Sep 30, 2025
9bd3314
refactor model provision, cleanup unused code
pokornyd Sep 30, 2025
1a36157
unify element conversion and processing
pokornyd Sep 30, 2025
7d79d87
resolve item links as objects, refactor rich text
pokornyd Oct 2, 2025
86265b9
unify naming for enumerateAll methods
pokornyd Oct 7, 2025
08786d1
cleanup unused code
pokornyd Oct 9, 2025
da194f5
refactor registration, reintroduce builders
pokornyd Oct 9, 2025
eda244d
extend structured rich text
pokornyd Oct 13, 2025
c41dff0
reorganize directory, unify rich text processing to node-based
pokornyd Oct 13, 2025
3d7abf3
refactor converter factory
pokornyd Oct 13, 2025
6d37978
cache mapper reflection, refactor
pokornyd Oct 14, 2025
f61b0ca
make default resolution automatic, refactor link resolution
pokornyd Oct 14, 2025
6d8eca9
fix taxonomy hydration, add tests
pokornyd Oct 15, 2025
089b5e4
add base for new caching approach, deprecate legacy
pokornyd Oct 16, 2025
f13bc26
add new distributedCacheManager
pokornyd Oct 16, 2025
b7febf2
remove legacy caching logic
pokornyd Oct 16, 2025
c073266
add caching-related tests
pokornyd Oct 16, 2025
f7b8c92
remove caching optin from deliveryoptions, add servicecollection over…
pokornyd Oct 17, 2025
b70f47f
extract cache dependency generation logic
pokornyd Oct 17, 2025
6f963d6
adjust remaining models for tests
pokornyd Oct 17, 2025
15c5366
fix option validation tests, adjust resolving context, improve resolv…
pokornyd Oct 17, 2025
99119de
remove non-existent project reference from sln
pokornyd Oct 17, 2025
2554e39
simplify asset models, clear unused ones
pokornyd Oct 20, 2025
6a4306b
inline rich text processing, remove related legacy code
pokornyd Oct 20, 2025
83ad97e
simplify property mapper, remove legacy custom attrs
pokornyd Oct 20, 2025
2389dab
remove ValueOf dep, refactor filtervalue
pokornyd Oct 20, 2025
85e67e2
add filter validation
pokornyd Oct 20, 2025
3e7572c
add further filtering tests, adjust propertypaths
pokornyd Oct 20, 2025
7789936
refactor resolver provisioning, rename InlineContentItem to EmbeddedC…
pokornyd Oct 20, 2025
71780d9
make resolution encoding more permissive
pokornyd Oct 20, 2025
cccc3fe
unify link and item resolution design
pokornyd Oct 21, 2025
67140ba
remove resolution context
pokornyd Oct 21, 2025
4d292ce
add named client registration support and client factory
pokornyd Oct 21, 2025
312d109
refactor, cleanup unused objects
pokornyd Oct 21, 2025
ad6b92d
format, cleanup unused code, lint
pokornyd Oct 22, 2025
f9647e0
adjust readme
pokornyd Oct 22, 2025
7afd757
make workflow related system properties nullable (for components)
pokornyd Oct 22, 2025
5ad008b
Update beta release notice in README
pokornyd Oct 22, 2025
1d4a71a
add developer docs
pokornyd Oct 23, 2025
e637998
remove legacy docs
Oct 23, 2025
e918942
refactor
pokornyd Oct 26, 2025
1e4b5cc
clear unused packages from csproj, fix benchmark proj cpu req
pokornyd Oct 26, 2025
bcea743
consolidate project props, remove legacy assemblyinfo files
pokornyd Oct 26, 2025
fb45dca
fix incorrect filter method naming for typesquery
pokornyd Oct 26, 2025
bf79a40
make filter public, make toqueryparam an extension method
pokornyd Oct 26, 2025
7eac166
adjust dir structure, clear unused usings
pokornyd Oct 26, 2025
540e70f
format and refactor
pokornyd Oct 26, 2025
442b75e
add missing examples to docs
pokornyd Oct 26, 2025
31debdc
add strongly typed resolution of rich text embedded content
pokornyd Oct 26, 2025
28982f6
add linked item elements recursive postprocessing
pokornyd Oct 26, 2025
4c7b5ae
minor refactor
pokornyd Oct 26, 2025
af74e19
update readmes with linked item element processing
pokornyd Oct 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 32 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<!-- Enable CI-specific deterministic/source-linked builds when running in CI -->
<ContinuousIntegrationBuild Condition="'$(CI)'=='true'">true</ContinuousIntegrationBuild>
</PropertyGroup>

<!-- Shared packaging and SourceLink configuration for packable projects only -->
<PropertyGroup Condition="'$(IsPackable)'=='true'">
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>

<Authors>Kontent s.r.o.</Authors>
<Product>Kontent.ai</Product>
<Copyright>© 2025 Kontent s.r.o. All rights reserved.</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/kontent-ai/delivery-sdk-net</PackageProjectUrl>
<RepositoryUrl>https://github.com/kontent-ai/delivery-sdk-net.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>

<!-- Prefer embedded icon/readme over legacy URL -->
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>kai-logo-symbol-color-rgb.png</PackageIcon>
</PropertyGroup>

<ItemGroup Condition="'$(IsPackable)'=='true'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<None Include="../README.md" Pack="true" PackagePath="" />
<None Include="../kai-logo-symbol-color-rgb.png" Pack="true" PackagePath="" />
</ItemGroup>
</Project>
25 changes: 13 additions & 12 deletions Kontent.Ai.Delivery.Abstractions.Tests/CheckNamespaces.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
using System;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using Xunit;
using Xunit.Abstractions;

namespace Kontent.Ai.Delivery.Abstractions.Tests;
namespace Kontent.Ai.Delivery.Abstractions;

public class CheckNamespaces
public class CheckNamespaces(ITestOutputHelper output)
{
private readonly ITestOutputHelper output;

public CheckNamespaces(ITestOutputHelper output)
{
this.output = output;
}
private readonly ITestOutputHelper output = output;

/// <summary>
/// See Kontent.Ai.Delivery.Abstractions Readme for more information.
Expand All @@ -24,8 +17,16 @@ public void AllNamespacecAreCorrect()
{
var abstractionTypes = Assembly.LoadFrom("Kontent.Ai.Delivery.Abstractions.dll");

var typesToCheck = abstractionTypes
.GetTypes()
// Exclude compiler-generated artifacts and synthesized types
.Where(t => t.GetCustomAttribute(typeof(CompilerGeneratedAttribute), inherit: true) == null)
.Where(t => !t.Name.StartsWith("<>"))
// Only consider types that actually have a namespace
.Where(t => t.Namespace is not null);

Assert.All(
abstractionTypes.GetTypes().Where(t => t.GetCustomAttribute(typeof(CompilerGeneratedAttribute), true) == null),
t => Assert.Equal("Kontent.Ai.Delivery.Abstractions", t.Namespace));
typesToCheck,
t => Assert.StartsWith("Kontent.Ai.Delivery.Abstractions", t.Namespace));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
108 changes: 108 additions & 0 deletions Kontent.Ai.Delivery.Abstractions/Caching/IDeliveryCacheManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
namespace Kontent.Ai.Delivery.Abstractions;

/// <summary>
/// Manages caching of Delivery API responses with automatic dependency tracking and invalidation.
/// Implementations should provide thread-safe operations suitable for concurrent access.
/// </summary>
/// <remarks>
/// <para>
/// This interface follows modern .NET caching patterns, separating retrieval (<see cref="GetAsync{T}"/>),
/// storage (<see cref="SetAsync{T}"/>), and invalidation (<see cref="InvalidateAsync"/>) concerns.
/// </para>
/// <para>
/// The dependency tracking system enables automatic cache invalidation when content changes.
/// When storing a cache entry, you specify which content items, assets, or taxonomies it depends on.
/// Later, calling <see cref="InvalidateAsync"/> with any of those dependency keys will invalidate
/// all cache entries that reference them.
/// </para>
/// <para>
/// Dependency key format conventions:
/// <list type="bullet">
/// <item><description>Content items: <c>item_{codename}</c> (e.g., "item_hero")</description></item>
/// <item><description>Assets: <c>asset_{guid}</c> (e.g., "asset_a5e1c4b2-...")</description></item>
/// <item><description>Taxonomies: <c>taxonomy_{group}</c> (e.g., "taxonomy_categories")</description></item>
/// </list>
/// </para>
/// </remarks>
public interface IDeliveryCacheManager
{
/// <summary>
/// Attempts to retrieve a cached value by its key.
/// </summary>
/// <typeparam name="T">The type of the cached value.</typeparam>
/// <param name="cacheKey">The unique key identifying the cache entry.</param>
/// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
/// <returns>
/// A task representing the asynchronous operation, containing the cached value if found;
/// otherwise, <c>null</c>.
/// </returns>
/// <remarks>
/// This method should return <c>null</c> for cache misses or expired entries, not throw exceptions.
/// Implementations should handle deserialization errors gracefully by treating them as cache misses.
/// </remarks>
Task<T?> GetAsync<T>(string cacheKey, CancellationToken cancellationToken = default) where T : class;

/// <summary>
/// Stores a value in the cache with associated dependency keys for automatic invalidation.
/// </summary>
/// <typeparam name="T">The type of the value to cache.</typeparam>
/// <param name="cacheKey">The unique key under which to store the value. Must not be <c>null</c> or empty.</param>
/// <param name="value">The value to cache. Must not be <c>null</c>.</param>
/// <param name="dependencies">
/// A collection of dependency keys that, when invalidated, will also invalidate this cache entry.
/// Use standardized key formats (see <see cref="IDeliveryCacheManager"/> remarks).
/// Must not be <c>null</c>, but may be empty.
/// </param>
/// <param name="expiration">
/// Optional absolute expiration timespan. If <c>null</c>, the implementation's default expiration is used.
/// </param>
/// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
/// <returns>A task representing the asynchronous storage operation.</returns>
/// <exception cref="ArgumentNullException">
/// Thrown when <paramref name="cacheKey"/>, <paramref name="value"/>, or <paramref name="dependencies"/> is <c>null</c>.
/// </exception>
/// <exception cref="ArgumentException">
/// Thrown when <paramref name="cacheKey"/> is empty or whitespace.
/// </exception>
/// <remarks>
/// <para>
/// Implementations should create a reverse index mapping each dependency key to all cache entries
/// that reference it, enabling efficient invalidation via <see cref="InvalidateAsync"/>.
/// </para>
/// <para>
/// If the cache write fails, implementations should throw an exception rather than silently fail,
/// allowing the calling code to handle the error appropriately.
/// </para>
/// </remarks>
Task SetAsync<T>(
string cacheKey,
T value,
IEnumerable<string> dependencies,
TimeSpan? expiration = null,
CancellationToken cancellationToken = default) where T : class;

/// <summary>
/// Invalidates all cache entries that depend on the specified dependency keys.
/// </summary>
/// <param name="cancellationToken">A token to cancel the asynchronous operation.</param>
/// <param name="dependencyKeys">
/// One or more dependency keys to invalidate. All cache entries referencing any of these keys
/// will be removed from the cache.
/// </param>
/// <returns>A task representing the asynchronous invalidation operation.</returns>
/// <remarks>
/// <para>
/// This method performs cascade invalidation: if a cache entry depends on any of the specified keys,
/// it will be removed, regardless of what other dependencies it may have.
/// </para>
/// <para>
/// Invalidating a non-existent dependency key should succeed without error (idempotent operation).
/// </para>
/// <para>
/// Example: If a cached items list depends on "item_hero" and "item_author", calling
/// <c>InvalidateAsync(dependencyKeys: "item_hero")</c> will invalidate the entire list,
/// even though "item_author" was not invalidated.
/// </para>
/// </remarks>
Task InvalidateAsync(CancellationToken cancellationToken = default, params string[] dependencyKeys);
}

This file was deleted.

Loading
Loading