IWebhookApplication
Interface added to an Application class to mark it as webhook-aware. Implement it alongside AApplication (or any of its descendants).
For new Applications, prefer extending AWebhookApplication. It implements this interface, wires the WebhookManager for you, and exposes the WebhookSubscription.create(...) factory. Implementing IWebhookApplication directly is supported for backwards compatibility but no longer the recommended path.
import IWebhookApplication from '@orchesty/nodejs-sdk/dist/lib/Application/Base/IWebhookApplication';
Methods you implement #
| Method | Returns | Purpose |
|---|---|---|
getWebhookSubscriptions() | WebhookSubscription[] | Available subscriptions: event name, parameters, optional description shown in the editor's webhook picker. The topology and node fields of the legacy constructor are ignored — those values are owned by the UI. |
getWebhookSubscribeRequestDto(install, subscription, url) | RequestDto | HTTP request that registers a webhook with the third-party API. |
getWebhookUnsubscribeRequestDto(install, webhook) | RequestDto | HTTP request that removes a webhook by id. |
processWebhookSubscribeResponse(response, install) | string | Reads the third-party response and returns the external webhook id. |
processWebhookUnsubscribeResponse(response) | boolean | Confirms the unsubscribe request succeeded. |
See also #
- AWebhookApplication — recommended abstract base
- WebhookSubscription
- Development: Patterns / Webhooks
- AApplication
- PHP equivalent:
WebhookApplicationInterface