jansathi-community-schema 0.30.0 → 0.32.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.
@@ -1 +1 @@
1
- {"version":3,"file":"crowdfunding.d.ts","sourceRoot":"","sources":["../src/crowdfunding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,2PAwB/B,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,oEAM/B,CAAC;AACX,eAAO,MAAM,0BAA0B;;;;;;EAAuC,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,4DAM/B,CAAC;AACX,eAAO,MAAM,yBAAyB;;;;;;EAAuC,CAAC;AAC9E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;EAAuC,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,+DAM5B,CAAC;AACX,eAAO,MAAM,uBAAuB;;;;;;EAAoC,CAAC;AACzE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,gHAQ7B,CAAC;AACX,eAAO,MAAM,wBAAwB;;;;;;;;EAAqC,CAAC;AAC3E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB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;;;;;iBAAyC,CAAC;AACnF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;iBAExC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;iBAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAIlF;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC;;;;iBAM/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG;;;;GAIG;AACH,eAAO,MAAM,mCAAmC;;iBAE9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAIhG,eAAO,MAAM,oCAAoC;;;;;;;;iBAI/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG;;;;;GAKG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;iBAIjD,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAC"}
@@ -161,11 +161,7 @@ export const crowdfundingFeeBillingModeSchema = z.enum(CROWDFUNDING_FEE_BILLING_
161
161
  * via the same flow. A failure state can be added when (and if) the
162
162
  * My Campaigns surface needs a distinct "retry needed" badge.
163
163
  */
164
- export const CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES = [
165
- 'pending',
166
- 'paid',
167
- 'deferred',
168
- ];
164
+ export const CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES = ['pending', 'paid', 'deferred'];
169
165
  export const crowdfundingFeePaymentStatusSchema = z.enum(CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES);
170
166
  // ─── Sub-shapes ────────────────────────────────────────────────────────────
171
167
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"crowdfunding.js","sourceRoot":"","sources":["../src/crowdfunding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,uCAAuC,EACvC,2CAA2C,EAC3C,kCAAkC,EAClC,kCAAkC,EAClC,6BAA6B,EAC7B,8BAA8B,EAC9B,yBAAyB,EACzB,uBAAuB,EACvB,gCAAgC,EAChC,8BAA8B,EAC9B,yBAAyB,EACzB,uCAAuC,EACvC,uCAAuC,EACvC,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,SAAS;IACT,WAAW;IACX,aAAa;IACb,eAAe;IACf,WAAW;IACX,UAAU;IACV,UAAU;IACV,OAAO;IACP,OAAO;IACP,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,cAAc;IACd,kBAAkB;IAClB;;;;;OAKG;IACH,mBAAmB;IACnB,OAAO;CACC,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,cAAc;CACN,CAAC;AACX,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC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E;CAClD,CAAC,CAAC;AAGH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACtD,KAAK,EAAE,+BAA+B,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC","sourcesContent":["/**\n * Community crowdfunding wire shapes.\n *\n * A crowdfunding campaign is a verified civic fundraiser surfaced in\n * the feed alongside posts / polls / lost-found / voice-box / donate-\n * item. The model is:\n *\n * 1. Creator drafts a campaign, fills bank + UPI QR + identity tier\n * based on the goal amount, picks an area scope.\n * 2. A leader at the matching scope (or any leader higher up the\n * hierarchy) reviews and approves OR rejects with reason.\n * Approved campaigns transition to ACTIVE and appear in the feed.\n * 3. Donors view the card, tap \"Donate\", pay externally via UPI\n * directly to the creator's bank — the platform never sees the\n * money. After paying, the donor self-attests amount + uploads a\n * receipt screenshot (optional). Without a screenshot the\n * donation enters PENDING state — the donor can upload the\n * receipt later (anytime, from settings → My Donations).\n * 4. The live progress bar shows ONLY verified amount (receipt\n * uploaded). Pending donations are counted separately and\n * surfaced as a secondary \"₹X pending receipt\" note. This is the\n * product decision: the visible progress reflects trust-grounded\n * money, not claims.\n *\n * Privacy: bank account number, IFSC, PAN, Aadhaar last-4, and\n * supporting documents are NEVER on the wire. Only `bankAccountLast4`,\n * `bankAccountHolderName`, and a UPI QR URL surface to donors.\n *\n * @module community-schema/crowdfunding\n */\n\nimport { z } from 'zod';\nimport { areaLineageSnapshotSchema } from './area.js';\nimport {\n CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS,\n CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_MAX_DONATION_INR,\n CROWDFUNDING_MAX_DURATION_DAYS,\n CROWDFUNDING_MAX_GOAL_INR,\n CROWDFUNDING_MAX_IMAGES,\n CROWDFUNDING_MAX_SUPPORTING_DOCS,\n CROWDFUNDING_MIN_DURATION_DAYS,\n CROWDFUNDING_MIN_GOAL_INR,\n CROWDFUNDING_REJECTION_REASON_MAX_CHARS,\n CROWDFUNDING_REJECTION_REASON_MIN_CHARS,\n CROWDFUNDING_TITLE_MAX_CHARS,\n CROWDFUNDING_TITLE_MIN_CHARS,\n} from './constants.js';\nimport { voteValueSchema } from './engagement.js';\nimport { postAuthorSnapshotSchema } from './post.js';\n\n// ─── Enums ─────────────────────────────────────────────────────────────────\n\n/**\n * Top-level categories — drives the chip + icon on the card and the\n * verifier's per-category supporting-doc requirements (medical needs\n * hospital invoice; education needs admission letter; etc.).\n */\nexport const CROWDFUNDING_CATEGORY_VALUES = [\n 'medical',\n 'maternity',\n 'senior_care',\n 'special_needs',\n 'education',\n 'memorial',\n 'disaster',\n 'civic',\n 'faith',\n 'sports_talent',\n 'animal_welfare',\n 'environment',\n 'legal_aid',\n 'arts_culture',\n 'self_improvement',\n /**\n * Startup / prototype building — distinct from `self_improvement`\n * (which is now strictly skill / coursework). Covers MVP builds,\n * tooling, initial inventory, working capital, registration fees,\n * marketing for genuine first-stage entrepreneurs.\n */\n 'startup_prototype',\n 'other',\n] as const;\n\n/**\n * Who the campaign is for — drives the relation chip set and the\n * organization-specific identity asks on the composer. Captured so the\n * verifier can match the campaign narrative to the supporting docs\n * (e.g. an `organization` audience should produce 12A / 80G papers,\n * not a personal hospital bill).\n */\nexport const CROWDFUNDING_AUDIENCE_VALUES = [\n 'self',\n 'family',\n 'friend',\n 'community',\n 'organization',\n] as const;\nexport const crowdfundingAudienceSchema = z.enum(CROWDFUNDING_AUDIENCE_VALUES);\nexport type CrowdfundingAudience = z.infer<typeof crowdfundingAudienceSchema>;\n\n/**\n * Org-registration class — only meaningful when `audience ===\n * 'organization'`. Drives the verifier's expected document set\n * (12A/80G for trust, FCRA-style papers for NGO, etc.).\n */\nexport const CROWDFUNDING_ORG_KIND_VALUES = [\n 'ngo',\n 'trust',\n 'society',\n 'section_8',\n 'other',\n] as const;\nexport const crowdfundingOrgKindSchema = z.enum(CROWDFUNDING_ORG_KIND_VALUES);\nexport type CrowdfundingOrgKind = z.infer<typeof crowdfundingOrgKindSchema>;\nexport const crowdfundingCategorySchema = z.enum(CROWDFUNDING_CATEGORY_VALUES);\nexport type CrowdfundingCategory = z.infer<typeof crowdfundingCategorySchema>;\n\n/**\n * Area scope — drives the required verifier role. A higher-tier\n * leader can always verify a lower-tier campaign (escalation path);\n * the reverse is rejected.\n */\nexport const CROWDFUNDING_SCOPE_VALUES = [\n 'local',\n 'district',\n 'state',\n 'national',\n 'global',\n] as const;\nexport const crowdfundingScopeSchema = z.enum(CROWDFUNDING_SCOPE_VALUES);\nexport type CrowdfundingScope = z.infer<typeof crowdfundingScopeSchema>;\n\n/**\n * Lifecycle state. `submitted` is the verifier's queue; `active` is\n * publishable in the feed; the three `closed_*` are terminal end-states\n * with different reasons.\n */\nexport const CROWDFUNDING_STATUS_VALUES = [\n 'draft',\n 'submitted',\n 'rejected',\n 'active',\n 'closed_success',\n 'closed_timeout',\n 'closed_by_creator',\n] as const;\nexport const crowdfundingStatusSchema = z.enum(CROWDFUNDING_STATUS_VALUES);\nexport type CrowdfundingStatus = z.infer<typeof crowdfundingStatusSchema>;\n\n/**\n * Per-donation verification state. `pending` = attested but no\n * receipt. `verified` = receipt uploaded (creator confirmation\n * optional). `disputed` = creator marked \"I didn't receive this\".\n * Only `verified` rolls into the campaign's `verifiedAmountInr`\n * which drives the visible progress bar.\n */\nexport const CROWDFUNDING_DONATION_STATE_VALUES = ['pending', 'verified', 'disputed'] as const;\nexport const crowdfundingDonationStateSchema = z.enum(CROWDFUNDING_DONATION_STATE_VALUES);\nexport type CrowdfundingDonationState = z.infer<typeof crowdfundingDonationStateSchema>;\n\n/**\n * When the platform fee is settled:\n * - `'upfront'` — Creator pays a FLAT scope-tiered fee via Razorpay\n * BEFORE the campaign goes to leader review (₹500 local / ₹1,000\n * district / ₹2,000 state / ₹5,000 national / ₹10,000 global —\n * see `CROWDFUNDING_UPFRONT_FEE_INR_BY_SCOPE`). Approved\n * campaigns then disburse 100 % of donations to the creator.\n * - `'deferred'` — Nothing paid upfront. At disbursement time the\n * platform deducts 5 % of COLLECTED donations (see\n * `CROWDFUNDING_DEFERRED_FEE_RATE`) before transferring the rest\n * to the creator. The creator accepts an \"I promise to pay\"\n * attestation on the Pricing step to take this path.\n *\n * The choice is captured at submit time on the composer's Pricing\n * step and surfaced on the wire so the My Campaigns surface can show\n * \"Paid ₹X\" / \"Will deduct at payout\" badges per campaign.\n */\nexport const CROWDFUNDING_FEE_BILLING_MODE_VALUES = ['upfront', 'deferred'] as const;\nexport const crowdfundingFeeBillingModeSchema = z.enum(CROWDFUNDING_FEE_BILLING_MODE_VALUES);\nexport type CrowdfundingFeeBillingMode = z.infer<typeof crowdfundingFeeBillingModeSchema>;\n\n/**\n * Server-tracked state of the upfront-billing payment. Always\n * `'deferred'` when the creator picked the on-collection mode (there\n * is nothing to pay until disbursement). For upfront mode it starts\n * at `'pending'` on draft create, flips to `'paid'` after Razorpay\n * verify, and stays `'paid'` for the campaign lifetime.\n *\n * No `'failed'` state today — if Razorpay fails or the user dismisses\n * the modal, the row stays `'pending'` and the next retry transitions\n * via the same flow. A failure state can be added when (and if) the\n * My Campaigns surface needs a distinct \"retry needed\" badge.\n */\nexport const CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES = [\n 'pending',\n 'paid',\n 'deferred',\n] as const;\nexport const crowdfundingFeePaymentStatusSchema = z.enum(CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES);\nexport type CrowdfundingFeePaymentStatus = z.infer<typeof crowdfundingFeePaymentStatusSchema>;\n\n// ─── Sub-shapes ────────────────────────────────────────────────────────────\n\n/**\n * Per-campaign verification block. `approved` is the only state that\n * lets the campaign go ACTIVE; `pending` keeps it queued; `rejected`\n * is terminal-with-resubmit-allowed.\n */\nexport const crowdfundingVerificationSchema = z.object({\n status: z.enum(['pending', 'approved', 'rejected']),\n /** The leader who acted on this submission (display name —\n * live-joined from User at projection time). */\n verifiedByDisplayName: z.string().optional(),\n verifiedByUserId: z.string().optional(),\n /** When the leader acted. Approved + rejected both stamp this. */\n verifiedAt: z.string().datetime().optional(),\n /** The scope the verifier claimed when acting. A district leader\n * acting on a local campaign records `district` here so the\n * audit log shows the escalation path. */\n verifierScope: crowdfundingScopeSchema.optional(),\n /** Required when `status === 'rejected'`. Why the leader said no. */\n rejectionReason: z.string().optional(),\n});\nexport type CrowdfundingVerification = z.infer<typeof crowdfundingVerificationSchema>;\n\n/**\n * Public-facing payment surface — what the donor sees in the Donate\n * dialog. The full account number, IFSC, PAN, Aadhaar, supporting\n * docs etc. are kept server-side; only what's needed for the donor\n * to send money + recognise the recipient is exposed.\n */\nexport const crowdfundingPaymentSchema = z.object({\n /** GCS URL of the UPI QR code image uploaded by the creator. The\n * Donate dialog renders this for the donor to scan. */\n upiQrUrl: z.string().url(),\n /** Optional VPA — lets the donor tap a one-tap UPI deep link\n * instead of scanning the QR. e.g. \"ravi@okhdfcbank\". */\n upiId: z.string().optional(),\n /** Last 4 digits of the bank account — shown to the donor as\n * reassurance (\"ending in ••1234\"). Full number never surfaces. */\n bankAccountLast4: z.string().length(4),\n /** Account holder's name — must match the verified author display\n * name (penny-drop + UDP cross-check at submission time). */\n bankAccountHolderName: z.string(),\n /** Optional bank short name surfaced on the dialog. */\n bankName: z.string().optional(),\n});\nexport type CrowdfundingPayment = z.infer<typeof crowdfundingPaymentSchema>;\n\n// ─── Wire shape — feed item ────────────────────────────────────────────────\n\n/**\n * The card-renderable wire shape. Mirrors the engagement + author +\n * area-lineage shape of other feed kinds so the existing\n * EngagementBar, AuthorByline, and feed-projection helpers slot in\n * 1:1 without per-kind branches.\n */\nexport const crowdfundingFeedItemSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('crowdfunding'),\n author: postAuthorSnapshotSchema,\n\n // ─── Campaign content ────────────────────────────────────────────\n title: z.string(),\n description: z.string(),\n category: crowdfundingCategorySchema,\n beneficiaryName: z.string(),\n beneficiaryRelation: z.string().optional(),\n /** Who the campaign is for. Optional on the wire so historic\n * campaigns created before this field landed still validate. */\n audience: crowdfundingAudienceSchema.optional(),\n /** Optional explainer when `category === 'other'` — the writer's\n * short label for the custom cause (e.g. \"Wedding emergency\"). */\n categoryOther: z.string().optional(),\n /** Up to 3 sub-causes within the chosen category, e.g.\n * [\"Cancer treatment\", \"ICU / critical care\"] for `medical`. */\n subCauses: z.array(z.string()).max(3).optional(),\n /** When one of the picked sub-causes is \"Other\", this carries the\n * writer's clarification (e.g. \"Reconstructive surgery\"). */\n subCauseOther: z.string().optional(),\n /** Org-registration class. Only meaningful when\n * `audience === 'organization'`. */\n organizationKind: crowdfundingOrgKindSchema.optional(),\n /** When `organizationKind === 'other'`, the writer's clarification\n * (e.g. \"Religious body\", \"Cooperative\"). */\n organizationKindOther: z.string().optional(),\n /** Story images (separate from supporting documents, which are\n * verifier-only). Up to `CROWDFUNDING_MAX_IMAGES`. */\n images: z.array(z.string().url()).max(CROWDFUNDING_MAX_IMAGES).optional(),\n /** Optional YouTube URL surfaced as a preview/playback embed\n * alongside the story photos. Accepted forms: youtube.com/watch?v=,\n * youtu.be/, youtube.com/shorts/, youtube.com/embed/,\n * m.youtube.com/watch?v=. The wire stores whatever the creator\n * pasted; clients extract the video id themselves at render time. */\n youtubeUrl: z.string().url().optional(),\n\n // ─── Goal + progress ─────────────────────────────────────────────\n goalAmountInr: z.number().int().positive(),\n /** Sum of donations whose `verificationState === 'verified'`\n * (receipt uploaded or creator confirmed). THIS drives the visible\n * progress bar — the product decision is that only trust-grounded\n * money counts visually. */\n verifiedAmountInr: z.number().int().nonnegative(),\n /** Total attested amount — verified + pending + disputed\n * combined. Surfaced as secondary text (\"₹X pending receipt\")\n * so creator + donors can see the full attested pipeline without\n * it inflating the headline progress. */\n attestedAmountInr: z.number().int().nonnegative(),\n /** Distinct donors who attested any state. */\n donorCount: z.number().int().nonnegative(),\n /** Distinct donors whose latest donation is `verified`. The card\n * uses this for \"47 verified supporters\" copy. */\n verifiedDonorCount: z.number().int().nonnegative(),\n\n closesAt: z.string().datetime(),\n\n // ─── Verification surface ────────────────────────────────────────\n scope: crowdfundingScopeSchema,\n verification: crowdfundingVerificationSchema,\n\n // ─── Payment surface (donor-facing) ──────────────────────────────\n payment: crowdfundingPaymentSchema,\n\n // ─── Lifecycle ───────────────────────────────────────────────────\n status: crowdfundingStatusSchema,\n closedAt: z.string().datetime().nullable().optional(),\n\n // ─── Platform fee — set on the composer's Pricing step ───────────\n /**\n * Creator's choice for how the platform fee is settled. Optional\n * on the wire so legacy campaigns created before this field landed\n * still validate; the My Campaigns surface falls back to \"deferred\n * (legacy)\" copy when missing.\n */\n feeBillingMode: crowdfundingFeeBillingModeSchema.optional(),\n /**\n * Server-tracked state of the upfront-billing payment. Always\n * `'deferred'` when `feeBillingMode === 'deferred'`. For upfront\n * campaigns: `'pending'` while the Razorpay flow is open or\n * incomplete, `'paid'` after verify.\n */\n feePaymentStatus: crowdfundingFeePaymentStatusSchema.optional(),\n /**\n * Platform fee in rupees recorded on the campaign:\n * - UPFRONT campaigns: the flat scope-tiered amount that was (or\n * will be) charged — looked up from\n * `CROWDFUNDING_UPFRONT_FEE_INR_BY_SCOPE[scope]` at draft time\n * and frozen on `feePaymentStatus === 'paid'`.\n * - DEFERRED campaigns: `0` until disbursement, then the actual\n * `5 % × verifiedAmountInr` written by the payout job.\n *\n * Surfaced so the My Campaigns surface can show \"Paid ₹500\" /\n * \"Will deduct ₹X at payout\" badges without recomputing.\n */\n platformFeeAmountInr: z.number().int().nonnegative().optional(),\n\n // ─── Standard engagement (same axis as other kinds) ──────────────\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 areaLineage: areaLineageSnapshotSchema,\n /** When set, the campaign is scoped to a topical community and the\n * geo-cascade feed query skips it (mirrors the post + poll\n * community-scoping rule). */\n communityId: z.string().optional(),\n\n createdAt: z.string().datetime(),\n\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 /** The viewer's own donation state on THIS campaign. `null`\n * means they haven't attested anything yet. Populated from\n * the latest CrowdfundingDonation row keyed by\n * (campaignId, viewerUserId). */\n donationState: crowdfundingDonationStateSchema.nullable(),\n /** Amount the viewer last attested, in ₹. Null when no\n * attestation. The card uses this to render the \"You gave\n * ₹500 — upload receipt\" prompt. */\n donationAmountInr: z.number().int().positive().nullable(),\n /** True when the viewer is eligible to verify this campaign\n * (matching-or-higher leader at the campaign's scope, viewing\n * a `submitted` campaign). Renders the in-card Verify CTA. */\n canVerify: z.boolean(),\n })\n .optional(),\n});\nexport type CrowdfundingFeedItem = z.infer<typeof crowdfundingFeedItemSchema>;\n\n// Same shape mirrored as the public \"wire\" alias for parity with the\n// other kinds whose feed envelope === detail envelope.\nexport const communityCrowdfundingWireSchema = crowdfundingFeedItemSchema;\nexport type CommunityCrowdfundingWire = z.infer<typeof communityCrowdfundingWireSchema>;\n\n// ─── Donation wire ─────────────────────────────────────────────────────────\n\n/**\n * Single donation row — surfaced on the campaign's public donor list\n * and on the donor's own \"My Donations\" surface. The full bank /\n * receipt URL stays server-side; the wire carries display info plus\n * the verification state.\n */\nexport const crowdfundingDonationWireSchema = z.object({\n _id: z.string(),\n campaignId: z.string(),\n /** Donor's userId — omitted when `isAnonymous`, so the wire is the\n * privacy boundary not the card. */\n donorUserId: z.string().optional(),\n donorDisplayName: z.string(),\n amountInr: z.number().int().positive(),\n isAnonymous: z.boolean(),\n attestedAt: z.string().datetime(),\n /** When the receipt was uploaded. Absent on pending donations. */\n receiptUploadedAt: z.string().datetime().nullable().optional(),\n /** Signed URL for the receipt screenshot. Visible only to:\n * - the donor (their own row)\n * - the campaign creator\n * - the verifier on review\n * - admin / moderators\n * The list endpoint scrubs this for all other viewers. */\n receiptUrl: z.string().url().nullable().optional(),\n verificationState: crowdfundingDonationStateSchema,\n /** Set when the creator confirmed receipt independently of a\n * receipt upload. e.g. \"I see ₹500 from Ravi in my account\". */\n creatorConfirmed: z.boolean().optional(),\n /** Set when the creator marked \"I didn't receive this\". Donor is\n * notified to upload the receipt; auto-reverts after 7 days. */\n disputeReason: z.string().optional(),\n});\nexport type CrowdfundingDonationWire = z.infer<typeof crowdfundingDonationWireSchema>;\n\n// ─── Create / update / lifecycle bodies ────────────────────────────────────\n\n/**\n * Composer payload. Identity + bank fields are tier-conditional —\n * the server cross-checks the chosen `goalAmountInr` against the\n * provided fields per the tier matrix in constants.ts.\n */\nexport const createCrowdfundingBodySchema = z.object({\n title: z.string().trim().min(CROWDFUNDING_TITLE_MIN_CHARS).max(CROWDFUNDING_TITLE_MAX_CHARS),\n description: z\n .string()\n .trim()\n .min(CROWDFUNDING_DESCRIPTION_MIN_CHARS)\n .max(CROWDFUNDING_DESCRIPTION_MAX_CHARS),\n category: crowdfundingCategorySchema,\n beneficiaryName: z.string().trim().min(2).max(CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS),\n beneficiaryRelation: z\n .string()\n .trim()\n .max(CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS)\n .optional(),\n /** Audience picker — drives the relation chip set + the\n * organization-specific identity sub-steps on the composer. */\n audience: crowdfundingAudienceSchema.optional(),\n /** When `category === 'other'`, the writer's short label for the\n * custom cause. Bounded to keep the database column sane. */\n categoryOther: z.string().trim().max(80).optional(),\n /** Up to 3 sub-causes within the chosen category. */\n subCauses: z.array(z.string().trim().max(60)).max(3).optional(),\n /** Writer's clarification when one of the picked sub-causes is\n * \"Other\". */\n subCauseOther: z.string().trim().max(80).optional(),\n /** Org-registration class. Only set when `audience === 'organization'`. */\n organizationKind: crowdfundingOrgKindSchema.optional(),\n /** Writer's clarification when `organizationKind === 'other'`. */\n organizationKindOther: z.string().trim().max(80).optional(),\n images: z.array(z.string().url()).max(CROWDFUNDING_MAX_IMAGES).optional(),\n /** Optional YouTube video URL. Validated as a URL here; the\n * client-side validator additionally checks the host/path matches\n * a recognised YouTube shape and extracts the video id for the\n * preview component. */\n youtubeUrl: z.string().url().optional(),\n\n goalAmountInr: z.number().int().min(CROWDFUNDING_MIN_GOAL_INR).max(CROWDFUNDING_MAX_GOAL_INR),\n /** Duration in days. The server resolves `closesAt = now +\n * durationDays * 86400 * 1000` so client clock skew can't push\n * the close-time into the past. */\n durationDays: z\n .number()\n .int()\n .min(CROWDFUNDING_MIN_DURATION_DAYS)\n .max(CROWDFUNDING_MAX_DURATION_DAYS),\n\n scope: crowdfundingScopeSchema,\n\n // ─── Payment fields (server keeps full account + IFSC encrypted;\n // wire only carries last-4 + holder name + optional UPI ID) ──\n upiQrUrl: z.string().url(),\n upiId: z.string().trim().max(50).optional(),\n /** Full bank account number — 9-18 digits per RBI's range. Stored\n * encrypted server-side; never on the public wire. */\n bankAccountNumber: z\n .string()\n .trim()\n .regex(/^[0-9]{9,18}$/),\n bankAccountHolderName: z.string().trim().min(2).max(100),\n /** Indian IFSC code — 4 letters + 0 + 6 alphanumerics. Stored\n * encrypted; truncated on the wire. */\n ifsc: z\n .string()\n .trim()\n .regex(/^[A-Z]{4}0[A-Z0-9]{6}$/),\n bankName: z.string().trim().max(100).optional(),\n\n // ─── Identity (tier-conditional, validated server-side) ──────────\n /** PAN — 5 letters + 4 digits + 1 letter. Required for goal ≥\n * ₹25k (Standard tier). Stored encrypted; never on the wire (the\n * audit log surfaces a masked \"ABCDE****F\" form to verifiers). */\n pan: z\n .string()\n .trim()\n .regex(/^[A-Z]{5}[0-9]{4}[A-Z]$/)\n .optional(),\n /** Aadhaar last-4 only (never the full number — Aadhaar Act\n * restricts storage). Required for goal ≥ ₹2L (Enhanced tier). */\n aadhaarLast4: z\n .string()\n .trim()\n .regex(/^[0-9]{4}$/)\n .optional(),\n /** GCS URLs of supporting documents (hospital invoice / school\n * admission letter / FIR / etc.). Required for goal ≥ ₹2L.\n * Verifier sees these on the review queue; donors do not. */\n supportingDocs: z.array(z.string().url()).max(CROWDFUNDING_MAX_SUPPORTING_DOCS).optional(),\n\n /** Optional community scoping. If set the creator must be an active\n * member; non-members get a 403 server-side. */\n communityId: z.string().optional(),\n\n /**\n * How the platform fee is settled — set on the composer's Pricing\n * step. Optional on the wire so legacy clients (and older drafts\n * being resumed) still validate; the backend defaults a missing\n * value to `'deferred'` (the no-money-now path) since that's the\n * non-destructive default — if the creator never explicitly picks\n * upfront the platform won't surprise-charge them. The submit-for-\n * review handler enforces that an `'upfront'` choice has actually\n * been paid before the campaign enters the verifier queue.\n */\n feeBillingMode: crowdfundingFeeBillingModeSchema.optional(),\n});\nexport type CreateCrowdfundingBody = z.infer<typeof createCrowdfundingBodySchema>;\n\n/**\n * Update body — only fields that are safe to change on a `draft` or\n * `rejected` campaign before resubmission. Verification + lifecycle\n * fields cannot be updated through this endpoint. Tier + identity\n * fields stay editable so a rejected campaign can fix what the\n * verifier flagged.\n */\nexport const updateCrowdfundingBodySchema = createCrowdfundingBodySchema.partial();\nexport type UpdateCrowdfundingBody = z.infer<typeof updateCrowdfundingBodySchema>;\n\n/**\n * What the verifier sends when approving. The `verifierScope`\n * lets a higher-tier leader claim their tier at action time (a\n * district leader approving a local campaign records `district`).\n */\nexport const approveCrowdfundingBodySchema = z.object({\n verifierScope: crowdfundingScopeSchema,\n});\nexport type ApproveCrowdfundingBody = z.infer<typeof approveCrowdfundingBodySchema>;\n\n/**\n * Rejection body. Reason is required and surfaces back to the creator\n * so they can fix the gap and resubmit.\n */\nexport const rejectCrowdfundingBodySchema = z.object({\n reason: z\n .string()\n .trim()\n .min(CROWDFUNDING_REJECTION_REASON_MIN_CHARS)\n .max(CROWDFUNDING_REJECTION_REASON_MAX_CHARS),\n});\nexport type RejectCrowdfundingBody = z.infer<typeof rejectCrowdfundingBodySchema>;\n\n// ─── Donation bodies ───────────────────────────────────────────────────────\n\n/**\n * Donor self-attests a donation. Receipt is OPTIONAL — the\n * attestation creates a `pending` row that the donor can attach a\n * receipt to later (anytime, from settings → My Donations) which\n * promotes it to `verified` and counts toward the progress bar.\n */\nexport const attestCrowdfundingDonationBodySchema = z.object({\n amountInr: z.number().int().min(1).max(CROWDFUNDING_MAX_DONATION_INR),\n isAnonymous: z.boolean().default(false),\n /** GCS URL of the receipt screenshot. When omitted the donation\n * enters `pending` state. */\n receiptUrl: z.string().url().optional(),\n});\nexport type AttestCrowdfundingDonationBody = z.infer<typeof attestCrowdfundingDonationBodySchema>;\n\n/**\n * Upload (or re-upload) a receipt for a previously-attested donation.\n * Promotes a `pending` row to `verified`; for an already-`verified`\n * row it replaces the receipt.\n */\nexport const uploadCrowdfundingReceiptBodySchema = z.object({\n receiptUrl: z.string().url(),\n});\nexport type UploadCrowdfundingReceiptBody = z.infer<typeof uploadCrowdfundingReceiptBodySchema>;\n\n// ─── Listing query ─────────────────────────────────────────────────────────\n\nexport const listCrowdfundingDonationsQuerySchema = z.object({\n page: z.number().int().positive().optional(),\n limit: z.number().int().positive().max(100).optional(),\n state: crowdfundingDonationStateSchema.optional(),\n});\nexport type ListCrowdfundingDonationsQuery = z.infer<typeof listCrowdfundingDonationsQuerySchema>;\n\n/**\n * Per-donor \"My Donations\" surface — different from the per-campaign\n * donor list. Returns every donation the viewer has attested, across\n * all campaigns, so the donor can spot any row that's still\n * `pending` and upload a receipt.\n */\nexport const listMyCrowdfundingDonationsQuerySchema = z.object({\n page: z.number().int().positive().optional(),\n limit: z.number().int().positive().max(100).optional(),\n state: crowdfundingDonationStateSchema.optional(),\n});\nexport type ListMyCrowdfundingDonationsQuery = z.infer<\n typeof listMyCrowdfundingDonationsQuerySchema\n>;\n"]}
1
+ {"version":3,"file":"crowdfunding.js","sourceRoot":"","sources":["../src/crowdfunding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,uCAAuC,EACvC,2CAA2C,EAC3C,kCAAkC,EAClC,kCAAkC,EAClC,6BAA6B,EAC7B,8BAA8B,EAC9B,yBAAyB,EACzB,uBAAuB,EACvB,gCAAgC,EAChC,8BAA8B,EAC9B,yBAAyB,EACzB,uCAAuC,EACvC,uCAAuC,EACvC,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,SAAS;IACT,WAAW;IACX,aAAa;IACb,eAAe;IACf,WAAW;IACX,UAAU;IACV,UAAU;IACV,OAAO;IACP,OAAO;IACP,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,cAAc;IACd,kBAAkB;IAClB;;;;;OAKG;IACH,mBAAmB;IACnB,OAAO;CACC,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,cAAc;CACN,CAAC;AACX,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;AAG/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,KAAK;IACL,OAAO;IACP,SAAS;IACT,WAAW;IACX,OAAO;CACC,CAAC;AACX,MAAM,CAAC,MAA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AAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACtD,KAAK,EAAE,+BAA+B,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC","sourcesContent":["/**\n * Community crowdfunding wire shapes.\n *\n * A crowdfunding campaign is a verified civic fundraiser surfaced in\n * the feed alongside posts / polls / lost-found / voice-box / donate-\n * item. The model is:\n *\n * 1. Creator drafts a campaign, fills bank + UPI QR + identity tier\n * based on the goal amount, picks an area scope.\n * 2. A leader at the matching scope (or any leader higher up the\n * hierarchy) reviews and approves OR rejects with reason.\n * Approved campaigns transition to ACTIVE and appear in the feed.\n * 3. Donors view the card, tap \"Donate\", pay externally via UPI\n * directly to the creator's bank — the platform never sees the\n * money. After paying, the donor self-attests amount + uploads a\n * receipt screenshot (optional). Without a screenshot the\n * donation enters PENDING state — the donor can upload the\n * receipt later (anytime, from settings → My Donations).\n * 4. The live progress bar shows ONLY verified amount (receipt\n * uploaded). Pending donations are counted separately and\n * surfaced as a secondary \"₹X pending receipt\" note. This is the\n * product decision: the visible progress reflects trust-grounded\n * money, not claims.\n *\n * Privacy: bank account number, IFSC, PAN, Aadhaar last-4, and\n * supporting documents are NEVER on the wire. Only `bankAccountLast4`,\n * `bankAccountHolderName`, and a UPI QR URL surface to donors.\n *\n * @module community-schema/crowdfunding\n */\n\nimport { z } from 'zod';\nimport { areaLineageSnapshotSchema } from './area.js';\nimport {\n CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS,\n CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_MAX_DONATION_INR,\n CROWDFUNDING_MAX_DURATION_DAYS,\n CROWDFUNDING_MAX_GOAL_INR,\n CROWDFUNDING_MAX_IMAGES,\n CROWDFUNDING_MAX_SUPPORTING_DOCS,\n CROWDFUNDING_MIN_DURATION_DAYS,\n CROWDFUNDING_MIN_GOAL_INR,\n CROWDFUNDING_REJECTION_REASON_MAX_CHARS,\n CROWDFUNDING_REJECTION_REASON_MIN_CHARS,\n CROWDFUNDING_TITLE_MAX_CHARS,\n CROWDFUNDING_TITLE_MIN_CHARS,\n} from './constants.js';\nimport { voteValueSchema } from './engagement.js';\nimport { postAuthorSnapshotSchema } from './post.js';\n\n// ─── Enums ─────────────────────────────────────────────────────────────────\n\n/**\n * Top-level categories — drives the chip + icon on the card and the\n * verifier's per-category supporting-doc requirements (medical needs\n * hospital invoice; education needs admission letter; etc.).\n */\nexport const CROWDFUNDING_CATEGORY_VALUES = [\n 'medical',\n 'maternity',\n 'senior_care',\n 'special_needs',\n 'education',\n 'memorial',\n 'disaster',\n 'civic',\n 'faith',\n 'sports_talent',\n 'animal_welfare',\n 'environment',\n 'legal_aid',\n 'arts_culture',\n 'self_improvement',\n /**\n * Startup / prototype building — distinct from `self_improvement`\n * (which is now strictly skill / coursework). Covers MVP builds,\n * tooling, initial inventory, working capital, registration fees,\n * marketing for genuine first-stage entrepreneurs.\n */\n 'startup_prototype',\n 'other',\n] as const;\n\n/**\n * Who the campaign is for — drives the relation chip set and the\n * organization-specific identity asks on the composer. Captured so the\n * verifier can match the campaign narrative to the supporting docs\n * (e.g. an `organization` audience should produce 12A / 80G papers,\n * not a personal hospital bill).\n */\nexport const CROWDFUNDING_AUDIENCE_VALUES = [\n 'self',\n 'family',\n 'friend',\n 'community',\n 'organization',\n] as const;\nexport const crowdfundingAudienceSchema = z.enum(CROWDFUNDING_AUDIENCE_VALUES);\nexport type CrowdfundingAudience = z.infer<typeof crowdfundingAudienceSchema>;\n\n/**\n * Org-registration class — only meaningful when `audience ===\n * 'organization'`. Drives the verifier's expected document set\n * (12A/80G for trust, FCRA-style papers for NGO, etc.).\n */\nexport const CROWDFUNDING_ORG_KIND_VALUES = [\n 'ngo',\n 'trust',\n 'society',\n 'section_8',\n 'other',\n] as const;\nexport const crowdfundingOrgKindSchema = z.enum(CROWDFUNDING_ORG_KIND_VALUES);\nexport type CrowdfundingOrgKind = z.infer<typeof crowdfundingOrgKindSchema>;\nexport const crowdfundingCategorySchema = z.enum(CROWDFUNDING_CATEGORY_VALUES);\nexport type CrowdfundingCategory = z.infer<typeof crowdfundingCategorySchema>;\n\n/**\n * Area scope — drives the required verifier role. A higher-tier\n * leader can always verify a lower-tier campaign (escalation path);\n * the reverse is rejected.\n */\nexport const CROWDFUNDING_SCOPE_VALUES = [\n 'local',\n 'district',\n 'state',\n 'national',\n 'global',\n] as const;\nexport const crowdfundingScopeSchema = z.enum(CROWDFUNDING_SCOPE_VALUES);\nexport type CrowdfundingScope = z.infer<typeof crowdfundingScopeSchema>;\n\n/**\n * Lifecycle state. `submitted` is the verifier's queue; `active` is\n * publishable in the feed; the three `closed_*` are terminal end-states\n * with different reasons.\n */\nexport const CROWDFUNDING_STATUS_VALUES = [\n 'draft',\n 'submitted',\n 'rejected',\n 'active',\n 'closed_success',\n 'closed_timeout',\n 'closed_by_creator',\n] as const;\nexport const crowdfundingStatusSchema = z.enum(CROWDFUNDING_STATUS_VALUES);\nexport type CrowdfundingStatus = z.infer<typeof crowdfundingStatusSchema>;\n\n/**\n * Per-donation verification state. `pending` = attested but no\n * receipt. `verified` = receipt uploaded (creator confirmation\n * optional). `disputed` = creator marked \"I didn't receive this\".\n * Only `verified` rolls into the campaign's `verifiedAmountInr`\n * which drives the visible progress bar.\n */\nexport const CROWDFUNDING_DONATION_STATE_VALUES = ['pending', 'verified', 'disputed'] as const;\nexport const crowdfundingDonationStateSchema = z.enum(CROWDFUNDING_DONATION_STATE_VALUES);\nexport type CrowdfundingDonationState = z.infer<typeof crowdfundingDonationStateSchema>;\n\n/**\n * When the platform fee is settled:\n * - `'upfront'` — Creator pays a FLAT scope-tiered fee via Razorpay\n * BEFORE the campaign goes to leader review (₹500 local / ₹1,000\n * district / ₹2,000 state / ₹5,000 national / ₹10,000 global —\n * see `CROWDFUNDING_UPFRONT_FEE_INR_BY_SCOPE`). Approved\n * campaigns then disburse 100 % of donations to the creator.\n * - `'deferred'` — Nothing paid upfront. At disbursement time the\n * platform deducts 5 % of COLLECTED donations (see\n * `CROWDFUNDING_DEFERRED_FEE_RATE`) before transferring the rest\n * to the creator. The creator accepts an \"I promise to pay\"\n * attestation on the Pricing step to take this path.\n *\n * The choice is captured at submit time on the composer's Pricing\n * step and surfaced on the wire so the My Campaigns surface can show\n * \"Paid ₹X\" / \"Will deduct at payout\" badges per campaign.\n */\nexport const CROWDFUNDING_FEE_BILLING_MODE_VALUES = ['upfront', 'deferred'] as const;\nexport const crowdfundingFeeBillingModeSchema = z.enum(CROWDFUNDING_FEE_BILLING_MODE_VALUES);\nexport type CrowdfundingFeeBillingMode = z.infer<typeof crowdfundingFeeBillingModeSchema>;\n\n/**\n * Server-tracked state of the upfront-billing payment. Always\n * `'deferred'` when the creator picked the on-collection mode (there\n * is nothing to pay until disbursement). For upfront mode it starts\n * at `'pending'` on draft create, flips to `'paid'` after Razorpay\n * verify, and stays `'paid'` for the campaign lifetime.\n *\n * No `'failed'` state today — if Razorpay fails or the user dismisses\n * the modal, the row stays `'pending'` and the next retry transitions\n * via the same flow. A failure state can be added when (and if) the\n * My Campaigns surface needs a distinct \"retry needed\" badge.\n */\nexport const CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES = ['pending', 'paid', 'deferred'] as const;\nexport const crowdfundingFeePaymentStatusSchema = z.enum(CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES);\nexport type CrowdfundingFeePaymentStatus = z.infer<typeof crowdfundingFeePaymentStatusSchema>;\n\n// ─── Sub-shapes ────────────────────────────────────────────────────────────\n\n/**\n * Per-campaign verification block. `approved` is the only state that\n * lets the campaign go ACTIVE; `pending` keeps it queued; `rejected`\n * is terminal-with-resubmit-allowed.\n */\nexport const crowdfundingVerificationSchema = z.object({\n status: z.enum(['pending', 'approved', 'rejected']),\n /** The leader who acted on this submission (display name —\n * live-joined from User at projection time). */\n verifiedByDisplayName: z.string().optional(),\n verifiedByUserId: z.string().optional(),\n /** When the leader acted. Approved + rejected both stamp this. */\n verifiedAt: z.string().datetime().optional(),\n /** The scope the verifier claimed when acting. A district leader\n * acting on a local campaign records `district` here so the\n * audit log shows the escalation path. */\n verifierScope: crowdfundingScopeSchema.optional(),\n /** Required when `status === 'rejected'`. Why the leader said no. */\n rejectionReason: z.string().optional(),\n});\nexport type CrowdfundingVerification = z.infer<typeof crowdfundingVerificationSchema>;\n\n/**\n * Public-facing payment surface — what the donor sees in the Donate\n * dialog. The full account number, IFSC, PAN, Aadhaar, supporting\n * docs etc. are kept server-side; only what's needed for the donor\n * to send money + recognise the recipient is exposed.\n */\nexport const crowdfundingPaymentSchema = z.object({\n /** GCS URL of the UPI QR code image uploaded by the creator. The\n * Donate dialog renders this for the donor to scan. */\n upiQrUrl: z.string().url(),\n /** Optional VPA — lets the donor tap a one-tap UPI deep link\n * instead of scanning the QR. e.g. \"ravi@okhdfcbank\". */\n upiId: z.string().optional(),\n /** Last 4 digits of the bank account — shown to the donor as\n * reassurance (\"ending in ••1234\"). Full number never surfaces. */\n bankAccountLast4: z.string().length(4),\n /** Account holder's name — must match the verified author display\n * name (penny-drop + UDP cross-check at submission time). */\n bankAccountHolderName: z.string(),\n /** Optional bank short name surfaced on the dialog. */\n bankName: z.string().optional(),\n});\nexport type CrowdfundingPayment = z.infer<typeof crowdfundingPaymentSchema>;\n\n// ─── Wire shape — feed item ────────────────────────────────────────────────\n\n/**\n * The card-renderable wire shape. Mirrors the engagement + author +\n * area-lineage shape of other feed kinds so the existing\n * EngagementBar, AuthorByline, and feed-projection helpers slot in\n * 1:1 without per-kind branches.\n */\nexport const crowdfundingFeedItemSchema = z.object({\n _id: z.string(),\n contentKind: z.literal('crowdfunding'),\n author: postAuthorSnapshotSchema,\n\n // ─── Campaign content ────────────────────────────────────────────\n title: z.string(),\n description: z.string(),\n category: crowdfundingCategorySchema,\n beneficiaryName: z.string(),\n beneficiaryRelation: z.string().optional(),\n /** Who the campaign is for. Optional on the wire so historic\n * campaigns created before this field landed still validate. */\n audience: crowdfundingAudienceSchema.optional(),\n /** Optional explainer when `category === 'other'` — the writer's\n * short label for the custom cause (e.g. \"Wedding emergency\"). */\n categoryOther: z.string().optional(),\n /** Up to 3 sub-causes within the chosen category, e.g.\n * [\"Cancer treatment\", \"ICU / critical care\"] for `medical`. */\n subCauses: z.array(z.string()).max(3).optional(),\n /** When one of the picked sub-causes is \"Other\", this carries the\n * writer's clarification (e.g. \"Reconstructive surgery\"). */\n subCauseOther: z.string().optional(),\n /** Org-registration class. Only meaningful when\n * `audience === 'organization'`. */\n organizationKind: crowdfundingOrgKindSchema.optional(),\n /** When `organizationKind === 'other'`, the writer's clarification\n * (e.g. \"Religious body\", \"Cooperative\"). */\n organizationKindOther: z.string().optional(),\n /** Story images (separate from supporting documents, which are\n * verifier-only). Up to `CROWDFUNDING_MAX_IMAGES`. */\n images: z.array(z.string().url()).max(CROWDFUNDING_MAX_IMAGES).optional(),\n /** Optional YouTube URL surfaced as a preview/playback embed\n * alongside the story photos. Accepted forms: youtube.com/watch?v=,\n * youtu.be/, youtube.com/shorts/, youtube.com/embed/,\n * m.youtube.com/watch?v=. The wire stores whatever the creator\n * pasted; clients extract the video id themselves at render time. */\n youtubeUrl: z.string().url().optional(),\n\n // ─── Goal + progress ─────────────────────────────────────────────\n goalAmountInr: z.number().int().positive(),\n /** Sum of donations whose `verificationState === 'verified'`\n * (receipt uploaded or creator confirmed). THIS drives the visible\n * progress bar — the product decision is that only trust-grounded\n * money counts visually. */\n verifiedAmountInr: z.number().int().nonnegative(),\n /** Total attested amount — verified + pending + disputed\n * combined. Surfaced as secondary text (\"₹X pending receipt\")\n * so creator + donors can see the full attested pipeline without\n * it inflating the headline progress. */\n attestedAmountInr: z.number().int().nonnegative(),\n /** Distinct donors who attested any state. */\n donorCount: z.number().int().nonnegative(),\n /** Distinct donors whose latest donation is `verified`. The card\n * uses this for \"47 verified supporters\" copy. */\n verifiedDonorCount: z.number().int().nonnegative(),\n\n closesAt: z.string().datetime(),\n\n // ─── Verification surface ────────────────────────────────────────\n scope: crowdfundingScopeSchema,\n verification: crowdfundingVerificationSchema,\n\n // ─── Payment surface (donor-facing) ──────────────────────────────\n payment: crowdfundingPaymentSchema,\n\n // ─── Lifecycle ───────────────────────────────────────────────────\n status: crowdfundingStatusSchema,\n closedAt: z.string().datetime().nullable().optional(),\n\n // ─── Platform fee — set on the composer's Pricing step ───────────\n /**\n * Creator's choice for how the platform fee is settled. Optional\n * on the wire so legacy campaigns created before this field landed\n * still validate; the My Campaigns surface falls back to \"deferred\n * (legacy)\" copy when missing.\n */\n feeBillingMode: crowdfundingFeeBillingModeSchema.optional(),\n /**\n * Server-tracked state of the upfront-billing payment. Always\n * `'deferred'` when `feeBillingMode === 'deferred'`. For upfront\n * campaigns: `'pending'` while the Razorpay flow is open or\n * incomplete, `'paid'` after verify.\n */\n feePaymentStatus: crowdfundingFeePaymentStatusSchema.optional(),\n /**\n * Platform fee in rupees recorded on the campaign:\n * - UPFRONT campaigns: the flat scope-tiered amount that was (or\n * will be) charged — looked up from\n * `CROWDFUNDING_UPFRONT_FEE_INR_BY_SCOPE[scope]` at draft time\n * and frozen on `feePaymentStatus === 'paid'`.\n * - DEFERRED campaigns: `0` until disbursement, then the actual\n * `5 % × verifiedAmountInr` written by the payout job.\n *\n * Surfaced so the My Campaigns surface can show \"Paid ₹500\" /\n * \"Will deduct ₹X at payout\" badges without recomputing.\n */\n platformFeeAmountInr: z.number().int().nonnegative().optional(),\n\n // ─── Standard engagement (same axis as other kinds) ──────────────\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 areaLineage: areaLineageSnapshotSchema,\n /** When set, the campaign is scoped to a topical community and the\n * geo-cascade feed query skips it (mirrors the post + poll\n * community-scoping rule). */\n communityId: z.string().optional(),\n\n createdAt: z.string().datetime(),\n\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 /** The viewer's own donation state on THIS campaign. `null`\n * means they haven't attested anything yet. Populated from\n * the latest CrowdfundingDonation row keyed by\n * (campaignId, viewerUserId). */\n donationState: crowdfundingDonationStateSchema.nullable(),\n /** Amount the viewer last attested, in ₹. Null when no\n * attestation. The card uses this to render the \"You gave\n * ₹500 — upload receipt\" prompt. */\n donationAmountInr: z.number().int().positive().nullable(),\n /** True when the viewer is eligible to verify this campaign\n * (matching-or-higher leader at the campaign's scope, viewing\n * a `submitted` campaign). Renders the in-card Verify CTA. */\n canVerify: z.boolean(),\n })\n .optional(),\n});\nexport type CrowdfundingFeedItem = z.infer<typeof crowdfundingFeedItemSchema>;\n\n// Same shape mirrored as the public \"wire\" alias for parity with the\n// other kinds whose feed envelope === detail envelope.\nexport const communityCrowdfundingWireSchema = crowdfundingFeedItemSchema;\nexport type CommunityCrowdfundingWire = z.infer<typeof communityCrowdfundingWireSchema>;\n\n// ─── Donation wire ─────────────────────────────────────────────────────────\n\n/**\n * Single donation row — surfaced on the campaign's public donor list\n * and on the donor's own \"My Donations\" surface. The full bank /\n * receipt URL stays server-side; the wire carries display info plus\n * the verification state.\n */\nexport const crowdfundingDonationWireSchema = z.object({\n _id: z.string(),\n campaignId: z.string(),\n /** Donor's userId — omitted when `isAnonymous`, so the wire is the\n * privacy boundary not the card. */\n donorUserId: z.string().optional(),\n donorDisplayName: z.string(),\n amountInr: z.number().int().positive(),\n isAnonymous: z.boolean(),\n attestedAt: z.string().datetime(),\n /** When the receipt was uploaded. Absent on pending donations. */\n receiptUploadedAt: z.string().datetime().nullable().optional(),\n /** Signed URL for the receipt screenshot. Visible only to:\n * - the donor (their own row)\n * - the campaign creator\n * - the verifier on review\n * - admin / moderators\n * The list endpoint scrubs this for all other viewers. */\n receiptUrl: z.string().url().nullable().optional(),\n verificationState: crowdfundingDonationStateSchema,\n /** Set when the creator confirmed receipt independently of a\n * receipt upload. e.g. \"I see ₹500 from Ravi in my account\". */\n creatorConfirmed: z.boolean().optional(),\n /** Set when the creator marked \"I didn't receive this\". Donor is\n * notified to upload the receipt; auto-reverts after 7 days. */\n disputeReason: z.string().optional(),\n});\nexport type CrowdfundingDonationWire = z.infer<typeof crowdfundingDonationWireSchema>;\n\n// ─── Create / update / lifecycle bodies ────────────────────────────────────\n\n/**\n * Composer payload. Identity + bank fields are tier-conditional —\n * the server cross-checks the chosen `goalAmountInr` against the\n * provided fields per the tier matrix in constants.ts.\n */\nexport const createCrowdfundingBodySchema = z.object({\n title: z.string().trim().min(CROWDFUNDING_TITLE_MIN_CHARS).max(CROWDFUNDING_TITLE_MAX_CHARS),\n description: z\n .string()\n .trim()\n .min(CROWDFUNDING_DESCRIPTION_MIN_CHARS)\n .max(CROWDFUNDING_DESCRIPTION_MAX_CHARS),\n category: crowdfundingCategorySchema,\n beneficiaryName: z.string().trim().min(2).max(CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS),\n beneficiaryRelation: z\n .string()\n .trim()\n .max(CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS)\n .optional(),\n /** Audience picker — drives the relation chip set + the\n * organization-specific identity sub-steps on the composer. */\n audience: crowdfundingAudienceSchema.optional(),\n /** When `category === 'other'`, the writer's short label for the\n * custom cause. Bounded to keep the database column sane. */\n categoryOther: z.string().trim().max(80).optional(),\n /** Up to 3 sub-causes within the chosen category. */\n subCauses: z.array(z.string().trim().max(60)).max(3).optional(),\n /** Writer's clarification when one of the picked sub-causes is\n * \"Other\". */\n subCauseOther: z.string().trim().max(80).optional(),\n /** Org-registration class. Only set when `audience === 'organization'`. */\n organizationKind: crowdfundingOrgKindSchema.optional(),\n /** Writer's clarification when `organizationKind === 'other'`. */\n organizationKindOther: z.string().trim().max(80).optional(),\n images: z.array(z.string().url()).max(CROWDFUNDING_MAX_IMAGES).optional(),\n /** Optional YouTube video URL. Validated as a URL here; the\n * client-side validator additionally checks the host/path matches\n * a recognised YouTube shape and extracts the video id for the\n * preview component. */\n youtubeUrl: z.string().url().optional(),\n\n goalAmountInr: z.number().int().min(CROWDFUNDING_MIN_GOAL_INR).max(CROWDFUNDING_MAX_GOAL_INR),\n /** Duration in days. The server resolves `closesAt = now +\n * durationDays * 86400 * 1000` so client clock skew can't push\n * the close-time into the past. */\n durationDays: z\n .number()\n .int()\n .min(CROWDFUNDING_MIN_DURATION_DAYS)\n .max(CROWDFUNDING_MAX_DURATION_DAYS),\n\n scope: crowdfundingScopeSchema,\n\n // ─── Payment fields (server keeps full account + IFSC encrypted;\n // wire only carries last-4 + holder name + optional UPI ID) ──\n upiQrUrl: z.string().url(),\n upiId: z.string().trim().max(50).optional(),\n /** Full bank account number — 9-18 digits per RBI's range. Stored\n * encrypted server-side; never on the public wire. */\n bankAccountNumber: z\n .string()\n .trim()\n .regex(/^[0-9]{9,18}$/),\n bankAccountHolderName: z.string().trim().min(2).max(100),\n /** Indian IFSC code — 4 letters + 0 + 6 alphanumerics. Stored\n * encrypted; truncated on the wire. */\n ifsc: z\n .string()\n .trim()\n .regex(/^[A-Z]{4}0[A-Z0-9]{6}$/),\n bankName: z.string().trim().max(100).optional(),\n\n // ─── Identity (tier-conditional, validated server-side) ──────────\n /** PAN — 5 letters + 4 digits + 1 letter. Required for goal ≥\n * ₹25k (Standard tier). Stored encrypted; never on the wire (the\n * audit log surfaces a masked \"ABCDE****F\" form to verifiers). */\n pan: z\n .string()\n .trim()\n .regex(/^[A-Z]{5}[0-9]{4}[A-Z]$/)\n .optional(),\n /** Aadhaar last-4 only (never the full number — Aadhaar Act\n * restricts storage). Required for goal ≥ ₹2L (Enhanced tier). */\n aadhaarLast4: z\n .string()\n .trim()\n .regex(/^[0-9]{4}$/)\n .optional(),\n /** GCS URLs of supporting documents (hospital invoice / school\n * admission letter / FIR / etc.). Required for goal ≥ ₹2L.\n * Verifier sees these on the review queue; donors do not. */\n supportingDocs: z.array(z.string().url()).max(CROWDFUNDING_MAX_SUPPORTING_DOCS).optional(),\n\n /** Optional community scoping. If set the creator must be an active\n * member; non-members get a 403 server-side. */\n communityId: z.string().optional(),\n\n /**\n * How the platform fee is settled — set on the composer's Pricing\n * step. Optional on the wire so legacy clients (and older drafts\n * being resumed) still validate; the backend defaults a missing\n * value to `'deferred'` (the no-money-now path) since that's the\n * non-destructive default — if the creator never explicitly picks\n * upfront the platform won't surprise-charge them. The submit-for-\n * review handler enforces that an `'upfront'` choice has actually\n * been paid before the campaign enters the verifier queue.\n */\n feeBillingMode: crowdfundingFeeBillingModeSchema.optional(),\n});\nexport type CreateCrowdfundingBody = z.infer<typeof createCrowdfundingBodySchema>;\n\n/**\n * Update body — only fields that are safe to change on a `draft` or\n * `rejected` campaign before resubmission. Verification + lifecycle\n * fields cannot be updated through this endpoint. Tier + identity\n * fields stay editable so a rejected campaign can fix what the\n * verifier flagged.\n */\nexport const updateCrowdfundingBodySchema = createCrowdfundingBodySchema.partial();\nexport type UpdateCrowdfundingBody = z.infer<typeof updateCrowdfundingBodySchema>;\n\n/**\n * What the verifier sends when approving. The `verifierScope`\n * lets a higher-tier leader claim their tier at action time (a\n * district leader approving a local campaign records `district`).\n */\nexport const approveCrowdfundingBodySchema = z.object({\n verifierScope: crowdfundingScopeSchema,\n});\nexport type ApproveCrowdfundingBody = z.infer<typeof approveCrowdfundingBodySchema>;\n\n/**\n * Rejection body. Reason is required and surfaces back to the creator\n * so they can fix the gap and resubmit.\n */\nexport const rejectCrowdfundingBodySchema = z.object({\n reason: z\n .string()\n .trim()\n .min(CROWDFUNDING_REJECTION_REASON_MIN_CHARS)\n .max(CROWDFUNDING_REJECTION_REASON_MAX_CHARS),\n});\nexport type RejectCrowdfundingBody = z.infer<typeof rejectCrowdfundingBodySchema>;\n\n// ─── Donation bodies ───────────────────────────────────────────────────────\n\n/**\n * Donor self-attests a donation. Receipt is OPTIONAL — the\n * attestation creates a `pending` row that the donor can attach a\n * receipt to later (anytime, from settings → My Donations) which\n * promotes it to `verified` and counts toward the progress bar.\n */\nexport const attestCrowdfundingDonationBodySchema = z.object({\n amountInr: z.number().int().min(1).max(CROWDFUNDING_MAX_DONATION_INR),\n isAnonymous: z.boolean().default(false),\n /** GCS URL of the receipt screenshot. When omitted the donation\n * enters `pending` state. */\n receiptUrl: z.string().url().optional(),\n});\nexport type AttestCrowdfundingDonationBody = z.infer<typeof attestCrowdfundingDonationBodySchema>;\n\n/**\n * Upload (or re-upload) a receipt for a previously-attested donation.\n * Promotes a `pending` row to `verified`; for an already-`verified`\n * row it replaces the receipt.\n */\nexport const uploadCrowdfundingReceiptBodySchema = z.object({\n receiptUrl: z.string().url(),\n});\nexport type UploadCrowdfundingReceiptBody = z.infer<typeof uploadCrowdfundingReceiptBodySchema>;\n\n// ─── Listing query ─────────────────────────────────────────────────────────\n\nexport const listCrowdfundingDonationsQuerySchema = z.object({\n page: z.number().int().positive().optional(),\n limit: z.number().int().positive().max(100).optional(),\n state: crowdfundingDonationStateSchema.optional(),\n});\nexport type ListCrowdfundingDonationsQuery = z.infer<typeof listCrowdfundingDonationsQuerySchema>;\n\n/**\n * Per-donor \"My Donations\" surface — different from the per-campaign\n * donor list. Returns every donation the viewer has attested, across\n * all campaigns, so the donor can spot any row that's still\n * `pending` and upload a receipt.\n */\nexport const listMyCrowdfundingDonationsQuerySchema = z.object({\n page: z.number().int().positive().optional(),\n limit: z.number().int().positive().max(100).optional(),\n state: crowdfundingDonationStateSchema.optional(),\n});\nexport type ListMyCrowdfundingDonationsQuery = z.infer<\n typeof listMyCrowdfundingDonationsQuerySchema\n>;\n"]}
package/dist/index.d.ts CHANGED
@@ -25,6 +25,7 @@ export { DONATE_ITEM_CONDITION_VALUES, DONATE_ITEM_STATUS_VALUES, type DonateIte
25
25
  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';
26
26
  export { LINK_PREVIEW_KIND_VALUES, type LinkPreview, type LinkPreviewKind, linkPreviewKindSchema, linkPreviewSchema, } from './link-preview.js';
27
27
  export { type PostImage, type PostVideo, postImageSchema, postVideoSchema, } from './media.js';
28
+ export { type ListNotificationsQuery, type ListNotificationsResponse, listNotificationsQuerySchema, listNotificationsResponseSchema, type MarkAllNotificationsReadBody, markAllNotificationsReadBodySchema, NOTIFICATION_CATEGORY_VALUES, NOTIFICATION_CHANNEL_VALUES, NOTIFICATION_PRIORITY_VALUES, NOTIFICATION_SOURCE_REF_KIND_VALUES, type NotificationActor, type NotificationCategory, type NotificationChannel, type NotificationPriority, type NotificationReadAllEvent, type NotificationReadEvent, type NotificationSourceRef, type NotificationSourceRefKind, type NotificationUnreadCount, type NotificationWire, notificationActorSchema, notificationCategorySchema, notificationChannelSchema, notificationPrioritySchema, notificationReadAllEventSchema, notificationReadEventSchema, notificationSourceRefKindSchema, notificationSourceRefSchema, notificationUnreadCountSchema, notificationWireSchema, REFORM_NOTIFICATION_SOCKET_EVENTS, type ReformNotificationSocketEvent, } from './notification.js';
28
29
  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';
29
30
  export { type CommunityPostWire, type CreatePostBody, communityPostWireSchema, createPostBodySchema, type PostAuthorSnapshot, postAuthorSnapshotSchema, type RepostedSource, repostedSourceSchema, type UpdatePostBody, updatePostBodySchema, } from './post.js';
30
31
  export { PEOPLE_LIST_FILTER_DEFAULT, PEOPLE_LIST_FILTER_VALUES, type PeopleListFilter, type PeopleListItem, type PeopleListResponse, type PeopleQueryParams, type ProfileMutuals, type PublicProfileWire, peopleListFilterSchema, peopleListItemSchema, peopleListResponseSchema, peopleQueryParamsSchema, profileMutualsSchema, publicProfileWireSchema, } from './profile.js';
@@ -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,qBAAqB,EACrB,kCAAkC,EAClC,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,+BAA+B,EAC/B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,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EACL,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,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
@@ -36,6 +36,8 @@ export { addGroupMembersBodySchema, communityGroupWireSchema, communityGroupWith
36
36
  export { LINK_PREVIEW_KIND_VALUES, linkPreviewKindSchema, linkPreviewSchema, } from './link-preview.js';
37
37
  // ─── Media ─────────────────────────────────────────────────────────────────
38
38
  export { postImageSchema, postVideoSchema, } from './media.js';
39
+ // ─── Notifications ─────────────────────────────────────────────────────────
40
+ export { listNotificationsQuerySchema, listNotificationsResponseSchema, markAllNotificationsReadBodySchema, NOTIFICATION_CATEGORY_VALUES, NOTIFICATION_CHANNEL_VALUES, NOTIFICATION_PRIORITY_VALUES, NOTIFICATION_SOURCE_REF_KIND_VALUES, notificationActorSchema, notificationCategorySchema, notificationChannelSchema, notificationPrioritySchema, notificationReadAllEventSchema, notificationReadEventSchema, notificationSourceRefKindSchema, notificationSourceRefSchema, notificationUnreadCountSchema, notificationWireSchema, REFORM_NOTIFICATION_SOCKET_EVENTS, } from './notification.js';
39
41
  // ─── Poll ──────────────────────────────────────────────────────────────────
40
42
  export { castVoteBodySchema, communityPollFeedItemSchema, communityPollWireSchema, createPollBodySchema, POLL_RESULTS_VISIBILITY_VALUES, pollOptionInputSchema, pollOptionWireSchema, pollResultsVisibilitySchema, voteResponseSchema, } from './poll.js';
41
43
  // ─── Post ──────────────────────────────────────────────────────────────────
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,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,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,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BAAkB,EAClB,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,EACpB,8BAA8B,EAI9B,qBAAqB,EACrB,oBAAoB,EACpB,2BAA2B,EAE3B,kBAAkB,GACnB,MAAM,WAAW,CAAC;AACnB,8EAA8E;AAC9E,OAAO,EAGL,uBAAuB,EACvB,oBAAoB,EAEpB,wBAAwB,EAExB,oBAAoB,EAEpB,oBAAoB,GACrB,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;AACrB,8EAA8E;AAC9E,OAAO,EAGL,8BAA8B,EAC9B,qBAAqB,EACrB,2BAA2B,EAE3B,2BAA2B,EAE3B,iCAAiC,GAClC,MAAM,eAAe,CAAC;AACvB,8EAA8E;AAC9E,OAAO,EAEL,0BAA0B,EAE1B,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,6EAA6E;AAC7E,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAGlB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,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 CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS,\n CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS,\n CROWDFUNDING_DEFERRED_FEE_RATE,\n CROWDFUNDING_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_MAX_DONATION_INR,\n CROWDFUNDING_MAX_DURATION_DAYS,\n CROWDFUNDING_MAX_GOAL_INR,\n CROWDFUNDING_MAX_IMAGES,\n CROWDFUNDING_MAX_SUPPORTING_DOCS,\n CROWDFUNDING_MIN_DURATION_DAYS,\n CROWDFUNDING_MIN_GOAL_INR,\n CROWDFUNDING_PAGE_SIZE,\n CROWDFUNDING_REJECTION_REASON_MAX_CHARS,\n CROWDFUNDING_REJECTION_REASON_MIN_CHARS,\n CROWDFUNDING_TIER_ENHANCED_INR,\n CROWDFUNDING_TIER_MAXIMUM_INR,\n CROWDFUNDING_TIER_STANDARD_INR,\n CROWDFUNDING_TITLE_MAX_CHARS,\n CROWDFUNDING_TITLE_MIN_CHARS,\n CROWDFUNDING_UPFRONT_FEE_INR_BY_SCOPE,\n computeCrowdfundingDeferredFee,\n EDIT_GRACE_WINDOW_MS,\n FEED_PAGE_SIZE,\n GROUP_MAX_MEMBERS,\n GROUP_NAME_MAX_CHARS,\n GROUP_NAME_MIN_CHARS,\n getCrowdfundingDeferredEstimate,\n getCrowdfundingUpfrontFee,\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// ─── Crowdfunding ──────────────────────────────────────────────────────────\nexport {\n type ApproveCrowdfundingBody,\n type AttestCrowdfundingDonationBody,\n approveCrowdfundingBodySchema,\n attestCrowdfundingDonationBodySchema,\n type CommunityCrowdfundingWire,\n CROWDFUNDING_AUDIENCE_VALUES,\n CROWDFUNDING_CATEGORY_VALUES,\n CROWDFUNDING_DONATION_STATE_VALUES,\n CROWDFUNDING_FEE_BILLING_MODE_VALUES,\n CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES,\n CROWDFUNDING_ORG_KIND_VALUES,\n CROWDFUNDING_SCOPE_VALUES,\n CROWDFUNDING_STATUS_VALUES,\n type CreateCrowdfundingBody,\n type CrowdfundingAudience,\n type CrowdfundingCategory,\n type CrowdfundingDonationState,\n type CrowdfundingDonationWire,\n type CrowdfundingFeeBillingMode,\n type CrowdfundingFeedItem,\n type CrowdfundingFeePaymentStatus,\n type CrowdfundingOrgKind,\n type CrowdfundingPayment,\n type CrowdfundingScope,\n type CrowdfundingStatus,\n type CrowdfundingVerification,\n communityCrowdfundingWireSchema,\n createCrowdfundingBodySchema,\n crowdfundingAudienceSchema,\n crowdfundingCategorySchema,\n crowdfundingDonationStateSchema,\n crowdfundingDonationWireSchema,\n crowdfundingFeeBillingModeSchema,\n crowdfundingFeedItemSchema,\n crowdfundingFeePaymentStatusSchema,\n crowdfundingOrgKindSchema,\n crowdfundingPaymentSchema,\n crowdfundingScopeSchema,\n crowdfundingStatusSchema,\n crowdfundingVerificationSchema,\n type ListCrowdfundingDonationsQuery,\n type ListMyCrowdfundingDonationsQuery,\n listCrowdfundingDonationsQuerySchema,\n listMyCrowdfundingDonationsQuerySchema,\n type RejectCrowdfundingBody,\n rejectCrowdfundingBodySchema,\n type UpdateCrowdfundingBody,\n type UploadCrowdfundingReceiptBody,\n updateCrowdfundingBodySchema,\n uploadCrowdfundingReceiptBodySchema,\n} from './crowdfunding.js';\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// ─── 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// ─── 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// ─── 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// ─── 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// ─── Social (follow) ───────────────────────────────────────────────────────\nexport {\n type ToggleFollowResponse,\n toggleFollowResponseSchema,\n type ViewerSocialState,\n viewerSocialStateSchema,\n} from './social.js';\n// ─── Social score (shared tier table) ─────────────────────────────────────\nexport {\n SOCIAL_SCORE_TIER_NAMES,\n SOCIAL_SCORE_TIERS,\n type SocialScoreTier,\n type SocialScoreTierName,\n tierFromSocialScore,\n} from './social-score.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,+B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AClC,MAAM,eAAe,CAAC;AACvB,8EAA8E;AAC9E,OAAO,EAEL,0BAA0B,EAE1B,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,6EAA6E;AAC7E,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAGlB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,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 CROWDFUNDING_BENEFICIARY_NAME_MAX_CHARS,\n CROWDFUNDING_BENEFICIARY_RELATION_MAX_CHARS,\n CROWDFUNDING_DEFERRED_FEE_RATE,\n CROWDFUNDING_DESCRIPTION_MAX_CHARS,\n CROWDFUNDING_DESCRIPTION_MIN_CHARS,\n CROWDFUNDING_MAX_DONATION_INR,\n CROWDFUNDING_MAX_DURATION_DAYS,\n CROWDFUNDING_MAX_GOAL_INR,\n CROWDFUNDING_MAX_IMAGES,\n CROWDFUNDING_MAX_SUPPORTING_DOCS,\n CROWDFUNDING_MIN_DURATION_DAYS,\n CROWDFUNDING_MIN_GOAL_INR,\n CROWDFUNDING_PAGE_SIZE,\n CROWDFUNDING_REJECTION_REASON_MAX_CHARS,\n CROWDFUNDING_REJECTION_REASON_MIN_CHARS,\n CROWDFUNDING_TIER_ENHANCED_INR,\n CROWDFUNDING_TIER_MAXIMUM_INR,\n CROWDFUNDING_TIER_STANDARD_INR,\n CROWDFUNDING_TITLE_MAX_CHARS,\n CROWDFUNDING_TITLE_MIN_CHARS,\n CROWDFUNDING_UPFRONT_FEE_INR_BY_SCOPE,\n computeCrowdfundingDeferredFee,\n EDIT_GRACE_WINDOW_MS,\n FEED_PAGE_SIZE,\n GROUP_MAX_MEMBERS,\n GROUP_NAME_MAX_CHARS,\n GROUP_NAME_MIN_CHARS,\n getCrowdfundingDeferredEstimate,\n getCrowdfundingUpfrontFee,\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// ─── Crowdfunding ──────────────────────────────────────────────────────────\nexport {\n type ApproveCrowdfundingBody,\n type AttestCrowdfundingDonationBody,\n approveCrowdfundingBodySchema,\n attestCrowdfundingDonationBodySchema,\n type CommunityCrowdfundingWire,\n CROWDFUNDING_AUDIENCE_VALUES,\n CROWDFUNDING_CATEGORY_VALUES,\n CROWDFUNDING_DONATION_STATE_VALUES,\n CROWDFUNDING_FEE_BILLING_MODE_VALUES,\n CROWDFUNDING_FEE_PAYMENT_STATUS_VALUES,\n CROWDFUNDING_ORG_KIND_VALUES,\n CROWDFUNDING_SCOPE_VALUES,\n CROWDFUNDING_STATUS_VALUES,\n type CreateCrowdfundingBody,\n type CrowdfundingAudience,\n type CrowdfundingCategory,\n type CrowdfundingDonationState,\n type CrowdfundingDonationWire,\n type CrowdfundingFeeBillingMode,\n type CrowdfundingFeedItem,\n type CrowdfundingFeePaymentStatus,\n type CrowdfundingOrgKind,\n type CrowdfundingPayment,\n type CrowdfundingScope,\n type CrowdfundingStatus,\n type CrowdfundingVerification,\n communityCrowdfundingWireSchema,\n createCrowdfundingBodySchema,\n crowdfundingAudienceSchema,\n crowdfundingCategorySchema,\n crowdfundingDonationStateSchema,\n crowdfundingDonationWireSchema,\n crowdfundingFeeBillingModeSchema,\n crowdfundingFeedItemSchema,\n crowdfundingFeePaymentStatusSchema,\n crowdfundingOrgKindSchema,\n crowdfundingPaymentSchema,\n crowdfundingScopeSchema,\n crowdfundingStatusSchema,\n crowdfundingVerificationSchema,\n type ListCrowdfundingDonationsQuery,\n type ListMyCrowdfundingDonationsQuery,\n listCrowdfundingDonationsQuerySchema,\n listMyCrowdfundingDonationsQuerySchema,\n type RejectCrowdfundingBody,\n rejectCrowdfundingBodySchema,\n type UpdateCrowdfundingBody,\n type UploadCrowdfundingReceiptBody,\n updateCrowdfundingBodySchema,\n uploadCrowdfundingReceiptBodySchema,\n} from './crowdfunding.js';\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// ─── 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// ─── 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// ─── Notifications ─────────────────────────────────────────────────────────\nexport {\n type ListNotificationsQuery,\n type ListNotificationsResponse,\n listNotificationsQuerySchema,\n listNotificationsResponseSchema,\n type MarkAllNotificationsReadBody,\n markAllNotificationsReadBodySchema,\n NOTIFICATION_CATEGORY_VALUES,\n NOTIFICATION_CHANNEL_VALUES,\n NOTIFICATION_PRIORITY_VALUES,\n NOTIFICATION_SOURCE_REF_KIND_VALUES,\n type NotificationActor,\n type NotificationCategory,\n type NotificationChannel,\n type NotificationPriority,\n type NotificationReadAllEvent,\n type NotificationReadEvent,\n type NotificationSourceRef,\n type NotificationSourceRefKind,\n type NotificationUnreadCount,\n type NotificationWire,\n notificationActorSchema,\n notificationCategorySchema,\n notificationChannelSchema,\n notificationPrioritySchema,\n notificationReadAllEventSchema,\n notificationReadEventSchema,\n notificationSourceRefKindSchema,\n notificationSourceRefSchema,\n notificationUnreadCountSchema,\n notificationWireSchema,\n REFORM_NOTIFICATION_SOCKET_EVENTS,\n type ReformNotificationSocketEvent,\n} from './notification.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// ─── 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// ─── 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// ─── Social (follow) ───────────────────────────────────────────────────────\nexport {\n type ToggleFollowResponse,\n toggleFollowResponseSchema,\n type ViewerSocialState,\n viewerSocialStateSchema,\n} from './social.js';\n// ─── Social score (shared tier table) ─────────────────────────────────────\nexport {\n SOCIAL_SCORE_TIER_NAMES,\n SOCIAL_SCORE_TIERS,\n type SocialScoreTier,\n type SocialScoreTierName,\n tierFromSocialScore,\n} from './social-score.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,489 @@
1
+ /**
2
+ * Notification wire shapes — the contract the frontend's
3
+ * `/notifications` page + bell badge consume from reform-backend.
4
+ *
5
+ * Architecture (community-notifications-implementation.md §1):
6
+ * - Persistence lives in reform-backend (ReformNotification +
7
+ * ReformNotificationReceipt collections).
8
+ * - This package owns the cross-repo TYPES — the enum, the wire
9
+ * row, the query shapes, the socket event names. One place to
10
+ * edit when a new category lands.
11
+ *
12
+ * Module layout (kept inside this single file to match the
13
+ * community-schema package's flat-per-domain convention):
14
+ *
15
+ * 1. Category enum
16
+ * 2. Priority + Channel enums
17
+ * 3. Source-ref + Actor sub-shapes
18
+ * 4. Wire row shape
19
+ * 5. List query (cursor pagination) + response
20
+ * 6. Unread count response
21
+ * 7. Mark-as-read body + mark-all body
22
+ * 8. Realtime socket event names + payloads
23
+ *
24
+ * Scalability hooks:
25
+ * - The category enum has explicit "domain prefix" groupings so
26
+ * adding a new domain (e.g. marketplace) is `MARKETPLACE_*` —
27
+ * no collision, no breaking change to consumers.
28
+ * - The `sourceRef.kind` enum is open-ended for the same reason.
29
+ * - `categories` query param accepts an array so filter chips on
30
+ * the frontend can group multiple kinds under one chip.
31
+ *
32
+ * @module community-schema/notification
33
+ */
34
+ import { z } from 'zod';
35
+ /**
36
+ * Every notification kind the frontend can render. Grouped by domain
37
+ * with a stable prefix so adding new kinds in one domain doesn't
38
+ * shuffle the others. The first five (`general`, `announcement`,
39
+ * `task`, `reminder`, `alert`) are the legacy values that already
40
+ * exist in production — kept here for backwards-compat with the
41
+ * leader / admin "Create notification" surface.
42
+ */
43
+ export declare const NOTIFICATION_CATEGORY_VALUES: readonly ["general", "announcement", "task", "reminder", "alert", "post_reaction", "post_vote", "post_comment", "post_comment_reply", "post_comment_reaction", "post_repost", "post_mention", "comment_mention", "new_follower", "friend_posted", "community_join_request", "community_membership_approved", "community_membership_rejected", "community_role_promoted", "community_role_demoted", "community_designation_set", "community_verified", "community_kicked", "community_deleted", "identity_verification_request", "identity_verification_granted", "crowdfunding_approved", "crowdfunding_rejected", "verifier_queue_new_campaign", "crowdfunding_donation_received", "crowdfunding_donation_receipt_uploaded", "crowdfunding_closed_success", "crowdfunding_closed_timeout", "chat_message", "chat_group_message", "chat_mention", "call_missed", "group_participant_added", "group_participant_removed"];
44
+ export declare const notificationCategorySchema: z.ZodEnum<{
45
+ general: "general";
46
+ announcement: "announcement";
47
+ task: "task";
48
+ reminder: "reminder";
49
+ alert: "alert";
50
+ post_reaction: "post_reaction";
51
+ post_vote: "post_vote";
52
+ post_comment: "post_comment";
53
+ post_comment_reply: "post_comment_reply";
54
+ post_comment_reaction: "post_comment_reaction";
55
+ post_repost: "post_repost";
56
+ post_mention: "post_mention";
57
+ comment_mention: "comment_mention";
58
+ new_follower: "new_follower";
59
+ friend_posted: "friend_posted";
60
+ community_join_request: "community_join_request";
61
+ community_membership_approved: "community_membership_approved";
62
+ community_membership_rejected: "community_membership_rejected";
63
+ community_role_promoted: "community_role_promoted";
64
+ community_role_demoted: "community_role_demoted";
65
+ community_designation_set: "community_designation_set";
66
+ community_verified: "community_verified";
67
+ community_kicked: "community_kicked";
68
+ community_deleted: "community_deleted";
69
+ identity_verification_request: "identity_verification_request";
70
+ identity_verification_granted: "identity_verification_granted";
71
+ crowdfunding_approved: "crowdfunding_approved";
72
+ crowdfunding_rejected: "crowdfunding_rejected";
73
+ verifier_queue_new_campaign: "verifier_queue_new_campaign";
74
+ crowdfunding_donation_received: "crowdfunding_donation_received";
75
+ crowdfunding_donation_receipt_uploaded: "crowdfunding_donation_receipt_uploaded";
76
+ crowdfunding_closed_success: "crowdfunding_closed_success";
77
+ crowdfunding_closed_timeout: "crowdfunding_closed_timeout";
78
+ chat_message: "chat_message";
79
+ chat_group_message: "chat_group_message";
80
+ chat_mention: "chat_mention";
81
+ call_missed: "call_missed";
82
+ group_participant_added: "group_participant_added";
83
+ group_participant_removed: "group_participant_removed";
84
+ }>;
85
+ export type NotificationCategory = z.infer<typeof notificationCategorySchema>;
86
+ /**
87
+ * Priority drives sorting + the "important" highlight on the row.
88
+ * `urgent` reserved for safety / security (account compromise,
89
+ * identity-verification escalation); most application categories are
90
+ * `normal`.
91
+ */
92
+ export declare const NOTIFICATION_PRIORITY_VALUES: readonly ["low", "normal", "high", "urgent"];
93
+ export declare const notificationPrioritySchema: z.ZodEnum<{
94
+ low: "low";
95
+ high: "high";
96
+ normal: "normal";
97
+ urgent: "urgent";
98
+ }>;
99
+ export type NotificationPriority = z.infer<typeof notificationPrioritySchema>;
100
+ /**
101
+ * Delivery channels. `in_app` writes a row + emits the live socket
102
+ * event; `push` dispatches a Web Push (handled by async-service in
103
+ * the future web-push phase). The model defaults to `['in_app']`
104
+ * for now — push integration lands separately.
105
+ */
106
+ export declare const NOTIFICATION_CHANNEL_VALUES: readonly ["in_app", "push"];
107
+ export declare const notificationChannelSchema: z.ZodEnum<{
108
+ in_app: "in_app";
109
+ push: "push";
110
+ }>;
111
+ export type NotificationChannel = z.infer<typeof notificationChannelSchema>;
112
+ /**
113
+ * Where the notification "came from" semantically — the entity that
114
+ * triggered it. Drives the frontend's deep-link AND its grouping
115
+ * (e.g. collapse 12 reactions on one post into one row keyed by
116
+ * `sourceRef: {kind:'post', id}` later if reaction storms become an
117
+ * issue).
118
+ *
119
+ * Open-ended on purpose — adding a new entity kind (`event`,
120
+ * `tournament`) is a one-line edit on next publish.
121
+ */
122
+ export declare const NOTIFICATION_SOURCE_REF_KIND_VALUES: readonly ["post", "comment", "community", "campaign", "user", "conversation"];
123
+ export declare const notificationSourceRefKindSchema: z.ZodEnum<{
124
+ post: "post";
125
+ user: "user";
126
+ community: "community";
127
+ comment: "comment";
128
+ campaign: "campaign";
129
+ conversation: "conversation";
130
+ }>;
131
+ export type NotificationSourceRefKind = z.infer<typeof notificationSourceRefKindSchema>;
132
+ export declare const notificationSourceRefSchema: z.ZodObject<{
133
+ kind: z.ZodEnum<{
134
+ post: "post";
135
+ user: "user";
136
+ community: "community";
137
+ comment: "comment";
138
+ campaign: "campaign";
139
+ conversation: "conversation";
140
+ }>;
141
+ id: z.ZodString;
142
+ }, z.core.$strip>;
143
+ export type NotificationSourceRef = z.infer<typeof notificationSourceRefSchema>;
144
+ /**
145
+ * Denormalised "who did this" snapshot. Stored on the notification
146
+ * row so the page can render the actor without an extra User
147
+ * lookup. Display-name refresh on rename is acceptable lag — the
148
+ * existing community-post author snapshot uses the same pattern.
149
+ */
150
+ export declare const notificationActorSchema: z.ZodObject<{
151
+ userId: z.ZodString;
152
+ displayName: z.ZodString;
153
+ avatarUrl: z.ZodOptional<z.ZodString>;
154
+ }, z.core.$strip>;
155
+ export type NotificationActor = z.infer<typeof notificationActorSchema>;
156
+ /**
157
+ * The shape rendered by `/notifications` and the bell dropdown
158
+ * (when that lands). Everything the row needs to display itself
159
+ * AND deep-link on tap, in one payload — no per-row follow-up
160
+ * fetches.
161
+ *
162
+ * `isRead` + `readAt` are joined from `ReformNotificationReceipt`
163
+ * server-side; the wire surface stays flat.
164
+ */
165
+ export declare const notificationWireSchema: z.ZodObject<{
166
+ _id: z.ZodString;
167
+ category: z.ZodEnum<{
168
+ general: "general";
169
+ announcement: "announcement";
170
+ task: "task";
171
+ reminder: "reminder";
172
+ alert: "alert";
173
+ post_reaction: "post_reaction";
174
+ post_vote: "post_vote";
175
+ post_comment: "post_comment";
176
+ post_comment_reply: "post_comment_reply";
177
+ post_comment_reaction: "post_comment_reaction";
178
+ post_repost: "post_repost";
179
+ post_mention: "post_mention";
180
+ comment_mention: "comment_mention";
181
+ new_follower: "new_follower";
182
+ friend_posted: "friend_posted";
183
+ community_join_request: "community_join_request";
184
+ community_membership_approved: "community_membership_approved";
185
+ community_membership_rejected: "community_membership_rejected";
186
+ community_role_promoted: "community_role_promoted";
187
+ community_role_demoted: "community_role_demoted";
188
+ community_designation_set: "community_designation_set";
189
+ community_verified: "community_verified";
190
+ community_kicked: "community_kicked";
191
+ community_deleted: "community_deleted";
192
+ identity_verification_request: "identity_verification_request";
193
+ identity_verification_granted: "identity_verification_granted";
194
+ crowdfunding_approved: "crowdfunding_approved";
195
+ crowdfunding_rejected: "crowdfunding_rejected";
196
+ verifier_queue_new_campaign: "verifier_queue_new_campaign";
197
+ crowdfunding_donation_received: "crowdfunding_donation_received";
198
+ crowdfunding_donation_receipt_uploaded: "crowdfunding_donation_receipt_uploaded";
199
+ crowdfunding_closed_success: "crowdfunding_closed_success";
200
+ crowdfunding_closed_timeout: "crowdfunding_closed_timeout";
201
+ chat_message: "chat_message";
202
+ chat_group_message: "chat_group_message";
203
+ chat_mention: "chat_mention";
204
+ call_missed: "call_missed";
205
+ group_participant_added: "group_participant_added";
206
+ group_participant_removed: "group_participant_removed";
207
+ }>;
208
+ priority: z.ZodEnum<{
209
+ low: "low";
210
+ high: "high";
211
+ normal: "normal";
212
+ urgent: "urgent";
213
+ }>;
214
+ title: z.ZodString;
215
+ body: z.ZodString;
216
+ actionUrl: z.ZodOptional<z.ZodString>;
217
+ isRead: z.ZodBoolean;
218
+ readAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
219
+ createdAt: z.ZodString;
220
+ sourceRef: z.ZodOptional<z.ZodObject<{
221
+ kind: z.ZodEnum<{
222
+ post: "post";
223
+ user: "user";
224
+ community: "community";
225
+ comment: "comment";
226
+ campaign: "campaign";
227
+ conversation: "conversation";
228
+ }>;
229
+ id: z.ZodString;
230
+ }, z.core.$strip>>;
231
+ actor: z.ZodOptional<z.ZodObject<{
232
+ userId: z.ZodString;
233
+ displayName: z.ZodString;
234
+ avatarUrl: z.ZodOptional<z.ZodString>;
235
+ }, z.core.$strip>>;
236
+ }, z.core.$strip>;
237
+ export type NotificationWire = z.infer<typeof notificationWireSchema>;
238
+ /**
239
+ * Opaque base64 cursor encoding `{createdAt, _id}` of the last
240
+ * fetched row — keyset pagination so deep scrolls stay fast even on
241
+ * an inbox with thousands of rows.
242
+ *
243
+ * Empty / missing cursor = newest page. `nextCursor` in the
244
+ * response is `null` when no more pages.
245
+ */
246
+ export declare const listNotificationsQuerySchema: z.ZodObject<{
247
+ cursor: z.ZodOptional<z.ZodString>;
248
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
249
+ unreadOnly: z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodCoercedBoolean<unknown>, z.ZodLiteral<"true">, z.ZodLiteral<"false">]>>, z.ZodTransform<boolean, boolean | "true" | "false" | undefined>>;
250
+ categories: z.ZodOptional<z.ZodArray<z.ZodEnum<{
251
+ general: "general";
252
+ announcement: "announcement";
253
+ task: "task";
254
+ reminder: "reminder";
255
+ alert: "alert";
256
+ post_reaction: "post_reaction";
257
+ post_vote: "post_vote";
258
+ post_comment: "post_comment";
259
+ post_comment_reply: "post_comment_reply";
260
+ post_comment_reaction: "post_comment_reaction";
261
+ post_repost: "post_repost";
262
+ post_mention: "post_mention";
263
+ comment_mention: "comment_mention";
264
+ new_follower: "new_follower";
265
+ friend_posted: "friend_posted";
266
+ community_join_request: "community_join_request";
267
+ community_membership_approved: "community_membership_approved";
268
+ community_membership_rejected: "community_membership_rejected";
269
+ community_role_promoted: "community_role_promoted";
270
+ community_role_demoted: "community_role_demoted";
271
+ community_designation_set: "community_designation_set";
272
+ community_verified: "community_verified";
273
+ community_kicked: "community_kicked";
274
+ community_deleted: "community_deleted";
275
+ identity_verification_request: "identity_verification_request";
276
+ identity_verification_granted: "identity_verification_granted";
277
+ crowdfunding_approved: "crowdfunding_approved";
278
+ crowdfunding_rejected: "crowdfunding_rejected";
279
+ verifier_queue_new_campaign: "verifier_queue_new_campaign";
280
+ crowdfunding_donation_received: "crowdfunding_donation_received";
281
+ crowdfunding_donation_receipt_uploaded: "crowdfunding_donation_receipt_uploaded";
282
+ crowdfunding_closed_success: "crowdfunding_closed_success";
283
+ crowdfunding_closed_timeout: "crowdfunding_closed_timeout";
284
+ chat_message: "chat_message";
285
+ chat_group_message: "chat_group_message";
286
+ chat_mention: "chat_mention";
287
+ call_missed: "call_missed";
288
+ group_participant_added: "group_participant_added";
289
+ group_participant_removed: "group_participant_removed";
290
+ }>>>;
291
+ }, z.core.$strip>;
292
+ export type ListNotificationsQuery = z.infer<typeof listNotificationsQuerySchema>;
293
+ export declare const listNotificationsResponseSchema: z.ZodObject<{
294
+ items: z.ZodArray<z.ZodObject<{
295
+ _id: z.ZodString;
296
+ category: z.ZodEnum<{
297
+ general: "general";
298
+ announcement: "announcement";
299
+ task: "task";
300
+ reminder: "reminder";
301
+ alert: "alert";
302
+ post_reaction: "post_reaction";
303
+ post_vote: "post_vote";
304
+ post_comment: "post_comment";
305
+ post_comment_reply: "post_comment_reply";
306
+ post_comment_reaction: "post_comment_reaction";
307
+ post_repost: "post_repost";
308
+ post_mention: "post_mention";
309
+ comment_mention: "comment_mention";
310
+ new_follower: "new_follower";
311
+ friend_posted: "friend_posted";
312
+ community_join_request: "community_join_request";
313
+ community_membership_approved: "community_membership_approved";
314
+ community_membership_rejected: "community_membership_rejected";
315
+ community_role_promoted: "community_role_promoted";
316
+ community_role_demoted: "community_role_demoted";
317
+ community_designation_set: "community_designation_set";
318
+ community_verified: "community_verified";
319
+ community_kicked: "community_kicked";
320
+ community_deleted: "community_deleted";
321
+ identity_verification_request: "identity_verification_request";
322
+ identity_verification_granted: "identity_verification_granted";
323
+ crowdfunding_approved: "crowdfunding_approved";
324
+ crowdfunding_rejected: "crowdfunding_rejected";
325
+ verifier_queue_new_campaign: "verifier_queue_new_campaign";
326
+ crowdfunding_donation_received: "crowdfunding_donation_received";
327
+ crowdfunding_donation_receipt_uploaded: "crowdfunding_donation_receipt_uploaded";
328
+ crowdfunding_closed_success: "crowdfunding_closed_success";
329
+ crowdfunding_closed_timeout: "crowdfunding_closed_timeout";
330
+ chat_message: "chat_message";
331
+ chat_group_message: "chat_group_message";
332
+ chat_mention: "chat_mention";
333
+ call_missed: "call_missed";
334
+ group_participant_added: "group_participant_added";
335
+ group_participant_removed: "group_participant_removed";
336
+ }>;
337
+ priority: z.ZodEnum<{
338
+ low: "low";
339
+ high: "high";
340
+ normal: "normal";
341
+ urgent: "urgent";
342
+ }>;
343
+ title: z.ZodString;
344
+ body: z.ZodString;
345
+ actionUrl: z.ZodOptional<z.ZodString>;
346
+ isRead: z.ZodBoolean;
347
+ readAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
348
+ createdAt: z.ZodString;
349
+ sourceRef: z.ZodOptional<z.ZodObject<{
350
+ kind: z.ZodEnum<{
351
+ post: "post";
352
+ user: "user";
353
+ community: "community";
354
+ comment: "comment";
355
+ campaign: "campaign";
356
+ conversation: "conversation";
357
+ }>;
358
+ id: z.ZodString;
359
+ }, z.core.$strip>>;
360
+ actor: z.ZodOptional<z.ZodObject<{
361
+ userId: z.ZodString;
362
+ displayName: z.ZodString;
363
+ avatarUrl: z.ZodOptional<z.ZodString>;
364
+ }, z.core.$strip>>;
365
+ }, z.core.$strip>>;
366
+ nextCursor: z.ZodNullable<z.ZodString>;
367
+ }, z.core.$strip>;
368
+ export type ListNotificationsResponse = z.infer<typeof listNotificationsResponseSchema>;
369
+ /**
370
+ * Cheap badge endpoint — `countDocuments({userId, readAt: null})`
371
+ * on the receipt collection. Returned by `GET /unread-count`.
372
+ * Polled by the bell every 60s as a fallback when the live socket
373
+ * is disconnected.
374
+ */
375
+ export declare const notificationUnreadCountSchema: z.ZodObject<{
376
+ count: z.ZodNumber;
377
+ }, z.core.$strip>;
378
+ export type NotificationUnreadCount = z.infer<typeof notificationUnreadCountSchema>;
379
+ export declare const markAllNotificationsReadBodySchema: z.ZodObject<{
380
+ categories: z.ZodOptional<z.ZodArray<z.ZodEnum<{
381
+ general: "general";
382
+ announcement: "announcement";
383
+ task: "task";
384
+ reminder: "reminder";
385
+ alert: "alert";
386
+ post_reaction: "post_reaction";
387
+ post_vote: "post_vote";
388
+ post_comment: "post_comment";
389
+ post_comment_reply: "post_comment_reply";
390
+ post_comment_reaction: "post_comment_reaction";
391
+ post_repost: "post_repost";
392
+ post_mention: "post_mention";
393
+ comment_mention: "comment_mention";
394
+ new_follower: "new_follower";
395
+ friend_posted: "friend_posted";
396
+ community_join_request: "community_join_request";
397
+ community_membership_approved: "community_membership_approved";
398
+ community_membership_rejected: "community_membership_rejected";
399
+ community_role_promoted: "community_role_promoted";
400
+ community_role_demoted: "community_role_demoted";
401
+ community_designation_set: "community_designation_set";
402
+ community_verified: "community_verified";
403
+ community_kicked: "community_kicked";
404
+ community_deleted: "community_deleted";
405
+ identity_verification_request: "identity_verification_request";
406
+ identity_verification_granted: "identity_verification_granted";
407
+ crowdfunding_approved: "crowdfunding_approved";
408
+ crowdfunding_rejected: "crowdfunding_rejected";
409
+ verifier_queue_new_campaign: "verifier_queue_new_campaign";
410
+ crowdfunding_donation_received: "crowdfunding_donation_received";
411
+ crowdfunding_donation_receipt_uploaded: "crowdfunding_donation_receipt_uploaded";
412
+ crowdfunding_closed_success: "crowdfunding_closed_success";
413
+ crowdfunding_closed_timeout: "crowdfunding_closed_timeout";
414
+ chat_message: "chat_message";
415
+ chat_group_message: "chat_group_message";
416
+ chat_mention: "chat_mention";
417
+ call_missed: "call_missed";
418
+ group_participant_added: "group_participant_added";
419
+ group_participant_removed: "group_participant_removed";
420
+ }>>>;
421
+ }, z.core.$strip>;
422
+ export type MarkAllNotificationsReadBody = z.infer<typeof markAllNotificationsReadBodySchema>;
423
+ /**
424
+ * Event names emitted by reform-backend's notification Socket.io
425
+ * namespace and consumed by the frontend stream hook. Stored as a
426
+ * const map so both producer and consumer reference the same
427
+ * strings (no typos).
428
+ *
429
+ * Room convention: each client joins `user:<userId>` on connect;
430
+ * events fan out to that room only.
431
+ */
432
+ export declare const REFORM_NOTIFICATION_SOCKET_EVENTS: {
433
+ /** A new notification was created for the viewer. Payload: NotificationWire. */
434
+ readonly NEW: "reform-notif:new";
435
+ /** A notification was marked read (possibly from another device). Payload: { notificationId }. */
436
+ readonly READ: "reform-notif:read";
437
+ /** All notifications (optionally filtered by categories) were marked read. Payload: { categories? }. */
438
+ readonly READ_ALL: "reform-notif:read-all";
439
+ };
440
+ export type ReformNotificationSocketEvent = (typeof REFORM_NOTIFICATION_SOCKET_EVENTS)[keyof typeof REFORM_NOTIFICATION_SOCKET_EVENTS];
441
+ export declare const notificationReadEventSchema: z.ZodObject<{
442
+ notificationId: z.ZodString;
443
+ }, z.core.$strip>;
444
+ export type NotificationReadEvent = z.infer<typeof notificationReadEventSchema>;
445
+ export declare const notificationReadAllEventSchema: z.ZodObject<{
446
+ categories: z.ZodOptional<z.ZodArray<z.ZodEnum<{
447
+ general: "general";
448
+ announcement: "announcement";
449
+ task: "task";
450
+ reminder: "reminder";
451
+ alert: "alert";
452
+ post_reaction: "post_reaction";
453
+ post_vote: "post_vote";
454
+ post_comment: "post_comment";
455
+ post_comment_reply: "post_comment_reply";
456
+ post_comment_reaction: "post_comment_reaction";
457
+ post_repost: "post_repost";
458
+ post_mention: "post_mention";
459
+ comment_mention: "comment_mention";
460
+ new_follower: "new_follower";
461
+ friend_posted: "friend_posted";
462
+ community_join_request: "community_join_request";
463
+ community_membership_approved: "community_membership_approved";
464
+ community_membership_rejected: "community_membership_rejected";
465
+ community_role_promoted: "community_role_promoted";
466
+ community_role_demoted: "community_role_demoted";
467
+ community_designation_set: "community_designation_set";
468
+ community_verified: "community_verified";
469
+ community_kicked: "community_kicked";
470
+ community_deleted: "community_deleted";
471
+ identity_verification_request: "identity_verification_request";
472
+ identity_verification_granted: "identity_verification_granted";
473
+ crowdfunding_approved: "crowdfunding_approved";
474
+ crowdfunding_rejected: "crowdfunding_rejected";
475
+ verifier_queue_new_campaign: "verifier_queue_new_campaign";
476
+ crowdfunding_donation_received: "crowdfunding_donation_received";
477
+ crowdfunding_donation_receipt_uploaded: "crowdfunding_donation_receipt_uploaded";
478
+ crowdfunding_closed_success: "crowdfunding_closed_success";
479
+ crowdfunding_closed_timeout: "crowdfunding_closed_timeout";
480
+ chat_message: "chat_message";
481
+ chat_group_message: "chat_group_message";
482
+ chat_mention: "chat_mention";
483
+ call_missed: "call_missed";
484
+ group_participant_added: "group_participant_added";
485
+ group_participant_removed: "group_participant_removed";
486
+ }>>>;
487
+ }, z.core.$strip>;
488
+ export type NotificationReadAllEvent = z.infer<typeof notificationReadAllEventSchema>;
489
+ //# sourceMappingURL=notification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../src/notification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,03BA+D/B,CAAC;AAEX,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAuC,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAI9E;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,8CAA+C,CAAC;AACzF,eAAO,MAAM,0BAA0B;;;;;EAAuC,CAAC;AAC/E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,6BAA8B,CAAC;AACvE,eAAO,MAAM,yBAAyB;;;EAAsC,CAAC;AAC7E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAI5E;;;;;;;;;GASG;AACH,eAAO,MAAM,mCAAmC,+EAOtC,CAAC;AACX,eAAO,MAAM,+BAA+B;;;;;;;EAA8C,CAAC;AAC3F,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,eAAO,MAAM,2BAA2B;;;;;;;;;;iBAGtC,CAAC;AACH,MAAM,MAAM,q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;;IAElG,wGAAwG;;CAEhG,CAAC;AACX,MAAM,MAAM,6BAA6B,GACvC,CAAC,OAAO,iCAAiC,CAAC,CAAC,MAAM,OAAO,iCAAiC,CAAC,CAAC;AAE7F,eAAO,MAAM,2BAA2B;;iBAEtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
@@ -0,0 +1,259 @@
1
+ /**
2
+ * Notification wire shapes — the contract the frontend's
3
+ * `/notifications` page + bell badge consume from reform-backend.
4
+ *
5
+ * Architecture (community-notifications-implementation.md §1):
6
+ * - Persistence lives in reform-backend (ReformNotification +
7
+ * ReformNotificationReceipt collections).
8
+ * - This package owns the cross-repo TYPES — the enum, the wire
9
+ * row, the query shapes, the socket event names. One place to
10
+ * edit when a new category lands.
11
+ *
12
+ * Module layout (kept inside this single file to match the
13
+ * community-schema package's flat-per-domain convention):
14
+ *
15
+ * 1. Category enum
16
+ * 2. Priority + Channel enums
17
+ * 3. Source-ref + Actor sub-shapes
18
+ * 4. Wire row shape
19
+ * 5. List query (cursor pagination) + response
20
+ * 6. Unread count response
21
+ * 7. Mark-as-read body + mark-all body
22
+ * 8. Realtime socket event names + payloads
23
+ *
24
+ * Scalability hooks:
25
+ * - The category enum has explicit "domain prefix" groupings so
26
+ * adding a new domain (e.g. marketplace) is `MARKETPLACE_*` —
27
+ * no collision, no breaking change to consumers.
28
+ * - The `sourceRef.kind` enum is open-ended for the same reason.
29
+ * - `categories` query param accepts an array so filter chips on
30
+ * the frontend can group multiple kinds under one chip.
31
+ *
32
+ * @module community-schema/notification
33
+ */
34
+ import { z } from 'zod';
35
+ // ─── 1. Category enum ──────────────────────────────────────────────
36
+ /**
37
+ * Every notification kind the frontend can render. Grouped by domain
38
+ * with a stable prefix so adding new kinds in one domain doesn't
39
+ * shuffle the others. The first five (`general`, `announcement`,
40
+ * `task`, `reminder`, `alert`) are the legacy values that already
41
+ * exist in production — kept here for backwards-compat with the
42
+ * leader / admin "Create notification" surface.
43
+ */
44
+ export const NOTIFICATION_CATEGORY_VALUES = [
45
+ // ─── Legacy broadcast categories (predate this expansion) ────────
46
+ 'general',
47
+ 'announcement',
48
+ 'task',
49
+ 'reminder',
50
+ 'alert',
51
+ // ─── Engagement (post + comment + follow surface) ────────────────
52
+ 'post_reaction',
53
+ 'post_vote',
54
+ 'post_comment',
55
+ 'post_comment_reply',
56
+ 'post_comment_reaction',
57
+ 'post_repost',
58
+ 'post_mention',
59
+ 'comment_mention',
60
+ 'new_follower',
61
+ /**
62
+ * Sent when someone the viewer follows publishes a new post.
63
+ * OPT-IN per category (the frontend settings page exposes a
64
+ * toggle — default off so this doesn't flood the inbox).
65
+ */
66
+ 'friend_posted',
67
+ // ─── Community lifecycle ─────────────────────────────────────────
68
+ 'community_join_request',
69
+ 'community_membership_approved',
70
+ 'community_membership_rejected',
71
+ 'community_role_promoted',
72
+ 'community_role_demoted',
73
+ 'community_designation_set',
74
+ 'community_verified',
75
+ 'community_kicked',
76
+ 'community_deleted',
77
+ // ─── Leader actions ──────────────────────────────────────────────
78
+ 'identity_verification_request',
79
+ 'identity_verification_granted',
80
+ 'crowdfunding_approved',
81
+ 'crowdfunding_rejected',
82
+ 'verifier_queue_new_campaign',
83
+ // ─── Crowdfunding donation lifecycle ─────────────────────────────
84
+ 'crowdfunding_donation_received',
85
+ 'crowdfunding_donation_receipt_uploaded',
86
+ 'crowdfunding_closed_success',
87
+ 'crowdfunding_closed_timeout',
88
+ // ─── Chat / calls (bridged from chat-server) ─────────────────────
89
+ /**
90
+ * Chat-server pushes these via the internal bridge endpoint after
91
+ * its own delivery logic has decided the recipient should ALSO get
92
+ * an inbox row (offline / not in the conversation / not muted).
93
+ * Chat-server still does its own Web Push for live ringers — the
94
+ * bridge is for the persistent inbox + bell badge only.
95
+ */
96
+ 'chat_message',
97
+ 'chat_group_message',
98
+ 'chat_mention',
99
+ 'call_missed',
100
+ 'group_participant_added',
101
+ 'group_participant_removed',
102
+ ];
103
+ export const notificationCategorySchema = z.enum(NOTIFICATION_CATEGORY_VALUES);
104
+ // ─── 2. Priority + channel ─────────────────────────────────────────
105
+ /**
106
+ * Priority drives sorting + the "important" highlight on the row.
107
+ * `urgent` reserved for safety / security (account compromise,
108
+ * identity-verification escalation); most application categories are
109
+ * `normal`.
110
+ */
111
+ export const NOTIFICATION_PRIORITY_VALUES = ['low', 'normal', 'high', 'urgent'];
112
+ export const notificationPrioritySchema = z.enum(NOTIFICATION_PRIORITY_VALUES);
113
+ /**
114
+ * Delivery channels. `in_app` writes a row + emits the live socket
115
+ * event; `push` dispatches a Web Push (handled by async-service in
116
+ * the future web-push phase). The model defaults to `['in_app']`
117
+ * for now — push integration lands separately.
118
+ */
119
+ export const NOTIFICATION_CHANNEL_VALUES = ['in_app', 'push'];
120
+ export const notificationChannelSchema = z.enum(NOTIFICATION_CHANNEL_VALUES);
121
+ // ─── 3. Source ref + actor ─────────────────────────────────────────
122
+ /**
123
+ * Where the notification "came from" semantically — the entity that
124
+ * triggered it. Drives the frontend's deep-link AND its grouping
125
+ * (e.g. collapse 12 reactions on one post into one row keyed by
126
+ * `sourceRef: {kind:'post', id}` later if reaction storms become an
127
+ * issue).
128
+ *
129
+ * Open-ended on purpose — adding a new entity kind (`event`,
130
+ * `tournament`) is a one-line edit on next publish.
131
+ */
132
+ export const NOTIFICATION_SOURCE_REF_KIND_VALUES = [
133
+ 'post',
134
+ 'comment',
135
+ 'community',
136
+ 'campaign',
137
+ 'user',
138
+ 'conversation',
139
+ ];
140
+ export const notificationSourceRefKindSchema = z.enum(NOTIFICATION_SOURCE_REF_KIND_VALUES);
141
+ export const notificationSourceRefSchema = z.object({
142
+ kind: notificationSourceRefKindSchema,
143
+ id: z.string(),
144
+ });
145
+ /**
146
+ * Denormalised "who did this" snapshot. Stored on the notification
147
+ * row so the page can render the actor without an extra User
148
+ * lookup. Display-name refresh on rename is acceptable lag — the
149
+ * existing community-post author snapshot uses the same pattern.
150
+ */
151
+ export const notificationActorSchema = z.object({
152
+ userId: z.string(),
153
+ displayName: z.string(),
154
+ avatarUrl: z.string().url().optional(),
155
+ });
156
+ // ─── 4. Wire row ───────────────────────────────────────────────────
157
+ /**
158
+ * The shape rendered by `/notifications` and the bell dropdown
159
+ * (when that lands). Everything the row needs to display itself
160
+ * AND deep-link on tap, in one payload — no per-row follow-up
161
+ * fetches.
162
+ *
163
+ * `isRead` + `readAt` are joined from `ReformNotificationReceipt`
164
+ * server-side; the wire surface stays flat.
165
+ */
166
+ export const notificationWireSchema = z.object({
167
+ _id: z.string(),
168
+ category: notificationCategorySchema,
169
+ priority: notificationPrioritySchema,
170
+ title: z.string(),
171
+ body: z.string(),
172
+ /**
173
+ * Deep-link destination. Tap on the row navigates here AND marks
174
+ * the row read. Optional because some categories (system maintenance
175
+ * banner) don't have a useful target.
176
+ */
177
+ actionUrl: z.string().optional(),
178
+ isRead: z.boolean(),
179
+ readAt: z.string().datetime().nullable().optional(),
180
+ createdAt: z.string().datetime(),
181
+ sourceRef: notificationSourceRefSchema.optional(),
182
+ actor: notificationActorSchema.optional(),
183
+ });
184
+ // ─── 5. List query (cursor pagination) ─────────────────────────────
185
+ /**
186
+ * Opaque base64 cursor encoding `{createdAt, _id}` of the last
187
+ * fetched row — keyset pagination so deep scrolls stay fast even on
188
+ * an inbox with thousands of rows.
189
+ *
190
+ * Empty / missing cursor = newest page. `nextCursor` in the
191
+ * response is `null` when no more pages.
192
+ */
193
+ export const listNotificationsQuerySchema = z.object({
194
+ cursor: z.string().optional(),
195
+ limit: z.coerce.number().int().positive().max(100).default(20),
196
+ /**
197
+ * When true, returns only rows where the viewer's receipt has
198
+ * `readAt: null`. Drives the "Unread" filter chip.
199
+ */
200
+ unreadOnly: z
201
+ .union([z.coerce.boolean(), z.literal('true'), z.literal('false')])
202
+ .optional()
203
+ .transform((v) => v === true || v === 'true'),
204
+ /**
205
+ * Filter by one or more categories. Accepts both a single string
206
+ * (`?categories=post_reaction`) and a comma-list
207
+ * (`?categories=post_reaction,post_comment`) — the express handler
208
+ * splits before the Zod parse.
209
+ */
210
+ categories: z.array(notificationCategorySchema).optional(),
211
+ });
212
+ export const listNotificationsResponseSchema = z.object({
213
+ items: z.array(notificationWireSchema),
214
+ nextCursor: z.string().nullable(),
215
+ });
216
+ // ─── 6. Unread count ───────────────────────────────────────────────
217
+ /**
218
+ * Cheap badge endpoint — `countDocuments({userId, readAt: null})`
219
+ * on the receipt collection. Returned by `GET /unread-count`.
220
+ * Polled by the bell every 60s as a fallback when the live socket
221
+ * is disconnected.
222
+ */
223
+ export const notificationUnreadCountSchema = z.object({
224
+ count: z.number().int().nonnegative(),
225
+ });
226
+ // ─── 7. Mark read / mark all read ──────────────────────────────────
227
+ export const markAllNotificationsReadBodySchema = z.object({
228
+ /**
229
+ * Optional — when set, only matching categories are cleared
230
+ * (lets a future "Clear reactions" inline action target one
231
+ * category without nuking the whole inbox).
232
+ */
233
+ categories: z.array(notificationCategorySchema).optional(),
234
+ });
235
+ // ─── 8. Realtime socket events ─────────────────────────────────────
236
+ /**
237
+ * Event names emitted by reform-backend's notification Socket.io
238
+ * namespace and consumed by the frontend stream hook. Stored as a
239
+ * const map so both producer and consumer reference the same
240
+ * strings (no typos).
241
+ *
242
+ * Room convention: each client joins `user:<userId>` on connect;
243
+ * events fan out to that room only.
244
+ */
245
+ export const REFORM_NOTIFICATION_SOCKET_EVENTS = {
246
+ /** A new notification was created for the viewer. Payload: NotificationWire. */
247
+ NEW: 'reform-notif:new',
248
+ /** A notification was marked read (possibly from another device). Payload: { notificationId }. */
249
+ READ: 'reform-notif:read',
250
+ /** All notifications (optionally filtered by categories) were marked read. Payload: { categories? }. */
251
+ READ_ALL: 'reform-notif:read-all',
252
+ };
253
+ export const notificationReadEventSchema = z.object({
254
+ notificationId: z.string(),
255
+ });
256
+ export const notificationReadAllEventSchema = z.object({
257
+ categories: z.array(notificationCategorySchema).optional(),
258
+ });
259
+ //# sourceMappingURL=notification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.js","sourceRoot":"","sources":["../src/notification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sEAAsE;AAEtE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,oEAAoE;IACpE,SAAS;IACT,cAAc;IACd,MAAM;IACN,UAAU;IACV,OAAO;IAEP,oEAAoE;IACpE,eAAe;IACf,WAAW;IACX,cAAc;IACd,oBAAoB;IACpB,uBAAuB;IACvB,aAAa;IACb,cAAc;IACd,iBAAiB;IACjB,cAAc;IACd;;;;OAIG;IACH,eAAe;IAEf,oEAAoE;IACpE,wBAAwB;IACxB,+BAA+B;IAC/B,+BAA+B;IAC/B,yBAAyB;IACzB,wBAAwB;IACxB,2BAA2B;IAC3B,oBAAoB;IACpB,kBAAkB;IAClB,mBAAmB;IAEnB,oEAAoE;IACpE,+BAA+B;IAC/B,+BAA+B;IAC/B,uBAAuB;IACvB,uBAAuB;IACvB,6BAA6B;IAE7B,oEAAoE;IACpE,gCAAgC;IAChC,wCAAwC;IACxC,6BAA6B;IAC7B,6BAA6B;IAE7B,oEAAoE;IACpE;;;;;;OAMG;IACH,cAAc;IACd,oBAAoB;IACpB,cAAc;IACd,aAAa;IACb,yBAAyB;IACzB,2BAA2B;CACnB,CAAC;AAEX,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;AAG/E,sEAAsE;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAK,EAAE,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;IACtC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAGH,sEAAsE;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;CACtC,CAAC,CAAC;AAGH,sEAAsE;AAEtE,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD;;;;OAIG;IACH,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,QAAQ,EAAE;CAC3D,CAAC,CAAC;AAGH,sEAAsE;AAEtE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,gFAAgF;IAChF,GAAG,EAAE,kBAAkB;IACvB,kGAAkG;IAClG,IAAI,EAAE,mBAAmB;IACzB,wGAAwG;IACxG,QAAQ,EAAE,uBAAuB;CACzB,CAAC;AAIX,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;CAC3B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,QAAQ,EAAE;CAC3D,CAAC,CAAC","sourcesContent":["/**\n * Notification wire shapes — the contract the frontend's\n * `/notifications` page + bell badge consume from reform-backend.\n *\n * Architecture (community-notifications-implementation.md §1):\n * - Persistence lives in reform-backend (ReformNotification +\n * ReformNotificationReceipt collections).\n * - This package owns the cross-repo TYPES — the enum, the wire\n * row, the query shapes, the socket event names. One place to\n * edit when a new category lands.\n *\n * Module layout (kept inside this single file to match the\n * community-schema package's flat-per-domain convention):\n *\n * 1. Category enum\n * 2. Priority + Channel enums\n * 3. Source-ref + Actor sub-shapes\n * 4. Wire row shape\n * 5. List query (cursor pagination) + response\n * 6. Unread count response\n * 7. Mark-as-read body + mark-all body\n * 8. Realtime socket event names + payloads\n *\n * Scalability hooks:\n * - The category enum has explicit \"domain prefix\" groupings so\n * adding a new domain (e.g. marketplace) is `MARKETPLACE_*` —\n * no collision, no breaking change to consumers.\n * - The `sourceRef.kind` enum is open-ended for the same reason.\n * - `categories` query param accepts an array so filter chips on\n * the frontend can group multiple kinds under one chip.\n *\n * @module community-schema/notification\n */\n\nimport { z } from 'zod';\n\n// ─── 1. Category enum ──────────────────────────────────────────────\n\n/**\n * Every notification kind the frontend can render. Grouped by domain\n * with a stable prefix so adding new kinds in one domain doesn't\n * shuffle the others. The first five (`general`, `announcement`,\n * `task`, `reminder`, `alert`) are the legacy values that already\n * exist in production — kept here for backwards-compat with the\n * leader / admin \"Create notification\" surface.\n */\nexport const NOTIFICATION_CATEGORY_VALUES = [\n // ─── Legacy broadcast categories (predate this expansion) ────────\n 'general',\n 'announcement',\n 'task',\n 'reminder',\n 'alert',\n\n // ─── Engagement (post + comment + follow surface) ────────────────\n 'post_reaction',\n 'post_vote',\n 'post_comment',\n 'post_comment_reply',\n 'post_comment_reaction',\n 'post_repost',\n 'post_mention',\n 'comment_mention',\n 'new_follower',\n /**\n * Sent when someone the viewer follows publishes a new post.\n * OPT-IN per category (the frontend settings page exposes a\n * toggle — default off so this doesn't flood the inbox).\n */\n 'friend_posted',\n\n // ─── Community lifecycle ─────────────────────────────────────────\n 'community_join_request',\n 'community_membership_approved',\n 'community_membership_rejected',\n 'community_role_promoted',\n 'community_role_demoted',\n 'community_designation_set',\n 'community_verified',\n 'community_kicked',\n 'community_deleted',\n\n // ─── Leader actions ──────────────────────────────────────────────\n 'identity_verification_request',\n 'identity_verification_granted',\n 'crowdfunding_approved',\n 'crowdfunding_rejected',\n 'verifier_queue_new_campaign',\n\n // ─── Crowdfunding donation lifecycle ─────────────────────────────\n 'crowdfunding_donation_received',\n 'crowdfunding_donation_receipt_uploaded',\n 'crowdfunding_closed_success',\n 'crowdfunding_closed_timeout',\n\n // ─── Chat / calls (bridged from chat-server) ─────────────────────\n /**\n * Chat-server pushes these via the internal bridge endpoint after\n * its own delivery logic has decided the recipient should ALSO get\n * an inbox row (offline / not in the conversation / not muted).\n * Chat-server still does its own Web Push for live ringers — the\n * bridge is for the persistent inbox + bell badge only.\n */\n 'chat_message',\n 'chat_group_message',\n 'chat_mention',\n 'call_missed',\n 'group_participant_added',\n 'group_participant_removed',\n] as const;\n\nexport const notificationCategorySchema = z.enum(NOTIFICATION_CATEGORY_VALUES);\nexport type NotificationCategory = z.infer<typeof notificationCategorySchema>;\n\n// ─── 2. Priority + channel ─────────────────────────────────────────\n\n/**\n * Priority drives sorting + the \"important\" highlight on the row.\n * `urgent` reserved for safety / security (account compromise,\n * identity-verification escalation); most application categories are\n * `normal`.\n */\nexport const NOTIFICATION_PRIORITY_VALUES = ['low', 'normal', 'high', 'urgent'] as const;\nexport const notificationPrioritySchema = z.enum(NOTIFICATION_PRIORITY_VALUES);\nexport type NotificationPriority = z.infer<typeof notificationPrioritySchema>;\n\n/**\n * Delivery channels. `in_app` writes a row + emits the live socket\n * event; `push` dispatches a Web Push (handled by async-service in\n * the future web-push phase). The model defaults to `['in_app']`\n * for now — push integration lands separately.\n */\nexport const NOTIFICATION_CHANNEL_VALUES = ['in_app', 'push'] as const;\nexport const notificationChannelSchema = z.enum(NOTIFICATION_CHANNEL_VALUES);\nexport type NotificationChannel = z.infer<typeof notificationChannelSchema>;\n\n// ─── 3. Source ref + actor ─────────────────────────────────────────\n\n/**\n * Where the notification \"came from\" semantically — the entity that\n * triggered it. Drives the frontend's deep-link AND its grouping\n * (e.g. collapse 12 reactions on one post into one row keyed by\n * `sourceRef: {kind:'post', id}` later if reaction storms become an\n * issue).\n *\n * Open-ended on purpose — adding a new entity kind (`event`,\n * `tournament`) is a one-line edit on next publish.\n */\nexport const NOTIFICATION_SOURCE_REF_KIND_VALUES = [\n 'post',\n 'comment',\n 'community',\n 'campaign',\n 'user',\n 'conversation',\n] as const;\nexport const notificationSourceRefKindSchema = z.enum(NOTIFICATION_SOURCE_REF_KIND_VALUES);\nexport type NotificationSourceRefKind = z.infer<typeof notificationSourceRefKindSchema>;\n\nexport const notificationSourceRefSchema = z.object({\n kind: notificationSourceRefKindSchema,\n id: z.string(),\n});\nexport type NotificationSourceRef = z.infer<typeof notificationSourceRefSchema>;\n\n/**\n * Denormalised \"who did this\" snapshot. Stored on the notification\n * row so the page can render the actor without an extra User\n * lookup. Display-name refresh on rename is acceptable lag — the\n * existing community-post author snapshot uses the same pattern.\n */\nexport const notificationActorSchema = z.object({\n userId: z.string(),\n displayName: z.string(),\n avatarUrl: z.string().url().optional(),\n});\nexport type NotificationActor = z.infer<typeof notificationActorSchema>;\n\n// ─── 4. Wire row ───────────────────────────────────────────────────\n\n/**\n * The shape rendered by `/notifications` and the bell dropdown\n * (when that lands). Everything the row needs to display itself\n * AND deep-link on tap, in one payload — no per-row follow-up\n * fetches.\n *\n * `isRead` + `readAt` are joined from `ReformNotificationReceipt`\n * server-side; the wire surface stays flat.\n */\nexport const notificationWireSchema = z.object({\n _id: z.string(),\n category: notificationCategorySchema,\n priority: notificationPrioritySchema,\n title: z.string(),\n body: z.string(),\n /**\n * Deep-link destination. Tap on the row navigates here AND marks\n * the row read. Optional because some categories (system maintenance\n * banner) don't have a useful target.\n */\n actionUrl: z.string().optional(),\n isRead: z.boolean(),\n readAt: z.string().datetime().nullable().optional(),\n createdAt: z.string().datetime(),\n sourceRef: notificationSourceRefSchema.optional(),\n actor: notificationActorSchema.optional(),\n});\nexport type NotificationWire = z.infer<typeof notificationWireSchema>;\n\n// ─── 5. List query (cursor pagination) ─────────────────────────────\n\n/**\n * Opaque base64 cursor encoding `{createdAt, _id}` of the last\n * fetched row — keyset pagination so deep scrolls stay fast even on\n * an inbox with thousands of rows.\n *\n * Empty / missing cursor = newest page. `nextCursor` in the\n * response is `null` when no more pages.\n */\nexport const listNotificationsQuerySchema = z.object({\n cursor: z.string().optional(),\n limit: z.coerce.number().int().positive().max(100).default(20),\n /**\n * When true, returns only rows where the viewer's receipt has\n * `readAt: null`. Drives the \"Unread\" filter chip.\n */\n unreadOnly: z\n .union([z.coerce.boolean(), z.literal('true'), z.literal('false')])\n .optional()\n .transform((v) => v === true || v === 'true'),\n /**\n * Filter by one or more categories. Accepts both a single string\n * (`?categories=post_reaction`) and a comma-list\n * (`?categories=post_reaction,post_comment`) — the express handler\n * splits before the Zod parse.\n */\n categories: z.array(notificationCategorySchema).optional(),\n});\nexport type ListNotificationsQuery = z.infer<typeof listNotificationsQuerySchema>;\n\nexport const listNotificationsResponseSchema = z.object({\n items: z.array(notificationWireSchema),\n nextCursor: z.string().nullable(),\n});\nexport type ListNotificationsResponse = z.infer<typeof listNotificationsResponseSchema>;\n\n// ─── 6. Unread count ───────────────────────────────────────────────\n\n/**\n * Cheap badge endpoint — `countDocuments({userId, readAt: null})`\n * on the receipt collection. Returned by `GET /unread-count`.\n * Polled by the bell every 60s as a fallback when the live socket\n * is disconnected.\n */\nexport const notificationUnreadCountSchema = z.object({\n count: z.number().int().nonnegative(),\n});\nexport type NotificationUnreadCount = z.infer<typeof notificationUnreadCountSchema>;\n\n// ─── 7. Mark read / mark all read ──────────────────────────────────\n\nexport const markAllNotificationsReadBodySchema = z.object({\n /**\n * Optional — when set, only matching categories are cleared\n * (lets a future \"Clear reactions\" inline action target one\n * category without nuking the whole inbox).\n */\n categories: z.array(notificationCategorySchema).optional(),\n});\nexport type MarkAllNotificationsReadBody = z.infer<typeof markAllNotificationsReadBodySchema>;\n\n// ─── 8. Realtime socket events ─────────────────────────────────────\n\n/**\n * Event names emitted by reform-backend's notification Socket.io\n * namespace and consumed by the frontend stream hook. Stored as a\n * const map so both producer and consumer reference the same\n * strings (no typos).\n *\n * Room convention: each client joins `user:<userId>` on connect;\n * events fan out to that room only.\n */\nexport const REFORM_NOTIFICATION_SOCKET_EVENTS = {\n /** A new notification was created for the viewer. Payload: NotificationWire. */\n NEW: 'reform-notif:new',\n /** A notification was marked read (possibly from another device). Payload: { notificationId }. */\n READ: 'reform-notif:read',\n /** All notifications (optionally filtered by categories) were marked read. Payload: { categories? }. */\n READ_ALL: 'reform-notif:read-all',\n} as const;\nexport type ReformNotificationSocketEvent =\n (typeof REFORM_NOTIFICATION_SOCKET_EVENTS)[keyof typeof REFORM_NOTIFICATION_SOCKET_EVENTS];\n\nexport const notificationReadEventSchema = z.object({\n notificationId: z.string(),\n});\nexport type NotificationReadEvent = z.infer<typeof notificationReadEventSchema>;\n\nexport const notificationReadAllEventSchema = z.object({\n categories: z.array(notificationCategorySchema).optional(),\n});\nexport type NotificationReadAllEvent = z.infer<typeof notificationReadAllEventSchema>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jansathi-community-schema",
3
- "version": "0.30.0",
3
+ "version": "0.32.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",