founder-schema 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feed.js","sourceRoot":"","sources":["../src/feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,gFAAgF;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACxC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AACjC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC;AAC5B,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE3C,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAC3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACxC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,iEAAiE;AACjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAClD,eAAe;AACf,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE7D,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAC7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC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C,CAAC,MAAM,CAAC;IAC7C,MAAM,EAAE,kBAAkB;IAC1B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAGH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,WAAW,EAAE,iBAAiB;IAC9B,SAAS,EAAE,cAAc;IACzB,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE;CAC7B,CAAC,CAAC;AAGH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,WAAW,EAAE,iBAAiB;IAC9B,SAAS,EAAE,cAAc;IACzB,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE;CACxB,CAAC,CAAC;AAGH;mEACmE;AACnE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,IAAI,EAAE,cAAc;CACrB,CAAC,CAAC","sourcesContent":["/**\n * founder-schema — Feed wire shapes: post, poll, comment, reaction\n *\n * ADAPTED FROM `jansathi-community-schema`, NOT DEPENDENT ON IT.\n *\n * The user ruled on 2026-09-21 that Founder Circle is a standalone app, so\n * these shapes are copied and cut down rather than imported. The reason is\n * worth keeping: `jansathi-community-schema` encodes Jansathi's reach levels,\n * community designations, official-area kinds and crowdfunding audiences.\n * Depending on it would put all of that permanently inside our contract for a\n * feed that has none of those concepts, and would mean a Jansathi publish can\n * break this product.\n *\n * DELIBERATELY NOT PORTED, so nobody \"restores\" them:\n * - the five civic verticals (lost_found, suggestions_complaints,\n * donate_item, crowdfunding, event). `contentKind` here is post | poll\n * only, and comments and reactions key off that narrower union.\n * - official communities, designations, identity verification badges.\n * - social score, and the whole area-proximity ranking vocabulary\n * (local / district / state / national / global).\n * - `areaLineage` as a REQUIRED authorship snapshot. Jansathi gates its\n * composer on a declared residence resolving to Indian district level or\n * deeper; the user ruled location is never mandatory here, so nothing in\n * this file requires one.\n * - anonymous posting, which in Jansathi is gated on identity verification\n * we do not have. A founders' network is an identified network.\n *\n * @module founder-schema/feed\n */\n\nimport { z } from 'zod';\nimport { httpUrlSchema, objectIdSchema, paginationQuerySchema, usernameSchema } from './common.js';\nimport { topicSchema } from './onboarding.js';\n\n// ─── Limits ──────────────────────────────────────────────────────────────────\n\n/**\n * Exported because the composer must count down to the SAME number the server\n * rejects at. A client-side limit that disagrees with the server is a message\n * a member cannot send and cannot see why.\n */\nexport const POST_MAX_BODY_CHARS = 5000;\n/**\n * Total attachments on one post, images and videos together.\n *\n * ONE cap over ONE ordered list, rather than Jansathi's separate image and\n * video arrays. A member who posts a screenshot, then a clip, then another\n * screenshot means that order, and two parallel arrays cannot express it: the\n * card would show both images and then the video, which is not what was\n * written.\n */\nexport const POST_MAX_MEDIA = 10;\n/**\n * Topics per item.\n *\n * Capped low on purpose: a post tagged with everything is about nothing, and\n * one tagged with ten matches every member, which is how a relevance feature\n * turns back into a chronological one.\n */\nexport const MAX_TOPICS = 3;\nexport const COMMENT_MAX_BODY_CHARS = 2000;\n\nexport const POLL_QUESTION_MAX_CHARS = 280;\nexport const POLL_OPTION_MAX_CHARS = 80;\nexport const POLL_MIN_OPTIONS = 2;\nexport const POLL_MAX_OPTIONS = 6;\n/** 5 minutes. Below this a poll closes before anyone sees it. */\nexport const POLL_MIN_DURATION_MS = 5 * 60 * 1000;\n/** 30 days. */\nexport const POLL_MAX_DURATION_MS = 30 * 24 * 60 * 60 * 1000;\n\n// ─── Enums ───────────────────────────────────────────────────────────────────\n\n/**\n * What can appear in the feed. Two kinds, not seven.\n *\n * Engagement is keyed by `(contentKind, contentId)` so one engagement bar\n * serves both, and comments hang off the same pair. Adding a kind later is\n * additive; the union is deliberately narrow now so the client never has to\n * handle a kind this product does not have.\n */\nexport const CONTENT_KIND_VALUES = ['post', 'poll'] as const;\nexport const contentKindSchema = z.enum(CONTENT_KIND_VALUES);\nexport type ContentKind = z.infer<typeof contentKindSchema>;\n\n/**\n * Reactions. Jansathi's `support` is dropped: it exists for reacting to a\n * civic complaint or a lost-and-found notice, which this feed does not carry.\n *\n * ⚠️ These values are stored per reaction row, so removing one orphans data.\n * Append only.\n */\nexport const REACTION_TYPE_VALUES = ['like', 'celebrate', 'insightful', 'curious'] as const;\nexport const reactionTypeSchema = z.enum(REACTION_TYPE_VALUES);\nexport type ReactionType = z.infer<typeof reactionTypeSchema>;\n\n/**\n * Feed ordering.\n *\n * `new` is the default here, unlike Jansathi where `hot` leads. A hot ranking\n * needs volume to be meaningful, and a brand-new network ranking a handful of\n * posts by a blended score mostly hides the newest thing somebody just wrote.\n * Revisit when there is enough content for `hot` to mean anything.\n */\nexport const FEED_SORT_VALUES = ['new', 'top'] as const;\nexport const feedSortSchema = z.enum(FEED_SORT_VALUES);\nexport type FeedSort = z.infer<typeof feedSortSchema>;\n\n/**\n * Counts keyed by reaction type, e.g. `{ like: 4, celebrate: 1 }`. Only the\n * reactions an item actually has need appear.\n *\n * ⚠️ `partialRecord`, NOT `record`. In Zod 4 an enum-keyed `z.record` is\n * EXHAUSTIVE: it demands every key, so `{ like: 4 }` fails with three missing\n * keys and `{}` fails with four. That would force the server to ship a zero for\n * every reaction on every item, and the day a fifth reaction is added every\n * previously stored payload and every older client stops parsing.\n * `partialRecord` keeps the key validation without the exhaustiveness, so an\n * unknown key like Jansathi's `support` is still refused.\n */\nexport const reactionCountsSchema = z.partialRecord(\n reactionTypeSchema,\n z.number().int().nonnegative(),\n);\nexport type ReactionCounts = z.infer<typeof reactionCountsSchema>;\n\n// ─── Author byline ───────────────────────────────────────────────────────────\n\n/**\n * The author as a card renders them.\n *\n * Every field here is LIVE, joined against the profile at read time rather\n * than frozen onto the post at write time. So a renamed handle, a new avatar\n * or an edited headline updates on old posts, and the byline link always\n * targets the current username instead of 404ing on a handle that moved.\n *\n * Jansathi additionally snapshots `localName` (\"where the author was when\n * posting\"). Not ported: location is optional here, so a byline that depends\n * on one would be blank for anyone who never set it.\n */\nexport const feedAuthorSchema = z.object({\n userId: z.string(),\n username: usernameSchema,\n displayName: z.string(),\n /** Server-generated or from the login provider, never member-typed, so a\n * plain URL check. Same reasoning as `avatarUrl` on the profile. */\n avatarUrl: z.url().optional(),\n /** The author's one-line headline, live-joined. Gives a founders' byline\n * the context a civic byline got from an area label. */\n headline: z.string().optional(),\n});\nexport type FeedAuthor = z.infer<typeof feedAuthorSchema>;\n\n// ─── Media ───────────────────────────────────────────────────────────────────\n\n/**\n * `width` and `height` are required so a card can reserve the right box before\n * the image loads. Without them every image arrival shifts the feed under the\n * reader's thumb.\n *\n * URLs here come from our own upload pipeline, so they take a plain `z.url()`\n * rather than `httpUrlSchema`. ⚠️ If a \"paste an image link\" path is ever\n * added, these become member-supplied and must move to `httpUrlSchema`.\n */\nexport const feedImageSchema = z.object({\n kind: z.literal('image'),\n url: z.url(),\n thumbnailUrl: z.url().optional(),\n width: z.number().int().positive(),\n height: z.number().int().positive(),\n /** Author-supplied alt text. Optional, and worth asking for. */\n alt: z.string().max(280).optional(),\n});\nexport type FeedImage = z.infer<typeof feedImageSchema>;\n\nexport const feedVideoSchema = z.object({\n kind: z.literal('video'),\n url: z.url(),\n /** Poster frame, server-extracted. Required: a video with no poster is a\n * black rectangle in the feed. */\n thumbnailUrl: z.url(),\n width: z.number().int().positive(),\n height: z.number().int().positive(),\n /** Seconds. */\n duration: z.number().positive(),\n});\nexport type FeedVideo = z.infer<typeof feedVideoSchema>;\n\n/**\n * One ordered list, discriminated on `kind`, so the carousel renders\n * attachments in the order they were attached and can switch on the kind\n * without inspecting fields.\n */\nexport const feedMediaSchema = z.discriminatedUnion('kind', [feedImageSchema, feedVideoSchema]);\nexport type FeedMedia = z.infer<typeof feedMediaSchema>;\n\n// ─── Link preview ────────────────────────────────────────────────────────────\n\n/**\n * Preview for the first link in a post body. Server-derived at write time and\n * stored, never re-fetched at render: a card that fetches a third-party page\n * per scroll leaks every reader's address to that site and blocks the feed on\n * somebody else's latency.\n *\n * `url` takes `httpUrlSchema` because it came out of text a member typed.\n * `imageUrl` is whatever the remote page advertised, so it is not ours either,\n * and a consumer still treats it as untrusted at render.\n */\nexport const linkPreviewSchema = z.object({\n url: httpUrlSchema,\n title: z.string().max(200).optional(),\n description: z.string().max(500).optional(),\n imageUrl: httpUrlSchema.optional(),\n});\nexport type LinkPreview = z.infer<typeof linkPreviewSchema>;\n\n// ─── Viewer state ────────────────────────────────────────────────────────────\n\n/**\n * What THIS viewer has done to this item, computed per request.\n *\n * Optional as a block, because an unauthenticated or server-rendered read has\n * no viewer. ⚠️ A client must treat an absent `viewer` as \"no state known\",\n * never as \"has not reacted\": rendering an empty reaction button off a missing\n * block is how a member sees their own reaction disappear on reload.\n */\nexport const viewerStateSchema = z.object({\n reaction: reactionTypeSchema.nullable(),\n bookmarked: z.boolean(),\n isAuthor: z.boolean(),\n\n /**\n * What this viewer may DO, decided by the server and sent as plain answers.\n *\n * Not role data for the client to reason about. The moment a client derives\n * \"can I edit this\" from roles and ownership, that derivation is a second\n * implementation of the rule, it drifts from the server's, and the drift is\n * invisible until the two disagree: either a button that 403s or a button\n * that should not have been there. `isAuthor` stays because the byline reads\n * differently for your own post, not because the client should compute rights\n * from it.\n *\n * `canEdit` is false once the edit window closes, so it is not simply\n * `isAuthor`.\n */\n canEdit: z.boolean(),\n canDelete: z.boolean(),\n canReport: z.boolean(),\n});\nexport type ViewerState = z.infer<typeof viewerStateSchema>;\n\n// ─── Post ────────────────────────────────────────────────────────────────────\n\n/**\n * A post as the feed and the single-post page receive it.\n *\n * Counts are denormalised onto the row so one document serves a whole card.\n *\n * No `score` and no up/down vote. Jansathi's signed score exists to rank civic\n * content by community judgement, and a downvote arrow on a founder's first\n * post is a different product. Reactions and comments are the engagement axes\n * here. Adding a score later is additive; removing a visible downvote after\n * members have used it is not.\n */\nexport const feedPostSchema = z.object({\n id: objectIdSchema,\n contentKind: z.literal('post'),\n author: feedAuthorSchema,\n\n /**\n * The WHOLE body, never a server-side truncation.\n *\n * So there is no \"was this shortened\" flag and no second fetch to read the\n * rest: the card clamps visually and expands in place. At a 5,000 character\n * cap a page of twenty posts is small enough that trimming would cost a round\n * trip to save nothing. If that ever stops being true, a truncation flag is\n * an additive change; a client that has been guessing is not.\n */\n text: z.string().max(POST_MAX_BODY_CHARS),\n /** Ordered as the author attached them. */\n media: z.array(feedMediaSchema).max(POST_MAX_MEDIA),\n /** Present only when the body had an embeddable link. */\n linkPreview: linkPreviewSchema.optional(),\n /**\n * What this post is ABOUT, from the same vocabulary a member picks as their\n * interests. This is the whole mechanism behind a relevant feed: matching is\n * an intersection of two lists drawn from one enum, not a guess from who\n * wrote it.\n *\n * ⚠️ An EMPTY array is allowed and means the post is untagged, so interest\n * matching cannot reach it. That is a real consequence, not a nuance: an\n * untagged post is only ever found chronologically.\n */\n topics: z.array(topicSchema).max(MAX_TOPICS),\n\n commentCount: z.number().int().nonnegative(),\n reactionCounts: reactionCountsSchema,\n\n createdAt: z.iso.datetime(),\n /** Null when never edited. The edit window is the server's to enforce. */\n editedAt: z.iso.datetime().nullable(),\n\n viewer: viewerStateSchema.optional(),\n});\nexport type FeedPost = z.infer<typeof feedPostSchema>;\n\n// ─── Poll ────────────────────────────────────────────────────────────────────\n\n/**\n * One choice. `index` is the identifier a vote refers to, not the label:\n * sending indices avoids ambiguity between two options whose labels differ\n * only by case, spacing or an invisible character.\n */\nexport const pollOptionSchema = z.object({\n index: z\n .number()\n .int()\n .min(0)\n .max(POLL_MAX_OPTIONS - 1),\n label: z.string().min(1).max(POLL_OPTION_MAX_CHARS),\n voteCount: z.number().int().nonnegative(),\n});\nexport type PollOption = z.infer<typeof pollOptionSchema>;\n\n/**\n * A poll. Its own kind, not a post with extra fields, because votes are their\n * own records keyed by (poll, voter) and a post has nothing equivalent.\n *\n * Polls are not editable. Changing a question or an option after a vote has\n * been cast silently re-purposes that vote. Closing early is allowed; editing\n * is not.\n */\nexport const feedPollSchema = z.object({\n id: objectIdSchema,\n contentKind: z.literal('poll'),\n author: feedAuthorSchema,\n\n question: z.string().min(1).max(POLL_QUESTION_MAX_CHARS),\n options: z.array(pollOptionSchema).min(POLL_MIN_OPTIONS).max(POLL_MAX_OPTIONS),\n /** Unique voters, not votes: with multi-select the two differ. */\n totalVoters: z.number().int().nonnegative(),\n allowsMultipleChoices: z.boolean(),\n closesAt: z.iso.datetime(),\n /**\n * Whether the poll is closed, decided by the SERVER's clock.\n *\n * Derivable from `closesAt`, and deliberately sent anyway: a device with a\n * wrong clock would otherwise show a live poll as finished, or offer a vote\n * the server then rejects, and the member sees a control that lies. `closesAt`\n * stays for rendering \"closes in 2 days\"; this is what gates the control.\n */\n isClosed: z.boolean(),\n\n /** As on a post. A poll is feed content and is matched the same way. */\n topics: z.array(topicSchema).max(MAX_TOPICS),\n\n commentCount: z.number().int().nonnegative(),\n reactionCounts: reactionCountsSchema,\n\n createdAt: z.iso.datetime(),\n /** Always null. Kept so one byline component renders both kinds. */\n editedAt: z.iso.datetime().nullable(),\n\n viewer: viewerStateSchema\n .extend({\n /** Indices this viewer chose. Empty means not voted yet, and it is\n * always populated for the viewer: a voter can always see their own\n * answer even where others' results are hidden. */\n votedOptionIndices: z.array(z.number().int().nonnegative()),\n })\n .optional(),\n});\nexport type FeedPoll = z.infer<typeof feedPollSchema>;\n\n// ─── The feed item union ─────────────────────────────────────────────────────\n\n/**\n * Discriminated on `contentKind`, so a client narrows with a switch and the\n * compiler catches an unhandled kind the day one is added. A plain union would\n * need every field checked by hand and would silently accept a hybrid.\n */\nexport const feedItemSchema = z.discriminatedUnion('contentKind', [feedPostSchema, feedPollSchema]);\nexport type FeedItem = z.infer<typeof feedItemSchema>;\n\n// ─── Comments ────────────────────────────────────────────────────────────────\n\n/**\n * A comment, one level of nesting only: a reply to a comment is allowed, a\n * reply to a reply is not. Two levels stay readable on a phone; three do not,\n * and the server is what enforces it.\n */\nexport const feedCommentSchema = z.object({\n id: objectIdSchema,\n contentKind: contentKindSchema,\n contentId: objectIdSchema,\n /** Null for a top-level comment. A non-null value may only name a top-level\n * comment, never a reply. */\n parentCommentId: objectIdSchema.nullable(),\n author: feedAuthorSchema,\n\n text: z.string().max(COMMENT_MAX_BODY_CHARS),\n\n /** Meaningful only on a top-level comment; always 0 on a reply. */\n replyCount: z.number().int().nonnegative(),\n reactionCounts: reactionCountsSchema,\n\n createdAt: z.iso.datetime(),\n editedAt: z.iso.datetime().nullable(),\n\n /** No `bookmarked`: the post is the right thing to save, not a comment. */\n viewer: viewerStateSchema.omit({ bookmarked: true }).optional(),\n});\nexport type FeedComment = z.infer<typeof feedCommentSchema>;\n\n// ─── Queries ─────────────────────────────────────────────────────────────────\n\n/**\n * The feed query. Inherits `limit` and `cursor`, which already tolerate an\n * emptied control rather than answering 400.\n *\n * `authorId` powers \"posts by this founder\" on a profile page, so the profile\n * feed and the main feed are the same endpoint and cannot drift apart.\n */\nexport const feedQuerySchema = paginationQuerySchema.extend({\n sort: feedSortSchema.default('new'),\n authorId: objectIdSchema.optional(),\n});\nexport type FeedQuery = z.infer<typeof feedQuerySchema>;\n\nexport const commentsQuerySchema = paginationQuerySchema.extend({\n /** Omitted lists top-level comments; set, it lists that comment's replies. */\n parentCommentId: objectIdSchema.optional(),\n});\nexport type CommentsQuery = z.infer<typeof commentsQuerySchema>;\n\n// ─── Write bodies ────────────────────────────────────────────────────────────\n\n/**\n * ⚠️ Every write body below is its own object with NO defaults, and none of\n * them is built with `.pick().partial()`. `.partial()` does not switch off\n * `.default()`, so a patch body built that way rewrites defaulted fields on\n * every request. See `updateFounderProfileBodySchema` for the incident.\n */\n\n/**\n * An attachment on the way IN: a reference to something already uploaded, and\n * deliberately not a URL.\n *\n * Upload happens first, straight to storage, and the composer sends back the\n * key it was given. The server resolves that key to the URL, dimensions and\n * poster frame it already knows, and those become the read shape.\n *\n * ⚠️ The first draft of this took the full read shape, URL included. That is\n * the same hole that was closed on the profile: a URL in a write body is a\n * member-supplied URL, so a post could have carried `javascript:` in an image\n * source, and nothing downstream re-checks a value the server itself stored.\n * Taking a key instead removes the question rather than validating it, and it\n * also stops a member pointing a post at somebody else's file.\n *\n * `width`, `height` and `duration` are NOT accepted here either. They are\n * properties of the uploaded object, so the server reads them from the object;\n * taking them from the client would let a caller claim a 1x1 image and collapse\n * the card.\n *\n * FORMAT, set by the backend (hary, 2026-09-21), minted server-side and never\n * by a client:\n *\n * media/<userId>/<uuid>.<ext>\n *\n * ⚠️ THIS SCHEMA IS THE FIRST OF THREE CHECKS AND THE WEAKEST. It proves the\n * key is well FORMED. It cannot prove the two things that actually matter, and\n * nobody should read a green parse as though it had:\n *\n * 1. OWNERSHIP. The `userId` segment is what makes \"is this your object\"\n * checkable, and the backend compares it against the authenticated caller.\n * A pattern happily accepts a perfectly well-formed key belonging to\n * somebody else, which is the exact attack taking a key was meant to stop.\n * 2. EXISTENCE. The backend calls HeadObject before writing the post, so a\n * key for an object nobody uploaded cannot be committed.\n *\n * The length ceiling and the traversal refusal below are redundant against this\n * pattern, which is anchored and admits no dots outside the extension. They are\n * kept on purpose: they are what still holds if this pattern is ever loosened.\n */\nexport const UPLOAD_KEY_MAX_CHARS = 300;\n\n/**\n * ⚠️ IMAGES ONLY, and that is now a product decision rather than an oversight.\n *\n * The asymmetry was real and was raised: `feedVideoSchema` is in the read union\n * and a card can render a video, while nothing could ever upload one. The user\n * settled it on 2026-09-21: members upload images, and share video by putting a\n * link in the post text, which the client renders inline. So the minter stays\n * images-only by intent.\n *\n * `feedVideoSchema` is deliberately KEPT. Widening the write path later is\n * additive; removing video from the read union once a client handles it is not.\n * A test named for refusing a video key holds this visible, so whoever adds\n * video uploads has to delete a test that says out loud why it exists.\n */\nexport const UPLOAD_KEY_EXTENSIONS = ['jpg', 'jpeg', 'png', 'webp', 'gif'] as const;\n\nexport const uploadKeySchema = z\n .string()\n .trim()\n .min(1)\n .max(UPLOAD_KEY_MAX_CHARS)\n .regex(\n /^media\\/[0-9a-f]{24}\\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\.(jpg|jpeg|png|webp|gif)$/,\n 'Invalid upload reference',\n )\n .refine((k) => !k.includes('..'), { message: 'Invalid upload reference' });\nexport type UploadKey = z.infer<typeof uploadKeySchema>;\n\nexport const attachedMediaSchema = z.object({\n uploadKey: uploadKeySchema,\n /** Author-supplied alt text, the one media field a member does write. */\n alt: z.string().trim().max(280).optional(),\n});\nexport type AttachedMedia = z.infer<typeof attachedMediaSchema>;\n\n/**\n * A post must carry something. Text alone, media alone, or both; empty is\n * refused here rather than reaching the feed as a blank card.\n */\nexport const createPostBodySchema = z\n .object({\n text: z.string().trim().max(POST_MAX_BODY_CHARS).optional(),\n /** Already uploaded. See `attachedMediaSchema`. Order is preserved. */\n media: z.array(attachedMediaSchema).max(POST_MAX_MEDIA).optional(),\n /** Absent means untagged, which means interest matching cannot find it. */\n topics: z.array(topicSchema).max(MAX_TOPICS).optional(),\n })\n .refine((b) => Boolean(b.text?.length) || Boolean(b.media?.length), {\n message: 'Write something or add a photo',\n path: ['text'],\n });\nexport type CreatePostBody = z.infer<typeof createPostBodySchema>;\n\n/** Only the text is editable. Changing media after the fact makes every\n * earlier reply look like a reply to something else. */\nexport const updatePostBodySchema = z.object({\n text: z.string().trim().min(1).max(POST_MAX_BODY_CHARS),\n});\nexport type UpdatePostBody = z.infer<typeof updatePostBodySchema>;\n\nexport const createPollBodySchema = z\n .object({\n question: z.string().trim().min(1).max(POLL_QUESTION_MAX_CHARS),\n options: z\n .array(z.object({ label: z.string().trim().min(1).max(POLL_OPTION_MAX_CHARS) }))\n .min(POLL_MIN_OPTIONS)\n .max(POLL_MAX_OPTIONS),\n /**\n * Duration from now, NOT an absolute closing time. A client whose clock is\n * wrong would otherwise open a poll that is already closed, and the member\n * would have no way to tell why.\n */\n durationMs: z.number().int().min(POLL_MIN_DURATION_MS).max(POLL_MAX_DURATION_MS),\n allowsMultipleChoices: z.boolean(),\n topics: z.array(topicSchema).max(MAX_TOPICS).optional(),\n })\n .refine(\n (b) => {\n const seen = new Set<string>();\n for (const o of b.options) {\n const key = o.label.trim().toLowerCase();\n if (seen.has(key)) return false;\n seen.add(key);\n }\n return true;\n },\n { message: 'Poll options must be different from each other', path: ['options'] },\n );\nexport type CreatePollBody = z.infer<typeof createPollBodySchema>;\n\n/** Cast or change a vote. The server upserts on (poll, voter), so voting\n * twice replaces rather than doubles. */\nexport const castVoteBodySchema = z.object({\n optionIndices: z\n .array(\n z\n .number()\n .int()\n .min(0)\n .max(POLL_MAX_OPTIONS - 1),\n )\n .min(1)\n .max(POLL_MAX_OPTIONS),\n});\nexport type CastVoteBody = z.infer<typeof castVoteBodySchema>;\n\nexport const createCommentBodySchema = z.object({\n text: z.string().trim().min(1).max(COMMENT_MAX_BODY_CHARS),\n /** Null for a top-level comment. */\n parentCommentId: objectIdSchema.nullable(),\n});\nexport type CreateCommentBody = z.infer<typeof createCommentBodySchema>;\n\nexport const updateCommentBodySchema = z.object({\n text: z.string().trim().min(1).max(COMMENT_MAX_BODY_CHARS),\n});\nexport type UpdateCommentBody = z.infer<typeof updateCommentBodySchema>;\n\n/** Set or clear a reaction. `null` clears it; at most one per viewer per item. */\nexport const setReactionBodySchema = z.object({\n reaction: reactionTypeSchema.nullable(),\n});\nexport type SetReactionBody = z.infer<typeof setReactionBodySchema>;\n\n// ─── Engagement responses ────────────────────────────────────────────────────\n\n/**\n * Returned by the reaction endpoint so the card can render the authoritative\n * result without a follow-up read. Without the fresh counts a client has to\n * guess the new total, and two quick taps leave it showing a number the server\n * never had.\n */\nexport const setReactionResponseSchema = z.object({\n contentKind: contentKindSchema,\n contentId: objectIdSchema,\n reaction: reactionTypeSchema.nullable(),\n reactionCounts: reactionCountsSchema,\n});\nexport type SetReactionResponse = z.infer<typeof setReactionResponseSchema>;\n\n// ─── Reporting ───────────────────────────────────────────────────────────────\n\n/**\n * Why a member reported something.\n *\n * ⚠️ Stored on every report row, so this is data, not a label: removing a value\n * orphans reports already filed under it, and the counts nobody can recover are\n * exactly the ones a moderation review needs. Append only.\n *\n * ⚠️ A REASON THAT IS MISSING DOES NOT DISAPPEAR, it lands in `other`. Whatever\n * is not named here becomes an undifferentiated pile that no aggregate can see\n * a pattern in, which is the one thing report categories exist for. Worth being\n * deliberate about the absences rather than discovering them later.\n */\nexport const REPORT_REASON_VALUES = [\n 'spam',\n 'harassment',\n 'misinformation',\n 'off_topic',\n 'impersonation',\n 'other',\n] as const;\nexport const reportReasonSchema = z.enum(REPORT_REASON_VALUES);\nexport type ReportReason = z.infer<typeof reportReasonSchema>;\n\n/**\n * What a member sends to report a post, poll or comment.\n *\n * The target is the URL's, not the body's: a report is filed against a specific\n * thing at a specific address, and taking the target from the body would let a\n * caller report one item while the route thinks it is another.\n *\n * `note` is free text and optional, which is the pressure valve for everything\n * the enum does not name. ⚠️ It is written by a member, so it is untrusted at\n * render: a moderation queue displays it, and a moderation queue is a screen\n * staff read quickly.\n */\nexport const createReportBodySchema = z.object({\n reason: reportReasonSchema,\n note: z.string().trim().max(1000).optional(),\n});\nexport type CreateReportBody = z.infer<typeof createReportBodySchema>;\n\n/**\n * The answer to filing one.\n *\n * `alreadyReported` distinguishes \"we have taken this\" from \"you already told\n * us\", because one report per member per target means a second press is a\n * no-op, and a silent no-op reads as a failure to somebody who pressed twice\n * deliberately. It is NOT a count: how many OTHER people reported an item is\n * moderation's business and telling a reporter would turn the count into a\n * score anyone could farm.\n */\nexport const createReportResponseSchema = z.object({\n contentKind: contentKindSchema,\n contentId: objectIdSchema,\n alreadyReported: z.boolean(),\n});\nexport type CreateReportResponse = z.infer<typeof createReportResponseSchema>;\n\n/** The bookmark endpoint is a toggle and returns the state it settled on. */\nexport const toggleBookmarkResponseSchema = z.object({\n contentKind: contentKindSchema,\n contentId: objectIdSchema,\n bookmarked: z.boolean(),\n});\nexport type ToggleBookmarkResponse = z.infer<typeof toggleBookmarkResponseSchema>;\n\n/** A vote returns the whole poll: counts, totals and the viewer's own choices\n * all move together, and reassembling them client-side drifts. */\nexport const castVoteResponseSchema = z.object({\n poll: feedPollSchema,\n});\nexport type CastVoteResponse = z.infer<typeof castVoteResponseSchema>;\n"]}
@@ -0,0 +1,357 @@
1
+ /**
2
+ * founder-schema — The founder profile
3
+ *
4
+ * One member, one profile. The central auth account owns identity (email,
5
+ * verification, deletion); this owns everything Founder Circle shows.
6
+ *
7
+ * @module founder-schema/founder-profile
8
+ */
9
+ import { z } from 'zod';
10
+ export declare const ventureSchema: z.ZodObject<{
11
+ name: z.ZodString;
12
+ tagline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
13
+ website: z.ZodOptional<z.ZodURL>;
14
+ industry: z.ZodEnum<{
15
+ agritech: "agritech";
16
+ ai_ml: "ai_ml";
17
+ b2b_saas: "b2b_saas";
18
+ consumer: "consumer";
19
+ climate: "climate";
20
+ d2c: "d2c";
21
+ deeptech: "deeptech";
22
+ edtech: "edtech";
23
+ fintech: "fintech";
24
+ gaming: "gaming";
25
+ healthtech: "healthtech";
26
+ logistics: "logistics";
27
+ manufacturing: "manufacturing";
28
+ marketplace: "marketplace";
29
+ media: "media";
30
+ mobility: "mobility";
31
+ proptech: "proptech";
32
+ robotics: "robotics";
33
+ services: "services";
34
+ space: "space";
35
+ other: "other";
36
+ }>;
37
+ stage: z.ZodEnum<{
38
+ idea: "idea";
39
+ validation: "validation";
40
+ mvp: "mvp";
41
+ pre_seed: "pre_seed";
42
+ seed: "seed";
43
+ series_a_plus: "series_a_plus";
44
+ profitable: "profitable";
45
+ exited: "exited";
46
+ }>;
47
+ teamSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
48
+ foundedYear: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
49
+ }, z.core.$strip>;
50
+ export type Venture = z.infer<typeof ventureSchema>;
51
+ /**
52
+ * The profile as the owner sees it. A peer sees the redacted projection
53
+ * (`founderCardSchema`), which is built on the server and never by dropping
54
+ * fields on the client.
55
+ */
56
+ export declare const founderProfileSchema: z.ZodObject<{
57
+ id: z.ZodString;
58
+ userId: z.ZodString;
59
+ username: z.ZodString;
60
+ displayName: z.ZodString;
61
+ headline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
62
+ about: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
63
+ avatarUrl: z.ZodOptional<z.ZodURL>;
64
+ location: z.ZodOptional<z.ZodObject<{
65
+ city: z.ZodString;
66
+ state: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
67
+ country: z.ZodDefault<z.ZodString>;
68
+ }, z.core.$strip>>;
69
+ venture: z.ZodOptional<z.ZodObject<{
70
+ name: z.ZodString;
71
+ tagline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
72
+ website: z.ZodOptional<z.ZodURL>;
73
+ industry: z.ZodEnum<{
74
+ agritech: "agritech";
75
+ ai_ml: "ai_ml";
76
+ b2b_saas: "b2b_saas";
77
+ consumer: "consumer";
78
+ climate: "climate";
79
+ d2c: "d2c";
80
+ deeptech: "deeptech";
81
+ edtech: "edtech";
82
+ fintech: "fintech";
83
+ gaming: "gaming";
84
+ healthtech: "healthtech";
85
+ logistics: "logistics";
86
+ manufacturing: "manufacturing";
87
+ marketplace: "marketplace";
88
+ media: "media";
89
+ mobility: "mobility";
90
+ proptech: "proptech";
91
+ robotics: "robotics";
92
+ services: "services";
93
+ space: "space";
94
+ other: "other";
95
+ }>;
96
+ stage: z.ZodEnum<{
97
+ idea: "idea";
98
+ validation: "validation";
99
+ mvp: "mvp";
100
+ pre_seed: "pre_seed";
101
+ seed: "seed";
102
+ series_a_plus: "series_a_plus";
103
+ profitable: "profitable";
104
+ exited: "exited";
105
+ }>;
106
+ teamSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
107
+ foundedYear: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
108
+ }, z.core.$strip>>;
109
+ skills: z.ZodDefault<z.ZodArray<z.ZodEnum<{
110
+ engineering: "engineering";
111
+ product: "product";
112
+ design: "design";
113
+ data: "data";
114
+ growth: "growth";
115
+ sales: "sales";
116
+ marketing: "marketing";
117
+ operations: "operations";
118
+ finance: "finance";
119
+ legal: "legal";
120
+ hr_people: "hr_people";
121
+ supply_chain: "supply_chain";
122
+ research: "research";
123
+ fundraising: "fundraising";
124
+ community: "community";
125
+ }>>>;
126
+ goals: z.ZodDefault<z.ZodArray<z.ZodEnum<{
127
+ find_cofounder: "find_cofounder";
128
+ find_investors: "find_investors";
129
+ find_customers: "find_customers";
130
+ hiring: "hiring";
131
+ partnerships: "partnerships";
132
+ mentorship: "mentorship";
133
+ grow_network: "grow_network";
134
+ business_ideas: "business_ideas";
135
+ market_insights: "market_insights";
136
+ learn_startup: "learn_startup";
137
+ start_company: "start_company";
138
+ }>>>;
139
+ links: z.ZodDefault<z.ZodObject<{
140
+ linkedin: z.ZodOptional<z.ZodURL>;
141
+ x: z.ZodOptional<z.ZodURL>;
142
+ github: z.ZodOptional<z.ZodURL>;
143
+ website: z.ZodOptional<z.ZodURL>;
144
+ }, z.core.$strip>>;
145
+ isOnboarded: z.ZodDefault<z.ZodBoolean>;
146
+ isActive: z.ZodDefault<z.ZodBoolean>;
147
+ createdAt: z.ZodISODateTime;
148
+ updatedAt: z.ZodISODateTime;
149
+ }, z.core.$strip>;
150
+ export type FounderProfile = z.infer<typeof founderProfileSchema>;
151
+ /**
152
+ * What one founder sees of another in Discover and on a profile page.
153
+ *
154
+ * Built server-side. Keep it a strict subset of `founderProfileSchema` — if a
155
+ * private field ever needs to show here, that is a product decision, not an
156
+ * accident of spreading the full document.
157
+ */
158
+ export declare const founderCardSchema: z.ZodObject<{
159
+ skills: z.ZodDefault<z.ZodArray<z.ZodEnum<{
160
+ engineering: "engineering";
161
+ product: "product";
162
+ design: "design";
163
+ data: "data";
164
+ growth: "growth";
165
+ sales: "sales";
166
+ marketing: "marketing";
167
+ operations: "operations";
168
+ finance: "finance";
169
+ legal: "legal";
170
+ hr_people: "hr_people";
171
+ supply_chain: "supply_chain";
172
+ research: "research";
173
+ fundraising: "fundraising";
174
+ community: "community";
175
+ }>>>;
176
+ displayName: z.ZodString;
177
+ headline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
178
+ location: z.ZodOptional<z.ZodObject<{
179
+ city: z.ZodString;
180
+ state: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
181
+ country: z.ZodDefault<z.ZodString>;
182
+ }, z.core.$strip>>;
183
+ goals: z.ZodDefault<z.ZodArray<z.ZodEnum<{
184
+ find_cofounder: "find_cofounder";
185
+ find_investors: "find_investors";
186
+ find_customers: "find_customers";
187
+ hiring: "hiring";
188
+ partnerships: "partnerships";
189
+ mentorship: "mentorship";
190
+ grow_network: "grow_network";
191
+ business_ideas: "business_ideas";
192
+ market_insights: "market_insights";
193
+ learn_startup: "learn_startup";
194
+ start_company: "start_company";
195
+ }>>>;
196
+ venture: z.ZodOptional<z.ZodObject<{
197
+ name: z.ZodString;
198
+ tagline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
199
+ website: z.ZodOptional<z.ZodURL>;
200
+ industry: z.ZodEnum<{
201
+ agritech: "agritech";
202
+ ai_ml: "ai_ml";
203
+ b2b_saas: "b2b_saas";
204
+ consumer: "consumer";
205
+ climate: "climate";
206
+ d2c: "d2c";
207
+ deeptech: "deeptech";
208
+ edtech: "edtech";
209
+ fintech: "fintech";
210
+ gaming: "gaming";
211
+ healthtech: "healthtech";
212
+ logistics: "logistics";
213
+ manufacturing: "manufacturing";
214
+ marketplace: "marketplace";
215
+ media: "media";
216
+ mobility: "mobility";
217
+ proptech: "proptech";
218
+ robotics: "robotics";
219
+ services: "services";
220
+ space: "space";
221
+ other: "other";
222
+ }>;
223
+ stage: z.ZodEnum<{
224
+ idea: "idea";
225
+ validation: "validation";
226
+ mvp: "mvp";
227
+ pre_seed: "pre_seed";
228
+ seed: "seed";
229
+ series_a_plus: "series_a_plus";
230
+ profitable: "profitable";
231
+ exited: "exited";
232
+ }>;
233
+ teamSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
234
+ foundedYear: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
235
+ }, z.core.$strip>>;
236
+ username: z.ZodString;
237
+ avatarUrl: z.ZodOptional<z.ZodURL>;
238
+ id: z.ZodString;
239
+ }, z.core.$strip>;
240
+ export type FounderCard = z.infer<typeof founderCardSchema>;
241
+ /**
242
+ * Patch body for the Me tab. Only the keys the member actually changed.
243
+ *
244
+ * ⚠️ Written as its own object ON PURPOSE. Do NOT rebuild it as
245
+ * `founderProfileSchema.pick({...}).partial()`: `.partial()` does not switch
246
+ * off `.default()`, so `skills`, `goals` and `links` would materialise as
247
+ * `[]`, `[]` and `{}` on every request, including an empty one. Under a `$set`
248
+ * that wipes a member's skills and every one of their links the moment they
249
+ * edit their display name. `tsc` cannot see it and the request looks correct in
250
+ * the network tab.
251
+ *
252
+ * The rule this comes from: defaults belong on the READ side. A write body
253
+ * states what the caller sent and nothing else.
254
+ */
255
+ export declare const updateFounderProfileBodySchema: z.ZodObject<{
256
+ displayName: z.ZodOptional<z.ZodString>;
257
+ headline: z.ZodOptional<z.ZodNullable<z.ZodString>>;
258
+ about: z.ZodOptional<z.ZodNullable<z.ZodString>>;
259
+ location: z.ZodOptional<z.ZodObject<{
260
+ city: z.ZodString;
261
+ state: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
262
+ country: z.ZodString;
263
+ }, z.core.$strip>>;
264
+ venture: z.ZodOptional<z.ZodObject<{
265
+ name: z.ZodString;
266
+ tagline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
267
+ website: z.ZodOptional<z.ZodURL>;
268
+ industry: z.ZodEnum<{
269
+ agritech: "agritech";
270
+ ai_ml: "ai_ml";
271
+ b2b_saas: "b2b_saas";
272
+ consumer: "consumer";
273
+ climate: "climate";
274
+ d2c: "d2c";
275
+ deeptech: "deeptech";
276
+ edtech: "edtech";
277
+ fintech: "fintech";
278
+ gaming: "gaming";
279
+ healthtech: "healthtech";
280
+ logistics: "logistics";
281
+ manufacturing: "manufacturing";
282
+ marketplace: "marketplace";
283
+ media: "media";
284
+ mobility: "mobility";
285
+ proptech: "proptech";
286
+ robotics: "robotics";
287
+ services: "services";
288
+ space: "space";
289
+ other: "other";
290
+ }>;
291
+ stage: z.ZodEnum<{
292
+ idea: "idea";
293
+ validation: "validation";
294
+ mvp: "mvp";
295
+ pre_seed: "pre_seed";
296
+ seed: "seed";
297
+ series_a_plus: "series_a_plus";
298
+ profitable: "profitable";
299
+ exited: "exited";
300
+ }>;
301
+ teamSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
302
+ foundedYear: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
303
+ }, z.core.$strip>>;
304
+ skills: z.ZodOptional<z.ZodArray<z.ZodEnum<{
305
+ engineering: "engineering";
306
+ product: "product";
307
+ design: "design";
308
+ data: "data";
309
+ growth: "growth";
310
+ sales: "sales";
311
+ marketing: "marketing";
312
+ operations: "operations";
313
+ finance: "finance";
314
+ legal: "legal";
315
+ hr_people: "hr_people";
316
+ supply_chain: "supply_chain";
317
+ research: "research";
318
+ fundraising: "fundraising";
319
+ community: "community";
320
+ }>>>;
321
+ goals: z.ZodOptional<z.ZodArray<z.ZodEnum<{
322
+ find_cofounder: "find_cofounder";
323
+ find_investors: "find_investors";
324
+ find_customers: "find_customers";
325
+ hiring: "hiring";
326
+ partnerships: "partnerships";
327
+ mentorship: "mentorship";
328
+ grow_network: "grow_network";
329
+ business_ideas: "business_ideas";
330
+ market_insights: "market_insights";
331
+ learn_startup: "learn_startup";
332
+ start_company: "start_company";
333
+ }>>>;
334
+ links: z.ZodOptional<z.ZodObject<{
335
+ linkedin: z.ZodOptional<z.ZodURL>;
336
+ x: z.ZodOptional<z.ZodURL>;
337
+ github: z.ZodOptional<z.ZodURL>;
338
+ website: z.ZodOptional<z.ZodURL>;
339
+ }, z.core.$strip>>;
340
+ }, z.core.$strip>;
341
+ export type UpdateFounderProfileBody = z.infer<typeof updateFounderProfileBodySchema>;
342
+ /** Username change. Separate from the profile patch because it needs a uniqueness check. */
343
+ export declare const updateUsernameBodySchema: z.ZodObject<{
344
+ username: z.ZodString;
345
+ }, z.core.$strip>;
346
+ export type UpdateUsernameBody = z.infer<typeof updateUsernameBodySchema>;
347
+ /** Availability probe behind the username field. */
348
+ export declare const usernameAvailabilitySchema: z.ZodObject<{
349
+ username: z.ZodString;
350
+ available: z.ZodBoolean;
351
+ reason: z.ZodOptional<z.ZodEnum<{
352
+ taken: "taken";
353
+ reserved: "reserved";
354
+ }>>;
355
+ }, z.core.$strip>;
356
+ export type UsernameAvailability = z.infer<typeof usernameAvailabilitySchema>;
357
+ //# sourceMappingURL=founder-profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"founder-profile.d.ts","sourceRoot":"","sources":["../src/founder-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BxB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAepD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoC/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAU5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AA0C5D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,4FAA4F;AAC5F,eAAO,MAAM,wBAAwB;;iBAAyC,CAAC;AAC/E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,oDAAoD;AACpD,eAAO,MAAM,0BAA0B;;;;;;;iBAKrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,180 @@
1
+ /**
2
+ * founder-schema — The founder profile
3
+ *
4
+ * One member, one profile. The central auth account owns identity (email,
5
+ * verification, deletion); this owns everything Founder Circle shows.
6
+ *
7
+ * @module founder-schema/founder-profile
8
+ */
9
+ import { z } from 'zod';
10
+ import { goalSchema, httpUrlSchema, industrySchema, locationSchema, optionalTrimmedString, skillSchema, startupStageSchema, usernameSchema, } from './common.js';
11
+ // ─── Venture ─────────────────────────────────────────────────────────────────
12
+ export const ventureSchema = z.object({
13
+ name: z.string().trim().min(1).max(120),
14
+ tagline: optionalTrimmedString(160),
15
+ website: httpUrlSchema.optional(),
16
+ industry: industrySchema,
17
+ stage: startupStageSchema,
18
+ /** Team size including the founder. Optional: a solo pre-idea founder has none to report. */
19
+ teamSize: z.coerce.number().int().min(1).max(100000).optional(),
20
+ /**
21
+ * Not in the future. The bound is read per parse, never captured once.
22
+ *
23
+ * `.max(new Date().getUTCFullYear())` looks equivalent and is not: it is
24
+ * evaluated when this module is imported, so a server process still up on
25
+ * 1 January rejects the new year until somebody restarts it. The backend's
26
+ * Mongoose model deliberately carries no upper bound for the same reason, a
27
+ * `max` there being frozen at schema construction. This is where the ceiling
28
+ * lives.
29
+ */
30
+ foundedYear: z.coerce
31
+ .number()
32
+ .int()
33
+ .min(1900)
34
+ .refine((year) => year <= new Date().getUTCFullYear(), {
35
+ message: 'Founded year cannot be in the future',
36
+ })
37
+ .optional(),
38
+ });
39
+ // ─── Profile ─────────────────────────────────────────────────────────────────
40
+ /**
41
+ * The founder's off-platform links. Defined once, because the read side wants a
42
+ * default and the write side must not have one.
43
+ */
44
+ const linksSchema = z.object({
45
+ linkedin: httpUrlSchema.optional(),
46
+ x: httpUrlSchema.optional(),
47
+ github: httpUrlSchema.optional(),
48
+ website: httpUrlSchema.optional(),
49
+ });
50
+ /**
51
+ * The profile as the owner sees it. A peer sees the redacted projection
52
+ * (`founderCardSchema`), which is built on the server and never by dropping
53
+ * fields on the client.
54
+ */
55
+ export const founderProfileSchema = z.object({
56
+ id: z.string(),
57
+ userId: z.string(),
58
+ username: usernameSchema,
59
+ displayName: z.string().trim().min(1).max(80),
60
+ headline: optionalTrimmedString(120),
61
+ about: optionalTrimmedString(1000),
62
+ /**
63
+ * Plain `z.url()`, NOT `httpUrlSchema`, and the difference is deliberate.
64
+ *
65
+ * No member can write this field: it appears in no write body, and
66
+ * `public-surface.test.ts` asserts that and will fail the day somebody adds it
67
+ * to a form. So the scheme restriction would be defending a field that takes
68
+ * no member input, while refusing hosts we legitimately serve avatars from,
69
+ * our own dev host among them. A read schema that rejects our own response is
70
+ * a self-inflicted outage.
71
+ *
72
+ * ⚠️ That argument holds only while nothing member-supplied reaches this
73
+ * field. Two sources write an avatar today and NEITHER is a member typing a
74
+ * URL: our own upload path, and the central-auth `user.created` /
75
+ * `user.updated` webhook, which carries the Google OAuth picture. If a
76
+ * "paste a link to your photo" control is ever added, this goes back to
77
+ * `httpUrlSchema` and the ruling behind it is void.
78
+ */
79
+ avatarUrl: z.url().optional(),
80
+ location: locationSchema.optional(),
81
+ venture: ventureSchema.optional(),
82
+ skills: z.array(skillSchema).max(8).default([]),
83
+ goals: z.array(goalSchema).max(11).default([]),
84
+ links: linksSchema.default({}),
85
+ /** Onboarding is finished and the member is visible in Discover. */
86
+ isOnboarded: z.boolean().default(false),
87
+ /** Member paused their own profile. Hidden from Discover, keeps their data. */
88
+ isActive: z.boolean().default(true),
89
+ createdAt: z.iso.datetime(),
90
+ updatedAt: z.iso.datetime(),
91
+ });
92
+ /**
93
+ * What one founder sees of another in Discover and on a profile page.
94
+ *
95
+ * Built server-side. Keep it a strict subset of `founderProfileSchema` — if a
96
+ * private field ever needs to show here, that is a product decision, not an
97
+ * accident of spreading the full document.
98
+ */
99
+ export const founderCardSchema = founderProfileSchema.pick({
100
+ id: true,
101
+ username: true,
102
+ displayName: true,
103
+ headline: true,
104
+ avatarUrl: true,
105
+ location: true,
106
+ venture: true,
107
+ skills: true,
108
+ goals: true,
109
+ });
110
+ // ─── Write bodies ────────────────────────────────────────────────────────────
111
+ /**
112
+ * A text field the member is allowed to empty.
113
+ *
114
+ * Three states, and they are deliberately distinct:
115
+ * absent do not touch this field
116
+ * null clear it (the backend turns this into an `$unset`)
117
+ * "" REJECTED
118
+ *
119
+ * The empty string is refused on purpose. A form that forgets to convert a
120
+ * cleared input to `null` then fails loudly at the boundary, instead of being
121
+ * silently dropped and leaving the member staring at text they just deleted.
122
+ * `optionalTrimmedString` does the dropping, which is right for a create body
123
+ * and wrong for a patch.
124
+ */
125
+ const clearableText = (maxLength) => z
126
+ .string()
127
+ .trim()
128
+ .min(1, 'Send null to clear this field, not an empty string')
129
+ .max(maxLength)
130
+ .nullable()
131
+ .optional();
132
+ /**
133
+ * Location as a PATCH sends it. Note what is missing: `country` has no default
134
+ * here, and is required instead.
135
+ *
136
+ * `locationSchema` defaults country to India, which is correct on the read side
137
+ * and destructive on the write side: a founder in Berlin who corrects only
138
+ * their city would be moved to India by a default they never saw. A patch that
139
+ * carries a location carries the whole location.
140
+ */
141
+ const patchLocationSchema = z.object({
142
+ city: z.string().trim().min(1).max(80),
143
+ state: optionalTrimmedString(80),
144
+ country: z.string().trim().min(1).max(80),
145
+ });
146
+ /**
147
+ * Patch body for the Me tab. Only the keys the member actually changed.
148
+ *
149
+ * ⚠️ Written as its own object ON PURPOSE. Do NOT rebuild it as
150
+ * `founderProfileSchema.pick({...}).partial()`: `.partial()` does not switch
151
+ * off `.default()`, so `skills`, `goals` and `links` would materialise as
152
+ * `[]`, `[]` and `{}` on every request, including an empty one. Under a `$set`
153
+ * that wipes a member's skills and every one of their links the moment they
154
+ * edit their display name. `tsc` cannot see it and the request looks correct in
155
+ * the network tab.
156
+ *
157
+ * The rule this comes from: defaults belong on the READ side. A write body
158
+ * states what the caller sent and nothing else.
159
+ */
160
+ export const updateFounderProfileBodySchema = z.object({
161
+ displayName: z.string().trim().min(1).max(80).optional(),
162
+ headline: clearableText(120),
163
+ about: clearableText(1000),
164
+ location: patchLocationSchema.optional(),
165
+ venture: ventureSchema.optional(),
166
+ skills: z.array(skillSchema).max(8).optional(),
167
+ goals: z.array(goalSchema).max(11).optional(),
168
+ /** Sent whole. To drop one link, send the object without that key. */
169
+ links: linksSchema.optional(),
170
+ });
171
+ /** Username change. Separate from the profile patch because it needs a uniqueness check. */
172
+ export const updateUsernameBodySchema = z.object({ username: usernameSchema });
173
+ /** Availability probe behind the username field. */
174
+ export const usernameAvailabilitySchema = z.object({
175
+ username: usernameSchema,
176
+ available: z.boolean(),
177
+ /** Present when unavailable: `taken` or `reserved`. */
178
+ reason: z.enum(['taken', 'reserved']).optional(),
179
+ });
180
+ //# sourceMappingURL=founder-profile.js.map