founder-schema 0.19.0 → 0.20.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.
Files changed (142) hide show
  1. package/README.md +46 -0
  2. package/dist/access/permissions.d.ts +3 -3
  3. package/dist/access/permissions.d.ts.map +1 -1
  4. package/dist/access/permissions.js.map +1 -1
  5. package/dist/core/common.d.ts +42 -15
  6. package/dist/core/common.d.ts.map +1 -1
  7. package/dist/core/common.js +58 -15
  8. package/dist/core/common.js.map +1 -1
  9. package/dist/core/deletion.d.ts +40 -0
  10. package/dist/core/deletion.d.ts.map +1 -0
  11. package/dist/core/deletion.js +39 -0
  12. package/dist/core/deletion.js.map +1 -0
  13. package/dist/domains/audit/audit.d.ts +36 -12
  14. package/dist/domains/audit/audit.d.ts.map +1 -1
  15. package/dist/domains/audit/audit.js +9 -10
  16. package/dist/domains/audit/audit.js.map +1 -1
  17. package/dist/domains/billing/billing.d.ts +29 -13
  18. package/dist/domains/billing/billing.d.ts.map +1 -1
  19. package/dist/domains/billing/billing.js +2 -3
  20. package/dist/domains/billing/billing.js.map +1 -1
  21. package/dist/domains/chat/chat.d.ts +19 -5
  22. package/dist/domains/chat/chat.d.ts.map +1 -1
  23. package/dist/domains/chat/chat.js +10 -10
  24. package/dist/domains/chat/chat.js.map +1 -1
  25. package/dist/domains/communities/communities.d.ts +95 -57
  26. package/dist/domains/communities/communities.d.ts.map +1 -1
  27. package/dist/domains/contributions/contributions.d.ts +28 -12
  28. package/dist/domains/contributions/contributions.d.ts.map +1 -1
  29. package/dist/domains/contributions/contributions.js +3 -0
  30. package/dist/domains/contributions/contributions.js.map +1 -1
  31. package/dist/domains/discover/discover.d.ts +2 -2
  32. package/dist/domains/feed/feed.d.ts +111 -63
  33. package/dist/domains/feed/feed.d.ts.map +1 -1
  34. package/dist/domains/feed/feed.js +3 -0
  35. package/dist/domains/feed/feed.js.map +1 -1
  36. package/dist/domains/location/areas.d.ts +7 -0
  37. package/dist/domains/location/areas.d.ts.map +1 -1
  38. package/dist/domains/location/areas.js +3 -0
  39. package/dist/domains/location/areas.js.map +1 -1
  40. package/dist/domains/media/media.d.ts +22 -0
  41. package/dist/domains/media/media.d.ts.map +1 -1
  42. package/dist/domains/media/media.js +20 -0
  43. package/dist/domains/media/media.js.map +1 -1
  44. package/dist/domains/members/members.d.ts +26 -9
  45. package/dist/domains/members/members.d.ts.map +1 -1
  46. package/dist/domains/members/members.js +9 -10
  47. package/dist/domains/members/members.js.map +1 -1
  48. package/dist/domains/membership/membership.d.ts +19 -0
  49. package/dist/domains/membership/membership.d.ts.map +1 -1
  50. package/dist/domains/membership/membership.js +10 -0
  51. package/dist/domains/membership/membership.js.map +1 -1
  52. package/dist/domains/moderation/moderation.d.ts +8 -2
  53. package/dist/domains/moderation/moderation.d.ts.map +1 -1
  54. package/dist/domains/moderation/moderation.js +3 -6
  55. package/dist/domains/moderation/moderation.js.map +1 -1
  56. package/dist/domains/notifications/notifications.d.ts +10 -6
  57. package/dist/domains/notifications/notifications.d.ts.map +1 -1
  58. package/dist/domains/onboarding/onboarding-answers.js +1 -1
  59. package/dist/domains/onboarding/onboarding-answers.js.map +1 -1
  60. package/dist/domains/onboarding/onboarding.d.ts +11 -10
  61. package/dist/domains/onboarding/onboarding.d.ts.map +1 -1
  62. package/dist/domains/onboarding/onboarding.js +16 -9
  63. package/dist/domains/onboarding/onboarding.js.map +1 -1
  64. package/dist/domains/people/person.d.ts +54 -0
  65. package/dist/domains/people/person.d.ts.map +1 -0
  66. package/dist/domains/people/person.js +73 -0
  67. package/dist/domains/people/person.js.map +1 -0
  68. package/dist/domains/products/products.d.ts +62 -33
  69. package/dist/domains/products/products.d.ts.map +1 -1
  70. package/dist/domains/products/products.js +3 -0
  71. package/dist/domains/products/products.js.map +1 -1
  72. package/dist/domains/profile/founder-profile.d.ts +36 -19
  73. package/dist/domains/profile/founder-profile.d.ts.map +1 -1
  74. package/dist/domains/profile/founder-profile.js +43 -21
  75. package/dist/domains/profile/founder-profile.js.map +1 -1
  76. package/dist/domains/reviews/reviews.d.ts +25 -15
  77. package/dist/domains/reviews/reviews.d.ts.map +1 -1
  78. package/dist/domains/support/support.d.ts +47 -10
  79. package/dist/domains/support/support.d.ts.map +1 -1
  80. package/dist/domains/support/support.js +4 -2
  81. package/dist/domains/support/support.js.map +1 -1
  82. package/dist/domains/team/team.d.ts +9 -3
  83. package/dist/domains/team/team.d.ts.map +1 -1
  84. package/dist/domains/team/team.js +3 -6
  85. package/dist/domains/team/team.js.map +1 -1
  86. package/dist/index.d.ts +11 -9
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +13 -9
  89. package/dist/index.js.map +1 -1
  90. package/package.json +3 -2
  91. package/dist/account.d.ts +0 -40
  92. package/dist/account.d.ts.map +0 -1
  93. package/dist/account.js +0 -39
  94. package/dist/account.js.map +0 -1
  95. package/dist/chat.d.ts +0 -187
  96. package/dist/chat.d.ts.map +0 -1
  97. package/dist/chat.js +0 -189
  98. package/dist/chat.js.map +0 -1
  99. package/dist/common.d.ts +0 -304
  100. package/dist/common.d.ts.map +0 -1
  101. package/dist/common.js +0 -340
  102. package/dist/common.js.map +0 -1
  103. package/dist/discover.d.ts +0 -245
  104. package/dist/discover.d.ts.map +0 -1
  105. package/dist/discover.js +0 -68
  106. package/dist/discover.js.map +0 -1
  107. package/dist/errors.d.ts +0 -85
  108. package/dist/errors.d.ts.map +0 -1
  109. package/dist/errors.js +0 -89
  110. package/dist/errors.js.map +0 -1
  111. package/dist/feed.d.ts +0 -1658
  112. package/dist/feed.d.ts.map +0 -1
  113. package/dist/feed.js +0 -623
  114. package/dist/feed.js.map +0 -1
  115. package/dist/founder-profile.d.ts +0 -387
  116. package/dist/founder-profile.d.ts.map +0 -1
  117. package/dist/founder-profile.js +0 -180
  118. package/dist/founder-profile.js.map +0 -1
  119. package/dist/limits.d.ts +0 -76
  120. package/dist/limits.d.ts.map +0 -1
  121. package/dist/limits.js +0 -84
  122. package/dist/limits.js.map +0 -1
  123. package/dist/onboarding.d.ts +0 -1018
  124. package/dist/onboarding.d.ts.map +0 -1
  125. package/dist/onboarding.js +0 -717
  126. package/dist/onboarding.js.map +0 -1
  127. package/dist/responses/common.d.ts +0 -167
  128. package/dist/responses/common.d.ts.map +0 -1
  129. package/dist/responses/common.js +0 -67
  130. package/dist/responses/common.js.map +0 -1
  131. package/dist/responses/index.d.ts +0 -7
  132. package/dist/responses/index.d.ts.map +0 -1
  133. package/dist/responses/index.js +0 -7
  134. package/dist/responses/index.js.map +0 -1
  135. package/dist/uploads.d.ts +0 -113
  136. package/dist/uploads.d.ts.map +0 -1
  137. package/dist/uploads.js +0 -106
  138. package/dist/uploads.js.map +0 -1
  139. package/dist/validation.d.ts +0 -136
  140. package/dist/validation.d.ts.map +0 -1
  141. package/dist/validation.js +0 -142
  142. package/dist/validation.js.map +0 -1
