jansathi-community-schema 0.16.0 → 0.18.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/comment.d.ts CHANGED
@@ -20,6 +20,7 @@ export declare const communityCommentWireSchema: z.ZodObject<{
20
20
  lost_found: "lost_found";
21
21
  voice_box: "voice_box";
22
22
  donate_item: "donate_item";
23
+ poll: "poll";
23
24
  }>;
24
25
  contentId: z.ZodString;
25
26
  parentCommentId: z.ZodNullable<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../src/comment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkCrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAI9E,eAAO,MAAM,uBAAuB;;;iBAMlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAIxE,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../src/comment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkCrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAI9E,eAAO,MAAM,uBAAuB;;;iBAMlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAIxE,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -74,4 +74,35 @@ export declare const COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS = 30;
74
74
  * ("Vice Chairman", "Press & Media") without opening the door to
75
75
  * punctuation soup. */
76
76
  export declare const COMMUNITY_DESIGNATION_CUSTOM_PATTERN: RegExp;
77
+ /** Poll question (the "What's your favourite Diwali sweet?" prompt).
78
+ * Twitter caps at 280; we match for a snappy feed read. */
79
+ export declare const POLL_QUESTION_MAX_CHARS = 280;
80
+ export declare const POLL_QUESTION_MIN_CHARS = 1;
81
+ /** Per-option label length. Long enough for a phrase, short enough that
82
+ * options stack readably in a feed card on a phone. */
83
+ export declare const POLL_OPTION_MAX_CHARS = 80;
84
+ export declare const POLL_OPTION_MIN_CHARS = 1;
85
+ /** A poll must offer at least two options (else it's not a choice) and
86
+ * at most six (more than that fragments votes and tanks readability —
87
+ * matches Twitter's 4 / WhatsApp's 12 / our pick is the middle). */
88
+ export declare const POLL_MIN_OPTIONS = 2;
89
+ export declare const POLL_MAX_OPTIONS = 6;
90
+ /** Duration bounds. Polls MUST have an expiry — open-ended polls go
91
+ * stale and clutter feeds (see PoLLs spec discussion). The floor stops
92
+ * accidental "1 second" polls; the ceiling caps a single poll's
93
+ * visibility window so authors think about timing. */
94
+ export declare const POLL_MIN_DURATION_MS: number;
95
+ export declare const POLL_MAX_DURATION_MS: number;
96
+ /** Composer presets (the radio chips in the duration picker). Custom
97
+ * date entry covers everything in between. Server still validates the
98
+ * resolved `closesAt` against the bounds above. */
99
+ export declare const POLL_DURATION_PRESETS_MS: {
100
+ readonly oneDay: number;
101
+ readonly threeDays: number;
102
+ readonly sevenDays: number;
103
+ readonly fourteenDays: number;
104
+ };
105
+ /** Feed page size for polls when fetched as their own list (rare —
106
+ * polls usually surface via the unified feed). Keeps memory bounded. */
107
+ export declare const POLLS_PAGE_SIZE = 20;
77
108
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,mCAAmC;AACnC,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC,qCAAqC;AACrC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,0CAA0C;AAC1C,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAIvC,2BAA2B;AAC3B,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,2BAA2B;AAC3B,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC,0DAA0D;AAC1D,eAAO,MAAM,sBAAsB,QAAU,CAAC;AAE9C,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,QAAmB,CAAC;AAErD,mCAAmC;AACnC,eAAO,MAAM,oBAAoB,QAAoB,CAAC;AAItD;kCACkC;AAClC,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,0CAA0C;AAC1C,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,yCAAyC;AACzC,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAIzC,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,QAAgB,CAAC;AAIlD,uDAAuD;AACvD,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,yBAAyB;AACzB,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAItC;mBACmB;AACnB,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAC3C,eAAO,MAAM,wBA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AAO,MAAM,oBAAoB,QAAgB,CAAC;AAClD,eAAO,MAAM,oBAAoB,QAA2B,CAAC;AAE7D;;oDAEoD;AACpD,eAAO,MAAM,wBAAwB;;;;;CAK3B,CAAC;AAEX;yEACyE;AACzE,eAAO,MAAM,eAAe,KAAK,CAAC"}
package/dist/constants.js CHANGED
@@ -81,4 +81,36 @@ export const COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS = 30;
81
81
  * ("Vice Chairman", "Press & Media") without opening the door to
82
82
  * punctuation soup. */
83
83
  export const COMMUNITY_DESIGNATION_CUSTOM_PATTERN = /^[A-Za-z0-9 &]+$/;
