alternative tangled frontend (extremely wip)

feat: zod schema for tangled actor lexicon

serenity 1b9a65ba 78b5f0d6

+80
+80
src/lib/types/lexicons/sh/tangled/actor/profile.ts
··· 1 + import { z } from "zod/v4"; 2 + 3 + /** 4 + * Zod v4 schema for the ATProto lexicon: sh.tangled.actor.profile 5 + * 6 + * A declaration of a Tangled account profile. 7 + * Record key: "literal:self" 8 + */ 9 + 10 + const blobSchema = z.object({ 11 + $type: z.literal("blob"), 12 + ref: z.object({ 13 + $link: z.string(), 14 + }), 15 + mimeType: z.enum(["image/png", "image/jpeg"]), 16 + size: z.number().int().max(1000000), 17 + }); 18 + 19 + const _statsEnum = z.enum([ 20 + "merged-pull-request-count", 21 + "closed-pull-request-count", 22 + "open-pull-request-count", 23 + "open-issue-count", 24 + "closed-issue-count", 25 + "repository-count", 26 + "star-count", 27 + ]); 28 + 29 + export const shTangledActorProfileSchema = z.object({ 30 + avatar: blobSchema 31 + .describe( 32 + "Small image to be displayed next to posts from account. AKA, 'profile picture'", 33 + ) 34 + .optional(), 35 + 36 + description: z 37 + .string() 38 + .max(2560) 39 + .describe("Free-form profile description text.") 40 + .optional(), 41 + 42 + links: z 43 + .array( 44 + z 45 + .url() 46 + .describe( 47 + "Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.", 48 + ), 49 + ) 50 + .min(0) 51 + .max(5) 52 + .optional(), 53 + 54 + stats: z 55 + .array(_statsEnum.describe("Vanity stats.")) 56 + .min(0) 57 + .max(2) 58 + .optional(), 59 + 60 + bluesky: z.boolean().describe("Include link to this account on Bluesky."), 61 + 62 + location: z 63 + .string() 64 + .max(400) 65 + .describe("Free-form location text.") 66 + .optional(), 67 + 68 + pinnedRepositories: z 69 + .array(z.string().describe("AT-URI reference to a repository.")) 70 + .min(0) 71 + .max(6) 72 + .describe("Any ATURI, it is up to appviews to validate these fields.") 73 + .optional(), 74 + 75 + pronouns: z 76 + .string() 77 + .max(40) 78 + .describe("Preferred gender pronouns.") 79 + .optional(), 80 + });