@@ -65,19 +65,23 @@ export type VentureKey = (typeof VENTURE_KEYS)[number];
65
65
  export declare const VENTURE_OPTIONAL_KEYS: readonly VentureKey[];
66
66
  /**
67
67
  * A member as a byline renders them: on a post (`feedAuthorSchema` is this), a
68
- * product's team, a review, a notification, the top-helpers list.
68
+ * product's team, a review, a notification, the top-helpers list. Since
69
+ * 0.20.0 it is `personSchema` (one shape for every person, its doc says why)
70
+ * with the member's one-line headline.
69
71
  *
70
- * Every field is LIVE, joined against the profile at read time rather than
71
- * frozen onto the post or review at write time. So a renamed handle, a new
72
- * photo or an edited headline updates everywhere, the link always targets the
73
- * current username, and nothing personal survives in other people's rows once
74
- * an account is deleted.
72
+ * Every field is LIVE, joined at read time rather than frozen onto the post or
73
+ * review at write time. So a new name, handle, photo or headline shows
74
+ * everywhere, the link always targets the current username, and nothing
75
+ * personal survives in other people's rows once an account is deleted: the
76
+ * byline of a deleted account is `former: true` with no name or picture.
75
77
  */
76
78
  export declare const memberBylineSchema: z.ZodObject<{
77
- userId: z.ZodString;
78
- username: z.ZodString;
79
+ userId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
80
+ username: z.ZodNullable<z.ZodString>;
79
81
  displayName: z.ZodString;
80
- avatarUrl: z.ZodOptional<z.ZodURL>;
82
+ firstName: z.ZodString;
83
+ avatarUrl: z.ZodNullable<z.ZodURL>;
84
+ former: z.ZodBoolean;
81
85
  headline: z.ZodOptional<z.ZodString>;
82
86
  }, z.core.$strip>;
83
87
  export type MemberByline = z.infer<typeof memberBylineSchema>;
@@ -131,6 +135,8 @@ export declare const founderProfileSchema: z.ZodObject<{
131
135
  userId: z.ZodString;
132
136
  username: z.ZodString;
133
137
  displayName: z.ZodString;
138
+ firstName: z.ZodString;
139
+ lastName: z.ZodString;
134
140
  headline: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
135
141
  about: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
136
142
  avatarUrl: z.ZodOptional<z.ZodURL>;
@@ -146,6 +152,8 @@ export declare const founderProfileSchema: z.ZodObject<{
146
152
  }, z.core.$strip>>;
147
153
  placeholder: z.ZodOptional<z.ZodString>;
148
154
  }, z.core.$strip>>;