84
+ // ─── Polls ─────────────────────────────────────────────────────────────────
85
+ /** Poll question (the "What's your favourite Diwali sweet?" prompt).
86
+ * Twitter caps at 280; we match for a snappy feed read. */
87
+ export const POLL_QUESTION_MAX_CHARS = 280;
88
+ export const POLL_QUESTION_MIN_CHARS = 1;
89
+ /** Per-option label length. Long enough for a phrase, short enough that
90
+ * options stack readably in a feed card on a phone. */
91
+ export const POLL_OPTION_MAX_CHARS = 80;
92
+ export const POLL_OPTION_MIN_CHARS = 1;
93
+ /** A poll must offer at least two options (else it's not a choice) and
94
+ * at most six (more than that fragments votes and tanks readability —
95
+ * matches Twitter's 4 / WhatsApp's 12 / our pick is the middle). */
96
+ export const POLL_MIN_OPTIONS = 2;
97
+ export const POLL_MAX_OPTIONS = 6;
98
+ /** Duration bounds. Polls MUST have an expiry — open-ended polls go
99
+ * stale and clutter feeds (see PoLLs spec discussion). The floor stops
100
+ * accidental "1 second" polls; the ceiling caps a single poll's
101
+ * visibility window so authors think about timing. */
102
+ export const POLL_MIN_DURATION_MS = 5 * 60 * 1000; // 5 minutes
103
+ export const POLL_MAX_DURATION_MS = 30 * 24 * 60 * 60 * 1000; // 30 days
104
+ /** Composer presets (the radio chips in the duration picker). Custom
105
+ * date entry covers everything in between. Server still validates the
106
+ * resolved `closesAt` against the bounds above. */
107
+ export const POLL_DURATION_PRESETS_MS = {
108
+ oneDay: 24 * 60 * 60 * 1000,
109
+ threeDays: 3 * 24 * 60 * 60 * 1000,
110
+ sevenDays: 7 * 24 * 60 * 60 * 1000,
111
+ fourteenDays: 14 * 24 * 60 * 60 * 1000,
112
+ };
113
+ /** Feed page size for polls when fetched as their own list (rare —
114
+ * polls usually surface via the unified feed). Keeps memory bounded. */
115
+ export const POLLS_PAGE_SIZE = 20;
84
116
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,+EAA+E;AAE/E,mCAAmC;AACnC,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC,qCAAqC;AACrC,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAEnC,0CAA0C;AAC1C,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAErC,yEAAyE;AACzE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC,8EAA8E;AAE9E,2BAA2B;AAC3B,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC,2BAA2B;AAC3B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AAEjC,0DAA0D;AAC1D,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,GAAG,EAAE,CAAC;AAE9C,sEAAsE;AACtE,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAErD,mCAAmC;AACnC,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtD,+EAA+E;AAE/E;kCACkC;AAClC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC,0CAA0C;AAC1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE3C,yCAAyC;AACzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,+EAA+E;AAE/E,8EAA8E;AAC9E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAElD,+EAA+E;AAE/E,uDAAuD;AACvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAErC,yBAAyB;AACzB,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC,8EAA8E;AAE9E;mBACmB;AACnB,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAC3C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAE1C;;4EAE4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAC3C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAC1C;oEACoE;AACpE,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAEtD,wDAAwD;AACxD,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAEnD,yDAAyD;AACzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACxC,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAE9C,6EAA6E;AAE7E;;sCAEsC;AACtC,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAErC;;;4CAG4C;AAC5C,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC;AAEhD;;gEAEgE;AAChE,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC;AACxD,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,CAAC;AACzD;;wBAEwB;AACxB,MAAM,CAAC,MAAM,oCAAoC,GAAG,kBAAkB,CAAC","sourcesContent":["/**\n * Tunable constants shared across the community feature.\n *\n * Live here (not inline in feature code) so backend and every frontend\n * agree byte-for-byte on the same limits, paginations, and timeouts.\n * Bump versions of this package when these change.\n *\n * @module community-schema/constants\n */\n\n// ─── Pagination ─────────────────────────────────────────────────────────────\n\n/** Feed list default page size. */\nexport const FEED_PAGE_SIZE = 20;\n\n/** People list default page size. */\nexport const PEOPLE_PAGE_SIZE = 30;\n\n/** Comments per page on a single post. */\nexport const COMMENTS_PAGE_SIZE = 20;\n\n/** Replies per top-level comment loaded with the first comments page. */\nexport const REPLIES_PRELOAD_COUNT = 3;\n\n// ─── Post media limits ─────────────────────────────────────────────────────\n\n/** Max images per post. */\nexport const POST_MAX_IMAGES = 10;\n\n/** Max videos per post. */\nexport const POST_MAX_VIDEOS = 5;\n\n/** Max duration of a single video in seconds (10 min). */\nexport const POST_MAX_VIDEO_SECONDS = 10 * 60;\n\n/** Per-image hard cap (15 MB). The file service compresses to fit. */\nexport const POST_MAX_IMAGE_BYTES = 15 * 1024 * 1024;\n\n/** Per-video hard cap (200 MB). */\nexport const POST_MAX_VIDEO_BYTES = 200 * 1024 * 1024;\n\n// ─── Text limits ────────────────────────────────────────────────────────────\n\n/** Post body character cap. Long enough for long-form, short enough to\n * keep feed rendering snappy. */\nexport const POST_MAX_BODY_CHARS = 5000;\n\n/** Comment + reply body character cap. */\nexport const COMMENT_MAX_BODY_CHARS = 2000;\n\n/** Free-text bio on a public profile. */\nexport const PROFILE_MAX_BIO_CHARS = 280;\n\n// ─── Engagement ─────────────────────────────────────────────────────────────\n\n/** Window during which an author can edit their own post / comment, in ms. */\nexport const EDIT_GRACE_WINDOW_MS = 5 * 60 * 1000;\n\n// ─── Groups ─────────────────────────────────────────────────────────────────\n\n/** Max members in a single user-created group chat. */\nexport const GROUP_MAX_MEMBERS = 256;\n\n/** Group name length. */\nexport const GROUP_NAME_MAX_CHARS = 60;\nexport const GROUP_NAME_MIN_CHARS = 2;\n\n// ─── Communities ───────────────────────────────────────────────────────────\n\n/** Community name length. Same range as a group, with room for a real\n * topic title. */\nexport const COMMUNITY_NAME_MAX_CHARS = 60;\nexport const COMMUNITY_NAME_MIN_CHARS = 2;\n\n/** Slug is auto-generated from name on create (lowercase, hyphenated)\n * but the user may also pick one explicitly on the create form. Match\n * Reddit's vibes: 3-21 chars, lower alphanumeric + underscore + hyphen. */\nexport const COMMUNITY_SLUG_MAX_CHARS = 21;\nexport const COMMUNITY_SLUG_MIN_CHARS = 3;\n/** Slug character class — kept in lockstep with the regex enforced by\n * the create-body Zod schema and the backend's slug normaliser. */\nexport const COMMUNITY_SLUG_PATTERN = /^[a-z0-9_-]+$/;\n\n/** Description shown on the community card + header. */\nexport const COMMUNITY_DESCRIPTION_MAX_CHARS = 500;\n\n/** Communities discover + members + posts page sizes. */\nexport const COMMUNITIES_PAGE_SIZE = 20;\nexport const COMMUNITY_MEMBERS_PAGE_SIZE = 50;\n\n// ─── Community v2 (taxonomy + reach + tags + verification + designation) ──\n\n/** Max tags a community can carry. Tags are picked from a curated\n * enum (`COMMUNITY_TAG_VALUES`), not free text — keeps the picker\n * + discovery filters meaningful. */\nexport const COMMUNITY_MAX_TAGS = 10;\n\n/** Hyperlocal discovery radius. Set generously because GPS accuracy\n * is noisy on phones — 5 km usually covers a viewer's neighborhood\n * plus a buffer of adjacent localities. Single source of truth so\n * backend filter + frontend copy agree. */\nexport const COMMUNITY_HYPERLOCAL_RADIUS_KM = 5;\n\n/** Custom (free-text) designation length bounds — used when the\n * owner / admin types a designation that isn't in the preset enum.\n * The preset path takes precedence; custom is the fallback. */\nexport const COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS = 2;\nexport const COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS = 30;\n/** Alphanumeric + space + ampersand — covers natural English labels\n * (\"Vice Chairman\", \"Press & Media\") without opening the door to\n * punctuation soup. */\nexport const COMMUNITY_DESIGNATION_CUSTOM_PATTERN = /^[A-Za-z0-9 &]+$/;\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AA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AAoB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,UAAU;AAExE;;oDAEoD;AACpD,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAC3B,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAClC,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAClC,YAAY,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;CAC9B,CAAC;AAEX;yEACyE;AACzE,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC","sourcesContent":["/**\n * Tunable constants shared across the community feature.\n *\n * Live here (not inline in feature code) so backend and every frontend\n * agree byte-for-byte on the same limits, paginations, and timeouts.\n * Bump versions of this package when these change.\n *\n * @module community-schema/constants\n */\n\n// ─── Pagination ─────────────────────────────────────────────────────────────\n\n/** Feed list default page size. */\nexport const FEED_PAGE_SIZE = 20;\n\n/** People list default page size. */\nexport const PEOPLE_PAGE_SIZE = 30;\n\n/** Comments per page on a single post. */\nexport const COMMENTS_PAGE_SIZE = 20;\n\n/** Replies per top-level comment loaded with the first comments page. */\nexport const REPLIES_PRELOAD_COUNT = 3;\n\n// ─── Post media limits ─────────────────────────────────────────────────────\n\n/** Max images per post. */\nexport const POST_MAX_IMAGES = 10;\n\n/** Max videos per post. */\nexport const POST_MAX_VIDEOS = 5;\n\n/** Max duration of a single video in seconds (10 min). */\nexport const POST_MAX_VIDEO_SECONDS = 10 * 60;\n\n/** Per-image hard cap (15 MB). The file service compresses to fit. */\nexport const POST_MAX_IMAGE_BYTES = 15 * 1024 * 1024;\n\n/** Per-video hard cap (200 MB). */\nexport const POST_MAX_VIDEO_BYTES = 200 * 1024 * 1024;\n\n// ─── Text limits ────────────────────────────────────────────────────────────\n\n/** Post body character cap. Long enough for long-form, short enough to\n * keep feed rendering snappy. */\nexport const POST_MAX_BODY_CHARS = 5000;\n\n/** Comment + reply body character cap. */\nexport const COMMENT_MAX_BODY_CHARS = 2000;\n\n/** Free-text bio on a public profile. */\nexport const PROFILE_MAX_BIO_CHARS = 280;\n\n// ─── Engagement ─────────────────────────────────────────────────────────────\n\n/** Window during which an author can edit their own post / comment, in ms. */\nexport const EDIT_GRACE_WINDOW_MS = 5 * 60 * 1000;\n\n// ─── Groups ─────────────────────────────────────────────────────────────────\n\n/** Max members in a single user-created group chat. */\nexport const GROUP_MAX_MEMBERS = 256;\n\n/** Group name length. */\nexport const GROUP_NAME_MAX_CHARS = 60;\nexport const GROUP_NAME_MIN_CHARS = 2;\n\n// ─── Communities ───────────────────────────────────────────────────────────\n\n/** Community name length. Same range as a group, with room for a real\n * topic title. */\nexport const COMMUNITY_NAME_MAX_CHARS = 60;\nexport const COMMUNITY_NAME_MIN_CHARS = 2;\n\n/** Slug is auto-generated from name on create (lowercase, hyphenated)\n * but the user may also pick one explicitly on the create form. Match\n * Reddit's vibes: 3-21 chars, lower alphanumeric + underscore + hyphen. */\nexport const COMMUNITY_SLUG_MAX_CHARS = 21;\nexport const COMMUNITY_SLUG_MIN_CHARS = 3;\n/** Slug character class — kept in lockstep with the regex enforced by\n * the create-body Zod schema and the backend's slug normaliser. */\nexport const COMMUNITY_SLUG_PATTERN = /^[a-z0-9_-]+$/;\n\n/** Description shown on the community card + header. */\nexport const COMMUNITY_DESCRIPTION_MAX_CHARS = 500;\n\n/** Communities discover + members + posts page sizes. */\nexport const COMMUNITIES_PAGE_SIZE = 20;\nexport const COMMUNITY_MEMBERS_PAGE_SIZE = 50;\n\n// ─── Community v2 (taxonomy + reach + tags + verification + designation) ──\n\n/** Max tags a community can carry. Tags are picked from a curated\n * enum (`COMMUNITY_TAG_VALUES`), not free text — keeps the picker\n * + discovery filters meaningful. */\nexport const COMMUNITY_MAX_TAGS = 10;\n\n/** Hyperlocal discovery radius. Set generously because GPS accuracy\n * is noisy on phones — 5 km usually covers a viewer's neighborhood\n * plus a buffer of adjacent localities. Single source of truth so\n * backend filter + frontend copy agree. */\nexport const COMMUNITY_HYPERLOCAL_RADIUS_KM = 5;\n\n/** Custom (free-text) designation length bounds — used when the\n * owner / admin types a designation that isn't in the preset enum.\n * The preset path takes precedence; custom is the fallback. */\nexport const COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS = 2;\nexport const COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS = 30;\n/** Alphanumeric + space + ampersand — covers natural English labels\n * (\"Vice Chairman\", \"Press & Media\") without opening the door to\n * punctuation soup. */\nexport const COMMUNITY_DESIGNATION_CUSTOM_PATTERN = /^[A-Za-z0-9 &]+$/;\n\n// ─── Polls ─────────────────────────────────────────────────────────────────\n\n/** Poll question (the \"What's your favourite Diwali sweet?\" prompt).\n * Twitter caps at 280; we match for a snappy feed read. */\nexport const POLL_QUESTION_MAX_CHARS = 280;\nexport const POLL_QUESTION_MIN_CHARS = 1;\n\n/** Per-option label length. Long enough for a phrase, short enough that\n * options stack readably in a feed card on a phone. */\nexport const POLL_OPTION_MAX_CHARS = 80;\nexport const POLL_OPTION_MIN_CHARS = 1;\n\n/** A poll must offer at least two options (else it's not a choice) and\n * at most six (more than that fragments votes and tanks readability —\n * matches Twitter's 4 / WhatsApp's 12 / our pick is the middle). */\nexport const POLL_MIN_OPTIONS = 2;\nexport const POLL_MAX_OPTIONS = 6;\n\n/** Duration bounds. Polls MUST have an expiry — open-ended polls go\n * stale and clutter feeds (see PoLLs spec discussion). The floor stops\n * accidental \"1 second\" polls; the ceiling caps a single poll's\n * visibility window so authors think about timing. */\nexport const POLL_MIN_DURATION_MS = 5 * 60 * 1000; // 5 minutes\nexport const POLL_MAX_DURATION_MS = 30 * 24 * 60 * 60 * 1000; // 30 days\n\n/** Composer presets (the radio chips in the duration picker). Custom\n * date entry covers everything in between. Server still validates the\n * resolved `closesAt` against the bounds above. */\nexport const POLL_DURATION_PRESETS_MS = {\n oneDay: 24 * 60 * 60 * 1000,\n threeDays: 3 * 24 * 60 * 60 * 1000,\n sevenDays: 7 * 24 * 60 * 60 * 1000,\n fourteenDays: 14 * 24 * 60 * 60 * 1000,\n} as const;\n\n/** Feed page size for polls when fetched as their own list (rare —\n * polls usually surface via the unified feed). Keeps memory bounded. */\nexport const POLLS_PAGE_SIZE = 20;\n"]}
@@ -23,6 +23,7 @@ export declare const toggleUpvoteResponseSchema: z.ZodObject<{
23
23
  lost_found: "lost_found";
24
24
  voice_box: "voice_box";
25
25
  donate_item: "donate_item";
26
+ poll: "poll";
26
27
  }>;
