//native
/**
* List revisions
* List the policy revisions SecureTrack recorded for a device. Get the device ID from List devices.
*/
export async function main(auth: RT.TufinSecuretrack, device_id: number) {
const base = auth.base_url.replace(/\/+$/, "")
const url = new URL(`${base}/securetrack/api/devices/${device_id}/revisions`)
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: `Basic ${btoa(`${auth.username}:${auth.password}`)}`,
Accept: "application/json",
},
})
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 6 hours ago