founder-schema 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +18 -15
  2. package/dist/access/access.d.ts +76 -0
  3. package/dist/access/access.d.ts.map +1 -0
  4. package/dist/access/access.js +66 -0
  5. package/dist/access/access.js.map +1 -0
  6. package/dist/access/permissions.d.ts +153 -0
  7. package/dist/access/permissions.d.ts.map +1 -0
  8. package/dist/access/permissions.js +80 -0
  9. package/dist/access/permissions.js.map +1 -0
  10. package/dist/access/roles.d.ts +71 -0
  11. package/dist/access/roles.d.ts.map +1 -0
  12. package/dist/access/roles.js +72 -0
  13. package/dist/access/roles.js.map +1 -0
  14. package/dist/chat.d.ts +4 -4
  15. package/dist/chat.d.ts.map +1 -1
  16. package/dist/chat.js +7 -2
  17. package/dist/chat.js.map +1 -1
  18. package/dist/core/common.d.ts +304 -0
  19. package/dist/core/common.d.ts.map +1 -0
  20. package/dist/core/common.js +340 -0
  21. package/dist/core/common.js.map +1 -0
  22. package/dist/core/errors.d.ts +105 -0
  23. package/dist/core/errors.d.ts.map +1 -0
  24. package/dist/core/errors.js +115 -0
  25. package/dist/core/errors.js.map +1 -0
  26. package/dist/core/limits.d.ts +99 -0
  27. package/dist/core/limits.d.ts.map +1 -0
  28. package/dist/core/limits.js +109 -0
  29. package/dist/core/limits.js.map +1 -0
  30. package/dist/core/responses.d.ts +195 -0
  31. package/dist/core/responses.d.ts.map +1 -0
  32. package/dist/core/responses.js +73 -0
  33. package/dist/core/responses.js.map +1 -0
  34. package/dist/core/validation.d.ts +144 -0
  35. package/dist/core/validation.d.ts.map +1 -0
  36. package/dist/core/validation.js +150 -0
  37. package/dist/core/validation.js.map +1 -0
  38. package/dist/domains/account/account.d.ts +40 -0
  39. package/dist/domains/account/account.d.ts.map +1 -0
  40. package/dist/domains/account/account.js +39 -0
  41. package/dist/domains/account/account.js.map +1 -0
  42. package/dist/domains/audit/audit.d.ts +169 -0
  43. package/dist/domains/audit/audit.d.ts.map +1 -0
  44. package/dist/domains/audit/audit.js +84 -0
  45. package/dist/domains/audit/audit.js.map +1 -0
  46. package/dist/domains/chat/chat.d.ts +187 -0
  47. package/dist/domains/chat/chat.d.ts.map +1 -0
  48. package/dist/domains/chat/chat.js +189 -0
  49. package/dist/domains/chat/chat.js.map +1 -0
  50. package/dist/domains/dashboard/dashboard.d.ts +48 -0
  51. package/dist/domains/dashboard/dashboard.d.ts.map +1 -0
  52. package/dist/domains/dashboard/dashboard.js +58 -0
  53. package/dist/domains/dashboard/dashboard.js.map +1 -0
  54. package/dist/domains/discover/discover.d.ts +245 -0
  55. package/dist/domains/discover/discover.d.ts.map +1 -0
  56. package/dist/domains/discover/discover.js +68 -0
  57. package/dist/domains/discover/discover.js.map +1 -0
  58. package/dist/domains/feed/feed.d.ts +1658 -0
  59. package/dist/domains/feed/feed.d.ts.map +1 -0
  60. package/dist/domains/feed/feed.js +623 -0
  61. package/dist/domains/feed/feed.js.map +1 -0
  62. package/dist/domains/members/members.d.ts +175 -0
  63. package/dist/domains/members/members.d.ts.map +1 -0
  64. package/dist/domains/members/members.js +106 -0
  65. package/dist/domains/members/members.js.map +1 -0
  66. package/dist/domains/moderation/moderation.d.ts +184 -0
  67. package/dist/domains/moderation/moderation.d.ts.map +1 -0
  68. package/dist/domains/moderation/moderation.js +90 -0
  69. package/dist/domains/moderation/moderation.js.map +1 -0
  70. package/dist/domains/onboarding/onboarding.d.ts +1018 -0
  71. package/dist/domains/onboarding/onboarding.d.ts.map +1 -0
  72. package/dist/domains/onboarding/onboarding.js +717 -0
  73. package/dist/domains/onboarding/onboarding.js.map +1 -0
  74. package/dist/domains/profile/founder-profile.d.ts +387 -0
  75. package/dist/domains/profile/founder-profile.d.ts.map +1 -0
  76. package/dist/domains/profile/founder-profile.js +180 -0
  77. package/dist/domains/profile/founder-profile.js.map +1 -0
  78. package/dist/domains/support/support.d.ts +305 -0
  79. package/dist/domains/support/support.d.ts.map +1 -0
  80. package/dist/domains/support/support.js +129 -0
  81. package/dist/domains/support/support.js.map +1 -0
  82. package/dist/domains/team/team.d.ts +79 -0
  83. package/dist/domains/team/team.d.ts.map +1 -0
  84. package/dist/domains/team/team.js +54 -0
  85. package/dist/domains/team/team.js.map +1 -0
  86. package/dist/domains/uploads/uploads.d.ts +113 -0
  87. package/dist/domains/uploads/uploads.d.ts.map +1 -0
  88. package/dist/domains/uploads/uploads.js +106 -0
  89. package/dist/domains/uploads/uploads.js.map +1 -0
  90. package/dist/env.d.ts +85 -0
  91. package/dist/env.d.ts.map +1 -0
  92. package/dist/env.js +150 -0
  93. package/dist/env.js.map +1 -0
  94. package/dist/index.d.ts +21 -12
  95. package/dist/index.d.ts.map +1 -1
  96. package/dist/index.js +29 -18
  97. package/dist/index.js.map +1 -1
  98. package/dist/onboarding.d.ts +58 -32
  99. package/dist/onboarding.d.ts.map +1 -1
  100. package/dist/onboarding.js +155 -32
  101. package/dist/onboarding.js.map +1 -1
  102. package/package.json +14 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feed.js","sourceRoot":"","sources":["../../../src/domains/feed/feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,aAAa,EACb,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,g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E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,IAAI,EAAE,cAAc;CACrB,CAAC,CAAC","sourcesContent":["/**\n * founder-schema — Feed wire shapes: post, poll, comment, reaction\n *\n * ADAPTED FROM `jansathi-community-schema`, NOT DEPENDENT ON IT.\n *\n * The user ruled on 2026-09-21 that Founder Circle is a standalone app, so\n * these shapes are copied and cut down rather than imported. The reason is\n * worth keeping: `jansathi-community-schema` encodes Jansathi's reach levels,\n * community designations, official-area kinds and crowdfunding audiences.\n * Depending on it would put all of that permanently inside our contract for a\n * feed that has none of those concepts, and would mean a Jansathi publish can\n * break this product.\n *\n * DELIBERATELY NOT PORTED, so nobody \"restores\" them:\n * - the five civic verticals (lost_found, suggestions_complaints,\n * donate_item, crowdfunding, event). `contentKind` here is post | poll\n * only; comment threads and bookmarks key off it, and reactions and\n * reports off the same union plus `comment`.\n * - official communities, designations, identity verification badges.\n * - social score, and the whole area-proximity ranking vocabulary\n * (local / district / state / national / global).\n * - `areaLineage` as a REQUIRED authorship snapshot. Jansathi gates its\n * composer on a declared residence resolving to Indian district level or\n * deeper; the user ruled location is never mandatory here, so nothing in\n * this file requires one.\n * - anonymous posting, which in Jansathi is gated on identity verification\n * we do not have. A founders' network is an identified network.\n *\n * @module founder-schema/domains/feed\n */\n\nimport { z } from 'zod';\nimport {\n emptyStringToUndefined,\n objectIdSchema,\n paginationQuerySchema,\n safeUrlSchema,\n usernameSchema,\n} from '../../core/common.js';\nimport {\n LINK_PREVIEW_DESCRIPTION_MAX,\n LINK_PREVIEW_TITLE_MAX,\n MEDIA_ALT_MAX,\n REPORT_NOTE_MAX,\n} from '../../core/limits.js';\nimport { paginatedSchema } from '../../core/responses.js';\nimport { VALIDATION_MESSAGE } from '../../core/validation.js';\nimport { topicSchema } from '../onboarding/onboarding.js';\nimport { uploadKeySchema } from '../uploads/uploads.js';\n\n// ─── Limits ──────────────────────────────────────────────────────────────────\n\n/**\n * Exported because the composer must count down to the SAME number the server\n * rejects at. A client-side limit that disagrees with the server is a message\n * a member cannot send and cannot see why.\n */\nexport const POST_MAX_BODY_CHARS = 5000;\n/**\n * Total attachments on one post, images and videos together.\n *\n * ONE cap over ONE ordered list, rather than Jansathi's separate image and\n * video arrays. A member who posts a screenshot, then a clip, then another\n * screenshot means that order, and two parallel arrays cannot express it: the\n * card would show both images and then the video, which is not what was\n * written.\n */\nexport const POST_MAX_MEDIA = 10;\n/**\n * Topics per item.\n *\n * Capped low on purpose: a post tagged with everything is about nothing, and\n * one tagged with ten matches every member, which is how a relevance feature\n * turns back into a chronological one.\n */\nexport const MAX_TOPICS = 3;\nexport const COMMENT_MAX_BODY_CHARS = 2000;\n\nexport const POLL_QUESTION_MAX_CHARS = 280;\nexport const POLL_OPTION_MAX_CHARS = 80;\nexport const POLL_MIN_OPTIONS = 2;\nexport const POLL_MAX_OPTIONS = 6;\n/** 5 minutes. Below this a poll closes before anyone sees it. */\nexport const POLL_MIN_DURATION_MS = 5 * 60 * 1000;\n/** 30 days. */\nexport const POLL_MAX_DURATION_MS = 30 * 24 * 60 * 60 * 1000;\n\n/**\n * How long after writing it the author may still edit a post or a comment.\n *\n * A window rather than forever: an edit after people have reacted changes what\n * they reacted to. Deletion has no window, because a member must always be able\n * to remove their own words. The server is the gate (`EDIT_WINDOW_CLOSED`);\n * a client uses this to stop offering Edit at the moment the server would\n * start refusing it, instead of on the next reload.\n */\nexport const EDIT_WINDOW_MS = 15 * 60 * 1000;\n\n// ─── Enums ───────────────────────────────────────────────────────────────────\n\n/**\n * What can appear in the feed. Two kinds, not seven.\n *\n * Engagement is keyed by `(contentKind, contentId)` so one engagement bar\n * serves both, and comments hang off the same pair. Adding a kind later is\n * additive; the union is deliberately narrow now so the client never has to\n * handle a kind this product does not have.\n */\nexport const CONTENT_KIND_VALUES = ['post', 'poll'] as const;\nexport const contentKindSchema = z.enum(CONTENT_KIND_VALUES);\nexport type ContentKind = z.infer<typeof contentKindSchema>;\n\n/**\n * What a reaction or a report can point at: a feed item, or a comment on one.\n *\n * Wider than `ContentKind` on purpose. A comment carries reaction counts and a\n * viewer reaction, and a comment can be abusive, so both reach it. A bookmark\n * and a comment thread cannot: they take `ContentKind`. Until 0.2.0 the\n * reaction and report RESPONSES were typed `ContentKind` while the routes\n * accepted comments, so every answer about a comment broke this contract.\n */\nexport const ENGAGEMENT_TARGET_KIND_VALUES = [...CONTENT_KIND_VALUES, 'comment'] as const;\nexport const engagementTargetKindSchema = z.enum(ENGAGEMENT_TARGET_KIND_VALUES);\nexport type EngagementTargetKind = z.infer<typeof engagementTargetKindSchema>;\n\n/**\n * Reactions. Jansathi's `support` is dropped: it exists for reacting to a\n * civic complaint or a lost-and-found notice, which this feed does not carry.\n *\n * ⚠️ These values are stored per reaction row, so removing one orphans data.\n * Append only.\n */\nexport const REACTION_TYPE_VALUES = ['like', 'celebrate', 'insightful', 'curious'] as const;\nexport const reactionTypeSchema = z.enum(REACTION_TYPE_VALUES);\nexport type ReactionType = z.infer<typeof reactionTypeSchema>;\n\n/**\n * Feed ordering.\n *\n * `new` is the default here, unlike Jansathi where `hot` leads. A hot ranking\n * needs volume to be meaningful, and a brand-new network ranking a handful of\n * posts by a blended score mostly hides the newest thing somebody just wrote.\n * Revisit when there is enough content for `hot` to mean anything.\n */\nexport const FEED_SORT_VALUES = ['new', 'top'] as const;\nexport const feedSortSchema = z.enum(FEED_SORT_VALUES);\nexport type FeedSort = z.infer<typeof feedSortSchema>;\n\n/**\n * Counts keyed by reaction type, e.g. `{ like: 4, celebrate: 1 }`. Only the\n * reactions an item actually has need appear.\n *\n * ⚠️ `partialRecord`, NOT `record`. In Zod 4 an enum-keyed `z.record` is\n * EXHAUSTIVE: it demands every key, so `{ like: 4 }` fails with three missing\n * keys and `{}` fails with four. That would force the server to ship a zero for\n * every reaction on every item, and the day a fifth reaction is added every\n * previously stored payload and every older client stops parsing.\n * `partialRecord` keeps the key validation without the exhaustiveness, so an\n * unknown key like Jansathi's `support` is still refused.\n */\nexport const reactionCountsSchema = z.partialRecord(\n reactionTypeSchema,\n z.number().int().nonnegative(),\n);\nexport type ReactionCounts = z.infer<typeof reactionCountsSchema>;\n\n// ─── Author byline ───────────────────────────────────────────────────────────\n\n/**\n * The author as a card renders them.\n *\n * Every field here is LIVE, joined against the profile at read time rather\n * than frozen onto the post at write time. So a renamed handle, a new avatar\n * or an edited headline updates on old posts, and the byline link always\n * targets the current username instead of 404ing on a handle that moved.\n *\n * Jansathi additionally snapshots `localName` (\"where the author was when\n * posting\"). Not ported: location is optional here, so a byline that depends\n * on one would be blank for anyone who never set it.\n */\nexport const feedAuthorSchema = z.object({\n userId: z.string(),\n username: usernameSchema,\n displayName: z.string(),\n /** Server-generated or from the login provider, never member-typed, so a\n * plain URL check. Same reasoning as `avatarUrl` on the profile. */\n avatarUrl: z.url().optional(),\n /** The author's one-line headline, live-joined. Gives a founders' byline\n * the context a civic byline got from an area label. */\n headline: z.string().optional(),\n});\nexport type FeedAuthor = z.infer<typeof feedAuthorSchema>;\n\n// ─── Media ───────────────────────────────────────────────────────────────────\n\n/**\n * `width` and `height` are required so a card can reserve the right box before\n * the image loads. Without them every image arrival shifts the feed under the\n * reader's thumb.\n *\n * URLs here come from our own upload pipeline, so they take a plain `z.url()`\n * rather than `httpUrlSchema`. ⚠️ If a \"paste an image link\" path is ever\n * added, these become member-supplied and must move to `httpUrlSchema`.\n */\nexport const feedImageSchema = z.object({\n kind: z.literal('image'),\n url: z.url(),\n thumbnailUrl: z.url().optional(),\n width: z.number().int().positive(),\n height: z.number().int().positive(),\n /** Author-supplied alt text. Optional, and worth asking for. */\n alt: z.string().max(MEDIA_ALT_MAX).optional(),\n});\nexport type FeedImage = z.infer<typeof feedImageSchema>;\n\nexport const feedVideoSchema = z.object({\n kind: z.literal('video'),\n url: z.url(),\n /** Poster frame, server-extracted. Required: a video with no poster is a\n * black rectangle in the feed. */\n thumbnailUrl: z.url(),\n width: z.number().int().positive(),\n height: z.number().int().positive(),\n /** Seconds. */\n duration: z.number().positive(),\n});\nexport type FeedVideo = z.infer<typeof feedVideoSchema>;\n\n/**\n * One ordered list, discriminated on `kind`, so the carousel renders\n * attachments in the order they were attached and can switch on the kind\n * without inspecting fields.\n */\nexport const feedMediaSchema = z.discriminatedUnion('kind', [feedImageSchema, feedVideoSchema]);\nexport type FeedMedia = z.infer<typeof feedMediaSchema>;\n\n// ─── Link preview ────────────────────────────────────────────────────────────\n\n/**\n * Preview for the first link in a post body. Server-derived at write time and\n * stored, never re-fetched at render: a card that fetches a third-party page\n * per scroll leaks every reader's address to that site and blocks the feed on\n * somebody else's latency.\n *\n * Both URLs take `safeUrlSchema`: the scheme and host rules, WITHOUT the\n * typed-URL cap. `url` came out of a post body, which is already capped as a\n * whole, and `imageUrl` is whatever the remote page advertised; a long CDN URL\n * is ordinary, and one over `LINK_URL_MAX` would otherwise fail the whole feed\n * page it sits on. Neither is ours, so a consumer still treats both as\n * untrusted at render.\n */\nexport const linkPreviewSchema = z.object({\n url: safeUrlSchema,\n title: z.string().max(LINK_PREVIEW_TITLE_MAX).optional(),\n description: z.string().max(LINK_PREVIEW_DESCRIPTION_MAX).optional(),\n imageUrl: safeUrlSchema.optional(),\n});\nexport type LinkPreview = z.infer<typeof linkPreviewSchema>;\n\n// ─── Viewer state ────────────────────────────────────────────────────────────\n\n/**\n * What THIS viewer has done to this item, computed per request.\n *\n * Optional as a block, because an unauthenticated or server-rendered read has\n * no viewer. ⚠️ A client must treat an absent `viewer` as \"no state known\",\n * never as \"has not reacted\": rendering an empty reaction button off a missing\n * block is how a member sees their own reaction disappear on reload.\n */\nexport const viewerStateSchema = z.object({\n reaction: reactionTypeSchema.nullable(),\n bookmarked: z.boolean(),\n isAuthor: z.boolean(),\n\n /**\n * What this viewer may DO, decided by the server and sent as plain answers.\n *\n * Not role data for the client to reason about. The moment a client derives\n * \"can I edit this\" from roles and ownership, that derivation is a second\n * implementation of the rule, it drifts from the server's, and the drift is\n * invisible until the two disagree: either a button that 403s or a button\n * that should not have been there. `isAuthor` stays because the byline reads\n * differently for your own post, not because the client should compute rights\n * from it.\n *\n * `canEdit` is false once the edit window closes, so it is not simply\n * `isAuthor`.\n */\n canEdit: z.boolean(),\n canDelete: z.boolean(),\n canReport: z.boolean(),\n});\nexport type ViewerState = z.infer<typeof viewerStateSchema>;\n\n// ─── Post ────────────────────────────────────────────────────────────────────\n\n/**\n * A post as the feed and the single-post page receive it.\n *\n * Counts are denormalised onto the row so one document serves a whole card.\n *\n * No `score` and no up/down vote. Jansathi's signed score exists to rank civic\n * content by community judgement, and a downvote arrow on a founder's first\n * post is a different product. Reactions and comments are the engagement axes\n * here. Adding a score later is additive; removing a visible downvote after\n * members have used it is not.\n */\nexport const feedPostSchema = z.object({\n id: objectIdSchema,\n contentKind: z.literal('post'),\n author: feedAuthorSchema,\n\n /**\n * The WHOLE body, never a server-side truncation.\n *\n * So there is no \"was this shortened\" flag and no second fetch to read the\n * rest: the card clamps visually and expands in place. At a 5,000 character\n * cap a page of twenty posts is small enough that trimming would cost a round\n * trip to save nothing. If that ever stops being true, a truncation flag is\n * an additive change; a client that has been guessing is not.\n */\n text: z.string().max(POST_MAX_BODY_CHARS),\n /** Ordered as the author attached them. */\n media: z.array(feedMediaSchema).max(POST_MAX_MEDIA),\n /** Present only when the body had an embeddable link. */\n linkPreview: linkPreviewSchema.optional(),\n /**\n * What this post is ABOUT, from the same vocabulary a member picks as their\n * interests. This is the whole mechanism behind a relevant feed: matching is\n * an intersection of two lists drawn from one enum, not a guess from who\n * wrote it.\n *\n * ⚠️ An EMPTY array is allowed and means the post is untagged, so interest\n * matching cannot reach it. That is a real consequence, not a nuance: an\n * untagged post is only ever found chronologically.\n */\n topics: z.array(topicSchema).max(MAX_TOPICS),\n\n commentCount: z.number().int().nonnegative(),\n reactionCounts: reactionCountsSchema,\n\n createdAt: z.iso.datetime(),\n /** Null when never edited. The edit window is the server's to enforce. */\n editedAt: z.iso.datetime().nullable(),\n\n viewer: viewerStateSchema.optional(),\n});\nexport type FeedPost = z.infer<typeof feedPostSchema>;\n\n// ─── Poll ────────────────────────────────────────────────────────────────────\n\n/**\n * One choice. `index` is the identifier a vote refers to, not the label:\n * sending indices avoids ambiguity between two options whose labels differ\n * only by case, spacing or an invisible character.\n */\nexport const pollOptionSchema = z.object({\n index: z\n .number()\n .int()\n .min(0)\n .max(POLL_MAX_OPTIONS - 1),\n label: z.string().min(1).max(POLL_OPTION_MAX_CHARS),\n voteCount: z.number().int().nonnegative(),\n});\nexport type PollOption = z.infer<typeof pollOptionSchema>;\n\n/**\n * A poll. Its own kind, not a post with extra fields, because votes are their\n * own records keyed by (poll, voter) and a post has nothing equivalent.\n *\n * Polls are not editable. Changing a question or an option after a vote has\n * been cast silently re-purposes that vote. Closing early is allowed; editing\n * is not.\n */\nexport const feedPollSchema = z.object({\n id: objectIdSchema,\n contentKind: z.literal('poll'),\n author: feedAuthorSchema,\n\n question: z.string().min(1).max(POLL_QUESTION_MAX_CHARS),\n options: z.array(pollOptionSchema).min(POLL_MIN_OPTIONS).max(POLL_MAX_OPTIONS),\n /** Unique voters, not votes: with multi-select the two differ. */\n totalVoters: z.number().int().nonnegative(),\n allowsMultipleChoices: z.boolean(),\n closesAt: z.iso.datetime(),\n /**\n * Whether the poll is closed, decided by the SERVER's clock.\n *\n * Derivable from `closesAt`, and deliberately sent anyway: a device with a\n * wrong clock would otherwise show a live poll as finished, or offer a vote\n * the server then rejects, and the member sees a control that lies. `closesAt`\n * stays for rendering \"closes in 2 days\"; this is what gates the control.\n */\n isClosed: z.boolean(),\n\n /** As on a post. A poll is feed content and is matched the same way. */\n topics: z.array(topicSchema).max(MAX_TOPICS),\n\n commentCount: z.number().int().nonnegative(),\n reactionCounts: reactionCountsSchema,\n\n createdAt: z.iso.datetime(),\n /** Always null. Kept so one byline component renders both kinds. */\n editedAt: z.iso.datetime().nullable(),\n\n viewer: viewerStateSchema\n .extend({\n /** Indices this viewer chose. Empty means not voted yet, and it is\n * always populated for the viewer: a voter can always see their own\n * answer even where others' results are hidden. */\n votedOptionIndices: z.array(z.number().int().nonnegative()),\n })\n .optional(),\n});\nexport type FeedPoll = z.infer<typeof feedPollSchema>;\n\n// ─── The feed item union ─────────────────────────────────────────────────────\n\n/**\n * Discriminated on `contentKind`, so a client narrows with a switch and the\n * compiler catches an unhandled kind the day one is added. A plain union would\n * need every field checked by hand and would silently accept a hybrid.\n */\nexport const feedItemSchema = z.discriminatedUnion('contentKind', [feedPostSchema, feedPollSchema]);\nexport type FeedItem = z.infer<typeof feedItemSchema>;\n\n// ─── Comments ────────────────────────────────────────────────────────────────\n\n/**\n * A comment, one level of nesting only: a reply to a comment is allowed, a\n * reply to a reply is not. Two levels stay readable on a phone; three do not,\n * and the server is what enforces it.\n */\nexport const feedCommentSchema = z.object({\n id: objectIdSchema,\n contentKind: contentKindSchema,\n contentId: objectIdSchema,\n /** Null for a top-level comment. A non-null value may only name a top-level\n * comment, never a reply. */\n parentCommentId: objectIdSchema.nullable(),\n author: feedAuthorSchema,\n\n text: z.string().max(COMMENT_MAX_BODY_CHARS),\n\n /** Meaningful only on a top-level comment; always 0 on a reply. */\n replyCount: z.number().int().nonnegative(),\n reactionCounts: reactionCountsSchema,\n\n createdAt: z.iso.datetime(),\n editedAt: z.iso.datetime().nullable(),\n\n /** No `bookmarked`: the post is the right thing to save, not a comment. */\n viewer: viewerStateSchema.omit({ bookmarked: true }).optional(),\n});\nexport type FeedComment = z.infer<typeof feedCommentSchema>;\n\n// ─── Queries ─────────────────────────────────────────────────────────────────\n\n/**\n * `GET /api/v1/feed`. Inherits `limit` and `cursor`, which already tolerate an\n * emptied control rather than answering 400.\n *\n * `interests=true` narrows to the viewer's topics (falling back to the plain\n * feed when they have none). `z.stringbool`, so `true`/`false`/`1`/`0` all\n * read as a person means them; until 0.2.0 the backend read this parameter\n * raw, outside the schema, and only the exact string `true` counted.\n *\n * ⚠ NO `authorId`. It was accepted here and then ignored by the server, so a\n * profile page asking for one founder's posts silently got everybody's. A\n * member's own posts are `GET /api/v1/feed/by-author/:userId`.\n */\nexport const feedQuerySchema = paginationQuerySchema.extend({\n sort: z.preprocess(emptyStringToUndefined, feedSortSchema.default('new')),\n interests: z.preprocess(emptyStringToUndefined, z.stringbool().default(false)),\n});\nexport type FeedQuery = z.infer<typeof feedQuerySchema>;\nexport type FeedQueryInput = z.input<typeof feedQuerySchema>;\n\n/** `GET /api/v1/feed/:contentKind/:contentId/comments`. */\nexport const commentsQuerySchema = paginationQuerySchema.extend({\n /** Omitted lists top-level comments; set, it lists that comment's replies. */\n parentCommentId: z.preprocess(emptyStringToUndefined, objectIdSchema.optional()),\n});\nexport type CommentsQuery = z.infer<typeof commentsQuerySchema>;\nexport type CommentsQueryInput = z.input<typeof commentsQuerySchema>;\n\n// ─── Route parameters ────────────────────────────────────────────────────────\n\n/**\n * Every id and kind in a feed URL, as a schema, so a bad one answers exactly\n * as a bad body field does: 400 `VALIDATION_ERROR`, the issue at\n * `location: 'params'`. Until 0.2.0 these were hand checks that answered\n * \"Invalid id.\" with no issues at all, and the comment routes never looked at\n * `:contentKind`.\n */\n\n/** `GET /feed/:id`, the permalink. */\nexport const feedItemParamsSchema = z.object({ id: objectIdSchema });\n\n/** `PATCH|DELETE /feed/:contentId`. */\nexport const contentParamsSchema = z.object({ contentId: objectIdSchema });\n\n/** A bookmark and a comment thread: a post or a poll. */\nexport const contentTargetParamsSchema = z.object({\n contentKind: contentKindSchema,\n contentId: objectIdSchema,\n});\n\n/** A reaction and a report: a post, a poll or a comment. */\nexport const engagementTargetParamsSchema = z.object({\n contentKind: engagementTargetKindSchema,\n contentId: objectIdSchema,\n});\n\n/** `POST|DELETE /feed/poll/:pollId/vote`. */\nexport const pollParamsSchema = z.object({ pollId: objectIdSchema });\n\n/** `DELETE /feed/comments/:commentId`. */\nexport const commentParamsSchema = z.object({ commentId: objectIdSchema });\n\n/** `GET /feed/by-author/:userId`. */\nexport const authorParamsSchema = z.object({ userId: objectIdSchema });\n\nexport type FeedItemParams = z.infer<typeof feedItemParamsSchema>;\nexport type ContentParams = z.infer<typeof contentParamsSchema>;\nexport type ContentTargetParams = z.infer<typeof contentTargetParamsSchema>;\nexport type EngagementTargetParams = z.infer<typeof engagementTargetParamsSchema>;\nexport type PollParams = z.infer<typeof pollParamsSchema>;\nexport type CommentParams = z.infer<typeof commentParamsSchema>;\nexport type AuthorParams = z.infer<typeof authorParamsSchema>;\n\n// ─── Pages ───────────────────────────────────────────────────────────────────\n\n/**\n * A page of the feed, and of one member's posts (`by-author`), which is the\n * same shape. `nextCursor` is null on the last page.\n */\nexport const feedPageSchema = paginatedSchema(feedItemSchema);\nexport type FeedPage = z.infer<typeof feedPageSchema>;\n\n/** A page of a thread: top-level comments, or one comment's replies. */\nexport const commentPageSchema = paginatedSchema(feedCommentSchema);\nexport type CommentPage = z.infer<typeof commentPageSchema>;\n\n// ─── Write bodies ────────────────────────────────────────────────────────────\n\n/**\n * ⚠️ Every write body below is its own object with NO defaults, and none of\n * them is built with `.pick().partial()`. `.partial()` does not switch off\n * `.default()`, so a patch body built that way rewrites defaulted fields on\n * every request. See `updateFounderProfileBodySchema` for the incident.\n */\n\n/**\n * An attachment on the way IN: a reference to something already uploaded, and\n * deliberately not a URL.\n *\n * Upload happens first, straight to storage, and the composer sends back the\n * key it was given (`uploadKeySchema`, in `uploads`). The server resolves that\n * key to the URL, dimensions and poster frame it reads from the object itself,\n * and those become the read shape.\n *\n * ⚠ The first draft of this took the full read shape, URL included. That is\n * the same hole that was closed on the profile: a URL in a write body is a\n * member-supplied URL, so a post could have carried `javascript:` in an image\n * source, and nothing downstream re-checks a value the server itself stored.\n * Taking a key instead removes the question rather than validating it, and it\n * also stops a member pointing a post at somebody else's file.\n *\n * `width`, `height` and `duration` are NOT accepted here either. They are\n * properties of the uploaded object, so the server reads them from the object;\n * taking them from the client would let a caller claim a 1x1 image and collapse\n * the card.\n */\nexport const attachedMediaSchema = z.object({\n uploadKey: uploadKeySchema,\n /** Author-supplied alt text, the one media field a member does write. */\n alt: z.string().trim().max(MEDIA_ALT_MAX).optional(),\n});\nexport type AttachedMedia = z.infer<typeof attachedMediaSchema>;\n\n/**\n * A post must carry something. Text alone, media alone, or both; empty is\n * refused here rather than reaching the feed as a blank card.\n */\nexport const createPostBodySchema = z\n .object({\n text: z.string().trim().max(POST_MAX_BODY_CHARS).optional(),\n /** Already uploaded. See `attachedMediaSchema`. Order is preserved. */\n media: z.array(attachedMediaSchema).max(POST_MAX_MEDIA).optional(),\n /** Absent means untagged, which means interest matching cannot find it. */\n topics: z.array(topicSchema).max(MAX_TOPICS).optional(),\n })\n .refine((b) => Boolean(b.text?.length) || Boolean(b.media?.length), {\n error: VALIDATION_MESSAGE.postEmpty,\n path: ['text'],\n });\nexport type CreatePostBody = z.infer<typeof createPostBodySchema>;\n\n/** Only the text is editable. Changing media after the fact makes every\n * earlier reply look like a reply to something else. */\nexport const updatePostBodySchema = z.object({\n text: z.string().trim().min(1).max(POST_MAX_BODY_CHARS),\n});\nexport type UpdatePostBody = z.infer<typeof updatePostBodySchema>;\n\nexport const createPollBodySchema = z\n .object({\n question: z.string().trim().min(1).max(POLL_QUESTION_MAX_CHARS),\n options: z\n .array(z.object({ label: z.string().trim().min(1).max(POLL_OPTION_MAX_CHARS) }))\n .min(POLL_MIN_OPTIONS)\n .max(POLL_MAX_OPTIONS),\n /**\n * Duration from now, NOT an absolute closing time. A client whose clock is\n * wrong would otherwise open a poll that is already closed, and the member\n * would have no way to tell why.\n */\n durationMs: z.number().int().min(POLL_MIN_DURATION_MS).max(POLL_MAX_DURATION_MS),\n allowsMultipleChoices: z.boolean(),\n topics: z.array(topicSchema).max(MAX_TOPICS).optional(),\n })\n .refine(\n (b) => {\n const seen = new Set<string>();\n for (const o of b.options) {\n const key = o.label.trim().toLowerCase();\n if (seen.has(key)) return false;\n seen.add(key);\n }\n return true;\n },\n { error: VALIDATION_MESSAGE.pollOptionsDuplicate, path: ['options'] },\n );\nexport type CreatePollBody = z.infer<typeof createPollBodySchema>;\n\n/** Cast or change a vote. The server upserts on (poll, voter), so voting\n * twice replaces rather than doubles. */\nexport const castVoteBodySchema = z.object({\n optionIndices: z\n .array(\n z\n .number()\n .int()\n .min(0)\n .max(POLL_MAX_OPTIONS - 1),\n )\n .min(1)\n .max(POLL_MAX_OPTIONS),\n});\nexport type CastVoteBody = z.infer<typeof castVoteBodySchema>;\n\nexport const createCommentBodySchema = z.object({\n text: z.string().trim().min(1).max(COMMENT_MAX_BODY_CHARS),\n /** Null for a top-level comment. */\n parentCommentId: objectIdSchema.nullable(),\n});\nexport type CreateCommentBody = z.infer<typeof createCommentBodySchema>;\n\nexport const updateCommentBodySchema = z.object({\n text: z.string().trim().min(1).max(COMMENT_MAX_BODY_CHARS),\n});\nexport type UpdateCommentBody = z.infer<typeof updateCommentBodySchema>;\n\n/** Set or clear a reaction. `null` clears it; at most one per viewer per item. */\nexport const setReactionBodySchema = z.object({\n reaction: reactionTypeSchema.nullable(),\n});\nexport type SetReactionBody = z.infer<typeof setReactionBodySchema>;\n\n// ─── Engagement responses ────────────────────────────────────────────────────\n\n/**\n * Returned by the reaction endpoint so the card can render the authoritative\n * result without a follow-up read. Without the fresh counts a client has to\n * guess the new total, and two quick taps leave it showing a number the server\n * never had.\n */\nexport const setReactionResponseSchema = z.object({\n contentKind: engagementTargetKindSchema,\n contentId: objectIdSchema,\n reaction: reactionTypeSchema.nullable(),\n reactionCounts: reactionCountsSchema,\n});\nexport type SetReactionResponse = z.infer<typeof setReactionResponseSchema>;\n\n// ─── Reporting ───────────────────────────────────────────────────────────────\n\n/**\n * Why a member reported something.\n *\n * ⚠️ Stored on every report row, so this is data, not a label: removing a value\n * orphans reports already filed under it, and the counts nobody can recover are\n * exactly the ones a moderation review needs. Append only.\n *\n * ⚠️ A REASON THAT IS MISSING DOES NOT DISAPPEAR, it lands in `other`. Whatever\n * is not named here becomes an undifferentiated pile that no aggregate can see\n * a pattern in, which is the one thing report categories exist for. Worth being\n * deliberate about the absences rather than discovering them later.\n */\nexport const REPORT_REASON_VALUES = [\n 'spam',\n 'harassment',\n 'misinformation',\n 'off_topic',\n 'impersonation',\n 'other',\n] as const;\nexport const reportReasonSchema = z.enum(REPORT_REASON_VALUES);\nexport type ReportReason = z.infer<typeof reportReasonSchema>;\n\n/**\n * What a member sends to report a post, poll or comment.\n *\n * The target is the URL's, not the body's: a report is filed against a specific\n * thing at a specific address, and taking the target from the body would let a\n * caller report one item while the route thinks it is another.\n *\n * `note` is free text and optional, which is the pressure valve for everything\n * the enum does not name. ⚠️ It is written by a member, so it is untrusted at\n * render: a moderation queue displays it, and a moderation queue is a screen\n * staff read quickly.\n */\nexport const createReportBodySchema = z.object({\n reason: reportReasonSchema,\n note: z.string().trim().max(REPORT_NOTE_MAX).optional(),\n});\nexport type CreateReportBody = z.infer<typeof createReportBodySchema>;\n\n/**\n * The answer to filing one.\n *\n * `alreadyReported` distinguishes \"we have taken this\" from \"you already told\n * us\", because one report per member per target means a second press is a\n * no-op, and a silent no-op reads as a failure to somebody who pressed twice\n * deliberately. It is NOT a count: how many OTHER people reported an item is\n * moderation's business and telling a reporter would turn the count into a\n * score anyone could farm.\n */\nexport const createReportResponseSchema = z.object({\n contentKind: engagementTargetKindSchema,\n contentId: objectIdSchema,\n alreadyReported: z.boolean(),\n});\nexport type CreateReportResponse = z.infer<typeof createReportResponseSchema>;\n\n/** The bookmark endpoint is a toggle and returns the state it settled on. */\nexport const toggleBookmarkResponseSchema = z.object({\n contentKind: contentKindSchema,\n contentId: objectIdSchema,\n bookmarked: z.boolean(),\n});\nexport type ToggleBookmarkResponse = z.infer<typeof toggleBookmarkResponseSchema>;\n\n/** A vote returns the whole poll: counts, totals and the viewer's own choices\n * all move together, and reassembling them client-side drifts. */\nexport const castVoteResponseSchema = z.object({\n poll: feedPollSchema,\n});\nexport type CastVoteResponse = z.infer<typeof castVoteResponseSchema>;\n"]}
