decentralised message store
at main 724 B view raw
1import { didSchema, nsidSchema } from "@/lib/types/atproto"; 2import { z } from "zod"; 3 4const prismEventSchema = z.object({ 5 did: didSchema, 6 time_us: z.number(), 7 kind: z.union([ 8 z.literal("commit"), 9 z.literal("identity"), 10 z.literal("account"), 11 ]), 12}); 13 14export const prismCommitSchema = prismEventSchema.safeExtend({ 15 commit: z.object({ 16 rev: z.string(), 17 operation: z.union([ 18 z.literal("create"), 19 z.literal("update"), 20 z.literal("delete"), 21 ]), 22 collection: nsidSchema, 23 rkey: z.string(), 24 record: z.record(z.string(), z.unknown()), 25 }), 26}); 27export type PrismCommit = z.infer<typeof prismCommitSchema>;