import { type APIGetDevicesOptions } from "https://deno.land/x/jamf_school@0.5.0/api.ts";
Properties
Specify whether each device should include its apps in the response.
Apps will not be included in the response unless this is true
.
If you have a lot of devices with a lot of apps, this may substantially increase the size of the response. As such, on slow internet connections, this may cause the response to time out.
Select a single device by its serial number (case insensitive). The serial number must be complete; it cannot be partial.
Select only devices that match the given model identifier.
{ modelIdentifier: "iPad11,6" }
Any string is valid, but not all strings are identifiers. If an invalid identifier is given, no devices will be returned. Currently known valid identifiers will be suggested in your editor.
Select devices based on their groups. Devices that are in any of the groups will be returned.
{ groupIds: [0, 1] }
Select devices based on the user groups the device owner is in. Devices with an owner in any of the groups are returned.
{ ownerGroupIds: [0, 1, 2] }
Select devices that have an owner that matches this name. This name can be partial.
{ ownerName: "John" }
{ ownerName: "John Doe" }
NOTE: Due to buggy API behaviour, it is better to filter the returned array instead of using this option.
const devices = await api.getDevices();
const managed = devices.filter((device) => device.isManaged);
Select based on each device's management status. If this option is omitted, both managed and unmanaged device will be returned.
Management relates to whether a device has checked in with Jamf School in the past 7 days, regardless of if it is supervised.
Select based on each device's supervision status. If this option is omitted, both supervised and unsupervised devices will be returned.
Supervision relates to whether the MDM can remotely manage the device, such as installing apps and profiles (regardless of if it is managed).