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
|
@@ -1,152 +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} Configuration
|
|
13
|
-
* @property {number} id
|
|
14
|
-
* @property {string} name
|
|
15
|
-
* @property {TypeHref} type
|
|
16
|
-
* @property {StatusHref} status
|
|
17
|
-
* @property {CompanyHref} company
|
|
18
|
-
* @property {ContactHref} contact
|
|
19
|
-
* @property {SiteHref} site
|
|
20
|
-
* @property activeFlag
|
|
21
|
-
* @property id
|
|
22
|
-
* @property name
|
|
23
|
-
* @property locationId
|
|
24
|
-
* @property businessUnitId
|
|
25
|
-
* @property deviceIdentifier
|
|
26
|
-
* @property serialNumber
|
|
27
|
-
* @property modelNumber
|
|
28
|
-
* @property tagNumber
|
|
29
|
-
* @property purchaseDate
|
|
30
|
-
* @property installationDate
|
|
31
|
-
* @property installedBy
|
|
32
|
-
* @property warrantyExpirationDate
|
|
33
|
-
* @property vendorNotes
|
|
34
|
-
* @property notes
|
|
35
|
-
* @property macAddress
|
|
36
|
-
* @property lastLoginName
|
|
37
|
-
* @property billFlag
|
|
38
|
-
* @property backupSuccesses
|
|
39
|
-
* @property backupIncomplete
|
|
40
|
-
* @property backupFailed
|
|
41
|
-
* @property backupRestores
|
|
42
|
-
* @property lastBackupDate
|
|
43
|
-
* @property backupServerName
|
|
44
|
-
* @property backupBillableSpaceGb
|
|
45
|
-
* @property backupProtectedDeviceList
|
|
46
|
-
* @property backupYear
|
|
47
|
-
* @property backupMonth
|
|
48
|
-
* @property ipAddress
|
|
49
|
-
* @property defaultGateway
|
|
50
|
-
* @property osType
|
|
51
|
-
* @property osInfo
|
|
52
|
-
* @property cpuSpeed
|
|
53
|
-
* @property ram
|
|
54
|
-
* @property localHardDrives
|
|
55
|
-
* @property parentConfigurationId
|
|
56
|
-
* @property vendor
|
|
57
|
-
* @property manufacturer
|
|
58
|
-
* @property activeFlag
|
|
59
|
-
* @property managementLink
|
|
60
|
-
* @property remoteLink
|
|
61
|
-
* @property {object} _info
|
|
62
|
-
* @property {string} _info.lastUpdated
|
|
63
|
-
* @property {string} _info.updatedBy
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @typedef {object} ConfigurationQuestion
|
|
68
|
-
* @property {number} answerId
|
|
69
|
-
* @property {number} questionId
|
|
70
|
-
* @property {string} question
|
|
71
|
-
* @property {null|boolean|number|string} answer
|
|
72
|
-
* @property {number} sequenceNumber
|
|
73
|
-
* @property {number} numberOfDecimals
|
|
74
|
-
* @property {string} fieldType ['Text', 'Button', 'Currency', 'Date', 'Hyperlink', 'IPAddress', 'Checkbox', 'Number', 'Percent', 'TextArea', 'Password']
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
*
|
|
79
|
-
* @param {CWOptions} options
|
|
80
|
-
* @inherits {ConnectWise}
|
|
81
|
-
* @constructor
|
|
82
|
-
*/
|
|
83
|
-
function Configurations(options) {
|
|
84
|
-
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
inherits(Configurations, ConnectWise);
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @param {Params} params
|
|
91
|
-
* @returns {Promise<Configuration[]>}
|
|
92
|
-
*/
|
|
93
|
-
Configurations.prototype.getConfigurations = function (params) {
|
|
94
|
-
return this.api('/company/configurations', 'GET', params);
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
*
|
|
98
|
-
* @param {Configuration} configuration
|
|
99
|
-
* @returns {Promise<Configuration>}
|
|
100
|
-
*/
|
|
101
|
-
Configurations.prototype.createConfiguration = function (configuration) {
|
|
102
|
-
return this.api('/company/configurations', 'POST', configuration);
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* @param {ParamsConfig} params
|
|
107
|
-
* @returns {Promise<Count>}
|
|
108
|
-
*/
|
|
109
|
-
Configurations.prototype.getConfigurationsCount = function (params) {
|
|
110
|
-
return this.api('/company/configurations/count', 'GET', params);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* @param {string|number} id
|
|
115
|
-
* @returns {Promise<DeleteResponse>}
|
|
116
|
-
*/
|
|
117
|
-
Configurations.prototype.deleteConfigurationById = function (id) {
|
|
118
|
-
return this.api(`/company/configurations/${id}`, 'DELETE');
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* @param {string|number} id
|
|
123
|
-
* @returns {Promise<Configuration>}
|
|
124
|
-
*/
|
|
125
|
-
Configurations.prototype.getConfigurationById = function (id) {
|
|
126
|
-
return this.api(`/company/configurations/${id}`, 'GET');
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* @param {string|number} id
|
|
131
|
-
* @param {Operations[]} ops
|
|
132
|
-
* @param {ParamsConfigUpdate} [params] unused currently @todo figure this out
|
|
133
|
-
* @returns {Promise<Configuration>}
|
|
134
|
-
*/
|
|
135
|
-
Configurations.prototype.updateConfiguration = function (id, ops, params) {
|
|
136
|
-
return this.api(`/company/configurations/${id}`, 'PATCH', ops);
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* @param {string|number} id
|
|
141
|
-
* @param {Configuration} config
|
|
142
|
-
* @returns {Promise<Configuration>}
|
|
143
|
-
*/
|
|
144
|
-
Configurations.prototype.replaceConfiguration = function (id, config) {
|
|
145
|
-
return this.api(`/company/configurations/${id}`, 'PUT', config);
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
*
|
|
150
|
-
* @type {Configurations}
|
|
151
|
-
*/
|
|
152
|
-
module.exports = Configurations;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
const inherits = require('util').inherits;
|
|
2
|
-
const ConnectWise = require('../ConnectWise.js');
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Company > ContactContactTypeAssociations
|
|
6
|
-
* @pilot
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @typedef {object} ContactTypeAssociation
|
|
11
|
-
* @property id
|
|
12
|
-
* @property type {ContactType}
|
|
13
|
-
* @property contact {ContactHref}
|
|
14
|
-
* @property _info
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @param {CWOptions} options
|
|
20
|
-
* @inherits {ConnectWise}
|
|
21
|
-
* @constructor
|
|
22
|
-
*/
|
|
23
|
-
function ContactContactTypeAssociations(options) {
|
|
24
|
-
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
inherits(ContactContactTypeAssociations, ConnectWise);
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @param contactId
|
|
31
|
-
* @param {Params} params
|
|
32
|
-
* @returns {Promise<ContactTypeAssociation[]>}
|
|
33
|
-
*/
|
|
34
|
-
ContactContactTypeAssociations.prototype.get = function (contactId, params) {
|
|
35
|
-
const path = `/company/contacts/${contactId}/typeAssociations`;
|
|
36
|
-
|
|
37
|
-
return this.api(path, 'GET', params);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
ContactContactTypeAssociations.prototype.update = function (contactId, associationId, params) {
|
|
41
|
-
const path = `/company/contacts/${contactId}/typeAssociations/${associationId}`;
|
|
42
|
-
|
|
43
|
-
return this.api(path, 'PUT', params);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
ContactContactTypeAssociations.prototype.create = function (contactId, params) {
|
|
47
|
-
const path = `/company/contacts/${contactId}/typeAssociations`;
|
|
48
|
-
|
|
49
|
-
return this.api(path, 'POST', params);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @type {ContactContactTypeAssociations}
|
|
54
|
-
*/
|
|
55
|
-
module.exports = ContactContactTypeAssociations;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const inherits = require('util').inherits;
|
|
2
|
-
const ConnectWise = require('../ConnectWise.js');
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @typedef {object} Relationship
|
|
6
|
-
* @property {number} id
|
|
7
|
-
* @property {string} name
|
|
8
|
-
* @property {object} _info
|
|
9
|
-
* @property {string} _info.lastUpdated
|
|
10
|
-
* @property {string} _info.updatedBy
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @param {CWOptions} options
|
|
16
|
-
* @inherits {ConnectWise}
|
|
17
|
-
* @constructor
|
|
18
|
-
*/
|
|
19
|
-
function ContactRelationships(options) {
|
|
20
|
-
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
inherits(ContactRelationships, ConnectWise);
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* @param {Params} params
|
|
27
|
-
* @returns {Promise<Relationship[]>}
|
|
28
|
-
*/
|
|
29
|
-
ContactRelationships.prototype.getRelationships = function (params) {
|
|
30
|
-
return this.api('/company/contacts/relationships', 'GET', params);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @type {ContactRelationships}
|
|
35
|
-
*/
|
|
36
|
-
module.exports = ContactRelationships;
|
|
@@ -1,199 +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} Contact
|
|
13
|
-
* @property {string} addressLine1
|
|
14
|
-
* @property {string} addressLine2
|
|
15
|
-
* @property {string} anniversary
|
|
16
|
-
* @property assistantContactId
|
|
17
|
-
* @property {boolean} childrenFlag
|
|
18
|
-
* @property city
|
|
19
|
-
* @property {CommunicationItemHref[]} communicationItems
|
|
20
|
-
* @property {CompanyHref} company
|
|
21
|
-
* @property {CountryHref} country
|
|
22
|
-
* @property {CustomField[]} customFields
|
|
23
|
-
* @property {DepartmentHref} department
|
|
24
|
-
* @property {boolean} disablePortalLoginFlag
|
|
25
|
-
* @property {string} firstName
|
|
26
|
-
* @property gender
|
|
27
|
-
* @property {number} id numeric identifier
|
|
28
|
-
* @property {boolean} inactiveFlag
|
|
29
|
-
* @property {string} lastName
|
|
30
|
-
* @property managerContactId
|
|
31
|
-
* @property {boolean} marriedFlag
|
|
32
|
-
* @property {string} nickName
|
|
33
|
-
* @property portalPassword
|
|
34
|
-
* @property {number} portalSecurityLevel
|
|
35
|
-
* @property presence
|
|
36
|
-
* @property {RelationshipHref} relationship
|
|
37
|
-
* @property school
|
|
38
|
-
* @property securityIdentifier
|
|
39
|
-
* @property significantOther
|
|
40
|
-
* @property {SiteHref} site
|
|
41
|
-
* @property state
|
|
42
|
-
* @property {string} title
|
|
43
|
-
* @property {TypeHref} type
|
|
44
|
-
* @property {boolean} unsubscribeFlag
|
|
45
|
-
* @property zip
|
|
46
|
-
* @property {object} _info
|
|
47
|
-
* @property {string} _info.communications_href
|
|
48
|
-
* @property {string} _info.image_href
|
|
49
|
-
* @property {string} _info.notes_href
|
|
50
|
-
* @property {string} _info.lastUpdated
|
|
51
|
-
* @property {string} _info.portalSecurity_href
|
|
52
|
-
* @property {string} _info.tracks_href
|
|
53
|
-
* @property {string} _info.updatedBy
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* @typedef {object} ContactType
|
|
58
|
-
* @property {number} id
|
|
59
|
-
* @property {string} description
|
|
60
|
-
* @property {boolean} defaultFlag
|
|
61
|
-
* @property {object} _info
|
|
62
|
-
* @property {string} _info.lastUpdated
|
|
63
|
-
* @property {string} _info.updatedBy
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @typedef {object} PortalSecurity
|
|
68
|
-
* @property {string} identifier
|
|
69
|
-
* @property {boolean} enabled
|
|
70
|
-
*/
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* @typedef {object} ValidatePortalResponse
|
|
74
|
-
* @property {boolean} success
|
|
75
|
-
* @property {number} contactId
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
*
|
|
80
|
-
* @param {CWOptions} options
|
|
81
|
-
* @inherits {ConnectWise}
|
|
82
|
-
* @constructor
|
|
83
|
-
*/
|
|
84
|
-
function Contacts(options) {
|
|
85
|
-
ConnectWise.apply(this, Array.prototype.slice.call(arguments));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
inherits(Contacts, ConnectWise);
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* @param {Params} params
|
|
92
|
-
* @returns {Promise<Contact[]>}
|
|
93
|
-
*/
|
|
94
|
-
Contacts.prototype.getContacts = function (params) {
|
|
95
|
-
return this.api('/company/contacts', 'GET', params);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @param {Contact} contact
|
|
100
|
-
* @returns {Promise<Contact>}
|
|
101
|
-
*/
|
|
102
|
-
Contacts.prototype.createContact = function (contact) {
|
|
103
|
-
return this.api('/company/contacts', 'POST', contact);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* @param {ParamsConditions} params
|
|
108
|
-
* @returns {Promise<Count>}
|
|
109
|
-
*/
|
|
110
|
-
Contacts.prototype.getContactsCount = function (params) {
|
|
111
|
-
return this.api('/company/contacts/count', 'GET', params);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* @param {ParamsConditions} params
|
|
116
|
-
* @returns {Promise<ContactType>}
|
|
117
|
-
*/
|
|
118
|
-
Contacts.prototype.getContactTypes = function (params) {
|
|
119
|
-
return this.api('/company/contacts/types', 'GET', params);
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* @param {number|string} id
|
|
124
|
-
* @param {number|string} transferContactId
|
|
125
|
-
* @returns {Promise<DeleteResponse>}
|
|
126
|
-
*/
|
|
127
|
-
Contacts.prototype.deleteContactById = function (id, transferContactId) {
|
|
128
|
-
return this.api(`/company/contacts/${id}`, 'DELETE', {transferContactId: transferContactId});
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* @param {string|number} id
|
|
133
|
-
* @returns {Promise<Contact>}
|
|
134
|
-
*/
|
|
135
|
-
Contacts.prototype.getContactById = function (id) {
|
|
136
|
-
return this.api(`/company/contacts/${id}`, 'GET');
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* @param {string|number} id
|
|
141
|
-
* @param {Operations[]} operations
|
|
142
|
-
* @returns {Promise<Contact>}
|
|
143
|
-
*/
|
|
144
|
-
Contacts.prototype.updateContact = function (id, operations) {
|
|
145
|
-
return this.api(`/company/contacts/${id}`, 'PATCH', operations);
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* @param {string|number} id
|
|
150
|
-
* @param {Contact} contact
|
|
151
|
-
* @returns {Promise<Contact>}
|
|
152
|
-
*/
|
|
153
|
-
Contacts.prototype.replaceContact = function (id, contact) {
|
|
154
|
-
return this.api(`/company/contacts/${id}`, 'PUT', contact);
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* @param {string|number} id
|
|
159
|
-
* @returns {Promise<PortalSecurity[]>}
|
|
160
|
-
*/
|
|
161
|
-
Contacts.prototype.getPortalSecurity = function (id) {
|
|
162
|
-
return this.api(`/company/contacts/${id}/portalSecurity`, 'GET');
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* @param {string} email
|
|
168
|
-
* @returns {Promise<PostResponse>}
|
|
169
|
-
*/
|
|
170
|
-
Contacts.prototype.requestPassword = function (email) {
|
|
171
|
-
return this.api('/company/contacts/requestPassword', 'POST', {email: email});
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
*
|
|
176
|
-
* @param {string} email
|
|
177
|
-
* @param {string} password
|
|
178
|
-
* @returns {Promise<ValidatePortalResponse>}
|
|
179
|
-
*/
|
|
180
|
-
Contacts.prototype.validatePortalCredentials = function (email, password) {
|
|
181
|
-
return this.api('/company/contacts/validatePortalCredentials', 'POST', {email: email, password: password});
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
*
|
|
186
|
-
* @param {string|number} id
|
|
187
|
-
* @param {boolean} useDefaultFlag
|
|
188
|
-
* @param {string} lastModified
|
|
189
|
-
* @returns {Promise<*>} @TODO check return type
|
|
190
|
-
*/
|
|
191
|
-
Contacts.prototype.getContactImage = function (id, useDefaultFlag, lastModified) {
|
|
192
|
-
return this.api(`/company/contacts/${id}/image`, 'GET', params);
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
*
|
|
197
|
-
* @type {Contacts}
|
|
198
|
-
*/
|
|
199
|
-
module.exports = Contacts;
|
package/src/CompanyAPI/index.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by kgrube on 1/22/2015.
|
|
3
|
-
* @author kgrube
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {object} CompanyAPI
|
|
8
|
-
* @property {Companies} Companies
|
|
9
|
-
* @property {Contacts} Contacts
|
|
10
|
-
* @property {Configurations} Configurations
|
|
11
|
-
* @property {ContactRelationships} ContactRelationships
|
|
12
|
-
* @property {ContactContactTypeAssociations} ContactContactTypeAssociations
|
|
13
|
-
* @property {CompanyCompanyTypeAssociations} CompanyCompanyTypeAssociations
|
|
14
|
-
* @property {CompanyTypes} CompanyTypes
|
|
15
|
-
* @property {CompanyTypeInfos} CompanyTypeInfos
|
|
16
|
-
* @property {CompanySites} CompanySites
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @param options
|
|
22
|
-
* @returns {CompanyAPI}
|
|
23
|
-
* @constructor
|
|
24
|
-
*/
|
|
25
|
-
function CompanyAPI(options) {
|
|
26
|
-
const _Companies = require('./Companies');
|
|
27
|
-
const _Contacts = require('./Contacts');
|
|
28
|
-
const _Configurations = require('./Configurations');
|
|
29
|
-
const _ContactRelationships = require('./ContactRelationships');
|
|
30
|
-
const _ContactContactTypeAssociations = require('./ContactContactTypeAssociations');
|
|
31
|
-
const _CompanyCompanyTypeAssociations = require('./CompanyCompanyTypeAssociations');
|
|
32
|
-
const _CompanyTypes = require('./CompanyTypes');
|
|
33
|
-
const _CompanyTypeInfos = require('./CompanyTypeInfos');
|
|
34
|
-
const _CompanySites = require('./CompanySites');
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
Companies: new _Companies(options),
|
|
38
|
-
Contacts: new _Contacts(options),
|
|
39
|
-
Configurations: new _Configurations(options),
|
|
40
|
-
ContactRelationships: new _ContactRelationships(options),
|
|
41
|
-
ContactContactTypeAssociations: new _ContactContactTypeAssociations(options),
|
|
42
|
-
CompanyCompanyTypeAssociations: new _CompanyCompanyTypeAssociations(options),
|
|
43
|
-
CompanyTypes: new _CompanyTypes(options),
|
|
44
|
-
CompanyTypeInfos: new _CompanyTypeInfos(options),
|
|
45
|
-
CompanySites: new _CompanySites(options),
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
51
|
-
* @type {CompanyAPI}
|
|
52
|
-
*/
|
|
53
|
-
module.exports = CompanyAPI;
|