export const COLLECTIONS = { wiki: "wiki.lichen.wiki", note: "wiki.lichen.note", noteRevision: "wiki.lichen.noteRevision", membership: "wiki.lichen.membership", memberRequest: "wiki.lichen.memberRequest", // Legacy: no longer minted or ingested from the firehose. Already-materialized // bookmark rows are kept; the constant remains only for backfill/exists refs. bookmark: "wiki.lichen.bookmark", // External NSID we don't own or publish (lexicon-community). All new bookmarks // are minted and ingested here. communityBookmark: "community.lexicon.bookmarks.bookmark", // Open-wiki contribution review: the submitter's envelope and the owner/admin's // decision. Web, PoC — enforcement lives in handler code and the appview queue. contribution: "wiki.lichen.contribution", contributionApproval: "wiki.lichen.contributionApproval", } as const; // Dev/PoC scope: transition:generic grants full PDS write access so we can mint // the open-contribution records without the granular permission-set being honored // by the PDS. A production permission-set should scope this down. export const OAUTH_SCOPE = `atproto transition:generic include:wiki.lichen.permissions include:community.lexicon.bookmarks.authManageBookmarks blob:*/*`; export type MemberRole = "admin" | "contributor" | "viewer"; export function normalizeRole(raw: string | null | undefined): MemberRole { if (raw === "admin" || raw === "viewer") return raw; return "contributor"; }