import type { AppContext } from '@voltro/runtime' import { rowAsOf } from '@voltro/plugin-row-history' const execute = async (input: { id: string; at: number }, ctx: AppContext) => { const snapshot = await rowAsOf(ctx.store, 'documents', input.id, ctx.request.subject.tenantId, input.at) if (snapshot === null) return null return { title: snapshot['title'] as string, content: snapshot['content'] as string, } } export default execute