asana
Advanced tools
Comparing version 0.1.2 to 0.2.0
@@ -59,3 +59,3 @@ var util = require('util'); | ||
Tasks.prototype.findByProject = function(projectId, params) { | ||
var path = util.format('/projects/%d/tasks', projectId); | ||
var path = util.format('/projects/%d/tasks', projectId); | ||
return this.dispatcher.get(path, params); | ||
@@ -71,3 +71,3 @@ }; | ||
Tasks.prototype.findByTag = function(tagId, params) { | ||
var path = util.format('/tags/%d/tasks', tagId); | ||
var path = util.format('/tags/%d/tasks', tagId); | ||
return this.dispatcher.get(path, params); | ||
@@ -113,3 +113,42 @@ }; | ||
* @param {Object} data The data containing the list of followers | ||
}; | ||
/** | ||
* Update a task | ||
* @param {Number} taskId The task id | ||
* @param {Object} data The data to be sent to the workspace | ||
* @return {Promise} The result of the API call | ||
*/ | ||
Tasks.prototype.update = function(taskId, data) { | ||
var path = util.format('/tasks/%d', taskId); | ||
return this.dispatcher.put(path, data); | ||
}; | ||
/** | ||
* Deletes a task | ||
* @param {Number} taskId The task id | ||
* @return {Promise} The result of the API call | ||
*/ | ||
Tasks.prototype.delete = function(taskId) { | ||
var path = util.format('/tasks/%d', taskId); | ||
return this.dispatcher.delete(path); | ||
}; | ||
/** | ||
* Dispatches a POST request to /tasks/:taskId/addFollowers with to add | ||
* followers to the task. | ||
* @param {Number} taskId The task id | ||
* @param {Object} data The data containing the list of followers | ||
*/ | ||
Tasks.prototype.addFollowers = function(taskId, data) { | ||
var path = util.format('/tasks/%d/addFollowers', taskId); | ||
return this.dispatcher.post(path, data); | ||
}; | ||
/** | ||
* Dispatches a POST request to /tasks/:taskId/removeFollowers with to remove | ||
* followers from the task. | ||
* @param {Number} taskId The task id | ||
* @param {Object} data The data containing the list of followers | ||
*/ | ||
Tasks.prototype.removeFollowers = function(taskId, data) { | ||
@@ -120,2 +159,36 @@ var path = util.format('/tasks/%d/removeFollowers', taskId); | ||
/** | ||
* Dispatches a GET request to /tasks/:taskId/projects | ||
* @param {Number} taskId The task id | ||
* @return {Promise} The result of the API call | ||
*/ | ||
Tasks.prototype.getProjects = function(taskId) { | ||
var path = util.format('/tasks/%d/projects', taskId); | ||
return this.dispatcher.get(path, undefined); | ||
}; | ||
/** | ||
* Dispatches a POST request to /tasks/:taskId/addProject with the project to | ||
* add to to the task. | ||
* @param {Number} taskId The task id | ||
* @param {Number} data The data containing the projectId | ||
* @return {Promise} The result of the API call | ||
*/ | ||
Tasks.prototype.addProject = function(taskId, data) { | ||
var path = util.format('/tasks/%d/addProject', taskId); | ||
return this.dispatcher.post(path, data); | ||
}; | ||
/** | ||
* Dispatches a POST request to /tasks/:taskId/removeProject with the project to | ||
* remove from the task | ||
* @param {Number} taskId The task id | ||
* @param {Object} data The data containing the list of followers | ||
* @return {Promise} The result of the API call | ||
*/ | ||
Tasks.prototype.removeProject = function(taskId, data) { | ||
var path = util.format('/tasks/%d/removeProject', taskId); | ||
return this.dispatcher.post(path, data); | ||
}; | ||
module.exports = Tasks; |
{ | ||
"name": "asana", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "A node.js client for the Asana API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
38027
790