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.
- package/README.md +5 -5
- package/index.d.ts +29 -80
- package/index.js +50 -1153
- package/lib/addigy.constants.d.ts +6 -0
- package/lib/addigy.constants.js +10 -0
- package/lib/addigy.d.ts +44 -0
- package/lib/addigy.js +63 -0
- package/lib/addigy.utils.d.ts +6 -0
- package/lib/addigy.utils.js +12 -0
- package/lib/alerts/alert.types.d.ts +5 -0
- package/lib/alerts/alert.types.js +9 -0
- package/lib/alerts/alerts.d.ts +7 -0
- package/lib/alerts/alerts.js +22 -0
- package/lib/applications/applications.d.ts +6 -0
- package/lib/applications/applications.js +18 -0
- package/lib/auth/auth.d.ts +9 -0
- package/lib/auth/auth.js +75 -0
- package/lib/auth/auth.types.d.ts +5 -0
- package/lib/billing/billing.d.ts +5 -0
- package/lib/billing/billing.js +36 -0
- package/lib/certs/certs.d.ts +5 -0
- package/lib/certs/certs.js +43 -0
- package/lib/commands/commands.d.ts +7 -0
- package/lib/commands/commands.js +31 -0
- package/lib/devices/devices.d.ts +11 -0
- package/lib/devices/devices.js +55 -0
- package/lib/facts/facts.d.ts +8 -0
- package/lib/facts/facts.js +66 -0
- package/lib/facts/facts.types.d.ts +22 -0
- package/lib/facts/facts.types.js +2 -0
- package/lib/files/files.d.ts +10 -0
- package/lib/files/files.js +63 -0
- package/lib/files/files.types.d.ts +26 -0
- package/lib/files/files.types.js +2 -0
- package/lib/integrations/integrations.d.ts +8 -0
- package/lib/integrations/integrations.js +63 -0
- package/lib/maintenance/maintenance.d.ts +6 -0
- package/lib/maintenance/maintenance.js +18 -0
- package/lib/mdm/mdm-configurations.d.ts +7 -0
- package/lib/mdm/mdm-configurations.js +41 -0
- package/lib/mdm/mdm-policies.d.ts +20 -0
- package/lib/mdm/mdm-policies.js +347 -0
- package/lib/mdm/mdm-profiles.d.ts +8 -0
- package/lib/mdm/mdm-profiles.js +74 -0
- package/{types.d.ts → lib/mdm/mdm.types.d.ts} +90 -180
- package/lib/mdm/mdm.types.js +2 -0
- package/lib/policies/policies.d.ts +11 -0
- package/lib/policies/policies.js +78 -0
- package/lib/profiles/profiles.d.ts +9 -0
- package/lib/profiles/profiles.js +59 -0
- package/lib/profiles/profiles.types.d.ts +20 -0
- package/lib/profiles/profiles.types.js +2 -0
- package/lib/screenconnect/screenconnect.d.ts +5 -0
- package/lib/screenconnect/screenconnect.js +39 -0
- package/lib/software/software.d.ts +13 -0
- package/lib/software/software.js +73 -0
- package/lib/software/software.types.d.ts +101 -0
- package/lib/software/software.types.js +2 -0
- package/lib/types.d.ts +20 -0
- package/lib/types.js +2 -0
- package/lib/users/user.types.d.ts +5 -0
- package/lib/users/user.types.js +9 -0
- package/lib/users/users.d.ts +9 -0
- package/lib/users/users.js +104 -0
- package/package.json +13 -14
- /package/{types.js → lib/auth/auth.types.js} +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Software = void 0;
|
|
4
|
+
const addigy_constants_1 = require("../addigy.constants");
|
|
5
|
+
class Software {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
this.http = http;
|
|
8
|
+
}
|
|
9
|
+
async getPublicSoftware() {
|
|
10
|
+
try {
|
|
11
|
+
let res = await this.http.get(`catalog/public`);
|
|
12
|
+
return res.data;
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
throw err;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
async getCustomSoftware() {
|
|
19
|
+
try {
|
|
20
|
+
let res = await this.http.get(`custom-software`);
|
|
21
|
+
return res.data;
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
throw err;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async getCustomSoftwareAllVersions(softwareId) {
|
|
28
|
+
try {
|
|
29
|
+
let res = await this.http.get(`custom-software?identifier=${softwareId}`);
|
|
30
|
+
return res.data;
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
throw err;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async getCustomSoftwareSpecificVersion(instructionId) {
|
|
37
|
+
try {
|
|
38
|
+
let res = await this.http.get(`custom-software?instructionid=${instructionId}`);
|
|
39
|
+
return res.data;
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
throw err;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async createCustomSoftware(baseIdentifier, version, downloads, installationScript, condition, removeScript, priority = 10) {
|
|
46
|
+
let postBody = {
|
|
47
|
+
base_identifier: baseIdentifier,
|
|
48
|
+
version,
|
|
49
|
+
downloads,
|
|
50
|
+
installation_script: installationScript,
|
|
51
|
+
condition,
|
|
52
|
+
remove_script: removeScript,
|
|
53
|
+
priority,
|
|
54
|
+
};
|
|
55
|
+
try {
|
|
56
|
+
let res = await this.http.post(`custom-software`, postBody);
|
|
57
|
+
return res.data;
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
throw err;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async createSoftwareInternal(authObject, software) {
|
|
64
|
+
const res = await this.http.post('software', software, {
|
|
65
|
+
headers: {
|
|
66
|
+
Cookie: `auth_token=${authObject.authToken};`,
|
|
67
|
+
origin: addigy_constants_1.Urls.appProd,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
return res.data;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.Software = Software;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export interface Software {
|
|
2
|
+
name: string;
|
|
3
|
+
provider: string;
|
|
4
|
+
identifier: string;
|
|
5
|
+
version: string;
|
|
6
|
+
instruction_id: string;
|
|
7
|
+
base_identifier: string;
|
|
8
|
+
public_software_instruction_id: string;
|
|
9
|
+
fact_identifier: string;
|
|
10
|
+
run_on_success: boolean;
|
|
11
|
+
predefined_conditions: PredefinedConditions;
|
|
12
|
+
condition: string;
|
|
13
|
+
remove_script: string;
|
|
14
|
+
policy_restricted: boolean;
|
|
15
|
+
status_on_skipped: string;
|
|
16
|
+
user_email: string;
|
|
17
|
+
label: string;
|
|
18
|
+
public: boolean;
|
|
19
|
+
organization_id: string;
|
|
20
|
+
downloads: any[];
|
|
21
|
+
profiles: any[];
|
|
22
|
+
installation_script: string;
|
|
23
|
+
price_per_device: number;
|
|
24
|
+
priority: number;
|
|
25
|
+
tcc_version: number;
|
|
26
|
+
type: string;
|
|
27
|
+
category: string;
|
|
28
|
+
software_icon: SoftwareIcon;
|
|
29
|
+
description: string;
|
|
30
|
+
archived: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface CreateSoftware {
|
|
33
|
+
base_identifier: string;
|
|
34
|
+
version: string;
|
|
35
|
+
downloads: SoftwareDownload[];
|
|
36
|
+
profiles: any[];
|
|
37
|
+
installation_script: string;
|
|
38
|
+
remove_script: string;
|
|
39
|
+
condition: string;
|
|
40
|
+
predefined_conditions: PredefinedConditions;
|
|
41
|
+
public: boolean | null;
|
|
42
|
+
software_icon: SoftwareIcon;
|
|
43
|
+
run_on_success: boolean;
|
|
44
|
+
status_on_skipped: string;
|
|
45
|
+
priority: number;
|
|
46
|
+
category: string;
|
|
47
|
+
}
|
|
48
|
+
export interface PredefinedConditions {
|
|
49
|
+
os_version: OSVersion;
|
|
50
|
+
app_exists: AppExists;
|
|
51
|
+
file_exists: FileExists;
|
|
52
|
+
file_not_exists: FileExists;
|
|
53
|
+
profile_exists: ProfileExists;
|
|
54
|
+
process_not_running: ProcessNotRunning;
|
|
55
|
+
required_architecture: RequiredArchitecture;
|
|
56
|
+
}
|
|
57
|
+
export interface AppExists {
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
operator: string;
|
|
60
|
+
version: string;
|
|
61
|
+
path: string;
|
|
62
|
+
install_if_not_present: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface FileExists {
|
|
65
|
+
enabled: boolean;
|
|
66
|
+
path: string;
|
|
67
|
+
}
|
|
68
|
+
export interface OSVersion {
|
|
69
|
+
enabled: boolean;
|
|
70
|
+
operator: string;
|
|
71
|
+
version: string;
|
|
72
|
+
}
|
|
73
|
+
export interface ProcessNotRunning {
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
process_name: string;
|
|
76
|
+
}
|
|
77
|
+
export interface ProfileExists {
|
|
78
|
+
enabled: boolean;
|
|
79
|
+
profile_id: string;
|
|
80
|
+
}
|
|
81
|
+
export interface RequiredArchitecture {
|
|
82
|
+
enabled: boolean;
|
|
83
|
+
apple_silicon: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface SoftwareIcon {
|
|
86
|
+
orgid: string;
|
|
87
|
+
filename: string;
|
|
88
|
+
id: string;
|
|
89
|
+
provider: string;
|
|
90
|
+
}
|
|
91
|
+
export interface SoftwareDownload {
|
|
92
|
+
orgid: string;
|
|
93
|
+
created: Date;
|
|
94
|
+
content_type: string;
|
|
95
|
+
filename: string;
|
|
96
|
+
id: string;
|
|
97
|
+
md5_hash: string;
|
|
98
|
+
provider: string;
|
|
99
|
+
user_email: string;
|
|
100
|
+
size: number;
|
|
101
|
+
}
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface IAddigyConfig {
|
|
2
|
+
clientId: string;
|
|
3
|
+
clientSecret: string;
|
|
4
|
+
adminUsername?: string;
|
|
5
|
+
adminPassword?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Payload {
|
|
8
|
+
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';
|
|
9
|
+
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';
|
|
10
|
+
payload_version: number;
|
|
11
|
+
payload_identifier: string;
|
|
12
|
+
payload_uuid: string;
|
|
13
|
+
payload_group_id: string;
|
|
14
|
+
payload_display_name: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SupportedOsVersions {
|
|
17
|
+
macOS?: string;
|
|
18
|
+
iOS?: string;
|
|
19
|
+
tvOS?: string;
|
|
20
|
+
}
|
package/lib/types.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserRoles = void 0;
|
|
4
|
+
var UserRoles;
|
|
5
|
+
(function (UserRoles) {
|
|
6
|
+
UserRoles["Owner"] = "power";
|
|
7
|
+
UserRoles["Admin"] = "admin";
|
|
8
|
+
UserRoles["User"] = "user";
|
|
9
|
+
})(UserRoles || (exports.UserRoles = UserRoles = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAddigyInternalAuthObject } from '../auth/auth.types';
|
|
2
|
+
import { UserRoles } from './user.types';
|
|
3
|
+
export declare class Users {
|
|
4
|
+
private readonly http;
|
|
5
|
+
createUser(authObject: IAddigyInternalAuthObject, email: string, name: string, policies: string[] | undefined, role: UserRoles | string, phone?: string): Promise<object[]>;
|
|
6
|
+
updateUser(authObject: IAddigyInternalAuthObject, email: string, name: string, policies: string[] | undefined, role: string, phone?: string): Promise<object[]>;
|
|
7
|
+
deleteUser(authObject: IAddigyInternalAuthObject, email: string): Promise<object[]>;
|
|
8
|
+
getUsers(authObject: IAddigyInternalAuthObject): Promise<object[]>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
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.Users = 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 Users {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.http = axios_1.default.create({
|
|
13
|
+
baseURL: 'https://app-prod.addigy.com/api/cloud/users',
|
|
14
|
+
...(0, addigy_utils_1.getAxiosHttpAgents)(),
|
|
15
|
+
headers: { origin: addigy_constants_1.Urls.appProd },
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
async createUser(authObject, email, name, policies = [], role, phone) {
|
|
19
|
+
let postBody = {
|
|
20
|
+
name: name,
|
|
21
|
+
email: email,
|
|
22
|
+
policies: policies,
|
|
23
|
+
role: role,
|
|
24
|
+
};
|
|
25
|
+
if (phone !== undefined) {
|
|
26
|
+
postBody['phone'] = phone;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
let res = await this.http.post('user', postBody, {
|
|
30
|
+
headers: {
|
|
31
|
+
Cookie: `auth_token=${authObject.authToken};`,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return res.data;
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
throw err;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async updateUser(authObject, email, name, policies = [], role, phone) {
|
|
41
|
+
let postBody = {
|
|
42
|
+
id: '',
|
|
43
|
+
uid: '',
|
|
44
|
+
name: name,
|
|
45
|
+
authanvil_tfa_username: '',
|
|
46
|
+
email: email,
|
|
47
|
+
phone: '',
|
|
48
|
+
role: role,
|
|
49
|
+
addigy_role: '',
|
|
50
|
+
policies: policies,
|
|
51
|
+
};
|
|
52
|
+
if (phone !== undefined) {
|
|
53
|
+
postBody['phone'] = phone;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
let users = await this.getUsers(authObject);
|
|
57
|
+
let user = users.find((element) => element.email === email);
|
|
58
|
+
if (!user)
|
|
59
|
+
throw new Error(`No user with email ${email} exists.`);
|
|
60
|
+
postBody['id'] = user.id;
|
|
61
|
+
let res = await this.http.put(`user/${user.id}?user_email=${encodeURIComponent(user.email)}`, postBody, {
|
|
62
|
+
headers: {
|
|
63
|
+
Cookie: `auth_token=${authObject.authToken};`,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
return res.data;
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
throw err;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async deleteUser(authObject, email) {
|
|
73
|
+
try {
|
|
74
|
+
let users = await this.getUsers(authObject);
|
|
75
|
+
let user = users.find((element) => element.email === email);
|
|
76
|
+
if (!user)
|
|
77
|
+
throw new Error(`No user with email ${email} exists.`);
|
|
78
|
+
let res = await this.http.delete(`user/${user.id}?user_email=${encodeURIComponent(email)}`, {
|
|
79
|
+
headers: {
|
|
80
|
+
Cookie: `auth_token=${authObject.authToken};`,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
return res.data;
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
throw err;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async getUsers(authObject) {
|
|
90
|
+
try {
|
|
91
|
+
let res = await this.http.get('https://app-prod.addigy.com/api/account', {
|
|
92
|
+
headers: {
|
|
93
|
+
Cookie: `auth_token=${authObject.authToken};`,
|
|
94
|
+
},
|
|
95
|
+
method: 'GET',
|
|
96
|
+
});
|
|
97
|
+
return res.data.users;
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
throw err;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.Users = Users;
|
package/package.json
CHANGED
|
@@ -6,32 +6,31 @@
|
|
|
6
6
|
}
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@expo/plist": "0.0
|
|
10
|
-
"
|
|
11
|
-
"
|
|
9
|
+
"@expo/plist": "0.1.0",
|
|
10
|
+
"axios": "1.6.7",
|
|
11
|
+
"http-cookie-agent": "6.0.1",
|
|
12
|
+
"tough-cookie": "4.1.3",
|
|
12
13
|
"uuid": "8.3.2"
|
|
13
14
|
},
|
|
14
15
|
"description": "",
|
|
15
16
|
"devDependencies": {
|
|
16
|
-
"@pliancy/eslint-config-ts": "1.
|
|
17
|
+
"@pliancy/eslint-config-ts": "1.1.0",
|
|
17
18
|
"@pliancy/semantic-release-config-npm": "2.2.0",
|
|
18
|
-
"@types/got": "9.6.12",
|
|
19
19
|
"@types/jest": "29.5.5",
|
|
20
|
-
"@types/node": "
|
|
21
|
-
"@types/
|
|
20
|
+
"@types/node": "20.11.20",
|
|
21
|
+
"@types/tough-cookie": "4.0.5",
|
|
22
|
+
"@types/uuid": "9.0.8",
|
|
22
23
|
"commitizen": "4.3.0",
|
|
23
24
|
"cpy-cli": "5.0.0",
|
|
24
25
|
"cz-conventional-changelog": "3.3.0",
|
|
25
|
-
"gh-pages": "3.2.3",
|
|
26
26
|
"husky": "8.0.3",
|
|
27
27
|
"jest": "29.7.0",
|
|
28
28
|
"npm-run-all": "4.1.5",
|
|
29
|
-
"open": "
|
|
30
|
-
"pinst": "
|
|
31
|
-
"rimraf": "
|
|
29
|
+
"open": "10.0.4",
|
|
30
|
+
"pinst": "3.0.0",
|
|
31
|
+
"rimraf": "5.0.5",
|
|
32
32
|
"ts-jest": "29.1.1",
|
|
33
|
-
"
|
|
34
|
-
"typescript": "4.9.5"
|
|
33
|
+
"typescript": "5.3.3"
|
|
35
34
|
},
|
|
36
35
|
"keywords": [
|
|
37
36
|
"addigy",
|
|
@@ -59,7 +58,7 @@
|
|
|
59
58
|
"tsc": "tsc -p tsconfig.build.json"
|
|
60
59
|
},
|
|
61
60
|
"types": "index.d.ts",
|
|
62
|
-
"version": "2.
|
|
61
|
+
"version": "2.10.0",
|
|
63
62
|
"volta": {
|
|
64
63
|
"node": "20.8.0",
|
|
65
64
|
"yarn": "1.22.19"
|
|
File without changes
|