Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing all endpoints #25

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/api/clients.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ TogglClient.prototype.createClient = function createClient(data, callback) {
}
};

this.apiRequest('/api/v8/clients', req, utils.wrapDataCallback(callback));
this.apiRequest('/api/v9/clients', req, utils.wrapDataCallback(callback));
};


Expand All @@ -37,7 +37,7 @@ TogglClient.prototype.deleteClient = function deleteClient(clientId, callback) {
method: 'DELETE'
};

this.apiRequest('/api/v8/clients/' + clientId, req, callback);
this.apiRequest('/api/v9/clients/' + clientId, req, callback);
};


Expand All @@ -49,7 +49,7 @@ TogglClient.prototype.deleteClient = function deleteClient(clientId, callback) {
*/
TogglClient.prototype.getClientData = function getClientData(clientId,
callback) {
this.apiRequest('/api/v8/clients/' + clientId, {},
this.apiRequest('/api/v9/clients/' + clientId, {},
utils.wrapDataCallback(callback));
};

Expand All @@ -71,7 +71,7 @@ TogglClient.prototype.getClientProjects = function getClientProjects(clientId,
return;
}

this.apiRequest('/api/v8/clients/' + clientId + '/projects', { qs: qs },
this.apiRequest('/api/v9/clients/' + clientId + '/projects', { qs: qs },
callback);
};

Expand All @@ -82,7 +82,7 @@ TogglClient.prototype.getClientProjects = function getClientProjects(clientId,
* @param {Function} callback <code>(err, clients)</code>
*/
TogglClient.prototype.getClients = function getClients(callback) {
this.apiRequest('/api/v8/clients', {}, callback);
this.apiRequest('/api/v9/clients', {}, callback);
};


Expand All @@ -102,6 +102,6 @@ TogglClient.prototype.updateClient = function updateClient(clientId, data,
}
};

this.apiRequest('/api/v8/clients/' + clientId, req,
this.apiRequest('/api/v9/clients/' + clientId, req,
utils.wrapDataCallback(callback));
};
2 changes: 1 addition & 1 deletion lib/api/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ var utils = require('../utils');
* @param {Function} callback <code>(err, clients)</code>
*/
TogglClient.prototype.getDashboard = function getDashboard(wId, callback) {
this.apiRequest('/api/v8/dashboard/' + wId, {}, callback);
this.apiRequest('/api/v9/dashboard/' + wId, {}, callback);
};
6 changes: 3 additions & 3 deletions lib/api/project_users.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ TogglClient.prototype.addProjectUser = function addProjectUser(projectId,
}
};

this.apiRequest('/api/v8/project_users', req,
this.apiRequest('/api/v9/project_users', req,
utils.wrapDataCallback(callback));
};

Expand Down Expand Up @@ -88,7 +88,7 @@ TogglClient.prototype.deleteProjectUser = function deleteProjectUser(puID,
method: 'DELETE'
};

this.apiRequest('/api/v8/project_users/' + puID, req, callback);
this.apiRequest('/api/v9/project_users/' + puID, req, callback);
};


Expand Down Expand Up @@ -130,7 +130,7 @@ TogglClient.prototype.updateProjectUser = function updateProjectUser(puID,
}
};

this.apiRequest('/api/v8/project_users/' + puID, req,
this.apiRequest('/api/v9/project_users/' + puID, req,
utils.wrapDataCallback(callback));
};

Expand Down
12 changes: 6 additions & 6 deletions lib/api/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ TogglClient.prototype.createProject = function createProject(data, callback) {
}
};

this.apiRequest('/api/v8/projects', req, utils.wrapDataCallback(callback));
this.apiRequest('/api/v9/projects', req, utils.wrapDataCallback(callback));
};


Expand All @@ -38,7 +38,7 @@ TogglClient.prototype.deleteProject = function deleteProject(projectId,
method: 'DELETE'
};

this.apiRequest('/api/v8/projects/' + projectId, req, callback);
this.apiRequest('/api/v9/projects/' + projectId, req, callback);
};


