From 0dd864b001e708a1373a7de3c7421546d0ae28ee Mon Sep 17 00:00:00 2001 From: HannesOberreiter Date: Mon, 17 Jun 2024 10:34:43 +0200 Subject: [PATCH] docs: :label: add types to webhook function --- server/api/helpers/utils/send-webhooks.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/server/api/helpers/utils/send-webhooks.js b/server/api/helpers/utils/send-webhooks.js index 57da1bf..5b62759 100644 --- a/server/api/helpers/utils/send-webhooks.js +++ b/server/api/helpers/utils/send-webhooks.js @@ -22,12 +22,26 @@ const jsonifyData = (data) => { return nextData; }; +/** + * @typedef {Object} Included + * @property {any[]} [projects] - Array of projects (optional). + * @property {any[]} [boards] - Array of boards (optional). + * @property {any[]} [lists] - Array of lists (optional). + * @property {any[]} [cards] - Array of cards (optional). + */ + +/** + * @typedef {Object} Data + * @property {any} item - Actual event data. + * @property {Included} [included] - Optional included data. + */ + /** * Sends a webhook notification to a configured URL. * * @param {*} webhook - Webhook configuration. * @param {string} event - The event (see {@link Events}). - * @param {*} data - The actual data related to the event. + * @param {Data} data - The data object containing event data and optionally included data. * @param {ref} user - User object associated with the event. * @returns {Promise} */