diff --git a/lexicons/chat/bsky/actor/defs.json b/lexicons/chat/bsky/actor/defs.json index c1756545..39532b6e 100644 --- a/lexicons/chat/bsky/actor/defs.json +++ b/lexicons/chat/bsky/actor/defs.json @@ -39,7 +39,11 @@ "kind": { "description": "Union field that has data specific to different kinds of convos.", "type": "union", - "refs": ["#directConvoMember", "#groupConvoMember"] + "refs": [ + "#directConvoMember", + "#groupConvoMember", + "#pastGroupConvoMember" + ] } } }, @@ -49,7 +53,7 @@ "properties": {} }, "groupConvoMember": { - "description": "[NOTE: This is under active development and should be considered unstable while this note is here].", + "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. A current group convo member.", "type": "object", "required": ["role"], "properties": { @@ -64,6 +68,12 @@ "ref": "#memberRole" } } + }, + "pastGroupConvoMember": { + "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. A past group convo member.", + "type": "object", + "required": [], + "properties": {} } } } diff --git a/lexicons/chat/bsky/actor/getStatus.json b/lexicons/chat/bsky/actor/getStatus.json new file mode 100644 index 00000000..300aa98f --- /dev/null +++ b/lexicons/chat/bsky/actor/getStatus.json @@ -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." + } + } + } + } + } + } +} diff --git a/lexicons/chat/bsky/convo/defs.json b/lexicons/chat/bsky/convo/defs.json index e3a31001..f78a1fab 100644 --- a/lexicons/chat/bsky/convo/defs.json +++ b/lexicons/chat/bsky/convo/defs.json @@ -14,6 +14,14 @@ "type": "string", "knownValues": ["request", "accepted"] }, + "convoRef": { + "type": "object", + "required": ["did", "convoId"], + "properties": { + "did": { "type": "string", "format": "did" }, + "convoId": { "type": "string" } + } + }, "messageRef": { "type": "object", "required": ["did", "messageId", "convoId"], @@ -72,6 +80,13 @@ "sentAt": { "type": "string", "format": "datetime" } } }, + "systemMessageReferredUser": { + "type": "object", + "required": ["did"], + "properties": { + "did": { "type": "string", "format": "did" } + } + }, "systemMessageView": { "description": "[NOTE: This is under active development and should be considered unstable while this note is here].", "type": "object", @@ -107,7 +122,7 @@ "member": { "description": "Current view of the member who was added.", "type": "ref", - "ref": "chat.bsky.actor.defs#profileViewBasic" + "ref": "#systemMessageReferredUser" }, "role": { "description": "Role the user was added to the group with. The role from 'member' will reflect the current data, not historical.", @@ -116,7 +131,7 @@ }, "addedBy": { "type": "ref", - "ref": "chat.bsky.actor.defs#profileViewBasic" + "ref": "#systemMessageReferredUser" } } }, @@ -128,11 +143,11 @@ "member": { "description": "Current view of the member who was removed.", "type": "ref", - "ref": "chat.bsky.actor.defs#profileViewBasic" + "ref": "#systemMessageReferredUser" }, "removedBy": { "type": "ref", - "ref": "chat.bsky.actor.defs#profileViewBasic" + "ref": "#systemMessageReferredUser" } } }, @@ -144,7 +159,7 @@ "member": { "description": "Current view of the member who joined.", "type": "ref", - "ref": "chat.bsky.actor.defs#profileViewBasic" + "ref": "#systemMessageReferredUser" }, "role": { "description": "Role the user was added to the group with. The role from 'member' will reflect the current data, not historical.", @@ -154,7 +169,7 @@ "approvedBy": { "description": "If join link was configured to require approval, this will be set to who approved the request. Undefined if approval was not required.", "type": "ref", - "ref": "chat.bsky.actor.defs#profileViewBasic" + "ref": "#systemMessageReferredUser" } } }, @@ -166,7 +181,7 @@ "member": { "description": "Current view of the member who left the group.", "type": "ref", - "ref": "chat.bsky.actor.defs#profileViewBasic" + "ref": "#systemMessageReferredUser" } } }, @@ -178,7 +193,7 @@ "lockedBy": { "description": "Current view of the member who locked the group.", "type": "ref", - "ref": "chat.bsky.actor.defs#profileViewBasic" + "ref": "#systemMessageReferredUser" } } }, @@ -190,7 +205,7 @@ "unlockedBy": { "description": "Current view of the member who unlocked the group.", "type": "ref", - "ref": "chat.bsky.actor.defs#profileViewBasic" + "ref": "#systemMessageReferredUser" } } }, @@ -202,7 +217,7 @@ "lockedBy": { "description": "Current view of the member who locked the group.", "type": "ref", - "ref": "chat.bsky.actor.defs#profileViewBasic" + "ref": "#systemMessageReferredUser" } } }, @@ -288,7 +303,7 @@ "id": { "type": "string" }, "rev": { "type": "string" }, "members": { - "description": "Members of this conversation. For direct convos, it will be an immutable list of the 2 members. For group convos, it will a list of important members (the first few members, the viewer, the member who invited the viewer, the member who sent the last message, the member who sent the last reaction), but will not contain the full list of members. NOTE: TBD an endpoint to list all members.", + "description": "Members of this conversation. For direct convos, it will be an immutable list of the 2 members. For group convos, it will a list of important members (the first few members, the viewer, the member who added the viewer, the member who sent the last message, the member who sent the last reaction), but will not contain the full list of members. Use chat.bsky.convo.getConvoMembers to list all members.", "type": "array", "items": { "type": "ref", @@ -325,7 +340,13 @@ "groupConvo": { "description": "[NOTE: This is under active development and should be considered unstable while this note is here].", "type": "object", - "required": ["name", "lockStatus"], + "required": [ + "name", + "lockStatus", + "memberCount", + "memberLimit", + "createdAt" + ], "properties": { "name": { "type": "string", @@ -333,10 +354,26 @@ "maxGraphemes": 128, "maxLength": 1280 }, + "memberCount": { + "type": "integer", + "description": "The total number of members in the group conversation." + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "joinRequestCount": { + "type": "integer", + "description": "The total number of pending join requests for the group conversation. Only present for the owner. Capped at 21." + }, "joinLink": { "type": "ref", "ref": "chat.bsky.group.defs#joinLinkView" }, + "memberLimit": { + "type": "integer", + "description": "The maximum number of members allowed in the group conversation." + }, "lockStatus": { "description": "The lock status of the conversation.", "type": "ref", @@ -399,6 +436,14 @@ "message": { "type": "union", "refs": ["#messageView", "#deletedMessageView"] + }, + "relatedProfiles": { + "description": "Profiles referred to in the message view. This isn't required for compatibility, because it was added later, but should generally be present.", + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.actor.defs#profileViewBasic" + } } } }, @@ -439,7 +484,15 @@ "type": "union", "refs": ["#messageView", "#deletedMessageView"] }, - "reaction": { "type": "ref", "ref": "#reactionView" } + "reaction": { "type": "ref", "ref": "#reactionView" }, + "relatedProfiles": { + "description": "Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present.", + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.actor.defs#profileViewBasic" + } + } } }, "logRemoveReaction": { @@ -453,7 +506,15 @@ "type": "union", "refs": ["#messageView", "#deletedMessageView"] }, - "reaction": { "type": "ref", "ref": "#reactionView" } + "reaction": { "type": "ref", "ref": "#reactionView" }, + "relatedProfiles": { + "description": "Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present.", + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.actor.defs#profileViewBasic" + } + } } }, "logReadConvo": { @@ -472,73 +533,154 @@ "logAddMember": { "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. Event indicating a member was added to a group convo. The member who was added gets a logBeginConvo (to create the convo) but also a logAddMember (to show the system message as the first message the user sees).", "type": "object", - "required": ["rev", "convoId", "message"], + "required": ["rev", "convoId", "message", "relatedProfiles"], "properties": { "rev": { "type": "string" }, "convoId": { "type": "string" }, - "message": { "type": "ref", "ref": "#systemMessageDataAddMember" } + "message": { + "description": "A system message with data of type #systemMessageDataAddMember", + "type": "ref", + "ref": "#systemMessageView" + }, + "relatedProfiles": { + "description": "Profiles referred in the system message.", + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.actor.defs#profileViewBasic" + } + } } }, "logRemoveMember": { "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. Event indicating a member was removed from a group convo. The member who was removed gets a logLeaveConvo (to leave the convo) but not a logRemoveMember (because they already left, so can't see the system message).", "type": "object", - "required": ["rev", "convoId", "message"], + "required": ["rev", "convoId", "message", "relatedProfiles"], "properties": { "rev": { "type": "string" }, "convoId": { "type": "string" }, - "message": { "type": "ref", "ref": "#systemMessageDataRemoveMember" } + "message": { + "description": "A system message with data of type #systemMessageDataRemoveMember", + "type": "ref", + "ref": "#systemMessageView" + }, + "relatedProfiles": { + "description": "Profiles referred in the system message.", + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.actor.defs#profileViewBasic" + } + } } }, "logMemberJoin": { "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. Event indicating a member joined a group convo via join link. The member who was added gets a logBeginConvo (to create the convo) but also a logMemberJoin (to show the system message as the first message the user sees).", "type": "object", - "required": ["rev", "convoId", "message"], + "required": ["rev", "convoId", "message", "relatedProfiles"], "properties": { "rev": { "type": "string" }, "convoId": { "type": "string" }, - "message": { "type": "ref", "ref": "#systemMessageDataMemberJoin" } + "message": { + "description": "A system message with data of type #systemMessageDataMemberJoin", + "type": "ref", + "ref": "#systemMessageView" + }, + "relatedProfiles": { + "description": "Profiles referred in the system message.", + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.actor.defs#profileViewBasic" + } + } } }, "logMemberLeave": { "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. Event indicating a member voluntarily left a group convo. The member who was removed gets a logLeaveConvo (to leave the convo) but not a logMemberLeave (because they already left, so can't see the system message).", "type": "object", - "required": ["rev", "convoId", "message"], + "required": ["rev", "convoId", "message", "relatedProfiles"], "properties": { "rev": { "type": "string" }, "convoId": { "type": "string" }, - "message": { "type": "ref", "ref": "#systemMessageDataMemberLeave" } + "message": { + "description": "A system message with data of type #systemMessageDataMemberLeave", + "type": "ref", + "ref": "#systemMessageView" + }, + "relatedProfiles": { + "description": "Profiles referred in the system message.", + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.actor.defs#profileViewBasic" + } + } } }, "logLockConvo": { "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. Event indicating a group convo was locked.", "type": "object", - "required": ["rev", "convoId", "message"], + "required": ["rev", "convoId", "message", "relatedProfiles"], "properties": { "rev": { "type": "string" }, "convoId": { "type": "string" }, - "message": { "type": "ref", "ref": "#systemMessageDataLockConvo" } + "message": { + "description": "A system message with data of type #systemMessageDataLockConvo", + "type": "ref", + "ref": "#systemMessageView" + }, + "relatedProfiles": { + "description": "Profiles referred in the system message.", + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.actor.defs#profileViewBasic" + } + } } }, "logUnlockConvo": { "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. Event indicating a group convo was unlocked.", "type": "object", - "required": ["rev", "convoId", "message"], + "required": ["rev", "convoId", "message", "relatedProfiles"], "properties": { "rev": { "type": "string" }, "convoId": { "type": "string" }, - "message": { "type": "ref", "ref": "#systemMessageDataUnlockConvo" } + "message": { + "description": "A system message with data of type #systemMessageDataUnlockConvo", + "type": "ref", + "ref": "#systemMessageView" + }, + "relatedProfiles": { + "description": "Profiles referred in the system message.", + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.actor.defs#profileViewBasic" + } + } } }, "logLockConvoPermanently": { "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. Event indicating a group convo was locked permanently.", "type": "object", - "required": ["rev", "convoId", "message"], + "required": ["rev", "convoId", "message", "relatedProfiles"], "properties": { "rev": { "type": "string" }, "convoId": { "type": "string" }, "message": { + "description": "A system message with data of type #systemMessageDataLockConvoPermanently", "type": "ref", - "ref": "#systemMessageDataLockConvoPermanently" + "ref": "#systemMessageView" + }, + "relatedProfiles": { + "description": "Profiles referred in the system message.", + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.actor.defs#profileViewBasic" + } } } }, @@ -549,7 +691,11 @@ "properties": { "rev": { "type": "string" }, "convoId": { "type": "string" }, - "message": { "type": "ref", "ref": "#systemMessageDataEditGroup" } + "message": { + "description": "A system message with data of type #systemMessageDataEditGroup", + "type": "ref", + "ref": "#systemMessageView" + } } }, "logCreateJoinLink": { @@ -559,7 +705,11 @@ "properties": { "rev": { "type": "string" }, "convoId": { "type": "string" }, - "message": { "type": "ref", "ref": "#systemMessageDataCreateJoinLink" } + "message": { + "description": "A system message with data of type #systemMessageDataCreateJoinLink", + "type": "ref", + "ref": "#systemMessageView" + } } }, "logEditJoinLink": { @@ -569,7 +719,11 @@ "properties": { "rev": { "type": "string" }, "convoId": { "type": "string" }, - "message": { "type": "ref", "ref": "#systemMessageDataEditJoinLink" } + "message": { + "description": "A system message with data of type #systemMessageDataEditJoinLink", + "type": "ref", + "ref": "#systemMessageView" + } } }, "logEnableJoinLink": { @@ -579,7 +733,11 @@ "properties": { "rev": { "type": "string" }, "convoId": { "type": "string" }, - "message": { "type": "ref", "ref": "#systemMessageDataEnableJoinLink" } + "message": { + "description": "A system message with data of type #systemMessageDataEnableJoinLink", + "type": "ref", + "ref": "#systemMessageView" + } } }, "logDisableJoinLink": { @@ -589,7 +747,11 @@ "properties": { "rev": { "type": "string" }, "convoId": { "type": "string" }, - "message": { "type": "ref", "ref": "#systemMessageDataDisableJoinLink" } + "message": { + "description": "A system message with data of type #systemMessageDataDisableJoinLink", + "type": "ref", + "ref": "#systemMessageView" + } } }, "logIncomingJoinRequest": { diff --git a/lexicons/chat/bsky/convo/getConvoForMembers.json b/lexicons/chat/bsky/convo/getConvoForMembers.json index 8889238e..220990eb 100644 --- a/lexicons/chat/bsky/convo/getConvoForMembers.json +++ b/lexicons/chat/bsky/convo/getConvoForMembers.json @@ -8,6 +8,7 @@ "errors": [ { "name": "AccountSuspended" }, { "name": "BlockedActor" }, + { "name": "BlockedSubject" }, { "name": "MessagesDisabled" }, { "name": "NotFollowedBySender" }, { "name": "RecipientNotFound" } diff --git a/lexicons/chat/bsky/convo/getConvoMembers.json b/lexicons/chat/bsky/convo/getConvoMembers.json new file mode 100644 index 00000000..dd0117ac --- /dev/null +++ b/lexicons/chat/bsky/convo/getConvoMembers.json @@ -0,0 +1,42 @@ +{ + "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" + } + } + } + } + } + } + } +} diff --git a/lexicons/chat/bsky/convo/getMessages.json b/lexicons/chat/bsky/convo/getMessages.json index 67be547a..dc5d2d78 100644 --- a/lexicons/chat/bsky/convo/getMessages.json +++ b/lexicons/chat/bsky/convo/getMessages.json @@ -37,6 +37,14 @@ "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" + } } } } diff --git a/lexicons/chat/bsky/convo/listConvoRequests.json b/lexicons/chat/bsky/convo/listConvoRequests.json index f289a439..f6f537f3 100644 --- a/lexicons/chat/bsky/convo/listConvoRequests.json +++ b/lexicons/chat/bsky/convo/listConvoRequests.json @@ -4,7 +4,7 @@ "defs": { "main": { "type": "query", - "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. Returns a page of incoming conversation requests for the user. Direct convo requests are returned as convoView; group join requests are returned as joinRequestView.", + "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. 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": { @@ -30,7 +30,7 @@ "type": "union", "refs": [ "chat.bsky.convo.defs#convoView", - "chat.bsky.group.defs#joinRequestView" + "chat.bsky.group.defs#joinRequestConvoView" ] } } diff --git a/lexicons/chat/bsky/convo/listConvos.json b/lexicons/chat/bsky/convo/listConvos.json index 098b66aa..68deb2d6 100644 --- a/lexicons/chat/bsky/convo/listConvos.json +++ b/lexicons/chat/bsky/convo/listConvos.json @@ -28,6 +28,11 @@ "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"] } } }, diff --git a/lexicons/chat/bsky/group/addMembers.json b/lexicons/chat/bsky/group/addMembers.json index 7480b4e7..2e810080 100644 --- a/lexicons/chat/bsky/group/addMembers.json +++ b/lexicons/chat/bsky/group/addMembers.json @@ -8,13 +8,14 @@ "errors": [ { "name": "AccountSuspended" }, { "name": "BlockedActor" }, - { "name": "GroupInvitesDisabled" }, + { "name": "BlockedSubject" }, { "name": "ConvoLocked" }, { "name": "InsufficientRole" }, { "name": "InvalidConvo" }, { "name": "MemberLimitReached" }, { "name": "NotFollowedBySender" }, - { "name": "RecipientNotFound" } + { "name": "RecipientNotFound" }, + { "name": "UserForbidsGroups" } ], "input": { "encoding": "application/json", @@ -40,6 +41,13 @@ "convo": { "type": "ref", "ref": "chat.bsky.convo.defs#convoView" + }, + "addedMembers": { + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.actor.defs#profileViewBasic" + } } } } diff --git a/lexicons/chat/bsky/group/createGroup.json b/lexicons/chat/bsky/group/createGroup.json index 79feb8d4..d534af54 100644 --- a/lexicons/chat/bsky/group/createGroup.json +++ b/lexicons/chat/bsky/group/createGroup.json @@ -8,9 +8,11 @@ "errors": [ { "name": "AccountSuspended" }, { "name": "BlockedActor" }, - { "name": "GroupInvitesDisabled" }, + { "name": "BlockedSubject" }, + { "name": "NewAccountCannotCreateGroup" }, { "name": "NotFollowedBySender" }, - { "name": "RecipientNotFound" } + { "name": "RecipientNotFound" }, + { "name": "UserForbidsGroups" } ], "input": { "encoding": "application/json", diff --git a/lexicons/chat/bsky/group/defs.json b/lexicons/chat/bsky/group/defs.json index 91aa9cb4..30f442a7 100644 --- a/lexicons/chat/bsky/group/defs.json +++ b/lexicons/chat/bsky/group/defs.json @@ -31,17 +31,45 @@ "createdAt": { "type": "string", "format": "datetime" } } }, - "groupPublicView": { + "joinLinkPreviewView": { "type": "object", - "required": ["name", "owner", "memberCount", "requireApproval"], + "required": [ + "code", + "name", + "owner", + "memberCount", + "memberLimit", + "requireApproval", + "joinRule", + "enabledStatus" + ], "properties": { + "code": { "type": "string" }, "name": { "type": "string" }, "owner": { "type": "ref", "ref": "chat.bsky.actor.defs#profileViewBasic" }, "memberCount": { "type": "integer" }, - "requireApproval": { "type": "boolean" } + "memberLimit": { "type": "integer" }, + "requireApproval": { "type": "boolean" }, + "joinRule": { "type": "ref", "ref": "#joinRule" }, + "enabledStatus": { "type": "ref", "ref": "#linkEnabledStatus" }, + "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" + } + } + }, + "joinLinkViewerState": { + "type": "object", + "properties": { + "requestedAt": { "type": "string", "format": "datetime" } } }, "joinRequestView": { @@ -55,6 +83,29 @@ }, "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", + "requestedAt" + ], + "properties": { + "convoId": { "type": "string" }, + "name": { "type": "string" }, + "owner": { + "type": "ref", + "ref": "chat.bsky.actor.defs#profileViewBasic" + }, + "memberCount": { "type": "integer" }, + "memberLimit": { "type": "integer" }, + "requestedAt": { "type": "string", "format": "datetime" } + } } } } diff --git a/lexicons/chat/bsky/group/getGroupPublicInfo.json b/lexicons/chat/bsky/group/getGroupPublicInfo.json deleted file mode 100644 index 85b6563c..00000000 --- a/lexicons/chat/bsky/group/getGroupPublicInfo.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "lexicon": 1, - "id": "chat.bsky.group.getGroupPublicInfo", - "defs": { - "main": { - "type": "query", - "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. Get public information about a group from an join link.", - "errors": [{ "name": "InvalidCode" }], - "parameters": { - "type": "params", - "required": ["code"], - "properties": { - "code": { "type": "string" } - } - }, - "output": { - "encoding": "application/json", - "schema": { - "type": "object", - "required": ["group"], - "properties": { - "group": { - "type": "ref", - "ref": "chat.bsky.group.defs#groupPublicView" - } - } - } - } - } - } -} diff --git a/lexicons/chat/bsky/group/getJoinLinkPreviews.json b/lexicons/chat/bsky/group/getJoinLinkPreviews.json new file mode 100644 index 00000000..98f13090 --- /dev/null +++ b/lexicons/chat/bsky/group/getJoinLinkPreviews.json @@ -0,0 +1,38 @@ +{ + "lexicon": 1, + "id": "chat.bsky.group.getJoinLinkPreviews", + "defs": { + "main": { + "type": "query", + "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. Get public information about groups from join links. Invalid or disabled codes are silently omitted from results.", + "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": "ref", + "ref": "chat.bsky.group.defs#joinLinkPreviewView" + } + } + } + } + } + } + } +} diff --git a/lexicons/chat/bsky/group/listMutualGroups.json b/lexicons/chat/bsky/group/listMutualGroups.json new file mode 100644 index 00000000..3cd8c38c --- /dev/null +++ b/lexicons/chat/bsky/group/listMutualGroups.json @@ -0,0 +1,44 @@ +{ + "lexicon": 1, + "id": "chat.bsky.group.listMutualGroups", + "defs": { + "main": { + "type": "query", + "description": "[NOTE: This is under active development and should be considered unstable while this note is here]. 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" + } + } + } + } + } + } + } +} diff --git a/lexicons/chat/bsky/moderation/getMessageContext.json b/lexicons/chat/bsky/moderation/getMessageContext.json index 93b9d9a0..b267dcd2 100644 --- a/lexicons/chat/bsky/moderation/getMessageContext.json +++ b/lexicons/chat/bsky/moderation/getMessageContext.json @@ -13,8 +13,23 @@ "description": "Conversation that the message is from. NOTE: this field will eventually be required." }, "messageId": { "type": "string" }, - "before": { "type": "integer", "default": 5 }, - "after": { "type": "integer", "default": 5 } + "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": { @@ -29,7 +44,6 @@ "type": "union", "refs": [ "chat.bsky.convo.defs#messageView", - "chat.bsky.convo.defs#deletedMessageView", "chat.bsky.convo.defs#systemMessageView" ] } diff --git a/lexicons/chat/bsky/moderation/subscribeModEvents.json b/lexicons/chat/bsky/moderation/subscribeModEvents.json index c9114984..6e718438 100644 --- a/lexicons/chat/bsky/moderation/subscribeModEvents.json +++ b/lexicons/chat/bsky/moderation/subscribeModEvents.json @@ -17,7 +17,18 @@ "message": { "schema": { "type": "union", - "refs": ["#eventConvoFirstMessage"] + "refs": [ + "#eventConvoFirstMessage", + "#eventGroupChatCreated", + "#eventGroupChatMemberAdded", + "#eventGroupChatMemberJoined", + "#eventGroupChatJoinRequest", + "#eventGroupChatJoinRequestApproved", + "#eventGroupChatJoinRequestRejected", + "#eventChatAccepted", + "#eventGroupChatMemberLeft", + "#eventGroupChatUpdated" + ] } }, "errors": [ @@ -30,6 +41,7 @@ }, "eventConvoFirstMessage": { "type": "object", + "description": "Fired when the first message was sent on a convo.", "required": ["createdAt", "rev", "convoId", "user", "recipients"], "properties": { "convoId": { "type": "string" }, @@ -47,6 +59,482 @@ "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" + ] + }, + "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" + ] + } + } } } }