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

FieldTypeRequiredDescriptionConstraints
actionenumyes
  • one of "paste.edited", "paste.deleted", "paste.visibility_changed", "paste.censored", "pastes.bulk", "forks.deleted", "comment.deleted", "thread.deleted", "thread.locked", "thread.unlocked", "post.deleted"
targetobjectyes
  • no other fields
target.typeenumyes
  • one of "paste", "paste_comment", "comment", "thread", "post", "pastes"
target.idstringyes
  • minLength 1
  • maxLength 200
target.owner_subjectstring | nullWhose content it was, when known.
actor_subjectstring | nullyesThe staff member (null only for a service acting without a person).
reasonstring | null
  • maxLength 500
detailsobjectPer 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 }] }