founder-schema 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +186 -17
- package/dist/access/access.d.ts +1 -1
- package/dist/access/access.d.ts.map +1 -1
- package/dist/access/access.js +4 -1
- package/dist/access/access.js.map +1 -1
- package/dist/access/permissions.d.ts +27 -29
- package/dist/access/permissions.d.ts.map +1 -1
- package/dist/access/permissions.js +39 -3
- package/dist/access/permissions.js.map +1 -1
- package/dist/core/common.d.ts +54 -23
- package/dist/core/common.d.ts.map +1 -1
- package/dist/core/common.js +49 -24
- package/dist/core/common.js.map +1 -1
- package/dist/core/errors.d.ts +7 -5
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +17 -11
- package/dist/core/errors.js.map +1 -1
- package/dist/core/limits.d.ts +73 -17
- package/dist/core/limits.d.ts.map +1 -1
- package/dist/core/limits.js +77 -22
- package/dist/core/limits.js.map +1 -1
- package/dist/core/money.d.ts +33 -0
- package/dist/core/money.d.ts.map +1 -0
- package/dist/core/money.js +36 -0
- package/dist/core/money.js.map +1 -0
- package/dist/core/responses.d.ts +14 -4
- package/dist/core/responses.d.ts.map +1 -1
- package/dist/core/responses.js.map +1 -1
- package/dist/core/validation.d.ts +19 -2
- package/dist/core/validation.d.ts.map +1 -1
- package/dist/core/validation.js +19 -2
- package/dist/core/validation.js.map +1 -1
- package/dist/domains/billing/billing.d.ts +61 -8
- package/dist/domains/billing/billing.d.ts.map +1 -1
- package/dist/domains/billing/billing.js +58 -22
- package/dist/domains/billing/billing.js.map +1 -1
- package/dist/domains/billing/gst.d.ts.map +1 -1
- package/dist/domains/billing/gst.js +4 -3
- package/dist/domains/billing/gst.js.map +1 -1
- package/dist/domains/chat/chat.d.ts +0 -21
- package/dist/domains/chat/chat.d.ts.map +1 -1
- package/dist/domains/chat/chat.js +0 -20
- package/dist/domains/chat/chat.js.map +1 -1
- package/dist/domains/communities/communities.d.ts +30 -12
- package/dist/domains/communities/communities.d.ts.map +1 -1
- package/dist/domains/communities/communities.js +43 -15
- package/dist/domains/communities/communities.js.map +1 -1
- package/dist/domains/contributions/contributions.d.ts +1 -1
- package/dist/domains/contributions/contributions.js +1 -1
- package/dist/domains/contributions/contributions.js.map +1 -1
- package/dist/domains/dashboard/dashboard.d.ts +3 -1
- package/dist/domains/dashboard/dashboard.d.ts.map +1 -1
- package/dist/domains/dashboard/dashboard.js +23 -7
- package/dist/domains/dashboard/dashboard.js.map +1 -1
- package/dist/domains/discover/discover.d.ts +8 -8
- package/dist/domains/feed/feed.d.ts +55 -153
- package/dist/domains/feed/feed.d.ts.map +1 -1
- package/dist/domains/feed/feed.js +53 -58
- package/dist/domains/feed/feed.js.map +1 -1
- package/dist/domains/location/areas.d.ts +331 -0
- package/dist/domains/location/areas.d.ts.map +1 -0
- package/dist/domains/location/areas.js +238 -0
- package/dist/domains/location/areas.js.map +1 -0
- package/dist/domains/location/india.d.ts +41 -123
- package/dist/domains/location/india.d.ts.map +1 -1
- package/dist/domains/location/india.js +121 -59
- package/dist/domains/location/india.js.map +1 -1
- package/dist/domains/members/members.d.ts +2 -2
- package/dist/domains/membership/membership.d.ts +26 -0
- package/dist/domains/membership/membership.d.ts.map +1 -1
- package/dist/domains/membership/membership.js +55 -1
- package/dist/domains/membership/membership.js.map +1 -1
- package/dist/domains/moderation/moderation.d.ts +2 -2
- package/dist/domains/moderation/moderation.js +3 -3
- package/dist/domains/moderation/moderation.js.map +1 -1
- package/dist/domains/notifications/notifications.d.ts +1 -10
- package/dist/domains/notifications/notifications.d.ts.map +1 -1
- package/dist/domains/notifications/notifications.js +2 -3
- package/dist/domains/notifications/notifications.js.map +1 -1
- package/dist/domains/onboarding/onboarding-answers.d.ts +42 -14
- package/dist/domains/onboarding/onboarding-answers.d.ts.map +1 -1
- package/dist/domains/onboarding/onboarding-answers.js +49 -33
- package/dist/domains/onboarding/onboarding-answers.js.map +1 -1
- package/dist/domains/onboarding/onboarding.d.ts +332 -138
- package/dist/domains/onboarding/onboarding.d.ts.map +1 -1
- package/dist/domains/onboarding/onboarding.js +47 -59
- package/dist/domains/onboarding/onboarding.js.map +1 -1
- package/dist/domains/products/products.d.ts +43 -8
- package/dist/domains/products/products.d.ts.map +1 -1
- package/dist/domains/products/products.js +57 -11
- package/dist/domains/products/products.js.map +1 -1
- package/dist/domains/profile/founder-profile.d.ts +123 -143
- package/dist/domains/profile/founder-profile.d.ts.map +1 -1
- package/dist/domains/profile/founder-profile.js +77 -35
- package/dist/domains/profile/founder-profile.js.map +1 -1
- package/dist/domains/profile/my-profile.d.ts +3 -3
- package/dist/domains/reviews/reviews.d.ts +1 -1
- package/dist/domains/reviews/reviews.d.ts.map +1 -1
- package/dist/domains/reviews/reviews.js +2 -2
- package/dist/domains/reviews/reviews.js.map +1 -1
- package/dist/domains/support/support.d.ts +22 -3
- package/dist/domains/support/support.d.ts.map +1 -1
- package/dist/domains/support/support.js +19 -5
- package/dist/domains/support/support.js.map +1 -1
- package/dist/domains/team/team.d.ts.map +1 -1
- package/dist/domains/team/team.js +3 -6
- package/dist/domains/team/team.js.map +1 -1
- package/dist/domains/uploads/uploads.d.ts +7 -22
- package/dist/domains/uploads/uploads.d.ts.map +1 -1
- package/dist/domains/uploads/uploads.js +7 -21
- package/dist/domains/uploads/uploads.js.map +1 -1
- package/dist/env.d.ts +26 -13
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +58 -23
- package/dist/env.js.map +1 -1
- package/dist/index.d.ts +19 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/errors.js.map
CHANGED
|
@@ -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;A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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"]}
|
|
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,CA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;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,oFAAoF;IACpF,oBAAoB;IACpB,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 products is reached (0.12.0: 1 for a member, 5 on\n * Premium, unlimited on Business, within `PRODUCTS_LIVE_SAFETY_MAX`).\n * Creating a product, making a paused one live, or being handed one. Live\n * and owner-paused products both count, so pausing one frees nothing: delete\n * or hand one over, or upgrade. `details.limit`.\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 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 /** 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 * A moderator removing or banning THEMSELF from their community (0.18.0:\n * was a bare FORBIDDEN). Leave the community instead. 403.\n */\n 'COMMUNITY_NOT_ON_YOURSELF',\n /**\n * A community's moderators putting back something Founder Circle STAFF hid\n * (0.18.0: was a bare FORBIDDEN): only staff can restore it. 403.\n */\n 'HIDDEN_BY_STAFF',\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 /** Reopening a ticket is its member's alone (0.18.0: was a bare FORBIDDEN). 403. */\n 'TICKET_MEMBER_ONLY',\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"]}
|
package/dist/core/limits.d.ts
CHANGED
|
@@ -30,6 +30,31 @@ export declare const GOALS_MIN = 1;
|
|
|
30
30
|
export declare const CITY_MAX = 80;
|
|
31
31
|
export declare const STATE_MAX = 80;
|
|
32
32
|
export declare const COUNTRY_MAX = 80;
|
|
33
|
+
/**
|
|
34
|
+
* An area's name as master_db stores it. Jansathi's area reference allows 200,
|
|
35
|
+
* but the all-India tree has names up to 250 characters (23 of them over 200,
|
|
36
|
+
* measured 2026-10-22): a list holding one must not fail its contract.
|
|
37
|
+
*/
|
|
38
|
+
export declare const AREA_NAME_MAX = 300;
|
|
39
|
+
/** The locality search box. */
|
|
40
|
+
export declare const AREA_SEARCH_MAX = 80;
|
|
41
|
+
/** Localities per page in the location drawer (Jansathi: 50). */
|
|
42
|
+
export declare const LOCALITY_PAGE_SIZE = 50;
|
|
43
|
+
/** How far a locality list may be paged (Jansathi clamps `skip` to 50,000). */
|
|
44
|
+
export declare const LOCALITY_SKIP_MAX = 50000;
|
|
45
|
+
/** Entries kept in each location history, newest last (Jansathi: 365). */
|
|
46
|
+
export declare const LOCATION_HISTORY_MAX = 365;
|
|
47
|
+
/**
|
|
48
|
+
* And none older than this many days (0.19.0, the privacy review): a rarely
|
|
49
|
+
* active member's oldest position must not live for years.
|
|
50
|
+
*/
|
|
51
|
+
export declare const LOCATION_HISTORY_MAX_DAYS = 365;
|
|
52
|
+
/** A GPS fix less accurate than this is refused (Jansathi's capture ceiling: 20 km). */
|
|
53
|
+
export declare const GEO_ACCURACY_MAX_M = 20000;
|
|
54
|
+
/** The daily sync retries a fix less accurate than this (Jansathi: 5 km). */
|
|
55
|
+
export declare const GEO_SYNC_ACCURACY_MAX_M = 5000;
|
|
56
|
+
/** A fix less accurate than this is coarse: the "Precise location" hint (Jansathi: 200 m). */
|
|
57
|
+
export declare const GEO_PRECISE_ACCURACY_M = 200;
|
|
33
58
|
export declare const VENTURE_NAME_MAX = 120;
|
|
34
59
|
export declare const VENTURE_TAGLINE_MAX = 160;
|
|
35
60
|
/** Team size including the founder. */
|
|
@@ -48,8 +73,6 @@ export declare const FOUNDED_YEAR_MIN = 1900;
|
|
|
48
73
|
export declare const LINK_URL_MAX = 300;
|
|
49
74
|
/** Author-supplied image description. The backend's stored copy uses this too. */
|
|
50
75
|
export declare const MEDIA_ALT_MAX = 280;
|
|
51
|
-
export declare const LINK_PREVIEW_TITLE_MAX = 200;
|
|
52
|
-
export declare const LINK_PREVIEW_DESCRIPTION_MAX = 500;
|
|
53
76
|
/** The free-text note on a report. */
|
|
54
77
|
export declare const REPORT_NOTE_MAX = 1000;
|
|
55
78
|
/** A moderator's note on a decision (why it was hidden, removed or dismissed). */
|
|
@@ -120,6 +143,8 @@ export declare const DISCOVER_FILTER_VALUES_MAX = 10;
|
|
|
120
143
|
export declare const DISCOVER_TEXT_MAX = 80;
|
|
121
144
|
/** Page size bounds for every cursor-paged list. */
|
|
122
145
|
export declare const PAGE_SIZE_MAX = 50;
|
|
146
|
+
/** Longest page cursor taken back: the server's are about 70 characters. */
|
|
147
|
+
export declare const CURSOR_MAX = 256;
|
|
123
148
|
export declare const PAGE_SIZE_DEFAULT = 20;
|
|
124
149
|
/**
|
|
125
150
|
* Members one participants lookup may name. Bounded so the lookup cannot be
|
|
@@ -133,14 +158,6 @@ export declare const PRODUCT_DESCRIPTION_MAX = 3000;
|
|
|
133
158
|
/** Screenshots on one product page. The first is its cover on Discover. */
|
|
134
159
|
export declare const PRODUCT_SCREENSHOTS_MAX = 8;
|
|
135
160
|
export declare const PRODUCT_CAPTION_MAX = 140;
|
|
136
|
-
/**
|
|
137
|
-
* @deprecated 0.12.0: how many products may be LIVE now depends on the plan
|
|
138
|
-
* (1 for a member, 5 on Premium, unlimited on Business), served by
|
|
139
|
-
* `GET /plans` and `GET /me/membership`; nothing reads this. Kept so no
|
|
140
|
-
* export is removed. It was the one cap for everyone, archived products
|
|
141
|
-
* counted, team roles never.
|
|
142
|
-
*/
|
|
143
|
-
export declare const PRODUCTS_OWNED_MAX = 5;
|
|
144
161
|
/** Team members a product page shows; the rest are one tap away (`/team`). */
|
|
145
162
|
export declare const PRODUCT_TEAM_SHOWN = 12;
|
|
146
163
|
/**
|
|
@@ -150,6 +167,17 @@ export declare const PRODUCT_TEAM_SHOWN = 12;
|
|
|
150
167
|
export declare const PRODUCT_ASK_OPEN_DAYS = 14;
|
|
151
168
|
/** Days after a payment within which it is refunded in full on request (the user's ruling). */
|
|
152
169
|
export declare const REFUND_WINDOW_DAYS = 7;
|
|
170
|
+
/**
|
|
171
|
+
* India Standard Time: UTC+05:30 all year, no daylight saving. Founder Circle
|
|
172
|
+
* counts every day in India's calendar (a refund window, a plan's months, a
|
|
173
|
+
* birthday, "today"): this one offset, never a copy (0.18.0, exported; the
|
|
174
|
+
* backend and the onboarding helpers each kept their own before).
|
|
175
|
+
*/
|
|
176
|
+
export declare const INDIA_UTC_OFFSET_MS: number;
|
|
177
|
+
/** India's time zone by its IANA name, for `Intl` dates: the same clock as `INDIA_UTC_OFFSET_MS`. */
|
|
178
|
+
export declare const INDIA_TIME_ZONE = "Asia/Kolkata";
|
|
179
|
+
/** One day in milliseconds. */
|
|
180
|
+
export declare const DAY_MS: number;
|
|
153
181
|
/**
|
|
154
182
|
* The LAST moment a payment made at `paidAt` may be asked to be refunded
|
|
155
183
|
* (0.15.0). The user's rule: seven days, "counted from the day I paid". So
|
|
@@ -173,16 +201,39 @@ export declare const PLAN_AHEAD_MAX_YEARS = 3;
|
|
|
173
201
|
export declare const PRODUCTS_LIVE_SAFETY_MAX = 100;
|
|
174
202
|
export declare const COUPON_CODE_MIN = 4;
|
|
175
203
|
export declare const COUPON_CODE_MAX = 32;
|
|
204
|
+
/**
|
|
205
|
+
* The most redemptions a coupon may allow (0.18.0: the web capped the field at
|
|
206
|
+
* 6 digits and nothing else did). A cap is a number staff type; no cap is null.
|
|
207
|
+
*/
|
|
208
|
+
export declare const COUPON_USES_MAX = 999999;
|
|
176
209
|
/** What staff call a coupon in their list ("Founding 100"). */
|
|
210
|
+
export declare const COUPON_LABEL_MIN = 2;
|
|
177
211
|
export declare const COUPON_LABEL_MAX = 80;
|
|
212
|
+
/** A percent-off coupon's share: never the whole price (a free membership is its own kind). */
|
|
213
|
+
export declare const COUPON_PERCENT_MIN = 1;
|
|
214
|
+
export declare const COUPON_PERCENT_MAX = 90;
|
|
178
215
|
/** Why staff refund a payment or grant or revoke a membership, on the audit record. */
|
|
179
216
|
export declare const BILLING_REASON_MIN = 3;
|
|
180
217
|
export declare const BILLING_REASON_MAX = 500;
|
|
181
218
|
/** A buyer's legal name and address on a B2B invoice. */
|
|
219
|
+
export declare const BILLING_NAME_MIN = 2;
|
|
182
220
|
export declare const BILLING_NAME_MAX = 120;
|
|
221
|
+
export declare const BILLING_ADDRESS_MIN = 10;
|
|
183
222
|
export declare const BILLING_ADDRESS_MAX = 300;
|
|
223
|
+
/** A GSTIN: always exactly this many characters (`gstinSchema` checks the pattern and the check character). */
|
|
224
|
+
export declare const GSTIN_LENGTH = 15;
|
|
225
|
+
/** An invoice or credit-note number: the GST rule's own ceiling (Rule 46(b): at most 16 characters). */
|
|
226
|
+
export declare const INVOICE_NUMBER_MAX = 16;
|
|
227
|
+
/** Razorpay's ids (order, payment) and the payment signature, as the checkout hands them back. */
|
|
228
|
+
export declare const RAZORPAY_ID_MAX = 64;
|
|
229
|
+
export declare const RAZORPAY_SIGNATURE_MAX = 256;
|
|
184
230
|
/** Days before a plan's end that the bell reminds, earliest first. */
|
|
185
231
|
export declare const PLAN_REMINDER_DAYS: readonly [7, 1];
|
|
232
|
+
/**
|
|
233
|
+
* Days a Razorpay webhook notice is kept, to answer "did that webhook arrive"
|
|
234
|
+
* (0.18.0: named; the backend's TTL and the Privacy text each held a 90).
|
|
235
|
+
*/
|
|
236
|
+
export declare const RAZORPAY_EVENT_RETENTION_DAYS = 90;
|
|
186
237
|
export declare const COMMUNITY_NAME_MIN = 3;
|
|
187
238
|
export declare const COMMUNITY_NAME_MAX = 60;
|
|
188
239
|
export declare const COMMUNITY_DESCRIPTION_MAX = 500;
|
|
@@ -207,23 +258,28 @@ export declare const REVIEW_REPLY_MAX = 1000;
|
|
|
207
258
|
* ratings say more about who wrote them than about the product.
|
|
208
259
|
*/
|
|
209
260
|
export declare const REVIEW_AVERAGE_MIN_COUNT = 3;
|
|
261
|
+
/** A rating's stars, and so the range an average can fall in. */
|
|
262
|
+
export declare const RATING_MIN = 1;
|
|
263
|
+
export declare const RATING_MAX = 5;
|
|
210
264
|
/** Points one review can earn its writer through other members' Helpful votes. */
|
|
211
265
|
export declare const REVIEW_HELPFUL_POINTS_MAX = 10;
|
|
212
266
|
/**
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
267
|
+
* Points one member can earn from ONE other member over any
|
|
268
|
+
* `CONTRIBUTION_PAIR_WINDOW_DAYS`, all kinds together, so two founders cannot
|
|
269
|
+
* farm each other by trading Helpful marks.
|
|
216
270
|
*/
|
|
217
|
-
export declare const
|
|
271
|
+
export declare const CONTRIBUTION_PAIR_POINTS_MAX = 30;
|
|
218
272
|
/**
|
|
219
|
-
*
|
|
220
|
-
*
|
|
273
|
+
* The window of that cap, in days (0.18.0: named; it borrowed the "this
|
|
274
|
+
* month" score's window, a different rule that happens to share the number).
|
|
221
275
|
*/
|
|
222
|
-
export declare const
|
|
276
|
+
export declare const CONTRIBUTION_PAIR_WINDOW_DAYS = 30;
|
|
223
277
|
/** Window of the "this month" score and the top-helpers list. */
|
|
224
278
|
export declare const CONTRIBUTION_RECENT_DAYS = 30;
|
|
225
279
|
/** Rows on the top-helpers list. */
|
|
226
280
|
export declare const CONTRIBUTION_LEADERBOARD_SIZE = 20;
|
|
281
|
+
/** The dashboard's "Last N days" counts (0.18.0: the one window; the backend kept two copies of 7). */
|
|
282
|
+
export declare const DASHBOARD_RECENT_DAYS = 7;
|
|
227
283
|
/** Days a notification is kept. Neither Jansathi nor GymMonk ever deletes one. */
|
|
228
284
|
export declare const NOTIFICATION_RETENTION_DAYS = 90;
|
|
229
285
|
/**
|
|
@@ -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;
|
|
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;AAE9B;;;;GAIG;AACH,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,+BAA+B;AAC/B,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,iEAAiE;AACjE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,+EAA+E;AAC/E,eAAO,MAAM,iBAAiB,QAAS,CAAC;AACxC,0EAA0E;AAC1E,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC;;;GAGG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAC7C,wFAAwF;AACxF,eA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MAAM,4BAA4B,IAAI,CAAC;AAC9C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAChD,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAI5C;;;GAGG;AACH,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,eAAe,OAAO,CAAC;AACpC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC;;;GAGG;AACH,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,iEAAiE;AACjE,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,UAAU,IAAI,CAAC;AAI5B,kFAAkF;AAClF,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAC5C;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAC/C;;;GAGG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAChD,iEAAiE;AACjE,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,oCAAoC;AACpC,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAIhD,uGAAuG;AACvG,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAIvC,kFAAkF;AAClF,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAI9C;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,mEAAmE;AACnE,eAAO,MAAM,wBAAwB,MAAM,CAAC"}
|
package/dist/core/limits.js
CHANGED
|
@@ -32,6 +32,31 @@ export const GOALS_MIN = 1;
|
|
|
32
32
|
export const CITY_MAX = 80;
|
|
33
33
|
export const STATE_MAX = 80;
|
|
34
34
|
export const COUNTRY_MAX = 80;
|
|
35
|
+
/**
|
|
36
|
+
* An area's name as master_db stores it. Jansathi's area reference allows 200,
|
|
37
|
+
* but the all-India tree has names up to 250 characters (23 of them over 200,
|
|
38
|
+
* measured 2026-10-22): a list holding one must not fail its contract.
|
|
39
|
+
*/
|
|
40
|
+
export const AREA_NAME_MAX = 300;
|
|
41
|
+
/** The locality search box. */
|
|
42
|
+
export const AREA_SEARCH_MAX = 80;
|
|
43
|
+
/** Localities per page in the location drawer (Jansathi: 50). */
|
|
44
|
+
export const LOCALITY_PAGE_SIZE = 50;
|
|
45
|
+
/** How far a locality list may be paged (Jansathi clamps `skip` to 50,000). */
|
|
46
|
+
export const LOCALITY_SKIP_MAX = 50_000;
|
|
47
|
+
/** Entries kept in each location history, newest last (Jansathi: 365). */
|
|
48
|
+
export const LOCATION_HISTORY_MAX = 365;
|
|
49
|
+
/**
|
|
50
|
+
* And none older than this many days (0.19.0, the privacy review): a rarely
|
|
51
|
+
* active member's oldest position must not live for years.
|
|
52
|
+
*/
|
|
53
|
+
export const LOCATION_HISTORY_MAX_DAYS = 365;
|
|
54
|
+
/** A GPS fix less accurate than this is refused (Jansathi's capture ceiling: 20 km). */
|
|
55
|
+
export const GEO_ACCURACY_MAX_M = 20_000;
|
|
56
|
+
/** The daily sync retries a fix less accurate than this (Jansathi: 5 km). */
|
|
57
|
+
export const GEO_SYNC_ACCURACY_MAX_M = 5_000;
|
|
58
|
+
/** A fix less accurate than this is coarse: the "Precise location" hint (Jansathi: 200 m). */
|
|
59
|
+
export const GEO_PRECISE_ACCURACY_M = 200;
|
|
35
60
|
// ─── Venture ─────────────────────────────────────────────────────────────────
|
|
36
61
|
export const VENTURE_NAME_MAX = 120;
|
|
37
62
|
export const VENTURE_TAGLINE_MAX = 160;
|
|
@@ -53,8 +78,6 @@ export const LINK_URL_MAX = 300;
|
|
|
53
78
|
// ─── Feed and moderation ─────────────────────────────────────────────────────
|
|
54
79
|
/** Author-supplied image description. The backend's stored copy uses this too. */
|
|
55
80
|
export const MEDIA_ALT_MAX = 280;
|
|
56
|
-
export const LINK_PREVIEW_TITLE_MAX = 200;
|
|
57
|
-
export const LINK_PREVIEW_DESCRIPTION_MAX = 500;
|
|
58
81
|
/** The free-text note on a report. */
|
|
59
82
|
export const REPORT_NOTE_MAX = 1000;
|
|
60
83
|
/** A moderator's note on a decision (why it was hidden, removed or dismissed). */
|
|
@@ -129,6 +152,8 @@ export const DISCOVER_FILTER_VALUES_MAX = 10;
|
|
|
129
152
|
export const DISCOVER_TEXT_MAX = 80;
|
|
130
153
|
/** Page size bounds for every cursor-paged list. */
|
|
131
154
|
export const PAGE_SIZE_MAX = 50;
|
|
155
|
+
/** Longest page cursor taken back: the server's are about 70 characters. */
|
|
156
|
+
export const CURSOR_MAX = 256;
|
|
132
157
|
export const PAGE_SIZE_DEFAULT = 20;
|
|
133
158
|
// ─── Chat ────────────────────────────────────────────────────────────────────
|
|
134
159
|
/**
|
|
@@ -144,14 +169,6 @@ export const PRODUCT_DESCRIPTION_MAX = 3000;
|
|
|
144
169
|
/** Screenshots on one product page. The first is its cover on Discover. */
|
|
145
170
|
export const PRODUCT_SCREENSHOTS_MAX = 8;
|
|
146
171
|
export const PRODUCT_CAPTION_MAX = 140;
|
|
147
|
-
/**
|
|
148
|
-
* @deprecated 0.12.0: how many products may be LIVE now depends on the plan
|
|
149
|
-
* (1 for a member, 5 on Premium, unlimited on Business), served by
|
|
150
|
-
* `GET /plans` and `GET /me/membership`; nothing reads this. Kept so no
|
|
151
|
-
* export is removed. It was the one cap for everyone, archived products
|
|
152
|
-
* counted, team roles never.
|
|
153
|
-
*/
|
|
154
|
-
export const PRODUCTS_OWNED_MAX = 5;
|
|
155
172
|
/** Team members a product page shows; the rest are one tap away (`/team`). */
|
|
156
173
|
export const PRODUCT_TEAM_SHOWN = 12;
|
|
157
174
|
/**
|
|
@@ -162,9 +179,17 @@ export const PRODUCT_ASK_OPEN_DAYS = 14;
|
|
|
162
179
|
// ─── Membership and plans (0.12.0) ───────────────────────────────────────────
|
|
163
180
|
/** Days after a payment within which it is refunded in full on request (the user's ruling). */
|
|
164
181
|
export const REFUND_WINDOW_DAYS = 7;
|
|
165
|
-
/**
|
|
166
|
-
|
|
167
|
-
|
|
182
|
+
/**
|
|
183
|
+
* India Standard Time: UTC+05:30 all year, no daylight saving. Founder Circle
|
|
184
|
+
* counts every day in India's calendar (a refund window, a plan's months, a
|
|
185
|
+
* birthday, "today"): this one offset, never a copy (0.18.0, exported; the
|
|
186
|
+
* backend and the onboarding helpers each kept their own before).
|
|
187
|
+
*/
|
|
188
|
+
export const INDIA_UTC_OFFSET_MS = (5 * 60 + 30) * 60 * 1000;
|
|
189
|
+
/** India's time zone by its IANA name, for `Intl` dates: the same clock as `INDIA_UTC_OFFSET_MS`. */
|
|
190
|
+
export const INDIA_TIME_ZONE = 'Asia/Kolkata';
|
|
191
|
+
/** One day in milliseconds. */
|
|
192
|
+
export const DAY_MS = 24 * 60 * 60 * 1000;
|
|
168
193
|
/**
|
|
169
194
|
* The LAST moment a payment made at `paidAt` may be asked to be refunded
|
|
170
195
|
* (0.15.0). The user's rule: seven days, "counted from the day I paid". So
|
|
@@ -176,8 +201,9 @@ const DAY_MS = 24 * 60 * 60 * 1000;
|
|
|
176
201
|
* Inclusive: an ask AT this instant is in time.
|
|
177
202
|
*/
|
|
178
203
|
export function refundWindowEndsAt(paidAt) {
|
|
179
|
-
const inIndia = new Date(new Date(paidAt).getTime() +
|
|
180
|
-
const payDayStart = Date.UTC(inIndia.getUTCFullYear(), inIndia.getUTCMonth(), inIndia.getUTCDate()) -
|
|
204
|
+
const inIndia = new Date(new Date(paidAt).getTime() + INDIA_UTC_OFFSET_MS);
|
|
205
|
+
const payDayStart = Date.UTC(inIndia.getUTCFullYear(), inIndia.getUTCMonth(), inIndia.getUTCDate()) -
|
|
206
|
+
INDIA_UTC_OFFSET_MS;
|
|
181
207
|
return new Date(payDayStart + (REFUND_WINDOW_DAYS + 1) * DAY_MS - 1);
|
|
182
208
|
}
|
|
183
209
|
/** Minutes a checkout stays payable. After that it is expired and a new one is opened. */
|
|
@@ -192,16 +218,39 @@ export const PLAN_AHEAD_MAX_YEARS = 3;
|
|
|
192
218
|
export const PRODUCTS_LIVE_SAFETY_MAX = 100;
|
|
193
219
|
export const COUPON_CODE_MIN = 4;
|
|
194
220
|
export const COUPON_CODE_MAX = 32;
|
|
221
|
+
/**
|
|
222
|
+
* The most redemptions a coupon may allow (0.18.0: the web capped the field at
|
|
223
|
+
* 6 digits and nothing else did). A cap is a number staff type; no cap is null.
|
|
224
|
+
*/
|
|
225
|
+
export const COUPON_USES_MAX = 999_999;
|
|
195
226
|
/** What staff call a coupon in their list ("Founding 100"). */
|
|
227
|
+
export const COUPON_LABEL_MIN = 2;
|
|
196
228
|
export const COUPON_LABEL_MAX = 80;
|
|
229
|
+
/** A percent-off coupon's share: never the whole price (a free membership is its own kind). */
|
|
230
|
+
export const COUPON_PERCENT_MIN = 1;
|
|
231
|
+
export const COUPON_PERCENT_MAX = 90;
|
|
197
232
|
/** Why staff refund a payment or grant or revoke a membership, on the audit record. */
|
|
198
233
|
export const BILLING_REASON_MIN = 3;
|
|
199
234
|
export const BILLING_REASON_MAX = 500;
|
|
200
235
|
/** A buyer's legal name and address on a B2B invoice. */
|
|
236
|
+
export const BILLING_NAME_MIN = 2;
|
|
201
237
|
export const BILLING_NAME_MAX = 120;
|
|
238
|
+
export const BILLING_ADDRESS_MIN = 10;
|
|
202
239
|
export const BILLING_ADDRESS_MAX = 300;
|
|
240
|
+
/** A GSTIN: always exactly this many characters (`gstinSchema` checks the pattern and the check character). */
|
|
241
|
+
export const GSTIN_LENGTH = 15;
|
|
242
|
+
/** An invoice or credit-note number: the GST rule's own ceiling (Rule 46(b): at most 16 characters). */
|
|
243
|
+
export const INVOICE_NUMBER_MAX = 16;
|
|
244
|
+
/** Razorpay's ids (order, payment) and the payment signature, as the checkout hands them back. */
|
|
245
|
+
export const RAZORPAY_ID_MAX = 64;
|
|
246
|
+
export const RAZORPAY_SIGNATURE_MAX = 256;
|
|
203
247
|
/** Days before a plan's end that the bell reminds, earliest first. */
|
|
204
248
|
export const PLAN_REMINDER_DAYS = [7, 1];
|
|
249
|
+
/**
|
|
250
|
+
* Days a Razorpay webhook notice is kept, to answer "did that webhook arrive"
|
|
251
|
+
* (0.18.0: named; the backend's TTL and the Privacy text each held a 90).
|
|
252
|
+
*/
|
|
253
|
+
export const RAZORPAY_EVENT_RETENTION_DAYS = 90;
|
|
205
254
|
// ─── Communities (0.9.0) ─────────────────────────────────────────────────────
|
|
206
255
|
export const COMMUNITY_NAME_MIN = 3;
|
|
207
256
|
export const COMMUNITY_NAME_MAX = 60;
|
|
@@ -228,24 +277,30 @@ export const REVIEW_REPLY_MAX = 1000;
|
|
|
228
277
|
* ratings say more about who wrote them than about the product.
|
|
229
278
|
*/
|
|
230
279
|
export const REVIEW_AVERAGE_MIN_COUNT = 3;
|
|
280
|
+
/** A rating's stars, and so the range an average can fall in. */
|
|
281
|
+
export const RATING_MIN = 1;
|
|
282
|
+
export const RATING_MAX = 5;
|
|
231
283
|
// ─── Contribution ────────────────────────────────────────────────────────────
|
|
232
284
|
/** Points one review can earn its writer through other members' Helpful votes. */
|
|
233
285
|
export const REVIEW_HELPFUL_POINTS_MAX = 10;
|
|
234
286
|
/**
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
287
|
+
* Points one member can earn from ONE other member over any
|
|
288
|
+
* `CONTRIBUTION_PAIR_WINDOW_DAYS`, all kinds together, so two founders cannot
|
|
289
|
+
* farm each other by trading Helpful marks.
|
|
238
290
|
*/
|
|
239
|
-
export const
|
|
291
|
+
export const CONTRIBUTION_PAIR_POINTS_MAX = 30;
|
|
240
292
|
/**
|
|
241
|
-
*
|
|
242
|
-
*
|
|
293
|
+
* The window of that cap, in days (0.18.0: named; it borrowed the "this
|
|
294
|
+
* month" score's window, a different rule that happens to share the number).
|
|
243
295
|
*/
|
|
244
|
-
export const
|
|
296
|
+
export const CONTRIBUTION_PAIR_WINDOW_DAYS = 30;
|
|
245
297
|
/** Window of the "this month" score and the top-helpers list. */
|
|
246
298
|
export const CONTRIBUTION_RECENT_DAYS = 30;
|
|
247
299
|
/** Rows on the top-helpers list. */
|
|
248
300
|
export const CONTRIBUTION_LEADERBOARD_SIZE = 20;
|
|
301
|
+
// ─── Staff dashboard ─────────────────────────────────────────────────────────
|
|
302
|
+
/** The dashboard's "Last N days" counts (0.18.0: the one window; the backend kept two copies of 7). */
|
|
303
|
+
export const DASHBOARD_RECENT_DAYS = 7;
|
|
249
304
|
// ─── Notifications ───────────────────────────────────────────────────────────
|
|
250
305
|
/** Days a notification is kept. Neither Jansathi nor GymMonk ever deletes one. */
|
|
251
306
|
export const NOTIFICATION_RETENTION_DAYS = 90;
|
package/dist/core/limits.js.map
CHANGED
|
@@ -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,MAAM,CAAC,MAAM,YAA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AC,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;\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 * 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;\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","source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\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/**\n * An area's name as master_db stores it. Jansathi's area reference allows 200,\n * but the all-India tree has names up to 250 characters (23 of them over 200,\n * measured 2026-10-22): a list holding one must not fail its contract.\n */\nexport const AREA_NAME_MAX = 300;\n/** The locality search box. */\nexport const AREA_SEARCH_MAX = 80;\n/** Localities per page in the location drawer (Jansathi: 50). */\nexport const LOCALITY_PAGE_SIZE = 50;\n/** How far a locality list may be paged (Jansathi clamps `skip` to 50,000). */\nexport const LOCALITY_SKIP_MAX = 50_000;\n/** Entries kept in each location history, newest last (Jansathi: 365). */\nexport const LOCATION_HISTORY_MAX = 365;\n/**\n * And none older than this many days (0.19.0, the privacy review): a rarely\n * active member's oldest position must not live for years.\n */\nexport const LOCATION_HISTORY_MAX_DAYS = 365;\n/** A GPS fix less accurate than this is refused (Jansathi's capture ceiling: 20 km). */\nexport const GEO_ACCURACY_MAX_M = 20_000;\n/** The daily sync retries a fix less accurate than this (Jansathi: 5 km). */\nexport const GEO_SYNC_ACCURACY_MAX_M = 5_000;\n/** A fix less accurate than this is coarse: the \"Precise location\" hint (Jansathi: 200 m). */\nexport const GEO_PRECISE_ACCURACY_M = 200;\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"}
|