first commit
This commit is contained in:
133
shared/proto/chat.proto
Normal file
133
shared/proto/chat.proto
Normal file
@@ -0,0 +1,133 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package chat;
|
||||
|
||||
service ChatService {
|
||||
rpc ListRooms (ListRoomsRequest) returns (ListRoomsResponse);
|
||||
rpc CreateRoom (CreateRoomRequest) returns (ChatRoomResponse);
|
||||
rpc UpdateRoomSettings (UpdateRoomSettingsRequest) returns (ChatRoomResponse);
|
||||
rpc ListMessages (ListMessagesRequest) returns (ListMessagesResponse);
|
||||
rpc SendMessage (SendMessageRequest) returns (ChatMessageResponse);
|
||||
rpc VotePoll (VotePollRequest) returns (ChatMessageResponse);
|
||||
rpc SetRoomNotificationsMuted (SetRoomNotificationsMutedRequest) returns (MutationResponse);
|
||||
}
|
||||
|
||||
message ListRoomsRequest {
|
||||
string userId = 1;
|
||||
string groupId = 2;
|
||||
}
|
||||
|
||||
message CreateRoomRequest {
|
||||
string userId = 1;
|
||||
string groupId = 2;
|
||||
string name = 3;
|
||||
repeated string memberUserIds = 4;
|
||||
}
|
||||
|
||||
message UpdateRoomSettingsRequest {
|
||||
string userId = 1;
|
||||
string roomId = 2;
|
||||
optional string name = 3;
|
||||
optional bool notificationsMuted = 4;
|
||||
}
|
||||
|
||||
message ListMessagesRequest {
|
||||
string userId = 1;
|
||||
string roomId = 2;
|
||||
optional string beforeMessageId = 3;
|
||||
int32 limit = 4;
|
||||
}
|
||||
|
||||
message SendMessageRequest {
|
||||
string userId = 1;
|
||||
string roomId = 2;
|
||||
string type = 3;
|
||||
optional string content = 4;
|
||||
optional string replyToId = 5;
|
||||
optional string storageKey = 6;
|
||||
optional string mimeType = 7;
|
||||
optional string metadataJson = 8;
|
||||
optional PollPayload poll = 9;
|
||||
}
|
||||
|
||||
message PollPayload {
|
||||
string question = 1;
|
||||
repeated string options = 2;
|
||||
bool allowsMultiple = 3;
|
||||
bool isAnonymous = 4;
|
||||
}
|
||||
|
||||
message VotePollRequest {
|
||||
string userId = 1;
|
||||
string messageId = 2;
|
||||
repeated string optionIds = 3;
|
||||
}
|
||||
|
||||
message SetRoomNotificationsMutedRequest {
|
||||
string userId = 1;
|
||||
string roomId = 2;
|
||||
bool muted = 3;
|
||||
}
|
||||
|
||||
message ChatRoomMemberResponse {
|
||||
string id = 1;
|
||||
string userId = 2;
|
||||
string displayName = 3;
|
||||
bool hasAvatar = 4;
|
||||
bool notificationsMuted = 5;
|
||||
}
|
||||
|
||||
message ChatRoomResponse {
|
||||
string id = 1;
|
||||
string groupId = 2;
|
||||
string type = 3;
|
||||
string name = 4;
|
||||
bool hasAvatar = 5;
|
||||
string updatedAt = 6;
|
||||
repeated ChatRoomMemberResponse members = 7;
|
||||
optional ChatMessageResponse lastMessage = 8;
|
||||
}
|
||||
|
||||
message PollOptionResponse {
|
||||
string id = 1;
|
||||
string text = 2;
|
||||
int32 voteCount = 3;
|
||||
bool votedByMe = 4;
|
||||
}
|
||||
|
||||
message PollResponse {
|
||||
string id = 1;
|
||||
string question = 2;
|
||||
bool allowsMultiple = 3;
|
||||
bool isAnonymous = 4;
|
||||
optional string closedAt = 5;
|
||||
repeated PollOptionResponse options = 6;
|
||||
}
|
||||
|
||||
message ChatMessageResponse {
|
||||
string id = 1;
|
||||
string roomId = 2;
|
||||
string senderId = 3;
|
||||
string senderName = 4;
|
||||
bool senderHasAvatar = 5;
|
||||
string type = 6;
|
||||
optional string content = 7;
|
||||
optional string replyToId = 8;
|
||||
optional string storageKey = 9;
|
||||
optional string mimeType = 10;
|
||||
optional string metadataJson = 11;
|
||||
string createdAt = 12;
|
||||
optional PollResponse poll = 13;
|
||||
}
|
||||
|
||||
message ListRoomsResponse {
|
||||
repeated ChatRoomResponse rooms = 1;
|
||||
}
|
||||
|
||||
message ListMessagesResponse {
|
||||
repeated ChatMessageResponse messages = 1;
|
||||
}
|
||||
|
||||
message MutationResponse {
|
||||
int32 count = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user