LiveModerationActionPayload live.moderation.action@1

Generated at from openvibe-contracts v0.51.0 and openvibe-sdk v0.11.0.

Version
1.0.0
Owner
live
Visibility
first-party
Status
active
Compatibility
backward
Decision
ADR-022
Schema
https://openvibe.network/contracts/events/payloads/live.moderation.action.v1.json

live.moderation.action v1 (OpenVibe.Live server/db/database.js logModerationAction; ADR-022). A staff or channel moderator action taken on OpenVibe.Live outside chat: site and global bans, IP bans, message deletes and purges from Live's admin panel, a stream force-ended, relay users hidden, channel moderators added or removed. Not a person tidying their own messages or configuring their own channel. Written to Live's outbox in the transaction that records the action. OpenVibe.Network keeps it in the moderation audit log. Envelope: subject { type: moderation_action, id: <action_id> }, visibility internal, actor the acting person when known. details is free-form per action (never secrets or message text beyond what moderators saw).

Fields

FieldTypeRequiredDescriptionConstraints
action_idintegeryes
  • minimum 1
action_typestringyessite_ban, global_ban, ip_ban_all, message_delete, bulk_message_delete, stream_force_end, channel_mod_add, … as Live names them.
  • minLength 1
  • maxLength 64
scope_typestringyessite, channel, stream, room, …
  • minLength 1
  • maxLength 32
scope_idstring | integer | null
actor_user_idinteger | nullLegacy Live user id of the actor (kept while subjects are adopted).
actor_subjectstring | null
target_user_idinteger | null
target_subjectstring | null
detailsobject

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: force-end
{
  "action_id": 1205,
  "action_type": "stream_force_end",
  "scope_type": "stream",
  "scope_id": 9001,
  "actor_user_id": 1,
  "actor_subject": null,
  "target_user_id": 44,
  "target_subject": null,
  "details": {}
}
Valid: site-ban
{
  "action_id": 1204,
  "action_type": "site_ban",
  "scope_type": "site",
  "scope_id": null,
  "actor_user_id": 1,
  "actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "target_user_id": 44,
  "target_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "details": {
    "reason": "spam",
    "ban_type": "permanent"
  }
}
Rejected: no-action-type
{
  "action_id": 1206,
  "scope_type": "site"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('live.moderation.action@1', value);   // { valid, errors: [{ path, message }] }