Skip to content

Commit

Permalink
Merge pull request #23 from upwork/v1.2.5
Browse files Browse the repository at this point in the history
v1.3.0
  • Loading branch information
mnovozhylov committed May 25, 2018
2 parents f0c5f5f + 66b04e8 commit 317d65d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 114 deletions.
1 change: 1 addition & 0 deletions .tests
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm test
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
language: node_js

node_js:
- 0.9
- 0.10
- 0.11
- 7
- 8

notifications:
email:
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release History

## 1.3.0
* Stop supporting deprecated Teamrooms API
* Migrate Workdiaries, Workdays and Snapshots API to v3
52 changes: 3 additions & 49 deletions lib/routers/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,52 +32,6 @@ exports.Snapshot = function(api) {
this.api.epoint = entryPoint;
}

/**
* Get snaphot info
*
* @method get
* @param company {String} Company
* @param username {String} Username
* @param ts {String} Timestamp
* @param callback {String} Callback function
* @async
*/
exports.Snapshot.prototype.get = function(company, username, ts, callback) {
debug('running request');
this.api.client.get('team/v1/snapshots/' + company + '/' + username + '/' + ts, {}, callback);
}

/**
* Update snapshot
*
* @method update
* @param company {String} Company
* @param username {String} Username
* @param ts {String} Timestamp
* @param params {Hash} Parameters
* @param callback {String} Callback function
* @async
*/
exports.Snapshot.prototype.update = function(company, username, ts, params, callback) {
debug('running request');
this.api.client.put('team/v1/snapshots/' + company + '/' + username + '/' + ts, params, callback);
}

/**
* Delete snaphot
*
* @method delete
* @param company {String} Company
* @param username {String} Username
* @param ts {String} Timestamp
* @param callback {String} Callback function
* @async
*/
exports.Snapshot.prototype.delete = function(company, username, ts, callback) {
debug('running request');
this.api.client.delete('team/v1/snapshots/' + company + '/' + username + '/' + ts, {}, callback);
}

/**
* Get snaphot info by specific contract
*
Expand All @@ -89,7 +43,7 @@ exports.Snapshot.prototype.delete = function(company, username, ts, callback) {
*/
exports.Snapshot.prototype.getByContract = function(contract, ts, callback) {
debug('running request');
this.api.client.get('team/v2/snapshots/contracts/' + contract + '/' + ts, {}, callback);
this.api.client.get('team/v3/snapshots/contracts/' + contract + '/' + ts, {}, callback);
}

/**
Expand All @@ -104,7 +58,7 @@ exports.Snapshot.prototype.getByContract = function(contract, ts, callback) {
*/
exports.Snapshot.prototype.updateByContract = function(contract, ts, params, callback) {
debug('running request');
this.api.client.put('team/v2/snapshots/contracts/' + contract + '/' + ts, params, callback);
this.api.client.put('team/v3/snapshots/contracts/' + contract + '/' + ts, params, callback);
}

/**
Expand All @@ -118,5 +72,5 @@ exports.Snapshot.prototype.updateByContract = function(contract, ts, params, cal
*/
exports.Snapshot.prototype.deleteByContract = function(contract, ts, callback) {
debug('running request');
this.api.client.delete('team/v2/snapshots/contracts/' + contract + '/' + ts, {}, callback);
this.api.client.delete('team/v3/snapshots/contracts/' + contract + '/' + ts, {}, callback);
}
57 changes: 0 additions & 57 deletions lib/routers/teams.js

This file was deleted.

4 changes: 2 additions & 2 deletions lib/routers/workdays.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ exports.Workdays = function(api) {
*/
exports.Workdays.prototype.getByCompany = function(company, fromDate, tillDate, params, callback) {
debug('running request');
this.api.client.get('team/v2/workdays/companies/' + company + '/' + fromDate + ',' + tillDate, params, callback);
this.api.client.get('team/v3/workdays/companies/' + company + '/' + fromDate + ',' + tillDate, params, callback);
}

/**
Expand All @@ -59,5 +59,5 @@ exports.Workdays.prototype.getByCompany = function(company, fromDate, tillDate,
*/
exports.Workdays.prototype.getByContract = function(contract, fromDate, tillDate, params, callback) {
debug('running request');
this.api.client.get('team/v2/workdays/contracts/' + contract + '/' + fromDate + ',' + tillDate, params, callback);
this.api.client.get('team/v3/workdays/contracts/' + contract + '/' + fromDate + ',' + tillDate, params, callback);
}
7 changes: 3 additions & 4 deletions lib/routers/workdiary.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ exports.Workdiary = function(api) {
*
* @method get
* @param company {String} Company
* @param username {String} Username
* @param date {String} Date
* @param params {Hash} Parameters
* @param callback {String} Callback function
* @async
*/
exports.Workdiary.prototype.get = function(company, username, date, params, callback) {
exports.Workdiary.prototype.get = function(company, date, params, callback) {
debug('running request');
this.api.client.get('team/v1/workdiaries/' + company + '/' + username + '/' + date, params, callback);
this.api.client.get('team/v3/workdiaries/companies/' + company + '/' + date, params, callback);
}

/**
Expand All @@ -58,5 +57,5 @@ exports.Workdiary.prototype.get = function(company, username, date, params, call
*/
exports.Workdiary.prototype.getByContract = function(contract, date, params, callback) {
debug('running request');
this.api.client.get('team/v2/workdiaries/contracts/' + contract + '/' + date, params, callback);
this.api.client.get('team/v3/workdiaries/contracts/' + contract + '/' + date, params, callback);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "upwork-api",
"description": "Node.JS bindings for Upwork API",
"version": "1.2.4",
"version": "1.3.0",
"author": {
"name": "Maksym Novozhylov",
"email": "mnovozhilov@upwork.com"
Expand Down

0 comments on commit 317d65d

Please sign in to comment.