Expand Down Expand Up @@ -67,7 +67,7 @@ TogglClient.prototype.deleteProjects = function deleteProjects(projectIds,
*/
TogglClient.prototype.getProjectData = function getProjectData(projectId,
callback) {
this.apiRequest('/api/v8/projects/' + projectId, {},
this.apiRequest('/api/v9/projects/' + projectId, {},
utils.wrapDataCallback(callback));
};

Expand All @@ -80,7 +80,7 @@ TogglClient.prototype.getProjectData = function getProjectData(projectId,
*/
TogglClient.prototype.getProjectTasks = function getProjectTasks(projectId,
callback) {
this.apiRequest('/api/v8/projects/' + projectId + '/tasks', {}, callback);
this.apiRequest('/api/v9/projects/' + projectId + '/tasks', {}, callback);
};


Expand All @@ -92,7 +92,7 @@ TogglClient.prototype.getProjectTasks = function getProjectTasks(projectId,
*/
TogglClient.prototype.getProjectUsers = function getProjectUsers(projectId,
callback) {
this.apiRequest('/api/v8/projects/' + projectId + '/project_users', {}, callback);
this.apiRequest('/api/v9/projects/' + projectId + '/project_users', {}, callback);
};


Expand All @@ -112,6 +112,6 @@ TogglClient.prototype.updateProject = function updateProject(projectId, data,
}
};

this.apiRequest('/api/v8/projects/' + projectId, req,
this.apiRequest('/api/v9/projects/' + projectId, req,
utils.wrapDataCallback(callback));
};
6 changes: 3 additions & 3 deletions lib/api/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ TogglClient.prototype.createTag = function createTag(name, workspaceId,
}
};

this.apiRequest('/api/v8/tags', req, utils.wrapDataCallback(callback));
this.apiRequest('/api/v9/tags', req, utils.wrapDataCallback(callback));
};


Expand All @@ -44,7 +44,7 @@ TogglClient.prototype.deleteTag = function deleteTag(tagId, callback) {
method: 'DELETE'
};

this.apiRequest('/api/v8/tags/' + tagId, req, callback);
this.apiRequest('/api/v9/tags/' + tagId, req, callback);
};


Expand Down Expand Up @@ -72,6 +72,6 @@ TogglClient.prototype.updateTagName = function updateTagName(tagId, name,
}
};

this.apiRequest('/api/v8/tags/' + tagId, req,
this.apiRequest('/api/v9/tags/' + tagId, req,
utils.wrapDataCallback(callback));
};
8 changes: 4 additions & 4 deletions lib/api/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ TogglClient.prototype.createTask = function createTask(name, projectId, data,
}
};

this.apiRequest('/api/v8/tasks', req, utils.wrapDataCallback(callback));
this.apiRequest('/api/v9/tasks', req, utils.wrapDataCallback(callback));
};


Expand All @@ -39,7 +39,7 @@ TogglClient.prototype.deleteTask = function deleteTask(taskId, callback) {
method: 'DELETE'
};

this.apiRequest('/api/v8/tasks/' + taskId, req, callback);
this.apiRequest('/api/v9/tasks/' + taskId, req, callback);
};


Expand All @@ -61,7 +61,7 @@ TogglClient.prototype.deleteTasks = function deleteTasks(taskIds, callback) {
* @param {Function} callback <code>(err, task)</code>
*/
TogglClient.prototype.getTaskData = function getTaskData(taskId, callback) {
this.apiRequest('/api/v8/tasks/' + taskId, {},
this.apiRequest('/api/v9/tasks/' + taskId, {},
utils.wrapDataCallback(callback));
};

Expand Down Expand Up @@ -92,7 +92,7 @@ TogglClient.prototype.updateTask = function updateTask(taskId, data, fields,
}
};

this.apiRequest('/api/v8/tasks/' + taskId, req,
this.apiRequest('/api/v9/tasks/' + taskId, req,
utils.wrapDataCallback(callback));
};

Expand Down
18 changes: 9 additions & 9 deletions lib/api/time_entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TogglClient.prototype.createTimeEntry = function createTimeEntry(data,
}
};

this.apiRequest('/api/v8/time_entries', req,
this.apiRequest('/api/v9/time_entries', req,
utils.wrapDataCallback(callback));
};

Expand All @@ -52,7 +52,7 @@ TogglClient.prototype.deleteTimeEntry = function deleteTimeEntry(teId,
method: 'DELETE'
};

this.apiRequest('/api/v8/time_entries/' + teId, req, callback);
this.apiRequest('/api/v9/time_entries/' + teId, req, callback);
};


