Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V13: Webhook all the things #15161

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
a7c4a8f
Adds Language WebHooks & Moves existing Core ones into own folder/nam…
warrenbuckley Nov 7, 2023
cd12abc
Updates WebHook Collection to have handy Extension method for AddLang…
warrenbuckley Nov 7, 2023
90d5548
Adds Dictionary WebHooks
warrenbuckley Nov 7, 2023
41bff00
Adds domain webhooks
warrenbuckley Nov 7, 2023
f462aba
Formatting - CTRL K + CTRL D
warrenbuckley Nov 7, 2023
7a5b166
Adds DataType Webhooks
warrenbuckley Nov 7, 2023
f20244e
Adds Relations and Relation Types to Webhook Events
warrenbuckley Nov 7, 2023
70d4e18
Adds stylesheet webhooks
warrenbuckley Nov 7, 2023
2e865f8
Adds Template/Partial View Webhooks
warrenbuckley Nov 7, 2023
df1e2ed
Adds script webhooks
warrenbuckley Nov 7, 2023
6397b18
Namespace change as there are more media and content events/notificat…
warrenbuckley Nov 7, 2023
98c255a
Adds Package Webhook
warrenbuckley Nov 7, 2023
5ea95fb
Adds Media WebHooks
warrenbuckley Nov 7, 2023
819c108
Adds more Media Webhooks
warrenbuckley Nov 7, 2023
cfec660
Merge remote-tracking branch 'upstream/v13/dev' into v13/feature/webh…
warrenbuckley Nov 9, 2023
642bad8
WIP: Updates to changes made in dev branch
warrenbuckley Nov 9, 2023
a6e668a
Update existing Webhooks to use the new attribute
warrenbuckley Nov 10, 2023
b229c8d
Merge remote-tracking branch 'upstream/v13/dev' into v13/feature/webh…
warrenbuckley Nov 10, 2023
5187649
After merge - fixes the change from IWebHookService to IWebhookService
warrenbuckley Nov 10, 2023
389525f
Merge remote-tracking branch 'upstream/v13/dev' into v13/feature/webh…
warrenbuckley Nov 13, 2023
0ac1595
Rename to align with the name of underlying Notification
warrenbuckley Nov 13, 2023
a4c0f7c
Adds a couple more Webhook events - Content Saved, Rolled Back and Em…
warrenbuckley Nov 13, 2023
8abdbc0
For now empty recylce bin returns the IContent entity as the previous…
warrenbuckley Nov 13, 2023
b6465be
Merge remote-tracking branch 'upstream/v13/dev' into v13/feature/webh…
warrenbuckley Nov 13, 2023
081178d
Adds Member Type notifications
warrenbuckley Nov 13, 2023
021169d
Adds more Content based Webhooks
warrenbuckley Nov 14, 2023
604c9e7
Merge remote-tracking branch 'upstream/v13/dev' into v13/feature/webh…
warrenbuckley Nov 14, 2023
b938020
Merge tag 'release-13.0.0-rc2' into v13/feature/webhook-all-the-things
warrenbuckley Nov 15, 2023
5939f42
Adds the last of the Content related notifications as Webhooks that I…
warrenbuckley Nov 15, 2023
00f44d5
Merge remote-tracking branch 'upstream/v13/dev' into v13/feature/webh…
warrenbuckley Nov 17, 2023
c6a9a61
Adds PublicAccess WebHooks
warrenbuckley Nov 19, 2023
05647ad
Merge remote-tracking branch 'upstream/release/13.0' into v13/feature…
warrenbuckley Nov 19, 2023
2c88377
Merge remote-tracking branch 'upstream/v13/dev' into v13/feature/webh…
warrenbuckley Nov 21, 2023
fba16cd
Fix up misaligned namespaces - too much copy/pasting
warrenbuckley Nov 21, 2023
80bdd89
Adds Member Webhook for Saved & Deleted
warrenbuckley Nov 21, 2023
b0c75f9
Merge branch 'v13/feature/webhook-all-the-things' of https://github.c…
warrenbuckley Nov 21, 2023
cc3d45b
WebHookEventBase ConvertNotificationToRequestPayload that could be ov…
warrenbuckley Nov 21, 2023
5561f8c
Adds the last fo the member webhooks
warrenbuckley Nov 21, 2023
c3fb6ef
Adds AllTheWebHook to the collection builder to easily see all events…
warrenbuckley Nov 21, 2023
362d36f
Merge remote-tracking branch 'upstream/v13/dev' into v13/feature/webh…
warrenbuckley Nov 21, 2023
5c6eb4a
Adds the User related Webhooks
warrenbuckley Nov 21, 2023
b74ecd6
Refined the template webhooks mostly to remove Messages & State prope…
warrenbuckley Nov 22, 2023
69bc1aa
Refined the stylesheet webhooks mostly to remove Messages & State pro…
warrenbuckley Nov 22, 2023
065e406
Refined the script webhooks mostly to remove Messages & State properties
warrenbuckley Nov 22, 2023
ab7b40b
Refined the Relation and RelationType webhooks mostly to remove Messa…
warrenbuckley Nov 22, 2023
08f4ae1
Refined the PublicAccess webhooks mostly to remove Messages & State p…
warrenbuckley Nov 22, 2023
c9619bc
Refined the MemberType webhooks mostly to remove Messages & State pro…
warrenbuckley Nov 22, 2023
b68d3b6
Refined the Member webhooks mostly to remove Messages & State properties
warrenbuckley Nov 22, 2023
4da31ce
Refined the Media webhooks mostly to remove Messages & State properties
warrenbuckley Nov 22, 2023
88179ff
Refined the Language webhooks mostly to remove Messages & State prope…
warrenbuckley Nov 22, 2023
05ccfd6
Refined the Domain webhooks mostly to remove Messages & State properties
warrenbuckley Nov 22, 2023
8e0d8f3
Refined the Dictionary webhooks mostly to remove Messages & State pro…
warrenbuckley Nov 22, 2023
29dc36d
Refined the DataType webhooks mostly to remove Messages & State prope…
warrenbuckley Nov 22, 2023
3897c56
Refined the Content webhooks mostly to remove Messages & State proper…
warrenbuckley Nov 22, 2023
80c3806
Merge remote-tracking branch 'upstream/v13/dev' into v13/feature/webh…
warrenbuckley Nov 22, 2023
80526ae
Merge remote-tracking branch 'upstream/v13/dev' into v13/feature/webh…
warrenbuckley Nov 23, 2023
25f40f1
Merge remote-tracking branch 'upstream/release/13.0' into v13/feature…
warrenbuckley Nov 27, 2023
bf751d4
Merge remote-tracking branch 'upstream/v13/dev' into v13/feature/webh…
warrenbuckley Nov 28, 2023
58aa1d8
Updates the infinite editor for the WebHook events to be sorted by th…
warrenbuckley Nov 28, 2023
c66f9c3
Merge remote-tracking branch 'upstream/v13/dev' into v13/feature/webh…
warrenbuckley Nov 28, 2023
8e5b9b4
Infinite Editor for Webhook Events with filtering like icon picker
warrenbuckley Nov 28, 2023
43ca562
Add a language key webhooks_noEventsFound
warrenbuckley Nov 28, 2023
ccc7409
Merge remote-tracking branch 'upstream/v13/dev' into v13/feature/webh…
warrenbuckley Nov 28, 2023
1bffdc4
Merge branch 'v13/feature/webhook-all-the-things' of https://github.c…
warrenbuckley Nov 30, 2023
c32d2be
Spell MediaType without space, consistent with the other Types
nul800sebastiaan Nov 30, 2023
f4399ed
Clarify method name
nul800sebastiaan Nov 30, 2023
dadf2c7
Spell RelationType without space, consistent with the other Types
nul800sebastiaan Nov 30, 2023
cd626b1
Correct wrong names
nul800sebastiaan Nov 30, 2023
34e381f
Consistency in folders and naming (everything WITH a space - changed …
nul800sebastiaan Nov 30, 2023
6db15aa
More consistency
nul800sebastiaan Nov 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;

namespace Umbraco.Cms.Core.Webhooks.Events;
namespace Umbraco.Cms.Core.Webhooks.Events.Core;

public class ContentDeleteWebhookEvent : WebhookEventContentBase<ContentDeletedNotification, IContent>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;

namespace Umbraco.Cms.Core.Webhooks.Events;
namespace Umbraco.Cms.Core.Webhooks.Events.Core;

public class ContentPublishWebhookEvent : WebhookEventContentBase<ContentPublishedNotification, IContent>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;

namespace Umbraco.Cms.Core.Webhooks.Events;
namespace Umbraco.Cms.Core.Webhooks.Events.Core;

public class ContentUnpublishWebhookEvent : WebhookEventContentBase<ContentUnpublishedNotification, IContent>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;

namespace Umbraco.Cms.Core.Webhooks.Events;
namespace Umbraco.Cms.Core.Webhooks.Events.Core;

public class MediaDeleteWebhookEvent : WebhookEventContentBase<MediaDeletedNotification, IMedia>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;

namespace Umbraco.Cms.Core.Webhooks.Events;
namespace Umbraco.Cms.Core.Webhooks.Events.Core;

public class MediaSaveWebhookEvent : WebhookEventContentBase<MediaSavedNotification, IMedia>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;

namespace Umbraco.Cms.Core.Webhooks.Events.Dictionary;

public class DictionaryItemDeletedWebhookEvent : WebhookEventBase<DictionaryItemDeletedNotification>
{
public DictionaryItemDeletedWebhookEvent(
IWebhookFiringService webhookFiringService,
IWebHookService webHookService,
IOptionsMonitor<WebhookSettings> webhookSettings,
IServerRoleAccessor serverRoleAccessor)
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Dictionary Item Deleted")
{ }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;

namespace Umbraco.Cms.Core.Webhooks.Events.Dictionary;

public class DictionaryItemSavedWebhookEvent : WebhookEventBase<DictionaryItemSavedNotification>
{
public DictionaryItemSavedWebhookEvent(
IWebhookFiringService webhookFiringService,
IWebHookService webHookService,
IOptionsMonitor<WebhookSettings> webhookSettings,
IServerRoleAccessor serverRoleAccessor)
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Dictionary Item Saved")
{ }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;

namespace Umbraco.Cms.Core.Webhooks.Events.Language;

public class LanguageDeletedWebhookEvent : WebhookEventBase<LanguageDeletedNotification>
{
public LanguageDeletedWebhookEvent(
IWebhookFiringService webhookFiringService,
IWebHookService webHookService,
IOptionsMonitor<WebhookSettings> webhookSettings,
IServerRoleAccessor serverRoleAccessor)
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Language Deleted")
{ }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Sync;

namespace Umbraco.Cms.Core.Webhooks.Events.Language;

public class LanguageSavedWebhookEvent : WebhookEventBase<LanguageSavedNotification>
{
public LanguageSavedWebhookEvent(
IWebhookFiringService webhookFiringService,
IWebHookService webHookService,
IOptionsMonitor<WebhookSettings> webhookSettings,
IServerRoleAccessor serverRoleAccessor)
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Language Saved")
{ }
}
37 changes: 27 additions & 10 deletions src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.Webhooks.Events;
using Umbraco.Cms.Core.Webhooks.Events.Core;
using Umbraco.Cms.Core.Webhooks.Events.Dictionary;
using Umbraco.Cms.Core.Webhooks.Events.Language;
using Umbraco.Extensions;

namespace Umbraco.Cms.Core.Webhooks;
Expand All @@ -21,16 +24,6 @@ public override void RegisterWith(IServiceCollection services)
base.RegisterWith(services);
}

public WebhookEventCollectionBuilder AddCoreWebhooks()
{
Append<ContentDeleteWebhookEvent>();
Append<ContentPublishWebhookEvent>();
Append<ContentUnpublishWebhookEvent>();
Append<MediaDeleteWebhookEvent>();
Append<MediaSaveWebhookEvent>();
return this;
}

private void RegisterTypes(IServiceCollection services)
{
Type[] types = GetRegisteringTypes(GetTypes()).ToArray();
Expand Down Expand Up @@ -78,4 +71,28 @@ private void RegisterTypes(IServiceCollection services)

return null;
}

public WebhookEventCollectionBuilder AddCoreWebhooks()
{
Append<ContentDeleteWebhookEvent>();
Append<ContentPublishWebhookEvent>();
Append<ContentUnpublishWebhookEvent>();
Append<MediaDeleteWebhookEvent>();
Append<MediaSaveWebhookEvent>();
return this;
}

public WebhookEventCollectionBuilder AddDictionaryWebhooks()
{
Append<DictionaryItemDeletedWebhookEvent>();
Append<DictionaryItemSavedWebhookEvent>();
return this;
}

public WebhookEventCollectionBuilder AddLanguageWebhooks()
{
Append<LanguageDeletedWebhookEvent>();
Append<LanguageSavedWebhookEvent>();
return this;
}
mikecp marked this conversation as resolved.
Show resolved Hide resolved
}
Loading