founder-schema 0.17.0 → 0.19.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 (120) hide show
  1. package/README.md +186 -17
  2. package/dist/access/access.d.ts +1 -1
  3. package/dist/access/access.d.ts.map +1 -1
  4. package/dist/access/access.js +4 -1
  5. package/dist/access/access.js.map +1 -1
  6. package/dist/access/permissions.d.ts +27 -29
  7. package/dist/access/permissions.d.ts.map +1 -1
  8. package/dist/access/permissions.js +39 -3
  9. package/dist/access/permissions.js.map +1 -1
  10. package/dist/core/common.d.ts +54 -23
  11. package/dist/core/common.d.ts.map +1 -1
  12. package/dist/core/common.js +49 -24
  13. package/dist/core/common.js.map +1 -1
  14. package/dist/core/errors.d.ts +7 -5
  15. package/dist/core/errors.d.ts.map +1 -1
  16. package/dist/core/errors.js +17 -11
  17. package/dist/core/errors.js.map +1 -1
  18. package/dist/core/limits.d.ts +73 -17
  19. package/dist/core/limits.d.ts.map +1 -1
  20. package/dist/core/limits.js +77 -22
  21. package/dist/core/limits.js.map +1 -1
  22. package/dist/core/money.d.ts +33 -0
  23. package/dist/core/money.d.ts.map +1 -0
  24. package/dist/core/money.js +36 -0
  25. package/dist/core/money.js.map +1 -0
  26. package/dist/core/responses.d.ts +14 -4
  27. package/dist/core/responses.d.ts.map +1 -1
  28. package/dist/core/responses.js.map +1 -1
  29. package/dist/core/validation.d.ts +19 -2
  30. package/dist/core/validation.d.ts.map +1 -1
  31. package/dist/core/validation.js +19 -2
  32. package/dist/core/validation.js.map +1 -1
  33. package/dist/domains/billing/billing.d.ts +61 -8
  34. package/dist/domains/billing/billing.d.ts.map +1 -1
  35. package/dist/domains/billing/billing.js +58 -22
  36. package/dist/domains/billing/billing.js.map +1 -1
  37. package/dist/domains/billing/gst.d.ts.map +1 -1
  38. package/dist/domains/billing/gst.js +4 -3
  39. package/dist/domains/billing/gst.js.map +1 -1
  40. package/dist/domains/chat/chat.d.ts +0 -21
  41. package/dist/domains/chat/chat.d.ts.map +1 -1
  42. package/dist/domains/chat/chat.js +0 -20
  43. package/dist/domains/chat/chat.js.map +1 -1
  44. package/dist/domains/communities/communities.d.ts +30 -12
  45. package/dist/domains/communities/communities.d.ts.map +1 -1
  46. package/dist/domains/communities/communities.js +43 -15
  47. package/dist/domains/communities/communities.js.map +1 -1
  48. package/dist/domains/contributions/contributions.d.ts +1 -1
  49. package/dist/domains/contributions/contributions.js +1 -1
  50. package/dist/domains/contributions/contributions.js.map +1 -1
  51. package/dist/domains/dashboard/dashboard.d.ts +3 -1
  52. package/dist/domains/dashboard/dashboard.d.ts.map +1 -1
  53. package/dist/domains/dashboard/dashboard.js +23 -7
  54. package/dist/domains/dashboard/dashboard.js.map +1 -1
  55. package/dist/domains/discover/discover.d.ts +8 -8
  56. package/dist/domains/feed/feed.d.ts +55 -153
  57. package/dist/domains/feed/feed.d.ts.map +1 -1
  58. package/dist/domains/feed/feed.js +53 -58
  59. package/dist/domains/feed/feed.js.map +1 -1
  60. package/dist/domains/location/areas.d.ts +331 -0
  61. package/dist/domains/location/areas.d.ts.map +1 -0
  62. package/dist/domains/location/areas.js +238 -0
  63. package/dist/domains/location/areas.js.map +1 -0
  64. package/dist/domains/location/india.d.ts +41 -123
  65. package/dist/domains/location/india.d.ts.map +1 -1
  66. package/dist/domains/location/india.js +121 -59
  67. package/dist/domains/location/india.js.map +1 -1
  68. package/dist/domains/members/members.d.ts +2 -2
  69. package/dist/domains/membership/membership.d.ts +26 -0
  70. package/dist/domains/membership/membership.d.ts.map +1 -1
  71. package/dist/domains/membership/membership.js +55 -1
  72. package/dist/domains/membership/membership.js.map +1 -1
  73. package/dist/domains/moderation/moderation.d.ts +2 -2
  74. package/dist/domains/moderation/moderation.js +3 -3
  75. package/dist/domains/moderation/moderation.js.map +1 -1
  76. package/dist/domains/notifications/notifications.d.ts +1 -10
  77. package/dist/domains/notifications/notifications.d.ts.map +1 -1
  78. package/dist/domains/notifications/notifications.js +2 -3
  79. package/dist/domains/notifications/notifications.js.map +1 -1
  80. package/dist/domains/onboarding/onboarding-answers.d.ts +42 -14
  81. package/dist/domains/onboarding/onboarding-answers.d.ts.map +1 -1
  82. package/dist/domains/onboarding/onboarding-answers.js +49 -33
  83. package/dist/domains/onboarding/onboarding-answers.js.map +1 -1
  84. package/dist/domains/onboarding/onboarding.d.ts +332 -138
  85. package/dist/domains/onboarding/onboarding.d.ts.map +1 -1
  86. package/dist/domains/onboarding/onboarding.js +47 -59
  87. package/dist/domains/onboarding/onboarding.js.map +1 -1
  88. package/dist/domains/products/products.d.ts +43 -8
  89. package/dist/domains/products/products.d.ts.map +1 -1
  90. package/dist/domains/products/products.js +57 -11
  91. package/dist/domains/products/products.js.map +1 -1
  92. package/dist/domains/profile/founder-profile.d.ts +123 -143
  93. package/dist/domains/profile/founder-profile.d.ts.map +1 -1
  94. package/dist/domains/profile/founder-profile.js +77 -35
  95. package/dist/domains/profile/founder-profile.js.map +1 -1
  96. package/dist/domains/profile/my-profile.d.ts +3 -3
  97. package/dist/domains/reviews/reviews.d.ts +1 -1
  98. package/dist/domains/reviews/reviews.d.ts.map +1 -1
  99. package/dist/domains/reviews/reviews.js +2 -2
  100. package/dist/domains/reviews/reviews.js.map +1 -1
  101. package/dist/domains/support/support.d.ts +22 -3
  102. package/dist/domains/support/support.d.ts.map +1 -1
  103. package/dist/domains/support/support.js +19 -5
  104. package/dist/domains/support/support.js.map +1 -1
  105. package/dist/domains/team/team.d.ts.map +1 -1
  106. package/dist/domains/team/team.js +3 -6
  107. package/dist/domains/team/team.js.map +1 -1
  108. package/dist/domains/uploads/uploads.d.ts +7 -22
  109. package/dist/domains/uploads/uploads.d.ts.map +1 -1
  110. package/dist/domains/uploads/uploads.js +7 -21
  111. package/dist/domains/uploads/uploads.js.map +1 -1
  112. package/dist/env.d.ts +26 -13
  113. package/dist/env.d.ts.map +1 -1
  114. package/dist/env.js +58 -23
  115. package/dist/env.js.map +1 -1
  116. package/dist/index.d.ts +19 -17
  117. package/dist/index.d.ts.map +1 -1
  118. package/dist/index.js +21 -17
  119. package/dist/index.js.map +1 -1
  120. package/package.json +1 -1
