founder-schema 0.16.0 → 0.18.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 (116) hide show
  1. package/README.md +263 -19
  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 +117 -23
  11. package/dist/core/common.d.ts.map +1 -1
  12. package/dist/core/common.js +104 -21
  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 +55 -17
  19. package/dist/core/limits.d.ts.map +1 -1
  20. package/dist/core/limits.js +59 -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 +32 -2
  30. package/dist/core/validation.d.ts.map +1 -1
  31. package/dist/core/validation.js +32 -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/india.d.ts +215 -0
  61. package/dist/domains/location/india.d.ts.map +1 -0
  62. package/dist/domains/location/india.js +1203 -0
  63. package/dist/domains/location/india.js.map +1 -0
  64. package/dist/domains/members/members.d.ts +2 -2
  65. package/dist/domains/membership/membership.d.ts +26 -0
  66. package/dist/domains/membership/membership.d.ts.map +1 -1
  67. package/dist/domains/membership/membership.js +55 -1
  68. package/dist/domains/membership/membership.js.map +1 -1
  69. package/dist/domains/moderation/moderation.d.ts +2 -2
  70. package/dist/domains/moderation/moderation.js +3 -3
  71. package/dist/domains/moderation/moderation.js.map +1 -1
  72. package/dist/domains/notifications/notifications.d.ts +1 -10
  73. package/dist/domains/notifications/notifications.d.ts.map +1 -1
  74. package/dist/domains/notifications/notifications.js +2 -3
  75. package/dist/domains/notifications/notifications.js.map +1 -1
  76. package/dist/domains/onboarding/onboarding-answers.d.ts +112 -0
  77. package/dist/domains/onboarding/onboarding-answers.d.ts.map +1 -0
  78. package/dist/domains/onboarding/onboarding-answers.js +164 -0
  79. package/dist/domains/onboarding/onboarding-answers.js.map +1 -0
  80. package/dist/domains/onboarding/onboarding.d.ts +398 -62
  81. package/dist/domains/onboarding/onboarding.d.ts.map +1 -1
  82. package/dist/domains/onboarding/onboarding.js +229 -68
  83. package/dist/domains/onboarding/onboarding.js.map +1 -1
  84. package/dist/domains/products/products.d.ts +43 -8
  85. package/dist/domains/products/products.d.ts.map +1 -1
  86. package/dist/domains/products/products.js +57 -11
  87. package/dist/domains/products/products.js.map +1 -1
  88. package/dist/domains/profile/founder-profile.d.ts +120 -68
  89. package/dist/domains/profile/founder-profile.d.ts.map +1 -1
  90. package/dist/domains/profile/founder-profile.js +80 -29
  91. package/dist/domains/profile/founder-profile.js.map +1 -1
  92. package/dist/domains/profile/my-profile.d.ts +3 -3
  93. package/dist/domains/reviews/reviews.d.ts +1 -1
  94. package/dist/domains/reviews/reviews.d.ts.map +1 -1
  95. package/dist/domains/reviews/reviews.js +2 -2
  96. package/dist/domains/reviews/reviews.js.map +1 -1
  97. package/dist/domains/support/support.d.ts +22 -3
  98. package/dist/domains/support/support.d.ts.map +1 -1
  99. package/dist/domains/support/support.js +19 -5
  100. package/dist/domains/support/support.js.map +1 -1
  101. package/dist/domains/team/team.d.ts.map +1 -1
  102. package/dist/domains/team/team.js +3 -6
  103. package/dist/domains/team/team.js.map +1 -1
  104. package/dist/domains/uploads/uploads.d.ts +7 -22
  105. package/dist/domains/uploads/uploads.d.ts.map +1 -1
  106. package/dist/domains/uploads/uploads.js +7 -21
  107. package/dist/domains/uploads/uploads.js.map +1 -1
  108. package/dist/env.d.ts +26 -13
  109. package/dist/env.d.ts.map +1 -1
  110. package/dist/env.js +58 -23
  111. package/dist/env.js.map +1 -1
  112. package/dist/index.d.ts +18 -15
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/index.js +19 -14
  115. package/dist/index.js.map +1 -1
  116. package/package.json +1 -1
@@ -53,8 +53,6 @@ export const LINK_URL_MAX = 300;
53
53
  // ─── Feed and moderation ─────────────────────────────────────────────────────
54
54
  /** Author-supplied image description. The backend's stored copy uses this too. */
55
55
  export const MEDIA_ALT_MAX = 280;
56
- export const LINK_PREVIEW_TITLE_MAX = 200;
57
- export const LINK_PREVIEW_DESCRIPTION_MAX = 500;
58
56
  /** The free-text note on a report. */
59
57
  export const REPORT_NOTE_MAX = 1000;
60
58
  /** A moderator's note on a decision (why it was hidden, removed or dismissed). */
@@ -107,6 +105,13 @@ export const MEDIA_MAX_INPUT_PIXELS = 50_000_000;
107
105
  * that the server deletes it: the composer was abandoned, or the tab closed.
108
106
  */
109
107
  export const MEDIA_UNATTACHED_TTL_HOURS = 24;
108
+ /**
109
+ * Days an unfinished sign-up's answers are kept after the member last changed
110
+ * them, finished or not (0.17.0, moved here from the backend's model): the
111
+ * draft row's TTL, the photo saved with it (released by the backend's job once
112
+ * the row goes), and the number Privacy states. One number, three readers.
113
+ */
114
+ export const ONBOARDING_DRAFT_RETENTION_DAYS = 90;
110
115
  /**
111
116
  * Uploads one member may have waiting (requested or processed, not yet
112
117
  * attached) at once. A full post is `POST_MAX_MEDIA` (10); this leaves room for
@@ -122,6 +127,8 @@ export const DISCOVER_FILTER_VALUES_MAX = 10;
122
127
  export const DISCOVER_TEXT_MAX = 80;
123
128
  /** Page size bounds for every cursor-paged list. */
124
129
  export const PAGE_SIZE_MAX = 50;
130
+ /** Longest page cursor taken back: the server's are about 70 characters. */
131
+ export const CURSOR_MAX = 256;
125
132
  export const PAGE_SIZE_DEFAULT = 20;
126
133
  // ─── Chat ────────────────────────────────────────────────────────────────────
127
134
  /**
@@ -137,14 +144,6 @@ export const PRODUCT_DESCRIPTION_MAX = 3000;
137
144
  /** Screenshots on one product page. The first is its cover on Discover. */
138
145
  export const PRODUCT_SCREENSHOTS_MAX = 8;
139
146
  export const PRODUCT_CAPTION_MAX = 140;
140
- /**
141
- * @deprecated 0.12.0: how many products may be LIVE now depends on the plan
142
- * (1 for a member, 5 on Premium, unlimited on Business), served by
143
- * `GET /plans` and `GET /me/membership`; nothing reads this. Kept so no
144
- * export is removed. It was the one cap for everyone, archived products
145
- * counted, team roles never.
146
- */
147
- export const PRODUCTS_OWNED_MAX = 5;
148
147
  /** Team members a product page shows; the rest are one tap away (`/team`). */
149
148
  export const PRODUCT_TEAM_SHOWN = 12;
150
149
  /**
@@ -155,9 +154,17 @@ export const PRODUCT_ASK_OPEN_DAYS = 14;
155
154
  // ─── Membership and plans (0.12.0) ───────────────────────────────────────────
156
155
  /** Days after a payment within which it is refunded in full on request (the user's ruling). */
157
156
  export const REFUND_WINDOW_DAYS = 7;
158
- /** India Standard Time: UTC+05:30 all year. */
159
- const IST_OFFSET_MS = (5 * 60 + 30) * 60 * 1000;
160
- const DAY_MS = 24 * 60 * 60 * 1000;
157
+ /**
158
+ * India Standard Time: UTC+05:30 all year, no daylight saving. Founder Circle
159
+ * counts every day in India's calendar (a refund window, a plan's months, a
160
+ * birthday, "today"): this one offset, never a copy (0.18.0, exported; the
161
+ * backend and the onboarding helpers each kept their own before).
162
+ */
163
+ export const INDIA_UTC_OFFSET_MS = (5 * 60 + 30) * 60 * 1000;
164
+ /** India's time zone by its IANA name, for `Intl` dates: the same clock as `INDIA_UTC_OFFSET_MS`. */
165
+ export const INDIA_TIME_ZONE = 'Asia/Kolkata';
166
+ /** One day in milliseconds. */
167
+ export const DAY_MS = 24 * 60 * 60 * 1000;
161
168
  /**
162
169
  * The LAST moment a payment made at `paidAt` may be asked to be refunded
163
170
  * (0.15.0). The user's rule: seven days, "counted from the day I paid". So
@@ -169,8 +176,9 @@ const DAY_MS = 24 * 60 * 60 * 1000;
169
176
  * Inclusive: an ask AT this instant is in time.
170
177
  */
171
178
  export function refundWindowEndsAt(paidAt) {
172
- const inIndia = new Date(new Date(paidAt).getTime() + IST_OFFSET_MS);
173
- const payDayStart = Date.UTC(inIndia.getUTCFullYear(), inIndia.getUTCMonth(), inIndia.getUTCDate()) - IST_OFFSET_MS;
179
+ const inIndia = new Date(new Date(paidAt).getTime() + INDIA_UTC_OFFSET_MS);
180
+ const payDayStart = Date.UTC(inIndia.getUTCFullYear(), inIndia.getUTCMonth(), inIndia.getUTCDate()) -
181
+ INDIA_UTC_OFFSET_MS;
174
182
  return new Date(payDayStart + (REFUND_WINDOW_DAYS + 1) * DAY_MS - 1);
175
183
  }
