founder-schema 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -99,6 +99,57 @@ instance; this package must not bring its own.
99
99
 
100
100
  ---
101
101
 
102
+ ## Breaking in 0.15.0: the launch waitlist (2026-10-16)
103
+
104
+ Until the launch instant `FC_LAUNCH_AT` (a server-only env on BOTH the backend
105
+ and the web; AWS main only: Tuesday 20 October 2026, 12:00 noon IST), joining is
106
+ signing in, and the first `FOUNDING_PLACES` places get the membership free
107
+ (0.14.0). Unset means launched, so nothing changes where it is not set. Design:
108
+ `founder-circle-backend/docs/waitlist.md`. No export is removed.
109
+
110
+ - **New:** `src/domains/waitlist/waitlist.ts`, in route order:
111
+ `waitlistStatusSchema` for `GET /waitlist` (public: `waiting`, `launchAt`,
112
+ `foundingPlaces`, `foundingPlacesLeft`); `myWaitlistSchema` for
113
+ `GET /waitlist/me` (`place` or null, `canJoin`, `refusal`: `closed` |
114
+ `staff` | `place_used` or null); `waitlistPlaceSchema` for
115
+ `POST /waitlist/join` (`place`, `joinedAt`, `founding`).
116
+ - **New error codes, so a client's exhaustive word map must add them:**
117
+ `NOT_LAUNCHED` (403; every write but the waitlist's few, while waiting, for
118
+ everyone, staff included), `WAITLIST_CLOSED` (409; joining after the launch),
119
+ `WAITLIST_STAFF` (403; staff never take a place), `WAITLIST_PLACE_USED` (409;
120
+ one place per inbox and per sign-in, ever: addresses reaching one inbox
121
+ (`x+1@`, Gmail's dots) share one, and so does a deleted account's sign-in).
122
+ - **New:** `refundWindowEndsAt(paidAt)`: the refund window's last moment, the
123
+ end of the 7th day after the paying day in India (the server and the staff
124
+ screen share it).
125
+ - **Breaking on main while waiting:** a 0.14.0 web cannot parse `NOT_LAUNCHED`.
126
+ Deploy the backend and the web together, both on 0.15.0, with `FC_LAUNCH_AT`
127
+ ALREADY in both env files: started without it, main runs launched (fully
128
+ open) until it is set.
129
+ - **Backend, at deploy:** new collections `waitlist_entries` (unique
130
+ `waitlist_by_user`, `waitlist_by_place`) and `waitlist_counters`; run
131
+ `sync-indexes` (the dry run must say 0 differing).
132
+
133
+ ## Changes in 0.14.0: founding places come from the launch waitlist (2026-10-16)
134
+
135
+ The user's rule: the first `FOUNDING_PLACES` (100) people to join the launch
136
+ waitlist get their membership free, numbered "Founding member #N" by their
137
+ place; everyone else pays the membership once. Nothing breaks for a 0.13.0
138
+ client, and no export is removed.
139
+
140
+ - **New error code `COUPON_FOUNDING_RETIRED`** (409): staff can no longer
141
+ create a founding coupon; no code gives a founding place. Coupons stored
142
+ before keep working (AWS dev's `FIRST100`), and the coupon `founding` field
143
+ stays because they carry it.
144
+ - **Doc only:** the `founding` membership kind and `FOUNDING_PLACES` now
145
+ describe the waitlist.
146
+ - **Backend, at deploy:** `users` gains the unique partial index
147
+ `users_founding_number` (`membership.foundingNumber > 0`); run
148
+ `sync-indexes` (the boot builds a new index; the dry run must say 0
149
+ differing).
150
+
151
+ The waitlist's own contract follows in 0.15.0.
152
+
102
153
  ## Breaking in 0.13.0: the live walk on AWS dev (2026-10-13)
103
154
 
104
155
  A whole-product walk on AWS dev, with fixes in all three repos. Design notes:
@@ -27,7 +27,7 @@ import { z } from 'zod';
27
27
  * As a tuple, the way `GENDER_VALUES` is, so a consumer can iterate it (a
28
28
  * translation-coverage test does exactly that) and TypeScript keeps the union.
29
29
  */
30
- export declare const API_ERROR_CODE_VALUES: readonly ["INTERNAL_ERROR", "VALIDATION_ERROR", "NOT_FOUND", "CONFLICT", "RATE_LIMITED", "SERVICE_UNAVAILABLE", "UNAUTHORIZED", "INVALID_TOKEN", "TOKEN_EXPIRED", "SESSION_INVALIDATED", "FORBIDDEN", "ONBOARDING_INCOMPLETE", "ALREADY_ONBOARDED", "UNDER_AGE", "UPLOAD_NOT_ATTACHABLE", "UPLOAD_TOO_LARGE", "UPLOAD_WRONG_TYPE", "UPLOAD_NOT_RECEIVED", "UPLOAD_PROCESSING", "UPLOAD_UNREADABLE", "UPLOAD_TOO_MANY_PIXELS", "UPLOAD_LIMIT_REACHED", "UPLOAD_IN_USE", "EDIT_WINDOW_CLOSED", "POLL_NOT_EDITABLE", "POLL_CLOSED", "POLL_CHOICE_INVALID", "REPLY_TOO_DEEP", "CANNOT_REPORT_OWN", "FEEDBACK_NOT_MARKABLE", "CANNOT_REPOST_OWN", "CANNOT_REPOST_A_REPOST", "ALREADY_REPOSTED", "PRODUCT_LIMIT_REACHED", "PRODUCT_NOT_LISTABLE", "PRODUCT_ARCHIVED", "PRODUCT_NOT_YOURS", "PRODUCT_ALREADY_MEMBER", "PRODUCT_MEMBER_NOT_INVITABLE", "PRODUCT_NOT_ON_TEAM", "PRODUCT_OWNER_MUST_TRANSFER", "PRODUCT_OWN_TEAM", "TESTER_NOT_ELIGIBLE", "PRODUCT_PAUSED", "MEMBERSHIP_REQUIRED", "PLAN_REQUIRED", "ALREADY_MEMBER", "MEMBERSHIP_NOT_REVOCABLE", "COUPON_INVALID", "COUPON_NOT_APPLICABLE", "COUPON_EXHAUSTED", "COUPON_ALREADY_USED", "COUPON_CODE_TAKEN", "USERNAME_TAKEN", "COUPON_FOUNDING_EXISTS", "PLAN_UPGRADE_INSTEAD", "PLAN_NOTHING_TO_UPGRADE", "PLAN_TERM_LIMIT", "PLAN_CHANGED", "PAYMENTS_UNAVAILABLE", "PAYMENT_NOT_VERIFIED", "ORDER_EXPIRED", "REFUND_WINDOW_CLOSED", "PAYMENT_NOT_REFUNDABLE", "REFUND_FAILED", "MESSAGE_ALLOWANCE_EXHAUSTED", "MESSAGE_ALLOWANCE_UNCONFIRMED", "MESSAGE_NOT_ACCEPTED", "COMMUNITY_JOIN_REQUIRED", "COMMUNITY_NAME_TAKEN", "COMMUNITY_ALREADY_MEMBER", "COMMUNITY_MEMBER_NOT_INVITABLE", "COMMUNITY_MEMBER_BANNED", "COMMUNITY_INVITE_NOT_NEEDED", "COMMUNITY_LAST_ADMIN", "COMMUNITY_ARCHIVED", "COMMUNITY_EXPOSURE_UNCONFIRMED", "COMMUNITY_PINS_FULL", "COMMUNITY_ANNOUNCE_TOO_SOON", "COMMUNITY_CONTENT_NOT_REPOSTABLE", "COMMUNITY_SUGGESTIONS_FULL", "COMMUNITY_SUGGESTION_DECIDED", "REVIEW_EXISTS", "REVIEW_OWN_VOTE", "MODERATION_ACTION_INVALID", "CHAT_WITH_SELF", "ACCOUNT_SUSPENDED", "ROLE_NOT_HELD", "MPIN_NOT_SET", "MPIN_ALREADY_SET", "MPIN_INCORRECT", "MPIN_LOCKED", "CANNOT_CHANGE_OWN_ROLES", "ROLE_NOT_GRANTABLE", "CANNOT_CHANGE_OWN_CAPABILITIES", "CAPABILITY_NOT_GRANTABLE", "TICKET_FULL", "SAVED_REPLIES_FULL"];
30
+ export declare const API_ERROR_CODE_VALUES: readonly ["INTERNAL_ERROR", "VALIDATION_ERROR", "NOT_FOUND", "CONFLICT", "RATE_LIMITED", "SERVICE_UNAVAILABLE", "UNAUTHORIZED", "INVALID_TOKEN", "TOKEN_EXPIRED", "SESSION_INVALIDATED", "FORBIDDEN", "ONBOARDING_INCOMPLETE", "ALREADY_ONBOARDED", "UNDER_AGE", "UPLOAD_NOT_ATTACHABLE", "UPLOAD_TOO_LARGE", "UPLOAD_WRONG_TYPE", "UPLOAD_NOT_RECEIVED", "UPLOAD_PROCESSING", "UPLOAD_UNREADABLE", "UPLOAD_TOO_MANY_PIXELS", "UPLOAD_LIMIT_REACHED", "UPLOAD_IN_USE", "EDIT_WINDOW_CLOSED", "POLL_NOT_EDITABLE", "POLL_CLOSED", "POLL_CHOICE_INVALID", "REPLY_TOO_DEEP", "CANNOT_REPORT_OWN", "FEEDBACK_NOT_MARKABLE", "CANNOT_REPOST_OWN", "CANNOT_REPOST_A_REPOST", "ALREADY_REPOSTED", "PRODUCT_LIMIT_REACHED", "PRODUCT_NOT_LISTABLE", "PRODUCT_ARCHIVED", "PRODUCT_NOT_YOURS", "PRODUCT_ALREADY_MEMBER", "PRODUCT_MEMBER_NOT_INVITABLE", "PRODUCT_NOT_ON_TEAM", "PRODUCT_OWNER_MUST_TRANSFER", "PRODUCT_OWN_TEAM", "TESTER_NOT_ELIGIBLE", "PRODUCT_PAUSED", "MEMBERSHIP_REQUIRED", "PLAN_REQUIRED", "ALREADY_MEMBER", "MEMBERSHIP_NOT_REVOCABLE", "COUPON_INVALID", "COUPON_NOT_APPLICABLE", "COUPON_EXHAUSTED", "COUPON_ALREADY_USED", "COUPON_CODE_TAKEN", "USERNAME_TAKEN", "COUPON_FOUNDING_EXISTS", "COUPON_FOUNDING_RETIRED", "PLAN_UPGRADE_INSTEAD", "PLAN_NOTHING_TO_UPGRADE", "PLAN_TERM_LIMIT", "PLAN_CHANGED", "PAYMENTS_UNAVAILABLE", "PAYMENT_NOT_VERIFIED", "ORDER_EXPIRED", "REFUND_WINDOW_CLOSED", "PAYMENT_NOT_REFUNDABLE", "REFUND_FAILED", "MESSAGE_ALLOWANCE_EXHAUSTED", "MESSAGE_ALLOWANCE_UNCONFIRMED", "MESSAGE_NOT_ACCEPTED", "COMMUNITY_JOIN_REQUIRED", "COMMUNITY_NAME_TAKEN", "COMMUNITY_ALREADY_MEMBER", "COMMUNITY_MEMBER_NOT_INVITABLE", "COMMUNITY_MEMBER_BANNED", "COMMUNITY_INVITE_NOT_NEEDED", "COMMUNITY_LAST_ADMIN", "COMMUNITY_ARCHIVED", "COMMUNITY_EXPOSURE_UNCONFIRMED", "COMMUNITY_PINS_FULL", "COMMUNITY_ANNOUNCE_TOO_SOON", "COMMUNITY_CONTENT_NOT_REPOSTABLE", "COMMUNITY_SUGGESTIONS_FULL", "COMMUNITY_SUGGESTION_DECIDED", "REVIEW_EXISTS", "REVIEW_OWN_VOTE", "MODERATION_ACTION_INVALID", "CHAT_WITH_SELF", "ACCOUNT_SUSPENDED", "ROLE_NOT_HELD", "MPIN_NOT_SET", "MPIN_ALREADY_SET", "MPIN_INCORRECT", "MPIN_LOCKED", "CANNOT_CHANGE_OWN_ROLES", "ROLE_NOT_GRANTABLE", "CANNOT_CHANGE_OWN_CAPABILITIES", "CAPABILITY_NOT_GRANTABLE", "TICKET_FULL", "SAVED_REPLIES_FULL", "NOT_LAUNCHED", "WAITLIST_CLOSED", "WAITLIST_STAFF", "WAITLIST_PLACE_USED"];
31
31
  export declare const apiErrorCodeSchema: z.ZodEnum<{
32
32
  INTERNAL_ERROR: "INTERNAL_ERROR";
33
33
  VALIDATION_ERROR: "VALIDATION_ERROR";
@@ -84,6 +84,7 @@ export declare const apiErrorCodeSchema: z.ZodEnum<{
84
84
  COUPON_CODE_TAKEN: "COUPON_CODE_TAKEN";
85
85
  USERNAME_TAKEN: "USERNAME_TAKEN";
86
86
  COUPON_FOUNDING_EXISTS: "COUPON_FOUNDING_EXISTS";
87
+ COUPON_FOUNDING_RETIRED: "COUPON_FOUNDING_RETIRED";
87
88
  PLAN_UPGRADE_INSTEAD: "PLAN_UPGRADE_INSTEAD";
88
89
  PLAN_NOTHING_TO_UPGRADE: "PLAN_NOTHING_TO_UPGRADE";
89
90
  PLAN_TERM_LIMIT: "PLAN_TERM_LIMIT";
@@ -127,6 +128,10 @@ export declare const apiErrorCodeSchema: z.ZodEnum<{
127
128
  CAPABILITY_NOT_GRANTABLE: "CAPABILITY_NOT_GRANTABLE";
128
129
  TICKET_FULL: "TICKET_FULL";
129
130
  SAVED_REPLIES_FULL: "SAVED_REPLIES_FULL";
131
+ NOT_LAUNCHED: "NOT_LAUNCHED";
132
+ WAITLIST_CLOSED: "WAITLIST_CLOSED";
133
+ WAITLIST_STAFF: "WAITLIST_STAFF";
134
+ WAITLIST_PLACE_USED: "WAITLIST_PLACE_USED";
130
135
  }>;
131
136
  export type ApiErrorCode = z.infer<typeof apiErrorCodeSchema>;
132
137
  /** The same codes by name: `API_ERROR_CODE.POLL_CLOSED`. */
@@ -186,6 +191,7 @@ export declare const API_ERROR_CODE: {
186
191
  COUPON_CODE_TAKEN: "COUPON_CODE_TAKEN";
187
192
  USERNAME_TAKEN: "USERNAME_TAKEN";
188
193
  COUPON_FOUNDING_EXISTS: "COUPON_FOUNDING_EXISTS";
194
+ COUPON_FOUNDING_RETIRED: "COUPON_FOUNDING_RETIRED";
189
195
  PLAN_UPGRADE_INSTEAD: "PLAN_UPGRADE_INSTEAD";
190
196
  PLAN_NOTHING_TO_UPGRADE: "PLAN_NOTHING_TO_UPGRADE";
191
197
  PLAN_TERM_LIMIT: "PLAN_TERM_LIMIT";
@@ -229,5 +235,9 @@ export declare const API_ERROR_CODE: {
229
235
  CAPABILITY_NOT_GRANTABLE: "CAPABILITY_NOT_GRANTABLE";
230
236
  TICKET_FULL: "TICKET_FULL";
231
237
  SAVED_REPLIES_FULL: "SAVED_REPLIES_FULL";
238
+ NOT_LAUNCHED: "NOT_LAUNCHED";
239
+ WAITLIST_CLOSED: "WAITLIST_CLOSED";
240
+ WAITLIST_STAFF: "WAITLIST_STAFF";
241
+ WAITLIST_PLACE_USED: "WAITLIST_PLACE_USED";
232
242
  };
233
243
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,uqEAgUxB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAgC,CAAC;AAChE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,4DAA4D;AAC5D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA0B,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,8wEA0VxB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAgC,CAAC;AAChE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,4DAA4D;AAC5D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA0B,CAAC"}
@@ -196,6 +196,12 @@ export const API_ERROR_CODE_VALUES = [
196
196
  * up on the one founding coupon, so a second would hand out #1 again. 409.
197
197
  */
198
198
  'COUPON_FOUNDING_EXISTS',
199
+ /**
200
+ * Staff creating ANY founding coupon (0.14.0): founding places come from the
201
+ * launch waitlist alone (the user, 2026-10-16), so no code may hand one out.
202
+ * 409.
203
+ */
204
+ 'COUPON_FOUNDING_RETIRED',
199
205
  /** Buying Business while on Premium: that is an upgrade, priced as the difference. 409. */
200
206
  'PLAN_UPGRADE_INSTEAD',
201
207
  /** Asking to upgrade with no Premium time to turn into Business. 409. */
@@ -334,6 +340,25 @@ export const API_ERROR_CODE_VALUES = [
334
340
  'TICKET_FULL',
335
341
  /** The team keeps `SAVED_REPLIES_MAX` saved replies. Delete one first. */
336
342
  'SAVED_REPLIES_FULL',
343
+ // ── Waitlist (0.15.0) ──
344
+ /**
345
+ * Founder Circle has not opened yet (`FC_LAUNCH_AT` is still ahead). Until
346
+ * it does, only joining the waitlist, onboarding and your profile, uploads
347
+ * for it and deleting your account work, for everyone, staff included. 403.
348
+ */
349
+ 'NOT_LAUNCHED',
350
+ /** Joining the waitlist after the launch: it closed then (the user, 2026-10-16). 409. */
351
+ 'WAITLIST_CLOSED',
352
+ /** A staff account joining the waitlist: staff never take a place (the user, 2026-10-16). 403. */
353
+ 'WAITLIST_STAFF',
354
+ /**
355
+ * Joining when this email's inbox or this sign-in already had a place: one
356
+ * place per inbox (`x+1@`, `x+2@`, Gmail's dots are one inbox) and per
357
+ * sign-in, ever, deleted accounts included, so neither new addresses nor
358
+ * deleting and joining again take the free places one by one (the user,
359
+ * 2026-10-16; the security review, 2026-10-18). 409.
360
+ */
361
+ 'WAITLIST_PLACE_USED',
337
362
  ];
338
363
  export const apiErrorCodeSchema = z.enum(API_ERROR_CODE_VALUES);
339
364
  /** The same codes by name: `API_ERROR_CODE.POLL_CLOSED`. */
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,iBAAiB;IACjB,gFAAgF;IAChF,gBAAgB;IAChB,yEAAyE;IACzE,kBAAkB;IAClB,2EAA2E;IAC3E,WAAW;IACX,wEAAwE;IACxE,UAAU;IACV,uEAAuE;IACvE,cAAc;IACd,2EAA2E;IAC3E,qBAAqB;IAErB,oBAAoB;IACpB,4BAA4B;IAC5B,cAAc;IACd,sDAAsD;IACtD,eAAe;IACf,qEAAqE;IACrE,eAAe;IACf,oEAAoE;IACpE,qBAAqB;IACrB,6CAA6C;IAC7C,WAAW;IAEX,mBAAmB;IACnB,mFAAmF;IACnF,uBAAuB;IACvB,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,oDAAoD;IACpD,yBAAyB;IACzB,qEAAqE;IACrE,oBAAoB;IACpB,mEAAmE;IACnE,gCAAgC;IAChC,mFAAmF;IACnF,0BAA0B;IAE1B,gBAAgB;IAChB,uEAAuE;IACvE,aAAa;IACb,0EAA0E;IAC1E,oBAAoB;CACZ,CAAC;AAEX,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAGhE,4DAA4D;AAC5D,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC,IAAI,CAAC","sourcesContent":["/**\n * founder-schema — Every error code the API answers with\n *\n * THE CODE IS WHAT A CLIENT ACTS ON; the `message` beside it is English for\n * logs and for a client too old to know the code. A client words each code in\n * the member's language, and a test on the web side asserts every value here\n * has a message in every locale it ships.\n *\n * Before 0.2.0 the backend kept this list to itself, and every domain refusal\n * (a closed poll, a reply to a reply, the edit window) went out as\n * `VALIDATION_ERROR` with an English sentence, so the only way for a client to\n * tell them apart was to match on the wording.\n *\n * WHEN TO USE WHICH:\n * - A request that does not match its schema: `VALIDATION_ERROR`, with every\n * problem in `error.details.issues`.\n * - A well-formed request the current STATE of things refuses: its own code\n * below. These carry no issues; the code says it all.\n *\n * ⚠ Append freely; remove deliberately. A code removed here that an older\n * server still sends fails the client's parse of the error envelope.\n *\n * @module founder-schema/core/errors\n */\n\nimport { z } from 'zod';\n\n/**\n * As a tuple, the way `GENDER_VALUES` is, so a consumer can iterate it (a\n * translation-coverage test does exactly that) and TypeScript keeps the union.\n */\nexport const API_ERROR_CODE_VALUES = [\n // ── Anything ──\n /** A bug or an outage on our side. The message says nothing more on purpose. */\n 'INTERNAL_ERROR',\n /** The request did not match its schema. `details.issues` says where. */\n 'VALIDATION_ERROR',\n /** No such thing, or not one you may see. Deliberately the same answer. */\n 'NOT_FOUND',\n /** Two writes raced for something unique; retrying usually succeeds. */\n 'CONFLICT',\n /** Too many requests from this member or address. Wait, then retry. */\n 'RATE_LIMITED',\n /** Something we depend on (the chat server) is down or not switched on. */\n 'SERVICE_UNAVAILABLE',\n\n // ── Who you are ──\n /** No credential at all. */\n 'UNAUTHORIZED',\n /** A credential that is not ours, or not readable. */\n 'INVALID_TOKEN',\n /** A credential that was ours and has expired. Refresh and retry. */\n 'TOKEN_EXPIRED',\n /** Signed out everywhere, or the account changed. Sign in again. */\n 'SESSION_INVALIDATED',\n /** Signed in, and not allowed to do this. */\n 'FORBIDDEN',\n\n // ── Onboarding ──\n /** Finish onboarding first. The client routes here instead of showing an error. */\n 'ONBOARDING_INCOMPLETE',\n /** Onboarding is already finished; there is nothing to save or finish again. */\n 'ALREADY_ONBOARDED',\n /** Under `MIN_AGE_YEARS`. Refused at the draft and again at finish. */\n 'UNDER_AGE',\n\n // ── Uploads: completing one, and attaching it ──\n /**\n * Not an upload of yours, not processed yet, already attached somewhere, or\n * for the other purpose (an avatar upload on a post). One code for all of\n * them on purpose: telling \"someone else's\" apart from \"does not exist\" would\n * let a caller probe other members' media ids.\n */\n 'UPLOAD_NOT_ATTACHABLE',\n /** Larger than `UPLOAD_MAX_BYTES`. */\n 'UPLOAD_TOO_LARGE',\n /**\n * Not one of the image types this product accepts (by the file's own bytes,\n * whatever its name or declared type), or not an image at all.\n */\n 'UPLOAD_WRONG_TYPE',\n /** Completed before the file reached storage: upload it, then complete. */\n 'UPLOAD_NOT_RECEIVED',\n /**\n * Another request is processing this upload right now (a retry or a double\n * tap). Nothing is wrong: complete again in a moment and it answers with\n * the image. 409.\n */\n 'UPLOAD_PROCESSING',\n /** A JPEG, PNG, WebP or GIF by its bytes that cannot be decoded: truncated or corrupt. */\n 'UPLOAD_UNREADABLE',\n /** More than `MEDIA_MAX_INPUT_PIXELS`; refused before decoding. */\n 'UPLOAD_TOO_MANY_PIXELS',\n /** `MEDIA_PENDING_MAX` uploads are already waiting to be attached. */\n 'UPLOAD_LIMIT_REACHED',\n /** Discarding an upload that is attached: remove it from its post or avatar instead. */\n 'UPLOAD_IN_USE',\n\n // ── The feed ──\n /** The post is older than `EDIT_WINDOW_MS`. */\n 'EDIT_WINDOW_CLOSED',\n /** A poll is never editable: people have already voted on it. */\n 'POLL_NOT_EDITABLE',\n /** The poll has closed, by the server's clock. */\n 'POLL_CLOSED',\n /** No option, several on a single-choice poll, or an option that does not exist. */\n 'POLL_CHOICE_INVALID',\n /** A reply to a reply. One level of nesting only. */\n 'REPLY_TOO_DEEP',\n /** Reporting your own post, poll or comment (or, since 0.6.0, your own product or review). */\n 'CANNOT_REPORT_OWN',\n /**\n * Marking a comment \"this helped\" that is not feedback on your product: the\n * post is not tagged with a product you are on, or the comment is your own\n * team's.\n */\n 'FEEDBACK_NOT_MARKABLE',\n /** Reposting your own post or poll (0.8.0). */\n 'CANNOT_REPOST_OWN',\n /** Reposting a repost (0.8.0): share the original instead. */\n 'CANNOT_REPOST_A_REPOST',\n /** You already have an active repost of this item (0.8.0). Undo it first. 409. */\n 'ALREADY_REPOSTED',\n\n // ── Products ──\n /**\n * Their plan's number of LIVE products is reached (0.12.0: 1 for a member,\n * 5 on Premium, unlimited on Business; was `PRODUCTS_OWNED_MAX` for\n * everyone). Creating a product, making a paused one live, or being handed\n * one. `details.limit`. Pause one, or upgrade.\n */\n 'PRODUCT_LIMIT_REACHED',\n /**\n * Listing a product that is not ready for Discover, or removing what keeps a\n * listed one ready. `details.missing`: some of `logo`, `tagline`, `screenshot`.\n */\n 'PRODUCT_NOT_LISTABLE',\n /**\n * The product is archived and frozen until its owner restores it: no new\n * posts about it, reviews, upvotes, replies, helpful marks, testers or\n * invitations.\n */\n 'PRODUCT_ARCHIVED',\n /** Tagging a post with, or acting for, a product you are not on the team of. */\n 'PRODUCT_NOT_YOURS',\n /** Inviting someone who is already on the team or already invited. */\n 'PRODUCT_ALREADY_MEMBER',\n /**\n * Inviting someone who cannot join a team: not finished onboarding, paused,\n * suspended or deleted. One code for all four, so it reveals none of them.\n */\n 'PRODUCT_MEMBER_NOT_INVITABLE',\n /** Handing over to, or re-roling, someone who is not on the team (or invited, for a role). */\n 'PRODUCT_NOT_ON_TEAM',\n /**\n * The owner leaving, being removed, or having their role changed. Ownership\n * moves only by handing the product to someone first.\n */\n 'PRODUCT_OWNER_MUST_TRANSFER',\n /** Upvoting, reviewing or confirming yourself as a tester of your own team's product. */\n 'PRODUCT_OWN_TEAM',\n /** Confirming as a tester someone who has given this product no feedback. */\n 'TESTER_NOT_ELIGIBLE',\n /**\n * The product is paused (0.12.0): its owner's plan has fewer live places\n * than they own products. Only its team sees it; nothing new is tagged with\n * it until its owner makes it live again.\n */\n 'PRODUCT_PAUSED',\n\n // ── Membership and plans (0.12.0) ──\n /**\n * Taking part needs a membership: a viewer posting, commenting, reacting,\n * voting, saving, joining, chatting or listing a product. 403. Also the\n * reason on the refusing rule, so the web offers the membership.\n */\n 'MEMBERSHIP_REQUIRED',\n /**\n * Starting a conversation with someone you do not know needs Premium or\n * Business. 403. Also the reason on the refusing rule.\n */\n 'PLAN_REQUIRED',\n /** Buying or claiming a membership while holding one. 409. */\n 'ALREADY_MEMBER',\n /**\n * Revoking a membership staff may not revoke: a paid one (refund the\n * payment instead) or a staff member's, which comes with the role. 409.\n */\n 'MEMBERSHIP_NOT_REVOCABLE',\n /** No such coupon, or it is switched off, not started or over. One code for all, on purpose. */\n 'COUPON_INVALID',\n /** A real coupon that does not apply to what is being bought (a membership code on a plan). */\n 'COUPON_NOT_APPLICABLE',\n /** Every redemption of the coupon is taken. 409. */\n 'COUPON_EXHAUSTED',\n /** This account already used the coupon. 409. */\n 'COUPON_ALREADY_USED',\n /** Staff creating a coupon whose code another coupon has (case ignored). 409. */\n 'COUPON_CODE_TAKEN',\n /** A member choosing a username someone else holds (0.13.0). 409. */\n 'USERNAME_TAKEN',\n /**\n * Staff creating a second FOUNDING coupon (0.13.0): founding numbers count\n * up on the one founding coupon, so a second would hand out #1 again. 409.\n */\n 'COUPON_FOUNDING_EXISTS',\n /** Buying Business while on Premium: that is an upgrade, priced as the difference. 409. */\n 'PLAN_UPGRADE_INSTEAD',\n /** Asking to upgrade with no Premium time to turn into Business. 409. */\n 'PLAN_NOTHING_TO_UPGRADE',\n /** The purchase would hold plan time more than `PLAN_AHEAD_MAX_YEARS` ahead. 409. */\n 'PLAN_TERM_LIMIT',\n /**\n * The plan changed between the quote and the payment (another purchase\n * moved the Premium an upgrade was priced on, or the quote is over a day\n * old): the payment is not applied, and is refunded in full by itself. 409.\n */\n 'PLAN_CHANGED',\n /** Payments are not switched on here (no gateway keys). 503. A free coupon still works. */\n 'PAYMENTS_UNAVAILABLE',\n /**\n * What came back from checkout does not prove this payment: a bad\n * signature, or another order's ids. 400. If money was taken, the webhook\n * still settles it.\n */\n 'PAYMENT_NOT_VERIFIED',\n /** The checkout was not paid within its time (`ORDER_TTL_MINUTES`). Start again. 409. */\n 'ORDER_EXPIRED',\n /** More than `REFUND_WINDOW_DAYS` days since the payment. 409. */\n 'REFUND_WINDOW_CLOSED',\n /** Not a captured payment, or already refunded. 409. */\n 'PAYMENT_NOT_REFUNDABLE',\n /** The gateway refused the refund. Nothing changed; try again or refund from its dashboard. 502. */\n 'REFUND_FAILED',\n\n // ── Messaging people you do not know (0.12.0) ──\n /** This month's allowance of new people is used. `details.resetsAt`. 403. */\n 'MESSAGE_ALLOWANCE_EXHAUSTED',\n /**\n * Opening a conversation that would use the allowance, without saying so\n * (`useAllowance: true`). `details.left`. 409. Nothing was spent.\n */\n 'MESSAGE_ALLOWANCE_UNCONFIRMED',\n /**\n * They do not take conversations from people they do not know, or they\n * cannot chat at all (not a member). One code for both, on purpose. 403.\n */\n 'MESSAGE_NOT_ACCEPTED',\n\n // ── Communities (0.9.0) ──\n /**\n * Something in a community you can SEE but must join first: taking part in\n * it (posting into it, commenting, reacting, voting, saving, reporting,\n * editing), or reading a private community's feed, pinned posts or\n * members. Join (public) or request to join (private). 403. What you cannot\n * see at all answers NOT_FOUND, as content of a private or hidden community\n * looked up by its id does.\n */\n 'COMMUNITY_JOIN_REQUIRED',\n /** A live community already has this name (case and spacing ignored). 409. */\n 'COMMUNITY_NAME_TAKEN',\n /** Joining, requesting or inviting someone who is already a member, has requested or is invited. 409. */\n 'COMMUNITY_ALREADY_MEMBER',\n /**\n * Inviting someone who cannot join: not finished onboarding, paused,\n * suspended or deleted. One code for all four, so it reveals none of them.\n */\n 'COMMUNITY_MEMBER_NOT_INVITABLE',\n /** Inviting someone banned from this community. Unban them first. */\n 'COMMUNITY_MEMBER_BANNED',\n /** Inviting into a public community: anyone can join it, share its link instead. */\n 'COMMUNITY_INVITE_NOT_NEEDED',\n /**\n * The last admin leaving, stepping down or being removed, or deleting their\n * account while someone else could be made admin. Make someone else admin\n * first. On an account deletion, `details.communities` names them.\n */\n 'COMMUNITY_LAST_ADMIN',\n /**\n * The community is archived (read-only): no new posts, polls, comments,\n * reactions, votes, saves, reports, edits, joins, approvals, invitations\n * or pins. Its moderators may still hide what breaks its rules.\n */\n 'COMMUNITY_ARCHIVED',\n /**\n * A type change that exposes what was already posted (toward public, or\n * hidden to private) sent without `confirmExposure: true`.\n */\n 'COMMUNITY_EXPOSURE_UNCONFIRMED',\n /** `COMMUNITY_PINS_MAX` announcements are pinned already. Unpin one first. */\n 'COMMUNITY_PINS_FULL',\n /**\n * Notifying every member again within `COMMUNITY_ANNOUNCE_INTERVAL_MS`.\n * `details.nextAt` says when it is allowed. Pinning without notifying works.\n */\n 'COMMUNITY_ANNOUNCE_TOO_SOON',\n /** Reposting a post or poll that lives in a community: community content stays in it. */\n 'COMMUNITY_CONTENT_NOT_REPOSTABLE',\n /** `COMMUNITY_SUGGESTIONS_OPEN_MAX` suggestions are already waiting for review. */\n 'COMMUNITY_SUGGESTIONS_FULL',\n /** Approving or declining a suggestion that was already decided. 409. */\n 'COMMUNITY_SUGGESTION_DECIDED',\n // ── Reviews ──\n /** One review per member per product. Edit yours instead. */\n 'REVIEW_EXISTS',\n /** Voting your own review helpful. */\n 'REVIEW_OWN_VOTE',\n\n // ── Moderation ──\n /**\n * A decision that does not apply to that kind of thing: removing a product\n * (staff hide one, never delete it). `MODERATION_ACTIONS_BY_TARGET_KIND`.\n */\n 'MODERATION_ACTION_INVALID',\n\n // ── Chat ──\n /** Opening a conversation with yourself. */\n 'CHAT_WITH_SELF',\n\n // ── The account ──\n /** Staff suspended this account: nothing in the product works until it is lifted. */\n 'ACCOUNT_SUSPENDED',\n\n // ── Roles and the MPIN ──\n /**\n * Switching to a role this person does not hold (or no longer holds), or\n * setting an MPIN while holding no staff role at all.\n */\n 'ROLE_NOT_HELD',\n /** A staff role needs an MPIN, and none has been set yet. Set one first. */\n 'MPIN_NOT_SET',\n /** An MPIN is set once; changing it needs the current one. */\n 'MPIN_ALREADY_SET',\n /** The MPIN is wrong. `details.attemptsLeft` says how many tries remain. */\n 'MPIN_INCORRECT',\n /** Too many wrong MPINs. `details.lockedUntil` says when to try again. */\n 'MPIN_LOCKED',\n /** Changing your own roles. Someone else has to. */\n 'CANNOT_CHANGE_OWN_ROLES',\n /** Granting or revoking a role the role you act as may not touch. */\n 'ROLE_NOT_GRANTABLE',\n /** Changing your own capabilities (0.9.0). Someone else has to. */\n 'CANNOT_CHANGE_OWN_CAPABILITIES',\n /** Granting or revoking a capability the role you act as may not touch (0.9.0). */\n 'CAPABILITY_NOT_GRANTABLE',\n\n // ── Support ──\n /** The ticket holds `TICKET_MESSAGES_MAX` messages. Open a new one. */\n 'TICKET_FULL',\n /** The team keeps `SAVED_REPLIES_MAX` saved replies. Delete one first. */\n 'SAVED_REPLIES_FULL',\n] as const;\n\nexport const apiErrorCodeSchema = z.enum(API_ERROR_CODE_VALUES);\nexport type ApiErrorCode = z.infer<typeof apiErrorCodeSchema>;\n\n/** The same codes by name: `API_ERROR_CODE.POLL_CLOSED`. */\nexport const API_ERROR_CODE = apiErrorCodeSchema.enum;\n"]}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EA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B;IACrB;;;OAGG;IACH,6BAA6B;IAC7B,yFAAyF;IACzF,kCAAkC;IAClC,mFAAmF;IACnF,4BAA4B;IAC5B,yEAAyE;IACzE,8BAA8B;IAC9B,gBAAgB;IAChB,6DAA6D;IAC7D,eAAe;IACf,sCAAsC;IACtC,iBAAiB;IAEjB,mBAAmB;IACnB;;;OAGG;IACH,2BAA2B;IAE3B,aAAa;IACb,4CAA4C;IAC5C,gBAAgB;IAEhB,oBAAoB;IACpB,qFAAqF;IACrF,mBAAmB;IAEnB,2BAA2B;IAC3B;;;OAGG;IACH,eAAe;IACf,4EAA4E;IAC5E,cAAc;IACd,8DAA8D;IAC9D,kBAAkB;IAClB,4EAA4E;IAC5E,gBAAgB;IAChB,0EAA0E;IAC1E,aAAa;IACb,oDAAoD;IACpD,yBAAyB;IACzB,qEAAqE;IACrE,oBAAoB;IACpB,mEAAmE;IACnE,gCAAgC;IAChC,mFAAmF;IACnF,0BAA0B;IAE1B,gBAAgB;IAChB,uEAAuE;IACvE,aAAa;IACb,0EAA0E;IAC1E,oBAAoB;IAEpB,0BAA0B;IAC1B;;;;OAIG;IACH,cAAc;IACd,yFAAyF;IACzF,iBAAiB;IACjB,kGAAkG;IAClG,gBAAgB;IAChB;;;;;;OAMG;IACH,qBAAqB;CACb,CAAC;AAEX,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAGhE,4DAA4D;AAC5D,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC,IAAI,CAAC","sourcesContent":["/**\n * founder-schema — Every error code the API answers with\n *\n * THE CODE IS WHAT A CLIENT ACTS ON; the `message` beside it is English for\n * logs and for a client too old to know the code. A client words each code in\n * the member's language, and a test on the web side asserts every value here\n * has a message in every locale it ships.\n *\n * Before 0.2.0 the backend kept this list to itself, and every domain refusal\n * (a closed poll, a reply to a reply, the edit window) went out as\n * `VALIDATION_ERROR` with an English sentence, so the only way for a client to\n * tell them apart was to match on the wording.\n *\n * WHEN TO USE WHICH:\n * - A request that does not match its schema: `VALIDATION_ERROR`, with every\n * problem in `error.details.issues`.\n * - A well-formed request the current STATE of things refuses: its own code\n * below. These carry no issues; the code says it all.\n *\n * ⚠ Append freely; remove deliberately. A code removed here that an older\n * server still sends fails the client's parse of the error envelope.\n *\n * @module founder-schema/core/errors\n */\n\nimport { z } from 'zod';\n\n/**\n * As a tuple, the way `GENDER_VALUES` is, so a consumer can iterate it (a\n * translation-coverage test does exactly that) and TypeScript keeps the union.\n */\nexport const API_ERROR_CODE_VALUES = [\n // ── Anything ──\n /** A bug or an outage on our side. The message says nothing more on purpose. */\n 'INTERNAL_ERROR',\n /** The request did not match its schema. `details.issues` says where. */\n 'VALIDATION_ERROR',\n /** No such thing, or not one you may see. Deliberately the same answer. */\n 'NOT_FOUND',\n /** Two writes raced for something unique; retrying usually succeeds. */\n 'CONFLICT',\n /** Too many requests from this member or address. Wait, then retry. */\n 'RATE_LIMITED',\n /** Something we depend on (the chat server) is down or not switched on. */\n 'SERVICE_UNAVAILABLE',\n\n // ── Who you are ──\n /** No credential at all. */\n 'UNAUTHORIZED',\n /** A credential that is not ours, or not readable. */\n 'INVALID_TOKEN',\n /** A credential that was ours and has expired. Refresh and retry. */\n 'TOKEN_EXPIRED',\n /** Signed out everywhere, or the account changed. Sign in again. */\n 'SESSION_INVALIDATED',\n /** Signed in, and not allowed to do this. */\n 'FORBIDDEN',\n\n // ── Onboarding ──\n /** Finish onboarding first. The client routes here instead of showing an error. */\n 'ONBOARDING_INCOMPLETE',\n /** Onboarding is already finished; there is nothing to save or finish again. */\n 'ALREADY_ONBOARDED',\n /** Under `MIN_AGE_YEARS`. Refused at the draft and again at finish. */\n 'UNDER_AGE',\n\n // ── Uploads: completing one, and attaching it ──\n /**\n * Not an upload of yours, not processed yet, already attached somewhere, or\n * for the other purpose (an avatar upload on a post). One code for all of\n * them on purpose: telling \"someone else's\" apart from \"does not exist\" would\n * let a caller probe other members' media ids.\n */\n 'UPLOAD_NOT_ATTACHABLE',\n /** Larger than `UPLOAD_MAX_BYTES`. */\n 'UPLOAD_TOO_LARGE',\n /**\n * Not one of the image types this product accepts (by the file's own bytes,\n * whatever its name or declared type), or not an image at all.\n */\n 'UPLOAD_WRONG_TYPE',\n /** Completed before the file reached storage: upload it, then complete. */\n 'UPLOAD_NOT_RECEIVED',\n /**\n * Another request is processing this upload right now (a retry or a double\n * tap). Nothing is wrong: complete again in a moment and it answers with\n * the image. 409.\n */\n 'UPLOAD_PROCESSING',\n /** A JPEG, PNG, WebP or GIF by its bytes that cannot be decoded: truncated or corrupt. */\n 'UPLOAD_UNREADABLE',\n /** More than `MEDIA_MAX_INPUT_PIXELS`; refused before decoding. */\n 'UPLOAD_TOO_MANY_PIXELS',\n /** `MEDIA_PENDING_MAX` uploads are already waiting to be attached. */\n 'UPLOAD_LIMIT_REACHED',\n /** Discarding an upload that is attached: remove it from its post or avatar instead. */\n 'UPLOAD_IN_USE',\n\n // ── The feed ──\n /** The post is older than `EDIT_WINDOW_MS`. */\n 'EDIT_WINDOW_CLOSED',\n /** A poll is never editable: people have already voted on it. */\n 'POLL_NOT_EDITABLE',\n /** The poll has closed, by the server's clock. */\n 'POLL_CLOSED',\n /** No option, several on a single-choice poll, or an option that does not exist. */\n 'POLL_CHOICE_INVALID',\n /** A reply to a reply. One level of nesting only. */\n 'REPLY_TOO_DEEP',\n /** Reporting your own post, poll or comment (or, since 0.6.0, your own product or review). */\n 'CANNOT_REPORT_OWN',\n /**\n * Marking a comment \"this helped\" that is not feedback on your product: the\n * post is not tagged with a product you are on, or the comment is your own\n * team's.\n */\n 'FEEDBACK_NOT_MARKABLE',\n /** Reposting your own post or poll (0.8.0). */\n 'CANNOT_REPOST_OWN',\n /** Reposting a repost (0.8.0): share the original instead. */\n 'CANNOT_REPOST_A_REPOST',\n /** You already have an active repost of this item (0.8.0). Undo it first. 409. */\n 'ALREADY_REPOSTED',\n\n // ── Products ──\n /**\n * Their plan's number of LIVE products is reached (0.12.0: 1 for a member,\n * 5 on Premium, unlimited on Business; was `PRODUCTS_OWNED_MAX` for\n * everyone). Creating a product, making a paused one live, or being handed\n * one. `details.limit`. Pause one, or upgrade.\n */\n 'PRODUCT_LIMIT_REACHED',\n /**\n * Listing a product that is not ready for Discover, or removing what keeps a\n * listed one ready. `details.missing`: some of `logo`, `tagline`, `screenshot`.\n */\n 'PRODUCT_NOT_LISTABLE',\n /**\n * The product is archived and frozen until its owner restores it: no new\n * posts about it, reviews, upvotes, replies, helpful marks, testers or\n * invitations.\n */\n 'PRODUCT_ARCHIVED',\n /** Tagging a post with, or acting for, a product you are not on the team of. */\n 'PRODUCT_NOT_YOURS',\n /** Inviting someone who is already on the team or already invited. */\n 'PRODUCT_ALREADY_MEMBER',\n /**\n * Inviting someone who cannot join a team: not finished onboarding, paused,\n * suspended or deleted. One code for all four, so it reveals none of them.\n */\n 'PRODUCT_MEMBER_NOT_INVITABLE',\n /** Handing over to, or re-roling, someone who is not on the team (or invited, for a role). */\n 'PRODUCT_NOT_ON_TEAM',\n /**\n * The owner leaving, being removed, or having their role changed. Ownership\n * moves only by handing the product to someone first.\n */\n 'PRODUCT_OWNER_MUST_TRANSFER',\n /** Upvoting, reviewing or confirming yourself as a tester of your own team's product. */\n 'PRODUCT_OWN_TEAM',\n /** Confirming as a tester someone who has given this product no feedback. */\n 'TESTER_NOT_ELIGIBLE',\n /**\n * The product is paused (0.12.0): its owner's plan has fewer live places\n * than they own products. Only its team sees it; nothing new is tagged with\n * it until its owner makes it live again.\n */\n 'PRODUCT_PAUSED',\n\n // ── Membership and plans (0.12.0) ──\n /**\n * Taking part needs a membership: a viewer posting, commenting, reacting,\n * voting, saving, joining, chatting or listing a product. 403. Also the\n * reason on the refusing rule, so the web offers the membership.\n */\n 'MEMBERSHIP_REQUIRED',\n /**\n * Starting a conversation with someone you do not know needs Premium or\n * Business. 403. Also the reason on the refusing rule.\n */\n 'PLAN_REQUIRED',\n /** Buying or claiming a membership while holding one. 409. */\n 'ALREADY_MEMBER',\n /**\n * Revoking a membership staff may not revoke: a paid one (refund the\n * payment instead) or a staff member's, which comes with the role. 409.\n */\n 'MEMBERSHIP_NOT_REVOCABLE',\n /** No such coupon, or it is switched off, not started or over. One code for all, on purpose. */\n 'COUPON_INVALID',\n /** A real coupon that does not apply to what is being bought (a membership code on a plan). */\n 'COUPON_NOT_APPLICABLE',\n /** Every redemption of the coupon is taken. 409. */\n 'COUPON_EXHAUSTED',\n /** This account already used the coupon. 409. */\n 'COUPON_ALREADY_USED',\n /** Staff creating a coupon whose code another coupon has (case ignored). 409. */\n 'COUPON_CODE_TAKEN',\n /** A member choosing a username someone else holds (0.13.0). 409. */\n 'USERNAME_TAKEN',\n /**\n * Staff creating a second FOUNDING coupon (0.13.0): founding numbers count\n * up on the one founding coupon, so a second would hand out #1 again. 409.\n */\n 'COUPON_FOUNDING_EXISTS',\n /**\n * Staff creating ANY founding coupon (0.14.0): founding places come from the\n * launch waitlist alone (the user, 2026-10-16), so no code may hand one out.\n * 409.\n */\n 'COUPON_FOUNDING_RETIRED',\n /** Buying Business while on Premium: that is an upgrade, priced as the difference. 409. */\n 'PLAN_UPGRADE_INSTEAD',\n /** Asking to upgrade with no Premium time to turn into Business. 409. */\n 'PLAN_NOTHING_TO_UPGRADE',\n /** The purchase would hold plan time more than `PLAN_AHEAD_MAX_YEARS` ahead. 409. */\n 'PLAN_TERM_LIMIT',\n /**\n * The plan changed between the quote and the payment (another purchase\n * moved the Premium an upgrade was priced on, or the quote is over a day\n * old): the payment is not applied, and is refunded in full by itself. 409.\n */\n 'PLAN_CHANGED',\n /** Payments are not switched on here (no gateway keys). 503. A free coupon still works. */\n 'PAYMENTS_UNAVAILABLE',\n /**\n * What came back from checkout does not prove this payment: a bad\n * signature, or another order's ids. 400. If money was taken, the webhook\n * still settles it.\n */\n 'PAYMENT_NOT_VERIFIED',\n /** The checkout was not paid within its time (`ORDER_TTL_MINUTES`). Start again. 409. */\n 'ORDER_EXPIRED',\n /** More than `REFUND_WINDOW_DAYS` days since the payment. 409. */\n 'REFUND_WINDOW_CLOSED',\n /** Not a captured payment, or already refunded. 409. */\n 'PAYMENT_NOT_REFUNDABLE',\n /** The gateway refused the refund. Nothing changed; try again or refund from its dashboard. 502. */\n 'REFUND_FAILED',\n\n // ── Messaging people you do not know (0.12.0) ──\n /** This month's allowance of new people is used. `details.resetsAt`. 403. */\n 'MESSAGE_ALLOWANCE_EXHAUSTED',\n /**\n * Opening a conversation that would use the allowance, without saying so\n * (`useAllowance: true`). `details.left`. 409. Nothing was spent.\n */\n 'MESSAGE_ALLOWANCE_UNCONFIRMED',\n /**\n * They do not take conversations from people they do not know, or they\n * cannot chat at all (not a member). One code for both, on purpose. 403.\n */\n 'MESSAGE_NOT_ACCEPTED',\n\n // ── Communities (0.9.0) ──\n /**\n * Something in a community you can SEE but must join first: taking part in\n * it (posting into it, commenting, reacting, voting, saving, reporting,\n * editing), or reading a private community's feed, pinned posts or\n * members. Join (public) or request to join (private). 403. What you cannot\n * see at all answers NOT_FOUND, as content of a private or hidden community\n * looked up by its id does.\n */\n 'COMMUNITY_JOIN_REQUIRED',\n /** A live community already has this name (case and spacing ignored). 409. */\n 'COMMUNITY_NAME_TAKEN',\n /** Joining, requesting or inviting someone who is already a member, has requested or is invited. 409. */\n 'COMMUNITY_ALREADY_MEMBER',\n /**\n * Inviting someone who cannot join: not finished onboarding, paused,\n * suspended or deleted. One code for all four, so it reveals none of them.\n */\n 'COMMUNITY_MEMBER_NOT_INVITABLE',\n /** Inviting someone banned from this community. Unban them first. */\n 'COMMUNITY_MEMBER_BANNED',\n /** Inviting into a public community: anyone can join it, share its link instead. */\n 'COMMUNITY_INVITE_NOT_NEEDED',\n /**\n * The last admin leaving, stepping down or being removed, or deleting their\n * account while someone else could be made admin. Make someone else admin\n * first. On an account deletion, `details.communities` names them.\n */\n 'COMMUNITY_LAST_ADMIN',\n /**\n * The community is archived (read-only): no new posts, polls, comments,\n * reactions, votes, saves, reports, edits, joins, approvals, invitations\n * or pins. Its moderators may still hide what breaks its rules.\n */\n 'COMMUNITY_ARCHIVED',\n /**\n * A type change that exposes what was already posted (toward public, or\n * hidden to private) sent without `confirmExposure: true`.\n */\n 'COMMUNITY_EXPOSURE_UNCONFIRMED',\n /** `COMMUNITY_PINS_MAX` announcements are pinned already. Unpin one first. */\n 'COMMUNITY_PINS_FULL',\n /**\n * Notifying every member again within `COMMUNITY_ANNOUNCE_INTERVAL_MS`.\n * `details.nextAt` says when it is allowed. Pinning without notifying works.\n */\n 'COMMUNITY_ANNOUNCE_TOO_SOON',\n /** Reposting a post or poll that lives in a community: community content stays in it. */\n 'COMMUNITY_CONTENT_NOT_REPOSTABLE',\n /** `COMMUNITY_SUGGESTIONS_OPEN_MAX` suggestions are already waiting for review. */\n 'COMMUNITY_SUGGESTIONS_FULL',\n /** Approving or declining a suggestion that was already decided. 409. */\n 'COMMUNITY_SUGGESTION_DECIDED',\n // ── Reviews ──\n /** One review per member per product. Edit yours instead. */\n 'REVIEW_EXISTS',\n /** Voting your own review helpful. */\n 'REVIEW_OWN_VOTE',\n\n // ── Moderation ──\n /**\n * A decision that does not apply to that kind of thing: removing a product\n * (staff hide one, never delete it). `MODERATION_ACTIONS_BY_TARGET_KIND`.\n */\n 'MODERATION_ACTION_INVALID',\n\n // ── Chat ──\n /** Opening a conversation with yourself. */\n 'CHAT_WITH_SELF',\n\n // ── The account ──\n /** Staff suspended this account: nothing in the product works until it is lifted. */\n 'ACCOUNT_SUSPENDED',\n\n // ── Roles and the MPIN ──\n /**\n * Switching to a role this person does not hold (or no longer holds), or\n * setting an MPIN while holding no staff role at all.\n */\n 'ROLE_NOT_HELD',\n /** A staff role needs an MPIN, and none has been set yet. Set one first. */\n 'MPIN_NOT_SET',\n /** An MPIN is set once; changing it needs the current one. */\n 'MPIN_ALREADY_SET',\n /** The MPIN is wrong. `details.attemptsLeft` says how many tries remain. */\n 'MPIN_INCORRECT',\n /** Too many wrong MPINs. `details.lockedUntil` says when to try again. */\n 'MPIN_LOCKED',\n /** Changing your own roles. Someone else has to. */\n 'CANNOT_CHANGE_OWN_ROLES',\n /** Granting or revoking a role the role you act as may not touch. */\n 'ROLE_NOT_GRANTABLE',\n /** Changing your own capabilities (0.9.0). Someone else has to. */\n 'CANNOT_CHANGE_OWN_CAPABILITIES',\n /** Granting or revoking a capability the role you act as may not touch (0.9.0). */\n 'CAPABILITY_NOT_GRANTABLE',\n\n // ── Support ──\n /** The ticket holds `TICKET_MESSAGES_MAX` messages. Open a new one. */\n 'TICKET_FULL',\n /** The team keeps `SAVED_REPLIES_MAX` saved replies. Delete one first. */\n 'SAVED_REPLIES_FULL',\n\n // ── Waitlist (0.15.0) ──\n /**\n * Founder Circle has not opened yet (`FC_LAUNCH_AT` is still ahead). Until\n * it does, only joining the waitlist, onboarding and your profile, uploads\n * for it and deleting your account work, for everyone, staff included. 403.\n */\n 'NOT_LAUNCHED',\n /** Joining the waitlist after the launch: it closed then (the user, 2026-10-16). 409. */\n 'WAITLIST_CLOSED',\n /** A staff account joining the waitlist: staff never take a place (the user, 2026-10-16). 403. */\n 'WAITLIST_STAFF',\n /**\n * Joining when this email's inbox or this sign-in already had a place: one\n * place per inbox (`x+1@`, `x+2@`, Gmail's dots are one inbox) and per\n * sign-in, ever, deleted accounts included, so neither new addresses nor\n * deleting and joining again take the free places one by one (the user,\n * 2026-10-16; the security review, 2026-10-18). 409.\n */\n 'WAITLIST_PLACE_USED',\n] as const;\n\nexport const apiErrorCodeSchema = z.enum(API_ERROR_CODE_VALUES);\nexport type ApiErrorCode = z.infer<typeof apiErrorCodeSchema>;\n\n/** The same codes by name: `API_ERROR_CODE.POLL_CLOSED`. */\nexport const API_ERROR_CODE = apiErrorCodeSchema.enum;\n"]}
@@ -143,6 +143,17 @@ export declare const PRODUCT_TEAM_SHOWN = 12;
143
143
  export declare const PRODUCT_ASK_OPEN_DAYS = 14;
144
144
  /** Days after a payment within which it is refunded in full on request (the user's ruling). */
145
145
  export declare const REFUND_WINDOW_DAYS = 7;
146
+ /**
147
+ * The LAST moment a payment made at `paidAt` may be asked to be refunded
148
+ * (0.15.0). The user's rule: seven days, "counted from the day I paid". So
149
+ * the window runs to the END of the seventh day after the day of paying, in
150
+ * India's time: paid at 00:10 on 1 October, refundable until 23:59:59.999 on
151
+ * 8 October. That is the date a member is shown, so the date shown and the
152
+ * moment enforced can never disagree (before 0.15.0 the server cut off at
153
+ * exactly 7 x 24 hours after the payment while the page showed only a date).
154
+ * Inclusive: an ask AT this instant is in time.
155
+ */
156
+ export declare function refundWindowEndsAt(paidAt: Date | string): Date;
146
157
  /** Minutes a checkout stays payable. After that it is expired and a new one is opened. */
147
158
  export declare const ORDER_TTL_MINUTES = 30;
148
159
  /** Plan time one member may hold ahead of today, in years. Bounds what is prepaid. */
@@ -1 +1 @@
1
- {"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/core/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,SAAS,OAAO,CAAC;AAC9B,0DAA0D;AAC1D,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,gFAAgF;AAChF,eAAO,MAAM,SAAS,IAAI,CAAC;AAI3B,eAAO,MAAM,QAAQ,KAAK,CAAC;AAC3B,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,WAAW,KAAK,CAAC;AAI9B,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,uCAAuC;AACvC,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,aAAa,SAAU,CAAC;AACrC,mFAAmF;AACnF,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAIrC;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC;AAIhC,kFAAkF;AAClF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────────────────────────────────
156
156
  /** Days after a payment within which it is refunded in full on request (the user's ruling). */
157
157
  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;
161
+ /**
162
+ * The LAST moment a payment made at `paidAt` may be asked to be refunded
163
+ * (0.15.0). The user's rule: seven days, "counted from the day I paid". So
164
+ * the window runs to the END of the seventh day after the day of paying, in
165
+ * India's time: paid at 00:10 on 1 October, refundable until 23:59:59.999 on
166
+ * 8 October. That is the date a member is shown, so the date shown and the
167
+ * moment enforced can never disagree (before 0.15.0 the server cut off at
168
+ * exactly 7 x 24 hours after the payment while the page showed only a date).
169
+ * Inclusive: an ask AT this instant is in time.
170
+ */
171
+ 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;
174
+ return new Date(payDayStart + (REFUND_WINDOW_DAYS + 1) * DAY_MS - 1);
175
+ }
158
176
  /** Minutes a checkout stays payable. After that it is expired and a new one is opened. */
159
177
  export const ORDER_TTL_MINUTES = 30;
160
178
  /** Plan time one member may hold ahead of today, in years. Bounds what is prepaid. */
@@ -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,C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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/** 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,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,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAEhC,gFAAgF;AAEhF,kFAAk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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"]}
@@ -111,6 +111,7 @@ export declare const apiErrorSchema: z.ZodObject<{
111
111
  COUPON_CODE_TAKEN: "COUPON_CODE_TAKEN";
112
112
  USERNAME_TAKEN: "USERNAME_TAKEN";
113
113
  COUPON_FOUNDING_EXISTS: "COUPON_FOUNDING_EXISTS";
114
+ COUPON_FOUNDING_RETIRED: "COUPON_FOUNDING_RETIRED";
114
115
  PLAN_UPGRADE_INSTEAD: "PLAN_UPGRADE_INSTEAD";
115
116
  PLAN_NOTHING_TO_UPGRADE: "PLAN_NOTHING_TO_UPGRADE";
116
117
  PLAN_TERM_LIMIT: "PLAN_TERM_LIMIT";
@@ -154,6 +155,10 @@ export declare const apiErrorSchema: z.ZodObject<{
154
155
  CAPABILITY_NOT_GRANTABLE: "CAPABILITY_NOT_GRANTABLE";
155
156
  TICKET_FULL: "TICKET_FULL";
156
157
  SAVED_REPLIES_FULL: "SAVED_REPLIES_FULL";
158
+ NOT_LAUNCHED: "NOT_LAUNCHED";
159
+ WAITLIST_CLOSED: "WAITLIST_CLOSED";
160
+ WAITLIST_STAFF: "WAITLIST_STAFF";
161
+ WAITLIST_PLACE_USED: "WAITLIST_PLACE_USED";
157
162
  }>;
158
163
  message: z.ZodString;
159
164
  details: z.ZodOptional<z.ZodObject<{
@@ -254,6 +259,7 @@ export declare const errorResponseSchema: z.ZodObject<{
254
259
  COUPON_CODE_TAKEN: "COUPON_CODE_TAKEN";
255
260
  USERNAME_TAKEN: "USERNAME_TAKEN";
256
261
  COUPON_FOUNDING_EXISTS: "COUPON_FOUNDING_EXISTS";
262
+ COUPON_FOUNDING_RETIRED: "COUPON_FOUNDING_RETIRED";
257
263
  PLAN_UPGRADE_INSTEAD: "PLAN_UPGRADE_INSTEAD";
258
264
  PLAN_NOTHING_TO_UPGRADE: "PLAN_NOTHING_TO_UPGRADE";
259
265
  PLAN_TERM_LIMIT: "PLAN_TERM_LIMIT";
@@ -297,6 +303,10 @@ export declare const errorResponseSchema: z.ZodObject<{
297
303
  CAPABILITY_NOT_GRANTABLE: "CAPABILITY_NOT_GRANTABLE";
298
304
  TICKET_FULL: "TICKET_FULL";
299
305
  SAVED_REPLIES_FULL: "SAVED_REPLIES_FULL";
306
+ NOT_LAUNCHED: "NOT_LAUNCHED";
307
+ WAITLIST_CLOSED: "WAITLIST_CLOSED";
308
+ WAITLIST_STAFF: "WAITLIST_STAFF";
309
+ WAITLIST_PLACE_USED: "WAITLIST_PLACE_USED";
300
310
  }>;
301
311
  message: z.ZodString;
302
312
  details: z.ZodOptional<z.ZodOb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mC,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -1074,7 +1074,10 @@ export type CouponTarget = z.infer<typeof couponTargetSchema>;
1074
1074
  * ⚠ Stored: append only.
1075
1075
  *
1076
1076
  * free_membership the membership at Rs 0; `founding` numbers its holders
1077
- * ("Founding member #N")
1077
+ * ("Founding member #N"). ⚠ A NEW founding coupon is refused
1078
+ * (0.14.0, COUPON_FOUNDING_RETIRED): founding places come
1079
+ * from the launch waitlist alone. The field stays, because
1080
+ * stored coupons carry it.
1078
1081
  * percent_off a share off the listed price of what it applies to
1079
1082
  */
1080
1083
  export declare const couponBenefitSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../../src/domains/billing/billing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,OAAO,EACL,KAAK,cAAc,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,UAAU,EACV,KAAK,YAAY,EACjB,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,YAAY,GACb,MAAM,UAAU,CAAC;AAIlB,4CAA4C;AAC5C,eAAO,MAAM,oBAAoB,4CAA6C,CAAC;AAC/E,eAAO,MAAM,kBAAkB;;;;EAA+B,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;2BAI7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,wDAMO,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AC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;iBAQ4D,CAAC;AAChG,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -342,7 +342,10 @@ export const couponTargetSchema = z.enum(COUPON_TARGET_VALUES);
342
342
  * ⚠ Stored: append only.
343
343
  *
344
344
  * free_membership the membership at Rs 0; `founding` numbers its holders
345
- * ("Founding member #N")
345
+ * ("Founding member #N"). ⚠ A NEW founding coupon is refused
346
+ * (0.14.0, COUPON_FOUNDING_RETIRED): founding places come
347
+ * from the launch waitlist alone. The field stays, because
348
+ * stored coupons carry it.
346
349
  * percent_off a share off the listed price of what it applies to
347
350
  */
348
351
  export const couponBenefitSchema = z.discriminatedUnion('kind', [