27
28
  contentId: z.ZodString;
28
29
  upvoted: z.ZodBoolean;
@@ -54,6 +55,7 @@ export declare const setReactionResponseSchema: z.ZodObject<{
54
55
  lost_found: "lost_found";
55
56
  voice_box: "voice_box";
56
57
  donate_item: "donate_item";
58
+ poll: "poll";
57
59
  }>;
58
60
  contentId: z.ZodString;
59
61
  reaction: z.ZodNullable<z.ZodEnum<{
@@ -1 +1 @@
1
- {"version":3,"file":"engagement.d.ts","sourceRoot":"","sources":["../src/engagement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;;GAIG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;iBAQrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAI9E;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;iBAEhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;iBAOpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
1
+ {"version":3,"file":"engagement.d.ts","sourceRoot":"","sources":["../src/engagement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;;GAIG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;iBAQrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAI9E;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;iBAEhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;iBAOpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
package/dist/enums.d.ts CHANGED
@@ -48,20 +48,23 @@ export type VisibilityLevel = z.infer<typeof visibilityLevelSchema>;
48
48
  */
49
49
  export declare const VISIBILITY_LEVEL_RANK: Record<VisibilityLevel, number>;
50
50
  /**
51
- * The kinds of items that show up in the feed. `post` is the new
51
+ * The kinds of items that show up in the feed. `post` is the
52
52
  * community-native kind; `lost_found`, `voice_box`, and `donate_item`
53
53
  * are existing legacy features surfaced into the feed via polymorphic
54
- * union.
54
+ * union; `poll` is the structured-choice kind backed by its own
55
+ * `CommunityPoll` collection (votes live in a separate `PollVote`
56
+ * collection, see `./poll.ts`).
55
57
  *
56
58
  * Engagement (upvote / reaction / comment / share) is keyed by
57
59
  * (contentKind, contentId) so every kind gets the same engagement bar.
58
60
  */
59
- export declare const CONTENT_KIND_VALUES: readonly ["post", "lost_found", "voice_box", "donate_item"];
61
+ export declare const CONTENT_KIND_VALUES: readonly ["post", "lost_found", "voice_box", "donate_item", "poll"];
60
62
  export declare const contentKindSchema: z.ZodEnum<{
61
63
  post: "post";
62
64
  lost_found: "lost_found";
63
65
  voice_box: "voice_box";
64
66
  donate_item: "donate_item";
67
+ poll: "poll";
65
68
  }>;
66
69
  export type ContentKind = z.infer<typeof contentKindSchema>;
67
70
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../src/enums.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,uBAAuB,+DAM1B,CAAC;AACX,eAAO,MAAM,qBAAqB;;;;;;EAAkC,CAAC;AACrE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAMjE,CAAC;AAIF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,6DAA8D,CAAC;AAC/F,eAAO,MAAM,iBAAiB;;;;;EAA8B,CAAC;AAC7D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAI5D;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,qEAQvB,CAAC;AACX,eAAO,MAAM,kBAAkB;;;;;;;;EAA+B,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,gCAAiC,CAAC;AACrE,eAAO,MAAM,oBAAoB;;;EAAiC,CAAC;AACnE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CA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QvB,CAAC;AACX,eAAO,MAAM,kBAAkB;;;;;;;;EAA+B,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,gCAAiC,CAAC;AACrE,eAAO,MAAM,oBAAoB;;;EAAiC,CAAC;AACnE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAIlE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,yIAUvB,CAAC;AACX,eAAO,MAAM,kBAAkB;;;;;;;;;;EAA+B,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,6CAA6C;AAC7C,eAAO,MAAM,oBAAoB,4DAA6D,CAAC;AAC/F,eAAO,MAAM,kBAAkB;;;;;EAA+B,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,gCAAiC,CAAC;AAC/D,eAAO,MAAM,cAAc;;;;EAA2B,CAAC;AACvD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
package/dist/enums.js CHANGED
@@ -55,15 +55,23 @@ export const VISIBILITY_LEVEL_RANK = {
55
55
  };
56
56
  // ─── Polymorphic content kind ───────────────────────────────────────────────
57
57
  /**
58
- * The kinds of items that show up in the feed. `post` is the new
58
+ * The kinds of items that show up in the feed. `post` is the
59
59
  * community-native kind; `lost_found`, `voice_box`, and `donate_item`
60
60
  * are existing legacy features surfaced into the feed via polymorphic
61
- * union.
61
+ * union; `poll` is the structured-choice kind backed by its own
62
+ * `CommunityPoll` collection (votes live in a separate `PollVote`
63
+ * collection, see `./poll.ts`).
62
64
  *
63
65
  * Engagement (upvote / reaction / comment / share) is keyed by
64
66
  * (contentKind, contentId) so every kind gets the same engagement bar.
65
67
  */
66
- export const CONTENT_KIND_VALUES = ['post', 'lost_found', 'voice_box', 'donate_item'];
68
+ export const CONTENT_KIND_VALUES = [
69
+ 'post',
70
+ 'lost_found',
71
+ 'voice_box',
72
+ 'donate_item',
73
+ 'poll',
74
+ ];
67
75
  export const contentKindSchema = z.enum(CONTENT_KIND_VALUES);
68
76
  // ─── Reactions ──────────────────────────────────────────────────────────────
69
77
  /**
package/dist/enums.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","sourceRoot":"","sources":["../src/enums.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,OAAO;IACP,UAAU;IACV,OAAO;IACP,UAAU;IACV,QAAQ;CACA,CAAC;AACX,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AAGrE;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAoC;IACpE,KAAK,EAAE,CAAC;IACR,QAAQ,EAAE,CAAC;IACX,KAAK,EAAE,CAAC;IACR,QAAQ,EAAE,CAAC;IACX,MAAM,EAAE,CAAC;CACV,CAAC;AAEF,+EAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,CAAU,CAAC;AAC/F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAG7D,+EAA+E;AAE/E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,KAAK;IACL,OAAO;IACP,SAAS;CACD,CAAC;AACX,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAG/D,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAU,CAAC;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;AAGnE,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM;IACN,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,gBAAgB;IAChB,UAAU;IACV,WAAW;IACX,iBAAiB;IACjB,OAAO;CACC,CAAC;AACX,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAG/D,6CAA6C;AAC7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,CAAU,CAAC;AAC/F,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAG/D,8EAA8E;AAE9E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAC/D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["/**\n * Enum value arrays shared across the community feature.\n *\n * Each enum is exported as both a `*_VALUES` tuple and the corresponding\n * Zod schema so backend Mongoose models and frontend forms validate\n * against the exact same set.\n *\n * @module community-schema/enums\n */\n\nimport { z } from 'zod';\n\n// ─── Feed viewport (viewer-side geographic filter) ─────────────────────────\n\n/**\n * Geographic scope the VIEWER chose for their feed — the area-proximity\n * cascade is gated by this value.\n *\n * Posts do NOT carry a per-post `visibilityLevel` any more. Every post\n * is implicitly global; visibility is purely a function of (a) the\n * author's `areaLineage` at write time and (b) the viewer's scope\n * choice here. The cascade walks from the viewer's locality outward\n * and includes any post whose author was inside the viewer's area at\n * ANY level the viewer's scope reaches.\n *\n * - `local` → locality + district + state + national matches\n * - `district` → district + state + national matches (no locality boost)\n * - `state` → state + national matches\n * - `national` → national matches\n * - `global` → all matches (de-facto same as `national` for an\n * India-only product, but kept for forward compat)\n *\n * Read-side ranking — see `feed.service.ts#tierBoost` — multiplies the\n * row's hotScore by an area-proximity factor: locality match 2.0,\n * district 1.2, state 0.9, national 0.7, distant 0.5. So local\n * content dominates at equal quality, while genuinely viral national\n * content still surfaces.\n */\nexport const VISIBILITY_LEVEL_VALUES = [\n 'local',\n 'district',\n 'state',\n 'national',\n 'global',\n] as const;\nexport const visibilityLevelSchema = z.enum(VISIBILITY_LEVEL_VALUES);\nexport type VisibilityLevel = z.infer<typeof visibilityLevelSchema>;\n\n/**\n * Numeric ranking used for the area-proximity cascade. `local` is the\n * deepest (most specific) feed scope, `global` the broadest. Higher\n * rank = broader scope.\n */\nexport const VISIBILITY_LEVEL_RANK: Record<VisibilityLevel, number> = {\n local: 0,\n district: 1,\n state: 2,\n national: 3,\n global: 4,\n};\n\n// ─── Polymorphic content kind ───────────────────────────────────────────────\n\n/**\n * The kinds of items that show up in the feed. `post` is the new\n * community-native kind; `lost_found`, `voice_box`, and `donate_item`\n * are existing legacy features surfaced into the feed via polymorphic\n * union.\n *\n * Engagement (upvote / reaction / comment / share) is keyed by\n * (contentKind, contentId) so every kind gets the same engagement bar.\n */\nexport const CONTENT_KIND_VALUES = ['post', 'lost_found', 'voice_box', 'donate_item'] as const;\nexport const contentKindSchema = z.enum(CONTENT_KIND_VALUES);\nexport type ContentKind = z.infer<typeof contentKindSchema>;\n\n// ─── Reactions ──────────────────────────────────────────────────────────────\n\n/**\n * Reaction types available on every feed item.\n *\n * `support` replaces Facebook's \"Care\" — better-suited to a civic /\n * hyperlocal context where reacting to a complaint or lost-and-found\n * post deserves a distinct \"I support you\" signal.\n */\nexport const REACTION_TYPE_VALUES = [\n 'like',\n 'love',\n 'haha',\n 'wow',\n 'sad',\n 'angry',\n 'support',\n] as const;\nexport const reactionTypeSchema = z.enum(REACTION_TYPE_VALUES);\nexport type ReactionType = z.infer<typeof reactionTypeSchema>;\n\n// ─── Profile privacy ───────────────────────────────────────────────────────\n\n/**\n * Profile-level privacy (single toggle in Settings).\n *\n * `public` — anyone the area-proximity cascade reaches sees this user's posts.\n * `private` — only the viewer's followers see this user's posts.\n */\nexport const PROFILE_PRIVACY_VALUES = ['public', 'private'] as const;\nexport const profilePrivacySchema = z.enum(PROFILE_PRIVACY_VALUES);\nexport type ProfilePrivacy = z.infer<typeof profilePrivacySchema>;\n\n// ─── Moderation ────────────────────────────────────────────────────────────\n\n/**\n * Reasons a piece of content can be reported. The list is deliberately\n * short — finer categorization can come from the optional `details`\n * free-text field on a report.\n */\nexport const REPORT_REASON_VALUES = [\n 'spam',\n 'harassment',\n 'hate_speech',\n 'misinformation',\n 'sexual_content',\n 'violence',\n 'self_harm',\n 'illegal_content',\n 'other',\n] as const;\nexport const reportReasonSchema = z.enum(REPORT_REASON_VALUES);\nexport type ReportReason = z.infer<typeof reportReasonSchema>;\n\n/** Moderator decision states on a report. */\nexport const REPORT_STATUS_VALUES = ['pending', 'reviewing', 'actioned', 'dismissed'] as const;\nexport const reportStatusSchema = z.enum(REPORT_STATUS_VALUES);\nexport type ReportStatus = z.infer<typeof reportStatusSchema>;\n\n// ─── Feed sort ─────────────────────────────────────────────────────────────\n\n/**\n * Sort options exposed in the feed UI.\n *\n * `hot` — the default. Reddit-style score blending upvotes, comment count,\n * and recency. Best surface for civic / community engagement.\n * `new` — strict reverse-chronological. Useful when the viewer wants to\n * catch up on everything fresh.\n * `top` — highest upvote count over a configurable window (defaults to\n * 24 hours on the client).\n */\nexport const FEED_SORT_VALUES = ['hot', 'new', 'top'] as const;\nexport const feedSortSchema = z.enum(FEED_SORT_VALUES);\nexport type FeedSort = z.infer<typeof feedSortSchema>;\n"]}
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../src/enums.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAE9E;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,OAAO;IACP,UAAU;IACV,OAAO;IACP,UAAU;IACV,QAAQ;CACA,CAAC;AACX,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AAGrE;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAoC;IACpE,KAAK,EAAE,CAAC;IACR,QAAQ,EAAE,CAAC;IACX,KAAK,EAAE,CAAC;IACR,QAAQ,EAAE,CAAC;IACX,MAAM,EAAE,CAAC;CACV,CAAC;AAEF,+EAA+E;AAE/E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,MAAM;IACN,YAAY;IACZ,WAAW;IACX,aAAa;IACb,MAAM;CACE,CAAC;AACX,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAG7D,+EAA+E;AAE/E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,KAAK;IACL,OAAO;IACP,SAAS;CACD,CAAC;AACX,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAG/D,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAU,CAAC;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;AAGnE,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,MAAM;IACN,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,gBAAgB;IAChB,UAAU;IACV,WAAW;IACX,iBAAiB;IACjB,OAAO;CACC,CAAC;AACX,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAG/D,6CAA6C;AAC7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,CAAU,CAAC;AAC/F,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;AAG/D,8EAA8E;AAE9E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAC/D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["/**\n * Enum value arrays shared across the community feature.\n *\n * Each enum is exported as both a `*_VALUES` tuple and the corresponding\n * Zod schema so backend Mongoose models and frontend forms validate\n * against the exact same set.\n *\n * @module community-schema/enums\n */\n\nimport { z } from 'zod';\n\n// ─── Feed viewport (viewer-side geographic filter) ─────────────────────────\n\n/**\n * Geographic scope the VIEWER chose for their feed — the area-proximity\n * cascade is gated by this value.\n *\n * Posts do NOT carry a per-post `visibilityLevel` any more. Every post\n * is implicitly global; visibility is purely a function of (a) the\n * author's `areaLineage` at write time and (b) the viewer's scope\n * choice here. The cascade walks from the viewer's locality outward\n * and includes any post whose author was inside the viewer's area at\n * ANY level the viewer's scope reaches.\n *\n * - `local` → locality + district + state + national matches\n * - `district` → district + state + national matches (no locality boost)\n * - `state` → state + national matches\n * - `national` → national matches\n * - `global` → all matches (de-facto same as `national` for an\n * India-only product, but kept for forward compat)\n *\n * Read-side ranking — see `feed.service.ts#tierBoost` — multiplies the\n * row's hotScore by an area-proximity factor: locality match 2.0,\n * district 1.2, state 0.9, national 0.7, distant 0.5. So local\n * content dominates at equal quality, while genuinely viral national\n * content still surfaces.\n */\nexport const VISIBILITY_LEVEL_VALUES = [\n 'local',\n 'district',\n 'state',\n 'national',\n 'global',\n] as const;\nexport const visibilityLevelSchema = z.enum(VISIBILITY_LEVEL_VALUES);\nexport type VisibilityLevel = z.infer<typeof visibilityLevelSchema>;\n\n/**\n * Numeric ranking used for the area-proximity cascade. `local` is the\n * deepest (most specific) feed scope, `global` the broadest. Higher\n * rank = broader scope.\n */\nexport const VISIBILITY_LEVEL_RANK: Record<VisibilityLevel, number> = {\n local: 0,\n district: 1,\n state: 2,\n national: 3,\n global: 4,\n};\n\n// ─── Polymorphic content kind ───────────────────────────────────────────────\n\n/**\n * The kinds of items that show up in the feed. `post` is the\n * community-native kind; `lost_found`, `voice_box`, and `donate_item`\n * are existing legacy features surfaced into the feed via polymorphic\n * union; `poll` is the structured-choice kind backed by its own\n * `CommunityPoll` collection (votes live in a separate `PollVote`\n * collection, see `./poll.ts`).\n *\n * Engagement (upvote / reaction / comment / share) is keyed by\n * (contentKind, contentId) so every kind gets the same engagement bar.\n */\nexport const CONTENT_KIND_VALUES = [\n 'post',\n 'lost_found',\n 'voice_box',\n 'donate_item',\n 'poll',\n] as const;\nexport const contentKindSchema = z.enum(CONTENT_KIND_VALUES);\nexport type ContentKind = z.infer<typeof contentKindSchema>;\n\n// ─── Reactions ──────────────────────────────────────────────────────────────\n\n/**\n * Reaction types available on every feed item.\n *\n * `support` replaces Facebook's \"Care\" — better-suited to a civic /\n * hyperlocal context where reacting to a complaint or lost-and-found\n * post deserves a distinct \"I support you\" signal.\n */\nexport const REACTION_TYPE_VALUES = [\n 'like',\n 'love',\n 'haha',\n 'wow',\n 'sad',\n 'angry',\n 'support',\n] as const;\nexport const reactionTypeSchema = z.enum(REACTION_TYPE_VALUES);\nexport type ReactionType = z.infer<typeof reactionTypeSchema>;\n\n// ─── Profile privacy ───────────────────────────────────────────────────────\n\n/**\n * Profile-level privacy (single toggle in Settings).\n *\n * `public` — anyone the area-proximity cascade reaches sees this user's posts.\n * `private` — only the viewer's followers see this user's posts.\n */\nexport const PROFILE_PRIVACY_VALUES = ['public', 'private'] as const;\nexport const profilePrivacySchema = z.enum(PROFILE_PRIVACY_VALUES);\nexport type ProfilePrivacy = z.infer<typeof profilePrivacySchema>;\n\n// ─── Moderation ────────────────────────────────────────────────────────────\n\n/**\n * Reasons a piece of content can be reported. The list is deliberately\n * short — finer categorization can come from the optional `details`\n * free-text field on a report.\n */\nexport const REPORT_REASON_VALUES = [\n 'spam',\n 'harassment',\n 'hate_speech',\n 'misinformation',\n 'sexual_content',\n 'violence',\n 'self_harm',\n 'illegal_content',\n 'other',\n] as const;\nexport const reportReasonSchema = z.enum(REPORT_REASON_VALUES);\nexport type ReportReason = z.infer<typeof reportReasonSchema>;\n\n/** Moderator decision states on a report. */\nexport const REPORT_STATUS_VALUES = ['pending', 'reviewing', 'actioned', 'dismissed'] as const;\nexport const reportStatusSchema = z.enum(REPORT_STATUS_VALUES);\nexport type ReportStatus = z.infer<typeof reportStatusSchema>;\n\n// ─── Feed sort ─────────────────────────────────────────────────────────────\n\n/**\n * Sort options exposed in the feed UI.\n *\n * `hot` — the default. Reddit-style score blending upvotes, comment count,\n * and recency. Best surface for civic / community engagement.\n * `new` — strict reverse-chronological. Useful when the viewer wants to\n * catch up on everything fresh.\n * `top` — highest upvote count over a configurable window (defaults to\n * 24 hours on the client).\n */\nexport const FEED_SORT_VALUES = ['hot', 'new', 'top'] as const;\nexport const feedSortSchema = z.enum(FEED_SORT_VALUES);\nexport type FeedSort = z.infer<typeof feedSortSchema>;\n"]}
package/dist/feed.d.ts CHANGED
@@ -272,6 +272,7 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
272
272
  lost_found: "lost_found";
273
273
  voice_box: "voice_box";
274
274
  donate_item: "donate_item";
275
+ poll: "poll";
275
276
  }>;
276
277
  _id: z.ZodString;
277
278
  author: z.ZodObject<{
@@ -482,6 +483,77 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
482
483
  isAuthor: z.ZodBoolean;
483
484
  reposted: z.ZodBoolean;
484
485
  }, z.core.$strip>>;
486
+ }, z.core.$strip>, z.ZodObject<{
487
+ _id: z.ZodString;
488
+ contentKind: z.ZodLiteral<"poll">;
489
+ author: z.ZodObject<{
490
+ userId: z.ZodString;
491
+ username: z.ZodString;
492
+ displayName: z.ZodString;
493
+ avatarUrl: z.ZodOptional<z.ZodString>;
494
+ localName: z.ZodOptional<z.ZodString>;
495
+ designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
496
+ preset: z.ZodNullable<z.ZodEnum<{
497
+ volunteer: "volunteer";
498
+ chairman: "chairman";
499
+ vice_chairman: "vice_chairman";
500
+ president: "president";
501
+ vice_president: "vice_president";
502
+ secretary: "secretary";
503
+ joint_secretary: "joint_secretary";
504
+ general_secretary: "general_secretary";
505
+ treasurer: "treasurer";
506
+ joint_treasurer: "joint_treasurer";
507
+ organizer: "organizer";
508
+ coordinator: "coordinator";
509
+ spokesperson: "spokesperson";
510
+ founder: "founder";
511
+ co_founder: "co_founder";
512
+ patron: "patron";
513
+ advisor: "advisor";
514
+ mentor: "mentor";
515
+ committee_member: "committee_member";
516
+ member_at_large: "member_at_large";
517
+ }>>;
518
+ custom: z.ZodNullable<z.ZodString>;
519
+ }, z.core.$strip>>>;
520
+ identityVerified: z.ZodOptional<z.ZodBoolean>;
521
+ }, z.core.$strip>;
522
+ question: z.ZodString;
523
+ options: z.ZodArray<z.ZodObject<{
524
+ index: z.ZodNumber;
525
+ label: z.ZodString;
526
+ voteCount: z.ZodNumber;
527
+ }, z.core.$strip>>;
528
+ totalVoters: z.ZodNumber;
529
+ allowsMultipleChoices: z.ZodBoolean;
530
+ resultsVisibility: z.ZodEnum<{
531
+ live: "live";
532
+ after_close: "after_close";
533
+ }>;
534
+ closesAt: z.ZodString;
535
+ areaLineage: z.ZodObject<{
536
+ countryId: z.ZodOptional<z.ZodString>;
537
+ stateId: z.ZodOptional<z.ZodString>;
538
+ districtId: z.ZodOptional<z.ZodString>;
539
+ localId: z.ZodOptional<z.ZodString>;
540
+ localName: z.ZodOptional<z.ZodString>;
541
+ }, z.core.$strip>;
542
+ communityId: z.ZodOptional<z.ZodString>;
543
+ upvoteCount: z.ZodNumber;
544
+ commentCount: z.ZodNumber;
545
+ repostCount: z.ZodNumber;
546
+ reactionCounts: z.ZodRecord<z.ZodString, z.ZodNumber>;
547
+ createdAt: z.ZodString;
548
+ editedAt: z.ZodNullable<z.ZodString>;
549
+ deletedAt: z.ZodNullable<z.ZodString>;
550
+ viewer: z.ZodOptional<z.ZodObject<{
551
+ upvoted: z.ZodBoolean;
552
+ reaction: z.ZodNullable<z.ZodString>;
553
+ isAuthor: z.ZodBoolean;
554
+ reposted: z.ZodBoolean;
555
+ votedOptionIndices: z.ZodArray<z.ZodNumber>;
556
+ }, z.core.$strip>>;
485
557
  }, z.core.$strip>], "contentKind">;
