connectwise-rest 0.25.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +17 -52
- package/.gitattributes +1 -0
- package/.mocharc.json +5 -0
- package/.prettierrc +7 -0
- package/README.md +293 -230
- package/api-extractor.json +364 -0
- package/dist/Automate/AVTemplatePoliciesAPI.d.ts +36 -0
- package/dist/Automate/AVTemplatePoliciesAPI.d.ts.map +1 -0
- package/dist/Automate/AVTemplatePoliciesAPI.js +92 -0
- package/dist/Automate/AVTemplatePoliciesAPI.js.map +1 -0
- package/dist/Automate/ClientsAPI.d.ts +44 -0
- package/dist/Automate/ClientsAPI.d.ts.map +1 -0
- package/dist/Automate/ClientsAPI.js +119 -0
- package/dist/Automate/ClientsAPI.js.map +1 -0
- package/dist/Automate/CommandsAPI.d.ts +20 -0
- package/dist/Automate/CommandsAPI.d.ts.map +1 -0
- package/dist/Automate/CommandsAPI.js +36 -0
- package/dist/Automate/CommandsAPI.js.map +1 -0
- package/dist/Automate/ComputersAPI.d.ts +131 -0
- package/dist/Automate/ComputersAPI.d.ts.map +1 -0
- package/dist/Automate/ComputersAPI.js +358 -0
- package/dist/Automate/ComputersAPI.js.map +1 -0
- package/dist/Automate/ContactsAPI.d.ts +24 -0
- package/dist/Automate/ContactsAPI.d.ts.map +1 -0
- package/dist/Automate/ContactsAPI.js +50 -0
- package/dist/Automate/ContactsAPI.js.map +1 -0
- package/dist/Automate/DataViewsAPI.d.ts +22 -0
- package/dist/Automate/DataViewsAPI.d.ts.map +1 -0
- package/dist/Automate/DataViewsAPI.js +36 -0
- package/dist/Automate/DataViewsAPI.js.map +1 -0
- package/dist/Automate/DrivesAPI.d.ts +25 -0
- package/dist/Automate/DrivesAPI.d.ts.map +1 -0
- package/dist/Automate/DrivesAPI.js +57 -0
- package/dist/Automate/DrivesAPI.js.map +1 -0
- package/dist/Automate/EventLogsAPI.d.ts +19 -0
- package/dist/Automate/EventLogsAPI.d.ts.map +1 -0
- package/dist/Automate/EventLogsAPI.js +29 -0
- package/dist/Automate/EventLogsAPI.js.map +1 -0
- package/dist/Automate/LocationsAPI.d.ts +57 -0
- package/dist/Automate/LocationsAPI.d.ts.map +1 -0
- package/dist/Automate/LocationsAPI.js +138 -0
- package/dist/Automate/LocationsAPI.js.map +1 -0
- package/dist/Automate/MaintenanceWindowDefinitionsAPI.d.ts +19 -0
- package/dist/Automate/MaintenanceWindowDefinitionsAPI.d.ts.map +1 -0
- package/dist/Automate/MaintenanceWindowDefinitionsAPI.js +29 -0
- package/dist/Automate/MaintenanceWindowDefinitionsAPI.js.map +1 -0
- package/dist/Automate/MonitorsAPI.d.ts +29 -0
- package/dist/Automate/MonitorsAPI.d.ts.map +1 -0
- package/dist/Automate/MonitorsAPI.js +85 -0
- package/dist/Automate/MonitorsAPI.js.map +1 -0
- package/dist/Automate/NetworkDevicesAPI.d.ts +23 -0
- package/dist/Automate/NetworkDevicesAPI.d.ts.map +1 -0
- package/dist/Automate/NetworkDevicesAPI.js +43 -0
- package/dist/Automate/NetworkDevicesAPI.js.map +1 -0
- package/dist/Automate/PatchingAPI.d.ts +33 -0
- package/dist/Automate/PatchingAPI.d.ts.map +1 -0
- package/dist/Automate/PatchingAPI.js +99 -0
- package/dist/Automate/PatchingAPI.js.map +1 -0
- package/dist/Automate/RemoteAgentAPI.d.ts +24 -0
- package/dist/Automate/RemoteAgentAPI.d.ts.map +1 -0
- package/dist/Automate/RemoteAgentAPI.js +50 -0
- package/dist/Automate/RemoteAgentAPI.js.map +1 -0
- package/dist/Automate/ScriptingAPI.d.ts +41 -0
- package/dist/Automate/ScriptingAPI.d.ts.map +1 -0
- package/dist/Automate/ScriptingAPI.js +109 -0
- package/dist/Automate/ScriptingAPI.js.map +1 -0
- package/dist/Automate/SearchesAPI.d.ts +23 -0
- package/dist/Automate/SearchesAPI.d.ts.map +1 -0
- package/dist/Automate/SearchesAPI.js +43 -0
- package/dist/Automate/SearchesAPI.js.map +1 -0
- package/dist/Automate/SystemAPI.d.ts +97 -0
- package/dist/Automate/SystemAPI.d.ts.map +1 -0
- package/dist/Automate/SystemAPI.js +273 -0
- package/dist/Automate/SystemAPI.js.map +1 -0
- package/dist/Automate/TicketsAPI.d.ts +14 -0
- package/dist/Automate/TicketsAPI.d.ts.map +1 -0
- package/dist/Automate/TicketsAPI.js +29 -0
- package/dist/Automate/TicketsAPI.js.map +1 -0
- package/dist/Automate/UserProfilesAPI.d.ts +19 -0
- package/dist/Automate/UserProfilesAPI.d.ts.map +1 -0
- package/dist/Automate/UserProfilesAPI.js +28 -0
- package/dist/Automate/UserProfilesAPI.js.map +1 -0
- package/dist/Automate.d.ts +43 -0
- package/dist/Automate.d.ts.map +1 -0
- package/dist/Automate.js +164 -0
- package/dist/Automate.js.map +1 -0
- package/dist/AutomateAPI.d.ts +129 -0
- package/dist/AutomateAPI.d.ts.map +1 -0
- package/dist/AutomateAPI.js +175 -0
- package/dist/AutomateAPI.js.map +1 -0
- package/dist/AutomateTypes.d.ts +10437 -0
- package/dist/AutomateTypes.d.ts.map +1 -0
- package/dist/AutomateTypes.js +3 -0
- package/dist/AutomateTypes.js.map +1 -0
- package/dist/BaseAPI.d.ts +26 -0
- package/dist/BaseAPI.d.ts.map +1 -0
- package/dist/BaseAPI.js +116 -0
- package/dist/BaseAPI.js.map +1 -0
- package/dist/Manage/CompanyAPI.d.ts +662 -0
- package/dist/Manage/CompanyAPI.d.ts.map +1 -0
- package/dist/Manage/CompanyAPI.js +3299 -0
- package/dist/Manage/CompanyAPI.js.map +1 -0
- package/dist/Manage/ConfigurationsAPI.d.ts +32 -0
- package/dist/Manage/ConfigurationsAPI.d.ts.map +1 -0
- package/dist/Manage/ConfigurationsAPI.js +78 -0
- package/dist/Manage/ConfigurationsAPI.js.map +1 -0
- package/dist/Manage/ExpenseAPI.d.ts +85 -0
- package/dist/Manage/ExpenseAPI.d.ts.map +1 -0
- package/dist/Manage/ExpenseAPI.js +311 -0
- package/dist/Manage/ExpenseAPI.js.map +1 -0
- package/dist/Manage/FinanceAPI.d.ts +538 -0
- package/dist/Manage/FinanceAPI.d.ts.map +1 -0
- package/dist/Manage/FinanceAPI.js +2592 -0
- package/dist/Manage/FinanceAPI.js.map +1 -0
- package/dist/Manage/MarketingAPI.d.ts +142 -0
- package/dist/Manage/MarketingAPI.d.ts.map +1 -0
- package/dist/Manage/MarketingAPI.js +634 -0
- package/dist/Manage/MarketingAPI.js.map +1 -0
- package/dist/Manage/ProcurementAPI.d.ts +435 -0
- package/dist/Manage/ProcurementAPI.d.ts.map +1 -0
- package/dist/Manage/ProcurementAPI.js +2103 -0
- package/dist/Manage/ProcurementAPI.js.map +1 -0
- package/dist/Manage/ProjectAPI.d.ts +215 -0
- package/dist/Manage/ProjectAPI.d.ts.map +1 -0
- package/dist/Manage/ProjectAPI.js +945 -0
- package/dist/Manage/ProjectAPI.js.map +1 -0
- package/dist/Manage/SalesAPI.d.ts +299 -0
- package/dist/Manage/SalesAPI.d.ts.map +1 -0
- package/dist/Manage/SalesAPI.js +1397 -0
- package/dist/Manage/SalesAPI.js.map +1 -0
- package/dist/Manage/ScheduleAPI.d.ts +132 -0
- package/dist/Manage/ScheduleAPI.d.ts.map +1 -0
- package/dist/Manage/ScheduleAPI.js +580 -0
- package/dist/Manage/ScheduleAPI.js.map +1 -0
- package/dist/Manage/ServiceAPI.d.ts +493 -0
- package/dist/Manage/ServiceAPI.d.ts.map +1 -0
- package/dist/Manage/ServiceAPI.js +2339 -0
- package/dist/Manage/ServiceAPI.js.map +1 -0
- package/dist/Manage/SystemAPI.d.ts +954 -0
- package/dist/Manage/SystemAPI.d.ts.map +1 -0
- package/dist/Manage/SystemAPI.js +4536 -0
- package/dist/Manage/SystemAPI.js.map +1 -0
- package/dist/Manage/TimeAPI.d.ts +186 -0
- package/dist/Manage/TimeAPI.d.ts.map +1 -0
- package/dist/Manage/TimeAPI.js +840 -0
- package/dist/Manage/TimeAPI.js.map +1 -0
- package/dist/Manage.d.ts +39 -0
- package/dist/Manage.d.ts.map +1 -0
- package/dist/Manage.js +137 -0
- package/dist/Manage.js.map +1 -0
- package/dist/ManageAPI.d.ts +135 -0
- package/dist/ManageAPI.d.ts.map +1 -0
- package/dist/ManageAPI.js +115 -0
- package/dist/ManageAPI.js.map +1 -0
- package/dist/ManageTypes.d.ts +91320 -0
- package/dist/ManageTypes.d.ts.map +1 -0
- package/dist/ManageTypes.js +7 -0
- package/dist/ManageTypes.js.map +1 -0
- package/dist/connectwise-rest.d.ts +108638 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/types.d.ts +48 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +21 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/Callback.d.ts +70 -0
- package/dist/utils/Callback.d.ts.map +1 -0
- package/dist/utils/Callback.js +109 -0
- package/dist/utils/Callback.js.map +1 -0
- package/dist/utils/Series.d.ts +42 -0
- package/dist/utils/Series.d.ts.map +1 -0
- package/dist/utils/Series.js +68 -0
- package/dist/utils/Series.js.map +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +11 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +50 -19
- package/src/Automate/AVTemplatePoliciesAPI.ts +124 -0
- package/src/Automate/ClientsAPI.ts +172 -0
- package/src/Automate/CommandsAPI.ts +39 -0
- package/src/Automate/ComputersAPI.ts +588 -0
- package/src/Automate/ContactsAPI.ts +63 -0
- package/src/Automate/DataViewsAPI.ts +43 -0
- package/src/Automate/DrivesAPI.ts +81 -0
- package/src/Automate/EventLogsAPI.ts +31 -0
- package/src/Automate/LocationsAPI.ts +222 -0
- package/src/Automate/MaintenanceWindowDefinitionsAPI.ts +34 -0
- package/src/Automate/MonitorsAPI.ts +101 -0
- package/src/Automate/NetworkDevicesAPI.ts +51 -0
- package/src/Automate/PatchingAPI.ts +116 -0
- package/src/Automate/RemoteAgentAPI.ts +65 -0
- package/src/Automate/ScriptingAPI.ts +147 -0
- package/src/Automate/SearchesAPI.ts +49 -0
- package/src/Automate/SystemAPI.ts +412 -0
- package/src/Automate/TicketsAPI.ts +29 -0
- package/src/Automate/UserProfilesAPI.ts +31 -0
- package/src/Automate.ts +204 -0
- package/src/AutomateAPI.ts +178 -0
- package/src/AutomateTypes.ts +10492 -0
- package/src/BaseAPI.ts +180 -0
- package/src/Manage/CompanyAPI.ts +4941 -0
- package/src/Manage/ConfigurationsAPI.ts +116 -0
- package/src/Manage/ExpenseAPI.ts +413 -0
- package/src/Manage/FinanceAPI.ts +3930 -0
- package/src/Manage/MarketingAPI.ts +958 -0
- package/src/Manage/ProcurementAPI.ts +3107 -0
- package/src/Manage/ProjectAPI.ts +1437 -0
- package/src/Manage/SalesAPI.ts +1968 -0
- package/src/Manage/ScheduleAPI.ts +773 -0
- package/src/Manage/ServiceAPI.ts +3476 -0
- package/src/Manage/SystemAPI.ts +6415 -0
- package/src/Manage/TimeAPI.ts +1151 -0
- package/src/Manage.ts +161 -0
- package/src/ManageAPI.ts +170 -0
- package/src/ManageTypes.ts +91318 -0
- package/src/index.ts +13 -0
- package/src/types.ts +68 -0
- package/src/utils/Callback.ts +148 -0
- package/src/utils/Series.ts +89 -0
- package/src/utils/index.ts +7 -0
- package/swagger-errors.md +25 -0
- package/test/.env.example +12 -6
- package/test/test-utils.ts +27 -0
- package/test/test.js +331 -108
- package/tsconfig.json +29 -0
- package/.travis.yml +0 -9
- package/doc.md +0 -5984
- package/docs/jsdoc.json +0 -15
- package/index.js +0 -10
- package/src/CompanyAPI/Companies.js +0 -149
- package/src/CompanyAPI/CompanyCompanyTypeAssociations.js +0 -111
- package/src/CompanyAPI/CompanySites.js +0 -80
- package/src/CompanyAPI/CompanyTeams.js +0 -108
- package/src/CompanyAPI/CompanyTypeInfos.js +0 -58
- package/src/CompanyAPI/CompanyTypes.js +0 -52
- package/src/CompanyAPI/Configurations.js +0 -152
- package/src/CompanyAPI/ContactContactTypeAssociations.js +0 -55
- package/src/CompanyAPI/ContactRelationships.js +0 -36
- package/src/CompanyAPI/Contacts.js +0 -199
- package/src/CompanyAPI/index.js +0 -53
- package/src/ConnectWise.js +0 -339
- package/src/ConnectWiseRest.js +0 -515
- package/src/FinanceAPI/Additions.js +0 -127
- package/src/FinanceAPI/Adjustments.js +0 -109
- package/src/FinanceAPI/AgreementSites.js +0 -108
- package/src/FinanceAPI/Agreements.js +0 -220
- package/src/FinanceAPI/BoardDefaults.js +0 -109
- package/src/FinanceAPI/WorkRoles.js +0 -113
- package/src/FinanceAPI/WorkTypeExclusions.js +0 -78
- package/src/FinanceAPI/WorkTypes.js +0 -124
- package/src/FinanceAPI/index.js +0 -50
- package/src/ProcurementAPI/CatalogItems.js +0 -94
- package/src/ProcurementAPI/index.js +0 -22
- package/src/ProjectAPI/Projects.js +0 -142
- package/src/ProjectAPI/index.js +0 -28
- package/src/SalesAPI/Activities.js +0 -149
- package/src/SalesAPI/index.js +0 -14
- package/src/ScheduleAPI/ScheduleEntries.js +0 -109
- package/src/ScheduleAPI/ScheduleTypes.js +0 -101
- package/src/ScheduleAPI/index.js +0 -30
- package/src/ServiceDeskAPI/BoardItems.js +0 -134
- package/src/ServiceDeskAPI/BoardSubTypes.js +0 -112
- package/src/ServiceDeskAPI/BoardTeams.js +0 -108
- package/src/ServiceDeskAPI/BoardTypes.js +0 -139
- package/src/ServiceDeskAPI/Boards.js +0 -100
- package/src/ServiceDeskAPI/Priorities.js +0 -47
- package/src/ServiceDeskAPI/ServiceNotes.js +0 -172
- package/src/ServiceDeskAPI/Statuses.js +0 -116
- package/src/ServiceDeskAPI/Tickets.js +0 -588
- package/src/ServiceDeskAPI/index.js +0 -53
- package/src/SystemAPI/Members.js +0 -139
- package/src/SystemAPI/Reports.js +0 -116
- package/src/SystemAPI/index.js +0 -32
- package/src/TimeAPI/TimeEntries.js +0 -121
- package/src/TimeAPI/index.js +0 -27
- package/src/utils/Callback.js +0 -124
- package/src/utils/Series.js +0 -63
- package/src/utils/index.js +0 -21
package/src/ConnectWiseRest.js
DELETED
|
@@ -1,515 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by kgrube on 12/15/2015.
|
|
3
|
-
* @author kgrube
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @type {CWUtils}
|
|
8
|
-
* @private
|
|
9
|
-
*/
|
|
10
|
-
const _utils = require('./utils');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @typedef {object} CWOptions
|
|
15
|
-
* @property companyId
|
|
16
|
-
* @property publicKey
|
|
17
|
-
* @property privateKey
|
|
18
|
-
* @property clientId register for a clientId at https://developer.connectwise.com/ClientID
|
|
19
|
-
* @property companyUrl
|
|
20
|
-
* @property {string} [entryPoint=v4_6_release] defaults to 'v4_6_release'
|
|
21
|
-
* @property {number} [timeout=20000] defaults to 20000 (20 seconds)
|
|
22
|
-
* @property {boolean} [retry=false] enable automatic retries
|
|
23
|
-
* @property {object} [retryOptions] configure retry options
|
|
24
|
-
* @property {number} [retryOptions.minTimeout=50] minimum time between retries
|
|
25
|
-
* @property {number} [retryOptions.maxTimeout=20000] maximum time to wait for a timeout
|
|
26
|
-
* @property {boolean} [retryOptions.randomize=true] randomize delay between retires
|
|
27
|
-
* @property {boolean} [debug=false] enable debug output
|
|
28
|
-
* @property {function} [logger=console] function(String:level, String:text, *:Object) defaults to console
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @typedef {object} ConnectWiseRest
|
|
33
|
-
* @property {ConnectWise} API
|
|
34
|
-
* @property {CompanyAPI} CompanyAPI
|
|
35
|
-
* @property {FinanceAPI} FinanceAPI
|
|
36
|
-
* @property {ServiceDeskAPI} ServiceDeskAPI
|
|
37
|
-
* @property {TimeAPI} TimeAPI
|
|
38
|
-
* @property {ProjectAPI} ProjectAPI
|
|
39
|
-
* @property {ScheduleAPI} ScheduleAPI
|
|
40
|
-
* @property {SystemAPI} SystemAPI
|
|
41
|
-
* @property {SalesAPI} SalesAPI
|
|
42
|
-
* @property {ProcurementAPI} ProcurementAPI
|
|
43
|
-
* @property {CWUtils} utils
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @class ConnectWiseRest
|
|
48
|
-
* @param {CWOptions} options
|
|
49
|
-
* @type {ConnectWiseRest}
|
|
50
|
-
* @constructor
|
|
51
|
-
*/
|
|
52
|
-
function ConnectWiseRest(options) {
|
|
53
|
-
const _ConnectWise = require('./ConnectWise');
|
|
54
|
-
const _CompanyAPI = require('./CompanyAPI');
|
|
55
|
-
const _FinanceAPI = require('./FinanceAPI');
|
|
56
|
-
const _TimeAPI = require('./TimeAPI');
|
|
57
|
-
const _ServiceDeskAPI = require('./ServiceDeskAPI');
|
|
58
|
-
const _ProjectAPI = require('./ProjectAPI');
|
|
59
|
-
const _ScheduleAPI = require('./ScheduleAPI');
|
|
60
|
-
const _SystemAPI = require('./SystemAPI');
|
|
61
|
-
const _SalesAPI = require('./SalesAPI');
|
|
62
|
-
const _ProcurementAPI = require('./ProcurementAPI');
|
|
63
|
-
|
|
64
|
-
this.API = new _ConnectWise(options);
|
|
65
|
-
this.CompanyAPI = new _CompanyAPI(options);
|
|
66
|
-
this.FinanceAPI = new _FinanceAPI(options);
|
|
67
|
-
this.TimeAPI = new _TimeAPI(options);
|
|
68
|
-
this.ServiceDeskAPI = new _ServiceDeskAPI(options);
|
|
69
|
-
this.ProjectAPI = new _ProjectAPI(options);
|
|
70
|
-
this.ScheduleAPI = new _ScheduleAPI(options);
|
|
71
|
-
this.SystemAPI = new _SystemAPI(options);
|
|
72
|
-
this.SalesAPI = new _SalesAPI(options);
|
|
73
|
-
this.ProcurementAPI = new _ProcurementAPI(options);
|
|
74
|
-
this.utils = _utils;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
ConnectWiseRest.utils = _utils;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
*
|
|
81
|
-
* @type {ConnectWiseRest}
|
|
82
|
-
*/
|
|
83
|
-
module.exports = ConnectWiseRest;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* @typedef {object} InfoHref
|
|
87
|
-
* @property lastUpdated
|
|
88
|
-
* @property updatedBy
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @typedef {object} AgreementHref
|
|
93
|
-
* @property {number} id
|
|
94
|
-
* @property {string} name
|
|
95
|
-
* @property {object} _info
|
|
96
|
-
* @property {string} _info.agreement_href
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* @typedef {object} AgreementTypeHref
|
|
101
|
-
* @property {number} id
|
|
102
|
-
* @property {string} name
|
|
103
|
-
* @property {object} _info
|
|
104
|
-
* @property {string} _info.type_href
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* @typedef {object} BoardHref
|
|
109
|
-
* @property {number} id
|
|
110
|
-
* @property {string} name
|
|
111
|
-
* @property {object} _info
|
|
112
|
-
* @property {string} _info.board_href
|
|
113
|
-
*/
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* @typedef {object} CompanyHref
|
|
117
|
-
* @property {number} id
|
|
118
|
-
* @property {string} identifier The company ID in ConnectWise
|
|
119
|
-
* @property {object} _info
|
|
120
|
-
* @property {string} _info.company_href
|
|
121
|
-
*/
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* @typedef {object} ContactHref
|
|
125
|
-
* @property {number} id
|
|
126
|
-
* @property {string} name
|
|
127
|
-
* @property {object} _info
|
|
128
|
-
* @property {string} _info.contact_href
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* @typedef {object} CountryHref
|
|
133
|
-
* @property {number} id
|
|
134
|
-
* @property {string} name
|
|
135
|
-
* @property {object} _info
|
|
136
|
-
*/
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* @typedef {object} DocumentHref
|
|
140
|
-
* @property {number} id
|
|
141
|
-
* @property {object} _info
|
|
142
|
-
* @property {string} _info.filename
|
|
143
|
-
*/
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* @typedef {object} ItemHref Service Item
|
|
147
|
-
* @property {number} id
|
|
148
|
-
* @property {string} name
|
|
149
|
-
* @property {object} _info
|
|
150
|
-
* @property {string} _info.item_href
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* @typedef {object} PriorityHref
|
|
155
|
-
* @property {number} id
|
|
156
|
-
* @property {string} name
|
|
157
|
-
* @property {object} _info
|
|
158
|
-
* @property {string} _info.image_href
|
|
159
|
-
* @property {string} _info.priority_href
|
|
160
|
-
*/
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* @typedef {object} ProductHref
|
|
164
|
-
* @property {number} id
|
|
165
|
-
* @property {string} identifier
|
|
166
|
-
* @property {object} _info
|
|
167
|
-
* @property {string} _info.identifier
|
|
168
|
-
*/
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* @typedef {object} ServiceLocationHref
|
|
172
|
-
* @property {number} id
|
|
173
|
-
* @property {string} name
|
|
174
|
-
* @property {object} _info
|
|
175
|
-
* @property {string} _info.location_href
|
|
176
|
-
*/
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* @typedef {object} ServiceTypeHref
|
|
180
|
-
* @property {number} id
|
|
181
|
-
* @property {string} name
|
|
182
|
-
* @property {object} _info
|
|
183
|
-
*/
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* @typedef {object} ScheduleEntryHref
|
|
187
|
-
* @property {number} id
|
|
188
|
-
* @property {object} _info
|
|
189
|
-
* @property {string} _info.description
|
|
190
|
-
* @property {string} _info.schedule_href
|
|
191
|
-
*/
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* @typedef {object} SiteHref
|
|
195
|
-
* @property {number} id
|
|
196
|
-
* @property {object} _info
|
|
197
|
-
* @property {string} _info.name
|
|
198
|
-
* @property {string} _info.site_href
|
|
199
|
-
*/
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* @typedef {object} SourceHref
|
|
203
|
-
* @property {number} id
|
|
204
|
-
* @property {string} name
|
|
205
|
-
* @property {object} _info
|
|
206
|
-
* @property {string} _info.source_href
|
|
207
|
-
*/
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* @typedef {object} StatusHref
|
|
211
|
-
* @property {number} id
|
|
212
|
-
* @property {string} name
|
|
213
|
-
* @property {object} _info
|
|
214
|
-
* @property {string} _info.status_href
|
|
215
|
-
*/
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* @typedef {object} SubTypeHref Service Subtype
|
|
219
|
-
* @property {number} id
|
|
220
|
-
* @property {string} name
|
|
221
|
-
* @property {object} _info
|
|
222
|
-
* @property {string} _info.subType_href
|
|
223
|
-
*/
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* @typedef {object} TeamHref
|
|
227
|
-
* @property {number} id
|
|
228
|
-
* @property {string} name
|
|
229
|
-
* @property {object} _info
|
|
230
|
-
* @property {string} _info.team_href
|
|
231
|
-
*/
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* @typedef {object} TypeHref
|
|
235
|
-
* @property {number} id
|
|
236
|
-
* @property {string} name
|
|
237
|
-
* @property {object} _info
|
|
238
|
-
* @property {string} _info.type_href
|
|
239
|
-
*/
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* @typedef {object} OpportunityHref
|
|
243
|
-
* @property {number} id
|
|
244
|
-
* @property {string} name
|
|
245
|
-
* @property {object} _info
|
|
246
|
-
* @property {string} opportunity_href
|
|
247
|
-
*/
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* @typedef {object} Params
|
|
251
|
-
* @property {string} [conditions] Search results based on the fields returned in a GET, board/name="Integration" and summary="xyz" or board/id in (3, 2, 4) and lastUpdated > [2016-08-20T18:04:26Z]
|
|
252
|
-
* @property {string} [orderBy] Choose which field to sort the results by, 'contact/name asc'
|
|
253
|
-
* @property {string|number} [page] Used in pagination to cycle through results
|
|
254
|
-
* @property {string|number} [pageSize] Number of results returned per page (Defaults to 25) (Max page size was increased to 1,000 in 2016.2.)
|
|
255
|
-
* @property {string} [childConditions] Allows searching arrays on endpoints that list childConditions under parameters
|
|
256
|
-
* @property {string} [customFieldConditions] Allows searching custom fields when customFieldConditions is listed in the parameters
|
|
257
|
-
* @property {string} [fields] Limits which information is returned in the response - Not available on the reporting endpoints
|
|
258
|
-
* @property {string} [columns] Limits which information is returned in the response - Only used for the Reporting Endpoints
|
|
259
|
-
*/
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* @typedef {object} ParamsPage
|
|
263
|
-
* @property {string|number} [page]
|
|
264
|
-
* @property {string|number} [pageSize]
|
|
265
|
-
*/
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* @typedef {object} ParamsConditions
|
|
269
|
-
* @property {string} [conditions]
|
|
270
|
-
* @property {string} [orderBy]
|
|
271
|
-
*/
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* @typedef {object} ParamsImage
|
|
275
|
-
* @property {boolean} [useDefaultFlag]
|
|
276
|
-
* @property {string} [lastmodifier] note the lower case M (not a typo)
|
|
277
|
-
*/
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* @typedef {object} ParamsConfig
|
|
281
|
-
* @property {string} [conditions]
|
|
282
|
-
* @property {string} [managedIdentifier]
|
|
283
|
-
*/
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* @typedef {object} ParamsConfigUpdate
|
|
287
|
-
* @property {string} [managementSolutionName]
|
|
288
|
-
* @property {string} [managedIdentifier]
|
|
289
|
-
* @property {string} [type]
|
|
290
|
-
* @property {string} [level]
|
|
291
|
-
* @property {string} [childConfigurationsMatchingOn]
|
|
292
|
-
* @property {string} [inactivateConfigurationsMatchingOn]
|
|
293
|
-
* @property {number} [inactiveConfigurationStatusId]
|
|
294
|
-
*/
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* @typedef {object} ProductHref
|
|
298
|
-
* @property {number} id
|
|
299
|
-
* @property {object} _info
|
|
300
|
-
* @property {string} _info.description
|
|
301
|
-
*/
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* @typedef {object} WorkRoleHref
|
|
305
|
-
* @property {number} id
|
|
306
|
-
* @property {string} name
|
|
307
|
-
* @property {object} _info
|
|
308
|
-
* @property {string} _info.role_href
|
|
309
|
-
*/
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* @typedef {object} WorkTypeHref
|
|
313
|
-
* @property {number} id
|
|
314
|
-
* @property {string} name
|
|
315
|
-
* @property {object} _info
|
|
316
|
-
* @property {string} _info.type_href
|
|
317
|
-
*/
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* @typedef {object} Operations
|
|
321
|
-
* @property {string} op ['replace','remove']
|
|
322
|
-
* @property {string} path the relative path to the variable to be updated, e.g. status
|
|
323
|
-
* @property {string|boolean|object|number} value the value of the object property to replace, e.g. { id: 123 }
|
|
324
|
-
*/
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* @typedef {object} Count
|
|
328
|
-
* @property {number} count the number of matched records.
|
|
329
|
-
*/
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* @typedef {object} ConfigurationHref
|
|
333
|
-
* @property {number} id
|
|
334
|
-
* @property {string} deviceIdentifier
|
|
335
|
-
* @property {object} _info
|
|
336
|
-
* @property {string} _info.name
|
|
337
|
-
* @property {string} _info.configuration_href
|
|
338
|
-
*
|
|
339
|
-
*/
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* @typedef {object} CurrencyHref
|
|
343
|
-
* @property {string} currency_href
|
|
344
|
-
*/
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* @typedef {object} MemberHref
|
|
348
|
-
* @property {number} id
|
|
349
|
-
* @property {string} identifier the member's ID in CW
|
|
350
|
-
* @property {object} _info
|
|
351
|
-
* @property {string} _info.lastUpdated
|
|
352
|
-
* @property {string} _info.updatedBy
|
|
353
|
-
*/
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* @typedef {object} DeleteResponse
|
|
357
|
-
* @property {string} error null if no error
|
|
358
|
-
*/
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* @typedef {object} PostResponse
|
|
362
|
-
* @property {string} error null if no error
|
|
363
|
-
*/
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* @typedef {object} ErrorResponse
|
|
368
|
-
* @property {string} code
|
|
369
|
-
* @property {string} message
|
|
370
|
-
* @property {object[]} errors
|
|
371
|
-
*/
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* @typedef {object} CustomField
|
|
375
|
-
* @property {string} caption
|
|
376
|
-
* @property {string} entryMethod
|
|
377
|
-
* @property {number} id
|
|
378
|
-
* @property {number} numberOfDecimals
|
|
379
|
-
* @property {string} type
|
|
380
|
-
* @property {string} value
|
|
381
|
-
*
|
|
382
|
-
*/
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* @typedef {object} ProjectStatusHref
|
|
386
|
-
* @property {number} id
|
|
387
|
-
* @property {string} name
|
|
388
|
-
* @property {object} _info
|
|
389
|
-
*
|
|
390
|
-
*/
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* @typedef {object} ProjectTypeHref
|
|
394
|
-
* @property {number} id
|
|
395
|
-
* @property {string} name
|
|
396
|
-
* @property {object} _info
|
|
397
|
-
*
|
|
398
|
-
*/
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* @typedef {object} OwnerHref
|
|
402
|
-
* @property {number} id
|
|
403
|
-
* @property {string} identifier
|
|
404
|
-
* @property {object} _info
|
|
405
|
-
* @property {string} image_href
|
|
406
|
-
* @property {string} member_href
|
|
407
|
-
*/
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* @typedef {object} CountryHref
|
|
411
|
-
* @property {number} id
|
|
412
|
-
* @property {string} name
|
|
413
|
-
* @property {object} _info
|
|
414
|
-
*/
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* @typedef {object} CustomField
|
|
418
|
-
* @property {string} caption
|
|
419
|
-
* @property {string} entryMethod
|
|
420
|
-
* @property {number} id
|
|
421
|
-
* @property {number} numberOfDecimals
|
|
422
|
-
* @property {string} type
|
|
423
|
-
* @property {string} value
|
|
424
|
-
*
|
|
425
|
-
*/
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* @typedef {object} CommunicationItemHref
|
|
429
|
-
* @property {string} communicationType
|
|
430
|
-
* @property {boolean} defaultFlag
|
|
431
|
-
* @property extension
|
|
432
|
-
* @property {number} id
|
|
433
|
-
* @property {TypeHref} type
|
|
434
|
-
* @property {string} value
|
|
435
|
-
*
|
|
436
|
-
*/
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* @typedef {object} DepartmentHref
|
|
440
|
-
* @property {number} id
|
|
441
|
-
* @property {string} name
|
|
442
|
-
* @property {object} _info
|
|
443
|
-
* @property {string} _info.department_href
|
|
444
|
-
*
|
|
445
|
-
*/
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* @typedef {object} RelationshipHref
|
|
449
|
-
* @property {number} id
|
|
450
|
-
* @property {string} name
|
|
451
|
-
* @property {object} _info
|
|
452
|
-
* @property {string} relationship_href
|
|
453
|
-
*
|
|
454
|
-
*/
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* @typedef {object} ScheduleTypeHref
|
|
458
|
-
* @property id
|
|
459
|
-
* @property identifier
|
|
460
|
-
* @property {object} _info
|
|
461
|
-
* @property _info.type_href
|
|
462
|
-
*/
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* @typedef {object} ScheduleStatusHref
|
|
466
|
-
* @property id
|
|
467
|
-
* @property name
|
|
468
|
-
* @property {object} _info
|
|
469
|
-
* @property _info.status_href
|
|
470
|
-
*/
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* @typedef {object} ScheduleSpanHref
|
|
474
|
-
* @property id
|
|
475
|
-
* @property name
|
|
476
|
-
* @property _info
|
|
477
|
-
*/
|
|
478
|
-
|
|
479
|
-
/**
|
|
480
|
-
* @typedef {object} ReminderHref
|
|
481
|
-
* @property id
|
|
482
|
-
* @property name
|
|
483
|
-
* @property _info
|
|
484
|
-
*
|
|
485
|
-
*/
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* @typedef {object} ServiceLocationHref
|
|
489
|
-
* @property id
|
|
490
|
-
* @property name
|
|
491
|
-
* @property _info
|
|
492
|
-
* @property _info.location_href
|
|
493
|
-
*/
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* @typedef {object} ChargeCodeHref
|
|
497
|
-
* @property {number} id
|
|
498
|
-
* @property {string} name
|
|
499
|
-
* @property {object} _info
|
|
500
|
-
*/
|
|
501
|
-
|
|
502
|
-
/**
|
|
503
|
-
* @typedef {Object} Usage
|
|
504
|
-
* @property type
|
|
505
|
-
* @property count
|
|
506
|
-
* @property id
|
|
507
|
-
* @property description
|
|
508
|
-
* @property hyperlink
|
|
509
|
-
*/
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* @typedef {Object} UsageCount
|
|
513
|
-
* @property type
|
|
514
|
-
* @property count
|
|
515
|
-
*/
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by kgrube on 1/22/2016.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @private
|
|
7
|
-
*/
|
|
8
|
-
const inherits = require('util').inherits;
|
|
9
|
-
const ConnectWise = require('../ConnectWise.js');
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @typedef {object} Addition
|
|
13
|
-
* @property {number} agreementId
|
|
14
|
-
* @property {string} billCustomer
|
|
15
|
-
* @property {string} cancelledDate
|
|
16
|
-
* @property {string} description
|
|
17
|
-
* @property {string} effectiveDate
|
|
18
|
-
* @property {number} extCost
|
|
19
|
-
* @property {number} extPrice
|
|
20
|
-
* @property {number} id
|
|
21
|
-
* @property {string} invoiceDescription
|
|
22
|
-
* @property {number} lessIncluded
|
|
23
|
-
* @property {number} margin
|
|
24
|
-
* @property {ProductHref} product
|
|
25
|
-
* @property {boolean} purchaseItemFlag
|
|
26
|
-
* @property {number} quantity
|
|
27
|
-
* @property serialNumber
|
|
28
|
-
* @property {boolean} specialOrderFlag
|
|
29
|
-
* @property {boolean} taxableFlag
|
|
30
|
-
* @property {number} unitCost
|
|
31
|
-
* @property {number} unitPrice
|
|
32
|
-
* @property {string} uom unit of measurement ['each', 'monthly', 'yearly', 'quarterly']
|
|
33
|
-
* @property {object} _info
|
|
34
|
-
* @property {string} _info.lastUpdated
|
|
35
|
-
* @property {string} _info.updatedBy
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @param {CWOptions} options
|
|
41
|
-
* @inherits {ConnectWise}
|
|
42
|
-
* @constructor
|
|
43
|
-
*/
|
|
44
|
-
function Additions(options) {
|
|
45
|
-
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
inherits(Additions, ConnectWise);
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* GET
|
|
52
|
-
* Returns non-cancelled active additions to an agreement
|
|
53
|
-
* @param agreementId
|
|
54
|
-
* @param {Params} params
|
|
55
|
-
* @returns {Promise<Addition[]>}
|
|
56
|
-
*/
|
|
57
|
-
Additions.prototype.getAdditions = function (agreementId, params) {
|
|
58
|
-
return this.api(`/finance/agreements/${agreementId}/additions`, 'GET', params);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* POST
|
|
63
|
-
* @param agreementId
|
|
64
|
-
* @param {Addition} addition
|
|
65
|
-
* @returns {Promise<Addition>}
|
|
66
|
-
*/
|
|
67
|
-
Additions.prototype.createAddition = function (agreementId, addition) {
|
|
68
|
-
return this.api(`/finance/agreements/${agreementId}/additions`, 'POST', addition);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* GET
|
|
73
|
-
* @param agreementId
|
|
74
|
-
* @param {ParamsConditions} params
|
|
75
|
-
* @returns {Promise<Count>}
|
|
76
|
-
*/
|
|
77
|
-
Additions.prototype.getAdditionsCount = function (agreementId, params) {
|
|
78
|
-
return this.api(`/finance/agreements/${agreementId}/additions/count`, 'GET', params);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* DELETE
|
|
83
|
-
* @param agreementId
|
|
84
|
-
* @param additionId
|
|
85
|
-
* @returns {Promise<DeleteResponse>}
|
|
86
|
-
*/
|
|
87
|
-
Additions.prototype.deleteAdditionById = function (agreementId, additionId) {
|
|
88
|
-
return this.api(`/finance/agreements/${agreementId}/additions/${additionId}`, 'DELETE');
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* GET
|
|
93
|
-
* @param agreementId
|
|
94
|
-
* @param additionId
|
|
95
|
-
* @returns {Promise<Addition>}
|
|
96
|
-
*/
|
|
97
|
-
Additions.prototype.getAdditionById = function (agreementId, additionId) {
|
|
98
|
-
return this.api(`/finance/agreements/${agreementId}/additions/${additionId}`, 'GET');
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* PATCH
|
|
103
|
-
* @param agreementId
|
|
104
|
-
* @param additionId
|
|
105
|
-
* @param {Operations[]} operations
|
|
106
|
-
* @returns {Promise<Addition>}
|
|
107
|
-
*/
|
|
108
|
-
Additions.prototype.updateAddition = function (agreementId, additionId, operations) {
|
|
109
|
-
return this.api(`/finance/agreements/${agreementId}/additions/${additionId}`, 'PATCH', operations);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* PUT
|
|
114
|
-
* @param agreementId
|
|
115
|
-
* @param additionId
|
|
116
|
-
* @param {Addition} addition
|
|
117
|
-
* @returns {Promise<Addition>}
|
|
118
|
-
*/
|
|
119
|
-
Additions.prototype.replaceAddition = function (agreementId, additionId, addition) {
|
|
120
|
-
return this.api(`/finance/agreements/${agreementId}/additions/${additionId}`, 'PUT', addition);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
*
|
|
125
|
-
* @type {Additions}
|
|
126
|
-
*/
|
|
127
|
-
module.exports = Additions;
|