Skip to content

Commit

Permalink
Fix Operations jsdoc definition
Browse files Browse the repository at this point in the history
  • Loading branch information
k-grube committed Sep 14, 2018
1 parent 883b94c commit 3424a83
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 27 deletions.
3 changes: 2 additions & 1 deletion src/CompanyAPI/Companies.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ var inherits = require('util').inherits,
function Companies(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(Companies, ConnectWise);

/**
Expand Down Expand Up @@ -123,7 +124,7 @@ Companies.prototype.deleteCompanyById = function (id) {

/**
* @param {string|number} id
* @param {Operations} ops
* @param {Operations[]} ops
* @returns {Promise<Company>}
*/
Companies.prototype.updateCompany = function (id, ops) {
Expand Down
3 changes: 2 additions & 1 deletion src/CompanyAPI/CompanyTeams.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var inherits = require('util').inherits,
function CompanyTeams(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(CompanyTeams, ConnectWise);

/**
Expand Down Expand Up @@ -93,7 +94,7 @@ CompanyTeams.prototype.replaceCompanyTeam = function (id, teamId, companyTeam) {
/**
* @param id companyId
* @param teamId
* @param {Operations} ops
* @param {Operations[]} ops
* @returns {Promise<CompanyTeam>}
*/
CompanyTeams.prototype.updateCompanyTeam = function (id, teamId, ops) {
Expand Down
3 changes: 2 additions & 1 deletion src/CompanyAPI/Configurations.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ var inherits = require('util').inherits,
function Configurations(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(Configurations, ConnectWise);

/**
Expand Down Expand Up @@ -127,7 +128,7 @@ Configurations.prototype.getConfigurationById = function (id) {

/**
* @param {string|number} id
* @param {Operations} ops
* @param {Operations[]} ops
* @param {ParamsConfigUpdate} params
* @returns {Promise<Configuration>}
*/
Expand Down
2 changes: 1 addition & 1 deletion src/CompanyAPI/Contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Contacts.prototype.getContactById = function (id) {

/**
* @param {string|number} id
* @param {Operations} operations
* @param {Operations[]} operations
* @returns {Promise<Contact>}
*/
Contacts.prototype.updateContact = function (id, operations) {
Expand Down
2 changes: 1 addition & 1 deletion src/ConnectWiseRest.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ module.exports = ConnectWiseRest;
*/

/**
* @typedef {object[]} Operations
* @typedef {object} Operations
* @property {string} op ['replace','remove']
* @property {string} path the relative path to the variable to be updated, e.g. status
* @property {string} value the value of the object property to replace, e.g. { id: 123 }
Expand Down
3 changes: 2 additions & 1 deletion src/FinanceAPI/Additions.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var inherits = require('util').inherits,
function Additions(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(Additions, ConnectWise);

/**
Expand Down Expand Up @@ -101,7 +102,7 @@ Additions.prototype.getAdditionById = function (agreementId, additionId) {
* PATCH
* @param agreementId
* @param additionId
* @param {Operations} operations
* @param {Operations[]} operations
* @returns {Promise<Addition>}
*/
Additions.prototype.updateAddition = function (agreementId, additionId, operations) {
Expand Down
3 changes: 2 additions & 1 deletion src/FinanceAPI/AgreementSites.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var inherits = require('util').inherits,
function AgreementSites(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(AgreementSites, ConnectWise);

/**
Expand Down Expand Up @@ -82,7 +83,7 @@ AgreementSites.prototype.getAgreementSiteById = function (agreementId, siteId) {
* PATCH
* @param agreementId
* @param siteId
* @param {Operations} operations
* @param {Operations[]} operations
* @returns {Promise<AgreementSite>}
*/
AgreementSites.prototype.updateAgreementSite = function (agreementId, siteId, operations) {
Expand Down
5 changes: 3 additions & 2 deletions src/FinanceAPI/Agreements.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ var inherits = require('util').inherits,
function Agreements(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(Agreements, ConnectWise);

/**
Expand Down Expand Up @@ -146,7 +147,7 @@ Agreements.prototype.getAgreementById = function (agreementId) {
/**
*
* @param {string|number} agreementId
* @param {Operations} operations
* @param {Operations[]} operations
* @returns {Promise<Agreement>}
*/
Agreements.prototype.updateAgreement = function (agreementId, operations) {
Expand Down Expand Up @@ -180,7 +181,7 @@ Agreements.prototype.getAgreementConfigurations = function (agreementId, params)
* @returns {Promise<ConfigurationHref>}
*/
Agreements.prototype.createConfigurationAssociation = function (agreementId, configuration) {
return this.api('/finance/agreements/' + agreementId + '/configurations', 'POST', configuration)
return this.api('/finance/agreements/' + agreementId + '/configurations', 'POST', configuration);
};

/**
Expand Down
3 changes: 2 additions & 1 deletion src/FinanceAPI/BoardDefaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var inherits = require('util').inherits,
function BoardDefaults(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(BoardDefaults, ConnectWise);

/**
Expand Down Expand Up @@ -83,7 +84,7 @@ BoardDefaults.prototype.getBoardDefaultById = function (agreementId, boardDefaul
* PATCH
* @param agreementId
* @param boardDefaultId
* @param {Operations} operations
* @param {Operations[]} operations
* @returns {Promise<BoardDefault>}
*/
BoardDefaults.prototype.updateBoardDefault = function (agreementId, boardDefaultId, operations) {
Expand Down
3 changes: 2 additions & 1 deletion src/FinanceAPI/WorkRoles.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var inherits = require('util').inherits,
function WorkRoles(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(WorkRoles, ConnectWise);

/**
Expand Down Expand Up @@ -87,7 +88,7 @@ WorkRoles.prototype.getWorkRoleById = function (agreementId, workRoleId) {
* PATCH
* @param agreementId
* @param workRoleId
* @param {Operations} operations
* @param {Operations[]} operations
* @returns {Promise<WorkRole>}
*/
WorkRoles.prototype.updateWorkRole = function (agreementId, workRoleId, operations) {
Expand Down
3 changes: 2 additions & 1 deletion src/FinanceAPI/WorkTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var inherits = require('util').inherits,
function WorkTypes(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(WorkTypes, ConnectWise);

/**
Expand Down Expand Up @@ -97,7 +98,7 @@ WorkTypes.prototype.getWorkTypeById = function (agreementId, workTypeId) {
* PATCH
* @param agreementId
* @param workTypeId
* @param {Operations} operations
* @param {Operations[]} operations
* @returns {Promise<WorkType>}
*/
WorkTypes.prototype.updateWorkType = function (agreementId, workTypeId, operations) {
Expand Down
3 changes: 2 additions & 1 deletion src/ProjectAPI/Projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ var inherits = require('util').inherits,
function Projects(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(Projects, ConnectWise);

/**
Expand Down Expand Up @@ -118,7 +119,7 @@ Projects.prototype.getProjectById = function (projectId) {
/**
*
* @param {string|number} projectId
* @param {Operations} operations
* @param {Operations[]} operations
* @returns {Promise<Project>}
*/
Projects.prototype.updateProject = function (projectId, operations) {
Expand Down
2 changes: 1 addition & 1 deletion src/SalesAPI/Activities.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Activities.prototype.deleteActivityById = function (id) {
/**
*
* @param id
* @param {Operations} ops
* @param {Operations[]} ops
* @returns {Promise<Activity>}
*/
Activities.prototype.updateActivity = function (id, ops) {
Expand Down
3 changes: 2 additions & 1 deletion src/ScheduleAPI/ScheduleEntries.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var inherits = require('util').inherits,
function ScheduleEntries(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(ScheduleEntries, ConnectWise);

/**
Expand Down Expand Up @@ -94,7 +95,7 @@ ScheduleEntries.prototype.replaceSchedule = function (id) {

/**
* @param id scheduleId
* @param {Operations} ops
* @param {Operations[]} ops
* @returns {Promise<ScheduleEntry[]>}
*/
ScheduleEntries.prototype.updateSchedule = function (id, ops) {
Expand Down
11 changes: 6 additions & 5 deletions src/ScheduleAPI/ScheduleTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var inherits = require('util').inherits,
function ScheduleTypes(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(ScheduleTypes, ConnectWise);

/**
Expand Down Expand Up @@ -60,7 +61,7 @@ ScheduleTypes.prototype.getScheduleTypesCount = function (params) {
* @param scheduleTypeId
* @returns {Promise<ScheduleType>}
*/
ScheduleTypes.prototype.getScheduleTypeById = function(scheduleTypeId) {
ScheduleTypes.prototype.getScheduleTypeById = function (scheduleTypeId) {
return this.api('/schedule/types/' + scheduleTypeId, 'GET');
};

Expand All @@ -69,7 +70,7 @@ ScheduleTypes.prototype.getScheduleTypeById = function(scheduleTypeId) {
* @param scheduleTypeId
* @returns {Promise<DeleteResponse>}
*/
ScheduleTypes.prototype.deleteScheduleTypeById = function(scheduleTypeId) {
ScheduleTypes.prototype.deleteScheduleTypeById = function (scheduleTypeId) {
return this.api('/schedule/types/' + scheduleTypeId, 'DELETE');
};

Expand All @@ -79,16 +80,16 @@ ScheduleTypes.prototype.deleteScheduleTypeById = function(scheduleTypeId) {
* @param {ScheduleType} scheduleType
* @returns {Promise<ScheduleType>}
*/
ScheduleTypes.prototype.replaceScheduleType = function(scheduleTypeId, scheduleType) {
ScheduleTypes.prototype.replaceScheduleType = function (scheduleTypeId, scheduleType) {
return this.api('/schedule/types/' + scheduleTypeId, 'PUT', scheduleType);
};

/**
* @param scheduleTypeId
* @param {Operations} ops
* @param {Operations[]} ops
* @returns {Promise<ScheduleType>}
*/
ScheduleTypes.prototype.updateScheduleType = function(scheduleTypeId, ops) {
ScheduleTypes.prototype.updateScheduleType = function (scheduleTypeId, ops) {
return this.api('/schedule/types/' + scheduleTypeId, 'PATCH', ops);
};

Expand Down
6 changes: 4 additions & 2 deletions src/ServiceDeskAPI/Boards.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
var inherits = require('util').inherits,
ConnectWise = require('../ConnectWise.js');

/**
* @typedef {object} Board
* @property {number} id
Expand All @@ -32,6 +33,7 @@ var inherits = require('util').inherits,
function Boards(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(Boards, ConnectWise);

/**
Expand Down Expand Up @@ -73,7 +75,7 @@ Boards.prototype.getBoardsCount = function (params) {
/**
* PATCH
* @param id
* @param {Operations} ops
* @param {Operations[]} ops
* @returns {Promise<Board>}
*/
Boards.prototype.updateBoard = function (id, ops) {
Expand All @@ -94,4 +96,4 @@ Boards.prototype.replaceBoard = function (id, board) {
*
* @type {Boards}
*/
module.exports = Boards;
module.exports = Boards;
8 changes: 5 additions & 3 deletions src/ServiceDeskAPI/Statuses.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
var inherits = require('util').inherits,
ConnectWise = require('../ConnectWise.js');

/**
* @typedef {object} Status
* @property {number} id
Expand All @@ -33,6 +34,7 @@ var inherits = require('util').inherits,
function Statuses(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(Statuses, ConnectWise);

/**
Expand All @@ -52,7 +54,7 @@ Statuses.prototype.getStatusesByBoardId = function (boardId, params) {
* @returns {Promise<Status>}
*/
Statuses.prototype.createStatuses = function (boardId, status) {
return this.api('/service/boards/' + boardId + '/statuses', 'POST', status)
return this.api('/service/boards/' + boardId + '/statuses', 'POST', status);
};

/**
Expand All @@ -71,7 +73,7 @@ Statuses.prototype.getStatusesCount = function (boardId) {
* @returns {Promise<DeleteResponse>}
*/
Statuses.prototype.deleteStatusById = function (boardId, statusId) {
return this.api('/service/boards/' + boardId + '/statuses/' + statusId, 'DELETE')
return this.api('/service/boards/' + boardId + '/statuses/' + statusId, 'DELETE');
};

/**
Expand All @@ -88,7 +90,7 @@ Statuses.prototype.getStatusById = function (boardId, statusId) {
*
* @param boardId
* @param statusId
* @param {Operations} operations
* @param {Operations[]} operations
* @returns {Promise<Status>}
*/
Statuses.prototype.updateStatus = function (boardId, statusId, operations) {
Expand Down
5 changes: 3 additions & 2 deletions src/TimeAPI/TimeEntries.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var inherits = require('util').inherits,
function TimeEntries(options) {
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}

inherits(TimeEntries, ConnectWise);

/**
Expand Down Expand Up @@ -96,7 +97,7 @@ TimeEntries.prototype.getTimeEntryById = function (id) {
/**
*
* @param id
* @param {Operations} operations
* @param {Operations[]} operations
* @returns {Promise<TimeEntry>}
*/
TimeEntries.prototype.updateTimeEntry = function (id, operations) {
Expand All @@ -117,4 +118,4 @@ TimeEntries.prototype.replaceTimeEntry = function (id, timeEntry) {
*
* @type {TimeEntries}
*/
module.exports = TimeEntries;
module.exports = TimeEntries;

0 comments on commit 3424a83

Please sign in to comment.