import { resolveFileStore } from "./store.js";
import { v4 } from "uuid";
export async function setFile(data, givenStore) {
    const fileId = data.fileId || v4();
    const createdAt = data.createdAt || new Date().toISOString();
    const meta = {
        updatedAt: createdAt,
        createdAt,
        ...data,
        uploadedAt: data.uploadedAt || createdAt,
        fileId,
    };
    const store = resolveFileStore(meta, givenStore);
    await store.set(fileId, meta);
    return meta;
}
//# sourceMappingURL=set-file.js.map