import { Oura } from "https://deno.land/x/oura_api@0.5.7/mod.ts";
export const getSleepScore = async (ouraToken) => {
const oura = new Oura(ouraToken);
const today = new Date().toISOString().split("T")[0];
const yesterday = (d => (d.setDate(d.getDate() - 1), d))(new Date()).toISOString().split("T")[0];
const docs = await oura.getSleepDocuments(yesterday, today);
return docs.data.reverse()[0];
};