jansathi-community-schema 0.11.0 → 0.12.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 +25 -0
- package/dist/comment.d.ts.map +1 -1
- package/dist/community.d.ts.map +1 -1
- package/dist/community.js +6 -2
- package/dist/community.js.map +1 -1
- package/dist/feed.d.ts +325 -0
- package/dist/feed.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/post.d.ts +100 -0
- package/dist/post.d.ts.map +1 -1
- package/dist/post.js +17 -0
- package/dist/post.js.map +1 -1
- package/dist/repost.d.ts +50 -0
- package/dist/repost.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/comment.d.ts
CHANGED
|
@@ -29,6 +29,31 @@ export declare const communityCommentWireSchema: z.ZodObject<{
|
|
|
29
29
|
displayName: z.ZodString;
|
|
30
30
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
31
31
|
localName: z.ZodOptional<z.ZodString>;
|
|
32
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
33
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
34
|
+
volunteer: "volunteer";
|
|
35
|
+
chairman: "chairman";
|
|
36
|
+
vice_chairman: "vice_chairman";
|
|
37
|
+
president: "president";
|
|
38
|
+
vice_president: "vice_president";
|
|
39
|
+
secretary: "secretary";
|
|
40
|
+
joint_secretary: "joint_secretary";
|
|
41
|
+
general_secretary: "general_secretary";
|
|
42
|
+
treasurer: "treasurer";
|
|
43
|
+
joint_treasurer: "joint_treasurer";
|
|
44
|
+
organizer: "organizer";
|
|
45
|
+
coordinator: "coordinator";
|
|
46
|
+
spokesperson: "spokesperson";
|
|
47
|
+
founder: "founder";
|
|
48
|
+
co_founder: "co_founder";
|
|
49
|
+
patron: "patron";
|
|
50
|
+
advisor: "advisor";
|
|
51
|
+
mentor: "mentor";
|
|
52
|
+
committee_member: "committee_member";
|
|
53
|
+
member_at_large: "member_at_large";
|
|
54
|
+
}>>;
|
|
55
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>>>;
|
|
32
57
|
}, z.core.$strip>;
|
|
33
58
|
text: z.ZodString;
|
|
34
59
|
upvoteCount: z.ZodNumber;
|
package/dist/comment.d.ts.map
CHANGED
|
@@ -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
|
|
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"}
|
package/dist/community.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../src/community.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,CAA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KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAI9E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;iBAYvC,CAAC;AACL,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAItF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;iBAKpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAI5E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB,yCAA0C,CAAC;AAChF,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AACxE,eAAO,MAAM,qBAAqB;;;;EAAmC,CAAC;AAEtE,eAAO,MAAM,qBAAqB;;;;;;;;iBAKhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,oBAAoB;;;;;;;;;iBAK/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,wBAAwB;;;;;;;;;;;iBAEnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
package/dist/community.js
CHANGED
|
@@ -325,7 +325,9 @@ export const communityDesignationSchema = z
|
|
|
325
325
|
preset: communityDesignationPresetSchema.nullable(),
|
|
326
326
|
custom: z.string().nullable(),
|
|
327
327
|
})
|
|
328
|
-
.refine((d) => (d.preset == null) !== (d.custom == null), {
|
|
328
|
+
.refine((d) => (d.preset == null) !== (d.custom == null), {
|
|
329
|
+
message: 'Designation must have exactly one of `preset` or `custom` set.',
|
|
330
|
+
});
|
|
329
331
|
/**
|
|
330
332
|
* Latitude / longitude pair used for hyperlocal (`reach=neighborhood`)
|
|
331
333
|
* communities. Stored at create time from either the picked area's
|
|
@@ -586,7 +588,9 @@ export const setMemberDesignationBodySchema = z
|
|
|
586
588
|
.regex(COMMUNITY_DESIGNATION_CUSTOM_PATTERN)
|
|
587
589
|
.optional(),
|
|
588
590
|
})
|
|
589
|
-
.refine((b) => (b.preset != null) !== (b.custom != null), {
|
|
591
|
+
.refine((b) => (b.preset != null) !== (b.custom != null), {
|
|
592
|
+
message: 'Provide exactly one of `preset` or `custom`.',
|
|
593
|
+
});
|
|
590
594
|
// ─── Verification (state+ leader vouch) ────────────────────────────────────
|
|
591
595
|
/**
|
|
592
596
|
* Body for `POST /communities/:slug/verify`. Empty for now; the
|
package/dist/community.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"community.js","sourceRoot":"","sources":["../src/community.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,sCAAsC,EACtC,sCAAsC,EACtC,oCAAoC,EACpC,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAExB,+EAA+E;AAE/E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,CAAU,CAAC;AAElF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAEjE;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,cAAc;IACd,MAAM;IACN,OA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AQ,EAAE;CACrC,CAAC,CAAC;AAGH,8EAA8E;AAE9E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAEhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,qBAAqB;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,kEAAkE;IAClE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,qBAAqB;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC;CACrC,CAAC,CAAC","sourcesContent":["/**\n * Topical Community wire shapes.\n *\n * A Community is a Reddit-subreddit / Facebook-group style surface: a\n * named topic users can discover, join, and post into. Distinct from\n * the user-created `Group` (chat-bound, small, private) — each\n * Community auto-owns its own bound `Group` (so members get a\n * Community chat room for free) but they're conceptually different\n * objects with their own roster + permissions.\n *\n * Visibility model\n * ----------------\n * - `public` — anyone can join one-tap; posts are visible to all\n * viewers in the community feed.\n * - `private` — joining requires owner / admin approval; posts and\n * member list are hidden from non-members. Discovery\n * still lists the community card (name + description +\n * member count + join button) so users can request to\n * join.\n *\n * Posts inside a community do NOT participate in the geo cascade —\n * they live and die inside the community surface. Posts authored\n * from the global composer continue to flow through the geo\n * area-proximity cascade ranked by `tierBoost` (see\n * `reform-backend/src/services/community/services/visibility.service.ts`).\n *\n * @module community-schema/community\n */\n\nimport { z } from 'zod';\nimport { areaLineageSnapshotSchema } from './area.js';\nimport {\n COMMUNITIES_PAGE_SIZE,\n COMMUNITY_DESCRIPTION_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_PATTERN,\n COMMUNITY_MAX_TAGS,\n COMMUNITY_NAME_MAX_CHARS,\n COMMUNITY_NAME_MIN_CHARS,\n COMMUNITY_SLUG_MAX_CHARS,\n COMMUNITY_SLUG_MIN_CHARS,\n COMMUNITY_SLUG_PATTERN,\n} from './constants.js';\n\n// ─── Enums ──────────────────────────────────────────────────────────────────\n\n/**\n * public — anyone can read + post.\n * restricted — anyone can read; only approved members can post. The\n * middle option Reddit added so communities can be open\n * to browse but moderated on the write side.\n * private — only approved members can read or post. The roster\n * + post bodies are hidden from non-members.\n */\nexport const COMMUNITY_TYPE_VALUES = ['public', 'restricted', 'private'] as const;\nexport type CommunityType = (typeof COMMUNITY_TYPE_VALUES)[number];\nexport const communityTypeSchema = z.enum(COMMUNITY_TYPE_VALUES);\n\n/**\n * Geographic scope a community claims. Maps onto the existing\n * area-lineage tiers so discovery can match a viewer's `areaLineage`\n * one tier at a time.\n *\n * neighborhood — hyperlocal; carries `areaLineage.localId` +\n * `centerCoords`. Discovery uses the 5 km radius from\n * `COMMUNITY_HYPERLOCAL_RADIUS_KM`.\n * city — district-scoped; carries `areaLineage.districtId`.\n * state — carries `areaLineage.stateId`.\n * national — carries `areaLineage.countryId`.\n * global — area-agnostic; `areaLineage` is null.\n */\nexport const COMMUNITY_REACH_VALUES = [\n 'neighborhood',\n 'city',\n 'state',\n 'national',\n 'global',\n] as const;\nexport type CommunityReach = (typeof COMMUNITY_REACH_VALUES)[number];\nexport const communityReachSchema = z.enum(COMMUNITY_REACH_VALUES);\n\n/**\n * Verification scope on a verified community — which leader-tier\n * vouched for it.\n *\n * state — a state-level leader verified within their own state.\n * national — a national-level leader (or higher).\n * global — a global / platform-level leader.\n */\nexport const COMMUNITY_VERIFIED_SCOPE_VALUES = ['state', 'national', 'global'] as const;\nexport type CommunityVerifiedScope = (typeof COMMUNITY_VERIFIED_SCOPE_VALUES)[number];\nexport const communityVerifiedScopeSchema = z.enum(COMMUNITY_VERIFIED_SCOPE_VALUES);\n\n/**\n * Curated category enum. Slugs are **stable English keys** (snake_case);\n * the visible label is i18n'd on the frontend (en/hi message files).\n * Never store culturally-specific or transliterated names here — the\n * locale layer owns presentation.\n *\n * First 12 slugs are weighted toward the Indian civic / hyperlocal\n * context that Jansathi serves (Women's / Men's / Youth groups, RWA,\n * Social Welfare, Civic Reform). Remaining 30 are general-interest\n * categories adapted from Reddit's curated topic set + Facebook\n * Groups' top discovery categories.\n *\n * See `docs/community-create-v2.md` §2 in the jansathi-frontend repo\n * for the full label table.\n */\nexport const COMMUNITY_CATEGORY_VALUES = [\n // Indian civic / community (12)\n 'womens_group',\n 'mens_group',\n 'youth_group',\n 'senior_citizens',\n 'parenting_children',\n 'resident_welfare',\n 'social_welfare',\n 'social_awareness',\n 'volunteering',\n 'civic_reform',\n 'local_news_issues',\n 'environment',\n // Faith & culture (3)\n 'religion_spirituality',\n 'festivals_culture',\n 'devotional',\n // Education (4)\n 'education',\n 'competitive_exams',\n 'books_literature',\n 'language_learning',\n // Health & wellness (4)\n 'health_wellness',\n 'yoga_meditation',\n 'fitness',\n 'mental_health',\n // Lifestyle (4)\n 'food_cooking',\n 'travel',\n 'photography',\n 'fashion_beauty',\n // Sports & arts (5)\n 'sports',\n 'cricket',\n 'arts_crafts',\n 'music',\n 'dance',\n // Entertainment (3)\n 'movies_tv',\n 'gaming',\n 'entertainment',\n // Professional (5)\n 'business_career',\n 'entrepreneurship',\n 'technology',\n 'finance_investing',\n 'agriculture',\n // Information (1) + fallback (1)\n 'news_current_affairs',\n 'other',\n] as const;\nexport type CommunityCategory = (typeof COMMUNITY_CATEGORY_VALUES)[number];\nexport const communityCategorySchema = z.enum(COMMUNITY_CATEGORY_VALUES);\n\n/**\n * Curated tag enum. A community picks 0–`COMMUNITY_MAX_TAGS` from\n * this list. Tags are stable English snake_case slugs; the visible\n * label is i18n'd. The tag picker UI groups them by theme via a\n * separate theme-map on the frontend; the stored enum is flat.\n *\n * Total: 112 tags spanning civic, health, education, sports, food,\n * arts/music/faith, business/tech, local issues, and lifestyle.\n */\nexport const COMMUNITY_TAG_VALUES = [\n // Civic & social (24)\n 'volunteer',\n 'donation_drive',\n 'blood_donation',\n 'anti_corruption',\n 'women_safety',\n 'child_safety',\n 'senior_care',\n 'disability_support',\n 'lgbtq_support',\n 'environment',\n 'cleanliness',\n 'plant_trees',\n 'waste_management',\n 'legal_aid',\n 'rti',\n 'voter_awareness',\n 'government_schemes',\n 'ngo',\n 'charity',\n 'relief_work',\n 'public_service',\n 'fundraising',\n 'awareness_campaign',\n 'social_justice',\n // Health & wellness (14)\n 'yoga',\n 'meditation',\n 'fitness',\n 'running',\n 'cycling',\n 'walking',\n 'nutrition',\n 'mental_health',\n 'ayurveda',\n 'weight_loss',\n 'womens_health',\n 'mens_health',\n 'dental_health',\n 'eye_care',\n // Education (16)\n 'jee',\n 'neet',\n 'upsc',\n 'ssc',\n 'ielts',\n 'school_support',\n 'college_support',\n 'scholarship',\n 'career_guidance',\n 'coding',\n 'mathematics',\n 'science',\n 'languages',\n 'spoken_english',\n 'tutoring',\n 'study_abroad',\n // Sports (9)\n 'cricket',\n 'football',\n 'badminton',\n 'tennis',\n 'kabaddi',\n 'hockey',\n 'chess',\n 'swimming',\n 'marathon',\n // Food (10)\n 'street_food',\n 'home_cooking',\n 'vegetarian',\n 'vegan',\n 'jain_food',\n 'fasting_recipes',\n 'north_indian',\n 'south_indian',\n 'baking',\n 'desserts',\n // Arts, music, faith (14)\n 'classical_music',\n 'hindustani',\n 'carnatic',\n 'bhajan',\n 'kirtan',\n 'bollywood',\n 'dance_classical',\n 'dance_folk',\n 'painting',\n 'photography',\n 'craft',\n 'satsang',\n 'festivals',\n 'pilgrimage',\n // Business & tech (11)\n 'entrepreneurship',\n 'startup',\n 'small_business',\n 'freelancing',\n 'real_estate',\n 'stocks_investing',\n 'mutual_funds',\n 'agriculture',\n 'handicrafts',\n 'job_postings',\n 'web_development',\n // Local issues (9)\n 'water_supply',\n 'electricity',\n 'road_repair',\n 'garbage_collection',\n 'drainage',\n 'public_transport',\n 'traffic',\n 'parking',\n 'local_healthcare',\n // Lifestyle (5)\n 'movies',\n 'tv_shows',\n 'books_club',\n 'trekking',\n 'parenting',\n] as const;\nexport type CommunityTag = (typeof COMMUNITY_TAG_VALUES)[number];\nexport const communityTagSchema = z.enum(COMMUNITY_TAG_VALUES);\n\n/**\n * Preset designation labels — purely **representation** (not\n * permission-bearing). Renders in brackets after a member's display\n * name in a community context (e.g., \"Hari Joshi (Chairman) · 12h ago\").\n *\n * Permission still flows through `CommunityRole` (owner / admin /\n * member). A designation does NOT promote or restrict anything.\n *\n * Per-community: Hari can be \"Chairman\" in one community and\n * \"Member-at-Large\" in another. Custom designations (free text)\n * cover the long tail; presets are surfaced first in the picker.\n */\nexport const COMMUNITY_DESIGNATION_PRESETS = [\n 'chairman',\n 'vice_chairman',\n 'president',\n 'vice_president',\n 'secretary',\n 'joint_secretary',\n 'general_secretary',\n 'treasurer',\n 'joint_treasurer',\n 'organizer',\n 'coordinator',\n 'spokesperson',\n 'founder',\n 'co_founder',\n 'patron',\n 'advisor',\n 'mentor',\n 'committee_member',\n 'member_at_large',\n 'volunteer',\n] as const;\nexport type CommunityDesignationPreset = (typeof COMMUNITY_DESIGNATION_PRESETS)[number];\nexport const communityDesignationPresetSchema = z.enum(COMMUNITY_DESIGNATION_PRESETS);\n\n/**\n * Designation stored on a `CommunityMembership`. Exactly one of\n * `preset` / `custom` is non-null when a designation is set.\n *\n * { preset: 'chairman', custom: null } — picked from the preset enum.\n * { preset: null, custom: 'Press & Media' } — free text.\n * null — no designation.\n *\n * The picker UI surfaces the preset list first; the custom path is\n * for niche labels that don't fit a preset. Validation enforces\n * exactly-one via a refinement.\n */\nexport const communityDesignationSchema = z\n .object({\n preset: communityDesignationPresetSchema.nullable(),\n custom: z.string().nullable(),\n })\n .refine(\n (d) => (d.preset == null) !== (d.custom == null),\n { message: 'Designation must have exactly one of `preset` or `custom` set.' },\n );\nexport type CommunityDesignation = z.infer<typeof communityDesignationSchema>;\n\n/**\n * Latitude / longitude pair used for hyperlocal (`reach=neighborhood`)\n * communities. Stored at create time from either the picked area's\n * centroid (if the Area carries coordinates) or the creator's current\n * GPS as a fallback. Indexed 2dsphere on the backend; powers the\n * `$nearSphere` query inside the `?nearMe=true` listing filter.\n */\nexport const communityCenterCoordsSchema = z.object({\n lat: z.number().min(-90).max(90),\n lng: z.number().min(-180).max(180),\n});\nexport type CommunityCenterCoords = z.infer<typeof communityCenterCoordsSchema>;\n\n/** Role hierarchy within a single community.\n *\n * owner — creator; cannot be demoted by anyone, can transfer\n * ownership (deferred for v1) and delete the community.\n * admin — granted by owner; can edit metadata, kick members,\n * soft-delete posts authored in the community.\n * member — joined; can post and comment, can leave at any time.\n */\nexport const COMMUNITY_ROLE_VALUES = ['owner', 'admin', 'member'] as const;\nexport type CommunityRole = (typeof COMMUNITY_ROLE_VALUES)[number];\nexport const communityRoleSchema = z.enum(COMMUNITY_ROLE_VALUES);\n\n/** Membership lifecycle.\n *\n * active — currently in the community.\n * pending — for a `private` community: the join request is awaiting\n * owner/admin approval. Pending rows aren't counted toward\n * `memberCount` and the user can't post yet.\n */\nexport const COMMUNITY_MEMBERSHIP_STATUS_VALUES = ['active', 'pending'] as const;\nexport type CommunityMembershipStatus = (typeof COMMUNITY_MEMBERSHIP_STATUS_VALUES)[number];\nexport const communityMembershipStatusSchema = z.enum(COMMUNITY_MEMBERSHIP_STATUS_VALUES);\n\n// ─── Wire shape ─────────────────────────────────────────────────────────────\n\n/**\n * `GET /communities/:slug` / discovery card / search hit.\n *\n * `viewer` is included when the request is authenticated. It carries\n * the viewer's role + membership status so the UI can render the\n * right CTA (Join / Joined / Pending / Owner) without a follow-up\n * round trip.\n */\nexport const communityWireSchema = z.object({\n _id: z.string(),\n slug: z.string(),\n name: z.string().min(COMMUNITY_NAME_MIN_CHARS).max(COMMUNITY_NAME_MAX_CHARS),\n description: z.string().max(COMMUNITY_DESCRIPTION_MAX_CHARS).optional(),\n type: communityTypeSchema,\n coverImageUrl: z.string().url().optional(),\n ownerUserId: z.string(),\n /** Active members only. Pending join-requests don't count. */\n memberCount: z.number().int().nonnegative(),\n /** Denormalised post count. Increments on create, decrements on\n * soft-delete. */\n postCount: z.number().int().nonnegative(),\n /** Bound chat-group id. Auto-created when the Community is created;\n * members are added to both rosters in lockstep. */\n groupId: z.string(),\n createdAt: z.string().datetime(),\n\n // ─── v2 taxonomy + reach + verification ─────────────────────────────\n /** Curated subject category. Single source of truth in\n * `COMMUNITY_CATEGORY_VALUES`; visible label is i18n'd. */\n category: communityCategorySchema,\n /** Geographic scope. Drives discovery filtering and is the reason\n * `areaLineage` / `centerCoords` may be present. */\n reach: communityReachSchema,\n /** Up to `COMMUNITY_MAX_TAGS` (10) tags from the curated enum. */\n tags: z.array(communityTagSchema),\n /** Mature (18+) flag. Content-gates the surface (blur previews,\n * age-confirm) once the gate UI ships; the field is persisted\n * from create-time so the mature designation is permanent. */\n mature: z.boolean(),\n /** Area snapshot — present when `reach !== 'global'`. Mirrors the\n * post-area lineage pattern; written once at create time and\n * immutable thereafter. */\n areaLineage: areaLineageSnapshotSchema.nullable(),\n /** Lat/lng pair — present when `reach === 'neighborhood'`. Powers\n * the `?nearMe=true` 5 km geospatial filter on discovery. */\n centerCoords: communityCenterCoordsSchema.nullable(),\n /** ISO timestamp set by a state+ leader when verifying the\n * community. Null until verified; clearing reverts to null. */\n verifiedAt: z.string().datetime().nullable(),\n /** UserId of the leader who verified. */\n verifiedBy: z.string().nullable(),\n /** Which leader tier vouched — drives the badge tooltip (\"verified\n * by a state leader\" vs \"by a national leader\"). */\n verifiedScope: communityVerifiedScopeSchema.nullable(),\n\n viewer: z\n .object({\n role: communityRoleSchema.nullable(),\n status: communityMembershipStatusSchema.nullable(),\n joinedAt: z.string().datetime().nullable(),\n /** Viewer's designation in THIS community. Null when the\n * viewer is not a member or has no designation set. Returned\n * at the wire level (vs the roster level) so post-cards and\n * the byline can render `(Chairman)` without a separate\n * roster lookup. */\n designation: communityDesignationSchema.nullable(),\n })\n .optional(),\n});\nexport type CommunityWire = z.infer<typeof communityWireSchema>;\n\n// ─── Member roster row ──────────────────────────────────────────────────────\n\nexport const communityMemberWireSchema = z.object({\n userId: z.string(),\n displayName: z.string(),\n avatarUrl: z.string().url().optional(),\n localName: z.string().optional(),\n role: communityRoleSchema,\n status: communityMembershipStatusSchema,\n joinedAt: z.string().datetime(),\n /** Per-community representation label. See\n * `communityDesignationSchema` — null when none set. */\n designation: communityDesignationSchema.nullable(),\n});\nexport type CommunityMemberWire = z.infer<typeof communityMemberWireSchema>;\n\n// ─── Create body ────────────────────────────────────────────────────────────\n\n/**\n * `POST /communities` body. `slug` is optional — when omitted the\n * backend auto-generates one from the name (lowercased, hyphenated,\n * collision-suffixed). When provided it must match the slug pattern\n * and be unique.\n *\n * `areaId` is required when `reach !== 'global'` — it's the deepest-\n * matching area-entity id (`localId` for neighborhood, `districtId`\n * for city, etc.) the creator picked from the area picker. The\n * backend resolves the full `areaLineage` snapshot from this id.\n */\nexport const createCommunityBodySchema = z\n .object({\n name: z.string().min(COMMUNITY_NAME_MIN_CHARS).max(COMMUNITY_NAME_MAX_CHARS),\n slug: z\n .string()\n .min(COMMUNITY_SLUG_MIN_CHARS)\n .max(COMMUNITY_SLUG_MAX_CHARS)\n .regex(COMMUNITY_SLUG_PATTERN)\n .optional(),\n description: z.string().max(COMMUNITY_DESCRIPTION_MAX_CHARS).optional(),\n type: communityTypeSchema,\n coverImageUrl: z.string().url().optional(),\n // ── v2 fields ─────────────────────────────────────────────────\n category: communityCategorySchema,\n reach: communityReachSchema,\n /** ObjectId of the picked area at the reach's tier. Required iff\n * `reach !== 'global'`. */\n areaId: z.string().optional(),\n tags: z.array(communityTagSchema).max(COMMUNITY_MAX_TAGS).default([]),\n mature: z.boolean().default(false),\n })\n .superRefine((body, ctx) => {\n if (body.reach !== 'global' && !body.areaId) {\n ctx.addIssue({\n code: 'custom',\n path: ['areaId'],\n message: 'Area is required when reach is not Global.',\n });\n }\n });\nexport type CreateCommunityBody = z.infer<typeof createCommunityBodySchema>;\n\n// ─── Update body (owner / admin only) ───────────────────────────────────────\n\n/**\n * `PATCH /communities/:slug` body. All fields optional. Sending\n * `null` for `description` or `coverImageUrl` clears that field.\n *\n * Type changes between `public` / `restricted` / `private` are NOT\n * supported in v1 — the decision has implications for already-\n * published posts and pending join requests that we don't want to\n * silently handle. Recreate the community if you need to switch.\n *\n * `category`, `tags`, `mature` are editable post-create. `reach` and\n * `areaLineage` / `centerCoords` are NOT editable — moving a community\n * across geographic scopes would silently invalidate every existing\n * member's relationship with it.\n */\nexport const updateCommunityBodySchema = z.object({\n name: z.string().min(COMMUNITY_NAME_MIN_CHARS).max(COMMUNITY_NAME_MAX_CHARS).optional(),\n description: z.string().max(COMMUNITY_DESCRIPTION_MAX_CHARS).nullable().optional(),\n coverImageUrl: z.string().url().nullable().optional(),\n category: communityCategorySchema.optional(),\n tags: z.array(communityTagSchema).max(COMMUNITY_MAX_TAGS).optional(),\n mature: z.boolean().optional(),\n});\nexport type UpdateCommunityBody = z.infer<typeof updateCommunityBodySchema>;\n\n// ─── List + discover + search responses ─────────────────────────────────────\n\n/** Sort order on the discover page. `popular` ranks by active member\n * count, `new` by createdAt desc. `top` is reserved for a future\n * activity-weighted ranking and accepted as a no-op for now. */\nexport const COMMUNITY_DISCOVER_SORT_VALUES = ['popular', 'new', 'top'] as const;\nexport type CommunityDiscoverSort = (typeof COMMUNITY_DISCOVER_SORT_VALUES)[number];\nexport const communityDiscoverSortSchema = z.enum(COMMUNITY_DISCOVER_SORT_VALUES);\n\nexport const communityListQuerySchema = z.object({\n sort: communityDiscoverSortSchema.optional(),\n /** Free-text fragment matched case-insensitively against the\n * community name. */\n q: z.string().max(60).optional(),\n cursor: z.string().optional(),\n pageSize: z.number().int().min(1).max(COMMUNITIES_PAGE_SIZE).optional(),\n // ── v2 discovery filters ─────────────────────────────────────────\n /** Filter by curated subject category. */\n category: communityCategorySchema.optional(),\n /** Filter by geographic reach tier. */\n reach: communityReachSchema.optional(),\n /** Return only verified communities. */\n verified: z.boolean().optional(),\n /** Layered \"near me\" mode — when true, returns the union of:\n * • `reach=neighborhood` AND `centerCoords` within\n * `COMMUNITY_HYPERLOCAL_RADIUS_KM` of the supplied (lat, lng),\n * • `reach=city` AND `districtId = viewer.districtId`,\n * • `reach=state` AND `stateId = viewer.stateId`,\n * • `reach=national` AND `countryId = viewer.countryId`.\n * `lat` + `lng` must accompany the flag (typically from the\n * viewer's currentLocation GPS). */\n nearMe: z.boolean().optional(),\n lat: z.number().min(-90).max(90).optional(),\n lng: z.number().min(-180).max(180).optional(),\n});\nexport type CommunityListQuery = z.infer<typeof communityListQuerySchema>;\n\nexport const communityListResponseSchema = z.object({\n items: z.array(communityWireSchema),\n nextCursor: z.string().nullable(),\n});\nexport type CommunityListResponse = z.infer<typeof communityListResponseSchema>;\n\n// ─── Membership actions ────────────────────────────────────────────────────\n\n/**\n * `POST /communities/:slug/join`. Response carries the new viewer\n * state so the client can update the CTA without a follow-up GET.\n *\n * - public → returns `{ status: 'active', role: 'member' }`\n * - private → returns `{ status: 'pending', role: null }`; the\n * owner / admin approves via the moderation endpoint\n * (`POST /communities/:slug/members/:userId/approve`).\n */\nexport const joinCommunityResponseSchema = z.object({\n status: communityMembershipStatusSchema,\n role: communityRoleSchema.nullable(),\n joinedAt: z.string().datetime().nullable(),\n});\nexport type JoinCommunityResponse = z.infer<typeof joinCommunityResponseSchema>;\n\nexport const communityMembersListResponseSchema = z.object({\n items: z.array(communityMemberWireSchema),\n nextCursor: z.string().nullable(),\n});\nexport type CommunityMembersListResponse = z.infer<typeof communityMembersListResponseSchema>;\n\n/** Body for `POST /communities/:slug/members/:userId/role` — owner-\n * only. Used to promote a member to admin or demote an admin back\n * to plain member. Owner role can't be set via this endpoint;\n * transferring ownership has its own dedicated route (deferred). */\nexport const updateMemberRoleBodySchema = z.object({\n role: z.enum(['admin', 'member']),\n});\nexport type UpdateMemberRoleBody = z.infer<typeof updateMemberRoleBodySchema>;\n\n// ─── Designation (representation, not permission) ──────────────────────────\n\n/**\n * Body for `PUT /communities/:slug/members/:userId/designation`.\n * Owner / admin only. Exactly one of `preset` / `custom` must be set.\n *\n * Use the preset list first (one-tap pick from `CommunityDesignationPreset`);\n * fall through to `custom` for niche labels (\"Press & Media\",\n * \"Disaster Response Lead\", etc.) that don't fit a preset.\n *\n * To clear an existing designation, use `DELETE` on the same path —\n * there's no \"null\" mode on this body.\n */\nexport const setMemberDesignationBodySchema = z\n .object({\n preset: communityDesignationPresetSchema.optional(),\n custom: z\n .string()\n .min(COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS)\n .max(COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS)\n .regex(COMMUNITY_DESIGNATION_CUSTOM_PATTERN)\n .optional(),\n })\n .refine(\n (b) => (b.preset != null) !== (b.custom != null),\n { message: 'Provide exactly one of `preset` or `custom`.' },\n );\nexport type SetMemberDesignationBody = z.infer<typeof setMemberDesignationBodySchema>;\n\n// ─── Verification (state+ leader vouch) ────────────────────────────────────\n\n/**\n * Body for `POST /communities/:slug/verify`. Empty for now; the\n * verifier's scope (`state | national | global`) is derived from the\n * caller's leader role rather than supplied. Keeping a body object\n * leaves room for a `note` field later without a breaking change.\n */\nexport const verifyCommunityBodySchema = z.object({\n /** Optional free-text note the leader can attach to the verification\n * (visible in the verification audit trail; not surfaced in the\n * default badge tooltip). Capped at 200 chars. */\n note: z.string().max(200).optional(),\n});\nexport type VerifyCommunityBody = z.infer<typeof verifyCommunityBodySchema>;\n\n// ─── Area picker query (powers the cascading area sheet) ───────────────────\n\n/**\n * `GET /areas?level=...&parentId=...&q=...` — backs the area picker\n * inside the create-community wizard's step 3. Returns areas at the\n * specified `level` that sit under the given parent area:\n *\n * level=local → returns localities under a `districtId` parent.\n * level=district → returns districts under a `stateId` parent.\n * level=state → returns states under a `countryId` parent.\n *\n * The picker constrains the user to siblings under their own parent\n * area (so a Maharashtra creator can pick any locality in Maharashtra\n * for a neighborhood community, but not one in Tamil Nadu).\n */\nexport const AREA_PICKER_LEVEL_VALUES = ['local', 'district', 'state'] as const;\nexport type AreaPickerLevel = (typeof AREA_PICKER_LEVEL_VALUES)[number];\nexport const areaPickerLevelSchema = z.enum(AREA_PICKER_LEVEL_VALUES);\n\nexport const areaPickerQuerySchema = z.object({\n level: areaPickerLevelSchema,\n parentId: z.string(),\n /** Optional name prefix for debounced search inside the sheet. */\n q: z.string().max(60).optional(),\n});\nexport type AreaPickerQuery = z.infer<typeof areaPickerQuerySchema>;\n\nexport const areaPickerItemSchema = z.object({\n _id: z.string(),\n name: z.string(),\n level: areaPickerLevelSchema,\n parentId: z.string(),\n});\nexport type AreaPickerItem = z.infer<typeof areaPickerItemSchema>;\n\nexport const areaPickerResponseSchema = z.object({\n items: z.array(areaPickerItemSchema),\n});\nexport type AreaPickerResponse = z.infer<typeof areaPickerResponseSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"community.js","sourceRoot":"","sources":["../src/community.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,sCAAsC,EACtC,sCAAsC,EACtC,oCAAoC,EAC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AAC,KAAK,CAAC,oBAAoB,CAAC;CACrC,CAAC,CAAC","sourcesContent":["/**\n * Topical Community wire shapes.\n *\n * A Community is a Reddit-subreddit / Facebook-group style surface: a\n * named topic users can discover, join, and post into. Distinct from\n * the user-created `Group` (chat-bound, small, private) — each\n * Community auto-owns its own bound `Group` (so members get a\n * Community chat room for free) but they're conceptually different\n * objects with their own roster + permissions.\n *\n * Visibility model\n * ----------------\n * - `public` — anyone can join one-tap; posts are visible to all\n * viewers in the community feed.\n * - `private` — joining requires owner / admin approval; posts and\n * member list are hidden from non-members. Discovery\n * still lists the community card (name + description +\n * member count + join button) so users can request to\n * join.\n *\n * Posts inside a community do NOT participate in the geo cascade —\n * they live and die inside the community surface. Posts authored\n * from the global composer continue to flow through the geo\n * area-proximity cascade ranked by `tierBoost` (see\n * `reform-backend/src/services/community/services/visibility.service.ts`).\n *\n * @module community-schema/community\n */\n\nimport { z } from 'zod';\nimport { areaLineageSnapshotSchema } from './area.js';\nimport {\n COMMUNITIES_PAGE_SIZE,\n COMMUNITY_DESCRIPTION_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_PATTERN,\n COMMUNITY_MAX_TAGS,\n COMMUNITY_NAME_MAX_CHARS,\n COMMUNITY_NAME_MIN_CHARS,\n COMMUNITY_SLUG_MAX_CHARS,\n COMMUNITY_SLUG_MIN_CHARS,\n COMMUNITY_SLUG_PATTERN,\n} from './constants.js';\n\n// ─── Enums ──────────────────────────────────────────────────────────────────\n\n/**\n * public — anyone can read + post.\n * restricted — anyone can read; only approved members can post. The\n * middle option Reddit added so communities can be open\n * to browse but moderated on the write side.\n * private — only approved members can read or post. The roster\n * + post bodies are hidden from non-members.\n */\nexport const COMMUNITY_TYPE_VALUES = ['public', 'restricted', 'private'] as const;\nexport type CommunityType = (typeof COMMUNITY_TYPE_VALUES)[number];\nexport const communityTypeSchema = z.enum(COMMUNITY_TYPE_VALUES);\n\n/**\n * Geographic scope a community claims. Maps onto the existing\n * area-lineage tiers so discovery can match a viewer's `areaLineage`\n * one tier at a time.\n *\n * neighborhood — hyperlocal; carries `areaLineage.localId` +\n * `centerCoords`. Discovery uses the 5 km radius from\n * `COMMUNITY_HYPERLOCAL_RADIUS_KM`.\n * city — district-scoped; carries `areaLineage.districtId`.\n * state — carries `areaLineage.stateId`.\n * national — carries `areaLineage.countryId`.\n * global — area-agnostic; `areaLineage` is null.\n */\nexport const COMMUNITY_REACH_VALUES = [\n 'neighborhood',\n 'city',\n 'state',\n 'national',\n 'global',\n] as const;\nexport type CommunityReach = (typeof COMMUNITY_REACH_VALUES)[number];\nexport const communityReachSchema = z.enum(COMMUNITY_REACH_VALUES);\n\n/**\n * Verification scope on a verified community — which leader-tier\n * vouched for it.\n *\n * state — a state-level leader verified within their own state.\n * national — a national-level leader (or higher).\n * global — a global / platform-level leader.\n */\nexport const COMMUNITY_VERIFIED_SCOPE_VALUES = ['state', 'national', 'global'] as const;\nexport type CommunityVerifiedScope = (typeof COMMUNITY_VERIFIED_SCOPE_VALUES)[number];\nexport const communityVerifiedScopeSchema = z.enum(COMMUNITY_VERIFIED_SCOPE_VALUES);\n\n/**\n * Curated category enum. Slugs are **stable English keys** (snake_case);\n * the visible label is i18n'd on the frontend (en/hi message files).\n * Never store culturally-specific or transliterated names here — the\n * locale layer owns presentation.\n *\n * First 12 slugs are weighted toward the Indian civic / hyperlocal\n * context that Jansathi serves (Women's / Men's / Youth groups, RWA,\n * Social Welfare, Civic Reform). Remaining 30 are general-interest\n * categories adapted from Reddit's curated topic set + Facebook\n * Groups' top discovery categories.\n *\n * See `docs/community-create-v2.md` §2 in the jansathi-frontend repo\n * for the full label table.\n */\nexport const COMMUNITY_CATEGORY_VALUES = [\n // Indian civic / community (12)\n 'womens_group',\n 'mens_group',\n 'youth_group',\n 'senior_citizens',\n 'parenting_children',\n 'resident_welfare',\n 'social_welfare',\n 'social_awareness',\n 'volunteering',\n 'civic_reform',\n 'local_news_issues',\n 'environment',\n // Faith & culture (3)\n 'religion_spirituality',\n 'festivals_culture',\n 'devotional',\n // Education (4)\n 'education',\n 'competitive_exams',\n 'books_literature',\n 'language_learning',\n // Health & wellness (4)\n 'health_wellness',\n 'yoga_meditation',\n 'fitness',\n 'mental_health',\n // Lifestyle (4)\n 'food_cooking',\n 'travel',\n 'photography',\n 'fashion_beauty',\n // Sports & arts (5)\n 'sports',\n 'cricket',\n 'arts_crafts',\n 'music',\n 'dance',\n // Entertainment (3)\n 'movies_tv',\n 'gaming',\n 'entertainment',\n // Professional (5)\n 'business_career',\n 'entrepreneurship',\n 'technology',\n 'finance_investing',\n 'agriculture',\n // Information (1) + fallback (1)\n 'news_current_affairs',\n 'other',\n] as const;\nexport type CommunityCategory = (typeof COMMUNITY_CATEGORY_VALUES)[number];\nexport const communityCategorySchema = z.enum(COMMUNITY_CATEGORY_VALUES);\n\n/**\n * Curated tag enum. A community picks 0–`COMMUNITY_MAX_TAGS` from\n * this list. Tags are stable English snake_case slugs; the visible\n * label is i18n'd. The tag picker UI groups them by theme via a\n * separate theme-map on the frontend; the stored enum is flat.\n *\n * Total: 112 tags spanning civic, health, education, sports, food,\n * arts/music/faith, business/tech, local issues, and lifestyle.\n */\nexport const COMMUNITY_TAG_VALUES = [\n // Civic & social (24)\n 'volunteer',\n 'donation_drive',\n 'blood_donation',\n 'anti_corruption',\n 'women_safety',\n 'child_safety',\n 'senior_care',\n 'disability_support',\n 'lgbtq_support',\n 'environment',\n 'cleanliness',\n 'plant_trees',\n 'waste_management',\n 'legal_aid',\n 'rti',\n 'voter_awareness',\n 'government_schemes',\n 'ngo',\n 'charity',\n 'relief_work',\n 'public_service',\n 'fundraising',\n 'awareness_campaign',\n 'social_justice',\n // Health & wellness (14)\n 'yoga',\n 'meditation',\n 'fitness',\n 'running',\n 'cycling',\n 'walking',\n 'nutrition',\n 'mental_health',\n 'ayurveda',\n 'weight_loss',\n 'womens_health',\n 'mens_health',\n 'dental_health',\n 'eye_care',\n // Education (16)\n 'jee',\n 'neet',\n 'upsc',\n 'ssc',\n 'ielts',\n 'school_support',\n 'college_support',\n 'scholarship',\n 'career_guidance',\n 'coding',\n 'mathematics',\n 'science',\n 'languages',\n 'spoken_english',\n 'tutoring',\n 'study_abroad',\n // Sports (9)\n 'cricket',\n 'football',\n 'badminton',\n 'tennis',\n 'kabaddi',\n 'hockey',\n 'chess',\n 'swimming',\n 'marathon',\n // Food (10)\n 'street_food',\n 'home_cooking',\n 'vegetarian',\n 'vegan',\n 'jain_food',\n 'fasting_recipes',\n 'north_indian',\n 'south_indian',\n 'baking',\n 'desserts',\n // Arts, music, faith (14)\n 'classical_music',\n 'hindustani',\n 'carnatic',\n 'bhajan',\n 'kirtan',\n 'bollywood',\n 'dance_classical',\n 'dance_folk',\n 'painting',\n 'photography',\n 'craft',\n 'satsang',\n 'festivals',\n 'pilgrimage',\n // Business & tech (11)\n 'entrepreneurship',\n 'startup',\n 'small_business',\n 'freelancing',\n 'real_estate',\n 'stocks_investing',\n 'mutual_funds',\n 'agriculture',\n 'handicrafts',\n 'job_postings',\n 'web_development',\n // Local issues (9)\n 'water_supply',\n 'electricity',\n 'road_repair',\n 'garbage_collection',\n 'drainage',\n 'public_transport',\n 'traffic',\n 'parking',\n 'local_healthcare',\n // Lifestyle (5)\n 'movies',\n 'tv_shows',\n 'books_club',\n 'trekking',\n 'parenting',\n] as const;\nexport type CommunityTag = (typeof COMMUNITY_TAG_VALUES)[number];\nexport const communityTagSchema = z.enum(COMMUNITY_TAG_VALUES);\n\n/**\n * Preset designation labels — purely **representation** (not\n * permission-bearing). Renders in brackets after a member's display\n * name in a community context (e.g., \"Hari Joshi (Chairman) · 12h ago\").\n *\n * Permission still flows through `CommunityRole` (owner / admin /\n * member). A designation does NOT promote or restrict anything.\n *\n * Per-community: Hari can be \"Chairman\" in one community and\n * \"Member-at-Large\" in another. Custom designations (free text)\n * cover the long tail; presets are surfaced first in the picker.\n */\nexport const COMMUNITY_DESIGNATION_PRESETS = [\n 'chairman',\n 'vice_chairman',\n 'president',\n 'vice_president',\n 'secretary',\n 'joint_secretary',\n 'general_secretary',\n 'treasurer',\n 'joint_treasurer',\n 'organizer',\n 'coordinator',\n 'spokesperson',\n 'founder',\n 'co_founder',\n 'patron',\n 'advisor',\n 'mentor',\n 'committee_member',\n 'member_at_large',\n 'volunteer',\n] as const;\nexport type CommunityDesignationPreset = (typeof COMMUNITY_DESIGNATION_PRESETS)[number];\nexport const communityDesignationPresetSchema = z.enum(COMMUNITY_DESIGNATION_PRESETS);\n\n/**\n * Designation stored on a `CommunityMembership`. Exactly one of\n * `preset` / `custom` is non-null when a designation is set.\n *\n * { preset: 'chairman', custom: null } — picked from the preset enum.\n * { preset: null, custom: 'Press & Media' } — free text.\n * null — no designation.\n *\n * The picker UI surfaces the preset list first; the custom path is\n * for niche labels that don't fit a preset. Validation enforces\n * exactly-one via a refinement.\n */\nexport const communityDesignationSchema = z\n .object({\n preset: communityDesignationPresetSchema.nullable(),\n custom: z.string().nullable(),\n })\n .refine((d) => (d.preset == null) !== (d.custom == null), {\n message: 'Designation must have exactly one of `preset` or `custom` set.',\n });\nexport type CommunityDesignation = z.infer<typeof communityDesignationSchema>;\n\n/**\n * Latitude / longitude pair used for hyperlocal (`reach=neighborhood`)\n * communities. Stored at create time from either the picked area's\n * centroid (if the Area carries coordinates) or the creator's current\n * GPS as a fallback. Indexed 2dsphere on the backend; powers the\n * `$nearSphere` query inside the `?nearMe=true` listing filter.\n */\nexport const communityCenterCoordsSchema = z.object({\n lat: z.number().min(-90).max(90),\n lng: z.number().min(-180).max(180),\n});\nexport type CommunityCenterCoords = z.infer<typeof communityCenterCoordsSchema>;\n\n/** Role hierarchy within a single community.\n *\n * owner — creator; cannot be demoted by anyone, can transfer\n * ownership (deferred for v1) and delete the community.\n * admin — granted by owner; can edit metadata, kick members,\n * soft-delete posts authored in the community.\n * member — joined; can post and comment, can leave at any time.\n */\nexport const COMMUNITY_ROLE_VALUES = ['owner', 'admin', 'member'] as const;\nexport type CommunityRole = (typeof COMMUNITY_ROLE_VALUES)[number];\nexport const communityRoleSchema = z.enum(COMMUNITY_ROLE_VALUES);\n\n/** Membership lifecycle.\n *\n * active — currently in the community.\n * pending — for a `private` community: the join request is awaiting\n * owner/admin approval. Pending rows aren't counted toward\n * `memberCount` and the user can't post yet.\n */\nexport const COMMUNITY_MEMBERSHIP_STATUS_VALUES = ['active', 'pending'] as const;\nexport type CommunityMembershipStatus = (typeof COMMUNITY_MEMBERSHIP_STATUS_VALUES)[number];\nexport const communityMembershipStatusSchema = z.enum(COMMUNITY_MEMBERSHIP_STATUS_VALUES);\n\n// ─── Wire shape ─────────────────────────────────────────────────────────────\n\n/**\n * `GET /communities/:slug` / discovery card / search hit.\n *\n * `viewer` is included when the request is authenticated. It carries\n * the viewer's role + membership status so the UI can render the\n * right CTA (Join / Joined / Pending / Owner) without a follow-up\n * round trip.\n */\nexport const communityWireSchema = z.object({\n _id: z.string(),\n slug: z.string(),\n name: z.string().min(COMMUNITY_NAME_MIN_CHARS).max(COMMUNITY_NAME_MAX_CHARS),\n description: z.string().max(COMMUNITY_DESCRIPTION_MAX_CHARS).optional(),\n type: communityTypeSchema,\n coverImageUrl: z.string().url().optional(),\n ownerUserId: z.string(),\n /** Active members only. Pending join-requests don't count. */\n memberCount: z.number().int().nonnegative(),\n /** Denormalised post count. Increments on create, decrements on\n * soft-delete. */\n postCount: z.number().int().nonnegative(),\n /** Bound chat-group id. Auto-created when the Community is created;\n * members are added to both rosters in lockstep. */\n groupId: z.string(),\n createdAt: z.string().datetime(),\n\n // ─── v2 taxonomy + reach + verification ─────────────────────────────\n /** Curated subject category. Single source of truth in\n * `COMMUNITY_CATEGORY_VALUES`; visible label is i18n'd. */\n category: communityCategorySchema,\n /** Geographic scope. Drives discovery filtering and is the reason\n * `areaLineage` / `centerCoords` may be present. */\n reach: communityReachSchema,\n /** Up to `COMMUNITY_MAX_TAGS` (10) tags from the curated enum. */\n tags: z.array(communityTagSchema),\n /** Mature (18+) flag. Content-gates the surface (blur previews,\n * age-confirm) once the gate UI ships; the field is persisted\n * from create-time so the mature designation is permanent. */\n mature: z.boolean(),\n /** Area snapshot — present when `reach !== 'global'`. Mirrors the\n * post-area lineage pattern; written once at create time and\n * immutable thereafter. */\n areaLineage: areaLineageSnapshotSchema.nullable(),\n /** Lat/lng pair — present when `reach === 'neighborhood'`. Powers\n * the `?nearMe=true` 5 km geospatial filter on discovery. */\n centerCoords: communityCenterCoordsSchema.nullable(),\n /** ISO timestamp set by a state+ leader when verifying the\n * community. Null until verified; clearing reverts to null. */\n verifiedAt: z.string().datetime().nullable(),\n /** UserId of the leader who verified. */\n verifiedBy: z.string().nullable(),\n /** Which leader tier vouched — drives the badge tooltip (\"verified\n * by a state leader\" vs \"by a national leader\"). */\n verifiedScope: communityVerifiedScopeSchema.nullable(),\n\n viewer: z\n .object({\n role: communityRoleSchema.nullable(),\n status: communityMembershipStatusSchema.nullable(),\n joinedAt: z.string().datetime().nullable(),\n /** Viewer's designation in THIS community. Null when the\n * viewer is not a member or has no designation set. Returned\n * at the wire level (vs the roster level) so post-cards and\n * the byline can render `(Chairman)` without a separate\n * roster lookup. */\n designation: communityDesignationSchema.nullable(),\n })\n .optional(),\n});\nexport type CommunityWire = z.infer<typeof communityWireSchema>;\n\n// ─── Member roster row ──────────────────────────────────────────────────────\n\nexport const communityMemberWireSchema = z.object({\n userId: z.string(),\n displayName: z.string(),\n avatarUrl: z.string().url().optional(),\n localName: z.string().optional(),\n role: communityRoleSchema,\n status: communityMembershipStatusSchema,\n joinedAt: z.string().datetime(),\n /** Per-community representation label. See\n * `communityDesignationSchema` — null when none set. */\n designation: communityDesignationSchema.nullable(),\n});\nexport type CommunityMemberWire = z.infer<typeof communityMemberWireSchema>;\n\n// ─── Create body ────────────────────────────────────────────────────────────\n\n/**\n * `POST /communities` body. `slug` is optional — when omitted the\n * backend auto-generates one from the name (lowercased, hyphenated,\n * collision-suffixed). When provided it must match the slug pattern\n * and be unique.\n *\n * `areaId` is required when `reach !== 'global'` — it's the deepest-\n * matching area-entity id (`localId` for neighborhood, `districtId`\n * for city, etc.) the creator picked from the area picker. The\n * backend resolves the full `areaLineage` snapshot from this id.\n */\nexport const createCommunityBodySchema = z\n .object({\n name: z.string().min(COMMUNITY_NAME_MIN_CHARS).max(COMMUNITY_NAME_MAX_CHARS),\n slug: z\n .string()\n .min(COMMUNITY_SLUG_MIN_CHARS)\n .max(COMMUNITY_SLUG_MAX_CHARS)\n .regex(COMMUNITY_SLUG_PATTERN)\n .optional(),\n description: z.string().max(COMMUNITY_DESCRIPTION_MAX_CHARS).optional(),\n type: communityTypeSchema,\n coverImageUrl: z.string().url().optional(),\n // ── v2 fields ─────────────────────────────────────────────────\n category: communityCategorySchema,\n reach: communityReachSchema,\n /** ObjectId of the picked area at the reach's tier. Required iff\n * `reach !== 'global'`. */\n areaId: z.string().optional(),\n tags: z.array(communityTagSchema).max(COMMUNITY_MAX_TAGS).default([]),\n mature: z.boolean().default(false),\n })\n .superRefine((body, ctx) => {\n if (body.reach !== 'global' && !body.areaId) {\n ctx.addIssue({\n code: 'custom',\n path: ['areaId'],\n message: 'Area is required when reach is not Global.',\n });\n }\n });\nexport type CreateCommunityBody = z.infer<typeof createCommunityBodySchema>;\n\n// ─── Update body (owner / admin only) ───────────────────────────────────────\n\n/**\n * `PATCH /communities/:slug` body. All fields optional. Sending\n * `null` for `description` or `coverImageUrl` clears that field.\n *\n * Type changes between `public` / `restricted` / `private` are NOT\n * supported in v1 — the decision has implications for already-\n * published posts and pending join requests that we don't want to\n * silently handle. Recreate the community if you need to switch.\n *\n * `category`, `tags`, `mature` are editable post-create. `reach` and\n * `areaLineage` / `centerCoords` are NOT editable — moving a community\n * across geographic scopes would silently invalidate every existing\n * member's relationship with it.\n */\nexport const updateCommunityBodySchema = z.object({\n name: z.string().min(COMMUNITY_NAME_MIN_CHARS).max(COMMUNITY_NAME_MAX_CHARS).optional(),\n description: z.string().max(COMMUNITY_DESCRIPTION_MAX_CHARS).nullable().optional(),\n coverImageUrl: z.string().url().nullable().optional(),\n category: communityCategorySchema.optional(),\n tags: z.array(communityTagSchema).max(COMMUNITY_MAX_TAGS).optional(),\n mature: z.boolean().optional(),\n});\nexport type UpdateCommunityBody = z.infer<typeof updateCommunityBodySchema>;\n\n// ─── List + discover + search responses ─────────────────────────────────────\n\n/** Sort order on the discover page. `popular` ranks by active member\n * count, `new` by createdAt desc. `top` is reserved for a future\n * activity-weighted ranking and accepted as a no-op for now. */\nexport const COMMUNITY_DISCOVER_SORT_VALUES = ['popular', 'new', 'top'] as const;\nexport type CommunityDiscoverSort = (typeof COMMUNITY_DISCOVER_SORT_VALUES)[number];\nexport const communityDiscoverSortSchema = z.enum(COMMUNITY_DISCOVER_SORT_VALUES);\n\nexport const communityListQuerySchema = z.object({\n sort: communityDiscoverSortSchema.optional(),\n /** Free-text fragment matched case-insensitively against the\n * community name. */\n q: z.string().max(60).optional(),\n cursor: z.string().optional(),\n pageSize: z.number().int().min(1).max(COMMUNITIES_PAGE_SIZE).optional(),\n // ── v2 discovery filters ─────────────────────────────────────────\n /** Filter by curated subject category. */\n category: communityCategorySchema.optional(),\n /** Filter by geographic reach tier. */\n reach: communityReachSchema.optional(),\n /** Return only verified communities. */\n verified: z.boolean().optional(),\n /** Layered \"near me\" mode — when true, returns the union of:\n * • `reach=neighborhood` AND `centerCoords` within\n * `COMMUNITY_HYPERLOCAL_RADIUS_KM` of the supplied (lat, lng),\n * • `reach=city` AND `districtId = viewer.districtId`,\n * • `reach=state` AND `stateId = viewer.stateId`,\n * • `reach=national` AND `countryId = viewer.countryId`.\n * `lat` + `lng` must accompany the flag (typically from the\n * viewer's currentLocation GPS). */\n nearMe: z.boolean().optional(),\n lat: z.number().min(-90).max(90).optional(),\n lng: z.number().min(-180).max(180).optional(),\n});\nexport type CommunityListQuery = z.infer<typeof communityListQuerySchema>;\n\nexport const communityListResponseSchema = z.object({\n items: z.array(communityWireSchema),\n nextCursor: z.string().nullable(),\n});\nexport type CommunityListResponse = z.infer<typeof communityListResponseSchema>;\n\n// ─── Membership actions ────────────────────────────────────────────────────\n\n/**\n * `POST /communities/:slug/join`. Response carries the new viewer\n * state so the client can update the CTA without a follow-up GET.\n *\n * - public → returns `{ status: 'active', role: 'member' }`\n * - private → returns `{ status: 'pending', role: null }`; the\n * owner / admin approves via the moderation endpoint\n * (`POST /communities/:slug/members/:userId/approve`).\n */\nexport const joinCommunityResponseSchema = z.object({\n status: communityMembershipStatusSchema,\n role: communityRoleSchema.nullable(),\n joinedAt: z.string().datetime().nullable(),\n});\nexport type JoinCommunityResponse = z.infer<typeof joinCommunityResponseSchema>;\n\nexport const communityMembersListResponseSchema = z.object({\n items: z.array(communityMemberWireSchema),\n nextCursor: z.string().nullable(),\n});\nexport type CommunityMembersListResponse = z.infer<typeof communityMembersListResponseSchema>;\n\n/** Body for `POST /communities/:slug/members/:userId/role` — owner-\n * only. Used to promote a member to admin or demote an admin back\n * to plain member. Owner role can't be set via this endpoint;\n * transferring ownership has its own dedicated route (deferred). */\nexport const updateMemberRoleBodySchema = z.object({\n role: z.enum(['admin', 'member']),\n});\nexport type UpdateMemberRoleBody = z.infer<typeof updateMemberRoleBodySchema>;\n\n// ─── Designation (representation, not permission) ──────────────────────────\n\n/**\n * Body for `PUT /communities/:slug/members/:userId/designation`.\n * Owner / admin only. Exactly one of `preset` / `custom` must be set.\n *\n * Use the preset list first (one-tap pick from `CommunityDesignationPreset`);\n * fall through to `custom` for niche labels (\"Press & Media\",\n * \"Disaster Response Lead\", etc.) that don't fit a preset.\n *\n * To clear an existing designation, use `DELETE` on the same path —\n * there's no \"null\" mode on this body.\n */\nexport const setMemberDesignationBodySchema = z\n .object({\n preset: communityDesignationPresetSchema.optional(),\n custom: z\n .string()\n .min(COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS)\n .max(COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS)\n .regex(COMMUNITY_DESIGNATION_CUSTOM_PATTERN)\n .optional(),\n })\n .refine((b) => (b.preset != null) !== (b.custom != null), {\n message: 'Provide exactly one of `preset` or `custom`.',\n });\nexport type SetMemberDesignationBody = z.infer<typeof setMemberDesignationBodySchema>;\n\n// ─── Verification (state+ leader vouch) ────────────────────────────────────\n\n/**\n * Body for `POST /communities/:slug/verify`. Empty for now; the\n * verifier's scope (`state | national | global`) is derived from the\n * caller's leader role rather than supplied. Keeping a body object\n * leaves room for a `note` field later without a breaking change.\n */\nexport const verifyCommunityBodySchema = z.object({\n /** Optional free-text note the leader can attach to the verification\n * (visible in the verification audit trail; not surfaced in the\n * default badge tooltip). Capped at 200 chars. */\n note: z.string().max(200).optional(),\n});\nexport type VerifyCommunityBody = z.infer<typeof verifyCommunityBodySchema>;\n\n// ─── Area picker query (powers the cascading area sheet) ───────────────────\n\n/**\n * `GET /areas?level=...&parentId=...&q=...` — backs the area picker\n * inside the create-community wizard's step 3. Returns areas at the\n * specified `level` that sit under the given parent area:\n *\n * level=local → returns localities under a `districtId` parent.\n * level=district → returns districts under a `stateId` parent.\n * level=state → returns states under a `countryId` parent.\n *\n * The picker constrains the user to siblings under their own parent\n * area (so a Maharashtra creator can pick any locality in Maharashtra\n * for a neighborhood community, but not one in Tamil Nadu).\n */\nexport const AREA_PICKER_LEVEL_VALUES = ['local', 'district', 'state'] as const;\nexport type AreaPickerLevel = (typeof AREA_PICKER_LEVEL_VALUES)[number];\nexport const areaPickerLevelSchema = z.enum(AREA_PICKER_LEVEL_VALUES);\n\nexport const areaPickerQuerySchema = z.object({\n level: areaPickerLevelSchema,\n parentId: z.string(),\n /** Optional name prefix for debounced search inside the sheet. */\n q: z.string().max(60).optional(),\n});\nexport type AreaPickerQuery = z.infer<typeof areaPickerQuerySchema>;\n\nexport const areaPickerItemSchema = z.object({\n _id: z.string(),\n name: z.string(),\n level: areaPickerLevelSchema,\n parentId: z.string(),\n});\nexport type AreaPickerItem = z.infer<typeof areaPickerItemSchema>;\n\nexport const areaPickerResponseSchema = z.object({\n items: z.array(areaPickerItemSchema),\n});\nexport type AreaPickerResponse = z.infer<typeof areaPickerResponseSchema>;\n"]}
|
package/dist/feed.d.ts
CHANGED
|
@@ -36,6 +36,31 @@ export declare const lostFoundFeedItemSchema: z.ZodObject<{
|
|
|
36
36
|
displayName: z.ZodString;
|
|
37
37
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
38
38
|
localName: z.ZodOptional<z.ZodString>;
|
|
39
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
40
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
41
|
+
volunteer: "volunteer";
|
|
42
|
+
chairman: "chairman";
|
|
43
|
+
vice_chairman: "vice_chairman";
|
|
44
|
+
president: "president";
|
|
45
|
+
vice_president: "vice_president";
|
|
46
|
+
secretary: "secretary";
|
|
47
|
+
joint_secretary: "joint_secretary";
|
|
48
|
+
general_secretary: "general_secretary";
|
|
49
|
+
treasurer: "treasurer";
|
|
50
|
+
joint_treasurer: "joint_treasurer";
|
|
51
|
+
organizer: "organizer";
|
|
52
|
+
coordinator: "coordinator";
|
|
53
|
+
spokesperson: "spokesperson";
|
|
54
|
+
founder: "founder";
|
|
55
|
+
co_founder: "co_founder";
|
|
56
|
+
patron: "patron";
|
|
57
|
+
advisor: "advisor";
|
|
58
|
+
mentor: "mentor";
|
|
59
|
+
committee_member: "committee_member";
|
|
60
|
+
member_at_large: "member_at_large";
|
|
61
|
+
}>>;
|
|
62
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
63
|
+
}, z.core.$strip>>>;
|
|
39
64
|
}, z.core.$strip>;
|
|
40
65
|
kind: z.ZodEnum<{
|
|
41
66
|
lost: "lost";
|
|
@@ -71,6 +96,31 @@ export declare const donateItemFeedItemSchema: z.ZodObject<{
|
|
|
71
96
|
displayName: z.ZodString;
|
|
72
97
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
73
98
|
localName: z.ZodOptional<z.ZodString>;
|
|
99
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
100
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
101
|
+
volunteer: "volunteer";
|
|
102
|
+
chairman: "chairman";
|
|
103
|
+
vice_chairman: "vice_chairman";
|
|
104
|
+
president: "president";
|
|
105
|
+
vice_president: "vice_president";
|
|
106
|
+
secretary: "secretary";
|
|
107
|
+
joint_secretary: "joint_secretary";
|
|
108
|
+
general_secretary: "general_secretary";
|
|
109
|
+
treasurer: "treasurer";
|
|
110
|
+
joint_treasurer: "joint_treasurer";
|
|
111
|
+
organizer: "organizer";
|
|
112
|
+
coordinator: "coordinator";
|
|
113
|
+
spokesperson: "spokesperson";
|
|
114
|
+
founder: "founder";
|
|
115
|
+
co_founder: "co_founder";
|
|
116
|
+
patron: "patron";
|
|
117
|
+
advisor: "advisor";
|
|
118
|
+
mentor: "mentor";
|
|
119
|
+
committee_member: "committee_member";
|
|
120
|
+
member_at_large: "member_at_large";
|
|
121
|
+
}>>;
|
|
122
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
123
|
+
}, z.core.$strip>>>;
|
|
74
124
|
}, z.core.$strip>;
|
|
75
125
|
itemName: z.ZodString;
|
|
76
126
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -103,6 +153,31 @@ export declare const voiceBoxFeedItemSchema: z.ZodObject<{
|
|
|
103
153
|
displayName: z.ZodString;
|
|
104
154
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
105
155
|
localName: z.ZodOptional<z.ZodString>;
|
|
156
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
157
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
158
|
+
volunteer: "volunteer";
|
|
159
|
+
chairman: "chairman";
|
|
160
|
+
vice_chairman: "vice_chairman";
|
|
161
|
+
president: "president";
|
|
162
|
+
vice_president: "vice_president";
|
|
163
|
+
secretary: "secretary";
|
|
164
|
+
joint_secretary: "joint_secretary";
|
|
165
|
+
general_secretary: "general_secretary";
|
|
166
|
+
treasurer: "treasurer";
|
|
167
|
+
joint_treasurer: "joint_treasurer";
|
|
168
|
+
organizer: "organizer";
|
|
169
|
+
coordinator: "coordinator";
|
|
170
|
+
spokesperson: "spokesperson";
|
|
171
|
+
founder: "founder";
|
|
172
|
+
co_founder: "co_founder";
|
|
173
|
+
patron: "patron";
|
|
174
|
+
advisor: "advisor";
|
|
175
|
+
mentor: "mentor";
|
|
176
|
+
committee_member: "committee_member";
|
|
177
|
+
member_at_large: "member_at_large";
|
|
178
|
+
}>>;
|
|
179
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
180
|
+
}, z.core.$strip>>>;
|
|
106
181
|
}, z.core.$strip>;
|
|
107
182
|
kind: z.ZodEnum<{
|
|
108
183
|
complaint: "complaint";
|
|
@@ -132,6 +207,31 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
132
207
|
displayName: z.ZodString;
|
|
133
208
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
134
209
|
localName: z.ZodOptional<z.ZodString>;
|
|
210
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
211
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
212
|
+
volunteer: "volunteer";
|
|
213
|
+
chairman: "chairman";
|
|
214
|
+
vice_chairman: "vice_chairman";
|
|
215
|
+
president: "president";
|
|
216
|
+
vice_president: "vice_president";
|
|
217
|
+
secretary: "secretary";
|
|
218
|
+
joint_secretary: "joint_secretary";
|
|
219
|
+
general_secretary: "general_secretary";
|
|
220
|
+
treasurer: "treasurer";
|
|
221
|
+
joint_treasurer: "joint_treasurer";
|
|
222
|
+
organizer: "organizer";
|
|
223
|
+
coordinator: "coordinator";
|
|
224
|
+
spokesperson: "spokesperson";
|
|
225
|
+
founder: "founder";
|
|
226
|
+
co_founder: "co_founder";
|
|
227
|
+
patron: "patron";
|
|
228
|
+
advisor: "advisor";
|
|
229
|
+
mentor: "mentor";
|
|
230
|
+
committee_member: "committee_member";
|
|
231
|
+
member_at_large: "member_at_large";
|
|
232
|
+
}>>;
|
|
233
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
234
|
+
}, z.core.$strip>>>;
|
|
135
235
|
}, z.core.$strip>;
|
|
136
236
|
text: z.ZodString;
|
|
137
237
|
images: z.ZodArray<z.ZodObject<{
|
|
@@ -176,6 +276,31 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
176
276
|
displayName: z.ZodString;
|
|
177
277
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
178
278
|
localName: z.ZodOptional<z.ZodString>;
|
|
279
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
280
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
281
|
+
volunteer: "volunteer";
|
|
282
|
+
chairman: "chairman";
|
|
283
|
+
vice_chairman: "vice_chairman";
|
|
284
|
+
president: "president";
|
|
285
|
+
vice_president: "vice_president";
|
|
286
|
+
secretary: "secretary";
|
|
287
|
+
joint_secretary: "joint_secretary";
|
|
288
|
+
general_secretary: "general_secretary";
|
|
289
|
+
treasurer: "treasurer";
|
|
290
|
+
joint_treasurer: "joint_treasurer";
|
|
291
|
+
organizer: "organizer";
|
|
292
|
+
coordinator: "coordinator";
|
|
293
|
+
spokesperson: "spokesperson";
|
|
294
|
+
founder: "founder";
|
|
295
|
+
co_founder: "co_founder";
|
|
296
|
+
patron: "patron";
|
|
297
|
+
advisor: "advisor";
|
|
298
|
+
mentor: "mentor";
|
|
299
|
+
committee_member: "committee_member";
|
|
300
|
+
member_at_large: "member_at_large";
|
|
301
|
+
}>>;
|
|
302
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
303
|
+
}, z.core.$strip>>>;
|
|
179
304
|
}, z.core.$strip>;
|
|
180
305
|
title: z.ZodString;
|
|
181
306
|
body: z.ZodOptional<z.ZodString>;
|
|
@@ -201,6 +326,31 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
201
326
|
displayName: z.ZodString;
|
|
202
327
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
203
328
|
localName: z.ZodOptional<z.ZodString>;
|
|
329
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
330
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
331
|
+
volunteer: "volunteer";
|
|
332
|
+
chairman: "chairman";
|
|
333
|
+
vice_chairman: "vice_chairman";
|
|
334
|
+
president: "president";
|
|
335
|
+
vice_president: "vice_president";
|
|
336
|
+
secretary: "secretary";
|
|
337
|
+
joint_secretary: "joint_secretary";
|
|
338
|
+
general_secretary: "general_secretary";
|
|
339
|
+
treasurer: "treasurer";
|
|
340
|
+
joint_treasurer: "joint_treasurer";
|
|
341
|
+
organizer: "organizer";
|
|
342
|
+
coordinator: "coordinator";
|
|
343
|
+
spokesperson: "spokesperson";
|
|
344
|
+
founder: "founder";
|
|
345
|
+
co_founder: "co_founder";
|
|
346
|
+
patron: "patron";
|
|
347
|
+
advisor: "advisor";
|
|
348
|
+
mentor: "mentor";
|
|
349
|
+
committee_member: "committee_member";
|
|
350
|
+
member_at_large: "member_at_large";
|
|
351
|
+
}>>;
|
|
352
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
353
|
+
}, z.core.$strip>>>;
|
|
204
354
|
}, z.core.$strip>;
|
|
205
355
|
kind: z.ZodEnum<{
|
|
206
356
|
lost: "lost";
|
|
@@ -229,6 +379,31 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
229
379
|
displayName: z.ZodString;
|
|
230
380
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
231
381
|
localName: z.ZodOptional<z.ZodString>;
|
|
382
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
383
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
384
|
+
volunteer: "volunteer";
|
|
385
|
+
chairman: "chairman";
|
|
386
|
+
vice_chairman: "vice_chairman";
|
|
387
|
+
president: "president";
|
|
388
|
+
vice_president: "vice_president";
|
|
389
|
+
secretary: "secretary";
|
|
390
|
+
joint_secretary: "joint_secretary";
|
|
391
|
+
general_secretary: "general_secretary";
|
|
392
|
+
treasurer: "treasurer";
|
|
393
|
+
joint_treasurer: "joint_treasurer";
|
|
394
|
+
organizer: "organizer";
|
|
395
|
+
coordinator: "coordinator";
|
|
396
|
+
spokesperson: "spokesperson";
|
|
397
|
+
founder: "founder";
|
|
398
|
+
co_founder: "co_founder";
|
|
399
|
+
patron: "patron";
|
|
400
|
+
advisor: "advisor";
|
|
401
|
+
mentor: "mentor";
|
|
402
|
+
committee_member: "committee_member";
|
|
403
|
+
member_at_large: "member_at_large";
|
|
404
|
+
}>>;
|
|
405
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
406
|
+
}, z.core.$strip>>>;
|
|
232
407
|
}, z.core.$strip>;
|
|
233
408
|
kind: z.ZodEnum<{
|
|
234
409
|
complaint: "complaint";
|
|
@@ -256,6 +431,31 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
256
431
|
displayName: z.ZodString;
|
|
257
432
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
258
433
|
localName: z.ZodOptional<z.ZodString>;
|
|
434
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
435
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
436
|
+
volunteer: "volunteer";
|
|
437
|
+
chairman: "chairman";
|
|
438
|
+
vice_chairman: "vice_chairman";
|
|
439
|
+
president: "president";
|
|
440
|
+
vice_president: "vice_president";
|
|
441
|
+
secretary: "secretary";
|
|
442
|
+
joint_secretary: "joint_secretary";
|
|
443
|
+
general_secretary: "general_secretary";
|
|
444
|
+
treasurer: "treasurer";
|
|
445
|
+
joint_treasurer: "joint_treasurer";
|
|
446
|
+
organizer: "organizer";
|
|
447
|
+
coordinator: "coordinator";
|
|
448
|
+
spokesperson: "spokesperson";
|
|
449
|
+
founder: "founder";
|
|
450
|
+
co_founder: "co_founder";
|
|
451
|
+
patron: "patron";
|
|
452
|
+
advisor: "advisor";
|
|
453
|
+
mentor: "mentor";
|
|
454
|
+
committee_member: "committee_member";
|
|
455
|
+
member_at_large: "member_at_large";
|
|
456
|
+
}>>;
|
|
457
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
458
|
+
}, z.core.$strip>>>;
|
|
259
459
|
}, z.core.$strip>;
|
|
260
460
|
itemName: z.ZodString;
|
|
261
461
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -303,6 +503,31 @@ export declare const feedResponseSchema: z.ZodObject<{
|
|
|
303
503
|
displayName: z.ZodString;
|
|
304
504
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
305
505
|
localName: z.ZodOptional<z.ZodString>;
|
|
506
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
507
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
508
|
+
volunteer: "volunteer";
|
|
509
|
+
chairman: "chairman";
|
|
510
|
+
vice_chairman: "vice_chairman";
|
|
511
|
+
president: "president";
|
|
512
|
+
vice_president: "vice_president";
|
|
513
|
+
secretary: "secretary";
|
|
514
|
+
joint_secretary: "joint_secretary";
|
|
515
|
+
general_secretary: "general_secretary";
|
|
516
|
+
treasurer: "treasurer";
|
|
517
|
+
joint_treasurer: "joint_treasurer";
|
|
518
|
+
organizer: "organizer";
|
|
519
|
+
coordinator: "coordinator";
|
|
520
|
+
spokesperson: "spokesperson";
|
|
521
|
+
founder: "founder";
|
|
522
|
+
co_founder: "co_founder";
|
|
523
|
+
patron: "patron";
|
|
524
|
+
advisor: "advisor";
|
|
525
|
+
mentor: "mentor";
|
|
526
|
+
committee_member: "committee_member";
|
|
527
|
+
member_at_large: "member_at_large";
|
|
528
|
+
}>>;
|
|
529
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
530
|
+
}, z.core.$strip>>>;
|
|
306
531
|
}, z.core.$strip>;
|
|
307
532
|
text: z.ZodString;
|
|
308
533
|
images: z.ZodArray<z.ZodObject<{
|
|
@@ -347,6 +572,31 @@ export declare const feedResponseSchema: z.ZodObject<{
|
|
|
347
572
|
displayName: z.ZodString;
|
|
348
573
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
349
574
|
localName: z.ZodOptional<z.ZodString>;
|
|
575
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
576
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
577
|
+
volunteer: "volunteer";
|
|
578
|
+
chairman: "chairman";
|
|
579
|
+
vice_chairman: "vice_chairman";
|
|
580
|
+
president: "president";
|
|
581
|
+
vice_president: "vice_president";
|
|
582
|
+
secretary: "secretary";
|
|
583
|
+
joint_secretary: "joint_secretary";
|
|
584
|
+
general_secretary: "general_secretary";
|
|
585
|
+
treasurer: "treasurer";
|
|
586
|
+
joint_treasurer: "joint_treasurer";
|
|
587
|
+
organizer: "organizer";
|
|
588
|
+
coordinator: "coordinator";
|
|
589
|
+
spokesperson: "spokesperson";
|
|
590
|
+
founder: "founder";
|
|
591
|
+
co_founder: "co_founder";
|
|
592
|
+
patron: "patron";
|
|
593
|
+
advisor: "advisor";
|
|
594
|
+
mentor: "mentor";
|
|
595
|
+
committee_member: "committee_member";
|
|
596
|
+
member_at_large: "member_at_large";
|
|
597
|
+
}>>;
|
|
598
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
599
|
+
}, z.core.$strip>>>;
|
|
350
600
|
}, z.core.$strip>;
|
|
351
601
|
title: z.ZodString;
|
|
352
602
|
body: z.ZodOptional<z.ZodString>;
|
|
@@ -372,6 +622,31 @@ export declare const feedResponseSchema: z.ZodObject<{
|
|
|
372
622
|
displayName: z.ZodString;
|
|
373
623
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
374
624
|
localName: z.ZodOptional<z.ZodString>;
|
|
625
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
626
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
627
|
+
volunteer: "volunteer";
|
|
628
|
+
chairman: "chairman";
|
|
629
|
+
vice_chairman: "vice_chairman";
|
|
630
|
+
president: "president";
|
|
631
|
+
vice_president: "vice_president";
|
|
632
|
+
secretary: "secretary";
|
|
633
|
+
joint_secretary: "joint_secretary";
|
|
634
|
+
general_secretary: "general_secretary";
|
|
635
|
+
treasurer: "treasurer";
|
|
636
|
+
joint_treasurer: "joint_treasurer";
|
|
637
|
+
organizer: "organizer";
|
|
638
|
+
coordinator: "coordinator";
|
|
639
|
+
spokesperson: "spokesperson";
|
|
640
|
+
founder: "founder";
|
|
641
|
+
co_founder: "co_founder";
|
|
642
|
+
patron: "patron";
|
|
643
|
+
advisor: "advisor";
|
|
644
|
+
mentor: "mentor";
|
|
645
|
+
committee_member: "committee_member";
|
|
646
|
+
member_at_large: "member_at_large";
|
|
647
|
+
}>>;
|
|
648
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
649
|
+
}, z.core.$strip>>>;
|
|
375
650
|
}, z.core.$strip>;
|
|
376
651
|
kind: z.ZodEnum<{
|
|
377
652
|
lost: "lost";
|
|
@@ -400,6 +675,31 @@ export declare const feedResponseSchema: z.ZodObject<{
|
|
|
400
675
|
displayName: z.ZodString;
|
|
401
676
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
402
677
|
localName: z.ZodOptional<z.ZodString>;
|
|
678
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
679
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
680
|
+
volunteer: "volunteer";
|
|
681
|
+
chairman: "chairman";
|
|
682
|
+
vice_chairman: "vice_chairman";
|
|
683
|
+
president: "president";
|
|
684
|
+
vice_president: "vice_president";
|
|
685
|
+
secretary: "secretary";
|
|
686
|
+
joint_secretary: "joint_secretary";
|
|
687
|
+
general_secretary: "general_secretary";
|
|
688
|
+
treasurer: "treasurer";
|
|
689
|
+
joint_treasurer: "joint_treasurer";
|
|
690
|
+
organizer: "organizer";
|
|
691
|
+
coordinator: "coordinator";
|
|
692
|
+
spokesperson: "spokesperson";
|
|
693
|
+
founder: "founder";
|
|
694
|
+
co_founder: "co_founder";
|
|
695
|
+
patron: "patron";
|
|
696
|
+
advisor: "advisor";
|
|
697
|
+
mentor: "mentor";
|
|
698
|
+
committee_member: "committee_member";
|
|
699
|
+
member_at_large: "member_at_large";
|
|
700
|
+
}>>;
|
|
701
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
702
|
+
}, z.core.$strip>>>;
|
|
403
703
|
}, z.core.$strip>;
|
|
404
704
|
kind: z.ZodEnum<{
|
|
405
705
|
complaint: "complaint";
|
|
@@ -427,6 +727,31 @@ export declare const feedResponseSchema: z.ZodObject<{
|
|
|
427
727
|
displayName: z.ZodString;
|
|
428
728
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
429
729
|
localName: z.ZodOptional<z.ZodString>;
|
|
730
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
731
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
732
|
+
volunteer: "volunteer";
|
|
733
|
+
chairman: "chairman";
|
|
734
|
+
vice_chairman: "vice_chairman";
|
|
735
|
+
president: "president";
|
|
736
|
+
vice_president: "vice_president";
|
|
737
|
+
secretary: "secretary";
|
|
738
|
+
joint_secretary: "joint_secretary";
|
|
739
|
+
general_secretary: "general_secretary";
|
|
740
|
+
treasurer: "treasurer";
|
|
741
|
+
joint_treasurer: "joint_treasurer";
|
|
742
|
+
organizer: "organizer";
|
|
743
|
+
coordinator: "coordinator";
|
|
744
|
+
spokesperson: "spokesperson";
|
|
745
|
+
founder: "founder";
|
|
746
|
+
co_founder: "co_founder";
|
|
747
|
+
patron: "patron";
|
|
748
|
+
advisor: "advisor";
|
|
749
|
+
mentor: "mentor";
|
|
750
|
+
committee_member: "committee_member";
|
|
751
|
+
member_at_large: "member_at_large";
|
|
752
|
+
}>>;
|
|
753
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
754
|
+
}, z.core.$strip>>>;
|
|
430
755
|
}, z.core.$strip>;
|
|
431
756
|
itemName: z.ZodString;
|
|
432
757
|
description: z.ZodOptional<z.ZodString>;
|
package/dist/feed.d.ts.map
CHANGED
|
@@ -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
|
|
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;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CA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|
18
18
|
export { type CommunityCommentWire, type CreateCommentBody, communityCommentWireSchema, createCommentBodySchema, type UpdateCommentBody, updateCommentBodySchema, } from './comment.js';
|
|
19
|
-
export { AREA_PICKER_LEVEL_VALUES,
|
|
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
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';
|
|
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';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EACL,KAAK,mBAAmB,EACxB,yBAA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AAiB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,sBAAsB,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
|
@@ -19,7 +19,7 @@ export { areaLineageSnapshotSchema, } from './area.js';
|
|
|
19
19
|
// ─── Comment ───────────────────────────────────────────────────────────────
|
|
20
20
|
export { communityCommentWireSchema, createCommentBodySchema, updateCommentBodySchema, } from './comment.js';
|
|
21
21
|
// ─── Communities ───────────────────────────────────────────────────────────
|
|
22
|
-
export { AREA_PICKER_LEVEL_VALUES, 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,
|
|
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
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';
|
|
25
25
|
// ─── Engagement (upvote + reactions) ───────────────────────────────────────
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,8EAA8E;AAC9E,OAAO,EAEL,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AAEnB,8EAA8E;AAC9E,OAAO,EAGL,0BAA0B,EAC1B,uBAAuB,EAEvB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAEtB,8EAA8E;AAC9E,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,+BAA+B,EAsB/B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,EAC3B,+BAA+B,EAC/B,kCAAkC,EAClC,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB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B,8BAA8B,EAC9B,qBAAqB,EACrB,eAAe,EACf,wBAAwB,EAExB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAEpB,8EAA8E;AAC9E,OAAO,EAGL,eAAe,EACf,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,8EAA8E;AAC9E,OAAO,EAGL,uBAAuB,EACvB,oBAAoB,EAEpB,wBAAwB,EAExB,oBAAoB,EAEpB,oBAAoB,GACrB,MAAM,WAAW,CAAC;AACnB,8EAA8E;AAC9E,OAAO,EAML,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,8EAA8E;AAC9E,OAAO,EAML,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,8EAA8E;AAC9E,OAAO,EAGL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AAErB,8EAA8E;AAC9E,OAAO,EAGL,8BAA8B,EAC9B,qBAAqB,EACrB,2BAA2B,EAE3B,2BAA2B,EAE3B,iCAAiC,GAClC,MAAM,eAAe,CAAC;AAEvB,8EAA8E;AAC9E,OAAO,EAEL,0BAA0B,EAE1B,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,6EAA6E;AAC7E,OAAO,EAEL,0BAA0B,EAG1B,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAI5B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,cAAc,EACd,+BAA+B,GAChC,MAAM,eAAe,CAAC","sourcesContent":["/**\n * community-schema — Shared Zod schemas + TypeScript types for the\n * Jansathi hyperlocal community feature (feed, posts, engagement,\n * social graph, groups, settings).\n *\n * Single source of truth consumed by reform-backend and every product\n * frontend. The schemas mirror MongoDB / Mongoose document shapes\n * 1:1 so the same Zod validation runs at the controller boundary on\n * the backend and in the form handlers on the client.\n *\n * Cascade-upward visibility semantics: a viewer whose feed level is L\n * sees posts at L and every BROADER level matching their area lineage.\n * See `./enums.ts#VISIBILITY_LEVEL_VALUES` for the level rank table.\n *\n * @module community-schema\n */\n\n// ─── Area lineage snapshot ─────────────────────────────────────────────────\nexport {\n type AreaLineageSnapshot,\n areaLineageSnapshotSchema,\n} from './area.js';\n\n// ─── Comment ───────────────────────────────────────────────────────────────\nexport {\n type CommunityCommentWire,\n type CreateCommentBody,\n communityCommentWireSchema,\n createCommentBodySchema,\n type UpdateCommentBody,\n updateCommentBodySchema,\n} from './comment.js';\n\n// ─── Communities ───────────────────────────────────────────────────────────\nexport {\n AREA_PICKER_LEVEL_VALUES,\n COMMUNITY_CATEGORY_VALUES,\n COMMUNITY_DESIGNATION_PRESETS,\n COMMUNITY_DISCOVER_SORT_VALUES,\n COMMUNITY_MEMBERSHIP_STATUS_VALUES,\n COMMUNITY_REACH_VALUES,\n COMMUNITY_ROLE_VALUES,\n COMMUNITY_TAG_VALUES,\n COMMUNITY_TYPE_VALUES,\n COMMUNITY_VERIFIED_SCOPE_VALUES,\n type AreaPickerItem,\n type AreaPickerLevel,\n type AreaPickerQuery,\n type AreaPickerResponse,\n type CommunityCategory,\n type CommunityCenterCoords,\n type CommunityDesignation,\n type CommunityDesignationPreset,\n type CommunityDiscoverSort,\n type CommunityListQuery,\n type CommunityListResponse,\n type CommunityMembershipStatus,\n type CommunityMembersListResponse,\n type CommunityMemberWire,\n type CommunityReach,\n type CommunityRole,\n type CommunityTag,\n type CommunityType,\n type CommunityVerifiedScope,\n type CommunityWire,\n type CreateCommunityBody,\n areaPickerItemSchema,\n areaPickerLevelSchema,\n areaPickerQuerySchema,\n areaPickerResponseSchema,\n communityCategorySchema,\n communityCenterCoordsSchema,\n communityDesignationPresetSchema,\n communityDesignationSchema,\n communityDiscoverSortSchema,\n communityListQuerySchema,\n communityListResponseSchema,\n communityMembershipStatusSchema,\n communityMembersListResponseSchema,\n communityMemberWireSchema,\n communityReachSchema,\n communityRoleSchema,\n communityTagSchema,\n communityTypeSchema,\n communityVerifiedScopeSchema,\n communityWireSchema,\n createCommunityBodySchema,\n type JoinCommunityResponse,\n joinCommunityResponseSchema,\n type SetMemberDesignationBody,\n setMemberDesignationBodySchema,\n type UpdateCommunityBody,\n type UpdateMemberRoleBody,\n type VerifyCommunityBody,\n updateCommunityBodySchema,\n updateMemberRoleBodySchema,\n verifyCommunityBodySchema,\n} from './community.js';\n\n// ─── Constants ─────────────────────────────────────────────────────────────\nexport {\n COMMENT_MAX_BODY_CHARS,\n COMMENTS_PAGE_SIZE,\n COMMUNITIES_PAGE_SIZE,\n COMMUNITY_DESCRIPTION_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_PATTERN,\n COMMUNITY_HYPERLOCAL_RADIUS_KM,\n COMMUNITY_MAX_TAGS,\n COMMUNITY_MEMBERS_PAGE_SIZE,\n COMMUNITY_NAME_MAX_CHARS,\n COMMUNITY_NAME_MIN_CHARS,\n COMMUNITY_SLUG_MAX_CHARS,\n COMMUNITY_SLUG_MIN_CHARS,\n COMMUNITY_SLUG_PATTERN,\n EDIT_GRACE_WINDOW_MS,\n FEED_PAGE_SIZE,\n GROUP_MAX_MEMBERS,\n GROUP_NAME_MAX_CHARS,\n GROUP_NAME_MIN_CHARS,\n PEOPLE_PAGE_SIZE,\n POST_MAX_BODY_CHARS,\n POST_MAX_IMAGE_BYTES,\n POST_MAX_IMAGES,\n POST_MAX_VIDEO_BYTES,\n POST_MAX_VIDEO_SECONDS,\n POST_MAX_VIDEOS,\n PROFILE_MAX_BIO_CHARS,\n REPLIES_PRELOAD_COUNT,\n} from './constants.js';\n\n// ─── Engagement (upvote + reactions) ───────────────────────────────────────\nexport {\n type SetReactionBody,\n type SetReactionResponse,\n setReactionBodySchema,\n setReactionResponseSchema,\n type ToggleUpvoteResponse,\n toggleUpvoteResponseSchema,\n} from './engagement.js';\n\n// ─── Enums ─────────────────────────────────────────────────────────────────\nexport {\n CONTENT_KIND_VALUES,\n type ContentKind,\n contentKindSchema,\n FEED_SORT_VALUES,\n type FeedSort,\n feedSortSchema,\n PROFILE_PRIVACY_VALUES,\n type ProfilePrivacy,\n profilePrivacySchema,\n REACTION_TYPE_VALUES,\n REPORT_REASON_VALUES,\n REPORT_STATUS_VALUES,\n type ReactionType,\n type ReportReason,\n type ReportStatus,\n reactionTypeSchema,\n reportReasonSchema,\n reportStatusSchema,\n VISIBILITY_LEVEL_RANK,\n VISIBILITY_LEVEL_VALUES,\n type VisibilityLevel,\n visibilityLevelSchema,\n} from './enums.js';\n\n// ─── Feed (polymorphic union) ──────────────────────────────────────────────\nexport {\n type DonateItemFeedItem,\n donateItemFeedItemSchema,\n type FeedItem,\n type FeedQueryParams,\n type FeedResponse,\n feedItemSchema,\n feedQueryParamsSchema,\n feedResponseSchema,\n type LostFoundFeedItem,\n lostFoundFeedItemSchema,\n type VoiceBoxFeedItem,\n voiceBoxFeedItemSchema,\n} from './feed.js';\n\n// ─── Groups ────────────────────────────────────────────────────────────────\nexport {\n type AddGroupMembersBody,\n addGroupMembersBodySchema,\n type CommunityGroupWire,\n type CommunityGroupWithMembers,\n type CreateGroupBody,\n communityGroupWireSchema,\n communityGroupWithMembersSchema,\n createGroupBodySchema,\n type GroupMembersListResponse,\n type GroupMemberWire,\n type GroupRole,\n type GroupsListResponse,\n groupMembersListResponseSchema,\n groupMemberWireSchema,\n groupRoleSchema,\n groupsListResponseSchema,\n type UpdateGroupBody,\n updateGroupBodySchema,\n} from './group.js';\n\n// ─── Media ─────────────────────────────────────────────────────────────────\nexport {\n type PostImage,\n type PostVideo,\n postImageSchema,\n postVideoSchema,\n} from './media.js';\n\n// ─── Post ──────────────────────────────────────────────────────────────────\nexport {\n type CommunityPostWire,\n type CreatePostBody,\n communityPostWireSchema,\n createPostBodySchema,\n type PostAuthorSnapshot,\n postAuthorSnapshotSchema,\n type RepostedSource,\n repostedSourceSchema,\n type UpdatePostBody,\n updatePostBodySchema,\n} from './post.js';\n// ─── Profile + People list ─────────────────────────────────────────────────\nexport {\n type PeopleListItem,\n type PeopleListResponse,\n type PeopleQueryParams,\n type ProfileMutuals,\n type PublicProfileWire,\n peopleListItemSchema,\n peopleListResponseSchema,\n peopleQueryParamsSchema,\n profileMutualsSchema,\n publicProfileWireSchema,\n} from './profile.js';\n// ─── Reports (moderation) ──────────────────────────────────────────────────\nexport {\n type ReportContentBody,\n type ReportContentKind,\n type ReportRecordWire,\n type ReportSubmissionResponse,\n type ReportUserBody,\n reportContentBodySchema,\n reportContentKindSchema,\n reportRecordWireSchema,\n reportSubmissionResponseSchema,\n reportUserBodySchema,\n} from './report.js';\n// ─── Repost (quote / amplify) ──────────────────────────────────────────────\nexport {\n type CreateRepostBody,\n type CreateRepostResponse,\n createRepostBodySchema,\n createRepostResponseSchema,\n} from './repost.js';\n\n// ─── Settings ──────────────────────────────────────────────────────────────\nexport {\n type BlockedUsersListResponse,\n type BlockedUserWire,\n blockedUsersListResponseSchema,\n blockedUserWireSchema,\n COMMUNITY_SETTINGS_DEFAULTS,\n type CommunitySettingsWire,\n communitySettingsWireSchema,\n type UpdateCommunitySettingsBody,\n updateCommunitySettingsBodySchema,\n} from './settings.js';\n\n// ─── Social (follow) ───────────────────────────────────────────────────────\nexport {\n type ToggleFollowResponse,\n toggleFollowResponseSchema,\n type ViewerSocialState,\n viewerSocialStateSchema,\n} from './social.js';\n\n// ─── Username (URL handle + change / availability) ────────────────────────\nexport {\n type CurrentUsernameState,\n currentUsernameStateSchema,\n type UpdateUsernameBody,\n type UpdateUsernameResponse,\n USERNAME_MAX_LENGTH,\n USERNAME_MIN_LENGTH,\n USERNAME_PATTERN,\n USERNAME_UNAVAILABLE_REASONS,\n type Username,\n type UsernameAvailabilityResponse,\n type UsernameUnavailableReason,\n updateUsernameBodySchema,\n updateUsernameResponseSchema,\n usernameAvailabilityResponseSchema,\n usernameSchema,\n usernameUnavailableReasonSchema,\n} from './username.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,8EAA8E;AAC9E,OAAO,EAEL,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AAEnB,8EAA8E;AAC9E,OAAO,EAGL,0BAA0B,EAC1B,uBAAuB,EAEvB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAEtB,8EAA8E;AAC9E,OAAO,EACL,wBAAwB,EAKxB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B,kCAAkC,EAClC,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,+BAA+B,EAkB/B,uBAAuB,EACvB,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,EAC3B,+BAA+B,EAC/B,kCAAkC,EAClC,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,EAC5B,mBAAmB,EACnB,yBAAyB,EAEzB,2BAA2B,EAE3B,8BAA8B,EAG9B,yBAAyB,EACzB,0BAA0B,EAE1B,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AAExB,8EAA8E;AAC9E,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,+BAA+B,EAC/B,sCAAsC,EACtC,sCAAsC,EACtC,oCAAoC,EACpC,8BAA8B,EAC9B,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,g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ACtB,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,8EAA8E;AAC9E,OAAO,EAGL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AAErB,8EAA8E;AAC9E,OAAO,EAGL,8BAA8B,EAC9B,qBAAqB,EACrB,2BAA2B,EAE3B,2BAA2B,EAE3B,iCAAiC,GAClC,MAAM,eAAe,CAAC;AAEvB,8EAA8E;AAC9E,OAAO,EAEL,0BAA0B,EAE1B,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,6EAA6E;AAC7E,OAAO,EAEL,0BAA0B,EAG1B,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,4BAA4B,EAI5B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,cAAc,EACd,+BAA+B,GAChC,MAAM,eAAe,CAAC","sourcesContent":["/**\n * community-schema — Shared Zod schemas + TypeScript types for the\n * Jansathi hyperlocal community feature (feed, posts, engagement,\n * social graph, groups, settings).\n *\n * Single source of truth consumed by reform-backend and every product\n * frontend. The schemas mirror MongoDB / Mongoose document shapes\n * 1:1 so the same Zod validation runs at the controller boundary on\n * the backend and in the form handlers on the client.\n *\n * Cascade-upward visibility semantics: a viewer whose feed level is L\n * sees posts at L and every BROADER level matching their area lineage.\n * See `./enums.ts#VISIBILITY_LEVEL_VALUES` for the level rank table.\n *\n * @module community-schema\n */\n\n// ─── Area lineage snapshot ─────────────────────────────────────────────────\nexport {\n type AreaLineageSnapshot,\n areaLineageSnapshotSchema,\n} from './area.js';\n\n// ─── Comment ───────────────────────────────────────────────────────────────\nexport {\n type CommunityCommentWire,\n type CreateCommentBody,\n communityCommentWireSchema,\n createCommentBodySchema,\n type UpdateCommentBody,\n updateCommentBodySchema,\n} from './comment.js';\n\n// ─── Communities ───────────────────────────────────────────────────────────\nexport {\n AREA_PICKER_LEVEL_VALUES,\n type AreaPickerItem,\n type AreaPickerLevel,\n type AreaPickerQuery,\n type AreaPickerResponse,\n areaPickerItemSchema,\n areaPickerLevelSchema,\n areaPickerQuerySchema,\n areaPickerResponseSchema,\n COMMUNITY_CATEGORY_VALUES,\n COMMUNITY_DESIGNATION_PRESETS,\n COMMUNITY_DISCOVER_SORT_VALUES,\n COMMUNITY_MEMBERSHIP_STATUS_VALUES,\n COMMUNITY_REACH_VALUES,\n COMMUNITY_ROLE_VALUES,\n COMMUNITY_TAG_VALUES,\n COMMUNITY_TYPE_VALUES,\n COMMUNITY_VERIFIED_SCOPE_VALUES,\n type CommunityCategory,\n type CommunityCenterCoords,\n type CommunityDesignation,\n type CommunityDesignationPreset,\n type CommunityDiscoverSort,\n type CommunityListQuery,\n type CommunityListResponse,\n type CommunityMembershipStatus,\n type CommunityMembersListResponse,\n type CommunityMemberWire,\n type CommunityReach,\n type CommunityRole,\n type CommunityTag,\n type CommunityType,\n type CommunityVerifiedScope,\n type CommunityWire,\n type CreateCommunityBody,\n communityCategorySchema,\n communityCenterCoordsSchema,\n communityDesignationPresetSchema,\n communityDesignationSchema,\n communityDiscoverSortSchema,\n communityListQuerySchema,\n communityListResponseSchema,\n communityMembershipStatusSchema,\n communityMembersListResponseSchema,\n communityMemberWireSchema,\n communityReachSchema,\n communityRoleSchema,\n communityTagSchema,\n communityTypeSchema,\n communityVerifiedScopeSchema,\n communityWireSchema,\n createCommunityBodySchema,\n type JoinCommunityResponse,\n joinCommunityResponseSchema,\n type SetMemberDesignationBody,\n setMemberDesignationBodySchema,\n type UpdateCommunityBody,\n type UpdateMemberRoleBody,\n updateCommunityBodySchema,\n updateMemberRoleBodySchema,\n type VerifyCommunityBody,\n verifyCommunityBodySchema,\n} from './community.js';\n\n// ─── Constants ─────────────────────────────────────────────────────────────\nexport {\n COMMENT_MAX_BODY_CHARS,\n COMMENTS_PAGE_SIZE,\n COMMUNITIES_PAGE_SIZE,\n COMMUNITY_DESCRIPTION_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MAX_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_MIN_CHARS,\n COMMUNITY_DESIGNATION_CUSTOM_PATTERN,\n COMMUNITY_HYPERLOCAL_RADIUS_KM,\n COMMUNITY_MAX_TAGS,\n COMMUNITY_MEMBERS_PAGE_SIZE,\n COMMUNITY_NAME_MAX_CHARS,\n COMMUNITY_NAME_MIN_CHARS,\n COMMUNITY_SLUG_MAX_CHARS,\n COMMUNITY_SLUG_MIN_CHARS,\n COMMUNITY_SLUG_PATTERN,\n EDIT_GRACE_WINDOW_MS,\n FEED_PAGE_SIZE,\n GROUP_MAX_MEMBERS,\n GROUP_NAME_MAX_CHARS,\n GROUP_NAME_MIN_CHARS,\n PEOPLE_PAGE_SIZE,\n POST_MAX_BODY_CHARS,\n POST_MAX_IMAGE_BYTES,\n POST_MAX_IMAGES,\n POST_MAX_VIDEO_BYTES,\n POST_MAX_VIDEO_SECONDS,\n POST_MAX_VIDEOS,\n PROFILE_MAX_BIO_CHARS,\n REPLIES_PRELOAD_COUNT,\n} from './constants.js';\n\n// ─── Engagement (upvote + reactions) ───────────────────────────────────────\nexport {\n type SetReactionBody,\n type SetReactionResponse,\n setReactionBodySchema,\n setReactionResponseSchema,\n type ToggleUpvoteResponse,\n toggleUpvoteResponseSchema,\n} from './engagement.js';\n\n// ─── Enums ─────────────────────────────────────────────────────────────────\nexport {\n CONTENT_KIND_VALUES,\n type ContentKind,\n contentKindSchema,\n FEED_SORT_VALUES,\n type FeedSort,\n feedSortSchema,\n PROFILE_PRIVACY_VALUES,\n type ProfilePrivacy,\n profilePrivacySchema,\n REACTION_TYPE_VALUES,\n REPORT_REASON_VALUES,\n REPORT_STATUS_VALUES,\n type ReactionType,\n type ReportReason,\n type ReportStatus,\n reactionTypeSchema,\n reportReasonSchema,\n reportStatusSchema,\n VISIBILITY_LEVEL_RANK,\n VISIBILITY_LEVEL_VALUES,\n type VisibilityLevel,\n visibilityLevelSchema,\n} from './enums.js';\n\n// ─── Feed (polymorphic union) ──────────────────────────────────────────────\nexport {\n type DonateItemFeedItem,\n donateItemFeedItemSchema,\n type FeedItem,\n type FeedQueryParams,\n type FeedResponse,\n feedItemSchema,\n feedQueryParamsSchema,\n feedResponseSchema,\n type LostFoundFeedItem,\n lostFoundFeedItemSchema,\n type VoiceBoxFeedItem,\n voiceBoxFeedItemSchema,\n} from './feed.js';\n\n// ─── Groups ────────────────────────────────────────────────────────────────\nexport {\n type AddGroupMembersBody,\n addGroupMembersBodySchema,\n type CommunityGroupWire,\n type CommunityGroupWithMembers,\n type CreateGroupBody,\n communityGroupWireSchema,\n communityGroupWithMembersSchema,\n createGroupBodySchema,\n type GroupMembersListResponse,\n type GroupMemberWire,\n type GroupRole,\n type GroupsListResponse,\n groupMembersListResponseSchema,\n groupMemberWireSchema,\n groupRoleSchema,\n groupsListResponseSchema,\n type UpdateGroupBody,\n updateGroupBodySchema,\n} from './group.js';\n\n// ─── Media ─────────────────────────────────────────────────────────────────\nexport {\n type PostImage,\n type PostVideo,\n postImageSchema,\n postVideoSchema,\n} from './media.js';\n\n// ─── Post ──────────────────────────────────────────────────────────────────\nexport {\n type CommunityPostWire,\n type CreatePostBody,\n communityPostWireSchema,\n createPostBodySchema,\n type PostAuthorSnapshot,\n postAuthorSnapshotSchema,\n type RepostedSource,\n repostedSourceSchema,\n type UpdatePostBody,\n updatePostBodySchema,\n} from './post.js';\n// ─── Profile + People list ─────────────────────────────────────────────────\nexport {\n type PeopleListItem,\n type PeopleListResponse,\n type PeopleQueryParams,\n type ProfileMutuals,\n type PublicProfileWire,\n peopleListItemSchema,\n peopleListResponseSchema,\n peopleQueryParamsSchema,\n profileMutualsSchema,\n publicProfileWireSchema,\n} from './profile.js';\n// ─── Reports (moderation) ──────────────────────────────────────────────────\nexport {\n type ReportContentBody,\n type ReportContentKind,\n type ReportRecordWire,\n type ReportSubmissionResponse,\n type ReportUserBody,\n reportContentBodySchema,\n reportContentKindSchema,\n reportRecordWireSchema,\n reportSubmissionResponseSchema,\n reportUserBodySchema,\n} from './report.js';\n// ─── Repost (quote / amplify) ──────────────────────────────────────────────\nexport {\n type CreateRepostBody,\n type CreateRepostResponse,\n createRepostBodySchema,\n createRepostResponseSchema,\n} from './repost.js';\n\n// ─── Settings ──────────────────────────────────────────────────────────────\nexport {\n type BlockedUsersListResponse,\n type BlockedUserWire,\n blockedUsersListResponseSchema,\n blockedUserWireSchema,\n COMMUNITY_SETTINGS_DEFAULTS,\n type CommunitySettingsWire,\n communitySettingsWireSchema,\n type UpdateCommunitySettingsBody,\n updateCommunitySettingsBodySchema,\n} from './settings.js';\n\n// ─── Social (follow) ───────────────────────────────────────────────────────\nexport {\n type ToggleFollowResponse,\n toggleFollowResponseSchema,\n type ViewerSocialState,\n viewerSocialStateSchema,\n} from './social.js';\n\n// ─── Username (URL handle + change / availability) ────────────────────────\nexport {\n type CurrentUsernameState,\n currentUsernameStateSchema,\n type UpdateUsernameBody,\n type UpdateUsernameResponse,\n USERNAME_MAX_LENGTH,\n USERNAME_MIN_LENGTH,\n USERNAME_PATTERN,\n USERNAME_UNAVAILABLE_REASONS,\n type Username,\n type UsernameAvailabilityResponse,\n type UsernameUnavailableReason,\n updateUsernameBodySchema,\n updateUsernameResponseSchema,\n usernameAvailabilityResponseSchema,\n usernameSchema,\n usernameUnavailableReasonSchema,\n} from './username.js';\n"]}
|
package/dist/post.d.ts
CHANGED
|
@@ -32,6 +32,31 @@ export declare const postAuthorSnapshotSchema: z.ZodObject<{
|
|
|
32
32
|
displayName: z.ZodString;
|
|
33
33
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
34
34
|
localName: z.ZodOptional<z.ZodString>;
|
|
35
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
36
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
37
|
+
volunteer: "volunteer";
|
|
38
|
+
chairman: "chairman";
|
|
39
|
+
vice_chairman: "vice_chairman";
|
|
40
|
+
president: "president";
|
|
41
|
+
vice_president: "vice_president";
|
|
42
|
+
secretary: "secretary";
|
|
43
|
+
joint_secretary: "joint_secretary";
|
|
44
|
+
general_secretary: "general_secretary";
|
|
45
|
+
treasurer: "treasurer";
|
|
46
|
+
joint_treasurer: "joint_treasurer";
|
|
47
|
+
organizer: "organizer";
|
|
48
|
+
coordinator: "coordinator";
|
|
49
|
+
spokesperson: "spokesperson";
|
|
50
|
+
founder: "founder";
|
|
51
|
+
co_founder: "co_founder";
|
|
52
|
+
patron: "patron";
|
|
53
|
+
advisor: "advisor";
|
|
54
|
+
mentor: "mentor";
|
|
55
|
+
committee_member: "committee_member";
|
|
56
|
+
member_at_large: "member_at_large";
|
|
57
|
+
}>>;
|
|
58
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
59
|
+
}, z.core.$strip>>>;
|
|
35
60
|
}, z.core.$strip>;
|
|
36
61
|
export type PostAuthorSnapshot = z.infer<typeof postAuthorSnapshotSchema>;
|
|
37
62
|
/**
|
|
@@ -63,6 +88,31 @@ export declare const repostedSourceSchema: z.ZodObject<{
|
|
|
63
88
|
displayName: z.ZodString;
|
|
64
89
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
65
90
|
localName: z.ZodOptional<z.ZodString>;
|
|
91
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
92
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
93
|
+
volunteer: "volunteer";
|
|
94
|
+
chairman: "chairman";
|
|
95
|
+
vice_chairman: "vice_chairman";
|
|
96
|
+
president: "president";
|
|
97
|
+
vice_president: "vice_president";
|
|
98
|
+
secretary: "secretary";
|
|
99
|
+
joint_secretary: "joint_secretary";
|
|
100
|
+
general_secretary: "general_secretary";
|
|
101
|
+
treasurer: "treasurer";
|
|
102
|
+
joint_treasurer: "joint_treasurer";
|
|
103
|
+
organizer: "organizer";
|
|
104
|
+
coordinator: "coordinator";
|
|
105
|
+
spokesperson: "spokesperson";
|
|
106
|
+
founder: "founder";
|
|
107
|
+
co_founder: "co_founder";
|
|
108
|
+
patron: "patron";
|
|
109
|
+
advisor: "advisor";
|
|
110
|
+
mentor: "mentor";
|
|
111
|
+
committee_member: "committee_member";
|
|
112
|
+
member_at_large: "member_at_large";
|
|
113
|
+
}>>;
|
|
114
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
115
|
+
}, z.core.$strip>>>;
|
|
66
116
|
}, z.core.$strip>;
|
|
67
117
|
title: z.ZodString;
|
|
68
118
|
body: z.ZodOptional<z.ZodString>;
|
|
@@ -86,6 +136,31 @@ export declare const communityPostWireSchema: z.ZodObject<{
|
|
|
86
136
|
displayName: z.ZodString;
|
|
87
137
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
88
138
|
localName: z.ZodOptional<z.ZodString>;
|
|
139
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
140
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
141
|
+
volunteer: "volunteer";
|
|
142
|
+
chairman: "chairman";
|
|
143
|
+
vice_chairman: "vice_chairman";
|
|
144
|
+
president: "president";
|
|
145
|
+
vice_president: "vice_president";
|
|
146
|
+
secretary: "secretary";
|
|
147
|
+
joint_secretary: "joint_secretary";
|
|
148
|
+
general_secretary: "general_secretary";
|
|
149
|
+
treasurer: "treasurer";
|
|
150
|
+
joint_treasurer: "joint_treasurer";
|
|
151
|
+
organizer: "organizer";
|
|
152
|
+
coordinator: "coordinator";
|
|
153
|
+
spokesperson: "spokesperson";
|
|
154
|
+
founder: "founder";
|
|
155
|
+
co_founder: "co_founder";
|
|
156
|
+
patron: "patron";
|
|
157
|
+
advisor: "advisor";
|
|
158
|
+
mentor: "mentor";
|
|
159
|
+
committee_member: "committee_member";
|
|
160
|
+
member_at_large: "member_at_large";
|
|
161
|
+
}>>;
|
|
162
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
163
|
+
}, z.core.$strip>>>;
|
|
89
164
|
}, z.core.$strip>;
|
|
90
165
|
text: z.ZodString;
|
|
91
166
|
images: z.ZodArray<z.ZodObject<{
|
|
@@ -130,6 +205,31 @@ export declare const communityPostWireSchema: z.ZodObject<{
|
|
|
130
205
|
displayName: z.ZodString;
|
|
131
206
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
132
207
|
localName: z.ZodOptional<z.ZodString>;
|
|
208
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
209
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
210
|
+
volunteer: "volunteer";
|
|
211
|
+
chairman: "chairman";
|
|
212
|
+
vice_chairman: "vice_chairman";
|
|
213
|
+
president: "president";
|
|
214
|
+
vice_president: "vice_president";
|
|
215
|
+
secretary: "secretary";
|
|
216
|
+
joint_secretary: "joint_secretary";
|
|
217
|
+
general_secretary: "general_secretary";
|
|
218
|
+
treasurer: "treasurer";
|
|
219
|
+
joint_treasurer: "joint_treasurer";
|
|
220
|
+
organizer: "organizer";
|
|
221
|
+
coordinator: "coordinator";
|
|
222
|
+
spokesperson: "spokesperson";
|
|
223
|
+
founder: "founder";
|
|
224
|
+
co_founder: "co_founder";
|
|
225
|
+
patron: "patron";
|
|
226
|
+
advisor: "advisor";
|
|
227
|
+
mentor: "mentor";
|
|
228
|
+
committee_member: "committee_member";
|
|
229
|
+
member_at_large: "member_at_large";
|
|
230
|
+
}>>;
|
|
231
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
232
|
+
}, z.core.$strip>>>;
|
|
133
233
|
}, z.core.$strip>;
|
|
134
234
|
title: z.ZodString;
|
|
135
235
|
body: z.ZodOptional<z.ZodString>;
|
package/dist/post.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../src/post.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../src/post.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8BnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAI1E;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuB/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAIlE;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyDlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAIxE;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;iBAO/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;iBAE/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/post.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { z } from 'zod';
|
|
12
12
|
import { areaLineageSnapshotSchema } from './area.js';
|
|
13
|
+
import { communityDesignationSchema } from './community.js';
|
|
13
14
|
import { POST_MAX_BODY_CHARS, POST_MAX_IMAGES, POST_MAX_VIDEOS } from './constants.js';
|
|
14
15
|
import { contentKindSchema } from './enums.js';
|
|
15
16
|
import { postImageSchema, postVideoSchema } from './media.js';
|
|
@@ -46,6 +47,22 @@ export const postAuthorSnapshotSchema = z.object({
|
|
|
46
47
|
* location.
|
|
47
48
|
*/
|
|
48
49
|
localName: z.string().optional(),
|
|
50
|
+
/**
|
|
51
|
+
* The author's community-scoped representation label, used to
|
|
52
|
+
* render "Hari Joshi (Chairman)" suffixes in feed-card bylines
|
|
53
|
+
* inside a community. **Live-joined** from `CommunityMembership`
|
|
54
|
+
* at read time (per the community + author pair), the same way
|
|
55
|
+
* `username` and `avatarUrl` are live-resolved — so a designation
|
|
56
|
+
* change propagates to old posts immediately.
|
|
57
|
+
*
|
|
58
|
+
* Populated only when the post lives inside a community
|
|
59
|
+
* (`communityId` set) AND the author has a designation set in
|
|
60
|
+
* that community. `null` otherwise. Global / cross-community feed
|
|
61
|
+
* surfaces (the feed tab, the profile page) leave this null even
|
|
62
|
+
* if the post is community-scoped — the byline there doesn't have
|
|
63
|
+
* a "current community" context to attach a designation to.
|
|
64
|
+
*/
|
|
65
|
+
designation: communityDesignationSchema.nullable().optional(),
|
|
49
66
|
});
|
|
50
67
|
// ─── Reposted source snapshot ──────────────────────────────────────────────
|
|
51
68
|
/**
|
package/dist/post.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.js","sourceRoot":"","sources":["../src/post.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAA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AO,EAAE,CAAC,CAAC,OAAO,EAAE;QACpB;;sDAE8C;QAC9C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC/B,+EAA+E;QAC/E,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;QACrB;;oDAE4C;QAC5C,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;KACtB,CAAC;SACD,QAAQ,EAAE;CACd,CAAC,CAAC;AAGH,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;IAChE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;IAChE;2DACuD;IACvD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC;CACjD,CAAC,CAAC","sourcesContent":["/**\n * Community post wire shapes.\n *\n * A \"post\" is the native community content kind (text-primary + media).\n * Lost-and-found and voice-box items show up in the same feed via\n * polymorphic union; their shapes live in their own schema packages\n * and are projected into a `FeedItem` envelope (see `./feed.ts`).\n *\n * @module community-schema/post\n */\n\nimport { z } from 'zod';\nimport { areaLineageSnapshotSchema } from './area.js';\nimport { POST_MAX_BODY_CHARS, POST_MAX_IMAGES, POST_MAX_VIDEOS } from './constants.js';\nimport { contentKindSchema } from './enums.js';\nimport { postImageSchema, postVideoSchema } from './media.js';\nimport { usernameSchema } from './username.js';\n\n// ─── Author snapshot (denormalised on every post) ──────────────────────────\n\n/**\n * The author's display info attached to every feed row.\n *\n * Two classes of fields here:\n *\n * - **Live (refreshed at read time)**: `username`, `displayName`,\n * `avatarUrl`. The projector batch-joins these against the User\n * collection per page, so a name or avatar change instantly\n * propagates to old posts and the byline link always targets the\n * CURRENT username (no stale `/oldhandle` 404 after a rename).\n *\n * - **Snapshotted at write time**: `localName`. This is \"where the\n * author was when posting\" — a deliberate snapshot, not a stale\n * read of their current location.\n *\n * @module community-schema/post (postAuthorSnapshotSchema)\n */\nexport const postAuthorSnapshotSchema = z.object({\n userId: z.string(),\n /** Public URL handle. Live-joined from User at read time so the\n * byline links to `/<currentUsername>` even after a rename. */\n username: usernameSchema,\n displayName: z.string(),\n avatarUrl: z.string().url().optional(),\n /**\n * The author's \"local\" area label at post time, e.g. \"Rohini Sector 15\".\n * Powers the byline \"<DisplayName> · <localName> · <relativeTime>\".\n * Snapshotted at write time — does NOT track the author's current\n * location.\n */\n localName: z.string().optional(),\n});\nexport type PostAuthorSnapshot = z.infer<typeof postAuthorSnapshotSchema>;\n\n// ─── Reposted source snapshot ──────────────────────────────────────────────\n\n/**\n * Compact embed shape used when a CommunityPost is a repost (caption +\n * optional quote of another item). Modelled after Twitter's quote-tweet\n * embed: byline + truncated text/title + first image + kind badge + the\n * moment-of-creation timestamp.\n *\n * Engagement counts are intentionally NOT included — they'd drift\n * relative to the live source. The card embeds this as a static teaser\n * that links to the source for the live numbers.\n *\n * Backend snapshots these fields at repost-create time from the source\n * row (post text / item title / first photo / status badge), so the\n * embed survives source edits / soft-deletes / hides — the user's\n * reaction at repost time is preserved.\n */\nexport const repostedSourceSchema = z.object({\n /** Which kind was reposted. Lets the embed render the right icon. */\n contentKind: contentKindSchema,\n /** Source row's id — tap-embed navigates to its thread / detail page. */\n _id: z.string(),\n /** Author snapshot of the source at repost time. */\n author: postAuthorSnapshotSchema,\n /** Primary text. For posts: the body text (truncated). For lost_found /\n * voice_box / donate_item: the title. */\n title: z.string(),\n /** Optional secondary line. For posts: unused. For legacy kinds: the\n * description (truncated server-side). */\n body: z.string().optional(),\n /** First image if any. */\n imageUrl: z.string().url().optional(),\n /** Small kind-specific badge:\n * - posts → undefined\n * - lost_found → 'lost' | 'found'\n * - voice_box → 'complaint' | 'suggestion'\n * - donate_item → 'PENDING' | 'VERIFIED' | 'AT_CENTER' | 'DONATED'\n */\n kindBadge: z.string().optional(),\n createdAt: z.string().datetime(),\n});\nexport type RepostedSource = z.infer<typeof repostedSourceSchema>;\n\n// ─── Wire shape — what the server returns ──────────────────────────────────\n\n/**\n * A community post as it appears in the feed and on the single-post\n * page. Engagement counts are denormalised onto the document for\n * fast feed sorting; the per-user reaction state (\"did I upvote this?\")\n * is computed at read time and returned in the `viewer` block.\n */\nexport const communityPostWireSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('post'),\n author: postAuthorSnapshotSchema,\n\n // Body — for a repost, this carries the caption (may be empty).\n text: z.string().max(POST_MAX_BODY_CHARS),\n images: z.array(postImageSchema).max(POST_MAX_IMAGES),\n videos: z.array(postVideoSchema).max(POST_MAX_VIDEOS),\n\n // Authorship area\n /** Snapshot of where the author was at write time. Drives the\n * area-proximity cascade and ranking in feed.service. */\n areaLineage: areaLineageSnapshotSchema,\n /** When set, the post is scoped to a topical community and is NOT\n * surfaced via the geo cascade. The community feed adds an explicit\n * `communityId` filter to its read queries. Posts authored from the\n * global composer leave this null. */\n communityId: z.string().optional(),\n\n // Denormalised engagement counters (drive feed sort + card render)\n upvoteCount: z.number().int().nonnegative(),\n commentCount: z.number().int().nonnegative(),\n /** How many times this post has been reposted. Incremented by the\n * repost endpoint; reposts of reposts are blocked server-side. */\n repostCount: z.number().int().nonnegative(),\n /** Map of `ReactionType` → count, e.g. { like: 4, love: 1 }. */\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n /** Source-snapshot when this post is a repost. Absent on regular posts.\n * The wrapper post owns its own engagement counters; this embed is\n * a static teaser of the original at repost time. */\n repostOf: repostedSourceSchema.optional(),\n\n // Lifecycle\n createdAt: z.string().datetime(),\n /** Last edit timestamp, or null if never edited. Edit window is\n * enforced by the server at write time, not by this schema. */\n editedAt: z.string().datetime().nullable(),\n deletedAt: z.string().datetime().nullable(),\n\n // Per-viewer state (filled by the server at read time)\n viewer: z\n .object({\n upvoted: z.boolean(),\n /** The reaction the viewer chose, or null. Mutually exclusive\n * with `upvoted` is intentionally NOT enforced — they're two\n * separate axes per the product decision. */\n reaction: z.string().nullable(),\n /** True when the viewer authored the post (controls edit / delete buttons). */\n isAuthor: z.boolean(),\n /** True when the viewer has already reposted this source. The\n * client uses this to render the repost button as \"already\n * reposted\" rather than as a fresh CTA. */\n reposted: z.boolean(),\n })\n .optional(),\n});\nexport type CommunityPostWire = z.infer<typeof communityPostWireSchema>;\n\n// ─── Create / update bodies ────────────────────────────────────────────────\n\n/**\n * What the client sends to `POST /api/v1/community/posts`. The author\n * is taken from the authenticated request; the area lineage is resolved\n * server-side from the user's `currentLocation` (the client cannot\n * spoof a different area).\n */\nexport const createPostBodySchema = z.object({\n text: z.string().min(1).max(POST_MAX_BODY_CHARS),\n images: z.array(postImageSchema).max(POST_MAX_IMAGES).optional(),\n videos: z.array(postVideoSchema).max(POST_MAX_VIDEOS).optional(),\n /** When set, the post is scoped to a topical community. The author\n * must be an active member; non-members get a 403. */\n communityId: z.string().optional(),\n});\nexport type CreatePostBody = z.infer<typeof createPostBodySchema>;\n\n/**\n * What the client sends to `PATCH /api/v1/community/posts/:id`. Only\n * the text body is editable — media additions / removals require a new\n * post (matches Twitter / FB convention).\n */\nexport const updatePostBodySchema = z.object({\n text: z.string().min(1).max(POST_MAX_BODY_CHARS),\n});\nexport type UpdatePostBody = z.infer<typeof updatePostBodySchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"post.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IACvD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC;CACjD,CAAC,CAAC","sourcesContent":["/**\n * Community post wire shapes.\n *\n * A \"post\" is the native community content kind (text-primary + media).\n * Lost-and-found and voice-box items show up in the same feed via\n * polymorphic union; their shapes live in their own schema packages\n * and are projected into a `FeedItem` envelope (see `./feed.ts`).\n *\n * @module community-schema/post\n */\n\nimport { z } from 'zod';\nimport { areaLineageSnapshotSchema } from './area.js';\nimport { communityDesignationSchema } from './community.js';\nimport { POST_MAX_BODY_CHARS, POST_MAX_IMAGES, POST_MAX_VIDEOS } from './constants.js';\nimport { contentKindSchema } from './enums.js';\nimport { postImageSchema, postVideoSchema } from './media.js';\nimport { usernameSchema } from './username.js';\n\n// ─── Author snapshot (denormalised on every post) ──────────────────────────\n\n/**\n * The author's display info attached to every feed row.\n *\n * Two classes of fields here:\n *\n * - **Live (refreshed at read time)**: `username`, `displayName`,\n * `avatarUrl`. The projector batch-joins these against the User\n * collection per page, so a name or avatar change instantly\n * propagates to old posts and the byline link always targets the\n * CURRENT username (no stale `/oldhandle` 404 after a rename).\n *\n * - **Snapshotted at write time**: `localName`. This is \"where the\n * author was when posting\" — a deliberate snapshot, not a stale\n * read of their current location.\n *\n * @module community-schema/post (postAuthorSnapshotSchema)\n */\nexport const postAuthorSnapshotSchema = z.object({\n userId: z.string(),\n /** Public URL handle. Live-joined from User at read time so the\n * byline links to `/<currentUsername>` even after a rename. */\n username: usernameSchema,\n displayName: z.string(),\n avatarUrl: z.string().url().optional(),\n /**\n * The author's \"local\" area label at post time, e.g. \"Rohini Sector 15\".\n * Powers the byline \"<DisplayName> · <localName> · <relativeTime>\".\n * Snapshotted at write time — does NOT track the author's current\n * location.\n */\n localName: z.string().optional(),\n /**\n * The author's community-scoped representation label, used to\n * render \"Hari Joshi (Chairman)\" suffixes in feed-card bylines\n * inside a community. **Live-joined** from `CommunityMembership`\n * at read time (per the community + author pair), the same way\n * `username` and `avatarUrl` are live-resolved — so a designation\n * change propagates to old posts immediately.\n *\n * Populated only when the post lives inside a community\n * (`communityId` set) AND the author has a designation set in\n * that community. `null` otherwise. Global / cross-community feed\n * surfaces (the feed tab, the profile page) leave this null even\n * if the post is community-scoped — the byline there doesn't have\n * a \"current community\" context to attach a designation to.\n */\n designation: communityDesignationSchema.nullable().optional(),\n});\nexport type PostAuthorSnapshot = z.infer<typeof postAuthorSnapshotSchema>;\n\n// ─── Reposted source snapshot ──────────────────────────────────────────────\n\n/**\n * Compact embed shape used when a CommunityPost is a repost (caption +\n * optional quote of another item). Modelled after Twitter's quote-tweet\n * embed: byline + truncated text/title + first image + kind badge + the\n * moment-of-creation timestamp.\n *\n * Engagement counts are intentionally NOT included — they'd drift\n * relative to the live source. The card embeds this as a static teaser\n * that links to the source for the live numbers.\n *\n * Backend snapshots these fields at repost-create time from the source\n * row (post text / item title / first photo / status badge), so the\n * embed survives source edits / soft-deletes / hides — the user's\n * reaction at repost time is preserved.\n */\nexport const repostedSourceSchema = z.object({\n /** Which kind was reposted. Lets the embed render the right icon. */\n contentKind: contentKindSchema,\n /** Source row's id — tap-embed navigates to its thread / detail page. */\n _id: z.string(),\n /** Author snapshot of the source at repost time. */\n author: postAuthorSnapshotSchema,\n /** Primary text. For posts: the body text (truncated). For lost_found /\n * voice_box / donate_item: the title. */\n title: z.string(),\n /** Optional secondary line. For posts: unused. For legacy kinds: the\n * description (truncated server-side). */\n body: z.string().optional(),\n /** First image if any. */\n imageUrl: z.string().url().optional(),\n /** Small kind-specific badge:\n * - posts → undefined\n * - lost_found → 'lost' | 'found'\n * - voice_box → 'complaint' | 'suggestion'\n * - donate_item → 'PENDING' | 'VERIFIED' | 'AT_CENTER' | 'DONATED'\n */\n kindBadge: z.string().optional(),\n createdAt: z.string().datetime(),\n});\nexport type RepostedSource = z.infer<typeof repostedSourceSchema>;\n\n// ─── Wire shape — what the server returns ──────────────────────────────────\n\n/**\n * A community post as it appears in the feed and on the single-post\n * page. Engagement counts are denormalised onto the document for\n * fast feed sorting; the per-user reaction state (\"did I upvote this?\")\n * is computed at read time and returned in the `viewer` block.\n */\nexport const communityPostWireSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('post'),\n author: postAuthorSnapshotSchema,\n\n // Body — for a repost, this carries the caption (may be empty).\n text: z.string().max(POST_MAX_BODY_CHARS),\n images: z.array(postImageSchema).max(POST_MAX_IMAGES),\n videos: z.array(postVideoSchema).max(POST_MAX_VIDEOS),\n\n // Authorship area\n /** Snapshot of where the author was at write time. Drives the\n * area-proximity cascade and ranking in feed.service. */\n areaLineage: areaLineageSnapshotSchema,\n /** When set, the post is scoped to a topical community and is NOT\n * surfaced via the geo cascade. The community feed adds an explicit\n * `communityId` filter to its read queries. Posts authored from the\n * global composer leave this null. */\n communityId: z.string().optional(),\n\n // Denormalised engagement counters (drive feed sort + card render)\n upvoteCount: z.number().int().nonnegative(),\n commentCount: z.number().int().nonnegative(),\n /** How many times this post has been reposted. Incremented by the\n * repost endpoint; reposts of reposts are blocked server-side. */\n repostCount: z.number().int().nonnegative(),\n /** Map of `ReactionType` → count, e.g. { like: 4, love: 1 }. */\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n /** Source-snapshot when this post is a repost. Absent on regular posts.\n * The wrapper post owns its own engagement counters; this embed is\n * a static teaser of the original at repost time. */\n repostOf: repostedSourceSchema.optional(),\n\n // Lifecycle\n createdAt: z.string().datetime(),\n /** Last edit timestamp, or null if never edited. Edit window is\n * enforced by the server at write time, not by this schema. */\n editedAt: z.string().datetime().nullable(),\n deletedAt: z.string().datetime().nullable(),\n\n // Per-viewer state (filled by the server at read time)\n viewer: z\n .object({\n upvoted: z.boolean(),\n /** The reaction the viewer chose, or null. Mutually exclusive\n * with `upvoted` is intentionally NOT enforced — they're two\n * separate axes per the product decision. */\n reaction: z.string().nullable(),\n /** True when the viewer authored the post (controls edit / delete buttons). */\n isAuthor: z.boolean(),\n /** True when the viewer has already reposted this source. The\n * client uses this to render the repost button as \"already\n * reposted\" rather than as a fresh CTA. */\n reposted: z.boolean(),\n })\n .optional(),\n});\nexport type CommunityPostWire = z.infer<typeof communityPostWireSchema>;\n\n// ─── Create / update bodies ────────────────────────────────────────────────\n\n/**\n * What the client sends to `POST /api/v1/community/posts`. The author\n * is taken from the authenticated request; the area lineage is resolved\n * server-side from the user's `currentLocation` (the client cannot\n * spoof a different area).\n */\nexport const createPostBodySchema = z.object({\n text: z.string().min(1).max(POST_MAX_BODY_CHARS),\n images: z.array(postImageSchema).max(POST_MAX_IMAGES).optional(),\n videos: z.array(postVideoSchema).max(POST_MAX_VIDEOS).optional(),\n /** When set, the post is scoped to a topical community. The author\n * must be an active member; non-members get a 403. */\n communityId: z.string().optional(),\n});\nexport type CreatePostBody = z.infer<typeof createPostBodySchema>;\n\n/**\n * What the client sends to `PATCH /api/v1/community/posts/:id`. Only\n * the text body is editable — media additions / removals require a new\n * post (matches Twitter / FB convention).\n */\nexport const updatePostBodySchema = z.object({\n text: z.string().min(1).max(POST_MAX_BODY_CHARS),\n});\nexport type UpdatePostBody = z.infer<typeof updatePostBodySchema>;\n"]}
|
package/dist/repost.d.ts
CHANGED
|
@@ -45,6 +45,31 @@ export declare const createRepostResponseSchema: z.ZodObject<{
|
|
|
45
45
|
displayName: z.ZodString;
|
|
46
46
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
47
47
|
localName: z.ZodOptional<z.ZodString>;
|
|
48
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
49
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
50
|
+
volunteer: "volunteer";
|
|
51
|
+
chairman: "chairman";
|
|
52
|
+
vice_chairman: "vice_chairman";
|
|
53
|
+
president: "president";
|
|
54
|
+
vice_president: "vice_president";
|
|
55
|
+
secretary: "secretary";
|
|
56
|
+
joint_secretary: "joint_secretary";
|
|
57
|
+
general_secretary: "general_secretary";
|
|
58
|
+
treasurer: "treasurer";
|
|
59
|
+
joint_treasurer: "joint_treasurer";
|
|
60
|
+
organizer: "organizer";
|
|
61
|
+
coordinator: "coordinator";
|
|
62
|
+
spokesperson: "spokesperson";
|
|
63
|
+
founder: "founder";
|
|
64
|
+
co_founder: "co_founder";
|
|
65
|
+
patron: "patron";
|
|
66
|
+
advisor: "advisor";
|
|
67
|
+
mentor: "mentor";
|
|
68
|
+
committee_member: "committee_member";
|
|
69
|
+
member_at_large: "member_at_large";
|
|
70
|
+
}>>;
|
|
71
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
72
|
+
}, z.core.$strip>>>;
|
|
48
73
|
}, z.core.$strip>;
|
|
49
74
|
text: z.ZodString;
|
|
50
75
|
images: z.ZodArray<z.ZodObject<{
|
|
@@ -89,6 +114,31 @@ export declare const createRepostResponseSchema: z.ZodObject<{
|
|
|
89
114
|
displayName: z.ZodString;
|
|
90
115
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
91
116
|
localName: z.ZodOptional<z.ZodString>;
|
|
117
|
+
designation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
118
|
+
preset: z.ZodNullable<z.ZodEnum<{
|
|
119
|
+
volunteer: "volunteer";
|
|
120
|
+
chairman: "chairman";
|
|
121
|
+
vice_chairman: "vice_chairman";
|
|
122
|
+
president: "president";
|
|
123
|
+
vice_president: "vice_president";
|
|
124
|
+
secretary: "secretary";
|
|
125
|
+
joint_secretary: "joint_secretary";
|
|
126
|
+
general_secretary: "general_secretary";
|
|
127
|
+
treasurer: "treasurer";
|
|
128
|
+
joint_treasurer: "joint_treasurer";
|
|
129
|
+
organizer: "organizer";
|
|
130
|
+
coordinator: "coordinator";
|
|
131
|
+
spokesperson: "spokesperson";
|
|
132
|
+
founder: "founder";
|
|
133
|
+
co_founder: "co_founder";
|
|
134
|
+
patron: "patron";
|
|
135
|
+
advisor: "advisor";
|
|
136
|
+
mentor: "mentor";
|
|
137
|
+
committee_member: "committee_member";
|
|
138
|
+
member_at_large: "member_at_large";
|
|
139
|
+
}>>;
|
|
140
|
+
custom: z.ZodNullable<z.ZodString>;
|
|
141
|
+
}, z.core.$strip>>>;
|
|
92
142
|
}, z.core.$strip>;
|
|
93
143
|
title: z.ZodString;
|
|
94
144
|
body: z.ZodOptional<z.ZodString>;
|
package/dist/repost.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repost.d.ts","sourceRoot":"","sources":["../src/repost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;iBASjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"repost.d.ts","sourceRoot":"","sources":["../src/repost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;iBASjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAErC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jansathi-community-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Shared Zod schemas + TypeScript types for the Jansathi hyperlocal community feature (feed, posts, engagement, social graph, groups, communities).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|