Implementa o MVP do Adaptador de Planilhas no Elo Pro.

O módulo usa a identidade Supabase, isola cada workspace e registra storage, TTL, runner e biblioteca XLSX como decisões ainda abertas.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
camilafagundesandCursor committed 2026-10-02 23:02:00 -03:00
commit 6e23f1533b
144 files changed
+19060

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
import path from "node:path";
import { LocalPrivateStorage } from "./local";
import { createSupabaseStorage } from "./supabase";
import type { ObjectStorage } from "./memory";
export function createStorage(): ObjectStorage {
const url = process.env.NEXT_PUBLIC_SUPABASE_URL;
const serviceKey = process.env.SUPABASE_SERVICE_ROLE_KEY;
const bucket = process.env.SUPABASE_STORAGE_BUCKET;
if (url && serviceKey && bucket) return createSupabaseStorage(url, serviceKey, bucket);
if (process.env.NODE_ENV === "production") {
throw new Error("Armazenamento privado não configurado. A decisão de object storage continua aberta.");
}
return new LocalPrivateStorage(path.join(process.cwd(), ".data", "storage"));
}