UNPKG

projectmanager-sdk

Version:

Software development kit for the ProjectManager.com API. for TypeScript

73 lines 2.46 kB
/** * ProjectManager API for TypeScript * * (c) ProjectManager.com, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @author ProjectManager.com <support@projectmanager.com> * @copyright ProjectManager.com, Inc. * @link https://github.com/projectmgr/projectmanager-sdk-typescript */ export class DiscussionClient { client; /** * Internal constructor for this client library */ constructor(client) { this.client = client; } /** * Retrieve all comments written about a task * * @param taskId The unique ID number of the task to retrieve comments */ retrieveTaskComments(taskId) { const url = `/api/data/tasks/${taskId}/comments`; return this.client.request("get", url, null, null); } /** * Adds a Markdown-formatted comment to a task. * * Tasks can have discussions attached to them. These discussions can include text with simple * formatting. Discussion comments are formatted using [Markdown](https://www.markdownguide.org/) * and users should be aware that HTML embedding is not permitted due to the risk of cross-site * attacks and other embedding challenges. * * @param taskId The unique ID number of the task being commented upon * @param body The Markdown-formatted text of the comment */ createTaskComments(taskId, body) { const url = `/api/data/tasks/${taskId}/comments`; return this.client.request("post", url, null, body); } /** * Puts a thumbsup on a comment * * @param commentId the id of the comment */ likeacomment(commentId) { const url = `/api/data/comments/${commentId}/like`; return this.client.request("post", url, null, null); } /** * Unlike a comment that was previously liked * * @param commentId the id of the comment */ removesathumbsupfromacomment(commentId) { const url = `/api/data/comments/${commentId}/like`; return this.client.request("delete", url, null, null); } /** * Removes a comment by it's id * * @param commentId Remove a comment */ removeacomment(commentId) { const url = `/api/data/comments/${commentId}`; return this.client.request("delete", url, null, null); } } //# sourceMappingURL=DiscussionClient.js.map