sew-proto 0.11.6

Sew wire contracts: ids, addresses, errors, HTTP and gateway bodies, permissions, policies, audit.
Documentation
{
  "$defs": {
    "VoiceConnection": {
      "description": "Whether the engine has confirmed the member's media.",
      "oneOf": [
        {
          "const": "connecting",
          "description": "The admit is registered; media not confirmed yet.",
          "type": "string"
        },
        {
          "const": "connected",
          "description": "The engine confirmed the participant (also during a reconnect window).",
          "type": "string"
        }
      ]
    },
    "VoiceLeaveReason": {
      "description": "Why a member left voice. Sent only to the member themself. Codes are\nstable for metrics and logs.",
      "oneOf": [
        {
          "const": "left",
          "description": "The member left.",
          "type": "string"
        },
        {
          "const": "disconnected",
          "description": "The media connection ended for good.",
          "type": "string"
        },
        {
          "const": "replaced",
          "description": "Another device took over (swap).",
          "type": "string"
        },
        {
          "const": "moved",
          "description": "Moved (or switched) to another channel.",
          "type": "string"
        },
        {
          "const": "removed_by_moderator",
          "description": "A moderator disconnected the member.",
          "type": "string"
        },
        {
          "const": "perms_lost",
          "description": "CONNECT or VIEW was lost.",
          "type": "string"
        },
        {
          "const": "channel_archived",
          "description": "The channel was archived.",
          "type": "string"
        },
        {
          "const": "removed_from_space",
          "description": "The member left or was removed from the space.",
          "type": "string"
        },
        {
          "const": "timed_out",
          "description": "The member was timed out.",
          "type": "string"
        },
        {
          "const": "account_removed",
          "description": "The account was deprovisioned.",
          "type": "string"
        },
        {
          "const": "session_revoked",
          "description": "The login session was revoked.",
          "type": "string"
        },
        {
          "const": "device_revoked",
          "description": "The device was revoked.",
          "type": "string"
        },
        {
          "const": "orphaned",
          "description": "The media outlived every socket.",
          "type": "string"
        },
        {
          "const": "alone_timeout",
          "description": "Alone in the channel too long.",
          "type": "string"
        },
        {
          "const": "connect_timeout",
          "description": "Media never connected.",
          "type": "string"
        },
        {
          "const": "media_restarted",
          "description": "The engine restarted or was down and the media did not come back.",
          "type": "string"
        },
        {
          "const": "voice_disabled",
          "description": "Voice was turned off.",
          "type": "string"
        },
        {
          "const": "e2ee_sender_index_stuck",
          "description": "The sender stayed on a stale key slot.",
          "type": "string"
        },
        {
          "const": "call_ended",
          "description": "The DM call ended.",
          "type": "string"
        },
        {
          "const": "media_unused",
          "description": "Self-only (no leave): a camera or screen lease was released unused.",
          "type": "string"
        },
        {
          "const": "media_revoked",
          "description": "Self-only (no leave): a camera or screen lease was revoked.",
          "type": "string"
        },
        {
          "const": "unresponsive",
          "description": "The device stopped answering key requests (removed as unresponsive).",
          "type": "string"
        },
        {
          "const": "e2ee_unsupported_client",
          "description": "The engine refused the device's client (an SDK that cannot switch the sender key index)\nafter Sew admitted it; the join is dropped at once.",
          "type": "string"
        },
        {
          "const": "recording_declined",
          "description": "Declined the recording notice while declining means not joining.",
          "type": "string"
        },
        {
          "const": "recording_withdrawn",
          "description": "Withdrew recording consent while declining means not joining.",
          "type": "string"
        },
        {
          "const": "recording_consent_timeout",
          "description": "Left the recording notice unanswered too long while declining means not joining.",
          "type": "string"
        },
        {
          "const": "space_orphaned",
          "description": "The voice channel's Space was unbound from its App: a read-only orphan.",
          "type": "string"
        },
        {
          "const": "media_path_down",
          "description": "K2 said the media path (the TURN lane) is down: every live call\nended.",
          "type": "string"
        },
        {
          "const": "app_unlinked",
          "description": "Sew 0.8.0: the join came through an App whose participant link to the\nvoice channel's Space was removed.",
          "type": "string"
        }
      ]
    },
    "VoiceState": {
      "description": "A member's voice state.",
      "properties": {
        "call_id": {
          "description": "The DM call (`calls.id`) of a call entry; absent in voice channels.",
          "pattern": "^[1-9][0-9]{0,18}$",
          "type": [
            "string",
            "null"
          ]
        },
        "channel_id": {
          "description": "The voice channel.",
          "pattern": "^[1-9][0-9]{0,18}$",
          "type": "string"
        },
        "connection": {
          "$ref": "#/$defs/VoiceConnection",
          "description": "`connecting` or `connected`."
        },
        "joined_at": {
          "description": "When the join succeeded (a move resets it).",
          "format": "date-time",
          "type": "string"
        },
        "member_id": {
          "description": "The member.",
          "pattern": "^[1-9][0-9]{0,18}$",
          "type": "string"
        },
        "secure": {
          "description": "The member's device is in the activated key epoch (see the `secure_changed` dispatch).",
          "type": "boolean"
        },
        "self_deaf": {
          "description": "Deafened by the member (implies `self_mute`).",
          "type": "boolean"
        },
        "self_mute": {
          "description": "Muted by the member.",
          "type": "boolean"
        },
        "self_stream": {
          "default": false,
          "description": "The member holds a screen-share lease.",
          "type": "boolean"
        },
        "self_video": {
          "default": false,
          "description": "The member holds a camera lease.",
          "type": "boolean"
        },
        "server_deaf": {
          "description": "Deafened by a moderator (persistent per space).",
          "type": "boolean"
        },
        "server_mute": {
          "description": "Muted by a moderator (persistent per space).",
          "type": "boolean"
        },
        "space_id": {
          "description": "The channel's space; absent for DM calls.",
          "pattern": "^[1-9][0-9]{0,18}$",
          "type": [
            "string",
            "null"
          ]
        },
        "speak_denied": {
          "description": "The member lacks SPEAK here; clients show it as muted.",
          "type": "boolean"
        }
      },
      "required": [
        "member_id",
        "channel_id",
        "connection",
        "secure",
        "self_mute",
        "self_deaf",
        "server_mute",
        "server_deaf",
        "speak_denied",
        "joined_at"
      ],
      "type": "object"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Body of `voice_state_updated`: `channel_id = null` and `state = null` mean the\nmember left voice. `reason` is only in the copy sent to the member themself.",
  "properties": {
    "channel_id": {
      "description": "The channel now; absent when the member left voice.",
      "pattern": "^[1-9][0-9]{0,18}$",
      "type": [
        "string",
        "null"
      ]
    },
    "member_id": {
      "description": "The member.",
      "pattern": "^[1-9][0-9]{0,18}$",
      "type": "string"
    },
    "previous_channel_id": {
      "description": "The channel before a move or a leave.",
      "pattern": "^[1-9][0-9]{0,18}$",
      "type": [
        "string",
        "null"
      ]
    },
    "reason": {
      "anyOf": [
        {
          "$ref": "#/$defs/VoiceLeaveReason"
        },
        {
          "type": "null"
        }
      ],
      "description": "Why the member left or moved (self copy only)."
    },
    "space_id": {
      "description": "The space; absent for DM calls.",
      "pattern": "^[1-9][0-9]{0,18}$",
      "type": [
        "string",
        "null"
      ]
    },
    "state": {
      "anyOf": [
        {
          "$ref": "#/$defs/VoiceState"
        },
        {
          "type": "null"
        }
      ],
      "description": "The state now; absent when the member left voice."
    }
  },
  "required": [
    "member_id"
  ],
  "title": "VoiceStateUpdated",
  "type": "object"
}