Expand All @@ -64,7 +64,7 @@ TogglClient.prototype.deleteTimeEntry = function deleteTimeEntry(teId,
*/
TogglClient.prototype.getTimeEntryData = function getTimeEntryData(teId,
callback) {
this.apiRequest('/api/v8/time_entries/' + teId, {},
this.apiRequest('/api/v9/time_entries/' + teId, {},
utils.wrapDataCallback(callback));
};

Expand Down Expand Up @@ -101,7 +101,7 @@ TogglClient.prototype.getTimeEntries = function getTimeEntries(startDate,
qs: qs
};

this.apiRequest('/api/v8/time_entries', req, callback);
this.apiRequest('/api/v9/time_entries', req, callback);
};


Expand All @@ -111,7 +111,7 @@ TogglClient.prototype.getTimeEntries = function getTimeEntries(startDate,
* @param {Function} callback <code>(err, timeEntry)</code>
*/
TogglClient.prototype.getCurrentTimeEntry = function getCurrentTimeEntry(callback) {
this.apiRequest('/api/v8/time_entries/current', {},
this.apiRequest('/api/v9/time_entries/current', {},
utils.wrapDataCallback(callback));
};

Expand Down Expand Up @@ -144,7 +144,7 @@ TogglClient.prototype.startTimeEntry = function startTimeEntry(data, callback) {
}
};

this.apiRequest('/api/v8/time_entries/start', req,
this.apiRequest('/api/v9/time_entries/start', req,
utils.wrapDataCallback(callback));
};

Expand All @@ -160,7 +160,7 @@ TogglClient.prototype.stopTimeEntry = function stopTimeEntry(teId, callback) {
method: 'PUT'
};

this.apiRequest('/api/v8/time_entries/' + teId + '/stop', req,
this.apiRequest('/api/v9/time_entries/' + teId + '/stop', req,
utils.wrapDataCallback(callback));
};

Expand All @@ -181,7 +181,7 @@ TogglClient.prototype.updateTimeEntry = function updateTimeEntry(teId, data,
}
};

this.apiRequest('/api/v8/time_entries/' + teId, req,
this.apiRequest('/api/v9/time_entries/' + teId, req,
utils.wrapDataCallback(callback));
};

Expand Down Expand Up @@ -212,6 +212,6 @@ TogglClient.prototype.updateTimeEntriesTags = function updateTimeEntriesTags(teI
}
};

this.apiRequest('/api/v8/time_entries/' + teIds.join(), req,
this.apiRequest('/api/v9/time_entries/' + teIds.join(), req,
utils.wrapDataCallback(callback));
};
10 changes: 5 additions & 5 deletions lib/api/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TogglClient.createUser = function createUser(email, password, timezone,
}
};

TogglClient.defaultClient().apiRequest('/api/v8/signups', req,
TogglClient.defaultClient().apiRequest('/api/v9/signups', req,
utils.wrapDataCallback(callback));
};

Expand Down Expand Up @@ -68,7 +68,7 @@ TogglClient.prototype.changeUserPassword = function changeUserPassword(currentPa
}
};

this.apiRequest('/api/v8/me', req, utils.wrapDataCallback(callback));
this.apiRequest('/api/v9/me', req, utils.wrapDataCallback(callback));
};


Expand All @@ -83,7 +83,7 @@ TogglClient.prototype.getUserData = function getUserData(options, callback) {
return;
}

this.apiRequest('/api/v8/me', { qs: options },
this.apiRequest('/api/v9/me', { qs: options },
utils.wrapDataCallback(callback));
};

Expand Down Expand Up @@ -113,7 +113,7 @@ TogglClient.prototype.resetApiToken = function resetApiToken(callback) {
};
}

this.apiRequest('/api/v8/reset_token', req, callback);
this.apiRequest('/api/v9/reset_token', req, callback);
};


Expand All @@ -135,5 +135,5 @@ TogglClient.prototype.updateUserData = function updateUserData(data, callback) {
}
};

this.apiRequest('/api/v8/me', req, utils.wrapDataCallback(callback));
this.apiRequest('/api/v9/me', req, utils.wrapDataCallback(callback));
};
6 changes: 3 additions & 3 deletions lib/api/workspace_users.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ TogglClient.prototype.deleteWorkspaceUser = function deleteWorkspaceUser(wuId,
method: 'DELETE'
};

this.apiRequest('/api/v8/workspace_users/' + wuId, req, callback);
this.apiRequest('/api/v9/workspace_users/' + wuId, req, callback);
};


Expand All @@ -36,7 +36,7 @@ TogglClient.prototype.inviteUsers = function inviteUsers(workspaceId, emails,
}
};

this.apiRequest('/api/v8/workspaces/' + workspaceId + '/invite', req,
this.apiRequest('/api/v9/workspaces/' + workspaceId + '/invite', req,
onresponse);

function onresponse(err, data) {
Expand Down Expand Up @@ -66,6 +66,6 @@ TogglClient.prototype.updateWorkspaceUser = function updateWorkspaceUser(wuId,
}
};

this.apiRequest('/api/v8/workspace_users/' + wuId, req,
this.apiRequest('/api/v9/workspace_users/' + wuId, req,
utils.wrapDataCallback(callback));
};
Loading