founder-schema 0.14.0 → 0.16.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.
- package/README.md +90 -3
- package/dist/core/common.d.ts +30 -4
- package/dist/core/common.d.ts.map +1 -1
- package/dist/core/common.js +37 -3
- package/dist/core/common.js.map +1 -1
- package/dist/core/errors.d.ts +9 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +19 -0
- package/dist/core/errors.js.map +1 -1
- package/dist/core/limits.d.ts +11 -0
- package/dist/core/limits.d.ts.map +1 -1
- package/dist/core/limits.js +18 -0
- package/dist/core/limits.js.map +1 -1
- package/dist/core/responses.d.ts +8 -0
- package/dist/core/responses.d.ts.map +1 -1
- package/dist/domains/communities/communities.d.ts +9 -9
- package/dist/domains/discover/discover.d.ts +7 -0
- package/dist/domains/discover/discover.d.ts.map +1 -1
- package/dist/domains/feed/feed.d.ts +11 -11
- package/dist/domains/onboarding/onboarding.d.ts +245 -21
- package/dist/domains/onboarding/onboarding.d.ts.map +1 -1
- package/dist/domains/onboarding/onboarding.js +104 -16
- package/dist/domains/onboarding/onboarding.js.map +1 -1
- package/dist/domains/products/products.d.ts +3 -3
- package/dist/domains/profile/founder-profile.d.ts +28 -0
- package/dist/domains/profile/founder-profile.d.ts.map +1 -1
- package/dist/domains/profile/founder-profile.js +3 -0
- package/dist/domains/profile/founder-profile.js.map +1 -1
- package/dist/domains/profile/my-profile.d.ts +386 -0
- package/dist/domains/profile/my-profile.d.ts.map +1 -0
- package/dist/domains/profile/my-profile.js +52 -0
- package/dist/domains/profile/my-profile.js.map +1 -0
- package/dist/domains/waitlist/waitlist.d.ts +68 -0
- package/dist/domains/waitlist/waitlist.d.ts.map +1 -0
- package/dist/domains/waitlist/waitlist.js +64 -0
- package/dist/domains/waitlist/waitlist.js.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../../src/domains/onboarding/onboarding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,WAAW,EACX,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAAS,EACT,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,SAAS,EACT,aAAa,EACb,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAElF,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAChC,qEAAqE;AACrE,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AAEjC;;;;;;;;;GASG;AACH,+DAA+D;AAC/D,MAAM,eAAe,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAElD,MAAM,UAAU,UAAU,CAAC,OAAe,EAAE,MAAY,IAAI,IAAI,EAAE;IAChE,0EAA0E;IAC1E,yEAAyE;IACzE,6EAA6E;IAC7E,6EAA6E;IAC7E,sEAAsE;IACtE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CACjB,4GAA4G,CAC7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AM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC;IACzD,KAAK,EAAE,qBAAqB,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC","sourcesContent":["/**\n * founder-schema — Onboarding: steps, enums, and the two shapes of the answers\n *\n * ONE LIST DEFINES THE FLOW, AND IT IS DERIVED. Each step's fields are a pick\n * of the finish body (`ONBOARDING_STEP_SCHEMAS`), and `FOUNDER_ONBOARDING_STEPS`\n * is built FROM those picks: its `fields`, and even whether a step may be\n * skipped, come from the schema rather than from a second hand-written list.\n * GymMonk arrived at one list after keeping two in sync by hand, where a step\n * could exist with no title or, worse, no validation gate at all; until 0.2.0\n * this file still wrote the field lists twice.\n *\n * TWO SHAPES, ONE SET OF RULES. A half-filled form legitimately holds `null`\n * for a choice nobody has made yet; the finalize body only ever sees completed\n * answers. So the rules are written once and expressed over both shapes:\n * `onboardingFormSchema` for work in progress and `completeOnboardingBodySchema`\n * for the end. Letting those two drift is how a wizard says a step is optional\n * and then answers 422 at Finish.\n *\n * NO COPY IN HERE. Step titles and help lines are translation KEYS\n * (`titleKey`, `helpKey`), Jansathi's rule for every config string: an English\n * sentence in a shared package is a sentence every other language has to match\n * by wording. A topic category is named by its `key`, which the client words\n * (0.6.0 dropped its `labelKey`: the web, English-only since 2026-10-06, read\n * nothing from it).\n *\n * @module founder-schema/domains/onboarding\n */\n\nimport { z } from 'zod';\nimport {\n displayNameSchema,\n GENDER_VALUES,\n GOAL_VALUES,\n genderSchema,\n goalSchema,\n INDUSTRY_VALUES,\n industrySchema,\n locationSchema,\n objectIdSchema,\n optionalTrimmedString,\n phoneSchema,\n SKILL_VALUES,\n STARTUP_STAGE_VALUES,\n skillSchema,\n startupStageSchema,\n} from '../../core/common.js';\nimport {\n ABOUT_MAX,\n CITY_MAX,\n COUNTRY_MAX,\n DISPLAY_NAME_MAX,\n GOALS_MIN,\n HEADLINE_MAX,\n LINK_URL_MAX,\n SKILLS_MAX,\n STATE_MAX,\n TEAM_SIZE_MAX,\n VENTURE_NAME_MAX,\n} from '../../core/limits.js';\nimport { VALIDATION_MESSAGE } from '../../core/validation.js';\nimport { founderLinksSchema, ventureSchema } from '../profile/founder-profile.js';\n\n// ─── Age ─────────────────────────────────────────────────────────────────────\n\n/**\n * 18, ruled by the user 2026-09-21. Under-18 would pull in parental-consent\n * duties under the DPDP Act, which is a different and larger problem than a\n * validation rule.\n *\n * ⚠️ The SERVER refuses at finalize. This schema exists so the member sees a\n * useful message; it is not the gate.\n */\nexport const MIN_AGE_YEARS = 18;\n/** A sanity ceiling, not a product rule. Catches a mistyped year. */\nexport const MAX_AGE_YEARS = 120;\n\n/**\n * Whole years completed, by the calendar.\n *\n * ⚠️ NOT `elapsedMs / (365.25 * day)`, which is what the sibling product uses.\n * That approximation reads 17.9986 at the start of somebody's eighteenth\n * birthday and only crosses 18 about halfway through the day, so it refuses\n * them for the half of their birthday they are most likely to be signing up on.\n * Measured: it disagrees with the calendar on all 400 of the next 400 days.\n * An age gate is exactly the place an approximation is not good enough.\n */\n/** India Standard Time, UTC+05:30, with no daylight saving. */\nconst INDIA_OFFSET_MS = (5 * 60 + 30) * 60 * 1000;\n\nexport function ageInYears(isoDate: string, now: Date = new Date()): number {\n // ⚠️ A STRING, `YYYY-MM-DD`, not a `Date`. This is a wire contract, so it\n // takes the wire type. The backend is the obvious caller and the backend\n // holds a `Date`, so it must format first; passing the Date straight in used\n // to fail with `isoDate.split is not a function`, which says nothing useful.\n // Naming the fix costs one line and saves the next person the detour.\n if (typeof isoDate !== 'string') {\n throw new TypeError(\n 'ageInYears expects a YYYY-MM-DD string, not a Date. Format it first, e.g. date.toISOString().slice(0, 10).',\n );\n }\n const [y, m, d] = isoDate.split('-').map(Number) as [number, number, number];\n // The date TODAY IS IN INDIA (0.13.0), where the members are: a birthday\n // begins at midnight there, not five and a half hours later at UTC's\n // midnight. India keeps one offset all year.\n const today = new Date(now.getTime() + INDIA_OFFSET_MS);\n let age = today.getUTCFullYear() - y;\n const monthNow = today.getUTCMonth() + 1;\n if (monthNow < m || (monthNow === m && today.getUTCDate() < d)) age -= 1;\n return age;\n}\n\n/** A calendar date with no time component, `YYYY-MM-DD`. */\nexport const isoDateSchema = z\n .string()\n .trim()\n .regex(/^\\d{4}-\\d{2}-\\d{2}$/, VALIDATION_MESSAGE.dateInvalid);\nexport type IsoDate = z.infer<typeof isoDateSchema>;\n\n/** True only for a date that exists. Rejects 2026-02-30 and 2026-13-01. */\nfunction isRealDate(iso: string): boolean {\n const [y, m, d] = iso.split('-').map(Number) as [number, number, number];\n if (m < 1 || m > 12 || d < 1) return false;\n const asDate = new Date(Date.UTC(y, m - 1, d));\n return (\n asDate.getUTCFullYear() === y && asDate.getUTCMonth() === m - 1 && asDate.getUTCDate() === d\n );\n}\n\n/**\n * Date of birth, with the age gate applied per parse.\n *\n * ⚠️ THE CLIENT IS NOT THE GATE. This schema exists so the member sees a useful\n * message, and the server must refuse the same dates at finalize regardless.\n * The sibling dating product validates the identical rule on its client and\n * still shipped a defect where an under-age date of birth produced a live,\n * discoverable profile, because the client was the only thing checking.\n */\nexport const dateOfBirthSchema = isoDateSchema\n .refine(isRealDate, { error: VALIDATION_MESSAGE.dobInvalid })\n .refine((v) => ageInYears(v) >= MIN_AGE_YEARS, { error: VALIDATION_MESSAGE.dobUnderAge })\n .refine((v) => ageInYears(v) <= MAX_AGE_YEARS, { error: VALIDATION_MESSAGE.dobTooOld });\nexport type DateOfBirth = z.infer<typeof dateOfBirthSchema>;\n\n// ─── Business ────────────────────────────────────────────────────────────────\n\nexport const BUSINESS_TYPE_VALUES = ['startup', 'sme', 'enterprise'] as const;\nexport const businessTypeSchema = z.enum(BUSINESS_TYPE_VALUES);\nexport type BusinessType = z.infer<typeof businessTypeSchema>;\n\n// ─── Topics: the shared vocabulary ───────────────────────────────────────────────────────────────\n\n/**\n * ONE vocabulary, used TWICE: a member picks these as their `interests`, and a\n * post carries them as its `topics`. That is what makes relevance an index\n * lookup rather than a guess, and it is why this list is not called \"interests\"\n * - naming it for one of its two jobs would have invited a second list for the\n * other, which is the mistake this package has already made once with goals.\n * (User's ruling via hary, 2026-09-21.)\n *\n * Deliberately DISTINCT from two neighbours that will otherwise collect the\n * same words:\n *\n * industry what your company does\n * skills what you can do\n * interests what you want to read about\n *\n * If the copy does not keep them apart, members fill all three identically and\n * every one of them stops telling us anything.\n *\n * A closed list, consistent with industry, skill and stage, for the reason\n * already written beside those: free text means two people typing \"growth\" and\n * \"Growth Marketing\" never match, and matching is the entire point. The cost is\n * that adding an interest needs a publish.\n *\n * Tuned down from the dating product's 246, which is mostly dating material.\n * Values reuse its exact strings wherever one existed, so its Hindi\n * translations can be lifted across.\n *\n * ⚠️ Stored per member. Append only; removing a value orphans data.\n */\nexport const TOPIC_VALUES = [\n // Career growth\n 'mentoring',\n 'leadership',\n 'networking',\n 'public_speaking',\n 'teaching',\n 'hiring_talent',\n 'personal_branding',\n 'career_transition',\n 'remote_work',\n // Innovation and tech\n 'ai_ml',\n 'blockchain',\n 'crypto_web3',\n 'robotics',\n 'data_science',\n 'cybersecurity',\n 'game_dev',\n 'ux_design',\n 'app_development',\n 'open_source',\n 'electronics',\n 'space_exploration',\n 'green_tech',\n 'deeptech',\n 'no_code',\n // Business\n 'entrepreneurship',\n 'investing',\n 'stock_trading',\n 'personal_finance',\n 'fundraising',\n 'marketing',\n 'sales',\n 'consulting',\n 'ecommerce',\n 'retail',\n 'real_estate',\n 'supply_chain',\n 'product_management',\n 'growth',\n 'b2b_saas',\n 'd2c',\n // Personal development\n 'meditation',\n 'journaling',\n 'self_improvement',\n 'productivity',\n 'reading',\n 'online_courses',\n 'philosophy',\n 'psychology',\n 'therapy',\n 'sleep_optimization',\n 'gym',\n 'yoga',\n // Creative\n 'photography',\n 'writing',\n 'graphic_design',\n 'filmmaking',\n 'digital_art',\n 'content_creation',\n 'blogging',\n 'vlogging',\n 'podcasts',\n 'animation',\n 'music_production',\n // Impact and community\n 'volunteering',\n 'ngo_work',\n 'environmental',\n 'women_empowerment',\n 'community_service',\n 'social_enterprise',\n 'education_access',\n] as const;\nexport const topicSchema = z.enum(TOPIC_VALUES);\nexport type Topic = z.infer<typeof topicSchema>;\n\n/**\n * The grouping the picker renders.\n *\n * ⚠️ `TOPIC_VALUES` above is the single source of truth and this is typed\n * against it, so a typo here is a compile error rather than a chip that renders\n * and can never be selected. The dating product keeps a categorised list and a\n * flat list side by side and they have already drifted apart by two values;\n * a test in this package asserts these two agree exactly, in both directions.\n */\nexport const TOPIC_CATEGORY_KEYS = [\n 'career',\n 'tech',\n 'business',\n 'growth',\n 'creative',\n 'impact',\n] as const;\nexport type TopicCategoryKey = (typeof TOPIC_CATEGORY_KEYS)[number];\n\n/**\n * One group of the picker: its `key` (the client words it) and its topics.\n * Breaking in 0.6.0: no `labelKey`.\n */\nexport interface TopicCategory {\n key: TopicCategoryKey;\n values: readonly Topic[];\n}\n\nconst topicCategory = (key: TopicCategoryKey, values: readonly Topic[]): TopicCategory => ({\n key,\n values,\n});\n\nexport const TOPIC_CATEGORIES: readonly TopicCategory[] = [\n topicCategory('career', [\n 'mentoring',\n 'leadership',\n 'networking',\n 'public_speaking',\n 'teaching',\n 'hiring_talent',\n 'personal_branding',\n 'career_transition',\n 'remote_work',\n ]),\n topicCategory('tech', [\n 'ai_ml',\n 'blockchain',\n 'crypto_web3',\n 'robotics',\n 'data_science',\n 'cybersecurity',\n 'game_dev',\n 'ux_design',\n 'app_development',\n 'open_source',\n 'electronics',\n 'space_exploration',\n 'green_tech',\n 'deeptech',\n 'no_code',\n ]),\n topicCategory('business', [\n 'entrepreneurship',\n 'investing',\n 'stock_trading',\n 'personal_finance',\n 'fundraising',\n 'marketing',\n 'sales',\n 'consulting',\n 'ecommerce',\n 'retail',\n 'real_estate',\n 'supply_chain',\n 'product_management',\n 'growth',\n 'b2b_saas',\n 'd2c',\n ]),\n topicCategory('growth', [\n 'meditation',\n 'journaling',\n 'self_improvement',\n 'productivity',\n 'reading',\n 'online_courses',\n 'philosophy',\n 'psychology',\n 'therapy',\n 'sleep_optimization',\n 'gym',\n 'yoga',\n ]),\n topicCategory('creative', [\n 'photography',\n 'writing',\n 'graphic_design',\n 'filmmaking',\n 'digital_art',\n 'content_creation',\n 'blogging',\n 'vlogging',\n 'podcasts',\n 'animation',\n 'music_production',\n ]),\n topicCategory('impact', [\n 'volunteering',\n 'ngo_work',\n 'environmental',\n 'women_empowerment',\n 'community_service',\n 'social_enterprise',\n 'education_access',\n ]),\n];\n\n/**\n * How many a member must pick. A minimum exists because these drive feed\n * relevance and zero of them means no relevance at all.\n *\n * ⚠️ If 3 turns out to be hard to reach against this list, that is a signal\n * about the LIST, not about the minimum. The sibling product enforces no\n * minimum at all, and its own field config says \"pick up to 10\" while every\n * screen and schema enforces 20.\n */\nexport const INTERESTS_MIN = 3;\nexport const INTERESTS_MAX = 10;\n\n// ─── The step keys ───────────────────────────────────────────────────────────\n\n/**\n * The step keys, in order, as a literal union, so a consumer can key a table by\n * step and have TypeScript insist on every one. Before 0.2.0 `key` was a plain\n * string and the web client kept its own copy of this list to get the same\n * check; a test there held the two together. Now there is one list.\n */\nexport const ONBOARDING_STEP_KEYS = [\n 'identity',\n 'contact',\n 'location',\n 'goals',\n 'interests',\n 'business',\n 'guidelines',\n] as const;\nexport type OnboardingStepKey = (typeof ONBOARDING_STEP_KEYS)[number];\n\n// ─── Guidelines ──────────────────────────────────────────────────────────────\n\n/**\n * The community guidelines a member agrees to at the last step, by version.\n *\n * The finish body accepts THIS version and no other: an old tab still showing\n * last month's text cannot record agreement to text it never displayed, and\n * `'whatever'` is not a version. Until 0.2.0 any non-empty string passed, and\n * the web client held this constant on its own.\n *\n * ⚠ Changing the guidelines text means bumping this, in the same publish.\n * Every member who agreed to an earlier version keeps that version on their\n * profile; that record is the point.\n */\nexport const GUIDELINES_VERSION = '2026-10-03' as const;\nexport const guidelinesVersionSchema = z.literal(GUIDELINES_VERSION, {\n error: VALIDATION_MESSAGE.guidelinesOutdated,\n});\n\n// ─── Contact ─────────────────────────────────────────────────────────────────\n\n/**\n * The links the contact step collects, picked from the profile's own links so\n * the two cannot disagree on what a link is. The phone is `phoneSchema`: ten\n * digits, stored raw with no country code, on the account rather than here.\n */\nexport const contactLinksSchema = founderLinksSchema.pick({\n linkedin: true,\n x: true,\n instagram: true,\n});\nexport type ContactLinks = z.infer<typeof contactLinksSchema>;\n\n/** A team size has at most this many digits: `TEAM_SIZE_MAX` written out. */\nexport const TEAM_SIZE_DIGITS_MAX = String(TEAM_SIZE_MAX).length;\n\n// ─── The form, mid-flight: the draft each step saves ──────────────────────────\n\n/**\n * The answers so far, keyed by the finish body's own field names: what each\n * step SAVES (`PATCH /onboarding`, merged per field), what `GET` hands back\n * to resume, and so the only keys a draft may hold\n * (`ONBOARDING_DRAFT_KEYS`).\n *\n * RAW, on purpose: a draft is what the member TYPED, not what Finish will send.\n * A half-typed link is ordinary text, a team size is digits as typed, and every\n * choice is `null` until made (\"not answered\" is not \"answered with nothing\").\n * Nothing here is required; whether a member may FINISH is\n * `completeOnboardingBodySchema`'s decision, and the client builds that body\n * from these answers.\n *\n * Screens may hold a different shape on top of this one (the web draws first\n * and last name as two fields and joins them into `displayName`). Derive that\n * type from `OnboardingForm` rather than writing it out, so a field added here\n * reaches every screen.\n *\n * A stored draft is UNTRUSTED when it comes back: an older client, or another\n * one, wrote it, and the server stores values opaquely. Read it with\n * `readOnboardingDraft`, never by casting.\n */\nexport const onboardingFormSchema = z.object({\n displayName: z.string().max(DISPLAY_NAME_MAX),\n gender: genderSchema.nullable(),\n /** `YYYY-MM-DD` once complete; whatever has been typed until then. */\n dateOfBirth: z.string(),\n headline: z.string().max(HEADLINE_MAX),\n about: z.string().max(ABOUT_MAX),\n /**\n * The completed upload's id (`media`, purpose `avatar`). Allowed in the form,\n * and NEVER restored by `readOnboardingDraft`: an upload not attached within\n * `MEDIA_UNATTACHED_TTL_HOURS` is deleted, so an id from an older draft would\n * fail at Finish, on the last screen, about a photo picked days ago. Clients\n * hold it for the visit and do not save it.\n */\n avatarMediaId: objectIdSchema.nullable(),\n skills: z.array(skillSchema).max(SKILLS_MAX),\n\n /** As typed; the finish body takes `phoneSchema`'s ten digits. */\n phone: z.string(),\n /** As typed; the finish body takes full `https://` URLs. */\n links: z.object({\n linkedin: z.string().max(LINK_URL_MAX),\n x: z.string().max(LINK_URL_MAX),\n instagram: z.string().max(LINK_URL_MAX),\n }),\n\n /** `null` until the member opens the location step, and when they skip it. */\n location: z\n .object({\n city: z.string().max(CITY_MAX),\n state: z.string().max(STATE_MAX),\n country: z.string().max(COUNTRY_MAX),\n })\n .nullable(),\n\n goals: z.array(goalSchema).max(GOAL_VALUES.length),\n interests: z.array(topicSchema).max(INTERESTS_MAX),\n\n /**\n * Always present; empty until started. Onboarding does not ask for a\n * tagline (the profile does, later), so the draft has none.\n */\n venture: z.object({\n name: z.string().max(VENTURE_NAME_MAX),\n website: z.string().max(LINK_URL_MAX),\n industry: industrySchema.nullable(),\n stage: startupStageSchema.nullable(),\n /** Digits as typed, at most `TEAM_SIZE_DIGITS_MAX`; the body sends a number. */\n teamSize: z.string().max(TEAM_SIZE_DIGITS_MAX),\n }),\n businessType: businessTypeSchema.nullable(),\n\n /** The guidelines text the member agreed to, or `null`. */\n guidelinesVersion: z.string().nullable(),\n});\nexport type OnboardingForm = z.infer<typeof onboardingFormSchema>;\n\n// ─── Reading a stored draft back ─────────────────────────────────────────────\n\n/** Longest date of birth worth keeping from a draft: `YYYY-MM-DD`. */\nconst DATE_INPUT_MAX = 10;\n\n/** Longest phone number worth keeping from a draft, as typed with spaces. */\nconst PHONE_INPUT_MAX = 20;\n\n/** Text, cut to its limit; anything that is not text is \"not answered\". */\nconst draftText = (max: number) =>\n z\n .string()\n .catch('')\n .transform((v) => v.slice(0, max));\n\n/** One of a vocabulary, or `null` (\"not answered\"). */\nconst draftChoice = <T extends readonly [string, ...string[]]>(values: T) =>\n z.enum(values).nullable().catch(null);\n\n/**\n * Items of a vocabulary, deduplicated and capped. Unknown items (a value since\n * retired, or junk) are dropped one by one, so the rest of the answer survives.\n */\nconst draftList = <T extends readonly [string, ...string[]]>(values: T, max: number) =>\n z\n .array(z.unknown())\n .catch([])\n .transform((items) => {\n const allowed = new Set<string>(values);\n const kept = items.filter((v): v is T[number] => typeof v === 'string' && allowed.has(v));\n return [...new Set(kept)].slice(0, max);\n });\n\n/** An object of the given fields, or `null` when the draft holds none. */\nconst draftObject = <S extends z.ZodRawShape>(shape: S) =>\n z\n .record(z.string(), z.unknown())\n .nullable()\n .catch(null)\n .pipe(z.union([z.null(), z.object(shape)]));\n\nconst draftReaderSchema = z.object({\n displayName: draftText(DISPLAY_NAME_MAX),\n gender: draftChoice(GENDER_VALUES),\n dateOfBirth: draftText(DATE_INPUT_MAX),\n headline: draftText(HEADLINE_MAX),\n about: draftText(ABOUT_MAX),\n avatarMediaId: z\n .unknown()\n .optional()\n .transform(() => null),\n skills: draftList(SKILL_VALUES, SKILLS_MAX),\n phone: draftText(PHONE_INPUT_MAX),\n links: draftObject({\n linkedin: draftText(LINK_URL_MAX),\n x: draftText(LINK_URL_MAX),\n instagram: draftText(LINK_URL_MAX),\n }).transform((links) => links ?? { linkedin: '', x: '', instagram: '' }),\n location: draftObject({\n city: draftText(CITY_MAX),\n state: draftText(STATE_MAX),\n country: draftText(COUNTRY_MAX),\n }),\n goals: draftList(GOAL_VALUES, GOAL_VALUES.length),\n interests: draftList(TOPIC_VALUES, INTERESTS_MAX),\n venture: draftObject({\n name: draftText(VENTURE_NAME_MAX),\n website: draftText(LINK_URL_MAX),\n industry: draftChoice(INDUSTRY_VALUES),\n stage: draftChoice(STARTUP_STAGE_VALUES),\n teamSize: z\n .string()\n .catch('')\n .transform((v) => v.replace(/\\D/g, '').slice(0, TEAM_SIZE_DIGITS_MAX)),\n }).transform((venture) => venture ?? { ...EMPTY_ONBOARDING_VENTURE }),\n businessType: draftChoice(BUSINESS_TYPE_VALUES),\n /** Agreement to an OLDER text is not agreement to this one. */\n guidelinesVersion: z\n .unknown()\n .optional()\n .transform((v) => (v === GUIDELINES_VERSION ? GUIDELINES_VERSION : null)),\n});\n\n/** The business step before anything is chosen. */\nexport const EMPTY_ONBOARDING_VENTURE: OnboardingForm['venture'] = {\n name: '',\n website: '',\n industry: null,\n stage: null,\n teamSize: '',\n};\n\n/**\n * A stored draft as an `OnboardingForm`, FIELD BY FIELD.\n *\n * Every field is checked against its own vocabulary and cut to its own limit;\n * one that does not fit becomes \"not answered\" (`''`, `null`, `[]`) and the\n * rest of the draft survives. Never coerced into a different answer: a value\n * outside a vocabulary is dropped, not mapped to the nearest one. A photo\n * is never restored (see `avatarMediaId`), and agreement only counts for the\n * CURRENT guidelines.\n *\n * It fills in no answer the member did not give: a blank country stays blank.\n * Whatever a screen shows by default is that screen's choice.\n */\nexport function readOnboardingDraft(draft: unknown): OnboardingForm {\n const source = draft && typeof draft === 'object' && !Array.isArray(draft) ? draft : {};\n return draftReaderSchema.parse(source);\n}\n\n// ─── The finalize body ───────────────────────────────────────────────────────\n\n/**\n * What the client sends to finish. Completed answers only.\n *\n * ⚠️ EVERY OPTIONAL FIELD HERE MUST BE ABSENT WHEN UNANSWERED, never a default\n * standing in for one. The sibling gym product sent `bloodGroup ?? 'O+'`, so\n * every member who skipped the question was recorded as O-positive: a real\n * answer, indistinguishable from one somebody gave, sitting on a screen staff\n * would read in an emergency. Absent has to stay absent.\n *\n * ⚠️ AND THIS IS NOT THE GATE EITHER. The server re-checks the age and refuses\n * at finalize. `isOnboarded` may be set here and nowhere else: four of the\n * profile's partial indexes are gated on it, so a half-built profile carrying\n * it true appears in Discover half-built.\n *\n * Location, venture and links are the profile's own shapes, not copies: the\n * copies are how the profile model came to lack Instagram.\n */\nexport const completeOnboardingBodySchema = z.object({\n // Plain bounds, no custom message: `too_small` with minimum 1 already says\n // \"required\", and the client words it in the member's language.\n displayName: displayNameSchema,\n /**\n * ⚠️ NO `username` HERE, and its absence is deliberate.\n *\n * It used to be required, and that was a defect: no onboarding step collects\n * one, the design draws no screen for one, and it was not even on the\n * in-progress form, so a finalize could never have succeeded. Found by\n * checking every finalize-required field against the step list; a test now\n * asserts that relationship in both directions.\n *\n * The handle is DERIVED SERVER-SIDE at finalize and edited later from the Me\n * tab, which is what the product describes. That also makes the collision\n * case kinder: a server deriving a handle can suffix it and move on, whereas\n * a member who picked one six steps ago can only be told, at the end, that\n * step one failed.\n */\n gender: genderSchema,\n dateOfBirth: dateOfBirthSchema,\n headline: optionalTrimmedString(HEADLINE_MAX),\n about: optionalTrimmedString(ABOUT_MAX),\n /**\n * A completed avatar upload (`media`, purpose `avatar`). The server attaches\n * it inside the same transaction that creates the profile, so a refused\n * Finish leaves the upload unattached (and swept), never half-used.\n */\n avatarMediaId: objectIdSchema.optional(),\n\n phone: phoneSchema,\n links: contactLinksSchema.optional(),\n\n /** Absent when the member skipped the step or refused the permission. */\n location: locationSchema.optional(),\n\n goals: z.array(goalSchema).min(GOALS_MIN).max(GOAL_VALUES.length),\n interests: z.array(topicSchema).min(INTERESTS_MIN).max(INTERESTS_MAX),\n skills: z.array(skillSchema).max(SKILLS_MAX).optional(),\n\n /**\n * Absent when the member skipped the business step. The profile's venture\n * without `foundedYear`, which onboarding does not ask; the Me tab does.\n */\n venture: ventureSchema.omit({ foundedYear: true }).optional(),\n businessType: businessTypeSchema.optional(),\n\n /**\n * The version of the guidelines this member read: `GUIDELINES_VERSION`,\n * exactly.\n *\n * A version and not a boolean, and the server stamps the time. A boolean says\n * somebody agreed; a version and a timestamp say WHAT they agreed to and\n * WHEN, which is the only form worth anything the day the text changes or a\n * moderation decision is disputed.\n */\n guidelinesVersion: guidelinesVersionSchema,\n});\nexport type CompleteOnboardingBody = z.infer<typeof completeOnboardingBodySchema>;\n/** What a form may hand to the finish body before parsing. */\nexport type CompleteOnboardingBodyInput = z.input<typeof completeOnboardingBodySchema>;\n\n// ─── The steps ───────────────────────────────────────────────────────────────\n\n/**\n * Each step's slice of the finish body, picked FROM it, so a client validating\n * \"may I leave this step\" and the server validating the finish apply the very\n * same rules. A copy would drift, and the drift shows up as a wizard that lets\n * a step pass and a finish that refuses it, on the last screen.\n *\n * THIS IS THE ONE PLACE A STEP'S FIELDS ARE WRITTEN. `FOUNDER_ONBOARDING_STEPS`\n * below reads them from here. A test asserts that every finish field belongs to\n * exactly one step.\n *\n * These validate the FINISH shape (skipped = absent), not the in-progress form:\n * a client maps its form state to the slice first. The server does not run them\n * on a draft save, because a half-answered step must be storable.\n */\nexport const ONBOARDING_STEP_SCHEMAS = {\n identity: completeOnboardingBodySchema.pick({\n displayName: true,\n gender: true,\n dateOfBirth: true,\n headline: true,\n about: true,\n avatarMediaId: true,\n // Here because ruling D8 folded the design's orphan \"title, achievements,\n // skills\" screen into step one. It was on no step until 0.2.0, which made\n // it the one finish field no step owned.\n skills: true,\n }),\n contact: completeOnboardingBodySchema.pick({ phone: true, links: true }),\n location: completeOnboardingBodySchema.pick({ location: true }),\n goals: completeOnboardingBodySchema.pick({ goals: true }),\n interests: completeOnboardingBodySchema.pick({ interests: true }),\n business: completeOnboardingBodySchema.pick({ venture: true, businessType: true }),\n guidelines: completeOnboardingBodySchema.pick({ guidelinesVersion: true }),\n} as const satisfies Record<OnboardingStepKey, z.ZodObject>;\n\n/** One step's slice, parsed: `OnboardingStepBody<'contact'>` is `{ phone, links? }`. */\nexport type OnboardingStepBody<K extends OnboardingStepKey> = z.infer<\n (typeof ONBOARDING_STEP_SCHEMAS)[K]\n>;\n\n/** A finish-body field name. */\nexport type OnboardingField = keyof CompleteOnboardingBody;\n\n/**\n * One step of the wizard, as a client renders it.\n *\n * `fields` is what gates leaving this step: a field that appears in no step is\n * unreachable twice over, because Continue will not surface its error and the\n * final submit's jump-to-the-bad-step finds no step to jump to and leaves the\n * last screen dead.\n */\nexport interface OnboardingStepConfig {\n /** Stable identifier. Safe for analytics and for a resume cursor, unlike an index. */\n key: OnboardingStepKey;\n /** Translation keys. The words live in the client's message files. */\n titleKey: `onboarding.steps.${OnboardingStepKey}.title`;\n helpKey: `onboarding.steps.${OnboardingStepKey}.help`;\n /** The step's slice of the finish body, in schema order. */\n fields: readonly OnboardingField[];\n /**\n * False when the whole step may be passed without answering anything.\n * DERIVED: a step is optional exactly when its slice accepts an empty\n * object, so \"skippable\" can never disagree with what the finish accepts.\n */\n required: boolean;\n}\n\nexport const FOUNDER_ONBOARDING_STEPS: readonly OnboardingStepConfig[] = ONBOARDING_STEP_KEYS.map(\n (key): OnboardingStepConfig => {\n const slice = ONBOARDING_STEP_SCHEMAS[key];\n return {\n key,\n titleKey: `onboarding.steps.${key}.title`,\n helpKey: `onboarding.steps.${key}.help`,\n fields: Object.keys(slice.shape) as OnboardingField[],\n required: !slice.safeParse({}).success,\n };\n },\n);\n\nexport const ONBOARDING_TOTAL_STEPS = FOUNDER_ONBOARDING_STEPS.length;\n\n/** Fields gating each step, in step order. Read from the same picks. */\nexport const ONBOARDING_STEP_FIELDS: readonly (readonly OnboardingField[])[] =\n FOUNDER_ONBOARDING_STEPS.map((s) => s.fields);\n\n/** What finishing answers: the new profile's id and the handle derived for it. */\nexport const completeOnboardingResponseSchema = z.object({\n id: z.string(),\n username: z.string(),\n});\nexport type CompleteOnboardingResponse = z.infer<typeof completeOnboardingResponseSchema>;\n\n// ─── The resume cursor ───────────────────────────────────────────────────────\n\n/**\n * The keys a draft may hold: exactly the in-progress form's fields.\n *\n * ⚠ The server writes each key as a dot path (`draft.<key>`). Unchecked, a key\n * holding a dot writes somewhere nested the form never asked for, and the\n * collection fills with whatever a client invents. Until 0.2.0 the backend\n * kept its own copy of this list and DROPPED unknown keys without a word; now a\n * draft carrying one is refused, with the key in the issue's path.\n */\nexport const onboardingDraftKeySchema = onboardingFormSchema.keyof();\nexport const ONBOARDING_DRAFT_KEYS = onboardingDraftKeySchema.options;\nexport type OnboardingDraftKey = z.infer<typeof onboardingDraftKeySchema>;\n\n/**\n * Where the member got to, kept in its own collection, separate from the\n * profile.\n *\n * `step` is a flat index into `FOUNDER_ONBOARDING_STEPS`, not a `(step, sub)`\n * pair: one number is what lets a member start on the web and resume elsewhere,\n * provided both ends agree on the encoding.\n *\n * The draft's KEYS come from the form; its VALUES are opaque on purpose. A\n * half-answered step must be storable even though it would fail the finish,\n * and everything in it is re-validated strictly at finalize.\n *\n * `partialRecord`, not `record`: in Zod 4 an enum-keyed `z.record` demands\n * every key, and a draft holds whichever steps the member has reached.\n */\nexport const onboardingDraftSchema = z.partialRecord(onboardingDraftKeySchema, z.unknown());\nexport type OnboardingDraft = z.infer<typeof onboardingDraftSchema>;\n\nexport const onboardingProgressSchema = z.object({\n step: z.number().int().min(0).max(ONBOARDING_TOTAL_STEPS),\n draft: onboardingDraftSchema.optional(),\n});\nexport type OnboardingProgress = z.infer<typeof onboardingProgressSchema>;\n\n/**\n * `PATCH` body: any subset of the cursor, merged server-side. No defaults.\n * `step` may equal `ONBOARDING_TOTAL_STEPS`: \"past the last step\", which the\n * client sends on its way to finish.\n */\nexport const onboardingProgressUpdateSchema = z.object({\n step: z.number().int().min(0).max(ONBOARDING_TOTAL_STEPS).optional(),\n draft: onboardingDraftSchema.optional(),\n});\nexport type OnboardingProgressUpdate = z.infer<typeof onboardingProgressUpdateSchema>;\n\n/**\n * What the client reads on return, from `GET` and from every `PATCH`.\n *\n * ⚠️ `onboarded` is the gate and it comes from the profile, not from the\n * cursor: a finished member on a new device must be recognised even when the\n * cursor row is gone, and a cursor that failed to load must never make an\n * unfinished member look finished.\n */\nexport const onboardingStatusSchema = z.object({\n onboarded: z.boolean(),\n step: z.number().int().min(0).max(ONBOARDING_TOTAL_STEPS),\n draft: onboardingDraftSchema.optional(),\n});\nexport type OnboardingStatus = z.infer<typeof onboardingStatusSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../../src/domains/onboarding/onboarding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC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,CAAC,CAAC,aAAa,CAAC,wBAAwB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAG5F,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC;IACzD,KAAK,EAAE,qBAAqB,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,QAAQ,EAAE;IACpE,KAAK,EAAE,qBAAqB,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAGH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC;IACzD,KAAK,EAAE,qBAAqB,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC","sourcesContent":["/**\n * founder-schema — Onboarding: steps, enums, and the two shapes of the answers\n *\n * ONE LIST DEFINES THE FLOW, AND IT IS DERIVED. Each step's fields are a pick\n * of the finish body (`ONBOARDING_STEP_SCHEMAS`), and `FOUNDER_ONBOARDING_STEPS`\n * is built FROM those picks: its `fields`, and even whether a step may be\n * skipped, come from the schema rather than from a second hand-written list.\n * GymMonk arrived at one list after keeping two in sync by hand, where a step\n * could exist with no title or, worse, no validation gate at all; until 0.2.0\n * this file still wrote the field lists twice.\n *\n * TWO SHAPES, ONE SET OF RULES. A half-filled form legitimately holds `null`\n * for a choice nobody has made yet; the finalize body only ever sees completed\n * answers. So the rules are written once and expressed over both shapes:\n * `onboardingFormSchema` for work in progress and `completeOnboardingBodySchema`\n * for the end. Letting those two drift is how a wizard says a step is optional\n * and then answers 422 at Finish.\n *\n * NO COPY IN HERE. Step titles and help lines are translation KEYS\n * (`titleKey`, `helpKey`), Jansathi's rule for every config string: an English\n * sentence in a shared package is a sentence every other language has to match\n * by wording. A topic category is named by its `key`, which the client words\n * (0.6.0 dropped its `labelKey`: the web, English-only since 2026-10-06, read\n * nothing from it).\n *\n * @module founder-schema/domains/onboarding\n */\n\nimport { z } from 'zod';\nimport {\n displayNameSchema,\n GENDER_VALUES,\n GOAL_VALUES,\n genderSchema,\n goalSchema,\n INDUSTRY_VALUES,\n industrySchema,\n locationSchema,\n objectIdSchema,\n optionalTrimmedString,\n phoneSchema,\n SKILL_VALUES,\n STARTUP_STAGE_VALUES,\n skillSchema,\n startupStageSchema,\n} from '../../core/common.js';\nimport {\n ABOUT_MAX,\n CITY_MAX,\n COUNTRY_MAX,\n DISPLAY_NAME_MAX,\n GOALS_MIN,\n HEADLINE_MAX,\n LINK_URL_MAX,\n SKILLS_MAX,\n STATE_MAX,\n TEAM_SIZE_MAX,\n VENTURE_NAME_MAX,\n} from '../../core/limits.js';\nimport { VALIDATION_MESSAGE } from '../../core/validation.js';\nimport { founderLinksSchema, ventureSchema } from '../profile/founder-profile.js';\n\n// ─── Age ─────────────────────────────────────────────────────────────────────\n\n/**\n * 18, ruled by the user 2026-09-21. Under-18 would pull in parental-consent\n * duties under the DPDP Act, which is a different and larger problem than a\n * validation rule.\n *\n * ⚠️ The SERVER refuses at finalize. This schema exists so the member sees a\n * useful message; it is not the gate.\n */\nexport const MIN_AGE_YEARS = 18;\n/** A sanity ceiling, not a product rule. Catches a mistyped year. */\nexport const MAX_AGE_YEARS = 120;\n\n/**\n * Whole years completed, by the calendar.\n *\n * ⚠️ NOT `elapsedMs / (365.25 * day)`, which is what the sibling product uses.\n * That approximation reads 17.9986 at the start of somebody's eighteenth\n * birthday and only crosses 18 about halfway through the day, so it refuses\n * them for the half of their birthday they are most likely to be signing up on.\n * Measured: it disagrees with the calendar on all 400 of the next 400 days.\n * An age gate is exactly the place an approximation is not good enough.\n */\n/** India Standard Time, UTC+05:30, with no daylight saving. */\nconst INDIA_OFFSET_MS = (5 * 60 + 30) * 60 * 1000;\n\nexport function ageInYears(isoDate: string, now: Date = new Date()): number {\n // ⚠️ A STRING, `YYYY-MM-DD`, not a `Date`. This is a wire contract, so it\n // takes the wire type. The backend is the obvious caller and the backend\n // holds a `Date`, so it must format first; passing the Date straight in used\n // to fail with `isoDate.split is not a function`, which says nothing useful.\n // Naming the fix costs one line and saves the next person the detour.\n if (typeof isoDate !== 'string') {\n throw new TypeError(\n 'ageInYears expects a YYYY-MM-DD string, not a Date. Format it first, e.g. date.toISOString().slice(0, 10).',\n );\n }\n const [y, m, d] = isoDate.split('-').map(Number) as [number, number, number];\n // The date TODAY IS IN INDIA (0.13.0), where the members are: a birthday\n // begins at midnight there, not five and a half hours later at UTC's\n // midnight. India keeps one offset all year.\n const today = new Date(now.getTime() + INDIA_OFFSET_MS);\n let age = today.getUTCFullYear() - y;\n const monthNow = today.getUTCMonth() + 1;\n if (monthNow < m || (monthNow === m && today.getUTCDate() < d)) age -= 1;\n return age;\n}\n\n/** A calendar date with no time component, `YYYY-MM-DD`. */\nexport const isoDateSchema = z\n .string()\n .trim()\n .regex(/^\\d{4}-\\d{2}-\\d{2}$/, VALIDATION_MESSAGE.dateInvalid);\nexport type IsoDate = z.infer<typeof isoDateSchema>;\n\n/** True only for a date that exists. Rejects 2026-02-30 and 2026-13-01. */\nfunction isRealDate(iso: string): boolean {\n const [y, m, d] = iso.split('-').map(Number) as [number, number, number];\n if (m < 1 || m > 12 || d < 1) return false;\n const asDate = new Date(Date.UTC(y, m - 1, d));\n return (\n asDate.getUTCFullYear() === y && asDate.getUTCMonth() === m - 1 && asDate.getUTCDate() === d\n );\n}\n\n/**\n * Date of birth, with the age gate applied per parse.\n *\n * ⚠️ THE CLIENT IS NOT THE GATE. This schema exists so the member sees a useful\n * message, and the server must refuse the same dates at finalize regardless.\n * The sibling dating product validates the identical rule on its client and\n * still shipped a defect where an under-age date of birth produced a live,\n * discoverable profile, because the client was the only thing checking.\n */\nexport const dateOfBirthSchema = isoDateSchema\n .refine(isRealDate, { error: VALIDATION_MESSAGE.dobInvalid })\n .refine((v) => ageInYears(v) >= MIN_AGE_YEARS, { error: VALIDATION_MESSAGE.dobUnderAge })\n .refine((v) => ageInYears(v) <= MAX_AGE_YEARS, { error: VALIDATION_MESSAGE.dobTooOld });\nexport type DateOfBirth = z.infer<typeof dateOfBirthSchema>;\n\n// ─── Business ────────────────────────────────────────────────────────────────\n\n/**\n * What KIND of business it is, which is not how it is registered\n * (`LEGAL_STRUCTURE_VALUES`): a freelancer may be a sole proprietorship, a\n * startup a private limited company, a social enterprise a Section 8 company.\n *\n * 0.16.0 (the user, 2026-10-18: \"check what more business types we can use\")\n * added the kinds an Indian founder network meets beyond the three it had: the\n * independent professional, the services firm, the social enterprise, the\n * family business and the franchise. `sme` is India's MSME.\n *\n * ⚠ Stored on the profile's venture and a Mongoose enum. Append only.\n */\nexport const BUSINESS_TYPE_VALUES = [\n 'startup',\n 'sme',\n 'enterprise',\n 'freelancer',\n 'agency',\n 'social_enterprise',\n 'family_business',\n 'franchise',\n] as const;\nexport const businessTypeSchema = z.enum(BUSINESS_TYPE_VALUES);\nexport type BusinessType = z.infer<typeof businessTypeSchema>;\n\n/**\n * How the business is registered in India, or that it is not yet (0.16.0, the\n * user, 2026-10-18: \"the categories that we have in India like private\n * limited, LLP or OPC or proprietorship\").\n *\n * The forms Indian law provides: a sole proprietorship and a partnership firm\n * (Indian Partnership Act, 1932), a limited liability partnership (LLP Act,\n * 2008), a one person, private limited, public limited or Section 8 (not for\n * profit) company (Companies Act, 2013), a trust or society, and a\n * co-operative society. Two more are answers a founder often has: not\n * registered yet (an idea, or a side project), and registered outside India\n * (an Indian team whose company is incorporated abroad, often in the US).\n *\n * Optional, like the business type, and private to the member: nothing here\n * verifies it (documents are a settings matter, by the user's ruling).\n *\n * ⚠ Stored on the profile's venture and a Mongoose enum. Append only.\n */\nexport const LEGAL_STRUCTURE_VALUES = [\n 'not_registered',\n 'sole_proprietorship',\n 'partnership',\n 'llp',\n 'opc',\n 'private_limited',\n 'public_limited',\n 'section_8',\n 'trust_or_society',\n 'cooperative',\n 'registered_abroad',\n] as const;\nexport const legalStructureSchema = z.enum(LEGAL_STRUCTURE_VALUES);\nexport type LegalStructure = z.infer<typeof legalStructureSchema>;\n\n// ─── Topics: the shared vocabulary ───────────────────────────────────────────────────────────────\n\n/**\n * ONE vocabulary, used TWICE: a member picks these as their `interests`, and a\n * post carries them as its `topics`. That is what makes relevance an index\n * lookup rather than a guess, and it is why this list is not called \"interests\"\n * - naming it for one of its two jobs would have invited a second list for the\n * other, which is the mistake this package has already made once with goals.\n * (User's ruling via hary, 2026-09-21.)\n *\n * Deliberately DISTINCT from two neighbours that will otherwise collect the\n * same words:\n *\n * industry what your company does\n * skills what you can do\n * interests what you want to read about\n *\n * If the copy does not keep them apart, members fill all three identically and\n * every one of them stops telling us anything.\n *\n * A closed list, consistent with industry, skill and stage, for the reason\n * already written beside those: free text means two people typing \"growth\" and\n * \"Growth Marketing\" never match, and matching is the entire point. The cost is\n * that adding an interest needs a publish.\n *\n * Tuned down from the dating product's 246, which is mostly dating material.\n * Values reuse its exact strings wherever one existed, so its Hindi\n * translations can be lifted across.\n *\n * ⚠️ Stored per member. Append only; removing a value orphans data.\n */\nexport const TOPIC_VALUES = [\n // Career growth\n 'mentoring',\n 'leadership',\n 'networking',\n 'public_speaking',\n 'teaching',\n 'hiring_talent',\n 'personal_branding',\n 'career_transition',\n 'remote_work',\n // Innovation and tech\n 'ai_ml',\n 'blockchain',\n 'crypto_web3',\n 'robotics',\n 'data_science',\n 'cybersecurity',\n 'game_dev',\n 'ux_design',\n 'app_development',\n 'open_source',\n 'electronics',\n 'space_exploration',\n 'green_tech',\n 'deeptech',\n 'no_code',\n // Business\n 'entrepreneurship',\n 'investing',\n 'stock_trading',\n 'personal_finance',\n 'fundraising',\n 'marketing',\n 'sales',\n 'consulting',\n 'ecommerce',\n 'retail',\n 'real_estate',\n 'supply_chain',\n 'product_management',\n 'growth',\n 'b2b_saas',\n 'd2c',\n // Personal development\n 'meditation',\n 'journaling',\n 'self_improvement',\n 'productivity',\n 'reading',\n 'online_courses',\n 'philosophy',\n 'psychology',\n 'therapy',\n 'sleep_optimization',\n 'gym',\n 'yoga',\n // Creative\n 'photography',\n 'writing',\n 'graphic_design',\n 'filmmaking',\n 'digital_art',\n 'content_creation',\n 'blogging',\n 'vlogging',\n 'podcasts',\n 'animation',\n 'music_production',\n // Impact and community\n 'volunteering',\n 'ngo_work',\n 'environmental',\n 'women_empowerment',\n 'community_service',\n 'social_enterprise',\n 'education_access',\n] as const;\nexport const topicSchema = z.enum(TOPIC_VALUES);\nexport type Topic = z.infer<typeof topicSchema>;\n\n/**\n * The grouping the picker renders.\n *\n * ⚠️ `TOPIC_VALUES` above is the single source of truth and this is typed\n * against it, so a typo here is a compile error rather than a chip that renders\n * and can never be selected. The dating product keeps a categorised list and a\n * flat list side by side and they have already drifted apart by two values;\n * a test in this package asserts these two agree exactly, in both directions.\n */\nexport const TOPIC_CATEGORY_KEYS = [\n 'career',\n 'tech',\n 'business',\n 'growth',\n 'creative',\n 'impact',\n] as const;\nexport type TopicCategoryKey = (typeof TOPIC_CATEGORY_KEYS)[number];\n\n/**\n * One group of the picker: its `key` (the client words it) and its topics.\n * Breaking in 0.6.0: no `labelKey`.\n */\nexport interface TopicCategory {\n key: TopicCategoryKey;\n values: readonly Topic[];\n}\n\nconst topicCategory = (key: TopicCategoryKey, values: readonly Topic[]): TopicCategory => ({\n key,\n values,\n});\n\nexport const TOPIC_CATEGORIES: readonly TopicCategory[] = [\n topicCategory('career', [\n 'mentoring',\n 'leadership',\n 'networking',\n 'public_speaking',\n 'teaching',\n 'hiring_talent',\n 'personal_branding',\n 'career_transition',\n 'remote_work',\n ]),\n topicCategory('tech', [\n 'ai_ml',\n 'blockchain',\n 'crypto_web3',\n 'robotics',\n 'data_science',\n 'cybersecurity',\n 'game_dev',\n 'ux_design',\n 'app_development',\n 'open_source',\n 'electronics',\n 'space_exploration',\n 'green_tech',\n 'deeptech',\n 'no_code',\n ]),\n topicCategory('business', [\n 'entrepreneurship',\n 'investing',\n 'stock_trading',\n 'personal_finance',\n 'fundraising',\n 'marketing',\n 'sales',\n 'consulting',\n 'ecommerce',\n 'retail',\n 'real_estate',\n 'supply_chain',\n 'product_management',\n 'growth',\n 'b2b_saas',\n 'd2c',\n ]),\n topicCategory('growth', [\n 'meditation',\n 'journaling',\n 'self_improvement',\n 'productivity',\n 'reading',\n 'online_courses',\n 'philosophy',\n 'psychology',\n 'therapy',\n 'sleep_optimization',\n 'gym',\n 'yoga',\n ]),\n topicCategory('creative', [\n 'photography',\n 'writing',\n 'graphic_design',\n 'filmmaking',\n 'digital_art',\n 'content_creation',\n 'blogging',\n 'vlogging',\n 'podcasts',\n 'animation',\n 'music_production',\n ]),\n topicCategory('impact', [\n 'volunteering',\n 'ngo_work',\n 'environmental',\n 'women_empowerment',\n 'community_service',\n 'social_enterprise',\n 'education_access',\n ]),\n];\n\n/**\n * How many a member must pick. A minimum exists because these drive feed\n * relevance and zero of them means no relevance at all.\n *\n * ⚠️ If 3 turns out to be hard to reach against this list, that is a signal\n * about the LIST, not about the minimum. The sibling product enforces no\n * minimum at all, and its own field config says \"pick up to 10\" while every\n * screen and schema enforces 20.\n */\nexport const INTERESTS_MIN = 3;\nexport const INTERESTS_MAX = 10;\n\n/**\n * A member's interests, by ONE rule (0.16.0): onboarding's finish and the Me\n * tab's editor (`putMyInterestsBodySchema`) both apply this very schema, so a\n * list one accepts the other can never refuse.\n *\n * Each topic only once: without that, three copies of one topic met the\n * minimum of three while meaning one interest.\n */\nexport const interestsSchema = z\n .array(topicSchema)\n .min(INTERESTS_MIN)\n .max(INTERESTS_MAX)\n .refine((topics) => new Set(topics).size === topics.length, {\n error: VALIDATION_MESSAGE.topicsDuplicate,\n });\n\n// ─── The step keys ───────────────────────────────────────────────────────────\n\n/**\n * The step keys, in order, as a literal union, so a consumer can key a table by\n * step and have TypeScript insist on every one. Before 0.2.0 `key` was a plain\n * string and the web client kept its own copy of this list to get the same\n * check; a test there held the two together. Now there is one list.\n *\n * 0.16.0 (the user, 2026-10-18) split the old first step, `identity`, into\n * three: `basics` (full name, gender, date of birth, nothing else), `photo`\n * (the photo alone) and `professional` (title, about, skills). Nine steps, up\n * from seven.\n *\n * ⚠ THE SERVER'S RESUME CURSOR IS AN INDEX INTO THIS LIST, so re-ordering it\n * moves every member who stopped part-way. A cursor saved under the old seven\n * is translated by the backend (its progress rows carry the list's version);\n * any further change needs the same.\n */\nexport const ONBOARDING_STEP_KEYS = [\n 'basics',\n 'photo',\n 'professional',\n 'contact',\n 'location',\n 'goals',\n 'interests',\n 'business',\n 'guidelines',\n] as const;\nexport type OnboardingStepKey = (typeof ONBOARDING_STEP_KEYS)[number];\n\n// ─── Guidelines ──────────────────────────────────────────────────────────────\n\n/**\n * The community guidelines a member agrees to at the last step, by version.\n *\n * The finish body accepts THIS version and no other: an old tab still showing\n * last month's text cannot record agreement to text it never displayed, and\n * `'whatever'` is not a version. Until 0.2.0 any non-empty string passed, and\n * the web client held this constant on its own.\n *\n * ⚠ Changing the guidelines text means bumping this, in the same publish.\n * Every member who agreed to an earlier version keeps that version on their\n * profile; that record is the point.\n */\nexport const GUIDELINES_VERSION = '2026-10-03' as const;\nexport const guidelinesVersionSchema = z.literal(GUIDELINES_VERSION, {\n error: VALIDATION_MESSAGE.guidelinesOutdated,\n});\n\n// ─── Contact ─────────────────────────────────────────────────────────────────\n\n/**\n * The links the contact step collects, picked from the profile's own links so\n * the two cannot disagree on what a link is. The phone is `phoneSchema`: ten\n * digits, stored raw with no country code, on the account rather than here.\n */\nexport const contactLinksSchema = founderLinksSchema.pick({\n linkedin: true,\n x: true,\n instagram: true,\n});\nexport type ContactLinks = z.infer<typeof contactLinksSchema>;\n\n/** A team size has at most this many digits: `TEAM_SIZE_MAX` written out. */\nexport const TEAM_SIZE_DIGITS_MAX = String(TEAM_SIZE_MAX).length;\n\n// ─── The form, mid-flight: the draft each step saves ──────────────────────────\n\n/**\n * The answers so far, keyed by the finish body's own field names: what each\n * step SAVES (`PATCH /onboarding`, merged per field), what `GET` hands back\n * to resume, and so the only keys a draft may hold\n * (`ONBOARDING_DRAFT_KEYS`).\n *\n * RAW, on purpose: a draft is what the member TYPED, not what Finish will send.\n * A half-typed link is ordinary text, a team size is digits as typed, and every\n * choice is `null` until made (\"not answered\" is not \"answered with nothing\").\n * Nothing here is required; whether a member may FINISH is\n * `completeOnboardingBodySchema`'s decision, and the client builds that body\n * from these answers.\n *\n * Screens may hold a different shape on top of this one. Derive that type from\n * `OnboardingForm` rather than writing it out, so a field added here reaches\n * every screen. (Since 0.16.0 the name is asked as one full name, which is\n * `displayName` as typed; first and last name are deduced by `splitFullName`.)\n *\n * A stored draft is UNTRUSTED when it comes back: an older client, or another\n * one, wrote it, and the server stores values opaquely. Read it with\n * `readOnboardingDraft`, never by casting.\n */\nexport const onboardingFormSchema = z.object({\n displayName: z.string().max(DISPLAY_NAME_MAX),\n gender: genderSchema.nullable(),\n /** `YYYY-MM-DD` once complete; whatever has been typed until then. */\n dateOfBirth: z.string(),\n headline: z.string().max(HEADLINE_MAX),\n about: z.string().max(ABOUT_MAX),\n /**\n * The completed upload's id (`media`, purpose `avatar`). Allowed in the form,\n * and NEVER restored by `readOnboardingDraft`: an upload not attached within\n * `MEDIA_UNATTACHED_TTL_HOURS` is deleted, so an id from an older draft would\n * fail at Finish, on the last screen, about a photo picked days ago. Clients\n * hold it for the visit and do not save it.\n */\n avatarMediaId: objectIdSchema.nullable(),\n skills: z.array(skillSchema).max(SKILLS_MAX),\n\n /** As typed; the finish body takes `phoneSchema`'s ten digits. */\n phone: z.string(),\n /** As typed; the finish body takes full `https://` URLs. */\n links: z.object({\n linkedin: z.string().max(LINK_URL_MAX),\n x: z.string().max(LINK_URL_MAX),\n instagram: z.string().max(LINK_URL_MAX),\n }),\n\n /** `null` until the member opens the location step, and when they skip it. */\n location: z\n .object({\n city: z.string().max(CITY_MAX),\n state: z.string().max(STATE_MAX),\n country: z.string().max(COUNTRY_MAX),\n })\n .nullable(),\n\n goals: z.array(goalSchema).max(GOAL_VALUES.length),\n interests: z.array(topicSchema).max(INTERESTS_MAX),\n\n /**\n * Always present; empty until started. Onboarding does not ask for a\n * tagline (the profile does, later), so the draft has none.\n */\n venture: z.object({\n name: z.string().max(VENTURE_NAME_MAX),\n website: z.string().max(LINK_URL_MAX),\n industry: industrySchema.nullable(),\n stage: startupStageSchema.nullable(),\n /** Digits as typed, at most `TEAM_SIZE_DIGITS_MAX`; the body sends a number. */\n teamSize: z.string().max(TEAM_SIZE_DIGITS_MAX),\n }),\n businessType: businessTypeSchema.nullable(),\n legalStructure: legalStructureSchema.nullable(),\n\n /** The guidelines text the member agreed to, or `null`. */\n guidelinesVersion: z.string().nullable(),\n});\nexport type OnboardingForm = z.infer<typeof onboardingFormSchema>;\n\n// ─── Reading a stored draft back ─────────────────────────────────────────────\n\n/** Longest date of birth worth keeping from a draft: `YYYY-MM-DD`. */\nconst DATE_INPUT_MAX = 10;\n\n/** Longest phone number worth keeping from a draft, as typed with spaces. */\nconst PHONE_INPUT_MAX = 20;\n\n/** Text, cut to its limit; anything that is not text is \"not answered\". */\nconst draftText = (max: number) =>\n z\n .string()\n .catch('')\n .transform((v) => v.slice(0, max));\n\n/** One of a vocabulary, or `null` (\"not answered\"). */\nconst draftChoice = <T extends readonly [string, ...string[]]>(values: T) =>\n z.enum(values).nullable().catch(null);\n\n/**\n * Items of a vocabulary, deduplicated and capped. Unknown items (a value since\n * retired, or junk) are dropped one by one, so the rest of the answer survives.\n */\nconst draftList = <T extends readonly [string, ...string[]]>(values: T, max: number) =>\n z\n .array(z.unknown())\n .catch([])\n .transform((items) => {\n const allowed = new Set<string>(values);\n const kept = items.filter((v): v is T[number] => typeof v === 'string' && allowed.has(v));\n return [...new Set(kept)].slice(0, max);\n });\n\n/** An object of the given fields, or `null` when the draft holds none. */\nconst draftObject = <S extends z.ZodRawShape>(shape: S) =>\n z\n .record(z.string(), z.unknown())\n .nullable()\n .catch(null)\n .pipe(z.union([z.null(), z.object(shape)]));\n\nconst draftReaderSchema = z.object({\n displayName: draftText(DISPLAY_NAME_MAX),\n gender: draftChoice(GENDER_VALUES),\n dateOfBirth: draftText(DATE_INPUT_MAX),\n headline: draftText(HEADLINE_MAX),\n about: draftText(ABOUT_MAX),\n avatarMediaId: z\n .unknown()\n .optional()\n .transform(() => null),\n skills: draftList(SKILL_VALUES, SKILLS_MAX),\n phone: draftText(PHONE_INPUT_MAX),\n links: draftObject({\n linkedin: draftText(LINK_URL_MAX),\n x: draftText(LINK_URL_MAX),\n instagram: draftText(LINK_URL_MAX),\n }).transform((links) => links ?? { linkedin: '', x: '', instagram: '' }),\n location: draftObject({\n city: draftText(CITY_MAX),\n state: draftText(STATE_MAX),\n country: draftText(COUNTRY_MAX),\n }),\n goals: draftList(GOAL_VALUES, GOAL_VALUES.length),\n interests: draftList(TOPIC_VALUES, INTERESTS_MAX),\n venture: draftObject({\n name: draftText(VENTURE_NAME_MAX),\n website: draftText(LINK_URL_MAX),\n industry: draftChoice(INDUSTRY_VALUES),\n stage: draftChoice(STARTUP_STAGE_VALUES),\n teamSize: z\n .string()\n .catch('')\n .transform((v) => v.replace(/\\D/g, '').slice(0, TEAM_SIZE_DIGITS_MAX)),\n }).transform((venture) => venture ?? { ...EMPTY_ONBOARDING_VENTURE }),\n businessType: draftChoice(BUSINESS_TYPE_VALUES),\n legalStructure: draftChoice(LEGAL_STRUCTURE_VALUES),\n /** Agreement to an OLDER text is not agreement to this one. */\n guidelinesVersion: z\n .unknown()\n .optional()\n .transform((v) => (v === GUIDELINES_VERSION ? GUIDELINES_VERSION : null)),\n});\n\n/** The business step before anything is chosen. */\nexport const EMPTY_ONBOARDING_VENTURE: OnboardingForm['venture'] = {\n name: '',\n website: '',\n industry: null,\n stage: null,\n teamSize: '',\n};\n\n/**\n * A stored draft as an `OnboardingForm`, FIELD BY FIELD.\n *\n * Every field is checked against its own vocabulary and cut to its own limit;\n * one that does not fit becomes \"not answered\" (`''`, `null`, `[]`) and the\n * rest of the draft survives. Never coerced into a different answer: a value\n * outside a vocabulary is dropped, not mapped to the nearest one. A photo\n * is never restored (see `avatarMediaId`), and agreement only counts for the\n * CURRENT guidelines.\n *\n * It fills in no answer the member did not give: a blank country stays blank.\n * Whatever a screen shows by default is that screen's choice.\n */\nexport function readOnboardingDraft(draft: unknown): OnboardingForm {\n const source = draft && typeof draft === 'object' && !Array.isArray(draft) ? draft : {};\n return draftReaderSchema.parse(source);\n}\n\n// ─── The finalize body ───────────────────────────────────────────────────────\n\n/**\n * What the client sends to finish. Completed answers only.\n *\n * ⚠️ EVERY OPTIONAL FIELD HERE MUST BE ABSENT WHEN UNANSWERED, never a default\n * standing in for one. The sibling gym product sent `bloodGroup ?? 'O+'`, so\n * every member who skipped the question was recorded as O-positive: a real\n * answer, indistinguishable from one somebody gave, sitting on a screen staff\n * would read in an emergency. Absent has to stay absent.\n *\n * ⚠️ AND THIS IS NOT THE GATE EITHER. The server re-checks the age and refuses\n * at finalize. `isOnboarded` may be set here and nowhere else: four of the\n * profile's partial indexes are gated on it, so a half-built profile carrying\n * it true appears in Discover half-built.\n *\n * Location, venture and links are the profile's own shapes, not copies: the\n * copies are how the profile model came to lack Instagram.\n */\nexport const completeOnboardingBodySchema = z.object({\n // Plain bounds, no custom message: `too_small` with minimum 1 already says\n // \"required\", and the client words it in the member's language.\n displayName: displayNameSchema,\n /**\n * ⚠️ NO `username` HERE, and its absence is deliberate.\n *\n * It used to be required, and that was a defect: no onboarding step collects\n * one, the design draws no screen for one, and it was not even on the\n * in-progress form, so a finalize could never have succeeded. Found by\n * checking every finalize-required field against the step list; a test now\n * asserts that relationship in both directions.\n *\n * The handle is DERIVED SERVER-SIDE at finalize and edited later from the Me\n * tab, which is what the product describes. That also makes the collision\n * case kinder: a server deriving a handle can suffix it and move on, whereas\n * a member who picked one six steps ago can only be told, at the end, that\n * step one failed.\n */\n gender: genderSchema,\n dateOfBirth: dateOfBirthSchema,\n headline: optionalTrimmedString(HEADLINE_MAX),\n about: optionalTrimmedString(ABOUT_MAX),\n /**\n * A completed avatar upload (`media`, purpose `avatar`). The server attaches\n * it inside the same transaction that creates the profile, so a refused\n * Finish leaves the upload unattached (and swept), never half-used.\n */\n avatarMediaId: objectIdSchema.optional(),\n\n phone: phoneSchema,\n links: contactLinksSchema.optional(),\n\n /** Absent when the member skipped the step or refused the permission. */\n location: locationSchema.optional(),\n\n goals: z.array(goalSchema).min(GOALS_MIN).max(GOAL_VALUES.length),\n interests: interestsSchema,\n skills: z.array(skillSchema).max(SKILLS_MAX).optional(),\n\n /**\n * Absent when the member skipped the business step. The profile's venture\n * without `foundedYear`, which onboarding does not ask; the Me tab does.\n */\n venture: ventureSchema.omit({ foundedYear: true }).optional(),\n businessType: businessTypeSchema.optional(),\n /** How the venture is registered, if the member says. Stored on the venture, like the type. */\n legalStructure: legalStructureSchema.optional(),\n\n /**\n * The version of the guidelines this member read: `GUIDELINES_VERSION`,\n * exactly.\n *\n * A version and not a boolean, and the server stamps the time. A boolean says\n * somebody agreed; a version and a timestamp say WHAT they agreed to and\n * WHEN, which is the only form worth anything the day the text changes or a\n * moderation decision is disputed.\n */\n guidelinesVersion: guidelinesVersionSchema,\n});\nexport type CompleteOnboardingBody = z.infer<typeof completeOnboardingBodySchema>;\n/** What a form may hand to the finish body before parsing. */\nexport type CompleteOnboardingBodyInput = z.input<typeof completeOnboardingBodySchema>;\n\n// ─── The steps ───────────────────────────────────────────────────────────────\n\n/**\n * Each step's slice of the finish body, picked FROM it, so a client validating\n * \"may I leave this step\" and the server validating the finish apply the very\n * same rules. A copy would drift, and the drift shows up as a wizard that lets\n * a step pass and a finish that refuses it, on the last screen.\n *\n * THIS IS THE ONE PLACE A STEP'S FIELDS ARE WRITTEN. `FOUNDER_ONBOARDING_STEPS`\n * below reads them from here. A test asserts that every finish field belongs to\n * exactly one step.\n *\n * These validate the FINISH shape (skipped = absent), not the in-progress form:\n * a client maps its form state to the slice first. The server does not run them\n * on a draft save, because a half-answered step must be storable.\n */\nexport const ONBOARDING_STEP_SCHEMAS = {\n // 0.16.0: the old `identity` step, split three ways by the user. The basics\n // are the step's only required answers; the photo and the professional\n // details may each be passed over.\n basics: completeOnboardingBodySchema.pick({ displayName: true, gender: true, dateOfBirth: true }),\n photo: completeOnboardingBodySchema.pick({ avatarMediaId: true }),\n professional: completeOnboardingBodySchema.pick({\n headline: true,\n about: true,\n // Ruling D8 folded the design's \"title, achievements, skills\" screen into\n // the profile's first questions; it now has a step of its own again.\n skills: true,\n }),\n contact: completeOnboardingBodySchema.pick({ phone: true, links: true }),\n location: completeOnboardingBodySchema.pick({ location: true }),\n goals: completeOnboardingBodySchema.pick({ goals: true }),\n interests: completeOnboardingBodySchema.pick({ interests: true }),\n business: completeOnboardingBodySchema.pick({\n venture: true,\n businessType: true,\n legalStructure: true,\n }),\n guidelines: completeOnboardingBodySchema.pick({ guidelinesVersion: true }),\n} as const satisfies Record<OnboardingStepKey, z.ZodObject>;\n\n/** One step's slice, parsed: `OnboardingStepBody<'contact'>` is `{ phone, links? }`. */\nexport type OnboardingStepBody<K extends OnboardingStepKey> = z.infer<\n (typeof ONBOARDING_STEP_SCHEMAS)[K]\n>;\n\n/** A finish-body field name. */\nexport type OnboardingField = keyof CompleteOnboardingBody;\n\n/**\n * One step of the wizard, as a client renders it.\n *\n * `fields` is what gates leaving this step: a field that appears in no step is\n * unreachable twice over, because Continue will not surface its error and the\n * final submit's jump-to-the-bad-step finds no step to jump to and leaves the\n * last screen dead.\n */\nexport interface OnboardingStepConfig {\n /** Stable identifier. Safe for analytics and for a resume cursor, unlike an index. */\n key: OnboardingStepKey;\n /** Translation keys. The words live in the client's message files. */\n titleKey: `onboarding.steps.${OnboardingStepKey}.title`;\n helpKey: `onboarding.steps.${OnboardingStepKey}.help`;\n /** The step's slice of the finish body, in schema order. */\n fields: readonly OnboardingField[];\n /**\n * False when the whole step may be passed without answering anything.\n * DERIVED: a step is optional exactly when its slice accepts an empty\n * object, so \"skippable\" can never disagree with what the finish accepts.\n */\n required: boolean;\n}\n\nexport const FOUNDER_ONBOARDING_STEPS: readonly OnboardingStepConfig[] = ONBOARDING_STEP_KEYS.map(\n (key): OnboardingStepConfig => {\n const slice = ONBOARDING_STEP_SCHEMAS[key];\n return {\n key,\n titleKey: `onboarding.steps.${key}.title`,\n helpKey: `onboarding.steps.${key}.help`,\n fields: Object.keys(slice.shape) as OnboardingField[],\n required: !slice.safeParse({}).success,\n };\n },\n);\n\nexport const ONBOARDING_TOTAL_STEPS = FOUNDER_ONBOARDING_STEPS.length;\n\n/** Fields gating each step, in step order. Read from the same picks. */\nexport const ONBOARDING_STEP_FIELDS: readonly (readonly OnboardingField[])[] =\n FOUNDER_ONBOARDING_STEPS.map((s) => s.fields);\n\n/** What finishing answers: the new profile's id and the handle derived for it. */\nexport const completeOnboardingResponseSchema = z.object({\n id: z.string(),\n username: z.string(),\n});\nexport type CompleteOnboardingResponse = z.infer<typeof completeOnboardingResponseSchema>;\n\n// ─── The resume cursor ───────────────────────────────────────────────────────\n\n/**\n * The keys a draft may hold: exactly the in-progress form's fields.\n *\n * ⚠ The server writes each key as a dot path (`draft.<key>`). Unchecked, a key\n * holding a dot writes somewhere nested the form never asked for, and the\n * collection fills with whatever a client invents. Until 0.2.0 the backend\n * kept its own copy of this list and DROPPED unknown keys without a word; now a\n * draft carrying one is refused, with the key in the issue's path.\n */\nexport const onboardingDraftKeySchema = onboardingFormSchema.keyof();\nexport const ONBOARDING_DRAFT_KEYS = onboardingDraftKeySchema.options;\nexport type OnboardingDraftKey = z.infer<typeof onboardingDraftKeySchema>;\n\n/**\n * Where the member got to, kept in its own collection, separate from the\n * profile.\n *\n * `step` is a flat index into `FOUNDER_ONBOARDING_STEPS`, not a `(step, sub)`\n * pair: one number is what lets a member start on the web and resume elsewhere,\n * provided both ends agree on the encoding.\n *\n * The draft's KEYS come from the form; its VALUES are opaque on purpose. A\n * half-answered step must be storable even though it would fail the finish,\n * and everything in it is re-validated strictly at finalize.\n *\n * `partialRecord`, not `record`: in Zod 4 an enum-keyed `z.record` demands\n * every key, and a draft holds whichever steps the member has reached.\n */\nexport const onboardingDraftSchema = z.partialRecord(onboardingDraftKeySchema, z.unknown());\nexport type OnboardingDraft = z.infer<typeof onboardingDraftSchema>;\n\nexport const onboardingProgressSchema = z.object({\n step: z.number().int().min(0).max(ONBOARDING_TOTAL_STEPS),\n draft: onboardingDraftSchema.optional(),\n});\nexport type OnboardingProgress = z.infer<typeof onboardingProgressSchema>;\n\n/**\n * `PATCH` body: any subset of the cursor, merged server-side. No defaults.\n * `step` may equal `ONBOARDING_TOTAL_STEPS`: \"past the last step\", which the\n * client sends on its way to finish.\n */\nexport const onboardingProgressUpdateSchema = z.object({\n step: z.number().int().min(0).max(ONBOARDING_TOTAL_STEPS).optional(),\n draft: onboardingDraftSchema.optional(),\n});\nexport type OnboardingProgressUpdate = z.infer<typeof onboardingProgressUpdateSchema>;\n\n/**\n * What the client reads on return, from `GET` and from every `PATCH`.\n *\n * ⚠️ `onboarded` is the gate and it comes from the profile, not from the\n * cursor: a finished member on a new device must be recognised even when the\n * cursor row is gone, and a cursor that failed to load must never make an\n * unfinished member look finished.\n */\nexport const onboardingStatusSchema = z.object({\n onboarded: z.boolean(),\n step: z.number().int().min(0).max(ONBOARDING_TOTAL_STEPS),\n draft: onboardingDraftSchema.optional(),\n});\nexport type OnboardingStatus = z.infer<typeof onboardingStatusSchema>;\n"]}
|
|
@@ -512,6 +512,7 @@ export declare const productSchema: z.ZodObject<{
|
|
|
512
512
|
marketing: "marketing";
|
|
513
513
|
supply_chain: "supply_chain";
|
|
514
514
|
fundraising: "fundraising";
|
|
515
|
+
social_enterprise: "social_enterprise";
|
|
515
516
|
mentoring: "mentoring";
|
|
516
517
|
leadership: "leadership";
|
|
517
518
|
networking: "networking";
|
|
@@ -570,7 +571,6 @@ export declare const productSchema: z.ZodObject<{
|
|
|
570
571
|
environmental: "environmental";
|
|
571
572
|
women_empowerment: "women_empowerment";
|
|
572
573
|
community_service: "community_service";
|
|
573
|
-
social_enterprise: "social_enterprise";
|
|
574
574
|
education_access: "education_access";
|
|
575
575
|
}>>;
|
|
576
576
|
screenshots: z.ZodArray<z.ZodObject<{
|
|
@@ -1214,6 +1214,7 @@ export declare const createProductBodySchema: z.ZodObject<{
|
|
|
1214
1214
|
marketing: "marketing";
|
|
1215
1215
|
supply_chain: "supply_chain";
|
|
1216
1216
|
fundraising: "fundraising";
|
|
1217
|
+
social_enterprise: "social_enterprise";
|
|
1217
1218
|
mentoring: "mentoring";
|
|
1218
1219
|
leadership: "leadership";
|
|
1219
1220
|
networking: "networking";
|
|
@@ -1272,7 +1273,6 @@ export declare const createProductBodySchema: z.ZodObject<{
|
|
|
1272
1273
|
environmental: "environmental";
|
|
1273
1274
|
women_empowerment: "women_empowerment";
|
|
1274
1275
|
community_service: "community_service";
|
|
1275
|
-
social_enterprise: "social_enterprise";
|
|
1276
1276
|
education_access: "education_access";
|
|
1277
1277
|
}>>>;
|
|
1278
1278
|
links: z.ZodOptional<z.ZodObject<{
|
|
@@ -1347,6 +1347,7 @@ export declare const updateProductBodySchema: z.ZodObject<{
|
|
|
1347
1347
|
marketing: "marketing";
|
|
1348
1348
|
supply_chain: "supply_chain";
|
|
1349
1349
|
fundraising: "fundraising";
|
|
1350
|
+
social_enterprise: "social_enterprise";
|
|
1350
1351
|
mentoring: "mentoring";
|
|
1351
1352
|
leadership: "leadership";
|
|
1352
1353
|
networking: "networking";
|
|
@@ -1405,7 +1406,6 @@ export declare const updateProductBodySchema: z.ZodObject<{
|
|
|
1405
1406
|
environmental: "environmental";
|
|
1406
1407
|
women_empowerment: "women_empowerment";
|
|
1407
1408
|
community_service: "community_service";
|
|
1408
|
-
social_enterprise: "social_enterprise";
|
|
1409
1409
|
education_access: "education_access";
|
|
1410
1410
|
}>>>;
|
|
1411
1411
|
links: z.ZodOptional<z.ZodObject<{
|
|
@@ -206,6 +206,13 @@ export declare const founderProfileSchema: z.ZodObject<{
|
|
|
206
206
|
market_insights: "market_insights";
|
|
207
207
|
learn_startup: "learn_startup";
|
|
208
208
|
start_company: "start_company";
|
|
209
|
+
get_feedback: "get_feedback";
|
|
210
|
+
find_testers: "find_testers";
|
|
211
|
+
mentor_others: "mentor_others";
|
|
212
|
+
invest_in_startups: "invest_in_startups";
|
|
213
|
+
join_startup: "join_startup";
|
|
214
|
+
find_service_providers: "find_service_providers";
|
|
215
|
+
attend_events: "attend_events";
|
|
209
216
|
}>>>;
|
|
210
217
|
links: z.ZodDefault<z.ZodObject<{
|
|
211
218
|
linkedin: z.ZodOptional<z.ZodURL>;
|
|
@@ -316,6 +323,13 @@ export declare const founderCardSchema: z.ZodObject<{
|
|
|
316
323
|
market_insights: "market_insights";
|
|
317
324
|
learn_startup: "learn_startup";
|
|
318
325
|
start_company: "start_company";
|
|
326
|
+
get_feedback: "get_feedback";
|
|
327
|
+
find_testers: "find_testers";
|
|
328
|
+
mentor_others: "mentor_others";
|
|
329
|
+
invest_in_startups: "invest_in_startups";
|
|
330
|
+
join_startup: "join_startup";
|
|
331
|
+
find_service_providers: "find_service_providers";
|
|
332
|
+
attend_events: "attend_events";
|
|
319
333
|
}>>>;
|
|
320
334
|
}, z.core.$strip>;
|
|
321
335
|
export type FounderCard = z.infer<typeof founderCardSchema>;
|
|
@@ -448,6 +462,13 @@ export declare const memberProfileSchema: z.ZodObject<{
|
|
|
448
462
|
market_insights: "market_insights";
|
|
449
463
|
learn_startup: "learn_startup";
|
|
450
464
|
start_company: "start_company";
|
|
465
|
+
get_feedback: "get_feedback";
|
|
466
|
+
find_testers: "find_testers";
|
|
467
|
+
mentor_others: "mentor_others";
|
|
468
|
+
invest_in_startups: "invest_in_startups";
|
|
469
|
+
join_startup: "join_startup";
|
|
470
|
+
find_service_providers: "find_service_providers";
|
|
471
|
+
attend_events: "attend_events";
|
|
451
472
|
}>>>;
|
|
452
473
|
links: z.ZodDefault<z.ZodObject<{
|
|
453
474
|
linkedin: z.ZodOptional<z.ZodURL>;
|
|
@@ -573,6 +594,13 @@ export declare const updateFounderProfileBodySchema: z.ZodObject<{
|
|
|
573
594
|
market_insights: "market_insights";
|
|
574
595
|
learn_startup: "learn_startup";
|
|
575
596
|
start_company: "start_company";
|
|
597
|
+
get_feedback: "get_feedback";
|
|
598
|
+
find_testers: "find_testers";
|
|
599
|
+
mentor_others: "mentor_others";
|
|
600
|
+
invest_in_startups: "invest_in_startups";
|
|
601
|
+
join_startup: "join_startup";
|
|
602
|
+
find_service_providers: "find_service_providers";
|
|
603
|
+
attend_events: "attend_events";
|
|
576
604
|
}>>>;
|
|
577
605
|
links: z.ZodOptional<z.ZodObject<{
|
|
578
606
|
linkedin: z.ZodOptional<z.ZodURL>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"founder-profile.d.ts","sourceRoot":"","sources":["../../../src/domains/profile/founder-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiCxB;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BxB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAIpD;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB;;;;;;iBAS7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAA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,6 +166,9 @@ export const founderProfileSchema = z.object({
|
|
|
166
166
|
* private field ever needs to show here, that is a product decision, not an
|
|
167
167
|
* accident of spreading the full document.
|
|
168
168
|
*/
|
|
169
|
+
// ⚠ The web's Discover cache follows the member's own saves of exactly these
|
|
170
|
+
// fields (`discoverChangedBy` in the web's features/profile/api.ts derives its
|
|
171
|
+
// list from this shape): adding a field here is enough, there is no second list.
|
|
169
172
|
export const founderCardSchema = founderProfileSchema.pick({
|
|
170
173
|
id: true,
|
|
171
174
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"founder-profile.js","sourceRoot":"","sources":["../../../src/domains/profile/founder-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC;IACpD,OAAO,EAAE,qBAAqB,CAAC,mBAAmB,CAAC;IACnD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AAO,EAAE,cAAc,EAAE,CAAC,CAAC","sourcesContent":["/**\n * founder-schema — The founder profile\n *\n * One member, one profile. The central auth account owns identity (email,\n * verification, deletion); this owns everything Founder Circle shows.\n *\n * @module founder-schema/domains/profile\n */\n\nimport { z } from 'zod';\nimport {\n chosenUsernameSchema,\n displayNameSchema,\n GOAL_VALUES,\n genderSchema,\n goalSchema,\n httpUrlSchema,\n industrySchema,\n locationSchema,\n objectIdSchema,\n optionalTrimmedString,\n phoneSchema,\n skillSchema,\n startupStageSchema,\n usernameSchema,\n} from '../../core/common.js';\nimport {\n ABOUT_MAX,\n DISPLAY_NAME_MAX,\n FOUNDED_YEAR_MIN,\n HEADLINE_MAX,\n SKILLS_MAX,\n TEAM_SIZE_MAX,\n TEAM_SIZE_MIN,\n VENTURE_NAME_MAX,\n VENTURE_TAGLINE_MAX,\n} from '../../core/limits.js';\nimport { VALIDATION_MESSAGE } from '../../core/validation.js';\nimport { mediaImageSchema } from '../media/media.js';\n\n// ─── Venture ─────────────────────────────────────────────────────────────────\n\n/**\n * ⚠ NUMBERS ARE NUMBERS, never coerced. This is a BODY, which arrives as JSON\n * and already carries types. `z.coerce.number()` here accepted `teamSize: true`\n * as 1 and `\" \"` as 0, and made the schema's input type `unknown`, so a form\n * typed against it could put anything in the field. Coercion belongs to query\n * strings, where everything is text; a form converts its text input before it\n * builds the body.\n */\nexport const ventureSchema = z.object({\n name: z.string().trim().min(1).max(VENTURE_NAME_MAX),\n tagline: optionalTrimmedString(VENTURE_TAGLINE_MAX),\n website: httpUrlSchema.optional(),\n industry: industrySchema,\n stage: startupStageSchema,\n /** Team size including the founder. Optional: a solo pre-idea founder has none to report. */\n teamSize: z.number().int().min(TEAM_SIZE_MIN).max(TEAM_SIZE_MAX).optional(),\n /**\n * Not in the future. The bound is read per parse, never captured once.\n *\n * `.max(new Date().getUTCFullYear())` looks equivalent and is not: it is\n * evaluated when this module is imported, so a server process still up on\n * 1 January rejects the new year until somebody restarts it. The backend's\n * Mongoose model deliberately carries no upper bound for the same reason, a\n * `max` there being frozen at schema construction. This is where the ceiling\n * lives.\n */\n foundedYear: z\n .number()\n .int()\n .min(FOUNDED_YEAR_MIN)\n .refine((year) => year <= new Date().getUTCFullYear(), {\n error: VALIDATION_MESSAGE.foundedYearFuture,\n })\n .optional(),\n});\nexport type Venture = z.infer<typeof ventureSchema>;\n\n// ─── A member as other surfaces name them ────────────────────────────────────\n\n/**\n * A member as a byline renders them: on a post (`feedAuthorSchema` is this), a\n * product's team, a review, a notification, the top-helpers list.\n *\n * Every field is LIVE, joined against the profile at read time rather than\n * frozen onto the post or review at write time. So a renamed handle, a new\n * photo or an edited headline updates everywhere, the link always targets the\n * current username, and nothing personal survives in other people's rows once\n * an account is deleted.\n */\nexport const memberBylineSchema = 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 member's one-line headline, live-joined. */\n headline: z.string().optional(),\n});\nexport type MemberByline = z.infer<typeof memberBylineSchema>;\n\n/**\n * What a member has given the community, on their profile and card.\n *\n * `score` is points earned from OTHER members' recognition only: a product's\n * team marking your feedback helpful, confirming you tested their product,\n * and members finding your review helpful (writing one earns nothing by\n * itself). Nothing a member\n * does to their own product counts, so the score cannot be bought by having a\n * popular one. `helpedCount` is how many different founders recognised that\n * help (\"Helped 12 founders\"). See `domains/contributions`.\n */\nexport const contributionSummarySchema = z.object({\n score: z.number().int().nonnegative(),\n helpedCount: z.number().int().nonnegative(),\n});\nexport type ContributionSummary = z.infer<typeof contributionSummarySchema>;\n\n// ─── Profile ─────────────────────────────────────────────────────────────────\n\n/**\n * The founder's off-platform links. ONE shape: onboarding's contact step picks\n * its three from this, so a link one side knows can never be missing on the\n * other. (It was written twice until 0.2.0, and the profile side lacked\n * Instagram, which onboarding collected.)\n *\n * Defined without a default, because the read side wants one and the write\n * side must not have one; each adds its own.\n */\nexport const founderLinksSchema = z.object({\n linkedin: httpUrlSchema.optional(),\n x: httpUrlSchema.optional(),\n instagram: httpUrlSchema.optional(),\n github: httpUrlSchema.optional(),\n website: httpUrlSchema.optional(),\n});\nexport type FounderLinks = z.infer<typeof founderLinksSchema>;\n\n/**\n * The profile as the owner sees it. A peer sees the redacted projection\n * (`founderCardSchema`), which is built on the server and never by dropping\n * fields on the client.\n */\nexport const founderProfileSchema = z.object({\n id: z.string(),\n userId: z.string(),\n username: usernameSchema,\n displayName: z.string().trim().min(1).max(DISPLAY_NAME_MAX),\n headline: optionalTrimmedString(HEADLINE_MAX),\n about: optionalTrimmedString(ABOUT_MAX),\n /**\n * Plain `z.url()`, NOT `httpUrlSchema`, and the difference is deliberate.\n *\n * No member can write this field: it appears in no write body, and\n * `public-surface.test.ts` asserts that and will fail the day somebody adds it\n * to a form. So the scheme restriction would be defending a field that takes\n * no member input, while refusing hosts we legitimately serve avatars from,\n * our own dev host among them. A read schema that rejects our own response is\n * a self-inflicted outage.\n *\n * ⚠️ That argument holds only while nothing member-supplied reaches this\n * field. Two sources write an avatar today and NEITHER is a member typing a\n * URL: our own upload path, and the central-auth `user.created` /\n * `user.updated` webhook, which carries the Google OAuth picture. If a\n * \"paste a link to your photo\" control is ever added, this goes back to\n * `httpUrlSchema` and the ruling behind it is void.\n *\n * WHICH picture: the member's uploaded photo at its small size (192, see\n * `MEDIA_SIZES.avatar`), else their sign-in provider's picture, else absent.\n * Every surface that shows this member resolves it the same way.\n */\n avatarUrl: z.url().optional(),\n /**\n * The uploaded photo itself, every size, when the member has one. Absent\n * means `avatarUrl` (if any) is the sign-in provider's picture, so a client\n * offers \"Remove photo\" only when this is present. Not on `founderCardSchema`:\n * a card needs one small picture, not the set.\n */\n avatar: mediaImageSchema.optional(),\n location: locationSchema.optional(),\n venture: ventureSchema.optional(),\n skills: z.array(skillSchema).max(SKILLS_MAX).default([]),\n goals: z.array(goalSchema).max(GOAL_VALUES.length).default([]),\n links: founderLinksSchema.default({}),\n /**\n * Their contribution to other founders. Server-computed, never written by a\n * member. REQUIRED, no default: a read-side default would let a server that\n * forgot the field pass as a real zero.\n */\n contribution: contributionSummarySchema,\n /** Onboarding is finished and the member is visible in Discover. */\n isOnboarded: z.boolean().default(false),\n /** Member paused their own profile. Hidden from Discover, keeps their data. */\n isActive: z.boolean().default(true),\n createdAt: z.iso.datetime(),\n updatedAt: z.iso.datetime(),\n});\nexport type FounderProfile = z.infer<typeof founderProfileSchema>;\n\n/**\n * What one founder sees of another in Discover and on a profile page.\n *\n * Built server-side. Keep it a strict subset of `founderProfileSchema` — if a\n * private field ever needs to show here, that is a product decision, not an\n * accident of spreading the full document.\n */\nexport const founderCardSchema = founderProfileSchema.pick({\n id: true,\n /**\n * The MEMBER's id (0.6.0): what a team invitation, a chat and every byline\n * key on. `id` is the profile's own id, which nothing takes as input.\n */\n userId: true,\n username: true,\n displayName: true,\n headline: true,\n avatarUrl: true,\n location: true,\n venture: true,\n skills: true,\n goals: true,\n contribution: true,\n});\nexport type FounderCard = z.infer<typeof founderCardSchema>;\n\n// ─── What a member chooses to show (0.11.0) ──────────────────────────────────\n\n/**\n * The four personal details a member MAY show on their profile page (the\n * user's ruling, 2026-10-11). Each is PRIVATE until its owner turns it on;\n * everything else on a profile is public as before. Changed only through\n * `PATCH /profiles/me/personal`.\n */\nexport const CONTACT_VISIBILITY_FIELDS = ['email', 'phone', 'gender', 'birthday'] as const;\nexport type ContactVisibilityField = (typeof CONTACT_VISIBILITY_FIELDS)[number];\n\n/** Which of the four the member shows. Every key present on a read: false is private. */\nexport const contactVisibilitySchema = z.object({\n email: z.boolean(),\n phone: z.boolean(),\n gender: z.boolean(),\n birthday: z.boolean(),\n});\nexport type ContactVisibility = z.infer<typeof contactVisibilitySchema>;\n\n/**\n * A birthday as OTHERS see it: day and month, NEVER the year (the user's\n * ruling). The year would give away the age and, with the name, the full date\n * of birth that identity checks ask for. The year is never on the wire.\n */\nexport const publicBirthdaySchema = z.object({\n day: z.number().int().min(1).max(31),\n month: z.number().int().min(1).max(12),\n});\nexport type PublicBirthday = z.infer<typeof publicBirthdaySchema>;\n\n/**\n * `GET /api/v1/founders/by-username/:username` (0.11.0): one member's profile\n * page, as a signed-in member (or the member themself) sees it.\n *\n * The card's fields, what only a page has room for (about, links, member\n * since), and `shown`: the personal details this member has CHOSEN to show,\n * and nothing else. Email and phone go to members only, never to an account\n * without membership (the coming viewer tier); the server decides, and a\n * client renders what arrives. Built field by field on the server\n * (`toMemberPublic`), never by dropping fields from a fuller document.\n *\n * `viewer.canMessage` is the server's answer to \"offer Message\": the tap\n * opens a conversation, or (0.13.0) the sheet that makes one possible (the\n * membership for a viewer, the plans for a member without one). Who may\n * message whom follows membership and plans, so no client works it out.\n */\nexport const memberProfileSchema = founderProfileSchema\n .pick({\n id: true,\n userId: true,\n username: true,\n displayName: true,\n headline: true,\n about: true,\n avatarUrl: true,\n location: true,\n venture: true,\n skills: true,\n goals: true,\n links: true,\n contribution: true,\n createdAt: true,\n })\n .extend({\n shown: z.object({\n email: z.string().optional(),\n phone: z.string().optional(),\n gender: genderSchema.optional(),\n birthday: publicBirthdaySchema.optional(),\n }),\n viewer: z.object({ isSelf: z.boolean(), canMessage: z.boolean() }),\n });\nexport type MemberProfile = z.infer<typeof memberProfileSchema>;\n\n/** The member page's address: `/discover/<username>`. */\nexport const memberHandleParamsSchema = z.object({ username: usernameSchema });\nexport type MemberHandleParams = z.infer<typeof memberHandleParamsSchema>;\n\n// ─── Write bodies ────────────────────────────────────────────────────────────\n\n/**\n * A text field the member is allowed to empty.\n *\n * Three states, and they are deliberately distinct:\n * absent do not touch this field\n * null clear it (the backend turns this into an `$unset`)\n * \"\" REJECTED\n *\n * The empty string is refused on purpose. A form that forgets to convert a\n * cleared input to `null` then fails loudly at the boundary, instead of being\n * silently dropped and leaving the member staring at text they just deleted.\n * `optionalTrimmedString` does the dropping, which is right for a create body\n * and wrong for a patch.\n */\nconst clearableText = (maxLength: number) =>\n z.string().trim().min(1, VALIDATION_MESSAGE.clearWithNull).max(maxLength).nullable().optional();\n\n/**\n * Patch body for the Me tab. Only the keys the member actually changed.\n *\n * ⚠️ Written as its own object ON PURPOSE. Do NOT rebuild it as\n * `founderProfileSchema.pick({...}).partial()`: `.partial()` does not switch\n * off `.default()`, so `skills`, `goals` and `links` would materialise as\n * `[]`, `[]` and `{}` on every request, including an empty one. Under a `$set`\n * that wipes a member's skills and every one of their links the moment they\n * edit their display name. `tsc` cannot see it and the request looks correct in\n * the network tab.\n *\n * The rule this comes from: defaults belong on the READ side. A write body\n * states what the caller sent and nothing else.\n */\nexport const updateFounderProfileBodySchema = z.object({\n displayName: displayNameSchema.optional(),\n headline: clearableText(HEADLINE_MAX),\n about: clearableText(ABOUT_MAX),\n /**\n * Carries the whole location; `locationSchema` has no default to fill a gap.\n * `null` removes it (0.10.0): a member may stop showing their city on\n * Discover, and nothing else would take it off once given.\n */\n location: locationSchema.nullable().optional(),\n /**\n * The whole venture, or `null` to remove it (0.10.0), its business type\n * with it: a member whose venture closed is no longer building it.\n */\n venture: ventureSchema.nullable().optional(),\n skills: z.array(skillSchema).max(SKILLS_MAX).optional(),\n goals: z.array(goalSchema).max(GOAL_VALUES.length).optional(),\n /** Sent whole. To drop one link, send the object without that key. */\n links: founderLinksSchema.optional(),\n});\nexport type UpdateFounderProfileBody = z.infer<typeof updateFounderProfileBodySchema>;\n\n/**\n * Username change. Separate from the profile patch because it needs a\n * uniqueness check, and it refuses a reserved handle (`chosenUsernameSchema`).\n */\nexport const updateUsernameBodySchema = z.object({ username: chosenUsernameSchema });\nexport type UpdateUsernameBody = z.infer<typeof updateUsernameBodySchema>;\n\n/** `GET /api/v1/profiles/username-available?username=` (0.13.0): the handle asked about. */\nexport const usernameAvailabilityQuerySchema = z.object({ username: usernameSchema });\nexport type UsernameAvailabilityQuery = z.infer<typeof usernameAvailabilityQuerySchema>;\n\n/** Availability probe behind the username field. */\nexport const usernameAvailabilitySchema = z.object({\n username: usernameSchema,\n available: z.boolean(),\n /** Present when unavailable: `taken` or `reserved`. */\n reason: z.enum(['taken', 'reserved']).optional(),\n});\nexport type UsernameAvailability = z.infer<typeof usernameAvailabilitySchema>;\n\n// ─── The member's own personal details ──────────────────────────────────────\n\n/**\n * `GET /api/v1/profiles/me/personal` (0.10.0): what ONLY the member sees of\n * themselves, the \"Personal details\" card of the Me tab's Profile.\n *\n * ⚠ OWNER ONLY, and kept OFF `founderProfileSchema` on purpose. Email, phone,\n * gender and date of birth are personal data: they appear on no card, no\n * search, no team list, no byline and no audit detail. The profile is read on\n * every page by the app shell; these do not travel with it, they are asked\n * for only where they are shown.\n *\n * Read shapes are plain where the stored value may predate today's rule (a\n * phone seeded from the sign-in provider in another format): a read schema\n * that rejects our own stored value is a self-inflicted outage. The write\n * body holds the rules.\n */\nexport const myPersonalDetailsSchema = z.object({\n /** The profile's display name: the card's first row. */\n displayName: z.string(),\n /** The sign-in account's. Changed there (Account settings), never here. */\n email: z.string().optional(),\n /** Ten digits as stored on the account mirror; display adds the `+91`. */\n phone: z.string().optional(),\n gender: genderSchema.optional(),\n /**\n * `YYYY-MM-DD`. READ ONLY: it is the 18+ check's input, given once at\n * onboarding. A date of birth that could be edited later would be an age\n * gate anyone could walk around.\n */\n dateOfBirth: z.string().optional(),\n /** Which of email, phone, gender and birthday the member shows on their page (0.11.0). */\n visibility: contactVisibilitySchema,\n});\nexport type MyPersonalDetails = z.infer<typeof myPersonalDetailsSchema>;\n\n/**\n * `PATCH /api/v1/profiles/me/personal` (0.10.0): name, phone and gender. Only\n * the keys the member changed; answers with `myPersonalDetailsSchema`.\n *\n * ONE RULE PER FIELD: the very schemas onboarding finishes with (the display\n * name, the ten-digit phone, the gender enum with prefer-not-to-say), so a\n * value one accepts the other can never refuse.\n *\n * ⚠ NO `.default()` and no `.partial()` of a read shape (see\n * `updateFounderProfileBodySchema`): absent means unchanged, and a default\n * would overwrite what is stored. No `dateOfBirth`: read only, above. No\n * `email`: the sign-in account owns it.\n *\n * Name and phone are PRODUCT-OWNED on Founder Circle's account mirror: the\n * sign-in service seeds them once and never overwrites them, so this edits\n * Founder Circle's copy and never calls the sign-in service.\n */\nexport const updateMyPersonalDetailsBodySchema = z.object({\n displayName: displayNameSchema.optional(),\n phone: phoneSchema.optional(),\n gender: genderSchema.optional(),\n /**\n * The city, or `null` to remove it (0.11.0): it moved to the Personal\n * Details card, so its editor saves it here, with the rest, in one\n * transaction. `PATCH /profiles/me` still takes it too.\n */\n location: locationSchema.nullable().optional(),\n /** Only the switches that changed (0.11.0). */\n visibility: contactVisibilitySchema.partial().optional(),\n});\nexport type UpdateMyPersonalDetailsBody = z.infer<typeof updateMyPersonalDetailsBodySchema>;\n\n// ─── The member's own photo ──────────────────────────────────────────────────\n\n/**\n * `PUT /api/v1/profiles/me/avatar`: use a completed upload (purpose `avatar`)\n * as the member's photo. Answers with the updated `founderProfileSchema`.\n *\n * The previous photo is deleted from storage, not merely unlinked, so its old\n * address stops working. `DELETE /api/v1/profiles/me/avatar` removes the photo\n * the same way and the member falls back to their sign-in provider's picture.\n */\nexport const setAvatarBodySchema = z.object({ mediaId: objectIdSchema });\nexport type SetAvatarBody = z.infer<typeof setAvatarBodySchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"founder-profile.js","sourceRoot":"","sources":["../../../src/domains/profile/founder-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,mBAAmB,GACpB,MAAM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AAC,CAAC,MAAM,CAAC;IACxD,WAAW,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACzC,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B;;;;OAIG;IACH,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC9C,+CAA+C;IAC/C,UAAU,EAAE,uBAAuB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACzD,CAAC,CAAC;AAGH,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC","sourcesContent":["/**\n * founder-schema — The founder profile\n *\n * One member, one profile. The central auth account owns identity (email,\n * verification, deletion); this owns everything Founder Circle shows.\n *\n * @module founder-schema/domains/profile\n */\n\nimport { z } from 'zod';\nimport {\n chosenUsernameSchema,\n displayNameSchema,\n GOAL_VALUES,\n genderSchema,\n goalSchema,\n httpUrlSchema,\n industrySchema,\n locationSchema,\n objectIdSchema,\n optionalTrimmedString,\n phoneSchema,\n skillSchema,\n startupStageSchema,\n usernameSchema,\n} from '../../core/common.js';\nimport {\n ABOUT_MAX,\n DISPLAY_NAME_MAX,\n FOUNDED_YEAR_MIN,\n HEADLINE_MAX,\n SKILLS_MAX,\n TEAM_SIZE_MAX,\n TEAM_SIZE_MIN,\n VENTURE_NAME_MAX,\n VENTURE_TAGLINE_MAX,\n} from '../../core/limits.js';\nimport { VALIDATION_MESSAGE } from '../../core/validation.js';\nimport { mediaImageSchema } from '../media/media.js';\n\n// ─── Venture ─────────────────────────────────────────────────────────────────\n\n/**\n * ⚠ NUMBERS ARE NUMBERS, never coerced. This is a BODY, which arrives as JSON\n * and already carries types. `z.coerce.number()` here accepted `teamSize: true`\n * as 1 and `\" \"` as 0, and made the schema's input type `unknown`, so a form\n * typed against it could put anything in the field. Coercion belongs to query\n * strings, where everything is text; a form converts its text input before it\n * builds the body.\n */\nexport const ventureSchema = z.object({\n name: z.string().trim().min(1).max(VENTURE_NAME_MAX),\n tagline: optionalTrimmedString(VENTURE_TAGLINE_MAX),\n website: httpUrlSchema.optional(),\n industry: industrySchema,\n stage: startupStageSchema,\n /** Team size including the founder. Optional: a solo pre-idea founder has none to report. */\n teamSize: z.number().int().min(TEAM_SIZE_MIN).max(TEAM_SIZE_MAX).optional(),\n /**\n * Not in the future. The bound is read per parse, never captured once.\n *\n * `.max(new Date().getUTCFullYear())` looks equivalent and is not: it is\n * evaluated when this module is imported, so a server process still up on\n * 1 January rejects the new year until somebody restarts it. The backend's\n * Mongoose model deliberately carries no upper bound for the same reason, a\n * `max` there being frozen at schema construction. This is where the ceiling\n * lives.\n */\n foundedYear: z\n .number()\n .int()\n .min(FOUNDED_YEAR_MIN)\n .refine((year) => year <= new Date().getUTCFullYear(), {\n error: VALIDATION_MESSAGE.foundedYearFuture,\n })\n .optional(),\n});\nexport type Venture = z.infer<typeof ventureSchema>;\n\n// ─── A member as other surfaces name them ────────────────────────────────────\n\n/**\n * A member as a byline renders them: on a post (`feedAuthorSchema` is this), a\n * product's team, a review, a notification, the top-helpers list.\n *\n * Every field is LIVE, joined against the profile at read time rather than\n * frozen onto the post or review at write time. So a renamed handle, a new\n * photo or an edited headline updates everywhere, the link always targets the\n * current username, and nothing personal survives in other people's rows once\n * an account is deleted.\n */\nexport const memberBylineSchema = 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 member's one-line headline, live-joined. */\n headline: z.string().optional(),\n});\nexport type MemberByline = z.infer<typeof memberBylineSchema>;\n\n/**\n * What a member has given the community, on their profile and card.\n *\n * `score` is points earned from OTHER members' recognition only: a product's\n * team marking your feedback helpful, confirming you tested their product,\n * and members finding your review helpful (writing one earns nothing by\n * itself). Nothing a member\n * does to their own product counts, so the score cannot be bought by having a\n * popular one. `helpedCount` is how many different founders recognised that\n * help (\"Helped 12 founders\"). See `domains/contributions`.\n */\nexport const contributionSummarySchema = z.object({\n score: z.number().int().nonnegative(),\n helpedCount: z.number().int().nonnegative(),\n});\nexport type ContributionSummary = z.infer<typeof contributionSummarySchema>;\n\n// ─── Profile ─────────────────────────────────────────────────────────────────\n\n/**\n * The founder's off-platform links. ONE shape: onboarding's contact step picks\n * its three from this, so a link one side knows can never be missing on the\n * other. (It was written twice until 0.2.0, and the profile side lacked\n * Instagram, which onboarding collected.)\n *\n * Defined without a default, because the read side wants one and the write\n * side must not have one; each adds its own.\n */\nexport const founderLinksSchema = z.object({\n linkedin: httpUrlSchema.optional(),\n x: httpUrlSchema.optional(),\n instagram: httpUrlSchema.optional(),\n github: httpUrlSchema.optional(),\n website: httpUrlSchema.optional(),\n});\nexport type FounderLinks = z.infer<typeof founderLinksSchema>;\n\n/**\n * The profile as the owner sees it. A peer sees the redacted projection\n * (`founderCardSchema`), which is built on the server and never by dropping\n * fields on the client.\n */\nexport const founderProfileSchema = z.object({\n id: z.string(),\n userId: z.string(),\n username: usernameSchema,\n displayName: z.string().trim().min(1).max(DISPLAY_NAME_MAX),\n headline: optionalTrimmedString(HEADLINE_MAX),\n about: optionalTrimmedString(ABOUT_MAX),\n /**\n * Plain `z.url()`, NOT `httpUrlSchema`, and the difference is deliberate.\n *\n * No member can write this field: it appears in no write body, and\n * `public-surface.test.ts` asserts that and will fail the day somebody adds it\n * to a form. So the scheme restriction would be defending a field that takes\n * no member input, while refusing hosts we legitimately serve avatars from,\n * our own dev host among them. A read schema that rejects our own response is\n * a self-inflicted outage.\n *\n * ⚠️ That argument holds only while nothing member-supplied reaches this\n * field. Two sources write an avatar today and NEITHER is a member typing a\n * URL: our own upload path, and the central-auth `user.created` /\n * `user.updated` webhook, which carries the Google OAuth picture. If a\n * \"paste a link to your photo\" control is ever added, this goes back to\n * `httpUrlSchema` and the ruling behind it is void.\n *\n * WHICH picture: the member's uploaded photo at its small size (192, see\n * `MEDIA_SIZES.avatar`), else their sign-in provider's picture, else absent.\n * Every surface that shows this member resolves it the same way.\n */\n avatarUrl: z.url().optional(),\n /**\n * The uploaded photo itself, every size, when the member has one. Absent\n * means `avatarUrl` (if any) is the sign-in provider's picture, so a client\n * offers \"Remove photo\" only when this is present. Not on `founderCardSchema`:\n * a card needs one small picture, not the set.\n */\n avatar: mediaImageSchema.optional(),\n location: locationSchema.optional(),\n venture: ventureSchema.optional(),\n skills: z.array(skillSchema).max(SKILLS_MAX).default([]),\n goals: z.array(goalSchema).max(GOAL_VALUES.length).default([]),\n links: founderLinksSchema.default({}),\n /**\n * Their contribution to other founders. Server-computed, never written by a\n * member. REQUIRED, no default: a read-side default would let a server that\n * forgot the field pass as a real zero.\n */\n contribution: contributionSummarySchema,\n /** Onboarding is finished and the member is visible in Discover. */\n isOnboarded: z.boolean().default(false),\n /** Member paused their own profile. Hidden from Discover, keeps their data. */\n isActive: z.boolean().default(true),\n createdAt: z.iso.datetime(),\n updatedAt: z.iso.datetime(),\n});\nexport type FounderProfile = z.infer<typeof founderProfileSchema>;\n\n/**\n * What one founder sees of another in Discover and on a profile page.\n *\n * Built server-side. Keep it a strict subset of `founderProfileSchema` — if a\n * private field ever needs to show here, that is a product decision, not an\n * accident of spreading the full document.\n */\n// ⚠ The web's Discover cache follows the member's own saves of exactly these\n// fields (`discoverChangedBy` in the web's features/profile/api.ts derives its\n// list from this shape): adding a field here is enough, there is no second list.\nexport const founderCardSchema = founderProfileSchema.pick({\n id: true,\n /**\n * The MEMBER's id (0.6.0): what a team invitation, a chat and every byline\n * key on. `id` is the profile's own id, which nothing takes as input.\n */\n userId: true,\n username: true,\n displayName: true,\n headline: true,\n avatarUrl: true,\n location: true,\n venture: true,\n skills: true,\n goals: true,\n contribution: true,\n});\nexport type FounderCard = z.infer<typeof founderCardSchema>;\n\n// ─── What a member chooses to show (0.11.0) ──────────────────────────────────\n\n/**\n * The four personal details a member MAY show on their profile page (the\n * user's ruling, 2026-10-11). Each is PRIVATE until its owner turns it on;\n * everything else on a profile is public as before. Changed only through\n * `PATCH /profiles/me/personal`.\n */\nexport const CONTACT_VISIBILITY_FIELDS = ['email', 'phone', 'gender', 'birthday'] as const;\nexport type ContactVisibilityField = (typeof CONTACT_VISIBILITY_FIELDS)[number];\n\n/** Which of the four the member shows. Every key present on a read: false is private. */\nexport const contactVisibilitySchema = z.object({\n email: z.boolean(),\n phone: z.boolean(),\n gender: z.boolean(),\n birthday: z.boolean(),\n});\nexport type ContactVisibility = z.infer<typeof contactVisibilitySchema>;\n\n/**\n * A birthday as OTHERS see it: day and month, NEVER the year (the user's\n * ruling). The year would give away the age and, with the name, the full date\n * of birth that identity checks ask for. The year is never on the wire.\n */\nexport const publicBirthdaySchema = z.object({\n day: z.number().int().min(1).max(31),\n month: z.number().int().min(1).max(12),\n});\nexport type PublicBirthday = z.infer<typeof publicBirthdaySchema>;\n\n/**\n * `GET /api/v1/founders/by-username/:username` (0.11.0): one member's profile\n * page, as a signed-in member (or the member themself) sees it.\n *\n * The card's fields, what only a page has room for (about, links, member\n * since), and `shown`: the personal details this member has CHOSEN to show,\n * and nothing else. Email and phone go to members only, never to an account\n * without membership (the coming viewer tier); the server decides, and a\n * client renders what arrives. Built field by field on the server\n * (`toMemberPublic`), never by dropping fields from a fuller document.\n *\n * `viewer.canMessage` is the server's answer to \"offer Message\": the tap\n * opens a conversation, or (0.13.0) the sheet that makes one possible (the\n * membership for a viewer, the plans for a member without one). Who may\n * message whom follows membership and plans, so no client works it out.\n */\nexport const memberProfileSchema = founderProfileSchema\n .pick({\n id: true,\n userId: true,\n username: true,\n displayName: true,\n headline: true,\n about: true,\n avatarUrl: true,\n location: true,\n venture: true,\n skills: true,\n goals: true,\n links: true,\n contribution: true,\n createdAt: true,\n })\n .extend({\n shown: z.object({\n email: z.string().optional(),\n phone: z.string().optional(),\n gender: genderSchema.optional(),\n birthday: publicBirthdaySchema.optional(),\n }),\n viewer: z.object({ isSelf: z.boolean(), canMessage: z.boolean() }),\n });\nexport type MemberProfile = z.infer<typeof memberProfileSchema>;\n\n/** The member page's address: `/discover/<username>`. */\nexport const memberHandleParamsSchema = z.object({ username: usernameSchema });\nexport type MemberHandleParams = z.infer<typeof memberHandleParamsSchema>;\n\n// ─── Write bodies ────────────────────────────────────────────────────────────\n\n/**\n * A text field the member is allowed to empty.\n *\n * Three states, and they are deliberately distinct:\n * absent do not touch this field\n * null clear it (the backend turns this into an `$unset`)\n * \"\" REJECTED\n *\n * The empty string is refused on purpose. A form that forgets to convert a\n * cleared input to `null` then fails loudly at the boundary, instead of being\n * silently dropped and leaving the member staring at text they just deleted.\n * `optionalTrimmedString` does the dropping, which is right for a create body\n * and wrong for a patch.\n */\nconst clearableText = (maxLength: number) =>\n z.string().trim().min(1, VALIDATION_MESSAGE.clearWithNull).max(maxLength).nullable().optional();\n\n/**\n * Patch body for the Me tab. Only the keys the member actually changed.\n *\n * ⚠️ Written as its own object ON PURPOSE. Do NOT rebuild it as\n * `founderProfileSchema.pick({...}).partial()`: `.partial()` does not switch\n * off `.default()`, so `skills`, `goals` and `links` would materialise as\n * `[]`, `[]` and `{}` on every request, including an empty one. Under a `$set`\n * that wipes a member's skills and every one of their links the moment they\n * edit their display name. `tsc` cannot see it and the request looks correct in\n * the network tab.\n *\n * The rule this comes from: defaults belong on the READ side. A write body\n * states what the caller sent and nothing else.\n */\nexport const updateFounderProfileBodySchema = z.object({\n displayName: displayNameSchema.optional(),\n headline: clearableText(HEADLINE_MAX),\n about: clearableText(ABOUT_MAX),\n /**\n * Carries the whole location; `locationSchema` has no default to fill a gap.\n * `null` removes it (0.10.0): a member may stop showing their city on\n * Discover, and nothing else would take it off once given.\n */\n location: locationSchema.nullable().optional(),\n /**\n * The whole venture, or `null` to remove it (0.10.0), its business type\n * with it: a member whose venture closed is no longer building it.\n */\n venture: ventureSchema.nullable().optional(),\n skills: z.array(skillSchema).max(SKILLS_MAX).optional(),\n goals: z.array(goalSchema).max(GOAL_VALUES.length).optional(),\n /** Sent whole. To drop one link, send the object without that key. */\n links: founderLinksSchema.optional(),\n});\nexport type UpdateFounderProfileBody = z.infer<typeof updateFounderProfileBodySchema>;\n\n/**\n * Username change. Separate from the profile patch because it needs a\n * uniqueness check, and it refuses a reserved handle (`chosenUsernameSchema`).\n */\nexport const updateUsernameBodySchema = z.object({ username: chosenUsernameSchema });\nexport type UpdateUsernameBody = z.infer<typeof updateUsernameBodySchema>;\n\n/** `GET /api/v1/profiles/username-available?username=` (0.13.0): the handle asked about. */\nexport const usernameAvailabilityQuerySchema = z.object({ username: usernameSchema });\nexport type UsernameAvailabilityQuery = z.infer<typeof usernameAvailabilityQuerySchema>;\n\n/** Availability probe behind the username field. */\nexport const usernameAvailabilitySchema = z.object({\n username: usernameSchema,\n available: z.boolean(),\n /** Present when unavailable: `taken` or `reserved`. */\n reason: z.enum(['taken', 'reserved']).optional(),\n});\nexport type UsernameAvailability = z.infer<typeof usernameAvailabilitySchema>;\n\n// ─── The member's own personal details ──────────────────────────────────────\n\n/**\n * `GET /api/v1/profiles/me/personal` (0.10.0): what ONLY the member sees of\n * themselves, the \"Personal details\" card of the Me tab's Profile.\n *\n * ⚠ OWNER ONLY, and kept OFF `founderProfileSchema` on purpose. Email, phone,\n * gender and date of birth are personal data: they appear on no card, no\n * search, no team list, no byline and no audit detail. The profile is read on\n * every page by the app shell; these do not travel with it, they are asked\n * for only where they are shown.\n *\n * Read shapes are plain where the stored value may predate today's rule (a\n * phone seeded from the sign-in provider in another format): a read schema\n * that rejects our own stored value is a self-inflicted outage. The write\n * body holds the rules.\n */\nexport const myPersonalDetailsSchema = z.object({\n /** The profile's display name: the card's first row. */\n displayName: z.string(),\n /** The sign-in account's. Changed there (Account settings), never here. */\n email: z.string().optional(),\n /** Ten digits as stored on the account mirror; display adds the `+91`. */\n phone: z.string().optional(),\n gender: genderSchema.optional(),\n /**\n * `YYYY-MM-DD`. READ ONLY: it is the 18+ check's input, given once at\n * onboarding. A date of birth that could be edited later would be an age\n * gate anyone could walk around.\n */\n dateOfBirth: z.string().optional(),\n /** Which of email, phone, gender and birthday the member shows on their page (0.11.0). */\n visibility: contactVisibilitySchema,\n});\nexport type MyPersonalDetails = z.infer<typeof myPersonalDetailsSchema>;\n\n/**\n * `PATCH /api/v1/profiles/me/personal` (0.10.0): name, phone and gender. Only\n * the keys the member changed; answers with `myPersonalDetailsSchema`.\n *\n * ONE RULE PER FIELD: the very schemas onboarding finishes with (the display\n * name, the ten-digit phone, the gender enum with prefer-not-to-say), so a\n * value one accepts the other can never refuse.\n *\n * ⚠ NO `.default()` and no `.partial()` of a read shape (see\n * `updateFounderProfileBodySchema`): absent means unchanged, and a default\n * would overwrite what is stored. No `dateOfBirth`: read only, above. No\n * `email`: the sign-in account owns it.\n *\n * Name and phone are PRODUCT-OWNED on Founder Circle's account mirror: the\n * sign-in service seeds them once and never overwrites them, so this edits\n * Founder Circle's copy and never calls the sign-in service.\n */\nexport const updateMyPersonalDetailsBodySchema = z.object({\n displayName: displayNameSchema.optional(),\n phone: phoneSchema.optional(),\n gender: genderSchema.optional(),\n /**\n * The city, or `null` to remove it (0.11.0): it moved to the Personal\n * Details card, so its editor saves it here, with the rest, in one\n * transaction. `PATCH /profiles/me` still takes it too.\n */\n location: locationSchema.nullable().optional(),\n /** Only the switches that changed (0.11.0). */\n visibility: contactVisibilitySchema.partial().optional(),\n});\nexport type UpdateMyPersonalDetailsBody = z.infer<typeof updateMyPersonalDetailsBodySchema>;\n\n// ─── The member's own photo ──────────────────────────────────────────────────\n\n/**\n * `PUT /api/v1/profiles/me/avatar`: use a completed upload (purpose `avatar`)\n * as the member's photo. Answers with the updated `founderProfileSchema`.\n *\n * The previous photo is deleted from storage, not merely unlinked, so its old\n * address stops working. `DELETE /api/v1/profiles/me/avatar` removes the photo\n * the same way and the member falls back to their sign-in provider's picture.\n */\nexport const setAvatarBodySchema = z.object({ mediaId: objectIdSchema });\nexport type SetAvatarBody = z.infer<typeof setAvatarBodySchema>;\n"]}
|