From f5a8bd0bced5a974f7f05ac46d2aad4924e02f3f Mon Sep 17 00:00:00 2001 From: HannesOberreiter Date: Wed, 22 May 2024 15:36:35 +0200 Subject: [PATCH] docs: :memo: add jsdoc --- server/api/helpers/utils/send-webhook.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server/api/helpers/utils/send-webhook.js b/server/api/helpers/utils/send-webhook.js index 01c18c0..e7abc01 100644 --- a/server/api/helpers/utils/send-webhook.js +++ b/server/api/helpers/utils/send-webhook.js @@ -28,6 +28,19 @@ const EVENT_TYPES = { TASK_DELETE: 'task_delete', }; +/** + * Sends a webhook notification to a configured URL. + * + * @param {Object} inputs - Data to include in the webhook payload. + * @param {string} inputs.event - The event type (see {@link EVENT_TYPES}). + * @param {*} inputs.data - The actual data related to the event. + * @param {string} inputs.projectId - The project ID associated with the event. + * @param {ref} [inputs.user] - Optional user object associated with the event. + * @param {ref} [inputs.card] - Optional card object associated with the event. + * @param {ref} [inputs.board] - Optional board object associated with the event. + * @param {ref} [inputs.list] - Optional list object associated with the event. + * @returns {Promise} + */ async function sendWebhook(inputs) { const url = sails.config.custom.webhookUrl; const headers = {