decentralised sync engine
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: prism types

serenity 1304fa46 5bc32cce

+27
+27
src/lib/types/prism.ts
··· 1 + import { didSchema, nsidSchema } from "@/lib/types/atproto"; 2 + import { z } from "zod"; 3 + 4 + const 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 + 14 + export 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 + }); 27 + export type PrismCommit = z.infer<typeof prismCommitSchema>;