addigy 2.8.2 → 2.10.0

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 (66) hide show
  1. package/README.md +5 -5
  2. package/index.d.ts +29 -80
  3. package/index.js +50 -1153
  4. package/lib/addigy.constants.d.ts +6 -0
  5. package/lib/addigy.constants.js +10 -0
  6. package/lib/addigy.d.ts +44 -0
  7. package/lib/addigy.js +63 -0
  8. package/lib/addigy.utils.d.ts +6 -0
  9. package/lib/addigy.utils.js +12 -0
  10. package/lib/alerts/alert.types.d.ts +5 -0
  11. package/lib/alerts/alert.types.js +9 -0
  12. package/lib/alerts/alerts.d.ts +7 -0
  13. package/lib/alerts/alerts.js +22 -0
  14. package/lib/applications/applications.d.ts +6 -0
  15. package/lib/applications/applications.js +18 -0
  16. package/lib/auth/auth.d.ts +9 -0
  17. package/lib/auth/auth.js +75 -0
  18. package/lib/auth/auth.types.d.ts +5 -0
  19. package/lib/billing/billing.d.ts +5 -0
  20. package/lib/billing/billing.js +36 -0
  21. package/lib/certs/certs.d.ts +5 -0
  22. package/lib/certs/certs.js +43 -0
  23. package/lib/commands/commands.d.ts +7 -0
  24. package/lib/commands/commands.js +31 -0
  25. package/lib/devices/devices.d.ts +11 -0
  26. package/lib/devices/devices.js +55 -0
  27. package/lib/facts/facts.d.ts +8 -0
  28. package/lib/facts/facts.js +66 -0
  29. package/lib/facts/facts.types.d.ts +22 -0
  30. package/lib/facts/facts.types.js +2 -0
  31. package/lib/files/files.d.ts +10 -0
  32. package/lib/files/files.js +63 -0
  33. package/lib/files/files.types.d.ts +26 -0
  34. package/lib/files/files.types.js +2 -0
  35. package/lib/integrations/integrations.d.ts +8 -0
  36. package/lib/integrations/integrations.js +63 -0
  37. package/lib/maintenance/maintenance.d.ts +6 -0
  38. package/lib/maintenance/maintenance.js +18 -0
  39. package/lib/mdm/mdm-configurations.d.ts +7 -0
  40. package/lib/mdm/mdm-configurations.js +41 -0
  41. package/lib/mdm/mdm-policies.d.ts +20 -0
  42. package/lib/mdm/mdm-policies.js +347 -0
  43. package/lib/mdm/mdm-profiles.d.ts +8 -0
  44. package/lib/mdm/mdm-profiles.js +74 -0
  45. package/{types.d.ts → lib/mdm/mdm.types.d.ts} +90 -180
  46. package/lib/mdm/mdm.types.js +2 -0
  47. package/lib/policies/policies.d.ts +11 -0
  48. package/lib/policies/policies.js +78 -0
  49. package/lib/profiles/profiles.d.ts +9 -0
  50. package/lib/profiles/profiles.js +59 -0
  51. package/lib/profiles/profiles.types.d.ts +20 -0
  52. package/lib/profiles/profiles.types.js +2 -0
  53. package/lib/screenconnect/screenconnect.d.ts +5 -0
  54. package/lib/screenconnect/screenconnect.js +39 -0
  55. package/lib/software/software.d.ts +13 -0
  56. package/lib/software/software.js +73 -0
  57. package/lib/software/software.types.d.ts +101 -0
  58. package/lib/software/software.types.js +2 -0
  59. package/lib/types.d.ts +20 -0
  60. package/lib/types.js +2 -0
  61. package/lib/users/user.types.d.ts +5 -0
  62. package/lib/users/user.types.js +9 -0
  63. package/lib/users/users.d.ts +9 -0
  64. package/lib/users/users.js +104 -0
  65. package/package.json +13 -14
  66. /package/{types.js → lib/auth/auth.types.js} +0 -0
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MdmProfiles = void 0;
7
+ const uuid_1 = require("uuid");
8
+ const plist_1 = __importDefault(require("@expo/plist"));
9
+ const axios_1 = __importDefault(require("axios"));
10
+ const addigy_constants_1 = require("../addigy.constants");
11
+ const addigy_utils_1 = require("../addigy.utils");
12
+ class MdmProfiles {
13
+ constructor() {
14
+ this.http = axios_1.default.create({
15
+ baseURL: `${addigy_constants_1.Urls.appProd}/api/mdm/user/profiles/configurations`,
16
+ ...(0, addigy_utils_1.getAxiosHttpAgents)(),
17
+ headers: { origin: addigy_constants_1.Urls.appProd },
18
+ });
19
+ }
20
+ async createCustomProfile(authObject, name, customProfileText, supportedOsVersions, payloadScope = 'System', is_profile_signed = false) {
21
+ const groupUUID = (0, uuid_1.v4)();
22
+ const customProfileJson = plist_1.default.parse(customProfileText);
23
+ const updateCustomProfileJson = Object.entries(customProfileJson).reduce((acc, [key, value]) => {
24
+ acc[this.toSnakeCase(key)] = value;
25
+ return acc;
26
+ }, {});
27
+ const customProfileBase64 = Buffer.from(customProfileText).toString('base64');
28
+ const payload = {
29
+ addigy_payload_type: 'com.addigy.custom.mdm.payload',
30
+ payload_type: 'custom',
31
+ payload_version: 1,
32
+ payload_identifier: `com.addigy.custom.mdm.payload.${groupUUID}`,
33
+ payload_uuid: `custom-profile-${(0, uuid_1.v4)()}`,
34
+ payload_group_id: groupUUID,
35
+ payload_display_name: name,
36
+ is_profile_signed,
37
+ profile_json_data: updateCustomProfileJson,
38
+ decoded_profile_content: customProfileText,
39
+ custom_profile_content: customProfileBase64,
40
+ supported_os_versions: supportedOsVersions,
41
+ payload_scope: payloadScope,
42
+ };
43
+ try {
44
+ let res = await this.http.post('/', { payloads: [payload] }, {
45
+ headers: {
46
+ Cookie: `auth_token=${authObject.authToken};`,
47
+ },
48
+ });
49
+ return res.data;
50
+ }
51
+ catch (err) {
52
+ throw err;
53
+ }
54
+ }
55
+ async createMdmProfile(authObject, mdmProfile) {
56
+ try {
57
+ let res = await this.http.post('/', { payloads: mdmProfile }, {
58
+ headers: {
59
+ Cookie: `auth_token=${authObject.authToken};`,
60
+ },
61
+ });
62
+ return res.data;
63
+ }
64
+ catch (err) {
65
+ throw err;
66
+ }
67
+ }
68
+ toSnakeCase(text) {
69
+ return text
70
+ .replace(/([^\p{L}\d]+|(?<=\p{L})(?=\d)|(?<=\d)(?=\p{L})|(?<=[\p{Ll}\d])(?=\p{Lu})|(?<=\p{Lu})(?=\p{Lu}\p{Ll})|(?<=[\p{L}\d])(?=\p{Lu}\p{Ll}))/gu, '_')
71
+ .toLowerCase();
72
+ }
73
+ }
74
+ exports.MdmProfiles = MdmProfiles;
@@ -1,22 +1,32 @@
1
- export interface IAddigyConfig {
2
- clientId: string;
3
- clientSecret: string;
4
- adminUsername?: string;
5
- adminPassword?: string;
6
- }
7
- export interface IAddigyInternalAuthObject {
8
- orgId: string;
9
- authToken: string;
10
- emailAddress: string;
1
+ import { Payload, SupportedOsVersions } from '../types';
2
+ export interface CreateWebContentFilterPayload {
3
+ user_defined_name: string;
4
+ plugin_bundle_id: string;
5
+ filter_grade: 'firewall' | 'inspector';
6
+ vendor_config?: Record<string, string>;
7
+ content_filter_uuid?: string;
8
+ server_address?: string;
9
+ organization?: string;
10
+ user_name?: string;
11
+ password?: string;
12
+ filter_browsers?: boolean;
13
+ filter_sockets?: boolean;
14
+ filter_data_provider_bundle_identifier?: string;
15
+ filter_data_provider_designated_requirement?: string;
16
+ filter_packets?: boolean;
17
+ filter_packet_provider_bundle_identifier?: string;
18
+ filter_packet_provider_designated_requirement?: string;
19
+ auto_filter_enabled?: null;
20
+ permitted_urls?: string[];
21
+ blacklisted_urls?: string[];
22
+ white_listed_bookmarks?: string[];
23
+ policy_restricted?: boolean;
24
+ requires_device_supervision?: boolean;
25
+ requires_mdm_profile_approved?: boolean;
11
26
  }
12
- export interface Payload {
13
- addigy_payload_type: 'com.addigy.syspolicy.system-extension-policy.com.apple.system-extension-policy' | 'com.addigy.TCC.configuration-profile-policy.com.apple.TCC.configuration-profile-policy' | 'com.addigy.syspolicy.kernel-extension-policy.com.apple.syspolicy.kernel-extension-policy' | 'com.addigy.notifications.com.apple.notificationsettings' | 'com.addigy.custom.mdm.payload' | 'com.addigy.securityAndPrivacy.com.apple.MCX.FileVault2' | 'com.addigy.securityAndPrivacy.com.apple.MCX' | 'com.addigy.securityAndPrivacy.com.apple.security.pkcs1' | 'com.addigy.securityAndPrivacy.com.apple.security.FDERecoveryKeyEscrow' | 'com.addigy.securityAndPrivacy.com.apple.security.FDERecoveryRedirect' | 'com.addigy.servicemanagement.com.apple.servicemanagement' | 'com.addigy.webcontent-filter.com.apple.webcontent-filter';
14
- payload_type: 'com.apple.system-extension-policy' | 'com.apple.syspolicy.kernel-extension-policy' | 'com.apple.TCC.configuration-profile-policy' | 'com.apple.notificationsettings' | 'custom' | 'com.apple.MCX.FileVault2' | 'com.apple.MCX' | 'com.apple.security.pkcs1' | 'com.apple.security.FDERecoveryKeyEscrow' | 'com.apple.security.FDERecoveryRedirect' | 'com.apple.servicemanagement' | 'com.apple.webcontent-filter';
15
- payload_version: number;
16
- payload_identifier: string;
17
- payload_uuid: string;
18
- payload_group_id: string;
19
- payload_display_name: string;
27
+ export interface Extension {
28
+ teamIdentifier: string;
29
+ bundleIdentifiers: string[];
20
30
  }
21
31
  export interface SystemExtensionPayload extends Payload {
22
32
  payload_enabled: boolean;
@@ -25,7 +35,7 @@ export interface SystemExtensionPayload extends Payload {
25
35
  allowed_team_identifiers: string[];
26
36
  allow_user_overrides: boolean;
27
37
  }
28
- export interface KernalExtensionPayload extends Payload {
38
+ export interface KernelExtensionPayload extends Payload {
29
39
  payload_enabled: boolean;
30
40
  allow_user_overrides: boolean;
31
41
  allowed_kernel_extensions: any;
@@ -84,6 +94,67 @@ export interface PPPCServiceInput {
84
94
  staticCode?: boolean;
85
95
  identifierType: 'bundleID' | 'path';
86
96
  }
97
+ export interface WebContentFilterPayload extends Payload {
98
+ addigy_payload_version: number;
99
+ auto_filter_enabled: null | boolean;
100
+ blacklisted_urls: null | string[];
101
+ content_filter_uuid: null | string;
102
+ filter_browsers: null | boolean;
103
+ filter_data_provider_bundle_identifier: string | null;
104
+ filter_data_provider_designated_requirement: string | null;
105
+ filter_grade: 'firewall' | 'inspector';
106
+ filter_packet_provider_bundle_identifier: null | string;
107
+ filter_packet_provider_designated_requirement: null | string;
108
+ filter_packets: null | boolean;
109
+ filter_sockets: boolean;
110
+ filter_type: string;
111
+ has_manifest: boolean;
112
+ organization: null | string;
113
+ password: null | string;
114
+ payload_enabled: boolean;
115
+ payload_priority: number;
116
+ permitted_urls: null | string[];
117
+ plugin_bundle_id: string | null;
118
+ policy_restricted: boolean;
119
+ requires_device_supervision: boolean;
120
+ requires_mdm_profile_approved: boolean;
121
+ server_address: null | string;
122
+ supported_os_versions: null | SupportedOsVersions;
123
+ user_defined_name: string;
124
+ user_name: null | string;
125
+ vendor_config: Record<string, string> | null;
126
+ white_listed_bookmarks: null | string[];
127
+ }
128
+ export interface ServiceManagementPayload extends Payload {
129
+ addigy_payload_version: number;
130
+ has_manifest: boolean;
131
+ payload_enabled: boolean;
132
+ payload_priority: number;
133
+ policy_restricted: boolean;
134
+ requires_device_supervision: boolean;
135
+ requires_mdm_profile_approved: boolean;
136
+ rules: ServiceManagementPayloadRule[];
137
+ supported_os_versions: SupportedOsVersions | null;
138
+ }
139
+ export interface ServiceManagementPayloadRule {
140
+ comment: string;
141
+ rule_type: string;
142
+ rule_value: string;
143
+ }
144
+ export interface NotificationSettings {
145
+ bundle_identifier: string;
146
+ notifications_enabled: boolean;
147
+ show_in_lock_screen: boolean;
148
+ show_in_notification_center: boolean;
149
+ sounds_enabled: boolean;
150
+ badges_enabled: boolean;
151
+ critical_alert_enabled: boolean;
152
+ preview_type?: any;
153
+ alert_type?: any;
154
+ }
155
+ export interface NotificationSettingsPayload extends Payload {
156
+ notification_settings: NotificationSettings[];
157
+ }
87
158
  export interface PPPCScreenCaptureServiceInput {
88
159
  service: 'microphone' | 'camera';
89
160
  allowed: false;
@@ -105,95 +176,6 @@ export interface PPPCAppleEventServiceInput {
105
176
  aeReceiverIdentifierType: 'bundleID' | 'path';
106
177
  aeReceiverCodeRequirement: string;
107
178
  }
108
- export interface Extension {
109
- teamIdentifier: string;
110
- bundleIdentifiers: string[];
111
- }
112
- export interface NotificationSettings {
113
- bundle_identifier: string;
114
- notifications_enabled: boolean;
115
- show_in_lock_screen: boolean;
116
- show_in_notification_center: boolean;
117
- sounds_enabled: boolean;
118
- badges_enabled: boolean;
119
- critical_alert_enabled: boolean;
120
- preview_type?: any;
121
- alert_type?: any;
122
- }
123
- export interface NotificationSettingsPayload extends Payload {
124
- notification_settings: NotificationSettings[];
125
- }
126
- export interface CustomProfilePayload extends Payload {
127
- is_profile_signed: boolean;
128
- custom_profile_content: string;
129
- decoded_profile_content: string;
130
- supported_os_versions: SupportedOsVersions;
131
- payload_scope: 'System' | 'User';
132
- profile_json_data: CustomProfileJSONData[];
133
- }
134
- export interface CustomProfileJSONData {
135
- payload_identifier: string;
136
- payload_removal_disallowed: boolean;
137
- payload_scope: string;
138
- payload_type: string;
139
- payload_uuid: string;
140
- payload_organization: string;
141
- payload_version: number;
142
- payload_display_name: string;
143
- payload_content: any[];
144
- }
145
- export interface SupportedOsVersions {
146
- macOS?: string;
147
- iOS?: string;
148
- tvOS?: string;
149
- }
150
- export interface FilevaultPayload extends Payload {
151
- enable?: 'On' | 'Off';
152
- defer?: boolean;
153
- use_recovery_key?: boolean;
154
- show_recovery_key?: boolean | null;
155
- defer_dont_ask_at_user_logout?: boolean | null;
156
- defer_force_at_user_login_max_bypass_attempts?: number | null;
157
- addigy_payload_version?: number;
158
- destroy_fv_key_on_standby?: boolean | null;
159
- dont_allow_fde_disable?: boolean;
160
- is_from_security_profile?: boolean;
161
- encrypt_cert_payload_uuid?: string;
162
- location?: string;
163
- payload_priority?: number;
164
- redirect_url?: string;
165
- }
166
- export interface FilevaultRequest {
167
- enable?: boolean;
168
- defer?: boolean;
169
- showRecoveryKey?: boolean;
170
- destroyFvKeyOnStandby?: boolean;
171
- escrowRecoveryKey?: boolean;
172
- deferDontAskAtUserLogout?: boolean;
173
- deferForceAtUserLoginMaxBypassAttempts?: -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
174
- }
175
- export interface CustomFact {
176
- organization_id: string;
177
- name: string;
178
- return_type: string;
179
- identifier: string;
180
- version: number;
181
- os_architectures: CustomFactOSArchitectures;
182
- notes: string;
183
- provider: string;
184
- source: string;
185
- }
186
- export interface CustomFactOSArchitectures {
187
- linux_arm: CustomFactOSArchitecturesData;
188
- darwin_amd64: CustomFactOSArchitecturesData;
189
- }
190
- export interface CustomFactOSArchitecturesData {
191
- language: string;
192
- is_supported: boolean;
193
- shebang: string;
194
- script: string;
195
- md5_hash: string;
196
- }
197
179
  export interface MdmConfigurations {
198
180
  payloads: Payload[];
199
181
  staged_payloads: any[];
@@ -218,75 +200,3 @@ export interface PoliciesMdmPayload {
218
200
  configuration_id: string;
219
201
  policy_id: string;
220
202
  }
221
- export interface ServiceManagementPayload extends Payload {
222
- addigy_payload_version: number;
223
- has_manifest: boolean;
224
- payload_enabled: boolean;
225
- payload_priority: number;
226
- policy_restricted: boolean;
227
- requires_device_supervision: boolean;
228
- requires_mdm_profile_approved: boolean;
229
- rules: ServiceManagementPayloadRule[];
230
- supported_os_versions: SupportedOsVersions | null;
231
- }
232
- export interface ServiceManagementPayloadRule {
233
- comment: string;
234
- rule_type: string;
235
- rule_value: string;
236
- }
237
- export interface WebContentFilterPayload extends Payload {
238
- addigy_payload_version: number;
239
- auto_filter_enabled: null | boolean;
240
- blacklisted_urls: null | string[];
241
- content_filter_uuid: null | string;
242
- filter_browsers: null | boolean;
243
- filter_data_provider_bundle_identifier: string | null;
244
- filter_data_provider_designated_requirement: string | null;
245
- filter_grade: 'firewall' | 'inspector';
246
- filter_packet_provider_bundle_identifier: null | string;
247
- filter_packet_provider_designated_requirement: null | string;
248
- filter_packets: null | boolean;
249
- filter_sockets: boolean;
250
- filter_type: string;
251
- has_manifest: boolean;
252
- organization: null | string;
253
- password: null | string;
254
- payload_enabled: boolean;
255
- payload_priority: number;
256
- permitted_urls: null | string[];
257
- plugin_bundle_id: string | null;
258
- policy_restricted: boolean;
259
- requires_device_supervision: boolean;
260
- requires_mdm_profile_approved: boolean;
261
- server_address: null | string;
262
- supported_os_versions: null | SupportedOsVersions;
263
- user_defined_name: string;
264
- user_name: null | string;
265
- vendor_config: Record<string, string> | null;
266
- white_listed_bookmarks: null | string[];
267
- }
268
- export interface CreateWebContentFilterPayload {
269
- user_defined_name: string;
270
- plugin_bundle_id: string;
271
- filter_grade: 'firewall' | 'inspector';
272
- vendor_config?: Record<string, string>;
273
- content_filter_uuid?: string;
274
- server_address?: string;
275
- organization?: string;
276
- user_name?: string;
277
- password?: string;
278
- filter_browsers?: boolean;
279
- filter_sockets?: boolean;
280
- filter_data_provider_bundle_identifier?: string;
281
- filter_data_provider_designated_requirement?: string;
282
- filter_packets?: boolean;
283
- filter_packet_provider_bundle_identifier?: string;
284
- filter_packet_provider_designated_requirement?: string;
285
- auto_filter_enabled?: null;
286
- permitted_urls?: string[];
287
- blacklisted_urls?: string[];
288
- white_listed_bookmarks?: string[];
289
- policy_restricted?: boolean;
290
- requires_device_supervision?: boolean;
291
- requires_mdm_profile_approved?: boolean;
292
- }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { AxiosInstance } from 'axios';
2
+ export declare class Policies {
3
+ private readonly http;
4
+ constructor(http: AxiosInstance);
5
+ getPolicies(): Promise<object[]>;
6
+ getPolicyInstructions(policyId: string, provider?: string): Promise<object[]>;
7
+ createPolicyInstructions(policyId: string, instructionId: string): Promise<object[]>;
8
+ deletePolicyInstructions(policyId: string, instructionId: string, provider?: string): Promise<object[]>;
9
+ getPolicyDetails(policyId: string, provider?: string): Promise<object[]>;
10
+ createPolicy(name: string, parentId?: string, icon?: string, color?: string): Promise<object[]>;
11
+ }
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Policies = void 0;
4
+ class Policies {
5
+ constructor(http) {
6
+ this.http = http;
7
+ }
8
+ async getPolicies() {
9
+ try {
10
+ let res = await this.http.get(`policies`);
11
+ return res.data;
12
+ }
13
+ catch (err) {
14
+ throw err;
15
+ }
16
+ }
17
+ async getPolicyInstructions(policyId, provider = 'ansible-profile') {
18
+ try {
19
+ let res = await this.http.get(`policies/instructions?provider=${provider}&policy_id=${policyId}`);
20
+ return res.data;
21
+ }
22
+ catch (err) {
23
+ throw err;
24
+ }
25
+ }
26
+ async createPolicyInstructions(policyId, instructionId) {
27
+ try {
28
+ let res = await this.http.post(`policies/instructions`, {
29
+ instruction_id: instructionId,
30
+ policy_id: policyId,
31
+ });
32
+ return res.data;
33
+ }
34
+ catch (err) {
35
+ throw err;
36
+ }
37
+ }
38
+ async deletePolicyInstructions(policyId, instructionId, provider = 'ansible-profile') {
39
+ try {
40
+ let res = await this.http.delete(`policies/instructions?policy_id=${policyId}&instruction_id=${instructionId}&provider=${provider}`);
41
+ return res.data;
42
+ }
43
+ catch (err) {
44
+ throw err;
45
+ }
46
+ }
47
+ async getPolicyDetails(policyId, provider = 'ansible-profile') {
48
+ try {
49
+ let res = await this.http.get(`policies/details?provider=${provider}&policy_id=${policyId}`);
50
+ return res.data;
51
+ }
52
+ catch (err) {
53
+ throw err;
54
+ }
55
+ }
56
+ async createPolicy(name, parentId, icon, color) {
57
+ let postBody = {
58
+ name: name,
59
+ };
60
+ if (icon !== undefined) {
61
+ postBody['icon'] = icon;
62
+ }
63
+ if (color !== undefined) {
64
+ postBody['color'] = color;
65
+ }
66
+ if (parentId !== undefined) {
67
+ postBody['parent_id'] = parentId;
68
+ }
69
+ try {
70
+ let res = await this.http.post(`policies`, postBody);
71
+ return res.data;
72
+ }
73
+ catch (err) {
74
+ throw err;
75
+ }
76
+ }
77
+ }
78
+ exports.Policies = Policies;
@@ -0,0 +1,9 @@
1
+ import { AxiosInstance } from 'axios';
2
+ export declare class Profiles {
3
+ private readonly http;
4
+ constructor(http: AxiosInstance);
5
+ getProfiles(instructionId?: string): Promise<object[]>;
6
+ createProfile(name: string, payloads: object[]): Promise<object[]>;
7
+ updateProfile(instructionId: string, payloads: object[]): Promise<object[]>;
8
+ deleteProfile(instructionId: string): Promise<object[]>;
9
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Profiles = void 0;
4
+ class Profiles {
5
+ constructor(http) {
6
+ this.http = http;
7
+ }
8
+ async getProfiles(instructionId) {
9
+ let instructionUri = '';
10
+ if (instructionId !== undefined) {
11
+ instructionUri = `?instruction_id=${instructionId}`;
12
+ }
13
+ try {
14
+ let res = await this.http.get(`profiles` + instructionUri);
15
+ return res.data;
16
+ }
17
+ catch (err) {
18
+ throw err;
19
+ }
20
+ }
21
+ async createProfile(name, payloads) {
22
+ let postBody = {
23
+ name: name,
24
+ payloads: payloads,
25
+ };
26
+ try {
27
+ let res = await this.http.post(`profiles`, postBody);
28
+ return res.data;
29
+ }
30
+ catch (err) {
31
+ throw err;
32
+ }
33
+ }
34
+ async updateProfile(instructionId, payloads) {
35
+ let postBody = {
36
+ instruction_id: instructionId,
37
+ payloads: payloads,
38
+ };
39
+ try {
40
+ let res = await this.http.put(`profiles`, postBody);
41
+ return res.data;
42
+ }
43
+ catch (err) {
44
+ throw err;
45
+ }
46
+ }
47
+ async deleteProfile(instructionId) {
48
+ try {
49
+ let res = await this.http.delete(`profiles`, {
50
+ params: { instruction_id: instructionId },
51
+ });
52
+ return res.data;
53
+ }
54
+ catch (err) {
55
+ throw err;
56
+ }
57
+ }
58
+ }
59
+ exports.Profiles = Profiles;
@@ -0,0 +1,20 @@
1
+ import { Payload, SupportedOsVersions } from '../types';
2
+ export interface CustomProfilePayload extends Payload {
3
+ is_profile_signed: boolean;
4
+ custom_profile_content: string;
5
+ decoded_profile_content: string;
6
+ supported_os_versions: SupportedOsVersions;
7
+ payload_scope: 'System' | 'User';
8
+ profile_json_data: CustomProfileJSONData[];
9
+ }
10
+ export interface CustomProfileJSONData {
11
+ payload_identifier: string;
12
+ payload_removal_disallowed: boolean;
13
+ payload_scope: string;
14
+ payload_type: string;
15
+ payload_uuid: string;
16
+ payload_organization: string;
17
+ payload_version: number;
18
+ payload_display_name: string;
19
+ payload_content: any[];
20
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import { IAddigyInternalAuthObject } from '../auth/auth.types';
2
+ export declare class ScreenConnect {
3
+ private readonly http;
4
+ getScreenconnectLinks(authObject: IAddigyInternalAuthObject, sessionId: string, agentId?: string): Promise<object[]>;
5
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ScreenConnect = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const addigy_constants_1 = require("../addigy.constants");
9
+ const addigy_utils_1 = require("../addigy.utils");
10
+ class ScreenConnect {
11
+ constructor() {
12
+ this.http = axios_1.default.create({
13
+ baseURL: `${addigy_constants_1.Urls.appProd}/api/devices/screenconnect`,
14
+ ...(0, addigy_utils_1.getAxiosHttpAgents)(),
15
+ headers: { origin: addigy_constants_1.Urls.appProd },
16
+ });
17
+ }
18
+ async getScreenconnectLinks(authObject, sessionId, agentId) {
19
+ agentId = agentId ? agentId : sessionId;
20
+ let postBody = {
21
+ sessionId: sessionId,
22
+ agentid: agentId,
23
+ };
24
+ try {
25
+ let res = await this.http.post('links', postBody, {
26
+ headers: {
27
+ Cookie: `auth_token=${authObject.authToken};`,
28
+ email: authObject.emailAddress,
29
+ orgid: authObject.orgId,
30
+ },
31
+ });
32
+ return res.data;
33
+ }
34
+ catch (err) {
35
+ throw err;
36
+ }
37
+ }
38
+ }
39
+ exports.ScreenConnect = ScreenConnect;
@@ -0,0 +1,13 @@
1
+ import { AxiosInstance } from 'axios';
2
+ import { IAddigyInternalAuthObject } from '../auth/auth.types';
3
+ import { CreateSoftware } from './software.types';
4
+ export declare class Software {
5
+ private readonly http;
6
+ constructor(http: AxiosInstance);
7
+ getPublicSoftware(): Promise<object[]>;
8
+ getCustomSoftware(): Promise<object[]>;
9
+ getCustomSoftwareAllVersions(softwareId: string): Promise<object[]>;
10
+ getCustomSoftwareSpecificVersion(instructionId: string): Promise<object[]>;
11
+ createCustomSoftware(baseIdentifier: string, version: string, downloads: string[], installationScript: string, condition: string, removeScript: string, priority?: number): Promise<object[]>;
12
+ createSoftwareInternal(authObject: IAddigyInternalAuthObject, software: CreateSoftware): Promise<Software>;
13
+ }