projectmanager-sdk
Version:
Software development kit for the ProjectManager.com API. for TypeScript
81 lines • 3.51 kB
JavaScript
/**
* 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 NptClient {
client;
/**
* Internal constructor for this client library
*/
constructor(client) {
this.client = client;
}
/**
* Retrieve a Non-Project Task (NPT) by its unique identifier or by its short ID.
* An NPT has both a unique identifier, which is a GUID, and a short ID, which is a small text label that is unique only within your Workspace.
*
* A Non-Project Task (NPT) is an individual element of work that is outside of a project.
* Many people use NPTs to track personal work or general administrative work. NPTs have nearly
* all the same features as other tasks, but since they are not part of a project, they can
* be tracked separately by individuals.
*
* @param nptId the id of the npt
*/
getNpt(nptId) {
const url = `/api/data/non-project-tasks/${nptId}`;
return this.client.request("get", url, null, null);
}
/**
* Updates a Non-Project Task (NPT) by its unique identifier, which is a GUID.
*
* A Non-Project Task (NPT) is an individual element of work that is outside of a project.
* Many people use NPTs to track personal work or general administrative work. NPTs have nearly
* all the same features as other tasks, but since they are not part of a project, they can
* be tracked separately by individuals.
*
* @param nptId the id of the npt
* @param body the fields to update
*/
updateNpt(nptId, body) {
const url = `/api/data/non-project-tasks/${nptId}`;
return this.client.request("put", url, null, body);
}
/**
* Removes a Non-Project Task (NPT) by its unique identifier, which is a GUID.
*
* A Non-Project Task (NPT) is an individual element of work that is outside of a project.
* Many people use NPTs to track personal work or general administrative work. NPTs have nearly
* all the same features as other tasks, but since they are not part of a project, they can
* be tracked separately by individuals.
*
* @param nptId the id of the npt to remove
*/
removeNpt(nptId) {
const url = `/api/data/non-project-tasks/${nptId}`;
return this.client.request("delete", url, null, null);
}
/**
* Creates a new Non-Project Task (NPT) for the current user. If you specify an assignee for this NPT, that user will be assigned to this task.
* If you do not specify an assignee, the NPT will be automatically assigned to you.
*
* A Non-Project Task (NPT) is an individual element of work that is outside of a project.
* Many people use NPTs to track personal work or general administrative work. NPTs have nearly
* all the same features as other tasks, but since they are not part of a project, they can
* be tracked separately by individuals.
*
* @param body The data used to create the Npt
*/
createNpt(body) {
const url = `/api/data/non-project-tasks`;
return this.client.request("post", url, null, body);
}
}
//# sourceMappingURL=NptClient.js.map