@@ -17,7 +17,7 @@ import { z } from 'zod';
17
17
  */
18
18
  export declare const ventureSchema: z.ZodObject<{
19
19
  name: z.ZodString;
20
- tagline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
20
+ tagline: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
21
21
  website: z.ZodOptional<z.ZodURL>;
22
22
  industry: z.ZodEnum<{
23
23
  agritech: "agritech";
@@ -131,8 +131,8 @@ export declare const founderProfileSchema: z.ZodObject<{
131
131
  userId: z.ZodString;
132
132
  username: z.ZodString;
133
133
  displayName: z.ZodString;
134
- headline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
135
- about: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
134
+ headline: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
135
+ about: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
136
136
  avatarUrl: z.ZodOptional<z.ZodURL>;
137
137
  avatar: z.ZodOptional<z.ZodObject<{
138
138
  id: z.ZodString;
@@ -148,12 +148,65 @@ export declare const founderProfileSchema: z.ZodObject<{
148
148
  }, z.core.$strip>>;
149
149
  location: z.ZodOptional<z.ZodObject<{
150
150
  city: z.ZodString;
151
- state: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
151
+ state: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
152
152
  country: z.ZodString;
153
153
  }, z.core.$strip>>;
154
+ place: z.ZodOptional<z.ZodObject<{
155
+ state: z.ZodObject<{
156
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
157
+ name: z.ZodString;
158
+ type: z.ZodEnum<{
159
+ COUNTRY: "COUNTRY";
160
+ STATE: "STATE";
161
+ DISTRICT: "DISTRICT";
162
+ SUB_DISTRICT: "SUB_DISTRICT";
163
+ BLOCK: "BLOCK";
164
+ GRAM_PANCHAYAT: "GRAM_PANCHAYAT";
165
+ VILLAGE: "VILLAGE";
166
+ URBAN_BODY: "URBAN_BODY";
167
+ URBAN_WARD: "URBAN_WARD";
168
+ }>;
169
+ urbanBodyType: z.ZodOptional<z.ZodString>;
170
+ within: z.ZodOptional<z.ZodString>;
171
+ }, z.core.$strip>;
172
+ district: z.ZodObject<{
173
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
174
+ name: z.ZodString;
175
+ type: z.ZodEnum<{
176
+ COUNTRY: "COUNTRY";
177
+ STATE: "STATE";
178
+ DISTRICT: "DISTRICT";
179
+ SUB_DISTRICT: "SUB_DISTRICT";
180
+ BLOCK: "BLOCK";
181
+ GRAM_PANCHAYAT: "GRAM_PANCHAYAT";
182
+ VILLAGE: "VILLAGE";
183
+ URBAN_BODY: "URBAN_BODY";
184
+ URBAN_WARD: "URBAN_WARD";
185
+ }>;
186
+ urbanBodyType: z.ZodOptional<z.ZodString>;
187
+ within: z.ZodOptional<z.ZodString>;
188
+ }, z.core.$strip>;
189
+ locality: z.ZodNullable<z.ZodObject<{
190
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
191
+ name: z.ZodString;
192
+ type: z.ZodEnum<{
193
+ COUNTRY: "COUNTRY";
194
+ STATE: "STATE";
195
+ DISTRICT: "DISTRICT";
196
+ SUB_DISTRICT: "SUB_DISTRICT";
197
+ BLOCK: "BLOCK";
198
+ GRAM_PANCHAYAT: "GRAM_PANCHAYAT";
199
+ VILLAGE: "VILLAGE";
200
+ URBAN_BODY: "URBAN_BODY";
201
+ URBAN_WARD: "URBAN_WARD";
202
+ }>;
203
+ urbanBodyType: z.ZodOptional<z.ZodString>;
204
+ within: z.ZodOptional<z.ZodString>;
205
+ }, z.core.$strip>>;
206
+ }, z.core.$strip>>;
154
207
  venture: z.ZodOptional<z.ZodObject<{
155
208
  name: z.ZodString;
156
- tagline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
209
+ tagline: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
157
210
  website: z.ZodOptional<z.ZodURL>;
158
211
  industry: z.ZodEnum<{
159
212
  agritech: "agritech";
@@ -256,21 +309,21 @@ export declare const founderCardSchema: z.ZodObject<{
256
309
  id: z.ZodString;
257
310
  location: z.ZodOptional<z.ZodObject<{
258
311
  city: z.ZodString;
259
- state: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
312
+ state: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
260
313
  country: z.ZodString;
261
314
  }, z.core.$strip>>;
262
315
  displayName: z.ZodString;
263
- userId: z.ZodString;
264
316
  username: z.ZodString;
317
+ userId: z.ZodString;
265
318
  avatarUrl: z.ZodOptional<z.ZodURL>;
266
- headline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
319
+ headline: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
267
320
  contribution: z.ZodObject<{
268
321
  score: z.ZodNumber;
269
322
  helpedCount: z.ZodNumber;
270
323
  }, z.core.$strip>;
271
324
  venture: z.ZodOptional<z.ZodObject<{
272
325
  name: z.ZodString;
273
- tagline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
326
+ tagline: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
274
327
  website: z.ZodOptional<z.ZodURL>;
275
328
  industry: z.ZodEnum<{
276
329
  agritech: "agritech";
@@ -347,6 +400,28 @@ export declare const founderCardSchema: z.ZodObject<{
347
400
  }>>>;
348
401
  }, z.core.$strip>;
349
402
  export type FounderCard = z.infer<typeof founderCardSchema>;
403
+ /** The fields a Discover card shows. */
404
+ export declare const FOUNDER_CARD_FIELDS: ("id" | "location" | "displayName" | "username" | "userId" | "avatarUrl" | "headline" | "contribution" | "venture" | "skills" | "goals")[];
405
+ export type FounderCardField = (typeof FOUNDER_CARD_FIELDS)[number];
406
+ /**
407
+ * The card fields a member's own edit can change, the ones that move them up
408
+ * Discover: every card field but the ids, which never change, and the points
409
+ * (`contribution`), which other people's acts move all day and which would
410
+ * otherwise reorder Discover with every helpful mark.
411
+ */
412
+ export declare const FOUNDER_CARD_EDIT_FIELDS: ("location" | "displayName" | "username" | "avatarUrl" | "headline" | "venture" | "skills" | "goals")[];
413
+ /**
414
+ * Whether a write changed what a member's Discover card shows (0.18.0): ONE
415
+ * rule for every profile writer, which decides whether the member moves up
416
+ * Discover (its "recently updated" order) and whether a client reloads it.
417
+ * `changed` names the fields the write actually changed: a body's keys, or
418
+ * for the business editor `venture` only when its PUBLIC part changed. Before
419
+ * 0.18.0 five writers decided it four ways: an edit to the About text alone
420
+ * lifted a member to the top of everyone's Discover, a new username never did.
421
+ * Points never count (`FOUNDER_CARD_EDIT_FIELDS`): they are not the member's
422
+ * edit.
423
+ */
424
+ export declare function changesDiscoverCard(changed: readonly string[]): boolean;
350
425
  /**
351
426
  * The four personal details a member MAY show on their profile page (the
352
427
  * user's ruling, 2026-10-11). Each is PRIVATE until its owner turns it on;
@@ -355,6 +430,21 @@ export type FounderCard = z.infer<typeof founderCardSchema>;
355
430
  */
356
431
  export declare const CONTACT_VISIBILITY_FIELDS: readonly ["email", "phone", "gender", "birthday"];
357
432
  export type ContactVisibilityField = (typeof CONTACT_VISIBILITY_FIELDS)[number];
433
+ /**
434
+ * WHO sees each of the four once its owner turns it on (0.18.0). The user,
435
+ * 2026-10-20: "any person who has the platform membership can view them if
436
+ * they are public", so all four go to members only (and to the member
437
+ * themself), never to an account without membership. One table: the server
438
+ * builds `shown` from it, and every screen words its switch from it.
439
+ */
440
+ export declare const PROFILE_AUDIENCE_VALUES: readonly ["members"];
441
+ export type ProfileAudience = (typeof PROFILE_AUDIENCE_VALUES)[number];
442
+ export declare const CONTACT_VISIBILITY_AUDIENCE: {
443
+ readonly email: "members";
444
+ readonly phone: "members";
445
+ readonly gender: "members";
446
+ readonly birthday: "members";
447
+ };
358
448
  /** Which of the four the member shows. Every key present on a read: false is private. */
359
449
  export declare const contactVisibilitySchema: z.ZodObject<{
360
450
  email: z.ZodBoolean;
@@ -379,9 +469,9 @@ export type PublicBirthday = z.infer<typeof publicBirthdaySchema>;
379
469
  *
380
470
  * The card's fields, what only a page has room for (about, links, member
381
471
  * since), and `shown`: the personal details this member has CHOSEN to show,
382
- * and nothing else. Email and phone go to members only, never to an account
383
- * without membership (the coming viewer tier); the server decides, and a
384
- * client renders what arrives. Built field by field on the server
472
+ * and nothing else, to the audience `CONTACT_VISIBILITY_AUDIENCE` names
473
+ * (members only, all four, 0.18.0); the server decides, and a client renders
474
+ * what arrives. Built field by field on the server
385
475
  * (`toMemberPublic`), never by dropping fields from a fuller document.
386
476
  *
387
477
  * `viewer.canMessage` is the server's answer to "offer Message": the tap
@@ -393,23 +483,23 @@ export declare const memberProfileSchema: z.ZodObject<{
393
483
  id: z.ZodString;
394
484
  location: z.ZodOptional<z.ZodObject<{
395
485
  city: z.ZodString;
396
- state: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
486
+ state: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
397
487
  country: z.ZodString;
398
488
  }, z.core.$strip>>;
399
- about: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
489
+ about: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
400
490
  displayName: z.ZodString;
401
491
  createdAt: z.ZodISODateTime;
402
- userId: z.ZodString;
403
492
  username: z.ZodString;
493
+ userId: z.ZodString;
404
494
  avatarUrl: z.ZodOptional<z.ZodURL>;
405
- headline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
495
+ headline: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
406
496
  contribution: z.ZodObject<{
407
497
  score: z.ZodNumber;
408
498
  helpedCount: z.ZodNumber;
409
499
  }, z.core.$strip>;
410
500
  venture: z.ZodOptional<z.ZodObject<{
411
501
  name: z.ZodString;
412
- tagline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
502
+ tagline: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
413
503
  website: z.ZodOptional<z.ZodURL>;
414
504
  industry: z.ZodEnum<{
415
505
  agritech: "agritech";
@@ -529,93 +619,18 @@ export type MemberHandleParams = z.infer<typeof memberHandleParamsSchema>;
529
619
  *
530
620
  * The rule this comes from: defaults belong on the READ side. A write body
531
621
  * states what the caller sent and nothing else.
622
+ *
623
+ * ONE WRITER PER FIELD (0.18.0): the name and the city are the personal
624
+ * details' (`PATCH /profiles/me/personal`), the venture is the business
625
+ * editor's (`PUT /profiles/me/business`), the handle has its own route. They
626
+ * were taken here too, a second path with its own rules for Discover's order.
627
+ * STRICT: any other key is refused (a 400 naming it), never dropped without a
628
+ * word, so a client still sending a name here learns it at once instead of
629
+ * losing the member's edit.
532
630
  */
533
631
  export declare const updateFounderProfileBodySchema: z.ZodObject<{
534
- displayName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
535
632
  headline: z.ZodOptional<z.ZodNullable<z.ZodString>>;
536
633
  about: z.ZodOptional<z.ZodNullable<z.ZodString>>;
537
- location: z.ZodOptional<z.ZodNullable<z.ZodObject<{
538
- city: z.ZodString;
539
- state: z.ZodPreprocess<z.ZodEnum<{
540
- "Jammu and Kashmir": "Jammu and Kashmir";
541
- "Himachal Pradesh": "Himachal Pradesh";
542
- Punjab: "Punjab";
543
- Chandigarh: "Chandigarh";
544
- Uttarakhand: "Uttarakhand";
545
- Haryana: "Haryana";
546
- Delhi: "Delhi";
547
- Rajasthan: "Rajasthan";
548
- "Uttar Pradesh": "Uttar Pradesh";
549
- Bihar: "Bihar";
550
- Sikkim: "Sikkim";
551
- "Arunachal Pradesh": "Arunachal Pradesh";
552
- Nagaland: "Nagaland";
553
- Manipur: "Manipur";
554
- Mizoram: "Mizoram";
555
- Tripura: "Tripura";
556
- Meghalaya: "Meghalaya";
557
- Assam: "Assam";
558
- "West Bengal": "West Bengal";
559
- Jharkhand: "Jharkhand";
560
- Odisha: "Odisha";
561
- Chhattisgarh: "Chhattisgarh";
562
- "Madhya Pradesh": "Madhya Pradesh";
563
- Gujarat: "Gujarat";
564
- "Dadra and Nagar Haveli and Daman and Diu": "Dadra and Nagar Haveli and Daman and Diu";
565
- Maharashtra: "Maharashtra";
566
- Karnataka: "Karnataka";
567
- Goa: "Goa";
568
- Lakshadweep: "Lakshadweep";
569
- Kerala: "Kerala";
570
- "Tamil Nadu": "Tamil Nadu";
571
- Puducherry: "Puducherry";
572
- "Andaman and Nicobar Islands": "Andaman and Nicobar Islands";
573
- Telangana: "Telangana";
574
- "Andhra Pradesh": "Andhra Pradesh";
575
- Ladakh: "Ladakh";
576
- }>, unknown>;
577
- country: z.ZodLiteral<"India">;
578
- }, z.core.$strip>>>;
579
- venture: z.ZodOptional<z.ZodNullable<z.ZodObject<{
580
- name: z.ZodString;
581
- tagline: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
582
- website: z.ZodOptional<z.ZodURL>;
583
- industry: z.ZodEnum<{
584
- agritech: "agritech";
585
- ai_ml: "ai_ml";
586
- b2b_saas: "b2b_saas";
587
- consumer: "consumer";
588
- climate: "climate";
589
- d2c: "d2c";
590
- deeptech: "deeptech";
591
- edtech: "edtech";
592
- fintech: "fintech";
593
- gaming: "gaming";
594
- healthtech: "healthtech";
595
- logistics: "logistics";
596
- manufacturing: "manufacturing";
597
- marketplace: "marketplace";
598
- media: "media";
599
- mobility: "mobility";
600
- proptech: "proptech";
601
- robotics: "robotics";
602
- services: "services";
603
- space: "space";
604
- other: "other";
605
- }>;
606
- stage: z.ZodEnum<{
607
- idea: "idea";
608
- validation: "validation";
609
- mvp: "mvp";
610
- pre_seed: "pre_seed";
611
- seed: "seed";
612
- series_a_plus: "series_a_plus";
613
- profitable: "profitable";
614
- exited: "exited";
615
- }>;
616
- teamSize: z.ZodOptional<z.ZodNumber>;
617
- foundedYear: z.ZodOptional<z.ZodNumber>;
618
- }, z.core.$strip>>>;
619
634
  skills: z.ZodOptional<z.ZodArray<z.ZodEnum<{
620
635
  engineering: "engineering";
621
636
  product: "product";
@@ -660,7 +675,7 @@ export declare const updateFounderProfileBodySchema: z.ZodObject<{
660
675
  github: z.ZodOptional<z.ZodURL>;
661
676
  website: z.ZodOptional<z.ZodURL>;
662
677
  }, z.core.$strip>>;
663
- }, z.core.$strip>;
678
+ }, z.core.$strict>;
664
679
  export type UpdateFounderProfileBody = z.infer<typeof updateFounderProfileBodySchema>;
665
680
  /**
666
681
  * Username change. Separate from the profile patch because it needs a
@@ -675,7 +690,9 @@ export declare const usernameAvailabilityQuerySchema: z.ZodObject<{
675
690
  username: z.ZodString;
676
691
  }, z.core.$strip>;
677
692
  export type UsernameAvailabilityQuery = z.infer<typeof usernameAvailabilityQuerySchema>;
678
- /** Availability probe behind the username field. */
693
+ /** Why a username is not available. */
694
+ export declare const USERNAME_UNAVAILABLE_REASON_VALUES: readonly ["taken", "reserved"];
695
+ export type UsernameUnavailableReason = (typeof USERNAME_UNAVAILABLE_REASON_VALUES)[number];
679
696
  export declare const usernameAvailabilitySchema: z.ZodObject<{
680
697
  username: z.ZodString;
681
698
  available: z.ZodBoolean;
@@ -746,47 +763,10 @@ export declare const updateMyPersonalDetailsBodySchema: z.ZodObject<{
746
763
  prefer_not_to_say: "prefer_not_to_say";
747
764
  }>>;
748
765
  location: z.ZodOptional<z.ZodNullable<z.ZodObject<{
749
- city: z.ZodString;
750
- state: z.ZodPreprocess<z.ZodEnum<{
751
- "Jammu and Kashmir": "Jammu and Kashmir";
752
- "Himachal Pradesh": "Himachal Pradesh";
753
- Punjab: "Punjab";
754
- Chandigarh: "Chandigarh";
755
- Uttarakhand: "Uttarakhand";
756
- Haryana: "Haryana";
757
- Delhi: "Delhi";
758
- Rajasthan: "Rajasthan";
759
- "Uttar Pradesh": "Uttar Pradesh";
760
- Bihar: "Bihar";
761
- Sikkim: "Sikkim";
762
- "Arunachal Pradesh": "Arunachal Pradesh";
763
- Nagaland: "Nagaland";
764
- Manipur: "Manipur";
765
- Mizoram: "Mizoram";
766
- Tripura: "Tripura";
767
- Meghalaya: "Meghalaya";
768
- Assam: "Assam";
769
- "West Bengal": "West Bengal";
770
- Jharkhand: "Jharkhand";
771
- Odisha: "Odisha";
772
- Chhattisgarh: "Chhattisgarh";
773
- "Madhya Pradesh": "Madhya Pradesh";
774
- Gujarat: "Gujarat";
775
- "Dadra and Nagar Haveli and Daman and Diu": "Dadra and Nagar Haveli and Daman and Diu";
776
- Maharashtra: "Maharashtra";
777
- Karnataka: "Karnataka";
778
- Goa: "Goa";
779
- Lakshadweep: "Lakshadweep";
780
- Kerala: "Kerala";
781
- "Tamil Nadu": "Tamil Nadu";
782
- Puducherry: "Puducherry";
783
- "Andaman and Nicobar Islands": "Andaman and Nicobar Islands";
784
- Telangana: "Telangana";
785
- "Andhra Pradesh": "Andhra Pradesh";
786
- Ladakh: "Ladakh";
787
- }>, unknown>;
788
- country: z.ZodLiteral<"India">;
789
- }, z.core.$strip>>>;
766
+ stateId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
767
+ districtId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
768
+ localityId: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
769
+ }, z.core.$strict>>>;
790
770
  visibility: z.ZodOptional<z.ZodObject<{
791
771
  email: z.ZodOptional<z.ZodBoolean>;
792
772
  phone: z.ZodOptional<z.ZodBoolean>;
@@ -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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;;;;;;;GAcG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;iBAgBlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;iBAc5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAI5F;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB;;iBAAwC,CAAC;AACzE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -7,10 +7,10 @@
7
7
  * @module founder-schema/domains/profile
8
8
  */
9
9
  import { z } from 'zod';
10
- import { chosenUsernameSchema, displayNameSchema, GOAL_VALUES, genderSchema, goalListSchema, goalSchema, httpUrlSchema, industrySchema, locationSchema, objectIdSchema, optionalTrimmedString, phoneSchema, skillListSchema, skillSchema, startupStageSchema, usernameSchema, } from '../../core/common.js';
10
+ import { chosenUsernameSchema, displayNameSchema, 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
- import { indiaLocationSchema } from '../location/india.js';
13
+ import { locationPickSchema, placeSchema } from '../location/areas.js';
14
14
  import { mediaImageSchema } from '../media/media.js';
15
15
  // ─── Venture ─────────────────────────────────────────────────────────────────
16
16
  /**
@@ -155,6 +155,13 @@ export const founderProfileSchema = z.object({
155
155
  */
156
156
  avatar: mediaImageSchema.optional(),
157
157
  location: locationSchema.optional(),
158
+ /**
159
+ * The member's own location as picked (0.19.0): state, district and
160
+ * locality with their area ids, for Me's location field and the drawer.
161
+ * OWNER-ONLY: no card or member page carries it (they pick `location`).
162
+ * Absent for a location stored as text before 0.19.0.
163
+ */
164
+ place: placeSchema.optional(),
158
165
  venture: ventureSchema.optional(),
159
166
  skills: z.array(skillSchema).max(SKILLS_MAX).default([]),
160
167
  goals: z.array(goalSchema).max(GOAL_VALUES.length).default([]),
@@ -199,6 +206,29 @@ export const founderCardSchema = founderProfileSchema.pick({
199
206
  goals: true,
200
207
  contribution: true,
201
208
  });
209
+ /** The fields a Discover card shows. */
210
+ export const FOUNDER_CARD_FIELDS = founderCardSchema.keyof().options;
211
+ /**
212
+ * The card fields a member's own edit can change, the ones that move them up
213
+ * Discover: every card field but the ids, which never change, and the points
214
+ * (`contribution`), which other people's acts move all day and which would
215
+ * otherwise reorder Discover with every helpful mark.
216
+ */
217
+ export const FOUNDER_CARD_EDIT_FIELDS = FOUNDER_CARD_FIELDS.filter((field) => field !== 'id' && field !== 'userId' && field !== 'contribution');
218
+ /**
219
+ * Whether a write changed what a member's Discover card shows (0.18.0): ONE
220
+ * rule for every profile writer, which decides whether the member moves up
221
+ * Discover (its "recently updated" order) and whether a client reloads it.
222
+ * `changed` names the fields the write actually changed: a body's keys, or
223
+ * for the business editor `venture` only when its PUBLIC part changed. Before
224
+ * 0.18.0 five writers decided it four ways: an edit to the About text alone
225
+ * lifted a member to the top of everyone's Discover, a new username never did.
226
+ * Points never count (`FOUNDER_CARD_EDIT_FIELDS`): they are not the member's
227
+ * edit.
228
+ */
229
+ export function changesDiscoverCard(changed) {
230
+ return changed.some((field) => FOUNDER_CARD_EDIT_FIELDS.includes(field));
231
+ }
202
232
  // ─── What a member chooses to show (0.11.0) ──────────────────────────────────
203
233
  /**
204
234
  * The four personal details a member MAY show on their profile page (the
@@ -207,13 +237,22 @@ export const founderCardSchema = founderProfileSchema.pick({
207
237
  * `PATCH /profiles/me/personal`.
208
238
  */
209
239
  export const CONTACT_VISIBILITY_FIELDS = ['email', 'phone', 'gender', 'birthday'];
240
+ /**
241
+ * WHO sees each of the four once its owner turns it on (0.18.0). The user,
242
+ * 2026-10-20: "any person who has the platform membership can view them if
243
+ * they are public", so all four go to members only (and to the member
244
+ * themself), never to an account without membership. One table: the server
245
+ * builds `shown` from it, and every screen words its switch from it.
246
+ */
247
+ export const PROFILE_AUDIENCE_VALUES = ['members'];
248
+ export const CONTACT_VISIBILITY_AUDIENCE = {
249
+ email: 'members',
250
+ phone: 'members',
251
+ gender: 'members',
252
+ birthday: 'members',
253
+ };
210
254
  /** Which of the four the member shows. Every key present on a read: false is private. */
211
- export const contactVisibilitySchema = z.object({
212
- email: z.boolean(),
213
- phone: z.boolean(),
214
- gender: z.boolean(),
215
- birthday: z.boolean(),
216
- });
255
+ export const contactVisibilitySchema = z.object(Object.fromEntries(CONTACT_VISIBILITY_FIELDS.map((field) => [field, z.boolean()])));
217
256
  /**
218
257
  * A birthday as OTHERS see it: day and month, NEVER the year (the user's
219
258
  * ruling). The year would give away the age and, with the name, the full date
@@ -229,9 +268,9 @@ export const publicBirthdaySchema = z.object({
229
268
  *
230
269
  * The card's fields, what only a page has room for (about, links, member
231
270
  * since), and `shown`: the personal details this member has CHOSEN to show,
232
- * and nothing else. Email and phone go to members only, never to an account
233
- * without membership (the coming viewer tier); the server decides, and a
234
- * client renders what arrives. Built field by field on the server
271
+ * and nothing else, to the audience `CONTACT_VISIBILITY_AUDIENCE` names
272
+ * (members only, all four, 0.18.0); the server decides, and a client renders
273
+ * what arrives. Built field by field on the server
235
274
  * (`toMemberPublic`), never by dropping fields from a fuller document.
236
275
  *
237
276
  * `viewer.canMessage` is the server's answer to "offer Message": the tap
@@ -296,30 +335,31 @@ const clearableText = (maxLength) => z.string().trim().min(1, VALIDATION_MESSAGE
296
335
  *
297
336
  * The rule this comes from: defaults belong on the READ side. A write body
298
337
  * states what the caller sent and nothing else.
338
+ *
339
+ * ONE WRITER PER FIELD (0.18.0): the name and the city are the personal
340
+ * details' (`PATCH /profiles/me/personal`), the venture is the business
341
+ * editor's (`PUT /profiles/me/business`), the handle has its own route. They
342
+ * were taken here too, a second path with its own rules for Discover's order.
343
+ * STRICT: any other key is refused (a 400 naming it), never dropped without a
344
+ * word, so a client still sending a name here learns it at once instead of
345
+ * losing the member's edit.
299
346
  */
300
- export const updateFounderProfileBodySchema = z.object({
301
- displayName: displayNameSchema.optional(),
347
+ export const updateFounderProfileBodySchema = z
348
+ .object({
302
349
  headline: clearableText(HEADLINE_MAX),
303
350
  about: clearableText(ABOUT_MAX),
304
- /**
305
- * Carries the whole location; it has no default to fill a gap. `null`
306
- * removes it (0.10.0): a member may stop showing their city on Discover, and
307
- * nothing else would take it off once given. Written in India, one of its
308
- * states (0.17.0, `indiaLocationSchema`); a stored location is still READ by
309
- * `locationSchema`.
310
- */
311
- location: indiaLocationSchema.nullable().optional(),
312
- /**
313
- * The whole venture, or `null` to remove it (0.10.0), its business type
314
- * with it: a member whose venture closed is no longer building it.
315
- */
316
- venture: ventureSchema.nullable().optional(),
317
351
  /** The same list rules as onboarding's finish (each value once, 0.17.0). */
318
352
  skills: skillListSchema.optional(),
319
- goals: goalListSchema.optional(),
353
+ /**
354
+ * The same rules as onboarding's finish, its minimum included (0.18.0, the
355
+ * user: "we already have at least one goal required"): Me cannot save a
356
+ * member down to no goals.
357
+ */
358
+ goals: requiredGoalListSchema.optional(),
320
359
  /** Sent whole. To drop one link, send the object without that key. */
321
360
  links: founderLinksSchema.optional(),
322
- });
361
+ })
362
+ .strict();
323
363
  /**
324
364
  * Username change. Separate from the profile patch because it needs a
325
365
  * uniqueness check, and it refuses a reserved handle (`chosenUsernameSchema`).
@@ -327,12 +367,13 @@ export const updateFounderProfileBodySchema = z.object({
327
367
  export const updateUsernameBodySchema = z.object({ username: chosenUsernameSchema });
328
368
  /** `GET /api/v1/profiles/username-available?username=` (0.13.0): the handle asked about. */
329
369
  export const usernameAvailabilityQuerySchema = z.object({ username: usernameSchema });
330
- /** Availability probe behind the username field. */
370
+ /** Why a username is not available. */
371
+ export const USERNAME_UNAVAILABLE_REASON_VALUES = ['taken', 'reserved'];
331
372
  export const usernameAvailabilitySchema = z.object({
332
373
  username: usernameSchema,
333
374
  available: z.boolean(),
334
- /** Present when unavailable: `taken` or `reserved`. */
335
- reason: z.enum(['taken', 'reserved']).optional(),
375
+ /** Present when unavailable. */
376
+ reason: z.enum(USERNAME_UNAVAILABLE_REASON_VALUES).optional(),
336
377
  });
337
378
  // ─── The member's own personal details ──────────────────────────────────────
338
379
  /**
@@ -389,12 +430,13 @@ export const updateMyPersonalDetailsBodySchema = z.object({
389
430
  phone: phoneSchema.optional(),
390
431
  gender: genderSchema.optional(),
391
432
  /**
392
- * The city, or `null` to remove it (0.11.0): it moved to the Personal
433
+ * The location, or `null` to remove it (0.11.0): it moved to the Personal
393
434
  * Details card, so its editor saves it here, with the rest, in one
394
- * transaction. `PATCH /profiles/me` still takes it too. Written in India,
395
- * one of its states (0.17.0, `indiaLocationSchema`).
435
+ * transaction; only here since 0.18.0 (`PATCH /profiles/me` took it too).
436
+ * Area ids from the drawer or GPS (0.19.0, `locationPickSchema`): the server
437
+ * names the place and its public city from `master_db`.
396
438
  */
397
- location: indiaLocationSchema.nullable().optional(),
439
+ location: locationPickSchema.nullable().optional(),
398
440
  /** Only the switches that changed (0.11.0). */
399
441
  visibility: contactVisibilitySchema.partial().optional(),
400
442
  });