155
+ useProviderPhoto: z.ZodBoolean;
156
+ hasProviderPhoto: z.ZodBoolean;
149
157
  location: z.ZodOptional<z.ZodObject<{
150
158
  city: z.ZodString;
151
159
  state: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
@@ -292,8 +300,6 @@ export declare const founderProfileSchema: z.ZodObject<{
292
300
  score: z.ZodNumber;
293
301
  helpedCount: z.ZodNumber;
294
302
  }, z.core.$strip>;
295
- isOnboarded: z.ZodDefault<z.ZodBoolean>;
296
- isActive: z.ZodDefault<z.ZodBoolean>;
297
303
  createdAt: z.ZodISODateTime;
298
304
  updatedAt: z.ZodISODateTime;
299
305
  }, z.core.$strip>;
@@ -312,9 +318,9 @@ export declare const founderCardSchema: z.ZodObject<{
312
318
  state: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
313
319
  country: z.ZodString;
314
320
  }, z.core.$strip>>;
315
- displayName: z.ZodString;
316
- username: z.ZodString;
317
321
  userId: z.ZodString;
322
+ username: z.ZodString;
323
+ displayName: z.ZodString;
318
324
  avatarUrl: z.ZodOptional<z.ZodURL>;
319
325
  headline: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
320
326
  contribution: z.ZodObject<{
@@ -401,7 +407,7 @@ export declare const founderCardSchema: z.ZodObject<{
401
407
  }, z.core.$strip>;
402
408
  export type FounderCard = z.infer<typeof founderCardSchema>;
403
409
  /** The fields a Discover card shows. */
404
- export declare const FOUNDER_CARD_FIELDS: ("id" | "location" | "displayName" | "username" | "userId" | "avatarUrl" | "headline" | "contribution" | "venture" | "skills" | "goals")[];
410
+ export declare const FOUNDER_CARD_FIELDS: ("id" | "location" | "userId" | "username" | "displayName" | "avatarUrl" | "headline" | "contribution" | "venture" | "skills" | "goals")[];
405
411
  export type FounderCardField = (typeof FOUNDER_CARD_FIELDS)[number];
406
412
  /**
407
413
  * The card fields a member's own edit can change, the ones that move them up
@@ -409,7 +415,7 @@ export type FounderCardField = (typeof FOUNDER_CARD_FIELDS)[number];
409
415
  * (`contribution`), which other people's acts move all day and which would
410
416
  * otherwise reorder Discover with every helpful mark.
411
417
  */
412
- export declare const FOUNDER_CARD_EDIT_FIELDS: ("location" | "displayName" | "username" | "avatarUrl" | "headline" | "venture" | "skills" | "goals")[];
418
+ export declare const FOUNDER_CARD_EDIT_FIELDS: ("location" | "username" | "displayName" | "avatarUrl" | "headline" | "venture" | "skills" | "goals")[];
413
419
  /**
414
420
  * Whether a write changed what a member's Discover card shows (0.18.0): ONE
415
421
  * rule for every profile writer, which decides whether the member moves up
@@ -487,11 +493,11 @@ export declare const memberProfileSchema: z.ZodObject<{
487
493
  country: z.ZodString;
488
494
  }, z.core.$strip>>;
489
495
  about: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
490
- displayName: z.ZodString;
491
- createdAt: z.ZodISODateTime;
492
- username: z.ZodString;
493
496
  userId: z.ZodString;
497
+ username: z.ZodString;
498
+ displayName: z.ZodString;
494
499
  avatarUrl: z.ZodOptional<z.ZodURL>;
500
+ createdAt: z.ZodISODateTime;
495
501
  headline: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
496
502
  contribution: z.ZodObject<{
497
503
  score: z.ZodNumber;
@@ -719,6 +725,8 @@ export type UsernameAvailability = z.infer<typeof usernameAvailabilitySchema>;
719
725
  */
720
726
  export declare const myPersonalDetailsSchema: z.ZodObject<{
721
727
  displayName: z.ZodString;
728
+ firstName: z.ZodString;
729
+ lastName: z.ZodString;
722
730
  email: z.ZodOptional<z.ZodString>;
723
731
  phone: z.ZodOptional<z.ZodString>;
724
732
  gender: z.ZodOptional<z.ZodEnum<{
@@ -754,7 +762,7 @@ export type MyPersonalDetails = z.infer<typeof myPersonalDetailsSchema>;
754
762
  * Founder Circle's copy and never calls the sign-in service.
755
763
  */
756
764
  export declare const updateMyPersonalDetailsBodySchema: z.ZodObject<{
757
- displayName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
765
+ fullName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
758
766
  phone: z.ZodOptional<z.ZodString>;
759
767
  gender: z.ZodOptional<z.ZodEnum<{
760
768
  other: "other";
@@ -787,4 +795,13 @@ export declare const setAvatarBodySchema: z.ZodObject<{
787
795
  mediaId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
788
796
  }, z.core.$strip>;
789
797
  export type SetAvatarBody = z.infer<typeof setAvatarBodySchema>;
798
+ /**
799
+ * `PATCH /api/v1/profiles/me/photo-settings` (0.20.0): show or hide the
800
+ * sign-in provider's picture (Google's). Off, a member with no upload appears
801
+ * with their initials everywhere. Answers with the updated `founderProfileSchema`.
802
+ */
803
+ export declare const updatePhotoSettingsBodySchema: z.ZodObject<{
804
+ useProviderPhoto: z.ZodBoolean;
805
+ }, z.core.$strict>;
806
+ export type UpdatePhotoSettingsBody = z.infer<typeof updatePhotoSettingsBodySchema>;
790
807
  //# sourceMappingURL=founder-profile.d.ts.map
@@ -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;AAoCxB;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BxB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,YAAY,wFAAgC,CAAC;AAC1D,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AACvD,eAAO,MAAM,qBAAqB,EAAE,SAAS,UAAU,EAEtD,CAAC;AAIF;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB;;;;;;iBAS7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB;;;iBAGpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAI5E;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;;;;;;iBAM7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,2DAAqC,CAAC;AACpE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CA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B;;iBAAwC,CAAC;AACzE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;kBAAuD,CAAC;AAClG,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
@@ -7,11 +7,12 @@
7
7
  * @module founder-schema/domains/profile
8
8
  */
9
9
  import { z } from 'zod';
10
- import { chosenUsernameSchema, displayNameSchema, GOAL_VALUES, genderSchema, goalSchema, httpUrlSchema, industrySchema, locationSchema, objectIdSchema, optionalTrimmedString, phoneSchema, requiredGoalListSchema, skillListSchema, skillSchema, startupStageSchema, usernameSchema, } from '../../core/common.js';
10
+ import { chosenUsernameSchema, fullNameSchema, GOAL_VALUES, genderSchema, goalSchema, httpUrlSchema, industrySchema, locationSchema, objectIdSchema, optionalTrimmedString, phoneSchema, requiredGoalListSchema, skillListSchema, skillSchema, startupStageSchema, usernameSchema, } from '../../core/common.js';
11
11
  import { ABOUT_MAX, DISPLAY_NAME_MAX, FOUNDED_YEAR_MIN, HEADLINE_MAX, SKILLS_MAX, TEAM_SIZE_MAX, TEAM_SIZE_MIN, VENTURE_NAME_MAX, VENTURE_TAGLINE_MAX, } from '../../core/limits.js';
12
12
  import { VALIDATION_MESSAGE } from '../../core/validation.js';
13
13
  import { locationPickSchema, placeSchema } from '../location/areas.js';
14
14
  import { mediaImageSchema } from '../media/media.js';
15
+ import { personSchema } from '../people/person.js';
15
16
  // ─── Venture ─────────────────────────────────────────────────────────────────
16
17
  /**
17
18
  * ⚠ NUMBERS ARE NUMBERS, never coerced. This is a BODY, which arrives as JSON
@@ -57,22 +58,18 @@ export const VENTURE_OPTIONAL_KEYS = VENTURE_KEYS.filter((key) => ventureSchema.
57
58
  // ─── A member as other surfaces name them ────────────────────────────────────
58
59
  /**
59
60
  * A member as a byline renders them: on a post (`feedAuthorSchema` is this), a
60
- * product's team, a review, a notification, the top-helpers list.
61
+ * product's team, a review, a notification, the top-helpers list. Since
62
+ * 0.20.0 it is `personSchema` (one shape for every person, its doc says why)
63
+ * with the member's one-line headline.
61
64
  *
62
- * Every field is LIVE, joined against the profile at read time rather than
63
- * frozen onto the post or review at write time. So a renamed handle, a new
64
- * photo or an edited headline updates everywhere, the link always targets the
65
- * current username, and nothing personal survives in other people's rows once
66
- * an account is deleted.
65
+ * Every field is LIVE, joined at read time rather than frozen onto the post or
66
+ * review at write time. So a new name, handle, photo or headline shows
67
+ * everywhere, the link always targets the current username, and nothing
68
+ * personal survives in other people's rows once an account is deleted: the
69
+ * byline of a deleted account is `former: true` with no name or picture.
67
70
  */
68
- export const memberBylineSchema = z.object({
69
- userId: z.string(),
70
- username: usernameSchema,
71
- displayName: z.string(),
72
- /** Server-generated or from the login provider, never member-typed, so a
73
- * plain URL check. Same reasoning as `avatarUrl` on the profile. */
74
- avatarUrl: z.url().optional(),
75
- /** The member's one-line headline, live-joined. */
71
+ export const memberBylineSchema = personSchema.extend({
72
+ /** The member's one-line headline, live-joined. Absent for a former member. */
76
73
  headline: z.string().optional(),
77
74
  });
78
75
  /**
@@ -122,7 +119,15 @@ export const founderProfileSchema = z.object({
122
119
  id: z.string(),
123
120
  userId: z.string(),
124
121
  username: usernameSchema,
122
+ /**
123
+ * First and last name joined (0.20.0): DERIVED by the server from
124
+ * `firstName` and `lastName`, never written as a value of its own.
125
+ */
125
126
  displayName: z.string().trim().min(1).max(DISPLAY_NAME_MAX),
127
+ /** The first word of the member's full name (0.20.0). */
128
+ firstName: z.string(),
129
+ /** Everything after the first space; `''` for a one-word name (0.20.0). */
130
+ lastName: z.string(),
126
131
  headline: optionalTrimmedString(HEADLINE_MAX),
127
132
  about: optionalTrimmedString(ABOUT_MAX),
128
133
  /**
@@ -154,6 +159,13 @@ export const founderProfileSchema = z.object({
154
159
  * a card needs one small picture, not the set.
155
160
  */
156
161
  avatar: mediaImageSchema.optional(),
162
+ /**
163
+ * The member's choice about their sign-in provider's picture (0.20.0): when
164
+ * false it is never shown, so with no upload they appear with their
165
+ * initials. `hasProviderPhoto` says whether there is one to offer at all.
166
+ */
167
+ useProviderPhoto: z.boolean(),
168
+ hasProviderPhoto: z.boolean(),
157
169
  location: locationSchema.optional(),
158
170
  /**
159
171
  * The member's own location as picked (0.19.0): state, district and
@@ -172,10 +184,6 @@ export const founderProfileSchema = z.object({
172
184
  * forgot the field pass as a real zero.
173
185
  */
174
186
  contribution: contributionSummarySchema,
175
- /** Onboarding is finished and the member is visible in Discover. */
176
- isOnboarded: z.boolean().default(false),
177
- /** Member paused their own profile. Hidden from Discover, keeps their data. */
178
- isActive: z.boolean().default(true),
179
187
  createdAt: z.iso.datetime(),
180
188
  updatedAt: z.iso.datetime(),
181
189
  });
@@ -392,8 +400,11 @@ export const usernameAvailabilitySchema = z.object({
392
400
  * body holds the rules.
393
401
  */
394
402
  export const myPersonalDetailsSchema = z.object({
395
- /** The profile's display name: the card's first row. */
403
+ /** First and last name joined, derived (0.20.0): the card's first row. */
396
404
  displayName: z.string(),
405
+ /** As stored (0.20.0): what Me's "Full name" box is filled from, joined. */
406
+ firstName: z.string(),
407
+ lastName: z.string(),
397
408
  /** The sign-in account's. Changed there (Account settings), never here. */
398
409
  email: z.string().optional(),
399
410
  /** Ten digits as stored on the account mirror; display adds the `+91`. */
@@ -426,7 +437,12 @@ export const myPersonalDetailsSchema = z.object({
426
437
  * Founder Circle's copy and never calls the sign-in service.
427
438
  */
428
439
  export const updateMyPersonalDetailsBodySchema = z.object({
429
- displayName: displayNameSchema.optional(),
440
+ /**
441
+ * The full name as typed (0.20.0; `displayName` until 0.19.0): the server
442
+ * splits it at the first space into first and last name and derives the
443
+ * display name from them (`splitFullName`, `joinFullName`).
444
+ */
445
+ fullName: fullNameSchema.optional(),
430
446
  phone: phoneSchema.optional(),
431
447
  gender: genderSchema.optional(),
432
448
  /**
@@ -450,4 +466,10 @@ export const updateMyPersonalDetailsBodySchema = z.object({
450
466
  * the same way and the member falls back to their sign-in provider's picture.
451
467
  */
452
468
  export const setAvatarBodySchema = z.object({ mediaId: objectIdSchema });
469
+ /**
470
+ * `PATCH /api/v1/profiles/me/photo-settings` (0.20.0): show or hide the
471
+ * sign-in provider's picture (Google's). Off, a member with no upload appears
472
+ * with their initials everywhere. Answers with the updated `founderProfileSchema`.
473
+ */
474
+ export const updatePhotoSettingsBodySchema = z.object({ useProviderPhoto: z.boolean() }).strict();
453
475
  //# sourceMappingURL=founder-profile.js.map
@@ -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,sBAAsB,EACtB,eAAe,EACf,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,kBAAkB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvE,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,C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AAC;AAGH,+EAA+E;AAE/E;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,wDAAwD;IACxD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,2EAA2E;IAC3E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,0EAA0E;IAC1E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B;;;;OAIG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,0FAA0F;IAC1F,UAAU,EAAE,uBAAuB;CACpC,CAAC,CAAC;AAGH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,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;;;;;;OAMG;IACH,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAClD,+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 requiredGoalListSchema,\n skillListSchema,\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 { locationPickSchema, placeSchema } from '../location/areas.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/**\n * A venture's fields, in order, and which of them may be left out (0.17.0):\n * what the backend lists when it saves or compares a venture, read from here.\n */\nexport const VENTURE_KEYS = ventureSchema.keyof().options;\nexport type VentureKey = (typeof VENTURE_KEYS)[number];\nexport const VENTURE_OPTIONAL_KEYS: readonly VentureKey[] = VENTURE_KEYS.filter(\n (key) => ventureSchema.shape[key].safeParse(undefined).success,\n);\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's links, by key, in order (0.17.0): what the backend's model and\n * its projections list. Read from here, never written out again: a copy of\n * this list is how the profile model once lost Instagram.\n */\nexport const FOUNDER_LINK_KEYS = founderLinksSchema.keyof().options;\nexport type FounderLinkKey = (typeof FOUNDER_LINK_KEYS)[number];\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 /**\n * The member's own location as picked (0.19.0): state, district and\n * locality with their area ids, for Me's location field and the drawer.\n * OWNER-ONLY: no card or member page carries it (they pick `location`).\n * Absent for a location stored as text before 0.19.0.\n */\n place: placeSchema.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/** The fields a Discover card shows. */\nexport const FOUNDER_CARD_FIELDS = founderCardSchema.keyof().options;\nexport type FounderCardField = (typeof FOUNDER_CARD_FIELDS)[number];\n\n/**\n * The card fields a member's own edit can change, the ones that move them up\n * Discover: every card field but the ids, which never change, and the points\n * (`contribution`), which other people's acts move all day and which would\n * otherwise reorder Discover with every helpful mark.\n */\nexport const FOUNDER_CARD_EDIT_FIELDS = FOUNDER_CARD_FIELDS.filter(\n (field) => field !== 'id' && field !== 'userId' && field !== 'contribution',\n);\n\n/**\n * Whether a write changed what a member's Discover card shows (0.18.0): ONE\n * rule for every profile writer, which decides whether the member moves up\n * Discover (its \"recently updated\" order) and whether a client reloads it.\n * `changed` names the fields the write actually changed: a body's keys, or\n * for the business editor `venture` only when its PUBLIC part changed. Before\n * 0.18.0 five writers decided it four ways: an edit to the About text alone\n * lifted a member to the top of everyone's Discover, a new username never did.\n * Points never count (`FOUNDER_CARD_EDIT_FIELDS`): they are not the member's\n * edit.\n */\nexport function changesDiscoverCard(changed: readonly string[]): boolean {\n return changed.some((field) => (FOUNDER_CARD_EDIT_FIELDS as readonly string[]).includes(field));\n}\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/**\n * WHO sees each of the four once its owner turns it on (0.18.0). The user,\n * 2026-10-20: \"any person who has the platform membership can view them if\n * they are public\", so all four go to members only (and to the member\n * themself), never to an account without membership. One table: the server\n * builds `shown` from it, and every screen words its switch from it.\n */\nexport const PROFILE_AUDIENCE_VALUES = ['members'] as const;\nexport type ProfileAudience = (typeof PROFILE_AUDIENCE_VALUES)[number];\nexport const CONTACT_VISIBILITY_AUDIENCE = {\n email: 'members',\n phone: 'members',\n gender: 'members',\n birthday: 'members',\n} as const satisfies Record<ContactVisibilityField, ProfileAudience>;\n\n/** Which of the four the member shows. Every key present on a read: false is private. */\nexport const contactVisibilitySchema = z.object(\n Object.fromEntries(CONTACT_VISIBILITY_FIELDS.map((field) => [field, z.boolean()])) as Record<\n ContactVisibilityField,\n z.ZodBoolean\n >,\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, to the audience `CONTACT_VISIBILITY_AUDIENCE` names\n * (members only, all four, 0.18.0); the server decides, and a client renders\n * 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 *\n * ONE WRITER PER FIELD (0.18.0): the name and the city are the personal\n * details' (`PATCH /profiles/me/personal`), the venture is the business\n * editor's (`PUT /profiles/me/business`), the handle has its own route. They\n * were taken here too, a second path with its own rules for Discover's order.\n * STRICT: any other key is refused (a 400 naming it), never dropped without a\n * word, so a client still sending a name here learns it at once instead of\n * losing the member's edit.\n */\nexport const updateFounderProfileBodySchema = z\n .object({\n headline: clearableText(HEADLINE_MAX),\n about: clearableText(ABOUT_MAX),\n /** The same list rules as onboarding's finish (each value once, 0.17.0). */\n skills: skillListSchema.optional(),\n /**\n * The same rules as onboarding's finish, its minimum included (0.18.0, the\n * user: \"we already have at least one goal required\"): Me cannot save a\n * member down to no goals.\n */\n goals: requiredGoalListSchema.optional(),\n /** Sent whole. To drop one link, send the object without that key. */\n links: founderLinksSchema.optional(),\n })\n .strict();\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/** Why a username is not available. */\nexport const USERNAME_UNAVAILABLE_REASON_VALUES = ['taken', 'reserved'] as const;\nexport type UsernameUnavailableReason = (typeof USERNAME_UNAVAILABLE_REASON_VALUES)[number];\n\nexport const usernameAvailabilitySchema = z.object({\n username: usernameSchema,\n available: z.boolean(),\n /** Present when unavailable. */\n reason: z.enum(USERNAME_UNAVAILABLE_REASON_VALUES).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 location, 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; only here since 0.18.0 (`PATCH /profiles/me` took it too).\n * Area ids from the drawer or GPS (0.19.0, `locationPickSchema`): the server\n * names the place and its public city from `master_db`.\n */\n location: locationPickSchema.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,cAAc,EACd,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,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,kBAAkB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,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,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;IACjC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Q,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,2EAA2E;IAC3E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,0EAA0E;IAC1E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B;;;;OAIG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,0FAA0F;IAC1F,UAAU,EAAE,uBAAuB;CACpC,CAAC,CAAC;AAGH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD;;;;OAIG;IACH,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B;;;;;;OAMG;IACH,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAClD,+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;AAGzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,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 fullNameSchema,\n GOAL_VALUES,\n genderSchema,\n goalSchema,\n httpUrlSchema,\n industrySchema,\n locationSchema,\n objectIdSchema,\n optionalTrimmedString,\n phoneSchema,\n requiredGoalListSchema,\n skillListSchema,\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 { locationPickSchema, placeSchema } from '../location/areas.js';\nimport { mediaImageSchema } from '../media/media.js';\nimport { personSchema } from '../people/person.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/**\n * A venture's fields, in order, and which of them may be left out (0.17.0):\n * what the backend lists when it saves or compares a venture, read from here.\n */\nexport const VENTURE_KEYS = ventureSchema.keyof().options;\nexport type VentureKey = (typeof VENTURE_KEYS)[number];\nexport const VENTURE_OPTIONAL_KEYS: readonly VentureKey[] = VENTURE_KEYS.filter(\n (key) => ventureSchema.shape[key].safeParse(undefined).success,\n);\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. Since\n * 0.20.0 it is `personSchema` (one shape for every person, its doc says why)\n * with the member's one-line headline.\n *\n * Every field is LIVE, joined at read time rather than frozen onto the post or\n * review at write time. So a new name, handle, photo or headline shows\n * everywhere, the link always targets the current username, and nothing\n * personal survives in other people's rows once an account is deleted: the\n * byline of a deleted account is `former: true` with no name or picture.\n */\nexport const memberBylineSchema = personSchema.extend({\n /** The member's one-line headline, live-joined. Absent for a former member. */\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's links, by key, in order (0.17.0): what the backend's model and\n * its projections list. Read from here, never written out again: a copy of\n * this list is how the profile model once lost Instagram.\n */\nexport const FOUNDER_LINK_KEYS = founderLinksSchema.keyof().options;\nexport type FounderLinkKey = (typeof FOUNDER_LINK_KEYS)[number];\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 /**\n * First and last name joined (0.20.0): DERIVED by the server from\n * `firstName` and `lastName`, never written as a value of its own.\n */\n displayName: z.string().trim().min(1).max(DISPLAY_NAME_MAX),\n /** The first word of the member's full name (0.20.0). */\n firstName: z.string(),\n /** Everything after the first space; `''` for a one-word name (0.20.0). */\n lastName: z.string(),\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 /**\n * The member's choice about their sign-in provider's picture (0.20.0): when\n * false it is never shown, so with no upload they appear with their\n * initials. `hasProviderPhoto` says whether there is one to offer at all.\n */\n useProviderPhoto: z.boolean(),\n hasProviderPhoto: z.boolean(),\n location: locationSchema.optional(),\n /**\n * The member's own location as picked (0.19.0): state, district and\n * locality with their area ids, for Me's location field and the drawer.\n * OWNER-ONLY: no card or member page carries it (they pick `location`).\n * Absent for a location stored as text before 0.19.0.\n */\n place: placeSchema.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 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/** The fields a Discover card shows. */\nexport const FOUNDER_CARD_FIELDS = founderCardSchema.keyof().options;\nexport type FounderCardField = (typeof FOUNDER_CARD_FIELDS)[number];\n\n/**\n * The card fields a member's own edit can change, the ones that move them up\n * Discover: every card field but the ids, which never change, and the points\n * (`contribution`), which other people's acts move all day and which would\n * otherwise reorder Discover with every helpful mark.\n */\nexport const FOUNDER_CARD_EDIT_FIELDS = FOUNDER_CARD_FIELDS.filter(\n (field) => field !== 'id' && field !== 'userId' && field !== 'contribution',\n);\n\n/**\n * Whether a write changed what a member's Discover card shows (0.18.0): ONE\n * rule for every profile writer, which decides whether the member moves up\n * Discover (its \"recently updated\" order) and whether a client reloads it.\n * `changed` names the fields the write actually changed: a body's keys, or\n * for the business editor `venture` only when its PUBLIC part changed. Before\n * 0.18.0 five writers decided it four ways: an edit to the About text alone\n * lifted a member to the top of everyone's Discover, a new username never did.\n * Points never count (`FOUNDER_CARD_EDIT_FIELDS`): they are not the member's\n * edit.\n */\nexport function changesDiscoverCard(changed: readonly string[]): boolean {\n return changed.some((field) => (FOUNDER_CARD_EDIT_FIELDS as readonly string[]).includes(field));\n}\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/**\n * WHO sees each of the four once its owner turns it on (0.18.0). The user,\n * 2026-10-20: \"any person who has the platform membership can view them if\n * they are public\", so all four go to members only (and to the member\n * themself), never to an account without membership. One table: the server\n * builds `shown` from it, and every screen words its switch from it.\n */\nexport const PROFILE_AUDIENCE_VALUES = ['members'] as const;\nexport type ProfileAudience = (typeof PROFILE_AUDIENCE_VALUES)[number];\nexport const CONTACT_VISIBILITY_AUDIENCE = {\n email: 'members',\n phone: 'members',\n gender: 'members',\n birthday: 'members',\n} as const satisfies Record<ContactVisibilityField, ProfileAudience>;\n\n/** Which of the four the member shows. Every key present on a read: false is private. */\nexport const contactVisibilitySchema = z.object(\n Object.fromEntries(CONTACT_VISIBILITY_FIELDS.map((field) => [field, z.boolean()])) as Record<\n ContactVisibilityField,\n z.ZodBoolean\n >,\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, to the audience `CONTACT_VISIBILITY_AUDIENCE` names\n * (members only, all four, 0.18.0); the server decides, and a client renders\n * 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 *\n * ONE WRITER PER FIELD (0.18.0): the name and the city are the personal\n * details' (`PATCH /profiles/me/personal`), the venture is the business\n * editor's (`PUT /profiles/me/business`), the handle has its own route. They\n * were taken here too, a second path with its own rules for Discover's order.\n * STRICT: any other key is refused (a 400 naming it), never dropped without a\n * word, so a client still sending a name here learns it at once instead of\n * losing the member's edit.\n */\nexport const updateFounderProfileBodySchema = z\n .object({\n headline: clearableText(HEADLINE_MAX),\n about: clearableText(ABOUT_MAX),\n /** The same list rules as onboarding's finish (each value once, 0.17.0). */\n skills: skillListSchema.optional(),\n /**\n * The same rules as onboarding's finish, its minimum included (0.18.0, the\n * user: \"we already have at least one goal required\"): Me cannot save a\n * member down to no goals.\n */\n goals: requiredGoalListSchema.optional(),\n /** Sent whole. To drop one link, send the object without that key. */\n links: founderLinksSchema.optional(),\n })\n .strict();\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/** Why a username is not available. */\nexport const USERNAME_UNAVAILABLE_REASON_VALUES = ['taken', 'reserved'] as const;\nexport type UsernameUnavailableReason = (typeof USERNAME_UNAVAILABLE_REASON_VALUES)[number];\n\nexport const usernameAvailabilitySchema = z.object({\n username: usernameSchema,\n available: z.boolean(),\n /** Present when unavailable. */\n reason: z.enum(USERNAME_UNAVAILABLE_REASON_VALUES).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 /** First and last name joined, derived (0.20.0): the card's first row. */\n displayName: z.string(),\n /** As stored (0.20.0): what Me's \"Full name\" box is filled from, joined. */\n firstName: z.string(),\n lastName: 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 /**\n * The full name as typed (0.20.0; `displayName` until 0.19.0): the server\n * splits it at the first space into first and last name and derives the\n * display name from them (`splitFullName`, `joinFullName`).\n */\n fullName: fullNameSchema.optional(),\n phone: phoneSchema.optional(),\n gender: genderSchema.optional(),\n /**\n * The location, 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; only here since 0.18.0 (`PATCH /profiles/me` took it too).\n * Area ids from the drawer or GPS (0.19.0, `locationPickSchema`): the server\n * names the place and its public city from `master_db`.\n */\n location: locationPickSchema.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\n/**\n * `PATCH /api/v1/profiles/me/photo-settings` (0.20.0): show or hide the\n * sign-in provider's picture (Google's). Off, a member with no upload appears\n * with their initials everywhere. Answers with the updated `founderProfileSchema`.\n */\nexport const updatePhotoSettingsBodySchema = z.object({ useProviderPhoto: z.boolean() }).strict();\nexport type UpdatePhotoSettingsBody = z.infer<typeof updatePhotoSettingsBodySchema>;\n"]}
@@ -42,10 +42,12 @@ export type ReviewSort = z.infer<typeof reviewSortSchema>;
42
42
  export declare const reviewReplySchema: z.ZodObject<{
43
43
  text: z.ZodString;
44
44
  author: z.ZodNullable<z.ZodObject<{
45
- userId: z.ZodString;
46
- username: z.ZodString;
45
+ userId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
46
+ username: z.ZodNullable<z.ZodString>;
47
47
  displayName: z.ZodString;
48
- avatarUrl: z.ZodOptional<z.ZodURL>;
48
+ firstName: z.ZodString;
49
+ avatarUrl: z.ZodNullable<z.ZodURL>;
50
+ former: z.ZodBoolean;
49
51
  headline: z.ZodOptional<z.ZodString>;
50
52
  }, z.core.$strip>>;
51
53
  createdAt: z.ZodISODateTime;
@@ -68,10 +70,12 @@ export declare const productReviewSchema: z.ZodObject<{
68
70
  id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
69
71
  productId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
70
72
  author: z.ZodObject<{
71
- userId: z.ZodString;
72
- username: z.ZodString;
73
+ userId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
74
+ username: z.ZodNullable<z.ZodString>;
73
75
  displayName: z.ZodString;
74
- avatarUrl: z.ZodOptional<z.ZodURL>;
76
+ firstName: z.ZodString;
77
+ avatarUrl: z.ZodNullable<z.ZodURL>;
78
+ former: z.ZodBoolean;
75
79
  headline: z.ZodOptional<z.ZodString>;
76
80
  }, z.core.$strip>;
77
81
  rating: z.ZodNumber;
@@ -81,10 +85,12 @@ export declare const productReviewSchema: z.ZodObject<{
81
85
  reply: z.ZodNullable<z.ZodObject<{
82
86
  text: z.ZodString;
83
87
  author: z.ZodNullable<z.ZodObject<{
84
- userId: z.ZodString;
85
- username: z.ZodString;
88
+ userId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
89
+ username: z.ZodNullable<z.ZodString>;
86
90
  displayName: z.ZodString;
87
- avatarUrl: z.ZodOptional<z.ZodURL>;
91
+ firstName: z.ZodString;
92
+ avatarUrl: z.ZodNullable<z.ZodURL>;
93
+ former: z.ZodBoolean;
88
94
  headline: z.ZodOptional<z.ZodString>;
89
95
  }, z.core.$strip>>;
90
96
  createdAt: z.ZodISODateTime;
@@ -109,10 +115,12 @@ export declare const reviewPageSchema: z.ZodObject<{
109
115
  id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
110
116
  productId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
111
117
  author: z.ZodObject<{
112
- userId: z.ZodString;
113
- username: z.ZodString;
118
+ userId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
119
+ username: z.ZodNullable<z.ZodString>;
114
120
  displayName: z.ZodString;
115
- avatarUrl: z.ZodOptional<z.ZodURL>;
121
+ firstName: z.ZodString;
122
+ avatarUrl: z.ZodNullable<z.ZodURL>;
123
+ former: z.ZodBoolean;
116
124
  headline: z.ZodOptional<z.ZodString>;
117
125
  }, z.core.$strip>;
118
126
  rating: z.ZodNumber;
@@ -122,10 +130,12 @@ export declare const reviewPageSchema: z.ZodObject<{
122
130
  reply: z.ZodNullable<z.ZodObject<{
123
131
  text: z.ZodString;
124
132
  author: z.ZodNullable<z.ZodObject<{
125
- userId: z.ZodString;
126
- username: z.ZodString;
133
+ userId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
134
+ username: z.ZodNullable<z.ZodString>;
127
135
  displayName: z.ZodString;
128
- avatarUrl: z.ZodOptional<z.ZodURL>;
136
+ firstName: z.ZodString;
137
+ avatarUrl: z.ZodNullable<z.ZodURL>;
138
+ former: z.ZodBoolean;
129
139
  headline: z.ZodOptional<z.ZodString>;
130
140
  }, z.core.$strip>>;
131
141
  createdAt: z.ZodISODateTime;
@@ -1 +1 @@
1
- {"version":3,"file":"reviews.d.ts","sourceRoot":"","sources":["../../../src/domains/reviews/reviews.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,mBAAmB;AACnB,eAAO,MAAM,kBAAkB,aAAmD,CAAC;AACnF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,6BAA8B,CAAC;AAC9D,eAAO,MAAM,gBAAgB;;;EAA6B,CAAC;AAC3D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,4CAA4C;AAC5C,eAAO,MAAM,iBAAiB;;;;;;;;;;;iBAM5B,CAAC;AACH,MAAM,MAAM,WAAW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