Files
Umbraco-CMS/src/Umbraco.Core/Services/IWebhookLogService.cs
Andy Butland 1c68e3d825 Added deliveries workspace view to the webhook details workspace (#18175)
* Added deliveries workspace view to the webhook details workspace.

* Front-end linting fixes.

* rename to unique

* update filter value

* make delivery feature folder

* move delivery workspace view for delivery feature folder

* correct details workspace view label and pathname to match name

* remove unused alias

* use singular form to align naming

* remove pagination as the default collection kind already includes this

* show icon

* remove double registration

* add observables for webhook data, add get methods + add jsdocs

* align UX with languages

* remove hardcoded fake name + make url the link

* remove redundant url in table

* render status code as tag

* use tags for enabled/disabled webhook state to align with users

* make the name more explicit

* move webhook root to a feature folder

* export consts

* fix webhook collection pagination

* move menu item manifests into root folder

* move webhook delivery filering responsibility from repo to workspace view

* reorganize

* move workspace

* fix import

* move entity actions

* export delivery consts

* dot not export const

* rename folder

* update name

* make event feature folder

* export consts

* move repository files

* more clean up

* split types

* add deprecation warning for a temp method

* bring back url to deliveries table

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2025-02-04 06:36:38 +01:00

22 lines
943 B
C#

using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Core.Services;
public interface IWebhookLogService
{
Task<WebhookLog> CreateAsync(WebhookLog webhookLog);
Task<PagedModel<WebhookLog>> Get(int skip = 0, int take = int.MaxValue);
// TODO (V16): Remove the default implementation on this method.
async Task<PagedModel<WebhookLog>> Get(Guid webhookKey, int skip = 0, int take = int.MaxValue)
{
// This is very inefficient as the filter/skip/take is in-memory, but it will return the correct data.
// As it's only here to avoid a breaking change on the interface that is unlikely to have a custom
// implementation, this seems reasonable.
PagedModel<WebhookLog> allLogs = await Get(0, int.MaxValue);
var logsForId = allLogs.Items.Where(x => x.WebhookKey == webhookKey).ToList();
return new PagedModel<WebhookLog>(logsForId.Count, logsForId.Skip(skip).Take(take));
}
}