import type { DirectoryEntry } from '~/types'; import type { Warren } from '~/types/warrens'; export async function getWarrens(): Promise> { const arr: Warren[] = await $fetch(getApiUrl('warrens'), { method: 'GET', }); const warrens: Record = {}; for (const warren of arr) { warrens[warren.id] = warren; } return warrens; } export async function getWarrenDirectory( path: string ): Promise { const entries: DirectoryEntry[] = await $fetch( getApiUrl(`warrens/${path}`), { method: 'GET', } ); return entries; }