-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use fluent API for adding webhook events and add document type events (…
…#15345) * Move adding webhooks to extension methods * Clean up WebhookEventCollectionBuilder * Rename AddAllAvailableWebhooks to AddCmsWebhooks and internalize defaults * Use fluent CmsWebhookEventCollectionBuilder for adding CMS specific webhook events * Split media and media type webhook events * Use fluent CmsUserWebhookEventCollectionBuilder for adding CMS user specific webhook events * Rename extension methods and add onlyDefault parameter * Remove duplicate UserForgotPasswordRequestedWebhookEvent * Add document type webhook events and use fluent builders for content and content types * Use fluent WebhookEventCollectionBuilderCmsMember for adding member/member group webhook events * Use fluent WebhookEventCollectionBuilderCmsTemplate for template/partial view webhook events * Use fluent WebhookEventCollectionBuilderCmsFile for file based webhook events (instead of only template/partial view) * Move all webhook events to Umbraco.Cms.Core.Webhooks.Events namespace * Reorder AddFile method and update documentation
- Loading branch information
1 parent
da56f16
commit c20d96c
Showing
86 changed files
with
1,023 additions
and
403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Umbraco.Core/Webhooks/Events/Content/ContentCopiedWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedBlueprintWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedVersionsWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Umbraco.Core/Webhooks/Events/Content/ContentDeletedWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Umbraco.Core/Webhooks/Events/Content/ContentMovedToRecycleBinWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Umbraco.Core/Webhooks/Events/Content/ContentMovedWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Umbraco.Core/Webhooks/Events/Content/ContentSavedBlueprintWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Umbraco.Core/Webhooks/Events/Content/ContentUnpublishedWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/Umbraco.Core/Webhooks/Events/ContentType/DocumentTypeChangedWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
[WebhookEvent("Document Type Changed")] | ||
public class DocumentTypeChangedWebhookEvent : WebhookEventBase<ContentTypeChangedNotification> | ||
{ | ||
public DocumentTypeChangedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "documentTypeChanged"; | ||
|
||
public override object? ConvertNotificationToRequestPayload(ContentTypeChangedNotification notification) | ||
=> notification.Changes; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Umbraco.Core/Webhooks/Events/ContentType/DocumentTypeDeletedWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
[WebhookEvent("Document Type Deleted")] | ||
public class DocumentTypeDeletedWebhookEvent : WebhookEventBase<ContentTypeDeletedNotification> | ||
{ | ||
public DocumentTypeDeletedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "documentTypeDeleted"; | ||
|
||
public override object? ConvertNotificationToRequestPayload(ContentTypeDeletedNotification notification) | ||
=> notification.DeletedEntities; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Umbraco.Core/Webhooks/Events/ContentType/DocumentTypeMovedWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
[WebhookEvent("Document Type Moved")] | ||
public class DocumentTypeMovedWebhookEvent : WebhookEventBase<ContentTypeMovedNotification> | ||
{ | ||
public DocumentTypeMovedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "documentTypeMoved"; | ||
|
||
public override object? ConvertNotificationToRequestPayload(ContentTypeMovedNotification notification) | ||
=> notification.MoveInfoCollection; | ||
} |
25 changes: 25 additions & 0 deletions
25
src/Umbraco.Core/Webhooks/Events/ContentType/DocumentTypeSavedWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
[WebhookEvent("Document Type Saved")] | ||
public class DocumentTypeSavedWebhookEvent : WebhookEventBase<ContentTypeSavedNotification> | ||
{ | ||
public DocumentTypeSavedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "documentTypeSaved"; | ||
|
||
public override object? ConvertNotificationToRequestPayload(ContentTypeSavedNotification notification) | ||
=> notification.SavedEntities; | ||
} |
4 changes: 2 additions & 2 deletions
4
...MediaType/MediaTypeChangedWebhookEvent.cs → ...ntentType/MediaTypeChangedWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...mberType/MemberTypeChangedWebhookEvent.cs → ...tentType/MemberTypeChangedWebhookEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.