Skip to content

Commit

Permalink
Add Room Messages API
Browse files Browse the repository at this point in the history
  • Loading branch information
mnovozhylov committed May 8, 2020
1 parent 2744841 commit 9d6cae8
Show file tree
Hide file tree
Showing 7 changed files with 804 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History

## 2.1.1
* Add Room Messages API
* Sync-up routers with OAuth1 version

## 2.1.0
* Add Specialties API
* Add Skills V2 API
Expand Down
16 changes: 16 additions & 0 deletions lib/routers/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ exports.Messages.prototype.getRoomDetails = function(company, roomId, params, ca
this.api.client.get('messages/v3/' + company + '/rooms/' + roomId, params, callback);
}

/**
* Get messages from a specific room
*
* @method getRoomDetails
* @param company {String} Company ID
* @param roomId {String} Room ID
* @param params {Hash} Parameters
* @param callback {String} Callback function
* @async
*/
exports.Messages.prototype.getRoomMessages = function(company, roomId, params, callback) {
params = params || {};
debug('running request');
this.api.client.get('messages/v3/' + company + '/rooms/' + roomId + '/stories', params, callback);
}

/**
* Get a specific room by offer ID
*
Expand Down
14 changes: 14 additions & 0 deletions lib/routers/reports/finance/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ exports.Accounts = function(api) {
this.api.client.setEntryPoint(this.api.epoint);
}

/**
* Generate Financial Reports for an owned Account
*
* @method getOwned
* @param freelancerReference {Integer} Freelancer reference
* @param params {Hash} Parameters
* @param callback {String} Callback function
* @async
*/
exports.Accounts.prototype.getOwned = function(freelancerReference, params, callback) {
debug('running request');
this.api.client.get('finreports/v2/financial_account_owner/' + freelancerReference, params, callback);
}

/**
* Generate Financial Reports for a Specific Account
*
Expand Down
28 changes: 28 additions & 0 deletions lib/routers/reports/finance/billings.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,34 @@ exports.Billings.prototype.getByFreelancer = function(freelancerReference, param
this.api.client.get('finreports/v2/providers/' + freelancerReference + '/billings', params, callback);
}

/**
* Generate Billing Reports for a Specific Freelancer's Team
*
* @method getByFreelancersTeam
* @param freelancerTeamReference {Integer} Freelancer team reference
* @param params {Hash} Parameters
* @param callback {String} Callback function
* @async
*/
exports.Billings.prototype.getByFreelancersTeam = function(freelancerTeamReference, params, callback) {
debug('running request');
this.api.client.get('finreports/v2/provider_teams/' + freelancerTeamReference + '/billings', params, callback);
}

/**
* Generate Billing Reports for a Specific Freelancer's Company
*
* @method getByFreelancersCompany
* @param freelancerCompanyReference {Integer} Freelancer company reference
* @param params {Hash} Parameters
* @param callback {String} Callback function
* @async
*/
exports.Billings.prototype.getByFreelancersCompany = function(freelancerCompanyReference, params, callback) {
debug('running request');
this.api.client.get('finreports/v2/provider_companies/' + freelancerCompanyReference + '/billings', params, callback);
}

/**
* Generate Billing Reports for a Specific Buyer's Team
*
Expand Down
28 changes: 28 additions & 0 deletions lib/routers/reports/finance/earnings.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,34 @@ exports.Earnings.prototype.getByFreelancer = function(freelancerReference, param
this.api.client.get('finreports/v2/providers/' + freelancerReference + '/earnings', params, callback);
}

/**
* Generate Earning Reports for a Specific Freelancer's Team
*
* @method getByFreelancersTeam
* @param freelancerTeamReference {Integer} Freelancer team reference
* @param params {Hash} Parameters
* @param callback {String} Callback function
* @async
*/
exports.Earnings.prototype.getByFreelancersTeam = function(freelancerTeamReference, params, callback) {
debug('running request');
this.api.client.get('finreports/v2/provider_teams/' + freelancerTeamReference + '/earnings', params, callback);
}

/**
* Generate Earning Reports for a Specific Freelancer's Company
*
* @method getByFreelancersCompany
* @param freelancerCompanyReference {Integer} Freelancer company reference
* @param params {Hash} Parameters
* @param callback {String} Callback function
* @async
*/
exports.Earnings.prototype.getByFreelancersCompany = function(freelancerCompanyReference, params, callback) {
debug('running request');
this.api.client.get('finreports/v2/provider_companies/' + freelancerCompanyReference + '/earnings', params, callback);
}

/**
* Generate Earning Reports for a Specific Buyer's Team
*
Expand Down
Loading

0 comments on commit 9d6cae8

Please sign in to comment.