Commit Graph

16 Commits

Author SHA1 Message Date
Erik-Jan Westendorp
ce769ffff4 Add health checks results to payload 2024-03-05 14:24:34 +03:00
Erik-Jan Westendorp
7256d49761 Use constants for all webhook event aliases (#15492)
* Use constants for all webhook event aliases

* Fix
2024-01-30 02:52:50 +01:00
Erik-Jan Westendorp
6c725dbd67 Fix aliases 2024-01-03 13:20:12 +01:00
Ronald Barendse
c598171d85 Change WebhookEventCollectionBuilder to set collection (#15351)
* Change WebhookEventCollectionBuilder to set collection

* Fix AddHealthCheck extension method
2023-12-05 10:33:47 +01:00
Ronald Barendse
8a65c00279 Fix health check webhook event registration 2023-12-04 14:11:42 +01:00
Erik-Jan Westendorp
80dcc04df0 Add HealthCheckCompletedWebhookEvent (#15337) 2023-12-04 14:04:57 +01:00
Ronald Barendse
c20d96c705 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
2023-12-04 13:25:51 +01:00
Ronald Barendse
da56f16abf Move helper methods for adding webhooks to extension methods (#15344)
* Move adding webhooks to extension methods

* Clean up WebhookEventCollectionBuilder

* Rename AddAllAvailableWebhooks to AddCmsWebhooks and internalize defaults
2023-12-04 10:58:11 +01:00
Warren Buckley
d088ed8bf6 V13: Webhook all the things (#15161) 2023-11-30 15:41:45 +01:00
Nikolaj Geisle
8755703845 V13: Implement webook as i entity (#15267)
* Add webhook service to service context

* Refactor webhooks to implement IEntity

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-21 14:38:47 +01:00
Andy Butland
8f8302358a Added notifications to the webhook service (#15174)
* Added webhooks to UdiEntityTypes and UdiGetterExtensions.

* Renamed IWebhookservice and amended signature of CreateAsync to allow returning of null.
Added notifications for webhooks.

* Further renames.

* Fixed failing unit test.

* Removed inadvertently added file.
2023-11-10 10:17:36 +01:00
Nikolaj Geisle
e143133bcf V13: Update IWebHookService to proper casing (#15169)
* Update to proper casing

* Fixed naming

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Andreas Zerbst <andr317c@live.dk>
2023-11-10 08:20:22 +01:00
Nikolaj Geisle
7bde16b4ef V13: Add eventype to webhookevents (#15157)
* Refactor IWebhookEvent to contain event type.

* refactor frontend to filter on eventType.

* Display event names

* refactor to use eventNames

* remove npm from overview

* implement alias for WebhookEvents

* Implement [WebhookEvent] attribute

* Refactor IWebhookService to get by event alias and not name

* Rename parameter to fit method name

* to lower event type to avoid casing issues

* Apply suggestions from code review

Co-authored-by: Ronald Barendse <ronald@barend.se>

* Change event names from constants to hard coded. And give more friendly names

* Refactor to not use event names, where it was not intended

* Add renaming column migration

* display event alias in logs

* Update migration to check if old column is there

* Apply suggestions from code review

Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>

* add determineResource function to avoid duplicate code

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Ronald Barendse <ronald@barend.se>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
2023-11-09 14:18:34 +01:00
Kevin Jump
c31df57bdc New WebhookEventBase class (#15129)
(cherry picked from commit 145107be45)
2023-11-06 08:23:34 +01:00
Nikolaj Geisle
ff05886e43 Remove setter from WebhookEvent (#15106)
Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-11-02 14:37:28 +01:00
Nikolaj Geisle
1b34d33eb7 Webhooks administration from Backoffice (#15050)
* Create webhook models

* Define interfaces for service and repository

* Create Webhook dto and corresponding factory

* implement WebhookRepository.cs

* Remove entity name from models, as that should be resolved in mapping instead

* Add new table to schema creator

* Register repo for DI

* Remove more mentions of entityname

* Refactor repository to guids

* Implement WebhookService

* Use scopes in service

* Start creating tests for service

* Refactor delete to use Id and not entire entity

* Rework Webhooks to be able to have multiple entity keys

* Implement GetAll functionality

* Implement webhook controller

* Imeplement get all events action

* Add equalityComparer deletegate to Webhook

* Add datacontract attirbutes to properties

* Implement backoffice webhooks tree

* Implement first webhooks menu

* Make WebHookController authorized

* Update to have tabs with webhooks and logs

* Enable create overlay

* Push to entityKeys array

* Fix up pagination

* Implement delete functionality

* remove pagination

* add log view

* Fix create to be able to select more than one content type

* implement type name resolving for content

* Refactor to use less duplication

* Implement update functionality in frontend

* Rename database table

* Make multiple events possible

* create new event picker

* Refactor to actually add new database table with proper name

* Make it possible to select multiple events

* Fix updating current items

* Fix up update functionality after db rework

* Add webhook icon

* Switch to match heartcore icons

* Refactor to use bases instead of Enum

* Refactor to make IWebhookEvent to Collection, so it can be injected instead of using reflection

* Fix up frontend to match new models

* Fix integration tests

* Remove obsolete entity key from webhookdto

* Introduce constants instead of hard coded strings

* Start implementation of firing mechanism

* Add new GetByEventName method

* Add 1 to many list on WebhookDto

* Implement new repository pattern

* Implement GetByEventName

* Fix up repository to use all async

* Refactor events to fire

* Refactor WebhookEvents to be more DRY

* Add custom header

* Start implementing log repository

* Implement GetPaged

* Implement WebhookLogService

* Implement GetLogs

* Add url to webhook log

* Implement log overview

* Formatting

* Implement details view

* Refactor to get actual retry count

* Refactor firing to fire only when Enabled

* Add Status code to detailed view

* Add configuration to disable webhooks entirely

* Implement custom headers frontend

* Implement persistence of custom headers

* Refactor retry service to also retry on non success status codes.

* Refactor registration of Webhooks, to also register as NotificationHandler

* Add webhooks migration

* Add key for adding webhook headers

* Fix up test

* Change event icon to flag

* Remember event, when editing what events you have chosen

* Refactor reflection to check if INotificationAsyncHandler instead

* Formatting

* Refactor webhook model to no longer derive from EntityBase

* Rename entityKeys to content keys

* Rename controller to lowercase H

* Add null check before trying to access selectedEvents

* Add configuration for maximum number of retries

* Add index to date

* Add webhook Key to logs

* Check for SchedulingPublisher before sending webhooks

* rename requestObject to payload

* Refactor event to send appropriate payloads

* Refactor logging to happen for every try.

* Order date by descending

* Add todo

* Change firing service to use String not ByteContent

* Update Headers to Interface instead of concrete implementation

* Dont return if a table exists already

* Rename updateModel to webhook

* Annotate WebhookController.cs with PluginController attribute

* Add danish translations

* Do not check if fail

* Dont filter when selecting custom items

* Remove delay from WebhookFiringService

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-10-31 10:06:14 +01:00