486
558
  export type FeedItem = z.infer<typeof feedItemSchema>;
487
559
  export declare const feedQueryParamsSchema: z.ZodObject<{
@@ -573,6 +645,7 @@ export declare const feedResponseSchema: z.ZodObject<{
573
645
  lost_found: "lost_found";
574
646
  voice_box: "voice_box";
575
647
  donate_item: "donate_item";
648
+ poll: "poll";
576
649
  }>;
577
650
  _id: z.ZodString;
578
651
  author: z.ZodObject<{
@@ -783,6 +856,77 @@ export declare const feedResponseSchema: z.ZodObject<{
783
856
  isAuthor: z.ZodBoolean;
784
857
  reposted: z.ZodBoolean;
785
858
  }, z.core.$strip>>;
859
+ }, z.core.$strip>, z.ZodObject<{
860
+ _id: z.ZodString;
861
+ contentKind: z.ZodLiteral<"poll">;
862
+ author: z.ZodObject<{
863
+ userId: z.ZodString;
864
+ username: z.ZodString;
865
+ displayName: z.ZodString;
866
+ avatarUrl: z.ZodOptional<z.ZodString>;
867
+ localName: z.ZodOptional<z.ZodString>;
868
+ designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
869
+ preset: z.ZodNullable<z.ZodEnum<{
870
+ volunteer: "volunteer";
871
+ chairman: "chairman";
872
+ vice_chairman: "vice_chairman";
873
+ president: "president";
874
+ vice_president: "vice_president";
875
+ secretary: "secretary";
876
+ joint_secretary: "joint_secretary";
877
+ general_secretary: "general_secretary";
878
+ treasurer: "treasurer";
879
+ joint_treasurer: "joint_treasurer";
880
+ organizer: "organizer";
881
+ coordinator: "coordinator";
882
+ spokesperson: "spokesperson";
883
+ founder: "founder";
884
+ co_founder: "co_founder";
885
+ patron: "patron";
886
+ advisor: "advisor";
887
+ mentor: "mentor";
888
+ committee_member: "committee_member";
889
+ member_at_large: "member_at_large";
890
+ }>>;
891
+ custom: z.ZodNullable<z.ZodString>;
892
+ }, z.core.$strip>>>;
893
+ identityVerified: z.ZodOptional<z.ZodBoolean>;
894
+ }, z.core.$strip>;
895
+ question: z.ZodString;
896
+ options: z.ZodArray<z.ZodObject<{
897
+ index: z.ZodNumber;
898
+ label: z.ZodString;
899
+ voteCount: z.ZodNumber;
900
+ }, z.core.$strip>>;
901
+ totalVoters: z.ZodNumber;
902
+ allowsMultipleChoices: z.ZodBoolean;
903
+ resultsVisibility: z.ZodEnum<{
904
+ live: "live";
905
+ after_close: "after_close";
906
+ }>;
907
+ closesAt: z.ZodString;
908
+ areaLineage: z.ZodObject<{
909
+ countryId: z.ZodOptional<z.ZodString>;
910
+ stateId: z.ZodOptional<z.ZodString>;
911
+ districtId: z.ZodOptional<z.ZodString>;
912
+ localId: z.ZodOptional<z.ZodString>;
913
+ localName: z.ZodOptional<z.ZodString>;
914
+ }, z.core.$strip>;
915
+ communityId: z.ZodOptional<z.ZodString>;
916
+ upvoteCount: z.ZodNumber;
917
+ commentCount: z.ZodNumber;
918
+ repostCount: z.ZodNumber;
919
+ reactionCounts: z.ZodRecord<z.ZodString, z.ZodNumber>;
920
+ createdAt: z.ZodString;
921
+ editedAt: z.ZodNullable<z.ZodString>;
922
+ deletedAt: z.ZodNullable<z.ZodString>;
923
+ viewer: z.ZodOptional<z.ZodObject<{
924
+ upvoted: z.ZodBoolean;
925
+ reaction: z.ZodNullable<z.ZodString>;
926
+ isAuthor: z.ZodBoolean;
927
+ reposted: z.ZodBoolean;
928
+ votedOptionIndices: z.ZodArray<z.ZodNumber>;
929
+ }, z.core.$strip>>;
786
930
  }, z.core.$strip>], "contentKind">>;
