import { randomUUID } from "node:crypto"; import { mkdir, unlink, writeFile } from "node:fs/promises"; import path from "node:path"; /** * Local-disk storage for the Media Manager (see src/services/media) — * files live under public/media//..., served for free by * Next's own static file handling for public/ (no custom GET route * needed). A deliberate v1 choice for this app's single-container Docker * deployment model, not a cloud object-storage integration — see * docker-compose.local.yaml's media volume for why this survives a * container restart. Swapping to S3-compatible storage later only means * changing this one file; every caller only ever sees a public URL. * * SVG is deliberately not in the allow-list — an uploaded SVG can embed *