add @bsky.app/sdk + @atproto/lex, vendor lexicons, codegen via lex cli

This commit is contained in:
Samuel Newman
2026-07-15 16:06:20 +03:00
parent 17c1ee4869
commit 15e232749a
306 changed files with 22544 additions and 2 deletions
+26
View File
@@ -0,0 +1,26 @@
{
"lexicon": 1,
"id": "chat.bsky.actor.declaration",
"defs": {
"main": {
"type": "record",
"description": "A declaration of a Bluesky chat account.",
"key": "literal:self",
"record": {
"type": "object",
"required": ["allowIncoming"],
"properties": {
"allowIncoming": {
"type": "string",
"knownValues": ["all", "none", "following"]
},
"allowGroupInvites": {
"description": "Declaration about group chat invitation preferences for the record owner.",
"type": "string",
"knownValues": ["all", "none", "following"]
}
}
}
}
}
}
+96
View File
@@ -0,0 +1,96 @@
{
"lexicon": 1,
"id": "chat.bsky.actor.defs",
"defs": {
"memberRole": {
"type": "string",
"knownValues": ["owner", "standard"]
},
"profileViewBasic": {
"type": "object",
"required": ["did", "handle"],
"properties": {
"did": {
"type": "string",
"format": "did"
},
"handle": {
"type": "string",
"format": "handle"
},
"displayName": {
"type": "string",
"maxGraphemes": 64,
"maxLength": 640
},
"avatar": {
"type": "string",
"format": "uri"
},
"associated": {
"type": "ref",
"ref": "app.bsky.actor.defs#profileAssociated"
},
"viewer": {
"type": "ref",
"ref": "app.bsky.actor.defs#viewerState"
},
"labels": {
"type": "array",
"items": {
"type": "ref",
"ref": "com.atproto.label.defs#label"
}
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"chatDisabled": {
"type": "boolean",
"description": "Set to true when the actor cannot actively participate in conversations"
},
"verification": {
"type": "ref",
"ref": "app.bsky.actor.defs#verificationState"
},
"kind": {
"description": "Union field that has data specific to different kinds of convos.",
"type": "union",
"refs": [
"#directConvoMember",
"#groupConvoMember",
"#pastGroupConvoMember"
]
}
}
},
"directConvoMember": {
"type": "object",
"properties": {}
},
"groupConvoMember": {
"description": "A current group convo member.",
"type": "object",
"required": ["role"],
"properties": {
"addedBy": {
"description": "Who added this member. Only present if the member was added (instead of joining via link).",
"type": "ref",
"ref": "#profileViewBasic"
},
"role": {
"description": "The member's role within this conversation. Only present in group conversation member lists.",
"type": "ref",
"ref": "#memberRole"
}
}
},
"pastGroupConvoMember": {
"description": "A past group convo member.",
"type": "object",
"required": [],
"properties": {}
}
}
}
@@ -0,0 +1,16 @@
{
"lexicon": 1,
"id": "chat.bsky.actor.deleteAccount",
"defs": {
"main": {
"type": "procedure",
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {}
}
}
}
}
}
@@ -0,0 +1,12 @@
{
"lexicon": 1,
"id": "chat.bsky.actor.exportAccountData",
"defs": {
"main": {
"type": "query",
"output": {
"encoding": "application/jsonl"
}
}
}
}
+31
View File
@@ -0,0 +1,31 @@
{
"lexicon": 1,
"id": "chat.bsky.actor.getStatus",
"defs": {
"main": {
"type": "query",
"description": "Get the authenticated viewer's chat status: whether their account is chat-disabled and whether their group-membership additions are restricted to accounts they follow.",
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["chatDisabled", "canCreateGroups", "groupMemberLimit"],
"properties": {
"chatDisabled": {
"type": "boolean",
"description": "True when the viewer's account is disabled and cannot actively participate in chat."
},
"canCreateGroups": {
"type": "boolean",
"description": "Whether the viewer's account is allowed to create group chats. New accounts are restricted from creating groups."
},
"groupMemberLimit": {
"type": "integer",
"description": "The maximum number of members allowed in a group conversation."
}
}
}
}
}
}
}
@@ -0,0 +1,69 @@
{
"lexicon": 1,
"id": "chat.bsky.authFullChatClient",
"defs": {
"main": {
"type": "permission-set",
"title": "Full Chat Client (All Conversations)",
"title:lang": {},
"detail": "Control of all chat conversations and configuration management.",
"detail:lang": {
"en": "All Chat Conversations"
},
"permissions": [
{
"type": "permission",
"resource": "rpc",
"inheritAud": true,
"lxm": [
"chat.bsky.actor.deleteAccount",
"chat.bsky.actor.getStatus",
"chat.bsky.convo.acceptConvo",
"chat.bsky.convo.addReaction",
"chat.bsky.convo.deleteMessageForSelf",
"chat.bsky.convo.exportAccountData",
"chat.bsky.convo.getConvo",
"chat.bsky.convo.getConvoAvailability",
"chat.bsky.convo.getConvoForMembers",
"chat.bsky.convo.getConvoMembers",
"chat.bsky.convo.getLog",
"chat.bsky.convo.getMessages",
"chat.bsky.convo.leaveConvo",
"chat.bsky.convo.listConvoRequests",
"chat.bsky.convo.listConvos",
"chat.bsky.convo.lockConvo",
"chat.bsky.convo.muteConvo",
"chat.bsky.convo.removeReaction",
"chat.bsky.convo.sendMessage",
"chat.bsky.convo.sendMessageBatch",
"chat.bsky.convo.unlockConvo",
"chat.bsky.convo.unmuteConvo",
"chat.bsky.convo.updateAllRead",
"chat.bsky.convo.updateRead",
"chat.bsky.group.addMembers",
"chat.bsky.group.approveJoinRequest",
"chat.bsky.group.createGroup",
"chat.bsky.group.createJoinLink",
"chat.bsky.group.disableJoinLink",
"chat.bsky.group.editGroup",
"chat.bsky.group.editJoinLink",
"chat.bsky.group.enableJoinLink",
"chat.bsky.group.getJoinLinkPreviews",
"chat.bsky.group.listJoinRequests",
"chat.bsky.group.listMutualGroups",
"chat.bsky.group.rejectJoinRequest",
"chat.bsky.group.removeMembers",
"chat.bsky.group.requestJoin",
"chat.bsky.group.withdrawJoinRequest"
]
},
{
"type": "permission",
"resource": "repo",
"action": ["create", "update", "delete"],
"collection": ["chat.bsky.actor.declaration"]
}
]
}
}
}
+39
View File
@@ -0,0 +1,39 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.acceptConvo",
"defs": {
"main": {
"type": "procedure",
"description": "Marks a conversation as accepted, so it is shown in the list of accepted convos instead on the request convos.",
"errors": [
{
"name": "InvalidConvo"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {
"rev": {
"description": "Rev when the convo was accepted. If not present, the convo was already accepted.",
"type": "string"
}
}
}
}
}
}
}
+66
View File
@@ -0,0 +1,66 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.addReaction",
"defs": {
"main": {
"type": "procedure",
"description": "Adds an emoji reaction to a message. Requires authentication. It is idempotent, so multiple calls from the same user with the same emoji result in a single reaction.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId", "messageId", "value"],
"properties": {
"convoId": {
"type": "string"
},
"messageId": {
"type": "string"
},
"value": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"minGraphemes": 1,
"maxGraphemes": 1
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["message"],
"properties": {
"message": {
"type": "ref",
"ref": "chat.bsky.convo.defs#messageView"
}
}
}
},
"errors": [
{
"name": "InvalidConvo"
},
{
"name": "ReactionNotAllowed",
"description": "Indicates that reactions are not allowed on this message, e.g. because it is a system message."
},
{
"name": "ReactionMessageDeleted",
"description": "Indicates that the message has been deleted and reactions can no longer be added/removed."
},
{
"name": "ReactionLimitReached",
"description": "Indicates that the message has the maximum number of reactions allowed for a single user, and the requested reaction wasn't yet present. If it was already present, the request will not fail since it is idempotent."
},
{
"name": "ReactionInvalidValue",
"description": "Indicates the value for the reaction is not acceptable. In general, this means it is not an emoji."
}
]
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,41 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.deleteMessageForSelf",
"defs": {
"main": {
"type": "procedure",
"description": "Marks a message as deleted for the viewer, so they won't see that message in future enumerations.",
"errors": [
{
"name": "InvalidConvo"
},
{
"name": "MessageDeleteNotAllowed",
"description": "Indicates that this message cannot be deleted, e.g. because it is a system message."
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId", "messageId"],
"properties": {
"convoId": {
"type": "string"
},
"messageId": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "ref",
"ref": "chat.bsky.convo.defs#deletedMessageView"
}
}
}
}
}
@@ -0,0 +1,13 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.exportAccountData",
"description": "Stub: chat.bsky.convo.exportAccountData is referenced in chat.bsky.authFullChatClient but the lexicon may have been renamed in the local repo.",
"defs": {
"main": {
"type": "query",
"output": {
"encoding": "application/jsonl"
}
}
}
}
+37
View File
@@ -0,0 +1,37 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.getConvo",
"defs": {
"main": {
"type": "query",
"description": "Gets an existing conversation by its ID.",
"errors": [
{
"name": "InvalidConvo"
}
],
"parameters": {
"type": "params",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convo"],
"properties": {
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
@@ -0,0 +1,41 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.getConvoAvailability",
"defs": {
"main": {
"type": "query",
"description": "Check whether the requester and the other members can start a 1-1 chat. Only applicable to direct (non-group) conversations. If an existing convo is found for these members, it is returned. Does not create a new convo if it doesn't exist.",
"parameters": {
"type": "params",
"required": ["members"],
"properties": {
"members": {
"type": "array",
"minLength": 1,
"maxLength": 10,
"items": {
"type": "string",
"format": "did"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["canChat"],
"properties": {
"canChat": {
"type": "boolean"
},
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
@@ -0,0 +1,58 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.getConvoForMembers",
"defs": {
"main": {
"type": "query",
"description": "Get or create a 1-1 conversation for the given members. Always returns the same direct (non-group) conversation. To create a group conversation, use createGroup.",
"errors": [
{
"name": "AccountSuspended"
},
{
"name": "BlockedActor"
},
{
"name": "BlockedSubject"
},
{
"name": "MessagesDisabled"
},
{
"name": "NotFollowedBySender"
},
{
"name": "RecipientNotFound"
}
],
"parameters": {
"type": "params",
"required": ["members"],
"properties": {
"members": {
"type": "array",
"minLength": 1,
"maxLength": 10,
"items": {
"type": "string",
"format": "did"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convo"],
"properties": {
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
@@ -0,0 +1,52 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.getConvoMembers",
"defs": {
"main": {
"type": "query",
"description": "Returns a paginated list of members from a conversation.",
"errors": [
{
"name": "InvalidConvo"
}
],
"parameters": {
"type": "params",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
},
"cursor": {
"type": "string"
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["members"],
"properties": {
"cursor": {
"type": "string"
},
"members": {
"type": "array",
"items": {
"type": "ref",
"ref": "chat.bsky.actor.defs#profileViewBasic"
}
}
}
}
}
}
}
}
+68
View File
@@ -0,0 +1,68 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.getLog",
"defs": {
"main": {
"type": "query",
"parameters": {
"type": "params",
"required": [],
"properties": {
"cursor": {
"type": "string"
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["logs"],
"properties": {
"cursor": {
"type": "string"
},
"logs": {
"type": "array",
"items": {
"type": "union",
"refs": [
"chat.bsky.convo.defs#logBeginConvo",
"chat.bsky.convo.defs#logAcceptConvo",
"chat.bsky.convo.defs#logLeaveConvo",
"chat.bsky.convo.defs#logMuteConvo",
"chat.bsky.convo.defs#logUnmuteConvo",
"chat.bsky.convo.defs#logCreateMessage",
"chat.bsky.convo.defs#logDeleteMessage",
"chat.bsky.convo.defs#logReadMessage",
"chat.bsky.convo.defs#logAddReaction",
"chat.bsky.convo.defs#logRemoveReaction",
"chat.bsky.convo.defs#logReadConvo",
"chat.bsky.convo.defs#logAddMember",
"chat.bsky.convo.defs#logRemoveMember",
"chat.bsky.convo.defs#logMemberJoin",
"chat.bsky.convo.defs#logMemberLeave",
"chat.bsky.convo.defs#logLockConvo",
"chat.bsky.convo.defs#logUnlockConvo",
"chat.bsky.convo.defs#logLockConvoPermanently",
"chat.bsky.convo.defs#logEditGroup",
"chat.bsky.convo.defs#logCreateJoinLink",
"chat.bsky.convo.defs#logEditJoinLink",
"chat.bsky.convo.defs#logEnableJoinLink",
"chat.bsky.convo.defs#logDisableJoinLink",
"chat.bsky.convo.defs#logIncomingJoinRequest",
"chat.bsky.convo.defs#logApproveJoinRequest",
"chat.bsky.convo.defs#logRejectJoinRequest",
"chat.bsky.convo.defs#logOutgoingJoinRequest",
"chat.bsky.convo.defs#logWithdrawIncomingJoinRequest",
"chat.bsky.convo.defs#logWithdrawOutgoingJoinRequest",
"chat.bsky.convo.defs#logReadJoinRequests"
]
}
}
}
}
}
}
}
}
+64
View File
@@ -0,0 +1,64 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.getMessages",
"defs": {
"main": {
"type": "query",
"description": "Returns a page of messages from a conversation.",
"errors": [
{
"name": "InvalidConvo"
}
],
"parameters": {
"type": "params",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
},
"cursor": {
"type": "string"
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["messages"],
"properties": {
"cursor": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"type": "union",
"refs": [
"chat.bsky.convo.defs#messageView",
"chat.bsky.convo.defs#deletedMessageView",
"chat.bsky.convo.defs#systemMessageView"
]
}
},
"relatedProfiles": {
"description": "Set of all members who authored or reacted to the returned messages. Members referred to by system messages are also included.",
"type": "array",
"items": {
"type": "ref",
"ref": "chat.bsky.actor.defs#profileViewBasic"
}
}
}
}
}
}
}
}
@@ -0,0 +1,37 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.getUnreadCounts",
"defs": {
"main": {
"type": "query",
"description": "Returns unread conversation counts for conversations that are unlocked, not muted, split by convo status. Direct convos are excluded when a block relationship exists between the actor and the other member, or when the other member's account is deleted or deactivated. Group convos are considered unread if they have unread join request counts.",
"parameters": {
"type": "params",
"properties": {
"includeGroupChats": {
"type": "boolean",
"default": true,
"description": "When false, group convos are excluded from the counts."
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["unreadAcceptedConvos", "unreadRequestConvos"],
"properties": {
"unreadAcceptedConvos": {
"type": "integer",
"description": "Number of unread, unlocked accepted convos. Counts convos with unread messages and unread join requests. Capped at 100, where 100 means more than 99."
},
"unreadRequestConvos": {
"type": "integer",
"description": "Number of unread, unlocked request convos. Includes convos with unread messages, but not with unread join request, since only the owner of a group has join requests to read, and the group would necessarily be accepted. Capped at 100, where 100 means more than 99."
}
}
}
}
}
}
}
+46
View File
@@ -0,0 +1,46 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.leaveConvo",
"defs": {
"main": {
"type": "procedure",
"description": "Leaves a conversation (direct or group). For group, this effectively removes membership. For direct, membership is never removed, only changed to remove from enumerations by the user who left.",
"errors": [
{
"name": "InvalidConvo"
},
{
"name": "OwnerCannotLeave",
"description": "The owner of a group conversation cannot leave before locking the group."
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId", "rev"],
"properties": {
"convoId": {
"type": "string"
},
"rev": {
"type": "string"
}
}
}
}
}
}
}
@@ -0,0 +1,46 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.listConvoRequests",
"defs": {
"main": {
"type": "query",
"description": "Returns a page of incoming conversation requests for the user. Direct convo requests are returned as convoView; group join requests made by the user are returned as joinRequestConvoView.",
"parameters": {
"type": "params",
"properties": {
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
},
"cursor": {
"type": "string"
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["requests"],
"properties": {
"cursor": {
"type": "string"
},
"requests": {
"type": "array",
"items": {
"type": "union",
"refs": [
"chat.bsky.convo.defs#convoView",
"chat.bsky.group.defs#joinRequestConvoView"
]
}
}
}
}
}
}
}
}
+62
View File
@@ -0,0 +1,62 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.listConvos",
"defs": {
"main": {
"type": "query",
"description": "Returns a page of conversations (direct or group) for the user.",
"parameters": {
"type": "params",
"properties": {
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
},
"cursor": {
"type": "string"
},
"readState": {
"type": "string",
"knownValues": ["unread"]
},
"status": {
"description": "Filter convos by their status. It is discouraged to call with \"request\" and preferred to call chat.bsky.convo.listConvoRequests, which also includes group join requests made by the user.",
"type": "string",
"knownValues": ["request", "accepted"]
},
"kind": {
"type": "string",
"description": "Filter by conversation kind.",
"knownValues": ["direct", "group"]
},
"lockStatus": {
"type": "string",
"description": "Filter by conversation lock status. Values follow chat.bsky.convo.defs#convoLockStatus.",
"knownValues": ["unlocked", "locked", "locked-permanently"]
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convos"],
"properties": {
"cursor": {
"type": "string"
},
"convos": {
"type": "array",
"items": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
}
+46
View File
@@ -0,0 +1,46 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.lockConvo",
"defs": {
"main": {
"type": "procedure",
"description": "Locks a group convo so no more content (messages, reactions) can be added to it.",
"errors": [
{
"name": "ConvoLocked"
},
{
"name": "InvalidConvo"
},
{
"name": "InsufficientRole"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convo"],
"properties": {
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
+40
View File
@@ -0,0 +1,40 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.muteConvo",
"defs": {
"main": {
"type": "procedure",
"description": "Mutes a conversation, preventing notifications related to it.",
"errors": [
{
"name": "InvalidConvo"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convo"],
"properties": {
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
@@ -0,0 +1,62 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.removeReaction",
"defs": {
"main": {
"type": "procedure",
"description": "Removes an emoji reaction from a message. Requires authentication. It is idempotent, so multiple calls from the same user with the same emoji result in that reaction not being present, even if it already wasn't.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId", "messageId", "value"],
"properties": {
"convoId": {
"type": "string"
},
"messageId": {
"type": "string"
},
"value": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"minGraphemes": 1,
"maxGraphemes": 1
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["message"],
"properties": {
"message": {
"type": "ref",
"ref": "chat.bsky.convo.defs#messageView"
}
}
}
},
"errors": [
{
"name": "InvalidConvo"
},
{
"name": "ReactionNotAllowed",
"description": "Indicates that reactions are not allowed on this message, e.g. because it is a system message."
},
{
"name": "ReactionMessageDeleted",
"description": "Indicates that the message has been deleted and reactions can no longer be added/removed."
},
{
"name": "ReactionInvalidValue",
"description": "Indicates the value for the reaction is not acceptable. In general, this means it is not an emoji."
}
]
}
}
}
+44
View File
@@ -0,0 +1,44 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.sendMessage",
"defs": {
"main": {
"type": "procedure",
"description": "Sends a message to a conversation.",
"errors": [
{
"name": "ConvoLocked"
},
{
"name": "InvalidConvo"
},
{
"name": "ReplyTargetNotFound"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId", "message"],
"properties": {
"convoId": {
"type": "string"
},
"message": {
"type": "ref",
"ref": "chat.bsky.convo.defs#messageInput"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "ref",
"ref": "chat.bsky.convo.defs#messageView"
}
}
}
}
}
@@ -0,0 +1,67 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.sendMessageBatch",
"defs": {
"main": {
"type": "procedure",
"description": "Sends a batch of messages to a conversation.",
"errors": [
{
"name": "ConvoLocked"
},
{
"name": "InvalidConvo"
},
{
"name": "ReplyTargetNotFound"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["items"],
"properties": {
"items": {
"type": "array",
"maxLength": 100,
"items": {
"type": "ref",
"ref": "#batchItem"
}
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["items"],
"properties": {
"items": {
"type": "array",
"items": {
"type": "ref",
"ref": "chat.bsky.convo.defs#messageView"
}
}
}
}
}
},
"batchItem": {
"type": "object",
"required": ["convoId", "message"],
"properties": {
"convoId": {
"type": "string"
},
"message": {
"type": "ref",
"ref": "chat.bsky.convo.defs#messageInput"
}
}
}
}
}
+46
View File
@@ -0,0 +1,46 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.unlockConvo",
"defs": {
"main": {
"type": "procedure",
"description": "Unlocks a group convo so it is able to receive new content.",
"errors": [
{
"name": "InvalidConvo"
},
{
"name": "InsufficientRole"
},
{
"name": "ConvoLockedByModeration"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convo"],
"properties": {
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
+40
View File
@@ -0,0 +1,40 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.unmuteConvo",
"defs": {
"main": {
"type": "procedure",
"description": "Unmutes a conversation, allowing notifications related to it.",
"errors": [
{
"name": "InvalidConvo"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convo"],
"properties": {
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
@@ -0,0 +1,35 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.updateAllRead",
"defs": {
"main": {
"type": "procedure",
"description": "Sets conversations from a user as read to the latest message, with filters.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"knownValues": ["request", "accepted"]
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["updatedCount"],
"properties": {
"updatedCount": {
"description": "The count of updated convos.",
"type": "integer"
}
}
}
}
}
}
}
+43
View File
@@ -0,0 +1,43 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.updateRead",
"defs": {
"main": {
"type": "procedure",
"description": "Updates the read state of a conversation from, optionally specifying the last read message.",
"errors": [
{
"name": "InvalidConvo"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
},
"messageId": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convo"],
"properties": {
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
+31
View File
@@ -0,0 +1,31 @@
{
"lexicon": 1,
"id": "chat.bsky.embed.joinLink",
"description": "A join link embedded in a chat message.",
"defs": {
"main": {
"type": "object",
"required": ["code"],
"properties": {
"code": {
"type": "string",
"description": "The join link code."
}
}
},
"view": {
"type": "object",
"required": ["joinLinkPreview"],
"properties": {
"joinLinkPreview": {
"type": "union",
"refs": [
"chat.bsky.group.defs#joinLinkPreviewView",
"chat.bsky.group.defs#disabledJoinLinkPreviewView",
"chat.bsky.group.defs#invalidJoinLinkPreviewView"
]
}
}
}
}
}
+82
View File
@@ -0,0 +1,82 @@
{
"lexicon": 1,
"id": "chat.bsky.group.addMembers",
"defs": {
"main": {
"type": "procedure",
"description": "Adds members to a group. The members are added in 'request' status, so they have to accept it. This creates convo memberships.",
"errors": [
{
"name": "AccountSuspended"
},
{
"name": "BlockedActor"
},
{
"name": "BlockedSubject"
},
{
"name": "ConvoLocked"
},
{
"name": "InsufficientRole"
},
{
"name": "InvalidConvo"
},
{
"name": "MemberLimitReached"
},
{
"name": "NotFollowedBySender"
},
{
"name": "RecipientNotFound"
},
{
"name": "UserForbidsGroups"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId", "members"],
"properties": {
"convoId": {
"type": "string"
},
"members": {
"type": "array",
"items": {
"type": "string",
"format": "did"
},
"minLength": 1
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convo"],
"properties": {
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
},
"addedMembers": {
"type": "array",
"items": {
"type": "ref",
"ref": "chat.bsky.actor.defs#profileViewBasic"
}
}
}
}
}
}
}
}
@@ -0,0 +1,50 @@
{
"lexicon": 1,
"id": "chat.bsky.group.approveJoinRequest",
"defs": {
"main": {
"type": "procedure",
"description": "Approves a request to join a group (via join link) the user owns. Action taken by the group owner.",
"errors": [
{
"name": "InvalidConvo"
},
{
"name": "InsufficientRole"
},
{
"name": "MemberLimitReached"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId", "member"],
"properties": {
"convoId": {
"type": "string"
},
"member": {
"type": "string",
"format": "did"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convo"],
"properties": {
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
+69
View File
@@ -0,0 +1,69 @@
{
"lexicon": 1,
"id": "chat.bsky.group.createGroup",
"defs": {
"main": {
"type": "procedure",
"description": "Creates a group convo, specifying the members to be added to it. Unlike getConvoForMembers, this isn't idempotent. It will create new groups even if the membership is identical to pre-existing groups. Will create 'request' membership for all members, except the owner who is 'accepted'.",
"errors": [
{
"name": "AccountSuspended"
},
{
"name": "BlockedActor"
},
{
"name": "BlockedSubject"
},
{
"name": "NewAccountCannotCreateGroup"
},
{
"name": "NotFollowedBySender"
},
{
"name": "RecipientNotFound"
},
{
"name": "UserForbidsGroups"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["members", "name"],
"properties": {
"members": {
"type": "array",
"maxLength": 49,
"items": {
"type": "string",
"format": "did"
}
},
"name": {
"type": "string",
"minLength": 1,
"maxGraphemes": 50,
"maxLength": 500
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convo"],
"properties": {
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
@@ -0,0 +1,54 @@
{
"lexicon": 1,
"id": "chat.bsky.group.createJoinLink",
"defs": {
"main": {
"type": "procedure",
"description": "Creates a join link for the group convo.",
"errors": [
{
"name": "EnabledJoinLinkAlreadyExists"
},
{
"name": "InvalidConvo"
},
{
"name": "InsufficientRole"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId", "joinRule"],
"properties": {
"convoId": {
"type": "string"
},
"requireApproval": {
"type": "boolean",
"default": false
},
"joinRule": {
"type": "ref",
"ref": "chat.bsky.group.defs#joinRule"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["joinLink"],
"properties": {
"joinLink": {
"type": "ref",
"ref": "chat.bsky.group.defs#joinLinkView"
}
}
}
}
}
}
}
+177
View File
@@ -0,0 +1,177 @@
{
"lexicon": 1,
"id": "chat.bsky.group.defs",
"defs": {
"linkEnabledStatus": {
"type": "string",
"knownValues": ["enabled", "disabled"]
},
"joinRule": {
"type": "string",
"knownValues": ["anyone", "followedByOwner"]
},
"joinLinkView": {
"description": "Join link view to be used within a group view, so the convo is surrounding, not specified inside this view.",
"type": "object",
"required": [
"code",
"enabledStatus",
"requireApproval",
"joinRule",
"createdAt"
],
"properties": {
"code": {
"type": "string"
},
"enabledStatus": {
"type": "ref",
"ref": "#linkEnabledStatus"
},
"requireApproval": {
"type": "boolean"
},
"joinRule": {
"type": "ref",
"ref": "#joinRule"
},
"createdAt": {
"type": "string",
"format": "datetime"
}
}
},
"joinLinkPreviewView": {
"description": "Preview that can be shown in feeds, including to unauthenticated viewers.",
"type": "object",
"required": [
"convoId",
"code",
"name",
"owner",
"memberCount",
"memberLimit",
"requireApproval",
"joinRule"
],
"properties": {
"convoId": {
"type": "string"
},
"code": {
"type": "string"
},
"name": {
"type": "string"
},
"owner": {
"type": "ref",
"ref": "chat.bsky.actor.defs#profileViewBasic"
},
"memberCount": {
"type": "integer"
},
"memberLimit": {
"type": "integer"
},
"requireApproval": {
"type": "boolean"
},
"joinRule": {
"type": "ref",
"ref": "#joinRule"
},
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView",
"description": "Present only if the request is authenticated and the user is a member of the group."
},
"viewer": {
"type": "ref",
"ref": "#joinLinkViewerState"
}
}
},
"disabledJoinLinkPreviewView": {
"description": "Preview for a disabled join link. Carries only the code so clients can correlate with the input and render a disabled state.",
"type": "object",
"required": ["code"],
"properties": {
"code": {
"type": "string"
}
}
},
"invalidJoinLinkPreviewView": {
"description": "Preview for a join link code that does not map to an existing link. Carries only the code so clients can correlate with the input and render an invalid state.",
"type": "object",
"required": ["code"],
"properties": {
"code": {
"type": "string"
}
}
},
"joinLinkViewerState": {
"type": "object",
"properties": {
"requestedAt": {
"type": "string",
"format": "datetime"
}
}
},
"joinRequestView": {
"description": "A join request from the perspective of the group owner.",
"type": "object",
"required": ["convoId", "requestedBy", "requestedAt"],
"properties": {
"convoId": {
"type": "string"
},
"requestedBy": {
"type": "ref",
"ref": "chat.bsky.actor.defs#profileViewBasic"
},
"requestedAt": {
"type": "string",
"format": "datetime"
}
}
},
"joinRequestConvoView": {
"description": "A join request from the perspective of the requester, including enough group context to render the request in a list (e.g. group name, owner, member count).",
"type": "object",
"required": [
"convoId",
"name",
"owner",
"memberCount",
"memberLimit",
"viewer"
],
"properties": {
"convoId": {
"type": "string"
},
"name": {
"type": "string"
},
"owner": {
"type": "ref",
"ref": "chat.bsky.actor.defs#profileViewBasic"
},
"memberCount": {
"type": "integer"
},
"memberLimit": {
"type": "integer"
},
"viewer": {
"type": "ref",
"ref": "#joinLinkViewerState"
}
}
}
}
}
@@ -0,0 +1,46 @@
{
"lexicon": 1,
"id": "chat.bsky.group.disableJoinLink",
"defs": {
"main": {
"type": "procedure",
"description": "Disables the active join link for the group convo.",
"errors": [
{
"name": "InvalidConvo"
},
{
"name": "InsufficientRole"
},
{
"name": "NoJoinLink"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["joinLink"],
"properties": {
"joinLink": {
"type": "ref",
"ref": "chat.bsky.group.defs#joinLinkView"
}
}
}
}
}
}
}
+52
View File
@@ -0,0 +1,52 @@
{
"lexicon": 1,
"id": "chat.bsky.group.editGroup",
"defs": {
"main": {
"type": "procedure",
"description": "Edits group settings.",
"errors": [
{
"name": "ConvoLocked"
},
{
"name": "InvalidConvo"
},
{
"name": "InsufficientRole"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId", "name"],
"properties": {
"convoId": {
"type": "string"
},
"name": {
"type": "string",
"minLength": 1,
"maxGraphemes": 50,
"maxLength": 500
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convo"],
"properties": {
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
@@ -0,0 +1,53 @@
{
"lexicon": 1,
"id": "chat.bsky.group.editJoinLink",
"defs": {
"main": {
"type": "procedure",
"description": "Edits the existing join link settings for the group convo.",
"errors": [
{
"name": "InvalidConvo"
},
{
"name": "InsufficientRole"
},
{
"name": "NoJoinLink"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
},
"requireApproval": {
"type": "boolean"
},
"joinRule": {
"type": "ref",
"ref": "chat.bsky.group.defs#joinRule"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["joinLink"],
"properties": {
"joinLink": {
"type": "ref",
"ref": "chat.bsky.group.defs#joinLinkView"
}
}
}
}
}
}
}
@@ -0,0 +1,49 @@
{
"lexicon": 1,
"id": "chat.bsky.group.enableJoinLink",
"defs": {
"main": {
"type": "procedure",
"description": "Re-enables a previously disabled join link for the group convo.",
"errors": [
{
"name": "InvalidConvo"
},
{
"name": "InsufficientRole"
},
{
"name": "NoJoinLink"
},
{
"name": "LinkAlreadyEnabled"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["joinLink"],
"properties": {
"joinLink": {
"type": "ref",
"ref": "chat.bsky.group.defs#joinLinkView"
}
}
}
}
}
}
}
@@ -0,0 +1,44 @@
{
"lexicon": 1,
"id": "chat.bsky.group.getJoinLinkPreviews",
"defs": {
"main": {
"type": "query",
"description": "Get public information about groups from join links. The output array matches the input codes one-to-one by position (and each view also carries its 'code'). Disabled codes return a disabledJoinLinkPreviewView, and codes that do not map to a previewable link return an invalidJoinLinkPreviewView.",
"parameters": {
"type": "params",
"required": ["codes"],
"properties": {
"codes": {
"type": "array",
"minLength": 1,
"maxLength": 50,
"items": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["joinLinkPreviews"],
"properties": {
"joinLinkPreviews": {
"type": "array",
"items": {
"type": "union",
"refs": [
"chat.bsky.group.defs#joinLinkPreviewView",
"chat.bsky.group.defs#disabledJoinLinkPreviewView",
"chat.bsky.group.defs#invalidJoinLinkPreviewView"
]
}
}
}
}
}
}
}
}
@@ -0,0 +1,55 @@
{
"lexicon": 1,
"id": "chat.bsky.group.listJoinRequests",
"defs": {
"main": {
"type": "query",
"description": "Lists a page of request to join a group (via join link) the user owns. Shows the data from the owner's point of view.",
"errors": [
{
"name": "InvalidConvo"
},
{
"name": "InsufficientRole"
}
],
"parameters": {
"type": "params",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
},
"cursor": {
"type": "string"
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["requests"],
"properties": {
"cursor": {
"type": "string"
},
"requests": {
"type": "array",
"items": {
"type": "ref",
"ref": "chat.bsky.group.defs#joinRequestView"
}
}
}
}
}
}
}
}
@@ -0,0 +1,48 @@
{
"lexicon": 1,
"id": "chat.bsky.group.listMutualGroups",
"defs": {
"main": {
"type": "query",
"description": "Returns a page of group conversations that both the requester and the specified actor are members of.",
"parameters": {
"type": "params",
"required": ["subject"],
"properties": {
"subject": {
"type": "string",
"format": "did"
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
},
"cursor": {
"type": "string"
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convos"],
"properties": {
"cursor": {
"type": "string"
},
"convos": {
"type": "array",
"items": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
}
@@ -0,0 +1,42 @@
{
"lexicon": 1,
"id": "chat.bsky.group.rejectJoinRequest",
"defs": {
"main": {
"type": "procedure",
"description": "Rejects a request to join a group (via join link) the user owns. Action taken by the group owner.",
"errors": [
{
"name": "InvalidConvo"
},
{
"name": "InsufficientRole"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId", "member"],
"properties": {
"convoId": {
"type": "string"
},
"member": {
"type": "string",
"format": "did"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": [],
"properties": {}
}
}
}
}
}
@@ -0,0 +1,51 @@
{
"lexicon": 1,
"id": "chat.bsky.group.removeMembers",
"defs": {
"main": {
"type": "procedure",
"description": "Removes members from a group. This deletes convo memberships, doesn't just set a status.",
"errors": [
{
"name": "InvalidConvo"
},
{
"name": "InsufficientRole"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId", "members"],
"properties": {
"convoId": {
"type": "string"
},
"members": {
"type": "array",
"items": {
"type": "string",
"format": "did"
},
"minLength": 1
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convo"],
"properties": {
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
+60
View File
@@ -0,0 +1,60 @@
{
"lexicon": 1,
"id": "chat.bsky.group.requestJoin",
"defs": {
"main": {
"type": "procedure",
"description": "Sends a request to join a group (via join link) to the group owner. Action taken by the prospective group member.",
"errors": [
{
"name": "ConvoLocked"
},
{
"name": "FollowRequired"
},
{
"name": "InvalidCode"
},
{
"name": "LinkDisabled"
},
{
"name": "MemberLimitReached"
},
{
"name": "UserKicked"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["code"],
"properties": {
"code": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["status"],
"properties": {
"status": {
"type": "string",
"knownValues": ["joined", "pending"]
},
"convo": {
"description": "The group convo joined. This is only present in the case of status=joined",
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}
@@ -0,0 +1,38 @@
{
"lexicon": 1,
"id": "chat.bsky.group.updateJoinRequestsRead",
"defs": {
"main": {
"type": "procedure",
"description": "Marks all join requests as read for the group owner.",
"errors": [
{
"name": "InvalidConvo"
},
{
"name": "InsufficientRole"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": [],
"properties": {}
}
}
}
}
}
@@ -0,0 +1,35 @@
{
"lexicon": 1,
"id": "chat.bsky.group.withdrawJoinRequest",
"defs": {
"main": {
"type": "procedure",
"description": "Withdraws a pending request to join a group. Action taken by the prospective member who originally requested to join.",
"errors": [
{
"name": "InvalidJoinRequest"
}
],
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": [],
"properties": {}
}
}
}
}
}
+74
View File
@@ -0,0 +1,74 @@
{
"lexicon": 1,
"id": "chat.bsky.moderation.defs",
"defs": {
"convoView": {
"description": "A view of a conversation for moderation purposes. Unlike chat.bsky.convo.defs#convoView, it does not include viewer-specific data (such as muted, unreadCount, status, lastMessage, lastReaction), since the requester is a moderator and not a member of the conversation. The member list is not included; use chat.bsky.moderation.getConvoMembers to list members.",
"type": "object",
"required": ["id", "rev"],
"properties": {
"id": {
"type": "string"
},
"rev": {
"type": "string"
},
"kind": {
"description": "Union field that has data specific to different kinds of convos.",
"type": "union",
"refs": ["#directConvo", "#groupConvo"]
}
}
},
"directConvo": {
"description": "Data specific to a direct conversation, for moderation purposes.",
"type": "object",
"properties": {}
},
"groupConvo": {
"description": "Data specific to a group conversation, for moderation purposes. Unlike chat.bsky.convo.defs#groupConvo, it does not include viewer-specific data (such as unreadJoinRequestCount), since the requester is a moderator and not a member of the conversation.",
"type": "object",
"required": [
"createdAt",
"joinRequestCount",
"lockStatus",
"memberCount",
"memberLimit",
"name"
],
"properties": {
"createdAt": {
"type": "string",
"format": "datetime"
},
"joinLink": {
"type": "ref",
"ref": "chat.bsky.group.defs#joinLinkView"
},
"joinRequestCount": {
"type": "integer",
"description": "The total number of pending join requests for the group conversation. This information is only visible to the owner and to moderators. Capped at 21."
},
"lockStatus": {
"description": "The lock status of the conversation.",
"type": "ref",
"ref": "chat.bsky.convo.defs#convoLockStatus"
},
"memberCount": {
"type": "integer",
"description": "The total number of members in the group conversation."
},
"memberLimit": {
"type": "integer",
"description": "The maximum number of members allowed in the group conversation."
},
"name": {
"type": "string",
"description": "The display name of the group conversation.",
"maxGraphemes": 50,
"maxLength": 500
}
}
}
}
}
@@ -0,0 +1,63 @@
{
"lexicon": 1,
"id": "chat.bsky.moderation.getActorMetadata",
"defs": {
"main": {
"type": "query",
"parameters": {
"type": "params",
"required": ["actor"],
"properties": {
"actor": {
"type": "string",
"format": "did"
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["day", "month", "all"],
"properties": {
"day": {
"type": "ref",
"ref": "#metadata"
},
"month": {
"type": "ref",
"ref": "#metadata"
},
"all": {
"type": "ref",
"ref": "#metadata"
}
}
}
}
},
"metadata": {
"type": "object",
"required": [
"messagesSent",
"messagesReceived",
"convos",
"convosStarted"
],
"properties": {
"messagesSent": {
"type": "integer"
},
"messagesReceived": {
"type": "integer"
},
"convos": {
"type": "integer"
},
"convosStarted": {
"type": "integer"
}
}
}
}
}
@@ -0,0 +1,37 @@
{
"lexicon": 1,
"id": "chat.bsky.moderation.getConvo",
"defs": {
"main": {
"type": "query",
"description": "Gets an existing conversation by its ID, for moderation purposes. Does not require the requester to be a member of the conversation.",
"errors": [
{
"name": "InvalidConvo"
}
],
"parameters": {
"type": "params",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convo"],
"properties": {
"convo": {
"type": "ref",
"ref": "chat.bsky.moderation.defs#convoView"
}
}
}
}
}
}
}
@@ -0,0 +1,52 @@
{
"lexicon": 1,
"id": "chat.bsky.moderation.getConvoMembers",
"defs": {
"main": {
"type": "query",
"description": "Returns a paginated list of members from a conversation, for moderation purposes. Does not require the requester to be a member of the conversation.",
"errors": [
{
"name": "InvalidConvo"
}
],
"parameters": {
"type": "params",
"required": ["convoId"],
"properties": {
"convoId": {
"type": "string"
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
},
"cursor": {
"type": "string"
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["members"],
"properties": {
"cursor": {
"type": "string"
},
"members": {
"type": "array",
"items": {
"type": "ref",
"ref": "chat.bsky.actor.defs#profileViewBasic"
}
}
}
}
}
}
}
}
@@ -0,0 +1,40 @@
{
"lexicon": 1,
"id": "chat.bsky.moderation.getConvos",
"defs": {
"main": {
"type": "query",
"description": "Gets existing conversations by their IDs, for moderation purposes. Does not require the requester to be a member of the conversations. Unknown IDs are silently omitted from the response.",
"parameters": {
"type": "params",
"required": ["convoIds"],
"properties": {
"convoIds": {
"type": "array",
"minLength": 1,
"maxLength": 100,
"items": {
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convos"],
"properties": {
"convos": {
"type": "array",
"items": {
"type": "ref",
"ref": "chat.bsky.moderation.defs#convoView"
}
}
}
}
}
}
}
}
@@ -0,0 +1,58 @@
{
"lexicon": 1,
"id": "chat.bsky.moderation.getMessageContext",
"defs": {
"main": {
"type": "query",
"parameters": {
"type": "params",
"required": ["messageId"],
"properties": {
"convoId": {
"type": "string",
"description": "Conversation that the message is from. NOTE: this field will eventually be required."
},
"messageId": {
"type": "string"
},
"before": {
"type": "integer",
"default": 5,
"description": "Number of user messages before the target to include. System messages between the earliest returned user message and the target are also included, capped per gap by `maxInterleavedSystemMessages`. If there are no user messages before the target, up to `maxInterleavedSystemMessages` system messages immediately preceding the target are returned instead."
},
"after": {
"type": "integer",
"default": 5,
"description": "Number of user messages after the target to include. System messages between the target and the latest returned user message are also included, capped per gap by `maxInterleavedSystemMessages`. If there are no user messages after the target, up to `maxInterleavedSystemMessages` system messages immediately following the target are returned instead."
},
"maxInterleavedSystemMessages": {
"type": "integer",
"default": 10,
"minimum": 0,
"maximum": 1000,
"description": "Maximum number of system messages to include per gap between consecutive returned messages (and per side when there are no user messages on that side). Within a gap, the system messages closest to the earlier message are kept."
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["messages"],
"properties": {
"messages": {
"type": "array",
"items": {
"type": "union",
"refs": [
"chat.bsky.convo.defs#messageView",
"chat.bsky.convo.defs#systemMessageView"
]
}
}
}
}
}
}
}
}
@@ -0,0 +1,657 @@
{
"lexicon": 1,
"id": "chat.bsky.moderation.subscribeModEvents",
"defs": {
"main": {
"type": "subscription",
"description": "Subscribe to stream of chat events targeted to moderation. Private endpoint.",
"parameters": {
"type": "params",
"properties": {
"cursor": {
"type": "string",
"description": "The last known event seq number to backfill from. Use '2222222222222' to backfill from the beginning. Don't specify a cursor to listen only for new events."
}
}
},
"message": {
"schema": {
"type": "union",
"refs": [
"#eventConvoFirstMessage",
"#eventGroupChatCreated",
"#eventGroupChatMemberAdded",
"#eventGroupChatMemberJoined",
"#eventGroupChatJoinRequest",
"#eventGroupChatJoinRequestApproved",
"#eventGroupChatJoinRequestRejected",
"#eventChatAccepted",
"#eventGroupChatMemberLeft",
"#eventGroupChatUpdated",
"#eventRateLimitExceeded"
]
}
},
"errors": [
{
"name": "FutureCursor"
},
{
"name": "ConsumerTooSlow",
"description": "If the consumer of the stream can not keep up with events, and a backlog gets too large, the server will drop the connection."
}
]
},
"eventConvoFirstMessage": {
"type": "object",
"description": "Fired when the first message was sent on a convo.",
"required": ["createdAt", "rev", "convoId", "user", "recipients"],
"properties": {
"convoId": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"messageId": {
"type": "string"
},
"recipients": {
"description": "The list of DIDs message recipients. Does not include the sender, which is in the `user` field",
"type": "array",
"items": {
"type": "string",
"format": "did"
}
},
"rev": {
"type": "string"
},
"user": {
"description": "The DID of the message author.",
"type": "string",
"format": "did"
}
}
},
"eventGroupChatCreated": {
"type": "object",
"description": "Fire when a group chat is created.",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"initialMemberDids",
"ownerDid",
"rev"
],
"properties": {
"actorDid": {
"description": "The DID of the actor performing the action. For this event, same as ownerDid.",
"type": "string",
"format": "did"
},
"convoCreatedAt": {
"description": "When the group was originally created.",
"type": "string",
"format": "datetime"
},
"convoId": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupMemberCount": {
"description": "Current member count at the time of the event.",
"type": "integer"
},
"groupName": {
"description": "The name set at creation time.",
"type": "string"
},
"initialMemberDids": {
"description": "DIDs of everyone added at creation time.",
"type": "array",
"items": {
"type": "string",
"format": "did"
}
},
"ownerDid": {
"description": "The DID of the group chat owner.",
"type": "string",
"format": "did"
},
"rev": {
"type": "string"
}
}
},
"eventGroupChatMemberAdded": {
"type": "object",
"description": "Fired when a member is added to a group chat. Note that members are added in the 'request' state.",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"ownerDid",
"requestMembersCount",
"rev",
"subjectDid",
"subjectFollowsOwner"
],
"properties": {
"actorDid": {
"description": "The DID of the actor performing the action. For this event, same as ownerDid.",
"type": "string",
"format": "did"
},
"convoCreatedAt": {
"description": "When the group was originally created.",
"type": "string",
"format": "datetime"
},
"convoId": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupMemberCount": {
"description": "Current member count at the time of the event.",
"type": "integer"
},
"groupName": {
"type": "string"
},
"ownerDid": {
"description": "The DID of the group chat owner.",
"type": "string",
"format": "did"
},
"requestMembersCount": {
"description": "The number of members who have not yet accepted the convo.",
"type": "integer"
},
"rev": {
"type": "string"
},
"subjectDid": {
"description": "The DID of the member who was added.",
"type": "string",
"format": "did"
},
"subjectFollowsOwner": {
"description": "Whether the added member follows the group owner.",
"type": "boolean"
}
}
},
"eventGroupChatMemberJoined": {
"type": "object",
"description": "Fired when a member joins a group chat via an join link that does not require approval.",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"joinLinkCode",
"ownerDid",
"rev",
"subjectFollowsOwner"
],
"properties": {
"actorDid": {
"description": "The DID of the person joining.",
"type": "string",
"format": "did"
},
"convoCreatedAt": {
"description": "When the group was originally created.",
"type": "string",
"format": "datetime"
},
"convoId": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupMemberCount": {
"description": "Current member count at the time of the event.",
"type": "integer"
},
"groupName": {
"type": "string"
},
"joinLinkCode": {
"description": "The code of the join link used to join.",
"type": "string"
},
"ownerDid": {
"description": "The DID of the group chat owner.",
"type": "string",
"format": "did"
},
"rev": {
"type": "string"
},
"subjectFollowsOwner": {
"description": "Whether the joining member follows the group owner.",
"type": "boolean"
}
}
},
"eventGroupChatJoinRequest": {
"type": "object",
"description": "Fired when a user requests to join a group chat via an join link that requires approval.",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"joinLinkCode",
"ownerDid",
"rev",
"subjectFollowsOwner"
],
"properties": {
"actorDid": {
"description": "The DID of the person requesting to join.",
"type": "string",
"format": "did"
},
"convoCreatedAt": {
"description": "When the group was originally created.",
"type": "string",
"format": "datetime"
},
"convoId": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupMemberCount": {
"description": "Current member count at the time of the event.",
"type": "integer"
},
"groupName": {
"type": "string"
},
"joinLinkCode": {
"description": "The code of the join link used to request joining.",
"type": "string"
},
"ownerDid": {
"description": "The DID of the group chat owner.",
"type": "string",
"format": "did"
},
"rev": {
"type": "string"
},
"subjectFollowsOwner": {
"description": "Whether the requesting member follows the group owner.",
"type": "boolean"
}
}
},
"eventGroupChatJoinRequestApproved": {
"type": "object",
"description": "Fired when a join request is approved by the group owner.",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"ownerDid",
"rev",
"subjectDid"
],
"properties": {
"actorDid": {
"description": "The DID of the owner approving the request.",
"type": "string",
"format": "did"
},
"convoCreatedAt": {
"description": "When the group was originally created.",
"type": "string",
"format": "datetime"
},
"convoId": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupMemberCount": {
"description": "Current member count at the time of the event.",
"type": "integer"
},
"groupName": {
"type": "string"
},
"ownerDid": {
"description": "The DID of the group chat owner.",
"type": "string",
"format": "did"
},
"rev": {
"type": "string"
},
"subjectDid": {
"description": "The DID of the member whose request was approved.",
"type": "string",
"format": "did"
}
}
},
"eventGroupChatJoinRequestRejected": {
"type": "object",
"description": "Fired when a join request is rejected by the group owner.",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"ownerDid",
"rev",
"subjectDid"
],
"properties": {
"actorDid": {
"description": "The DID of the owner rejecting the request.",
"type": "string",
"format": "did"
},
"convoCreatedAt": {
"description": "When the group was originally created.",
"type": "string",
"format": "datetime"
},
"convoId": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupMemberCount": {
"description": "Current member count at the time of the event.",
"type": "integer"
},
"groupName": {
"type": "string"
},
"ownerDid": {
"description": "The DID of the group chat owner.",
"type": "string",
"format": "did"
},
"rev": {
"type": "string"
},
"subjectDid": {
"description": "The DID of the member whose request was rejected.",
"type": "string",
"format": "did"
}
}
},
"eventChatAccepted": {
"type": "object",
"description": "Fired when a user accepts a chat convo, either explicitly or by sending a message.",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"method",
"rev"
],
"properties": {
"actorDid": {
"description": "The DID of the person accepting the convo.",
"type": "string",
"format": "did"
},
"convoCreatedAt": {
"description": "When the convo was originally created.",
"type": "string",
"format": "datetime"
},
"convoId": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupMemberCount": {
"description": "Current member count at the time of the event. Only present for group convos.",
"type": "integer"
},
"groupName": {
"description": "The name of the group chat. Only present for group convos.",
"type": "string"
},
"method": {
"description": "How the convo was accepted.",
"type": "string",
"knownValues": ["explicit", "message"]
},
"ownerDid": {
"description": "The DID of the group chat owner. Only present for group convos.",
"type": "string",
"format": "did"
},
"rev": {
"type": "string"
}
}
},
"eventGroupChatMemberLeft": {
"type": "object",
"description": "Fired when a member leaves or is removed from a group chat.",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"leaveMethod",
"ownerDid",
"rev",
"subjectDid"
],
"properties": {
"actorDid": {
"description": "The DID of the actor. For voluntary: the person leaving. For kicked: the owner.",
"type": "string",
"format": "did"
},
"convoCreatedAt": {
"description": "When the group was originally created.",
"type": "string",
"format": "datetime"
},
"convoId": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupMemberCount": {
"description": "Current member count at the time of the event.",
"type": "integer"
},
"groupName": {
"type": "string"
},
"leaveMethod": {
"description": "How the member left.",
"type": "string",
"knownValues": ["voluntary", "kicked"]
},
"ownerDid": {
"description": "The DID of the group chat owner.",
"type": "string",
"format": "did"
},
"rev": {
"type": "string"
},
"subjectDid": {
"description": "The DID of the member who left or was removed.",
"type": "string",
"format": "did"
}
}
},
"eventGroupChatUpdated": {
"type": "object",
"description": "Fired when a group chat's metadata or status changes.",
"required": [
"actorDid",
"convoCreatedAt",
"convoId",
"createdAt",
"groupMemberCount",
"groupName",
"ownerDid",
"rev",
"updateType"
],
"properties": {
"actorDid": {
"description": "The DID of the actor performing the action (the owner).",
"type": "string",
"format": "did"
},
"convoCreatedAt": {
"description": "When the group was originally created.",
"type": "string",
"format": "datetime"
},
"convoId": {
"type": "string"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"groupMemberCount": {
"description": "Current member count at the time of the event.",
"type": "integer"
},
"groupName": {
"description": "Current group name.",
"type": "string"
},
"joinLinkCode": {
"description": "The code of the join link. Only present when updateType is join-link-related.",
"type": "string"
},
"joinLinkFollowersOnly": {
"description": "Whether the join link is restricted to followers of the owner. Only present when updateType is join-link-related.",
"type": "boolean"
},
"joinLinkRequiresApproval": {
"description": "Whether the join link requires owner approval to join. Only present when updateType is join-link-related.",
"type": "boolean"
},
"lockReason": {
"description": "Why the group was locked. Only present when updateType is 'locked'.",
"type": "string",
"knownValues": [
"owner_action",
"owner_left",
"owner_deactivated",
"owner_deleted",
"owner_suspended",
"owner_taken_down",
"label_applied",
"convo_taken_down"
]
},
"newName": {
"description": "The new group name. Only present when updateType is 'name_changed'.",
"type": "string"
},
"oldName": {
"description": "The previous group name. Only present when updateType is 'name_changed'.",
"type": "string"
},
"ownerDid": {
"description": "The DID of the group chat owner.",
"type": "string",
"format": "did"
},
"rev": {
"type": "string"
},
"updateType": {
"description": "What changed.",
"type": "string",
"knownValues": [
"name_changed",
"locked",
"locked_permanently",
"unlocked",
"join_link_created",
"join_link_disabled",
"join_link_settings_changed"
]
}
}
},
"eventRateLimitExceeded": {
"type": "object",
"description": "Fired when a user exceeds a rate limit.",
"required": ["actorDid", "createdAt", "endpoint", "rev"],
"properties": {
"actorDid": {
"description": "The DID of the user who hit the rate limit.",
"type": "string",
"format": "did"
},
"createdAt": {
"type": "string",
"format": "datetime"
},
"endpoint": {
"description": "The NSID of the endpoint that was rate limited.",
"type": "string"
},
"rev": {
"type": "string"
}
}
}
}
}
@@ -0,0 +1,28 @@
{
"lexicon": 1,
"id": "chat.bsky.moderation.updateActorAccess",
"defs": {
"main": {
"type": "procedure",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["actor", "allowAccess"],
"properties": {
"actor": {
"type": "string",
"format": "did"
},
"allowAccess": {
"type": "boolean"
},
"ref": {
"type": "string"
}
}
}
}
}
}
}
+33
View File
@@ -0,0 +1,33 @@
{
"lexicon": 1,
"id": "chat.bsky.notification.defs",
"defs": {
"preferences": {
"type": "object",
"required": ["chat", "chatRequest"],
"properties": {
"chat": {
"type": "ref",
"ref": "#chatPreference"
},
"chatRequest": {
"type": "ref",
"ref": "#chatPreference"
}
}
},
"chatPreference": {
"type": "object",
"required": ["include", "push"],
"properties": {
"include": {
"type": "string",
"knownValues": ["all", "follows"]
},
"push": {
"type": "boolean"
}
}
}
}
}
@@ -0,0 +1,23 @@
{
"lexicon": 1,
"id": "chat.bsky.notification.getPreferences",
"defs": {
"main": {
"type": "query",
"description": "Get the requesting account's chat notification preferences. Defaults are returned for accounts that have not set any preferences. Requires auth.",
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["preferences"],
"properties": {
"preferences": {
"type": "ref",
"ref": "chat.bsky.notification.defs#preferences"
}
}
}
}
}
}
}
@@ -0,0 +1,39 @@
{
"lexicon": 1,
"id": "chat.bsky.notification.putPreferences",
"defs": {
"main": {
"type": "procedure",
"description": "Set the requesting account's chat notification preferences. Only the provided preferences are updated; omitted preferences are left unchanged.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {
"chat": {
"type": "ref",
"ref": "chat.bsky.notification.defs#chatPreference"
},
"chatRequest": {
"type": "ref",
"ref": "chat.bsky.notification.defs#chatPreference"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["preferences"],
"properties": {
"preferences": {
"type": "ref",
"ref": "chat.bsky.notification.defs#preferences"
}
}
}
}
}
}
}