CommunityModerationActionPayload community.moderation.action@1
Generated at from
openvibe-contracts v0.38.0 and
openvibe-sdk v0.5.0.
- Version
- 1.0.0
- Owner
- community
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-022
- Schema
https://openvibe.network/contracts/events/payloads/community.moderation.action.v1.json
community.moderation.action v1 (OpenVibe.Community server/events.js moderationAction). A staff action on someone else's content in Community: editing or deleting another person's paste, changing its visibility, censoring a screenshot, bulk actions, deleting forks, removing a comment, deleting or locking a thread. OpenVibe.Network keeps it in the moderation audit log (ADR-022). Envelope: subject { type: moderation_action, id: <target type>:<target id> }, visibility internal, actor the staff member. Never carries the content itself.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
action | enum | yes |
| |
target | object | yes |
| |
target.type | enum | yes |
| |
target.id | string | yes |
| |
target.owner_subject | string | null | Whose content it was, when known. | ||
actor_subject | string | null | yes | The staff member (null only for a service acting without a person). | |
reason | string | null |
| ||
details | object | Per action: the fields changed, a bulk action's name and count, … never the content. |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: bulk
{
"action": "pastes.bulk",
"target": {
"type": "pastes",
"id": "bulk"
},
"actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"details": {
"bulk_action": "private",
"done": 12,
"skipped": 1
}
}Valid: paste-deleted
{
"action": "paste.deleted",
"target": {
"type": "paste",
"id": "k3f9Qa",
"owner_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
},
"actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"reason": null,
"details": {}
}Rejected: carries-content
{
"action": "paste.edited",
"target": {
"type": "paste",
"id": "x"
},
"actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"content": "the paste text"
}Rejected: unknown-action
{
"action": "paste.promoted",
"target": {
"type": "paste",
"id": "x"
},
"actor_subject": null
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('community.moderation.action@1', value); // { valid, errors: [{ path, message }] }