import { fetchAPI } from './requests.js';
import { useCache } from './cache.js';
export async function updateACL(itemType, itemId, target, permissions) {
    return await fetchAPI('PATCH', 'acl/:itemType/:itemId', { target, permissions }, itemType, itemId);
}
export async function getACL(itemType, itemId) {
    return await useCache('acl', `${itemType}/${itemId}`, () => fetchAPI('GET', 'acl/:itemType/:itemId', {}, itemType, itemId));
}
export async function addToACL(itemType, itemId, target) {
    return await fetchAPI('PUT', 'acl/:itemType/:itemId', target, itemType, itemId);
}
export async function removeFromACL(itemType, itemId, target) {
    return await fetchAPI('DELETE', 'acl/:itemType/:itemId', target, itemType, itemId);
}
