import { type Client } from "https://deno.land/x/jamf_school@0.5.0/mod.ts";
A high-level abstraction over the Jamf School API that allows you to reason about it as returning objects with methods, instead of raw data.
As the implementations of these objects are not public, instance checks must
be done using the type
property on each object.
Lower-level actions can be done using an API
object. This data can be
upgraded to an object using one of the "create" methods on your Client
.
Methods
Create a device object with data from the API.
If you don't already have the data, you may want getDeviceById
,
getDeviceBySerialNumber
, or getDevices
.
Create a device group object with data from the API.
If you don't already have the data, you may want getDeviceGroupById
or
getDeviceGroups
.
Create a user object with data from the API.
If you don't already have the data, you may want getUserById
or
getUsers
.
Create an app object with data from the API.
If you don't already have the data, you may want getApps
.
Create a site object with data from the API.
If you don't already have the data, you may want getLocations
.
Create a user group object with data from the API.
If you don't already have the data, you may want getUserGroupById
or
getUserGroups
.
Create a profile object with data from the API.
If you don't already have the data, you may want getProfileById
or
getProfiles
.
(Read) Get a single user group by its name.
(Read) Get a single device by its serial number.
(Read) Get all devices in the given groups, without duplicates.
If a device is in more than one of the groups, it is only included once.
const groups = await Promise.all([
client.getDeviceGroupById(2),
client.getDeviceGroupById(3),
client.getDeviceGroupById(4),
]);
const devices = await client.getDevicesInGroups(groups);
If you already know the IDs of the groups to use, you can skip requesting the device group objects by using object literals.
const devices = await client.getDevicesInGroups([
{ id: 2 },
{ id: 3 },
{ id: 4 },
])
(Read) Get a single device group by its ID.
(Read) Get a single device group by its name.
(Read) Get a single app by its bundle identifier
If no apps with the given bundle ID exist, it returns null. If more than one exists, an error is thrown.
For example, "com.agilebits.onepassword-ios"
(Read) Get a single app by its name.
If no apps with the name exist, it returns null. If more than one app exists, an error is thrown.