Referencia
Eventos de webhooks
Un sitio lista sus webhooks en sus eventos. Cada cambio envía un evento a cada uno, como JSON en un POST, firmado con el secreto del webhook. parseHollwareEvent de @hollware/core lee uno, y verifyWebhook verifica su firma.
Las descripciones de los campos son las del código, en inglés.
Entrega
Un evento se escribe en el mismo lote que el cambio que cuenta, y después se envía por la cola: un webhook que responde un error lo recibe de nuevo, hasta cinco veces. Los eventos de una revisión llegan a los webhooks en la siguiente pasada del cron, en menos de un minuto. Quien recibe usa el id de un evento para ignorar uno que ya tiene.
hollware-event-id: el id del evento, el mismo en cada reintentohollware-timestamp: cuándo se firmó, en segundos; verifyWebhook rechaza uno que esté a más de cinco minutoshollware-signature: v1= y el HMAC-SHA256 del timestamp, un punto y el cuerpo, con el secreto del webhook
entry.published · entry.unpublished
| Campo | Tipo | Qué es |
|---|---|---|
| id | string | The id of the event, the same on every retry: ignore one you already have. |
| site | string | The key of the site it happened in. |
| at | string | When it happened, as an ISO 8601 timestamp. |
| cacheTags | string[] | The cache tags of the pages it changed, to purge; none when no page changed. |
| entry | object | The entry: its id, collection, locale, slug and translation group. |
| path | unknown | The path of the entry on the site, from the route of its collection and locale. |
| url | unknown | The URL of the entry, when the site has a url. |
site.changed
| Campo | Tipo | Qué es |
|---|---|---|
| id | string | The id of the event, the same on every retry: ignore one you already have. |
| site | string | The key of the site it happened in. |
| at | string | When it happened, as an ISO 8601 timestamp. |
| cacheTags | string[] | The cache tags of the pages it changed, to purge; none when no page changed. |
review.requested · review.decided
| Campo | Tipo | Qué es |
|---|---|---|
| id | string | The id of the event, the same on every retry: ignore one you already have. |
| site | string | The key of the site it happened in. |
| at | string | When it happened, as an ISO 8601 timestamp. |
| cacheTags | string[] | The cache tags of the pages it changed, to purge; none when no page changed. |
| review | object | The review: its id, its status (pending when asked, what became of it when decided), the name of who asked, and the note of a reviewer who asked for changes or rejected it. |
| entry | object | The entry the review asks to publish. |
| items | object[] | Every entry the review changes, the entry above first, and what it does to each. |
| adminPath | string | Where a person reads the review in the admin, under the URL of this Hollware. |