From a7c4a8f06a2cb58d2c58914b7a44876e75a27921 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 13:08:12 +0000 Subject: [PATCH 01/52] Adds Language WebHooks & Moves existing Core ones into own folder/namespace --- .../{ => Core}/ContentDeleteWebhookEvent.cs | 2 +- .../{ => Core}/ContentPublishWebhookEvent.cs | 2 +- .../{ => Core}/ContentUnpublishWebhookEvent.cs | 2 +- .../{ => Core}/MediaDeleteWebhookEvent.cs | 2 +- .../Events/{ => Core}/MediaSaveWebhookEvent.cs | 2 +- .../Language/LanguageDeletedWebhookEvent.cs | 18 ++++++++++++++++++ .../Language/LanguageSavedWebhookEvent.cs | 18 ++++++++++++++++++ 7 files changed, 41 insertions(+), 5 deletions(-) rename src/Umbraco.Core/Webhooks/Events/{ => Core}/ContentDeleteWebhookEvent.cs (95%) rename src/Umbraco.Core/Webhooks/Events/{ => Core}/ContentPublishWebhookEvent.cs (97%) rename src/Umbraco.Core/Webhooks/Events/{ => Core}/ContentUnpublishWebhookEvent.cs (95%) rename src/Umbraco.Core/Webhooks/Events/{ => Core}/MediaDeleteWebhookEvent.cs (95%) rename src/Umbraco.Core/Webhooks/Events/{ => Core}/MediaSaveWebhookEvent.cs (97%) create mode 100644 src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/ContentDeleteWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Core/ContentDeleteWebhookEvent.cs similarity index 95% rename from src/Umbraco.Core/Webhooks/Events/ContentDeleteWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Core/ContentDeleteWebhookEvent.cs index 52b8d233e535..14db8fe51bb3 100644 --- a/src/Umbraco.Core/Webhooks/Events/ContentDeleteWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Core/ContentDeleteWebhookEvent.cs @@ -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 { diff --git a/src/Umbraco.Core/Webhooks/Events/ContentPublishWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Core/ContentPublishWebhookEvent.cs similarity index 97% rename from src/Umbraco.Core/Webhooks/Events/ContentPublishWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Core/ContentPublishWebhookEvent.cs index 8f308432b88f..4060178253a8 100644 --- a/src/Umbraco.Core/Webhooks/Events/ContentPublishWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Core/ContentPublishWebhookEvent.cs @@ -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 { diff --git a/src/Umbraco.Core/Webhooks/Events/ContentUnpublishWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Core/ContentUnpublishWebhookEvent.cs similarity index 95% rename from src/Umbraco.Core/Webhooks/Events/ContentUnpublishWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Core/ContentUnpublishWebhookEvent.cs index c8a8fd789e5b..f3c58a742425 100644 --- a/src/Umbraco.Core/Webhooks/Events/ContentUnpublishWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Core/ContentUnpublishWebhookEvent.cs @@ -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 { diff --git a/src/Umbraco.Core/Webhooks/Events/MediaDeleteWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Core/MediaDeleteWebhookEvent.cs similarity index 95% rename from src/Umbraco.Core/Webhooks/Events/MediaDeleteWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Core/MediaDeleteWebhookEvent.cs index eb19e3e88861..4a012296d782 100644 --- a/src/Umbraco.Core/Webhooks/Events/MediaDeleteWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Core/MediaDeleteWebhookEvent.cs @@ -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 { diff --git a/src/Umbraco.Core/Webhooks/Events/MediaSaveWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Core/MediaSaveWebhookEvent.cs similarity index 97% rename from src/Umbraco.Core/Webhooks/Events/MediaSaveWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Core/MediaSaveWebhookEvent.cs index 9a7dcaa3d554..a6f824f50416 100644 --- a/src/Umbraco.Core/Webhooks/Events/MediaSaveWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Core/MediaSaveWebhookEvent.cs @@ -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 { diff --git a/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs new file mode 100644 index 000000000000..15ce0580ff37 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs @@ -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 +{ + public LanguageDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Language Deleted") + { } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs new file mode 100644 index 000000000000..b2ff28619b3a --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs @@ -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 +{ + public LanguageSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Language Saved") + { } +} From cd12abc5d0fc83ce5e75afd5e97ea6786f7b9182 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 13:09:39 +0000 Subject: [PATCH 02/52] Updates WebHook Collection to have handy Extension method for AddLanguageWebHooks Will allow devs to easily pick and choose a category or related collection of WebHooks --- .../Webhooks/WebhookEventCollectionBuilder.cs | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index e0eeb186e856..567498844a45 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -3,6 +3,8 @@ 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.Language; using Umbraco.Extensions; namespace Umbraco.Cms.Core.Webhooks; @@ -21,16 +23,6 @@ public override void RegisterWith(IServiceCollection services) base.RegisterWith(services); } - public WebhookEventCollectionBuilder AddCoreWebhooks() - { - Append(); - Append(); - Append(); - Append(); - Append(); - return this; - } - private void RegisterTypes(IServiceCollection services) { Type[] types = GetRegisteringTypes(GetTypes()).ToArray(); @@ -78,4 +70,21 @@ private void RegisterTypes(IServiceCollection services) return null; } + + public WebhookEventCollectionBuilder AddCoreWebhooks() + { + Append(); + Append(); + Append(); + Append(); + Append(); + return this; + } + + public WebhookEventCollectionBuilder AddLanguageWebhooks() + { + Append(); + Append(); + return this; + } } From 90d5548b530520b209e25715efc22b8416eb422a Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 13:14:07 +0000 Subject: [PATCH 03/52] Adds Dictionary WebHooks --- .../DictionaryItemDeletedWebhookEvent.cs | 18 ++++++++++++++++++ .../DictionaryItemSavedWebhookEvent.cs | 18 ++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 8 ++++++++ 3 files changed, 44 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs new file mode 100644 index 000000000000..ece780771e34 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs @@ -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 +{ + public DictionaryItemDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Dictionary Item Deleted") + { } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs new file mode 100644 index 000000000000..c043f303cccd --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs @@ -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 +{ + public DictionaryItemSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Dictionary Item Saved") + { } +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 567498844a45..b690a0649bdd 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -4,6 +4,7 @@ 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; @@ -81,6 +82,13 @@ public WebhookEventCollectionBuilder AddCoreWebhooks() return this; } + public WebhookEventCollectionBuilder AddDictionaryWebhooks() + { + Append(); + Append(); + return this; + } + public WebhookEventCollectionBuilder AddLanguageWebhooks() { Append(); From 41bff0068aed404f7c880b51cf4b119d40eb516e Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 13:20:59 +0000 Subject: [PATCH 04/52] Adds domain webhooks --- .../Domain/DomainDeletedWebhookEvent.cs | 19 +++++++++++++++++++ .../Events/Domain/DomainSavedWebhookEvent.cs | 19 +++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 8 ++++++++ 3 files changed, 46 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs new file mode 100644 index 000000000000..31a9bfcaf279 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Domain; + +public class DomainDeletedWebhookEvent : WebhookEventBase +{ + public DomainDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Domain Deleted") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs new file mode 100644 index 000000000000..6b40f16d3da3 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Domain; + +public class DomainSavedWebhookEvent : WebhookEventBase +{ + public DomainSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Domain Saved") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index b690a0649bdd..749bffa157d9 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -5,6 +5,7 @@ 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.Domain; using Umbraco.Cms.Core.Webhooks.Events.Language; using Umbraco.Extensions; @@ -89,6 +90,13 @@ public WebhookEventCollectionBuilder AddDictionaryWebhooks() return this; } + public WebhookEventCollectionBuilder AddDomainWebhooks() + { + Append(); + Append(); + return this; + } + public WebhookEventCollectionBuilder AddLanguageWebhooks() { Append(); From f462abaef6eeffe5a290ff694705301d724890dc Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 13:21:21 +0000 Subject: [PATCH 05/52] Formatting - CTRL K + CTRL D --- .../Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs | 3 ++- .../Events/Dictionary/DictionaryItemSavedWebhookEvent.cs | 3 ++- .../Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs | 3 ++- .../Webhooks/Events/Language/LanguageSavedWebhookEvent.cs | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs index ece780771e34..623ae86a3cce 100644 --- a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs @@ -14,5 +14,6 @@ public DictionaryItemDeletedWebhookEvent( IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Dictionary Item Deleted") - { } + { + } } diff --git a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs index c043f303cccd..3488cb0238ef 100644 --- a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs @@ -14,5 +14,6 @@ public DictionaryItemSavedWebhookEvent( IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Dictionary Item Saved") - { } + { + } } diff --git a/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs index 15ce0580ff37..045aa15fae2f 100644 --- a/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs @@ -14,5 +14,6 @@ public LanguageDeletedWebhookEvent( IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Language Deleted") - { } + { + } } diff --git a/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs index b2ff28619b3a..630cd8dcf557 100644 --- a/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs @@ -14,5 +14,6 @@ public LanguageSavedWebhookEvent( IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Language Saved") - { } + { + } } From 7a5b16624a3cbde22ab73ba594b6d5fab3b924a1 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 13:28:12 +0000 Subject: [PATCH 06/52] Adds DataType Webhooks --- .../DataType/DataTypeDeletedWebhookEvent.cs | 19 +++++++++++++++++++ .../DataType/DataTypeMovedWebhookEvent.cs | 19 +++++++++++++++++++ .../DataType/DataTypeSavedWebhookEvent.cs | 19 +++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 9 +++++++++ 4 files changed, 66 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs new file mode 100644 index 000000000000..2238a803a9e6 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.DataType; + +public class DataTypeDeletedWebhookEvent : WebhookEventBase +{ + public DataTypeDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "DataType Deleted") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs new file mode 100644 index 000000000000..714b595f8585 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.DataType; + +public class DataTypeMovedWebhookEvent : WebhookEventBase +{ + public DataTypeMovedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "DataType Moved") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs new file mode 100644 index 000000000000..0c24784646c1 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.DataType; + +public class DataTypeSavedWebhookEvent : WebhookEventBase +{ + public DataTypeSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "DataType Saved") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 749bffa157d9..221b9fe32e37 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -4,6 +4,7 @@ using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Webhooks.Events; using Umbraco.Cms.Core.Webhooks.Events.Core; +using Umbraco.Cms.Core.Webhooks.Events.DataType; using Umbraco.Cms.Core.Webhooks.Events.Dictionary; using Umbraco.Cms.Core.Webhooks.Events.Domain; using Umbraco.Cms.Core.Webhooks.Events.Language; @@ -83,6 +84,14 @@ public WebhookEventCollectionBuilder AddCoreWebhooks() return this; } + public WebhookEventCollectionBuilder AddDataTypeWebhooks() + { + Append(); + Append(); + Append(); + return this; + } + public WebhookEventCollectionBuilder AddDictionaryWebhooks() { Append(); From f20244e3c31b405c39129268da4c3ad42f3ef7b5 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 14:13:13 +0000 Subject: [PATCH 07/52] Adds Relations and Relation Types to Webhook Events --- .../Relation/RelationDeletedWebhookEvent.cs | 19 ++++++++++++++++++ .../Relation/RelationSavedWebhookEvent.cs | 19 ++++++++++++++++++ .../RelationTypeDeletedWebhookEvent.cs | 19 ++++++++++++++++++ .../Relation/RelationTypeSavedWebhookEvent.cs | 19 ++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 20 ++++++++++++++++--- 5 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs new file mode 100644 index 000000000000..c2755873f3d1 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Relation; + +public class RelationDeletedWebhookEvent : WebhookEventBase +{ + public RelationDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Relation Deleted") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs new file mode 100644 index 000000000000..2af50880f970 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Relation; + +public class RelationSavedWebhookEvent : WebhookEventBase +{ + public RelationSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Relation Saved") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs new file mode 100644 index 000000000000..ea905e83f193 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Relation; + +public class RelationTypeDeletedWebhookEvent : WebhookEventBase +{ + public RelationTypeDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Relation Item Deleted") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs new file mode 100644 index 000000000000..d88b27d351aa --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Relation; + +public class RelationTypeSavedWebhookEvent : WebhookEventBase +{ + public RelationTypeSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Relation Item Saved") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 221b9fe32e37..90ab0c5525f7 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -8,18 +8,21 @@ using Umbraco.Cms.Core.Webhooks.Events.Dictionary; using Umbraco.Cms.Core.Webhooks.Events.Domain; using Umbraco.Cms.Core.Webhooks.Events.Language; +using Umbraco.Cms.Core.Webhooks.Events.Relation; using Umbraco.Extensions; namespace Umbraco.Cms.Core.Webhooks; -public class WebhookEventCollectionBuilder : OrderedCollectionBuilderBase +public class WebhookEventCollectionBuilder : OrderedCollectionBuilderBase { protected override WebhookEventCollectionBuilder This => this; public override void RegisterWith(IServiceCollection services) { // register the collection - services.Add(new ServiceDescriptor(typeof(WebhookEventCollection), CreateCollection, ServiceLifetime.Singleton)); + services.Add(new ServiceDescriptor(typeof(WebhookEventCollection), CreateCollection, + ServiceLifetime.Singleton)); // register the types RegisterTypes(services); @@ -63,7 +66,8 @@ private void RegisterTypes(IServiceCollection services) { Type[] genericArguments = handlerType.BaseType!.GetGenericArguments(); - Type? notificationType = genericArguments.FirstOrDefault(arg => typeof(INotification).IsAssignableFrom(arg)); + Type? notificationType = + genericArguments.FirstOrDefault(arg => typeof(INotification).IsAssignableFrom(arg)); if (notificationType is not null) { @@ -112,4 +116,14 @@ public WebhookEventCollectionBuilder AddLanguageWebhooks() Append(); return this; } + + public WebhookEventCollectionBuilder AddRelationWebhooks() + { + Append(); + Append(); + + Append(); + Append(); + return this; + } } From 70d4e1802996e617e92ef2ed243b0a0b5ef87fc9 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 14:22:39 +0000 Subject: [PATCH 08/52] Adds stylesheet webhooks --- .../StylesheetDeletedWebhookEvent.cs | 19 +++++++++++++++++++ .../Stylesheet/StylesheetSavedWebhookEvent.cs | 19 +++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 8 ++++++++ 3 files changed, 46 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs new file mode 100644 index 000000000000..beed9becd05a --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Stylesheet; + +public class StylesheetDeletedWebhookEvent : WebhookEventBase +{ + public StylesheetDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Stylesheet Deleted") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs new file mode 100644 index 000000000000..2b916b1b2628 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Stylesheet; + +public class StylesheetSavedWebhookEvent : WebhookEventBase +{ + public StylesheetSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Stylesheet Saved") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 90ab0c5525f7..687a2573cc60 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -9,6 +9,7 @@ using Umbraco.Cms.Core.Webhooks.Events.Domain; using Umbraco.Cms.Core.Webhooks.Events.Language; using Umbraco.Cms.Core.Webhooks.Events.Relation; +using Umbraco.Cms.Core.Webhooks.Events.Stylesheet; using Umbraco.Extensions; namespace Umbraco.Cms.Core.Webhooks; @@ -126,4 +127,11 @@ public WebhookEventCollectionBuilder AddRelationWebhooks() Append(); return this; } + + public WebhookEventCollectionBuilder AddStylesheetWebhooks() + { + Append(); + Append(); + return this; + } } From 2e865f8f88927681e267ba35055f645bbe16ff73 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 14:47:25 +0000 Subject: [PATCH 09/52] Adds Template/Partial View Webhooks --- .../PartialViewDeletedWebhookEvent.cs | 19 +++++++++++++++++++ .../Template/PartialViewSavedWebhookEvent.cs | 19 +++++++++++++++++++ .../Template/TemplateDeletedWebhookEvent.cs | 19 +++++++++++++++++++ .../Template/TemplateSavedWebhookEvent.cs | 19 +++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 10 ++++++++++ 5 files changed, 86 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs new file mode 100644 index 000000000000..5e094b8c2f0e --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Stylesheet; + +public class PartialViewDeletedWebhookEvent : WebhookEventBase +{ + public PartialViewDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Partial View Deleted") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs new file mode 100644 index 000000000000..ee1304d9726b --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Stylesheet; + +public class PartialViewSavedWebhookEvent : WebhookEventBase +{ + public PartialViewSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Partial View Saved") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs new file mode 100644 index 000000000000..17d2084ccf1c --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Stylesheet; + +public class TemplateDeletedWebhookEvent : WebhookEventBase +{ + public TemplateDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Template Deleted") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs new file mode 100644 index 000000000000..324bd11900e6 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Stylesheet; + +public class TemplateSavedWebhookEvent : WebhookEventBase +{ + public TemplateSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Template Saved") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 687a2573cc60..766c359455db 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -134,4 +134,14 @@ public WebhookEventCollectionBuilder AddStylesheetWebhooks() Append(); return this; } + + public WebhookEventCollectionBuilder AddTemplateWebhooks() + { + Append(); + Append(); + + Append(); + Append(); + return this; + } } From df1e2ed255d20a8ee0993e3e5b8256dd5e44916f Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 14:55:11 +0000 Subject: [PATCH 10/52] Adds script webhooks --- .../Script/ScriptDeletedWebhookEvent.cs | 19 +++++++++++++++++++ .../Events/Script/ScriptSavedWebhookEvent.cs | 19 +++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 8 ++++++++ 3 files changed, 46 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs new file mode 100644 index 000000000000..c425a4a06d05 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Script; + +public class ScriptDeletedWebhookEvent : WebhookEventBase +{ + public ScriptDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Script Deleted") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs new file mode 100644 index 000000000000..739cc8bd9710 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Script; + +public class ScriptSavedWebhookEvent : WebhookEventBase +{ + public ScriptSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Script Saved") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 766c359455db..34c495d5a935 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -9,6 +9,7 @@ using Umbraco.Cms.Core.Webhooks.Events.Domain; using Umbraco.Cms.Core.Webhooks.Events.Language; using Umbraco.Cms.Core.Webhooks.Events.Relation; +using Umbraco.Cms.Core.Webhooks.Events.Script; using Umbraco.Cms.Core.Webhooks.Events.Stylesheet; using Umbraco.Extensions; @@ -128,6 +129,13 @@ public WebhookEventCollectionBuilder AddRelationWebhooks() return this; } + public WebhookEventCollectionBuilder AddScriptWebhooks() + { + Append(); + Append(); + return this; + } + public WebhookEventCollectionBuilder AddStylesheetWebhooks() { Append(); From 6397b18ad45050dd132c9e2141fc97ab4a89e612 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 15:10:40 +0000 Subject: [PATCH 11/52] Namespace change as there are more media and content events/notifications --- .../Events/{Core => Content}/ContentDeleteWebhookEvent.cs | 2 +- .../Events/{Core => Content}/ContentPublishWebhookEvent.cs | 2 +- .../Events/{Core => Content}/ContentUnpublishWebhookEvent.cs | 2 +- .../Webhooks/Events/{Core => Media}/MediaDeleteWebhookEvent.cs | 2 +- .../Webhooks/Events/{Core => Media}/MediaSaveWebhookEvent.cs | 2 +- src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs | 3 ++- 6 files changed, 7 insertions(+), 6 deletions(-) rename src/Umbraco.Core/Webhooks/Events/{Core => Content}/ContentDeleteWebhookEvent.cs (95%) rename src/Umbraco.Core/Webhooks/Events/{Core => Content}/ContentPublishWebhookEvent.cs (97%) rename src/Umbraco.Core/Webhooks/Events/{Core => Content}/ContentUnpublishWebhookEvent.cs (95%) rename src/Umbraco.Core/Webhooks/Events/{Core => Media}/MediaDeleteWebhookEvent.cs (95%) rename src/Umbraco.Core/Webhooks/Events/{Core => Media}/MediaSaveWebhookEvent.cs (97%) diff --git a/src/Umbraco.Core/Webhooks/Events/Core/ContentDeleteWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeleteWebhookEvent.cs similarity index 95% rename from src/Umbraco.Core/Webhooks/Events/Core/ContentDeleteWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Content/ContentDeleteWebhookEvent.cs index 14db8fe51bb3..1209766af7cb 100644 --- a/src/Umbraco.Core/Webhooks/Events/Core/ContentDeleteWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeleteWebhookEvent.cs @@ -5,7 +5,7 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Core; +namespace Umbraco.Cms.Core.Webhooks.Events.Content; public class ContentDeleteWebhookEvent : WebhookEventContentBase { diff --git a/src/Umbraco.Core/Webhooks/Events/Core/ContentPublishWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentPublishWebhookEvent.cs similarity index 97% rename from src/Umbraco.Core/Webhooks/Events/Core/ContentPublishWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Content/ContentPublishWebhookEvent.cs index 4060178253a8..7f3ef7dbd046 100644 --- a/src/Umbraco.Core/Webhooks/Events/Core/ContentPublishWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentPublishWebhookEvent.cs @@ -8,7 +8,7 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Core; +namespace Umbraco.Cms.Core.Webhooks.Events.Content; public class ContentPublishWebhookEvent : WebhookEventContentBase { diff --git a/src/Umbraco.Core/Webhooks/Events/Core/ContentUnpublishWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishWebhookEvent.cs similarity index 95% rename from src/Umbraco.Core/Webhooks/Events/Core/ContentUnpublishWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishWebhookEvent.cs index f3c58a742425..864bbbfb4439 100644 --- a/src/Umbraco.Core/Webhooks/Events/Core/ContentUnpublishWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishWebhookEvent.cs @@ -5,7 +5,7 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Core; +namespace Umbraco.Cms.Core.Webhooks.Events.Content; public class ContentUnpublishWebhookEvent : WebhookEventContentBase { diff --git a/src/Umbraco.Core/Webhooks/Events/Core/MediaDeleteWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaDeleteWebhookEvent.cs similarity index 95% rename from src/Umbraco.Core/Webhooks/Events/Core/MediaDeleteWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Media/MediaDeleteWebhookEvent.cs index 4a012296d782..3d8e31b54102 100644 --- a/src/Umbraco.Core/Webhooks/Events/Core/MediaDeleteWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaDeleteWebhookEvent.cs @@ -5,7 +5,7 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Core; +namespace Umbraco.Cms.Core.Webhooks.Events.Media; public class MediaDeleteWebhookEvent : WebhookEventContentBase { diff --git a/src/Umbraco.Core/Webhooks/Events/Core/MediaSaveWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaSaveWebhookEvent.cs similarity index 97% rename from src/Umbraco.Core/Webhooks/Events/Core/MediaSaveWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Media/MediaSaveWebhookEvent.cs index a6f824f50416..3f531ce3161b 100644 --- a/src/Umbraco.Core/Webhooks/Events/Core/MediaSaveWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaSaveWebhookEvent.cs @@ -8,7 +8,7 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Core; +namespace Umbraco.Cms.Core.Webhooks.Events.Media; public class MediaSaveWebhookEvent : WebhookEventContentBase { diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 34c495d5a935..562be775cf3e 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -3,11 +3,12 @@ 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.Content; using Umbraco.Cms.Core.Webhooks.Events.DataType; using Umbraco.Cms.Core.Webhooks.Events.Dictionary; using Umbraco.Cms.Core.Webhooks.Events.Domain; using Umbraco.Cms.Core.Webhooks.Events.Language; +using Umbraco.Cms.Core.Webhooks.Events.Media; using Umbraco.Cms.Core.Webhooks.Events.Relation; using Umbraco.Cms.Core.Webhooks.Events.Script; using Umbraco.Cms.Core.Webhooks.Events.Stylesheet; From 98c255ab41583b384f8e09cfd81b59327033a2b1 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 15:36:07 +0000 Subject: [PATCH 12/52] Adds Package Webhook --- .../Package/ImportedPackageWebhookEvent.cs | 19 +++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 7 +++++++ 2 files changed, 26 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs new file mode 100644 index 000000000000..1171551c34a3 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Package; + +public class ImportedPackageWebhookEvent : WebhookEventBase +{ + public ImportedPackageWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Imported Package") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 562be775cf3e..1d4260e020bf 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -9,6 +9,7 @@ using Umbraco.Cms.Core.Webhooks.Events.Domain; using Umbraco.Cms.Core.Webhooks.Events.Language; using Umbraco.Cms.Core.Webhooks.Events.Media; +using Umbraco.Cms.Core.Webhooks.Events.Package; using Umbraco.Cms.Core.Webhooks.Events.Relation; using Umbraco.Cms.Core.Webhooks.Events.Script; using Umbraco.Cms.Core.Webhooks.Events.Stylesheet; @@ -120,6 +121,12 @@ public WebhookEventCollectionBuilder AddLanguageWebhooks() return this; } + public WebhookEventCollectionBuilder AddPackageWebhooks() + { + Append(); + return this; + } + public WebhookEventCollectionBuilder AddRelationWebhooks() { Append(); From 5ea95fb4a8e7a1d06b60605c66d298eb2c55c272 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 16:17:06 +0000 Subject: [PATCH 13/52] Adds Media WebHooks Note: Renames the existing Save & Delete to be Saved and Deleted to be inline with rest of WebHooks --- src/Umbraco.Core/Constants-WebhookEvents.cs | 8 ++++---- ...okEvent.cs => MediaDeletedWebhookEvent.cs} | 6 +++--- ...hookEvent.cs => MediaSavedWebhookEvent.cs} | 6 +++--- .../Media/MediaTypeChangedWebhookEvent.cs | 19 ++++++++++++++++++ .../Media/MediaTypeDeletedWebhookEvent.cs | 19 ++++++++++++++++++ .../Media/MediaTypeMovedWebhookEvent.cs | 19 ++++++++++++++++++ .../Media/MediaTypeSavedWebhookEvent.cs | 19 ++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 20 +++++++++++++++++-- .../Services/WebhookServiceTests.cs | 8 ++++---- 9 files changed, 108 insertions(+), 16 deletions(-) rename src/Umbraco.Core/Webhooks/Events/Media/{MediaDeleteWebhookEvent.cs => MediaDeletedWebhookEvent.cs} (82%) rename src/Umbraco.Core/Webhooks/Events/Media/{MediaSaveWebhookEvent.cs => MediaSavedWebhookEvent.cs} (90%) create mode 100644 src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs diff --git a/src/Umbraco.Core/Constants-WebhookEvents.cs b/src/Umbraco.Core/Constants-WebhookEvents.cs index 24fe8902212b..3a94872301cb 100644 --- a/src/Umbraco.Core/Constants-WebhookEvents.cs +++ b/src/Umbraco.Core/Constants-WebhookEvents.cs @@ -20,13 +20,13 @@ public static class WebhookEvents public const string ContentUnpublish = "ContentUnpublish"; /// - /// Webhook event name for media delete. + /// Webhook event name for media deleted. /// - public const string MediaDelete = "MediaDelete"; + public const string MediaDeleted = "Media Deleted"; /// - /// Webhook event name for media save. + /// Webhook event name for media saved. /// - public const string MediaSave = "MediaSave"; + public const string MediaSaved = "Media Saved"; } } diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaDeleteWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaDeletedWebhookEvent.cs similarity index 82% rename from src/Umbraco.Core/Webhooks/Events/Media/MediaDeleteWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Media/MediaDeletedWebhookEvent.cs index 3d8e31b54102..139a20171719 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaDeleteWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaDeletedWebhookEvent.cs @@ -7,9 +7,9 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Media; -public class MediaDeleteWebhookEvent : WebhookEventContentBase +public class MediaDeletedWebhookEvent : WebhookEventContentBase { - public MediaDeleteWebhookEvent( + public MediaDeletedWebhookEvent( IWebhookFiringService webhookFiringService, IWebHookService webHookService, IOptionsMonitor webhookSettings, @@ -19,7 +19,7 @@ public MediaDeleteWebhookEvent( webHookService, webhookSettings, serverRoleAccessor, - Constants.WebhookEvents.MediaDelete) + Constants.WebhookEvents.MediaDeleted) { } diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaSaveWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaSavedWebhookEvent.cs similarity index 90% rename from src/Umbraco.Core/Webhooks/Events/Media/MediaSaveWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Media/MediaSavedWebhookEvent.cs index 3f531ce3161b..44340edf7d86 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaSaveWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaSavedWebhookEvent.cs @@ -10,12 +10,12 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Media; -public class MediaSaveWebhookEvent : WebhookEventContentBase +public class MediaSavedWebhookEvent : WebhookEventContentBase { private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor; private readonly IApiMediaBuilder _apiMediaBuilder; - public MediaSaveWebhookEvent( + public MediaSavedWebhookEvent( IWebhookFiringService webhookFiringService, IWebHookService webHookService, IOptionsMonitor webhookSettings, @@ -27,7 +27,7 @@ public MediaSaveWebhookEvent( webHookService, webhookSettings, serverRoleAccessor, - Constants.WebhookEvents.MediaSave) + Constants.WebhookEvents.MediaSaved) { _publishedSnapshotAccessor = publishedSnapshotAccessor; _apiMediaBuilder = apiMediaBuilder; diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs new file mode 100644 index 000000000000..4fb8ae126be4 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Media; + +public class MediaTypeChangedWebhookEvent : WebhookEventBase +{ + public MediaTypeChangedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Media Type Changed") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs new file mode 100644 index 000000000000..02d105820cd9 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Media; + +public class MediaTypeDeletedWebhookEvent : WebhookEventBase +{ + public MediaTypeDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Media Type Deleted") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs new file mode 100644 index 000000000000..7aa5b3daf875 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Media; + +public class MediaTypeMovedWebhookEvent : WebhookEventBase +{ + public MediaTypeMovedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Media Type Moved") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs new file mode 100644 index 000000000000..2022ff311403 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs @@ -0,0 +1,19 @@ +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.Media; + +public class MediaTypeSavedWebhookEvent : WebhookEventBase +{ + public MediaTypeSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Media Type Saved") + { + } +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 1d4260e020bf..681daf6a3a8a 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -87,8 +87,8 @@ public WebhookEventCollectionBuilder AddCoreWebhooks() Append(); Append(); Append(); - Append(); - Append(); + Append(); + Append(); return this; } @@ -121,6 +121,22 @@ public WebhookEventCollectionBuilder AddLanguageWebhooks() return this; } + public WebhookEventCollectionBuilder AddMediaWebhooks() + { + // Even though these two are in the AddCoreWebhooks() + // The job of the CollectionBuilder should be removing duplicates + // Would allow someone to use .AddCoreWebhooks().AddMediaWebhooks() + // Or if they explicitly they could skip over CoreWebHooks and just add this perhaps + Append(); + Append(); + + Append(); + Append(); + Append(); + Append(); + return this; + } + public WebhookEventCollectionBuilder AddPackageWebhooks() { Append(); diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookServiceTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookServiceTests.cs index 6f6da744852d..43d546bd8d9f 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookServiceTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/Services/WebhookServiceTests.cs @@ -17,8 +17,8 @@ public class WebhookServiceTests : UmbracoIntegrationTest [TestCase("https://example.com", Constants.WebhookEvents.ContentPublish, "00000000-0000-0000-0000-010000000000")] [TestCase("https://example.com", Constants.WebhookEvents.ContentDelete, "00000000-0000-0000-0000-000200000000")] [TestCase("https://example.com", Constants.WebhookEvents.ContentUnpublish, "00000000-0000-0000-0000-300000000000")] - [TestCase("https://example.com", Constants.WebhookEvents.MediaDelete, "00000000-0000-0000-0000-000004000000")] - [TestCase("https://example.com", Constants.WebhookEvents.MediaSave, "00000000-0000-0000-0000-000000500000")] + [TestCase("https://example.com", Constants.WebhookEvents.MediaDeleted, "00000000-0000-0000-0000-000004000000")] + [TestCase("https://example.com", Constants.WebhookEvents.MediaSaved, "00000000-0000-0000-0000-000000500000")] public async Task Can_Create_And_Get(string url, string webhookEvent, Guid key) { var createdWebhook = await WebhookService.CreateAsync(new Webhook(url, true, new[] { key }, new[] { webhookEvent })); @@ -55,8 +55,8 @@ public async Task Can_Get_All() [TestCase("https://example.com", Constants.WebhookEvents.ContentPublish, "00000000-0000-0000-0000-010000000000")] [TestCase("https://example.com", Constants.WebhookEvents.ContentDelete, "00000000-0000-0000-0000-000200000000")] [TestCase("https://example.com", Constants.WebhookEvents.ContentUnpublish, "00000000-0000-0000-0000-300000000000")] - [TestCase("https://example.com", Constants.WebhookEvents.MediaDelete, "00000000-0000-0000-0000-000004000000")] - [TestCase("https://example.com", Constants.WebhookEvents.MediaSave, "00000000-0000-0000-0000-000000500000")] + [TestCase("https://example.com", Constants.WebhookEvents.MediaDeleted, "00000000-0000-0000-0000-000004000000")] + [TestCase("https://example.com", Constants.WebhookEvents.MediaSaved, "00000000-0000-0000-0000-000000500000")] public async Task Can_Delete(string url, string webhookEvent, Guid key) { var createdWebhook = await WebhookService.CreateAsync(new Webhook(url, true, new[] { key }, new[] { webhookEvent })); From 819c10812471dd594734fd2d2aaf888ea4e29552 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 7 Nov 2023 16:25:49 +0000 Subject: [PATCH 14/52] Adds more Media Webhooks --- .../MediaEmptiedRecycleBinWebhookEvent.cs | 29 +++++++++++++++++++ .../MediaMovedToRecycleBinWebhookEvent.cs | 29 +++++++++++++++++++ .../Media/MediaMovedWebHookNotification.cs | 29 +++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 4 +++ 4 files changed, 91 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Media/MediaMovedToRecycleBinWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebHookNotification.cs diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs new file mode 100644 index 000000000000..4faf34d7a9dd --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs @@ -0,0 +1,29 @@ +using Microsoft.Extensions.Options; +using Umbraco.Cms.Core.Configuration.Models; +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Notifications; +using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Sync; + +namespace Umbraco.Cms.Core.Webhooks.Events.Media; + +public class MediaEmptiedRecycleBinWebhookEvent : WebhookEventContentBase +{ + public MediaEmptiedRecycleBinWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base( + webhookFiringService, + webHookService, + webhookSettings, + serverRoleAccessor, + "Media Emptied Recycle Bin") + { + } + + protected override IEnumerable GetEntitiesFromNotification(MediaEmptiedRecycleBinNotification notification) => notification.DeletedEntities; + + protected override object ConvertEntityToRequestPayload(IMedia entity) => new DefaultPayloadModel { Id = entity.Key }; +} diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedToRecycleBinWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedToRecycleBinWebhookEvent.cs new file mode 100644 index 000000000000..945c045a9bce --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedToRecycleBinWebhookEvent.cs @@ -0,0 +1,29 @@ +using Microsoft.Extensions.Options; +using Umbraco.Cms.Core.Configuration.Models; +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Notifications; +using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Sync; + +namespace Umbraco.Cms.Core.Webhooks.Events.Media; + +public class MediaMovedToRecycleBinWebhookEvent : WebhookEventContentBase +{ + public MediaMovedToRecycleBinWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base( + webhookFiringService, + webHookService, + webhookSettings, + serverRoleAccessor, + "Media Moved to Recycle Bin") + { + } + + protected override IEnumerable GetEntitiesFromNotification(MediaMovedToRecycleBinNotification notification) => notification.MoveInfoCollection.Select(x => x.Entity); + + protected override object ConvertEntityToRequestPayload(IMedia entity) => new DefaultPayloadModel { Id = entity.Key }; +} diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebHookNotification.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebHookNotification.cs new file mode 100644 index 000000000000..4945f5fa11fe --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebHookNotification.cs @@ -0,0 +1,29 @@ +using Microsoft.Extensions.Options; +using Umbraco.Cms.Core.Configuration.Models; +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Notifications; +using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Sync; + +namespace Umbraco.Cms.Core.Webhooks.Events.Media; + +public class MediaMovedWebhookEvent : WebhookEventContentBase +{ + public MediaMovedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebHookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base( + webhookFiringService, + webHookService, + webhookSettings, + serverRoleAccessor, + "Media Moved") + { + } + + protected override IEnumerable GetEntitiesFromNotification(MediaMovedNotification notification) => notification.MoveInfoCollection.Select(x => x.Entity); + + protected override object ConvertEntityToRequestPayload(IMedia entity) => new DefaultPayloadModel { Id = entity.Key }; +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 681daf6a3a8a..564e8b933b74 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -130,6 +130,10 @@ public WebhookEventCollectionBuilder AddMediaWebhooks() Append(); Append(); + Append(); + Append(); + Append(); + Append(); Append(); Append(); From 642bad81c55d18c0efad4f23aa152a41962ca494 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Thu, 9 Nov 2023 20:41:54 +0000 Subject: [PATCH 15/52] WIP: Updates to changes made in dev branch Just so I can move from main computer to laptop to carry on some hacking for now :) --- .../Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs | 5 ++++- .../Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs | 5 ++++- .../Events/Dictionary/DictionaryItemSavedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Domain/DomainSavedWebhookEvent.cs | 5 ++++- 7 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs index 2238a803a9e6..1bd49d1cd994 100644 --- a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.DataType; +[WebhookEvent("DataType Deleted")] public class DataTypeDeletedWebhookEvent : WebhookEventBase { public DataTypeDeletedWebhookEvent( @@ -13,7 +14,9 @@ public DataTypeDeletedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "DataType Deleted") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "dataTypeDeleted"; } diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs index 714b595f8585..18e9689f19f7 100644 --- a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.DataType; +[WebhookEvent("DataType Moved")] public class DataTypeMovedWebhookEvent : WebhookEventBase { public DataTypeMovedWebhookEvent( @@ -13,7 +14,9 @@ public DataTypeMovedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "DataType Moved") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "dataTypeMoved"; } diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs index 0c24784646c1..4fd0d046c383 100644 --- a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.DataType; +[WebhookEvent("DataType Saved")] public class DataTypeSavedWebhookEvent : WebhookEventBase { public DataTypeSavedWebhookEvent( @@ -13,7 +14,9 @@ public DataTypeSavedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "DataType Saved") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "dataTypeSaved"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs index 623ae86a3cce..643b3b4edfb3 100644 --- a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Dictionary; +[WebhookEvent("Dictionary Item Deleted")] public class DictionaryItemDeletedWebhookEvent : WebhookEventBase { public DictionaryItemDeletedWebhookEvent( @@ -13,7 +14,9 @@ public DictionaryItemDeletedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Dictionary Item Deleted") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "dictionaryItemDeleted"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs index 3488cb0238ef..b38003486efa 100644 --- a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Dictionary; +[WebhookEvent("Dictionary Item Saved")] public class DictionaryItemSavedWebhookEvent : WebhookEventBase { public DictionaryItemSavedWebhookEvent( @@ -13,7 +14,9 @@ public DictionaryItemSavedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Dictionary Item Saved") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "dictionaryItemSaved"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs index 31a9bfcaf279..427d7711c369 100644 --- a/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Domain; +[WebhookEvent("Domain Deleted")] public class DomainDeletedWebhookEvent : WebhookEventBase { public DomainDeletedWebhookEvent( @@ -13,7 +14,9 @@ public DomainDeletedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Domain Deleted") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "domainDeleted"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs index 6b40f16d3da3..52a72de3a1d4 100644 --- a/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Domain; +[WebhookEvent("Domain Saved")] public class DomainSavedWebhookEvent : WebhookEventBase { public DomainSavedWebhookEvent( @@ -13,7 +14,9 @@ public DomainSavedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Domain Saved") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "domainSaved"; } From a6e668ab59bc133c81c98532d0f0b9bb6d556e93 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Fri, 10 Nov 2023 16:45:58 +0000 Subject: [PATCH 16/52] Update existing Webhooks to use the new attribute --- .../Webhooks/Events/Content/ContentDeleteWebhookEvent.cs | 2 +- .../Webhooks/Events/Content/ContentPublishWebhookEvent.cs | 2 +- .../Webhooks/Events/Content/ContentUnpublishWebhookEvent.cs | 2 +- .../Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Language/LanguageSavedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Media/MediaDeletedWebhookEvent.cs | 6 +++--- .../Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs | 6 ++++-- .../Events/Media/MediaMovedToRecycleBinWebhookEvent.cs | 6 ++++-- ...ovedWebHookNotification.cs => MediaMovedWebhookEvent.cs} | 6 ++++-- .../Webhooks/Events/Media/MediaSavedWebhookEvent.cs | 6 +++--- .../Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Package/ImportedPackageWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Relation/RelationSavedWebhookEvent.cs | 5 ++++- .../Events/Relation/RelationTypeDeletedWebhookEvent.cs | 6 +++++- .../Events/Relation/RelationTypeSavedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Script/ScriptSavedWebhookEvent.cs | 5 ++++- .../Events/Stylesheet/StylesheetDeletedWebhookEvent.cs | 5 ++++- .../Events/Stylesheet/StylesheetSavedWebhookEvent.cs | 5 ++++- .../Events/Template/PartialViewDeletedWebhookEvent.cs | 5 ++++- .../Events/Template/PartialViewSavedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs | 5 ++++- .../Webhooks/Events/Template/TemplateSavedWebhookEvent.cs | 5 ++++- 27 files changed, 98 insertions(+), 34 deletions(-) rename src/Umbraco.Core/Webhooks/Events/Media/{MediaMovedWebHookNotification.cs => MediaMovedWebhookEvent.cs} (87%) diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentDeleteWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeleteWebhookEvent.cs index 6f7d4039f0b0..e1dc5d88a9d6 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentDeleteWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeleteWebhookEvent.cs @@ -7,7 +7,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Content; -[WebhookEvent("Content was deleted", Constants.WebhookEvents.Types.Content)] +[WebhookEvent("Content Deleted", Constants.WebhookEvents.Types.Content)] public class ContentDeleteWebhookEvent : WebhookEventContentBase { public ContentDeleteWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentPublishWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentPublishWebhookEvent.cs index 669b164a7081..8ce523810287 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentPublishWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentPublishWebhookEvent.cs @@ -10,7 +10,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Content; -[WebhookEvent("Content was published", Constants.WebhookEvents.Types.Content)] +[WebhookEvent("Content Published", Constants.WebhookEvents.Types.Content)] public class ContentPublishWebhookEvent : WebhookEventContentBase { private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor; diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishWebhookEvent.cs index 0e57916f8cf9..1bf303160a68 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishWebhookEvent.cs @@ -7,7 +7,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Content; -[WebhookEvent("Content was unpublished", Constants.WebhookEvents.Types.Content)] +[WebhookEvent("Content Unpublished", Constants.WebhookEvents.Types.Content)] public class ContentUnpublishWebhookEvent : WebhookEventContentBase { public ContentUnpublishWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs index 045aa15fae2f..fb283d239f41 100644 --- a/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Language; +[WebhookEvent("Language Deleted")] public class LanguageDeletedWebhookEvent : WebhookEventBase { public LanguageDeletedWebhookEvent( @@ -13,7 +14,9 @@ public LanguageDeletedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Language Deleted") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "languageDeleted"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs index 630cd8dcf557..f3ffcdd63cee 100644 --- a/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Language; +[WebhookEvent("Language Saved")] public class LanguageSavedWebhookEvent : WebhookEventBase { public LanguageSavedWebhookEvent( @@ -13,7 +14,9 @@ public LanguageSavedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Language Saved") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "languageSaved"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaDeletedWebhookEvent.cs index ab0fd98942e1..b372f4dc2c77 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaDeletedWebhookEvent.cs @@ -7,10 +7,10 @@ namespace Umbraco.Cms.Core.Webhooks.Events; -[WebhookEvent("Media was deleted", Constants.WebhookEvents.Types.Media)] -public class MediaDeleteWebhookEvent : WebhookEventContentBase +[WebhookEvent("Media Deleted", Constants.WebhookEvents.Types.Media)] +public class MediaDeletedWebhookEvent : WebhookEventContentBase { - public MediaDeleteWebhookEvent( + public MediaDeletedWebhookEvent( IWebhookFiringService webhookFiringService, IWebHookService webHookService, IOptionsMonitor webhookSettings, diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs index 4faf34d7a9dd..919e2d063cbf 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs @@ -7,6 +7,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Media; +[WebhookEvent("Media Recycle Bin Emptied", Constants.WebhookEvents.Types.Media)] public class MediaEmptiedRecycleBinWebhookEvent : WebhookEventContentBase { public MediaEmptiedRecycleBinWebhookEvent( @@ -18,11 +19,12 @@ public MediaEmptiedRecycleBinWebhookEvent( webhookFiringService, webHookService, webhookSettings, - serverRoleAccessor, - "Media Emptied Recycle Bin") + serverRoleAccessor) { } + public override string Alias => "mediaEmptiedRecycleBin"; + protected override IEnumerable GetEntitiesFromNotification(MediaEmptiedRecycleBinNotification notification) => notification.DeletedEntities; protected override object ConvertEntityToRequestPayload(IMedia entity) => new DefaultPayloadModel { Id = entity.Key }; diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedToRecycleBinWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedToRecycleBinWebhookEvent.cs index 945c045a9bce..2894ec87919f 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedToRecycleBinWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedToRecycleBinWebhookEvent.cs @@ -7,6 +7,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Media; +[WebhookEvent("Media Moved to Recycle Bin", Constants.WebhookEvents.Types.Media)] public class MediaMovedToRecycleBinWebhookEvent : WebhookEventContentBase { public MediaMovedToRecycleBinWebhookEvent( @@ -18,11 +19,12 @@ public MediaMovedToRecycleBinWebhookEvent( webhookFiringService, webHookService, webhookSettings, - serverRoleAccessor, - "Media Moved to Recycle Bin") + serverRoleAccessor) { } + public override string Alias => "mediaMovedToRecycleBin"; + protected override IEnumerable GetEntitiesFromNotification(MediaMovedToRecycleBinNotification notification) => notification.MoveInfoCollection.Select(x => x.Entity); protected override object ConvertEntityToRequestPayload(IMedia entity) => new DefaultPayloadModel { Id = entity.Key }; diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebHookNotification.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebhookEvent.cs similarity index 87% rename from src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebHookNotification.cs rename to src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebhookEvent.cs index 4945f5fa11fe..eb06d3e1dabf 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebHookNotification.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebhookEvent.cs @@ -7,6 +7,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Media; +[WebhookEvent("Media Moved", Constants.WebhookEvents.Types.Media)] public class MediaMovedWebhookEvent : WebhookEventContentBase { public MediaMovedWebhookEvent( @@ -18,11 +19,12 @@ public MediaMovedWebhookEvent( webhookFiringService, webHookService, webhookSettings, - serverRoleAccessor, - "Media Moved") + serverRoleAccessor) { } + public override string Alias => "mediaMoved"; + protected override IEnumerable GetEntitiesFromNotification(MediaMovedNotification notification) => notification.MoveInfoCollection.Select(x => x.Entity); protected override object ConvertEntityToRequestPayload(IMedia entity) => new DefaultPayloadModel { Id = entity.Key }; diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaSavedWebhookEvent.cs index 6907067b878d..a5b1717e81cd 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaSavedWebhookEvent.cs @@ -10,13 +10,13 @@ namespace Umbraco.Cms.Core.Webhooks.Events; -[WebhookEvent("Media was saved", Constants.WebhookEvents.Types.Media)] -public class MediaSaveWebhookEvent : WebhookEventContentBase +[WebhookEvent("Media Saved", Constants.WebhookEvents.Types.Media)] +public class MediaSavedWebhookEvent : WebhookEventContentBase { private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor; private readonly IApiMediaBuilder _apiMediaBuilder; - public MediaSaveWebhookEvent( + public MediaSavedWebhookEvent( IWebhookFiringService webhookFiringService, IWebHookService webHookService, IOptionsMonitor webhookSettings, diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs index 4fb8ae126be4..7f60ba6fe7a1 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Media; +[WebhookEvent("Media Type Changed")] public class MediaTypeChangedWebhookEvent : WebhookEventBase { public MediaTypeChangedWebhookEvent( @@ -13,7 +14,9 @@ public MediaTypeChangedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Media Type Changed") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "mediaTypeChanged"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs index 02d105820cd9..6a87992ddfbd 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Media; +[WebhookEvent("Media Type Deleted")] public class MediaTypeDeletedWebhookEvent : WebhookEventBase { public MediaTypeDeletedWebhookEvent( @@ -13,7 +14,9 @@ public MediaTypeDeletedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Media Type Deleted") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "mediaTypeDeleted"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs index 7aa5b3daf875..9a516fcbe6b6 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Media; +[WebhookEvent("Media Type Moved")] public class MediaTypeMovedWebhookEvent : WebhookEventBase { public MediaTypeMovedWebhookEvent( @@ -13,7 +14,9 @@ public MediaTypeMovedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Media Type Moved") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "mediaTypeMoved"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs index 2022ff311403..2c573a6f7656 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Media; +[WebhookEvent("Media Type Saved")] public class MediaTypeSavedWebhookEvent : WebhookEventBase { public MediaTypeSavedWebhookEvent( @@ -13,7 +14,9 @@ public MediaTypeSavedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Media Type Saved") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "mediaTypeSaved"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs index 1171551c34a3..8666402af11a 100644 --- a/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Package; +[WebhookEvent("Imported Package")] public class ImportedPackageWebhookEvent : WebhookEventBase { public ImportedPackageWebhookEvent( @@ -13,7 +14,9 @@ public ImportedPackageWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Imported Package") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "importedPackage"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs index c2755873f3d1..a47d93ee8129 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Relation; +[WebhookEvent("Relation Deleted")] public class RelationDeletedWebhookEvent : WebhookEventBase { public RelationDeletedWebhookEvent( @@ -13,7 +14,9 @@ public RelationDeletedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Relation Deleted") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "relationDeleted"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs index 2af50880f970..86f9fa4b12bb 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Relation; +[WebhookEvent("Relation Saved")] public class RelationSavedWebhookEvent : WebhookEventBase { public RelationSavedWebhookEvent( @@ -13,7 +14,9 @@ public RelationSavedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Relation Saved") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "relationSaved"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs index ea905e83f193..4fffdd929929 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Relation; +[WebhookEvent("Relation Type Deleted")] public class RelationTypeDeletedWebhookEvent : WebhookEventBase { public RelationTypeDeletedWebhookEvent( @@ -13,7 +14,10 @@ public RelationTypeDeletedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Relation Item Deleted") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + + public override string Alias => "relationTypeDeleted"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs index d88b27d351aa..0e2ceed7c0e8 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Relation; +[WebhookEvent("Relation Type Saved")] public class RelationTypeSavedWebhookEvent : WebhookEventBase { public RelationTypeSavedWebhookEvent( @@ -13,7 +14,9 @@ public RelationTypeSavedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Relation Item Saved") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "relationTypeSaved"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs index c425a4a06d05..26b0b3eb20aa 100644 --- a/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Script; +[WebhookEvent("Script Deleted")] public class ScriptDeletedWebhookEvent : WebhookEventBase { public ScriptDeletedWebhookEvent( @@ -13,7 +14,9 @@ public ScriptDeletedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Script Deleted") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "scriptDeleted"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs index 739cc8bd9710..f81af33e758b 100644 --- a/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Script; +[WebhookEvent("Script Saved")] public class ScriptSavedWebhookEvent : WebhookEventBase { public ScriptSavedWebhookEvent( @@ -13,7 +14,9 @@ public ScriptSavedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Script Saved") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "scriptSaved"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs index beed9becd05a..a93844c05c32 100644 --- a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Stylesheet; +[WebhookEvent("Stylesheet Deleted")] public class StylesheetDeletedWebhookEvent : WebhookEventBase { public StylesheetDeletedWebhookEvent( @@ -13,7 +14,9 @@ public StylesheetDeletedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Stylesheet Deleted") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "stylesheetDeleted"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs index 2b916b1b2628..58098f42c3b7 100644 --- a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Stylesheet; +[WebhookEvent("Stylesheet Saved")] public class StylesheetSavedWebhookEvent : WebhookEventBase { public StylesheetSavedWebhookEvent( @@ -13,7 +14,9 @@ public StylesheetSavedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Stylesheet Saved") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "stylesheetSaved"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs index 5e094b8c2f0e..a6d5f90e2bca 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Stylesheet; +[WebhookEvent("Partial View Deleted")] public class PartialViewDeletedWebhookEvent : WebhookEventBase { public PartialViewDeletedWebhookEvent( @@ -13,7 +14,9 @@ public PartialViewDeletedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Partial View Deleted") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "partialViewDeleted"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs index ee1304d9726b..6fa231d6c14e 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Stylesheet; +[WebhookEvent("Partial View Saved")] public class PartialViewSavedWebhookEvent : WebhookEventBase { public PartialViewSavedWebhookEvent( @@ -13,7 +14,9 @@ public PartialViewSavedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Partial View Saved") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "partialViewSaved"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs index 17d2084ccf1c..4a2a7aca92da 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Stylesheet; +[WebhookEvent("Template Deleted")] public class TemplateDeletedWebhookEvent : WebhookEventBase { public TemplateDeletedWebhookEvent( @@ -13,7 +14,9 @@ public TemplateDeletedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Template Deleted") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "templateDeleted"; } diff --git a/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs index 324bd11900e6..6bff029bf094 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs @@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Stylesheet; +[WebhookEvent("Template Saved")] public class TemplateSavedWebhookEvent : WebhookEventBase { public TemplateSavedWebhookEvent( @@ -13,7 +14,9 @@ public TemplateSavedWebhookEvent( IWebHookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) - : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor, "Template Saved") + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) { } + + public override string Alias => "templateSaved"; } From 5187649aef9b39fc51bcafc24040f27e933b4ced Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Fri, 10 Nov 2023 16:59:05 +0000 Subject: [PATCH 17/52] After merge - fixes the change from IWebHookService to IWebhookService Note the casing change --- .../Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs | 2 +- .../Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs | 2 +- .../Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs | 2 +- .../Events/Dictionary/DictionaryItemSavedWebhookEvent.cs | 2 +- .../Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/Domain/DomainSavedWebhookEvent.cs | 2 +- .../Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/Language/LanguageSavedWebhookEvent.cs | 3 ++- .../Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs | 2 +- .../Events/Media/MediaMovedToRecycleBinWebhookEvent.cs | 2 +- .../Webhooks/Events/Media/MediaMovedWebhookEvent.cs | 2 +- .../Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs | 2 +- .../Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs | 2 +- .../Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs | 2 +- .../Webhooks/Events/Package/ImportedPackageWebhookEvent.cs | 2 +- .../Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/Relation/RelationSavedWebhookEvent.cs | 2 +- .../Events/Relation/RelationTypeDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs | 2 +- .../Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/Script/ScriptSavedWebhookEvent.cs | 2 +- .../Events/Stylesheet/StylesheetDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs | 2 +- .../Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs | 2 +- .../Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/Template/TemplateSavedWebhookEvent.cs | 2 +- 29 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs index 1bd49d1cd994..1de8d78a4ca5 100644 --- a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs @@ -11,7 +11,7 @@ public class DataTypeDeletedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs index 18e9689f19f7..d828c7b065b6 100644 --- a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs @@ -11,7 +11,7 @@ public class DataTypeMovedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs index 4fd0d046c383..0f52a1709043 100644 --- a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs @@ -11,7 +11,7 @@ public class DataTypeSavedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs index 643b3b4edfb3..bd0cb9fcb6ff 100644 --- a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs @@ -11,7 +11,7 @@ public class DictionaryItemDeletedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs index b38003486efa..9f2ac820137e 100644 --- a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs @@ -11,7 +11,7 @@ public class DictionaryItemSavedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs index 427d7711c369..873b4bc2a9a6 100644 --- a/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs @@ -11,7 +11,7 @@ public class DomainDeletedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs index 52a72de3a1d4..f68e9cc1d2aa 100644 --- a/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs @@ -11,7 +11,7 @@ public class DomainSavedWebhookEvent : WebhookEventBase { public DomainSavedWebhookEvent( IWebhookFiringService webhookFiringService, - IWebHookService webHookService, + IWebhookService webHookService, IOptionsMonitor webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs index fb283d239f41..f1db8d74ac3d 100644 --- a/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs @@ -11,7 +11,7 @@ public class LanguageDeletedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs index f3ffcdd63cee..fbf1a3c2e9ed 100644 --- a/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs @@ -11,7 +11,7 @@ public class LanguageSavedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) @@ -20,3 +20,4 @@ public LanguageSavedWebhookEvent( public override string Alias => "languageSaved"; } + diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs index 919e2d063cbf..29d0e44e4623 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaEmptiedRecycleBinWebhookEvent.cs @@ -12,7 +12,7 @@ public class MediaEmptiedRecycleBinWebhookEvent : WebhookEventContentBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base( diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedToRecycleBinWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedToRecycleBinWebhookEvent.cs index 2894ec87919f..1bd05c6d7b03 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedToRecycleBinWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedToRecycleBinWebhookEvent.cs @@ -12,7 +12,7 @@ public class MediaMovedToRecycleBinWebhookEvent : WebhookEventContentBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base( diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebhookEvent.cs index eb06d3e1dabf..60b235f4cc63 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaMovedWebhookEvent.cs @@ -12,7 +12,7 @@ public class MediaMovedWebhookEvent : WebhookEventContentBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base( diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs index 7f60ba6fe7a1..175559e1ec8d 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs @@ -11,7 +11,7 @@ public class MediaTypeChangedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs index 6a87992ddfbd..9cc85cca1919 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs @@ -11,7 +11,7 @@ public class MediaTypeDeletedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs index 9a516fcbe6b6..8a9d0b8a4560 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs @@ -11,7 +11,7 @@ public class MediaTypeMovedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs index 2c573a6f7656..6b421031264a 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs @@ -11,7 +11,7 @@ public class MediaTypeSavedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs index 8666402af11a..b629ce394962 100644 --- a/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs @@ -11,7 +11,7 @@ public class ImportedPackageWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs index a47d93ee8129..6c2de75caa05 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs @@ -11,7 +11,7 @@ public class RelationDeletedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs index 86f9fa4b12bb..dd385b46451e 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs @@ -11,7 +11,7 @@ public class RelationSavedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs index 4fffdd929929..e7c63e5f8556 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs @@ -11,7 +11,7 @@ public class RelationTypeDeletedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs index 0e2ceed7c0e8..ce065b0a6d8b 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs @@ -11,7 +11,7 @@ public class RelationTypeSavedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs index 26b0b3eb20aa..5619d8728d77 100644 --- a/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs @@ -11,7 +11,7 @@ public class ScriptDeletedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs index f81af33e758b..bd18f218bdc6 100644 --- a/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs @@ -11,7 +11,7 @@ public class ScriptSavedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs index a93844c05c32..f17acf93b37d 100644 --- a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs @@ -11,7 +11,7 @@ public class StylesheetDeletedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs index 58098f42c3b7..16a65ec485a2 100644 --- a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs @@ -11,7 +11,7 @@ public class StylesheetSavedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs index a6d5f90e2bca..d94f5b31fd4c 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs @@ -11,7 +11,7 @@ public class PartialViewDeletedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs index 6fa231d6c14e..14176b958729 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs @@ -11,7 +11,7 @@ public class PartialViewSavedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs index 4a2a7aca92da..73334d13b339 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs @@ -11,7 +11,7 @@ public class TemplateDeletedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) diff --git a/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs index 6bff029bf094..5954be188a50 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs @@ -11,7 +11,7 @@ public class TemplateSavedWebhookEvent : WebhookEventBase webhookSettings, IServerRoleAccessor serverRoleAccessor) : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) From 0ac1595af0992c057f99e5a884c89e3dd8179e71 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Mon, 13 Nov 2023 12:25:04 +0000 Subject: [PATCH 18/52] Rename to align with the name of underlying Notification --- ...tDeleteWebhookEvent.cs => ContentDeletedWebhookEvent.cs} | 4 ++-- ...blishWebhookEvent.cs => ContentPublishedWebhookEvent.cs} | 4 ++-- ...ishWebhookEvent.cs => ContentUnpublishedWebhookEvent.cs} | 4 ++-- src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) rename src/Umbraco.Core/Webhooks/Events/Content/{ContentDeleteWebhookEvent.cs => ContentDeletedWebhookEvent.cs} (88%) rename src/Umbraco.Core/Webhooks/Events/Content/{ContentPublishWebhookEvent.cs => ContentPublishedWebhookEvent.cs} (92%) rename src/Umbraco.Core/Webhooks/Events/Content/{ContentUnpublishWebhookEvent.cs => ContentUnpublishedWebhookEvent.cs} (87%) diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentDeleteWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedWebhookEvent.cs similarity index 88% rename from src/Umbraco.Core/Webhooks/Events/Content/ContentDeleteWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedWebhookEvent.cs index df1c2512cc6d..128282299566 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentDeleteWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedWebhookEvent.cs @@ -8,9 +8,9 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Content; [WebhookEvent("Content Deleted", Constants.WebhookEvents.Types.Content)] -public class ContentDeleteWebhookEvent : WebhookEventContentBase +public class ContentDeletedWebhookEvent : WebhookEventContentBase { - public ContentDeleteWebhookEvent( + public ContentDeletedWebhookEvent( IWebhookFiringService webhookFiringService, IWebhookService webhookService, IOptionsMonitor webhookSettings, diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentPublishWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentPublishedWebhookEvent.cs similarity index 92% rename from src/Umbraco.Core/Webhooks/Events/Content/ContentPublishWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Content/ContentPublishedWebhookEvent.cs index 6c0b6b92722b..5847fb450e6c 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentPublishWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentPublishedWebhookEvent.cs @@ -11,12 +11,12 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Content; [WebhookEvent("Content Published", Constants.WebhookEvents.Types.Content)] -public class ContentPublishWebhookEvent : WebhookEventContentBase +public class ContentPublishedWebhookEvent : WebhookEventContentBase { private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor; private readonly IApiContentBuilder _apiContentBuilder; - public ContentPublishWebhookEvent( + public ContentPublishedWebhookEvent( IWebhookFiringService webhookFiringService, IWebhookService webhookService, IOptionsMonitor webhookSettings, diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishedWebhookEvent.cs similarity index 87% rename from src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishedWebhookEvent.cs index ff42895577bd..81245f9b75b2 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishedWebhookEvent.cs @@ -8,9 +8,9 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Content; [WebhookEvent("Content Unpublished", Constants.WebhookEvents.Types.Content)] -public class ContentUnpublishWebhookEvent : WebhookEventContentBase +public class ContentUnpublishedWebhookEvent : WebhookEventContentBase { - public ContentUnpublishWebhookEvent( + public ContentUnpublishedWebhookEvent( IWebhookFiringService webhookFiringService, IWebhookService webhookService, IOptionsMonitor webhookSettings, diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 564e8b933b74..77ef57279aff 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -84,9 +84,9 @@ private void RegisterTypes(IServiceCollection services) public WebhookEventCollectionBuilder AddCoreWebhooks() { - Append(); - Append(); - Append(); + Append(); + Append(); + Append(); Append(); Append(); return this; From a4c0f7c160d1dfb01a5c76a560eddbb1d81dbddc Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Mon, 13 Nov 2023 16:22:36 +0000 Subject: [PATCH 19/52] Adds a couple more Webhook events - Content Saved, Rolled Back and Emptied Recycle Bin --- src/Umbraco.Core/Constants-WebhookEvents.cs | 15 ++++++ .../ContentEmptiedRecycleBinWebhookEvent.cs | 51 ++++++++++++++++++ .../Events/Content/ContentRolledBack.cs | 52 +++++++++++++++++++ .../Content/ContentSavedWebhookEvent.cs | 52 +++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 11 ++++ 5 files changed, 181 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Content/ContentRolledBack.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Content/ContentSavedWebhookEvent.cs diff --git a/src/Umbraco.Core/Constants-WebhookEvents.cs b/src/Umbraco.Core/Constants-WebhookEvents.cs index afd57b5188ef..d65e5d36406e 100644 --- a/src/Umbraco.Core/Constants-WebhookEvents.cs +++ b/src/Umbraco.Core/Constants-WebhookEvents.cs @@ -6,6 +6,21 @@ public static class WebhookEvents { public static class Aliases { + /// + /// Webhook event alias for content emptied recycle bin. + /// + public const string ContentEmptiedRecycleBin = "Umbraco.ContentEmptiedRecycleBin"; + + /// + /// Webhook event alias for content rolled back. + /// + public const string ContentRolledBack = "Umbraco.ContentRolledBack"; + + /// + /// Webhook event alias for content saved. + /// + public const string ContentSaved = "Umbraco.ContentSaved"; + /// /// Webhook event alias for content publish. /// diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs new file mode 100644 index 000000000000..fd1d713ffcd9 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs @@ -0,0 +1,51 @@ +using Microsoft.Extensions.Options; +using Umbraco.Cms.Core.Configuration.Models; +using Umbraco.Cms.Core.DeliveryApi; +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.Notifications; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Sync; + +namespace Umbraco.Cms.Core.Webhooks.Events.Content; + +[WebhookEvent("Content Emptied Recycle Bin", Constants.WebhookEvents.Types.Content)] +public class ContentEmptiedRecycleBinWebhookEvent : WebhookEventContentBase +{ + private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor; + private readonly IApiContentBuilder _apiContentBuilder; + + public ContentEmptiedRecycleBinWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webhookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor, + IPublishedSnapshotAccessor publishedSnapshotAccessor, + IApiContentBuilder apiContentBuilder) + : base( + webhookFiringService, + webhookService, + webhookSettings, + serverRoleAccessor) + { + _publishedSnapshotAccessor = publishedSnapshotAccessor; + _apiContentBuilder = apiContentBuilder; + } + + public override string Alias => Constants.WebhookEvents.Aliases.ContentEmptiedRecycleBin; + + protected override IEnumerable GetEntitiesFromNotification(ContentEmptiedRecycleBinNotification notification) => + notification.DeletedEntities; + + protected override object? ConvertEntityToRequestPayload(IContent entity) + { + if (_publishedSnapshotAccessor.TryGetPublishedSnapshot(out IPublishedSnapshot? publishedSnapshot) is false || publishedSnapshot!.Content is null) + { + return null; + } + + IPublishedContent? publishedContent = publishedSnapshot.Content.GetById(true, entity.Key); + return publishedContent is null ? null : _apiContentBuilder.Build(publishedContent); + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentRolledBack.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentRolledBack.cs new file mode 100644 index 000000000000..55064912b971 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentRolledBack.cs @@ -0,0 +1,52 @@ +using Microsoft.Extensions.Options; +using Umbraco.Cms.Core.Configuration.Models; +using Umbraco.Cms.Core.DeliveryApi; +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.Notifications; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Sync; + +namespace Umbraco.Cms.Core.Webhooks.Events.Content; + +[WebhookEvent("Content Rolled Back", Constants.WebhookEvents.Types.Content)] +public class ContentRolledBackWebhookEvent : WebhookEventContentBase +{ + private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor; + private readonly IApiContentBuilder _apiContentBuilder; + + public ContentRolledBackWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webhookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor, + IPublishedSnapshotAccessor publishedSnapshotAccessor, + IApiContentBuilder apiContentBuilder) + : base( + webhookFiringService, + webhookService, + webhookSettings, + serverRoleAccessor) + { + _publishedSnapshotAccessor = publishedSnapshotAccessor; + _apiContentBuilder = apiContentBuilder; + } + + public override string Alias => Constants.WebhookEvents.Aliases.ContentRolledBack; + + protected override IEnumerable GetEntitiesFromNotification(ContentRolledBackNotification notification) => + new List { notification.Entity }; + + protected override object? ConvertEntityToRequestPayload(IContent entity) + { + if (_publishedSnapshotAccessor.TryGetPublishedSnapshot(out IPublishedSnapshot? publishedSnapshot) is false || publishedSnapshot!.Content is null) + { + return null; + } + + // Get preview/saved version of content as a rollback + IPublishedContent? publishedContent = publishedSnapshot.Content.GetById(true, entity.Key); + return publishedContent is null ? null : _apiContentBuilder.Build(publishedContent); + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentSavedWebhookEvent.cs new file mode 100644 index 000000000000..fac16de822e5 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentSavedWebhookEvent.cs @@ -0,0 +1,52 @@ +using Microsoft.Extensions.Options; +using Umbraco.Cms.Core.Configuration.Models; +using Umbraco.Cms.Core.DeliveryApi; +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.Notifications; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Sync; + +namespace Umbraco.Cms.Core.Webhooks.Events.Content; + +[WebhookEvent("Content Saved", Constants.WebhookEvents.Types.Content)] +public class ContentSavedWebhookEvent : WebhookEventContentBase +{ + private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor; + private readonly IApiContentBuilder _apiContentBuilder; + + public ContentSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webhookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor, + IPublishedSnapshotAccessor publishedSnapshotAccessor, + IApiContentBuilder apiContentBuilder) + : base( + webhookFiringService, + webhookService, + webhookSettings, + serverRoleAccessor) + { + _publishedSnapshotAccessor = publishedSnapshotAccessor; + _apiContentBuilder = apiContentBuilder; + } + + public override string Alias => Constants.WebhookEvents.Aliases.ContentSaved; + + protected override IEnumerable GetEntitiesFromNotification(ContentSavedNotification notification) => + notification.SavedEntities; + + protected override object? ConvertEntityToRequestPayload(IContent entity) + { + if (_publishedSnapshotAccessor.TryGetPublishedSnapshot(out IPublishedSnapshot? publishedSnapshot) is false || publishedSnapshot!.Content is null) + { + return null; + } + + // Get preview/saved version of content + IPublishedContent? publishedContent = publishedSnapshot.Content.GetById(true, entity.Key); + return publishedContent is null ? null : _apiContentBuilder.Build(publishedContent); + } +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 77ef57279aff..131571f85563 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -82,6 +82,17 @@ private void RegisterTypes(IServiceCollection services) return null; } + public WebhookEventCollectionBuilder AddContentWebhooks() + { + Append(); + Append(); + Append(); + Append(); + Append(); + Append(); + return this; + } + public WebhookEventCollectionBuilder AddCoreWebhooks() { Append(); From 8abdbc0c2e199495effce75c861af049fafee647 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Mon, 13 Nov 2023 16:34:14 +0000 Subject: [PATCH 20/52] For now empty recylce bin returns the IContent entity as the previous approach will not get anything from snapshot/content cache as the item is deleted --- .../Content/ContentEmptiedRecycleBinWebhookEvent.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs index fd1d713ffcd9..a8fc666694fc 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs @@ -38,14 +38,5 @@ public ContentEmptiedRecycleBinWebhookEvent( protected override IEnumerable GetEntitiesFromNotification(ContentEmptiedRecycleBinNotification notification) => notification.DeletedEntities; - protected override object? ConvertEntityToRequestPayload(IContent entity) - { - if (_publishedSnapshotAccessor.TryGetPublishedSnapshot(out IPublishedSnapshot? publishedSnapshot) is false || publishedSnapshot!.Content is null) - { - return null; - } - - IPublishedContent? publishedContent = publishedSnapshot.Content.GetById(true, entity.Key); - return publishedContent is null ? null : _apiContentBuilder.Build(publishedContent); - } + protected override object? ConvertEntityToRequestPayload(IContent entity) => entity; } From 081178de285b2614513b63e1138f87c2e216d808 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Mon, 13 Nov 2023 16:46:10 +0000 Subject: [PATCH 21/52] Adds Member Type notifications --- .../MemberTypeChangedWebhookEvent.cs | 22 +++++++++++++++++++ .../MemberTypeDeletedWebhookEvent.cs | 22 +++++++++++++++++++ .../MemberType/MemberTypeMovedWebhookEvent.cs | 22 +++++++++++++++++++ .../MemberType/MemberTypeSavedWebhookEvent.cs | 22 +++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 10 +++++++++ 5 files changed, 98 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeChangedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeMovedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeSavedWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeChangedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeChangedWebhookEvent.cs new file mode 100644 index 000000000000..727c6617e255 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeChangedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.MemberType; + +[WebhookEvent("MemberType Changed")] +public class MemberTypeChangedWebhookEvent : WebhookEventBase +{ + public MemberTypeChangedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "memberTypeChanged"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeDeletedWebhookEvent.cs new file mode 100644 index 000000000000..481f0eb6dd2d --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeDeletedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.MemberType; + +[WebhookEvent("MemberType Deleted")] +public class MemberTypeDeletedWebhookEvent : WebhookEventBase +{ + public MemberTypeDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "memberTypeDeleted"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeMovedWebhookEvent.cs new file mode 100644 index 000000000000..cabab8010a01 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeMovedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.MemberType; + +[WebhookEvent("MemberType Moved")] +public class MemberTypeMovedWebhookEvent : WebhookEventBase +{ + public MemberTypeMovedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "memberTypeMoved"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeSavedWebhookEvent.cs new file mode 100644 index 000000000000..ed57c7f7bd2e --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeSavedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.MemberType; + +[WebhookEvent("MemberType Saved")] +public class MemberTypeSavedWebhookEvent : WebhookEventBase +{ + public MemberTypeSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "memberTypeSaved"; +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 131571f85563..ad0c87e282f5 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -9,6 +9,7 @@ using Umbraco.Cms.Core.Webhooks.Events.Domain; using Umbraco.Cms.Core.Webhooks.Events.Language; using Umbraco.Cms.Core.Webhooks.Events.Media; +using Umbraco.Cms.Core.Webhooks.Events.MemberType; using Umbraco.Cms.Core.Webhooks.Events.Package; using Umbraco.Cms.Core.Webhooks.Events.Relation; using Umbraco.Cms.Core.Webhooks.Events.Script; @@ -152,6 +153,15 @@ public WebhookEventCollectionBuilder AddMediaWebhooks() return this; } + public WebhookEventCollectionBuilder AddMemberTypeWebhooks() + { + Append(); + Append(); + Append(); + Append(); + return this; + } + public WebhookEventCollectionBuilder AddPackageWebhooks() { Append(); From 021169d221f2e4d056688a9327433ec0d7993188 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 14 Nov 2023 14:02:44 +0000 Subject: [PATCH 22/52] Adds more Content based Webhooks --- src/Umbraco.Core/Constants-WebhookEvents.cs | 15 ++++++ .../Content/ContentCopiedWebhookEvent.cs | 27 ++++++++++ .../Content/ContentMovedWebhookEvent.cs | 27 ++++++++++ .../Content/ContentSortedWebhookEvent.cs | 50 +++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 3 ++ 5 files changed, 122 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/Content/ContentCopiedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Content/ContentMovedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Content/ContentSortedWebhookEvent.cs diff --git a/src/Umbraco.Core/Constants-WebhookEvents.cs b/src/Umbraco.Core/Constants-WebhookEvents.cs index d65e5d36406e..1aa66543271f 100644 --- a/src/Umbraco.Core/Constants-WebhookEvents.cs +++ b/src/Umbraco.Core/Constants-WebhookEvents.cs @@ -6,6 +6,21 @@ public static class WebhookEvents { public static class Aliases { + /// + /// Webhook event alias for content sorted. + /// + public const string ContentSorted = "Umbraco.ContentSorted"; + + /// + /// Webhook event alias for content moved. + /// + public const string ContentMoved = "Umbraco.ContentMoved"; + + /// + /// Webhook event alias for content copied. + /// + public const string ContentCopied = "Umbraco.ContentCopied"; + /// /// Webhook event alias for content emptied recycle bin. /// diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentCopiedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentCopiedWebhookEvent.cs new file mode 100644 index 000000000000..d8840f4b9779 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentCopiedWebhookEvent.cs @@ -0,0 +1,27 @@ +using Microsoft.Extensions.Options; +using Umbraco.Cms.Core.Configuration.Models; +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Notifications; +using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Sync; + +namespace Umbraco.Cms.Core.Webhooks.Events.Content; + +[WebhookEvent("Content Copied", Constants.WebhookEvents.Types.Content)] +public class ContentCopiedWebhookEvent : WebhookEventBase +{ + public ContentCopiedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webhookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base( + webhookFiringService, + webhookService, + webhookSettings, + serverRoleAccessor) + { + } + + public override string Alias => Constants.WebhookEvents.Aliases.ContentCopied; +} diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedWebhookEvent.cs new file mode 100644 index 000000000000..fa1eb9dec6d6 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedWebhookEvent.cs @@ -0,0 +1,27 @@ +using Microsoft.Extensions.Options; +using Umbraco.Cms.Core.Configuration.Models; +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Notifications; +using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Sync; + +namespace Umbraco.Cms.Core.Webhooks.Events.Content; + +[WebhookEvent("Content Moved", Constants.WebhookEvents.Types.Content)] +public class ContentMovedWebhookEvent : WebhookEventBase +{ + public ContentMovedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webhookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base( + webhookFiringService, + webhookService, + webhookSettings, + serverRoleAccessor) + { + } + + public override string Alias => Constants.WebhookEvents.Aliases.ContentMoved; +} diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentSortedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentSortedWebhookEvent.cs new file mode 100644 index 000000000000..bd706aef0b6d --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentSortedWebhookEvent.cs @@ -0,0 +1,50 @@ +using Microsoft.Extensions.Options; +using Umbraco.Cms.Core.Configuration.Models; +using Umbraco.Cms.Core.DeliveryApi; +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.Notifications; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Sync; + +namespace Umbraco.Cms.Core.Webhooks.Events.Content; + +[WebhookEvent("Content Sorted", Constants.WebhookEvents.Types.Content)] +public class ContentSortedWebhookEvent : WebhookEventContentBase +{ + private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor; + private readonly IApiContentBuilder _apiContentBuilder; + + public ContentSortedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webhookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor, + IPublishedSnapshotAccessor publishedSnapshotAccessor, + IApiContentBuilder apiContentBuilder) + : base( + webhookFiringService, + webhookService, + webhookSettings, + serverRoleAccessor) + { + _publishedSnapshotAccessor = publishedSnapshotAccessor; + _apiContentBuilder = apiContentBuilder; + } + + public override string Alias => Constants.WebhookEvents.Aliases.ContentSorted; + + protected override IEnumerable GetEntitiesFromNotification(ContentSortedNotification notification) => notification.SortedEntities; + + protected override object? ConvertEntityToRequestPayload(IContent entity) + { + if (_publishedSnapshotAccessor.TryGetPublishedSnapshot(out IPublishedSnapshot? publishedSnapshot) is false || publishedSnapshot!.Content is null) + { + return null; + } + + IPublishedContent? publishedContent = publishedSnapshot.Content.GetById(entity.Key); + return publishedContent is null ? null : _apiContentBuilder.Build(publishedContent); + } +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index ad0c87e282f5..8f073b3e519e 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -85,11 +85,14 @@ private void RegisterTypes(IServiceCollection services) public WebhookEventCollectionBuilder AddContentWebhooks() { + Append(); Append(); Append(); + Append(); Append(); Append(); Append(); + Append(); Append(); return this; } From 5939f42ab19d2229b11ea352f047c5861c68a60f Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 15 Nov 2023 12:09:51 +0000 Subject: [PATCH 23/52] Adds the last of the Content related notifications as Webhooks that I can think of --- src/Umbraco.Core/Constants-WebhookEvents.cs | 21 ++++++++++++ .../ContentDeletedBlueprintWebhookEvent.cs | 32 ++++++++++++++++++ .../ContentDeletedVersionsWebhookEvent.cs | 27 +++++++++++++++ .../ContentMovedToRecycleBinWebhookEvent.cs | 26 +++++++++++++++ .../ContentSavedBlueprintWebhookEvent.cs | 33 +++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 4 +++ 6 files changed, 143 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedBlueprintWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedVersionsWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Content/ContentMovedToRecycleBinWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Content/ContentSavedBlueprintWebhookEvent.cs diff --git a/src/Umbraco.Core/Constants-WebhookEvents.cs b/src/Umbraco.Core/Constants-WebhookEvents.cs index 1aa66543271f..41b9849f08f1 100644 --- a/src/Umbraco.Core/Constants-WebhookEvents.cs +++ b/src/Umbraco.Core/Constants-WebhookEvents.cs @@ -6,6 +6,27 @@ public static class WebhookEvents { public static class Aliases { + + /// + /// Webhook event alias for content versions deleted + /// + public const string ContentDeletedVersions = "Umbraco.ContentDeletedVersions"; + + /// + /// Webhook event alias for content blueprint saved + /// + public const string ContentSavedBlueprint = "Umbraco.ContentSavedBlueprint"; + + /// + /// Webhook event alias for content blueprint deleted + /// + public const string ContentDeletedBlueprint = "Umbraco.ContentDeletedBlueprint"; + + /// + /// Webhook event alias for content moved into the recycle bin. + /// + public const string ContentMovedToRecycleBin = "Umbraco.ContentMovedToRecycleBin"; + /// /// Webhook event alias for content sorted. /// diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedBlueprintWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedBlueprintWebhookEvent.cs new file mode 100644 index 000000000000..996b8abd15d9 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedBlueprintWebhookEvent.cs @@ -0,0 +1,32 @@ +using Microsoft.Extensions.Options; +using Umbraco.Cms.Core.Configuration.Models; +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Notifications; +using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Sync; + +namespace Umbraco.Cms.Core.Webhooks.Events.Content; + +[WebhookEvent("Content Template [Blueprint] Deleted", Constants.WebhookEvents.Types.Content)] +public class ContentDeletedBlueprintWebhookEvent : WebhookEventContentBase +{ + public ContentDeletedBlueprintWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webhookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base( + webhookFiringService, + webhookService, + webhookSettings, + serverRoleAccessor) + { + } + + public override string Alias => Constants.WebhookEvents.Aliases.ContentDeletedBlueprint; + + protected override IEnumerable GetEntitiesFromNotification(ContentDeletedBlueprintNotification notification) => + notification.DeletedBlueprints; + + protected override object ConvertEntityToRequestPayload(IContent entity) => entity; +} diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedVersionsWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedVersionsWebhookEvent.cs new file mode 100644 index 000000000000..98ec8465a2a8 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedVersionsWebhookEvent.cs @@ -0,0 +1,27 @@ +using Microsoft.Extensions.Options; +using Umbraco.Cms.Core.Configuration.Models; +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Notifications; +using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Sync; + +namespace Umbraco.Cms.Core.Webhooks.Events.Content; + +[WebhookEvent("Content Versions Deleted", Constants.WebhookEvents.Types.Content)] +public class ContentDeletedVersionsWebhookEvent : WebhookEventBase +{ + public ContentDeletedVersionsWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webhookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base( + webhookFiringService, + webhookService, + webhookSettings, + serverRoleAccessor) + { + } + + public override string Alias => Constants.WebhookEvents.Aliases.ContentDeletedVersions; +} diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedToRecycleBinWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedToRecycleBinWebhookEvent.cs new file mode 100644 index 000000000000..dad704fef0ec --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedToRecycleBinWebhookEvent.cs @@ -0,0 +1,26 @@ +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.Content; + +[WebhookEvent("Content Moved to Recycle Bin", Constants.WebhookEvents.Types.Content)] +public class ContentMovedToRecycleBinWebhookEvent : WebhookEventBase +{ + public ContentMovedToRecycleBinWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webhookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base( + webhookFiringService, + webhookService, + webhookSettings, + serverRoleAccessor) + { + } + + public override string Alias => Constants.WebhookEvents.Aliases.ContentMovedToRecycleBin; +} diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentSavedBlueprintWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentSavedBlueprintWebhookEvent.cs new file mode 100644 index 000000000000..40630b453f39 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentSavedBlueprintWebhookEvent.cs @@ -0,0 +1,33 @@ +using Microsoft.Extensions.Options; +using Umbraco.Cms.Core.Configuration.Models; +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.Notifications; +using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Sync; + +namespace Umbraco.Cms.Core.Webhooks.Events.Content; + +[WebhookEvent("Content Template [Blueprint] Saved", Constants.WebhookEvents.Types.Content)] +public class ContentSavedBlueprintWebhookEvent : WebhookEventContentBase +{ + public ContentSavedBlueprintWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webhookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base( + webhookFiringService, + webhookService, + webhookSettings, + serverRoleAccessor) + { + } + + public override string Alias => Constants.WebhookEvents.Aliases.ContentSavedBlueprint; + + protected override IEnumerable + GetEntitiesFromNotification(ContentSavedBlueprintNotification notification) + => new List { notification.SavedBlueprint }; + + protected override object ConvertEntityToRequestPayload(IContent entity) => entity; +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 8f073b3e519e..8d9561d6ccd2 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -86,11 +86,15 @@ private void RegisterTypes(IServiceCollection services) public WebhookEventCollectionBuilder AddContentWebhooks() { Append(); + Append(); + Append(); Append(); Append(); + Append(); Append(); Append(); Append(); + Append(); Append(); Append(); Append(); From c6a9a619a3558f9fb27da30c48e995639720cb72 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Sun, 19 Nov 2023 19:05:48 +0000 Subject: [PATCH 24/52] Adds PublicAccess WebHooks --- .../PublicAccessEntryDeletedWebhookEvent.cs | 22 +++++++++++++++++++ .../PublicAccessEntrySavedWebhookEvent.cs | 22 +++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 8 +++++++ 3 files changed, 52 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntryDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntrySavedWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntryDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntryDeletedWebhookEvent.cs new file mode 100644 index 000000000000..c4e8c68cd592 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntryDeletedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.PublicAccess; + +[WebhookEvent("Public Access Entry Deleted")] +public class PublicAccessEntryDeletedWebhookEvent : WebhookEventBase +{ + public PublicAccessEntryDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "publicAccessEntryDeleted"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntrySavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntrySavedWebhookEvent.cs new file mode 100644 index 000000000000..2daa8b4cfb96 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntrySavedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.PublicAccess; + +[WebhookEvent("Public Access Entry Saved")] +public class PublicAccessEntrySavedWebhookEvent : WebhookEventBase +{ + public PublicAccessEntrySavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "publicAccessEntrySaved"; +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 8d9561d6ccd2..d802d52b5d3c 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -11,6 +11,7 @@ using Umbraco.Cms.Core.Webhooks.Events.Media; using Umbraco.Cms.Core.Webhooks.Events.MemberType; using Umbraco.Cms.Core.Webhooks.Events.Package; +using Umbraco.Cms.Core.Webhooks.Events.PublicAccess; using Umbraco.Cms.Core.Webhooks.Events.Relation; using Umbraco.Cms.Core.Webhooks.Events.Script; using Umbraco.Cms.Core.Webhooks.Events.Stylesheet; @@ -175,6 +176,13 @@ public WebhookEventCollectionBuilder AddPackageWebhooks() return this; } + public WebhookEventCollectionBuilder AddPublicAccessWebhooks() + { + Append(); + Append(); + return this; + } + public WebhookEventCollectionBuilder AddRelationWebhooks() { Append(); From fba16cd3e7b1ad1b4d37e76c65b2fae95d7bb0ef Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 21 Nov 2023 12:17:12 +0000 Subject: [PATCH 25/52] Fix up misaligned namespaces - too much copy/pasting --- .../Webhooks/Events/Media/MediaDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/Media/MediaSavedWebhookEvent.cs | 10 +++++----- .../Events/Template/PartialViewDeletedWebhookEvent.cs | 2 +- .../Events/Template/PartialViewSavedWebhookEvent.cs | 2 +- .../Events/Template/TemplateDeletedWebhookEvent.cs | 2 +- .../Events/Template/TemplateSavedWebhookEvent.cs | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaDeletedWebhookEvent.cs index 44d9c5600263..659917652dda 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaDeletedWebhookEvent.cs @@ -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.Media; [WebhookEvent("Media Deleted", Constants.WebhookEvents.Types.Media)] public class MediaDeletedWebhookEvent : WebhookEventContentBase diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaSavedWebhookEvent.cs index a65f33832c26..6c68e8edb146 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaSavedWebhookEvent.cs @@ -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.Media; [WebhookEvent("Media Saved", Constants.WebhookEvents.Types.Media)] public class MediaSavedWebhookEvent : WebhookEventContentBase @@ -29,8 +29,8 @@ public MediaSavedWebhookEvent( webhookSettings, serverRoleAccessor) { - _publishedSnapshotAccessor = publishedSnapshotAccessor; - _apiMediaBuilder = apiMediaBuilder; + this._publishedSnapshotAccessor = publishedSnapshotAccessor; + this._apiMediaBuilder = apiMediaBuilder; } public override string Alias => Constants.WebhookEvents.Aliases.MediaSave; @@ -39,12 +39,12 @@ public MediaSavedWebhookEvent( protected override object? ConvertEntityToRequestPayload(IMedia entity) { - if (_publishedSnapshotAccessor.TryGetPublishedSnapshot(out IPublishedSnapshot? publishedSnapshot) is false || publishedSnapshot!.Content is null) + if (this._publishedSnapshotAccessor.TryGetPublishedSnapshot(out IPublishedSnapshot? publishedSnapshot) is false || publishedSnapshot!.Content is null) { return null; } IPublishedContent? publishedContent = publishedSnapshot.Media?.GetById(entity.Key); - return publishedContent is null ? null : _apiMediaBuilder.Build(publishedContent); + return publishedContent is null ? null : this._apiMediaBuilder.Build(publishedContent); } } diff --git a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs index d94f5b31fd4c..80e7fee593f0 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs @@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Stylesheet; +namespace Umbraco.Cms.Core.Webhooks.Events.Template; [WebhookEvent("Partial View Deleted")] public class PartialViewDeletedWebhookEvent : WebhookEventBase diff --git a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs index 14176b958729..232f11dcd82f 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs @@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Stylesheet; +namespace Umbraco.Cms.Core.Webhooks.Events.Template; [WebhookEvent("Partial View Saved")] public class PartialViewSavedWebhookEvent : WebhookEventBase diff --git a/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs index 73334d13b339..3a071b9fd974 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs @@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Stylesheet; +namespace Umbraco.Cms.Core.Webhooks.Events.Template; [WebhookEvent("Template Deleted")] public class TemplateDeletedWebhookEvent : WebhookEventBase diff --git a/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs index 5954be188a50..596d4233d52f 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs @@ -4,7 +4,7 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Stylesheet; +namespace Umbraco.Cms.Core.Webhooks.Events.Template; [WebhookEvent("Template Saved")] public class TemplateSavedWebhookEvent : WebhookEventBase From 80bdd89b0422601150d966ba194e25d23837e0b5 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 21 Nov 2023 12:18:03 +0000 Subject: [PATCH 26/52] Adds Member Webhook for Saved & Deleted TODO: Need to think of a way to ensure the password is not serialized --- .../Member/MemberDeletedWebhookEvent.cs | 22 +++++++++++++++++++ .../Events/Member/MemberSavedWebhookEvent.cs | 22 +++++++++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 9 ++++++++ 3 files changed, 53 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/Member/MemberDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Member/MemberSavedWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/Member/MemberDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Member/MemberDeletedWebhookEvent.cs new file mode 100644 index 000000000000..5eb23b9291bf --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Member/MemberDeletedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.Member; + +[WebhookEvent("Member Deleted")] +public class MemberDeletedWebhookEvent : WebhookEventBase +{ + public MemberDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "memberDeleted"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/Member/MemberSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Member/MemberSavedWebhookEvent.cs new file mode 100644 index 000000000000..642328b5b734 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Member/MemberSavedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.Member; + +[WebhookEvent("Member Saved")] +public class MemberSavedWebhookEvent : WebhookEventBase +{ + public MemberSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "memberSaved"; +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index d802d52b5d3c..74809148f973 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -9,12 +9,14 @@ using Umbraco.Cms.Core.Webhooks.Events.Domain; using Umbraco.Cms.Core.Webhooks.Events.Language; using Umbraco.Cms.Core.Webhooks.Events.Media; +using Umbraco.Cms.Core.Webhooks.Events.Member; using Umbraco.Cms.Core.Webhooks.Events.MemberType; using Umbraco.Cms.Core.Webhooks.Events.Package; using Umbraco.Cms.Core.Webhooks.Events.PublicAccess; using Umbraco.Cms.Core.Webhooks.Events.Relation; using Umbraco.Cms.Core.Webhooks.Events.Script; using Umbraco.Cms.Core.Webhooks.Events.Stylesheet; +using Umbraco.Cms.Core.Webhooks.Events.Template; using Umbraco.Extensions; namespace Umbraco.Cms.Core.Webhooks; @@ -161,6 +163,13 @@ public WebhookEventCollectionBuilder AddMediaWebhooks() return this; } + public WebhookEventCollectionBuilder AddMemberWebhooks() + { + Append(); + Append(); + return this; + } + public WebhookEventCollectionBuilder AddMemberTypeWebhooks() { Append(); From cc3d45bc2b03f14eff2ce22f0a03c0d70768fc93 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 21 Nov 2023 14:25:50 +0000 Subject: [PATCH 27/52] WebHookEventBase ConvertNotificationToRequestPayload that could be overriden if needed to exclude properties or shape the notification better --- .../Events/Member/MemberSavedWebhookEvent.cs | 17 +++++++++++++++++ src/Umbraco.Core/Webhooks/WebhookEventBase.cs | 12 +++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Webhooks/Events/Member/MemberSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Member/MemberSavedWebhookEvent.cs index 642328b5b734..edb82cb51843 100644 --- a/src/Umbraco.Core/Webhooks/Events/Member/MemberSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Member/MemberSavedWebhookEvent.cs @@ -19,4 +19,21 @@ public MemberSavedWebhookEvent( } public override string Alias => "memberSaved"; + + public override object? ConvertNotificationToRequestPayload(MemberSavedNotification notification) + { + // TODO: Map more stuff here + var result = notification.SavedEntities.Select(entity => new + { + entity.Id, + entity.Key, + entity.Name, + entity.ContentTypeAlias, + entity.Email, + entity.Username, + entity.FailedPasswordAttempts + }); + + return result; + } } diff --git a/src/Umbraco.Core/Webhooks/WebhookEventBase.cs b/src/Umbraco.Core/Webhooks/WebhookEventBase.cs index 529fe4191b94..4fdb77517f23 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventBase.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventBase.cs @@ -62,7 +62,7 @@ public virtual async Task ProcessWebhooks(TNotification notification, IEnumerabl continue; } - await WebhookFiringService.FireAsync(webhook, Alias, notification, cancellationToken); + await WebhookFiringService.FireAsync(webhook, Alias, ConvertNotificationToRequestPayload(notification), cancellationToken); } } @@ -95,4 +95,14 @@ public async Task HandleAsync(TNotification notification, CancellationToken canc await ProcessWebhooks(notification, webhooks, cancellationToken); } + + /// + /// Use this method if you wish to change the shape of the object to be serialised + /// for the JSON webhook payload. + /// For example excluding sensitive data + /// + /// + /// + public virtual object? ConvertNotificationToRequestPayload(TNotification notification) + => notification; } From 5561f8ca066209652de78ca74c5f9c034997bd36 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 21 Nov 2023 14:56:39 +0000 Subject: [PATCH 28/52] Adds the last fo the member webhooks --- .../Member/AssignedMemberRolesWebhookEvent.cs | 22 +++++++++++++ .../Member/ExportedMemberWebhookEvent.cs | 32 +++++++++++++++++++ .../Member/MemberDeletedWebhookEvent.cs | 17 ++++++++++ .../Member/MemberGroupDeletedWebhookEvent.cs | 22 +++++++++++++ .../Member/MemberGroupSavedWebhookEvent.cs | 22 +++++++++++++ .../Member/RemovedMemberRolesWebhookEvent.cs | 22 +++++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 5 +++ 7 files changed, 142 insertions(+) create mode 100644 src/Umbraco.Core/Webhooks/Events/Member/AssignedMemberRolesWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Member/ExportedMemberWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Member/MemberGroupDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Member/MemberGroupSavedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/Member/RemovedMemberRolesWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/Member/AssignedMemberRolesWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Member/AssignedMemberRolesWebhookEvent.cs new file mode 100644 index 000000000000..4812bdcc7368 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Member/AssignedMemberRolesWebhookEvent.cs @@ -0,0 +1,22 @@ +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.Member; + +[WebhookEvent("Member Roles Assigned")] +public class AssignedMemberRolesWebhookEvent : WebhookEventBase +{ + public AssignedMemberRolesWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "assignedMemberRoles"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/Member/ExportedMemberWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Member/ExportedMemberWebhookEvent.cs new file mode 100644 index 000000000000..3f72587c8fea --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Member/ExportedMemberWebhookEvent.cs @@ -0,0 +1,32 @@ +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.Member; + +[WebhookEvent("Member Exported")] +public class ExportedMemberWebhookEvent : WebhookEventBase +{ + public ExportedMemberWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "exportedMember"; + + public override object? ConvertNotificationToRequestPayload(ExportedMemberNotification notification) + { + // No need to return the original member in the notification as well + return new + { + exportedMember = notification.Exported + }; + + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/Member/MemberDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Member/MemberDeletedWebhookEvent.cs index 5eb23b9291bf..c29e22003f45 100644 --- a/src/Umbraco.Core/Webhooks/Events/Member/MemberDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Member/MemberDeletedWebhookEvent.cs @@ -19,4 +19,21 @@ public MemberDeletedWebhookEvent( } public override string Alias => "memberDeleted"; + + public override object? ConvertNotificationToRequestPayload(MemberDeletedNotification notification) + { + // TODO: Map more stuff here + var result = notification.DeletedEntities.Select(entity => new + { + entity.Id, + entity.Key, + entity.Name, + entity.ContentTypeAlias, + entity.Email, + entity.Username, + entity.FailedPasswordAttempts + }); + + return result; + } } diff --git a/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupDeletedWebhookEvent.cs new file mode 100644 index 000000000000..e00816312fb7 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupDeletedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.Member; + +[WebhookEvent("Member Group Deleted")] +public class MemberGroupDeletedWebhookEvent : WebhookEventBase +{ + public MemberGroupDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "memberGroupDeleted"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupSavedWebhookEvent.cs new file mode 100644 index 000000000000..e0be3df61d21 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupSavedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.Member; + +[WebhookEvent("Member Group Saved")] +public class MemberGroupSavedWebhookEvent : WebhookEventBase +{ + public MemberGroupSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "memberGroupSaved"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/Member/RemovedMemberRolesWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Member/RemovedMemberRolesWebhookEvent.cs new file mode 100644 index 000000000000..8925b240597d --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/Member/RemovedMemberRolesWebhookEvent.cs @@ -0,0 +1,22 @@ +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.Member; + +[WebhookEvent("Member Roles Removed")] +public class RemovedMemberRolesWebhookEvent : WebhookEventBase +{ + public RemovedMemberRolesWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "removedMemberRoles"; +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 74809148f973..fc77d70fe2e0 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -165,8 +165,13 @@ public WebhookEventCollectionBuilder AddMediaWebhooks() public WebhookEventCollectionBuilder AddMemberWebhooks() { + Append(); + Append(); Append(); + Append(); + Append(); Append(); + Append(); return this; } From c3fb6ef91b935c9f957241709dfef7e9f8b8b028 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 21 Nov 2023 14:57:10 +0000 Subject: [PATCH 29/52] Adds AllTheWebHook to the collection builder to easily see all events added at once --- .../Webhooks/WebhookEventCollectionBuilder.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index fc77d70fe2e0..6e09bddee7c9 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -86,6 +86,22 @@ private void RegisterTypes(IServiceCollection services) return null; } + public WebhookEventCollectionBuilder AddAllTheWebhooks() => + this.AddContentWebhooks() + .AddDataTypeWebhooks() + .AddDictionaryWebhooks() + .AddDictionaryWebhooks() + .AddLanguageWebhooks() + .AddMediaWebhooks() + .AddMemberWebhooks() + .AddMemberTypeWebhooks() + .AddPackageWebhooks() + .AddPublicAccessWebhooks() + .AddRelationWebhooks() + .AddScriptWebhooks() + .AddStylesheetWebhooks() + .AddTemplateWebhooks(); + public WebhookEventCollectionBuilder AddContentWebhooks() { Append(); From 5c6eb4aa9ea1363047389933816091bdca6adb64 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 21 Nov 2023 16:04:05 +0000 Subject: [PATCH 30/52] Adds the User related Webhooks --- ...ssignedUserGroupPermissionsWebhookEvent.cs | 25 ++++++++++++ .../Events/User/UserDeletedWebhookEvent.cs | 39 +++++++++++++++++++ ...UserForgotPasswordRequestedWebhookEvent.cs | 23 +++++++++++ ...rForgottenPasswordRequestedWebhookEvent.cs | 22 +++++++++++ .../User/UserGroupDeletedWebhookEvent.cs | 24 ++++++++++++ .../Events/User/UserGroupSavedWebhookEvent.cs | 24 ++++++++++++ .../Events/User/UserLockedWebhookEvent.cs | 22 +++++++++++ .../User/UserLoginFailedWebhookEvent.cs | 22 +++++++++++ ...erLoginRequiresVerificationWebhookEvent.cs | 23 +++++++++++ .../User/UserLoginSuccessWebhookEvent.cs | 22 +++++++++++ .../User/UserLogoutSuccessWebhookEvent.cs | 22 +++++++++++ .../User/UserPasswordChangedWebhookEvent.cs | 23 +++++++++++ .../User/UserPasswordResetWebhookEvent.cs | 22 +++++++++++ .../Events/User/UserSavedWebhookEvent.cs | 39 +++++++++++++++++++ .../UserTwoFactorRequestedWebhookEvent.cs | 23 +++++++++++ .../Events/User/UserUnlockedWebhookEvent.cs | 22 +++++++++++ .../Webhooks/WebhookEventCollectionBuilder.cs | 28 +++++++++++-- 17 files changed, 422 insertions(+), 3 deletions(-) create mode 100644 src/Umbraco.Core/Webhooks/Events/User/AssignedUserGroupPermissionsWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserForgotPasswordRequestedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserForgottenPasswordRequestedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserGroupDeletedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserGroupSavedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserLockedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserLoginFailedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserLoginRequiresVerificationWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserLoginSuccessWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserLogoutSuccessWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserPasswordChangedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserPasswordResetWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserSavedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserTwoFactorRequestedWebhookEvent.cs create mode 100644 src/Umbraco.Core/Webhooks/Events/User/UserUnlockedWebhookEvent.cs diff --git a/src/Umbraco.Core/Webhooks/Events/User/AssignedUserGroupPermissionsWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/AssignedUserGroupPermissionsWebhookEvent.cs new file mode 100644 index 000000000000..1b8b1002bcac --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/AssignedUserGroupPermissionsWebhookEvent.cs @@ -0,0 +1,25 @@ +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.User; + +[WebhookEvent("User Group Permissions Assigned")] +public class AssignedUserGroupPermissionsWebhookEvent : WebhookEventBase +{ + public AssignedUserGroupPermissionsWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "assignedUserGroupPermissions"; + + public override object? ConvertNotificationToRequestPayload(AssignedUserGroupPermissionsNotification notification) + => notification.EntityPermissions; +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserDeletedWebhookEvent.cs new file mode 100644 index 000000000000..3d7a6b2afa02 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserDeletedWebhookEvent.cs @@ -0,0 +1,39 @@ +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.User; + +[WebhookEvent("User Deleted")] +public class UserDeletedWebhookEvent : WebhookEventBase +{ + public UserDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userDeleted"; + + public override object? ConvertNotificationToRequestPayload(UserDeletedNotification notification) + { + // TODO: Map more stuff here + var result = notification.DeletedEntities.Select(entity => new + { + entity.Id, + entity.Key, + entity.Name, + entity.Language, + entity.Email, + entity.Username, + entity.FailedPasswordAttempts + }); + + return result; + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserForgotPasswordRequestedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserForgotPasswordRequestedWebhookEvent.cs new file mode 100644 index 000000000000..0426d7a1e673 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserForgotPasswordRequestedWebhookEvent.cs @@ -0,0 +1,23 @@ +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.User; + +[WebhookEvent("User Forgot Password Requested")] +public class UserForgotPasswordRequestedWebhookEvent : WebhookEventBase +{ + public UserForgotPasswordRequestedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userForgotPasswordRequested"; + +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserForgottenPasswordRequestedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserForgottenPasswordRequestedWebhookEvent.cs new file mode 100644 index 000000000000..7bd15f5a5189 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserForgottenPasswordRequestedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.User; + +[WebhookEvent("User Forgotten Password Requested")] +public class UserForgottenPasswordRequestedWebhookEvent : WebhookEventBase +{ + public UserForgottenPasswordRequestedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userForgottenPasswordRequested"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserGroupDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserGroupDeletedWebhookEvent.cs new file mode 100644 index 000000000000..c05bacb3779e --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserGroupDeletedWebhookEvent.cs @@ -0,0 +1,24 @@ +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.User; + +[WebhookEvent("User Group Deleted")] +public class UserGroupDeletedWebhookEvent : WebhookEventBase +{ + public UserGroupDeletedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userGroupDeleted"; + + public override object? ConvertNotificationToRequestPayload(UserGroupDeletedNotification notification) => notification.DeletedEntities; +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserGroupSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserGroupSavedWebhookEvent.cs new file mode 100644 index 000000000000..0bfe438a7b75 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserGroupSavedWebhookEvent.cs @@ -0,0 +1,24 @@ +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.User; + +[WebhookEvent("User Group Saved")] +public class UserGroupSavedWebhookEvent : WebhookEventBase +{ + public UserGroupSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userGroupSaved"; + + public override object? ConvertNotificationToRequestPayload(UserGroupSavedNotification notification) => notification.SavedEntities; +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserLockedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserLockedWebhookEvent.cs new file mode 100644 index 000000000000..eb3106687f40 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserLockedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.User; + +[WebhookEvent("User Locked")] +public class UserLockedWebhookEvent : WebhookEventBase +{ + public UserLockedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userLocked"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserLoginFailedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserLoginFailedWebhookEvent.cs new file mode 100644 index 000000000000..e6957d39dcd7 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserLoginFailedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.User; + +[WebhookEvent("User Login Failed")] +public class UserLoginFailedWebhookEvent : WebhookEventBase +{ + public UserLoginFailedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userLoginFailed"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserLoginRequiresVerificationWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserLoginRequiresVerificationWebhookEvent.cs new file mode 100644 index 000000000000..a64282715024 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserLoginRequiresVerificationWebhookEvent.cs @@ -0,0 +1,23 @@ +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.User; + +[WebhookEvent("User Login Requires Verification")] +public class UserLoginRequiresVerificationWebhookEvent : WebhookEventBase +{ + public UserLoginRequiresVerificationWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userLoginRequiresVerification"; + +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserLoginSuccessWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserLoginSuccessWebhookEvent.cs new file mode 100644 index 000000000000..58b98d8e0775 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserLoginSuccessWebhookEvent.cs @@ -0,0 +1,22 @@ +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.User; + +[WebhookEvent("User Login Success")] +public class UserLoginSuccessWebhookEvent : WebhookEventBase +{ + public UserLoginSuccessWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userLoginSuccess"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserLogoutSuccessWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserLogoutSuccessWebhookEvent.cs new file mode 100644 index 000000000000..5efb9e59c54a --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserLogoutSuccessWebhookEvent.cs @@ -0,0 +1,22 @@ +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.User; + +[WebhookEvent("User Login Success")] +public class UserLogoutSuccessWebhookEvent : WebhookEventBase +{ + public UserLogoutSuccessWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userLogoutSuccess"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserPasswordChangedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserPasswordChangedWebhookEvent.cs new file mode 100644 index 000000000000..99c654aba383 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserPasswordChangedWebhookEvent.cs @@ -0,0 +1,23 @@ +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.User; + +[WebhookEvent("User Password Changed")] +public class UserPasswordChangedWebhookEvent : WebhookEventBase +{ + public UserPasswordChangedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userPasswordChanged"; + +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserPasswordResetWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserPasswordResetWebhookEvent.cs new file mode 100644 index 000000000000..368116df0bcd --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserPasswordResetWebhookEvent.cs @@ -0,0 +1,22 @@ +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.User; + +[WebhookEvent("User Password Reset")] +public class UserPasswordResetWebhookEvent : WebhookEventBase +{ + public UserPasswordResetWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userPasswordReset"; +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserSavedWebhookEvent.cs new file mode 100644 index 000000000000..ee65e9b2eb06 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserSavedWebhookEvent.cs @@ -0,0 +1,39 @@ +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.User; + +[WebhookEvent("User Saved")] +public class UserSavedWebhookEvent : WebhookEventBase +{ + public UserSavedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userSaved"; + + public override object? ConvertNotificationToRequestPayload(UserSavedNotification notification) + { + // TODO: Map more stuff here + var result = notification.SavedEntities.Select(entity => new + { + entity.Id, + entity.Key, + entity.Name, + entity.Language, + entity.Email, + entity.Username, + entity.FailedPasswordAttempts + }); + + return result; + } +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserTwoFactorRequestedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserTwoFactorRequestedWebhookEvent.cs new file mode 100644 index 000000000000..afcac294ca82 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserTwoFactorRequestedWebhookEvent.cs @@ -0,0 +1,23 @@ +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.User; + +[WebhookEvent("User Two Factor Requested")] +public class UserTwoFactorRequestedWebhookEvent : WebhookEventBase +{ + public UserTwoFactorRequestedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userTwoFactorRequested"; + +} diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserUnlockedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserUnlockedWebhookEvent.cs new file mode 100644 index 000000000000..09037acac5e9 --- /dev/null +++ b/src/Umbraco.Core/Webhooks/Events/User/UserUnlockedWebhookEvent.cs @@ -0,0 +1,22 @@ +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.User; + +[WebhookEvent("User Locked")] +public class UserUnlockedWebhookEvent : WebhookEventBase +{ + public UserUnlockedWebhookEvent( + IWebhookFiringService webhookFiringService, + IWebhookService webHookService, + IOptionsMonitor webhookSettings, + IServerRoleAccessor serverRoleAccessor) + : base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) + { + } + + public override string Alias => "userUnlocked"; +} diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index 6e09bddee7c9..f403f4687ec1 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -2,7 +2,6 @@ using Umbraco.Cms.Core.Composing; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Notifications; -using Umbraco.Cms.Core.Webhooks.Events; using Umbraco.Cms.Core.Webhooks.Events.Content; using Umbraco.Cms.Core.Webhooks.Events.DataType; using Umbraco.Cms.Core.Webhooks.Events.Dictionary; @@ -17,6 +16,7 @@ using Umbraco.Cms.Core.Webhooks.Events.Script; using Umbraco.Cms.Core.Webhooks.Events.Stylesheet; using Umbraco.Cms.Core.Webhooks.Events.Template; +using Umbraco.Cms.Core.Webhooks.Events.User; using Umbraco.Extensions; namespace Umbraco.Cms.Core.Webhooks; @@ -90,7 +90,7 @@ public WebhookEventCollectionBuilder AddAllTheWebhooks() => this.AddContentWebhooks() .AddDataTypeWebhooks() .AddDictionaryWebhooks() - .AddDictionaryWebhooks() + .AddDomainWebhooks() .AddLanguageWebhooks() .AddMediaWebhooks() .AddMemberWebhooks() @@ -100,7 +100,8 @@ public WebhookEventCollectionBuilder AddAllTheWebhooks() => .AddRelationWebhooks() .AddScriptWebhooks() .AddStylesheetWebhooks() - .AddTemplateWebhooks(); + .AddTemplateWebhooks() + .AddUserWebhooks(); public WebhookEventCollectionBuilder AddContentWebhooks() { @@ -246,4 +247,25 @@ public WebhookEventCollectionBuilder AddTemplateWebhooks() Append(); return this; } + + public WebhookEventCollectionBuilder AddUserWebhooks() + { + Append(); + Append(); + Append(); + Append(); + Append(); + Append(); + Append(); + Append(); + Append(); + Append(); + Append(); + Append(); + Append(); + Append(); + Append(); + Append(); + return this; + } } From b74ecd65f991734b194750c77cb04e269c58ddff Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 22 Nov 2023 13:07:21 +0000 Subject: [PATCH 31/52] Refined the template webhooks mostly to remove Messages & State properties --- .../Events/Template/PartialViewDeletedWebhookEvent.cs | 3 +++ .../Events/Template/PartialViewSavedWebhookEvent.cs | 3 +++ .../Events/Template/TemplateDeletedWebhookEvent.cs | 3 +++ .../Events/Template/TemplateSavedWebhookEvent.cs | 11 +++++++++++ 4 files changed, 20 insertions(+) diff --git a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs index 80e7fee593f0..1f3fc756fbbf 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewDeletedWebhookEvent.cs @@ -19,4 +19,7 @@ public PartialViewDeletedWebhookEvent( } public override string Alias => "partialViewDeleted"; + + public override object? ConvertNotificationToRequestPayload(PartialViewDeletedNotification notification) + => notification.DeletedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs index 232f11dcd82f..224d71c837af 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/PartialViewSavedWebhookEvent.cs @@ -19,4 +19,7 @@ public PartialViewSavedWebhookEvent( } public override string Alias => "partialViewSaved"; + + public override object? ConvertNotificationToRequestPayload(PartialViewSavedNotification notification) => + notification.SavedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs index 3a071b9fd974..2e18dd99323f 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/TemplateDeletedWebhookEvent.cs @@ -19,4 +19,7 @@ public TemplateDeletedWebhookEvent( } public override string Alias => "templateDeleted"; + + public override object? ConvertNotificationToRequestPayload(TemplateDeletedNotification notification) => + notification.DeletedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs index 596d4233d52f..3950e7e370e5 100644 --- a/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Template/TemplateSavedWebhookEvent.cs @@ -19,4 +19,15 @@ public TemplateSavedWebhookEvent( } public override string Alias => "templateSaved"; + + public override object? ConvertNotificationToRequestPayload(TemplateSavedNotification notification) + { + // Create a new anonymous object with the properties we want + return new + { + notification.CreateTemplateForContentType, + notification.ContentTypeAlias, + notification.SavedEntities + }; + } } From 69bc1aa1e212705337a6534780462ee29730e2ab Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 22 Nov 2023 13:10:34 +0000 Subject: [PATCH 32/52] Refined the stylesheet webhooks mostly to remove Messages & State properties --- .../Events/Stylesheet/StylesheetDeletedWebhookEvent.cs | 3 +++ .../Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs index f17acf93b37d..5214dc39cb69 100644 --- a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetDeletedWebhookEvent.cs @@ -19,4 +19,7 @@ public StylesheetDeletedWebhookEvent( } public override string Alias => "stylesheetDeleted"; + + public override object? ConvertNotificationToRequestPayload(StylesheetDeletedNotification notification) => + notification.DeletedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs index 16a65ec485a2..a135f701319a 100644 --- a/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Stylesheet/StylesheetSavedWebhookEvent.cs @@ -19,4 +19,7 @@ public StylesheetSavedWebhookEvent( } public override string Alias => "stylesheetSaved"; + + public override object? ConvertNotificationToRequestPayload(StylesheetSavedNotification notification) + => notification.SavedEntities; } From 065e4066698bc8f1141853aaad3491785e2be6cd Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 22 Nov 2023 13:11:18 +0000 Subject: [PATCH 33/52] Refined the script webhooks mostly to remove Messages & State properties --- .../Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs | 3 +++ .../Webhooks/Events/Script/ScriptSavedWebhookEvent.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs index 5619d8728d77..1dad592cb1ec 100644 --- a/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Script/ScriptDeletedWebhookEvent.cs @@ -19,4 +19,7 @@ public ScriptDeletedWebhookEvent( } public override string Alias => "scriptDeleted"; + + public override object? ConvertNotificationToRequestPayload(ScriptDeletedNotification notification) + => notification.DeletedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs index bd18f218bdc6..4d026b9f6c3c 100644 --- a/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Script/ScriptSavedWebhookEvent.cs @@ -19,4 +19,7 @@ public ScriptSavedWebhookEvent( } public override string Alias => "scriptSaved"; + + public override object? ConvertNotificationToRequestPayload(ScriptDeletedNotification notification) + => notification.DeletedEntities; } From ab7b40b52376f3db0e9239e379d64a16b786bbd9 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 22 Nov 2023 13:13:18 +0000 Subject: [PATCH 34/52] Refined the Relation and RelationType webhooks mostly to remove Messages & State properties --- .../Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs | 3 +++ .../Webhooks/Events/Relation/RelationSavedWebhookEvent.cs | 3 +++ .../Events/Relation/RelationTypeDeletedWebhookEvent.cs | 3 +++ .../Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs index 6c2de75caa05..2ade4bd08e7b 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationDeletedWebhookEvent.cs @@ -19,4 +19,7 @@ public RelationDeletedWebhookEvent( } public override string Alias => "relationDeleted"; + + public override object? ConvertNotificationToRequestPayload(RelationDeletedNotification notification) + => notification.DeletedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs index dd385b46451e..4cc775aa219d 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationSavedWebhookEvent.cs @@ -19,4 +19,7 @@ public RelationSavedWebhookEvent( } public override string Alias => "relationSaved"; + + public override object? ConvertNotificationToRequestPayload(RelationSavedNotification notification) + => notification.SavedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs index e7c63e5f8556..625be64b6dec 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs @@ -20,4 +20,7 @@ public RelationTypeDeletedWebhookEvent( public override string Alias => "relationTypeDeleted"; + + public override object? ConvertNotificationToRequestPayload(RelationTypeDeletedNotification notification) + => notification.DeletedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs index ce065b0a6d8b..6af165c03bd1 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs @@ -19,4 +19,7 @@ public RelationTypeSavedWebhookEvent( } public override string Alias => "relationTypeSaved"; + + public override object? ConvertNotificationToRequestPayload(RelationTypeSavedNotification notification) + => notification.SavedEntities; } From 08f4ae13185d66103fd4ca93958a50c27824ff4b Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 22 Nov 2023 13:14:05 +0000 Subject: [PATCH 35/52] Refined the PublicAccess webhooks mostly to remove Messages & State properties --- .../PublicAccess/PublicAccessEntryDeletedWebhookEvent.cs | 2 ++ .../Events/PublicAccess/PublicAccessEntrySavedWebhookEvent.cs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntryDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntryDeletedWebhookEvent.cs index c4e8c68cd592..00f5a2ca86f7 100644 --- a/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntryDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntryDeletedWebhookEvent.cs @@ -19,4 +19,6 @@ public PublicAccessEntryDeletedWebhookEvent( } public override string Alias => "publicAccessEntryDeleted"; + + public override object? ConvertNotificationToRequestPayload(PublicAccessEntryDeletedNotification notification) => notification.DeletedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntrySavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntrySavedWebhookEvent.cs index 2daa8b4cfb96..3977db2832b5 100644 --- a/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntrySavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/PublicAccess/PublicAccessEntrySavedWebhookEvent.cs @@ -19,4 +19,7 @@ public PublicAccessEntrySavedWebhookEvent( } public override string Alias => "publicAccessEntrySaved"; + + public override object? ConvertNotificationToRequestPayload(PublicAccessEntrySavedNotification notification) + => notification.SavedEntities; } From c9619bc9875725cee4b777a86c952235201c1335 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 22 Nov 2023 14:00:40 +0000 Subject: [PATCH 36/52] Refined the MemberType webhooks mostly to remove Messages & State properties --- .../Events/MemberType/MemberTypeChangedWebhookEvent.cs | 3 +++ .../Events/MemberType/MemberTypeDeletedWebhookEvent.cs | 3 +++ .../Events/MemberType/MemberTypeMovedWebhookEvent.cs | 5 ++++- .../Events/MemberType/MemberTypeSavedWebhookEvent.cs | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeChangedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeChangedWebhookEvent.cs index 727c6617e255..65f49abb30f2 100644 --- a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeChangedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeChangedWebhookEvent.cs @@ -19,4 +19,7 @@ public MemberTypeChangedWebhookEvent( } public override string Alias => "memberTypeChanged"; + + public override object? ConvertNotificationToRequestPayload(MemberTypeChangedNotification notification) + => notification.Changes; } diff --git a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeDeletedWebhookEvent.cs index 481f0eb6dd2d..fd9bc12e251e 100644 --- a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeDeletedWebhookEvent.cs @@ -19,4 +19,7 @@ public MemberTypeDeletedWebhookEvent( } public override string Alias => "memberTypeDeleted"; + + public override object? ConvertNotificationToRequestPayload(MemberTypeDeletedNotification notification) + => notification.DeletedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeMovedWebhookEvent.cs index cabab8010a01..0020ee61dd22 100644 --- a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeMovedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeMovedWebhookEvent.cs @@ -7,7 +7,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.MemberType; [WebhookEvent("MemberType Moved")] -public class MemberTypeMovedWebhookEvent : WebhookEventBase +public class MemberTypeMovedWebhookEvent : WebhookEventBase { public MemberTypeMovedWebhookEvent( IWebhookFiringService webhookFiringService, @@ -19,4 +19,7 @@ public MemberTypeMovedWebhookEvent( } public override string Alias => "memberTypeMoved"; + + public override object? ConvertNotificationToRequestPayload(MemberTypeMovedNotification notification) + => notification.MoveInfoCollection; } diff --git a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeSavedWebhookEvent.cs index ed57c7f7bd2e..428803a34838 100644 --- a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeSavedWebhookEvent.cs @@ -19,4 +19,7 @@ public MemberTypeSavedWebhookEvent( } public override string Alias => "memberTypeSaved"; + + public override object? ConvertNotificationToRequestPayload(MemberTypeSavedNotification notification) => + notification.SavedEntities; } From b68d3b607fd445bbb1f1dbd06058d9915e27f624 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 22 Nov 2023 14:02:41 +0000 Subject: [PATCH 37/52] Refined the Member webhooks mostly to remove Messages & State properties --- .../Webhooks/Events/Member/MemberGroupDeletedWebhookEvent.cs | 3 +++ .../Webhooks/Events/Member/MemberGroupSavedWebhookEvent.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupDeletedWebhookEvent.cs index e00816312fb7..ab41dfed07f5 100644 --- a/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupDeletedWebhookEvent.cs @@ -19,4 +19,7 @@ public MemberGroupDeletedWebhookEvent( } public override string Alias => "memberGroupDeleted"; + + public override object? ConvertNotificationToRequestPayload(MemberGroupDeletedNotification notification) + => notification.DeletedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupSavedWebhookEvent.cs index e0be3df61d21..19d3e7d4b293 100644 --- a/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Member/MemberGroupSavedWebhookEvent.cs @@ -19,4 +19,7 @@ public MemberGroupSavedWebhookEvent( } public override string Alias => "memberGroupSaved"; + + public override object? ConvertNotificationToRequestPayload(MemberGroupSavedNotification notification) + => notification.SavedEntities; } From 4da31cecc6e2278366ef6cb49c2feeb2128b2ccc Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 22 Nov 2023 14:06:53 +0000 Subject: [PATCH 38/52] Refined the Media webhooks mostly to remove Messages & State properties --- .../Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs | 3 +++ .../Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs | 3 +++ .../Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs | 3 +++ .../Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs index 175559e1ec8d..ab6b96078fe5 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs @@ -19,4 +19,7 @@ public MediaTypeChangedWebhookEvent( } public override string Alias => "mediaTypeChanged"; + + public override object? ConvertNotificationToRequestPayload(MediaTypeChangedNotification notification) + => notification.Changes; } diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs index 9cc85cca1919..6b3e7d5cf3ee 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs @@ -19,4 +19,7 @@ public MediaTypeDeletedWebhookEvent( } public override string Alias => "mediaTypeDeleted"; + + public override object? ConvertNotificationToRequestPayload(MediaTypeDeletedNotification notification) + => notification.DeletedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs index 8a9d0b8a4560..4f28146574d4 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs @@ -19,4 +19,7 @@ public MediaTypeMovedWebhookEvent( } public override string Alias => "mediaTypeMoved"; + + public override object? ConvertNotificationToRequestPayload(MediaTypeMovedNotification notification) + => notification.MoveInfoCollection; } diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs index 6b421031264a..839d17a9c6d9 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs @@ -19,4 +19,7 @@ public MediaTypeSavedWebhookEvent( } public override string Alias => "mediaTypeSaved"; + + public override object? ConvertNotificationToRequestPayload(MediaTypeSavedNotification notification) + => notification.SavedEntities; } From 88179ff6a60bf1f1bfc72aa59416905b0fc5f1e7 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 22 Nov 2023 14:07:14 +0000 Subject: [PATCH 39/52] Refined the Language webhooks mostly to remove Messages & State properties --- .../Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs | 3 +++ .../Webhooks/Events/Language/LanguageSavedWebhookEvent.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs index f1db8d74ac3d..98ebd4d5c843 100644 --- a/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Language/LanguageDeletedWebhookEvent.cs @@ -19,4 +19,7 @@ public LanguageDeletedWebhookEvent( } public override string Alias => "languageDeleted"; + + public override object? ConvertNotificationToRequestPayload(LanguageDeletedNotification notification) + => notification.DeletedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs index fbf1a3c2e9ed..ccc52f4245c5 100644 --- a/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Language/LanguageSavedWebhookEvent.cs @@ -19,5 +19,8 @@ public LanguageSavedWebhookEvent( } public override string Alias => "languageSaved"; + + public override object? ConvertNotificationToRequestPayload(LanguageSavedNotification notification) + => notification.SavedEntities; } From 05ccfd672529e2240ddbcd2eb5585eeeba561c65 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 22 Nov 2023 14:07:23 +0000 Subject: [PATCH 40/52] Refined the Domain webhooks mostly to remove Messages & State properties --- .../Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs | 3 +++ .../Webhooks/Events/Domain/DomainSavedWebhookEvent.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs index 873b4bc2a9a6..30605a28de3e 100644 --- a/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Domain/DomainDeletedWebhookEvent.cs @@ -19,4 +19,7 @@ public DomainDeletedWebhookEvent( } public override string Alias => "domainDeleted"; + + public override object? ConvertNotificationToRequestPayload(DomainDeletedNotification notification) + => notification.DeletedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs index f68e9cc1d2aa..5cd80f743b1b 100644 --- a/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Domain/DomainSavedWebhookEvent.cs @@ -19,4 +19,7 @@ public DomainSavedWebhookEvent( } public override string Alias => "domainSaved"; + + public override object? ConvertNotificationToRequestPayload(DomainSavedNotification notification) + => notification.SavedEntities; } From 8e0d8f3b8e476a5b0f1cecd53cdeb1070e5d9a84 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 22 Nov 2023 14:07:34 +0000 Subject: [PATCH 41/52] Refined the Dictionary webhooks mostly to remove Messages & State properties --- .../Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs | 3 +++ .../Events/Dictionary/DictionaryItemSavedWebhookEvent.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs index bd0cb9fcb6ff..fa3c95cea55b 100644 --- a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemDeletedWebhookEvent.cs @@ -19,4 +19,7 @@ public DictionaryItemDeletedWebhookEvent( } public override string Alias => "dictionaryItemDeleted"; + + public override object? ConvertNotificationToRequestPayload(DictionaryItemDeletedNotification notification) + => notification.DeletedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs index 9f2ac820137e..7edd4e784926 100644 --- a/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Dictionary/DictionaryItemSavedWebhookEvent.cs @@ -19,4 +19,7 @@ public DictionaryItemSavedWebhookEvent( } public override string Alias => "dictionaryItemSaved"; + + public override object? ConvertNotificationToRequestPayload(DictionaryItemSavedNotification notification) + => notification.SavedEntities; } From 29dc36ddac729d67e7eb8808fd7c525480e7d50f Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 22 Nov 2023 14:07:45 +0000 Subject: [PATCH 42/52] Refined the DataType webhooks mostly to remove Messages & State properties --- .../Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs | 3 +++ .../Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs | 3 +++ .../Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs index 1de8d78a4ca5..78594954633c 100644 --- a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs @@ -19,4 +19,7 @@ public DataTypeDeletedWebhookEvent( } public override string Alias => "dataTypeDeleted"; + + public override object? ConvertNotificationToRequestPayload(DataTypeSavedNotification notification) + => notification.SavedEntities; } diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs index d828c7b065b6..81b1dde31085 100644 --- a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs @@ -19,4 +19,7 @@ public DataTypeMovedWebhookEvent( } public override string Alias => "dataTypeMoved"; + + public override object? ConvertNotificationToRequestPayload(DataTypeMovedNotification notification) + => notification.MoveInfoCollection; } diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs index 0f52a1709043..caf211893148 100644 --- a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs @@ -19,4 +19,7 @@ public DataTypeSavedWebhookEvent( } public override string Alias => "dataTypeSaved"; + + public override object? ConvertNotificationToRequestPayload(DataTypeSavedNotification notification) + => notification.SavedEntities; } From 3897c568aef28ee2b8013032a3cdd49f7384f383 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 22 Nov 2023 14:38:16 +0000 Subject: [PATCH 43/52] Refined the Content webhooks mostly to remove Messages & State properties --- .../Events/Content/ContentCopiedWebhookEvent.cs | 12 +++++++++++- .../ContentDeletedVersionsWebhookEvent.cs | 12 +++++++++++- .../ContentEmptiedRecycleBinWebhookEvent.cs | 3 +-- .../ContentMovedToRecycleBinWebhookEvent.cs | 3 +++ .../Events/Content/ContentMovedWebhookEvent.cs | 4 +++- .../Events/Content/ContentRolledBack.cs | 2 +- .../Events/Content/ContentSortedWebhookEvent.cs | 17 ++++++++++------- 7 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentCopiedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentCopiedWebhookEvent.cs index d8840f4b9779..3d6f0163d70b 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentCopiedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentCopiedWebhookEvent.cs @@ -1,6 +1,5 @@ using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; @@ -24,4 +23,15 @@ public ContentCopiedWebhookEvent( } public override string Alias => Constants.WebhookEvents.Aliases.ContentCopied; + + public override object? ConvertNotificationToRequestPayload(ContentCopiedNotification notification) + { + return new + { + notification.Copy, + notification.Original, + notification.ParentId, + notification.RelateToOriginal + }; + } } diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedVersionsWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedVersionsWebhookEvent.cs index 98ec8465a2a8..c543bfe3cad7 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedVersionsWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedVersionsWebhookEvent.cs @@ -1,6 +1,5 @@ using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; @@ -24,4 +23,15 @@ public ContentDeletedVersionsWebhookEvent( } public override string Alias => Constants.WebhookEvents.Aliases.ContentDeletedVersions; + + public override object? ConvertNotificationToRequestPayload(ContentDeletedVersionsNotification notification) + { + return new + { + notification.Id, + notification.DeletePriorVersions, + notification.SpecificVersion, + notification.DateToRetain + }; + } } diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs index a8fc666694fc..8670d23c49e5 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentEmptiedRecycleBinWebhookEvent.cs @@ -2,7 +2,6 @@ using Umbraco.Cms.Core.Configuration.Models; using Umbraco.Cms.Core.DeliveryApi; using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.PublishedCache; using Umbraco.Cms.Core.Services; @@ -10,7 +9,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Content; -[WebhookEvent("Content Emptied Recycle Bin", Constants.WebhookEvents.Types.Content)] +[WebhookEvent("Content Recycle Bin Emptied", Constants.WebhookEvents.Types.Content)] public class ContentEmptiedRecycleBinWebhookEvent : WebhookEventContentBase { private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor; diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedToRecycleBinWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedToRecycleBinWebhookEvent.cs index dad704fef0ec..6ed74d8c66e4 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedToRecycleBinWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedToRecycleBinWebhookEvent.cs @@ -23,4 +23,7 @@ public ContentMovedToRecycleBinWebhookEvent( } public override string Alias => Constants.WebhookEvents.Aliases.ContentMovedToRecycleBin; + + public override object? ConvertNotificationToRequestPayload(ContentMovedToRecycleBinNotification notification) + => notification.MoveInfoCollection; } diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedWebhookEvent.cs index fa1eb9dec6d6..46d487c499e0 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentMovedWebhookEvent.cs @@ -1,6 +1,5 @@ using Microsoft.Extensions.Options; using Umbraco.Cms.Core.Configuration.Models; -using Umbraco.Cms.Core.Models; using Umbraco.Cms.Core.Notifications; using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; @@ -24,4 +23,7 @@ public ContentMovedWebhookEvent( } public override string Alias => Constants.WebhookEvents.Aliases.ContentMoved; + + public override object? ConvertNotificationToRequestPayload(ContentMovedNotification notification) + => notification.MoveInfoCollection; } diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentRolledBack.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentRolledBack.cs index 55064912b971..f38ff571f908 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentRolledBack.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentRolledBack.cs @@ -45,7 +45,7 @@ protected override IEnumerable GetEntitiesFromNotification(ContentRoll return null; } - // Get preview/saved version of content as a rollback + // Get preview/saved version of content for a rollback IPublishedContent? publishedContent = publishedSnapshot.Content.GetById(true, entity.Key); return publishedContent is null ? null : _apiContentBuilder.Build(publishedContent); } diff --git a/src/Umbraco.Core/Webhooks/Events/Content/ContentSortedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Content/ContentSortedWebhookEvent.cs index bd706aef0b6d..d2a95028e2fd 100644 --- a/src/Umbraco.Core/Webhooks/Events/Content/ContentSortedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Content/ContentSortedWebhookEvent.cs @@ -11,7 +11,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Content; [WebhookEvent("Content Sorted", Constants.WebhookEvents.Types.Content)] -public class ContentSortedWebhookEvent : WebhookEventContentBase +public class ContentSortedWebhookEvent : WebhookEventBase { private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor; private readonly IApiContentBuilder _apiContentBuilder; @@ -35,16 +35,19 @@ public ContentSortedWebhookEvent( public override string Alias => Constants.WebhookEvents.Aliases.ContentSorted; - protected override IEnumerable GetEntitiesFromNotification(ContentSortedNotification notification) => notification.SortedEntities; - - protected override object? ConvertEntityToRequestPayload(IContent entity) + public override object? ConvertNotificationToRequestPayload(ContentSortedNotification notification) { if (_publishedSnapshotAccessor.TryGetPublishedSnapshot(out IPublishedSnapshot? publishedSnapshot) is false || publishedSnapshot!.Content is null) { return null; } - - IPublishedContent? publishedContent = publishedSnapshot.Content.GetById(entity.Key); - return publishedContent is null ? null : _apiContentBuilder.Build(publishedContent); + var sortedEntities = new List(); + foreach (var entity in notification.SortedEntities) + { + IPublishedContent? publishedContent = publishedSnapshot.Content.GetById(entity.Key); + object? payload = publishedContent is null ? null : _apiContentBuilder.Build(publishedContent); + sortedEntities.Add(payload); + } + return sortedEntities; } } From 58aa1d87720a23d7c7f67a8445b57fcd9346f088 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 28 Nov 2023 11:26:59 +0000 Subject: [PATCH 44/52] Updates the infinite editor for the WebHook events to be sorted by their friendly name --- .../eventpicker/eventpicker.html | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/eventpicker/eventpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/eventpicker/eventpicker.html index e65a5f767f41..e961c1db4dec 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/eventpicker/eventpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/eventpicker/eventpicker.html @@ -2,8 +2,12 @@ - - + @@ -13,11 +17,14 @@
    -
  • +
  • - -
    -
  • -
+ + +
+
    +
  • +
    + +
    +
  • +
+
+ + + No events were found + +
From 43ca562ebe89dc404c67900e6f54788ed51b63f4 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 28 Nov 2023 12:20:59 +0000 Subject: [PATCH 46/52] Add a language key webhooks_noEventsFound --- src/Umbraco.Core/EmbeddedResources/Lang/en.xml | 1 + src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml | 1 + .../views/common/infiniteeditors/eventpicker/eventpicker.html | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml index 572fe05dd4bc..492cb762cf6b 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml @@ -1941,6 +1941,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Create header Logs No webhook headers have been added + No events were found. Add language diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml index 33901735eec1..12fdf928c236 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml @@ -2023,6 +2023,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Create header Logs No webhook headers have been added + No events were found. Add language diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/eventpicker/eventpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/eventpicker/eventpicker.html index b5402cca3571..e87674791c36 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/eventpicker/eventpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/eventpicker/eventpicker.html @@ -49,8 +49,7 @@ - No events were found - + No events were found. From c32d2beb4b4f8a5674e486c6a642f9f328f19ef7 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 30 Nov 2023 15:03:26 +0100 Subject: [PATCH 47/52] Spell MediaType without space, consistent with the other Types --- .../Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs | 2 +- .../Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs | 2 +- .../Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs index ab6b96078fe5..d41bec7e62b1 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Media; -[WebhookEvent("Media Type Changed")] +[WebhookEvent("MediaType Changed")] public class MediaTypeChangedWebhookEvent : WebhookEventBase { public MediaTypeChangedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs index 6b3e7d5cf3ee..362375d430e7 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Media; -[WebhookEvent("Media Type Deleted")] +[WebhookEvent("MediaType Deleted")] public class MediaTypeDeletedWebhookEvent : WebhookEventBase { public MediaTypeDeletedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs index 4f28146574d4..29cfaf905b4a 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Media; -[WebhookEvent("Media Type Moved")] +[WebhookEvent("MediaType Moved")] public class MediaTypeMovedWebhookEvent : WebhookEventBase { public MediaTypeMovedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs index 839d17a9c6d9..d5e7f079fc1b 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Media; -[WebhookEvent("Media Type Saved")] +[WebhookEvent("MediaType Saved")] public class MediaTypeSavedWebhookEvent : WebhookEventBase { public MediaTypeSavedWebhookEvent( From f4399ed0112a494f9a3790de3a38039ba0fef7c9 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 30 Nov 2023 15:05:38 +0100 Subject: [PATCH 48/52] Clarify method name --- src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index f403f4687ec1..ef1708757bb3 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -86,7 +86,7 @@ private void RegisterTypes(IServiceCollection services) return null; } - public WebhookEventCollectionBuilder AddAllTheWebhooks() => + public WebhookEventCollectionBuilder AddAllAvailableWebhooks() => this.AddContentWebhooks() .AddDataTypeWebhooks() .AddDictionaryWebhooks() From dadf2c7a23a1e9c8881195a8fa89501f2c7aa1cf Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 30 Nov 2023 15:10:02 +0100 Subject: [PATCH 49/52] Spell RelationType without space, consistent with the other Types --- .../Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs index 625be64b6dec..d3fd6a75a9ed 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Relation; -[WebhookEvent("Relation Type Deleted")] +[WebhookEvent("RelationType Deleted")] public class RelationTypeDeletedWebhookEvent : WebhookEventBase { public RelationTypeDeletedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs index 6af165c03bd1..b486a5fa8501 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Relation; -[WebhookEvent("Relation Type Saved")] +[WebhookEvent("RelationType Saved")] public class RelationTypeSavedWebhookEvent : WebhookEventBase { public RelationTypeSavedWebhookEvent( From cd626b1e8b168612aedab7576fcbba20ce6dbd4c Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 30 Nov 2023 15:20:07 +0100 Subject: [PATCH 50/52] Correct wrong names --- .../Webhooks/Events/User/UserLogoutSuccessWebhookEvent.cs | 2 +- .../Webhooks/Events/User/UserUnlockedWebhookEvent.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserLogoutSuccessWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserLogoutSuccessWebhookEvent.cs index 5efb9e59c54a..dc0f8d7bb232 100644 --- a/src/Umbraco.Core/Webhooks/Events/User/UserLogoutSuccessWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/User/UserLogoutSuccessWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.User; -[WebhookEvent("User Login Success")] +[WebhookEvent("User Logout Success")] public class UserLogoutSuccessWebhookEvent : WebhookEventBase { public UserLogoutSuccessWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserUnlockedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserUnlockedWebhookEvent.cs index 09037acac5e9..53afc638ca24 100644 --- a/src/Umbraco.Core/Webhooks/Events/User/UserUnlockedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/User/UserUnlockedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.User; -[WebhookEvent("User Locked")] +[WebhookEvent("User unlocked")] public class UserUnlockedWebhookEvent : WebhookEventBase { public UserUnlockedWebhookEvent( From 34e381fd538c69676efbf7bf767aef4c96330db7 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 30 Nov 2023 15:26:24 +0100 Subject: [PATCH 51/52] Consistency in folders and naming (everything WITH a space - changed my mind from before) --- .../Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs | 2 +- .../Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs | 2 +- .../{Media => MediaType}/MediaTypeChangedWebhookEvent.cs | 4 ++-- .../{Media => MediaType}/MediaTypeDeletedWebhookEvent.cs | 4 ++-- .../Events/{Media => MediaType}/MediaTypeMovedWebhookEvent.cs | 4 ++-- .../Events/{Media => MediaType}/MediaTypeSavedWebhookEvent.cs | 4 ++-- .../Events/MemberType/MemberTypeChangedWebhookEvent.cs | 2 +- .../Events/MemberType/MemberTypeDeletedWebhookEvent.cs | 2 +- .../Webhooks/Events/MemberType/MemberTypeMovedWebhookEvent.cs | 2 +- .../Webhooks/Events/MemberType/MemberTypeSavedWebhookEvent.cs | 2 +- .../RelationTypeDeletedWebhookEvent.cs | 4 ++-- .../RelationTypeSavedWebhookEvent.cs | 4 ++-- src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs | 2 ++ 14 files changed, 21 insertions(+), 19 deletions(-) rename src/Umbraco.Core/Webhooks/Events/{Media => MediaType}/MediaTypeChangedWebhookEvent.cs (90%) rename src/Umbraco.Core/Webhooks/Events/{Media => MediaType}/MediaTypeDeletedWebhookEvent.cs (90%) rename src/Umbraco.Core/Webhooks/Events/{Media => MediaType}/MediaTypeMovedWebhookEvent.cs (90%) rename src/Umbraco.Core/Webhooks/Events/{Media => MediaType}/MediaTypeSavedWebhookEvent.cs (90%) rename src/Umbraco.Core/Webhooks/Events/{Relation => RelationType}/RelationTypeDeletedWebhookEvent.cs (89%) rename src/Umbraco.Core/Webhooks/Events/{Relation => RelationType}/RelationTypeSavedWebhookEvent.cs (89%) diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs index 78594954633c..b121c6f394dd 100644 --- a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeDeletedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.DataType; -[WebhookEvent("DataType Deleted")] +[WebhookEvent("Data Type Deleted")] public class DataTypeDeletedWebhookEvent : WebhookEventBase { public DataTypeDeletedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs index 81b1dde31085..03c0954305be 100644 --- a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeMovedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.DataType; -[WebhookEvent("DataType Moved")] +[WebhookEvent("Data Type Moved")] public class DataTypeMovedWebhookEvent : WebhookEventBase { public DataTypeMovedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs index caf211893148..a6e5afe189af 100644 --- a/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/DataType/DataTypeSavedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.DataType; -[WebhookEvent("DataType Saved")] +[WebhookEvent("Data Type Saved")] public class DataTypeSavedWebhookEvent : WebhookEventBase { public DataTypeSavedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MediaType/MediaTypeChangedWebhookEvent.cs similarity index 90% rename from src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/MediaType/MediaTypeChangedWebhookEvent.cs index d41bec7e62b1..23decd003229 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeChangedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/MediaType/MediaTypeChangedWebhookEvent.cs @@ -4,9 +4,9 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Media; +namespace Umbraco.Cms.Core.Webhooks.Events.MediaType; -[WebhookEvent("MediaType Changed")] +[WebhookEvent("Media Type Changed")] public class MediaTypeChangedWebhookEvent : WebhookEventBase { public MediaTypeChangedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MediaType/MediaTypeDeletedWebhookEvent.cs similarity index 90% rename from src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/MediaType/MediaTypeDeletedWebhookEvent.cs index 362375d430e7..7b46967d06bd 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/MediaType/MediaTypeDeletedWebhookEvent.cs @@ -4,9 +4,9 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Media; +namespace Umbraco.Cms.Core.Webhooks.Events.MediaType; -[WebhookEvent("MediaType Deleted")] +[WebhookEvent("Media Type Deleted")] public class MediaTypeDeletedWebhookEvent : WebhookEventBase { public MediaTypeDeletedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MediaType/MediaTypeMovedWebhookEvent.cs similarity index 90% rename from src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/MediaType/MediaTypeMovedWebhookEvent.cs index 29cfaf905b4a..ae2a35995ea4 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeMovedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/MediaType/MediaTypeMovedWebhookEvent.cs @@ -4,9 +4,9 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Media; +namespace Umbraco.Cms.Core.Webhooks.Events.MediaType; -[WebhookEvent("MediaType Moved")] +[WebhookEvent("Media Type Moved")] public class MediaTypeMovedWebhookEvent : WebhookEventBase { public MediaTypeMovedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MediaType/MediaTypeSavedWebhookEvent.cs similarity index 90% rename from src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/MediaType/MediaTypeSavedWebhookEvent.cs index d5e7f079fc1b..818b38f71b17 100644 --- a/src/Umbraco.Core/Webhooks/Events/Media/MediaTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/MediaType/MediaTypeSavedWebhookEvent.cs @@ -4,9 +4,9 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Media; +namespace Umbraco.Cms.Core.Webhooks.Events.MediaType; -[WebhookEvent("MediaType Saved")] +[WebhookEvent("Media Type Saved")] public class MediaTypeSavedWebhookEvent : WebhookEventBase { public MediaTypeSavedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeChangedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeChangedWebhookEvent.cs index 65f49abb30f2..68c4424e484b 100644 --- a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeChangedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeChangedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.MemberType; -[WebhookEvent("MemberType Changed")] +[WebhookEvent("Member Type Changed")] public class MemberTypeChangedWebhookEvent : WebhookEventBase { public MemberTypeChangedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeDeletedWebhookEvent.cs index fd9bc12e251e..005143826cae 100644 --- a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeDeletedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.MemberType; -[WebhookEvent("MemberType Deleted")] +[WebhookEvent("Member Type Deleted")] public class MemberTypeDeletedWebhookEvent : WebhookEventBase { public MemberTypeDeletedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeMovedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeMovedWebhookEvent.cs index 0020ee61dd22..ddef29a0c2f5 100644 --- a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeMovedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeMovedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.MemberType; -[WebhookEvent("MemberType Moved")] +[WebhookEvent("Member Type Moved")] public class MemberTypeMovedWebhookEvent : WebhookEventBase { public MemberTypeMovedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeSavedWebhookEvent.cs index 428803a34838..db4bcf8ad4a2 100644 --- a/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/MemberType/MemberTypeSavedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.MemberType; -[WebhookEvent("MemberType Saved")] +[WebhookEvent("Member Type Saved")] public class MemberTypeSavedWebhookEvent : WebhookEventBase { public MemberTypeSavedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/RelationType/RelationTypeDeletedWebhookEvent.cs similarity index 89% rename from src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/RelationType/RelationTypeDeletedWebhookEvent.cs index d3fd6a75a9ed..41f9619a4165 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeDeletedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/RelationType/RelationTypeDeletedWebhookEvent.cs @@ -4,9 +4,9 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Relation; +namespace Umbraco.Cms.Core.Webhooks.Events.RelationType; -[WebhookEvent("RelationType Deleted")] +[WebhookEvent("Relation Type Deleted")] public class RelationTypeDeletedWebhookEvent : WebhookEventBase { public RelationTypeDeletedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/RelationType/RelationTypeSavedWebhookEvent.cs similarity index 89% rename from src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs rename to src/Umbraco.Core/Webhooks/Events/RelationType/RelationTypeSavedWebhookEvent.cs index b486a5fa8501..915e95c6cbb6 100644 --- a/src/Umbraco.Core/Webhooks/Events/Relation/RelationTypeSavedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/RelationType/RelationTypeSavedWebhookEvent.cs @@ -4,9 +4,9 @@ using Umbraco.Cms.Core.Services; using Umbraco.Cms.Core.Sync; -namespace Umbraco.Cms.Core.Webhooks.Events.Relation; +namespace Umbraco.Cms.Core.Webhooks.Events.RelationType; -[WebhookEvent("RelationType Saved")] +[WebhookEvent("Relation Type Saved")] public class RelationTypeSavedWebhookEvent : WebhookEventBase { public RelationTypeSavedWebhookEvent( diff --git a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs index ef1708757bb3..9ebc7ee13fb1 100644 --- a/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs +++ b/src/Umbraco.Core/Webhooks/WebhookEventCollectionBuilder.cs @@ -8,11 +8,13 @@ using Umbraco.Cms.Core.Webhooks.Events.Domain; using Umbraco.Cms.Core.Webhooks.Events.Language; using Umbraco.Cms.Core.Webhooks.Events.Media; +using Umbraco.Cms.Core.Webhooks.Events.MediaType; using Umbraco.Cms.Core.Webhooks.Events.Member; using Umbraco.Cms.Core.Webhooks.Events.MemberType; using Umbraco.Cms.Core.Webhooks.Events.Package; using Umbraco.Cms.Core.Webhooks.Events.PublicAccess; using Umbraco.Cms.Core.Webhooks.Events.Relation; +using Umbraco.Cms.Core.Webhooks.Events.RelationType; using Umbraco.Cms.Core.Webhooks.Events.Script; using Umbraco.Cms.Core.Webhooks.Events.Stylesheet; using Umbraco.Cms.Core.Webhooks.Events.Template; From 6db15aa6783ddfed34293cb2a8891ecd20dc4675 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 30 Nov 2023 15:29:44 +0100 Subject: [PATCH 52/52] More consistency --- .../Webhooks/Events/Package/ImportedPackageWebhookEvent.cs | 4 ++-- .../Webhooks/Events/User/UserUnlockedWebhookEvent.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs index b629ce394962..8495dde4c2d9 100644 --- a/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/Package/ImportedPackageWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.Package; -[WebhookEvent("Imported Package")] +[WebhookEvent("Package Imported")] public class ImportedPackageWebhookEvent : WebhookEventBase { public ImportedPackageWebhookEvent( @@ -18,5 +18,5 @@ public ImportedPackageWebhookEvent( { } - public override string Alias => "importedPackage"; + public override string Alias => "packageImported"; } diff --git a/src/Umbraco.Core/Webhooks/Events/User/UserUnlockedWebhookEvent.cs b/src/Umbraco.Core/Webhooks/Events/User/UserUnlockedWebhookEvent.cs index 53afc638ca24..a6aea6219695 100644 --- a/src/Umbraco.Core/Webhooks/Events/User/UserUnlockedWebhookEvent.cs +++ b/src/Umbraco.Core/Webhooks/Events/User/UserUnlockedWebhookEvent.cs @@ -6,7 +6,7 @@ namespace Umbraco.Cms.Core.Webhooks.Events.User; -[WebhookEvent("User unlocked")] +[WebhookEvent("User Unlocked")] public class UserUnlockedWebhookEvent : WebhookEventBase { public UserUnlockedWebhookEvent(