176
184
  /** Minutes a checkout stays payable. After that it is expired and a new one is opened. */
@@ -185,16 +193,39 @@ export const PLAN_AHEAD_MAX_YEARS = 3;
185
193
  export const PRODUCTS_LIVE_SAFETY_MAX = 100;
186
194
  export const COUPON_CODE_MIN = 4;
187
195
  export const COUPON_CODE_MAX = 32;
196
+ /**
197
+ * The most redemptions a coupon may allow (0.18.0: the web capped the field at
198
+ * 6 digits and nothing else did). A cap is a number staff type; no cap is null.
199
+ */
200
+ export const COUPON_USES_MAX = 999_999;
188
201
  /** What staff call a coupon in their list ("Founding 100"). */
202
+ export const COUPON_LABEL_MIN = 2;
189
203
  export const COUPON_LABEL_MAX = 80;
204
+ /** A percent-off coupon's share: never the whole price (a free membership is its own kind). */
205
+ export const COUPON_PERCENT_MIN = 1;
206
+ export const COUPON_PERCENT_MAX = 90;
190
207
  /** Why staff refund a payment or grant or revoke a membership, on the audit record. */
191
208
  export const BILLING_REASON_MIN = 3;
192
209
  export const BILLING_REASON_MAX = 500;
193
210
  /** A buyer's legal name and address on a B2B invoice. */
211
+ export const BILLING_NAME_MIN = 2;
194
212
  export const BILLING_NAME_MAX = 120;
213
+ export const BILLING_ADDRESS_MIN = 10;
195
214
  export const BILLING_ADDRESS_MAX = 300;
215
+ /** A GSTIN: always exactly this many characters (`gstinSchema` checks the pattern and the check character). */
216
+ export const GSTIN_LENGTH = 15;
217
+ /** An invoice or credit-note number: the GST rule's own ceiling (Rule 46(b): at most 16 characters). */
218
+ export const INVOICE_NUMBER_MAX = 16;
219
+ /** Razorpay's ids (order, payment) and the payment signature, as the checkout hands them back. */
220
+ export const RAZORPAY_ID_MAX = 64;
221
+ export const RAZORPAY_SIGNATURE_MAX = 256;
196
222
  /** Days before a plan's end that the bell reminds, earliest first. */
197
223
  export const PLAN_REMINDER_DAYS = [7, 1];
224
+ /**
225
+ * Days a Razorpay webhook notice is kept, to answer "did that webhook arrive"
226
+ * (0.18.0: named; the backend's TTL and the Privacy text each held a 90).
227
+ */
228
+ export const RAZORPAY_EVENT_RETENTION_DAYS = 90;
198
229
  // ─── Communities (0.9.0) ─────────────────────────────────────────────────────
199
230
  export const COMMUNITY_NAME_MIN = 3;
200
231
  export const COMMUNITY_NAME_MAX = 60;
@@ -221,24 +252,30 @@ export const REVIEW_REPLY_MAX = 1000;
221
252
  * ratings say more about who wrote them than about the product.
222
253
  */
223
254
  export const REVIEW_AVERAGE_MIN_COUNT = 3;
255
+ /** A rating's stars, and so the range an average can fall in. */
256
+ export const RATING_MIN = 1;
257
+ export const RATING_MAX = 5;
224
258
  // ─── Contribution ────────────────────────────────────────────────────────────
225
259
  /** Points one review can earn its writer through other members' Helpful votes. */
226
260
  export const REVIEW_HELPFUL_POINTS_MAX = 10;
227
261
  /**
228
- * @deprecated 0.7.0: writing a review earns no points (the score counts only
229
- * what OTHER members recognise), so nothing reads this. Kept so no export is
230
- * removed.
262
+ * Points one member can earn from ONE other member over any
263
+ * `CONTRIBUTION_PAIR_WINDOW_DAYS`, all kinds together, so two founders cannot
264
+ * farm each other by trading Helpful marks.
231
265
  */
232
- export const REVIEWS_REWARDED_PER_DAY = 3;
266
+ export const CONTRIBUTION_PAIR_POINTS_MAX = 30;
233
267
  /**
234
- * Points one member can earn from ONE other member over any 30 days, all kinds
235
- * together, so two founders cannot farm each other by trading Helpful marks.
268
+ * The window of that cap, in days (0.18.0: named; it borrowed the "this
269
+ * month" score's window, a different rule that happens to share the number).
236
270
  */
237
- export const CONTRIBUTION_PAIR_POINTS_MAX = 30;
271
+ export const CONTRIBUTION_PAIR_WINDOW_DAYS = 30;
238
272
  /** Window of the "this month" score and the top-helpers list. */
239
273
  export const CONTRIBUTION_RECENT_DAYS = 30;
240
274
  /** Rows on the top-helpers list. */
241
275
  export const CONTRIBUTION_LEADERBOARD_SIZE = 20;
276
+ // ─── Staff dashboard ─────────────────────────────────────────────────────────
277
+ /** The dashboard's "Last N days" counts (0.18.0: the one window; the backend kept two copies of 7). */
278
+ export const DASHBOARD_RECENT_DAYS = 7;
242
279
  // ─── Notifications ───────────────────────────────────────────────────────────
243
280
  /** Days a notification is kept. Neither Jansathi nor GymMonk ever deletes one. */
244
281
  export const NOTIFICATION_RETENTION_DAYS = 90;
