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.
Files changed (282) hide show
  1. package/.eslintrc +17 -52
  2. package/.gitattributes +1 -0
  3. package/.mocharc.json +5 -0
  4. package/.prettierrc +7 -0
  5. package/README.md +293 -230
  6. package/api-extractor.json +364 -0
  7. package/dist/Automate/AVTemplatePoliciesAPI.d.ts +36 -0
  8. package/dist/Automate/AVTemplatePoliciesAPI.d.ts.map +1 -0
  9. package/dist/Automate/AVTemplatePoliciesAPI.js +92 -0
  10. package/dist/Automate/AVTemplatePoliciesAPI.js.map +1 -0
  11. package/dist/Automate/ClientsAPI.d.ts +44 -0
  12. package/dist/Automate/ClientsAPI.d.ts.map +1 -0
  13. package/dist/Automate/ClientsAPI.js +119 -0
  14. package/dist/Automate/ClientsAPI.js.map +1 -0
  15. package/dist/Automate/CommandsAPI.d.ts +20 -0
  16. package/dist/Automate/CommandsAPI.d.ts.map +1 -0
  17. package/dist/Automate/CommandsAPI.js +36 -0
  18. package/dist/Automate/CommandsAPI.js.map +1 -0
  19. package/dist/Automate/ComputersAPI.d.ts +131 -0
  20. package/dist/Automate/ComputersAPI.d.ts.map +1 -0
  21. package/dist/Automate/ComputersAPI.js +358 -0
  22. package/dist/Automate/ComputersAPI.js.map +1 -0
  23. package/dist/Automate/ContactsAPI.d.ts +24 -0
  24. package/dist/Automate/ContactsAPI.d.ts.map +1 -0
  25. package/dist/Automate/ContactsAPI.js +50 -0
  26. package/dist/Automate/ContactsAPI.js.map +1 -0
  27. package/dist/Automate/DataViewsAPI.d.ts +22 -0
  28. package/dist/Automate/DataViewsAPI.d.ts.map +1 -0
  29. package/dist/Automate/DataViewsAPI.js +36 -0
  30. package/dist/Automate/DataViewsAPI.js.map +1 -0
  31. package/dist/Automate/DrivesAPI.d.ts +25 -0
  32. package/dist/Automate/DrivesAPI.d.ts.map +1 -0
  33. package/dist/Automate/DrivesAPI.js +57 -0
  34. package/dist/Automate/DrivesAPI.js.map +1 -0
  35. package/dist/Automate/EventLogsAPI.d.ts +19 -0
  36. package/dist/Automate/EventLogsAPI.d.ts.map +1 -0
  37. package/dist/Automate/EventLogsAPI.js +29 -0
  38. package/dist/Automate/EventLogsAPI.js.map +1 -0
  39. package/dist/Automate/LocationsAPI.d.ts +57 -0
  40. package/dist/Automate/LocationsAPI.d.ts.map +1 -0
  41. package/dist/Automate/LocationsAPI.js +138 -0
  42. package/dist/Automate/LocationsAPI.js.map +1 -0
  43. package/dist/Automate/MaintenanceWindowDefinitionsAPI.d.ts +19 -0
  44. package/dist/Automate/MaintenanceWindowDefinitionsAPI.d.ts.map +1 -0
  45. package/dist/Automate/MaintenanceWindowDefinitionsAPI.js +29 -0
  46. package/dist/Automate/MaintenanceWindowDefinitionsAPI.js.map +1 -0
  47. package/dist/Automate/MonitorsAPI.d.ts +29 -0
  48. package/dist/Automate/MonitorsAPI.d.ts.map +1 -0
  49. package/dist/Automate/MonitorsAPI.js +85 -0
  50. package/dist/Automate/MonitorsAPI.js.map +1 -0
  51. package/dist/Automate/NetworkDevicesAPI.d.ts +23 -0
  52. package/dist/Automate/NetworkDevicesAPI.d.ts.map +1 -0
  53. package/dist/Automate/NetworkDevicesAPI.js +43 -0
  54. package/dist/Automate/NetworkDevicesAPI.js.map +1 -0
  55. package/dist/Automate/PatchingAPI.d.ts +33 -0
  56. package/dist/Automate/PatchingAPI.d.ts.map +1 -0
  57. package/dist/Automate/PatchingAPI.js +99 -0
  58. package/dist/Automate/PatchingAPI.js.map +1 -0
  59. package/dist/Automate/RemoteAgentAPI.d.ts +24 -0
  60. package/dist/Automate/RemoteAgentAPI.d.ts.map +1 -0
  61. package/dist/Automate/RemoteAgentAPI.js +50 -0
  62. package/dist/Automate/RemoteAgentAPI.js.map +1 -0
  63. package/dist/Automate/ScriptingAPI.d.ts +41 -0
  64. package/dist/Automate/ScriptingAPI.d.ts.map +1 -0
  65. package/dist/Automate/ScriptingAPI.js +109 -0
  66. package/dist/Automate/ScriptingAPI.js.map +1 -0
  67. package/dist/Automate/SearchesAPI.d.ts +23 -0
  68. package/dist/Automate/SearchesAPI.d.ts.map +1 -0
  69. package/dist/Automate/SearchesAPI.js +43 -0
  70. package/dist/Automate/SearchesAPI.js.map +1 -0
  71. package/dist/Automate/SystemAPI.d.ts +97 -0
  72. package/dist/Automate/SystemAPI.d.ts.map +1 -0
  73. package/dist/Automate/SystemAPI.js +273 -0
  74. package/dist/Automate/SystemAPI.js.map +1 -0
  75. package/dist/Automate/TicketsAPI.d.ts +14 -0
  76. package/dist/Automate/TicketsAPI.d.ts.map +1 -0
  77. package/dist/Automate/TicketsAPI.js +29 -0
  78. package/dist/Automate/TicketsAPI.js.map +1 -0
  79. package/dist/Automate/UserProfilesAPI.d.ts +19 -0
  80. package/dist/Automate/UserProfilesAPI.d.ts.map +1 -0
  81. package/dist/Automate/UserProfilesAPI.js +28 -0
  82. package/dist/Automate/UserProfilesAPI.js.map +1 -0
  83. package/dist/Automate.d.ts +43 -0
  84. package/dist/Automate.d.ts.map +1 -0
  85. package/dist/Automate.js +164 -0
  86. package/dist/Automate.js.map +1 -0
  87. package/dist/AutomateAPI.d.ts +129 -0
  88. package/dist/AutomateAPI.d.ts.map +1 -0
  89. package/dist/AutomateAPI.js +175 -0
  90. package/dist/AutomateAPI.js.map +1 -0
  91. package/dist/AutomateTypes.d.ts +10437 -0
  92. package/dist/AutomateTypes.d.ts.map +1 -0
  93. package/dist/AutomateTypes.js +3 -0
  94. package/dist/AutomateTypes.js.map +1 -0
  95. package/dist/BaseAPI.d.ts +26 -0
  96. package/dist/BaseAPI.d.ts.map +1 -0
  97. package/dist/BaseAPI.js +116 -0
  98. package/dist/BaseAPI.js.map +1 -0
  99. package/dist/Manage/CompanyAPI.d.ts +662 -0
  100. package/dist/Manage/CompanyAPI.d.ts.map +1 -0
  101. package/dist/Manage/CompanyAPI.js +3299 -0
  102. package/dist/Manage/CompanyAPI.js.map +1 -0
  103. package/dist/Manage/ConfigurationsAPI.d.ts +32 -0
  104. package/dist/Manage/ConfigurationsAPI.d.ts.map +1 -0
  105. package/dist/Manage/ConfigurationsAPI.js +78 -0
  106. package/dist/Manage/ConfigurationsAPI.js.map +1 -0
  107. package/dist/Manage/ExpenseAPI.d.ts +85 -0
  108. package/dist/Manage/ExpenseAPI.d.ts.map +1 -0
  109. package/dist/Manage/ExpenseAPI.js +311 -0
  110. package/dist/Manage/ExpenseAPI.js.map +1 -0
  111. package/dist/Manage/FinanceAPI.d.ts +538 -0
  112. package/dist/Manage/FinanceAPI.d.ts.map +1 -0
  113. package/dist/Manage/FinanceAPI.js +2592 -0
  114. package/dist/Manage/FinanceAPI.js.map +1 -0
  115. package/dist/Manage/MarketingAPI.d.ts +142 -0
  116. package/dist/Manage/MarketingAPI.d.ts.map +1 -0
  117. package/dist/Manage/MarketingAPI.js +634 -0
  118. package/dist/Manage/MarketingAPI.js.map +1 -0
  119. package/dist/Manage/ProcurementAPI.d.ts +435 -0
  120. package/dist/Manage/ProcurementAPI.d.ts.map +1 -0
  121. package/dist/Manage/ProcurementAPI.js +2103 -0
  122. package/dist/Manage/ProcurementAPI.js.map +1 -0
  123. package/dist/Manage/ProjectAPI.d.ts +215 -0
  124. package/dist/Manage/ProjectAPI.d.ts.map +1 -0
  125. package/dist/Manage/ProjectAPI.js +945 -0
  126. package/dist/Manage/ProjectAPI.js.map +1 -0
  127. package/dist/Manage/SalesAPI.d.ts +299 -0
  128. package/dist/Manage/SalesAPI.d.ts.map +1 -0
  129. package/dist/Manage/SalesAPI.js +1397 -0
  130. package/dist/Manage/SalesAPI.js.map +1 -0
  131. package/dist/Manage/ScheduleAPI.d.ts +132 -0
  132. package/dist/Manage/ScheduleAPI.d.ts.map +1 -0
  133. package/dist/Manage/ScheduleAPI.js +580 -0
  134. package/dist/Manage/ScheduleAPI.js.map +1 -0
  135. package/dist/Manage/ServiceAPI.d.ts +493 -0
  136. package/dist/Manage/ServiceAPI.d.ts.map +1 -0
  137. package/dist/Manage/ServiceAPI.js +2339 -0
  138. package/dist/Manage/ServiceAPI.js.map +1 -0
  139. package/dist/Manage/SystemAPI.d.ts +954 -0
  140. package/dist/Manage/SystemAPI.d.ts.map +1 -0
  141. package/dist/Manage/SystemAPI.js +4536 -0
  142. package/dist/Manage/SystemAPI.js.map +1 -0
  143. package/dist/Manage/TimeAPI.d.ts +186 -0
  144. package/dist/Manage/TimeAPI.d.ts.map +1 -0
  145. package/dist/Manage/TimeAPI.js +840 -0
  146. package/dist/Manage/TimeAPI.js.map +1 -0
  147. package/dist/Manage.d.ts +39 -0
  148. package/dist/Manage.d.ts.map +1 -0
  149. package/dist/Manage.js +137 -0
  150. package/dist/Manage.js.map +1 -0
  151. package/dist/ManageAPI.d.ts +135 -0
  152. package/dist/ManageAPI.d.ts.map +1 -0
  153. package/dist/ManageAPI.js +115 -0
  154. package/dist/ManageAPI.js.map +1 -0
  155. package/dist/ManageTypes.d.ts +91320 -0
  156. package/dist/ManageTypes.d.ts.map +1 -0
  157. package/dist/ManageTypes.js +7 -0
  158. package/dist/ManageTypes.js.map +1 -0
  159. package/dist/connectwise-rest.d.ts +108638 -0
  160. package/dist/index.d.ts +12 -0
  161. package/dist/index.d.ts.map +1 -0
  162. package/dist/index.js +36 -0
  163. package/dist/index.js.map +1 -0
  164. package/dist/tsdoc-metadata.json +11 -0
  165. package/dist/types.d.ts +48 -0
  166. package/dist/types.d.ts.map +1 -0
  167. package/dist/types.js +21 -0
  168. package/dist/types.js.map +1 -0
  169. package/dist/utils/Callback.d.ts +70 -0
  170. package/dist/utils/Callback.d.ts.map +1 -0
  171. package/dist/utils/Callback.js +109 -0
  172. package/dist/utils/Callback.js.map +1 -0
  173. package/dist/utils/Series.d.ts +42 -0
  174. package/dist/utils/Series.d.ts.map +1 -0
  175. package/dist/utils/Series.js +68 -0
  176. package/dist/utils/Series.js.map +1 -0
  177. package/dist/utils/index.d.ts +7 -0
  178. package/dist/utils/index.d.ts.map +1 -0
  179. package/dist/utils/index.js +11 -0
  180. package/dist/utils/index.js.map +1 -0
  181. package/package.json +50 -19
  182. package/src/Automate/AVTemplatePoliciesAPI.ts +124 -0
  183. package/src/Automate/ClientsAPI.ts +172 -0
  184. package/src/Automate/CommandsAPI.ts +39 -0
  185. package/src/Automate/ComputersAPI.ts +588 -0
  186. package/src/Automate/ContactsAPI.ts +63 -0
  187. package/src/Automate/DataViewsAPI.ts +43 -0
  188. package/src/Automate/DrivesAPI.ts +81 -0
  189. package/src/Automate/EventLogsAPI.ts +31 -0
  190. package/src/Automate/LocationsAPI.ts +222 -0
  191. package/src/Automate/MaintenanceWindowDefinitionsAPI.ts +34 -0
  192. package/src/Automate/MonitorsAPI.ts +101 -0
  193. package/src/Automate/NetworkDevicesAPI.ts +51 -0
  194. package/src/Automate/PatchingAPI.ts +116 -0
  195. package/src/Automate/RemoteAgentAPI.ts +65 -0
  196. package/src/Automate/ScriptingAPI.ts +147 -0
  197. package/src/Automate/SearchesAPI.ts +49 -0
  198. package/src/Automate/SystemAPI.ts +412 -0
  199. package/src/Automate/TicketsAPI.ts +29 -0
  200. package/src/Automate/UserProfilesAPI.ts +31 -0
  201. package/src/Automate.ts +204 -0
  202. package/src/AutomateAPI.ts +178 -0
  203. package/src/AutomateTypes.ts +10492 -0
  204. package/src/BaseAPI.ts +180 -0
  205. package/src/Manage/CompanyAPI.ts +4941 -0
  206. package/src/Manage/ConfigurationsAPI.ts +116 -0
  207. package/src/Manage/ExpenseAPI.ts +413 -0
  208. package/src/Manage/FinanceAPI.ts +3930 -0
  209. package/src/Manage/MarketingAPI.ts +958 -0
  210. package/src/Manage/ProcurementAPI.ts +3107 -0
  211. package/src/Manage/ProjectAPI.ts +1437 -0
  212. package/src/Manage/SalesAPI.ts +1968 -0
  213. package/src/Manage/ScheduleAPI.ts +773 -0
  214. package/src/Manage/ServiceAPI.ts +3476 -0
  215. package/src/Manage/SystemAPI.ts +6415 -0
  216. package/src/Manage/TimeAPI.ts +1151 -0
  217. package/src/Manage.ts +161 -0
  218. package/src/ManageAPI.ts +170 -0
  219. package/src/ManageTypes.ts +91318 -0
  220. package/src/index.ts +13 -0
  221. package/src/types.ts +68 -0
  222. package/src/utils/Callback.ts +148 -0
  223. package/src/utils/Series.ts +89 -0
  224. package/src/utils/index.ts +7 -0
  225. package/swagger-errors.md +25 -0
  226. package/test/.env.example +12 -6
  227. package/test/test-utils.ts +27 -0
  228. package/test/test.js +331 -108
  229. package/tsconfig.json +29 -0
  230. package/.travis.yml +0 -9
  231. package/doc.md +0 -5984
  232. package/docs/jsdoc.json +0 -15
  233. package/index.js +0 -10
  234. package/src/CompanyAPI/Companies.js +0 -149
  235. package/src/CompanyAPI/CompanyCompanyTypeAssociations.js +0 -111
  236. package/src/CompanyAPI/CompanySites.js +0 -80
  237. package/src/CompanyAPI/CompanyTeams.js +0 -108
  238. package/src/CompanyAPI/CompanyTypeInfos.js +0 -58
  239. package/src/CompanyAPI/CompanyTypes.js +0 -52
  240. package/src/CompanyAPI/Configurations.js +0 -152
  241. package/src/CompanyAPI/ContactContactTypeAssociations.js +0 -55
  242. package/src/CompanyAPI/ContactRelationships.js +0 -36
  243. package/src/CompanyAPI/Contacts.js +0 -199
  244. package/src/CompanyAPI/index.js +0 -53
  245. package/src/ConnectWise.js +0 -339
  246. package/src/ConnectWiseRest.js +0 -515
  247. package/src/FinanceAPI/Additions.js +0 -127
  248. package/src/FinanceAPI/Adjustments.js +0 -109
  249. package/src/FinanceAPI/AgreementSites.js +0 -108
  250. package/src/FinanceAPI/Agreements.js +0 -220
  251. package/src/FinanceAPI/BoardDefaults.js +0 -109
  252. package/src/FinanceAPI/WorkRoles.js +0 -113
  253. package/src/FinanceAPI/WorkTypeExclusions.js +0 -78
  254. package/src/FinanceAPI/WorkTypes.js +0 -124
  255. package/src/FinanceAPI/index.js +0 -50
  256. package/src/ProcurementAPI/CatalogItems.js +0 -94
  257. package/src/ProcurementAPI/index.js +0 -22
  258. package/src/ProjectAPI/Projects.js +0 -142
  259. package/src/ProjectAPI/index.js +0 -28
  260. package/src/SalesAPI/Activities.js +0 -149
  261. package/src/SalesAPI/index.js +0 -14
  262. package/src/ScheduleAPI/ScheduleEntries.js +0 -109
  263. package/src/ScheduleAPI/ScheduleTypes.js +0 -101
  264. package/src/ScheduleAPI/index.js +0 -30
  265. package/src/ServiceDeskAPI/BoardItems.js +0 -134
  266. package/src/ServiceDeskAPI/BoardSubTypes.js +0 -112
  267. package/src/ServiceDeskAPI/BoardTeams.js +0 -108
  268. package/src/ServiceDeskAPI/BoardTypes.js +0 -139
  269. package/src/ServiceDeskAPI/Boards.js +0 -100
  270. package/src/ServiceDeskAPI/Priorities.js +0 -47
  271. package/src/ServiceDeskAPI/ServiceNotes.js +0 -172
  272. package/src/ServiceDeskAPI/Statuses.js +0 -116
  273. package/src/ServiceDeskAPI/Tickets.js +0 -588
  274. package/src/ServiceDeskAPI/index.js +0 -53
  275. package/src/SystemAPI/Members.js +0 -139
  276. package/src/SystemAPI/Reports.js +0 -116
  277. package/src/SystemAPI/index.js +0 -32
  278. package/src/TimeAPI/TimeEntries.js +0 -121
  279. package/src/TimeAPI/index.js +0 -27
  280. package/src/utils/Callback.js +0 -124
  281. package/src/utils/Series.js +0 -63
  282. package/src/utils/index.js +0 -21
