teamwork-api
Advanced tools
Comparing version
@@ -29,3 +29,3 @@ ## Link | ||
[**DELETE /links/${link_id}.json**](https://developer.teamwork.com/projects/links/delete-a-single-link) | ||
[**DELETE /links/{link_id}.json**](https://developer.teamwork.com/projects/links/delete-a-single-link) | ||
@@ -54,3 +54,3 @@ ```js | ||
[**GET /links/${link_id}/tags.json**](https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource) | ||
[**GET /links/{link_id}/tags.json**](https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource) | ||
@@ -63,3 +63,3 @@ ```js | ||
[**PUT /links/${link_id}/tags.json**](https://developer.teamwork.com/projects/tags/update-tags-on-a-resource) | ||
[**PUT /links/{link_id}/tags.json**](https://developer.teamwork.com/projects/tags/update-tags-on-a-resource) | ||
@@ -66,0 +66,0 @@ ```js |
@@ -61,3 +61,3 @@ ## Message | ||
[**GET /messageReplies/${message_id}.json**](https://developer.teamwork.com/projects/message-replies/retrieve-a-single-message-reply) | ||
[**GET /messageReplies/{message_id}.json**](https://developer.teamwork.com/projects/message-replies/retrieve-a-single-message-reply) | ||
@@ -64,0 +64,0 @@ ```js |
@@ -5,3 +5,3 @@ ## Milestone | ||
[**GET /milestones.json | /milestones/${milestone_id}.json**](https://developer.teamwork.com/projects/milestones/list-all-milestones) | ||
[**GET /milestones.json | /milestones/{milestone_id}.json**](https://developer.teamwork.com/projects/milestones/list-all-milestones) | ||
@@ -30,3 +30,3 @@ ```js | ||
[**PUT /milestones/${milestone_id}.json**](https://developer.teamwork.com/projects/milestones/update-a-single-milestone) | ||
[**PUT /milestones/{milestone_id}.json**](https://developer.teamwork.com/projects/milestones/update-a-single-milestone) | ||
@@ -39,3 +39,3 @@ ```js | ||
[**DELETE /milestones/${milestone_id}.json**](https://developer.teamwork.com/projects/milestones/delete-a-milestone) | ||
[**DELETE /milestones/{milestone_id}.json**](https://developer.teamwork.com/projects/milestones/delete-a-milestone) | ||
@@ -48,3 +48,3 @@ ```js | ||
[**GET /milestones/${milestone_id}/comments.json**](https://developer.teamwork.com/projects/comments/retrieving-comments-across-all-types) | ||
[**GET /milestones/{milestone_id}/comments.json**](https://developer.teamwork.com/projects/comments/retrieving-comments-across-all-types) | ||
@@ -57,3 +57,3 @@ ```js | ||
[**POST /milestones/${milestone_id}/comments.json**](https://developer.teamwork.com/projects/comments/creating-a-comment) | ||
[**POST /milestones/{milestone_id}/comments.json**](https://developer.teamwork.com/projects/comments/creating-a-comment) | ||
@@ -66,3 +66,3 @@ ```js | ||
[**GET /milestones/${milestone_id}/tags.json**](https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource) | ||
[**GET /milestones/{milestone_id}/tags.json**](https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource) | ||
@@ -75,3 +75,3 @@ ```js | ||
[**PUT /milestones/${milestone_id}/tags.json**](https://developer.teamwork.com/projects/tags/update-tags-on-a-resource) | ||
[**PUT /milestones/{milestone_id}/tags.json**](https://developer.teamwork.com/projects/tags/update-tags-on-a-resource) | ||
@@ -78,0 +78,0 @@ ```js |
@@ -45,3 +45,3 @@ ## Notebook | ||
[**PUT /notebooks/${notebook_id}/copy.json**](https://developer.teamwork.com/projects/notebooks/copy-a-notebook-to-another-project) | ||
[**PUT /notebooks/{notebook_id}/copy.json**](https://developer.teamwork.com/projects/notebooks/copy-a-notebook-to-another-project) | ||
@@ -54,3 +54,3 @@ ```js | ||
[**PUT /notebooks/${notebook_id}/move.json**](https://developer.teamwork.com/projects/notebooks/move-a-notebook-to-another-project) | ||
[**PUT /notebooks/{notebook_id}/move.json**](https://developer.teamwork.com/projects/notebooks/move-a-notebook-to-another-project) | ||
@@ -63,3 +63,3 @@ ```js | ||
[**GET /notebooks/${notebook_id}/comments.json**](https://developer.teamwork.com/projects/comments/retrieving-comments-across-all-types) | ||
[**GET /notebooks/{notebook_id}/comments.json**](https://developer.teamwork.com/projects/comments/retrieving-comments-across-all-types) | ||
@@ -72,3 +72,3 @@ ```js | ||
[**POST /notebooks/${notebook_id}/comments.json**](https://developer.teamwork.com/projects/comments/creating-a-comment) | ||
[**POST /notebooks/{notebook_id}/comments.json**](https://developer.teamwork.com/projects/comments/creating-a-comment) | ||
@@ -75,0 +75,0 @@ ```js |
@@ -101,3 +101,3 @@ ## People | ||
[**GET /people/${person_id}/clockins.json**](https://developer.teamwork.com/projects/clock-in-clock-out/get-all-clock-ins) | ||
[**GET /people/{person_id}/clockins.json**](https://developer.teamwork.com/projects/clock-in-clock-out/get-all-clock-ins) | ||
@@ -104,0 +104,0 @@ ```js |
@@ -109,3 +109,3 @@ ## Project | ||
[**GET /projects/${project_id}/companies.json**](https://developer.teamwork.com/projects/companies/retrieving-companies-within-a-project) | ||
[**GET /projects/{project_id}/companies.json**](https://developer.teamwork.com/projects/companies/retrieving-companies-within-a-project) | ||
@@ -150,3 +150,3 @@ ```js | ||
[**GET /projects/${project_id}/posts/archive.json**](https://developer.teamwork.com/projects/messages/get-archived-messages) | ||
[**GET /projects/{project_id}/posts/archive.json**](https://developer.teamwork.com/projects/messages/get-archived-messages) | ||
@@ -207,3 +207,3 @@ ```js | ||
[**POST /projects/${project_id}/people/${person_id}.json**](https://developer.teamwork.com/projects/people/add-people-to-existing-project) | ||
[**POST /projects/${project_id}/people/{person_id}.json**](https://developer.teamwork.com/projects/people/add-people-to-existing-project) | ||
@@ -216,3 +216,3 @@ ```js | ||
[**PUT /projects/${project_id}/people.json**](https://developer.teamwork.com/projects/permissions/add-remove-multiple-people-to-from-a-project) | ||
[**PUT /projects/{project_id}/people.json**](https://developer.teamwork.com/projects/permissions/add-remove-multiple-people-to-from-a-project) | ||
@@ -225,3 +225,3 @@ ```js | ||
[**POST /projects/${project_id}/people.json**](https://developer.teamwork.com/projects/people/remove-people-from-a-project) | ||
[**POST /projects/{project_id}/people.json**](https://developer.teamwork.com/projects/people/remove-people-from-a-project) | ||
@@ -234,3 +234,3 @@ ```js | ||
[**GET /projects/${project_id}/people/${person_id}.json**](https://developer.teamwork.com/projects/permissions/get-a-users-permissions-on-a-project) | ||
[**GET /projects/${project_id}/people/{person_id}.json**](https://developer.teamwork.com/projects/permissions/get-a-users-permissions-on-a-project) | ||
@@ -243,3 +243,3 @@ ```js | ||
[**PUT /projects/${project_id}/people/${person_id}.json**](https://developer.teamwork.com/projects/permissions/update-a-users-permissions-on-a-project) | ||
[**PUT /projects/${project_id}/people/{person_id}.json**](https://developer.teamwork.com/projects/permissions/update-a-users-permissions-on-a-project) | ||
@@ -279,3 +279,3 @@ ```js | ||
```js | ||
tw.projects.delete(query_string, project_id) | ||
tw.projects.get(query_string, project_id) | ||
``` | ||
@@ -293,3 +293,3 @@ | ||
[**PUT /projects/${project_id}/star.json**](https://developer.teamwork.com/projects/projects/star-a-project) | ||
[**PUT /projects/{project_id}/star.json**](https://developer.teamwork.com/projects/projects/star-a-project) | ||
@@ -326,3 +326,3 @@ ```js | ||
[**PUT /projects/${project_id}.json**](https://developer.teamwork.com/projects/projects/enable-and-disable-projects-features) | ||
[**PUT /projects/{project_id}.json**](https://developer.teamwork.com/projects/projects/enable-and-disable-projects-features) | ||
@@ -335,3 +335,3 @@ ```js | ||
[**GET /projects/${project_id}/roles.json**](https://developer.teamwork.com/projects/project-roles/list-roles-on-a-project) | ||
[**GET /projects/{project_id}/roles.json**](https://developer.teamwork.com/projects/project-roles/list-roles-on-a-project) | ||
@@ -344,3 +344,3 @@ ```js | ||
[**GET /projects/${project_id}/emailaddress.json**](https://developer.teamwork.com/projects/project-email-addresses/get-project-email-address) | ||
[**GET /projects/{project_id}/emailaddress.json**](https://developer.teamwork.com/projects/project-email-addresses/get-project-email-address) | ||
@@ -353,3 +353,3 @@ ```js | ||
[**PUT /projects/${project_id}/emailaddress.json**](https://developer.teamwork.com/projects/project-email-addresses/update-project-email-address) | ||
[**PUT /projects/{project_id}/emailaddress.json**](https://developer.teamwork.com/projects/project-email-addresses/update-project-email-address) | ||
@@ -362,3 +362,3 @@ ```js | ||
[**GET /projects/${project_id}/links.json**](https://developer.teamwork.com/projects/links/list-links-on-a-project) | ||
[**GET /projects/{project_id}/links.json**](https://developer.teamwork.com/projects/links/list-links-on-a-project) | ||
@@ -371,3 +371,3 @@ ```js | ||
[**GET /projects/${project_id}/risks.json**](https://developer.teamwork.com/projects/risks/retrieve-all-risks-in-a-project) | ||
[**GET /projects/{project_id}/risks.json**](https://developer.teamwork.com/projects/risks/retrieve-all-risks-in-a-project) | ||
@@ -380,3 +380,3 @@ ```js | ||
[**GET /projects/${project_id}/time_entries.json**](https://developer.teamwork.com/projects/time-tracking/retrieve-all-time-entries-for-a-project) | ||
[**GET /projects/{project_id}/time_entries.json**](https://developer.teamwork.com/projects/time-tracking/retrieve-all-time-entries-for-a-project) | ||
@@ -389,3 +389,3 @@ ```js | ||
[**POST /projects/${project_id}/time_entries.json**](https://developer.teamwork.com/projects/time-tracking/create-a-time-entry) | ||
[**POST /projects/{project_id}/time_entries.json**](https://developer.teamwork.com/projects/time-tracking/create-a-time-entry) | ||
@@ -414,3 +414,3 @@ ```js | ||
[**GET /projects/${project_id}/tasks.json**](https://developer.teamwork.com/projects/tasks/get-all-tasks-on-a-given-project) | ||
[**GET /projects/{project_id}/tasks.json**](https://developer.teamwork.com/projects/tasks/get-all-tasks-on-a-given-project) | ||
@@ -423,3 +423,3 @@ ```js | ||
[**GET /projects/${project_id}/tags.json**](https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource) | ||
[**GET /projects/{project_id}/tags.json**](https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource) | ||
@@ -432,3 +432,3 @@ ```js | ||
[**PUT /projects/${project_id}/tags.json**](https://developer.teamwork.com/projects/tags/update-tags-on-a-resource) | ||
[**PUT /projects/{project_id}/tags.json**](https://developer.teamwork.com/projects/tags/update-tags-on-a-resource) | ||
@@ -435,0 +435,0 @@ ```js |
@@ -5,3 +5,3 @@ ## Risk | ||
[**GET /risks/${risk_id}.json**](https://developer.teamwork.com/projects/risks/get-all-risks) | ||
[**GET /risks/{risk_id}.json**](https://developer.teamwork.com/projects/risks/get-all-risks) | ||
@@ -8,0 +8,0 @@ ```js |
@@ -13,3 +13,3 @@ ## Role | ||
[**POST /projects/${project_id}/roles.json**](https://developer.teamwork.com/projects/project-roles/add-a-role-to-a-project) | ||
[**POST /projects/{project_id}/roles.json**](https://developer.teamwork.com/projects/project-roles/add-a-role-to-a-project) | ||
@@ -22,3 +22,3 @@ ```js | ||
[**PUT /roles/${role_id}.json**](https://developer.teamwork.com/projects/project-roles/update-a-role-on-a-project) | ||
[**PUT /roles/{role_id}.json**](https://developer.teamwork.com/projects/project-roles/update-a-role-on-a-project) | ||
@@ -31,3 +31,3 @@ ```js | ||
[**DELETE /roles/${role_id}.json**](https://developer.teamwork.com/projects/project-roles/delete-a-role) | ||
[**DELETE /roles/{role_id}.json**](https://developer.teamwork.com/projects/project-roles/delete-a-role) | ||
@@ -34,0 +34,0 @@ ```js |
@@ -5,3 +5,3 @@ ## Status | ||
[**GET /statuses.json | /people/${user_id}/status.json**](https://developer.teamwork.com/projects/people-status/retrieve-everybody-status) | ||
[**GET /statuses.json | /people/{user_id}/status.json**](https://developer.teamwork.com/projects/people-status/retrieve-everybody-status) | ||
@@ -30,3 +30,3 @@ ```js | ||
[**PUT /me/status/${status_id}.json**](https://developer.teamwork.com/projects/people-status/update-my-status) | ||
[**PUT /me/status/{status_id}.json**](https://developer.teamwork.com/projects/people-status/update-my-status) | ||
@@ -39,3 +39,3 @@ ```js | ||
[**PUT /people/status/${status_id}.json | /people/${person_id}/status/${status_id}.json**](https://developer.teamwork.com/projects/people-status/update-user-status) | ||
[**PUT /people/status/${status_id}.json | /people/${person_id}/status/{status_id}.json**](https://developer.teamwork.com/projects/people-status/update-user-status) | ||
@@ -48,3 +48,3 @@ ```js | ||
[**DELETE /me/status/${status_id}.json**](https://developer.teamwork.com/projects/people-status/delete-my-status) | ||
[**DELETE /me/status/{status_id}.json**](https://developer.teamwork.com/projects/people-status/delete-my-status) | ||
@@ -57,3 +57,3 @@ ```js | ||
[**DELETE /people/status/${status_id}.json | /people/${person_id}/status/${status_id}.json**](https://developer.teamwork.com/projects/people-status/delete-user-status) | ||
[**DELETE /people/status/${status_id}.json | /people/${person_id}/status/{status_id}.json**](https://developer.teamwork.com/projects/people-status/delete-user-status) | ||
@@ -60,0 +60,0 @@ ```js |
@@ -21,3 +21,3 @@ ## Tag | ||
[**PUT /tags/${tag_id}.json**](https://developer.teamwork.com/projects/tags/update-a-single-tag) | ||
[**PUT /tags/{tag_id}.json**](https://developer.teamwork.com/projects/tags/update-a-single-tag) | ||
@@ -30,3 +30,3 @@ ```js | ||
[**DELETE /tags/${tag_id}.json**](https://developer.teamwork.com/projects/tags/delete-a-single-tag) | ||
[**DELETE /tags/{tag_id}.json**](https://developer.teamwork.com/projects/tags/delete-a-single-tag) | ||
@@ -33,0 +33,0 @@ ```js |
@@ -5,3 +5,3 @@ ## Task-list | ||
[**GET /tasklists.json | /tasklists/${tasklist_id}.json**](https://developer.teamwork.com/projects/task-lists/get-all-task-lists) | ||
[**GET /tasklists.json | /tasklists/{tasklist_id}.json**](https://developer.teamwork.com/projects/task-lists/get-all-task-lists) | ||
@@ -70,3 +70,3 @@ ```js | ||
[**GET /tasklists/${tasklist_id}/tasks.json**](https://developer.teamwork.com/projects/tasks/get-all-tasks-on-a-given-task-list) | ||
[**GET /tasklists/{tasklist_id}/tasks.json**](https://developer.teamwork.com/projects/tasks/get-all-tasks-on-a-given-task-list) | ||
@@ -79,3 +79,3 @@ ```js | ||
[**GET /tasklists/${tasklist_id}/time/total.json**](https://developer.teamwork.com/projects/tasks/get-all-tasks-on-a-given-task-list) | ||
[**GET /tasklists/{tasklist_id}/time/total.json**](https://developer.teamwork.com/projects/tasks/get-all-tasks-on-a-given-task-list) | ||
@@ -82,0 +82,0 @@ ```js |
@@ -5,3 +5,3 @@ ## Task | ||
[**GET /tasks.json | /tasks/${task_id}.json**](https://developer.teamwork.com/projects/tasks/get-all-tasks-across-all-projects) | ||
[**GET /tasks.json | /tasks/{task_id}.json**](https://developer.teamwork.com/projects/tasks/get-all-tasks-across-all-projects) | ||
@@ -22,3 +22,3 @@ ```js | ||
[**PUT /tasks/${task_id}.json**](https://developer.teamwork.com/projects/tasks/update-a-task) | ||
[**PUT /tasks/{task_id}.json**](https://developer.teamwork.com/projects/tasks/update-a-task) | ||
@@ -31,3 +31,3 @@ ```js | ||
[**DELETE /tasks/${task_id}.json**](https://developer.teamwork.com/projects/tasks/delete-a-task) | ||
[**DELETE /tasks/{task_id}.json**](https://developer.teamwork.com/projects/tasks/delete-a-task) | ||
@@ -40,3 +40,3 @@ ```js | ||
[**POST /tasks/${task_id}.json**](https://developer.teamwork.com/projects/tasks/create-a-sub-task) | ||
[**POST /tasks/{task_id}.json**](https://developer.teamwork.com/projects/tasks/create-a-sub-task) | ||
@@ -73,3 +73,3 @@ ```js | ||
[**PUT /tasks/${task_id}.json**](https://developer.teamwork.com/projects/tasks/change-the-completed-date-on-closed-tasks) | ||
[**PUT /tasks/{task_id}.json**](https://developer.teamwork.com/projects/tasks/change-the-completed-date-on-closed-tasks) | ||
@@ -82,3 +82,3 @@ ```js | ||
[**GET /tasks/${task_id}/dependencies.json**](https://developer.teamwork.com/projects/tasks/retrieve-task-dependencies) | ||
[**GET /tasks/{task_id}/dependencies.json**](https://developer.teamwork.com/projects/tasks/retrieve-task-dependencies) | ||
@@ -91,3 +91,3 @@ ```js | ||
[**PUT /tasklists/${tasklist_id}/tasks/reorder.json**](https://developer.teamwork.com/projects/tasks/reorder-the-tasks) | ||
[**PUT /tasklists/{tasklist_id}/tasks/reorder.json**](https://developer.teamwork.com/projects/tasks/reorder-the-tasks) | ||
@@ -100,3 +100,3 @@ ```js | ||
[**GET /tasks/${task_id}/followers.json**](https://developer.teamwork.com/projects/tasks/get-task-followers) | ||
[**GET /tasks/{task_id}/followers.json**](https://developer.teamwork.com/projects/tasks/get-task-followers) | ||
@@ -109,3 +109,3 @@ ```js | ||
[**PUT /tasks/${task_id}.json**](https://developer.teamwork.com/projects/tasks/set-task-followers) | ||
[**PUT /tasks/{task_id}.json**](https://developer.teamwork.com/projects/tasks/set-task-followers) | ||
@@ -118,3 +118,3 @@ ```js | ||
[**PUT /tasks/${task_id}.json**](https://developer.teamwork.com/projects/tasks/remove-task-followers) | ||
[**PUT /tasks/{task_id}.json**](https://developer.teamwork.com/projects/tasks/remove-task-followers) | ||
@@ -127,3 +127,3 @@ ```js | ||
[**PUT /tasklists/${tasklist_id}/quickadd.json**](https://developer.teamwork.com/projects/tasks/quickly-add-multiple-tasks) | ||
[**PUT /tasklists/{tasklist_id}/quickadd.json**](https://developer.teamwork.com/projects/tasks/quickly-add-multiple-tasks) | ||
@@ -136,3 +136,3 @@ ```js | ||
[**POST /tasks/${task_id}/time_entries.json**](https://developer.teamwork.com/projects/time-tracking/create-a-time-entry-for-a-task) | ||
[**POST /tasks/{task_id}/time_entries.json**](https://developer.teamwork.com/projects/time-tracking/create-a-time-entry-for-a-task) | ||
@@ -145,3 +145,3 @@ ```js | ||
[**GET /tasks/${task_id}/time/total.json**](https://developer.teamwork.com/projects/time-tracking/total-time-on-a-task) | ||
[**GET /tasks/{task_id}/time/total.json**](https://developer.teamwork.com/projects/time-tracking/total-time-on-a-task) | ||
@@ -162,3 +162,3 @@ ```js | ||
[**GET /tasks/${task_id}/time_entries.json**](https://developer.teamwork.com/projects/time-tracking/retrieve-all-task-times) | ||
[**GET /tasks/{task_id}/time_entries.json**](https://developer.teamwork.com/projects/time-tracking/retrieve-all-task-times) | ||
@@ -171,3 +171,3 @@ ```js | ||
[**GET /tasks/${task_id}/comments.json**](https://developer.teamwork.com/projects/comments/retrieving-comments-across-all-types) | ||
[**GET /tasks/{task_id}/comments.json**](https://developer.teamwork.com/projects/comments/retrieving-comments-across-all-types) | ||
@@ -180,3 +180,3 @@ ```js | ||
[**POST /tasks/${task_id}/comments.json**](https://developer.teamwork.com/projects/comments/creating-a-comment) | ||
[**POST /tasks/{task_id}/comments.json**](https://developer.teamwork.com/projects/comments/creating-a-comment) | ||
@@ -189,3 +189,3 @@ ```js | ||
[**GET /tasks/${task_id}/files.json**](https://developer.teamwork.com/projects/files/list-files-on-a-task) | ||
[**GET /tasks/{task_id}/files.json**](https://developer.teamwork.com/projects/files/list-files-on-a-task) | ||
@@ -198,3 +198,3 @@ ```js | ||
[**POST /tasks/${task_id}/files.json**](https://developer.teamwork.com/projects/files/add-a-file-to-a-task) | ||
[**POST /tasks/{task_id}/files.json**](https://developer.teamwork.com/projects/files/add-a-file-to-a-task) | ||
@@ -207,3 +207,3 @@ ```js | ||
[**GET /tasks/${task_id}/tags.json**](https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource) | ||
[**GET /tasks/{task_id}/tags.json**](https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource) | ||
@@ -216,3 +216,3 @@ ```js | ||
[**PUT /tasks/${task_id}/tags.json**](https://developer.teamwork.com/projects/tags/update-a-single-tag) | ||
[**PUT /tasks/{task_id}/tags.json**](https://developer.teamwork.com/projects/tags/update-a-single-tag) | ||
@@ -225,3 +225,3 @@ ```js | ||
[**GET /tasks/${task_id}/audit.json**](https://developer.teamwork.com/projects/activity/get-a-task-s-audit-history-premium-and-enterprise-plans-only) | ||
[**GET /tasks/{task_id}/audit.json**](https://developer.teamwork.com/projects/activity/get-a-task-s-audit-history-premium-and-enterprise-plans-only) | ||
@@ -228,0 +228,0 @@ ```js |
## Teamwork | ||
### Teamwork Constructor | ||
[** **]() | ||
```js | ||
``` | ||
### Get account information | ||
@@ -35,10 +27,2 @@ | ||
### handle Errors | ||
[** **]() | ||
```js | ||
``` | ||
### Execute api query | ||
@@ -49,3 +33,3 @@ | ||
```js | ||
tw.teamwork.query(options) | ||
``` |
@@ -5,3 +5,3 @@ ## Time | ||
[**GET /time_entries.json | /time_entries/${time_id}.json**](https://developer.teamwork.com/projects/time-tracking/retrieve-all-time-entries-across-all-projects) | ||
[**GET /time_entries.json | /time_entries/{time_id}.json**](https://developer.teamwork.com/projects/time-tracking/retrieve-all-time-entries-across-all-projects) | ||
@@ -14,3 +14,3 @@ ```js | ||
[**PUT /time_entries/${time_id}.json**](https://developer.teamwork.com/projects/time-tracking/update-a-time-entry) | ||
[**PUT /time_entries/{time_id}.json**](https://developer.teamwork.com/projects/time-tracking/update-a-time-entry) | ||
@@ -23,3 +23,3 @@ ```js | ||
[**DELETE /time_entries/${time_id}.json**](https://developer.teamwork.com/projects/time-tracking/delete-a-time-entry) | ||
[**DELETE /time_entries/{time_id}.json**](https://developer.teamwork.com/projects/time-tracking/delete-a-time-entry) | ||
@@ -40,3 +40,3 @@ ```js | ||
[**GET /timelogs/${time_id}/tags.json**](https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource) | ||
[**GET /timelogs/{time_id}/tags.json**](https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource) | ||
@@ -49,3 +49,3 @@ ```js | ||
[**PUT /timelogs/${time_id}/tags.json**](https://developer.teamwork.com/projects/tags/update-a-single-tag) | ||
[**PUT /timelogs/{time_id}/tags.json**](https://developer.teamwork.com/projects/tags/update-a-single-tag) | ||
@@ -52,0 +52,0 @@ ```js |
@@ -5,3 +5,3 @@ ## Trashcan | ||
[**GET /trashcan/projects/${project_id}.json**](https://developer.teamwork.com/projects/trashcan/get-a-project-resources-in-the-trashcan) | ||
[**GET /trashcan/projects/{project_id}.json**](https://developer.teamwork.com/projects/trashcan/get-a-project-resources-in-the-trashcan) | ||
@@ -8,0 +8,0 @@ ```js |
@@ -13,3 +13,3 @@ ## Webhook | ||
[**GET /webhooks.json | /webhooks/${webhook_id}.json**](https://developer.teamwork.com/projects/webhooks/get-all-webhooks-set-on-your-account) | ||
[**GET /webhooks.json | /webhooks/{webhook_id}.json**](https://developer.teamwork.com/projects/webhooks/get-all-webhooks-set-on-your-account) | ||
@@ -30,3 +30,3 @@ ```js | ||
[**PUT /webhooks/${webhook_id}.json**](https://developer.teamwork.com/projects/webhooks/update-a-specific-webhook-set-on-your-account) | ||
[**PUT /webhooks/{webhook_id}.json**](https://developer.teamwork.com/projects/webhooks/update-a-specific-webhook-set-on-your-account) | ||
@@ -39,3 +39,3 @@ ```js | ||
[**PUT /webhooks/${webhook_id}/resume.json**](https://developer.teamwork.com/projects/webhooks/resume-a-specific-webhook-set-on-your-account) | ||
[**PUT /webhooks/{webhook_id}/resume.json**](https://developer.teamwork.com/projects/webhooks/resume-a-specific-webhook-set-on-your-account) | ||
@@ -48,3 +48,3 @@ ```js | ||
[**PUT /webhooks/${webhook_id}/pause.json**](https://developer.teamwork.com/projects/webhooks/pause-a-specific-webhook-set-on-your-account) | ||
[**PUT /webhooks/{webhook_id}/pause.json**](https://developer.teamwork.com/projects/webhooks/pause-a-specific-webhook-set-on-your-account) | ||
@@ -57,3 +57,3 @@ ```js | ||
[**DELETE /webhooks/${webhook_id}.json**](https://developer.teamwork.com/projects/webhooks/delete-a-specific-webhook-on-your-account) | ||
[**DELETE /webhooks/{webhook_id}.json**](https://developer.teamwork.com/projects/webhooks/delete-a-specific-webhook-on-your-account) | ||
@@ -60,0 +60,0 @@ ```js |
{ | ||
"name": "teamwork-api", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "A wrapper around teamwork api making it easier to perform requests.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -26,3 +26,3 @@ # Teamwork Api | ||
Alternativly pass them in as function arguments | ||
Alternatively pass them in as function arguments | ||
@@ -33,2 +33,19 @@ ```js | ||
If your teamwork installation uses a custom domain (ie. https://tw.mycompany.com) pass the `custom_domain=true` flag. | ||
```js | ||
const tw = require('teamwork-api')('1234567890', 'https://tw.mycompany.com', custom_domain=true) | ||
``` | ||
## Contributing | ||
I am happy for people to contribute to this project, fix or add new features. | ||
Be sure when adding / modifying methods that the doc blocks are correct. | ||
The documentation is built based on these comments using `npm run docs`. | ||
Further to this ensure when you commit you are using `npm run commit` as this will help when semantic versioning the code. | ||
Happy coding 💻... | ||
## API Reference | ||
@@ -61,3 +78,3 @@ | ||
[Calendar Events](/docs/calendar.md) | ||
[Companies](/docs/company.md) | ||
@@ -64,0 +81,0 @@ |
'use strict' | ||
function teamwork (api_key = '', domain = '') { | ||
function teamwork (api_key = '', domain = '', custom_domain = false) { | ||
@@ -10,2 +10,5 @@ api_key = !api_key ? process.env.TW_API : api_key | ||
throw new Error('api_key or domain not provided') | ||
} if (custom_domain && | ||
!/^((\b(f|F)(t|T)(p|P)\b|\b(h|H)(t|T)(t|T)(p|P)\b|\b(h|H)(t|T)(t|T)(p|P)(s|S)\b)+(:\/\/[0-9a-zA-Z])|[0-9a-zA-Z])+\.+[0-9a-zA-Z]+(\.([0-9a-zA-z])+)+$/.test(domain)){ | ||
throw new Error('custom domains must be fully qualified and include protocol without a trailing slash') | ||
} | ||
@@ -48,8 +51,8 @@ | ||
const base = new api['teamwork'](api_key, domain) | ||
const base = new api['teamwork'](api_key, domain, custom_domain) | ||
return new Proxy(base, { | ||
get: (target, name) => { | ||
return api[name] ? | ||
new api[name](api_key, domain) : | ||
return api[name] ? | ||
new api[name](api_key, domain, custom_domain) : | ||
base[name] | ||
@@ -56,0 +59,0 @@ } |
@@ -76,3 +76,3 @@ 'use strict' | ||
* @method DELETE | ||
* @uri /links/${link_id}.json | ||
* @uri /links/{link_id}.json | ||
* @url https://developer.teamwork.com/projects/links/delete-a-single-link | ||
@@ -146,3 +146,3 @@ * @example tw.links.delete(link_id) | ||
* @method GET | ||
* @uri /links/${link_id}/tags.json | ||
* @uri /links/{link_id}/tags.json | ||
* @url https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource | ||
@@ -170,3 +170,3 @@ * @example tw.links.getTags(link_id, query_string) | ||
* @method PUT | ||
* @uri /links/${link_id}/tags.json | ||
* @uri /links/{link_id}/tags.json | ||
* @url https://developer.teamwork.com/projects/tags/update-tags-on-a-resource | ||
@@ -173,0 +173,0 @@ * @example tw.links.updateTag(link_id, body) |
@@ -168,3 +168,3 @@ 'use strict' | ||
* @method GET | ||
* @uri /messageReplies/${message_id}.json | ||
* @uri /messageReplies/{message_id}.json | ||
* @url https://developer.teamwork.com/projects/message-replies/retrieve-a-single-message-reply | ||
@@ -171,0 +171,0 @@ * @example tw.messages.getReply(message_id) |
@@ -11,3 +11,3 @@ 'use strict' | ||
* @method GET | ||
* @uri /milestones.json | /milestones/${milestone_id}.json | ||
* @uri /milestones.json | /milestones/{milestone_id}.json | ||
* @url https://developer.teamwork.com/projects/milestones/list-all-milestones | ||
@@ -77,3 +77,3 @@ * @example tw.milestones.get(query_string, milestone_id) | ||
* @method PUT | ||
* @uri /milestones/${milestone_id}.json | ||
* @uri /milestones/{milestone_id}.json | ||
* @url https://developer.teamwork.com/projects/milestones/update-a-single-milestone | ||
@@ -102,3 +102,3 @@ * @example tw.milestones.update(milestone_id, body) | ||
* @method DELETE | ||
* @uri /milestones/${milestone_id}.json | ||
* @uri /milestones/{milestone_id}.json | ||
* @url https://developer.teamwork.com/projects/milestones/delete-a-milestone | ||
@@ -125,3 +125,3 @@ * @example tw.milestones.delete(milestone_id) | ||
* @method GET | ||
* @uri /milestones/${milestone_id}/comments.json | ||
* @uri /milestones/{milestone_id}/comments.json | ||
* @url https://developer.teamwork.com/projects/comments/retrieving-comments-across-all-types | ||
@@ -149,3 +149,3 @@ * @example tw.milestones.getComments(milestone_id, query_string) | ||
* @method POST | ||
* @uri /milestones/${milestone_id}/comments.json | ||
* @uri /milestones/{milestone_id}/comments.json | ||
* @url https://developer.teamwork.com/projects/comments/creating-a-comment | ||
@@ -174,3 +174,3 @@ * @example tw.milestones.createComment(milestone_id, body) | ||
* @method GET | ||
* @uri /milestones/${milestone_id}/tags.json | ||
* @uri /milestones/{milestone_id}/tags.json | ||
* @url https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource | ||
@@ -198,3 +198,3 @@ * @example tw.milestones.getTags(milestone_id, query_string) | ||
* @method PUT | ||
* @uri /milestones/${milestone_id}/tags.json | ||
* @uri /milestones/{milestone_id}/tags.json | ||
* @url https://developer.teamwork.com/projects/tags/update-tags-on-a-resource | ||
@@ -201,0 +201,0 @@ * @example tw.milestones.updateTag(milestone_id, body) |
@@ -122,3 +122,3 @@ 'use strict' | ||
* @method PUT | ||
* @uri /notebooks/${notebook_id}/copy.json | ||
* @uri /notebooks/{notebook_id}/copy.json | ||
* @url https://developer.teamwork.com/projects/notebooks/copy-a-notebook-to-another-project | ||
@@ -147,3 +147,3 @@ * @example tw.notebooks.copy(notebook_id, body) | ||
* @method PUT | ||
* @uri /notebooks/${notebook_id}/move.json | ||
* @uri /notebooks/{notebook_id}/move.json | ||
* @url https://developer.teamwork.com/projects/notebooks/move-a-notebook-to-another-project | ||
@@ -172,3 +172,3 @@ * @example tw.notebooks.move(notebook_id, body) | ||
* @method GET | ||
* @uri /notebooks/${notebook_id}/comments.json | ||
* @uri /notebooks/{notebook_id}/comments.json | ||
* @url https://developer.teamwork.com/projects/comments/retrieving-comments-across-all-types | ||
@@ -196,3 +196,3 @@ * @example tw.notbooks.getComments(notebook_id, query_string) | ||
* @method POST | ||
* @uri /notebooks/${notebook_id}/comments.json | ||
* @uri /notebooks/{notebook_id}/comments.json | ||
* @url https://developer.teamwork.com/projects/comments/creating-a-comment | ||
@@ -199,0 +199,0 @@ * @example tw.notbooks.createComment(notebook_id, body) |
@@ -258,3 +258,3 @@ 'use strict' | ||
* @method GET | ||
* @uri /people/${person_id}/clockins.json | ||
* @uri /people/{person_id}/clockins.json | ||
* @url https://developer.teamwork.com/projects/clock-in-clock-out/get-all-clock-ins | ||
@@ -261,0 +261,0 @@ * @example tw.people.clockIns(person_id, query_string) |
@@ -306,3 +306,3 @@ 'use strict' | ||
* @method GET | ||
* @uri /projects/${project_id}/companies.json | ||
* @uri /projects/{project_id}/companies.json | ||
* @url https://developer.teamwork.com/projects/companies/retrieving-companies-within-a-project | ||
@@ -421,3 +421,3 @@ * @example tw.projects.getCompanies(project_id) | ||
* @method GET | ||
* @uri /projects/${project_id}/posts/archive.json | ||
* @uri /projects/{project_id}/posts/archive.json | ||
* @url https://developer.teamwork.com/projects/messages/get-archived-messages | ||
@@ -587,3 +587,3 @@ * @example tw.projects.getMessages(project_id, archived) | ||
* @method POST | ||
* @uri /projects/${project_id}/people/${person_id}.json | ||
* @uri /projects/${project_id}/people/{person_id}.json | ||
* @url https://developer.teamwork.com/projects/people/add-people-to-existing-project | ||
@@ -611,3 +611,3 @@ * @example tw.projects.addPeople(project_id, person_id) | ||
* @method PUT | ||
* @uri /projects/${project_id}/people.json | ||
* @uri /projects/{project_id}/people.json | ||
* @url https://developer.teamwork.com/projects/permissions/add-remove-multiple-people-to-from-a-project | ||
@@ -636,3 +636,3 @@ * @example tw.projects.people(project_id, body) | ||
* @method POST | ||
* @uri /projects/${project_id}/people.json | ||
* @uri /projects/{project_id}/people.json | ||
* @url https://developer.teamwork.com/projects/people/remove-people-from-a-project | ||
@@ -661,3 +661,3 @@ * @example tw.projects.removePeople(project_id, body) | ||
* @method GET | ||
* @uri /projects/${project_id}/people/${person_id}.json | ||
* @uri /projects/${project_id}/people/{person_id}.json | ||
* @url https://developer.teamwork.com/projects/permissions/get-a-users-permissions-on-a-project | ||
@@ -684,3 +684,3 @@ * @example tw.projects.getPermissions(project_id, person_id) | ||
* @method PUT | ||
* @uri /projects/${project_id}/people/${person_id}.json | ||
* @uri /projects/${project_id}/people/{person_id}.json | ||
* @url https://developer.teamwork.com/projects/permissions/update-a-users-permissions-on-a-project | ||
@@ -775,3 +775,3 @@ * @example tw.projects.updatePermissions(project_id, person_id, body) | ||
* @url https://developer.teamwork.com/projects/projects/retrieve-a-single-project | ||
* @example tw.projects.delete(query_string, project_id) | ||
* @example tw.projects.get(query_string, project_id) | ||
* | ||
@@ -811,3 +811,3 @@ * @param {Object} | ||
* @method PUT | ||
* @uri /projects/${project_id}/star.json | ||
* @uri /projects/{project_id}/star.json | ||
* @url https://developer.teamwork.com/projects/projects/star-a-project | ||
@@ -903,3 +903,3 @@ * @example tw.projects.star(project_id) | ||
* @method PUT | ||
* @uri /projects/${project_id}.json | ||
* @uri /projects/{project_id}.json | ||
* @url https://developer.teamwork.com/projects/projects/enable-and-disable-projects-features | ||
@@ -928,3 +928,3 @@ * @example tw.projects.features(project_id, body) | ||
* @method GET | ||
* @uri /projects/${project_id}/roles.json | ||
* @uri /projects/{project_id}/roles.json | ||
* @url https://developer.teamwork.com/projects/project-roles/list-roles-on-a-project | ||
@@ -950,3 +950,3 @@ * @example tw.projects.getRoles(project_id) | ||
* @method GET | ||
* @uri /projects/${project_id}/emailaddress.json | ||
* @uri /projects/{project_id}/emailaddress.json | ||
* @url https://developer.teamwork.com/projects/project-email-addresses/get-project-email-address | ||
@@ -972,3 +972,3 @@ * @example tw.projects.getEmailAddress(project_id) | ||
* @method PUT | ||
* @uri /projects/${project_id}/emailaddress.json | ||
* @uri /projects/{project_id}/emailaddress.json | ||
* @url https://developer.teamwork.com/projects/project-email-addresses/update-project-email-address | ||
@@ -997,3 +997,3 @@ * @example tw.projects.setEmailAddress(project_id, body) | ||
* @method GET | ||
* @uri /projects/${project_id}/links.json | ||
* @uri /projects/{project_id}/links.json | ||
* @url https://developer.teamwork.com/projects/links/list-links-on-a-project | ||
@@ -1019,3 +1019,3 @@ * @example tw.projects.getLinks(project_id) | ||
* @method GET | ||
* @uri /projects/${project_id}/risks.json | ||
* @uri /projects/{project_id}/risks.json | ||
* @url https://developer.teamwork.com/projects/risks/retrieve-all-risks-in-a-project | ||
@@ -1041,3 +1041,3 @@ * @example tw.projects.getRisks(project_id) | ||
* @method GET | ||
* @uri /projects/${project_id}/time_entries.json | ||
* @uri /projects/{project_id}/time_entries.json | ||
* @url https://developer.teamwork.com/projects/time-tracking/retrieve-all-time-entries-for-a-project | ||
@@ -1065,3 +1065,3 @@ * @example tw.projects.getTime(project_id, query_string) | ||
* @method POST | ||
* @uri /projects/${project_id}/time_entries.json | ||
* @uri /projects/{project_id}/time_entries.json | ||
* @url https://developer.teamwork.com/projects/time-tracking/create-a-time-entry | ||
@@ -1134,3 +1134,3 @@ * @example tw.projects.createTime(project_id, body) | ||
* @method GET | ||
* @uri /projects/${project_id}/tasks.json | ||
* @uri /projects/{project_id}/tasks.json | ||
* @url https://developer.teamwork.com/projects/tasks/get-all-tasks-on-a-given-project | ||
@@ -1158,3 +1158,3 @@ * @example tw.projects.getTasks(project_id, query_string) | ||
* @method GET | ||
* @uri /projects/${project_id}/tags.json | ||
* @uri /projects/{project_id}/tags.json | ||
* @url https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource | ||
@@ -1182,3 +1182,3 @@ * @example tw.projects.getTags(project_id, query_string) | ||
* @method PUT | ||
* @uri /projects/${project_id}/tags.json | ||
* @uri /projects/{project_id}/tags.json | ||
* @url https://developer.teamwork.com/projects/tags/update-tags-on-a-resource | ||
@@ -1185,0 +1185,0 @@ * @example tw.projects.updateTag(project_id, body) |
@@ -11,3 +11,3 @@ 'use strict' | ||
* @method GET | ||
* @uri /risks/${risk_id}.json | ||
* @uri /risks/{risk_id}.json | ||
* @url https://developer.teamwork.com/projects/risks/get-all-risks | ||
@@ -14,0 +14,0 @@ * @example tw.risks.get(query_string, risk_id) |
@@ -32,3 +32,3 @@ 'use strict' | ||
* @method POST | ||
* @uri /projects/${project_id}/roles.json | ||
* @uri /projects/{project_id}/roles.json | ||
* @url https://developer.teamwork.com/projects/project-roles/add-a-role-to-a-project | ||
@@ -57,3 +57,3 @@ * @example tw.roles.create(project_id, body) | ||
* @method PUT | ||
* @uri /roles/${role_id}.json | ||
* @uri /roles/{role_id}.json | ||
* @url https://developer.teamwork.com/projects/project-roles/update-a-role-on-a-project | ||
@@ -82,3 +82,3 @@ * @example tw.roles.update(role_id, body) | ||
* @method DELETE | ||
* @uri /roles/${role_id}.json | ||
* @uri /roles/{role_id}.json | ||
* @url https://developer.teamwork.com/projects/project-roles/delete-a-role | ||
@@ -85,0 +85,0 @@ * @example tw.roles.delete(role_id) |
@@ -11,3 +11,3 @@ 'use strict' | ||
* @method GET | ||
* @uri /statuses.json | /people/${user_id}/status.json | ||
* @uri /statuses.json | /people/{user_id}/status.json | ||
* @url https://developer.teamwork.com/projects/people-status/retrieve-everybody-status | ||
@@ -69,3 +69,3 @@ * @example tw.status.get(user_id) | ||
* @method PUT | ||
* @uri /me/status/${status_id}.json | ||
* @uri /me/status/{status_id}.json | ||
* @url https://developer.teamwork.com/projects/people-status/update-my-status | ||
@@ -94,3 +94,3 @@ * @example tw.status.updateMe(status_id, body) | ||
* @method PUT | ||
* @uri /people/status/${status_id}.json | /people/${person_id}/status/${status_id}.json | ||
* @uri /people/status/${status_id}.json | /people/${person_id}/status/{status_id}.json | ||
* @url https://developer.teamwork.com/projects/people-status/update-user-status | ||
@@ -126,3 +126,3 @@ * @example tw.status.update(status_id, person_id, body) | ||
* @method DELETE | ||
* @uri /me/status/${status_id}.json | ||
* @uri /me/status/{status_id}.json | ||
* @url https://developer.teamwork.com/projects/people-status/delete-my-status | ||
@@ -150,3 +150,3 @@ * @example tw.status.deleteMe(status_id) | ||
* @method DELETE | ||
* @uri /people/status/${status_id}.json | /people/${person_id}/status/${status_id}.json | ||
* @uri /people/status/${status_id}.json | /people/${person_id}/status/{status_id}.json | ||
* @url https://developer.teamwork.com/projects/people-status/delete-user-status | ||
@@ -153,0 +153,0 @@ * @example tw.status.delete(status_id, person_id) |
@@ -51,3 +51,3 @@ 'use strict' | ||
* @method PUT | ||
* @uri /tags/${tag_id}.json | ||
* @uri /tags/{tag_id}.json | ||
* @url https://developer.teamwork.com/projects/tags/update-a-single-tag | ||
@@ -77,3 +77,3 @@ * @example tw.tags.update(tag_id, body) | ||
* @method DELETE | ||
* @uri /tags/${tag_id}.json | ||
* @uri /tags/{tag_id}.json | ||
* @url https://developer.teamwork.com/projects/tags/delete-a-single-tag | ||
@@ -80,0 +80,0 @@ * @example tw.tags.delete(tag_id) |
@@ -11,3 +11,3 @@ 'use strict' | ||
* @method GET | ||
* @uri /tasklists.json | /tasklists/${tasklist_id}.json | ||
* @uri /tasklists.json | /tasklists/{tasklist_id}.json | ||
* @url https://developer.teamwork.com/projects/task-lists/get-all-task-lists | ||
@@ -190,3 +190,3 @@ * @example tw.tasklists.get(query_string, tasklist_id) | ||
* @method GET | ||
* @uri /tasklists/${tasklist_id}/tasks.json | ||
* @uri /tasklists/{tasklist_id}/tasks.json | ||
* @url https://developer.teamwork.com/projects/tasks/get-all-tasks-on-a-given-task-list | ||
@@ -214,3 +214,3 @@ * @example tw.tasklists.getTasks(tasklist_id, query_string) | ||
* @method GET | ||
* @uri /tasklists/${tasklist_id}/time/total.json | ||
* @uri /tasklists/{tasklist_id}/time/total.json | ||
* @url https://developer.teamwork.com/projects/tasks/get-all-tasks-on-a-given-task-list | ||
@@ -217,0 +217,0 @@ * @example tw.tasklists.totalTime(tasklist_id, query_string) |
@@ -11,3 +11,3 @@ 'use strict' | ||
* @method GET | ||
* @uri /tasks.json | /tasks/${task_id}.json | ||
* @uri /tasks.json | /tasks/{task_id}.json | ||
* @url https://developer.teamwork.com/projects/tasks/get-all-tasks-across-all-projects | ||
@@ -58,3 +58,3 @@ * @example tw.tasks.get(query_string, task_id) | ||
* @method PUT | ||
* @uri /tasks/${task_id}.json | ||
* @uri /tasks/{task_id}.json | ||
* @url https://developer.teamwork.com/projects/tasks/update-a-task | ||
@@ -83,3 +83,3 @@ * @example tw.tasks.update(task_id, body) | ||
* @method DELETE | ||
* @uri /tasks/${task_id}.json | ||
* @uri /tasks/{task_id}.json | ||
* @url https://developer.teamwork.com/projects/tasks/delete-a-task | ||
@@ -106,3 +106,3 @@ * @example tw.tasks.delete(task_id) | ||
* @method POST | ||
* @uri /tasks/${task_id}.json | ||
* @uri /tasks/{task_id}.json | ||
* @url https://developer.teamwork.com/projects/tasks/create-a-sub-task | ||
@@ -196,3 +196,3 @@ * @example tw.tasks.subtask(task_id, body, query_string) | ||
* @method PUT | ||
* @uri /tasks/${task_id}.json | ||
* @uri /tasks/{task_id}.json | ||
* @url https://developer.teamwork.com/projects/tasks/change-the-completed-date-on-closed-tasks | ||
@@ -221,3 +221,3 @@ * @example tw.tasks.completedDate(task_id, body) | ||
* @method GET | ||
* @uri /tasks/${task_id}/dependencies.json | ||
* @uri /tasks/{task_id}/dependencies.json | ||
* @url https://developer.teamwork.com/projects/tasks/retrieve-task-dependencies | ||
@@ -243,3 +243,3 @@ * @example tw.tasks.dependencies(task_id) | ||
* @method PUT | ||
* @uri /tasklists/${tasklist_id}/tasks/reorder.json | ||
* @uri /tasklists/{tasklist_id}/tasks/reorder.json | ||
* @url https://developer.teamwork.com/projects/tasks/reorder-the-tasks | ||
@@ -268,3 +268,3 @@ * @example tw.tasks.reorder(tasklist_id, body) | ||
* @method GET | ||
* @uri /tasks/${task_id}/followers.json | ||
* @uri /tasks/{task_id}/followers.json | ||
* @url https://developer.teamwork.com/projects/tasks/get-task-followers | ||
@@ -290,3 +290,3 @@ * @example tw.tasks.getFollowers(task_id) | ||
* @method PUT | ||
* @uri /tasks/${task_id}.json | ||
* @uri /tasks/{task_id}.json | ||
* @url https://developer.teamwork.com/projects/tasks/set-task-followers | ||
@@ -315,3 +315,3 @@ * @example tw.tasks.setFollowers(task_id, body) | ||
* @method PUT | ||
* @uri /tasks/${task_id}.json | ||
* @uri /tasks/{task_id}.json | ||
* @url https://developer.teamwork.com/projects/tasks/remove-task-followers | ||
@@ -340,3 +340,3 @@ * @example tw.tasks.removeFollowers(task_id, body) | ||
* @method PUT | ||
* @uri /tasklists/${tasklist_id}/quickadd.json | ||
* @uri /tasklists/{tasklist_id}/quickadd.json | ||
* @url https://developer.teamwork.com/projects/tasks/quickly-add-multiple-tasks | ||
@@ -365,3 +365,3 @@ * @example tw.tasks.quickadd(tasklist_id, body) | ||
* @method POST | ||
* @uri /tasks/${task_id}/time_entries.json | ||
* @uri /tasks/{task_id}/time_entries.json | ||
* @url https://developer.teamwork.com/projects/time-tracking/create-a-time-entry-for-a-task | ||
@@ -390,3 +390,3 @@ * @example tw.tasks.createTime(task_id, body) | ||
* @method GET | ||
* @uri /tasks/${task_id}/time/total.json | ||
* @uri /tasks/{task_id}/time/total.json | ||
* @url https://developer.teamwork.com/projects/time-tracking/total-time-on-a-task | ||
@@ -438,3 +438,3 @@ * @example tw.tasks.totalTime(task_id, query_string) | ||
* @method GET | ||
* @uri /tasks/${task_id}/time_entries.json | ||
* @uri /tasks/{task_id}/time_entries.json | ||
* @url https://developer.teamwork.com/projects/time-tracking/retrieve-all-task-times | ||
@@ -460,3 +460,3 @@ * @example tw.tasks.getTimeEntries(task_id) | ||
* @method GET | ||
* @uri /tasks/${task_id}/comments.json | ||
* @uri /tasks/{task_id}/comments.json | ||
* @url https://developer.teamwork.com/projects/comments/retrieving-comments-across-all-types | ||
@@ -484,3 +484,3 @@ * @example tw.tasks.getComments(task_id, query_string) | ||
* @method POST | ||
* @uri /tasks/${task_id}/comments.json | ||
* @uri /tasks/{task_id}/comments.json | ||
* @url https://developer.teamwork.com/projects/comments/creating-a-comment | ||
@@ -509,3 +509,3 @@ * @example tw.tasks.createComment(task_id, body) | ||
* @method GET | ||
* @uri /tasks/${task_id}/files.json | ||
* @uri /tasks/{task_id}/files.json | ||
* @url https://developer.teamwork.com/projects/files/list-files-on-a-task | ||
@@ -532,3 +532,3 @@ * @example tw.tasks.getFiles(task_id) | ||
* @method POST | ||
* @uri /tasks/${task_id}/files.json | ||
* @uri /tasks/{task_id}/files.json | ||
* @url https://developer.teamwork.com/projects/files/add-a-file-to-a-task | ||
@@ -557,3 +557,3 @@ * @example tw.tasks.createFile(task_id, body) | ||
* @method GET | ||
* @uri /tasks/${task_id}/tags.json | ||
* @uri /tasks/{task_id}/tags.json | ||
* @url https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource | ||
@@ -581,3 +581,3 @@ * @example tw.tasks.getTags(task_id, query_string) | ||
* @method PUT | ||
* @uri /tasks/${task_id}/tags.json | ||
* @uri /tasks/{task_id}/tags.json | ||
* @url https://developer.teamwork.com/projects/tags/update-a-single-tag | ||
@@ -606,3 +606,3 @@ * @example tw.tasks.updateTag(task_id, body) | ||
* @method GET | ||
* @uri /tasks/${task_id}/audit.json | ||
* @uri /tasks/{task_id}/audit.json | ||
* @url https://developer.teamwork.com/projects/activity/get-a-task-s-audit-history-premium-and-enterprise-plans-only | ||
@@ -609,0 +609,0 @@ * @example tw.tasks.audit(task_id) |
@@ -7,13 +7,7 @@ 'use strict' | ||
/** | ||
* Teamwork Constructor | ||
* | ||
* @param {String} | ||
* @param {String} | ||
* @return {Object} | ||
*/ | ||
constructor(api_key, domain) { | ||
constructor(api_key, domain, custom_domain) { | ||
this.api_key = api_key | ||
this.domain = domain | ||
this.europe = domain.indexOf('.eu') === -1 | ||
this.customDomain = custom_domain | ||
} | ||
@@ -50,3 +44,3 @@ | ||
uri: '/authenticate.json', | ||
baseUrl: 'https://' + (this.europe ? 'authenticate.teamwork.com' : 'authenticate.eu.teamwork.com') | ||
baseUrl: this.customDomain ? this.domain : 'https://' + (this.europe ? 'authenticate.teamwork.com' : 'authenticate.eu.teamwork.com') | ||
}) | ||
@@ -73,8 +67,2 @@ } | ||
/** | ||
* handle Errors | ||
* | ||
* @param {String} | ||
* @return {Promise} | ||
*/ | ||
handleError(message = 'Fatal error occured') { | ||
@@ -87,2 +75,4 @@ return Promise.reject(message) | ||
* | ||
* @example tw.teamwork.query(options) | ||
* | ||
* @param {Object} | ||
@@ -96,3 +86,3 @@ * @param {Object} | ||
method: 'GET', | ||
baseUrl: `https://${this.domain}.teamwork.com`, | ||
baseUrl: this.customDomain ? this.domain :`https://${this.domain}.teamwork.com`, | ||
uri: '/', | ||
@@ -99,0 +89,0 @@ json: true, |
@@ -11,3 +11,3 @@ 'use strict' | ||
* @method GET | ||
* @uri /time_entries.json | /time_entries/${time_id}.json | ||
* @uri /time_entries.json | /time_entries/{time_id}.json | ||
* @url https://developer.teamwork.com/projects/time-tracking/retrieve-all-time-entries-across-all-projects | ||
@@ -33,3 +33,3 @@ * @example tw.time.get(query_string, time_id) | ||
* @method PUT | ||
* @uri /time_entries/${time_id}.json | ||
* @uri /time_entries/{time_id}.json | ||
* @url https://developer.teamwork.com/projects/time-tracking/update-a-time-entry | ||
@@ -58,3 +58,3 @@ * @example tw.time.update(time_id, body) | ||
* @method DELETE | ||
* @uri /time_entries/${time_id}.json | ||
* @uri /time_entries/{time_id}.json | ||
* @url https://developer.teamwork.com/projects/time-tracking/delete-a-time-entry | ||
@@ -98,3 +98,3 @@ * @example tw.time.delete(time_id) | ||
* @method GET | ||
* @uri /timelogs/${time_id}/tags.json | ||
* @uri /timelogs/{time_id}/tags.json | ||
* @url https://developer.teamwork.com/projects/tags/list-all-tags-for-a-resource | ||
@@ -122,3 +122,3 @@ * @example tw.time.getTags(time_id, query_string) | ||
* @method PUT | ||
* @uri /timelogs/${time_id}/tags.json | ||
* @uri /timelogs/{time_id}/tags.json | ||
* @url https://developer.teamwork.com/projects/tags/update-a-single-tag | ||
@@ -125,0 +125,0 @@ * @example tw.tasks.updateTag(time_id, body) |
@@ -11,3 +11,3 @@ 'use strict' | ||
* @method GET | ||
* @uri /trashcan/projects/${project_id}.json | ||
* @uri /trashcan/projects/{project_id}.json | ||
* @url https://developer.teamwork.com/projects/trashcan/get-a-project-resources-in-the-trashcan | ||
@@ -14,0 +14,0 @@ * @example tw.trashcan.get(time_id, body) |
@@ -27,3 +27,3 @@ 'use strict' | ||
* @method GET | ||
* @uri /webhooks.json | /webhooks/${webhook_id}.json | ||
* @uri /webhooks.json | /webhooks/{webhook_id}.json | ||
* @url https://developer.teamwork.com/projects/webhooks/get-all-webhooks-set-on-your-account | ||
@@ -66,3 +66,3 @@ * @example tw.webhooks.get(webhook_id) | ||
* @method PUT | ||
* @uri /webhooks/${webhook_id}.json | ||
* @uri /webhooks/{webhook_id}.json | ||
* @url https://developer.teamwork.com/projects/webhooks/update-a-specific-webhook-set-on-your-account | ||
@@ -92,3 +92,3 @@ * @example tw.webhooks.update(webhook_id, body) | ||
* @method PUT | ||
* @uri /webhooks/${webhook_id}/resume.json | ||
* @uri /webhooks/{webhook_id}/resume.json | ||
* @url https://developer.teamwork.com/projects/webhooks/resume-a-specific-webhook-set-on-your-account | ||
@@ -115,3 +115,3 @@ * @example tw.webhooks.resume(webhook_id) | ||
* @method PUT | ||
* @uri /webhooks/${webhook_id}/pause.json | ||
* @uri /webhooks/{webhook_id}/pause.json | ||
* @url https://developer.teamwork.com/projects/webhooks/pause-a-specific-webhook-set-on-your-account | ||
@@ -138,3 +138,3 @@ * @example tw.webhooks.pause(webhook_id) | ||
* @method DELETE | ||
* @uri /webhooks/${webhook_id}.json | ||
* @uri /webhooks/{webhook_id}.json | ||
* @url https://developer.teamwork.com/projects/webhooks/delete-a-specific-webhook-on-your-account | ||
@@ -141,0 +141,0 @@ * @example tw.webhooks.delete(webhook_id) |
@@ -54,3 +54,3 @@ 'use strict' | ||
it('throws an error when no api key is provided on the environment', function () { | ||
it('throws an error when no subdomain is provided on the environment', function () { | ||
process.env.TW_SUB = domain | ||
@@ -61,3 +61,3 @@ expect(tw).to.throw(Error, 'api_key or domain not provided') | ||
it('throws an error when no subdomain is provided on the environment', function () { | ||
it('throws an error when no api key is provided on the environment', function () { | ||
process.env.TW_API = api | ||
@@ -68,2 +68,6 @@ expect(tw).to.throw(Error, 'api_key or domain not provided') | ||
it('throws an error when an invalid custom domain is passed', function () { | ||
expect(() => tw(api, 'mycompany.com', true)).to.throw(Error, 'custom domains must be fully qualified and include protocol without a trailing slash') | ||
}) | ||
// Success | ||
@@ -85,2 +89,7 @@ // | ||
it('returns the default teamwork class when a custom domain is used', function () { | ||
const instance = tw(api, 'https://projects.mydomain.net', true) | ||
expect(instance).to.be.an.instanceof(teamwork) | ||
}) | ||
it('returns correct Class instance when called', function () { | ||
@@ -87,0 +96,0 @@ const instance = tw(api, domain) |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
256092
0.46%111
18.09%