1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00

docs: Add types to webhook function (#796)

This commit is contained in:
HannesOberreiter 2024-06-18 15:41:12 +02:00 committed by GitHub
parent 2495891fad
commit d8635e7915

View file

@ -77,12 +77,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 EVENT_TYPES}).
* @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<void>}
*/