File
Blob: src/worker/serializers/inbox.ts
| 1 | import { InboxInfo } from "@/shared/contracts"; |
| 2 | import type { InboxRecord } from "@/worker/types"; |
| 3 | import { ttlHoursFromInbox } from "@/worker/services/inbox/shared"; |
| 4 | |
| 5 | export function toInboxInfo(inbox: InboxRecord) { |
| 6 | return InboxInfo.create({ |
| 7 | address: inbox.fullAddress, |
| 8 | isPermanent: inbox.isPermanent, |
| 9 | ttlHours: ttlHoursFromInbox(inbox), |
| 10 | expiresAt: inbox.expiresAt?.toISOString() ?? null, |
| 11 | createdAt: inbox.createdAt.toISOString(), |
| 12 | }); |
| 13 | } |