founder-schema 0.14.0 → 0.16.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 +90 -3
- package/dist/core/common.d.ts +30 -4
- package/dist/core/common.d.ts.map +1 -1
- package/dist/core/common.js +37 -3
- package/dist/core/common.js.map +1 -1
- package/dist/core/errors.d.ts +9 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +19 -0
- package/dist/core/errors.js.map +1 -1
- package/dist/core/limits.d.ts +11 -0
- package/dist/core/limits.d.ts.map +1 -1
- package/dist/core/limits.js +18 -0
- package/dist/core/limits.js.map +1 -1
- package/dist/core/responses.d.ts +8 -0
- package/dist/core/responses.d.ts.map +1 -1
- package/dist/domains/communities/communities.d.ts +9 -9
- package/dist/domains/discover/discover.d.ts +7 -0
- package/dist/domains/discover/discover.d.ts.map +1 -1
- package/dist/domains/feed/feed.d.ts +11 -11
- package/dist/domains/onboarding/onboarding.d.ts +245 -21
- package/dist/domains/onboarding/onboarding.d.ts.map +1 -1
- package/dist/domains/onboarding/onboarding.js +104 -16
- package/dist/domains/onboarding/onboarding.js.map +1 -1
- package/dist/domains/products/products.d.ts +3 -3
- package/dist/domains/profile/founder-profile.d.ts +28 -0
- package/dist/domains/profile/founder-profile.d.ts.map +1 -1
- package/dist/domains/profile/founder-profile.js +3 -0
- package/dist/domains/profile/founder-profile.js.map +1 -1
- package/dist/domains/profile/my-profile.d.ts +386 -0
- package/dist/domains/profile/my-profile.d.ts.map +1 -0
- package/dist/domains/profile/my-profile.js +52 -0
- package/dist/domains/profile/my-profile.js.map +1 -0
- package/dist/domains/waitlist/waitlist.d.ts +68 -0
- package/dist/domains/waitlist/waitlist.d.ts.map +1 -0
- package/dist/domains/waitlist/waitlist.js +64 -0
- package/dist/domains/waitlist/waitlist.js.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,6 +99,88 @@ instance; this package must not bring its own.
|
|
|
99
99
|
|
|
100
100
|
---
|
|
101
101
|
|
|
102
|
+
## Breaking in 0.16.0: onboarding in nine steps (2026-10-18)
|
|
103
|
+
|
|
104
|
+
The user's rework of onboarding. The finish body takes the same answers plus one.
|
|
105
|
+
|
|
106
|
+
- **Breaking:** `ONBOARDING_STEP_KEYS` is nine: `basics` (full name, gender,
|
|
107
|
+
date of birth, nothing else), `photo`, `professional` (title, about, skills),
|
|
108
|
+
then `contact`, `location`, `goals`, `interests`, `business`, `guidelines` as
|
|
109
|
+
before. `identity` and `ONBOARDING_STEP_SCHEMAS.identity` are gone;
|
|
110
|
+
`ONBOARDING_TOTAL_STEPS` is 9. The resume cursor is an index into this list:
|
|
111
|
+
the backend translates a cursor saved under the seven steps once, by step
|
|
112
|
+
name (its progress rows carry `stepsVersion`), so nobody resumes on the wrong
|
|
113
|
+
step or loses an answer.
|
|
114
|
+
- **Breaking:** `onboardingFormSchema` gains `legalStructure` (nullable), so a
|
|
115
|
+
form built from it must hold the key.
|
|
116
|
+
- **New:** `LEGAL_STRUCTURE_VALUES` / `legalStructureSchema` / `LegalStructure`:
|
|
117
|
+
how a venture is registered in India (sole proprietorship, partnership, LLP,
|
|
118
|
+
OPC, private and public limited, Section 8, trust or society, co-operative),
|
|
119
|
+
or not yet, or outside India. Optional on the finish body and the business
|
|
120
|
+
step; stored on the profile's venture beside `businessType`, and shown only
|
|
121
|
+
to the member (below).
|
|
122
|
+
- **New: the member's private answers in Me** (`domains/profile/my-profile.ts`,
|
|
123
|
+
the user, 2026-10-18): `GET`/`PUT /profiles/me/business` (`myBusinessSchema`,
|
|
124
|
+
`putMyBusinessBodySchema`: the WHOLE venture with its `businessType` and
|
|
125
|
+
`legalStructure`, which are `myVentureSchema`, or `null` to remove it) and
|
|
126
|
+
`GET`/`PUT /profiles/me/interests` (`myInterestsSchema`,
|
|
127
|
+
`putMyInterestsBodySchema`). Owner only: none of the three is on
|
|
128
|
+
`founderProfileSchema`, a card, a byline or a member's page.
|
|
129
|
+
- **Stricter:** `interestsSchema` is the ONE interests rule, used by the finish
|
|
130
|
+
body and the Me editor, and it now refuses a topic twice (`topicsDuplicate`):
|
|
131
|
+
three copies of one topic met the minimum of three. Neither client sends one.
|
|
132
|
+
- **New:** `splitFullName(fullName)`: the first and last name a full name
|
|
133
|
+
deduces to, at the first space; a one-word name is whole. Derived, never
|
|
134
|
+
stored: `displayName` stays the one owner of a name.
|
|
135
|
+
- **Appended:** `GOAL_VALUES` +7 (`get_feedback`, `find_testers`,
|
|
136
|
+
`mentor_others`, `invest_in_startups`, `join_startup`,
|
|
137
|
+
`find_service_providers`, `attend_events`); `BUSINESS_TYPE_VALUES` +5
|
|
138
|
+
(`freelancer`, `agency`, `social_enterprise`, `family_business`, `franchise`).
|
|
139
|
+
Nothing renamed or removed.
|
|
140
|
+
- **Deploy order: the backend, then the web straight after.** A 0.15 backend
|
|
141
|
+
refuses the `legalStructure` draft key and steps above 7, so a 0.16 web on it
|
|
142
|
+
is stuck at the business step; a 0.15 web cannot parse a 9-step status or a
|
|
143
|
+
card holding a new goal. Open tabs and an installed app's cached copy keep the
|
|
144
|
+
old bundle until they update.
|
|
145
|
+
- **Rollback floor:** once a member saves a new goal, a build below 0.16
|
|
146
|
+
cannot parse their card, member page or own profile; roll back only after a
|
|
147
|
+
backfill. A new business type or registration travels on none of those (only
|
|
148
|
+
on the owner's own `/profiles/me/business`, new in 0.16), so it does not
|
|
149
|
+
move the floor.
|
|
150
|
+
- **Backend, at deploy:** no new index and no migration (old cursors are
|
|
151
|
+
translated on the member's next visit).
|
|
152
|
+
|
|
153
|
+
## Breaking in 0.15.0: the launch waitlist (2026-10-16)
|
|
154
|
+
|
|
155
|
+
Until the launch instant `FC_LAUNCH_AT` (a server-only env on BOTH the backend
|
|
156
|
+
and the web; AWS main only: Tuesday 20 October 2026, 12:00 noon IST), joining is
|
|
157
|
+
signing in, and the first `FOUNDING_PLACES` places get the membership free
|
|
158
|
+
(0.14.0). Unset means launched, so nothing changes where it is not set. Design:
|
|
159
|
+
`founder-circle-backend/docs/waitlist.md`. No export is removed.
|
|
160
|
+
|
|
161
|
+
- **New:** `src/domains/waitlist/waitlist.ts`, in route order:
|
|
162
|
+
`waitlistStatusSchema` for `GET /waitlist` (public: `waiting`, `launchAt`,
|
|
163
|
+
`foundingPlaces`, `foundingPlacesLeft`); `myWaitlistSchema` for
|
|
164
|
+
`GET /waitlist/me` (`place` or null, `canJoin`, `refusal`: `closed` |
|
|
165
|
+
`staff` | `place_used` or null); `waitlistPlaceSchema` for
|
|
166
|
+
`POST /waitlist/join` (`place`, `joinedAt`, `founding`).
|
|
167
|
+
- **New error codes, so a client's exhaustive word map must add them:**
|
|
168
|
+
`NOT_LAUNCHED` (403; every write but the waitlist's few, while waiting, for
|
|
169
|
+
everyone, staff included), `WAITLIST_CLOSED` (409; joining after the launch),
|
|
170
|
+
`WAITLIST_STAFF` (403; staff never take a place), `WAITLIST_PLACE_USED` (409;
|
|
171
|
+
one place per inbox and per sign-in, ever: addresses reaching one inbox
|
|
172
|
+
(`x+1@`, Gmail's dots) share one, and so does a deleted account's sign-in).
|
|
173
|
+
- **New:** `refundWindowEndsAt(paidAt)`: the refund window's last moment, the
|
|
174
|
+
end of the 7th day after the paying day in India (the server and the staff
|
|
175
|
+
screen share it).
|
|
176
|
+
- **Breaking on main while waiting:** a 0.14.0 web cannot parse `NOT_LAUNCHED`.
|
|
177
|
+
Deploy the backend and the web together, both on 0.15.0, with `FC_LAUNCH_AT`
|
|
178
|
+
ALREADY in both env files: started without it, main runs launched (fully
|
|
179
|
+
open) until it is set.
|
|
180
|
+
- **Backend, at deploy:** new collections `waitlist_entries` (unique
|
|
181
|
+
`waitlist_by_user`, `waitlist_by_place`) and `waitlist_counters`; run
|
|
182
|
+
`sync-indexes` (the dry run must say 0 differing).
|
|
183
|
+
|
|
102
184
|
## Changes in 0.14.0: founding places come from the launch waitlist (2026-10-16)
|
|
103
185
|
|
|
104
186
|
The user's rule: the first `FOUNDING_PLACES` (100) people to join the launch
|
|
@@ -543,8 +625,13 @@ is imported, so a server process still up on 1 January rejects the new year unti
|
|
|
543
625
|
somebody restarts it.
|
|
544
626
|
|
|
545
627
|
**Changing a member of an enum array is a data change, not a type change.** The
|
|
546
|
-
|
|
547
|
-
|
|
628
|
+
`*_VALUES` arrays the backend's profile model uses (stage, industry, skill, goal,
|
|
629
|
+
gender, topic, business type, legal structure) are Mongoose `enum` constraints.
|
|
630
|
+
Removing or renaming a value orphans documents already saved with it. Appending
|
|
631
|
+
is safe for the database, but not for an OLDER CLIENT, which parses strictly and
|
|
632
|
+
refuses a value it does not know: deploy the readers (backend, then web) before
|
|
633
|
+
anything can write the new value, and a rollback below the version that added it
|
|
634
|
+
needs a backfill first.
|
|
548
635
|
`STARTUP_STAGE_VALUES` is ordered earliest to latest and that order is load
|
|
549
636
|
bearing, so append at the end and never insert.
|
|
550
637
|
|
|
@@ -553,7 +640,7 @@ bearing, so append at the end and never insert.
|
|
|
553
640
|
## Settled since the scaffold
|
|
554
641
|
|
|
555
642
|
- **The npm name and the first publish:** `founder-schema`, 0.1.0, by the user.
|
|
556
|
-
- **The onboarding steps:**
|
|
643
|
+
- **The onboarding steps:** nine since 0.16.0 (the user, 2026-10-18), seven before (ruled 2026-09-22); see `src/domains/onboarding/onboarding.ts`.
|
|
557
644
|
|
|
558
645
|
## Contract decisions, 2026-09-21
|
|
559
646
|
|
package/dist/core/common.d.ts
CHANGED
|
@@ -238,11 +238,12 @@ export type Skill = z.infer<typeof skillSchema>;
|
|
|
238
238
|
* venture works only for a member who ALREADY HAS a venture row, and somebody
|
|
239
239
|
* who wants to start a company is precisely the member with no venture at all,
|
|
240
240
|
* so there is nothing to infer from. It also cannot express a founder with a
|
|
241
|
-
* running company who wants to start another.
|
|
242
|
-
*
|
|
243
|
-
*
|
|
241
|
+
* running company who wants to start another. The others were all asks of other
|
|
242
|
+
* people and this one an ask of the product, which is the whole of the oddness.
|
|
243
|
+
* (hary, 2026-09-21.) Since 0.16.0 the list also holds offers (`mentor_others`,
|
|
244
|
+
* `invest_in_startups`) and a second ask of the product (`attend_events`).
|
|
244
245
|
*/
|
|
245
|
-
export declare const GOAL_VALUES: readonly ["find_cofounder", "find_investors", "find_customers", "hiring", "partnerships", "mentorship", "grow_network", "business_ideas", "market_insights", "learn_startup", "start_company"];
|
|
246
|
+
export declare const GOAL_VALUES: readonly ["find_cofounder", "find_investors", "find_customers", "hiring", "partnerships", "mentorship", "grow_network", "business_ideas", "market_insights", "learn_startup", "start_company", "get_feedback", "find_testers", "mentor_others", "invest_in_startups", "join_startup", "find_service_providers", "attend_events"];
|
|
246
247
|
export declare const goalSchema: z.ZodEnum<{
|
|
247
248
|
find_cofounder: "find_cofounder";
|
|
248
249
|
find_investors: "find_investors";
|
|
@@ -255,6 +256,13 @@ export declare const goalSchema: z.ZodEnum<{
|
|
|
255
256
|
market_insights: "market_insights";
|
|
256
257
|
learn_startup: "learn_startup";
|
|
257
258
|
start_company: "start_company";
|
|
259
|
+
get_feedback: "get_feedback";
|
|
260
|
+
find_testers: "find_testers";
|
|
261
|
+
mentor_others: "mentor_others";
|
|
262
|
+
invest_in_startups: "invest_in_startups";
|
|
263
|
+
join_startup: "join_startup";
|
|
264
|
+
find_service_providers: "find_service_providers";
|
|
265
|
+
attend_events: "attend_events";
|
|
258
266
|
}>;
|
|
259
267
|
export type Goal = z.infer<typeof goalSchema>;
|
|
260
268
|
/**
|
|
@@ -281,6 +289,24 @@ export type Gender = z.infer<typeof genderSchema>;
|
|
|
281
289
|
* words it.
|
|
282
290
|
*/
|
|
283
291
|
export declare const displayNameSchema: z.ZodString;
|
|
292
|
+
/**
|
|
293
|
+
* A full name's first and last name, DEDUCED, never asked (the user,
|
|
294
|
+
* 2026-10-18: onboarding asks one "Full name" and works the two out from the
|
|
295
|
+
* space). The first word is the first name and everything after the first
|
|
296
|
+
* space is the last name, kept as written ("Asha Rao Kulkarni" is Asha and
|
|
297
|
+
* Rao Kulkarni).
|
|
298
|
+
*
|
|
299
|
+
* ⚠ A ONE-WORD NAME IS A WHOLE NAME. Many people in India go by a single name,
|
|
300
|
+
* so `lastName` is then `''`, and nothing may refuse it for that.
|
|
301
|
+
*
|
|
302
|
+
* Derived wherever it is needed, never stored as a second copy of the name:
|
|
303
|
+
* `displayName` stays the one owner of a member's name, so a rename can never
|
|
304
|
+
* leave a stale first name behind.
|
|
305
|
+
*/
|
|
306
|
+
export declare function splitFullName(fullName: string): {
|
|
307
|
+
firstName: string;
|
|
308
|
+
lastName: string;
|
|
309
|
+
};
|
|
284
310
|
/**
|
|
285
311
|
* Indian mobile number: ten raw digits, no country code, matching the standard
|
|
286
312
|
* used across this family. Display adds the `+91`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/core/common.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,OAAO,KAAG,OAGvD,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,GAAI,kBAAe,yDAC8B,CAAC;AAEpF;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,KAAK,MAAM,2DAKlC,CAAC;AAEzC,4EAA4E;AAC5E,eAAO,MAAM,cAAc,wDAGS,CAAC;AACrC,yFAAyF;AACzF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAI5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,aAAa,UAIxB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAA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CAAC,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;iBAGjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE3E;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;kBAA4B,CAAC;AACjE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAIxE;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;iBAYhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,kFAAkF;AAClF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
package/dist/core/common.js
CHANGED
|
@@ -312,9 +312,10 @@ export const skillSchema = z.enum(SKILL_VALUES);
|
|
|
312
312
|
* venture works only for a member who ALREADY HAS a venture row, and somebody
|
|
313
313
|
* who wants to start a company is precisely the member with no venture at all,
|
|
314
314
|
* so there is nothing to infer from. It also cannot express a founder with a
|
|
315
|
-
* running company who wants to start another.
|
|
316
|
-
*
|
|
317
|
-
*
|
|
315
|
+
* running company who wants to start another. The others were all asks of other
|
|
316
|
+
* people and this one an ask of the product, which is the whole of the oddness.
|
|
317
|
+
* (hary, 2026-09-21.) Since 0.16.0 the list also holds offers (`mentor_others`,
|
|
318
|
+
* `invest_in_startups`) and a second ask of the product (`attend_events`).
|
|
318
319
|
*/
|
|
319
320
|
export const GOAL_VALUES = [
|
|
320
321
|
'find_cofounder',
|
|
@@ -328,6 +329,18 @@ export const GOAL_VALUES = [
|
|
|
328
329
|
'market_insights',
|
|
329
330
|
'learn_startup',
|
|
330
331
|
'start_company',
|
|
332
|
+
// 0.16.0 (the user, 2026-10-18: "a few more ... cover most of the goals"):
|
|
333
|
+
// the journey's own asks (feedback on an idea, early testers), the other
|
|
334
|
+
// side of mentorship and of fundraising (mentoring, investing), and three
|
|
335
|
+
// more a founder network is asked for: joining a startup, finding
|
|
336
|
+
// service providers, and events. Appended, per the rule above.
|
|
337
|
+
'get_feedback',
|
|
338
|
+
'find_testers',
|
|
339
|
+
'mentor_others',
|
|
340
|
+
'invest_in_startups',
|
|
341
|
+
'join_startup',
|
|
342
|
+
'find_service_providers',
|
|
343
|
+
'attend_events',
|
|
331
344
|
];
|
|
332
345
|
export const goalSchema = z.enum(GOAL_VALUES);
|
|
333
346
|
// ─── Gender ──────────────────────────────────────────────────────────────────
|
|
@@ -350,6 +363,27 @@ export const genderSchema = z.enum(GENDER_VALUES);
|
|
|
350
363
|
* words it.
|
|
351
364
|
*/
|
|
352
365
|
export const displayNameSchema = z.string().trim().min(1).max(DISPLAY_NAME_MAX);
|
|
366
|
+
/**
|
|
367
|
+
* A full name's first and last name, DEDUCED, never asked (the user,
|
|
368
|
+
* 2026-10-18: onboarding asks one "Full name" and works the two out from the
|
|
369
|
+
* space). The first word is the first name and everything after the first
|
|
370
|
+
* space is the last name, kept as written ("Asha Rao Kulkarni" is Asha and
|
|
371
|
+
* Rao Kulkarni).
|
|
372
|
+
*
|
|
373
|
+
* ⚠ A ONE-WORD NAME IS A WHOLE NAME. Many people in India go by a single name,
|
|
374
|
+
* so `lastName` is then `''`, and nothing may refuse it for that.
|
|
375
|
+
*
|
|
376
|
+
* Derived wherever it is needed, never stored as a second copy of the name:
|
|
377
|
+
* `displayName` stays the one owner of a member's name, so a rename can never
|
|
378
|
+
* leave a stale first name behind.
|
|
379
|
+
*/
|
|
380
|
+
export function splitFullName(fullName) {
|
|
381
|
+
const name = fullName.trim().replace(/\s+/g, ' ');
|
|
382
|
+
const space = name.indexOf(' ');
|
|
383
|
+
return space === -1
|
|
384
|
+
? { firstName: name, lastName: '' }
|
|
385
|
+
: { firstName: name.slice(0, space), lastName: name.slice(space + 1) };
|
|
386
|
+
}
|
|
353
387
|
// ─── Phone ───────────────────────────────────────────────────────────────────
|
|
354
388
|
/**
|
|
355
389
|
* Indian mobile number: ten raw digits, no country code, matching the standard
|
package/dist/core/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/core/common.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAc,EAAW,EAAE;IAChE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IACvE,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,yEAAyE;AACzE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAS,GAAG,GAAG,EAAE,EAAE,CACvD,CAAC,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAEpF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAsB,KAAQ,EAAE,GAAW,EAAE,EAAE,CAC5E,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5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AC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC7E,GAAG,EAAE,CAAC,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAChF,CAAC,CAAC;AAIH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,cAAc,CAAC,QAAQ,EAAE,CAAC;AAGjE,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C;;;;;OAKG;IACH,KAAK,EAAE,CAAC,CAAC,UAAU,CACjB,sBAAsB,EACtB,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAC7E;IACD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC","sourcesContent":["/**\n * founder-schema — Shared helpers and core enums\n *\n * The stable building blocks reused across every Founder Circle schema.\n * Anything that both the backend and a client need to agree on lives here.\n *\n * @module founder-schema/core/common\n */\n\nimport { z } from 'zod';\nimport {\n CITY_MAX,\n COUNTRY_MAX,\n DISPLAY_NAME_MAX,\n LINK_URL_MAX,\n PAGE_SIZE_DEFAULT,\n PAGE_SIZE_MAX,\n STATE_MAX,\n} from './limits.js';\nimport { VALIDATION_MESSAGE } from './validation.js';\n\n// ─── String helpers ──────────────────────────────────────────────────────────\n\n/**\n * Converts empty / whitespace-only strings to `undefined` so Zod `.optional()`\n * treats them as \"not provided\".\n *\n * Why this exists: an HTML form submits `\"\"` for a cleared field, and without\n * this an optional field would be stored as an empty string rather than left\n * alone. Jansathi shipped that bug in dating onboarding.\n */\nexport const emptyStringToUndefined = (value: unknown): unknown => {\n if (typeof value === 'string' && value.trim() === '') return undefined;\n return value;\n};\n\n/** Optional trimmed string. Empty strings are coerced to `undefined`. */\nexport const optionalTrimmedString = (maxLength = 100) =>\n z.preprocess(emptyStringToUndefined, z.string().trim().max(maxLength).optional());\n\n/**\n * A repeated query param (`?skill=growth&skill=sales`) or a single value,\n * always as an array, at most `max` values.\n *\n * Express gives `string` for one occurrence and `string[]` for several, so\n * without this the same URL shape parses two different ways. EMPTY values are\n * dropped (`?industry=` is a select the member just reset): asking for fewer\n * filters is never a 400.\n */\nexport const multiValueQuery = <T extends z.ZodType>(inner: T, max: number) =>\n z.preprocess((value) => {\n if (value === undefined || value === null) return undefined;\n const list = (Array.isArray(value) ? value : [value]).filter((v) => v !== '');\n return list.length > 0 ? list : undefined;\n }, z.array(inner).max(max).optional());\n\n/** A Mongo ObjectId as it crosses the wire: 24 lowercase hex characters. */\nexport const objectIdSchema = z\n .string()\n .regex(/^[0-9a-f]{24}$/i, VALIDATION_MESSAGE.invalidId)\n .transform((v) => v.toLowerCase());\n/** Named for what it is on the wire, so it never collides with Mongoose's `ObjectId`. */\nexport type ObjectIdString = z.infer<typeof objectIdSchema>;\n\n// ─── URLs ────────────────────────────────────────────────────────────────────\n\n/**\n * A URL safe to store and, after the consumer's own check, to render.\n *\n * Use this for EVERY member-supplied URL. Never bare `z.url()`: it accepts any\n * scheme the URL parser accepts, so `javascript:alert(document.cookie)`,\n * `data:text/html,<script>...`, `vbscript:` and `file:///etc/passwd` all pass.\n * Each of those is stored XSS the moment a client renders it as an `href`, and\n * `data:` is the same in an `<img src>`.\n *\n * `hostname` is restricted too, not only the scheme. A bare host like\n * `localhost` or a literal IP is refused, which closes server-side request\n * forgery: this product runs on EC2 with an instance role, so a member-supplied\n * `http://169.254.169.254/latest/meta-data/` that anything server-side ever\n * fetches is a credential read.\n *\n * Validating here is necessary and not sufficient. A consumer still treats a\n * stored URL as untrusted at render time, because rows written before this\n * existed were never checked.\n *\n * ⚠️ IF THIS EVER GROWS A HOST ALLOWLIST, compare the PARSED hostname for\n * exact equality. Never `includes`, never `endsWith`, never a regex over the\n * whole URL. Each of these is a real bypass of a naive \"is it YouTube\" check,\n * and all three read as obviously fine:\n *\n * https://evil.example/?next=youtube.com/watch contains the string\n * youtube.com.evil.example starts with it\n * youtu.be.evil.example a suffix check passes it\n *\n * The same mistake in the opposite direction to the `javascript:` hole: there\n * the scheme was too permissive, here the host check only LOOKS strict.\n * (krish hit this rendering inline video, 2026-09-21, and handles it by parsing\n * and comparing the hostname exactly.)\n */\nexport const safeUrlSchema = z.url({\n protocol: /^https?$/,\n hostname: z.regexes.domain,\n error: VALIDATION_MESSAGE.urlInvalid,\n});\nexport type SafeUrl = z.infer<typeof safeUrlSchema>;\n\n/**\n * A URL a member TYPES: `safeUrlSchema` plus the `LINK_URL_MAX` ceiling, so\n * every member URL carries the same cap and no consumer has to remember it.\n *\n * Two schemas, not one, because the cap is about what a person types and is\n * wrong for what the server reads from elsewhere. Until 0.2.0 there was only\n * this one, and it capped a link preview's CDN image URL too: one 314-character\n * `imageUrl` would have failed a whole feed page.\n */\nexport const httpUrlSchema = safeUrlSchema.max(LINK_URL_MAX);\nexport type HttpUrl = z.infer<typeof httpUrlSchema>;\n\n/**\n * True when `url` parses and its hostname is EXACTLY one of `hosts`\n * (lowercase). The one host check in this package, written the way the warning\n * on `safeUrlSchema` demands: parsed, compared for equality, never matched as\n * text. `youtube.com.evil.example` and `evil.example/?u=youtube.com` are refused.\n */\nexport function isUrlOnHost(url: string, hosts: readonly string[]): boolean {\n try {\n return hosts.includes(new URL(url).hostname.toLowerCase());\n } catch {\n return false;\n }\n}\n\n/** A typed URL (`httpUrlSchema`) that must also live on one of `hosts`. */\nexport const httpUrlOnHosts = (hosts: readonly string[], message: string) =>\n httpUrlSchema.refine((url) => isUrlOnHost(url, hosts), { error: message });\n\n/**\n * What a product needs before it can be listed in Discover (0.6.0). Here, not\n * in the products domain, because an error's details carry it\n * (`PRODUCT_NOT_LISTABLE` -> `details.missing`) and core never imports a domain.\n */\nexport const PRODUCT_LISTING_REQUIREMENT_VALUES = ['logo', 'tagline', 'screenshot'] as const;\nexport const productListingRequirementSchema = z.enum(PRODUCT_LISTING_REQUIREMENT_VALUES);\nexport type ProductListingRequirement = z.infer<typeof productListingRequirementSchema>;\n\n/**\n * The hosts a shared video may come from. The user's ruling (2026-09-21): video\n * is shared as a link and played in the card, never uploaded. The web plays it\n * through youtube-nocookie.com, the one video frame its CSP admits.\n */\nexport const YOUTUBE_HOSTS = [\n 'youtube.com',\n 'www.youtube.com',\n 'm.youtube.com',\n 'youtu.be',\n // The privacy-mode player's own links (0.7.0).\n 'youtube-nocookie.com',\n 'www.youtube-nocookie.com',\n] as const;\n\n/**\n * The 11-character id of a YouTube VIDEO link, or null for anything else (a\n * channel, a playlist, the home page, another site): what a page can embed.\n * Reads `youtu.be/<id>`, `/watch?v=<id>`, and `/shorts/`, `/embed/`, `/live/<id>`\n * on a `YOUTUBE_HOSTS` host (0.7.0).\n */\nexport function youtubeVideoId(url: string): string | null {\n let u: URL;\n try {\n u = new URL(url);\n } catch {\n return null;\n }\n const host = u.hostname.toLowerCase();\n if (!(YOUTUBE_HOSTS as readonly string[]).includes(host)) return null;\n const id =\n host === 'youtu.be'\n ? (u.pathname.split('/')[1] ?? null)\n : u.pathname === '/watch'\n ? u.searchParams.get('v')\n : (/^\\/(?:shorts|embed|live)\\/([^/]+)/.exec(u.pathname)?.[1] ?? null);\n return id && /^[A-Za-z0-9_-]{11}$/.test(id) ? id : null;\n}\n\n// ─── Username ────────────────────────────────────────────────────────────────\n\n/**\n * Public handle. Derived by the server at onboarding, changeable later.\n *\n * Rules are deliberately narrow because the handle appears in URLs and in\n * mentions: lowercase letters, digits, underscore and a single dot, 3 to 30\n * characters, must start with a letter.\n *\n * This is the FORMAT, and it is what every read shape uses. A handle being\n * CHOSEN must also not be reserved: that is `chosenUsernameSchema`.\n */\nexport const USERNAME_MIN = 3;\nexport const USERNAME_MAX = 30;\n\nexport const usernameSchema = z\n .string()\n .trim()\n .toLowerCase()\n // Plain bounds: the client words them from the issue's own minimum/maximum.\n .min(USERNAME_MIN)\n .max(USERNAME_MAX)\n .regex(/^[a-z][a-z0-9_]*(\\.[a-z0-9_]+)?$/, VALIDATION_MESSAGE.usernameInvalid);\nexport type Username = z.infer<typeof usernameSchema>;\n\n/**\n * Handles this product keeps for itself: route names a handle would shadow,\n * and words that would let a member pass as staff.\n *\n * ⚠ HERE, IN THE CONTRACT, since 0.2.0. It used to live in the backend so it\n * could grow without a publish, and nothing ever read it: the server derived\n * handles without checking it, so a member called \"Support\" was handed\n * `support`. One list, read by the server when it derives a handle and by any\n * form that lets a member choose one, is worth a publish per addition.\n *\n * Matched exactly, after lowercasing.\n */\nexport const RESERVED_USERNAMES = [\n 'admin',\n 'about',\n 'api',\n 'chat',\n 'discover',\n 'feed',\n 'founder',\n 'foundercircle',\n 'help',\n 'home',\n 'me',\n 'meetup',\n 'moderator',\n 'onboarding',\n 'settings',\n 'staff',\n 'superadmin',\n 'support',\n 'system',\n 'team',\n] as const;\n\nconst RESERVED = new Set<string>(RESERVED_USERNAMES);\n\nexport function isReservedUsername(handle: string): boolean {\n return RESERVED.has(handle.trim().toLowerCase());\n}\n\n/**\n * A handle a member is CHOOSING: the format, and not reserved.\n *\n * ⚠ Not used on read shapes, deliberately. A handle stored before the reserved\n * check existed must still READ, or one member's old handle would fail every\n * page that shows their name.\n */\nexport const chosenUsernameSchema = usernameSchema.refine((u) => !isReservedUsername(u), {\n error: VALIDATION_MESSAGE.usernameReserved,\n});\n\n// ─── Founder-facing enums ────────────────────────────────────────────────────\n\n/**\n * Stage of the founder's current venture.\n *\n * Ordered from earliest to latest so a range filter can compare by index. Add\n * new stages at the END or the stored ordinal of existing rows shifts.\n */\nexport const STARTUP_STAGE_VALUES = [\n 'idea',\n 'validation',\n 'mvp',\n 'pre_seed',\n 'seed',\n 'series_a_plus',\n 'profitable',\n 'exited',\n] as const;\nexport const startupStageSchema = z.enum(STARTUP_STAGE_VALUES);\nexport type StartupStage = z.infer<typeof startupStageSchema>;\n\n/**\n * Industry the venture operates in. Kept as a closed list so Discover filters\n * are a single indexed equality match rather than a text search.\n */\nexport const INDUSTRY_VALUES = [\n 'agritech',\n 'ai_ml',\n 'b2b_saas',\n 'consumer',\n 'climate',\n 'd2c',\n 'deeptech',\n 'edtech',\n 'fintech',\n 'gaming',\n 'healthtech',\n 'logistics',\n 'manufacturing',\n 'marketplace',\n 'media',\n 'mobility',\n 'proptech',\n 'robotics',\n 'services',\n 'space',\n 'other',\n] as const;\nexport const industrySchema = z.enum(INDUSTRY_VALUES);\nexport type Industry = z.infer<typeof industrySchema>;\n\n/**\n * What the founder brings. Free-text skills were considered and rejected: two\n * people typing \"growth\" and \"Growth Marketing\" would never match each other in\n * a filter, and the Discover tab is the whole point of the product.\n */\nexport const SKILL_VALUES = [\n 'engineering',\n 'product',\n 'design',\n 'data',\n 'growth',\n 'sales',\n 'marketing',\n 'operations',\n 'finance',\n 'legal',\n 'hr_people',\n 'supply_chain',\n 'research',\n 'fundraising',\n 'community',\n] as const;\nexport const skillSchema = z.enum(SKILL_VALUES);\nexport type Skill = z.infer<typeof skillSchema>;\n\n/**\n * What the member is here for. ONE list, replacing three.\n *\n * This was `lookingFor` with six values. The design draws eight \"Goals &\n * Passion\" tiles and four more on the business step; all three were the same\n * idea at three grains, and shipping them together would have meant nobody\n * could say which one Discover filters on - the answer settled by whichever\n * query got written first. Merged on hary's ruling, 2026-09-21, while there\n * were still no rows in any database.\n *\n * ⚠️ Stored per member and used as a Mongoose enum. Append only; removing a\n * value orphans documents already saved with it.\n *\n * ⚠️ `start_company` READS ODDLY next to its neighbours and is correct. It was\n * queried on the grounds that it restates `venture.stage: 'idea'`; it does not,\n * and the reason is worth keeping so nobody re-opens it. Inferring it from the\n * venture works only for a member who ALREADY HAS a venture row, and somebody\n * who wants to start a company is precisely the member with no venture at all,\n * so there is nothing to infer from. It also cannot express a founder with a\n * running company who wants to start another. Every other value is an ask of\n * other people and this one is an ask of the product, which is the whole of the\n * oddness. (hary, 2026-09-21.)\n */\nexport const GOAL_VALUES = [\n 'find_cofounder',\n 'find_investors',\n 'find_customers',\n 'hiring',\n 'partnerships',\n 'mentorship',\n 'grow_network',\n 'business_ideas',\n 'market_insights',\n 'learn_startup',\n 'start_company',\n] as const;\nexport const goalSchema = z.enum(GOAL_VALUES);\nexport type Goal = z.infer<typeof goalSchema>;\n\n// ─── Gender ──────────────────────────────────────────────────────────────────\n\n/**\n * Demographic only. Nothing here computes anything from it, unlike the sibling\n * gym product where gender feeds body-metric maths.\n *\n * Takes the family's three values and ADDS one rather than renaming any: a\n * network for founders should let somebody decline the question without having\n * to describe themselves as \"other\".\n */\nexport const GENDER_VALUES = ['male', 'female', 'other', 'prefer_not_to_say'] as const;\nexport const genderSchema = z.enum(GENDER_VALUES);\nexport type Gender = z.infer<typeof genderSchema>;\n\n// ─── Display name ────────────────────────────────────────────────────────────\n\n/**\n * The name a member is shown by. ONE rule for every body that writes it:\n * onboarding's finish, the profile patch and the personal-details patch, so a\n * name one accepts the others can never refuse. Plain bounds, no custom\n * message: `too_small` with minimum 1 already says \"required\", and the client\n * words it.\n */\nexport const displayNameSchema = z.string().trim().min(1).max(DISPLAY_NAME_MAX);\n\n// ─── Phone ───────────────────────────────────────────────────────────────────\n\n/**\n * Indian mobile number: ten raw digits, no country code, matching the standard\n * used across this family. Display adds the `+91`.\n *\n * ⚠️ WHERE IT IS STORED IS NOT A SCHEMA QUESTION, and it has been ruled: the\n * phone lives on the account mirror, never as a second copy on the profile.\n * Two stored copies drift the first time somebody edits one, and the profile's\n * would be the copy nobody keeps in sync.\n */\nexport const phoneSchema = z\n .string()\n .trim()\n .regex(/^[6-9]\\d{9}$/, VALIDATION_MESSAGE.phoneInvalid);\nexport type Phone = z.infer<typeof phoneSchema>;\n\n// ─── Location ────────────────────────────────────────────────────────────────\n\n/**\n * Where the founder is based. City and country are what Discover filters on.\n *\n * ONE SHAPE for the profile, the Me tab's patch, onboarding's finish and the\n * location suggestion. It was written out three times until 0.2.0, the same\n * kind of copy that let the profile model lose Instagram.\n *\n * ⚠ `country` is REQUIRED and has NO default. A default here (it used to be\n * `'India'`) is destructive on every write path: a founder in Berlin who\n * corrects only their city would be moved to India by a value they never saw.\n * A body that carries a location carries the whole location. Every stored\n * location has a country, because the model requires one, so the read side\n * loses nothing.\n *\n * This is a DECLARED location, not a GPS reading. Jansathi's rule applies\n * here too: never write a declared location from a GPS capture.\n */\nexport const locationSchema = z.object({\n city: z.string().trim().min(1).max(CITY_MAX),\n state: optionalTrimmedString(STATE_MAX),\n country: z.string().trim().min(1).max(COUNTRY_MAX),\n});\nexport type FounderLocation = z.infer<typeof locationSchema>;\n\n/**\n * `GET /api/v1/location/areas/reverse?lat=&lng=`: plain decimal degrees.\n *\n * A QUERY, so coercion is right here: everything in a URL is a string. An\n * emptied parameter is \"missing\", never 0, because 0,0 is a real place in the\n * Gulf of Guinea and would be looked up rather than refused.\n */\nexport const coordinatesQuerySchema = z.object({\n lat: z.preprocess(emptyStringToUndefined, z.coerce.number().min(-90).max(90)),\n lng: z.preprocess(emptyStringToUndefined, z.coerce.number().min(-180).max(180)),\n});\nexport type CoordinatesQuery = z.infer<typeof coordinatesQuerySchema>;\nexport type CoordinatesQueryInput = z.input<typeof coordinatesQuerySchema>;\n\n/**\n * The city these coordinates look like, for the member to CONFIRM, or `null`\n * when the lookup could not place them confidently (or they are outside India,\n * whose area data is all there is). A suggestion, never a write: only what the\n * member then submits becomes their location.\n */\nexport const suggestedLocationSchema = locationSchema.nullable();\nexport type SuggestedLocation = z.infer<typeof suggestedLocationSchema>;\n\n// ─── Pagination ──────────────────────────────────────────────────────────────\n\n/**\n * Cursor pagination query. Feed and Discover both use it.\n *\n * Cursor, not page number: the community feed changes under the reader, and an\n * offset would repeat or skip posts as new ones land.\n */\nexport const paginationQuerySchema = z.object({\n /**\n * `?limit=` with nothing after it is treated as \"not provided\", not as a\n * validation failure. A client that clears the control sends the empty\n * string, and `z.coerce.number()` turns that into 0, which then fails\n * `.min(1)`: the member sees a 400 for a page they never asked to size.\n */\n limit: z.preprocess(\n emptyStringToUndefined,\n z.coerce.number().int().min(1).max(PAGE_SIZE_MAX).default(PAGE_SIZE_DEFAULT),\n ),\n cursor: z.string().trim().min(1).optional(),\n});\nexport type PaginationQuery = z.infer<typeof paginationQuerySchema>;\n/** What a client may put IN the URL: every field optional, numbers as strings. */\nexport type PaginationQueryInput = z.input<typeof paginationQuerySchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/core/common.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAc,EAAW,EAAE;IAChE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IACvE,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,yEAAyE;AACzE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAS,GAAG,GAAG,EAAE,EAAE,CACvD,CAAC,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC,CAA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MAAM,uBAAuB,GAAG,cAAc,CAAC,QAAQ,EAAE,CAAC;AAGjE,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C;;;;;OAKG;IACH,KAAK,EAAE,CAAC,CAAC,UAAU,CACjB,sBAAsB,EACtB,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAC7E;IACD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC","sourcesContent":["/**\n * founder-schema — Shared helpers and core enums\n *\n * The stable building blocks reused across every Founder Circle schema.\n * Anything that both the backend and a client need to agree on lives here.\n *\n * @module founder-schema/core/common\n */\n\nimport { z } from 'zod';\nimport {\n CITY_MAX,\n COUNTRY_MAX,\n DISPLAY_NAME_MAX,\n LINK_URL_MAX,\n PAGE_SIZE_DEFAULT,\n PAGE_SIZE_MAX,\n STATE_MAX,\n} from './limits.js';\nimport { VALIDATION_MESSAGE } from './validation.js';\n\n// ─── String helpers ──────────────────────────────────────────────────────────\n\n/**\n * Converts empty / whitespace-only strings to `undefined` so Zod `.optional()`\n * treats them as \"not provided\".\n *\n * Why this exists: an HTML form submits `\"\"` for a cleared field, and without\n * this an optional field would be stored as an empty string rather than left\n * alone. Jansathi shipped that bug in dating onboarding.\n */\nexport const emptyStringToUndefined = (value: unknown): unknown => {\n if (typeof value === 'string' && value.trim() === '') return undefined;\n return value;\n};\n\n/** Optional trimmed string. Empty strings are coerced to `undefined`. */\nexport const optionalTrimmedString = (maxLength = 100) =>\n z.preprocess(emptyStringToUndefined, z.string().trim().max(maxLength).optional());\n\n/**\n * A repeated query param (`?skill=growth&skill=sales`) or a single value,\n * always as an array, at most `max` values.\n *\n * Express gives `string` for one occurrence and `string[]` for several, so\n * without this the same URL shape parses two different ways. EMPTY values are\n * dropped (`?industry=` is a select the member just reset): asking for fewer\n * filters is never a 400.\n */\nexport const multiValueQuery = <T extends z.ZodType>(inner: T, max: number) =>\n z.preprocess((value) => {\n if (value === undefined || value === null) return undefined;\n const list = (Array.isArray(value) ? value : [value]).filter((v) => v !== '');\n return list.length > 0 ? list : undefined;\n }, z.array(inner).max(max).optional());\n\n/** A Mongo ObjectId as it crosses the wire: 24 lowercase hex characters. */\nexport const objectIdSchema = z\n .string()\n .regex(/^[0-9a-f]{24}$/i, VALIDATION_MESSAGE.invalidId)\n .transform((v) => v.toLowerCase());\n/** Named for what it is on the wire, so it never collides with Mongoose's `ObjectId`. */\nexport type ObjectIdString = z.infer<typeof objectIdSchema>;\n\n// ─── URLs ────────────────────────────────────────────────────────────────────\n\n/**\n * A URL safe to store and, after the consumer's own check, to render.\n *\n * Use this for EVERY member-supplied URL. Never bare `z.url()`: it accepts any\n * scheme the URL parser accepts, so `javascript:alert(document.cookie)`,\n * `data:text/html,<script>...`, `vbscript:` and `file:///etc/passwd` all pass.\n * Each of those is stored XSS the moment a client renders it as an `href`, and\n * `data:` is the same in an `<img src>`.\n *\n * `hostname` is restricted too, not only the scheme. A bare host like\n * `localhost` or a literal IP is refused, which closes server-side request\n * forgery: this product runs on EC2 with an instance role, so a member-supplied\n * `http://169.254.169.254/latest/meta-data/` that anything server-side ever\n * fetches is a credential read.\n *\n * Validating here is necessary and not sufficient. A consumer still treats a\n * stored URL as untrusted at render time, because rows written before this\n * existed were never checked.\n *\n * ⚠️ IF THIS EVER GROWS A HOST ALLOWLIST, compare the PARSED hostname for\n * exact equality. Never `includes`, never `endsWith`, never a regex over the\n * whole URL. Each of these is a real bypass of a naive \"is it YouTube\" check,\n * and all three read as obviously fine:\n *\n * https://evil.example/?next=youtube.com/watch contains the string\n * youtube.com.evil.example starts with it\n * youtu.be.evil.example a suffix check passes it\n *\n * The same mistake in the opposite direction to the `javascript:` hole: there\n * the scheme was too permissive, here the host check only LOOKS strict.\n * (krish hit this rendering inline video, 2026-09-21, and handles it by parsing\n * and comparing the hostname exactly.)\n */\nexport const safeUrlSchema = z.url({\n protocol: /^https?$/,\n hostname: z.regexes.domain,\n error: VALIDATION_MESSAGE.urlInvalid,\n});\nexport type SafeUrl = z.infer<typeof safeUrlSchema>;\n\n/**\n * A URL a member TYPES: `safeUrlSchema` plus the `LINK_URL_MAX` ceiling, so\n * every member URL carries the same cap and no consumer has to remember it.\n *\n * Two schemas, not one, because the cap is about what a person types and is\n * wrong for what the server reads from elsewhere. Until 0.2.0 there was only\n * this one, and it capped a link preview's CDN image URL too: one 314-character\n * `imageUrl` would have failed a whole feed page.\n */\nexport const httpUrlSchema = safeUrlSchema.max(LINK_URL_MAX);\nexport type HttpUrl = z.infer<typeof httpUrlSchema>;\n\n/**\n * True when `url` parses and its hostname is EXACTLY one of `hosts`\n * (lowercase). The one host check in this package, written the way the warning\n * on `safeUrlSchema` demands: parsed, compared for equality, never matched as\n * text. `youtube.com.evil.example` and `evil.example/?u=youtube.com` are refused.\n */\nexport function isUrlOnHost(url: string, hosts: readonly string[]): boolean {\n try {\n return hosts.includes(new URL(url).hostname.toLowerCase());\n } catch {\n return false;\n }\n}\n\n/** A typed URL (`httpUrlSchema`) that must also live on one of `hosts`. */\nexport const httpUrlOnHosts = (hosts: readonly string[], message: string) =>\n httpUrlSchema.refine((url) => isUrlOnHost(url, hosts), { error: message });\n\n/**\n * What a product needs before it can be listed in Discover (0.6.0). Here, not\n * in the products domain, because an error's details carry it\n * (`PRODUCT_NOT_LISTABLE` -> `details.missing`) and core never imports a domain.\n */\nexport const PRODUCT_LISTING_REQUIREMENT_VALUES = ['logo', 'tagline', 'screenshot'] as const;\nexport const productListingRequirementSchema = z.enum(PRODUCT_LISTING_REQUIREMENT_VALUES);\nexport type ProductListingRequirement = z.infer<typeof productListingRequirementSchema>;\n\n/**\n * The hosts a shared video may come from. The user's ruling (2026-09-21): video\n * is shared as a link and played in the card, never uploaded. The web plays it\n * through youtube-nocookie.com, the one video frame its CSP admits.\n */\nexport const YOUTUBE_HOSTS = [\n 'youtube.com',\n 'www.youtube.com',\n 'm.youtube.com',\n 'youtu.be',\n // The privacy-mode player's own links (0.7.0).\n 'youtube-nocookie.com',\n 'www.youtube-nocookie.com',\n] as const;\n\n/**\n * The 11-character id of a YouTube VIDEO link, or null for anything else (a\n * channel, a playlist, the home page, another site): what a page can embed.\n * Reads `youtu.be/<id>`, `/watch?v=<id>`, and `/shorts/`, `/embed/`, `/live/<id>`\n * on a `YOUTUBE_HOSTS` host (0.7.0).\n */\nexport function youtubeVideoId(url: string): string | null {\n let u: URL;\n try {\n u = new URL(url);\n } catch {\n return null;\n }\n const host = u.hostname.toLowerCase();\n if (!(YOUTUBE_HOSTS as readonly string[]).includes(host)) return null;\n const id =\n host === 'youtu.be'\n ? (u.pathname.split('/')[1] ?? null)\n : u.pathname === '/watch'\n ? u.searchParams.get('v')\n : (/^\\/(?:shorts|embed|live)\\/([^/]+)/.exec(u.pathname)?.[1] ?? null);\n return id && /^[A-Za-z0-9_-]{11}$/.test(id) ? id : null;\n}\n\n// ─── Username ────────────────────────────────────────────────────────────────\n\n/**\n * Public handle. Derived by the server at onboarding, changeable later.\n *\n * Rules are deliberately narrow because the handle appears in URLs and in\n * mentions: lowercase letters, digits, underscore and a single dot, 3 to 30\n * characters, must start with a letter.\n *\n * This is the FORMAT, and it is what every read shape uses. A handle being\n * CHOSEN must also not be reserved: that is `chosenUsernameSchema`.\n */\nexport const USERNAME_MIN = 3;\nexport const USERNAME_MAX = 30;\n\nexport const usernameSchema = z\n .string()\n .trim()\n .toLowerCase()\n // Plain bounds: the client words them from the issue's own minimum/maximum.\n .min(USERNAME_MIN)\n .max(USERNAME_MAX)\n .regex(/^[a-z][a-z0-9_]*(\\.[a-z0-9_]+)?$/, VALIDATION_MESSAGE.usernameInvalid);\nexport type Username = z.infer<typeof usernameSchema>;\n\n/**\n * Handles this product keeps for itself: route names a handle would shadow,\n * and words that would let a member pass as staff.\n *\n * ⚠ HERE, IN THE CONTRACT, since 0.2.0. It used to live in the backend so it\n * could grow without a publish, and nothing ever read it: the server derived\n * handles without checking it, so a member called \"Support\" was handed\n * `support`. One list, read by the server when it derives a handle and by any\n * form that lets a member choose one, is worth a publish per addition.\n *\n * Matched exactly, after lowercasing.\n */\nexport const RESERVED_USERNAMES = [\n 'admin',\n 'about',\n 'api',\n 'chat',\n 'discover',\n 'feed',\n 'founder',\n 'foundercircle',\n 'help',\n 'home',\n 'me',\n 'meetup',\n 'moderator',\n 'onboarding',\n 'settings',\n 'staff',\n 'superadmin',\n 'support',\n 'system',\n 'team',\n] as const;\n\nconst RESERVED = new Set<string>(RESERVED_USERNAMES);\n\nexport function isReservedUsername(handle: string): boolean {\n return RESERVED.has(handle.trim().toLowerCase());\n}\n\n/**\n * A handle a member is CHOOSING: the format, and not reserved.\n *\n * ⚠ Not used on read shapes, deliberately. A handle stored before the reserved\n * check existed must still READ, or one member's old handle would fail every\n * page that shows their name.\n */\nexport const chosenUsernameSchema = usernameSchema.refine((u) => !isReservedUsername(u), {\n error: VALIDATION_MESSAGE.usernameReserved,\n});\n\n// ─── Founder-facing enums ────────────────────────────────────────────────────\n\n/**\n * Stage of the founder's current venture.\n *\n * Ordered from earliest to latest so a range filter can compare by index. Add\n * new stages at the END or the stored ordinal of existing rows shifts.\n */\nexport const STARTUP_STAGE_VALUES = [\n 'idea',\n 'validation',\n 'mvp',\n 'pre_seed',\n 'seed',\n 'series_a_plus',\n 'profitable',\n 'exited',\n] as const;\nexport const startupStageSchema = z.enum(STARTUP_STAGE_VALUES);\nexport type StartupStage = z.infer<typeof startupStageSchema>;\n\n/**\n * Industry the venture operates in. Kept as a closed list so Discover filters\n * are a single indexed equality match rather than a text search.\n */\nexport const INDUSTRY_VALUES = [\n 'agritech',\n 'ai_ml',\n 'b2b_saas',\n 'consumer',\n 'climate',\n 'd2c',\n 'deeptech',\n 'edtech',\n 'fintech',\n 'gaming',\n 'healthtech',\n 'logistics',\n 'manufacturing',\n 'marketplace',\n 'media',\n 'mobility',\n 'proptech',\n 'robotics',\n 'services',\n 'space',\n 'other',\n] as const;\nexport const industrySchema = z.enum(INDUSTRY_VALUES);\nexport type Industry = z.infer<typeof industrySchema>;\n\n/**\n * What the founder brings. Free-text skills were considered and rejected: two\n * people typing \"growth\" and \"Growth Marketing\" would never match each other in\n * a filter, and the Discover tab is the whole point of the product.\n */\nexport const SKILL_VALUES = [\n 'engineering',\n 'product',\n 'design',\n 'data',\n 'growth',\n 'sales',\n 'marketing',\n 'operations',\n 'finance',\n 'legal',\n 'hr_people',\n 'supply_chain',\n 'research',\n 'fundraising',\n 'community',\n] as const;\nexport const skillSchema = z.enum(SKILL_VALUES);\nexport type Skill = z.infer<typeof skillSchema>;\n\n/**\n * What the member is here for. ONE list, replacing three.\n *\n * This was `lookingFor` with six values. The design draws eight \"Goals &\n * Passion\" tiles and four more on the business step; all three were the same\n * idea at three grains, and shipping them together would have meant nobody\n * could say which one Discover filters on - the answer settled by whichever\n * query got written first. Merged on hary's ruling, 2026-09-21, while there\n * were still no rows in any database.\n *\n * ⚠️ Stored per member and used as a Mongoose enum. Append only; removing a\n * value orphans documents already saved with it.\n *\n * ⚠️ `start_company` READS ODDLY next to its neighbours and is correct. It was\n * queried on the grounds that it restates `venture.stage: 'idea'`; it does not,\n * and the reason is worth keeping so nobody re-opens it. Inferring it from the\n * venture works only for a member who ALREADY HAS a venture row, and somebody\n * who wants to start a company is precisely the member with no venture at all,\n * so there is nothing to infer from. It also cannot express a founder with a\n * running company who wants to start another. The others were all asks of other\n * people and this one an ask of the product, which is the whole of the oddness.\n * (hary, 2026-09-21.) Since 0.16.0 the list also holds offers (`mentor_others`,\n * `invest_in_startups`) and a second ask of the product (`attend_events`).\n */\nexport const GOAL_VALUES = [\n 'find_cofounder',\n 'find_investors',\n 'find_customers',\n 'hiring',\n 'partnerships',\n 'mentorship',\n 'grow_network',\n 'business_ideas',\n 'market_insights',\n 'learn_startup',\n 'start_company',\n // 0.16.0 (the user, 2026-10-18: \"a few more ... cover most of the goals\"):\n // the journey's own asks (feedback on an idea, early testers), the other\n // side of mentorship and of fundraising (mentoring, investing), and three\n // more a founder network is asked for: joining a startup, finding\n // service providers, and events. Appended, per the rule above.\n 'get_feedback',\n 'find_testers',\n 'mentor_others',\n 'invest_in_startups',\n 'join_startup',\n 'find_service_providers',\n 'attend_events',\n] as const;\nexport const goalSchema = z.enum(GOAL_VALUES);\nexport type Goal = z.infer<typeof goalSchema>;\n\n// ─── Gender ──────────────────────────────────────────────────────────────────\n\n/**\n * Demographic only. Nothing here computes anything from it, unlike the sibling\n * gym product where gender feeds body-metric maths.\n *\n * Takes the family's three values and ADDS one rather than renaming any: a\n * network for founders should let somebody decline the question without having\n * to describe themselves as \"other\".\n */\nexport const GENDER_VALUES = ['male', 'female', 'other', 'prefer_not_to_say'] as const;\nexport const genderSchema = z.enum(GENDER_VALUES);\nexport type Gender = z.infer<typeof genderSchema>;\n\n// ─── Display name ────────────────────────────────────────────────────────────\n\n/**\n * The name a member is shown by. ONE rule for every body that writes it:\n * onboarding's finish, the profile patch and the personal-details patch, so a\n * name one accepts the others can never refuse. Plain bounds, no custom\n * message: `too_small` with minimum 1 already says \"required\", and the client\n * words it.\n */\nexport const displayNameSchema = z.string().trim().min(1).max(DISPLAY_NAME_MAX);\n\n/**\n * A full name's first and last name, DEDUCED, never asked (the user,\n * 2026-10-18: onboarding asks one \"Full name\" and works the two out from the\n * space). The first word is the first name and everything after the first\n * space is the last name, kept as written (\"Asha Rao Kulkarni\" is Asha and\n * Rao Kulkarni).\n *\n * ⚠ A ONE-WORD NAME IS A WHOLE NAME. Many people in India go by a single name,\n * so `lastName` is then `''`, and nothing may refuse it for that.\n *\n * Derived wherever it is needed, never stored as a second copy of the name:\n * `displayName` stays the one owner of a member's name, so a rename can never\n * leave a stale first name behind.\n */\nexport function splitFullName(fullName: string): { firstName: string; lastName: string } {\n const name = fullName.trim().replace(/\\s+/g, ' ');\n const space = name.indexOf(' ');\n return space === -1\n ? { firstName: name, lastName: '' }\n : { firstName: name.slice(0, space), lastName: name.slice(space + 1) };\n}\n\n// ─── Phone ───────────────────────────────────────────────────────────────────\n\n/**\n * Indian mobile number: ten raw digits, no country code, matching the standard\n * used across this family. Display adds the `+91`.\n *\n * ⚠️ WHERE IT IS STORED IS NOT A SCHEMA QUESTION, and it has been ruled: the\n * phone lives on the account mirror, never as a second copy on the profile.\n * Two stored copies drift the first time somebody edits one, and the profile's\n * would be the copy nobody keeps in sync.\n */\nexport const phoneSchema = z\n .string()\n .trim()\n .regex(/^[6-9]\\d{9}$/, VALIDATION_MESSAGE.phoneInvalid);\nexport type Phone = z.infer<typeof phoneSchema>;\n\n// ─── Location ────────────────────────────────────────────────────────────────\n\n/**\n * Where the founder is based. City and country are what Discover filters on.\n *\n * ONE SHAPE for the profile, the Me tab's patch, onboarding's finish and the\n * location suggestion. It was written out three times until 0.2.0, the same\n * kind of copy that let the profile model lose Instagram.\n *\n * ⚠ `country` is REQUIRED and has NO default. A default here (it used to be\n * `'India'`) is destructive on every write path: a founder in Berlin who\n * corrects only their city would be moved to India by a value they never saw.\n * A body that carries a location carries the whole location. Every stored\n * location has a country, because the model requires one, so the read side\n * loses nothing.\n *\n * This is a DECLARED location, not a GPS reading. Jansathi's rule applies\n * here too: never write a declared location from a GPS capture.\n */\nexport const locationSchema = z.object({\n city: z.string().trim().min(1).max(CITY_MAX),\n state: optionalTrimmedString(STATE_MAX),\n country: z.string().trim().min(1).max(COUNTRY_MAX),\n});\nexport type FounderLocation = z.infer<typeof locationSchema>;\n\n/**\n * `GET /api/v1/location/areas/reverse?lat=&lng=`: plain decimal degrees.\n *\n * A QUERY, so coercion is right here: everything in a URL is a string. An\n * emptied parameter is \"missing\", never 0, because 0,0 is a real place in the\n * Gulf of Guinea and would be looked up rather than refused.\n */\nexport const coordinatesQuerySchema = z.object({\n lat: z.preprocess(emptyStringToUndefined, z.coerce.number().min(-90).max(90)),\n lng: z.preprocess(emptyStringToUndefined, z.coerce.number().min(-180).max(180)),\n});\nexport type CoordinatesQuery = z.infer<typeof coordinatesQuerySchema>;\nexport type CoordinatesQueryInput = z.input<typeof coordinatesQuerySchema>;\n\n/**\n * The city these coordinates look like, for the member to CONFIRM, or `null`\n * when the lookup could not place them confidently (or they are outside India,\n * whose area data is all there is). A suggestion, never a write: only what the\n * member then submits becomes their location.\n */\nexport const suggestedLocationSchema = locationSchema.nullable();\nexport type SuggestedLocation = z.infer<typeof suggestedLocationSchema>;\n\n// ─── Pagination ──────────────────────────────────────────────────────────────\n\n/**\n * Cursor pagination query. Feed and Discover both use it.\n *\n * Cursor, not page number: the community feed changes under the reader, and an\n * offset would repeat or skip posts as new ones land.\n */\nexport const paginationQuerySchema = z.object({\n /**\n * `?limit=` with nothing after it is treated as \"not provided\", not as a\n * validation failure. A client that clears the control sends the empty\n * string, and `z.coerce.number()` turns that into 0, which then fails\n * `.min(1)`: the member sees a 400 for a page they never asked to size.\n */\n limit: z.preprocess(\n emptyStringToUndefined,\n z.coerce.number().int().min(1).max(PAGE_SIZE_MAX).default(PAGE_SIZE_DEFAULT),\n ),\n cursor: z.string().trim().min(1).optional(),\n});\nexport type PaginationQuery = z.infer<typeof paginationQuerySchema>;\n/** What a client may put IN the URL: every field optional, numbers as strings. */\nexport type PaginationQueryInput = z.input<typeof paginationQuerySchema>;\n"]}
|
package/dist/core/errors.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ import { z } from 'zod';
|
|
|
27
27
|
* As a tuple, the way `GENDER_VALUES` is, so a consumer can iterate it (a
|
|
28
28
|
* translation-coverage test does exactly that) and TypeScript keeps the union.
|
|
29
29
|
*/
|
|
30
|
-
export declare const API_ERROR_CODE_VALUES: readonly ["INTERNAL_ERROR", "VALIDATION_ERROR", "NOT_FOUND", "CONFLICT", "RATE_LIMITED", "SERVICE_UNAVAILABLE", "UNAUTHORIZED", "INVALID_TOKEN", "TOKEN_EXPIRED", "SESSION_INVALIDATED", "FORBIDDEN", "ONBOARDING_INCOMPLETE", "ALREADY_ONBOARDED", "UNDER_AGE", "UPLOAD_NOT_ATTACHABLE", "UPLOAD_TOO_LARGE", "UPLOAD_WRONG_TYPE", "UPLOAD_NOT_RECEIVED", "UPLOAD_PROCESSING", "UPLOAD_UNREADABLE", "UPLOAD_TOO_MANY_PIXELS", "UPLOAD_LIMIT_REACHED", "UPLOAD_IN_USE", "EDIT_WINDOW_CLOSED", "POLL_NOT_EDITABLE", "POLL_CLOSED", "POLL_CHOICE_INVALID", "REPLY_TOO_DEEP", "CANNOT_REPORT_OWN", "FEEDBACK_NOT_MARKABLE", "CANNOT_REPOST_OWN", "CANNOT_REPOST_A_REPOST", "ALREADY_REPOSTED", "PRODUCT_LIMIT_REACHED", "PRODUCT_NOT_LISTABLE", "PRODUCT_ARCHIVED", "PRODUCT_NOT_YOURS", "PRODUCT_ALREADY_MEMBER", "PRODUCT_MEMBER_NOT_INVITABLE", "PRODUCT_NOT_ON_TEAM", "PRODUCT_OWNER_MUST_TRANSFER", "PRODUCT_OWN_TEAM", "TESTER_NOT_ELIGIBLE", "PRODUCT_PAUSED", "MEMBERSHIP_REQUIRED", "PLAN_REQUIRED", "ALREADY_MEMBER", "MEMBERSHIP_NOT_REVOCABLE", "COUPON_INVALID", "COUPON_NOT_APPLICABLE", "COUPON_EXHAUSTED", "COUPON_ALREADY_USED", "COUPON_CODE_TAKEN", "USERNAME_TAKEN", "COUPON_FOUNDING_EXISTS", "COUPON_FOUNDING_RETIRED", "PLAN_UPGRADE_INSTEAD", "PLAN_NOTHING_TO_UPGRADE", "PLAN_TERM_LIMIT", "PLAN_CHANGED", "PAYMENTS_UNAVAILABLE", "PAYMENT_NOT_VERIFIED", "ORDER_EXPIRED", "REFUND_WINDOW_CLOSED", "PAYMENT_NOT_REFUNDABLE", "REFUND_FAILED", "MESSAGE_ALLOWANCE_EXHAUSTED", "MESSAGE_ALLOWANCE_UNCONFIRMED", "MESSAGE_NOT_ACCEPTED", "COMMUNITY_JOIN_REQUIRED", "COMMUNITY_NAME_TAKEN", "COMMUNITY_ALREADY_MEMBER", "COMMUNITY_MEMBER_NOT_INVITABLE", "COMMUNITY_MEMBER_BANNED", "COMMUNITY_INVITE_NOT_NEEDED", "COMMUNITY_LAST_ADMIN", "COMMUNITY_ARCHIVED", "COMMUNITY_EXPOSURE_UNCONFIRMED", "COMMUNITY_PINS_FULL", "COMMUNITY_ANNOUNCE_TOO_SOON", "COMMUNITY_CONTENT_NOT_REPOSTABLE", "COMMUNITY_SUGGESTIONS_FULL", "COMMUNITY_SUGGESTION_DECIDED", "REVIEW_EXISTS", "REVIEW_OWN_VOTE", "MODERATION_ACTION_INVALID", "CHAT_WITH_SELF", "ACCOUNT_SUSPENDED", "ROLE_NOT_HELD", "MPIN_NOT_SET", "MPIN_ALREADY_SET", "MPIN_INCORRECT", "MPIN_LOCKED", "CANNOT_CHANGE_OWN_ROLES", "ROLE_NOT_GRANTABLE", "CANNOT_CHANGE_OWN_CAPABILITIES", "CAPABILITY_NOT_GRANTABLE", "TICKET_FULL", "SAVED_REPLIES_FULL"];
|
|
30
|
+
export declare const API_ERROR_CODE_VALUES: readonly ["INTERNAL_ERROR", "VALIDATION_ERROR", "NOT_FOUND", "CONFLICT", "RATE_LIMITED", "SERVICE_UNAVAILABLE", "UNAUTHORIZED", "INVALID_TOKEN", "TOKEN_EXPIRED", "SESSION_INVALIDATED", "FORBIDDEN", "ONBOARDING_INCOMPLETE", "ALREADY_ONBOARDED", "UNDER_AGE", "UPLOAD_NOT_ATTACHABLE", "UPLOAD_TOO_LARGE", "UPLOAD_WRONG_TYPE", "UPLOAD_NOT_RECEIVED", "UPLOAD_PROCESSING", "UPLOAD_UNREADABLE", "UPLOAD_TOO_MANY_PIXELS", "UPLOAD_LIMIT_REACHED", "UPLOAD_IN_USE", "EDIT_WINDOW_CLOSED", "POLL_NOT_EDITABLE", "POLL_CLOSED", "POLL_CHOICE_INVALID", "REPLY_TOO_DEEP", "CANNOT_REPORT_OWN", "FEEDBACK_NOT_MARKABLE", "CANNOT_REPOST_OWN", "CANNOT_REPOST_A_REPOST", "ALREADY_REPOSTED", "PRODUCT_LIMIT_REACHED", "PRODUCT_NOT_LISTABLE", "PRODUCT_ARCHIVED", "PRODUCT_NOT_YOURS", "PRODUCT_ALREADY_MEMBER", "PRODUCT_MEMBER_NOT_INVITABLE", "PRODUCT_NOT_ON_TEAM", "PRODUCT_OWNER_MUST_TRANSFER", "PRODUCT_OWN_TEAM", "TESTER_NOT_ELIGIBLE", "PRODUCT_PAUSED", "MEMBERSHIP_REQUIRED", "PLAN_REQUIRED", "ALREADY_MEMBER", "MEMBERSHIP_NOT_REVOCABLE", "COUPON_INVALID", "COUPON_NOT_APPLICABLE", "COUPON_EXHAUSTED", "COUPON_ALREADY_USED", "COUPON_CODE_TAKEN", "USERNAME_TAKEN", "COUPON_FOUNDING_EXISTS", "COUPON_FOUNDING_RETIRED", "PLAN_UPGRADE_INSTEAD", "PLAN_NOTHING_TO_UPGRADE", "PLAN_TERM_LIMIT", "PLAN_CHANGED", "PAYMENTS_UNAVAILABLE", "PAYMENT_NOT_VERIFIED", "ORDER_EXPIRED", "REFUND_WINDOW_CLOSED", "PAYMENT_NOT_REFUNDABLE", "REFUND_FAILED", "MESSAGE_ALLOWANCE_EXHAUSTED", "MESSAGE_ALLOWANCE_UNCONFIRMED", "MESSAGE_NOT_ACCEPTED", "COMMUNITY_JOIN_REQUIRED", "COMMUNITY_NAME_TAKEN", "COMMUNITY_ALREADY_MEMBER", "COMMUNITY_MEMBER_NOT_INVITABLE", "COMMUNITY_MEMBER_BANNED", "COMMUNITY_INVITE_NOT_NEEDED", "COMMUNITY_LAST_ADMIN", "COMMUNITY_ARCHIVED", "COMMUNITY_EXPOSURE_UNCONFIRMED", "COMMUNITY_PINS_FULL", "COMMUNITY_ANNOUNCE_TOO_SOON", "COMMUNITY_CONTENT_NOT_REPOSTABLE", "COMMUNITY_SUGGESTIONS_FULL", "COMMUNITY_SUGGESTION_DECIDED", "REVIEW_EXISTS", "REVIEW_OWN_VOTE", "MODERATION_ACTION_INVALID", "CHAT_WITH_SELF", "ACCOUNT_SUSPENDED", "ROLE_NOT_HELD", "MPIN_NOT_SET", "MPIN_ALREADY_SET", "MPIN_INCORRECT", "MPIN_LOCKED", "CANNOT_CHANGE_OWN_ROLES", "ROLE_NOT_GRANTABLE", "CANNOT_CHANGE_OWN_CAPABILITIES", "CAPABILITY_NOT_GRANTABLE", "TICKET_FULL", "SAVED_REPLIES_FULL", "NOT_LAUNCHED", "WAITLIST_CLOSED", "WAITLIST_STAFF", "WAITLIST_PLACE_USED"];
|
|
31
31
|
export declare const apiErrorCodeSchema: z.ZodEnum<{
|
|
32
32
|
INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
33
33
|
VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
@@ -128,6 +128,10 @@ export declare const apiErrorCodeSchema: z.ZodEnum<{
|
|
|
128
128
|
CAPABILITY_NOT_GRANTABLE: "CAPABILITY_NOT_GRANTABLE";
|
|
129
129
|
TICKET_FULL: "TICKET_FULL";
|
|
130
130
|
SAVED_REPLIES_FULL: "SAVED_REPLIES_FULL";
|
|
131
|
+
NOT_LAUNCHED: "NOT_LAUNCHED";
|
|
132
|
+
WAITLIST_CLOSED: "WAITLIST_CLOSED";
|
|
133
|
+
WAITLIST_STAFF: "WAITLIST_STAFF";
|
|
134
|
+
WAITLIST_PLACE_USED: "WAITLIST_PLACE_USED";
|
|
131
135
|
}>;
|
|
132
136
|
export type ApiErrorCode = z.infer<typeof apiErrorCodeSchema>;
|
|
133
137
|
/** The same codes by name: `API_ERROR_CODE.POLL_CLOSED`. */
|
|
@@ -231,5 +235,9 @@ export declare const API_ERROR_CODE: {
|
|
|
231
235
|
CAPABILITY_NOT_GRANTABLE: "CAPABILITY_NOT_GRANTABLE";
|
|
232
236
|
TICKET_FULL: "TICKET_FULL";
|
|
233
237
|
SAVED_REPLIES_FULL: "SAVED_REPLIES_FULL";
|
|
238
|
+
NOT_LAUNCHED: "NOT_LAUNCHED";
|
|
239
|
+
WAITLIST_CLOSED: "WAITLIST_CLOSED";
|
|
240
|
+
WAITLIST_STAFF: "WAITLIST_STAFF";
|
|
241
|
+
WAITLIST_PLACE_USED: "WAITLIST_PLACE_USED";
|
|
234
242
|
};
|
|
235
243
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,8wEA0VxB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAgC,CAAC;AAChE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,4DAA4D;AAC5D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA0B,CAAC"}
|
package/dist/core/errors.js
CHANGED
|
@@ -340,6 +340,25 @@ export const API_ERROR_CODE_VALUES = [
|
|
|
340
340
|
'TICKET_FULL',
|
|
341
341
|
/** The team keeps `SAVED_REPLIES_MAX` saved replies. Delete one first. */
|
|
342
342
|
'SAVED_REPLIES_FULL',
|
|
343
|
+
// ── Waitlist (0.15.0) ──
|
|
344
|
+
/**
|
|
345
|
+
* Founder Circle has not opened yet (`FC_LAUNCH_AT` is still ahead). Until
|
|
346
|
+
* it does, only joining the waitlist, onboarding and your profile, uploads
|
|
347
|
+
* for it and deleting your account work, for everyone, staff included. 403.
|
|
348
|
+
*/
|
|
349
|
+
'NOT_LAUNCHED',
|
|
350
|
+
/** Joining the waitlist after the launch: it closed then (the user, 2026-10-16). 409. */
|
|
351
|
+
'WAITLIST_CLOSED',
|
|
352
|
+
/** A staff account joining the waitlist: staff never take a place (the user, 2026-10-16). 403. */
|
|
353
|
+
'WAITLIST_STAFF',
|
|
354
|
+
/**
|
|
355
|
+
* Joining when this email's inbox or this sign-in already had a place: one
|
|
356
|
+
* place per inbox (`x+1@`, `x+2@`, Gmail's dots are one inbox) and per
|
|
357
|
+
* sign-in, ever, deleted accounts included, so neither new addresses nor
|
|
358
|
+
* deleting and joining again take the free places one by one (the user,
|
|
359
|
+
* 2026-10-16; the security review, 2026-10-18). 409.
|
|
360
|
+
*/
|
|
361
|
+
'WAITLIST_PLACE_USED',
|
|
343
362
|
];
|
|
344
363
|
export const apiErrorCodeSchema = z.enum(API_ERROR_CODE_VALUES);
|
|
345
364
|
/** The same codes by name: `API_ERROR_CODE.POLL_CLOSED`. */
|
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;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,iBAAiB;IACjB,gFAAgF;IAChF,gBAAgB;IACh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AC9B,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;CACZ,CAAC;AAEX,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAGhE,4DAA4D;AAC5D,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC,IAAI,CAAC","sourcesContent":["/**\n * founder-schema — Every error code the API answers with\n *\n * THE CODE IS WHAT A CLIENT ACTS ON; the `message` beside it is English for\n * logs and for a client too old to know the code. A client words each code in\n * the member's language, and a test on the web side asserts every value here\n * has a message in every locale it ships.\n *\n * Before 0.2.0 the backend kept this list to itself, and every domain refusal\n * (a closed poll, a reply to a reply, the edit window) went out as\n * `VALIDATION_ERROR` with an English sentence, so the only way for a client to\n * tell them apart was to match on the wording.\n *\n * WHEN TO USE WHICH:\n * - A request that does not match its schema: `VALIDATION_ERROR`, with every\n * problem in `error.details.issues`.\n * - A well-formed request the current STATE of things refuses: its own code\n * below. These carry no issues; the code says it all.\n *\n * ⚠ Append freely; remove deliberately. A code removed here that an older\n * server still sends fails the client's parse of the error envelope.\n *\n * @module founder-schema/core/errors\n */\n\nimport { z } from 'zod';\n\n/**\n * As a tuple, the way `GENDER_VALUES` is, so a consumer can iterate it (a\n * translation-coverage test does exactly that) and TypeScript keeps the union.\n */\nexport const API_ERROR_CODE_VALUES = [\n // ── Anything ──\n /** A bug or an outage on our side. The message says nothing more on purpose. */\n 'INTERNAL_ERROR',\n /** The request did not match its schema. `details.issues` says where. */\n 'VALIDATION_ERROR',\n /** No such thing, or not one you may see. Deliberately the same answer. */\n 'NOT_FOUND',\n /** Two writes raced for something unique; retrying usually succeeds. */\n 'CONFLICT',\n /** Too many requests from this member or address. Wait, then retry. */\n 'RATE_LIMITED',\n /** Something we depend on (the chat server) is down or not switched on. */\n 'SERVICE_UNAVAILABLE',\n\n // ── Who you are ──\n /** No credential at all. */\n 'UNAUTHORIZED',\n /** A credential that is not ours, or not readable. */\n 'INVALID_TOKEN',\n /** A credential that was ours and has expired. Refresh and retry. */\n 'TOKEN_EXPIRED',\n /** Signed out everywhere, or the account changed. Sign in again. */\n 'SESSION_INVALIDATED',\n /** Signed in, and not allowed to do this. */\n 'FORBIDDEN',\n\n // ── Onboarding ──\n /** Finish onboarding first. The client routes here instead of showing an error. */\n 'ONBOARDING_INCOMPLETE',\n /** Onboarding is already finished; there is nothing to save or finish again. */\n 'ALREADY_ONBOARDED',\n /** Under `MIN_AGE_YEARS`. Refused at the draft and again at finish. */\n 'UNDER_AGE',\n\n // ── Uploads: completing one, and attaching it ──\n /**\n * Not an upload of yours, not processed yet, already attached somewhere, or\n * for the other purpose (an avatar upload on a post). One code for all of\n * them on purpose: telling \"someone else's\" apart from \"does not exist\" would\n * let a caller probe other members' media ids.\n */\n 'UPLOAD_NOT_ATTACHABLE',\n /** Larger than `UPLOAD_MAX_BYTES`. */\n 'UPLOAD_TOO_LARGE',\n /**\n * Not one of the image types this product accepts (by the file's own bytes,\n * whatever its name or declared type), or not an image at all.\n */\n 'UPLOAD_WRONG_TYPE',\n /** Completed before the file reached storage: upload it, then complete. */\n 'UPLOAD_NOT_RECEIVED',\n /**\n * Another request is processing this upload right now (a retry or a double\n * tap). Nothing is wrong: complete again in a moment and it answers with\n * the image. 409.\n */\n 'UPLOAD_PROCESSING',\n /** A JPEG, PNG, WebP or GIF by its bytes that cannot be decoded: truncated or corrupt. */\n 'UPLOAD_UNREADABLE',\n /** More than `MEDIA_MAX_INPUT_PIXELS`; refused before decoding. */\n 'UPLOAD_TOO_MANY_PIXELS',\n /** `MEDIA_PENDING_MAX` uploads are already waiting to be attached. */\n 'UPLOAD_LIMIT_REACHED',\n /** Discarding an upload that is attached: remove it from its post or avatar instead. */\n 'UPLOAD_IN_USE',\n\n // ── The feed ──\n /** The post is older than `EDIT_WINDOW_MS`. */\n 'EDIT_WINDOW_CLOSED',\n /** A poll is never editable: people have already voted on it. */\n 'POLL_NOT_EDITABLE',\n /** The poll has closed, by the server's clock. */\n 'POLL_CLOSED',\n /** No option, several on a single-choice poll, or an option that does not exist. */\n 'POLL_CHOICE_INVALID',\n /** A reply to a reply. One level of nesting only. */\n 'REPLY_TOO_DEEP',\n /** Reporting your own post, poll or comment (or, since 0.6.0, your own product or review). */\n 'CANNOT_REPORT_OWN',\n /**\n * Marking a comment \"this helped\" that is not feedback on your product: the\n * post is not tagged with a product you are on, or the comment is your own\n * team's.\n */\n 'FEEDBACK_NOT_MARKABLE',\n /** Reposting your own post or poll (0.8.0). */\n 'CANNOT_REPOST_OWN',\n /** Reposting a repost (0.8.0): share the original instead. */\n 'CANNOT_REPOST_A_REPOST',\n /** You already have an active repost of this item (0.8.0). Undo it first. 409. */\n 'ALREADY_REPOSTED',\n\n // ── Products ──\n /**\n * Their plan's number of LIVE products is reached (0.12.0: 1 for a member,\n * 5 on Premium, unlimited on Business; was `PRODUCTS_OWNED_MAX` for\n * everyone). Creating a product, making a paused one live, or being handed\n * one. `details.limit`. Pause one, or upgrade.\n */\n 'PRODUCT_LIMIT_REACHED',\n /**\n * Listing a product that is not ready for Discover, or removing what keeps a\n * listed one ready. `details.missing`: some of `logo`, `tagline`, `screenshot`.\n */\n 'PRODUCT_NOT_LISTABLE',\n /**\n * The product is archived and frozen until its owner restores it: no new\n * posts about it, reviews, upvotes, replies, helpful marks, testers or\n * invitations.\n */\n 'PRODUCT_ARCHIVED',\n /** Tagging a post with, or acting for, a product you are not on the team of. */\n 'PRODUCT_NOT_YOURS',\n /** Inviting someone who is already on the team or already invited. */\n 'PRODUCT_ALREADY_MEMBER',\n /**\n * Inviting someone who cannot join a team: not finished onboarding, paused,\n * suspended or deleted. One code for all four, so it reveals none of them.\n */\n 'PRODUCT_MEMBER_NOT_INVITABLE',\n /** Handing over to, or re-roling, someone who is not on the team (or invited, for a role). */\n 'PRODUCT_NOT_ON_TEAM',\n /**\n * The owner leaving, being removed, or having their role changed. Ownership\n * moves only by handing the product to someone first.\n */\n 'PRODUCT_OWNER_MUST_TRANSFER',\n /** Upvoting, reviewing or confirming yourself as a tester of your own team's product. */\n 'PRODUCT_OWN_TEAM',\n /** Confirming as a tester someone who has given this product no feedback. */\n 'TESTER_NOT_ELIGIBLE',\n /**\n * The product is paused (0.12.0): its owner's plan has fewer live places\n * than they own products. Only its team sees it; nothing new is tagged with\n * it until its owner makes it live again.\n */\n 'PRODUCT_PAUSED',\n\n // ── Membership and plans (0.12.0) ──\n /**\n * Taking part needs a membership: a viewer posting, commenting, reacting,\n * voting, saving, joining, chatting or listing a product. 403. Also the\n * reason on the refusing rule, so the web offers the membership.\n */\n 'MEMBERSHIP_REQUIRED',\n /**\n * Starting a conversation with someone you do not know needs Premium or\n * Business. 403. Also the reason on the refusing rule.\n */\n 'PLAN_REQUIRED',\n /** Buying or claiming a membership while holding one. 409. */\n 'ALREADY_MEMBER',\n /**\n * Revoking a membership staff may not revoke: a paid one (refund the\n * payment instead) or a staff member's, which comes with the role. 409.\n */\n 'MEMBERSHIP_NOT_REVOCABLE',\n /** No such coupon, or it is switched off, not started or over. One code for all, on purpose. */\n 'COUPON_INVALID',\n /** A real coupon that does not apply to what is being bought (a membership code on a plan). */\n 'COUPON_NOT_APPLICABLE',\n /** Every redemption of the coupon is taken. 409. */\n 'COUPON_EXHAUSTED',\n /** This account already used the coupon. 409. */\n 'COUPON_ALREADY_USED',\n /** Staff creating a coupon whose code another coupon has (case ignored). 409. */\n 'COUPON_CODE_TAKEN',\n /** A member choosing a username someone else holds (0.13.0). 409. */\n 'USERNAME_TAKEN',\n /**\n * Staff creating a second FOUNDING coupon (0.13.0): founding numbers count\n * up on the one founding coupon, so a second would hand out #1 again. 409.\n */\n 'COUPON_FOUNDING_EXISTS',\n /**\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] 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,CAAC,MAAM,qBAAqB,GAAG;IACnC,iBAAiB;IACjB,gFAAgF;IAChF,gBAAgB;IAChB,yEAAyE;IACzE,kBAAkB;IAClB,2EAA2E;IAC3E,WAAW;IACX,wEAAwE;IACxE,UAAU;IACV,uEAAuE;IACvE,cAAc;IACd,2EAA2E;IAC3E,qBAAqB;IAErB,oBAAoB;IACpB,4BAA4B;IAC5B,cAAc;IACd,sDAAsD;IACtD,eAAe;IACf,qEAAqE;IACrE,eAAe;IACf,oEAAoE;IACpE,qBAAqB;IACrB,6CAA6C;IAC7C,WAAW;IAEX,mBAAmB;IACnB,mFAAmF;IACnF,uBAAuB;IACvB,gFAAgF;IAChF,mBAAmB;IACnB,uEAAuE;IACvE,WAAW;IAEX,kDAAkD;IAClD;;;;;OAKG;IACH,uBAAuB;IACvB,sCAAsC;IACtC,kBAAkB;IAClB;;;OAGG;IACH,mBAAmB;IACnB,2EAA2E;IAC3E,qBAAqB;IACrB;;;;OAIG;IACH,mBAAmB;IACnB,0FAA0F;IAC1F,mBAAmB;IACnB,mEAAmE;IACnE,wBAAwB;IACxB,sEAAsE;IACtE,sBAAsB;IACt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,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"]}
|
package/dist/core/limits.d.ts
CHANGED
|
@@ -143,6 +143,17 @@ export declare const PRODUCT_TEAM_SHOWN = 12;
|
|
|
143
143
|
export declare const PRODUCT_ASK_OPEN_DAYS = 14;
|
|
144
144
|
/** Days after a payment within which it is refunded in full on request (the user's ruling). */
|
|
145
145
|
export declare const REFUND_WINDOW_DAYS = 7;
|
|
146
|
+
/**
|
|
147
|
+
* The LAST moment a payment made at `paidAt` may be asked to be refunded
|
|
148
|
+
* (0.15.0). The user's rule: seven days, "counted from the day I paid". So
|
|
149
|
+
* the window runs to the END of the seventh day after the day of paying, in
|
|
150
|
+
* India's time: paid at 00:10 on 1 October, refundable until 23:59:59.999 on
|
|
151
|
+
* 8 October. That is the date a member is shown, so the date shown and the
|
|
152
|
+
* moment enforced can never disagree (before 0.15.0 the server cut off at
|
|
153
|
+
* exactly 7 x 24 hours after the payment while the page showed only a date).
|
|
154
|
+
* Inclusive: an ask AT this instant is in time.
|
|
155
|
+
*/
|
|
156
|
+
export declare function refundWindowEndsAt(paidAt: Date | string): Date;
|
|
146
157
|
/** Minutes a checkout stays payable. After that it is expired and a new one is opened. */
|
|
147
158
|
export declare const ORDER_TTL_MINUTES = 30;
|
|
148
159
|
/** Plan time one member may hold ahead of today, in years. Bounds what is prepaid. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/core/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;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