10 lines
526 B
TypeScript
10 lines
526 B
TypeScript
import { backupItemDtoSchema } from "@mmapp/contracts/backups"
|
|
import type { backupEntries } from "../db/schema.js"
|
|
export function mapBackupEntry(row: typeof backupEntries.$inferSelect) {
|
|
return backupItemDtoSchema.parse({
|
|
id: row.id, serverId: row.serverId, serverName: row.serverName, filename: row.filename,
|
|
sizeBytes: row.sizeBytes, createdAt: new Date(row.createdAt).toISOString(), kind: row.kind,
|
|
notes: row.notes ?? undefined, storage: row.storage, s3Key: row.s3Key, uploadError: row.uploadError,
|
|
})
|
|
}
|