mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Adding /webhooks endpoint
Summary: - New /webhooks event that lists all webhooks in a document (available for owners), - Monitoring webhooks usage and saving it in memory or Redis, - Loosening _usubscribe API endpoint, so that the information returned from the /webhook endpoint is enough to unsubscribe, - Owners can remove webhook without the unsubscribe key. The endpoint lists all webhooks that are registered in a document, not just webhooks from a single table. There are two status fields. First for the webhook, second for the last request attempt. Webhook can have 5 statuses: 'idle', 'sending', 'retrying', 'postponed', 'error', which roughly describes what the sendLoop is currently doing. The 'error' status describes a situation when all request attempts failed and the queue needs to be drained, so some requests were dropped. The last request status can only be: 'success', 'failure' or 'rejected'. Rejected means that the last batch was dropped because the queue was too long. Test Plan: New and updated tests Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3727
This commit is contained in:
@@ -1727,6 +1727,13 @@ export class ActiveDoc extends EventEmitter {
|
||||
await this._triggers.clearWebhookQueue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of outgoing webhook for a table in this document.
|
||||
*/
|
||||
public async webhooksSummary() {
|
||||
return this._triggers.summary();
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads an open document from DocStorage. Returns a list of the tables it contains.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user