Skip to content
Svartz v2.6.0

@svartz/plugin-moderation

12 exported symbols.

Interfaces

i BuildDataWhat the build tells the server about the vault.
i ModerationOptionsThe `moderation` plugin's options.
i ModerationServerOptionsWhat the server module receives: the options with every default filled in.
i ReportRequest`POST <endpoint>/reports/` takes this JSON body and answers 201 with `{ report: { id } }`.

Types

t TargetKind

Functions

f moderationThe `moderation` plugin: its routes and Reports panel on the server, and the Report action in the browser.
f mountBrowser script entry: answer `data-svartz-report` buttons, and add **Report** to a note's page actions. The build doesn't know a host app's `paths.base`, so the routes get the deployment base here, from `context`.

Variables

v defaultThe `moderation` server module: `server: { module, options }` with `ModerationServerOptions` and the build's `BuildData`.
v DEFAULT_REPORTS_PER_HOURReports each signed-in reader may send per hour unless `limits.reportsPerHour` says otherwise.
v MODERATION_PLUGIN_IDThe plugin's id, and so its URL segment: `<base><mount>/_svartz/moderation/`.
v REASON_MAX_LENGTHCharacters in a report's reason, counted in UTF-16 code units as `maxlength` counts them.
v TARGET_KINDSWhat a report can be about, and how each is named: a page by its slug, a commit by its full SHA, a submission by its pull request number, an annotation by its id, and an account by its handle.