787
931
  nextCursor: z.ZodNullable<z.ZodString>;
788
932
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"feed.d.ts","sourceRoot":"","sources":["../src/feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMhD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4BlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBjC,CAAC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Q,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAItD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;iBAShC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,CAAC"}
package/dist/feed.js CHANGED
@@ -23,6 +23,7 @@
23
23
  import { z } from 'zod';
24
24
  import { FEED_PAGE_SIZE } from './constants.js';
25
25
  import { feedSortSchema, visibilityLevelSchema } from './enums.js';
26
+ import { communityPollFeedItemSchema } from './poll.js';
26
27
  import { communityPostWireSchema, postAuthorSnapshotSchema } from './post.js';
27
28
  // ─── Per-kind feed envelopes ───────────────────────────────────────────────
28
29
  /**
@@ -121,6 +122,7 @@ export const feedItemSchema = z.discriminatedUnion('contentKind', [
121
122
  lostFoundFeedItemSchema,
122
123
  voiceBoxFeedItemSchema,
123
124
  donateItemFeedItemSchema,
125
+ communityPollFeedItemSchema,
124
126
  ]);
125
127
  // ─── Query + response ──────────────────────────────────────────────────────
126
128
  export const feedQueryParamsSchema = z.object({
package/dist/feed.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"feed.js","sourceRoot":"","sources":["../src/feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAE9E,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IACpC,MAAM,EAAE,wBAAwB;IAEhC,2DAA2D;IAC3D,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,iDAAiD;IACjD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAErC,uDAAuD;IACvD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC3C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC5C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC3C,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAA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found reports, and voice-box (complaints + suggestions).\n *\n * The feed is a SINGLE list typed as `FeedItem = Post | LostFound | VoiceBox`.\n * The client discriminates on `contentKind` and renders the matching\n * card component.\n *\n * Strategy notes (server-side):\n * - Read-time fanout. The server runs ONE parallel query per kind\n * filtered by the same area-lineage match and the same cascade-\n * upward visibility rule, then merges and sorts by `hot` score.\n * - Cursor-based pagination. The cursor is opaque (base64 of\n * `<sortKey>|<_id>`) so we can swap sort algorithms without a\n * breaking change.\n * - LostFound / VoiceBox shapes are pruned to the fields the feed\n * card needs — they keep their richer detail-page shape in their\n * own schemas (lost-found-schema, voice-box-schema if/when those\n * get factored out).\n *\n * @module community-schema/feed\n */\n\nimport { z } from 'zod';\nimport { FEED_PAGE_SIZE } from './constants.js';\nimport { feedSortSchema, visibilityLevelSchema } from './enums.js';\nimport { communityPostWireSchema, postAuthorSnapshotSchema } from './post.js';\n\n// ─── Per-kind feed envelopes ───────────────────────────────────────────────\n\n/**\n * Lost-and-found item projected into the feed. Mirrors the engagement\n * + author shape every feed card needs, plus a small handful of\n * lost-found-specific fields used by the card.\n */\nexport const lostFoundFeedItemSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('lost_found'),\n author: postAuthorSnapshotSchema,\n\n /** `'lost'` or `'found'` — drives the card chip colour. */\n kind: z.enum(['lost', 'found']),\n title: z.string(),\n description: z.string(),\n /** Single primary image rendered on the card. */\n imageUrl: z.string().url().optional(),\n\n /** Inherited engagement axis — same shape as posts. */\n upvoteCount: z.number().int().nonnegative(),\n commentCount: z.number().int().nonnegative(),\n repostCount: z.number().int().nonnegative(),\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n createdAt: z.string().datetime(),\n\n viewer: z\n .object({\n upvoted: z.boolean(),\n reaction: z.string().nullable(),\n isAuthor: z.boolean(),\n reposted: z.boolean(),\n })\n .optional(),\n});\nexport type LostFoundFeedItem = z.infer<typeof lostFoundFeedItemSchema>;\n\n/**\n * Donated-item listing projected into the feed. Mirrors the engagement\n * + author shape every feed card needs, plus the donate-item-specific\n * fields the card renders (item name, category, condition, status).\n */\nexport const donateItemFeedItemSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('donate_item'),\n author: postAuthorSnapshotSchema,\n\n /** Display name of the item (maps to ReformItemDonation.itemName). */\n itemName: z.string(),\n description: z.string().optional(),\n /** Free-text category (clothing / books / electronics / etc.). */\n category: z.string(),\n /** Free-text condition label (new / good / used / etc.). Optional. */\n condition: z.string().optional(),\n /** First photo if present — used as the card's hero image. */\n imageUrl: z.string().url().optional(),\n /** Donation lifecycle status (pending / verified / picked / etc.) so\n * the card can show an appropriate badge. */\n status: z.string(),\n\n upvoteCount: z.number().int().nonnegative(),\n commentCount: z.number().int().nonnegative(),\n repostCount: z.number().int().nonnegative(),\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n createdAt: z.string().datetime(),\n\n viewer: z\n .object({\n upvoted: z.boolean(),\n reaction: z.string().nullable(),\n isAuthor: z.boolean(),\n reposted: z.boolean(),\n })\n .optional(),\n});\nexport type DonateItemFeedItem = z.infer<typeof donateItemFeedItemSchema>;\n\n/**\n * Voice-box (complaint or suggestion) item projected into the feed.\n */\nexport const voiceBoxFeedItemSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('voice_box'),\n author: postAuthorSnapshotSchema,\n\n /** `'complaint'` or `'suggestion'` — drives the card chip colour. */\n kind: z.enum(['complaint', 'suggestion']),\n title: z.string(),\n description: z.string(),\n\n upvoteCount: z.number().int().nonnegative(),\n commentCount: z.number().int().nonnegative(),\n repostCount: z.number().int().nonnegative(),\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n createdAt: z.string().datetime(),\n\n viewer: z\n .object({\n upvoted: z.boolean(),\n reaction: z.string().nullable(),\n isAuthor: z.boolean(),\n reposted: z.boolean(),\n })\n .optional(),\n});\nexport type VoiceBoxFeedItem = z.infer<typeof voiceBoxFeedItemSchema>;\n\n// ─── Polymorphic union ─────────────────────────────────────────────────────\n\nexport const feedItemSchema = z.discriminatedUnion('contentKind', [\n communityPostWireSchema,\n lostFoundFeedItemSchema,\n voiceBoxFeedItemSchema,\n donateItemFeedItemSchema,\n]);\nexport type FeedItem = z.infer<typeof feedItemSchema>;\n\n// ─── Query + response ──────────────────────────────────────────────────────\n\nexport const feedQueryParamsSchema = z.object({\n /** The viewer's chosen feed level. Cascade-upward semantics apply. */\n level: visibilityLevelSchema,\n /** Sort algorithm. Defaults to `hot` server-side when omitted. */\n sort: feedSortSchema.optional(),\n /** Opaque pagination cursor returned by the previous page. */\n cursor: z.string().optional(),\n /** Page size; defaults to `FEED_PAGE_SIZE` server-side. */\n pageSize: z.number().int().positive().max(50).optional(),\n});\nexport type FeedQueryParams = z.infer<typeof feedQueryParamsSchema>;\n\nexport const feedResponseSchema = z.object({\n items: z.array(feedItemSchema),\n nextCursor: z.string().nullable(),\n});\nexport type FeedResponse = z.infer<typeof feedResponseSchema>;\n\n// Re-export so consumers don't have to also import constants.ts.\nexport { FEED_PAGE_SIZE };\n"]}
1
+ {"version":3,"file":"feed.js","sourceRoot":"","sources":["../src/feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAE9E,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IACpC,MAAM,EAAE,wBAAwB;IAEhC,2D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E;IACtE,KAAK,EAAE,qBAAqB;IAC5B,kEAAkE;IAClE,IAAI,EAAE,cAAc,CAAC,QAAQ,EAAE;IAC/B,8DAA8D;IAC9D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,2DAA2D;IAC3D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CACzD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;IAC9B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAGH,iEAAiE;AACjE,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["/**\n * Feed wire shapes — polymorphic union of community posts, lost-and-\n * found reports, and voice-box (complaints + suggestions).\n *\n * The feed is a SINGLE list typed as `FeedItem = Post | LostFound | VoiceBox`.\n * The client discriminates on `contentKind` and renders the matching\n * card component.\n *\n * Strategy notes (server-side):\n * - Read-time fanout. The server runs ONE parallel query per kind\n * filtered by the same area-lineage match and the same cascade-\n * upward visibility rule, then merges and sorts by `hot` score.\n * - Cursor-based pagination. The cursor is opaque (base64 of\n * `<sortKey>|<_id>`) so we can swap sort algorithms without a\n * breaking change.\n * - LostFound / VoiceBox shapes are pruned to the fields the feed\n * card needs — they keep their richer detail-page shape in their\n * own schemas (lost-found-schema, voice-box-schema if/when those\n * get factored out).\n *\n * @module community-schema/feed\n */\n\nimport { z } from 'zod';\nimport { FEED_PAGE_SIZE } from './constants.js';\nimport { feedSortSchema, visibilityLevelSchema } from './enums.js';\nimport { communityPollFeedItemSchema } from './poll.js';\nimport { communityPostWireSchema, postAuthorSnapshotSchema } from './post.js';\n\n// ─── Per-kind feed envelopes ───────────────────────────────────────────────\n\n/**\n * Lost-and-found item projected into the feed. Mirrors the engagement\n * + author shape every feed card needs, plus a small handful of\n * lost-found-specific fields used by the card.\n */\nexport const lostFoundFeedItemSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('lost_found'),\n author: postAuthorSnapshotSchema,\n\n /** `'lost'` or `'found'` — drives the card chip colour. */\n kind: z.enum(['lost', 'found']),\n title: z.string(),\n description: z.string(),\n /** Single primary image rendered on the card. */\n imageUrl: z.string().url().optional(),\n\n /** Inherited engagement axis — same shape as posts. */\n upvoteCount: z.number().int().nonnegative(),\n commentCount: z.number().int().nonnegative(),\n repostCount: z.number().int().nonnegative(),\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n createdAt: z.string().datetime(),\n\n viewer: z\n .object({\n upvoted: z.boolean(),\n reaction: z.string().nullable(),\n isAuthor: z.boolean(),\n reposted: z.boolean(),\n })\n .optional(),\n});\nexport type LostFoundFeedItem = z.infer<typeof lostFoundFeedItemSchema>;\n\n/**\n * Donated-item listing projected into the feed. Mirrors the engagement\n * + author shape every feed card needs, plus the donate-item-specific\n * fields the card renders (item name, category, condition, status).\n */\nexport const donateItemFeedItemSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('donate_item'),\n author: postAuthorSnapshotSchema,\n\n /** Display name of the item (maps to ReformItemDonation.itemName). */\n itemName: z.string(),\n description: z.string().optional(),\n /** Free-text category (clothing / books / electronics / etc.). */\n category: z.string(),\n /** Free-text condition label (new / good / used / etc.). Optional. */\n condition: z.string().optional(),\n /** First photo if present — used as the card's hero image. */\n imageUrl: z.string().url().optional(),\n /** Donation lifecycle status (pending / verified / picked / etc.) so\n * the card can show an appropriate badge. */\n status: z.string(),\n\n upvoteCount: z.number().int().nonnegative(),\n commentCount: z.number().int().nonnegative(),\n repostCount: z.number().int().nonnegative(),\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n createdAt: z.string().datetime(),\n\n viewer: z\n .object({\n upvoted: z.boolean(),\n reaction: z.string().nullable(),\n isAuthor: z.boolean(),\n reposted: z.boolean(),\n })\n .optional(),\n});\nexport type DonateItemFeedItem = z.infer<typeof donateItemFeedItemSchema>;\n\n/**\n * Voice-box (complaint or suggestion) item projected into the feed.\n */\nexport const voiceBoxFeedItemSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('voice_box'),\n author: postAuthorSnapshotSchema,\n\n /** `'complaint'` or `'suggestion'` — drives the card chip colour. */\n kind: z.enum(['complaint', 'suggestion']),\n title: z.string(),\n description: z.string(),\n\n upvoteCount: z.number().int().nonnegative(),\n commentCount: z.number().int().nonnegative(),\n repostCount: z.number().int().nonnegative(),\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n createdAt: z.string().datetime(),\n\n viewer: z\n .object({\n upvoted: z.boolean(),\n reaction: z.string().nullable(),\n isAuthor: z.boolean(),\n reposted: z.boolean(),\n })\n .optional(),\n});\nexport type VoiceBoxFeedItem = z.infer<typeof voiceBoxFeedItemSchema>;\n\n// ─── Polymorphic union ─────────────────────────────────────────────────────\n\nexport const feedItemSchema = z.discriminatedUnion('contentKind', [\n communityPostWireSchema,\n lostFoundFeedItemSchema,\n voiceBoxFeedItemSchema,\n donateItemFeedItemSchema,\n communityPollFeedItemSchema,\n]);\nexport type FeedItem = z.infer<typeof feedItemSchema>;\n\n// ─── Query + response ──────────────────────────────────────────────────────\n\nexport const feedQueryParamsSchema = z.object({\n /** The viewer's chosen feed level. Cascade-upward semantics apply. */\n level: visibilityLevelSchema,\n /** Sort algorithm. Defaults to `hot` server-side when omitted. */\n sort: feedSortSchema.optional(),\n /** Opaque pagination cursor returned by the previous page. */\n cursor: z.string().optional(),\n /** Page size; defaults to `FEED_PAGE_SIZE` server-side. */\n pageSize: z.number().int().positive().max(50).optional(),\n});\nexport type FeedQueryParams = z.infer<typeof feedQueryParamsSchema>;\n\nexport const feedResponseSchema = z.object({\n items: z.array(feedItemSchema),\n nextCursor: z.string().nullable(),\n});\nexport type FeedResponse = z.infer<typeof feedResponseSchema>;\n\n// Re-export so consumers don't have to also import constants.ts.\nexport { FEED_PAGE_SIZE };\n"]}
package/dist/index.d.ts CHANGED
@@ -17,14 +17,15 @@
17
17
  export { type AreaLineageSnapshot, areaLineageSnapshotSchema, } from './area.js';
18
18
  export { type CommunityCommentWire, type CreateCommentBody, communityCommentWireSchema, createCommentBodySchema, type UpdateCommentBody, updateCommentBodySchema, } from './comment.js';
19
19
  export { AREA_PICKER_LEVEL_VALUES, type AreaPickerItem, type AreaPickerLevel, type AreaPickerQuery, type AreaPickerResponse, areaPickerItemSchema, areaPickerLevelSchema, areaPickerQuerySchema, areaPickerResponseSchema, COMMUNITY_CATEGORY_VALUES, COMMUNITY_DESIGNATION_PRESETS, COMMUNITY_DISCOVER_SORT_VALUES, COMMUNITY_MEMBERSHIP_STATUS_VALUES, COMMUNITY_REACH_VALUES, COMMUNITY_ROLE_VALUES, COMMUNITY_TAG_VALUES, COMMUNITY_TYPE_VALUES, COMMUNITY_VERIFIED_SCOPE_VALUES, type CommunityCategory, type CommunityCenterCoords, type CommunityDesignation, type CommunityDesignationPreset, type CommunityDiscoverSort, type CommunityListQuery, type CommunityListResponse, type CommunityMembershipStatus, type CommunityMembersListResponse, type CommunityMemberWire, type CommunityReach, type CommunityRole, type CommunityTag, type CommunityType, type CommunityVerifiedScope, type CommunityWire, type CreateCommunityBody, communityCategorySchema, communityCenterCoordsSchema, communityDesignationPresetSchema, communityDesignationSchema, communityDiscoverSortSchema, communityListQuerySchema, communityListResponseSchema, communityMembershipStatusSchema, communityMembersListResponseSchema, communityMemberWireSchema, communityReachSchema, communityRoleSchema, communityTagSchema, communityTypeSchema, communityVerifiedScopeSchema, communityWireSchema, createCommunityBodySchema, type JoinCommunityResponse, joinCommunityResponseSchema, type SetMemberDesignationBody, setMemberDesignationBodySchema, type UpdateCommunityBody, type UpdateMemberRoleBody, updateCommunityBodySchema, updateMemberRoleBodySchema, type VerifyCommunityBody, verifyCommunityBodySchema, } from './community.js';
20
- export { COMMENT_MAX_BODY_CHARS, COMMENTS_PAGE_SIZE, COMMUNITIES_PAGE_SIZE, COMMUNITY_DESCRIPTION_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS, COMMUNITY_DESIGNATION_CUSTOM_PATTERN, COMMUNITY_HYPERLOCAL_RADIUS_KM, COMMUNITY_MAX_TAGS, COMMUNITY_MEMBERS_PAGE_SIZE, COMMUNITY_NAME_MAX_CHARS, COMMUNITY_NAME_MIN_CHARS, COMMUNITY_SLUG_MAX_CHARS, COMMUNITY_SLUG_MIN_CHARS, COMMUNITY_SLUG_PATTERN, EDIT_GRACE_WINDOW_MS, FEED_PAGE_SIZE, GROUP_MAX_MEMBERS, GROUP_NAME_MAX_CHARS, GROUP_NAME_MIN_CHARS, PEOPLE_PAGE_SIZE, POST_MAX_BODY_CHARS, POST_MAX_IMAGE_BYTES, POST_MAX_IMAGES, POST_MAX_VIDEO_BYTES, POST_MAX_VIDEO_SECONDS, POST_MAX_VIDEOS, PROFILE_MAX_BIO_CHARS, REPLIES_PRELOAD_COUNT, } from './constants.js';
20
+ export { COMMENT_MAX_BODY_CHARS, COMMENTS_PAGE_SIZE, COMMUNITIES_PAGE_SIZE, COMMUNITY_DESCRIPTION_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS, COMMUNITY_DESIGNATION_CUSTOM_PATTERN, COMMUNITY_HYPERLOCAL_RADIUS_KM, COMMUNITY_MAX_TAGS, COMMUNITY_MEMBERS_PAGE_SIZE, COMMUNITY_NAME_MAX_CHARS, COMMUNITY_NAME_MIN_CHARS, COMMUNITY_SLUG_MAX_CHARS, COMMUNITY_SLUG_MIN_CHARS, COMMUNITY_SLUG_PATTERN, EDIT_GRACE_WINDOW_MS, FEED_PAGE_SIZE, GROUP_MAX_MEMBERS, GROUP_NAME_MAX_CHARS, GROUP_NAME_MIN_CHARS, PEOPLE_PAGE_SIZE, POLL_DURATION_PRESETS_MS, POLL_MAX_DURATION_MS, POLL_MAX_OPTIONS, POLL_MIN_DURATION_MS, POLL_MIN_OPTIONS, POLL_OPTION_MAX_CHARS, POLL_OPTION_MIN_CHARS, POLL_QUESTION_MAX_CHARS, POLL_QUESTION_MIN_CHARS, POLLS_PAGE_SIZE, POST_MAX_BODY_CHARS, POST_MAX_IMAGE_BYTES, POST_MAX_IMAGES, POST_MAX_VIDEO_BYTES, POST_MAX_VIDEO_SECONDS, POST_MAX_VIDEOS, PROFILE_MAX_BIO_CHARS, REPLIES_PRELOAD_COUNT, } from './constants.js';
21
21
  export { type SetReactionBody, type SetReactionResponse, setReactionBodySchema, setReactionResponseSchema, type ToggleUpvoteResponse, toggleUpvoteResponseSchema, } from './engagement.js';
22
22
  export { CONTENT_KIND_VALUES, type ContentKind, contentKindSchema, FEED_SORT_VALUES, type FeedSort, feedSortSchema, PROFILE_PRIVACY_VALUES, type ProfilePrivacy, profilePrivacySchema, REACTION_TYPE_VALUES, REPORT_REASON_VALUES, REPORT_STATUS_VALUES, type ReactionType, type ReportReason, type ReportStatus, reactionTypeSchema, reportReasonSchema, reportStatusSchema, VISIBILITY_LEVEL_RANK, VISIBILITY_LEVEL_VALUES, type VisibilityLevel, visibilityLevelSchema, } from './enums.js';
23
23
  export { type DonateItemFeedItem, donateItemFeedItemSchema, type FeedItem, type FeedQueryParams, type FeedResponse, feedItemSchema, feedQueryParamsSchema, feedResponseSchema, type LostFoundFeedItem, lostFoundFeedItemSchema, type VoiceBoxFeedItem, voiceBoxFeedItemSchema, } from './feed.js';
24
24
  export { type AddGroupMembersBody, addGroupMembersBodySchema, type CommunityGroupWire, type CommunityGroupWithMembers, type CreateGroupBody, communityGroupWireSchema, communityGroupWithMembersSchema, createGroupBodySchema, type GroupMembersListResponse, type GroupMemberWire, type GroupRole, type GroupsListResponse, groupMembersListResponseSchema, groupMemberWireSchema, groupRoleSchema, groupsListResponseSchema, type UpdateGroupBody, updateGroupBodySchema, } from './group.js';
25
25
  export { type PostImage, type PostVideo, postImageSchema, postVideoSchema, } from './media.js';
26
+ export { type CastVoteBody, type CommunityPollFeedItem, type CommunityPollWire, type CreatePollBody, castVoteBodySchema, communityPollFeedItemSchema, communityPollWireSchema, createPollBodySchema, POLL_RESULTS_VISIBILITY_VALUES, type PollOptionInput, type PollOptionWire, type PollResultsVisibility, pollOptionInputSchema, pollOptionWireSchema, pollResultsVisibilitySchema, type VoteResponse, voteResponseSchema, } from './poll.js';
26
27
  export { type CommunityPostWire, type CreatePostBody, communityPostWireSchema, createPostBodySchema, type PostAuthorSnapshot, postAuthorSnapshotSchema, type RepostedSource, repostedSourceSchema, type UpdatePostBody, updatePostBodySchema, } from './post.js';
27
- export { type PeopleListItem, type PeopleListResponse, type PeopleQueryParams, type ProfileMutuals, type PublicProfileWire, peopleListItemSchema, peopleListResponseSchema, peopleQueryParamsSchema, profileMutualsSchema, publicProfileWireSchema, } from './profile.js';
28
+ export { PEOPLE_LIST_FILTER_DEFAULT, PEOPLE_LIST_FILTER_VALUES, type PeopleListFilter, type PeopleListItem, type PeopleListResponse, type PeopleQueryParams, type ProfileMutuals, type PublicProfileWire, peopleListFilterSchema, peopleListItemSchema, peopleListResponseSchema, peopleQueryParamsSchema, profileMutualsSchema, publicProfileWireSchema, } from './profile.js';
28
29
  export { type ReportContentBody, type ReportContentKind, type ReportRecordWire, type ReportSubmissionResponse, type ReportUserBody, reportContentBodySchema, reportContentKindSchema, reportRecordWireSchema, reportSubmissionResponseSchema, reportUserBodySchema, } from './report.js';
29
30
  export { type CreateRepostBody, type CreateRepostResponse, createRepostBodySchema, createRepostResponseSchema, } from './repost.js';
30
31
  export { type BlockedUsersListResponse, type BlockedUserWire, blockedUsersListResponseSchema, blockedUserWireSchema, COMMUNITY_SETTINGS_DEFAULTS, type CommunitySettingsWire, communitySettingsWireSchema, type UpdateCommunitySettingsBody, updateCommunitySettingsBodySchema, } from './settings.js';
@@ -1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AAsB,EACtB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,8BAA8B,EAC9B,qBAAqB,EACrB,2BAA2B,EAC3B,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,KAAK,2BAA2B,EAChC,iCAAiC,GAClC,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,KAAK,iBAAiB,EACtB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAC5B,KAAK,QAAQ,EACb,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,cAAc,EACd,+BAA+B,GAChC,MAAM,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -21,7 +21,7 @@ export { communityCommentWireSchema, createCommentBodySchema, updateCommentBodyS
21
21
  // ─── Communities ───────────────────────────────────────────────────────────
22
22
  export { AREA_PICKER_LEVEL_VALUES, areaPickerItemSchema, areaPickerLevelSchema, areaPickerQuerySchema, areaPickerResponseSchema, COMMUNITY_CATEGORY_VALUES, COMMUNITY_DESIGNATION_PRESETS, COMMUNITY_DISCOVER_SORT_VALUES, COMMUNITY_MEMBERSHIP_STATUS_VALUES, COMMUNITY_REACH_VALUES, COMMUNITY_ROLE_VALUES, COMMUNITY_TAG_VALUES, COMMUNITY_TYPE_VALUES, COMMUNITY_VERIFIED_SCOPE_VALUES, communityCategorySchema, communityCenterCoordsSchema, communityDesignationPresetSchema, communityDesignationSchema, communityDiscoverSortSchema, communityListQuerySchema, communityListResponseSchema, communityMembershipStatusSchema, communityMembersListResponseSchema, communityMemberWireSchema, communityReachSchema, communityRoleSchema, communityTagSchema, communityTypeSchema, communityVerifiedScopeSchema, communityWireSchema, createCommunityBodySchema, joinCommunityResponseSchema, setMemberDesignationBodySchema, updateCommunityBodySchema, updateMemberRoleBodySchema, verifyCommunityBodySchema, } from './community.js';
23
23
  // ─── Constants ─────────────────────────────────────────────────────────────
24
- export { COMMENT_MAX_BODY_CHARS, COMMENTS_PAGE_SIZE, COMMUNITIES_PAGE_SIZE, COMMUNITY_DESCRIPTION_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS, COMMUNITY_DESIGNATION_CUSTOM_PATTERN, COMMUNITY_HYPERLOCAL_RADIUS_KM, COMMUNITY_MAX_TAGS, COMMUNITY_MEMBERS_PAGE_SIZE, COMMUNITY_NAME_MAX_CHARS, COMMUNITY_NAME_MIN_CHARS, COMMUNITY_SLUG_MAX_CHARS, COMMUNITY_SLUG_MIN_CHARS, COMMUNITY_SLUG_PATTERN, EDIT_GRACE_WINDOW_MS, FEED_PAGE_SIZE, GROUP_MAX_MEMBERS, GROUP_NAME_MAX_CHARS, GROUP_NAME_MIN_CHARS, PEOPLE_PAGE_SIZE, POST_MAX_BODY_CHARS, POST_MAX_IMAGE_BYTES, POST_MAX_IMAGES, POST_MAX_VIDEO_BYTES, POST_MAX_VIDEO_SECONDS, POST_MAX_VIDEOS, PROFILE_MAX_BIO_CHARS, REPLIES_PRELOAD_COUNT, } from './constants.js';
24
+ export { COMMENT_MAX_BODY_CHARS, COMMENTS_PAGE_SIZE, COMMUNITIES_PAGE_SIZE, COMMUNITY_DESCRIPTION_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS, COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS, COMMUNITY_DESIGNATION_CUSTOM_PATTERN, COMMUNITY_HYPERLOCAL_RADIUS_KM, COMMUNITY_MAX_TAGS, COMMUNITY_MEMBERS_PAGE_SIZE, COMMUNITY_NAME_MAX_CHARS, COMMUNITY_NAME_MIN_CHARS, COMMUNITY_SLUG_MAX_CHARS, COMMUNITY_SLUG_MIN_CHARS, COMMUNITY_SLUG_PATTERN, EDIT_GRACE_WINDOW_MS, FEED_PAGE_SIZE, GROUP_MAX_MEMBERS, GROUP_NAME_MAX_CHARS, GROUP_NAME_MIN_CHARS, PEOPLE_PAGE_SIZE, POLL_DURATION_PRESETS_MS, POLL_MAX_DURATION_MS, POLL_MAX_OPTIONS, POLL_MIN_DURATION_MS, POLL_MIN_OPTIONS, POLL_OPTION_MAX_CHARS, POLL_OPTION_MIN_CHARS, POLL_QUESTION_MAX_CHARS, POLL_QUESTION_MIN_CHARS, POLLS_PAGE_SIZE, POST_MAX_BODY_CHARS, POST_MAX_IMAGE_BYTES, POST_MAX_IMAGES, POST_MAX_VIDEO_BYTES, POST_MAX_VIDEO_SECONDS, POST_MAX_VIDEOS, PROFILE_MAX_BIO_CHARS, REPLIES_PRELOAD_COUNT, } from './constants.js';
25
25
  // ─── Engagement (upvote + reactions) ───────────────────────────────────────
26
26
  export { setReactionBodySchema, setReactionResponseSchema, toggleUpvoteResponseSchema, } from './engagement.js';
27
27
  // ─── Enums ─────────────────────────────────────────────────────────────────
@@ -32,10 +32,12 @@ export { donateItemFeedItemSchema, feedItemSchema, feedQueryParamsSchema, feedRe
32
32
  export { addGroupMembersBodySchema, communityGroupWireSchema, communityGroupWithMembersSchema, createGroupBodySchema, groupMembersListResponseSchema, groupMemberWireSchema, groupRoleSchema, groupsListResponseSchema, updateGroupBodySchema, } from './group.js';
33
33
  // ─── Media ─────────────────────────────────────────────────────────────────
34
34
  export { postImageSchema, postVideoSchema, } from './media.js';
35
+ // ─── Poll ──────────────────────────────────────────────────────────────────
36
+ export { castVoteBodySchema, communityPollFeedItemSchema, communityPollWireSchema, createPollBodySchema, POLL_RESULTS_VISIBILITY_VALUES, pollOptionInputSchema, pollOptionWireSchema, pollResultsVisibilitySchema, voteResponseSchema, } from './poll.js';
35
37
  // ─── Post ──────────────────────────────────────────────────────────────────
36
38
  export { communityPostWireSchema, createPostBodySchema, postAuthorSnapshotSchema, repostedSourceSchema, updatePostBodySchema, } from './post.js';
37
39
  // ─── Profile + People list ─────────────────────────────────────────────────
38
- export { peopleListItemSchema, peopleListResponseSchema, peopleQueryParamsSchema, profileMutualsSchema, publicProfileWireSchema, } from './profile.js';
40
+ export { PEOPLE_LIST_FILTER_DEFAULT, PEOPLE_LIST_FILTER_VALUES, peopleListFilterSchema, peopleListItemSchema, peopleListResponseSchema, peopleQueryParamsSchema, profileMutualsSchema, publicProfileWireSchema, } from './profile.js';
39
41
  // ─── Reports (moderation) ──────────────────────────────────────────────────
40
42
  export { reportContentBodySchema, reportContentKindSchema, reportRecordWireSchema, reportSubmissionResponseSchema, reportUserBodySchema, } from './report.js';
41
43
  // ─── Repost (quote / amplify) ──────────────────────────────────────────────