CodesModerationActionPayload codes.moderation.action@1

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

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

codes.moderation.action v1 (ADR-022, roadmap WS-D task 1). A staff or moderator action on someone else's content or account in OpenVibe.Codes, such as revoking or deprecating someone else's release or app, and withdrawing trust in a publisher or signing key. Not a person acting on their own content. Written to the service's outbox in the transaction that performs the action; OpenVibe.Network keeps it in the moderation audit log. The payload is common.moderation-action@1. Envelope: subject { type: moderation_action, id: <target type>:<target id> }, visibility internal, actor the staff member. Never carries the content itself.

Fields

This schema has no named fields.

Examples

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

Valid: release-revoked
{
  "action": "release.revoked",
  "target": {
    "type": "release",
    "id": "rel_01JAB2C3D4E5F6G7H8J9K0MNPT",
    "owner_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "reason": "malware in 1.4.2",
  "details": {
    "app": "app_3",
    "version": "1.4.2"
  }
}
Rejected: no-target
{
  "action": "release.revoked",
  "actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "reason": "malware in 1.4.2"
}

Validate

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