jansathi-moderation-schema
v0.1.3
Published
Shared Zod schemas for the Jansathi app-level Moderation system (frontend + backend). Single source of truth for moderation enums, config, types, and validation.
Maintainers
Readme
jansathi-moderation-schema
Single source of truth for the Jansathi app-level Moderation system — shared
between reform-backend (moderation module) and jansathi-frontend (moderator surface).
Owns the enums, validation (Zod), behavior config, and types for the unified abuse-report moderation queue that an app-level moderator uses to review everything reported across every service (community, dating, marketplace, rent, property, resource-sharing, …).
What's inside
- Enums (
*_VALUESarrays — also used as Mongooseenum:sources): service, target class (content/media/account), target type, reason taxonomy, case status, action, severity. - Config (behavior SSOT):
REASON_SEVERITY,severityForReasons,TARGET_TYPE_CLASS,ACTIONS_BY_TARGET_CLASS,ACTIONS_REQUIRING_REASON,AUTOHIDE_THRESHOLD,OWNER_RESPONSE_WINDOW_HOURS. - Helpers:
objectIdSchema,areaRefSchema,caseLocationSchema(the denormalized origin-area used by the location filter). - Query:
moderationQueueQuerySchema(filters incl. location),moderationStatsQuerySchema. - Decision:
moderationCaseParamsSchema,moderationDecideBodySchema,moderationOwnerReplyBodySchema. - Response entities:
ModerationCase,ModerationCaseDetail,ModerationQueueResult,ModerationStats, etc.
Display strings live in the app's i18n (moderation.json), keyed by these enum values —
not here.
Build
npm install
npm run build # tsc → dist/
npm run check # type-check + biomePublished to npm; consumers install the published version (never file:../).
