addigy 2.5.0 → 2.6.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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CustomFact, Extension, FilevaultRequest, IAddigyConfig, IAddigyInternalAuthObject, NotificationSettings, PPPCInput, SupportedOsVersions } from './types';
1
+ import { CustomFact, Extension, FilevaultRequest, IAddigyConfig, IAddigyInternalAuthObject, MdmConfigurationPayload, NotificationSettings, PPPCInput, SupportedOsVersions } from './types';
2
2
  export * from './types';
3
3
  declare enum AlertStatus {
4
4
  Acknowledged = "Acknowledged",
@@ -67,8 +67,8 @@ export declare class Addigy {
67
67
  createCustomFact(authObject: IAddigyInternalAuthObject, name: string, script: string, scriptType: 'bash' | 'python' | 'zsh'): Promise<CustomFact>;
68
68
  getCustomFacts(authObject: IAddigyInternalAuthObject): Promise<CustomFact[]>;
69
69
  getCustomFactByName(authObject: IAddigyInternalAuthObject, name: string): Promise<CustomFact | undefined>;
70
- getMdmConfigurations(authObject: IAddigyInternalAuthObject): Promise<any[]>;
71
- getMdmConfigurationByName(authObject: IAddigyInternalAuthObject, name: string): Promise<any>;
70
+ getMdmConfigurations(authObject: IAddigyInternalAuthObject): Promise<MdmConfigurationPayload[]>;
71
+ getMdmConfigurationByName(authObject: IAddigyInternalAuthObject, name: string): Promise<MdmConfigurationPayload | undefined>;
72
72
  getFileVaultKeys(authObject: IAddigyInternalAuthObject): Promise<object[]>;
73
73
  toSnakeCase(text: string): string;
74
74
  getApnsCerts(authObject: IAddigyInternalAuthObject, next?: string, previous?: string): Promise<object[]>;
package/index.js CHANGED
@@ -932,6 +932,7 @@ class Addigy {
932
932
  return JSON.parse(res.body);
933
933
  }
934
934
  async getCustomFacts(authObject) {
935
+ var _a;
935
936
  const res = await this._addigyRequest('https://app-prod.addigy.com/api/services/facts/custom', {
936
937
  headers: {
937
938
  Cookie: `auth_token=${authObject.authToken};`,
@@ -939,7 +940,8 @@ class Addigy {
939
940
  },
940
941
  method: 'GET',
941
942
  });
942
- return JSON.parse(res.body);
943
+ const results = JSON.parse(res.body);
944
+ return (_a = results.custom_facts) !== null && _a !== void 0 ? _a : [];
943
945
  }
944
946
  async getCustomFactByName(authObject, name) {
945
947
  const facts = await this.getCustomFacts(authObject);
@@ -948,14 +950,14 @@ class Addigy {
948
950
  async getMdmConfigurations(authObject) {
949
951
  var _a;
950
952
  try {
951
- let res = await this._addigyRequest('https://app-prod.addigy.com/api/mdm/profiles', {
953
+ let res = await this._addigyRequest('https://app.addigy.com/api/v2/mdm/configurations/profiles', {
952
954
  headers: {
953
955
  Cookie: `auth_token=${authObject.authToken};`,
954
956
  origin: 'https://app-prod.addigy.com',
955
957
  },
956
958
  method: 'GET',
957
959
  });
958
- return (_a = JSON.parse(res.body)) === null || _a === void 0 ? void 0 : _a.mdm_payloads;
960
+ return (_a = JSON.parse(res.body)) === null || _a === void 0 ? void 0 : _a.payloads;
959
961
  }
960
962
  catch (err) {
961
963
  throw err;
package/package.json CHANGED
@@ -59,7 +59,7 @@
59
59
  "tsc": "tsc -p tsconfig.build.json"
60
60
  },
61
61
  "types": "index.d.ts",
62
- "version": "2.5.0",
62
+ "version": "2.6.1",
63
63
  "volta": {
64
64
  "node": "14.17.1",
65
65
  "yarn": "1.22.10"
package/types.d.ts CHANGED
@@ -194,3 +194,27 @@ export interface CustomFactOSArchitecturesData {
194
194
  script: string;
195
195
  md5_hash: string;
196
196
  }
197
+ export interface MdmConfigurations {
198
+ payloads: Payload[];
199
+ staged_payloads: any[];
200
+ policies_mdm_payloads: PoliciesMdmPayload[];
201
+ }
202
+ export interface MdmConfigurationPayload {
203
+ addigy_payload_type: string;
204
+ addigy_payload_version?: number;
205
+ orgid: string;
206
+ payload_display_name: string;
207
+ payload_group_id: string;
208
+ payload_identifier: string;
209
+ payload_priority: number;
210
+ payload_type: string;
211
+ payload_uuid: string;
212
+ payload_version: number;
213
+ policy_restricted: boolean;
214
+ has_manifest?: boolean;
215
+ }
216
+ export interface PoliciesMdmPayload {
217
+ orgid: string;
218
+ configuration_id: string;
219
+ policy_id: string;
220
+ }