diff --git a/lexicons/chat/sprk/actor/declaration.json b/lexicons/chat/sprk/actor/declaration.json new file mode 100644 index 0000000..a507aac --- /dev/null +++ b/lexicons/chat/sprk/actor/declaration.json @@ -0,0 +1,21 @@ +{ + "lexicon": 1, + "id": "chat.sprk.actor.declaration", + "defs": { + "main": { + "type": "record", + "description": "A declaration of a Spark chat account.", + "key": "literal:self", + "record": { + "type": "object", + "required": ["allowIncoming"], + "properties": { + "allowIncoming": { + "type": "string", + "knownValues": ["all", "none", "following"] + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/actor/defs.json b/lexicons/chat/sprk/actor/defs.json new file mode 100644 index 0000000..ee456ff --- /dev/null +++ b/lexicons/chat/sprk/actor/defs.json @@ -0,0 +1,38 @@ +{ + "lexicon": 1, + "id": "chat.sprk.actor.defs", + "defs": { + "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": "so.sprk.actor.defs#profileAssociated" + }, + "viewer": { "type": "ref", "ref": "so.sprk.actor.defs#viewerState" }, + "labels": { + "type": "array", + "items": { "type": "ref", "ref": "com.atproto.label.defs#label" } + }, + "createdAt": { "type": "string", "format": "datetime" }, + "stories": { + "type": "array", + "description": "Recent stories from this profile author.", + "items": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/authFull.json b/lexicons/chat/sprk/authFull.json new file mode 100644 index 0000000..465bcd2 --- /dev/null +++ b/lexicons/chat/sprk/authFull.json @@ -0,0 +1,46 @@ +{ + "lexicon": 1, + "id": "chat.sprk.authFull", + "defs": { + "main": { + "type": "permission-set", + "title": "Full Spark Chat Permissions", + "title:lang": {}, + "detail": "Control of all Spark chat conversations and configuration management.", + "detail:lang": { + "en": "All Spark Chat Conversations" + }, + "permissions": [ + { + "type": "permission", + "resource": "rpc", + "inheritAud": true, + "lxm": [ + "chat.sprk.convo.acceptConvo", + "chat.sprk.convo.addReaction", + "chat.sprk.convo.getConvo", + "chat.sprk.convo.getConvoAvailability", + "chat.sprk.convo.getConvoForMembers", + "chat.sprk.convo.getLog", + "chat.sprk.convo.getMessages", + "chat.sprk.convo.leaveConvo", + "chat.sprk.convo.listConvos", + "chat.sprk.convo.muteConvo", + "chat.sprk.convo.removeReaction", + "chat.sprk.convo.sendMessage", + "chat.sprk.convo.sendMessageBatch", + "chat.sprk.convo.unmuteConvo", + "chat.sprk.convo.updateAllRead", + "chat.sprk.convo.updateRead" + ] + }, + { + "type": "permission", + "resource": "repo", + "action": ["create", "update", "delete"], + "collection": ["chat.sprk.actor.declaration"] + } + ] + } + } +} diff --git a/lexicons/chat/sprk/convo/acceptConvo.json b/lexicons/chat/sprk/convo/acceptConvo.json new file mode 100644 index 0000000..112d08c --- /dev/null +++ b/lexicons/chat/sprk/convo/acceptConvo.json @@ -0,0 +1,31 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.acceptConvo", + "defs": { + "main": { + "type": "procedure", + "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" + } + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/addReaction.json b/lexicons/chat/sprk/convo/addReaction.json new file mode 100644 index 0000000..4ec996d --- /dev/null +++ b/lexicons/chat/sprk/convo/addReaction.json @@ -0,0 +1,55 @@ +{ + "lexicon": 1, + "id": "chat.sprk.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.sprk.convo.defs#messageView" + } + } + } + }, + "errors": [ + { + "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." + } + ] + } + } +} diff --git a/lexicons/chat/sprk/convo/defs.json b/lexicons/chat/sprk/convo/defs.json new file mode 100644 index 0000000..7d7cecf --- /dev/null +++ b/lexicons/chat/sprk/convo/defs.json @@ -0,0 +1,226 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.defs", + "defs": { + "messageRef": { + "type": "object", + "required": ["did", "messageId", "convoId"], + "properties": { + "did": { "type": "string", "format": "did" }, + "convoId": { "type": "string" }, + "messageId": { "type": "string" } + } + }, + "messageInput": { + "type": "object", + "required": ["text"], + "properties": { + "text": { + "type": "string", + "maxLength": 10000, + "maxGraphemes": 1000 + }, + "embed": { + "type": "string", + "format": "at-uri" + } + } + }, + "messageView": { + "type": "object", + "required": ["id", "rev", "text", "sender", "sentAt"], + "properties": { + "id": { "type": "string" }, + "rev": { "type": "string" }, + "text": { + "type": "string", + "maxLength": 10000, + "maxGraphemes": 1000 + }, + "embed": { + "type": "string", + "format": "at-uri" + }, + "reactions": { + "type": "array", + "description": "Reactions to this message, in ascending order of creation time.", + "items": { "type": "ref", "ref": "#reactionView" } + }, + "sender": { "type": "ref", "ref": "#messageViewSender" }, + "sentAt": { "type": "string", "format": "datetime" } + } + }, + "deletedMessageView": { + "type": "object", + "required": ["id", "rev", "sender", "sentAt"], + "properties": { + "id": { "type": "string" }, + "rev": { "type": "string" }, + "sender": { "type": "ref", "ref": "#messageViewSender" }, + "sentAt": { "type": "string", "format": "datetime" } + } + }, + "messageViewSender": { + "type": "object", + "required": ["did"], + "properties": { + "did": { "type": "string", "format": "did" } + } + }, + "reactionView": { + "type": "object", + "required": ["value", "sender", "createdAt"], + "properties": { + "value": { "type": "string" }, + "sender": { "type": "ref", "ref": "#reactionViewSender" }, + "createdAt": { "type": "string", "format": "datetime" } + } + }, + "reactionViewSender": { + "type": "object", + "required": ["did"], + "properties": { + "did": { "type": "string", "format": "did" } + } + }, + "messageAndReactionView": { + "type": "object", + "required": ["message", "reaction"], + "properties": { + "message": { "type": "ref", "ref": "#messageView" }, + "reaction": { "type": "ref", "ref": "#reactionView" } + } + }, + "convoView": { + "type": "object", + "required": ["id", "rev", "members", "muted", "unreadCount"], + "properties": { + "id": { "type": "string" }, + "rev": { "type": "string" }, + "members": { + "type": "array", + "items": { + "type": "ref", + "ref": "chat.sprk.actor.defs#profileViewBasic" + } + }, + "lastMessage": { + "type": "union", + "refs": ["#messageView", "#deletedMessageView"] + }, + "lastReaction": { + "type": "union", + "refs": ["#messageAndReactionView"] + }, + "muted": { "type": "boolean" }, + "status": { + "type": "string", + "knownValues": ["request", "accepted"] + }, + "unreadCount": { "type": "integer" } + } + }, + "logBeginConvo": { + "type": "object", + "required": ["rev", "convoId"], + "properties": { + "rev": { "type": "string" }, + "convoId": { "type": "string" } + } + }, + "logAcceptConvo": { + "type": "object", + "required": ["rev", "convoId"], + "properties": { + "rev": { "type": "string" }, + "convoId": { "type": "string" } + } + }, + "logLeaveConvo": { + "type": "object", + "required": ["rev", "convoId"], + "properties": { + "rev": { "type": "string" }, + "convoId": { "type": "string" } + } + }, + "logMuteConvo": { + "type": "object", + "required": ["rev", "convoId"], + "properties": { + "rev": { "type": "string" }, + "convoId": { "type": "string" } + } + }, + "logUnmuteConvo": { + "type": "object", + "required": ["rev", "convoId"], + "properties": { + "rev": { "type": "string" }, + "convoId": { "type": "string" } + } + }, + "logCreateMessage": { + "type": "object", + "required": ["rev", "convoId", "message"], + "properties": { + "rev": { "type": "string" }, + "convoId": { "type": "string" }, + "message": { + "type": "union", + "refs": ["#messageView", "#deletedMessageView"] + } + } + }, + "logDeleteMessage": { + "type": "object", + "required": ["rev", "convoId", "message"], + "properties": { + "rev": { "type": "string" }, + "convoId": { "type": "string" }, + "message": { + "type": "union", + "refs": ["#messageView", "#deletedMessageView"] + } + } + }, + "logReadMessage": { + "type": "object", + "required": ["rev", "convoId", "message"], + "properties": { + "rev": { "type": "string" }, + "convoId": { "type": "string" }, + "message": { + "type": "union", + "refs": ["#messageView", "#deletedMessageView"] + } + } + }, + "logAddReaction": { + "type": "object", + "required": ["rev", "convoId", "message", "reaction"], + "properties": { + "rev": { "type": "string" }, + "convoId": { "type": "string" }, + "message": { + "type": "union", + "refs": ["#messageView", "#deletedMessageView"] + }, + "reaction": { "type": "ref", "ref": "#reactionView" } + } + }, + "logRemoveReaction": { + "type": "object", + "required": ["rev", "convoId", "message", "reaction"], + "properties": { + "rev": { "type": "string" }, + "convoId": { "type": "string" }, + "message": { + "type": "union", + "refs": ["#messageView", "#deletedMessageView"] + }, + "reaction": { "type": "ref", "ref": "#reactionView" } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/getConvo.json b/lexicons/chat/sprk/convo/getConvo.json new file mode 100644 index 0000000..c29f6ea --- /dev/null +++ b/lexicons/chat/sprk/convo/getConvo.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.getConvo", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": ["convoId"], + "properties": { + "convoId": { "type": "string" } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["convo"], + "properties": { + "convo": { + "type": "ref", + "ref": "chat.sprk.convo.defs#convoView" + } + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/getConvoAvailability.json b/lexicons/chat/sprk/convo/getConvoAvailability.json new file mode 100644 index 0000000..fcef965 --- /dev/null +++ b/lexicons/chat/sprk/convo/getConvoAvailability.json @@ -0,0 +1,41 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.getConvoAvailability", + "defs": { + "main": { + "type": "query", + "description": "Get whether the requester and the other members can chat. If an existing convo is found for these members, it is returned.", + "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.sprk.convo.defs#convoView" + } + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/getConvoForMembers.json b/lexicons/chat/sprk/convo/getConvoForMembers.json new file mode 100644 index 0000000..cdc9945 --- /dev/null +++ b/lexicons/chat/sprk/convo/getConvoForMembers.json @@ -0,0 +1,37 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.getConvoForMembers", + "defs": { + "main": { + "type": "query", + "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.sprk.convo.defs#convoView" + } + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/getLog.json b/lexicons/chat/sprk/convo/getLog.json new file mode 100644 index 0000000..a7df182 --- /dev/null +++ b/lexicons/chat/sprk/convo/getLog.json @@ -0,0 +1,44 @@ +{ + "lexicon": 1, + "id": "chat.sprk.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.sprk.convo.defs#logBeginConvo", + "chat.sprk.convo.defs#logAcceptConvo", + "chat.sprk.convo.defs#logLeaveConvo", + "chat.sprk.convo.defs#logMuteConvo", + "chat.sprk.convo.defs#logUnmuteConvo", + "chat.sprk.convo.defs#logCreateMessage", + "chat.sprk.convo.defs#logDeleteMessage", + "chat.sprk.convo.defs#logReadMessage", + "chat.sprk.convo.defs#logAddReaction", + "chat.sprk.convo.defs#logRemoveReaction" + ] + } + } + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/getMessages.json b/lexicons/chat/sprk/convo/getMessages.json new file mode 100644 index 0000000..9f4c8c4 --- /dev/null +++ b/lexicons/chat/sprk/convo/getMessages.json @@ -0,0 +1,43 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.getMessages", + "defs": { + "main": { + "type": "query", + "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.sprk.convo.defs#messageView", + "chat.sprk.convo.defs#deletedMessageView" + ] + } + } + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/leaveConvo.json b/lexicons/chat/sprk/convo/leaveConvo.json new file mode 100644 index 0000000..8967333 --- /dev/null +++ b/lexicons/chat/sprk/convo/leaveConvo.json @@ -0,0 +1,30 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.leaveConvo", + "defs": { + "main": { + "type": "procedure", + "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" } + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/listConvos.json b/lexicons/chat/sprk/convo/listConvos.json new file mode 100644 index 0000000..d57d369 --- /dev/null +++ b/lexicons/chat/sprk/convo/listConvos.json @@ -0,0 +1,46 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.listConvos", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 50 + }, + "cursor": { "type": "string" }, + "readState": { + "type": "string", + "knownValues": ["unread"] + }, + "status": { + "type": "string", + "knownValues": ["request", "accepted"] + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["convos"], + "properties": { + "cursor": { "type": "string" }, + "convos": { + "type": "array", + "items": { + "type": "ref", + "ref": "chat.sprk.convo.defs#convoView" + } + } + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/muteConvo.json b/lexicons/chat/sprk/convo/muteConvo.json new file mode 100644 index 0000000..75edd6a --- /dev/null +++ b/lexicons/chat/sprk/convo/muteConvo.json @@ -0,0 +1,32 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.muteConvo", + "defs": { + "main": { + "type": "procedure", + "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.sprk.convo.defs#convoView" + } + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/removeReaction.json b/lexicons/chat/sprk/convo/removeReaction.json new file mode 100644 index 0000000..a2b67d1 --- /dev/null +++ b/lexicons/chat/sprk/convo/removeReaction.json @@ -0,0 +1,51 @@ +{ + "lexicon": 1, + "id": "chat.sprk.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.sprk.convo.defs#messageView" + } + } + } + }, + "errors": [ + { + "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." + } + ] + } + } +} diff --git a/lexicons/chat/sprk/convo/sendMessage.json b/lexicons/chat/sprk/convo/sendMessage.json new file mode 100644 index 0000000..3745af9 --- /dev/null +++ b/lexicons/chat/sprk/convo/sendMessage.json @@ -0,0 +1,30 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.sendMessage", + "defs": { + "main": { + "type": "procedure", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["convoId", "message"], + "properties": { + "convoId": { "type": "string" }, + "message": { + "type": "ref", + "ref": "chat.sprk.convo.defs#messageInput" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "chat.sprk.convo.defs#messageView" + } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/sendMessageBatch.json b/lexicons/chat/sprk/convo/sendMessageBatch.json new file mode 100644 index 0000000..196bf6f --- /dev/null +++ b/lexicons/chat/sprk/convo/sendMessageBatch.json @@ -0,0 +1,53 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.sendMessageBatch", + "defs": { + "main": { + "type": "procedure", + "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.sprk.convo.defs#messageView" + } + } + } + } + } + }, + "batchItem": { + "type": "object", + "required": ["convoId", "message"], + "properties": { + "convoId": { "type": "string" }, + "message": { + "type": "ref", + "ref": "chat.sprk.convo.defs#messageInput" + } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/unmuteConvo.json b/lexicons/chat/sprk/convo/unmuteConvo.json new file mode 100644 index 0000000..7eb82f9 --- /dev/null +++ b/lexicons/chat/sprk/convo/unmuteConvo.json @@ -0,0 +1,32 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.unmuteConvo", + "defs": { + "main": { + "type": "procedure", + "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.sprk.convo.defs#convoView" + } + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/updateAllRead.json b/lexicons/chat/sprk/convo/updateAllRead.json new file mode 100644 index 0000000..7f808b3 --- /dev/null +++ b/lexicons/chat/sprk/convo/updateAllRead.json @@ -0,0 +1,34 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.updateAllRead", + "defs": { + "main": { + "type": "procedure", + "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" + } + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/convo/updateRead.json b/lexicons/chat/sprk/convo/updateRead.json new file mode 100644 index 0000000..c5f0c7b --- /dev/null +++ b/lexicons/chat/sprk/convo/updateRead.json @@ -0,0 +1,33 @@ +{ + "lexicon": 1, + "id": "chat.sprk.convo.updateRead", + "defs": { + "main": { + "type": "procedure", + "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.sprk.convo.defs#convoView" + } + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/moderation/getActorMetadata.json b/lexicons/chat/sprk/moderation/getActorMetadata.json new file mode 100644 index 0000000..68756d9 --- /dev/null +++ b/lexicons/chat/sprk/moderation/getActorMetadata.json @@ -0,0 +1,43 @@ +{ + "lexicon": 1, + "id": "chat.sprk.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" } + } + } + } +} diff --git a/lexicons/chat/sprk/moderation/getMessageContext.json b/lexicons/chat/sprk/moderation/getMessageContext.json new file mode 100644 index 0000000..c3d7c25 --- /dev/null +++ b/lexicons/chat/sprk/moderation/getMessageContext.json @@ -0,0 +1,41 @@ +{ + "lexicon": 1, + "id": "chat.sprk.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 }, + "after": { "type": "integer", "default": 5 } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["messages"], + "properties": { + "messages": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "chat.sprk.convo.defs#messageView", + "chat.sprk.convo.defs#deletedMessageView" + ] + } + } + } + } + } + } + } +} diff --git a/lexicons/chat/sprk/moderation/updateActorAccess.json b/lexicons/chat/sprk/moderation/updateActorAccess.json new file mode 100644 index 0000000..03abfa7 --- /dev/null +++ b/lexicons/chat/sprk/moderation/updateActorAccess.json @@ -0,0 +1,21 @@ +{ + "lexicon": 1, + "id": "chat.sprk.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" } + } + } + } + } + } +}