Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/danielroe/roe.dev. This is the code and content for my personal website, built in Nuxt. roe.dev
Something went wrong. Try again.
TypeScript
123456789101112131415161718192021222324252627282930313233343536import type { AirspaceRecord } from 'airspace'
import { decryptJSON } from './encryption'import type lexicons from '../../../lexicons.ts'
export interface InviteView { rkey: string uri: string cid: string slug: string repo: string isActive: boolean createdAt?: string}
/** Decrypt an invite record into the shape exposed to the editor. */export function decryptInvite (r: AirspaceRecord<(typeof lexicons)['invite'], any>): InviteView { let slug = '' let repo = '' try { ;({ slug, repo } = decryptJSON<{ slug: string, repo: string }>(r.value.encrypted)) } catch (err) { console.warn(`[admin/invites] Failed to decrypt ${r.uri}:`, err instanceof Error ? err.message : err) } return { rkey: r.rkey, uri: r.uri, cid: r.cid, slug, repo, isActive: r.value.isActive, createdAt: r.value.createdAt, }}