From bd605a468ffb7a7a2eca349cfeab75322ed0654a Mon Sep 17 00:00:00 2001 From: jakehwll Date: Tue, 2 Sep 2025 19:10:48 +1000 Subject: [PATCH 1/3] chore: enforce `getComments` to `TicketComment[]` --- src/clients/core/tickets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clients/core/tickets.js b/src/clients/core/tickets.js index bc72640..743a87c 100644 --- a/src/clients/core/tickets.js +++ b/src/clients/core/tickets.js @@ -523,7 +523,7 @@ class Tickets extends Client { /** * Retrieve comments associated with a specific ticket. * @param {number} ticketId - The ID of the ticket to retrieve comments for. - * @returns {Promise} A promise that resolves with an array of comments associated with the ticket. + * @returns {Promise>} A promise that resolves with an array of comments associated with the ticket. * @throws {Error} If `ticketId` is not a valid number. * @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/} * @example From 8ec9ab21e22e6ae48b09a43d6f33de01f6fd175e Mon Sep 17 00:00:00 2001 From: jakehwll Date: Tue, 2 Sep 2025 19:35:07 +1000 Subject: [PATCH 2/3] chore: enforce `listCollaborators` to `TicketCollaborator[]` --- src/clients/core/tickets.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/clients/core/tickets.js b/src/clients/core/tickets.js index 743a87c..088abf9 100644 --- a/src/clients/core/tickets.js +++ b/src/clients/core/tickets.js @@ -127,6 +127,12 @@ const {Client} = require('../client'); * @property {Array} [tickets] - The ticket object to create many tickets. */ +/** + * @typedef {object} TicketCollaborator + * @property {number} id - The ID of the collaborator. + * @property {string} name - The name of the collaborator. + */ + /** * @class * Client for the Zendesk API - Tickets. @@ -238,7 +244,7 @@ class Tickets extends Client { /** * List collaborators of a specific ticket. * @param {number} ticketId - The ID of the ticket. - * @returns {Promise} An array of collaborators for the ticket. + * @returns {Promise>} An array of collaborators for the ticket. * @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#list-tickets} * @example * const collaborators = await client.tickets.listCollaborators(7890); From 3a34fa617df6983dbc377f03f0e7c084dc61936a Mon Sep 17 00:00:00 2001 From: jakehwll Date: Tue, 2 Sep 2025 19:47:47 +1000 Subject: [PATCH 3/3] chore: enforce `listIncidents` to `Ticket[]` --- src/clients/core/tickets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clients/core/tickets.js b/src/clients/core/tickets.js index 088abf9..1d9b5fe 100644 --- a/src/clients/core/tickets.js +++ b/src/clients/core/tickets.js @@ -256,7 +256,7 @@ class Tickets extends Client { /** * List incidents related to a specific ticket. * @param {number} ticketId - The ID of the ticket. - * @returns {Promise} An array of incidents related to the ticket. + * @returns {Promise>} An array of incidents related to the ticket. * @see {@link https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#list-tickets} * @example * const incidents = await client.tickets.listIncidents(7890);