import { getTaskStore } from "./store.js";
import { v4 } from "uuid";
export async function setTask(data) {
    const store = await getTaskStore();
    const updatedAt = new Date().toISOString();
    const taskId = data.taskId || v4();
    const document = {
        createdAt: data.createdAt || updatedAt,
        ...data,
        taskId,
        updatedAt,
    };
    await store.set(data.taskId, document);
    return document;
}
//# sourceMappingURL=set-task.js.map