{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "ack": {
      "description": "Answers a heartbeat.",
      "properties": {},
      "required": [],
      "type": "object"
    },
    "activity": {
      "description": "Reports that the user is actively using this client, which holds back push notifications to their other devices for a few minutes. Clients send it while visible and focused.",
      "properties": {},
      "required": [],
      "type": "object"
    },
    "applicationEvent": {
      "description": "The pending-application queue changed. Only sent to members who can manage approvals.",
      "properties": {
        "application": {
          "description": "The application. Absent on approve.",
          "ref": "social.colibri.beta.community.defs#applicationView",
          "type": "ref"
        },
        "community": {
          "description": "The community.",
          "format": "did",
          "type": "string"
        },
        "event": {
          "description": "What happened.",
          "knownValues": [
            "create",
            "approve",
            "dismiss",
            "undismiss"
          ],
          "type": "string"
        },
        "subject": {
          "description": "The applicant.",
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "event",
        "community",
        "subject"
      ],
      "type": "object"
    },
    "bridgeEvent": {
      "description": "A registration held by the connected bridge was changed or removed. Sent only to the bridge, which should fetch its configuration again.",
      "properties": {
        "community": {
          "description": "The community the registration belongs to.",
          "format": "did",
          "type": "string"
        },
        "event": {
          "description": "What happened.",
          "knownValues": [
            "update",
            "delete"
          ],
          "type": "string"
        },
        "registration": {
          "description": "Record key of the registration.",
          "format": "tid",
          "type": "string"
        }
      },
      "required": [
        "event",
        "community",
        "registration"
      ],
      "type": "object"
    },
    "categoryEvent": {
      "description": "A category was created, changed, or deleted.",
      "properties": {
        "category": {
          "description": "The category. Absent on delete.",
          "ref": "social.colibri.beta.community.defs#categoryView",
          "type": "ref"
        },
        "community": {
          "description": "The community it belongs to.",
          "format": "did",
          "type": "string"
        },
        "event": {
          "description": "What happened.",
          "knownValues": [
            "create",
            "update",
            "delete"
          ],
          "type": "string"
        },
        "rkey": {
          "description": "Which category, for deletes.",
          "format": "record-key",
          "type": "string"
        }
      },
      "required": [
        "event",
        "community"
      ],
      "type": "object"
    },
    "channelEvent": {
      "description": "A channel was created, changed, or deleted.",
      "properties": {
        "channel": {
          "description": "The channel. Absent on delete.",
          "ref": "social.colibri.beta.community.defs#channelView",
          "type": "ref"
        },
        "community": {
          "description": "The community it belongs to.",
          "format": "did",
          "type": "string"
        },
        "event": {
          "description": "What happened.",
          "knownValues": [
            "create",
            "update",
            "delete"
          ],
          "type": "string"
        },
        "space": {
          "description": "Which channel, for deletes.",
          "format": "space-ref",
          "type": "string"
        }
      },
      "required": [
        "event",
        "community"
      ],
      "type": "object"
    },
    "communityEvent": {
      "description": "A community's profile or settings changed.",
      "properties": {
        "community": {
          "description": "The community.",
          "format": "did",
          "type": "string"
        },
        "event": {
          "description": "What happened.",
          "knownValues": [
            "update",
            "delete"
          ],
          "type": "string"
        },
        "view": {
          "description": "The community. Absent on delete.",
          "ref": "social.colibri.beta.community.defs#communityView",
          "type": "ref"
        }
      },
      "required": [
        "event",
        "community"
      ],
      "type": "object"
    },
    "communityProgressEvent": {
      "description": "Progress while a community is being created or migrated, which takes several PDS round-trips.",
      "properties": {
        "community": {
          "description": "The community, once its account exists.",
          "format": "did",
          "type": "string"
        },
        "completed": {
          "description": "Steps finished.",
          "type": "integer"
        },
        "message": {
          "description": "Human-readable detail, set on failure.",
          "type": "string"
        },
        "step": {
          "description": "What the AppView is doing now.",
          "knownValues": [
            "creatingAccount",
            "creatingSpaces",
            "writingProfile",
            "creatingOwnerRole",
            "creatingStarterChannels",
            "readingLegacyRepo",
            "writingSettings",
            "migratingRoles",
            "migratingMembers",
            "migratingBans",
            "migratingChannels",
            "migratingCategories",
            "mirroringMessages",
            "retiringLegacyCommunity",
            "done",
            "failed"
          ],
          "type": "string"
        },
        "total": {
          "description": "Steps in total.",
          "type": "integer"
        }
      },
      "required": [
        "step",
        "completed",
        "total"
      ],
      "type": "object"
    },
    "drainNotice": {
      "description": "This node is going offline. Clients move their event socket to another node from listNodes. When no other node exists, clients warn the user that the connection may drop at the deadline.",
      "properties": {
        "deadline": {
          "description": "When the node closes its remaining connections.",
          "format": "datetime",
          "type": "string"
        },
        "reason": {
          "description": "Why the node goes offline.",
          "knownValues": [
            "update",
            "maintenance",
            "retire"
          ],
          "type": "string"
        }
      },
      "required": [
        "deadline"
      ],
      "type": "object"
    },
    "emojiEvent": {
      "description": "A community's custom emoji or packs changed. Sent to the community's subscribers. Carries the whole catalog so clients replace it in one step.",
      "properties": {
        "catalog": {
          "description": "The catalog after the change.",
          "ref": "social.colibri.beta.emoji.defs#catalogView",
          "type": "ref"
        },
        "owner": {
          "description": "The community whose catalog changed.",
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "owner",
        "catalog"
      ],
      "type": "object"
    },
    "emojiLibraryEvent": {
      "description": "The user's emoji library changed. Sent to a user's own connections when their own emoji change, a follow is added or removed, or the owner of something they follow changes their emoji. Carries the whole library so clients replace it in one step.",
      "properties": {
        "library": {
          "description": "The user's whole library after the change.",
          "ref": "social.colibri.beta.emoji.defs#libraryView",
          "type": "ref"
        }
      },
      "required": [
        "library"
      ],
      "type": "object"
    },
    "error": {
      "description": "Something the client sent could not be acted on.",
      "properties": {
        "error": {
          "description": "Error name.",
          "knownValues": [
            "InvalidFrame",
            "Forbidden",
            "NotFound",
            "RateLimited",
            "ReadOnly"
          ],
          "type": "string"
        },
        "message": {
          "description": "Human-readable detail.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object"
    },
    "heartbeat": {
      "description": "Keeps the connection alive and tells the AppView the user is still present. The server answers with an ack.",
      "properties": {},
      "required": [],
      "type": "object"
    },
    "invitationEvent": {
      "description": "A community's invitation list changed. Only sent to members who can create invitations.",
      "properties": {
        "code": {
          "description": "The invitation code that was created or deleted.",
          "type": "string"
        },
        "community": {
          "description": "The community.",
          "format": "did",
          "type": "string"
        },
        "event": {
          "description": "What happened.",
          "knownValues": [
            "create",
            "delete"
          ],
          "type": "string"
        }
      },
      "required": [
        "event",
        "community",
        "code"
      ],
      "type": "object"
    },
    "labelEvent": {
      "description": "A label was applied or retracted on a record in a subscribed space.",
      "properties": {
        "event": {
          "description": "What happened.",
          "knownValues": [
            "create",
            "negate"
          ],
          "type": "string"
        },
        "space": {
          "description": "The space the labelled record lives in.",
          "format": "space-ref",
          "type": "string"
        },
        "src": {
          "description": "The labeler.",
          "format": "did",
          "type": "string"
        },
        "subject": {
          "description": "The labelled record.",
          "ref": "social.colibri.beta.label#subject",
          "type": "ref"
        },
        "val": {
          "description": "The label value.",
          "type": "string"
        }
      },
      "required": [
        "event",
        "space",
        "subject",
        "val",
        "src"
      ],
      "type": "object"
    },
    "memberEvent": {
      "description": "Someone joined, left, or had their roles changed.",
      "properties": {
        "community": {
          "description": "The community.",
          "format": "did",
          "type": "string"
        },
        "event": {
          "description": "What happened. A kick or a ban arrives as a leave.",
          "knownValues": [
            "join",
            "leave",
            "update"
          ],
          "type": "string"
        },
        "member": {
          "description": "The member. Absent on leave.",
          "ref": "social.colibri.beta.community.defs#memberView",
          "type": "ref"
        },
        "subject": {
          "description": "Who, for leaves.",
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "event",
        "community"
      ],
      "type": "object"
    },
    "messageEvent": {
      "description": "A message was written, edited, or deleted in a subscribed channel.",
      "properties": {
        "channel": {
          "description": "The channel it happened in.",
          "format": "space-ref",
          "type": "string"
        },
        "event": {
          "description": "What happened.",
          "knownValues": [
            "create",
            "update",
            "delete"
          ],
          "type": "string"
        },
        "imported": {
          "description": "Set when a bridge imported the message from earlier history. Clients show it without marking the channel unread.",
          "type": "boolean"
        },
        "message": {
          "description": "The message. Absent on delete, where the reference alone identifies it.",
          "ref": "social.colibri.beta.channel.defs#messageView",
          "type": "ref"
        },
        "subject": {
          "description": "Which message, for deletes.",
          "ref": "social.colibri.beta.defs#recordRef",
          "type": "ref"
        },
        "subjectUri": {
          "description": "The record URI of the message, for deletes.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "event",
        "channel"
      ],
      "type": "object"
    },
    "moderationEvent": {
      "description": "A moderation action was logged. Only sent to members who can read the log.",
      "properties": {
        "community": {
          "description": "The community.",
          "format": "did",
          "type": "string"
        },
        "entry": {
          "description": "The log entry.",
          "ref": "social.colibri.beta.community.defs#moderationView",
          "type": "ref"
        }
      },
      "required": [
        "community",
        "entry"
      ],
      "type": "object"
    },
    "notificationEvent": {
      "description": "A notification was raised for the connected user.",
      "properties": {
        "notification": {
          "description": "The notification.",
          "ref": "social.colibri.beta.notification.defs#notificationView",
          "type": "ref"
        }
      },
      "required": [
        "notification"
      ],
      "type": "object"
    },
    "preferencesEvent": {
      "description": "The connected user changed their own preferences somewhere else.",
      "properties": {
        "preferences": {
          "description": "Their preferences as they now stand.",
          "ref": "social.colibri.beta.actor.defs#preferences",
          "type": "ref"
        }
      },
      "required": [
        "preferences"
      ],
      "type": "object"
    },
    "presenceEvent": {
      "description": "Someone's presence changed.",
      "properties": {
        "did": {
          "description": "Whose presence changed.",
          "format": "did",
          "type": "string"
        },
        "presence": {
          "description": "Their new presence.",
          "ref": "social.colibri.beta.actor.defs#presence",
          "type": "ref"
        }
      },
      "required": [
        "did",
        "presence"
      ],
      "type": "object"
    },
    "reactionEvent": {
      "description": "A reaction was added or removed in a subscribed channel.",
      "properties": {
        "actor": {
          "description": "Who reacted.",
          "format": "did",
          "type": "string"
        },
        "bridged": {
          "description": "Present when someone on another service reacted through a bridge. The actor is then the community that wrote the reaction.",
          "ref": "social.colibri.beta.bridge.defs#bridgedReactor",
          "type": "ref"
        },
        "channel": {
          "description": "The channel it happened in.",
          "format": "space-ref",
          "type": "string"
        },
        "customEmoji": {
          "description": "The emoji record behind a custom shortcode.",
          "ref": "social.colibri.beta.richtext.facet#customEmoji",
          "type": "ref"
        },
        "emoji": {
          "description": "The emoji or custom shortcode.",
          "type": "string"
        },
        "event": {
          "description": "What happened.",
          "knownValues": [
            "create",
            "delete"
          ],
          "type": "string"
        },
        "reaction": {
          "description": "The reaction record itself.",
          "ref": "social.colibri.beta.defs#recordRef",
          "type": "ref"
        },
        "target": {
          "description": "The message reacted to.",
          "ref": "social.colibri.beta.defs#recordRef",
          "type": "ref"
        },
        "uri": {
          "description": "The record URI of the message reacted to.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "event",
        "channel",
        "target",
        "emoji",
        "actor"
      ],
      "type": "object"
    },
    "readCursorEvent": {
      "description": "The connected user's read cursors for one community moved, possibly from another of their sessions. Each cursor is the newest the AppView holds for that channel or thread, so applying the event never moves a cursor backwards.",
      "properties": {
        "community": {
          "description": "The community the cursors belong to.",
          "format": "did",
          "type": "string"
        },
        "cursors": {
          "description": "The cursors that changed.",
          "items": {
            "ref": "social.colibri.beta.channel.read#cursor",
            "type": "ref"
          },
          "type": "array"
        }
      },
      "required": [
        "community",
        "cursors"
      ],
      "type": "object"
    },
    "roleEvent": {
      "description": "A role was created, changed, or deleted.",
      "properties": {
        "community": {
          "description": "The community it belongs to.",
          "format": "did",
          "type": "string"
        },
        "event": {
          "description": "What happened.",
          "knownValues": [
            "create",
            "update",
            "delete"
          ],
          "type": "string"
        },
        "rkey": {
          "description": "Which role, for deletes.",
          "format": "record-key",
          "type": "string"
        },
        "role": {
          "description": "The role. Absent on delete.",
          "ref": "social.colibri.beta.community.defs#roleView",
          "type": "ref"
        }
      },
      "required": [
        "event",
        "community"
      ],
      "type": "object"
    },
    "seenEvent": {
      "description": "The connected user marked notifications seen somewhere else, so this client should clear the same badges.",
      "properties": {
        "channel": {
          "description": "The channel that was marked seen, when it was a single channel.",
          "format": "space-ref",
          "type": "string"
        },
        "clearedAt": {
          "description": "Set when the user cleared their inbox. Notifications raised at or before this time are gone from it.",
          "format": "datetime",
          "type": "string"
        },
        "message": {
          "description": "The message whose notifications were marked seen, when it was a single message.",
          "ref": "social.colibri.beta.defs#recordRef",
          "type": "ref"
        },
        "seenAt": {
          "description": "The point everything was marked seen up to.",
          "format": "datetime",
          "type": "string"
        },
        "unread": {
          "description": "The user's remaining unread count.",
          "type": "integer"
        }
      },
      "required": [
        "unread"
      ],
      "type": "object"
    },
    "setPresence": {
      "description": "Updates the user's own presence over the socket.",
      "properties": {
        "onlineState": {
          "description": "Requested online state.",
          "knownValues": [
            "online",
            "away",
            "dnd",
            "offline"
          ],
          "type": "string"
        },
        "voice": {
          "description": "The user's own voice state, when connected to a voice channel.",
          "ref": "#voiceSelfState",
          "type": "ref"
        }
      },
      "required": [],
      "type": "object"
    },
    "subscribe": {
      "description": "Adds communities, channels and threads to what this connection receives. Subscription is explicit: a connection is sent nothing it did not ask for.",
      "properties": {
        "channels": {
          "description": "Channels and threads to start receiving messages for.",
          "items": {
            "description": "A channel or a thread.",
            "format": "space-ref",
            "type": "string"
          },
          "type": "array"
        },
        "communities": {
          "description": "Communities to start receiving events for.",
          "items": {
            "description": "A community.",
            "format": "did",
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [],
      "type": "object"
    },
    "subscribed": {
      "description": "Confirms what this connection is now receiving, after a subscribe or unsubscribe. Anything the user is not entitled to read is silently absent.",
      "properties": {
        "channels": {
          "description": "Channels and threads being received.",
          "items": {
            "description": "A channel or a thread.",
            "format": "space-ref",
            "type": "string"
          },
          "type": "array"
        },
        "communities": {
          "description": "Communities being received.",
          "items": {
            "description": "A community.",
            "format": "did",
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "communities",
        "channels"
      ],
      "type": "object"
    },
    "threadEvent": {
      "description": "A thread was opened, changed, deleted, or written to. This rides the community's topic rather than a topic per thread, so a client keeps every thread's activity age and unread dot live without subscribing to each one.",
      "properties": {
        "channel": {
          "description": "The channel the thread belongs to.",
          "format": "space-ref",
          "type": "string"
        },
        "community": {
          "description": "The community it belongs to.",
          "format": "did",
          "type": "string"
        },
        "event": {
          "description": "What happened. `activity` means someone posted, which moves the thread's last activity and nothing else.",
          "knownValues": [
            "create",
            "update",
            "delete",
            "activity"
          ],
          "type": "string"
        },
        "lastActivityAt": {
          "description": "The thread's new last activity, on activity events.",
          "format": "datetime",
          "type": "string"
        },
        "space": {
          "description": "Which thread, for deletes and for activity.",
          "format": "space-ref",
          "type": "string"
        },
        "thread": {
          "description": "The thread. Absent on delete and on activity.",
          "ref": "social.colibri.beta.thread.defs#threadView",
          "type": "ref"
        }
      },
      "required": [
        "event",
        "community"
      ],
      "type": "object"
    },
    "typing": {
      "description": "Reports that the user is typing in a channel.",
      "properties": {
        "channel": {
          "description": "The channel being typed in.",
          "format": "space-ref",
          "type": "string"
        }
      },
      "required": [
        "channel"
      ],
      "type": "object"
    },
    "typingEvent": {
      "description": "Someone is typing in a subscribed channel.",
      "properties": {
        "channel": {
          "description": "Where.",
          "format": "space-ref",
          "type": "string"
        },
        "did": {
          "description": "Who is typing.",
          "format": "did",
          "type": "string"
        }
      },
      "required": [
        "did",
        "channel"
      ],
      "type": "object"
    },
    "unsubscribe": {
      "description": "Removes communities, channels and threads from what this connection receives.",
      "properties": {
        "channels": {
          "description": "Channels and threads to stop receiving messages for.",
          "items": {
            "description": "A channel or a thread.",
            "format": "space-ref",
            "type": "string"
          },
          "type": "array"
        },
        "communities": {
          "description": "Communities to stop receiving events for.",
          "items": {
            "description": "A community.",
            "format": "did",
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [],
      "type": "object"
    },
    "viewChannel": {
      "description": "Reports which channel the user is looking at, which drives read state and away detection. An absent channel means they are looking at none.",
      "properties": {
        "channel": {
          "description": "The channel now in view.",
          "format": "space-ref",
          "type": "string"
        }
      },
      "required": [],
      "type": "object"
    },
    "voiceEvent": {
      "description": "A voice channel's participants changed.",
      "properties": {
        "channel": {
          "description": "The voice channel.",
          "format": "space-ref",
          "type": "string"
        },
        "did": {
          "description": "Who.",
          "format": "did",
          "type": "string"
        },
        "event": {
          "description": "What happened.",
          "knownValues": [
            "join",
            "leave",
            "update",
            "speaking"
          ],
          "type": "string"
        },
        "speaking": {
          "description": "Whether they are currently speaking, on speaking events.",
          "type": "boolean"
        },
        "voice": {
          "description": "Their voice state. Absent on leave.",
          "ref": "social.colibri.beta.actor.defs#voiceState",
          "type": "ref"
        }
      },
      "required": [
        "event",
        "channel",
        "did"
      ],
      "type": "object"
    },
    "voiceSelfState": {
      "description": "A user's own voice state.",
      "properties": {
        "channel": {
          "description": "The voice channel.",
          "format": "space-ref",
          "type": "string"
        },
        "deafened": {
          "description": "Whether the user has deafened themselves.",
          "type": "boolean"
        },
        "muted": {
          "description": "Whether the microphone is muted.",
          "type": "boolean"
        }
      },
      "required": [
        "channel"
      ],
      "type": "object"
    },
    "writeState": {
      "description": "Whether this node can take writes right now. Sent on connect and whenever it changes.",
      "properties": {
        "mode": {
          "description": "'normal' accepts writes. 'queued' accepts writes and applies them once the network can take them again. 'readOnly' rejects writes with a ReadOnly error.",
          "knownValues": [
            "normal",
            "queued",
            "readOnly"
          ],
          "type": "string"
        }
      },
      "required": [
        "mode"
      ],
      "type": "object"
    },
    "wroteTo": {
      "description": "Reports that the user just wrote a record to a space, so the AppView can pull it without waiting for the space host to forward a notification. Honoured only for a space this connection already receives.",
      "properties": {
        "rev": {
          "description": "The revision the write produced, when the client knows it.",
          "format": "tid",
          "type": "string"
        },
        "space": {
          "description": "The space that was written to.",
          "format": "space-ref",
          "type": "string"
        }
      },
      "required": [
        "space"
      ],
      "type": "object"
    }
  },
  "id": "social.colibri.beta.sync.defs",
  "lexicon": 1
}
