addigy 2.11.3 → 2.12.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/index.d.ts +3 -0
- package/index.js +7 -1
- package/lib/facts/facts.d.ts +1 -1
- package/lib/facts/facts.types.d.ts +0 -15
- package/lib/v2/addigy-v2.d.ts +6 -0
- package/lib/v2/addigy-v2.js +6 -0
- package/lib/v2/custom-facts-v2.d.ts +14 -0
- package/lib/v2/custom-facts-v2.js +54 -0
- package/lib/v2/mdm-configurations-v2.d.ts +36 -0
- package/lib/v2/mdm-configurations-v2.js +366 -0
- package/lib/v2/policies-v2.d.ts +2 -2
- package/lib/v2/policies-v2.js +9 -12
- package/lib/v2/smart-software-v2.d.ts +13 -0
- package/lib/v2/smart-software-v2.js +49 -0
- package/lib/v2/v2.types.d.ts +239 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -31,8 +31,11 @@ export { Users } from './lib/users/users';
|
|
|
31
31
|
export * from './lib/users/user.types';
|
|
32
32
|
export { AddigyV2 } from './lib/v2/addigy-v2';
|
|
33
33
|
export { CertsV2 } from './lib/v2/certs-v2';
|
|
34
|
+
export { CustomFactsV2 } from './lib/v2/custom-facts-v2';
|
|
34
35
|
export { DevicesV2 } from './lib/v2/devices-v2';
|
|
36
|
+
export { MdmConfigurationsV2 } from './lib/v2/mdm-configurations-v2';
|
|
35
37
|
export { PaginationV2 } from './lib/v2/pagination-v2';
|
|
36
38
|
export { PoliciesV2 } from './lib/v2/policies-v2';
|
|
39
|
+
export { SmartSoftwareV2 } from './lib/v2/smart-software-v2';
|
|
37
40
|
export { UsersV2 } from './lib/v2/users-v2';
|
|
38
41
|
export * from './lib/v2/v2.types';
|
package/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.UsersV2 = exports.PoliciesV2 = exports.PaginationV2 = exports.DevicesV2 = exports.CertsV2 = exports.AddigyV2 = exports.Users = exports.Software = exports.ScreenConnect = exports.Profiles = exports.Policies = exports.MdmProfiles = exports.MdmPolicies = exports.MdmConfigurations = exports.Maintenance = exports.Integrations = exports.Files = exports.Facts = exports.Devices = exports.Certs = exports.Billing = exports.Applications = exports.Auth = exports.Alerts = exports.Addigy = void 0;
|
|
17
|
+
exports.UsersV2 = exports.SmartSoftwareV2 = exports.PoliciesV2 = exports.PaginationV2 = exports.MdmConfigurationsV2 = exports.DevicesV2 = exports.CustomFactsV2 = exports.CertsV2 = exports.AddigyV2 = exports.Users = exports.Software = exports.ScreenConnect = exports.Profiles = exports.Policies = exports.MdmProfiles = exports.MdmPolicies = exports.MdmConfigurations = exports.Maintenance = exports.Integrations = exports.Files = exports.Facts = exports.Devices = exports.Certs = exports.Billing = exports.Applications = exports.Auth = exports.Alerts = exports.Addigy = void 0;
|
|
18
18
|
__exportStar(require("./lib/types"), exports);
|
|
19
19
|
var addigy_1 = require("./lib/addigy");
|
|
20
20
|
Object.defineProperty(exports, "Addigy", { enumerable: true, get: function () { return addigy_1.Addigy; } });
|
|
@@ -69,12 +69,18 @@ var addigy_v2_1 = require("./lib/v2/addigy-v2");
|
|
|
69
69
|
Object.defineProperty(exports, "AddigyV2", { enumerable: true, get: function () { return addigy_v2_1.AddigyV2; } });
|
|
70
70
|
var certs_v2_1 = require("./lib/v2/certs-v2");
|
|
71
71
|
Object.defineProperty(exports, "CertsV2", { enumerable: true, get: function () { return certs_v2_1.CertsV2; } });
|
|
72
|
+
var custom_facts_v2_1 = require("./lib/v2/custom-facts-v2");
|
|
73
|
+
Object.defineProperty(exports, "CustomFactsV2", { enumerable: true, get: function () { return custom_facts_v2_1.CustomFactsV2; } });
|
|
72
74
|
var devices_v2_1 = require("./lib/v2/devices-v2");
|
|
73
75
|
Object.defineProperty(exports, "DevicesV2", { enumerable: true, get: function () { return devices_v2_1.DevicesV2; } });
|
|
76
|
+
var mdm_configurations_v2_1 = require("./lib/v2/mdm-configurations-v2");
|
|
77
|
+
Object.defineProperty(exports, "MdmConfigurationsV2", { enumerable: true, get: function () { return mdm_configurations_v2_1.MdmConfigurationsV2; } });
|
|
74
78
|
var pagination_v2_1 = require("./lib/v2/pagination-v2");
|
|
75
79
|
Object.defineProperty(exports, "PaginationV2", { enumerable: true, get: function () { return pagination_v2_1.PaginationV2; } });
|
|
76
80
|
var policies_v2_1 = require("./lib/v2/policies-v2");
|
|
77
81
|
Object.defineProperty(exports, "PoliciesV2", { enumerable: true, get: function () { return policies_v2_1.PoliciesV2; } });
|
|
82
|
+
var smart_software_v2_1 = require("./lib/v2/smart-software-v2");
|
|
83
|
+
Object.defineProperty(exports, "SmartSoftwareV2", { enumerable: true, get: function () { return smart_software_v2_1.SmartSoftwareV2; } });
|
|
78
84
|
var users_v2_1 = require("./lib/v2/users-v2");
|
|
79
85
|
Object.defineProperty(exports, "UsersV2", { enumerable: true, get: function () { return users_v2_1.UsersV2; } });
|
|
80
86
|
__exportStar(require("./lib/v2/v2.types"), exports);
|
package/lib/facts/facts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAddigyInternalAuthObject } from '../auth/auth.types';
|
|
2
|
-
import { CustomFact } from '
|
|
2
|
+
import { CustomFact } from '../v2/v2.types';
|
|
3
3
|
export declare class Facts {
|
|
4
4
|
private readonly http;
|
|
5
5
|
createCustomFact(authObject: IAddigyInternalAuthObject, name: string, script: string, scriptType: 'bash' | 'python' | 'zsh'): Promise<CustomFact>;
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
export interface CustomFact {
|
|
2
|
-
organization_id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
return_type: string;
|
|
5
|
-
identifier: string;
|
|
6
|
-
version: number;
|
|
7
|
-
os_architectures: CustomFactOSArchitectures;
|
|
8
|
-
notes: string;
|
|
9
|
-
provider: string;
|
|
10
|
-
source: string;
|
|
11
|
-
}
|
|
12
|
-
export interface CustomFactOSArchitectures {
|
|
13
|
-
linux_arm: CustomFactOSArchitecturesData;
|
|
14
|
-
darwin_amd64: CustomFactOSArchitecturesData;
|
|
15
|
-
}
|
|
16
1
|
export interface CustomFactOSArchitecturesData {
|
|
17
2
|
language: string;
|
|
18
3
|
is_supported: boolean;
|
package/lib/v2/addigy-v2.d.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { CertsV2 } from './certs-v2';
|
|
2
|
+
import { CustomFactsV2 } from './custom-facts-v2';
|
|
2
3
|
import { DevicesV2 } from './devices-v2';
|
|
4
|
+
import { MdmConfigurationsV2 } from './mdm-configurations-v2';
|
|
3
5
|
import { PoliciesV2 } from './policies-v2';
|
|
6
|
+
import { SmartSoftwareV2 } from './smart-software-v2';
|
|
4
7
|
import { IAddigyV2Config } from './v2.types';
|
|
5
8
|
import { UsersV2 } from './users-v2';
|
|
6
9
|
export declare class AddigyV2 {
|
|
7
10
|
private readonly config;
|
|
8
11
|
certs: CertsV2;
|
|
12
|
+
customFacts: CustomFactsV2;
|
|
9
13
|
devices: DevicesV2;
|
|
14
|
+
mdmConfigurations: MdmConfigurationsV2;
|
|
10
15
|
policies: PoliciesV2;
|
|
16
|
+
smartSoftware: SmartSoftwareV2;
|
|
11
17
|
users: UsersV2;
|
|
12
18
|
private readonly http;
|
|
13
19
|
constructor(config: IAddigyV2Config);
|
package/lib/v2/addigy-v2.js
CHANGED
|
@@ -7,8 +7,11 @@ exports.AddigyV2 = void 0;
|
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const addigy_utils_1 = require("../addigy.utils");
|
|
9
9
|
const certs_v2_1 = require("./certs-v2");
|
|
10
|
+
const custom_facts_v2_1 = require("./custom-facts-v2");
|
|
10
11
|
const devices_v2_1 = require("./devices-v2");
|
|
12
|
+
const mdm_configurations_v2_1 = require("./mdm-configurations-v2");
|
|
11
13
|
const policies_v2_1 = require("./policies-v2");
|
|
14
|
+
const smart_software_v2_1 = require("./smart-software-v2");
|
|
12
15
|
const users_v2_1 = require("./users-v2");
|
|
13
16
|
class AddigyV2 {
|
|
14
17
|
constructor(config) {
|
|
@@ -23,8 +26,11 @@ class AddigyV2 {
|
|
|
23
26
|
},
|
|
24
27
|
});
|
|
25
28
|
this.certs = new certs_v2_1.CertsV2(this.http);
|
|
29
|
+
this.customFacts = new custom_facts_v2_1.CustomFactsV2(this.http);
|
|
26
30
|
this.devices = new devices_v2_1.DevicesV2(this.http);
|
|
31
|
+
this.mdmConfigurations = new mdm_configurations_v2_1.MdmConfigurationsV2(this.http);
|
|
27
32
|
this.policies = new policies_v2_1.PoliciesV2(this.http);
|
|
33
|
+
this.smartSoftware = new smart_software_v2_1.SmartSoftwareV2(this.http);
|
|
28
34
|
this.users = new users_v2_1.UsersV2(this.http);
|
|
29
35
|
}
|
|
30
36
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { AssignCustomFactToPoliciesResponse, CreateCustomFactRequest, CreateCustomFactResponse, CustomFact, CustomFactsListOptions, CustomFactUsage, UpdateCustomFactRequest } from './v2.types';
|
|
3
|
+
export declare class CustomFactsV2 {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: AxiosInstance);
|
|
6
|
+
list(options?: CustomFactsListOptions): Promise<CustomFact[]>;
|
|
7
|
+
get(organizationId: string, id: string): Promise<CustomFact>;
|
|
8
|
+
getUsage(organizationId: string, id: string): Promise<CustomFactUsage>;
|
|
9
|
+
create(organizationId: string, request: CreateCustomFactRequest): Promise<CreateCustomFactResponse>;
|
|
10
|
+
update(organizationId: string, request: UpdateCustomFactRequest): Promise<void>;
|
|
11
|
+
delete(organizationId: string, id: string): Promise<void>;
|
|
12
|
+
assignPolicies(organizationId: string, id: string, policies: string[]): Promise<AssignCustomFactToPoliciesResponse>;
|
|
13
|
+
unassignPolicy(organizationId: string, id: string, policyId: string): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomFactsV2 = void 0;
|
|
4
|
+
const pagination_v2_1 = require("./pagination-v2");
|
|
5
|
+
class CustomFactsV2 {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
this.http = http;
|
|
8
|
+
}
|
|
9
|
+
async list(options) {
|
|
10
|
+
const baseRequest = {};
|
|
11
|
+
return pagination_v2_1.PaginationV2.fetchItems(async ({ page, per_page }) => {
|
|
12
|
+
const requestBody = pagination_v2_1.PaginationV2.buildRequestBody(baseRequest, {
|
|
13
|
+
...options,
|
|
14
|
+
page,
|
|
15
|
+
perPage: per_page,
|
|
16
|
+
});
|
|
17
|
+
if (options === null || options === void 0 ? void 0 : options.filter) {
|
|
18
|
+
requestBody.query = options.filter;
|
|
19
|
+
}
|
|
20
|
+
const response = await this.http.post('/oa/facts/custom/query', requestBody);
|
|
21
|
+
return response.data;
|
|
22
|
+
}, options);
|
|
23
|
+
}
|
|
24
|
+
async get(organizationId, id) {
|
|
25
|
+
const response = await this.http.get(`/o/${encodeURIComponent(organizationId)}/facts/custom/${encodeURIComponent(id)}`);
|
|
26
|
+
return response.data;
|
|
27
|
+
}
|
|
28
|
+
async getUsage(organizationId, id) {
|
|
29
|
+
const response = await this.http.get(`/o/${encodeURIComponent(organizationId)}/facts/custom/${encodeURIComponent(id)}/usage`);
|
|
30
|
+
return response.data;
|
|
31
|
+
}
|
|
32
|
+
async create(organizationId, request) {
|
|
33
|
+
const response = await this.http.post(`/o/${encodeURIComponent(organizationId)}/facts/custom`, request);
|
|
34
|
+
return response.data;
|
|
35
|
+
}
|
|
36
|
+
async update(organizationId, request) {
|
|
37
|
+
await this.http.put(`/o/${encodeURIComponent(organizationId)}/facts/custom`, request);
|
|
38
|
+
}
|
|
39
|
+
async delete(organizationId, id) {
|
|
40
|
+
await this.http.delete(`/o/${encodeURIComponent(organizationId)}/facts/custom`, {
|
|
41
|
+
params: { id },
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
async assignPolicies(organizationId, id, policies) {
|
|
45
|
+
const response = await this.http.post(`/o/${encodeURIComponent(organizationId)}/facts/custom/policy`, { id, policies });
|
|
46
|
+
return response.data;
|
|
47
|
+
}
|
|
48
|
+
async unassignPolicy(organizationId, id, policyId) {
|
|
49
|
+
await this.http.delete(`/o/${encodeURIComponent(organizationId)}/facts/custom/policy`, {
|
|
50
|
+
params: { id, policy_id: policyId },
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.CustomFactsV2 = CustomFactsV2;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { CreateCustomProfileOptions, MdmConfigurationPayloads, MdmPayloadManifest, MdmPayloadRequest, MdmPayloadResult, MdmPayloadsQueryRequest } from './v2.types';
|
|
3
|
+
import { CreateWebContentFilterPayload, Extension, MdmConfigurationInput, NotificationSettings, PPPCInput, ServiceManagementPayloadRule } from '../mdm/mdm.types';
|
|
4
|
+
import { FilevaultRequest } from '../files/files.types';
|
|
5
|
+
export declare class MdmConfigurationsV2 {
|
|
6
|
+
private readonly http;
|
|
7
|
+
constructor(http: AxiosInstance);
|
|
8
|
+
list(): Promise<MdmConfigurationPayloads>;
|
|
9
|
+
get(payloadGroupId: string): Promise<MdmConfigurationPayloads>;
|
|
10
|
+
delete(payloadGroupId: string): Promise<string>;
|
|
11
|
+
create(payloads: MdmPayloadRequest[]): Promise<MdmConfigurationPayloads>;
|
|
12
|
+
createCustomProfile(profile: Buffer | string, options?: CreateCustomProfileOptions): Promise<MdmConfigurationPayloads>;
|
|
13
|
+
updatePayloads(payloads: MdmPayloadResult[]): Promise<MdmConfigurationPayloads>;
|
|
14
|
+
assignPolicies(groupId: string, policyIds: string[]): Promise<string>;
|
|
15
|
+
unassignPolicies(groupId: string, policyIds: string[]): Promise<string>;
|
|
16
|
+
listDefinitions(): Promise<MdmPayloadManifest[]>;
|
|
17
|
+
getDefinition(addigyPayloadType: string): Promise<MdmPayloadManifest>;
|
|
18
|
+
listByPolicyAndType(policyId: string, payloadType: string): Promise<MdmPayloadResult[]>;
|
|
19
|
+
queryPayloads(organizationId: string, request?: MdmPayloadsQueryRequest): Promise<MdmConfigurationPayloads>;
|
|
20
|
+
createKernelExtensionPolicy(name: string, allowOverrides: boolean, kernelExtensions: {
|
|
21
|
+
allowedTeamIdentifiers?: string[];
|
|
22
|
+
allowedKernelExtensions?: Extension[];
|
|
23
|
+
}): Promise<MdmConfigurationPayloads>;
|
|
24
|
+
createSystemExtensionPolicy(name: string, allowOverrides: boolean, systemExtensions: {
|
|
25
|
+
allowedSystemExtensions?: Extension[];
|
|
26
|
+
allowedSystemExtensionTypes?: Extension[];
|
|
27
|
+
allowedTeamIdentifiers?: string[];
|
|
28
|
+
}): Promise<MdmConfigurationPayloads>;
|
|
29
|
+
createNotificationSettingsPolicy(name: string, notificationSettings: NotificationSettings[]): Promise<MdmConfigurationPayloads>;
|
|
30
|
+
createServiceManagementPolicy(name: string, rules: ServiceManagementPayloadRule[], priority?: number): Promise<MdmConfigurationPayloads>;
|
|
31
|
+
createWebContentFilterPolicy(name: string, webContentPayload: CreateWebContentFilterPayload, priority?: number): Promise<MdmConfigurationPayloads>;
|
|
32
|
+
createFilevaultPolicy(name: string, filevault: FilevaultRequest, payloadPriority?: number): Promise<MdmConfigurationPayloads>;
|
|
33
|
+
createPPPCPolicy(name: string, pppcPolicy: PPPCInput[]): Promise<MdmConfigurationPayloads>;
|
|
34
|
+
createMdmCertificate(mdmConfigurationInput: MdmConfigurationInput): Promise<MdmConfigurationPayloads>;
|
|
35
|
+
createMdmProfile(mdmProfile: MdmPayloadRequest | MdmPayloadRequest[]): Promise<MdmConfigurationPayloads>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MdmConfigurationsV2 = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
class MdmConfigurationsV2 {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
this.http = http;
|
|
8
|
+
}
|
|
9
|
+
async list() {
|
|
10
|
+
const response = await this.http.get('/mdm/configurations/profiles');
|
|
11
|
+
return response.data;
|
|
12
|
+
}
|
|
13
|
+
async get(payloadGroupId) {
|
|
14
|
+
const response = await this.http.get(`/mdm/configurations/profile/${encodeURIComponent(payloadGroupId)}`);
|
|
15
|
+
return response.data;
|
|
16
|
+
}
|
|
17
|
+
async delete(payloadGroupId) {
|
|
18
|
+
const response = await this.http.delete(`/mdm/configurations/profile/${encodeURIComponent(payloadGroupId)}`);
|
|
19
|
+
return response.data;
|
|
20
|
+
}
|
|
21
|
+
async create(payloads) {
|
|
22
|
+
const response = await this.http.post('/mdm/configurations/profile', { payloads });
|
|
23
|
+
return response.data;
|
|
24
|
+
}
|
|
25
|
+
async createCustomProfile(profile, options) {
|
|
26
|
+
const form = new FormData();
|
|
27
|
+
const blob = new Blob([profile], { type: 'application/x-apple-aspen-config' });
|
|
28
|
+
form.append('profile', blob, 'profile.mobileconfig');
|
|
29
|
+
if (options === null || options === void 0 ? void 0 : options.ios_minimum_version)
|
|
30
|
+
form.append('ios_minimum_version', options.ios_minimum_version);
|
|
31
|
+
if (options === null || options === void 0 ? void 0 : options.macos_minimum_version)
|
|
32
|
+
form.append('macos_minimum_version', options.macos_minimum_version);
|
|
33
|
+
if (options === null || options === void 0 ? void 0 : options.tvos_minimum_version)
|
|
34
|
+
form.append('tvos_minimum_version', options.tvos_minimum_version);
|
|
35
|
+
const response = await this.http.post('/mdm/configurations/custom-profile', form, {
|
|
36
|
+
headers: { 'content-type': undefined },
|
|
37
|
+
});
|
|
38
|
+
return response.data;
|
|
39
|
+
}
|
|
40
|
+
async updatePayloads(payloads) {
|
|
41
|
+
const response = await this.http.put('/mdm/configurations/profiles/payloads', { payloads });
|
|
42
|
+
return response.data;
|
|
43
|
+
}
|
|
44
|
+
async assignPolicies(groupId, policyIds) {
|
|
45
|
+
const body = { groupId, policyIds };
|
|
46
|
+
const response = await this.http.post('/mdm/configurations/profile/policies', body);
|
|
47
|
+
return response.data;
|
|
48
|
+
}
|
|
49
|
+
async unassignPolicies(groupId, policyIds) {
|
|
50
|
+
const body = { groupId, policyIds };
|
|
51
|
+
const response = await this.http.delete('/mdm/configurations/profile/policies', {
|
|
52
|
+
data: body,
|
|
53
|
+
});
|
|
54
|
+
return response.data;
|
|
55
|
+
}
|
|
56
|
+
async listDefinitions() {
|
|
57
|
+
const response = await this.http.get('/mdm/configurations/definitions');
|
|
58
|
+
return response.data;
|
|
59
|
+
}
|
|
60
|
+
async getDefinition(addigyPayloadType) {
|
|
61
|
+
const response = await this.http.get(`/mdm/configurations/definition/${encodeURIComponent(addigyPayloadType)}`);
|
|
62
|
+
return response.data;
|
|
63
|
+
}
|
|
64
|
+
async listByPolicyAndType(policyId, payloadType) {
|
|
65
|
+
const response = await this.http.get('/mdm/configurations/policy/profiles', {
|
|
66
|
+
params: { policy_id: policyId, payload_type: payloadType },
|
|
67
|
+
});
|
|
68
|
+
return response.data;
|
|
69
|
+
}
|
|
70
|
+
async queryPayloads(organizationId, request) {
|
|
71
|
+
const response = await this.http.post(`/o/${encodeURIComponent(organizationId)}/mdm/payloads/query`, request !== null && request !== void 0 ? request : {});
|
|
72
|
+
return response.data;
|
|
73
|
+
}
|
|
74
|
+
async createKernelExtensionPolicy(name, allowOverrides, kernelExtensions) {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
const payloadUUID = (0, crypto_1.randomUUID)();
|
|
77
|
+
const groupUUID = (0, crypto_1.randomUUID)();
|
|
78
|
+
const payload = {
|
|
79
|
+
addigy_payload_type: 'com.addigy.syspolicy.kernel-extension-policy.com.apple.syspolicy.kernel-extension-policy',
|
|
80
|
+
payload_type: 'com.apple.syspolicy.kernel-extension-policy',
|
|
81
|
+
payload_version: 1,
|
|
82
|
+
payload_identifier: `com.addigy.syspolicy.kernel-extension-policy.com.apple.syspolicy.kernel-extension-policy.${groupUUID}`,
|
|
83
|
+
payload_uuid: payloadUUID,
|
|
84
|
+
payload_group_id: groupUUID,
|
|
85
|
+
payload_enabled: true,
|
|
86
|
+
payload_display_name: name,
|
|
87
|
+
allow_user_overrides: allowOverrides,
|
|
88
|
+
allowed_kernel_extensions: {},
|
|
89
|
+
allowed_team_identifiers: [],
|
|
90
|
+
};
|
|
91
|
+
if ((_a = kernelExtensions.allowedKernelExtensions) === null || _a === void 0 ? void 0 : _a.length) {
|
|
92
|
+
kernelExtensions.allowedKernelExtensions.forEach((e) => {
|
|
93
|
+
payload.allowed_kernel_extensions[e.teamIdentifier] = e.bundleIdentifiers;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
if ((_b = kernelExtensions.allowedTeamIdentifiers) === null || _b === void 0 ? void 0 : _b.length) {
|
|
97
|
+
kernelExtensions.allowedTeamIdentifiers.forEach((e) => {
|
|
98
|
+
payload.allowed_team_identifiers.push(e);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return this.create([payload]);
|
|
102
|
+
}
|
|
103
|
+
async createSystemExtensionPolicy(name, allowOverrides, systemExtensions) {
|
|
104
|
+
var _a, _b, _c;
|
|
105
|
+
const groupUUID = (0, crypto_1.randomUUID)();
|
|
106
|
+
const payload = {
|
|
107
|
+
addigy_payload_type: 'com.addigy.syspolicy.system-extension-policy.com.apple.system-extension-policy',
|
|
108
|
+
payload_type: 'com.apple.system-extension-policy',
|
|
109
|
+
payload_version: 1,
|
|
110
|
+
payload_identifier: `com.addigy.syspolicy.system-extension-policy.com.apple.system-extension-policy.${groupUUID}`,
|
|
111
|
+
payload_uuid: (0, crypto_1.randomUUID)(),
|
|
112
|
+
payload_group_id: groupUUID,
|
|
113
|
+
payload_enabled: true,
|
|
114
|
+
payload_display_name: name,
|
|
115
|
+
allowed_system_extensions: {},
|
|
116
|
+
allowed_system_extensions_types: {},
|
|
117
|
+
allowed_team_identifiers: [],
|
|
118
|
+
allow_user_overrides: allowOverrides,
|
|
119
|
+
};
|
|
120
|
+
if ((_a = systemExtensions.allowedSystemExtensions) === null || _a === void 0 ? void 0 : _a.length) {
|
|
121
|
+
systemExtensions.allowedSystemExtensions.forEach((e) => {
|
|
122
|
+
payload.allowed_system_extensions[e.teamIdentifier] = e.bundleIdentifiers;
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
if ((_b = systemExtensions.allowedSystemExtensionTypes) === null || _b === void 0 ? void 0 : _b.length) {
|
|
126
|
+
systemExtensions.allowedSystemExtensionTypes.forEach((e) => {
|
|
127
|
+
payload.allowed_system_extensions_types[e.teamIdentifier] = e.bundleIdentifiers;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
if ((_c = systemExtensions.allowedTeamIdentifiers) === null || _c === void 0 ? void 0 : _c.length) {
|
|
131
|
+
systemExtensions.allowedTeamIdentifiers.forEach((e) => {
|
|
132
|
+
payload.allowed_team_identifiers.push(e);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return this.create([payload]);
|
|
136
|
+
}
|
|
137
|
+
async createNotificationSettingsPolicy(name, notificationSettings) {
|
|
138
|
+
const groupUUID = (0, crypto_1.randomUUID)();
|
|
139
|
+
const payload = {
|
|
140
|
+
addigy_payload_type: 'com.addigy.notifications.com.apple.notificationsettings',
|
|
141
|
+
payload_type: 'com.apple.notificationsettings',
|
|
142
|
+
payload_version: 1,
|
|
143
|
+
payload_identifier: `com.addigy.notifications.com.apple.notificationsettings.${groupUUID}`,
|
|
144
|
+
payload_uuid: (0, crypto_1.randomUUID)(),
|
|
145
|
+
payload_group_id: groupUUID,
|
|
146
|
+
payload_display_name: name,
|
|
147
|
+
notification_settings: notificationSettings,
|
|
148
|
+
};
|
|
149
|
+
return this.create([payload]);
|
|
150
|
+
}
|
|
151
|
+
async createServiceManagementPolicy(name, rules, priority = 9) {
|
|
152
|
+
const groupUUID = (0, crypto_1.randomUUID)();
|
|
153
|
+
const payload = {
|
|
154
|
+
addigy_payload_type: 'com.addigy.servicemanagement.com.apple.servicemanagement',
|
|
155
|
+
addigy_payload_version: 0,
|
|
156
|
+
has_manifest: false,
|
|
157
|
+
payload_display_name: name,
|
|
158
|
+
payload_enabled: false,
|
|
159
|
+
payload_group_id: groupUUID,
|
|
160
|
+
payload_identifier: `com.addigy.servicemanagement.com.apple.servicemanagement.${groupUUID}`,
|
|
161
|
+
payload_priority: priority,
|
|
162
|
+
payload_type: 'com.apple.servicemanagement',
|
|
163
|
+
payload_uuid: (0, crypto_1.randomUUID)(),
|
|
164
|
+
payload_version: 1,
|
|
165
|
+
policy_restricted: false,
|
|
166
|
+
requires_device_supervision: false,
|
|
167
|
+
requires_mdm_profile_approved: false,
|
|
168
|
+
supported_os_versions: null,
|
|
169
|
+
rules,
|
|
170
|
+
};
|
|
171
|
+
return this.create([payload]);
|
|
172
|
+
}
|
|
173
|
+
async createWebContentFilterPolicy(name, webContentPayload, priority = 9) {
|
|
174
|
+
const groupUUID = (0, crypto_1.randomUUID)();
|
|
175
|
+
const payload = {
|
|
176
|
+
addigy_payload_type: 'com.addigy.webcontent-filter.com.apple.webcontent-filter',
|
|
177
|
+
addigy_payload_version: 2,
|
|
178
|
+
auto_filter_enabled: null,
|
|
179
|
+
blacklisted_urls: null,
|
|
180
|
+
content_filter_uuid: null,
|
|
181
|
+
filter_browsers: null,
|
|
182
|
+
filter_data_provider_bundle_identifier: null,
|
|
183
|
+
filter_data_provider_designated_requirement: null,
|
|
184
|
+
filter_packet_provider_bundle_identifier: null,
|
|
185
|
+
filter_packet_provider_designated_requirement: null,
|
|
186
|
+
filter_packets: null,
|
|
187
|
+
filter_sockets: true,
|
|
188
|
+
filter_type: 'Plugin',
|
|
189
|
+
has_manifest: false,
|
|
190
|
+
organization: null,
|
|
191
|
+
password: null,
|
|
192
|
+
payload_display_name: name,
|
|
193
|
+
payload_enabled: true,
|
|
194
|
+
payload_group_id: groupUUID,
|
|
195
|
+
payload_identifier: `com.addigy.webcontent-filter.com.apple.webcontent-filter.${groupUUID}`,
|
|
196
|
+
payload_priority: priority,
|
|
197
|
+
payload_type: 'com.apple.webcontent-filter',
|
|
198
|
+
payload_uuid: (0, crypto_1.randomUUID)(),
|
|
199
|
+
payload_version: 1,
|
|
200
|
+
permitted_urls: null,
|
|
201
|
+
policy_restricted: false,
|
|
202
|
+
requires_device_supervision: false,
|
|
203
|
+
requires_mdm_profile_approved: false,
|
|
204
|
+
server_address: null,
|
|
205
|
+
supported_os_versions: null,
|
|
206
|
+
user_name: null,
|
|
207
|
+
vendor_config: null,
|
|
208
|
+
white_listed_bookmarks: null,
|
|
209
|
+
...webContentPayload,
|
|
210
|
+
};
|
|
211
|
+
return this.create([payload]);
|
|
212
|
+
}
|
|
213
|
+
async createFilevaultPolicy(name, filevault, payloadPriority = 1) {
|
|
214
|
+
const groupUUID = (0, crypto_1.randomUUID)();
|
|
215
|
+
const encryptCertPayloadUUID = (0, crypto_1.randomUUID)();
|
|
216
|
+
const basePayload = {
|
|
217
|
+
payload_display_name: name,
|
|
218
|
+
payload_version: 1,
|
|
219
|
+
payload_group_id: groupUUID,
|
|
220
|
+
addigy_payload_version: 0,
|
|
221
|
+
payload_priority: payloadPriority,
|
|
222
|
+
};
|
|
223
|
+
const payloads = [
|
|
224
|
+
{
|
|
225
|
+
...basePayload,
|
|
226
|
+
payload_type: 'com.apple.MCX.FileVault2',
|
|
227
|
+
addigy_payload_type: 'com.addigy.securityAndPrivacy.com.apple.MCX.FileVault2',
|
|
228
|
+
payload_identifier: `com.addigy.securityAndPrivacy.com.apple.MCX.FileVault2.${groupUUID}`,
|
|
229
|
+
payload_uuid: (0, crypto_1.randomUUID)(),
|
|
230
|
+
enable: filevault.enable ? 'On' : 'Off',
|
|
231
|
+
defer: filevault.defer,
|
|
232
|
+
use_recovery_key: true,
|
|
233
|
+
show_recovery_key: filevault.showRecoveryKey === undefined ? null : filevault.showRecoveryKey,
|
|
234
|
+
defer_dont_ask_at_user_logout: filevault.deferDontAskAtUserLogout === undefined
|
|
235
|
+
? null
|
|
236
|
+
: filevault.deferDontAskAtUserLogout,
|
|
237
|
+
defer_force_at_user_login_max_bypass_attempts: filevault.deferForceAtUserLoginMaxBypassAttempts === undefined
|
|
238
|
+
? null
|
|
239
|
+
: filevault.deferForceAtUserLoginMaxBypassAttempts,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
...basePayload,
|
|
243
|
+
payload_type: 'com.apple.MCX',
|
|
244
|
+
addigy_payload_type: 'com.addigy.securityAndPrivacy.com.apple.MCX',
|
|
245
|
+
payload_identifier: `com.addigy.securityAndPrivacy.com.apple.MCX.${groupUUID} `,
|
|
246
|
+
payload_uuid: (0, crypto_1.randomUUID)(),
|
|
247
|
+
destroy_fv_key_on_standby: filevault.destroyFvKeyOnStandby === undefined
|
|
248
|
+
? null
|
|
249
|
+
: filevault.destroyFvKeyOnStandby,
|
|
250
|
+
dont_allow_fde_disable: true,
|
|
251
|
+
},
|
|
252
|
+
];
|
|
253
|
+
if (filevault.escrowRecoveryKey) {
|
|
254
|
+
payloads.push({
|
|
255
|
+
...basePayload,
|
|
256
|
+
addigy_payload_type: 'com.addigy.securityAndPrivacy.com.apple.security.pkcs1',
|
|
257
|
+
payload_type: 'com.apple.security.pkcs1',
|
|
258
|
+
payload_identifier: `com.addigy.securityAndPrivacy.com.apple.security.pkcs1.${groupUUID}`,
|
|
259
|
+
payload_uuid: (0, crypto_1.randomUUID)(),
|
|
260
|
+
is_from_security_profile: true,
|
|
261
|
+
}, {
|
|
262
|
+
...basePayload,
|
|
263
|
+
addigy_payload_type: 'com.addigy.securityAndPrivacy.com.apple.security.FDERecoveryKeyEscrow',
|
|
264
|
+
payload_type: 'com.apple.security.FDERecoveryKeyEscrow',
|
|
265
|
+
payload_identifier: `com.addigy.securityAndPrivacy.com.apple.security.FDERecoveryKeyEscrow.${groupUUID}`,
|
|
266
|
+
payload_uuid: (0, crypto_1.randomUUID)(),
|
|
267
|
+
encrypt_cert_payload_uuid: encryptCertPayloadUUID,
|
|
268
|
+
location: 'Key will be escrowed to an Addigy secure database.',
|
|
269
|
+
}, {
|
|
270
|
+
...basePayload,
|
|
271
|
+
addigy_payload_type: 'com.addigy.securityAndPrivacy.com.apple.security.FDERecoveryRedirect',
|
|
272
|
+
payload_type: 'com.apple.security.FDERecoveryRedirect',
|
|
273
|
+
payload_identifier: `com.addigy.securityAndPrivacy.com.apple.security.FDERecoveryRedirect.${groupUUID}`,
|
|
274
|
+
payload_uuid: (0, crypto_1.randomUUID)(),
|
|
275
|
+
encrypt_cert_payload_uuid: encryptCertPayloadUUID,
|
|
276
|
+
redirect_url: '',
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
return this.create(payloads);
|
|
280
|
+
}
|
|
281
|
+
async createPPPCPolicy(name, pppcPolicy) {
|
|
282
|
+
const groupUUID = (0, crypto_1.randomUUID)();
|
|
283
|
+
const payload = {
|
|
284
|
+
addigy_payload_type: 'com.addigy.TCC.configuration-profile-policy.com.apple.TCC.configuration-profile-policy',
|
|
285
|
+
payload_type: 'com.apple.TCC.configuration-profile-policy',
|
|
286
|
+
payload_display_name: name,
|
|
287
|
+
payload_group_id: (0, crypto_1.randomUUID)(),
|
|
288
|
+
payload_version: 1,
|
|
289
|
+
payload_identifier: `com.addigy.TCC.configuration-profile-policy.com.apple.TCC.configuration-profile-policy.${groupUUID}`,
|
|
290
|
+
payload_uuid: (0, crypto_1.randomUUID)(),
|
|
291
|
+
services: {
|
|
292
|
+
accessibility: [],
|
|
293
|
+
address_book: [],
|
|
294
|
+
apple_events: [],
|
|
295
|
+
calendar: [],
|
|
296
|
+
camera: [],
|
|
297
|
+
microphone: [],
|
|
298
|
+
photos: [],
|
|
299
|
+
post_event: [],
|
|
300
|
+
reminders: [],
|
|
301
|
+
system_policy_all_files: [],
|
|
302
|
+
system_policy_sys_admin_files: [],
|
|
303
|
+
file_provider_presence: [],
|
|
304
|
+
listen_event: [],
|
|
305
|
+
media_library: [],
|
|
306
|
+
screen_capture: [],
|
|
307
|
+
speech_recognition: [],
|
|
308
|
+
system_policy_desktop_folder: [],
|
|
309
|
+
system_policy_documents_folder: [],
|
|
310
|
+
system_policy_downloads_folder: [],
|
|
311
|
+
system_policy_network_volumes: [],
|
|
312
|
+
system_policy_removable_volumes: [],
|
|
313
|
+
},
|
|
314
|
+
};
|
|
315
|
+
pppcPolicy.forEach((pppc) => {
|
|
316
|
+
pppc.services.forEach((e) => {
|
|
317
|
+
var _a;
|
|
318
|
+
const service = {
|
|
319
|
+
allowed: false,
|
|
320
|
+
authorization: '',
|
|
321
|
+
code_requirement: pppc.codeRequirement,
|
|
322
|
+
comment: '',
|
|
323
|
+
identifier_type: e.identifierType,
|
|
324
|
+
identifier: pppc.identifier,
|
|
325
|
+
static_code: (_a = e.staticCode) !== null && _a !== void 0 ? _a : false,
|
|
326
|
+
predefined_app: null,
|
|
327
|
+
manual_selection: true,
|
|
328
|
+
rowId: (0, crypto_1.randomUUID)(),
|
|
329
|
+
};
|
|
330
|
+
if (e.service === 'screen_capture' && e.authorization) {
|
|
331
|
+
service.authorization = e.authorization;
|
|
332
|
+
}
|
|
333
|
+
if (e.service !== 'screen_capture')
|
|
334
|
+
service.allowed = e.allowed;
|
|
335
|
+
if (e.service === 'apple_events') {
|
|
336
|
+
service.ae_receiver_identifier = e.aeReceiverIdentifier;
|
|
337
|
+
service.ae_receiver_identifier_type = e.aeReceiverIdentifierType;
|
|
338
|
+
service.ae_receiver_code_requirement = e.aeReceiverCodeRequirement;
|
|
339
|
+
service.ae_receiver_predefined_app = null;
|
|
340
|
+
service.ae_receiver_manual_selection = true;
|
|
341
|
+
}
|
|
342
|
+
payload.services[e.service].push(service);
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
return this.create([payload]);
|
|
346
|
+
}
|
|
347
|
+
async createMdmCertificate(mdmConfigurationInput) {
|
|
348
|
+
const groupUUID = (0, crypto_1.randomUUID)();
|
|
349
|
+
const payload = {
|
|
350
|
+
addigy_payload_type: 'com.addigy.certificate.com.apple.security.root',
|
|
351
|
+
payload_type: 'com.apple.security.root',
|
|
352
|
+
payload_version: 1,
|
|
353
|
+
payload_group_id: groupUUID,
|
|
354
|
+
payload_identifier: `com.addigy.certificate.com.apple.security.root.${groupUUID}`,
|
|
355
|
+
payload_uuid: (0, crypto_1.randomUUID)(),
|
|
356
|
+
addigy_payload_version: 0,
|
|
357
|
+
...mdmConfigurationInput,
|
|
358
|
+
};
|
|
359
|
+
return this.create([payload]);
|
|
360
|
+
}
|
|
361
|
+
async createMdmProfile(mdmProfile) {
|
|
362
|
+
const payloads = Array.isArray(mdmProfile) ? mdmProfile : [mdmProfile];
|
|
363
|
+
return this.create(payloads);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
exports.MdmConfigurationsV2 = MdmConfigurationsV2;
|
package/lib/v2/policies-v2.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { V2Policy
|
|
2
|
+
import { V2Policy } from './v2.types';
|
|
3
3
|
export declare class PoliciesV2 {
|
|
4
4
|
private readonly http;
|
|
5
5
|
constructor(http: AxiosInstance);
|
|
6
|
-
list(
|
|
6
|
+
list(policies?: string[]): Promise<V2Policy[]>;
|
|
7
7
|
create(name: string): Promise<V2Policy>;
|
|
8
8
|
}
|
package/lib/v2/policies-v2.js
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PoliciesV2 = void 0;
|
|
4
|
-
const pagination_v2_1 = require("./pagination-v2");
|
|
5
4
|
class PoliciesV2 {
|
|
6
5
|
constructor(http) {
|
|
7
6
|
this.http = http;
|
|
8
7
|
}
|
|
9
|
-
async list(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return response.data;
|
|
19
|
-
}, options);
|
|
8
|
+
async list(policies) {
|
|
9
|
+
var _a;
|
|
10
|
+
const requestBody = policies ? { policies } : {};
|
|
11
|
+
const response = await this.http.post('/oa/policies/query', requestBody);
|
|
12
|
+
const responseData = response.data;
|
|
13
|
+
if (Array.isArray(responseData)) {
|
|
14
|
+
return responseData;
|
|
15
|
+
}
|
|
16
|
+
return (_a = responseData.items) !== null && _a !== void 0 ? _a : [];
|
|
20
17
|
}
|
|
21
18
|
async create(name) {
|
|
22
19
|
const requestBody = { name };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { CreateSmartSoftwareRequest, CustomSoftware, SmartSoftwareListOptions, UpdateSmartSoftwareRequest } from './v2.types';
|
|
3
|
+
export declare class SmartSoftwareV2 {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: AxiosInstance);
|
|
6
|
+
list(options?: SmartSoftwareListOptions): Promise<CustomSoftware[]>;
|
|
7
|
+
get(organizationId: string, id: string): Promise<CustomSoftware>;
|
|
8
|
+
create(organizationId: string, request: CreateSmartSoftwareRequest): Promise<CustomSoftware>;
|
|
9
|
+
delete(organizationId: string, id: string): Promise<void>;
|
|
10
|
+
createNewVersion(organizationId: string, id: string, request: UpdateSmartSoftwareRequest): Promise<CustomSoftware>;
|
|
11
|
+
assignToPolicy(organizationId: string, policyId: string, assetId: string): Promise<void>;
|
|
12
|
+
unassignFromPolicy(organizationId: string, policyId: string, assetId: string): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SmartSoftwareV2 = void 0;
|
|
4
|
+
const pagination_v2_1 = require("./pagination-v2");
|
|
5
|
+
class SmartSoftwareV2 {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
this.http = http;
|
|
8
|
+
}
|
|
9
|
+
async list(options) {
|
|
10
|
+
const baseRequest = {
|
|
11
|
+
sort_field: 'name',
|
|
12
|
+
sort_direction: 'asc',
|
|
13
|
+
};
|
|
14
|
+
return pagination_v2_1.PaginationV2.fetchItems(async ({ page, per_page }) => {
|
|
15
|
+
const requestBody = pagination_v2_1.PaginationV2.buildRequestBody(baseRequest, {
|
|
16
|
+
...options,
|
|
17
|
+
page,
|
|
18
|
+
perPage: per_page,
|
|
19
|
+
});
|
|
20
|
+
if (options === null || options === void 0 ? void 0 : options.filter) {
|
|
21
|
+
requestBody.query = options.filter;
|
|
22
|
+
}
|
|
23
|
+
const response = await this.http.post('/oa/smart-software/query', requestBody);
|
|
24
|
+
return response.data;
|
|
25
|
+
}, options);
|
|
26
|
+
}
|
|
27
|
+
async get(organizationId, id) {
|
|
28
|
+
const response = await this.http.get(`/o/${encodeURIComponent(organizationId)}/smart-software/${encodeURIComponent(id)}`);
|
|
29
|
+
return response.data;
|
|
30
|
+
}
|
|
31
|
+
async create(organizationId, request) {
|
|
32
|
+
const response = await this.http.post(`/o/${encodeURIComponent(organizationId)}/smart-software`, request);
|
|
33
|
+
return response.data;
|
|
34
|
+
}
|
|
35
|
+
async delete(organizationId, id) {
|
|
36
|
+
await this.http.delete(`/o/${encodeURIComponent(organizationId)}/smart-software/${encodeURIComponent(id)}`);
|
|
37
|
+
}
|
|
38
|
+
async createNewVersion(organizationId, id, request) {
|
|
39
|
+
const response = await this.http.post(`/o/${encodeURIComponent(organizationId)}/smart-software/${encodeURIComponent(id)}/new-version`, request);
|
|
40
|
+
return response.data;
|
|
41
|
+
}
|
|
42
|
+
async assignToPolicy(organizationId, policyId, assetId) {
|
|
43
|
+
await this.http.post(`/o/${encodeURIComponent(organizationId)}/policies/${encodeURIComponent(policyId)}/smart-software/${encodeURIComponent(assetId)}`);
|
|
44
|
+
}
|
|
45
|
+
async unassignFromPolicy(organizationId, policyId, assetId) {
|
|
46
|
+
await this.http.delete(`/o/${encodeURIComponent(organizationId)}/policies/${encodeURIComponent(policyId)}/smart-software/${encodeURIComponent(assetId)}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.SmartSoftwareV2 = SmartSoftwareV2;
|
package/lib/v2/v2.types.d.ts
CHANGED
|
@@ -282,4 +282,243 @@ export interface UserUpdateRequest {
|
|
|
282
282
|
}
|
|
283
283
|
export type UserUpdateResponse = Record<string, unknown>;
|
|
284
284
|
export type UserRemoveResponse = Record<string, unknown>;
|
|
285
|
+
export interface MdmPayloadRequest {
|
|
286
|
+
payload_display_name: string;
|
|
287
|
+
payload_type: string;
|
|
288
|
+
payload_priority?: number;
|
|
289
|
+
[key: string]: unknown;
|
|
290
|
+
}
|
|
291
|
+
export interface MdmPayloadResult {
|
|
292
|
+
addigy_payload_type?: string;
|
|
293
|
+
addigy_payload_version?: number;
|
|
294
|
+
payload_display_name?: string;
|
|
295
|
+
payload_enabled?: boolean;
|
|
296
|
+
payload_group_id?: string;
|
|
297
|
+
payload_identifier?: string;
|
|
298
|
+
payload_priority?: number;
|
|
299
|
+
payload_type?: string;
|
|
300
|
+
payload_uuid?: string;
|
|
301
|
+
payload_version?: number;
|
|
302
|
+
policy_restricted?: boolean;
|
|
303
|
+
requires_device_supervision?: boolean;
|
|
304
|
+
requires_mdm_profile_approved?: boolean;
|
|
305
|
+
supported_os_versions?: Record<string, string>;
|
|
306
|
+
[key: string]: unknown;
|
|
307
|
+
}
|
|
308
|
+
export interface MdmPolicyPayloadAssignment {
|
|
309
|
+
orgid?: string;
|
|
310
|
+
configuration_id?: string;
|
|
311
|
+
policy_id?: string;
|
|
312
|
+
}
|
|
313
|
+
export interface MdmConfigurationPayloads {
|
|
314
|
+
payloads?: MdmPayloadResult[];
|
|
315
|
+
staged_payloads?: MdmPayloadResult[];
|
|
316
|
+
policies_mdm_payloads?: MdmPolicyPayloadAssignment[];
|
|
317
|
+
}
|
|
318
|
+
export interface MdmPayloadManifestKey {
|
|
319
|
+
key_name?: string;
|
|
320
|
+
key_type?: string;
|
|
321
|
+
key_description?: string;
|
|
322
|
+
key_required?: boolean;
|
|
323
|
+
key_default_value?: unknown;
|
|
324
|
+
}
|
|
325
|
+
export interface MdmPayloadManifest {
|
|
326
|
+
addigy_payload_type?: string;
|
|
327
|
+
payload_type?: string;
|
|
328
|
+
payload_name?: string;
|
|
329
|
+
payload_description?: string;
|
|
330
|
+
payload_object?: string;
|
|
331
|
+
has_manifest?: boolean;
|
|
332
|
+
keys?: MdmPayloadManifestKey[];
|
|
333
|
+
supported_os_versions?: Record<string, string>[];
|
|
334
|
+
}
|
|
335
|
+
export interface AssignMdmPoliciesRequest {
|
|
336
|
+
groupId: string;
|
|
337
|
+
policyIds: string[];
|
|
338
|
+
}
|
|
339
|
+
export interface MdmPayloadsQueryRequest {
|
|
340
|
+
payload_group_ids?: string[];
|
|
341
|
+
excluded_payload_group_ids?: string[];
|
|
342
|
+
}
|
|
343
|
+
export interface CreateCustomProfileOptions {
|
|
344
|
+
ios_minimum_version?: string;
|
|
345
|
+
macos_minimum_version?: string;
|
|
346
|
+
tvos_minimum_version?: string;
|
|
347
|
+
}
|
|
348
|
+
export interface SmartSoftwareFilter {
|
|
349
|
+
archived?: boolean;
|
|
350
|
+
excluded_ids?: string[];
|
|
351
|
+
identifier?: string;
|
|
352
|
+
ids?: string[];
|
|
353
|
+
name_contains?: string;
|
|
354
|
+
}
|
|
355
|
+
export interface SmartSoftwareListOptions extends V2ListOptions {
|
|
356
|
+
filter?: SmartSoftwareFilter;
|
|
357
|
+
}
|
|
358
|
+
export interface SmartSoftwareDownloadRequest {
|
|
359
|
+
id: string;
|
|
360
|
+
}
|
|
361
|
+
export interface SmartSoftwareSoftwareIconRequest {
|
|
362
|
+
id: string;
|
|
363
|
+
provider: 'cloud-storage' | 'web';
|
|
364
|
+
}
|
|
365
|
+
export interface CreateSmartSoftwareRequest {
|
|
366
|
+
base_identifier: string;
|
|
367
|
+
version: string;
|
|
368
|
+
archived?: boolean;
|
|
369
|
+
category?: string;
|
|
370
|
+
condition?: string;
|
|
371
|
+
description?: string;
|
|
372
|
+
downloads?: SmartSoftwareDownloadRequest[];
|
|
373
|
+
identifier?: string;
|
|
374
|
+
installation_script?: string;
|
|
375
|
+
priority?: number;
|
|
376
|
+
remove_script?: string;
|
|
377
|
+
run_on_success?: string;
|
|
378
|
+
software_icon?: SmartSoftwareSoftwareIconRequest;
|
|
379
|
+
status_on_skipped?: 'finished' | 'failed';
|
|
380
|
+
user_email?: string;
|
|
381
|
+
}
|
|
382
|
+
export interface UpdateSmartSoftwareRequest {
|
|
383
|
+
archived?: boolean;
|
|
384
|
+
base_identifier?: string;
|
|
385
|
+
category?: string;
|
|
386
|
+
condition?: string;
|
|
387
|
+
description?: string;
|
|
388
|
+
downloads?: SmartSoftwareDownloadRequest[];
|
|
389
|
+
identifier?: string;
|
|
390
|
+
installation_script?: string;
|
|
391
|
+
name?: string;
|
|
392
|
+
priority?: number;
|
|
393
|
+
remove_script?: string;
|
|
394
|
+
run_on_success?: string;
|
|
395
|
+
software_icon?: SmartSoftwareSoftwareIconRequest;
|
|
396
|
+
status_on_skipped?: 'finished' | 'failed';
|
|
397
|
+
user_email?: string;
|
|
398
|
+
version?: string;
|
|
399
|
+
}
|
|
400
|
+
export interface CustomSoftwareDownload {
|
|
401
|
+
content_type?: string;
|
|
402
|
+
created?: string;
|
|
403
|
+
file_path?: string;
|
|
404
|
+
filename?: string;
|
|
405
|
+
id?: string;
|
|
406
|
+
md5_hash?: string;
|
|
407
|
+
provider?: string;
|
|
408
|
+
size?: number;
|
|
409
|
+
user_email?: string;
|
|
410
|
+
}
|
|
411
|
+
export interface CustomSoftware {
|
|
412
|
+
archived?: boolean;
|
|
413
|
+
base_identifier?: string;
|
|
414
|
+
category?: string;
|
|
415
|
+
condition?: string;
|
|
416
|
+
description?: string;
|
|
417
|
+
downloads?: CustomSoftwareDownload[];
|
|
418
|
+
fact_identifier?: string;
|
|
419
|
+
identifier?: string;
|
|
420
|
+
install?: boolean;
|
|
421
|
+
installation_script?: string;
|
|
422
|
+
instruction_id?: string;
|
|
423
|
+
is_onboarding_config?: boolean;
|
|
424
|
+
label?: string;
|
|
425
|
+
name?: string;
|
|
426
|
+
organization_id?: string;
|
|
427
|
+
policy_restricted?: boolean;
|
|
428
|
+
priority?: number;
|
|
429
|
+
provider?: string;
|
|
430
|
+
public?: boolean;
|
|
431
|
+
remove_script?: string;
|
|
432
|
+
run_on_success?: string;
|
|
433
|
+
set_group_name?: string;
|
|
434
|
+
software_icon?: CustomSoftwareDownload;
|
|
435
|
+
status_on_skipped?: string;
|
|
436
|
+
tcc_version?: number;
|
|
437
|
+
type?: string;
|
|
438
|
+
user_email?: string;
|
|
439
|
+
version?: unknown;
|
|
440
|
+
}
|
|
441
|
+
export type SmartSoftwareListResponse = V2PaginatedResponse<CustomSoftware>;
|
|
442
|
+
export interface CustomFactOSArchitecture {
|
|
443
|
+
is_supported?: boolean;
|
|
444
|
+
language?: string;
|
|
445
|
+
md5_hash?: string;
|
|
446
|
+
script?: string;
|
|
447
|
+
shebang?: string;
|
|
448
|
+
}
|
|
449
|
+
export interface CustomFactOSArchitectures {
|
|
450
|
+
darwin_amd64?: CustomFactOSArchitecture;
|
|
451
|
+
linux_arm?: CustomFactOSArchitecture;
|
|
452
|
+
macOS?: CustomFactOSArchitecture;
|
|
453
|
+
linux?: CustomFactOSArchitecture;
|
|
454
|
+
}
|
|
455
|
+
export interface CustomFact {
|
|
456
|
+
identifier?: string;
|
|
457
|
+
instruction_id?: string;
|
|
458
|
+
name?: string;
|
|
459
|
+
notes?: string;
|
|
460
|
+
orgid?: string;
|
|
461
|
+
provider?: string;
|
|
462
|
+
return_type?: string;
|
|
463
|
+
source?: string;
|
|
464
|
+
version?: number;
|
|
465
|
+
community_fact_id?: string;
|
|
466
|
+
community_version?: number;
|
|
467
|
+
os_architectures?: CustomFactOSArchitectures;
|
|
468
|
+
}
|
|
469
|
+
export interface CreateCustomFactRequest {
|
|
470
|
+
name: string;
|
|
471
|
+
return_type: string;
|
|
472
|
+
notes?: string;
|
|
473
|
+
os_architectures?: CustomFactOSArchitectures;
|
|
474
|
+
}
|
|
475
|
+
export interface UpdateCustomFactRequest {
|
|
476
|
+
id: string;
|
|
477
|
+
name?: string;
|
|
478
|
+
return_type?: string;
|
|
479
|
+
notes?: string;
|
|
480
|
+
os_architectures?: CustomFactOSArchitectures;
|
|
481
|
+
}
|
|
482
|
+
export interface CustomFactInstruction {
|
|
483
|
+
condition?: string;
|
|
484
|
+
identifier?: string;
|
|
485
|
+
instruction_id?: string;
|
|
486
|
+
label?: string;
|
|
487
|
+
name?: string;
|
|
488
|
+
policy_restricted?: boolean;
|
|
489
|
+
provider?: string;
|
|
490
|
+
public?: boolean;
|
|
491
|
+
remove_script?: string;
|
|
492
|
+
run_on_success?: boolean;
|
|
493
|
+
status_on_skipped?: string;
|
|
494
|
+
user_email?: string;
|
|
495
|
+
}
|
|
496
|
+
export interface CreateCustomFactResponse {
|
|
497
|
+
fact?: CustomFact;
|
|
498
|
+
instruction?: CustomFactInstruction;
|
|
499
|
+
}
|
|
500
|
+
export interface CustomFactsFilter {
|
|
501
|
+
ids?: string[];
|
|
502
|
+
name_contains?: string;
|
|
503
|
+
}
|
|
504
|
+
export interface CustomFactsListOptions extends V2ListOptions {
|
|
505
|
+
filter?: CustomFactsFilter;
|
|
506
|
+
}
|
|
507
|
+
export type CustomFactsListResponse = V2PaginatedResponse<CustomFact>;
|
|
508
|
+
export interface CustomFactUsageItem {
|
|
509
|
+
id?: string;
|
|
510
|
+
name?: string;
|
|
511
|
+
parent_id?: string;
|
|
512
|
+
}
|
|
513
|
+
export interface CustomFactUsage {
|
|
514
|
+
alerts?: CustomFactUsageItem[];
|
|
515
|
+
integrations?: CustomFactUsageItem[];
|
|
516
|
+
policies?: CustomFactUsageItem[];
|
|
517
|
+
reports?: CustomFactUsageItem[];
|
|
518
|
+
user_configs?: CustomFactUsageItem[];
|
|
519
|
+
}
|
|
520
|
+
export interface AssignCustomFactToPoliciesResponse {
|
|
521
|
+
succeeded?: string[];
|
|
522
|
+
failed?: string[];
|
|
523
|
+
}
|
|
285
524
|
export {};
|