jansathi-community-schema 0.21.0 → 0.22.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/feed.d.ts CHANGED
@@ -505,6 +505,20 @@ export declare const feedItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
505
505
  bytes: z.ZodNumber;
506
506
  duration: z.ZodNumber;
507
507
  }, z.core.$strip>>;
508
+ linkPreview: z.ZodOptional<z.ZodObject<{
509
+ url: z.ZodString;
510
+ kind: z.ZodEnum<{
511
+ youtube: "youtube";
512
+ vimeo: "vimeo";
513
+ image: "image";
514
+ generic: "generic";
515
+ }>;
516
+ videoId: z.ZodOptional<z.ZodString>;
517
+ title: z.ZodOptional<z.ZodString>;
518
+ description: z.ZodOptional<z.ZodString>;
519
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
520
+ siteName: z.ZodOptional<z.ZodString>;
521
+ }, z.core.$strip>>;
508
522
  areaLineage: z.ZodObject<{
509
523
  countryId: z.ZodOptional<z.ZodString>;
510
524
  stateId: z.ZodOptional<z.ZodString>;
@@ -990,6 +1004,20 @@ export declare const feedResponseSchema: z.ZodObject<{
990
1004
  bytes: z.ZodNumber;
991
1005
  duration: z.ZodNumber;
992
1006
  }, z.core.$strip>>;
1007
+ linkPreview: z.ZodOptional<z.ZodObject<{
1008
+ url: z.ZodString;
1009
+ kind: z.ZodEnum<{
1010
+ youtube: "youtube";
1011
+ vimeo: "vimeo";
1012
+ image: "image";
1013
+ generic: "generic";
1014
+ }>;
1015
+ videoId: z.ZodOptional<z.ZodString>;
1016
+ title: z.ZodOptional<z.ZodString>;
1017
+ description: z.ZodOptional<z.ZodString>;
1018
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
1019
+ siteName: z.ZodOptional<z.ZodString>;
1020
+ }, z.core.$strip>>;
993
1021
  areaLineage: z.ZodObject<{
994
1022
  countryId: z.ZodOptional<z.ZodString>;
995
1023
  stateId: z.ZodOptional<z.ZodString>;
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -18,10 +18,11 @@ export { type AreaLineageSnapshot, areaLineageSnapshotSchema, } from './area.js'
18
18
  export { type CommunityCommentWire, type CreateCommentBody, communityCommentWireSchema, createCommentBodySchema, type UpdateCommentBody, updateCommentBodySchema, } from './comment.js';
19
19
  export { type AddOfficialModeratorBody, AREA_PICKER_LEVEL_VALUES, type AreaPickerItem, type AreaPickerLevel, type AreaPickerQuery, type AreaPickerResponse, addOfficialModeratorBodySchema, areaPickerItemSchema, areaPickerLevelSchema, areaPickerQuerySchema, areaPickerResponseSchema, COMMUNITY_CATEGORY_VALUES, COMMUNITY_DESIGNATION_PRESETS, COMMUNITY_DISCOVER_SORT_VALUES, COMMUNITY_KIND_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 CommunityKind, type CommunityListQuery, type CommunityListResponse, type CommunityMembershipStatus, type CommunityMembersListResponse, type CommunityMemberWire, type CommunityReach, type CommunityRole, type CommunityTag, type CommunityType, type CommunityVerifiedScope, type CommunityWire, type CreateCommunityBody, type CreateOfficialCommunityBody, communityCategorySchema, communityCenterCoordsSchema, communityDesignationPresetSchema, communityDesignationSchema, communityDiscoverSortSchema, communityKindSchema, communityListQuerySchema, communityListResponseSchema, communityMembershipStatusSchema, communityMembersListResponseSchema, communityMemberWireSchema, communityReachSchema, communityRoleSchema, communityTagSchema, communityTypeSchema, communityVerifiedScopeSchema, communityWireSchema, createCommunityBodySchema, createOfficialCommunityBodySchema, type HidePostBody, hidePostBodySchema, type JoinCommunityResponse, joinCommunityResponseSchema, OFFICIAL_COMMUNITY_AREA_KIND_VALUES, type OfficialCommunityAreaKind, officialCommunityAreaKindSchema, type SetMemberDesignationBody, type SetOfficialRepresentativeBody, setMemberDesignationBodySchema, setOfficialRepresentativeBodySchema, 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, POLL_DURATION_PRESETS_MS, POLL_MAX_DURATION_MS, POLL_MAX_OPTIONS, POLL_MIN_DURATION_MS, POLL_MIN_OPTIONS, POLL_OPTION_MAX_CHARS, POLL_OPTION_MIN_CHARS, POLL_QUESTION_MAX_CHARS, POLL_QUESTION_MIN_CHARS, POLLS_PAGE_SIZE, POST_MAX_BODY_CHARS, POST_MAX_IMAGE_BYTES, POST_MAX_IMAGES, POST_MAX_VIDEO_BYTES, POST_MAX_VIDEO_SECONDS, POST_MAX_VIDEOS, PROFILE_MAX_BIO_CHARS, REPLIES_PRELOAD_COUNT, } from './constants.js';
21
- export { type SetReactionBody, type SetReactionResponse, setReactionBodySchema, setReactionResponseSchema, type SetVoteBody, setVoteBodySchema, type SetVoteResponse, setVoteResponseSchema, type ToggleBookmarkResponse, toggleBookmarkResponseSchema, VOTE_VALUES, type VoteValue, voteValueSchema, } from './engagement.js';
21
+ export { type SetReactionBody, type SetReactionResponse, type SetVoteBody, type SetVoteResponse, setReactionBodySchema, setReactionResponseSchema, setVoteBodySchema, setVoteResponseSchema, type ToggleBookmarkResponse, toggleBookmarkResponseSchema, VOTE_VALUES, type VoteValue, voteValueSchema, } from './engagement.js';
22
22
  export { CONTENT_KIND_VALUES, type ContentKind, contentKindSchema, FEED_SORT_VALUES, type FeedSort, feedSortSchema, PROFILE_PRIVACY_VALUES, type ProfilePrivacy, profilePrivacySchema, REACTION_TYPE_VALUES, REPORT_REASON_VALUES, REPORT_STATUS_VALUES, type ReactionType, type ReportReason, type ReportStatus, reactionTypeSchema, reportReasonSchema, reportStatusSchema, VISIBILITY_LEVEL_RANK, VISIBILITY_LEVEL_VALUES, type VisibilityLevel, visibilityLevelSchema, } from './enums.js';
23
- export { DONATE_ITEM_CONDITION_VALUES, DONATE_ITEM_STATUS_VALUES, donateAuditAtSchema, donateAuditByAtSchema, donateDonatedToSchema, type DonateItemCondition, type DonateItemFeedItem, donateItemConditionSchema, donateItemFeedItemSchema, type DonateItemStatus, donateItemStatusSchema, type FeedItem, type FeedQueryParams, type FeedResponse, feedItemSchema, feedQueryParamsSchema, feedResponseSchema, LOST_FOUND_CATEGORY_VALUES, LOST_FOUND_STATUS_VALUES, type LostFoundCategory, lostFoundCategorySchema, type LostFoundFeedItem, lostFoundFeedItemSchema, type LostFoundStatus, lostFoundStatusSchema, VOICE_BOX_PRIORITY_VALUES, VOICE_BOX_STATUS_VALUES, voiceBoxAudioSchema, type VoiceBoxFeedItem, voiceBoxFeedItemSchema, voiceBoxLocationSchema, voiceBoxOfficerResponseSchema, type VoiceBoxPriority, voiceBoxPrioritySchema, type VoiceBoxStatus, voiceBoxStatusSchema, voiceBoxVideoSchema, } from './feed.js';
23
+ export { DONATE_ITEM_CONDITION_VALUES, DONATE_ITEM_STATUS_VALUES, type DonateItemCondition, type DonateItemFeedItem, type DonateItemStatus, donateAuditAtSchema, donateAuditByAtSchema, donateDonatedToSchema, donateItemConditionSchema, donateItemFeedItemSchema, donateItemStatusSchema, type FeedItem, type FeedQueryParams, type FeedResponse, feedItemSchema, feedQueryParamsSchema, feedResponseSchema, LOST_FOUND_CATEGORY_VALUES, LOST_FOUND_STATUS_VALUES, type LostFoundCategory, type LostFoundFeedItem, type LostFoundStatus, lostFoundCategorySchema, lostFoundFeedItemSchema, lostFoundStatusSchema, VOICE_BOX_PRIORITY_VALUES, VOICE_BOX_STATUS_VALUES, type VoiceBoxFeedItem, type VoiceBoxPriority, type VoiceBoxStatus, voiceBoxAudioSchema, voiceBoxFeedItemSchema, voiceBoxLocationSchema, voiceBoxOfficerResponseSchema, voiceBoxPrioritySchema, voiceBoxStatusSchema, voiceBoxVideoSchema, } from './feed.js';
24
24
  export { type AddGroupMembersBody, addGroupMembersBodySchema, type CommunityGroupWire, type CommunityGroupWithMembers, type CreateGroupBody, communityGroupWireSchema, communityGroupWithMembersSchema, createGroupBodySchema, type GroupMembersListResponse, type GroupMemberWire, type GroupRole, type GroupsListResponse, groupMembersListResponseSchema, groupMemberWireSchema, groupRoleSchema, groupsListResponseSchema, type UpdateGroupBody, updateGroupBodySchema, } from './group.js';
25
+ export { LINK_PREVIEW_KIND_VALUES, type LinkPreview, type LinkPreviewKind, linkPreviewKindSchema, linkPreviewSchema, } from './link-preview.js';
25
26
  export { type PostImage, type PostVideo, postImageSchema, postVideoSchema, } from './media.js';
26
27
  export { type CastVoteBody, type CommunityPollFeedItem, type CommunityPollWire, type CreatePollBody, castVoteBodySchema, communityPollFeedItemSchema, communityPollWireSchema, createPollBodySchema, POLL_RESULTS_VISIBILITY_VALUES, type PollOptionInput, type PollOptionWire, type PollResultsVisibility, pollOptionInputSchema, pollOptionWireSchema, pollResultsVisibilitySchema, type VoteResponse, voteResponseSchema, } from './poll.js';
27
28
  export { type CommunityPostWire, type CreatePostBody, communityPostWireSchema, createPostBodySchema, type PostAuthorSnapshot, postAuthorSnapshotSchema, type RepostedSource, repostedSourceSchema, type UpdatePostBody, updatePostBodySchema, } from './post.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EACL,KAAK,mBAAmB,EACxB,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,KAAK,wBAAwB,EAC7B,wBAAwB,EACxB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B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B,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
@@ -30,6 +30,8 @@ export { CONTENT_KIND_VALUES, contentKindSchema, FEED_SORT_VALUES, feedSortSchem
30
30
  export { DONATE_ITEM_CONDITION_VALUES, DONATE_ITEM_STATUS_VALUES, donateAuditAtSchema, donateAuditByAtSchema, donateDonatedToSchema, donateItemConditionSchema, donateItemFeedItemSchema, donateItemStatusSchema, feedItemSchema, feedQueryParamsSchema, feedResponseSchema, LOST_FOUND_CATEGORY_VALUES, LOST_FOUND_STATUS_VALUES, lostFoundCategorySchema, lostFoundFeedItemSchema, lostFoundStatusSchema, VOICE_BOX_PRIORITY_VALUES, VOICE_BOX_STATUS_VALUES, voiceBoxAudioSchema, voiceBoxFeedItemSchema, voiceBoxLocationSchema, voiceBoxOfficerResponseSchema, voiceBoxPrioritySchema, voiceBoxStatusSchema, voiceBoxVideoSchema, } from './feed.js';
31
31
  // ─── Groups ────────────────────────────────────────────────────────────────
32
32
  export { addGroupMembersBodySchema, communityGroupWireSchema, communityGroupWithMembersSchema, createGroupBodySchema, groupMembersListResponseSchema, groupMemberWireSchema, groupRoleSchema, groupsListResponseSchema, updateGroupBodySchema, } from './group.js';
33
+ // ─── Link preview (auto-extracted URL embed) ──────────────────────────────
34
+ export { LINK_PREVIEW_KIND_VALUES, linkPreviewKindSchema, linkPreviewSchema, } from './link-preview.js';
33
35
  // ─── Media ─────────────────────────────────────────────────────────────────
34
36
  export { postImageSchema, postVideoSchema, } from './media.js';
35
37
  // ─── Poll ──────────────────────────────────────────────────────────────────
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,EAEL,wBAAwB,EAKxB,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,kCAAkC,EAClC,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,E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MAAM,WAAW,CAAC;AACnB,8EAA8E;AAC9E,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EAOzB,sBAAsB,EACtB,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 type AddOfficialModeratorBody,\n AREA_PICKER_LEVEL_VALUES,\n type AreaPickerItem,\n type AreaPickerLevel,\n type AreaPickerQuery,\n type AreaPickerResponse,\n addOfficialModeratorBodySchema,\n areaPickerItemSchema,\n areaPickerLevelSchema,\n areaPickerQuerySchema,\n areaPickerResponseSchema,\n COMMUNITY_CATEGORY_VALUES,\n COMMUNITY_DESIGNATION_PRESETS,\n COMMUNITY_DISCOVER_SORT_VALUES,\n COMMUNITY_KIND_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 CommunityKind,\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 type CreateOfficialCommunityBody,\n communityCategorySchema,\n communityCenterCoordsSchema,\n communityDesignationPresetSchema,\n communityDesignationSchema,\n communityDiscoverSortSchema,\n communityKindSchema,\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 createOfficialCommunityBodySchema,\n type HidePostBody,\n hidePostBodySchema,\n type JoinCommunityResponse,\n joinCommunityResponseSchema,\n OFFICIAL_COMMUNITY_AREA_KIND_VALUES,\n type OfficialCommunityAreaKind,\n officialCommunityAreaKindSchema,\n type SetMemberDesignationBody,\n type SetOfficialRepresentativeBody,\n setMemberDesignationBodySchema,\n setOfficialRepresentativeBodySchema,\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 POLL_DURATION_PRESETS_MS,\n POLL_MAX_DURATION_MS,\n POLL_MAX_OPTIONS,\n POLL_MIN_DURATION_MS,\n POLL_MIN_OPTIONS,\n POLL_OPTION_MAX_CHARS,\n POLL_OPTION_MIN_CHARS,\n POLL_QUESTION_MAX_CHARS,\n POLL_QUESTION_MIN_CHARS,\n POLLS_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 (vote + reactions + bookmark) ─────────────────────────────\nexport {\n type SetReactionBody,\n type SetReactionResponse,\n setReactionBodySchema,\n setReactionResponseSchema,\n type SetVoteBody,\n setVoteBodySchema,\n type SetVoteResponse,\n setVoteResponseSchema,\n type ToggleBookmarkResponse,\n toggleBookmarkResponseSchema,\n VOTE_VALUES,\n type VoteValue,\n voteValueSchema,\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 DONATE_ITEM_CONDITION_VALUES,\n DONATE_ITEM_STATUS_VALUES,\n donateAuditAtSchema,\n donateAuditByAtSchema,\n donateDonatedToSchema,\n type DonateItemCondition,\n type DonateItemFeedItem,\n donateItemConditionSchema,\n donateItemFeedItemSchema,\n type DonateItemStatus,\n donateItemStatusSchema,\n type FeedItem,\n type FeedQueryParams,\n type FeedResponse,\n feedItemSchema,\n feedQueryParamsSchema,\n feedResponseSchema,\n LOST_FOUND_CATEGORY_VALUES,\n LOST_FOUND_STATUS_VALUES,\n type LostFoundCategory,\n lostFoundCategorySchema,\n type LostFoundFeedItem,\n lostFoundFeedItemSchema,\n type LostFoundStatus,\n lostFoundStatusSchema,\n VOICE_BOX_PRIORITY_VALUES,\n VOICE_BOX_STATUS_VALUES,\n voiceBoxAudioSchema,\n type VoiceBoxFeedItem,\n voiceBoxFeedItemSchema,\n voiceBoxLocationSchema,\n voiceBoxOfficerResponseSchema,\n type VoiceBoxPriority,\n voiceBoxPrioritySchema,\n type VoiceBoxStatus,\n voiceBoxStatusSchema,\n voiceBoxVideoSchema,\n} from './feed.js';\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// ─── Media ─────────────────────────────────────────────────────────────────\nexport {\n type PostImage,\n type PostVideo,\n postImageSchema,\n postVideoSchema,\n} from './media.js';\n// ─── Poll ──────────────────────────────────────────────────────────────────\nexport {\n type CastVoteBody,\n type CommunityPollFeedItem,\n type CommunityPollWire,\n type CreatePollBody,\n castVoteBodySchema,\n communityPollFeedItemSchema,\n communityPollWireSchema,\n createPollBodySchema,\n POLL_RESULTS_VISIBILITY_VALUES,\n type PollOptionInput,\n type PollOptionWire,\n type PollResultsVisibility,\n pollOptionInputSchema,\n pollOptionWireSchema,\n pollResultsVisibilitySchema,\n type VoteResponse,\n voteResponseSchema,\n} from './poll.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 PEOPLE_LIST_FILTER_DEFAULT,\n PEOPLE_LIST_FILTER_VALUES,\n type PeopleListFilter,\n type PeopleListItem,\n type PeopleListResponse,\n type PeopleQueryParams,\n type ProfileMutuals,\n type PublicProfileWire,\n peopleListFilterSchema,\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,EAEL,wBAAwB,EAKxB,8BAA8B,EAC9B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,kCAAkC,EAClC,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,+BAA+B,EAoB/B,uBAAuB,EACvB,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,mBAAmB,EACnB,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,EACzB,iCAAiC,EAEjC,kBAAkB,EAElB,2BAA2B,EAC3B,mCAAmC,EAEnC,+BAA+B,EAG/B,8BAA8B,EAC9B,mCAAmC,EAGnC,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,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A0B,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 type AddOfficialModeratorBody,\n AREA_PICKER_LEVEL_VALUES,\n type AreaPickerItem,\n type AreaPickerLevel,\n type AreaPickerQuery,\n type AreaPickerResponse,\n addOfficialModeratorBodySchema,\n areaPickerItemSchema,\n areaPickerLevelSchema,\n areaPickerQuerySchema,\n areaPickerResponseSchema,\n COMMUNITY_CATEGORY_VALUES,\n COMMUNITY_DESIGNATION_PRESETS,\n COMMUNITY_DISCOVER_SORT_VALUES,\n COMMUNITY_KIND_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 CommunityKind,\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 type CreateOfficialCommunityBody,\n communityCategorySchema,\n communityCenterCoordsSchema,\n communityDesignationPresetSchema,\n communityDesignationSchema,\n communityDiscoverSortSchema,\n communityKindSchema,\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 createOfficialCommunityBodySchema,\n type HidePostBody,\n hidePostBodySchema,\n type JoinCommunityResponse,\n joinCommunityResponseSchema,\n OFFICIAL_COMMUNITY_AREA_KIND_VALUES,\n type OfficialCommunityAreaKind,\n officialCommunityAreaKindSchema,\n type SetMemberDesignationBody,\n type SetOfficialRepresentativeBody,\n setMemberDesignationBodySchema,\n setOfficialRepresentativeBodySchema,\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 POLL_DURATION_PRESETS_MS,\n POLL_MAX_DURATION_MS,\n POLL_MAX_OPTIONS,\n POLL_MIN_DURATION_MS,\n POLL_MIN_OPTIONS,\n POLL_OPTION_MAX_CHARS,\n POLL_OPTION_MIN_CHARS,\n POLL_QUESTION_MAX_CHARS,\n POLL_QUESTION_MIN_CHARS,\n POLLS_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 (vote + reactions + bookmark) ─────────────────────────────\nexport {\n type SetReactionBody,\n type SetReactionResponse,\n type SetVoteBody,\n type SetVoteResponse,\n setReactionBodySchema,\n setReactionResponseSchema,\n setVoteBodySchema,\n setVoteResponseSchema,\n type ToggleBookmarkResponse,\n toggleBookmarkResponseSchema,\n VOTE_VALUES,\n type VoteValue,\n voteValueSchema,\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 DONATE_ITEM_CONDITION_VALUES,\n DONATE_ITEM_STATUS_VALUES,\n type DonateItemCondition,\n type DonateItemFeedItem,\n type DonateItemStatus,\n donateAuditAtSchema,\n donateAuditByAtSchema,\n donateDonatedToSchema,\n donateItemConditionSchema,\n donateItemFeedItemSchema,\n donateItemStatusSchema,\n type FeedItem,\n type FeedQueryParams,\n type FeedResponse,\n feedItemSchema,\n feedQueryParamsSchema,\n feedResponseSchema,\n LOST_FOUND_CATEGORY_VALUES,\n LOST_FOUND_STATUS_VALUES,\n type LostFoundCategory,\n type LostFoundFeedItem,\n type LostFoundStatus,\n lostFoundCategorySchema,\n lostFoundFeedItemSchema,\n lostFoundStatusSchema,\n VOICE_BOX_PRIORITY_VALUES,\n VOICE_BOX_STATUS_VALUES,\n type VoiceBoxFeedItem,\n type VoiceBoxPriority,\n type VoiceBoxStatus,\n voiceBoxAudioSchema,\n voiceBoxFeedItemSchema,\n voiceBoxLocationSchema,\n voiceBoxOfficerResponseSchema,\n voiceBoxPrioritySchema,\n voiceBoxStatusSchema,\n voiceBoxVideoSchema,\n} from './feed.js';\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// ─── Link preview (auto-extracted URL embed) ──────────────────────────────\nexport {\n LINK_PREVIEW_KIND_VALUES,\n type LinkPreview,\n type LinkPreviewKind,\n linkPreviewKindSchema,\n linkPreviewSchema,\n} from './link-preview.js';\n// ─── Media ─────────────────────────────────────────────────────────────────\nexport {\n type PostImage,\n type PostVideo,\n postImageSchema,\n postVideoSchema,\n} from './media.js';\n// ─── Poll ──────────────────────────────────────────────────────────────────\nexport {\n type CastVoteBody,\n type CommunityPollFeedItem,\n type CommunityPollWire,\n type CreatePollBody,\n castVoteBodySchema,\n communityPollFeedItemSchema,\n communityPollWireSchema,\n createPollBodySchema,\n POLL_RESULTS_VISIBILITY_VALUES,\n type PollOptionInput,\n type PollOptionWire,\n type PollResultsVisibility,\n pollOptionInputSchema,\n pollOptionWireSchema,\n pollResultsVisibilitySchema,\n type VoteResponse,\n voteResponseSchema,\n} from './poll.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 PEOPLE_LIST_FILTER_DEFAULT,\n PEOPLE_LIST_FILTER_VALUES,\n type PeopleListFilter,\n type PeopleListItem,\n type PeopleListResponse,\n type PeopleQueryParams,\n type ProfileMutuals,\n type PublicProfileWire,\n peopleListFilterSchema,\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"]}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Link-preview wire shape — auto-extracted URL embed metadata attached
3
+ * to a community post.
4
+ *
5
+ * Pattern (matches Slack / Twitter / Facebook / WhatsApp): the server
6
+ * scans the post body at write time, picks the first eligible URL, and
7
+ * persists a small metadata blob alongside the post. Read-time renderers
8
+ * just consume the persisted blob and draw the matching embed; they do
9
+ * NOT re-extract or re-fetch. Snapshot-on-publish is what keeps the
10
+ * feed cheap and the embed stable when external sites redesign or die.
11
+ *
12
+ * Phase 1 covers the three kinds the server can resolve from the URL
13
+ * alone, with no outbound HTTP:
14
+ *
15
+ * - `youtube` — youtube.com / youtu.be / youtube.com/shorts. `videoId`
16
+ * is the 11-char ID. The renderer derives the thumbnail and embed
17
+ * iframe URL from the id.
18
+ * - `vimeo` — vimeo.com/<id>. Same pattern.
19
+ * - `image` — direct .jpg / .jpeg / .png / .webp / .gif link.
20
+ *
21
+ * Phase 2 will add `generic`, where the server fetches the URL and
22
+ * parses OpenGraph / Twitter Card meta tags into title + description +
23
+ * thumbnail. The wire shape already includes those optional fields so
24
+ * the renderer can light up without a schema bump.
25
+ *
26
+ * @module community-schema/link-preview
27
+ */
28
+ import { z } from 'zod';
29
+ export declare const LINK_PREVIEW_KIND_VALUES: readonly ["youtube", "vimeo", "image", "generic"];
30
+ export declare const linkPreviewKindSchema: z.ZodEnum<{
31
+ youtube: "youtube";
32
+ vimeo: "vimeo";
33
+ image: "image";
34
+ generic: "generic";
35
+ }>;
36
+ export type LinkPreviewKind = z.infer<typeof linkPreviewKindSchema>;
37
+ /**
38
+ * Auto-extracted embed for the first eligible URL in a post body.
39
+ * Server-derived; the client never writes this. Optional on the wire —
40
+ * posts with no URL in the body don't carry it.
41
+ */
42
+ export declare const linkPreviewSchema: z.ZodObject<{
43
+ url: z.ZodString;
44
+ kind: z.ZodEnum<{
45
+ youtube: "youtube";
46
+ vimeo: "vimeo";
47
+ image: "image";
48
+ generic: "generic";
49
+ }>;
50
+ videoId: z.ZodOptional<z.ZodString>;
51
+ title: z.ZodOptional<z.ZodString>;
52
+ description: z.ZodOptional<z.ZodString>;
53
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
54
+ siteName: z.ZodOptional<z.ZodString>;
55
+ }, z.core.$strip>;
56
+ export type LinkPreview = z.infer<typeof linkPreviewSchema>;
57
+ //# sourceMappingURL=link-preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-preview.d.ts","sourceRoot":"","sources":["../src/link-preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,wBAAwB,mDAAoD,CAAC;AAC1F,eAAO,MAAM,qBAAqB;;;;;EAAmC,CAAC;AACtE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;iBAwB5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Link-preview wire shape — auto-extracted URL embed metadata attached
3
+ * to a community post.
4
+ *
5
+ * Pattern (matches Slack / Twitter / Facebook / WhatsApp): the server
6
+ * scans the post body at write time, picks the first eligible URL, and
7
+ * persists a small metadata blob alongside the post. Read-time renderers
8
+ * just consume the persisted blob and draw the matching embed; they do
9
+ * NOT re-extract or re-fetch. Snapshot-on-publish is what keeps the
10
+ * feed cheap and the embed stable when external sites redesign or die.
11
+ *
12
+ * Phase 1 covers the three kinds the server can resolve from the URL
13
+ * alone, with no outbound HTTP:
14
+ *
15
+ * - `youtube` — youtube.com / youtu.be / youtube.com/shorts. `videoId`
16
+ * is the 11-char ID. The renderer derives the thumbnail and embed
17
+ * iframe URL from the id.
18
+ * - `vimeo` — vimeo.com/<id>. Same pattern.
19
+ * - `image` — direct .jpg / .jpeg / .png / .webp / .gif link.
20
+ *
21
+ * Phase 2 will add `generic`, where the server fetches the URL and
22
+ * parses OpenGraph / Twitter Card meta tags into title + description +
23
+ * thumbnail. The wire shape already includes those optional fields so
24
+ * the renderer can light up without a schema bump.
25
+ *
26
+ * @module community-schema/link-preview
27
+ */
28
+ import { z } from 'zod';
29
+ export const LINK_PREVIEW_KIND_VALUES = ['youtube', 'vimeo', 'image', 'generic'];
30
+ export const linkPreviewKindSchema = z.enum(LINK_PREVIEW_KIND_VALUES);
31
+ /**
32
+ * Auto-extracted embed for the first eligible URL in a post body.
33
+ * Server-derived; the client never writes this. Optional on the wire —
34
+ * posts with no URL in the body don't carry it.
35
+ */
36
+ export const linkPreviewSchema = z.object({
37
+ /** The exact URL the server extracted from `post.text`. Normalised
38
+ * (trailing slashes stripped, tracking params removed for YouTube)
39
+ * so the same video posted twice shares cache hits. */
40
+ url: z.string().url(),
41
+ kind: linkPreviewKindSchema,
42
+ /** Provider video id — populated for `youtube` and `vimeo`. The
43
+ * renderer derives the thumbnail and iframe src from this; we do
44
+ * not persist the iframe URL itself. */
45
+ videoId: z.string().max(64).optional(),
46
+ /** Display title — for Phase 1 kinds we leave this blank since we
47
+ * don't make an outbound fetch to learn it. Phase 2 fills this from
48
+ * `<meta property="og:title">`. */
49
+ title: z.string().max(200).optional(),
50
+ /** Display description, capped to the typical OG abstract length. */
51
+ description: z.string().max(400).optional(),
52
+ /** Image asset URL. For `youtube` / `vimeo` the renderer constructs
53
+ * this from `videoId` so we leave it empty here. For `image` it IS
54
+ * the URL itself. Phase 2 will use `<meta property="og:image">`. */
55
+ thumbnailUrl: z.string().url().optional(),
56
+ /** Hostname-derived label rendered next to the title in the generic
57
+ * card variant. Phase 2 derives from `<meta property="og:site_name">`
58
+ * with a fallback to the URL hostname. */
59
+ siteName: z.string().max(100).optional(),
60
+ });
61
+ //# sourceMappingURL=link-preview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-preview.js","sourceRoot":"","sources":["../src/link-preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAU,CAAC;AAC1F,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;AAGtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC;;4DAEwD;IACxD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACrB,IAAI,EAAE,qBAAqB;IAC3B;;6CAEyC;IACzC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtC;;wCAEoC;IACpC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACrC,qEAAqE;IACrE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC3C;;yEAEqE;IACrE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACzC;;+CAE2C;IAC3C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAC","sourcesContent":["/**\n * Link-preview wire shape — auto-extracted URL embed metadata attached\n * to a community post.\n *\n * Pattern (matches Slack / Twitter / Facebook / WhatsApp): the server\n * scans the post body at write time, picks the first eligible URL, and\n * persists a small metadata blob alongside the post. Read-time renderers\n * just consume the persisted blob and draw the matching embed; they do\n * NOT re-extract or re-fetch. Snapshot-on-publish is what keeps the\n * feed cheap and the embed stable when external sites redesign or die.\n *\n * Phase 1 covers the three kinds the server can resolve from the URL\n * alone, with no outbound HTTP:\n *\n * - `youtube` — youtube.com / youtu.be / youtube.com/shorts. `videoId`\n * is the 11-char ID. The renderer derives the thumbnail and embed\n * iframe URL from the id.\n * - `vimeo` — vimeo.com/<id>. Same pattern.\n * - `image` — direct .jpg / .jpeg / .png / .webp / .gif link.\n *\n * Phase 2 will add `generic`, where the server fetches the URL and\n * parses OpenGraph / Twitter Card meta tags into title + description +\n * thumbnail. The wire shape already includes those optional fields so\n * the renderer can light up without a schema bump.\n *\n * @module community-schema/link-preview\n */\n\nimport { z } from 'zod';\n\nexport const LINK_PREVIEW_KIND_VALUES = ['youtube', 'vimeo', 'image', 'generic'] as const;\nexport const linkPreviewKindSchema = z.enum(LINK_PREVIEW_KIND_VALUES);\nexport type LinkPreviewKind = z.infer<typeof linkPreviewKindSchema>;\n\n/**\n * Auto-extracted embed for the first eligible URL in a post body.\n * Server-derived; the client never writes this. Optional on the wire —\n * posts with no URL in the body don't carry it.\n */\nexport const linkPreviewSchema = z.object({\n /** The exact URL the server extracted from `post.text`. Normalised\n * (trailing slashes stripped, tracking params removed for YouTube)\n * so the same video posted twice shares cache hits. */\n url: z.string().url(),\n kind: linkPreviewKindSchema,\n /** Provider video id — populated for `youtube` and `vimeo`. The\n * renderer derives the thumbnail and iframe src from this; we do\n * not persist the iframe URL itself. */\n videoId: z.string().max(64).optional(),\n /** Display title — for Phase 1 kinds we leave this blank since we\n * don't make an outbound fetch to learn it. Phase 2 fills this from\n * `<meta property=\"og:title\">`. */\n title: z.string().max(200).optional(),\n /** Display description, capped to the typical OG abstract length. */\n description: z.string().max(400).optional(),\n /** Image asset URL. For `youtube` / `vimeo` the renderer constructs\n * this from `videoId` so we leave it empty here. For `image` it IS\n * the URL itself. Phase 2 will use `<meta property=\"og:image\">`. */\n thumbnailUrl: z.string().url().optional(),\n /** Hostname-derived label rendered next to the title in the generic\n * card variant. Phase 2 derives from `<meta property=\"og:site_name\">`\n * with a fallback to the URL hostname. */\n siteName: z.string().max(100).optional(),\n});\nexport type LinkPreview = z.infer<typeof linkPreviewSchema>;\n"]}
package/dist/poll.js CHANGED
@@ -31,8 +31,8 @@
31
31
  */
32
32
  import { z } from 'zod';
33
33
  import { areaLineageSnapshotSchema } from './area.js';
34
- import { voteValueSchema } from './engagement.js';
35
34
  import { POLL_MAX_DURATION_MS, POLL_MAX_OPTIONS, POLL_MIN_DURATION_MS, POLL_MIN_OPTIONS, POLL_OPTION_MAX_CHARS, POLL_OPTION_MIN_CHARS, POLL_QUESTION_MAX_CHARS, POLL_QUESTION_MIN_CHARS, } from './constants.js';
35
+ import { voteValueSchema } from './engagement.js';
36
36
  import { postAuthorSnapshotSchema } from './post.js';
37
37
  // ─── Results visibility ────────────────────────────────────────────────────
38
38
  /**
package/dist/poll.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"poll.js","sourceRoot":"","sources":["../src/poll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,8EAA8E;AAE9E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,MAAM,EAAE,aAAa,CAAU,CAAC;AAC/E,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;AAGlF,8EAA8E;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,gBAAgB,GAAG,CAAC,CAAC;IAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,qBAAqB,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SACb,KAAK,CACJ,CAAC;SACE,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAC7B;SACA,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,gBAAgB,CAAC;CACzB,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,uBAAuB;CAC9B,CAAC,CAAC","sourcesContent":["/**\n * Community poll wire shapes.\n *\n * A poll is a structured-choice feed item: a question + 2..6 options +\n * a fixed expiry. Lives in its own `community_polls` collection (NOT\n * an extension of `CommunityPost`); votes live in a separate\n * `poll_votes` collection keyed by `(pollId, userId)`. Per-option vote\n * counts + total-voter count are denormalised onto the poll so a feed\n * read serves the whole card in one document fetch.\n *\n * Industry alignment:\n * - Twitter / X: single-select, time-limited (5min..7d), results live.\n * - WhatsApp / Telegram: single OR multi-select, time-limited.\n * - Facebook: single OR multi-select, results live, no expiry.\n * - Reddit: single-select, 6h..7d, results post-vote.\n *\n * Our design:\n * - Required expiry, 5min..30d. Composer presets 1d / 3d / 7d / 14d.\n * - Author opts in for multi-select via `allowsMultipleChoices`.\n * - Author opts in for results-after-close (default: live) via\n * `resultsVisibility`. Server hides per-option counts on the wire\n * when the poll is still open AND `resultsVisibility === 'after_close'`,\n * so a peeking viewer can't fish results out of the API.\n *\n * Edits are NOT supported: changing question / options / expiry after\n * a vote has been cast would invalidate that vote. The author can\n * delete (soft-delete, freezes the poll) or close-early (sets\n * `closesAt` to now), but not edit.\n *\n * @module community-schema/poll\n */\n\nimport { z } from 'zod';\nimport { areaLineageSnapshotSchema } from './area.js';\nimport { voteValueSchema } from './engagement.js';\nimport {\n POLL_MAX_DURATION_MS,\n POLL_MAX_OPTIONS,\n POLL_MIN_DURATION_MS,\n POLL_MIN_OPTIONS,\n POLL_OPTION_MAX_CHARS,\n POLL_OPTION_MIN_CHARS,\n POLL_QUESTION_MAX_CHARS,\n POLL_QUESTION_MIN_CHARS,\n} from './constants.js';\nimport { postAuthorSnapshotSchema } from './post.js';\n\n// ─── Results visibility ────────────────────────────────────────────────────\n\n/**\n * When per-option vote counts become visible to voters.\n *\n * - `live` — counts visible to everyone, always. Default;\n * matches Facebook / Telegram. Encourages\n * engagement via \"see what's winning\".\n * - `after_close` — counts hidden until the poll closes. The wire\n * shape's option counts are server-replaced with\n * `0` during the open window so a curious viewer\n * can't fish results out via the JSON. Best for\n * genuinely-blind decisions (community polls\n * about admin selection, etc.).\n */\nexport const POLL_RESULTS_VISIBILITY_VALUES = ['live', 'after_close'] as const;\nexport const pollResultsVisibilitySchema = z.enum(POLL_RESULTS_VISIBILITY_VALUES);\nexport type PollResultsVisibility = z.infer<typeof pollResultsVisibilitySchema>;\n\n// ─── Poll option (denormalised on the poll doc) ────────────────────────────\n\n/**\n * One choice in the poll. `index` is the canonical identifier the vote\n * body refers to (a stable integer 0..N-1 — letting the client send\n * indices instead of labels avoids hash-collision games with non-ASCII\n * labels). `voteCount` is the denormalised aggregate, updated atomically\n * by the vote endpoint and zeroed on the wire when `resultsVisibility`\n * is `after_close` AND the poll is still open.\n */\nexport const pollOptionWireSchema = z.object({\n index: z\n .number()\n .int()\n .min(0)\n .max(POLL_MAX_OPTIONS - 1),\n label: z.string().min(POLL_OPTION_MIN_CHARS).max(POLL_OPTION_MAX_CHARS),\n voteCount: z.number().int().nonnegative(),\n});\nexport type PollOptionWire = z.infer<typeof pollOptionWireSchema>;\n\n/** Composer-side option (no vote count yet). */\nexport const pollOptionInputSchema = z.object({\n label: z.string().trim().min(POLL_OPTION_MIN_CHARS).max(POLL_OPTION_MAX_CHARS),\n});\nexport type PollOptionInput = z.infer<typeof pollOptionInputSchema>;\n\n// ─── Wire shape — what the server returns ──────────────────────────────────\n\n/**\n * A community poll as it appears in the feed and on a poll detail\n * page. Engagement counts mirror the post wire so the same engagement\n * bar component renders for every kind.\n */\nexport const communityPollWireSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('poll'),\n author: postAuthorSnapshotSchema,\n\n /** The poll question. Renders as the card's primary text. */\n question: z.string().min(POLL_QUESTION_MIN_CHARS).max(POLL_QUESTION_MAX_CHARS),\n /** Options 0..N-1 (N in `[POLL_MIN_OPTIONS, POLL_MAX_OPTIONS]`).\n * Per-option `voteCount` is zeroed on the wire while the poll is\n * open AND `resultsVisibility === 'after_close'` (the\n * total-voters count is still surfaced so the card can show\n * \"X voted\" without revealing how it splits). */\n options: z.array(pollOptionWireSchema).min(POLL_MIN_OPTIONS).max(POLL_MAX_OPTIONS),\n\n /** Number of UNIQUE voters. Always visible — even when option\n * counts are hidden — so the card can render \"X have voted\" as a\n * social proof signal. */\n totalVoters: z.number().int().nonnegative(),\n\n /** `true` when the author let voters pick more than one option. */\n allowsMultipleChoices: z.boolean(),\n /** Results visibility policy. See `pollResultsVisibilitySchema`. */\n resultsVisibility: pollResultsVisibilitySchema,\n\n /** ISO-string. The poll is closed when this is `<= now()`. Vote\n * endpoints reject after this; the client also hides the Vote CTA. */\n closesAt: z.string().datetime(),\n\n // Authorship area + scope (identical to communityPostWireSchema)\n areaLineage: areaLineageSnapshotSchema,\n communityId: z.string().optional(),\n\n // Denormalised engagement counters\n /** Net score = upvotes - downvotes. Signed — can be negative. */\n score: z.number().int(),\n commentCount: z.number().int().nonnegative(),\n repostCount: z.number().int().nonnegative(),\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n // Lifecycle\n createdAt: z.string().datetime(),\n /** Polls are never edited (see module docstring); editedAt is kept\n * on the wire as `null` for parity with the post envelope so card\n * templates can share a single byline component. */\n editedAt: z.string().datetime().nullable(),\n deletedAt: z.string().datetime().nullable(),\n\n // Per-viewer state (filled at read time)\n viewer: z\n .object({\n vote: voteValueSchema.nullable(),\n reaction: z.string().nullable(),\n bookmarked: z.boolean(),\n isAuthor: z.boolean(),\n reposted: z.boolean(),\n /** Indices the viewer voted for. Empty array means \"hasn't\n * voted yet\". Populated for every viewer regardless of\n * `resultsVisibility` — a voter can always see their own\n * choice. */\n votedOptionIndices: z.array(z.number().int().nonnegative()),\n })\n .optional(),\n});\nexport type CommunityPollWire = z.infer<typeof communityPollWireSchema>;\n\n// ─── Feed envelope ─────────────────────────────────────────────────────────\n\n/**\n * Same shape as `communityPollWireSchema` — the wire IS the feed\n * envelope (no pruning needed because polls are compact: a question +\n * ≤6 short option labels + counters). Aliased so consumers can import\n * the feed-envelope name in parallel with the existing lostFound /\n * voiceBox / donateItem envelopes.\n */\nexport const communityPollFeedItemSchema = communityPollWireSchema;\nexport type CommunityPollFeedItem = z.infer<typeof communityPollFeedItemSchema>;\n\n// ─── Create body ───────────────────────────────────────────────────────────\n\n/**\n * Composer payload: what the frontend sends to\n * `POST /api/v1/community/polls`. Author + areaLineage + initial vote\n * counts are filled server-side from the authenticated request and\n * cannot be spoofed by the client.\n */\nexport const createPollBodySchema = z\n .object({\n question: z.string().trim().min(POLL_QUESTION_MIN_CHARS).max(POLL_QUESTION_MAX_CHARS),\n options: z.array(pollOptionInputSchema).min(POLL_MIN_OPTIONS).max(POLL_MAX_OPTIONS),\n /** Duration in milliseconds from now until `closesAt`. Validated\n * against `POLL_MIN_DURATION_MS` / `POLL_MAX_DURATION_MS`. The\n * server resolves `closesAt = createdAt + durationMs` instead of\n * taking an absolute date so clock skew between client and server\n * can't push a poll into the past. */\n durationMs: z.number().int().min(POLL_MIN_DURATION_MS).max(POLL_MAX_DURATION_MS),\n allowsMultipleChoices: z.boolean(),\n resultsVisibility: pollResultsVisibilitySchema,\n /** Optional community scope. If set the author must be an active\n * member of the community — the server checks. */\n communityId: z.string().optional(),\n })\n .refine(\n (b) => {\n // Options must be unique by their trimmed label — duplicate\n // options fragment votes and confuse voters.\n const seen = new Set<string>();\n for (const o of b.options) {\n const k = o.label.trim().toLowerCase();\n if (seen.has(k)) return false;\n seen.add(k);\n }\n return true;\n },\n { message: 'Poll options must be unique', path: ['options'] },\n );\nexport type CreatePollBody = z.infer<typeof createPollBodySchema>;\n\n// ─── Vote body + response ──────────────────────────────────────────────────\n\n/**\n * What the client sends to `POST /api/v1/community/polls/:id/votes`\n * (cast OR change a vote — the server upserts on `(pollId, userId)`).\n *\n * For single-choice polls, `optionIndices` must be a single-element\n * array. The server enforces `length === 1` when the poll's\n * `allowsMultipleChoices` is false.\n */\nexport const castVoteBodySchema = z.object({\n optionIndices: z\n .array(\n z\n .number()\n .int()\n .min(0)\n .max(POLL_MAX_OPTIONS - 1),\n )\n .min(1)\n .max(POLL_MAX_OPTIONS),\n});\nexport type CastVoteBody = z.infer<typeof castVoteBodySchema>;\n\n/**\n * Server returns the updated poll wire after a vote / unvote so the\n * client can swap its local state for the authoritative copy (vote\n * counts, viewer.votedOptionIndices, totalVoters).\n */\nexport const voteResponseSchema = z.object({\n poll: communityPollWireSchema,\n});\nexport type VoteResponse = z.infer<typeof voteResponseSchema>;\n"]}
1
+ {"version":3,"file":"poll.js","sourceRoot":"","sources":["../src/poll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,8EAA8E;AAE9E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,MAAM,EAAE,aAAa,CAAU,CAAC;AAC/E,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC,8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AO,KAAK,CAAC;QAC9B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,EACD,EAAE,OAAO,EAAE,6BAA6B,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,CAC9D,CAAC;AAGJ,8EAA8E;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,aAAa,EAAE,CAAC;SACb,KAAK,CACJ,CAAC;SACE,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAC7B;SACA,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,gBAAgB,CAAC;CACzB,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,uBAAuB;CAC9B,CAAC,CAAC","sourcesContent":["/**\n * Community poll wire shapes.\n *\n * A poll is a structured-choice feed item: a question + 2..6 options +\n * a fixed expiry. Lives in its own `community_polls` collection (NOT\n * an extension of `CommunityPost`); votes live in a separate\n * `poll_votes` collection keyed by `(pollId, userId)`. Per-option vote\n * counts + total-voter count are denormalised onto the poll so a feed\n * read serves the whole card in one document fetch.\n *\n * Industry alignment:\n * - Twitter / X: single-select, time-limited (5min..7d), results live.\n * - WhatsApp / Telegram: single OR multi-select, time-limited.\n * - Facebook: single OR multi-select, results live, no expiry.\n * - Reddit: single-select, 6h..7d, results post-vote.\n *\n * Our design:\n * - Required expiry, 5min..30d. Composer presets 1d / 3d / 7d / 14d.\n * - Author opts in for multi-select via `allowsMultipleChoices`.\n * - Author opts in for results-after-close (default: live) via\n * `resultsVisibility`. Server hides per-option counts on the wire\n * when the poll is still open AND `resultsVisibility === 'after_close'`,\n * so a peeking viewer can't fish results out of the API.\n *\n * Edits are NOT supported: changing question / options / expiry after\n * a vote has been cast would invalidate that vote. The author can\n * delete (soft-delete, freezes the poll) or close-early (sets\n * `closesAt` to now), but not edit.\n *\n * @module community-schema/poll\n */\n\nimport { z } from 'zod';\nimport { areaLineageSnapshotSchema } from './area.js';\nimport {\n POLL_MAX_DURATION_MS,\n POLL_MAX_OPTIONS,\n POLL_MIN_DURATION_MS,\n POLL_MIN_OPTIONS,\n POLL_OPTION_MAX_CHARS,\n POLL_OPTION_MIN_CHARS,\n POLL_QUESTION_MAX_CHARS,\n POLL_QUESTION_MIN_CHARS,\n} from './constants.js';\nimport { voteValueSchema } from './engagement.js';\nimport { postAuthorSnapshotSchema } from './post.js';\n\n// ─── Results visibility ────────────────────────────────────────────────────\n\n/**\n * When per-option vote counts become visible to voters.\n *\n * - `live` — counts visible to everyone, always. Default;\n * matches Facebook / Telegram. Encourages\n * engagement via \"see what's winning\".\n * - `after_close` — counts hidden until the poll closes. The wire\n * shape's option counts are server-replaced with\n * `0` during the open window so a curious viewer\n * can't fish results out via the JSON. Best for\n * genuinely-blind decisions (community polls\n * about admin selection, etc.).\n */\nexport const POLL_RESULTS_VISIBILITY_VALUES = ['live', 'after_close'] as const;\nexport const pollResultsVisibilitySchema = z.enum(POLL_RESULTS_VISIBILITY_VALUES);\nexport type PollResultsVisibility = z.infer<typeof pollResultsVisibilitySchema>;\n\n// ─── Poll option (denormalised on the poll doc) ────────────────────────────\n\n/**\n * One choice in the poll. `index` is the canonical identifier the vote\n * body refers to (a stable integer 0..N-1 — letting the client send\n * indices instead of labels avoids hash-collision games with non-ASCII\n * labels). `voteCount` is the denormalised aggregate, updated atomically\n * by the vote endpoint and zeroed on the wire when `resultsVisibility`\n * is `after_close` AND the poll is still open.\n */\nexport const pollOptionWireSchema = z.object({\n index: z\n .number()\n .int()\n .min(0)\n .max(POLL_MAX_OPTIONS - 1),\n label: z.string().min(POLL_OPTION_MIN_CHARS).max(POLL_OPTION_MAX_CHARS),\n voteCount: z.number().int().nonnegative(),\n});\nexport type PollOptionWire = z.infer<typeof pollOptionWireSchema>;\n\n/** Composer-side option (no vote count yet). */\nexport const pollOptionInputSchema = z.object({\n label: z.string().trim().min(POLL_OPTION_MIN_CHARS).max(POLL_OPTION_MAX_CHARS),\n});\nexport type PollOptionInput = z.infer<typeof pollOptionInputSchema>;\n\n// ─── Wire shape — what the server returns ──────────────────────────────────\n\n/**\n * A community poll as it appears in the feed and on a poll detail\n * page. Engagement counts mirror the post wire so the same engagement\n * bar component renders for every kind.\n */\nexport const communityPollWireSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('poll'),\n author: postAuthorSnapshotSchema,\n\n /** The poll question. Renders as the card's primary text. */\n question: z.string().min(POLL_QUESTION_MIN_CHARS).max(POLL_QUESTION_MAX_CHARS),\n /** Options 0..N-1 (N in `[POLL_MIN_OPTIONS, POLL_MAX_OPTIONS]`).\n * Per-option `voteCount` is zeroed on the wire while the poll is\n * open AND `resultsVisibility === 'after_close'` (the\n * total-voters count is still surfaced so the card can show\n * \"X voted\" without revealing how it splits). */\n options: z.array(pollOptionWireSchema).min(POLL_MIN_OPTIONS).max(POLL_MAX_OPTIONS),\n\n /** Number of UNIQUE voters. Always visible — even when option\n * counts are hidden — so the card can render \"X have voted\" as a\n * social proof signal. */\n totalVoters: z.number().int().nonnegative(),\n\n /** `true` when the author let voters pick more than one option. */\n allowsMultipleChoices: z.boolean(),\n /** Results visibility policy. See `pollResultsVisibilitySchema`. */\n resultsVisibility: pollResultsVisibilitySchema,\n\n /** ISO-string. The poll is closed when this is `<= now()`. Vote\n * endpoints reject after this; the client also hides the Vote CTA. */\n closesAt: z.string().datetime(),\n\n // Authorship area + scope (identical to communityPostWireSchema)\n areaLineage: areaLineageSnapshotSchema,\n communityId: z.string().optional(),\n\n // Denormalised engagement counters\n /** Net score = upvotes - downvotes. Signed — can be negative. */\n score: z.number().int(),\n commentCount: z.number().int().nonnegative(),\n repostCount: z.number().int().nonnegative(),\n reactionCounts: z.record(z.string(), z.number().int().nonnegative()),\n\n // Lifecycle\n createdAt: z.string().datetime(),\n /** Polls are never edited (see module docstring); editedAt is kept\n * on the wire as `null` for parity with the post envelope so card\n * templates can share a single byline component. */\n editedAt: z.string().datetime().nullable(),\n deletedAt: z.string().datetime().nullable(),\n\n // Per-viewer state (filled at read time)\n viewer: z\n .object({\n vote: voteValueSchema.nullable(),\n reaction: z.string().nullable(),\n bookmarked: z.boolean(),\n isAuthor: z.boolean(),\n reposted: z.boolean(),\n /** Indices the viewer voted for. Empty array means \"hasn't\n * voted yet\". Populated for every viewer regardless of\n * `resultsVisibility` — a voter can always see their own\n * choice. */\n votedOptionIndices: z.array(z.number().int().nonnegative()),\n })\n .optional(),\n});\nexport type CommunityPollWire = z.infer<typeof communityPollWireSchema>;\n\n// ─── Feed envelope ─────────────────────────────────────────────────────────\n\n/**\n * Same shape as `communityPollWireSchema` — the wire IS the feed\n * envelope (no pruning needed because polls are compact: a question +\n * ≤6 short option labels + counters). Aliased so consumers can import\n * the feed-envelope name in parallel with the existing lostFound /\n * voiceBox / donateItem envelopes.\n */\nexport const communityPollFeedItemSchema = communityPollWireSchema;\nexport type CommunityPollFeedItem = z.infer<typeof communityPollFeedItemSchema>;\n\n// ─── Create body ───────────────────────────────────────────────────────────\n\n/**\n * Composer payload: what the frontend sends to\n * `POST /api/v1/community/polls`. Author + areaLineage + initial vote\n * counts are filled server-side from the authenticated request and\n * cannot be spoofed by the client.\n */\nexport const createPollBodySchema = z\n .object({\n question: z.string().trim().min(POLL_QUESTION_MIN_CHARS).max(POLL_QUESTION_MAX_CHARS),\n options: z.array(pollOptionInputSchema).min(POLL_MIN_OPTIONS).max(POLL_MAX_OPTIONS),\n /** Duration in milliseconds from now until `closesAt`. Validated\n * against `POLL_MIN_DURATION_MS` / `POLL_MAX_DURATION_MS`. The\n * server resolves `closesAt = createdAt + durationMs` instead of\n * taking an absolute date so clock skew between client and server\n * can't push a poll into the past. */\n durationMs: z.number().int().min(POLL_MIN_DURATION_MS).max(POLL_MAX_DURATION_MS),\n allowsMultipleChoices: z.boolean(),\n resultsVisibility: pollResultsVisibilitySchema,\n /** Optional community scope. If set the author must be an active\n * member of the community — the server checks. */\n communityId: z.string().optional(),\n })\n .refine(\n (b) => {\n // Options must be unique by their trimmed label — duplicate\n // options fragment votes and confuse voters.\n const seen = new Set<string>();\n for (const o of b.options) {\n const k = o.label.trim().toLowerCase();\n if (seen.has(k)) return false;\n seen.add(k);\n }\n return true;\n },\n { message: 'Poll options must be unique', path: ['options'] },\n );\nexport type CreatePollBody = z.infer<typeof createPollBodySchema>;\n\n// ─── Vote body + response ──────────────────────────────────────────────────\n\n/**\n * What the client sends to `POST /api/v1/community/polls/:id/votes`\n * (cast OR change a vote — the server upserts on `(pollId, userId)`).\n *\n * For single-choice polls, `optionIndices` must be a single-element\n * array. The server enforces `length === 1` when the poll's\n * `allowsMultipleChoices` is false.\n */\nexport const castVoteBodySchema = z.object({\n optionIndices: z\n .array(\n z\n .number()\n .int()\n .min(0)\n .max(POLL_MAX_OPTIONS - 1),\n )\n .min(1)\n .max(POLL_MAX_OPTIONS),\n});\nexport type CastVoteBody = z.infer<typeof castVoteBodySchema>;\n\n/**\n * Server returns the updated poll wire after a vote / unvote so the\n * client can swap its local state for the authoritative copy (vote\n * counts, viewer.votedOptionIndices, totalVoters).\n */\nexport const voteResponseSchema = z.object({\n poll: communityPollWireSchema,\n});\nexport type VoteResponse = z.infer<typeof voteResponseSchema>;\n"]}
package/dist/post.d.ts CHANGED
@@ -183,6 +183,20 @@ export declare const communityPostWireSchema: z.ZodObject<{
183
183
  bytes: z.ZodNumber;
184
184
  duration: z.ZodNumber;
185
185
  }, z.core.$strip>>;
186
+ linkPreview: z.ZodOptional<z.ZodObject<{
187
+ url: z.ZodString;
188
+ kind: z.ZodEnum<{
189
+ youtube: "youtube";
190
+ vimeo: "vimeo";
191
+ image: "image";
192
+ generic: "generic";
193
+ }>;
194
+ videoId: z.ZodOptional<z.ZodString>;
195
+ title: z.ZodOptional<z.ZodString>;
196
+ description: z.ZodOptional<z.ZodString>;
197
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
198
+ siteName: z.ZodOptional<z.ZodString>;
199
+ }, z.core.$strip>>;
186
200
  areaLineage: z.ZodObject<{
187
201
  countryId: z.ZodOptional<z.ZodString>;
188
202
  stateId: z.ZodOptional<z.ZodString>;
@@ -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;AAWxB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+CnC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkElC,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;A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,oBAAoB,CAAC,CAAC"}
package/dist/post.js CHANGED
@@ -14,6 +14,7 @@ import { communityDesignationSchema } from './community.js';
14
14
  import { POST_MAX_BODY_CHARS, POST_MAX_IMAGES, POST_MAX_VIDEOS } from './constants.js';
15
15
  import { voteValueSchema } from './engagement.js';
16
16
  import { contentKindSchema } from './enums.js';
17
+ import { linkPreviewSchema } from './link-preview.js';
17
18
  import { postImageSchema, postVideoSchema } from './media.js';
18
19
  import { usernameSchema } from './username.js';
19
20
  // ─── Author snapshot (denormalised on every post) ──────────────────────────
@@ -137,6 +138,11 @@ export const communityPostWireSchema = z.object({
137
138
  text: z.string().max(POST_MAX_BODY_CHARS),
138
139
  images: z.array(postImageSchema).max(POST_MAX_IMAGES),
139
140
  videos: z.array(postVideoSchema).max(POST_MAX_VIDEOS),
141
+ /** Auto-extracted embed for the first eligible URL in `text`. Server-
142
+ * derived at write/edit time (the client never sets this directly).
143
+ * Renderers consume the persisted blob and never re-fetch. Absent on
144
+ * posts whose body has no embeddable URL. */
145
+ linkPreview: linkPreviewSchema.optional(),
140
146
  // Authorship area
141
147
  /** Snapshot of where the author was at write time. Drives the
142
148
  * area-proximity cascade and ranking in feed.service. */
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,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,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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 { voteValueSchema } from './engagement.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 /**\n * Whether the author's real-world identity has been verified by a\n * Jansathi volunteer / leader (UDP step 9 + the verifiedFields\n * gate on the user-detailed-profile model). **Live-joined** from\n * `User.identityVerified.verified` at read time, the same way\n * `username` / `avatarUrl` / `designation` are — so a verification\n * change propagates instantly to every old post's byline.\n *\n * Drives the green check-badge next to the display name on every\n * feed card, plus client-side gating of leader-only actions like\n * starting a community.\n *\n * Optional so backends that haven't started populating the field\n * yet still serialize a valid wire shape — readers should treat\n * `undefined` as \"not verified\".\n */\n identityVerified: z.boolean().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 /** Net score = upvotes - downvotes. SIGNED — can be negative when\n * downvotes exceed upvotes. The EngagementBar renders this as the\n * centre number between the up / down arrows. */\n score: z.number().int(),\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 /** The viewer's vote on this target. `'up'` and `'down'`\n * each contribute ±1 to `score`; `null` means no vote. */\n vote: voteValueSchema.nullable(),\n /** The reaction the viewer chose, or null. Reaction is an\n * independent axis from `vote` — a viewer can both react and\n * vote on the same item. */\n reaction: z.string().nullable(),\n /** True when the viewer saved this post to their bookmarks.\n * Bookmarks are private and don't affect any aggregate count\n * exposed to other viewers. */\n bookmarked: z.boolean(),\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
+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,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 { communityDesignationSchema } from './community.js';\nimport { POST_MAX_BODY_CHARS, POST_MAX_IMAGES, POST_MAX_VIDEOS } from './constants.js';\nimport { voteValueSchema } from './engagement.js';\nimport { contentKindSchema } from './enums.js';\nimport { linkPreviewSchema } from './link-preview.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 /**\n * Whether the author's real-world identity has been verified by a\n * Jansathi volunteer / leader (UDP step 9 + the verifiedFields\n * gate on the user-detailed-profile model). **Live-joined** from\n * `User.identityVerified.verified` at read time, the same way\n * `username` / `avatarUrl` / `designation` are — so a verification\n * change propagates instantly to every old post's byline.\n *\n * Drives the green check-badge next to the display name on every\n * feed card, plus client-side gating of leader-only actions like\n * starting a community.\n *\n * Optional so backends that haven't started populating the field\n * yet still serialize a valid wire shape — readers should treat\n * `undefined` as \"not verified\".\n */\n identityVerified: z.boolean().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 /** Auto-extracted embed for the first eligible URL in `text`. Server-\n * derived at write/edit time (the client never sets this directly).\n * Renderers consume the persisted blob and never re-fetch. Absent on\n * posts whose body has no embeddable URL. */\n linkPreview: linkPreviewSchema.optional(),\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 /** Net score = upvotes - downvotes. SIGNED — can be negative when\n * downvotes exceed upvotes. The EngagementBar renders this as the\n * centre number between the up / down arrows. */\n score: z.number().int(),\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 /** The viewer's vote on this target. `'up'` and `'down'`\n * each contribute ±1 to `score`; `null` means no vote. */\n vote: voteValueSchema.nullable(),\n /** The reaction the viewer chose, or null. Reaction is an\n * independent axis from `vote` — a viewer can both react and\n * vote on the same item. */\n reaction: z.string().nullable(),\n /** True when the viewer saved this post to their bookmarks.\n * Bookmarks are private and don't affect any aggregate count\n * exposed to other viewers. */\n bookmarked: z.boolean(),\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
@@ -90,6 +90,20 @@ export declare const createRepostResponseSchema: z.ZodObject<{
90
90
  bytes: z.ZodNumber;
91
91
  duration: z.ZodNumber;
92
92
  }, z.core.$strip>>;
93
+ linkPreview: z.ZodOptional<z.ZodObject<{
94
+ url: z.ZodString;
95
+ kind: z.ZodEnum<{
96
+ youtube: "youtube";
97
+ vimeo: "vimeo";
98
+ image: "image";
99
+ generic: "generic";
100
+ }>;
101
+ videoId: z.ZodOptional<z.ZodString>;
102
+ title: z.ZodOptional<z.ZodString>;
103
+ description: z.ZodOptional<z.ZodString>;
104
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
105
+ siteName: z.ZodOptional<z.ZodString>;
106
+ }, z.core.$strip>>;
93
107
  areaLineage: z.ZodObject<{
94
108
  countryId: z.ZodOptional<z.ZodString>;
95
109
  stateId: z.ZodOptional<z.ZodString>;
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAErC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
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.21.0",
3
+ "version": "0.22.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",