@@ -1,109 +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} Adjustment
13
- * @property {number} agreementId
14
- * @property {number} amount
15
- * @property {string} description
16
- * @property {string} effectiveDate
17
- * @property {number} id
18
- * @property {object} _info
19
- * @property {string} _info.lastUpdated
20
- * @property {string} _info.updatedBy
21
- *
22
- */
23
-
24
- /**
25
- * @param {CWOptions} options
26
- * @constructor
27
- */
28
- function Adjustments(options) {
29
- ConnectWise.apply(this, Array.prototype.slice.call(arguments));
30
- }
31
- inherits(Adjustments, ConnectWise);
32
-
33
- /**
34
- * GET
35
- * @param agreementId
36
- * @param {Params} params
37
- * @returns {Promise<Adjustment[]>}
38
- */
39
- Adjustments.prototype.getAdjustments = function (agreementId, params) {
40
- return this.api(`/finance/agreements/${agreementId}/adjustments`, 'GET', params);
41
- };
42
-
43
- /**
44
- * POST
45
- * @param agreementId
46
- * @param {Adjustment} addition
47
- * @returns {Promise<Adjustment>}
48
- */
49
- Adjustments.prototype.createAdjustments = function (agreementId, addition) {
50
- return this.api(`/finance/agreements/${agreementId}/adjustments`, 'POST', addition);
51
- };
52
-
53
- /**
54
- * GET
55
- * @param agreementId
56
- * @param {ParamsConditions} params
57
- * @returns {Promise<Count>}
58
- */
59
- Adjustments.prototype.getAdjustmentsCount = function (agreementId, params) {
60
- return this.api(`/finance/agreements/${agreementId}/adjustments/count`, 'GET', params);
61
- };
62
-
63
- /**
64
- * DELETE
65
- * @param agreementId
66
- * @param additionId
67
- * @returns {Promise<DeleteResponse>}
68
- */
69
- Adjustments.prototype.deleteAdjustmentById = function (agreementId, additionId) {
70
- return this.api(`/finance/agreements/${agreementId}/adjustments/${additionId}`, 'DELETE');
71
- };
72
-
73
- /**
74
- * GET
75
- * @param agreementId
76
- * @param additionId
77
- * @returns {Promise<Adjustment>}
78
- */
79
- Adjustments.prototype.getAdjustmentById = function (agreementId, additionId) {
80
- return this.api(`/finance/agreements/${agreementId}/adjustments/${additionId}`, 'GET');
81
- };
82
-
83
- /**
84
- * PATCH
85
- * @param agreementId
86
- * @param additionId
87
- * @param {Operations operations
88
- * @returns {Promise<Adjustment>}
89
- */
90
- Adjustments.prototype.updateAdjustment = function (agreementId, additionId, operations) {
91
- return this.api(`/finance/agreements/${agreementId}/adjustments/${additionId}`, 'PATCH', operations);
92
- };
93
-
94
- /**
95
- * PUT
96
- * @param agreementId
97
- * @param additionId
98
- * @param {Adjustment} addition
99
- * @returns {Promise<Adjustment>}
100
- */
101
- Adjustments.prototype.replaceAdjustment = function (agreementId, additionId, addition) {
102
- return this.api(`/finance/agreements/${agreementId}/adjustments/${additionId}`, 'PUT', addition);
103
- };
104
-
105
- /**
106
- *
107
- * @type {Adjustments}
108
- */
109
- module.exports = Adjustments;
@@ -1,108 +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} AgreementSite
13
- * @property {number} id
14
- * @property {CompanyHref} company
15
- * @property {SiteHref} site
16
- * @property {number} agreementId
17
- * @property {object} _info
18
- */
19
-
20
- /**
21
- *
22
- * @param {CWOptions} options
23
- * @inherits {ConnectWise}
24
- * @constructor
25
- */
26
- function AgreementSites(options) {
27
- ConnectWise.apply(this, Array.prototype.slice.call(arguments));
28
- }
29
-
30
- inherits(AgreementSites, ConnectWise);
31
-
32
- /**
33
- * GET
34
- * @param agreementId
35
- * @param {Params} params
36
- * @returns {Promise<AgreementSite[]>}
37
- */
38
- AgreementSites.prototype.getAgreementSites = function (agreementId, params) {
39
- return this.api(`/finance/agreements/${agreementId}/sites`, 'GET', params);
40
- };
41
-
42
- /**
43
- * POST
44
- * @param agreementId
45
- * @param {AgreementSite} site
46
- * @returns {Promise<AgreementSite>}
47
- */
48
- AgreementSites.prototype.createAgreementSite = function (agreementId, site) {
49
- return this.api(`/finance/agreements/${agreementId}/sites`, 'POST', site);
50
- };
51
-
52
- /**
53
- * GET
54
- * @param agreementId
55
- * @param {ParamsConditions} params
56
- * @returns {Promise<Count>}
57
- */
58
- AgreementSites.prototype.getAgreementSitesCount = function (agreementId, params) {
59
- return this.api(`/finance/agreements/${agreementId}/sites/count`, 'GET', params);
60
- };
61
-
62
- /**
63
- * DELETE
64
- * @param agreementId
65
- * @param siteId
66
- * @returns {Promise<DeleteResponse>}
67
- */
68
- AgreementSites.prototype.deleteAgreementSiteById = function (agreementId, siteId) {
69
- return this.api(`/finance/agreements/${agreementId}/sites/${siteId}`, 'DELETE');
70
- };
71
-
72
- /**
73
- * GET
74
- * @param agreementId
75
- * @param siteId
76
- * @returns {Promise<AgreementSite>}
77
- */
78
- AgreementSites.prototype.getAgreementSiteById = function (agreementId, siteId) {
79
- return this.api(`/finance/agreements/${agreementId}/sites/${siteId}`, 'GET');
80
- };
81
-
82
- /**
83
- * PATCH
84
- * @param agreementId
85
- * @param siteId
86
- * @param {Operations[]} operations
87
- * @returns {Promise<AgreementSite>}
88
- */
89
- AgreementSites.prototype.updateAgreementSite = function (agreementId, siteId, operations) {
90
- return this.api(`/finance/agreements/${agreementId}/sites/${siteId}`, 'PATCH', operations);
91
- };
92
-
93
- /**
94
- * PUT
95
- * @param agreementId
96
- * @param siteId
97
- * @param {AgreementSite} site
98
- * @returns {Promise<AgreementSite>}
99
- */
100
- AgreementSites.prototype.replaceAgreementSite = function (agreementId, siteId, site) {
101
- return this.api(`/finance/agreements/${agreementId}/sites/${siteId}`, 'PUT', site);
102
- };
103
-
104
- /**
105
- *
106
- * @type {AgreementSites}
107
- */
108
- module.exports = AgreementSites;
@@ -1,220 +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} Agreement
13
- * @property {boolean} allowOverruns
14
- * @property {string} applicationCycle ['CalendarMonth', 'Contract2Weeks', 'Contract4Weeks', 'CalendarQuarter', 'CalendarWeek', 'ContractQuarter', 'CalendarYear']
15
- * @property {number} applicationLimit
16
- * @property {string} applicationUnits ['Amount', 'Hours', 'Incidents']
17
- * @property {boolean} applicationUnlimitedFlag
18
- * @property {number} billAmount
19
- * @property {number} billCycleId
20
- * @property {string} billExpenses ['Billable', 'DoNotBill', 'NoCharge', 'NoDefault']
21
- * @property {boolean} billOneTimeFlag
22
- * @property {string} billProducts ['Billable', 'DoNotBill', 'NoCharge', 'NoDefault']
23
- * @property {string} billStartDate
24
- * @property {number} billTermsId
25
- * @property {string} billTime ['Billable', 'DoNotBill', 'NoCharge', 'NoDefault']
26
- * @property {object} billToCompany
27
- * @property {number} billToCompany.id
28
- * @property {string} billToCompany.identifier
29
- * @property {object} billToCompany._info
30
- * @property {object} billToSite
31
- * @property {number} billToSite.id
32
- * @property {string} billToSite.name
33
- * @property {object} billToSite._info
34
- * @property {boolean} billableExpenseInvoice
35
- * @property {boolean} billableProductInvoice
36
- * @property {boolean} billableTimeInvoice
37
- * @property {boolean} bottomComment
38
- * @property {number} businessUnitId
39
- * @property {boolean} cancelledFlag
40
- * @property {boolean} carryOverUnused
41
- * @property {boolean} chargeToFirm
42
- * @property {number} compHourlyRate
43
- * @property {number} compLimitAmount
44
- * @property {CompanyHref} company
45
- * @property {ContactHref} contact
46
- * @property {boolean} coverAgreementExpense
47
- * @property {boolean} coverAgreementProduct
48
- * @property {boolean} coverAgreementTime
49
- * @property {boolean} coverSalesTax
50
- * @property {string} customerPO
51
- * @property {string} dateCancelled
52
- * @property {string} employeeCompNotExceed ['Billing', 'Percent', 'Amount]
53
- * @property {string} employeeCompRate ['Actual', 'Hourly']
54
- * @property {string} endDate
55
- * @property {boolean} expireWhenZero
56
- * @property {number} expiredDays
57
- * @property {number} id agreementId
58
- * @property {string} internalNotes
59
- * @property {string} invoiceDescription
60
- * @property {number} invoiceTemplateId
61
- * @property {string} invoicingCycle ['CalendarMonth', 'Contract2Weeks', 'Contract4Weeks', 'CalendarQuarter', 'CalendarWeek', 'ContractQuarter', 'CalendarYear']
62
- * @property {number} limit
63
- * @property {number} locationId
64
- * @property {string} name agreementName
65
- * @property {boolean} noEndingDateFlag
66
- * @property {boolean} oneTimeFlag
67
- * @property {OpportunityHref} opportunity
68
- * @property {number} parentAgreementId
69
- * @property {string} periodType ['Current', 'Future', 'Both', 'Undefined']
70
- * @property {number} projectTypeId
71
- * @property {number} prorateFirstBill
72
- * @property {boolean} restrictDepartmentFlag
73
- * @property {boolean} restrictDownPayment
74
- * @property {boolean} restrictLocationFlag
75
- * @property {number} slaId
76
- * @property {string} startDate
77
- * @property {CompanyHref} subContractCompany
78
- * @property {ContactHref} subContractContact
79
- * @property {number} taxCodeId
80
- * @property {boolean} taxable
81
- * @property {boolean} topComment
82
- * @property {AgreementTypeHref} type
83
- * @property {string} workOrder
84
- * @property {WorkRoleHref} workRole
85
- * @property {WorkTypeHref} workType
86
- *
87
- */
88
-
89
-
90
- /**
91
- *
92
- * @param {CWOptions} options
93
- * @inherits {ConnectWise}
94
- * @constructor
95
- */
96
- function Agreements(options) {
97
- ConnectWise.apply(this, Array.prototype.slice.call(arguments));
98
- }
99
-
100
- inherits(Agreements, ConnectWise);
101
-
102
- /**
103
- * GET
104
- * @param {Params} params
105
- * @returns {Promise<Agreement[]>}
106
- */
107
- Agreements.prototype.getAgreements = function (params) {
108
- return this.api('/finance/agreements', 'GET', params);
109
- };
110
-
111
- /**
112
- * POST
113
- * @param {Agreement} agreement
114
- * @returns {Promise<Agreement>}
115
- */
116
- Agreements.prototype.createAgreement = function (agreement) {
117
- return this.api('/finance/agreements', 'POST', agreement);
118
- };
119
-
120
- /**
121
- * GET
122
- * @param {ParamsConditions} params
123
- * @returns {Promise<Count>}
124
- */
125
- Agreements.prototype.getAgreementsCount = function (params) {
126
- return this.api('/finance/agreements/count', 'GET', params);
127
- };
128
-
129
- /**
130
- * DELETE
131
- * @param {string|number} agreementId
132
- * @returns {Promise<DeleteResponse>}
133
- */
134
- Agreements.prototype.deleteAgreementById = function (agreementId) {
135
- return this.api(`/finance/agreements/${agreementId}`, 'DELETE');
136
- };
137
-
138
- /**
139
- *
140
- * @param {string|number} agreementId
141
- * @returns {Promise<Agreement>}
142
- */
143
- Agreements.prototype.getAgreementById = function (agreementId) {
144
- return this.api(`/finance/agreements/${agreementId}`, 'GET');
145
- };
146
-
147
- /**
148
- *
149
- * @param {string|number} agreementId
150
- * @param {Operations[]} operations
151
- * @returns {Promise<Agreement>}
152
- */
153
- Agreements.prototype.updateAgreement = function (agreementId, operations) {
154
- return this.api(`/finance/agreements/${agreementId}`, 'PATCH', operations);
155
- };
156
-
157
- /**
158
- *
159
- * @param agreementId
160
- * @param {Agreement} agreement
161
- * @returns {Promise<Agreement>}
162
- */
163
- Agreements.prototype.replaceAgreement = function (agreementId, agreement) {
164
- return this.api(`/finance/agreements/${agreementId}`, 'PUT', agreement);
165
- };
166
-
167
- /**
168
- *
169
- * @param agreementId
170
- * @param {ParamsPage} params
171
- * @returns {Promise<ConfigurationHref[]>}
172
- */
173
- Agreements.prototype.getAgreementConfigurations = function (agreementId, params) {
174
- return this.api(`/finance/agreements/${agreementId}/configurations`, 'GET', params);
175
- };
176
-
177
- /**
178
- * POST
179
- * @param agreementId
180
- * @param configuration
181
- * @returns {Promise<ConfigurationHref>}
182
- */
183
- Agreements.prototype.createConfigurationAssociation = function (agreementId, configuration) {
184
- return this.api(`/finance/agreements/${agreementId}/configurations`, 'POST', configuration);
185
- };
186
-
187
- /**
188
- * GET
189
- * @param agreementId
190
- * @returns {Promise<Count>}
191
- */
192
- Agreements.prototype.getAgreementConfigurationsCount = function (agreementId) {
193
- return this.api(`/finance/agreements/${agreementId}/configurations/count`, 'GET');
194
- };
195
-
196
- /**
197
- *
198
- * @param agreementId
199
- * @param configurationId
200
- * @returns {Promise<DeleteResponse>}
201
- */
202
- Agreements.prototype.deleteConfigurationAssociation = function (agreementId, configurationId) {
203
- return this.api(`/finance/agreements/${agreementId}/configurations/${configurationId}`, 'DELETE');
204
- };
205
-
206
- /**
207
- *
208
- * @param agreementId
209
- * @param configurationId
210
- * @returns {Promise<ConfigurationHref>}
211
- */
212
- Agreements.prototype.getConfigurationAssociation = function (agreementId, configurationId) {
213
- return this.api(`/finance/agreements/${agreementId}/configurations/${configurationId}`, 'GET');
214
- };
215
-
216
- /**
217
- *
218
- * @type {Agreements}
219
- */
220
- module.exports = Agreements;
@@ -1,109 +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} BoardDefault
13
- * @property {number} id
14
- * @property {BoardHref} board
15
- * @property {ServiceTypeHref} serviceType
16
- * @property {boolean} defaultFlag
17
- * @property {number} agreementId
18
- * @property {object} _info
19
- */
20
-
21
- /**
22
- *
23
- * @param {CWOptions} options
24
- * @inherits {ConnectWise}
25
- * @constructor
26
- */
27
- function BoardDefaults(options) {
28
- ConnectWise.apply(this, Array.prototype.slice.call(arguments));
29
- }
30
-
31
- inherits(BoardDefaults, ConnectWise);
32
-
33
- /**
34
- * GET
35
- * @param agreementId
36
- * @param {Params} params
37
- * @returns {Promise<BoardDefault[]>}
38
- */
39
- BoardDefaults.prototype.getBoardDefaults = function (agreementId, params) {
40
- return this.api(`/finance/agreements/${agreementId}/boardDefaults`, 'GET', params);
41
- };
42
-
43
- /**
44
- * POST
45
- * @param agreementId
46
- * @param {BoardDefault} boardDefault
47
- * @returns {Promise<BoardDefault>}
48
- */
49
- BoardDefaults.prototype.createBoardDefault = function (agreementId, boardDefault) {
50
- return this.api(`/finance/agreements/${agreementId}/boardDefaults`, 'POST', boardDefault);
51
- };
52
-
53
- /**
54
- * GET
55
- * @param agreementId
56
- * @param {ParamsConditions} params
57
- * @returns {Promise<Count>}
58
- */
59
- BoardDefaults.prototype.getBoardDefaultsCount = function (agreementId, params) {
60
- return this.api(`/finance/agreements/${agreementId}/boardDefaults/count`, 'GET', params);
61
- };
62
-
63
- /**
64
- * DELETE
65
- * @param agreementId
66
- * @param boardDefaultId
67
- * @returns {Promise<DeleteResponse>}
68
- */
69
- BoardDefaults.prototype.deleteBoardDefaultById = function (agreementId, boardDefaultId) {
70
- return this.api(`/finance/agreements/${agreementId}/boardDefaults/${boardDefaultId}`, 'DELETE');
71
- };
72
-
73
- /**
74
- * GET
75
- * @param agreementId
76
- * @param boardDefaultId
77
- * @returns {Promise<BoardDefault>}
78
- */
79
- BoardDefaults.prototype.getBoardDefaultById = function (agreementId, boardDefaultId) {
80
- return this.api(`/finance/agreements/${agreementId}/boardDefaults/${boardDefaultId}`, 'GET');
81
- };
82
-
83
- /**
84
- * PATCH
85
- * @param agreementId
86
- * @param boardDefaultId
87
- * @param {Operations[]} operations
88
- * @returns {Promise<BoardDefault>}
89
- */
90
- BoardDefaults.prototype.updateBoardDefault = function (agreementId, boardDefaultId, operations) {
91
- return this.api(`/finance/agreements/${agreementId}/boardDefaults/${boardDefaultId}`, 'PATCH', operations);
92
- };
93
-
94
- /**
95
- * PUT
96
- * @param agreementId
97
- * @param boardDefaultId
98
- * @param {BoardDefault} boardDefault
99
- * @returns {Promise<BoardDefault>}
100
- */
101
- BoardDefaults.prototype.replaceBoardDefault = function (agreementId, boardDefaultId, boardDefault) {
102
- return this.api(`/finance/agreements/${agreementId}/boardDefaults/${boardDefaultId}`, 'PUT', boardDefault);
103
- };
104
-
105
- /**
106
- *
107
- * @type {BoardDefaults}
108
- */
109
- module.exports = BoardDefaults;
@@ -1,113 +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} WorkRole
13
- * @property {number} id
14
- * @property {WorkRoleHref} workRole
15
- * @property {number} locationId
16
- * @property {string} rateType ['AdjAmount', 'Custom', 'Multiplier']
17
- * @property {number} rate
18
- * @property {number} limitTo
19
- * @property {string} effectiveDate
20
- * @property {string} endingDate
21
- * @property {number} agreementId
22
- * @property {object} _info
23
- */
24
-
25
- /**
26
- *
27
- * @param {CWOptions} options
28
- * @inherits {ConnectWise}
29
- * @constructor
30
- */
31
- function WorkRoles(options) {
32
- ConnectWise.apply(this, Array.prototype.slice.call(arguments));
33
- }
34
-
35
- inherits(WorkRoles, ConnectWise);
36
-
37
- /**
38
- * GET
39
- * @param agreementId
40
- * @param {Params} params
41
- * @returns {Promise<WorkRole[]>}
42
- */
43
- WorkRoles.prototype.getWorkRoles = function (agreementId, params) {
44
- return this.api(`/finance/agreements/${agreementId}/workroles`, 'GET', params);
45
- };
46
-
47
- /**
48
- * POST
49
- * @param agreementId
50
- * @param {WorkRole} workRole
51
- * @returns {Promise<WorkRole>}
52
- */
53
- WorkRoles.prototype.createWorkRole = function (agreementId, workRole) {
54
- return this.api(`/finance/agreements/${agreementId}/workroles`, 'POST', workRole);
55
- };
56
-
57
- /**
58
- * GET
59
- * @param agreementId
60
- * @param {ParamsConditions} params
61
- * @returns {Promise<Count>}
62
- */
63
- WorkRoles.prototype.getWorkRolesCount = function (agreementId, params) {
64
- return this.api(`/finance/agreements/${agreementId}/workroles/count`, 'GET', params);
65
- };
66
-
67
- /**
68
- * DELETE
69
- * @param agreementId
70
- * @param workRoleId
71
- * @returns {Promise<DeleteResponse>}
72
- */
73
- WorkRoles.prototype.deleteWorkRoleById = function (agreementId, workRoleId) {
74
- return this.api(`/finance/agreements/${agreementId}/workroles/${workRoleId}`, 'DELETE');
75
- };
76
-
77
- /**
78
- * GET
79
- * @param agreementId
80
- * @param workRoleId
81
- * @returns {Promise<WorkRole>}
82
- */
83
- WorkRoles.prototype.getWorkRoleById = function (agreementId, workRoleId) {
84
- return this.api(`/finance/agreements/${agreementId}/workroles/${workRoleId}`, 'GET');
85
- };
86
-
87
- /**
88
- * PATCH
89
- * @param agreementId
90
- * @param workRoleId
91
- * @param {Operations[]} operations
92
- * @returns {Promise<WorkRole>}
93
- */
94
- WorkRoles.prototype.updateWorkRole = function (agreementId, workRoleId, operations) {
95
- return this.api(`/finance/agreements/${agreementId}/workroles/${workRoleId}`, 'PATCH', operations);
96
- };
97
-
98
- /**
99
- * PUT
100
- * @param agreementId
101
- * @param workRoleId
102
- * @param {WorkRole} workRole
103
- * @returns {Promise<WorkRole>}
104
- */
105
- WorkRoles.prototype.replaceWorkRole = function (agreementId, workRoleId, workRole) {
106
- return this.api(`/finance/agreements/${agreementId}/workroles/${workRoleId}`, 'PUT', workRole);
107
- };
108
-
109
- /**
110
- *
111
- * @type {WorkRoles}
112
- */
113
- module.exports = WorkRoles;