founder-schema 0.24.0 → 0.26.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/dist/access/permissions.d.ts +2 -1
- package/dist/access/permissions.d.ts.map +1 -1
- package/dist/access/permissions.js +2 -0
- package/dist/access/permissions.js.map +1 -1
- package/dist/domains/communities/communities.d.ts +9 -9
- package/dist/domains/discover/discover.d.ts +100 -1
- package/dist/domains/discover/discover.d.ts.map +1 -1
- package/dist/domains/discover/discover.js +6 -3
- package/dist/domains/discover/discover.js.map +1 -1
- package/dist/domains/feed/feed.d.ts +11 -11
- package/dist/domains/follows/follows.d.ts +431 -0
- package/dist/domains/follows/follows.d.ts.map +1 -0
- package/dist/domains/follows/follows.js +52 -0
- package/dist/domains/follows/follows.js.map +1 -0
- package/dist/domains/follows/relation.d.ts +59 -0
- package/dist/domains/follows/relation.d.ts.map +1 -0
- package/dist/domains/follows/relation.js +55 -0
- package/dist/domains/follows/relation.js.map +1 -0
- package/dist/domains/notifications/notifications.d.ts +20 -2
- package/dist/domains/notifications/notifications.d.ts.map +1 -1
- package/dist/domains/notifications/notifications.js +18 -0
- package/dist/domains/notifications/notifications.js.map +1 -1
- package/dist/domains/onboarding/onboarding-answers.d.ts +12 -8
- package/dist/domains/onboarding/onboarding-answers.d.ts.map +1 -1
- package/dist/domains/onboarding/onboarding-answers.js +20 -21
- package/dist/domains/onboarding/onboarding-answers.js.map +1 -1
- package/dist/domains/onboarding/onboarding.d.ts +210 -174
- package/dist/domains/onboarding/onboarding.d.ts.map +1 -1
- package/dist/domains/onboarding/onboarding.js +104 -70
- 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 +155 -1
- package/dist/domains/profile/founder-profile.d.ts.map +1 -1
- package/dist/domains/profile/founder-profile.js +49 -1
- package/dist/domains/profile/founder-profile.js.map +1 -1
- package/dist/domains/profile/my-profile.d.ts +119 -40
- package/dist/domains/profile/my-profile.d.ts.map +1 -1
- package/dist/domains/profile/my-profile.js +28 -14
- package/dist/domains/profile/my-profile.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -46,10 +46,11 @@ import type { Standing } from './standing.js';
|
|
|
46
46
|
* invitation to a product's team
|
|
47
47
|
* message start a conversation with a Member
|
|
48
48
|
* refund give a payment's money back (staff)
|
|
49
|
+
* follow follow a Member: see their posts, hear when they post (2026-11-20)
|
|
49
50
|
*
|
|
50
51
|
* Append only: a stored or packed rule names these.
|
|
51
52
|
*/
|
|
52
|
-
export declare const ACTION_VALUES: readonly ["manage", "create", "read", "update", "delete", "moderate", "assign", "suspend", "resolve", "reset", "represent", "react", "vote", "save", "join", "message", "refund"];
|
|
53
|
+
export declare const ACTION_VALUES: readonly ["manage", "create", "read", "update", "delete", "moderate", "assign", "suspend", "resolve", "reset", "represent", "react", "vote", "save", "join", "message", "refund", "follow"];
|
|
53
54
|
export type Action = (typeof ACTION_VALUES)[number];
|
|
54
55
|
/**
|
|
55
56
|
* The things.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/access/permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;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AE5D,0EAA0E;AAC1E,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;AAO/C;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE;IACjC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC7B,GAAG,IAAI,IAAI,UAAU,CAErB"}
|
|
@@ -40,6 +40,7 @@ import { z } from 'zod';
|
|
|
40
40
|
* invitation to a product's team
|
|
41
41
|
* message start a conversation with a Member
|
|
42
42
|
* refund give a payment's money back (staff)
|
|
43
|
+
* follow follow a Member: see their posts, hear when they post (2026-11-20)
|
|
43
44
|
*
|
|
44
45
|
* Append only: a stored or packed rule names these.
|
|
45
46
|
*/
|
|
@@ -61,6 +62,7 @@ export const ACTION_VALUES = [
|
|
|
61
62
|
'join',
|
|
62
63
|
'message',
|
|
63
64
|
'refund',
|
|
65
|
+
'follow',
|
|
64
66
|
];
|
|
65
67
|
/**
|
|
66
68
|
* The things.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../src/access/permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,SAAS;IACT,SAAS;IACT,OAAO;IACP,WAAW;IACX,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,SAAS;IACT,QAAQ;CACA,CAAC;AAGX;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,KAAK;IACL,WAAW;IACX,QA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*\n * Permissions are ACTION on SUBJECT, optionally narrowed by conditions on the\n * subject's fields (\"update a Post whose authorId is mine\"). The backend writes\n * one small policy per role from these words; the web receives the resulting\n * rules and asks the same questions to decide what to draw. Because both sides\n * spell actions and subjects from this file, a permission check with a typo is\n * a compile error, not a button that silently never shows.\n *\n * The SERVER decides; the web only mirrors. Every rule the web holds came from\n * the server for the role being acted as, and every request is checked again\n * on the server, so a tampered client can show itself a button and nothing\n * more.\n *\n * @module founder-schema/access/permissions\n */\n\nimport type { ForcedSubject, MongoAbility, RawRuleOf } from '@casl/ability';\nimport { z } from 'zod';\nimport type { OrderStatus, PurchaseKind } from '../domains/billing/billing.js';\nimport type { CommunitySuggestionStatus } from '../domains/communities/communities.js';\nimport type { ReportStatus } from '../domains/feed/feed.js';\nimport type { PlatformRole } from './roles.js';\nimport type { Standing } from './standing.js';\n\n/**\n * The verbs.\n *\n * manage every action (CASL's wildcard). Only superadmin holds it on `all`.\n * create, read, update, delete\n * moderate hide, restore or remove someone else's content, act on a report\n * assign grant or revoke (a platform role); take or hand over (a ticket)\n * suspend stop a member signing in to the product, and lift it\n * resolve close a support ticket or a report\n * reset clear a credential its owner forgot (a staff member's MPIN)\n * represent act for a product as one of its team: tag a post with it, reply\n * to its reviews, mark feedback helpful, confirm a tester\n *\n * Taking part (0.12.0, membership): the verbs a viewer is refused and a member\n * holds. Creating content stays `create`; these are the rest.\n *\n * react a reaction on a post, poll or comment; an upvote on a product;\n * marking a review helpful\n * vote vote in a poll\n * save bookmark a post or poll\n * join join a community, ask to, or accept its invitation; accept an\n * invitation to a product's team\n * message start a conversation with a Member\n * refund give a payment's money back (staff)\n *\n * Append only: a stored or packed rule names these.\n */\nexport const ACTION_VALUES = [\n 'manage',\n 'create',\n 'read',\n 'update',\n 'delete',\n 'moderate',\n 'assign',\n 'suspend',\n 'resolve',\n 'reset',\n 'represent',\n 'react',\n 'vote',\n 'save',\n 'join',\n 'message',\n 'refund',\n] as const;\nexport type Action = (typeof ACTION_VALUES)[number];\n\n/**\n * The things.\n *\n * all CASL's wildcard subject\n * Dashboard the staff overview: counts and trends\n * Member a person's account in this product\n * FounderProfile a member's public profile\n * Post, Poll, Comment\n * Report a member's report of a post, poll or comment\n * SupportTicket a member's request for help\n * SavedReply a support agent's reusable answer\n * PlatformRole a staff role, as something granted and revoked\n * AuditEntry the record of a staff action\n * PlatformSettings product-wide configuration\n * Product something a founder builds, with its team\n * Review a member's stars and words on a product\n * Community an official community (0.9.0)\n * CommunitySuggestion a member's suggestion for a new community (0.9.0)\n * Membership a person's platform membership: granted, revoked (0.12.0)\n * Payment a purchase and its invoice, and its refund (0.12.0)\n * Coupon a code that gives a membership or a discount (0.12.0)\n */\nexport const SUBJECT_VALUES = [\n 'all',\n 'Dashboard',\n 'Member',\n 'FounderProfile',\n 'Post',\n 'Poll',\n 'Comment',\n 'Report',\n 'SupportTicket',\n 'SavedReply',\n 'PlatformRole',\n 'AuditEntry',\n 'PlatformSettings',\n 'Product',\n 'Review',\n 'Community',\n 'CommunitySuggestion',\n 'Membership',\n 'Payment',\n 'Coupon',\n] as const;\nexport const subjectSchema = z.enum(SUBJECT_VALUES);\nexport type Subject = z.infer<typeof subjectSchema>;\n\n/**\n * The fields a rule may set CONDITIONS on, per subject: the server's stored\n * names, ids as strings. Declared here so a condition on a field the subject\n * does not have (`{ ownerId: me }` on a Post) is a compile error, on both sides.\n *\n * A web screen does not evaluate these against an API response: a response\n * names things differently (`author.userId`, not `authorId`). Row-level answers\n * come from the server on the item itself (`viewer.canEdit`); the web's own\n * checks are type-level (\"may I moderate Reports at all\").\n */\nexport interface SubjectFields {\n Dashboard: Record<never, never>;\n /**\n * `roles` is the staff roles held (0.20.0: from their access grant; `appRoles`\n * until 0.19.0), so a rule can protect a role (\"never suspend a superadmin\").\n *\n * For `message` (0.12.0), what the asker's relation to them is:\n * `contact` says the asker knows them (a teammate, a private community in\n * common, a conversation already); `standing` is theirs, so nobody starts a\n * conversation with a viewer, who cannot chat; `acceptsStrangers` is their\n * own setting (Premium and Business members may start one, or only people\n * they know). Optional because only the messaging check computes them: a\n * rule on a field that is absent never matches, so a check that forgets them\n * is refused, never let through.\n */\n Member: {\n _id: string;\n roles: PlatformRole[];\n contact?: boolean;\n standing?: Standing;\n acceptsStrangers?: boolean;\n };\n FounderProfile: { userId: string };\n Post: { authorId: string };\n Poll: { authorId: string };\n Comment: { authorId: string };\n Report: { reporterId: string; status: ReportStatus };\n SupportTicket: { memberId: string; assigneeId: string | null };\n SavedReply: { authorId: string };\n /** One role on one person: `memberId` is whose, so \"never your own\" is a rule too. */\n PlatformRole: { role: PlatformRole; memberId: string };\n /** `actorId` is null for an entry a server script wrote. */\n AuditEntry: { actorId: string | null };\n PlatformSettings: Record<never, never>;\n /**\n * The team, as three lists of member ids, so a rule reads \"a product whose\n * managers include me\" (`{ managerIds: me }`). `managerIds` is the owner and\n * the co-founders; `memberIds` is everyone on the team, owner included.\n */\n Product: { ownerId: string; managerIds: string[]; memberIds: string[] };\n Review: { authorId: string };\n /**\n * Its admins and moderators as id lists (0.9.0), so a rule reads \"a\n * community whose admins include me\" (`{ adminIds: me }`). Both short by\n * nature; ordinary members are never listed here (a community has no cap).\n */\n Community: { _id: string; adminIds: string[]; moderatorIds: string[] };\n /** `suggestedBy` so \"your own\" is a rule; `status` so only open ones are decided. */\n CommunitySuggestion: { suggestedBy: string; status: CommunitySuggestionStatus };\n /** Whose membership (0.12.0), so \"never your own\" is a rule. */\n Membership: { userId: string };\n /**\n * Who pays (0.12.0), what for, and where it stands: a viewer may buy only a\n * membership (a plan needs one), only a paid one is refunded, and never by\n * its own payer.\n */\n Payment: { userId: string; status: OrderStatus; kind: PurchaseKind };\n /** Coupons are the platform's (0.12.0): no condition is ever written on one. */\n Coupon: Record<never, never>;\n}\n\n/** A document tagged with its subject type, as CASL's `subject('Post', doc)` makes one. */\nexport type SubjectInstance = {\n [K in keyof SubjectFields]: SubjectFields[K] & ForcedSubject<K>;\n}[keyof SubjectFields];\n\n/**\n * The ability both sides build: the backend from its policy, the web from the\n * rules the backend sends. Mongo-style conditions, typed by `SubjectFields`.\n */\nexport type AppAbility = MongoAbility<[Action, Subject | SubjectInstance]>;\n\n/**\n * Compile-time proof that `SubjectFields` names exactly the subjects, no more\n * and no fewer: adding a subject without its fields fails the build here.\n */\ntype Same<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;\ntype Assert<T extends true> = T;\nexport type EverySubjectHasFields = Assert<Same<keyof SubjectFields, Exclude<Subject, 'all'>>>;\n\n/**\n * Rules as they cross the wire: CASL's `packRules` output, an array of\n * compact arrays. The web unpacks them with `unpackRules` before building its\n * ability. Each starts with its action(s) and subject(s), comma-joined\n * strings (checked, 0.18.0: an unchecked rule list could silently turn staff\n * routing off); what follows (conditions, inverted, fields, reason) is CASL's\n * own compact form.\n */\nconst zeroOrOne = z.union([z.literal(0), z.literal(1)]);\n/**\n * One packed rule, in exactly the shapes CASL's `PackRule` takes (a union of\n * tuples, not a rest: `unpackRules` needs one of these), with `conditions` as\n * `unknown`, which `isAppRawRule` and the ability itself then judge.\n */\nexport const packedRuleSchema = z.union([\n z.tuple([z.string().min(1), z.string().min(1)]),\n z.tuple([z.string().min(1), z.string().min(1), z.unknown()]),\n z.tuple([z.string().min(1), z.string().min(1), z.unknown(), z.literal(1)]),\n z.tuple([z.string().min(1), z.string().min(1), z.unknown(), zeroOrOne, z.string()]),\n z.tuple([\n z.string().min(1),\n z.string().min(1),\n z.unknown(),\n zeroOrOne,\n z.union([z.string(), z.literal(0)]),\n z.string(),\n ]),\n]);\nexport const packedRulesSchema = z.array(packedRuleSchema);\nexport type PackedRules = z.infer<typeof packedRulesSchema>;\n\n/** One rule as CASL's `unpackRules` gives it back, typed for this app. */\nexport type AppRawRule = RawRuleOf<AppAbility>;\n\nconst ACTION_SET: ReadonlySet<string> = new Set(ACTION_VALUES);\nconst SUBJECT_SET: ReadonlySet<string> = new Set(SUBJECT_VALUES);\nconst everyIn = (value: string | string[] | undefined, known: ReadonlySet<string>) =>\n value !== undefined && (Array.isArray(value) ? value : [value]).every((v) => known.has(v));\n\n/**\n * Whether an UNPACKED rule names only this app's actions and subjects\n * (0.18.0). Packed rules cross the wire as strings (`packRules` joins several\n * actions or subjects with commas, so the wire shape cannot be an enum); this\n * is the check that turns them back into `AppRawRule`s, with no cast:\n * `rules.every(isAppRawRule)` narrows the list, and a list that fails is a\n * contract mismatch, never an ability built from it.\n */\nexport function isAppRawRule(rule: {\n action: string | string[];\n subject?: string | string[];\n}): rule is AppRawRule {\n return everyIn(rule.action, ACTION_SET) && everyIn(rule.subject, SUBJECT_SET);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../src/access/permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,SAAS;IACT,SAAS;IACT,OAAO;IACP,WAAW;IACX,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,SAAS;IACT,QAAQ;IACR,QAAQ;CACA,CAAC;AAGX;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,KAAK;IACL,WAAW;IACX,QAAQ;IACR,gBAAgB;IAChB,MAAM;IACN,MAAM;IACN,SAAS;IACT,QAAQ;IACR,eAAe;IACf,YAAY;IACZ,cAAc;IACd,YAAY;IACZ,kBAAkB;IAClB,SAAS;IACT,QAAQ;IACR,WAAW;IACX,qBAAqB;IACrB,YAAY;IACZ,SAAS;IACT,QAAQ;CACA,CAAC;AACX,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAA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,CAAC,CAAC,OAAO,EAAE;QACX,SAAS;QACT,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,MAAM,EAAE;KACX,CAAC;CACH,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAM3D,MAAM,UAAU,GAAwB,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/D,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC,cAAc,CAAC,CAAC;AACjE,MAAM,OAAO,GAAG,CAAC,KAAoC,EAAE,KAA0B,EAAE,EAAE,CACnF,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7F;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,IAG5B;IACC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAChF,CAAC","sourcesContent":["/**\n * founder-schema: what a role may do, in CASL's terms\n *\n * Permissions are ACTION on SUBJECT, optionally narrowed by conditions on the\n * subject's fields (\"update a Post whose authorId is mine\"). The backend writes\n * one small policy per role from these words; the web receives the resulting\n * rules and asks the same questions to decide what to draw. Because both sides\n * spell actions and subjects from this file, a permission check with a typo is\n * a compile error, not a button that silently never shows.\n *\n * The SERVER decides; the web only mirrors. Every rule the web holds came from\n * the server for the role being acted as, and every request is checked again\n * on the server, so a tampered client can show itself a button and nothing\n * more.\n *\n * @module founder-schema/access/permissions\n */\n\nimport type { ForcedSubject, MongoAbility, RawRuleOf } from '@casl/ability';\nimport { z } from 'zod';\nimport type { OrderStatus, PurchaseKind } from '../domains/billing/billing.js';\nimport type { CommunitySuggestionStatus } from '../domains/communities/communities.js';\nimport type { ReportStatus } from '../domains/feed/feed.js';\nimport type { PlatformRole } from './roles.js';\nimport type { Standing } from './standing.js';\n\n/**\n * The verbs.\n *\n * manage every action (CASL's wildcard). Only superadmin holds it on `all`.\n * create, read, update, delete\n * moderate hide, restore or remove someone else's content, act on a report\n * assign grant or revoke (a platform role); take or hand over (a ticket)\n * suspend stop a member signing in to the product, and lift it\n * resolve close a support ticket or a report\n * reset clear a credential its owner forgot (a staff member's MPIN)\n * represent act for a product as one of its team: tag a post with it, reply\n * to its reviews, mark feedback helpful, confirm a tester\n *\n * Taking part (0.12.0, membership): the verbs a viewer is refused and a member\n * holds. Creating content stays `create`; these are the rest.\n *\n * react a reaction on a post, poll or comment; an upvote on a product;\n * marking a review helpful\n * vote vote in a poll\n * save bookmark a post or poll\n * join join a community, ask to, or accept its invitation; accept an\n * invitation to a product's team\n * message start a conversation with a Member\n * refund give a payment's money back (staff)\n * follow follow a Member: see their posts, hear when they post (2026-11-20)\n *\n * Append only: a stored or packed rule names these.\n */\nexport const ACTION_VALUES = [\n 'manage',\n 'create',\n 'read',\n 'update',\n 'delete',\n 'moderate',\n 'assign',\n 'suspend',\n 'resolve',\n 'reset',\n 'represent',\n 'react',\n 'vote',\n 'save',\n 'join',\n 'message',\n 'refund',\n 'follow',\n] as const;\nexport type Action = (typeof ACTION_VALUES)[number];\n\n/**\n * The things.\n *\n * all CASL's wildcard subject\n * Dashboard the staff overview: counts and trends\n * Member a person's account in this product\n * FounderProfile a member's public profile\n * Post, Poll, Comment\n * Report a member's report of a post, poll or comment\n * SupportTicket a member's request for help\n * SavedReply a support agent's reusable answer\n * PlatformRole a staff role, as something granted and revoked\n * AuditEntry the record of a staff action\n * PlatformSettings product-wide configuration\n * Product something a founder builds, with its team\n * Review a member's stars and words on a product\n * Community an official community (0.9.0)\n * CommunitySuggestion a member's suggestion for a new community (0.9.0)\n * Membership a person's platform membership: granted, revoked (0.12.0)\n * Payment a purchase and its invoice, and its refund (0.12.0)\n * Coupon a code that gives a membership or a discount (0.12.0)\n */\nexport const SUBJECT_VALUES = [\n 'all',\n 'Dashboard',\n 'Member',\n 'FounderProfile',\n 'Post',\n 'Poll',\n 'Comment',\n 'Report',\n 'SupportTicket',\n 'SavedReply',\n 'PlatformRole',\n 'AuditEntry',\n 'PlatformSettings',\n 'Product',\n 'Review',\n 'Community',\n 'CommunitySuggestion',\n 'Membership',\n 'Payment',\n 'Coupon',\n] as const;\nexport const subjectSchema = z.enum(SUBJECT_VALUES);\nexport type Subject = z.infer<typeof subjectSchema>;\n\n/**\n * The fields a rule may set CONDITIONS on, per subject: the server's stored\n * names, ids as strings. Declared here so a condition on a field the subject\n * does not have (`{ ownerId: me }` on a Post) is a compile error, on both sides.\n *\n * A web screen does not evaluate these against an API response: a response\n * names things differently (`author.userId`, not `authorId`). Row-level answers\n * come from the server on the item itself (`viewer.canEdit`); the web's own\n * checks are type-level (\"may I moderate Reports at all\").\n */\nexport interface SubjectFields {\n Dashboard: Record<never, never>;\n /**\n * `roles` is the staff roles held (0.20.0: from their access grant; `appRoles`\n * until 0.19.0), so a rule can protect a role (\"never suspend a superadmin\").\n *\n * For `message` (0.12.0), what the asker's relation to them is:\n * `contact` says the asker knows them (a teammate, a private community in\n * common, a conversation already); `standing` is theirs, so nobody starts a\n * conversation with a viewer, who cannot chat; `acceptsStrangers` is their\n * own setting (Premium and Business members may start one, or only people\n * they know). Optional because only the messaging check computes them: a\n * rule on a field that is absent never matches, so a check that forgets them\n * is refused, never let through.\n */\n Member: {\n _id: string;\n roles: PlatformRole[];\n contact?: boolean;\n standing?: Standing;\n acceptsStrangers?: boolean;\n };\n FounderProfile: { userId: string };\n Post: { authorId: string };\n Poll: { authorId: string };\n Comment: { authorId: string };\n Report: { reporterId: string; status: ReportStatus };\n SupportTicket: { memberId: string; assigneeId: string | null };\n SavedReply: { authorId: string };\n /** One role on one person: `memberId` is whose, so \"never your own\" is a rule too. */\n PlatformRole: { role: PlatformRole; memberId: string };\n /** `actorId` is null for an entry a server script wrote. */\n AuditEntry: { actorId: string | null };\n PlatformSettings: Record<never, never>;\n /**\n * The team, as three lists of member ids, so a rule reads \"a product whose\n * managers include me\" (`{ managerIds: me }`). `managerIds` is the owner and\n * the co-founders; `memberIds` is everyone on the team, owner included.\n */\n Product: { ownerId: string; managerIds: string[]; memberIds: string[] };\n Review: { authorId: string };\n /**\n * Its admins and moderators as id lists (0.9.0), so a rule reads \"a\n * community whose admins include me\" (`{ adminIds: me }`). Both short by\n * nature; ordinary members are never listed here (a community has no cap).\n */\n Community: { _id: string; adminIds: string[]; moderatorIds: string[] };\n /** `suggestedBy` so \"your own\" is a rule; `status` so only open ones are decided. */\n CommunitySuggestion: { suggestedBy: string; status: CommunitySuggestionStatus };\n /** Whose membership (0.12.0), so \"never your own\" is a rule. */\n Membership: { userId: string };\n /**\n * Who pays (0.12.0), what for, and where it stands: a viewer may buy only a\n * membership (a plan needs one), only a paid one is refunded, and never by\n * its own payer.\n */\n Payment: { userId: string; status: OrderStatus; kind: PurchaseKind };\n /** Coupons are the platform's (0.12.0): no condition is ever written on one. */\n Coupon: Record<never, never>;\n}\n\n/** A document tagged with its subject type, as CASL's `subject('Post', doc)` makes one. */\nexport type SubjectInstance = {\n [K in keyof SubjectFields]: SubjectFields[K] & ForcedSubject<K>;\n}[keyof SubjectFields];\n\n/**\n * The ability both sides build: the backend from its policy, the web from the\n * rules the backend sends. Mongo-style conditions, typed by `SubjectFields`.\n */\nexport type AppAbility = MongoAbility<[Action, Subject | SubjectInstance]>;\n\n/**\n * Compile-time proof that `SubjectFields` names exactly the subjects, no more\n * and no fewer: adding a subject without its fields fails the build here.\n */\ntype Same<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;\ntype Assert<T extends true> = T;\nexport type EverySubjectHasFields = Assert<Same<keyof SubjectFields, Exclude<Subject, 'all'>>>;\n\n/**\n * Rules as they cross the wire: CASL's `packRules` output, an array of\n * compact arrays. The web unpacks them with `unpackRules` before building its\n * ability. Each starts with its action(s) and subject(s), comma-joined\n * strings (checked, 0.18.0: an unchecked rule list could silently turn staff\n * routing off); what follows (conditions, inverted, fields, reason) is CASL's\n * own compact form.\n */\nconst zeroOrOne = z.union([z.literal(0), z.literal(1)]);\n/**\n * One packed rule, in exactly the shapes CASL's `PackRule` takes (a union of\n * tuples, not a rest: `unpackRules` needs one of these), with `conditions` as\n * `unknown`, which `isAppRawRule` and the ability itself then judge.\n */\nexport const packedRuleSchema = z.union([\n z.tuple([z.string().min(1), z.string().min(1)]),\n z.tuple([z.string().min(1), z.string().min(1), z.unknown()]),\n z.tuple([z.string().min(1), z.string().min(1), z.unknown(), z.literal(1)]),\n z.tuple([z.string().min(1), z.string().min(1), z.unknown(), zeroOrOne, z.string()]),\n z.tuple([\n z.string().min(1),\n z.string().min(1),\n z.unknown(),\n zeroOrOne,\n z.union([z.string(), z.literal(0)]),\n z.string(),\n ]),\n]);\nexport const packedRulesSchema = z.array(packedRuleSchema);\nexport type PackedRules = z.infer<typeof packedRulesSchema>;\n\n/** One rule as CASL's `unpackRules` gives it back, typed for this app. */\nexport type AppRawRule = RawRuleOf<AppAbility>;\n\nconst ACTION_SET: ReadonlySet<string> = new Set(ACTION_VALUES);\nconst SUBJECT_SET: ReadonlySet<string> = new Set(SUBJECT_VALUES);\nconst everyIn = (value: string | string[] | undefined, known: ReadonlySet<string>) =>\n value !== undefined && (Array.isArray(value) ? value : [value]).every((v) => known.has(v));\n\n/**\n * Whether an UNPACKED rule names only this app's actions and subjects\n * (0.18.0). Packed rules cross the wire as strings (`packRules` joins several\n * actions or subjects with commas, so the wire shape cannot be an enum); this\n * is the check that turns them back into `AppRawRule`s, with no cast:\n * `rules.every(isAppRawRule)` narrows the list, and a list that fails is a\n * contract mismatch, never an ability built from it.\n */\nexport function isAppRawRule(rule: {\n action: string | string[];\n subject?: string | string[];\n}): rule is AppRawRule {\n return everyIn(rule.action, ACTION_SET) && everyIn(rule.subject, SUBJECT_SET);\n}\n"]}
|
|
@@ -266,7 +266,6 @@ export declare const communityCardSchema: z.ZodObject<{
|
|
|
266
266
|
marketing: "marketing";
|
|
267
267
|
supply_chain: "supply_chain";
|
|
268
268
|
fundraising: "fundraising";
|
|
269
|
-
social_enterprise: "social_enterprise";
|
|
270
269
|
mentoring: "mentoring";
|
|
271
270
|
leadership: "leadership";
|
|
272
271
|
networking: "networking";
|
|
@@ -325,6 +324,7 @@ export declare const communityCardSchema: z.ZodObject<{
|
|
|
325
324
|
environmental: "environmental";
|
|
326
325
|
women_empowerment: "women_empowerment";
|
|
327
326
|
community_service: "community_service";
|
|
327
|
+
social_enterprise: "social_enterprise";
|
|
328
328
|
education_access: "education_access";
|
|
329
329
|
}>>;
|
|
330
330
|
memberCount: z.ZodNumber;
|
|
@@ -439,7 +439,6 @@ export declare const communitySchema: z.ZodObject<{
|
|
|
439
439
|
marketing: "marketing";
|
|
440
440
|
supply_chain: "supply_chain";
|
|
441
441
|
fundraising: "fundraising";
|
|
442
|
-
social_enterprise: "social_enterprise";
|
|
443
442
|
mentoring: "mentoring";
|
|
444
443
|
leadership: "leadership";
|
|
445
444
|
networking: "networking";
|
|
@@ -498,6 +497,7 @@ export declare const communitySchema: z.ZodObject<{
|
|
|
498
497
|
environmental: "environmental";
|
|
499
498
|
women_empowerment: "women_empowerment";
|
|
500
499
|
community_service: "community_service";
|
|
500
|
+
social_enterprise: "social_enterprise";
|
|
501
501
|
education_access: "education_access";
|
|
502
502
|
}>>;
|
|
503
503
|
memberCount: z.ZodNumber;
|
|
@@ -701,7 +701,6 @@ export declare const communitySuggestionSchema: z.ZodObject<{
|
|
|
701
701
|
marketing: "marketing";
|
|
702
702
|
supply_chain: "supply_chain";
|
|
703
703
|
fundraising: "fundraising";
|
|
704
|
-
social_enterprise: "social_enterprise";
|
|
705
704
|
mentoring: "mentoring";
|
|
706
705
|
leadership: "leadership";
|
|
707
706
|
networking: "networking";
|
|
@@ -760,6 +759,7 @@ export declare const communitySuggestionSchema: z.ZodObject<{
|
|
|
760
759
|
environmental: "environmental";
|
|
761
760
|
women_empowerment: "women_empowerment";
|
|
762
761
|
community_service: "community_service";
|
|
762
|
+
social_enterprise: "social_enterprise";
|
|
763
763
|
education_access: "education_access";
|
|
764
764
|
}>>;
|
|
765
765
|
status: z.ZodEnum<{
|
|
@@ -831,7 +831,6 @@ export declare const communityCardPageSchema: z.ZodObject<{
|
|
|
831
831
|
marketing: "marketing";
|
|
832
832
|
supply_chain: "supply_chain";
|
|
833
833
|
fundraising: "fundraising";
|
|
834
|
-
social_enterprise: "social_enterprise";
|
|
835
834
|
mentoring: "mentoring";
|
|
836
835
|
leadership: "leadership";
|
|
837
836
|
networking: "networking";
|
|
@@ -890,6 +889,7 @@ export declare const communityCardPageSchema: z.ZodObject<{
|
|
|
890
889
|
environmental: "environmental";
|
|
891
890
|
women_empowerment: "women_empowerment";
|
|
892
891
|
community_service: "community_service";
|
|
892
|
+
social_enterprise: "social_enterprise";
|
|
893
893
|
education_access: "education_access";
|
|
894
894
|
}>>;
|
|
895
895
|
memberCount: z.ZodNumber;
|
|
@@ -1032,7 +1032,6 @@ export declare const communitySuggestionPageSchema: z.ZodObject<{
|
|
|
1032
1032
|
marketing: "marketing";
|
|
1033
1033
|
supply_chain: "supply_chain";
|
|
1034
1034
|
fundraising: "fundraising";
|
|
1035
|
-
social_enterprise: "social_enterprise";
|
|
1036
1035
|
mentoring: "mentoring";
|
|
1037
1036
|
leadership: "leadership";
|
|
1038
1037
|
networking: "networking";
|
|
@@ -1091,6 +1090,7 @@ export declare const communitySuggestionPageSchema: z.ZodObject<{
|
|
|
1091
1090
|
environmental: "environmental";
|
|
1092
1091
|
women_empowerment: "women_empowerment";
|
|
1093
1092
|
community_service: "community_service";
|
|
1093
|
+
social_enterprise: "social_enterprise";
|
|
1094
1094
|
education_access: "education_access";
|
|
1095
1095
|
}>>;
|
|
1096
1096
|
status: z.ZodEnum<{
|
|
@@ -1146,7 +1146,6 @@ export declare const communityDiscoverQuerySchema: z.ZodObject<{
|
|
|
1146
1146
|
marketing: "marketing";
|
|
1147
1147
|
supply_chain: "supply_chain";
|
|
1148
1148
|
fundraising: "fundraising";
|
|
1149
|
-
social_enterprise: "social_enterprise";
|
|
1150
1149
|
mentoring: "mentoring";
|
|
1151
1150
|
leadership: "leadership";
|
|
1152
1151
|
networking: "networking";
|
|
@@ -1205,6 +1204,7 @@ export declare const communityDiscoverQuerySchema: z.ZodObject<{
|
|
|
1205
1204
|
environmental: "environmental";
|
|
1206
1205
|
women_empowerment: "women_empowerment";
|
|
1207
1206
|
community_service: "community_service";
|
|
1207
|
+
social_enterprise: "social_enterprise";
|
|
1208
1208
|
education_access: "education_access";
|
|
1209
1209
|
}>>>, unknown>;
|
|
1210
1210
|
}, z.core.$strip>;
|
|
@@ -1289,7 +1289,6 @@ export declare const createCommunityBodySchema: z.ZodObject<{
|
|
|
1289
1289
|
marketing: "marketing";
|
|
1290
1290
|
supply_chain: "supply_chain";
|
|
1291
1291
|
fundraising: "fundraising";
|
|
1292
|
-
social_enterprise: "social_enterprise";
|
|
1293
1292
|
mentoring: "mentoring";
|
|
1294
1293
|
leadership: "leadership";
|
|
1295
1294
|
networking: "networking";
|
|
@@ -1348,6 +1347,7 @@ export declare const createCommunityBodySchema: z.ZodObject<{
|
|
|
1348
1347
|
environmental: "environmental";
|
|
1349
1348
|
women_empowerment: "women_empowerment";
|
|
1350
1349
|
community_service: "community_service";
|
|
1350
|
+
social_enterprise: "social_enterprise";
|
|
1351
1351
|
education_access: "education_access";
|
|
1352
1352
|
}>>>;
|
|
1353
1353
|
iconMediaId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
@@ -1369,7 +1369,6 @@ export declare const updateCommunityBodySchema: z.ZodObject<{
|
|
|
1369
1369
|
marketing: "marketing";
|
|
1370
1370
|
supply_chain: "supply_chain";
|
|
1371
1371
|
fundraising: "fundraising";
|
|
1372
|
-
social_enterprise: "social_enterprise";
|
|
1373
1372
|
mentoring: "mentoring";
|
|
1374
1373
|
leadership: "leadership";
|
|
1375
1374
|
networking: "networking";
|
|
@@ -1428,6 +1427,7 @@ export declare const updateCommunityBodySchema: z.ZodObject<{
|
|
|
1428
1427
|
environmental: "environmental";
|
|
1429
1428
|
women_empowerment: "women_empowerment";
|
|
1430
1429
|
community_service: "community_service";
|
|
1430
|
+
social_enterprise: "social_enterprise";
|
|
1431
1431
|
education_access: "education_access";
|
|
1432
1432
|
}>>>;
|
|
1433
1433
|
}, z.core.$strip>;
|
|
@@ -1521,7 +1521,6 @@ export declare const createCommunitySuggestionBodySchema: z.ZodObject<{
|
|
|
1521
1521
|
marketing: "marketing";
|
|
1522
1522
|
supply_chain: "supply_chain";
|
|
1523
1523
|
fundraising: "fundraising";
|
|
1524
|
-
social_enterprise: "social_enterprise";
|
|
1525
1524
|
mentoring: "mentoring";
|
|
1526
1525
|
leadership: "leadership";
|
|
1527
1526
|
networking: "networking";
|
|
@@ -1580,6 +1579,7 @@ export declare const createCommunitySuggestionBodySchema: z.ZodObject<{
|
|
|
1580
1579
|
environmental: "environmental";
|
|
1581
1580
|
women_empowerment: "women_empowerment";
|
|
1582
1581
|
community_service: "community_service";
|
|
1582
|
+
social_enterprise: "social_enterprise";
|
|
1583
1583
|
education_access: "education_access";
|
|
1584
1584
|
}>>>;
|
|
1585
1585
|
}, z.core.$strip>;
|
|
@@ -77,7 +77,10 @@ export declare const discoverQuerySchema: z.ZodObject<{
|
|
|
77
77
|
}, z.core.$strip>;
|
|
78
78
|
export type DiscoverQuery = z.infer<typeof discoverQuerySchema>;
|
|
79
79
|
export type DiscoverQueryInput = z.input<typeof discoverQuerySchema>;
|
|
80
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* A page of founder cards, most recently updated first, each with how the
|
|
82
|
+
* viewer relates to them (2026-11-20: the People card's meta line and Follow).
|
|
83
|
+
*/
|
|
81
84
|
export declare const discoverPageSchema: z.ZodObject<{
|
|
82
85
|
items: z.ZodArray<z.ZodObject<{
|
|
83
86
|
id: z.ZodString;
|
|
@@ -132,6 +135,17 @@ export declare const discoverPageSchema: z.ZodObject<{
|
|
|
132
135
|
profitable: "profitable";
|
|
133
136
|
exited: "exited";
|
|
134
137
|
}>;
|
|
138
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
139
|
+
founder: "founder";
|
|
140
|
+
other: "other";
|
|
141
|
+
co_founder: "co_founder";
|
|
142
|
+
ceo: "ceo";
|
|
143
|
+
cto: "cto";
|
|
144
|
+
coo: "coo";
|
|
145
|
+
cfo: "cfo";
|
|
146
|
+
cmo: "cmo";
|
|
147
|
+
cpo: "cpo";
|
|
148
|
+
}>>>;
|
|
135
149
|
teamSize: z.ZodOptional<z.ZodNumber>;
|
|
136
150
|
foundedYear: z.ZodOptional<z.ZodNumber>;
|
|
137
151
|
}, z.core.$strip>>;
|
|
@@ -172,6 +186,91 @@ export declare const discoverPageSchema: z.ZodObject<{
|
|
|
172
186
|
find_service_providers: "find_service_providers";
|
|
173
187
|
attend_events: "attend_events";
|
|
174
188
|
}>>>;
|
|
189
|
+
interests: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
190
|
+
ai_ml: "ai_ml";
|
|
191
|
+
b2b_saas: "b2b_saas";
|
|
192
|
+
d2c: "d2c";
|
|
193
|
+
deeptech: "deeptech";
|
|
194
|
+
robotics: "robotics";
|
|
195
|
+
growth: "growth";
|
|
196
|
+
sales: "sales";
|
|
197
|
+
marketing: "marketing";
|
|
198
|
+
supply_chain: "supply_chain";
|
|
199
|
+
fundraising: "fundraising";
|
|
200
|
+
mentoring: "mentoring";
|
|
201
|
+
leadership: "leadership";
|
|
202
|
+
networking: "networking";
|
|
203
|
+
public_speaking: "public_speaking";
|
|
204
|
+
teaching: "teaching";
|
|
205
|
+
hiring_talent: "hiring_talent";
|
|
206
|
+
personal_branding: "personal_branding";
|
|
207
|
+
career_transition: "career_transition";
|
|
208
|
+
remote_work: "remote_work";
|
|
209
|
+
blockchain: "blockchain";
|
|
210
|
+
crypto_web3: "crypto_web3";
|
|
211
|
+
data_science: "data_science";
|
|
212
|
+
cybersecurity: "cybersecurity";
|
|
213
|
+
game_dev: "game_dev";
|
|
214
|
+
ux_design: "ux_design";
|
|
215
|
+
app_development: "app_development";
|
|
216
|
+
open_source: "open_source";
|
|
217
|
+
electronics: "electronics";
|
|
218
|
+
space_exploration: "space_exploration";
|
|
219
|
+
green_tech: "green_tech";
|
|
220
|
+
no_code: "no_code";
|
|
221
|
+
entrepreneurship: "entrepreneurship";
|
|
222
|
+
investing: "investing";
|
|
223
|
+
stock_trading: "stock_trading";
|
|
224
|
+
personal_finance: "personal_finance";
|
|
225
|
+
consulting: "consulting";
|
|
226
|
+
ecommerce: "ecommerce";
|
|
227
|
+
retail: "retail";
|
|
228
|
+
real_estate: "real_estate";
|
|
229
|
+
product_management: "product_management";
|
|
230
|
+
meditation: "meditation";
|
|
231
|
+
journaling: "journaling";
|
|
232
|
+
self_improvement: "self_improvement";
|
|
233
|
+
productivity: "productivity";
|
|
234
|
+
reading: "reading";
|
|
235
|
+
online_courses: "online_courses";
|
|
236
|
+
philosophy: "philosophy";
|
|
237
|
+
psychology: "psychology";
|
|
238
|
+
therapy: "therapy";
|
|
239
|
+
sleep_optimization: "sleep_optimization";
|
|
240
|
+
gym: "gym";
|
|
241
|
+
yoga: "yoga";
|
|
242
|
+
photography: "photography";
|
|
243
|
+
writing: "writing";
|
|
244
|
+
graphic_design: "graphic_design";
|
|
245
|
+
filmmaking: "filmmaking";
|
|
246
|
+
digital_art: "digital_art";
|
|
247
|
+
content_creation: "content_creation";
|
|
248
|
+
blogging: "blogging";
|
|
249
|
+
vlogging: "vlogging";
|
|
250
|
+
podcasts: "podcasts";
|
|
251
|
+
animation: "animation";
|
|
252
|
+
music_production: "music_production";
|
|
253
|
+
volunteering: "volunteering";
|
|
254
|
+
ngo_work: "ngo_work";
|
|
255
|
+
environmental: "environmental";
|
|
256
|
+
women_empowerment: "women_empowerment";
|
|
257
|
+
community_service: "community_service";
|
|
258
|
+
social_enterprise: "social_enterprise";
|
|
259
|
+
education_access: "education_access";
|
|
260
|
+
}>>>;
|
|
261
|
+
follow: z.ZodObject<{
|
|
262
|
+
following: z.ZodBoolean;
|
|
263
|
+
followsYou: z.ZodBoolean;
|
|
264
|
+
followedBy: z.ZodObject<{
|
|
265
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
266
|
+
others: z.ZodNumber;
|
|
267
|
+
}, z.core.$strip>;
|
|
268
|
+
mutuals: z.ZodOptional<z.ZodObject<{
|
|
269
|
+
count: z.ZodNumber;
|
|
270
|
+
sampleNames: z.ZodArray<z.ZodString>;
|
|
271
|
+
avatars: z.ZodArray<z.ZodNullable<z.ZodURL>>;
|
|
272
|
+
}, z.core.$strip>>;
|
|
273
|
+
}, z.core.$strip>;
|
|
175
274
|
}, z.core.$strip>>;
|
|
176
275
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
177
276
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../../src/domains/discover/discover.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAErE
|
|
1
|
+
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../../src/domains/discover/discover.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAoC,CAAC;AACpE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAM9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { z } from 'zod';
|
|
|
11
11
|
import { industrySchema, multiValueQuery, optionalTrimmedString, paginationQuerySchema, skillSchema, startupStageSchema, } from '../../core/common.js';
|
|
12
12
|
import { DISCOVER_FILTER_VALUES_MAX, DISCOVER_TEXT_MAX } from '../../core/limits.js';
|
|
13
13
|
import { paginatedSchema } from '../../core/responses.js';
|
|
14
|
-
import {
|
|
14
|
+
import { personCardSchema } from '../follows/follows.js';
|
|
15
15
|
/** A Discover multi-select (`?skill=a&skill=b`): see `multiValueQuery`. */
|
|
16
16
|
const multiValue = (inner) => multiValueQuery(inner, DISCOVER_FILTER_VALUES_MAX);
|
|
17
17
|
/**
|
|
@@ -33,8 +33,11 @@ export const discoverQuerySchema = paginationQuerySchema.extend({
|
|
|
33
33
|
city: optionalTrimmedString(DISCOVER_TEXT_MAX),
|
|
34
34
|
country: optionalTrimmedString(DISCOVER_TEXT_MAX),
|
|
35
35
|
});
|
|
36
|
-
/**
|
|
37
|
-
|
|
36
|
+
/**
|
|
37
|
+
* A page of founder cards, most recently updated first, each with how the
|
|
38
|
+
* viewer relates to them (2026-11-20: the People card's meta line and Follow).
|
|
39
|
+
*/
|
|
40
|
+
export const discoverPageSchema = paginatedSchema(personCardSchema);
|
|
38
41
|
/** One filter option and how many listed founders match it. */
|
|
39
42
|
const facetOption = (value) => z.object({ value, count: z.number().int().nonnegative() });
|
|
40
43
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../../src/domains/discover/discover.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"discover.js","sourceRoot":"","sources":["../../../src/domains/discover/discover.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OA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CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACzC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;CACzC,CAAC,CAAC","sourcesContent":["/**\n * founder-schema — Discover search and filters\n *\n * Search is by name; the filters are industry, skill, startup stage and\n * location. The community surface the Discover tab will grow later is not\n * modelled yet.\n *\n * @module founder-schema/domains/discover\n */\n\nimport { z } from 'zod';\nimport {\n industrySchema,\n multiValueQuery,\n optionalTrimmedString,\n paginationQuerySchema,\n skillSchema,\n startupStageSchema,\n} from '../../core/common.js';\nimport { DISCOVER_FILTER_VALUES_MAX, DISCOVER_TEXT_MAX } from '../../core/limits.js';\nimport { paginatedSchema } from '../../core/responses.js';\nimport { personCardSchema } from '../follows/follows.js';\n\n/** A Discover multi-select (`?skill=a&skill=b`): see `multiValueQuery`. */\nconst multiValue = <T extends z.ZodType>(inner: T) =>\n multiValueQuery(inner, DISCOVER_FILTER_VALUES_MAX);\n\n/**\n * Every free-text filter here is `optionalTrimmedString`, so an EMPTY one is\n * treated as \"not provided\" rather than as a validation failure.\n *\n * A search box the member has just cleared sends `?q=`, and a select they reset\n * sends `?city=`. Refusing those turns an ordinary interaction into a 400 with\n * nothing useful to show for it: the member asked for fewer filters, not for an\n * error. This is the one place the create-body rule and the patch-body rule\n * agree, because a query has nothing to erase.\n */\nexport const discoverQuerySchema = paginationQuerySchema.extend({\n /** Free-text name search. Matched against display name and username. */\n q: optionalTrimmedString(DISCOVER_TEXT_MAX),\n industry: multiValue(industrySchema),\n skill: multiValue(skillSchema),\n stage: multiValue(startupStageSchema),\n city: optionalTrimmedString(DISCOVER_TEXT_MAX),\n country: optionalTrimmedString(DISCOVER_TEXT_MAX),\n});\nexport type DiscoverQuery = z.infer<typeof discoverQuerySchema>;\nexport type DiscoverQueryInput = z.input<typeof discoverQuerySchema>;\n\n/**\n * A page of founder cards, most recently updated first, each with how the\n * viewer relates to them (2026-11-20: the People card's meta line and Follow).\n */\nexport const discoverPageSchema = paginatedSchema(personCardSchema);\nexport type DiscoverPage = z.infer<typeof discoverPageSchema>;\n\n/** One filter option and how many listed founders match it. */\nconst facetOption = <T extends z.ZodType>(value: T) =>\n z.object({ value, count: z.number().int().nonnegative() });\n\n/**\n * The filter options the Discover drawer offers, with counts. The VALUES come\n * from the enums here, so the options cannot disagree with what the query\n * accepts.\n *\n * ⚠ NO LABELS. The value IS the translation key (`industries.<value>`,\n * `stages.<value>`, `skills.<value>`), and a client words it in the member's\n * language. Until 0.2.0 the server also sent an English `label` per option,\n * built by capitalising the value (\"Ai ml\"), which no client read and which\n * would have been wrong in Hindi if one had. Cities are member-typed place\n * names, so their value is shown as it is.\n */\nexport const discoverFacetsSchema = z.object({\n industries: z.array(facetOption(industrySchema)),\n skills: z.array(facetOption(skillSchema)),\n stages: z.array(facetOption(startupStageSchema)),\n cities: z.array(facetOption(z.string())),\n});\nexport type DiscoverFacets = z.infer<typeof discoverFacetsSchema>;\n"]}
|
|
@@ -430,7 +430,6 @@ export declare const feedPostSchema: z.ZodObject<{
|
|
|
430
430
|
marketing: "marketing";
|
|
431
431
|
supply_chain: "supply_chain";
|
|
432
432
|
fundraising: "fundraising";
|
|
433
|
-
social_enterprise: "social_enterprise";
|
|
434
433
|
mentoring: "mentoring";
|
|
435
434
|
leadership: "leadership";
|
|
436
435
|
networking: "networking";
|
|
@@ -489,6 +488,7 @@ export declare const feedPostSchema: z.ZodObject<{
|
|
|
489
488
|
environmental: "environmental";
|
|
490
489
|
women_empowerment: "women_empowerment";
|
|
491
490
|
community_service: "community_service";
|
|
491
|
+
social_enterprise: "social_enterprise";
|
|
492
492
|
education_access: "education_access";
|
|
493
493
|
}>>;
|
|
494
494
|
product: z.ZodOptional<z.ZodObject<{
|
|
@@ -649,7 +649,6 @@ export declare const feedPollSchema: z.ZodObject<{
|
|
|
649
649
|
marketing: "marketing";
|
|
650
650
|
supply_chain: "supply_chain";
|
|
651
651
|
fundraising: "fundraising";
|
|
652
|
-
social_enterprise: "social_enterprise";
|
|
653
652
|
mentoring: "mentoring";
|
|
654
653
|
leadership: "leadership";
|
|
655
654
|
networking: "networking";
|
|
@@ -708,6 +707,7 @@ export declare const feedPollSchema: z.ZodObject<{
|
|
|
708
707
|
environmental: "environmental";
|
|
709
708
|
women_empowerment: "women_empowerment";
|
|
710
709
|
community_service: "community_service";
|
|
710
|
+
social_enterprise: "social_enterprise";
|
|
711
711
|
education_access: "education_access";
|
|
712
712
|
}>>;
|
|
713
713
|
product: z.ZodOptional<z.ZodObject<{
|
|
@@ -814,7 +814,6 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
814
814
|
marketing: "marketing";
|
|
815
815
|
supply_chain: "supply_chain";
|
|
816
816
|
fundraising: "fundraising";
|
|
817
|
-
social_enterprise: "social_enterprise";
|
|
818
817
|
mentoring: "mentoring";
|
|
819
818
|
leadership: "leadership";
|
|
820
819
|
networking: "networking";
|
|
@@ -873,6 +872,7 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
873
872
|
environmental: "environmental";
|
|
874
873
|
women_empowerment: "women_empowerment";
|
|
875
874
|
community_service: "community_service";
|
|
875
|
+
social_enterprise: "social_enterprise";
|
|
876
876
|
education_access: "education_access";
|
|
877
877
|
}>>;
|
|
878
878
|
product: z.ZodOptional<z.ZodObject<{
|
|
@@ -1012,7 +1012,6 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1012
1012
|
marketing: "marketing";
|
|
1013
1013
|
supply_chain: "supply_chain";
|
|
1014
1014
|
fundraising: "fundraising";
|
|
1015
|
-
social_enterprise: "social_enterprise";
|
|
1016
1015
|
mentoring: "mentoring";
|
|
1017
1016
|
leadership: "leadership";
|
|
1018
1017
|
networking: "networking";
|
|
@@ -1071,6 +1070,7 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1071
1070
|
environmental: "environmental";
|
|
1072
1071
|
women_empowerment: "women_empowerment";
|
|
1073
1072
|
community_service: "community_service";
|
|
1073
|
+
social_enterprise: "social_enterprise";
|
|
1074
1074
|
education_access: "education_access";
|
|
1075
1075
|
}>>;
|
|
1076
1076
|
product: z.ZodOptional<z.ZodObject<{
|
|
@@ -1334,7 +1334,6 @@ export declare const feedPageSchema: z.ZodObject<{
|
|
|
1334
1334
|
marketing: "marketing";
|
|
1335
1335
|
supply_chain: "supply_chain";
|
|
1336
1336
|
fundraising: "fundraising";
|
|
1337
|
-
social_enterprise: "social_enterprise";
|
|
1338
1337
|
mentoring: "mentoring";
|
|
1339
1338
|
leadership: "leadership";
|
|
1340
1339
|
networking: "networking";
|
|
@@ -1393,6 +1392,7 @@ export declare const feedPageSchema: z.ZodObject<{
|
|
|
1393
1392
|
environmental: "environmental";
|
|
1394
1393
|
women_empowerment: "women_empowerment";
|
|
1395
1394
|
community_service: "community_service";
|
|
1395
|
+
social_enterprise: "social_enterprise";
|
|
1396
1396
|
education_access: "education_access";
|
|
1397
1397
|
}>>;
|
|
1398
1398
|
product: z.ZodOptional<z.ZodObject<{
|
|
@@ -1532,7 +1532,6 @@ export declare const feedPageSchema: z.ZodObject<{
|
|
|
1532
1532
|
marketing: "marketing";
|
|
1533
1533
|
supply_chain: "supply_chain";
|
|
1534
1534
|
fundraising: "fundraising";
|
|
1535
|
-
social_enterprise: "social_enterprise";
|
|
1536
1535
|
mentoring: "mentoring";
|
|
1537
1536
|
leadership: "leadership";
|
|
1538
1537
|
networking: "networking";
|
|
@@ -1591,6 +1590,7 @@ export declare const feedPageSchema: z.ZodObject<{
|
|
|
1591
1590
|
environmental: "environmental";
|
|
1592
1591
|
women_empowerment: "women_empowerment";
|
|
1593
1592
|
community_service: "community_service";
|
|
1593
|
+
social_enterprise: "social_enterprise";
|
|
1594
1594
|
education_access: "education_access";
|
|
1595
1595
|
}>>;
|
|
1596
1596
|
product: z.ZodOptional<z.ZodObject<{
|
|
@@ -1699,7 +1699,6 @@ export declare const pinnedItemsSchema: z.ZodObject<{
|
|
|
1699
1699
|
marketing: "marketing";
|
|
1700
1700
|
supply_chain: "supply_chain";
|
|
1701
1701
|
fundraising: "fundraising";
|
|
1702
|
-
social_enterprise: "social_enterprise";
|
|
1703
1702
|
mentoring: "mentoring";
|
|
1704
1703
|
leadership: "leadership";
|
|
1705
1704
|
networking: "networking";
|
|
@@ -1758,6 +1757,7 @@ export declare const pinnedItemsSchema: z.ZodObject<{
|
|
|
1758
1757
|
environmental: "environmental";
|
|
1759
1758
|
women_empowerment: "women_empowerment";
|
|
1760
1759
|
community_service: "community_service";
|
|
1760
|
+
social_enterprise: "social_enterprise";
|
|
1761
1761
|
education_access: "education_access";
|
|
1762
1762
|
}>>;
|
|
1763
1763
|
product: z.ZodOptional<z.ZodObject<{
|
|
@@ -1897,7 +1897,6 @@ export declare const pinnedItemsSchema: z.ZodObject<{
|
|
|
1897
1897
|
marketing: "marketing";
|
|
1898
1898
|
supply_chain: "supply_chain";
|
|
1899
1899
|
fundraising: "fundraising";
|
|
1900
|
-
social_enterprise: "social_enterprise";
|
|
1901
1900
|
mentoring: "mentoring";
|
|
1902
1901
|
leadership: "leadership";
|
|
1903
1902
|
networking: "networking";
|
|
@@ -1956,6 +1955,7 @@ export declare const pinnedItemsSchema: z.ZodObject<{
|
|
|
1956
1955
|
environmental: "environmental";
|
|
1957
1956
|
women_empowerment: "women_empowerment";
|
|
1958
1957
|
community_service: "community_service";
|
|
1958
|
+
social_enterprise: "social_enterprise";
|
|
1959
1959
|
education_access: "education_access";
|
|
1960
1960
|
}>>;
|
|
1961
1961
|
product: z.ZodOptional<z.ZodObject<{
|
|
@@ -2310,7 +2310,6 @@ export declare const createPostBodySchema: z.ZodObject<{
|
|
|
2310
2310
|
marketing: "marketing";
|
|
2311
2311
|
supply_chain: "supply_chain";
|
|
2312
2312
|
fundraising: "fundraising";
|
|
2313
|
-
social_enterprise: "social_enterprise";
|
|
2314
2313
|
mentoring: "mentoring";
|
|
2315
2314
|
leadership: "leadership";
|
|
2316
2315
|
networking: "networking";
|
|
@@ -2369,6 +2368,7 @@ export declare const createPostBodySchema: z.ZodObject<{
|
|
|
2369
2368
|
environmental: "environmental";
|
|
2370
2369
|
women_empowerment: "women_empowerment";
|
|
2371
2370
|
community_service: "community_service";
|
|
2371
|
+
social_enterprise: "social_enterprise";
|
|
2372
2372
|
education_access: "education_access";
|
|
2373
2373
|
}>>>;
|
|
2374
2374
|
}, z.core.$strip>;
|
|
@@ -2409,7 +2409,6 @@ export declare const createPollBodySchema: z.ZodObject<{
|
|
|
2409
2409
|
marketing: "marketing";
|
|
2410
2410
|
supply_chain: "supply_chain";
|
|
2411
2411
|
fundraising: "fundraising";
|
|
2412
|
-
social_enterprise: "social_enterprise";
|
|
2413
2412
|
mentoring: "mentoring";
|
|
2414
2413
|
leadership: "leadership";
|
|
2415
2414
|
networking: "networking";
|
|
@@ -2468,6 +2467,7 @@ export declare const createPollBodySchema: z.ZodObject<{
|
|
|
2468
2467
|
environmental: "environmental";
|
|
2469
2468
|
women_empowerment: "women_empowerment";
|
|
2470
2469
|
community_service: "community_service";
|
|
2470
|
+
social_enterprise: "social_enterprise";
|
|
2471
2471
|
education_access: "education_access";
|
|
2472
2472
|
}>>>;
|
|
2473
2473
|
}, z.core.$strip>;
|
|
@@ -2695,7 +2695,6 @@ export declare const castVoteResponseSchema: z.ZodObject<{
|
|
|
2695
2695
|
marketing: "marketing";
|
|
2696
2696
|
supply_chain: "supply_chain";
|
|
2697
2697
|
fundraising: "fundraising";
|
|
2698
|
-
social_enterprise: "social_enterprise";
|
|
2699
2698
|
mentoring: "mentoring";
|
|
2700
2699
|
leadership: "leadership";
|
|
2701
2700
|
networking: "networking";
|
|
@@ -2754,6 +2753,7 @@ export declare const castVoteResponseSchema: z.ZodObject<{
|
|
|
2754
2753
|
environmental: "environmental";
|
|
2755
2754
|
women_empowerment: "women_empowerment";
|
|
2756
2755
|
community_service: "community_service";
|
|
2756
|
+
social_enterprise: "social_enterprise";
|
|
2757
2757
|
education_access: "education_access";
|
|
2758
2758
|
}>>;
|
|
2759
2759
|
product: z.ZodOptional<z.ZodObject<{
|