@@ -1 +1 @@
1
- {"version":3,"file":"limits.js","sourceRoot":"","sources":["../../src/core/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,gFAAgF;AAEhF,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAChC,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC;AAC9B,0DAA0D;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC;AAC5B,gFAAgF;AAChF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC;AAE3B,gFAAgF;AAEhF,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC;AAC3B,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC;AAC5B,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAE9B,gFAAgF;AAEhF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,uCAAuC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAC/B,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC;AACrC,mFAAmF;AACnF,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAErC,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAA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mE;AACnE,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC","sourcesContent":["/**\n * founder-schema — Every length, size and count limit, by name\n *\n * ONE PLACE FOR EVERY NUMBER a client and the server must agree on. Before this,\n * the limits lived inline (`.max(80)`, `.max(1000)`) where nothing else could\n * read them, so the web client re-typed each one for its counters and the\n * backend re-typed them as Mongoose `maxlength`. Three copies of one number is\n * how the image alt text came to be 280 here and 500 in the backend.\n *\n * The rule from 0.2.0: a schema uses one of these constants, a consumer imports\n * the same constant, and nobody writes the digits again.\n *\n * Imports nothing, so any module here can use it without a cycle. Limits that\n * already had a name in their own module (POST_MAX_BODY_CHARS, POLL_*,\n * USERNAME_*, INTERESTS_*, MIN_AGE_YEARS...) stay where they are and keep their\n * names; this file holds the ones that had none.\n *\n * ⚠️ Lowering a limit is a breaking change for stored data: a value that was\n * valid when written fails the next edit. Raise freely; lower deliberately.\n *\n * @module founder-schema/core/limits\n */\n\n// ─── Profile ─────────────────────────────────────────────────────────────────\n\nexport const DISPLAY_NAME_MAX = 80;\nexport const HEADLINE_MAX = 120;\nexport const ABOUT_MAX = 1000;\n/** Skills a member may list. Discover filters on them. */\nexport const SKILLS_MAX = 8;\n/** Goals a member must pick at onboarding. The list itself caps the maximum. */\nexport const GOALS_MIN = 1;\n\n// ─── Location ────────────────────────────────────────────────────────────────\n\nexport const CITY_MAX = 80;\nexport const STATE_MAX = 80;\nexport const COUNTRY_MAX = 80;\n\n// ─── Venture ─────────────────────────────────────────────────────────────────\n\nexport const VENTURE_NAME_MAX = 120;\nexport const VENTURE_TAGLINE_MAX = 160;\n/** Team size including the founder. */\nexport const TEAM_SIZE_MIN = 1;\nexport const TEAM_SIZE_MAX = 100_000;\n/** Earliest founding year accepted. The ceiling is \"this year\", read per parse. */\nexport const FOUNDED_YEAR_MIN = 1900;\n\n// ─── Links ───────────────────────────────────────────────────────────────────\n\n/**\n * Longest URL a member may TYPE. Applied by `httpUrlSchema` itself, so every\n * member URL carries it: profile links, a venture website.\n *\n * ⚠ NOT applied to URLs the server reads from elsewhere (a link preview's\n * page or image), which use `safeUrlSchema`: a 314-character CDN image URL is\n * ordinary, and one of them would otherwise fail a whole feed page.\n */\nexport const LINK_URL_MAX = 300;\n\n// ─── Feed and moderation ─────────────────────────────────────────────────────\n\n/** Author-supplied image description. The backend's stored copy uses this too. */\nexport const MEDIA_ALT_MAX = 280;\nexport const LINK_PREVIEW_TITLE_MAX = 200;\nexport const LINK_PREVIEW_DESCRIPTION_MAX = 500;\n/** The free-text note on a report. */\nexport const REPORT_NOTE_MAX = 1000;\n/** A moderator's note on a decision (why it was hidden, removed or dismissed). */\nexport const MODERATION_NOTE_MAX = 500;\n/** What a post, poll or comment is shown as in a staff list: its first words. */\nexport const MODERATION_EXCERPT_MAX = 160;\n\n// ─── Staff ───────────────────────────────────────────────────────────────────\n\n/** Why a member was suspended. Shown to staff, and on record in the audit log. */\nexport const SUSPENSION_REASON_MIN = 3;\nexport const SUSPENSION_REASON_MAX = 500;\n/** The staff member directory's search box (a name, a handle or an email). */\nexport const MEMBER_SEARCH_MAX = 120;\n\n// ─── Support ─────────────────────────────────────────────────────────────────\n\nexport const TICKET_SUBJECT_MIN = 3;\nexport const TICKET_SUBJECT_MAX = 120;\n/** One message in a ticket, the member's or an agent's. */\nexport const TICKET_MESSAGE_MAX = 4000;\n/**\n * Messages one ticket may hold. A conversation that long is a new problem, so\n * the member is asked to open a new ticket rather than the thread growing\n * without bound.\n */\nexport const TICKET_MESSAGES_MAX = 200;\nexport const SAVED_REPLY_TITLE_MAX = 80;\nexport const SAVED_REPLY_BODY_MAX = 4000;\n/** Saved replies kept in all: a team's library, not an archive. */\nexport const SAVED_REPLIES_MAX = 200;\n\n// ─── Uploads ─────────────────────────────────────────────────────────────────\n\n/**\n * Largest file accepted for upload: 10 MB.\n *\n * Enforced three times. The upload-slot body refuses a bigger `contentLength`;\n * the size is SIGNED INTO the upload URL, so storage refuses a body of any other\n * size; and the server checks the stored object again before processing it.\n * The client checks first only to fail fast: it shrinks a photo well below this\n * before uploading (see `MEDIA_SIZES`), so a member rarely meets the limit.\n */\nexport const UPLOAD_MAX_BYTES = 10 * 1024 * 1024;\n\n/**\n * Largest image, in pixels, the server will decode: 50 megapixels, one frame.\n *\n * Bytes do not bound memory. A 50,000 x 50,000 PNG of one colour compresses to\n * a few kilobytes and decodes to ten gigabytes. The server reads the dimensions\n * first and refuses anything above this before decoding (`UPLOAD_TOO_MANY_PIXELS`).\n * 50 MP admits every phone camera's full-resolution photo up to 48 MP.\n */\nexport const MEDIA_MAX_INPUT_PIXELS = 50_000_000;\n\n/**\n * Hours an upload may wait to be attached to a post or set as an avatar. After\n * that the server deletes it: the composer was abandoned, or the tab closed.\n */\nexport const MEDIA_UNATTACHED_TTL_HOURS = 24;\n\n/**\n * Uploads one member may have waiting (requested or processed, not yet\n * attached) at once. A full post is `POST_MAX_MEDIA` (10); this leaves room for\n * a retry or two without letting one account fill storage.\n */\nexport const MEDIA_PENDING_MAX = 30;\n\n/** Longest placeholder string: a base64 ThumbHash is about 30 characters. */\nexport const MEDIA_PLACEHOLDER_MAX = 100;\n\n// ─── Lists and search ────────────────────────────────────────────────────────\n\n/** Values one Discover multi-select filter may carry (`?skill=a&skill=b`). */\nexport const DISCOVER_FILTER_VALUES_MAX = 10;\n/** Discover's free-text inputs: the name search, city and country. */\nexport const DISCOVER_TEXT_MAX = 80;\n/** Page size bounds for every cursor-paged list. */\nexport const PAGE_SIZE_MAX = 50;\nexport const PAGE_SIZE_DEFAULT = 20;\n\n// ─── Chat ────────────────────────────────────────────────────────────────────\n\n/**\n * Members one participants lookup may name. Bounded so the lookup cannot be\n * used to page through the directory.\n */\nexport const CHAT_PARTICIPANTS_MAX = 100;\n\n// ─── Products ────────────────────────────────────────────────────────────────\n\nexport const PRODUCT_NAME_MAX = 60;\n/** One line on a Discover card: short enough to never wrap twice on a phone. */\nexport const PRODUCT_TAGLINE_MAX = 80;\nexport const PRODUCT_DESCRIPTION_MAX = 3000;\n/** Screenshots on one product page. The first is its cover on Discover. */\nexport const PRODUCT_SCREENSHOTS_MAX = 8;\nexport const PRODUCT_CAPTION_MAX = 140;\n/**\n * @deprecated 0.12.0: how many products may be LIVE now depends on the plan\n * (1 for a member, 5 on Premium, unlimited on Business), served by\n * `GET /plans` and `GET /me/membership`; nothing reads this. Kept so no\n * export is removed. It was the one cap for everyone, archived products\n * counted, team roles never.\n */\nexport const PRODUCTS_OWNED_MAX = 5;\n/** Team members a product page shows; the rest are one tap away (`/team`). */\nexport const PRODUCT_TEAM_SHOWN = 12;\n/**\n * Days a post's ask keeps its product on the \"asking for testers\" (or feedback,\n * launch, ideas) shelf. Each new post with that ask restarts the clock.\n */\nexport const PRODUCT_ASK_OPEN_DAYS = 14;\n\n// ─── Membership and plans (0.12.0) ───────────────────────────────────────────\n\n/** Days after a payment within which it is refunded in full on request (the user's ruling). */\nexport const REFUND_WINDOW_DAYS = 7;\n\n/** India Standard Time: UTC+05:30 all year. */\nconst IST_OFFSET_MS = (5 * 60 + 30) * 60 * 1000;\nconst DAY_MS = 24 * 60 * 60 * 1000;\n\n/**\n * The LAST moment a payment made at `paidAt` may be asked to be refunded\n * (0.15.0). The user's rule: seven days, \"counted from the day I paid\". So\n * the window runs to the END of the seventh day after the day of paying, in\n * India's time: paid at 00:10 on 1 October, refundable until 23:59:59.999 on\n * 8 October. That is the date a member is shown, so the date shown and the\n * moment enforced can never disagree (before 0.15.0 the server cut off at\n * exactly 7 x 24 hours after the payment while the page showed only a date).\n * Inclusive: an ask AT this instant is in time.\n */\nexport function refundWindowEndsAt(paidAt: Date | string): Date {\n const inIndia = new Date(new Date(paidAt).getTime() + IST_OFFSET_MS);\n const payDayStart =\n Date.UTC(inIndia.getUTCFullYear(), inIndia.getUTCMonth(), inIndia.getUTCDate()) - IST_OFFSET_MS;\n return new Date(payDayStart + (REFUND_WINDOW_DAYS + 1) * DAY_MS - 1);\n}\n/** Minutes a checkout stays payable. After that it is expired and a new one is opened. */\nexport const ORDER_TTL_MINUTES = 30;\n/** Plan time one member may hold ahead of today, in years. Bounds what is prepaid. */\nexport const PLAN_AHEAD_MAX_YEARS = 3;\n/**\n * The \"unlimited\" plan's actual ceiling on live products: a fair-use net\n * against a script, which the Terms of Service state. A constant: changing it\n * is a release.\n */\nexport const PRODUCTS_LIVE_SAFETY_MAX = 100;\nexport const COUPON_CODE_MIN = 4;\nexport const COUPON_CODE_MAX = 32;\n/** What staff call a coupon in their list (\"Founding 100\"). */\nexport const COUPON_LABEL_MAX = 80;\n/** Why staff refund a payment or grant or revoke a membership, on the audit record. */\nexport const BILLING_REASON_MIN = 3;\nexport const BILLING_REASON_MAX = 500;\n/** A buyer's legal name and address on a B2B invoice. */\nexport const BILLING_NAME_MAX = 120;\nexport const BILLING_ADDRESS_MAX = 300;\n/** Days before a plan's end that the bell reminds, earliest first. */\nexport const PLAN_REMINDER_DAYS = [7, 1] as const;\n\n// ─── Communities (0.9.0) ─────────────────────────────────────────────────────\n\nexport const COMMUNITY_NAME_MIN = 3;\nexport const COMMUNITY_NAME_MAX = 60;\nexport const COMMUNITY_DESCRIPTION_MAX = 500;\n/** Rules on one community, each one line. */\nexport const COMMUNITY_RULES_MAX = 10;\nexport const COMMUNITY_RULE_MAX = 200;\n/** What a suggester says the community is for, beyond its description. */\nexport const COMMUNITY_SUGGESTION_WHY_MAX = 500;\n/** A declined suggestion says why: long enough to be a reason, not a novel. */\nexport const COMMUNITY_DECLINE_REASON_MIN = 3;\nexport const COMMUNITY_DECLINE_REASON_MAX = 500;\nexport const COMMUNITY_BAN_REASON_MAX = 500;\n\n// ─── Reviews ─────────────────────────────────────────────────────────────────\n\n/**\n * A review says WHY. A star with no reason does not help the founder, which is\n * the whole point of reviewing here, so the text is required and has a floor.\n */\nexport const REVIEW_TEXT_MIN = 30;\nexport const REVIEW_TEXT_MAX = 2000;\nexport const REVIEW_REPLY_MAX = 1000;\n/**\n * Reviews before a product shows an average (and enters \"Top rated\"). One or two\n * ratings say more about who wrote them than about the product.\n */\nexport const REVIEW_AVERAGE_MIN_COUNT = 3;\n\n// ─── Contribution ────────────────────────────────────────────────────────────\n\n/** Points one review can earn its writer through other members' Helpful votes. */\nexport const REVIEW_HELPFUL_POINTS_MAX = 10;\n/**\n * @deprecated 0.7.0: writing a review earns no points (the score counts only\n * what OTHER members recognise), so nothing reads this. Kept so no export is\n * removed.\n */\nexport const REVIEWS_REWARDED_PER_DAY = 3;\n/**\n * Points one member can earn from ONE other member over any 30 days, all kinds\n * together, so two founders cannot farm each other by trading Helpful marks.\n */\nexport const CONTRIBUTION_PAIR_POINTS_MAX = 30;\n/** Window of the \"this month\" score and the top-helpers list. */\nexport const CONTRIBUTION_RECENT_DAYS = 30;\n/** Rows on the top-helpers list. */\nexport const CONTRIBUTION_LEADERBOARD_SIZE = 20;\n\n// ─── Notifications ───────────────────────────────────────────────────────────\n\n/** Days a notification is kept. Neither Jansathi nor GymMonk ever deletes one. */\nexport const NOTIFICATION_RETENTION_DAYS = 90;\n\n// ─── Erasure ─────────────────────────────────────────────────────────────────\n\n/**\n * Days what a deleted account leaves behind, and the text of content its\n * author deleted or moderation removed, is kept before it is purged (the\n * user's ruling, 2026-10-11). The floor in India's IT Rules, 2021: a closed\n * account's registration information is kept 180 days after it closes (rule\n * 3(1)(h)), and removed content is preserved 180 days for investigations (rule\n * 3(1)(g)). The backend's `erasure-purge` job enforces it; the Privacy Policy\n * states it, and its test reads this number.\n */\nexport const ERASURE_RETENTION_DAYS = 180;\n/** The first words of a comment or review a notification shows. */\nexport const NOTIFICATION_EXCERPT_MAX = 140;\n"]}
1
+ {"version":3,"file":"limits.js","sourceRoot":"","sources":["../../src/core/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,gFAAgF;AAEhF,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAChC,MAAM,CAAC,MAAM,SAAS,GAAG,IA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AoC;AACpC,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAEhD,gFAAgF;AAEhF,uGAAuG;AACvG,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC,gFAAgF;AAEhF,kFAAkF;AAClF,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAE9C,gFAAgF;AAEhF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAC1C,mEAAmE;AACnE,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC","sourcesContent":["/**\n * founder-schema — Every length, size and count limit, by name\n *\n * ONE PLACE FOR EVERY NUMBER a client and the server must agree on. Before this,\n * the limits lived inline (`.max(80)`, `.max(1000)`) where nothing else could\n * read them, so the web client re-typed each one for its counters and the\n * backend re-typed them as Mongoose `maxlength`. Three copies of one number is\n * how the image alt text came to be 280 here and 500 in the backend.\n *\n * The rule from 0.2.0: a schema uses one of these constants, a consumer imports\n * the same constant, and nobody writes the digits again.\n *\n * Imports nothing, so any module here can use it without a cycle. Limits that\n * already had a name in their own module (POST_MAX_BODY_CHARS, POLL_*,\n * USERNAME_*, INTERESTS_*, MIN_AGE_YEARS...) stay where they are and keep their\n * names; this file holds the ones that had none.\n *\n * ⚠️ Lowering a limit is a breaking change for stored data: a value that was\n * valid when written fails the next edit. Raise freely; lower deliberately.\n *\n * @module founder-schema/core/limits\n */\n\n// ─── Profile ─────────────────────────────────────────────────────────────────\n\nexport const DISPLAY_NAME_MAX = 80;\nexport const HEADLINE_MAX = 120;\nexport const ABOUT_MAX = 1000;\n/** Skills a member may list. Discover filters on them. */\nexport const SKILLS_MAX = 8;\n/** Goals a member must pick at onboarding. The list itself caps the maximum. */\nexport const GOALS_MIN = 1;\n\n// ─── Location ────────────────────────────────────────────────────────────────\n\nexport const CITY_MAX = 80;\nexport const STATE_MAX = 80;\nexport const COUNTRY_MAX = 80;\n\n// ─── Venture ─────────────────────────────────────────────────────────────────\n\nexport const VENTURE_NAME_MAX = 120;\nexport const VENTURE_TAGLINE_MAX = 160;\n/** Team size including the founder. */\nexport const TEAM_SIZE_MIN = 1;\nexport const TEAM_SIZE_MAX = 100_000;\n/** Earliest founding year accepted. The ceiling is \"this year\", read per parse. */\nexport const FOUNDED_YEAR_MIN = 1900;\n\n// ─── Links ───────────────────────────────────────────────────────────────────\n\n/**\n * Longest URL a member may TYPE. Applied by `httpUrlSchema` itself, so every\n * member URL carries it: profile links, a venture website.\n *\n * ⚠ NOT applied to URLs the server reads from elsewhere (a link preview's\n * page or image), which use `safeUrlSchema`: a 314-character CDN image URL is\n * ordinary, and one of them would otherwise fail a whole feed page.\n */\nexport const LINK_URL_MAX = 300;\n\n// ─── Feed and moderation ─────────────────────────────────────────────────────\n\n/** Author-supplied image description. The backend's stored copy uses this too. */\nexport const MEDIA_ALT_MAX = 280;\n/** The free-text note on a report. */\nexport const REPORT_NOTE_MAX = 1000;\n/** A moderator's note on a decision (why it was hidden, removed or dismissed). */\nexport const MODERATION_NOTE_MAX = 500;\n/** What a post, poll or comment is shown as in a staff list: its first words. */\nexport const MODERATION_EXCERPT_MAX = 160;\n\n// ─── Staff ───────────────────────────────────────────────────────────────────\n\n/** Why a member was suspended. Shown to staff, and on record in the audit log. */\nexport const SUSPENSION_REASON_MIN = 3;\nexport const SUSPENSION_REASON_MAX = 500;\n/** The staff member directory's search box (a name, a handle or an email). */\nexport const MEMBER_SEARCH_MAX = 120;\n\n// ─── Support ─────────────────────────────────────────────────────────────────\n\nexport const TICKET_SUBJECT_MIN = 3;\nexport const TICKET_SUBJECT_MAX = 120;\n/** One message in a ticket, the member's or an agent's. */\nexport const TICKET_MESSAGE_MAX = 4000;\n/**\n * Messages one ticket may hold. A conversation that long is a new problem, so\n * the member is asked to open a new ticket rather than the thread growing\n * without bound.\n */\nexport const TICKET_MESSAGES_MAX = 200;\nexport const SAVED_REPLY_TITLE_MAX = 80;\nexport const SAVED_REPLY_BODY_MAX = 4000;\n/** Saved replies kept in all: a team's library, not an archive. */\nexport const SAVED_REPLIES_MAX = 200;\n\n// ─── Uploads ─────────────────────────────────────────────────────────────────\n\n/**\n * Largest file accepted for upload: 10 MB.\n *\n * Enforced three times. The upload-slot body refuses a bigger `contentLength`;\n * the size is SIGNED INTO the upload URL, so storage refuses a body of any other\n * size; and the server checks the stored object again before processing it.\n * The client checks first only to fail fast: it shrinks a photo well below this\n * before uploading (see `MEDIA_SIZES`), so a member rarely meets the limit.\n */\nexport const UPLOAD_MAX_BYTES = 10 * 1024 * 1024;\n\n/**\n * Largest image, in pixels, the server will decode: 50 megapixels, one frame.\n *\n * Bytes do not bound memory. A 50,000 x 50,000 PNG of one colour compresses to\n * a few kilobytes and decodes to ten gigabytes. The server reads the dimensions\n * first and refuses anything above this before decoding (`UPLOAD_TOO_MANY_PIXELS`).\n * 50 MP admits every phone camera's full-resolution photo up to 48 MP.\n */\nexport const MEDIA_MAX_INPUT_PIXELS = 50_000_000;\n\n/**\n * Hours an upload may wait to be attached to a post or set as an avatar. After\n * that the server deletes it: the composer was abandoned, or the tab closed.\n */\nexport const MEDIA_UNATTACHED_TTL_HOURS = 24;\n\n/**\n * Days an unfinished sign-up's answers are kept after the member last changed\n * them, finished or not (0.17.0, moved here from the backend's model): the\n * draft row's TTL, the photo saved with it (released by the backend's job once\n * the row goes), and the number Privacy states. One number, three readers.\n */\nexport const ONBOARDING_DRAFT_RETENTION_DAYS = 90;\n\n/**\n * Uploads one member may have waiting (requested or processed, not yet\n * attached) at once. A full post is `POST_MAX_MEDIA` (10); this leaves room for\n * a retry or two without letting one account fill storage.\n */\nexport const MEDIA_PENDING_MAX = 30;\n\n/** Longest placeholder string: a base64 ThumbHash is about 30 characters. */\nexport const MEDIA_PLACEHOLDER_MAX = 100;\n\n// ─── Lists and search ────────────────────────────────────────────────────────\n\n/** Values one Discover multi-select filter may carry (`?skill=a&skill=b`). */\nexport const DISCOVER_FILTER_VALUES_MAX = 10;\n/** Discover's free-text inputs: the name search, city and country. */\nexport const DISCOVER_TEXT_MAX = 80;\n/** Page size bounds for every cursor-paged list. */\nexport const PAGE_SIZE_MAX = 50;\n/** Longest page cursor taken back: the server's are about 70 characters. */\nexport const CURSOR_MAX = 256;\nexport const PAGE_SIZE_DEFAULT = 20;\n\n// ─── Chat ────────────────────────────────────────────────────────────────────\n\n/**\n * Members one participants lookup may name. Bounded so the lookup cannot be\n * used to page through the directory.\n */\nexport const CHAT_PARTICIPANTS_MAX = 100;\n\n// ─── Products ────────────────────────────────────────────────────────────────\n\nexport const PRODUCT_NAME_MAX = 60;\n/** One line on a Discover card: short enough to never wrap twice on a phone. */\nexport const PRODUCT_TAGLINE_MAX = 80;\nexport const PRODUCT_DESCRIPTION_MAX = 3000;\n/** Screenshots on one product page. The first is its cover on Discover. */\nexport const PRODUCT_SCREENSHOTS_MAX = 8;\nexport const PRODUCT_CAPTION_MAX = 140;\n/** Team members a product page shows; the rest are one tap away (`/team`). */\nexport const PRODUCT_TEAM_SHOWN = 12;\n/**\n * Days a post's ask keeps its product on the \"asking for testers\" (or feedback,\n * launch, ideas) shelf. Each new post with that ask restarts the clock.\n */\nexport const PRODUCT_ASK_OPEN_DAYS = 14;\n\n// ─── Membership and plans (0.12.0) ───────────────────────────────────────────\n\n/** Days after a payment within which it is refunded in full on request (the user's ruling). */\nexport const REFUND_WINDOW_DAYS = 7;\n\n/**\n * India Standard Time: UTC+05:30 all year, no daylight saving. Founder Circle\n * counts every day in India's calendar (a refund window, a plan's months, a\n * birthday, \"today\"): this one offset, never a copy (0.18.0, exported; the\n * backend and the onboarding helpers each kept their own before).\n */\nexport const INDIA_UTC_OFFSET_MS = (5 * 60 + 30) * 60 * 1000;\n/** India's time zone by its IANA name, for `Intl` dates: the same clock as `INDIA_UTC_OFFSET_MS`. */\nexport const INDIA_TIME_ZONE = 'Asia/Kolkata';\n/** One day in milliseconds. */\nexport const DAY_MS = 24 * 60 * 60 * 1000;\n\n/**\n * The LAST moment a payment made at `paidAt` may be asked to be refunded\n * (0.15.0). The user's rule: seven days, \"counted from the day I paid\". So\n * the window runs to the END of the seventh day after the day of paying, in\n * India's time: paid at 00:10 on 1 October, refundable until 23:59:59.999 on\n * 8 October. That is the date a member is shown, so the date shown and the\n * moment enforced can never disagree (before 0.15.0 the server cut off at\n * exactly 7 x 24 hours after the payment while the page showed only a date).\n * Inclusive: an ask AT this instant is in time.\n */\nexport function refundWindowEndsAt(paidAt: Date | string): Date {\n const inIndia = new Date(new Date(paidAt).getTime() + INDIA_UTC_OFFSET_MS);\n const payDayStart =\n Date.UTC(inIndia.getUTCFullYear(), inIndia.getUTCMonth(), inIndia.getUTCDate()) -\n INDIA_UTC_OFFSET_MS;\n return new Date(payDayStart + (REFUND_WINDOW_DAYS + 1) * DAY_MS - 1);\n}\n/** Minutes a checkout stays payable. After that it is expired and a new one is opened. */\nexport const ORDER_TTL_MINUTES = 30;\n/** Plan time one member may hold ahead of today, in years. Bounds what is prepaid. */\nexport const PLAN_AHEAD_MAX_YEARS = 3;\n/**\n * The \"unlimited\" plan's actual ceiling on live products: a fair-use net\n * against a script, which the Terms of Service state. A constant: changing it\n * is a release.\n */\nexport const PRODUCTS_LIVE_SAFETY_MAX = 100;\nexport const COUPON_CODE_MIN = 4;\nexport const COUPON_CODE_MAX = 32;\n/**\n * The most redemptions a coupon may allow (0.18.0: the web capped the field at\n * 6 digits and nothing else did). A cap is a number staff type; no cap is null.\n */\nexport const COUPON_USES_MAX = 999_999;\n/** What staff call a coupon in their list (\"Founding 100\"). */\nexport const COUPON_LABEL_MIN = 2;\nexport const COUPON_LABEL_MAX = 80;\n/** A percent-off coupon's share: never the whole price (a free membership is its own kind). */\nexport const COUPON_PERCENT_MIN = 1;\nexport const COUPON_PERCENT_MAX = 90;\n/** Why staff refund a payment or grant or revoke a membership, on the audit record. */\nexport const BILLING_REASON_MIN = 3;\nexport const BILLING_REASON_MAX = 500;\n/** A buyer's legal name and address on a B2B invoice. */\nexport const BILLING_NAME_MIN = 2;\nexport const BILLING_NAME_MAX = 120;\nexport const BILLING_ADDRESS_MIN = 10;\nexport const BILLING_ADDRESS_MAX = 300;\n/** A GSTIN: always exactly this many characters (`gstinSchema` checks the pattern and the check character). */\nexport const GSTIN_LENGTH = 15;\n/** An invoice or credit-note number: the GST rule's own ceiling (Rule 46(b): at most 16 characters). */\nexport const INVOICE_NUMBER_MAX = 16;\n/** Razorpay's ids (order, payment) and the payment signature, as the checkout hands them back. */\nexport const RAZORPAY_ID_MAX = 64;\nexport const RAZORPAY_SIGNATURE_MAX = 256;\n/** Days before a plan's end that the bell reminds, earliest first. */\nexport const PLAN_REMINDER_DAYS = [7, 1] as const;\n\n/**\n * Days a Razorpay webhook notice is kept, to answer \"did that webhook arrive\"\n * (0.18.0: named; the backend's TTL and the Privacy text each held a 90).\n */\nexport const RAZORPAY_EVENT_RETENTION_DAYS = 90;\n\n// ─── Communities (0.9.0) ─────────────────────────────────────────────────────\n\nexport const COMMUNITY_NAME_MIN = 3;\nexport const COMMUNITY_NAME_MAX = 60;\nexport const COMMUNITY_DESCRIPTION_MAX = 500;\n/** Rules on one community, each one line. */\nexport const COMMUNITY_RULES_MAX = 10;\nexport const COMMUNITY_RULE_MAX = 200;\n/** What a suggester says the community is for, beyond its description. */\nexport const COMMUNITY_SUGGESTION_WHY_MAX = 500;\n/** A declined suggestion says why: long enough to be a reason, not a novel. */\nexport const COMMUNITY_DECLINE_REASON_MIN = 3;\nexport const COMMUNITY_DECLINE_REASON_MAX = 500;\nexport const COMMUNITY_BAN_REASON_MAX = 500;\n\n// ─── Reviews ─────────────────────────────────────────────────────────────────\n\n/**\n * A review says WHY. A star with no reason does not help the founder, which is\n * the whole point of reviewing here, so the text is required and has a floor.\n */\nexport const REVIEW_TEXT_MIN = 30;\nexport const REVIEW_TEXT_MAX = 2000;\nexport const REVIEW_REPLY_MAX = 1000;\n/**\n * Reviews before a product shows an average (and enters \"Top rated\"). One or two\n * ratings say more about who wrote them than about the product.\n */\nexport const REVIEW_AVERAGE_MIN_COUNT = 3;\n/** A rating's stars, and so the range an average can fall in. */\nexport const RATING_MIN = 1;\nexport const RATING_MAX = 5;\n\n// ─── Contribution ────────────────────────────────────────────────────────────\n\n/** Points one review can earn its writer through other members' Helpful votes. */\nexport const REVIEW_HELPFUL_POINTS_MAX = 10;\n/**\n * Points one member can earn from ONE other member over any\n * `CONTRIBUTION_PAIR_WINDOW_DAYS`, all kinds together, so two founders cannot\n * farm each other by trading Helpful marks.\n */\nexport const CONTRIBUTION_PAIR_POINTS_MAX = 30;\n/**\n * The window of that cap, in days (0.18.0: named; it borrowed the \"this\n * month\" score's window, a different rule that happens to share the number).\n */\nexport const CONTRIBUTION_PAIR_WINDOW_DAYS = 30;\n/** Window of the \"this month\" score and the top-helpers list. */\nexport const CONTRIBUTION_RECENT_DAYS = 30;\n/** Rows on the top-helpers list. */\nexport const CONTRIBUTION_LEADERBOARD_SIZE = 20;\n\n// ─── Staff dashboard ─────────────────────────────────────────────────────────\n\n/** The dashboard's \"Last N days\" counts (0.18.0: the one window; the backend kept two copies of 7). */\nexport const DASHBOARD_RECENT_DAYS = 7;\n\n// ─── Notifications ───────────────────────────────────────────────────────────\n\n/** Days a notification is kept. Neither Jansathi nor GymMonk ever deletes one. */\nexport const NOTIFICATION_RETENTION_DAYS = 90;\n\n// ─── Erasure ─────────────────────────────────────────────────────────────────\n\n/**\n * Days what a deleted account leaves behind, and the text of content its\n * author deleted or moderation removed, is kept before it is purged (the\n * user's ruling, 2026-10-11). The floor in India's IT Rules, 2021: a closed\n * account's registration information is kept 180 days after it closes (rule\n * 3(1)(h)), and removed content is preserved 180 days for investigations (rule\n * 3(1)(g)). The backend's `erasure-purge` job enforces it; the Privacy Policy\n * states it, and its test reads this number.\n */\nexport const ERASURE_RETENTION_DAYS = 180;\n/** The first words of a comment or review a notification shows. */\nexport const NOTIFICATION_EXCERPT_MAX = 140;\n"]}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * founder-schema: money as people read it (0.18.0)
3
+ *
4
+ * Every amount crosses the wire and is stored in PAISE, an integer, never a
5
+ * float of rupees. This is the one way it is written for a person: "₹3,999",
6
+ * or "₹338.14" when there are paise, Indian digit grouping. The backend's
7
+ * receipts and the web's screens and legal pages each kept a copy before.
8
+ *
9
+ * @module founder-schema/core/money
10
+ */
11
+ /** "₹3,999", or "₹338.14" when there are paise. Paise in, never a float of rupees. */
12
+ export declare function rupees(paise: number): string;
13
+ /**
14
+ * What is LEFT TO REFUND of a payment, in paise (0.18.0): what was taken, less
15
+ * what refunds made in the Razorpay dashboard already gave back. THE amount a
16
+ * refund (or a retry of a failed one) returns, and the one its confirm states;
17
+ * never zeroed by a credit note, which a failed refund already carries.
18
+ */
19
+ export declare function refundLeftPaise(payment: {
20
+ paid: number;
21
+ refunded: number;
22
+ }): number;
23
+ /**
24
+ * What Founder Circle KEEPS of a payment, in paise (0.18.0): what is left to
25
+ * refund, and nothing once it was refunded through Founder Circle (a credit
26
+ * note). The Overview's revenue; NOT a refund's amount (`refundLeftPaise`).
27
+ */
28
+ export declare function keptPaise(payment: {
29
+ paid: number;
30
+ refunded: number;
31
+ creditNoted: boolean;
32
+ }): number;
33
+ //# sourceMappingURL=money.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../src/core/money.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,sFAAsF;AACtF,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM5C;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEnF;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB,GAAG,MAAM,CAET"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * founder-schema: money as people read it (0.18.0)
3
+ *
4
+ * Every amount crosses the wire and is stored in PAISE, an integer, never a
5
+ * float of rupees. This is the one way it is written for a person: "₹3,999",
6
+ * or "₹338.14" when there are paise, Indian digit grouping. The backend's
7
+ * receipts and the web's screens and legal pages each kept a copy before.
8
+ *
9
+ * @module founder-schema/core/money
10
+ */
11
+ /** "₹3,999", or "₹338.14" when there are paise. Paise in, never a float of rupees. */
12
+ export function rupees(paise) {
13
+ const whole = paise % 100 === 0;
14
+ return `₹${(paise / 100).toLocaleString('en-IN', {
15
+ minimumFractionDigits: whole ? 0 : 2,
16
+ maximumFractionDigits: 2,
17
+ })}`;
18
+ }
19
+ /**
20
+ * What is LEFT TO REFUND of a payment, in paise (0.18.0): what was taken, less
21
+ * what refunds made in the Razorpay dashboard already gave back. THE amount a
22
+ * refund (or a retry of a failed one) returns, and the one its confirm states;
23
+ * never zeroed by a credit note, which a failed refund already carries.
24
+ */
25
+ export function refundLeftPaise(payment) {
26
+ return payment.paid - payment.refunded;
27
+ }
28
+ /**
29
+ * What Founder Circle KEEPS of a payment, in paise (0.18.0): what is left to
30
+ * refund, and nothing once it was refunded through Founder Circle (a credit
31
+ * note). The Overview's revenue; NOT a refund's amount (`refundLeftPaise`).
32
+ */
33
+ export function keptPaise(payment) {
34
+ return payment.creditNoted ? 0 : refundLeftPaise(payment);
35
+ }
36
+ //# sourceMappingURL=money.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"money.js","sourceRoot":"","sources":["../../src/core/money.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,sFAAsF;AACtF,MAAM,UAAU,MAAM,CAAC,KAAa;IAClC,MAAM,KAAK,GAAG,KAAK,GAAG,GAAG,KAAK,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE;QAC/C,qBAAqB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,qBAAqB,EAAE,CAAC;KACzB,CAAC,EAAE,CAAC;AACP,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAA2C;IACzE,OAAO,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC;AACzC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,OAIzB;IACC,OAAO,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["/**\n * founder-schema: money as people read it (0.18.0)\n *\n * Every amount crosses the wire and is stored in PAISE, an integer, never a\n * float of rupees. This is the one way it is written for a person: \"₹3,999\",\n * or \"₹338.14\" when there are paise, Indian digit grouping. The backend's\n * receipts and the web's screens and legal pages each kept a copy before.\n *\n * @module founder-schema/core/money\n */\n\n/** \"₹3,999\", or \"₹338.14\" when there are paise. Paise in, never a float of rupees. */\nexport function rupees(paise: number): string {\n const whole = paise % 100 === 0;\n return `₹${(paise / 100).toLocaleString('en-IN', {\n minimumFractionDigits: whole ? 0 : 2,\n maximumFractionDigits: 2,\n })}`;\n}\n\n/**\n * What is LEFT TO REFUND of a payment, in paise (0.18.0): what was taken, less\n * what refunds made in the Razorpay dashboard already gave back. THE amount a\n * refund (or a retry of a failed one) returns, and the one its confirm states;\n * never zeroed by a credit note, which a failed refund already carries.\n */\nexport function refundLeftPaise(payment: { paid: number; refunded: number }): number {\n return payment.paid - payment.refunded;\n}\n\n/**\n * What Founder Circle KEEPS of a payment, in paise (0.18.0): what is left to\n * refund, and nothing once it was refunded through Founder Circle (a credit\n * note). The Overview's revenue; NOT a refund's amount (`refundLeftPaise`).\n */\nexport function keptPaise(payment: {\n paid: number;\n refunded: number;\n creditNoted: boolean;\n}): number {\n return payment.creditNoted ? 0 : refundLeftPaise(payment);\n}\n"]}
@@ -110,7 +110,6 @@ export declare const apiErrorSchema: z.ZodObject<{
110
110
  COUPON_ALREADY_USED: "COUPON_ALREADY_USED";
111
111
  COUPON_CODE_TAKEN: "COUPON_CODE_TAKEN";
112
112
  USERNAME_TAKEN: "USERNAME_TAKEN";
113
- COUPON_FOUNDING_EXISTS: "COUPON_FOUNDING_EXISTS";
114
113
  COUPON_FOUNDING_RETIRED: "COUPON_FOUNDING_RETIRED";
115
114
  PLAN_UPGRADE_INSTEAD: "PLAN_UPGRADE_INSTEAD";
116
115
  PLAN_NOTHING_TO_UPGRADE: "PLAN_NOTHING_TO_UPGRADE";
@@ -118,7 +117,6 @@ export declare const apiErrorSchema: z.ZodObject<{
118
117
  PLAN_CHANGED: "PLAN_CHANGED";
119
118
  PAYMENTS_UNAVAILABLE: "PAYMENTS_UNAVAILABLE";
120
119
  PAYMENT_NOT_VERIFIED: "PAYMENT_NOT_VERIFIED";
121
- ORDER_EXPIRED: "ORDER_EXPIRED";
122
120
  REFUND_WINDOW_CLOSED: "REFUND_WINDOW_CLOSED";
123
121
  PAYMENT_NOT_REFUNDABLE: "PAYMENT_NOT_REFUNDABLE";
124
122
  REFUND_FAILED: "REFUND_FAILED";
@@ -132,6 +130,8 @@ export declare const apiErrorSchema: z.ZodObject<{
132
130
  COMMUNITY_MEMBER_BANNED: "COMMUNITY_MEMBER_BANNED";
133
131
  COMMUNITY_INVITE_NOT_NEEDED: "COMMUNITY_INVITE_NOT_NEEDED";
134
132
  COMMUNITY_LAST_ADMIN: "COMMUNITY_LAST_ADMIN";
133
+ COMMUNITY_NOT_ON_YOURSELF: "COMMUNITY_NOT_ON_YOURSELF";
134
+ HIDDEN_BY_STAFF: "HIDDEN_BY_STAFF";
135
135
  COMMUNITY_ARCHIVED: "COMMUNITY_ARCHIVED";
136
136
  COMMUNITY_EXPOSURE_UNCONFIRMED: "COMMUNITY_EXPOSURE_UNCONFIRMED";
137
137
  COMMUNITY_PINS_FULL: "COMMUNITY_PINS_FULL";
@@ -154,6 +154,7 @@ export declare const apiErrorSchema: z.ZodObject<{
154
154
  CANNOT_CHANGE_OWN_CAPABILITIES: "CANNOT_CHANGE_OWN_CAPABILITIES";
155
155
  CAPABILITY_NOT_GRANTABLE: "CAPABILITY_NOT_GRANTABLE";
156
156
  TICKET_FULL: "TICKET_FULL";
157
+ TICKET_MEMBER_ONLY: "TICKET_MEMBER_ONLY";
157
158
  SAVED_REPLIES_FULL: "SAVED_REPLIES_FULL";
158
159
  NOT_LAUNCHED: "NOT_LAUNCHED";
159
160
  WAITLIST_CLOSED: "WAITLIST_CLOSED";
@@ -258,7 +259,6 @@ export declare const errorResponseSchema: z.ZodObject<{
258
259
  COUPON_ALREADY_USED: "COUPON_ALREADY_USED";
259
260
  COUPON_CODE_TAKEN: "COUPON_CODE_TAKEN";
260
261
  USERNAME_TAKEN: "USERNAME_TAKEN";
261
- COUPON_FOUNDING_EXISTS: "COUPON_FOUNDING_EXISTS";
262
262
  COUPON_FOUNDING_RETIRED: "COUPON_FOUNDING_RETIRED";
263
263
  PLAN_UPGRADE_INSTEAD: "PLAN_UPGRADE_INSTEAD";
264
264
  PLAN_NOTHING_TO_UPGRADE: "PLAN_NOTHING_TO_UPGRADE";
@@ -266,7 +266,6 @@ export declare const errorResponseSchema: z.ZodObject<{
266
266
  PLAN_CHANGED: "PLAN_CHANGED";
267
267
  PAYMENTS_UNAVAILABLE: "PAYMENTS_UNAVAILABLE";
268
268
  PAYMENT_NOT_VERIFIED: "PAYMENT_NOT_VERIFIED";
269
- ORDER_EXPIRED: "ORDER_EXPIRED";
270
269
  REFUND_WINDOW_CLOSED: "REFUND_WINDOW_CLOSED";
271
270
  PAYMENT_NOT_REFUNDABLE: "PAYMENT_NOT_REFUNDABLE";
272
271
  REFUND_FAILED: "REFUND_FAILED";
@@ -280,6 +279,8 @@ export declare const errorResponseSchema: z.ZodObject<{
280
279
  COMMUNITY_MEMBER_BANNED: "COMMUNITY_MEMBER_BANNED";
281
280
  COMMUNITY_INVITE_NOT_NEEDED: "COMMUNITY_INVITE_NOT_NEEDED";
282
281
  COMMUNITY_LAST_ADMIN: "COMMUNITY_LAST_ADMIN";
282
+ COMMUNITY_NOT_ON_YOURSELF: "COMMUNITY_NOT_ON_YOURSELF";
283
+ HIDDEN_BY_STAFF: "HIDDEN_BY_STAFF";
283
284
  COMMUNITY_ARCHIVED: "COMMUNITY_ARCHIVED";
284
285
  COMMUNITY_EXPOSURE_UNCONFIRMED: "COMMUNITY_EXPOSURE_UNCONFIRMED";
285
286
  COMMUNITY_PINS_FULL: "COMMUNITY_PINS_FULL";
@@ -302,6 +303,7 @@ export declare const errorResponseSchema: z.ZodObject<{
302
303
  CANNOT_CHANGE_OWN_CAPABILITIES: "CANNOT_CHANGE_OWN_CAPABILITIES";
303
304
  CAPABILITY_NOT_GRANTABLE: "CAPABILITY_NOT_GRANTABLE";
304
305
  TICKET_FULL: "TICKET_FULL";
306
+ TICKET_MEMBER_ONLY: "TICKET_MEMBER_ONLY";
305
307
  SAVED_REPLIES_FULL: "SAVED_REPLIES_FULL";
306
308
  NOT_LAUNCHED: "NOT_LAUNCHED";
307
309
  WAITLIST_CLOSED: "WAITLIST_CLOSED";
@@ -369,4 +371,12 @@ export declare const idResponseSchema: z.ZodObject<{
369
371
  id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
370
372
  }, z.core.$strip>;
371
373
  export type IdResponse = z.infer<typeof idResponseSchema>;
374
+ /**
375
+ * What a client passes to build a list query (0.18.0): the query schema's
376
+ * PARSED shape, every field optional. Not `z.input`: a query field is read
377
+ * through `z.preprocess` (a repeated key, an emptied control), so its input
378
+ * type is `unknown` and typing by it would lose every enum check. A client
379
+ * sends values of the parsed type; the server reads them back with the schema.
380
+ */
381
+ export type QueryArgs<S extends z.ZodType> = Partial<z.output<S>>;
372
382
  //# sourceMappingURL=responses.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../src/core/responses.ts"],"names":[],"mappings":"AAAA;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,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC","sourcesContent":["/**\n * founder-schema — API response envelope\n *\n * Every Founder Circle endpoint answers in this shape. The clients read the\n * failure reason at `error.message`, so a handler must never return a bare\n * string body.\n *\n * @module founder-schema/core/responses\n */\n\nimport { z } from 'zod';\nimport { objectIdSchema, productListingRequirementSchema } from './common.js';\nimport { apiErrorCodeSchema } from './errors.js';\nimport { validationIssueSchema } from './validation.js';\n\n/**\n * What an error carries beyond its code, each field named by the code that\n * sends it. Declared here, not loosely typed, because a client parses errors\n * with this schema and Zod drops a key the schema does not name.\n *\n * `issues` is EVERY problem of a 400, each with its path, built on the server\n * by `toValidationIssues`. Until 0.2.0 this was typed as a record of strings\n * that nothing ever sent, while the real 400s carried only the first issue's\n * message, so a client could not tell which field to mark.\n */\nexport const apiErrorDetailsSchema = z.object({\n issues: z.array(validationIssueSchema).optional(),\n /** `MPIN_INCORRECT`: wrong tries left before the MPIN locks. */\n attemptsLeft: z.number().int().min(0).optional(),\n /** `MPIN_LOCKED`: when the MPIN can be tried again. */\n lockedUntil: z.iso.datetime().optional(),\n /** `PRODUCT_NOT_LISTABLE`: what the product lacks to be (or stay) listed. */\n missing: z.array(productListingRequirementSchema).optional(),\n /** `COMMUNITY_ANNOUNCE_TOO_SOON` (0.9.0): when notifying every member is allowed again. */\n nextAt: z.iso.datetime().optional(),\n /**\n * `COMMUNITY_LAST_ADMIN` on an account deletion (0.9.0): the communities the\n * member is the only admin of, to hand over first.\n */\n communities: z.array(z.object({ id: objectIdSchema, name: z.string() })).optional(),\n /** `PRODUCT_LIMIT_REACHED` (0.12.0): the live products their plan keeps. */\n limit: z.number().int().min(0).optional(),\n /** `MESSAGE_ALLOWANCE_UNCONFIRMED` (0.12.0): new people left this month, this one included. */\n left: z.number().int().min(0).optional(),\n /** `MESSAGE_ALLOWANCE_EXHAUSTED` and `..._UNCONFIRMED` (0.12.0): when the month's count starts again. */\n resetsAt: z.iso.datetime().optional(),\n});\nexport type ApiErrorDetails = z.infer<typeof apiErrorDetailsSchema>;\n\n/**\n * `code` is one of `API_ERROR_CODE_VALUES`, and it is what a client acts on.\n * `message` is English, for logs and for a client that predates the code.\n */\nexport const apiErrorSchema = z.object({\n code: apiErrorCodeSchema,\n message: z.string(),\n details: apiErrorDetailsSchema.optional(),\n});\nexport type ApiError = z.infer<typeof apiErrorSchema>;\n\n/** Success envelope. `T` is the payload schema. */\nexport const successResponseSchema = <T extends z.ZodType>(data: T) =>\n z.object({\n success: z.literal(true),\n data,\n message: z.string().optional(),\n });\n\nexport const errorResponseSchema = z.object({\n success: z.literal(false),\n error: apiErrorSchema,\n});\nexport type ErrorResponse = z.infer<typeof errorResponseSchema>;\n\n/**\n * Cursor-paginated list envelope.\n *\n * `nextCursor` is REQUIRED and is `null` at the end of the list. Omitting the\n * key is not the same thing and does not validate: a handler must decide\n * whether there is another page and say so, because \"the key is missing\" and\n * \"there are no more results\" are indistinguishable to a client that has to\n * choose between showing a Load more button and not showing one.\n *\n * An earlier version of this comment said absence and null were equivalent.\n * They never were; the schema has always required the key. Corrected\n * 2026-09-21, and pinned by a test.\n */\nexport const paginatedSchema = <T extends z.ZodType>(item: T) =>\n z.object({\n items: z.array(item),\n nextCursor: z.string().nullable(),\n });\n\n/**\n * What a create, an edit or a delete answers: the id of the thing it touched.\n * A client that needs the whole item reads it, so a write never ships a second\n * projection of it that could drift from the read path's.\n */\nexport const idResponseSchema = z.object({ id: objectIdSchema });\nexport type IdResponse = z.infer<typeof idResponseSchema>;\n"]}
1
+ {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/core/responses.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,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C;IACrC,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,qBAAqB,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAGH,mDAAmD;AACnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAsB,IAAO,EAAE,EAAE,CACpE,CAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACxB,IAAI;IACJ,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACzB,KAAK,EAAE,cAAc;CACtB,CAAC,CAAC;AAGH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAsB,IAAO,EAAE,EAAE,CAC9D,CAAC,CAAC,MAAM,CAAC;IACP,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;IACpB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAEL;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC","sourcesContent":["/**\n * founder-schema — API response envelope\n *\n * Every Founder Circle endpoint answers in this shape. The clients read the\n * failure reason at `error.message`, so a handler must never return a bare\n * string body.\n *\n * @module founder-schema/core/responses\n */\n\nimport { z } from 'zod';\nimport { objectIdSchema, productListingRequirementSchema } from './common.js';\nimport { apiErrorCodeSchema } from './errors.js';\nimport { validationIssueSchema } from './validation.js';\n\n/**\n * What an error carries beyond its code, each field named by the code that\n * sends it. Declared here, not loosely typed, because a client parses errors\n * with this schema and Zod drops a key the schema does not name.\n *\n * `issues` is EVERY problem of a 400, each with its path, built on the server\n * by `toValidationIssues`. Until 0.2.0 this was typed as a record of strings\n * that nothing ever sent, while the real 400s carried only the first issue's\n * message, so a client could not tell which field to mark.\n */\nexport const apiErrorDetailsSchema = z.object({\n issues: z.array(validationIssueSchema).optional(),\n /** `MPIN_INCORRECT`: wrong tries left before the MPIN locks. */\n attemptsLeft: z.number().int().min(0).optional(),\n /** `MPIN_LOCKED`: when the MPIN can be tried again. */\n lockedUntil: z.iso.datetime().optional(),\n /** `PRODUCT_NOT_LISTABLE`: what the product lacks to be (or stay) listed. */\n missing: z.array(productListingRequirementSchema).optional(),\n /** `COMMUNITY_ANNOUNCE_TOO_SOON` (0.9.0): when notifying every member is allowed again. */\n nextAt: z.iso.datetime().optional(),\n /**\n * `COMMUNITY_LAST_ADMIN` on an account deletion (0.9.0): the communities the\n * member is the only admin of, to hand over first.\n */\n communities: z.array(z.object({ id: objectIdSchema, name: z.string() })).optional(),\n /** `PRODUCT_LIMIT_REACHED` (0.12.0): the live products their plan keeps. */\n limit: z.number().int().min(0).optional(),\n /** `MESSAGE_ALLOWANCE_UNCONFIRMED` (0.12.0): new people left this month, this one included. */\n left: z.number().int().min(0).optional(),\n /** `MESSAGE_ALLOWANCE_EXHAUSTED` and `..._UNCONFIRMED` (0.12.0): when the month's count starts again. */\n resetsAt: z.iso.datetime().optional(),\n});\nexport type ApiErrorDetails = z.infer<typeof apiErrorDetailsSchema>;\n\n/**\n * `code` is one of `API_ERROR_CODE_VALUES`, and it is what a client acts on.\n * `message` is English, for logs and for a client that predates the code.\n */\nexport const apiErrorSchema = z.object({\n code: apiErrorCodeSchema,\n message: z.string(),\n details: apiErrorDetailsSchema.optional(),\n});\nexport type ApiError = z.infer<typeof apiErrorSchema>;\n\n/** Success envelope. `T` is the payload schema. */\nexport const successResponseSchema = <T extends z.ZodType>(data: T) =>\n z.object({\n success: z.literal(true),\n data,\n message: z.string().optional(),\n });\n\nexport const errorResponseSchema = z.object({\n success: z.literal(false),\n error: apiErrorSchema,\n});\nexport type ErrorResponse = z.infer<typeof errorResponseSchema>;\n\n/**\n * Cursor-paginated list envelope.\n *\n * `nextCursor` is REQUIRED and is `null` at the end of the list. Omitting the\n * key is not the same thing and does not validate: a handler must decide\n * whether there is another page and say so, because \"the key is missing\" and\n * \"there are no more results\" are indistinguishable to a client that has to\n * choose between showing a Load more button and not showing one.\n *\n * An earlier version of this comment said absence and null were equivalent.\n * They never were; the schema has always required the key. Corrected\n * 2026-09-21, and pinned by a test.\n */\nexport const paginatedSchema = <T extends z.ZodType>(item: T) =>\n z.object({\n items: z.array(item),\n nextCursor: z.string().nullable(),\n });\n\n/**\n * What a create, an edit or a delete answers: the id of the thing it touched.\n * A client that needs the whole item reads it, so a write never ships a second\n * projection of it that could drift from the read path's.\n */\nexport const idResponseSchema = z.object({ id: objectIdSchema });\nexport type IdResponse = z.infer<typeof idResponseSchema>;\n\n/**\n * What a client passes to build a list query (0.18.0): the query schema's\n * PARSED shape, every field optional. Not `z.input`: a query field is read\n * through `z.preprocess` (a repeated key, an emptied control), so its input\n * type is `unknown` and typing by it would lose every enum check. A client\n * sends values of the parsed type; the server reads them back with the schema.\n */\nexport type QueryArgs<S extends z.ZodType> = Partial<z.output<S>>;\n"]}
@@ -55,8 +55,12 @@ export declare const VALIDATION_MESSAGE: {
55
55
  readonly dobTooOld: "dobTooOld";
56
56
  /** A founding year after this year. */
57
57
  readonly foundedYearFuture: "foundedYearFuture";
58
- /** An upload key that is not one this product mints. */
59
- readonly uploadKeyInvalid: "uploadKeyInvalid";
58
+ /** A request body over the server's size limit (0.18.0: it answered in English). On `body`. */
59
+ readonly bodyTooLarge: "bodyTooLarge";
60
+ /** A request body that is not valid JSON (0.18.0: it answered in English). On `body`. */
61
+ readonly bodyNotJson: "bodyNotJson";
62
+ /** The same option twice in one vote (0.18.0). */
63
+ readonly pollVoteDuplicate: "pollVoteDuplicate";
60
64
  /** The same uploaded image attached twice to one post. */
61
65
  readonly mediaDuplicate: "mediaDuplicate";
62
66
  /** A post with neither text nor media. */
@@ -113,6 +117,32 @@ export declare const VALIDATION_MESSAGE: {
113
117
  readonly couponTargetsDuplicate: "couponTargetsDuplicate";
114
118
  /** A paid purchase without the buyer's state: the invoice's place of supply (0.12.0). */
115
119
  readonly billingStateRequired: "billingStateRequired";
120
+ /**
121
+ * The guidelines not agreed to at all: the tick box left empty (0.17.0).
122
+ * Distinct from `guidelinesOutdated`, which is agreement to an OLDER text;
123
+ * "the guidelines have changed" is the wrong thing to tell someone who has
124
+ * not ticked the box yet.
125
+ */
126
+ readonly guidelinesRequired: "guidelinesRequired";
127
+ /**
128
+ * The photo cannot be used (0.17.0): it is not the member's processed avatar
129
+ * upload any more, most often because it expired before it was saved. Sent
130
+ * by the server on the photo field with `UPLOAD_NOT_ATTACHABLE`.
131
+ */
132
+ readonly photoUnavailable: "photoUnavailable";
133
+ /** A business type or registration with no business to describe (0.17.0). */
134
+ readonly ventureRequired: "ventureRequired";
135
+ /** A state that is not one of India's states and union territories (0.17.0). */
136
+ readonly stateUnknown: "stateUnknown";
137
+ /** The same goal twice in one list (0.17.0). */
138
+ readonly goalsDuplicate: "goalsDuplicate";
139
+ /** The same skill twice in one list (0.17.0). */
140
+ readonly skillsDuplicate: "skillsDuplicate";
141
+ /**
142
+ * A location with no state (0.17.0): India's places are chosen state first.
143
+ * Its own key, so the refusal does not carry all 36 names as its message.
144
+ */
145
+ readonly stateRequired: "stateRequired";
116
146
  };
117
147
  export type ValidationMessageKey = (typeof VALIDATION_MESSAGE)[keyof typeof VALIDATION_MESSAGE];
118
148
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/core/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;IAC7B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D;;IAEhD,iDAAiD;;IAEjD;;;OAGG;;CAEK,CAAC;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAEhG;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,sCAAuC,CAAC;AACxE,eAAO,MAAM,iBAAiB;;;;EAA8B,CAAC;AAC7D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;iBAkBhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,6EAA6E;AAC7E,UAAU,YAAY;IACpB,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAKD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE;IAAE,MAAM,EAAE,SAAS,YAAY,EAAE,CAAA;CAAE,EAC1C,QAAQ,CAAC,EAAE,WAAW,GACrB,eAAe,EAAE,CAkBnB"}
@@ -55,8 +55,12 @@ export const VALIDATION_MESSAGE = {
55
55
  dobTooOld: 'dobTooOld',
56
56
  /** A founding year after this year. */
57
57
  foundedYearFuture: 'foundedYearFuture',
58
- /** An upload key that is not one this product mints. */
59
- uploadKeyInvalid: 'uploadKeyInvalid',
58
+ /** A request body over the server's size limit (0.18.0: it answered in English). On `body`. */
59
+ bodyTooLarge: 'bodyTooLarge',
60
+ /** A request body that is not valid JSON (0.18.0: it answered in English). On `body`. */
61
+ bodyNotJson: 'bodyNotJson',
62
+ /** The same option twice in one vote (0.18.0). */
63
+ pollVoteDuplicate: 'pollVoteDuplicate',
60
64
  /** The same uploaded image attached twice to one post. */
61
65
  mediaDuplicate: 'mediaDuplicate',
62
66
  /** A post with neither text nor media. */
@@ -113,6 +117,32 @@ export const VALIDATION_MESSAGE = {
113
117
  couponTargetsDuplicate: 'couponTargetsDuplicate',
114
118
  /** A paid purchase without the buyer's state: the invoice's place of supply (0.12.0). */
115
119
  billingStateRequired: 'billingStateRequired',
120
+ /**
121
+ * The guidelines not agreed to at all: the tick box left empty (0.17.0).
122
+ * Distinct from `guidelinesOutdated`, which is agreement to an OLDER text;
123
+ * "the guidelines have changed" is the wrong thing to tell someone who has
124
+ * not ticked the box yet.
125
+ */
126
+ guidelinesRequired: 'guidelinesRequired',
127
+ /**
128
+ * The photo cannot be used (0.17.0): it is not the member's processed avatar
129
+ * upload any more, most often because it expired before it was saved. Sent
130
+ * by the server on the photo field with `UPLOAD_NOT_ATTACHABLE`.
131
+ */
132
+ photoUnavailable: 'photoUnavailable',
133
+ /** A business type or registration with no business to describe (0.17.0). */
134
+ ventureRequired: 'ventureRequired',
135
+ /** A state that is not one of India's states and union territories (0.17.0). */
136
+ stateUnknown: 'stateUnknown',
137
+ /** The same goal twice in one list (0.17.0). */
138
+ goalsDuplicate: 'goalsDuplicate',
139
+ /** The same skill twice in one list (0.17.0). */
140
+ skillsDuplicate: 'skillsDuplicate',
141
+ /**
142
+ * A location with no state (0.17.0): India's places are chosen state first.
143
+ * Its own key, so the refusal does not carry all 36 names as its message.
144
+ */
145
+ stateRequired: 'stateRequired',
116
146
  };
117
147
  /**
118
148
  * Which part of the request an issue is about.