CommunityModerationRequest community.moderation-request@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- community
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/community/moderation-request.v1.json
community.moderation-request@1: bodies of the discussion moderation routes on OpenVibe.Community (community.comment.moderate; a browser must be a moderator). PUT /api/v1/comments/threads/:id/visibility: { visibility: public | hidden | locked }. PUT /api/v1/spaces/:space/threads/:slug/state: { pinned?, locked? }, at least one. PUT /api/v1/posts/:id: { body } (someone else's post). /api/v1/relay: POST /mappings { space, webhook_url_ref, enabled? } (webhook_url_ref is the NAME of an allow-listed environment variable, never a URL), PUT /mappings/:id { enabled }. DELETE /api/v1/comments/:commentId, DELETE /api/v1/spaces/:space/threads/:slug, DELETE /api/v1/posts/:id, POST /api/v1/relay/deliveries/:id/retry and the GETs take no body. Unknown fields are ignored.
Fields
This schema has no named fields.
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: lock-comments
{
"visibility": "locked"
}Valid: pin
{
"pinned": true
}Valid: relay-mapping
{
"space": "announcements",
"webhook_url_ref": "DISCORD_WEBHOOK_ANNOUNCEMENTS"
}Rejected: bad-visibility
{
"visibility": "deleted"
}Rejected: webhook-url
{
"space": "announcements",
"webhook_url_ref": "https://discord.com/api/webhooks/1/abc"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('community.moderation-request@1', value); // { valid, errors: [{ path, message }] }