@@ -0,0 +1,175 @@
1
+ /**
2
+ * founder-schema: the staff member directory
3
+ *
4
+ * GET /api/v1/members ?q&status&role&limit&cursor
5
+ * GET /api/v1/members/:memberId one member, as staff see them
6
+ * POST /api/v1/members/:memberId/suspension { reason } suspend
7
+ * DELETE /api/v1/members/:memberId/suspension lift it
8
+ *
9
+ * Every staff role has a Members tab: a moderator looks up who wrote
10
+ * something, a support agent finds the person who wrote in, a manager decides
11
+ * on a suspension. What each sees is the server's call, per field: a
12
+ * moderator gets no email (`email: null`), because finding a member's
13
+ * address is support's job, not moderation's.
14
+ *
15
+ * A SUSPENDED member cannot use the product at all, on any device, from the
16
+ * next request on (every call answers `ACCOUNT_SUSPENDED`); their posts stay
17
+ * up unless moderated separately, and a staff role they were acting in is
18
+ * switched off. Lifting it restores everything else.
19
+ *
20
+ * SEARCH (`q`) finds people by the start of their name or handle among listed
21
+ * founders, or by their exact email among everyone (only for a role that may
22
+ * see emails: a moderator's email search finds nothing). It returns up to
23
+ * `limit` matches in one page (type more to narrow), not a pageable list. Who may suspend whom is the access policy's: never
24
+ * yourself, never a superadmin, and a manager never a fellow manager.
25
+ *
26
+ * Each detail carries a `viewer` block of what the asking staff member may do
27
+ * to THIS member, worked out by the server, so the screen shows only the
28
+ * buttons that will work.
29
+ *
30
+ * @module founder-schema/domains/members
31
+ */
32
+ import { z } from 'zod';
33
+ /** What staff can see an account's state as. A deleted account is not listed. */
34
+ export declare const MEMBER_STATUS_VALUES: readonly ["active", "suspended"];
35
+ export declare const memberStatusSchema: z.ZodEnum<{
36
+ suspended: "suspended";
37
+ active: "active";
38
+ }>;
39
+ export type MemberStatus = z.infer<typeof memberStatusSchema>;
40
+ /** `:memberId` in the paths above. */
41
+ export declare const memberParamsSchema: z.ZodObject<{
42
+ memberId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
43
+ }, z.core.$strip>;
44
+ export type MemberParams = z.infer<typeof memberParamsSchema>;
45
+ /**
46
+ * The directory's query. `q` is a name or handle prefix, or a whole email
47
+ * address (anything with an `@` is matched as an email, exactly). An emptied
48
+ * box is "no search", not an error.
49
+ */
50
+ export declare const memberDirectoryQuerySchema: z.ZodObject<{
51
+ limit: z.ZodPreprocess<z.ZodDefault<z.ZodCoercedNumber<unknown>>, unknown>;
52
+ cursor: z.ZodOptional<z.ZodString>;
53
+ q: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
54
+ status: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
55
+ suspended: "suspended";
56
+ active: "active";
57
+ }>>, unknown>;
58
+ role: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
59
+ superadmin: "superadmin";
60
+ manager: "manager";
61
+ moderator: "moderator";
62
+ support_agent: "support_agent";
63
+ }>>, unknown>;
64
+ }, z.core.$strip>;
65
+ export type MemberDirectoryQuery = z.infer<typeof memberDirectoryQuerySchema>;
66
+ export type MemberDirectoryQueryInput = z.input<typeof memberDirectoryQuerySchema>;
67
+ /** One row of the directory. */
68
+ export declare const memberSummarySchema: z.ZodObject<{
69
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
70
+ displayName: z.ZodString;
71
+ username: z.ZodNullable<z.ZodString>;
72
+ avatarUrl: z.ZodNullable<z.ZodURL>;
73
+ email: z.ZodNullable<z.ZodString>;
74
+ status: z.ZodEnum<{
75
+ suspended: "suspended";
76
+ active: "active";
77
+ }>;
78
+ roles: z.ZodArray<z.ZodEnum<{
79
+ superadmin: "superadmin";
80
+ manager: "manager";
81
+ moderator: "moderator";
82
+ support_agent: "support_agent";
83
+ }>>;
84
+ joinedAt: z.ZodISODateTime;
85
+ lastActiveAt: z.ZodNullable<z.ZodISODateTime>;
86
+ }, z.core.$strip>;
87
+ export type MemberSummary = z.infer<typeof memberSummarySchema>;
88
+ export declare const memberDirectoryPageSchema: z.ZodObject<{
89
+ items: z.ZodArray<z.ZodObject<{
90
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
91
+ displayName: z.ZodString;
92
+ username: z.ZodNullable<z.ZodString>;
93
+ avatarUrl: z.ZodNullable<z.ZodURL>;
94
+ email: z.ZodNullable<z.ZodString>;
95
+ status: z.ZodEnum<{
96
+ suspended: "suspended";
97
+ active: "active";
98
+ }>;
99
+ roles: z.ZodArray<z.ZodEnum<{
100
+ superadmin: "superadmin";
101
+ manager: "manager";
102
+ moderator: "moderator";
103
+ support_agent: "support_agent";
104
+ }>>;
105
+ joinedAt: z.ZodISODateTime;
106
+ lastActiveAt: z.ZodNullable<z.ZodISODateTime>;
107
+ }, z.core.$strip>>;
108
+ nextCursor: z.ZodNullable<z.ZodString>;
109
+ }, z.core.$strip>;
110
+ export type MemberDirectoryPage = z.infer<typeof memberDirectoryPageSchema>;
111
+ /** A suspension in force. */
112
+ export declare const suspensionSchema: z.ZodObject<{
113
+ since: z.ZodISODateTime;
114
+ reason: z.ZodString;
115
+ by: z.ZodNullable<z.ZodObject<{
116
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
117
+ displayName: z.ZodString;
118
+ }, z.core.$strip>>;
119
+ }, z.core.$strip>;
120
+ export type Suspension = z.infer<typeof suspensionSchema>;
121
+ /** One member, as staff see them. */
122
+ export declare const memberDetailSchema: z.ZodObject<{
123
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
124
+ displayName: z.ZodString;
125
+ username: z.ZodNullable<z.ZodString>;
126
+ avatarUrl: z.ZodNullable<z.ZodURL>;
127
+ email: z.ZodNullable<z.ZodString>;
128
+ status: z.ZodEnum<{
129
+ suspended: "suspended";
130
+ active: "active";
131
+ }>;
132
+ roles: z.ZodArray<z.ZodEnum<{
133
+ superadmin: "superadmin";
134
+ manager: "manager";
135
+ moderator: "moderator";
136
+ support_agent: "support_agent";
137
+ }>>;
138
+ joinedAt: z.ZodISODateTime;
139
+ lastActiveAt: z.ZodNullable<z.ZodISODateTime>;
140
+ headline: z.ZodNullable<z.ZodString>;
141
+ city: z.ZodNullable<z.ZodString>;
142
+ counts: z.ZodObject<{
143
+ posts: z.ZodNumber;
144
+ polls: z.ZodNumber;
145
+ comments: z.ZodNumber;
146
+ reportsAgainst: z.ZodNumber;
147
+ tickets: z.ZodNumber;
148
+ }, z.core.$strip>;
149
+ suspension: z.ZodNullable<z.ZodObject<{
150
+ since: z.ZodISODateTime;
151
+ reason: z.ZodString;
152
+ by: z.ZodNullable<z.ZodObject<{
153
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
154
+ displayName: z.ZodString;
155
+ }, z.core.$strip>>;
156
+ }, z.core.$strip>>;
157
+ viewer: z.ZodObject<{
158
+ canSuspend: z.ZodBoolean;
159
+ grantableRoles: z.ZodArray<z.ZodEnum<{
160
+ superadmin: "superadmin";
161
+ manager: "manager";
162
+ moderator: "moderator";
163
+ support_agent: "support_agent";
164
+ }>>;
165
+ canResetMpin: z.ZodBoolean;
166
+ }, z.core.$strip>;
167
+ mpinSet: z.ZodBoolean;
168
+ }, z.core.$strip>;
169
+ export type MemberDetail = z.infer<typeof memberDetailSchema>;
170
+ /** `POST /members/:memberId/suspension`. The reason is on record in the audit log. */
171
+ export declare const suspendMemberBodySchema: z.ZodObject<{
172
+ reason: z.ZodString;
173
+ }, z.core.$strip>;
174
+ export type SuspendMemberBody = z.infer<typeof suspendMemberBodySchema>;
175
+ //# sourceMappingURL=members.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"members.d.ts","sourceRoot":"","sources":["../../../src/domains/members/members.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,kCAAmC,CAAC;AACrE,eAAO,MAAM,kBAAkB;;;EAA+B,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,sCAAsC;AACtC,eAAO,MAAM,kBAAkB;;iBAAyC,CAAC;AACzE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;iBAKrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEnF,gCAAgC;AAChC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;iBAa9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;iBAAuC,CAAC;AAC9E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,6BAA6B;AAC7B,eAAO,MAAM,gBAAgB;;;;;;;iBAK3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,qCAAqC;AACrC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwB7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,sFAAsF;AACtF,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * founder-schema: the staff member directory
3
+ *
4
+ * GET /api/v1/members ?q&status&role&limit&cursor
5
+ * GET /api/v1/members/:memberId one member, as staff see them
6
+ * POST /api/v1/members/:memberId/suspension { reason } suspend
7
+ * DELETE /api/v1/members/:memberId/suspension lift it
8
+ *
9
+ * Every staff role has a Members tab: a moderator looks up who wrote
10
+ * something, a support agent finds the person who wrote in, a manager decides
11
+ * on a suspension. What each sees is the server's call, per field: a
12
+ * moderator gets no email (`email: null`), because finding a member's
13
+ * address is support's job, not moderation's.
14
+ *
15
+ * A SUSPENDED member cannot use the product at all, on any device, from the
16
+ * next request on (every call answers `ACCOUNT_SUSPENDED`); their posts stay
17
+ * up unless moderated separately, and a staff role they were acting in is
18
+ * switched off. Lifting it restores everything else.
19
+ *
20
+ * SEARCH (`q`) finds people by the start of their name or handle among listed
21
+ * founders, or by their exact email among everyone (only for a role that may
22
+ * see emails: a moderator's email search finds nothing). It returns up to
23
+ * `limit` matches in one page (type more to narrow), not a pageable list. Who may suspend whom is the access policy's: never
24
+ * yourself, never a superadmin, and a manager never a fellow manager.
25
+ *
26
+ * Each detail carries a `viewer` block of what the asking staff member may do
27
+ * to THIS member, worked out by the server, so the screen shows only the
28
+ * buttons that will work.
29
+ *
30
+ * @module founder-schema/domains/members
31
+ */
32
+ import { z } from 'zod';
33
+ import { platformRoleSchema } from '../../access/roles.js';
34
+ import { emptyStringToUndefined, objectIdSchema, optionalTrimmedString, paginationQuerySchema, usernameSchema, } from '../../core/common.js';
35
+ import { MEMBER_SEARCH_MAX, SUSPENSION_REASON_MAX, SUSPENSION_REASON_MIN, } from '../../core/limits.js';
36
+ import { paginatedSchema } from '../../core/responses.js';
37
+ /** What staff can see an account's state as. A deleted account is not listed. */
38
+ export const MEMBER_STATUS_VALUES = ['active', 'suspended'];
39
+ export const memberStatusSchema = z.enum(MEMBER_STATUS_VALUES);
40
+ /** `:memberId` in the paths above. */
41
+ export const memberParamsSchema = z.object({ memberId: objectIdSchema });
42
+ /**
43
+ * The directory's query. `q` is a name or handle prefix, or a whole email
44
+ * address (anything with an `@` is matched as an email, exactly). An emptied
45
+ * box is "no search", not an error.
46
+ */
47
+ export const memberDirectoryQuerySchema = paginationQuerySchema.extend({
48
+ q: optionalTrimmedString(MEMBER_SEARCH_MAX),
49
+ status: z.preprocess(emptyStringToUndefined, memberStatusSchema.optional()),
50
+ /** Only people holding this staff role. */
51
+ role: z.preprocess(emptyStringToUndefined, platformRoleSchema.optional()),
52
+ });
53
+ /** One row of the directory. */
54
+ export const memberSummarySchema = z.object({
55
+ id: objectIdSchema,
56
+ displayName: z.string(),
57
+ /** Null when they have no founder profile (never finished onboarding). */
58
+ username: usernameSchema.nullable(),
59
+ avatarUrl: z.url().nullable(),
60
+ /** Null when the asking role may not see it. */
61
+ email: z.string().nullable(),
62
+ status: memberStatusSchema,
63
+ /** Staff roles held, highest first. Empty for an ordinary member. */
64
+ roles: z.array(platformRoleSchema),
65
+ joinedAt: z.iso.datetime(),
66
+ lastActiveAt: z.iso.datetime().nullable(),
67
+ });
68
+ export const memberDirectoryPageSchema = paginatedSchema(memberSummarySchema);
69
+ /** A suspension in force. */
70
+ export const suspensionSchema = z.object({
71
+ since: z.iso.datetime(),
72
+ reason: z.string(),
73
+ /** Who suspended them, by name at the time. */
74
+ by: z.object({ id: objectIdSchema, displayName: z.string() }).nullable(),
75
+ });
76
+ /** One member, as staff see them. */
77
+ export const memberDetailSchema = memberSummarySchema.extend({
78
+ headline: z.string().nullable(),
79
+ /** Their city, as declared on their profile. */
80
+ city: z.string().nullable(),
81
+ counts: z.object({
82
+ posts: z.number().int().min(0),
83
+ polls: z.number().int().min(0),
84
+ comments: z.number().int().min(0),
85
+ /** Reports filed about their posts, polls and comments that are still up. */
86
+ reportsAgainst: z.number().int().min(0),
87
+ /** Tickets they have raised. */
88
+ tickets: z.number().int().min(0),
89
+ }),
90
+ suspension: suspensionSchema.nullable(),
91
+ /** What the asking staff member may do to this member. */
92
+ viewer: z.object({
93
+ canSuspend: z.boolean(),
94
+ /** Roles the asker may grant or revoke on this member (never their own). */
95
+ grantableRoles: z.array(platformRoleSchema),
96
+ /** May clear this member's forgotten MPIN (superadmin, someone else). */
97
+ canResetMpin: z.boolean(),
98
+ }),
99
+ /** Whether they have set an MPIN. Only meaningful for staff. */
100
+ mpinSet: z.boolean(),
101
+ });
102
+ /** `POST /members/:memberId/suspension`. The reason is on record in the audit log. */
103
+ export const suspendMemberBodySchema = z.object({
104
+ reason: z.string().trim().min(SUSPENSION_REASON_MIN).max(SUSPENSION_REASON_MAX),
105
+ });
106
+ //# sourceMappingURL=members.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"members.js","sourceRoot":"","sources":["../../../src/domains/members/members.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,iFAAiF;AACjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAU,CAAC;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAG/D,sCAAsC;AACtC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC,CAAC;AAGzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,qBAAqB,CAAC,MAAM,CAAC;IACrE,CAAC,EAAE,qBAAqB,CAAC,iBAAiB,CAAC;IAC3C,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,QAAQ,EAAE,CAAC;IAC3E,2CAA2C;IAC3C,IAAI,EAAE,CAAC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: the staff member directory\n *\n * GET /api/v1/members ?q&status&role&limit&cursor\n * GET /api/v1/members/:memberId one member, as staff see them\n * POST /api/v1/members/:memberId/suspension { reason } suspend\n * DELETE /api/v1/members/:memberId/suspension lift it\n *\n * Every staff role has a Members tab: a moderator looks up who wrote\n * something, a support agent finds the person who wrote in, a manager decides\n * on a suspension. What each sees is the server's call, per field: a\n * moderator gets no email (`email: null`), because finding a member's\n * address is support's job, not moderation's.\n *\n * A SUSPENDED member cannot use the product at all, on any device, from the\n * next request on (every call answers `ACCOUNT_SUSPENDED`); their posts stay\n * up unless moderated separately, and a staff role they were acting in is\n * switched off. Lifting it restores everything else.\n *\n * SEARCH (`q`) finds people by the start of their name or handle among listed\n * founders, or by their exact email among everyone (only for a role that may\n * see emails: a moderator's email search finds nothing). It returns up to\n * `limit` matches in one page (type more to narrow), not a pageable list. Who may suspend whom is the access policy's: never\n * yourself, never a superadmin, and a manager never a fellow manager.\n *\n * Each detail carries a `viewer` block of what the asking staff member may do\n * to THIS member, worked out by the server, so the screen shows only the\n * buttons that will work.\n *\n * @module founder-schema/domains/members\n */\n\nimport { z } from 'zod';\nimport { platformRoleSchema } from '../../access/roles.js';\nimport {\n emptyStringToUndefined,\n objectIdSchema,\n optionalTrimmedString,\n paginationQuerySchema,\n usernameSchema,\n} from '../../core/common.js';\nimport {\n MEMBER_SEARCH_MAX,\n SUSPENSION_REASON_MAX,\n SUSPENSION_REASON_MIN,\n} from '../../core/limits.js';\nimport { paginatedSchema } from '../../core/responses.js';\n\n/** What staff can see an account's state as. A deleted account is not listed. */\nexport const MEMBER_STATUS_VALUES = ['active', 'suspended'] as const;\nexport const memberStatusSchema = z.enum(MEMBER_STATUS_VALUES);\nexport type MemberStatus = z.infer<typeof memberStatusSchema>;\n\n/** `:memberId` in the paths above. */\nexport const memberParamsSchema = z.object({ memberId: objectIdSchema });\nexport type MemberParams = z.infer<typeof memberParamsSchema>;\n\n/**\n * The directory's query. `q` is a name or handle prefix, or a whole email\n * address (anything with an `@` is matched as an email, exactly). An emptied\n * box is \"no search\", not an error.\n */\nexport const memberDirectoryQuerySchema = paginationQuerySchema.extend({\n q: optionalTrimmedString(MEMBER_SEARCH_MAX),\n status: z.preprocess(emptyStringToUndefined, memberStatusSchema.optional()),\n /** Only people holding this staff role. */\n role: z.preprocess(emptyStringToUndefined, platformRoleSchema.optional()),\n});\nexport type MemberDirectoryQuery = z.infer<typeof memberDirectoryQuerySchema>;\nexport type MemberDirectoryQueryInput = z.input<typeof memberDirectoryQuerySchema>;\n\n/** One row of the directory. */\nexport const memberSummarySchema = z.object({\n id: objectIdSchema,\n displayName: z.string(),\n /** Null when they have no founder profile (never finished onboarding). */\n username: usernameSchema.nullable(),\n avatarUrl: z.url().nullable(),\n /** Null when the asking role may not see it. */\n email: z.string().nullable(),\n status: memberStatusSchema,\n /** Staff roles held, highest first. Empty for an ordinary member. */\n roles: z.array(platformRoleSchema),\n joinedAt: z.iso.datetime(),\n lastActiveAt: z.iso.datetime().nullable(),\n});\nexport type MemberSummary = z.infer<typeof memberSummarySchema>;\n\nexport const memberDirectoryPageSchema = paginatedSchema(memberSummarySchema);\nexport type MemberDirectoryPage = z.infer<typeof memberDirectoryPageSchema>;\n\n/** A suspension in force. */\nexport const suspensionSchema = z.object({\n since: z.iso.datetime(),\n reason: z.string(),\n /** Who suspended them, by name at the time. */\n by: z.object({ id: objectIdSchema, displayName: z.string() }).nullable(),\n});\nexport type Suspension = z.infer<typeof suspensionSchema>;\n\n/** One member, as staff see them. */\nexport const memberDetailSchema = memberSummarySchema.extend({\n headline: z.string().nullable(),\n /** Their city, as declared on their profile. */\n city: z.string().nullable(),\n counts: z.object({\n posts: z.number().int().min(0),\n polls: z.number().int().min(0),\n comments: z.number().int().min(0),\n /** Reports filed about their posts, polls and comments that are still up. */\n reportsAgainst: z.number().int().min(0),\n /** Tickets they have raised. */\n tickets: z.number().int().min(0),\n }),\n suspension: suspensionSchema.nullable(),\n /** What the asking staff member may do to this member. */\n viewer: z.object({\n canSuspend: z.boolean(),\n /** Roles the asker may grant or revoke on this member (never their own). */\n grantableRoles: z.array(platformRoleSchema),\n /** May clear this member's forgotten MPIN (superadmin, someone else). */\n canResetMpin: z.boolean(),\n }),\n /** Whether they have set an MPIN. Only meaningful for staff. */\n mpinSet: z.boolean(),\n});\nexport type MemberDetail = z.infer<typeof memberDetailSchema>;\n\n/** `POST /members/:memberId/suspension`. The reason is on record in the audit log. */\nexport const suspendMemberBodySchema = z.object({\n reason: z.string().trim().min(SUSPENSION_REASON_MIN).max(SUSPENSION_REASON_MAX),\n});\nexport type SuspendMemberBody = z.infer<typeof suspendMemberBodySchema>;\n"]}
@@ -0,0 +1,184 @@
1
+ /**
2
+ * founder-schema: moderation
3
+ *
4
+ * GET /api/v1/moderation/queue ?limit&cursor
5
+ * what members reported and nobody has decided on, oldest report first
6
+ * GET /api/v1/moderation/content ?state&limit&cursor
7
+ * by state, newest first: visible is posts and polls by when posted;
8
+ * hidden and removed also hold comments (so a hidden comment can be
9
+ * found and put back), by when hidden or removed
10
+ * A decision that changes nothing (hiding what is already hidden, removing
11
+ * what its author deleted) leaves the reports open and writes nothing: for
12
+ * those, dismiss.
13
+ * POST /api/v1/moderation/:contentKind/:contentId/decision { action, note? }
14
+ * decide on one post, poll or comment; answers the item as it now is
15
+ *
16
+ * ONE ITEM PER THING, NOT PER REPORT. Five members reporting one post is one
17
+ * row with five reports, so a moderator decides once. The queue's order is
18
+ * the oldest open report first: whoever has waited longest is seen first, and
19
+ * a pile-on cannot jump the line.
20
+ *
21
+ * THE DECISIONS
22
+ * dismiss it stays up; its open reports close as dismissed
23
+ * hide out of every feed and thread, kept, restorable; reports actioned
24
+ * restore a hidden item goes back up
25
+ * remove deleted as its author deleting it would (counts move), not
26
+ * restorable from here; reports actioned
27
+ * Every decision on someone else's content is written to the audit log, with
28
+ * the note when there is one.
29
+ *
30
+ * A report's `note` was written by a member: untrusted text, shown as text.
31
+ *
32
+ * @module founder-schema/domains/moderation
33
+ */
34
+ import { z } from 'zod';
35
+ /** Where a post, poll or comment stands. */
36
+ export declare const MODERATION_STATE_VALUES: readonly ["visible", "hidden", "removed"];
37
+ export declare const moderationStateSchema: z.ZodEnum<{
38
+ visible: "visible";
39
+ hidden: "hidden";
40
+ removed: "removed";
41
+ }>;
42
+ export type ModerationState = z.infer<typeof moderationStateSchema>;
43
+ export declare const MODERATION_ACTION_VALUES: readonly ["dismiss", "hide", "restore", "remove"];
44
+ export declare const moderationActionSchema: z.ZodEnum<{
45
+ dismiss: "dismiss";
46
+ hide: "hide";
47
+ restore: "restore";
48
+ remove: "remove";
49
+ }>;
50
+ export type ModerationAction = z.infer<typeof moderationActionSchema>;
51
+ /** One post, poll or comment as moderation sees it. */
52
+ export declare const moderationItemSchema: z.ZodObject<{
53
+ target: z.ZodObject<{
54
+ kind: z.ZodEnum<{
55
+ post: "post";
56
+ poll: "poll";
57
+ comment: "comment";
58
+ }>;
59
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
60
+ }, z.core.$strip>;
61
+ content: z.ZodObject<{
62
+ kind: z.ZodEnum<{
63
+ post: "post";
64
+ poll: "poll";
65
+ }>;
66
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
67
+ }, z.core.$strip>;
68
+ excerpt: z.ZodString;
69
+ author: z.ZodObject<{
70
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
71
+ displayName: z.ZodString;
72
+ avatarUrl: z.ZodNullable<z.ZodURL>;
73
+ }, z.core.$strip>;
74
+ createdAt: z.ZodISODateTime;
75
+ state: z.ZodEnum<{
76
+ visible: "visible";
77
+ hidden: "hidden";
78
+ removed: "removed";
79
+ }>;
80
+ reports: z.ZodObject<{
81
+ open: z.ZodNumber;
82
+ total: z.ZodNumber;
83
+ reasons: z.ZodArray<z.ZodObject<{
84
+ reason: z.ZodEnum<{
85
+ other: "other";
86
+ spam: "spam";
87
+ harassment: "harassment";
88
+ misinformation: "misinformation";
89
+ off_topic: "off_topic";
90
+ impersonation: "impersonation";
91
+ }>;
92
+ count: z.ZodNumber;
93
+ }, z.core.$strip>>;
94
+ notes: z.ZodArray<z.ZodString>;
95
+ oldestOpenAt: z.ZodNullable<z.ZodISODateTime>;
96
+ }, z.core.$strip>;
97
+ viewer: z.ZodObject<{
98
+ canDismiss: z.ZodBoolean;
99
+ canHide: z.ZodBoolean;
100
+ canRestore: z.ZodBoolean;
101
+ canRemove: z.ZodBoolean;
102
+ }, z.core.$strip>;
103
+ }, z.core.$strip>;
104
+ export type ModerationItem = z.infer<typeof moderationItemSchema>;
105
+ export declare const moderationPageSchema: z.ZodObject<{
106
+ items: z.ZodArray<z.ZodObject<{
107
+ target: z.ZodObject<{
108
+ kind: z.ZodEnum<{
109
+ post: "post";
110
+ poll: "poll";
111
+ comment: "comment";
112
+ }>;
113
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
114
+ }, z.core.$strip>;
115
+ content: z.ZodObject<{
116
+ kind: z.ZodEnum<{
117
+ post: "post";
118
+ poll: "poll";
119
+ }>;
120
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
121
+ }, z.core.$strip>;
122
+ excerpt: z.ZodString;
123
+ author: z.ZodObject<{
124
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
125
+ displayName: z.ZodString;
126
+ avatarUrl: z.ZodNullable<z.ZodURL>;
127
+ }, z.core.$strip>;
128
+ createdAt: z.ZodISODateTime;
129
+ state: z.ZodEnum<{
130
+ visible: "visible";
131
+ hidden: "hidden";
132
+ removed: "removed";
133
+ }>;
134
+ reports: z.ZodObject<{
135
+ open: z.ZodNumber;
136
+ total: z.ZodNumber;
137
+ reasons: z.ZodArray<z.ZodObject<{
138
+ reason: z.ZodEnum<{
139
+ other: "other";
140
+ spam: "spam";
141
+ harassment: "harassment";
142
+ misinformation: "misinformation";
143
+ off_topic: "off_topic";
144
+ impersonation: "impersonation";
145
+ }>;
146
+ count: z.ZodNumber;
147
+ }, z.core.$strip>>;
148
+ notes: z.ZodArray<z.ZodString>;
149
+ oldestOpenAt: z.ZodNullable<z.ZodISODateTime>;
150
+ }, z.core.$strip>;
151
+ viewer: z.ZodObject<{
152
+ canDismiss: z.ZodBoolean;
153
+ canHide: z.ZodBoolean;
154
+ canRestore: z.ZodBoolean;
155
+ canRemove: z.ZodBoolean;
156
+ }, z.core.$strip>;
157
+ }, z.core.$strip>>;
158
+ nextCursor: z.ZodNullable<z.ZodString>;
159
+ }, z.core.$strip>;
160
+ export type ModerationPage = z.infer<typeof moderationPageSchema>;
161
+ /** `GET /moderation/content`. Visible when not said. */
162
+ export declare const moderationContentQuerySchema: z.ZodObject<{
163
+ limit: z.ZodPreprocess<z.ZodDefault<z.ZodCoercedNumber<unknown>>, unknown>;
164
+ cursor: z.ZodOptional<z.ZodString>;
165
+ state: z.ZodPreprocess<z.ZodDefault<z.ZodEnum<{
166
+ visible: "visible";
167
+ hidden: "hidden";
168
+ removed: "removed";
169
+ }>>, unknown>;
170
+ }, z.core.$strip>;
171
+ export type ModerationContentQuery = z.infer<typeof moderationContentQuerySchema>;
172
+ export type ModerationContentQueryInput = z.input<typeof moderationContentQuerySchema>;
173
+ /** `POST /moderation/:contentKind/:contentId/decision`. */
174
+ export declare const moderationDecisionBodySchema: z.ZodObject<{
175
+ action: z.ZodEnum<{
176
+ dismiss: "dismiss";
177
+ hide: "hide";
178
+ restore: "restore";
179
+ remove: "remove";
180
+ }>;
181
+ note: z.ZodPreprocess<z.ZodOptional<z.ZodString>, unknown>;
182
+ }, z.core.$strip>;
183
+ export type ModerationDecisionBody = z.infer<typeof moderationDecisionBodySchema>;
184
+ //# sourceMappingURL=moderation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moderation.d.ts","sourceRoot":"","sources":["../../../src/domains/moderation/moderation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAA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