diff --git a/apps/webhooks/lib/Controller/WebhooksController.php b/apps/webhooks/lib/Controller/WebhooksController.php index 46da32fd6e2..21a06f5e563 100644 --- a/apps/webhooks/lib/Controller/WebhooksController.php +++ b/apps/webhooks/lib/Controller/WebhooksController.php @@ -73,6 +73,7 @@ class WebhooksController extends OCSController { * @param string $httpMethod HTTP method to use to contact the webhook * @param string $uri Webhook URI endpoint * @param string $event Event class name to listen to + * @param ?array $eventFilter Mongo filter to apply to the serialized data to decide if firing * @param ?array $headers Array of headers to send * @param ?string $authMethod Authentication method to use. TODO * @param ?array $authData Array of data for authentication @@ -125,6 +126,7 @@ class WebhooksController extends OCSController { * @param string $httpMethod HTTP method to use to contact the webhook * @param string $uri Webhook URI endpoint * @param string $event Event class name to listen to + * @param ?array $eventFilter Mongo filter to apply to the serialized data to decide if firing * @param ?array $headers Array of headers to send * @param ?string $authMethod Authentication method to use. TODO * @param ?array $authData Array of data for authentication diff --git a/apps/webhooks/lib/Db/WebhookListener.php b/apps/webhooks/lib/Db/WebhookListener.php index a52042aa0a2..8e16249b678 100644 --- a/apps/webhooks/lib/Db/WebhookListener.php +++ b/apps/webhooks/lib/Db/WebhookListener.php @@ -28,6 +28,9 @@ class WebhookListener extends Entity implements \JsonSerializable { /** @var string */ protected $event; + /** @var array */ + protected $eventFilter; + /** @var ?string */ protected $headers; diff --git a/apps/webhooks/lib/ResponseDefinitions.php b/apps/webhooks/lib/ResponseDefinitions.php index d730c0d9e2c..a8c188d2a59 100644 --- a/apps/webhooks/lib/ResponseDefinitions.php +++ b/apps/webhooks/lib/ResponseDefinitions.php @@ -16,6 +16,10 @@ namespace OCA\Webhooks; * httpMethod: string, * uri: string, * event?: string, + * eventFilter?: array, + * headers?: array, + * authMethod: string, + * authData?: array, * } */ class ResponseDefinitions { diff --git a/apps/webhooks/openapi.json b/apps/webhooks/openapi.json index ada0d7fb9c7..eeed54d7805 100644 --- a/apps/webhooks/openapi.json +++ b/apps/webhooks/openapi.json @@ -180,6 +180,18 @@ "type": "string" } }, + { + "name": "eventFilter[]", + "in": "query", + "description": "Mongo filter to apply to the serialized data to decide if firing", + "schema": { + "type": "array", + "nullable": true, + "items": { + "type": "object" + } + } + }, { "name": "headers", "in": "query", @@ -422,6 +434,15 @@ "type": "string" } }, + { + "name": "eventFilter", + "in": "query", + "description": "Mongo filter to apply to the serialized data to decide if firing", + "schema": { + "type": "string", + "nullable": true + } + }, { "name": "headers", "in": "query", @@ -688,4 +709,4 @@ } }, "tags": [] -} \ No newline at end of file +}