connectwise-rest 1.0.0 → 1.0.1
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 +23 -26
- package/README.md +62 -12
- package/api-extractor.json +364 -364
- package/dist/Automate/AVTemplatePoliciesAPI.d.ts +10 -1
- package/dist/Automate/AVTemplatePoliciesAPI.d.ts.map +1 -1
- package/dist/Automate/AVTemplatePoliciesAPI.js +6 -1
- package/dist/Automate/AVTemplatePoliciesAPI.js.map +1 -1
- package/dist/Automate/ClientsAPI.d.ts +11 -1
- package/dist/Automate/ClientsAPI.d.ts.map +1 -1
- package/dist/Automate/ClientsAPI.js +6 -1
- package/dist/Automate/ClientsAPI.js.map +1 -1
- package/dist/Automate/CommandsAPI.d.ts +6 -1
- package/dist/Automate/CommandsAPI.d.ts.map +1 -1
- package/dist/Automate/CommandsAPI.js +6 -1
- package/dist/Automate/CommandsAPI.js.map +1 -1
- package/dist/Automate/ComputersAPI.d.ts +38 -1
- package/dist/Automate/ComputersAPI.d.ts.map +1 -1
- package/dist/Automate/ComputersAPI.js +6 -1
- package/dist/Automate/ComputersAPI.js.map +1 -1
- package/dist/Automate/ContactsAPI.d.ts +7 -1
- package/dist/Automate/ContactsAPI.d.ts.map +1 -1
- package/dist/Automate/ContactsAPI.js +6 -1
- package/dist/Automate/ContactsAPI.js.map +1 -1
- package/dist/Automate/DataViewsAPI.d.ts +7 -1
- package/dist/Automate/DataViewsAPI.d.ts.map +1 -1
- package/dist/Automate/DataViewsAPI.js +6 -1
- package/dist/Automate/DataViewsAPI.js.map +1 -1
- package/dist/Automate/DrivesAPI.d.ts +7 -1
- package/dist/Automate/DrivesAPI.d.ts.map +1 -1
- package/dist/Automate/DrivesAPI.js +6 -1
- package/dist/Automate/DrivesAPI.js.map +1 -1
- package/dist/Automate/EventLogsAPI.d.ts +6 -1
- package/dist/Automate/EventLogsAPI.d.ts.map +1 -1
- package/dist/Automate/EventLogsAPI.js +6 -1
- package/dist/Automate/EventLogsAPI.js.map +1 -1
- package/dist/Automate/LocationsAPI.d.ts +16 -1
- package/dist/Automate/LocationsAPI.d.ts.map +1 -1
- package/dist/Automate/LocationsAPI.js +6 -1
- package/dist/Automate/LocationsAPI.js.map +1 -1
- package/dist/Automate/MaintenanceWindowDefinitionsAPI.d.ts +6 -1
- package/dist/Automate/MaintenanceWindowDefinitionsAPI.d.ts.map +1 -1
- package/dist/Automate/MaintenanceWindowDefinitionsAPI.js +6 -1
- package/dist/Automate/MaintenanceWindowDefinitionsAPI.js.map +1 -1
- package/dist/Automate/MonitorsAPI.d.ts +7 -1
- package/dist/Automate/MonitorsAPI.d.ts.map +1 -1
- package/dist/Automate/MonitorsAPI.js +6 -1
- package/dist/Automate/MonitorsAPI.js.map +1 -1
- package/dist/Automate/NetworkDevicesAPI.d.ts +7 -1
- package/dist/Automate/NetworkDevicesAPI.d.ts.map +1 -1
- package/dist/Automate/NetworkDevicesAPI.js +6 -1
- package/dist/Automate/NetworkDevicesAPI.js.map +1 -1
- package/dist/Automate/PatchingAPI.d.ts +7 -1
- package/dist/Automate/PatchingAPI.d.ts.map +1 -1
- package/dist/Automate/PatchingAPI.js +6 -1
- package/dist/Automate/PatchingAPI.js.map +1 -1
- package/dist/Automate/RemoteAgentAPI.d.ts +7 -1
- package/dist/Automate/RemoteAgentAPI.d.ts.map +1 -1
- package/dist/Automate/RemoteAgentAPI.js +6 -1
- package/dist/Automate/RemoteAgentAPI.js.map +1 -1
- package/dist/Automate/ScriptingAPI.d.ts +10 -1
- package/dist/Automate/ScriptingAPI.d.ts.map +1 -1
- package/dist/Automate/ScriptingAPI.js +6 -1
- package/dist/Automate/ScriptingAPI.js.map +1 -1
- package/dist/Automate/SearchesAPI.d.ts +7 -1
- package/dist/Automate/SearchesAPI.d.ts.map +1 -1
- package/dist/Automate/SearchesAPI.js +6 -1
- package/dist/Automate/SearchesAPI.js.map +1 -1
- package/dist/Automate/SystemAPI.d.ts +28 -3
- package/dist/Automate/SystemAPI.d.ts.map +1 -1
- package/dist/Automate/SystemAPI.js +8 -3
- package/dist/Automate/SystemAPI.js.map +1 -1
- package/dist/Automate/TicketsAPI.d.ts +5 -1
- package/dist/Automate/TicketsAPI.d.ts.map +1 -1
- package/dist/Automate/TicketsAPI.js +6 -1
- package/dist/Automate/TicketsAPI.js.map +1 -1
- package/dist/Automate/UserProfilesAPI.d.ts +6 -1
- package/dist/Automate/UserProfilesAPI.d.ts.map +1 -1
- package/dist/Automate/UserProfilesAPI.js +6 -1
- package/dist/Automate/UserProfilesAPI.js.map +1 -1
- package/dist/Automate.d.ts +0 -5
- package/dist/Automate.d.ts.map +1 -1
- package/dist/Automate.js +0 -3
- package/dist/Automate.js.map +1 -1
- package/dist/AutomateAPI.d.ts +55 -22
- package/dist/AutomateAPI.d.ts.map +1 -1
- package/dist/AutomateAPI.js +46 -39
- package/dist/AutomateAPI.js.map +1 -1
- package/dist/BaseAPI.d.ts +13 -0
- package/dist/BaseAPI.d.ts.map +1 -1
- package/dist/BaseAPI.js +64 -1
- package/dist/BaseAPI.js.map +1 -1
- package/dist/Manage/CompanyAPI.d.ts +90 -1
- package/dist/Manage/CompanyAPI.d.ts.map +1 -1
- package/dist/Manage/CompanyAPI.js +6 -1
- package/dist/Manage/CompanyAPI.js.map +1 -1
- package/dist/Manage/ConfigurationsAPI.d.ts +9 -1
- package/dist/Manage/ConfigurationsAPI.d.ts.map +1 -1
- package/dist/Manage/ConfigurationsAPI.js +6 -1
- package/dist/Manage/ConfigurationsAPI.js.map +1 -1
- package/dist/Manage/ExpenseAPI.d.ts +18 -1
- package/dist/Manage/ExpenseAPI.d.ts.map +1 -1
- package/dist/Manage/ExpenseAPI.js +6 -1
- package/dist/Manage/ExpenseAPI.js.map +1 -1
- package/dist/Manage/FinanceAPI.d.ts +79 -1
- package/dist/Manage/FinanceAPI.d.ts.map +1 -1
- package/dist/Manage/FinanceAPI.js +6 -1
- package/dist/Manage/FinanceAPI.js.map +1 -1
- package/dist/Manage/MarketingAPI.d.ts +23 -1
- package/dist/Manage/MarketingAPI.d.ts.map +1 -1
- package/dist/Manage/MarketingAPI.js +6 -1
- package/dist/Manage/MarketingAPI.js.map +1 -1
- package/dist/Manage/ProcurementAPI.d.ts +63 -1
- package/dist/Manage/ProcurementAPI.d.ts.map +1 -1
- package/dist/Manage/ProcurementAPI.js +6 -1
- package/dist/Manage/ProcurementAPI.js.map +1 -1
- package/dist/Manage/ProjectAPI.d.ts +37 -1
- package/dist/Manage/ProjectAPI.d.ts.map +1 -1
- package/dist/Manage/ProjectAPI.js +6 -1
- package/dist/Manage/ProjectAPI.js.map +1 -1
- package/dist/Manage/SalesAPI.d.ts +46 -1
- package/dist/Manage/SalesAPI.d.ts.map +1 -1
- package/dist/Manage/SalesAPI.js +6 -1
- package/dist/Manage/SalesAPI.js.map +1 -1
- package/dist/Manage/ScheduleAPI.d.ts +22 -1
- package/dist/Manage/ScheduleAPI.d.ts.map +1 -1
- package/dist/Manage/ScheduleAPI.js +6 -1
- package/dist/Manage/ScheduleAPI.js.map +1 -1
- package/dist/Manage/ServiceAPI.d.ts +75 -1
- package/dist/Manage/ServiceAPI.d.ts.map +1 -1
- package/dist/Manage/ServiceAPI.js +6 -1
- package/dist/Manage/ServiceAPI.js.map +1 -1
- package/dist/Manage/SystemAPI.d.ts +146 -1
- package/dist/Manage/SystemAPI.d.ts.map +1 -1
- package/dist/Manage/SystemAPI.js +6 -1
- package/dist/Manage/SystemAPI.js.map +1 -1
- package/dist/Manage/TimeAPI.d.ts +30 -1
- package/dist/Manage/TimeAPI.d.ts.map +1 -1
- package/dist/Manage/TimeAPI.js +6 -1
- package/dist/Manage/TimeAPI.js.map +1 -1
- package/dist/Manage.d.ts +5 -0
- package/dist/Manage.d.ts.map +1 -1
- package/dist/Manage.js +10 -0
- package/dist/Manage.js.map +1 -1
- package/dist/ManageAPI.d.ts +51 -15
- package/dist/ManageAPI.d.ts.map +1 -1
- package/dist/ManageAPI.js +27 -24
- package/dist/ManageAPI.js.map +1 -1
- package/dist/connectwise-rest.d.ts +108638 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/types.d.ts +4 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/Callback.d.ts +3 -0
- package/dist/utils/Callback.d.ts.map +1 -1
- package/dist/utils/Callback.js.map +1 -1
- package/dist/utils/Series.d.ts +6 -0
- package/dist/utils/Series.d.ts.map +1 -1
- package/dist/utils/Series.js +6 -2
- package/dist/utils/Series.js.map +1 -1
- package/package.json +5 -2
- package/src/Automate/AVTemplatePoliciesAPI.ts +11 -1
- package/src/Automate/ClientsAPI.ts +12 -1
- package/src/Automate/CommandsAPI.ts +7 -1
- package/src/Automate/ComputersAPI.ts +39 -1
- package/src/Automate/ContactsAPI.ts +8 -1
- package/src/Automate/DataViewsAPI.ts +8 -1
- package/src/Automate/DrivesAPI.ts +8 -1
- package/src/Automate/EventLogsAPI.ts +7 -1
- package/src/Automate/LocationsAPI.ts +17 -1
- package/src/Automate/MaintenanceWindowDefinitionsAPI.ts +7 -1
- package/src/Automate/MonitorsAPI.ts +8 -1
- package/src/Automate/NetworkDevicesAPI.ts +8 -1
- package/src/Automate/PatchingAPI.ts +8 -1
- package/src/Automate/RemoteAgentAPI.ts +8 -1
- package/src/Automate/ScriptingAPI.ts +11 -1
- package/src/Automate/SearchesAPI.ts +8 -1
- package/src/Automate/SystemAPI.ts +29 -3
- package/src/Automate/TicketsAPI.ts +6 -1
- package/src/Automate/UserProfilesAPI.ts +7 -1
- package/src/Automate.ts +0 -12
- package/src/AutomateAPI.ts +77 -43
- package/src/AutomateTypes.ts +1 -1
- package/src/BaseAPI.ts +97 -0
- package/src/Manage/CompanyAPI.ts +91 -1
- package/src/Manage/ConfigurationsAPI.ts +10 -1
- package/src/Manage/ExpenseAPI.ts +19 -1
- package/src/Manage/FinanceAPI.ts +80 -1
- package/src/Manage/MarketingAPI.ts +24 -1
- package/src/Manage/ProcurementAPI.ts +64 -1
- package/src/Manage/ProjectAPI.ts +38 -1
- package/src/Manage/SalesAPI.ts +47 -1
- package/src/Manage/ScheduleAPI.ts +23 -1
- package/src/Manage/ServiceAPI.ts +76 -1
- package/src/Manage/SystemAPI.ts +147 -1
- package/src/Manage/TimeAPI.ts +31 -1
- package/src/Manage.ts +10 -1
- package/src/ManageAPI.ts +66 -29
- package/src/index.ts +6 -11
- package/src/types.ts +4 -2
- package/src/utils/Callback.ts +3 -0
- package/src/utils/Series.ts +6 -0
- package/swagger-errors.md +25 -30
- package/test/test.ts +34 -5
- package/.github/workflows/codeql-analysis.yml +0 -70
- package/.github/workflows/node.js.yml +0 -42
- package/.travis.yml +0 -11
- package/generator/automate-generator.js +0 -75
- package/generator/automate-json.js +0 -61
- package/generator/automate-types.js +0 -15
- package/generator/generator.d.ts +0 -67
- package/generator/generator.js +0 -255
- package/generator/manage-generator.js +0 -71
- package/generator/manage-types.js +0 -14
|
@@ -5,13 +5,20 @@ import { CommonParameters, CWAOptions } from '../AutomateAPI'
|
|
|
5
5
|
import { NoContentResponse, OctetStreamResponse, PDFResponse, HTMLResponse } from '../types'
|
|
6
6
|
type schemas = components['schemas']
|
|
7
7
|
type requestBodies = components['requestBodies']
|
|
8
|
+
/** {@link LabTechModelsRemoteAgentSchedule} */
|
|
8
9
|
export type LabTechModelsRemoteAgentSchedule = schemas['LabTech.Models.RemoteAgentSchedule']
|
|
10
|
+
/** {@link LabTechModelsRemoteAgentTemplate} */
|
|
9
11
|
export type LabTechModelsRemoteAgentTemplate = schemas['LabTech.Models.RemoteAgentTemplate']
|
|
10
12
|
|
|
11
13
|
/**
|
|
14
|
+
* @module RemoteAgentAPI
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* RemoteAgent module
|
|
12
19
|
* @public
|
|
13
20
|
*/
|
|
14
|
-
export
|
|
21
|
+
export class RemoteAgentAPI extends Automate {
|
|
15
22
|
constructor(props: CWAOptions) {
|
|
16
23
|
super(props)
|
|
17
24
|
}
|
|
@@ -5,19 +5,29 @@ import { CommonParameters, CWAOptions } from '../AutomateAPI'
|
|
|
5
5
|
import { NoContentResponse, OctetStreamResponse, PDFResponse, HTMLResponse } from '../types'
|
|
6
6
|
type schemas = components['schemas']
|
|
7
7
|
type requestBodies = components['requestBodies']
|
|
8
|
+
/** {@link AutomateApiDomainContractsScriptsRunningScriptsRunningScript} */
|
|
8
9
|
export type AutomateApiDomainContractsScriptsRunningScriptsRunningScript =
|
|
9
10
|
schemas['Automate.Api.Domain.Contracts.Scripts.RunningScripts.RunningScript']
|
|
11
|
+
/** {@link AutomateApiDomainContractsScriptsScheduledScript} */
|
|
10
12
|
export type AutomateApiDomainContractsScriptsScheduledScript =
|
|
11
13
|
schemas['Automate.Api.Domain.Contracts.Scripts.ScheduledScript']
|
|
14
|
+
/** {@link LabTechModelsScript} */
|
|
12
15
|
export type LabTechModelsScript = schemas['LabTech.Models.Script']
|
|
16
|
+
/** {@link LabTechModelsScriptFolder} */
|
|
13
17
|
export type LabTechModelsScriptFolder = schemas['LabTech.Models.ScriptFolder']
|
|
18
|
+
/** {@link LabTechRESTApiModelsPatchOperationArray} */
|
|
14
19
|
export type LabTechRESTApiModelsPatchOperationArray =
|
|
15
20
|
requestBodies['LabTech.RESTApi.Models.PatchOperationArray']
|
|
16
21
|
|
|
17
22
|
/**
|
|
23
|
+
* @module ScriptingAPI
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Scripting module
|
|
18
28
|
* @public
|
|
19
29
|
*/
|
|
20
|
-
export
|
|
30
|
+
export class ScriptingAPI extends Automate {
|
|
21
31
|
constructor(props: CWAOptions) {
|
|
22
32
|
super(props)
|
|
23
33
|
}
|
|
@@ -5,13 +5,20 @@ import { CommonParameters, CWAOptions } from '../AutomateAPI'
|
|
|
5
5
|
import { NoContentResponse, OctetStreamResponse, PDFResponse, HTMLResponse } from '../types'
|
|
6
6
|
type schemas = components['schemas']
|
|
7
7
|
type requestBodies = components['requestBodies']
|
|
8
|
+
/** {@link LabTechModelsSearch} */
|
|
8
9
|
export type LabTechModelsSearch = schemas['LabTech.Models.Search']
|
|
10
|
+
/** {@link LabTechModelsSearchFolder} */
|
|
9
11
|
export type LabTechModelsSearchFolder = schemas['LabTech.Models.SearchFolder']
|
|
10
12
|
|
|
11
13
|
/**
|
|
14
|
+
* @module SearchesAPI
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Searches module
|
|
12
19
|
* @public
|
|
13
20
|
*/
|
|
14
|
-
export
|
|
21
|
+
export class SearchesAPI extends Automate {
|
|
15
22
|
constructor(props: CWAOptions) {
|
|
16
23
|
super(props)
|
|
17
24
|
}
|
|
@@ -5,58 +5,84 @@ import { CommonParameters, CWAOptions } from '../AutomateAPI'
|
|
|
5
5
|
import { NoContentResponse, OctetStreamResponse, PDFResponse, HTMLResponse } from '../types'
|
|
6
6
|
type schemas = components['schemas']
|
|
7
7
|
type requestBodies = components['requestBodies']
|
|
8
|
+
/** {@link AutomateApiDomainContractsPresentationLayerWebExtensionsUserClassWebExtensionRequest} */
|
|
8
9
|
export type AutomateApiDomainContractsPresentationLayerWebExtensionsUserClassWebExtensionRequest =
|
|
9
10
|
schemas['Automate.Api.Domain.Contracts.PresentationLayer.WebExtensions.UserClassWebExtensionRequest']
|
|
11
|
+
/** {@link AutomateApiDomainContractsPresentationLayerWebExtensionsUserClassWebExtensionViewModel} */
|
|
10
12
|
export type AutomateApiDomainContractsPresentationLayerWebExtensionsUserClassWebExtensionViewModel =
|
|
11
13
|
schemas['Automate.Api.Domain.Contracts.PresentationLayer.WebExtensions.UserClassWebExtensionViewModel']
|
|
14
|
+
/** {@link AutomateApiDomainContractsSecurityAuthInformation} */
|
|
12
15
|
export type AutomateApiDomainContractsSecurityAuthInformation =
|
|
13
16
|
schemas['Automate.Api.Domain.Contracts.Security.AuthInformation']
|
|
17
|
+
/** {@link AutomateApiDomainContractsSecurityTokenCredentials} */
|
|
14
18
|
export type AutomateApiDomainContractsSecurityTokenCredentials =
|
|
15
19
|
schemas['Automate.Api.Domain.Contracts.Security.TokenCredentials']
|
|
20
|
+
/** {@link AutomateApiDomainContractsSecurityTokenResult} */
|
|
16
21
|
export type AutomateApiDomainContractsSecurityTokenResult =
|
|
17
22
|
schemas['Automate.Api.Domain.Contracts.Security.TokenResult']
|
|
23
|
+
/** {@link AutomateApiDomainContractsSystemServerInformation} */
|
|
18
24
|
export type AutomateApiDomainContractsSystemServerInformation =
|
|
19
25
|
schemas['Automate.Api.Domain.Contracts.System.ServerInformation']
|
|
26
|
+
/** {@link AutomateApiDomainContractsUsersChangePasswordRequest} */
|
|
20
27
|
export type AutomateApiDomainContractsUsersChangePasswordRequest =
|
|
21
28
|
schemas['Automate.Api.Domain.Contracts.Users.ChangePasswordRequest']
|
|
29
|
+
/** {@link AutomateApiDomainContractsUsersUser} */
|
|
22
30
|
export type AutomateApiDomainContractsUsersUser =
|
|
23
31
|
schemas['Automate.Api.Domain.Contracts.Users.User']
|
|
32
|
+
/** {@link AutomateApiDomainContractsUsersUserAccess} */
|
|
24
33
|
export type AutomateApiDomainContractsUsersUserAccess =
|
|
25
34
|
schemas['Automate.Api.Domain.Contracts.Users.UserAccess']
|
|
35
|
+
/** {@link AutomateApiDomainContractsUsersUserClass} */
|
|
26
36
|
export type AutomateApiDomainContractsUsersUserClass =
|
|
27
37
|
schemas['Automate.Api.Domain.Contracts.Users.UserClass']
|
|
38
|
+
/** {@link AutomateApiDomainContractsUsersUserFolder} */
|
|
28
39
|
export type AutomateApiDomainContractsUsersUserFolder =
|
|
29
40
|
schemas['Automate.Api.Domain.Contracts.Users.UserFolder']
|
|
41
|
+
/** {@link LabTechModelsExternalSystemCredentials} */
|
|
30
42
|
export type LabTechModelsExternalSystemCredentials =
|
|
31
43
|
schemas['LabTech.Models.ExternalSystemCredentials']
|
|
44
|
+
/** {@link LabTechModelsFeatureFlag} */
|
|
32
45
|
export type LabTechModelsFeatureFlag = schemas['LabTech.Models.FeatureFlag']
|
|
46
|
+
/** {@link LabTechModelsLicensedProduct} */
|
|
33
47
|
export type LabTechModelsLicensedProduct = schemas['LabTech.Models.LicensedProduct']
|
|
48
|
+
/** {@link LabTechModelsLink} */
|
|
34
49
|
export type LabTechModelsLink = schemas['LabTech.Models.Link']
|
|
50
|
+
/** {@link LabTechModelsPatchInformation} */
|
|
35
51
|
export type LabTechModelsPatchInformation = schemas['LabTech.Models.PatchInformation']
|
|
52
|
+
/** {@link LabTechModelsUserAudit} */
|
|
36
53
|
export type LabTechModelsUserAudit = schemas['LabTech.Models.UserAudit']
|
|
54
|
+
/** {@link LabTechModelsUserFavorite} */
|
|
37
55
|
export type LabTechModelsUserFavorite = schemas['LabTech.Models.UserFavorite']
|
|
56
|
+
/** {@link LabTechModelsUserSetting} */
|
|
38
57
|
export type LabTechModelsUserSetting = schemas['LabTech.Models.UserSetting']
|
|
58
|
+
/** {@link LabTechRESTApiModelsPatchOperationArray} */
|
|
39
59
|
export type LabTechRESTApiModelsPatchOperationArray =
|
|
40
60
|
requestBodies['LabTech.RESTApi.Models.PatchOperationArray']
|
|
61
|
+
/** {@link LabTechRESTApiSecurityAuthServiceCredentials} */
|
|
41
62
|
export type LabTechRESTApiSecurityAuthServiceCredentials =
|
|
42
63
|
schemas['LabTech.RESTApi.Security.AuthServiceCredentials']
|
|
43
64
|
|
|
44
65
|
/**
|
|
66
|
+
* @module SystemAPI
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* System module
|
|
45
71
|
* @public
|
|
46
72
|
*/
|
|
47
|
-
export
|
|
73
|
+
export class SystemAPI extends Automate {
|
|
48
74
|
constructor(props: CWAOptions) {
|
|
49
75
|
super(props)
|
|
50
76
|
}
|
|
51
77
|
|
|
52
|
-
|
|
78
|
+
getAuthInformation(): Promise<AutomateApiDomainContractsSecurityAuthInformation> {
|
|
53
79
|
return this.request({
|
|
54
80
|
path: `/api/v1/APIToken`,
|
|
55
81
|
method: 'get',
|
|
56
82
|
})
|
|
57
83
|
}
|
|
58
84
|
|
|
59
|
-
|
|
85
|
+
postToken(
|
|
60
86
|
TokenCredentials: AutomateApiDomainContractsSecurityTokenCredentials,
|
|
61
87
|
): Promise<AutomateApiDomainContractsSecurityTokenResult> {
|
|
62
88
|
return this.request({
|
|
@@ -7,9 +7,14 @@ type schemas = components['schemas']
|
|
|
7
7
|
type requestBodies = components['requestBodies']
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
+
* @module TicketsAPI
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Tickets module
|
|
10
15
|
* @public
|
|
11
16
|
*/
|
|
12
|
-
export
|
|
17
|
+
export class TicketsAPI extends Automate {
|
|
13
18
|
constructor(props: CWAOptions) {
|
|
14
19
|
super(props)
|
|
15
20
|
}
|
|
@@ -5,13 +5,19 @@ import { CommonParameters, CWAOptions } from '../AutomateAPI'
|
|
|
5
5
|
import { NoContentResponse, OctetStreamResponse, PDFResponse, HTMLResponse } from '../types'
|
|
6
6
|
type schemas = components['schemas']
|
|
7
7
|
type requestBodies = components['requestBodies']
|
|
8
|
+
/** {@link LabTechRepositoriesMySQLDomainModelsPresentationLayerUserProfile} */
|
|
8
9
|
export type LabTechRepositoriesMySQLDomainModelsPresentationLayerUserProfile =
|
|
9
10
|
schemas['LabTech.Repositories.MySQL.Domain.Models.PresentationLayer.UserProfile']
|
|
10
11
|
|
|
11
12
|
/**
|
|
13
|
+
* @module UserProfilesAPI
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* UserProfiles module
|
|
12
18
|
* @public
|
|
13
19
|
*/
|
|
14
|
-
export
|
|
20
|
+
export class UserProfilesAPI extends Automate {
|
|
15
21
|
constructor(props: CWAOptions) {
|
|
16
22
|
super(props)
|
|
17
23
|
}
|
package/src/Automate.ts
CHANGED
|
@@ -140,18 +140,6 @@ export default class Automate {
|
|
|
140
140
|
return result.data
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
static async refreshToken({
|
|
144
|
-
username,
|
|
145
|
-
password,
|
|
146
|
-
serverUrl,
|
|
147
|
-
}: {
|
|
148
|
-
username: string
|
|
149
|
-
password: string
|
|
150
|
-
serverUrl: string
|
|
151
|
-
}) {
|
|
152
|
-
// @todo how
|
|
153
|
-
}
|
|
154
|
-
|
|
155
143
|
async verifyToken() {
|
|
156
144
|
try {
|
|
157
145
|
const result = await this.api({ path: '/api/v1/FeatureFlags', method: 'get' })
|
package/src/AutomateAPI.ts
CHANGED
|
@@ -1,46 +1,44 @@
|
|
|
1
1
|
import Automate from './Automate'
|
|
2
2
|
import { CWLogger, RetryOptions } from './types'
|
|
3
|
-
import AVTemplatePoliciesAPI from './Automate/AVTemplatePoliciesAPI'
|
|
4
|
-
import ClientsAPI from './Automate/ClientsAPI'
|
|
5
|
-
import CommandsAPI from './Automate/CommandsAPI'
|
|
6
|
-
import ComputersAPI from './Automate/ComputersAPI'
|
|
7
|
-
import ContactsAPI from './Automate/ContactsAPI'
|
|
8
|
-
import DataViewsAPI from './Automate/DataViewsAPI'
|
|
9
|
-
import DrivesAPI from './Automate/DrivesAPI'
|
|
10
|
-
import EventLogsAPI from './Automate/EventLogsAPI'
|
|
11
|
-
import LocationsAPI from './Automate/LocationsAPI'
|
|
12
|
-
import MaintenanceWindowDefinitionsAPI from './Automate/MaintenanceWindowDefinitionsAPI'
|
|
13
|
-
import MonitorsAPI from './Automate/MonitorsAPI'
|
|
14
|
-
import NetworkDevicesAPI from './Automate/NetworkDevicesAPI'
|
|
15
|
-
import PatchingAPI from './Automate/PatchingAPI'
|
|
16
|
-
import RemoteAgentAPI from './Automate/RemoteAgentAPI'
|
|
17
|
-
import ScriptingAPI from './Automate/ScriptingAPI'
|
|
18
|
-
import SearchesAPI from './Automate/SearchesAPI'
|
|
19
|
-
import SystemAPI from './Automate/SystemAPI'
|
|
20
|
-
import
|
|
21
|
-
import UserProfilesAPI from './Automate/UserProfilesAPI'
|
|
3
|
+
import { AVTemplatePoliciesAPI } from './Automate/AVTemplatePoliciesAPI'
|
|
4
|
+
import { ClientsAPI } from './Automate/ClientsAPI'
|
|
5
|
+
import { CommandsAPI } from './Automate/CommandsAPI'
|
|
6
|
+
import { ComputersAPI } from './Automate/ComputersAPI'
|
|
7
|
+
import { ContactsAPI } from './Automate/ContactsAPI'
|
|
8
|
+
import { DataViewsAPI } from './Automate/DataViewsAPI'
|
|
9
|
+
import { DrivesAPI } from './Automate/DrivesAPI'
|
|
10
|
+
import { EventLogsAPI } from './Automate/EventLogsAPI'
|
|
11
|
+
import { LocationsAPI } from './Automate/LocationsAPI'
|
|
12
|
+
import { MaintenanceWindowDefinitionsAPI } from './Automate/MaintenanceWindowDefinitionsAPI'
|
|
13
|
+
import { MonitorsAPI } from './Automate/MonitorsAPI'
|
|
14
|
+
import { NetworkDevicesAPI } from './Automate/NetworkDevicesAPI'
|
|
15
|
+
import { PatchingAPI } from './Automate/PatchingAPI'
|
|
16
|
+
import { RemoteAgentAPI } from './Automate/RemoteAgentAPI'
|
|
17
|
+
import { ScriptingAPI } from './Automate/ScriptingAPI'
|
|
18
|
+
import { SearchesAPI } from './Automate/SearchesAPI'
|
|
19
|
+
import { SystemAPI } from './Automate/SystemAPI'
|
|
20
|
+
import { TicketsAPI } from './Automate/TicketsAPI'
|
|
21
|
+
import { UserProfilesAPI } from './Automate/UserProfilesAPI'
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
UserProfilesAPI,
|
|
43
|
-
}
|
|
23
|
+
import type * as AVTemplatePoliciesAPITypes from './Automate/AVTemplatePoliciesAPI'
|
|
24
|
+
import type * as ClientsAPITypes from './Automate/ClientsAPI'
|
|
25
|
+
import type * as CommandsAPITypes from './Automate/CommandsAPI'
|
|
26
|
+
import type * as ComputersAPITypes from './Automate/ComputersAPI'
|
|
27
|
+
import type * as ContactsAPITypes from './Automate/ContactsAPI'
|
|
28
|
+
import type * as DataViewsAPITypes from './Automate/DataViewsAPI'
|
|
29
|
+
import type * as DrivesAPITypes from './Automate/DrivesAPI'
|
|
30
|
+
import type * as EventLogsAPITypes from './Automate/EventLogsAPI'
|
|
31
|
+
import type * as LocationsAPITypes from './Automate/LocationsAPI'
|
|
32
|
+
import type * as MaintenanceWindowDefinitionsAPITypes from './Automate/MaintenanceWindowDefinitionsAPI'
|
|
33
|
+
import type * as MonitorsAPITypes from './Automate/MonitorsAPI'
|
|
34
|
+
import type * as NetworkDevicesAPITypes from './Automate/NetworkDevicesAPI'
|
|
35
|
+
import type * as PatchingAPITypes from './Automate/PatchingAPI'
|
|
36
|
+
import type * as RemoteAgentAPITypes from './Automate/RemoteAgentAPI'
|
|
37
|
+
import type * as ScriptingAPITypes from './Automate/ScriptingAPI'
|
|
38
|
+
import type * as SearchesAPITypes from './Automate/SearchesAPI'
|
|
39
|
+
import type * as SystemAPITypes from './Automate/SystemAPI'
|
|
40
|
+
import type * as TicketsAPITypes from './Automate/TicketsAPI'
|
|
41
|
+
import type * as UserProfilesAPITypes from './Automate/UserProfilesAPI'
|
|
44
42
|
|
|
45
43
|
/**
|
|
46
44
|
* @public
|
|
@@ -59,6 +57,9 @@ export type CWAOptions = {
|
|
|
59
57
|
debug?: boolean
|
|
60
58
|
}
|
|
61
59
|
|
|
60
|
+
/**
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
62
63
|
export type OrderBy = {
|
|
63
64
|
name?: string
|
|
64
65
|
type?: 'Undefined' | 'Ascending' | 'Descending'
|
|
@@ -81,6 +82,9 @@ export type CommonParameters = {
|
|
|
81
82
|
timeout?: number
|
|
82
83
|
}
|
|
83
84
|
|
|
85
|
+
/**
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
84
88
|
export type QueryOptionExpand = {
|
|
85
89
|
fieldName?: string
|
|
86
90
|
page?: number
|
|
@@ -95,9 +99,13 @@ export type QueryOptionExpand = {
|
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
/**
|
|
102
|
+
* @module AutomateAPI
|
|
98
103
|
* @public
|
|
99
104
|
*/
|
|
100
|
-
|
|
105
|
+
class AutomateAPI extends Automate {
|
|
106
|
+
/**
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
101
109
|
AVTemplatePoliciesAPI: AVTemplatePoliciesAPI
|
|
102
110
|
ClientsAPI: ClientsAPI
|
|
103
111
|
CommandsAPI: CommandsAPI
|
|
@@ -115,7 +123,7 @@ export default class AutomateAPI extends Automate {
|
|
|
115
123
|
ScriptingAPI: ScriptingAPI
|
|
116
124
|
SearchesAPI: SearchesAPI
|
|
117
125
|
SystemAPI: SystemAPI
|
|
118
|
-
|
|
126
|
+
TicketsAPI: TicketsAPI
|
|
119
127
|
UserProfilesAPI: UserProfilesAPI
|
|
120
128
|
|
|
121
129
|
constructor(options: CWAOptions) {
|
|
@@ -138,7 +146,33 @@ export default class AutomateAPI extends Automate {
|
|
|
138
146
|
this.ScriptingAPI = new ScriptingAPI(options)
|
|
139
147
|
this.SearchesAPI = new SearchesAPI(options)
|
|
140
148
|
this.SystemAPI = new SystemAPI(options)
|
|
141
|
-
this.
|
|
149
|
+
this.TicketsAPI = new TicketsAPI(options)
|
|
142
150
|
this.UserProfilesAPI = new UserProfilesAPI(options)
|
|
143
151
|
}
|
|
144
152
|
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* @public
|
|
156
|
+
*/
|
|
157
|
+
export default AutomateAPI
|
|
158
|
+
export type {
|
|
159
|
+
AVTemplatePoliciesAPITypes,
|
|
160
|
+
ClientsAPITypes,
|
|
161
|
+
CommandsAPITypes,
|
|
162
|
+
ComputersAPITypes,
|
|
163
|
+
ContactsAPITypes,
|
|
164
|
+
DataViewsAPITypes,
|
|
165
|
+
DrivesAPITypes,
|
|
166
|
+
EventLogsAPITypes,
|
|
167
|
+
LocationsAPITypes,
|
|
168
|
+
MaintenanceWindowDefinitionsAPITypes,
|
|
169
|
+
MonitorsAPITypes,
|
|
170
|
+
NetworkDevicesAPITypes,
|
|
171
|
+
PatchingAPITypes,
|
|
172
|
+
RemoteAgentAPITypes,
|
|
173
|
+
ScriptingAPITypes,
|
|
174
|
+
SearchesAPITypes,
|
|
175
|
+
SystemAPITypes,
|
|
176
|
+
TicketsAPITypes,
|
|
177
|
+
UserProfilesAPITypes,
|
|
178
|
+
}
|
package/src/AutomateTypes.ts
CHANGED
package/src/BaseAPI.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { RequestOptions } from './types'
|
|
|
2
2
|
import promiseRetry from 'promise-retry'
|
|
3
3
|
import Manage, { ManageConfig } from './Manage'
|
|
4
4
|
import Automate, { AutomateConfig } from './Automate'
|
|
5
|
+
import { CommonParameters } from './AutomateAPI'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* curried request function
|
|
@@ -81,3 +82,99 @@ export const makeRequest =
|
|
|
81
82
|
})
|
|
82
83
|
}
|
|
83
84
|
}
|
|
85
|
+
|
|
86
|
+
export interface PaginationConfig {
|
|
87
|
+
thisObj: InstanceType<typeof Automate | typeof Manage>
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
91
|
+
export type PaginationApiMethod = Function
|
|
92
|
+
|
|
93
|
+
export type PaginationOptions = {
|
|
94
|
+
pageSize?: number
|
|
95
|
+
startPage?: number
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* curried paginate function
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
export const makePaginate =
|
|
103
|
+
({ thisObj }: PaginationConfig) =>
|
|
104
|
+
(
|
|
105
|
+
apiMethod: PaginationApiMethod,
|
|
106
|
+
paginateArgs: PaginationOptions = {},
|
|
107
|
+
...methodArgs: Record<string, unknown>[]
|
|
108
|
+
): Promise<unknown[]> => {
|
|
109
|
+
const { startPage = 0, pageSize = 1000 } = paginateArgs
|
|
110
|
+
|
|
111
|
+
return new Promise(async (resolve, reject) => {
|
|
112
|
+
let results: unknown[] = []
|
|
113
|
+
|
|
114
|
+
let page = startPage
|
|
115
|
+
|
|
116
|
+
if (startPage === undefined || startPage < 1) {
|
|
117
|
+
page = 0
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
while (true) {
|
|
121
|
+
try {
|
|
122
|
+
const result = await getPage(apiMethod, methodArgs, thisObj, page++, pageSize)
|
|
123
|
+
// complete page returned, loop again
|
|
124
|
+
if (Array.isArray(result) && result.length > 0) {
|
|
125
|
+
results = results.concat(result)
|
|
126
|
+
} else {
|
|
127
|
+
// incomplete page, this is the last page of results, exit loop and return
|
|
128
|
+
break
|
|
129
|
+
}
|
|
130
|
+
} catch (error: unknown) {
|
|
131
|
+
return reject(error)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return resolve(results)
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
function getPage(
|
|
143
|
+
apiMethod: PaginationApiMethod,
|
|
144
|
+
methodArgs: Record<string, unknown>[],
|
|
145
|
+
thisObj: InstanceType<typeof Automate | typeof Manage>,
|
|
146
|
+
page = 1,
|
|
147
|
+
pageSize = 1000,
|
|
148
|
+
): Promise<unknown[]> {
|
|
149
|
+
// Javascript Function.length returns number of non-default values
|
|
150
|
+
// the method args will always be greater than the api method args
|
|
151
|
+
// due to this, if params is not passed in, even as an empty object,
|
|
152
|
+
// we need to throw an error
|
|
153
|
+
if (methodArgs.length < apiMethod.length) {
|
|
154
|
+
throw new Error(
|
|
155
|
+
`CommonParams must be passed in for pagination to work properly for function ${apiMethod.name}`,
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// look for CommonParams and inject page and pageSize
|
|
160
|
+
// check for apiMethod function args length
|
|
161
|
+
// get last arg
|
|
162
|
+
const commonParams = <CommonParameters>methodArgs.pop()
|
|
163
|
+
commonParams.page = page
|
|
164
|
+
commonParams.pageSize = pageSize
|
|
165
|
+
|
|
166
|
+
methodArgs.push(commonParams)
|
|
167
|
+
|
|
168
|
+
return apiMethod.apply(thisObj, methodArgs)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
174
|
+
function isCommonParametersLike(input: unknown): input is CommonParameters {
|
|
175
|
+
if (typeof input === 'object' && input !== null) {
|
|
176
|
+
return true
|
|
177
|
+
} else {
|
|
178
|
+
return false
|
|
179
|
+
}
|
|
180
|
+
}
|