global update and global fix
This commit is contained in:
234
shared/proto/bot.proto
Normal file
234
shared/proto/bot.proto
Normal file
@@ -0,0 +1,234 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bot;
|
||||
|
||||
service BotService {
|
||||
rpc CreateBot (CreateBotRequest) returns (BotCredentialsResponse);
|
||||
rpc RevokeBotToken (RevokeBotTokenRequest) returns (BotCredentialsResponse);
|
||||
rpc SetBotWebApp (SetBotWebAppRequest) returns (BotResponse);
|
||||
rpc ListMyBots (ListMyBotsRequest) returns (ListBotsResponse);
|
||||
rpc GetBot (GetBotRequest) returns (BotResponse);
|
||||
rpc UpdateBot (UpdateBotRequest) returns (BotResponse);
|
||||
rpc UpdateBotProfile (UpdateBotProfileRequest) returns (BotResponse);
|
||||
rpc DeleteBot (DeleteBotRequest) returns (MutationResponse);
|
||||
rpc ListAllBots (ListAllBotsRequest) returns (ListBotsResponse);
|
||||
rpc SetBotActive (SetBotActiveRequest) returns (BotResponse);
|
||||
rpc GetBotMetrics (GetBotMetricsRequest) returns (BotMetricsResponse);
|
||||
rpc ValidateBotToken (ValidateBotTokenRequest) returns (ValidatedBotResponse);
|
||||
rpc ExecuteBotMethod (ExecuteBotMethodRequest) returns (ExecuteBotMethodResponse);
|
||||
rpc ValidateWebAppInitData (ValidateWebAppInitDataRequest) returns (ValidateWebAppInitDataResponse);
|
||||
rpc SubmitBotInboundMessage (SubmitBotInboundMessageRequest) returns (SubmitBotInboundMessageResponse);
|
||||
rpc SubmitBotCallbackQuery (SubmitBotCallbackQueryRequest) returns (SubmitBotCallbackQueryResponse);
|
||||
rpc ListBotChatMessages (ListBotChatMessagesRequest) returns (ListBotChatMessagesResponse);
|
||||
}
|
||||
|
||||
message CreateBotRequest {
|
||||
string ownerId = 1;
|
||||
string name = 2;
|
||||
string username = 3;
|
||||
}
|
||||
|
||||
message RevokeBotTokenRequest {
|
||||
string requesterId = 1;
|
||||
string botId = 2;
|
||||
bool isSuperAdmin = 3;
|
||||
}
|
||||
|
||||
message SetBotWebAppRequest {
|
||||
string requesterId = 1;
|
||||
string botId = 2;
|
||||
optional string webAppUrl = 3;
|
||||
bool isSuperAdmin = 4;
|
||||
}
|
||||
|
||||
message ListMyBotsRequest {
|
||||
string ownerId = 1;
|
||||
}
|
||||
|
||||
message GetBotRequest {
|
||||
string requesterId = 1;
|
||||
string botId = 2;
|
||||
bool isSuperAdmin = 3;
|
||||
}
|
||||
|
||||
message UpdateBotRequest {
|
||||
string requesterId = 1;
|
||||
string botId = 2;
|
||||
optional string name = 3;
|
||||
optional string username = 4;
|
||||
bool isSuperAdmin = 5;
|
||||
}
|
||||
|
||||
message UpdateBotProfileRequest {
|
||||
string requesterId = 1;
|
||||
string botId = 2;
|
||||
optional string description = 3;
|
||||
optional string aboutText = 4;
|
||||
optional string botPicUrl = 5;
|
||||
optional string menuButtonJson = 6;
|
||||
optional string menuButtonUrl = 7;
|
||||
optional string menuButtonText = 8;
|
||||
bool isSuperAdmin = 9;
|
||||
}
|
||||
|
||||
message DeleteBotRequest {
|
||||
string requesterId = 1;
|
||||
string botId = 2;
|
||||
bool isSuperAdmin = 3;
|
||||
}
|
||||
|
||||
message ListAllBotsRequest {
|
||||
string requesterId = 1;
|
||||
bool isSuperAdmin = 2;
|
||||
optional string search = 3;
|
||||
int32 page = 4;
|
||||
int32 limit = 5;
|
||||
}
|
||||
|
||||
message SetBotActiveRequest {
|
||||
string requesterId = 1;
|
||||
string botId = 2;
|
||||
bool isActive = 3;
|
||||
bool isSuperAdmin = 4;
|
||||
}
|
||||
|
||||
message GetBotMetricsRequest {
|
||||
string requesterId = 1;
|
||||
bool isSuperAdmin = 2;
|
||||
}
|
||||
|
||||
message ValidateBotTokenRequest {
|
||||
string token = 1;
|
||||
}
|
||||
|
||||
message ExecuteBotMethodRequest {
|
||||
string token = 1;
|
||||
string method = 2;
|
||||
string payloadJson = 3;
|
||||
}
|
||||
|
||||
message ValidateWebAppInitDataRequest {
|
||||
string initData = 1;
|
||||
string botToken = 2;
|
||||
}
|
||||
|
||||
message BotOwnerResponse {
|
||||
string id = 1;
|
||||
string displayName = 2;
|
||||
optional string username = 3;
|
||||
}
|
||||
|
||||
message BotResponse {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string username = 3;
|
||||
string tokenPrefix = 4;
|
||||
string ownerId = 5;
|
||||
optional string webAppUrl = 6;
|
||||
bool isActive = 7;
|
||||
bool isSystemBot = 8;
|
||||
string createdAt = 9;
|
||||
string updatedAt = 10;
|
||||
optional BotOwnerResponse owner = 11;
|
||||
int32 messageCount = 12;
|
||||
int32 chatCount = 13;
|
||||
optional string description = 14;
|
||||
optional string aboutText = 15;
|
||||
optional string botPicUrl = 16;
|
||||
optional string menuButtonJson = 17;
|
||||
}
|
||||
|
||||
message BotCredentialsResponse {
|
||||
BotResponse bot = 1;
|
||||
string token = 2;
|
||||
}
|
||||
|
||||
message ListBotsResponse {
|
||||
repeated BotResponse bots = 1;
|
||||
int32 total = 2;
|
||||
}
|
||||
|
||||
message BotMetricsResponse {
|
||||
int32 totalBots = 1;
|
||||
int32 activeBots = 2;
|
||||
int32 blockedBots = 3;
|
||||
int32 totalMessages = 4;
|
||||
int32 totalChats = 5;
|
||||
}
|
||||
|
||||
message ValidatedBotResponse {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string username = 3;
|
||||
string ownerId = 4;
|
||||
optional string webAppUrl = 5;
|
||||
bool isActive = 6;
|
||||
bool isSystemBot = 7;
|
||||
}
|
||||
|
||||
message ExecuteBotMethodResponse {
|
||||
string responseJson = 1;
|
||||
int32 httpStatus = 2;
|
||||
}
|
||||
|
||||
message ValidateWebAppInitDataResponse {
|
||||
bool valid = 1;
|
||||
optional string userJson = 2;
|
||||
optional string authDate = 3;
|
||||
optional string error = 4;
|
||||
}
|
||||
|
||||
message MutationResponse {
|
||||
int32 count = 1;
|
||||
}
|
||||
|
||||
message SubmitBotInboundMessageRequest {
|
||||
string senderUserId = 1;
|
||||
string botRef = 2;
|
||||
string text = 3;
|
||||
}
|
||||
|
||||
message SubmitBotInboundMessageResponse {
|
||||
int32 updateId = 1;
|
||||
int32 messageId = 2;
|
||||
string chatId = 3;
|
||||
}
|
||||
|
||||
message SubmitBotCallbackQueryRequest {
|
||||
string senderUserId = 1;
|
||||
string botRef = 2;
|
||||
int32 messageId = 3;
|
||||
string callbackData = 4;
|
||||
}
|
||||
|
||||
message SubmitBotCallbackQueryResponse {
|
||||
int32 updateId = 1;
|
||||
string callbackQueryId = 2;
|
||||
int32 messageId = 3;
|
||||
}
|
||||
|
||||
message ListBotChatMessagesRequest {
|
||||
string userId = 1;
|
||||
string botRef = 2;
|
||||
}
|
||||
|
||||
message BotChatMessageItem {
|
||||
string id = 1;
|
||||
string direction = 2;
|
||||
string text = 3;
|
||||
string messageType = 4;
|
||||
int32 messageId = 5;
|
||||
string createdAt = 6;
|
||||
optional string replyMarkupJson = 7;
|
||||
}
|
||||
|
||||
message ListBotChatMessagesResponse {
|
||||
repeated BotChatMessageItem messages = 1;
|
||||
string botUsername = 2;
|
||||
string botDisplayName = 3;
|
||||
optional string composerWebAppUrl = 4;
|
||||
optional string botId = 5;
|
||||
optional string botOwnerId = 6;
|
||||
optional string manageWebAppUrl = 7;
|
||||
optional string composerMenuButtonJson = 8;
|
||||
}
|
||||
@@ -5,6 +5,7 @@ package chat;
|
||||
service ChatService {
|
||||
rpc ListRooms (ListRoomsRequest) returns (ListRoomsResponse);
|
||||
rpc CreateRoom (CreateRoomRequest) returns (ChatRoomResponse);
|
||||
rpc CreateE2ERoom (CreateE2ERoomRequest) returns (ChatRoomResponse);
|
||||
rpc UpdateRoomSettings (UpdateRoomSettingsRequest) returns (ChatRoomResponse);
|
||||
rpc AddRoomMember (AddRoomMemberRequest) returns (ChatRoomResponse);
|
||||
rpc RemoveRoomMember (RemoveRoomMemberRequest) returns (ChatRoomResponse);
|
||||
@@ -15,6 +16,10 @@ service ChatService {
|
||||
rpc MarkRoomRead (MarkRoomReadRequest) returns (MutationResponse);
|
||||
rpc VotePoll (VotePollRequest) returns (ChatMessageResponse);
|
||||
rpc SetRoomNotificationsMuted (SetRoomNotificationsMutedRequest) returns (MutationResponse);
|
||||
rpc DeleteRoom (DeleteRoomRequest) returns (MutationResponse);
|
||||
rpc ToggleMessageReaction (ToggleMessageReactionRequest) returns (ChatMessageResponse);
|
||||
rpc ForwardMessages (ForwardMessagesRequest) returns (ForwardMessagesResponse);
|
||||
rpc ReportTyping (ReportTypingRequest) returns (MutationResponse);
|
||||
}
|
||||
|
||||
message ListRoomsRequest {
|
||||
@@ -29,6 +34,12 @@ message CreateRoomRequest {
|
||||
repeated string memberUserIds = 4;
|
||||
}
|
||||
|
||||
message CreateE2ERoomRequest {
|
||||
string userId = 1;
|
||||
string groupId = 2;
|
||||
string peerUserId = 3;
|
||||
}
|
||||
|
||||
message UpdateRoomSettingsRequest {
|
||||
string userId = 1;
|
||||
string roomId = 2;
|
||||
@@ -65,6 +76,7 @@ message SendMessageRequest {
|
||||
optional string mimeType = 7;
|
||||
optional string metadataJson = 8;
|
||||
optional PollPayload poll = 9;
|
||||
optional bool isEncrypted = 10;
|
||||
}
|
||||
|
||||
message EditMessageRequest {
|
||||
@@ -103,6 +115,32 @@ message SetRoomNotificationsMutedRequest {
|
||||
bool muted = 3;
|
||||
}
|
||||
|
||||
message DeleteRoomRequest {
|
||||
string userId = 1;
|
||||
string roomId = 2;
|
||||
}
|
||||
|
||||
message ToggleMessageReactionRequest {
|
||||
string userId = 1;
|
||||
string messageId = 2;
|
||||
string emoji = 3;
|
||||
}
|
||||
|
||||
message ForwardMessagesRequest {
|
||||
string userId = 1;
|
||||
string targetRoomId = 2;
|
||||
repeated string messageIds = 3;
|
||||
}
|
||||
|
||||
message ReportTypingRequest {
|
||||
string userId = 1;
|
||||
string roomId = 2;
|
||||
}
|
||||
|
||||
message ForwardMessagesResponse {
|
||||
repeated ChatMessageResponse messages = 1;
|
||||
}
|
||||
|
||||
message ChatRoomMemberResponse {
|
||||
string id = 1;
|
||||
string userId = 2;
|
||||
@@ -123,6 +161,9 @@ message ChatRoomResponse {
|
||||
repeated ChatRoomMemberResponse members = 7;
|
||||
optional ChatMessageResponse lastMessage = 8;
|
||||
optional string createdById = 9;
|
||||
optional string peerUserId = 10;
|
||||
optional string botUsername = 11;
|
||||
optional bool isE2E = 12;
|
||||
}
|
||||
|
||||
message PollOptionResponse {
|
||||
@@ -160,6 +201,14 @@ message ChatMessageResponse {
|
||||
optional string editedAt = 14;
|
||||
bool isDeleted = 15;
|
||||
optional bool readByAll = 16;
|
||||
optional bool isEncrypted = 19;
|
||||
repeated MessageReactionResponse reactions = 20;
|
||||
}
|
||||
|
||||
message MessageReactionResponse {
|
||||
string emoji = 1;
|
||||
int32 count = 2;
|
||||
bool reactedByMe = 3;
|
||||
}
|
||||
|
||||
message ListRoomsResponse {
|
||||
|
||||
@@ -34,6 +34,8 @@ service FamilyService {
|
||||
rpc RespondFamilyInvite (RespondFamilyInviteRequest) returns (FamilyInviteResponse);
|
||||
rpc ListFamilyInvites (ListFamilyInvitesRequest) returns (ListFamilyInvitesResponse);
|
||||
rpc GetFamilyPresence (GetFamilyGroupRequest) returns (FamilyPresenceResponse);
|
||||
rpc AddBotFatherToFamily (GetFamilyGroupRequest) returns (FamilyMemberResponse);
|
||||
rpc AddBotToFamily (AddBotToFamilyRequest) returns (FamilyMemberResponse);
|
||||
}
|
||||
|
||||
message AuthorizeRequest {
|
||||
@@ -195,6 +197,16 @@ message FamilyInviteUserCandidate {
|
||||
optional string phone = 4;
|
||||
optional string username = 5;
|
||||
bool hasAvatar = 6;
|
||||
bool isBot = 7;
|
||||
optional string botUsername = 8;
|
||||
optional string botId = 9;
|
||||
optional string ownerDisplayName = 10;
|
||||
}
|
||||
|
||||
message AddBotToFamilyRequest {
|
||||
string requesterId = 1;
|
||||
string groupId = 2;
|
||||
string botId = 3;
|
||||
}
|
||||
|
||||
message SearchFamilyInviteUsersResponse {
|
||||
@@ -254,6 +266,8 @@ message FamilyMemberResponse {
|
||||
string createdAt = 7;
|
||||
bool isVerified = 8;
|
||||
optional string verificationIcon = 9;
|
||||
bool isBot = 10;
|
||||
optional string botUsername = 11;
|
||||
}
|
||||
|
||||
message FamilyGroupResponse {
|
||||
@@ -264,6 +278,7 @@ message FamilyGroupResponse {
|
||||
string createdAt = 5;
|
||||
string updatedAt = 6;
|
||||
repeated FamilyMemberResponse members = 7;
|
||||
bool botFatherAvailable = 8;
|
||||
}
|
||||
|
||||
message ListFamilyGroupsResponse {
|
||||
|
||||
@@ -15,6 +15,8 @@ service ProfileService {
|
||||
rpc RequestAccountDeletion (UserProfileRequest) returns (AccountDeletionResponse);
|
||||
rpc CancelAccountDeletion (UserProfileRequest) returns (AccountDeletionCancelResponse);
|
||||
rpc GetAccountDeletionStatus (UserProfileRequest) returns (AccountDeletionStatusResponse);
|
||||
rpc SetE2EPublicKey (SetE2EPublicKeyRequest) returns (E2EPublicKeyResponse);
|
||||
rpc GetE2EPublicKey (UserProfileRequest) returns (E2EPublicKeyResponse);
|
||||
}
|
||||
|
||||
message SetPasswordRequest {
|
||||
@@ -99,6 +101,17 @@ message ProfileResponse {
|
||||
optional string birthDate = 15;
|
||||
bool hasPassword = 16;
|
||||
optional string deletionRequestedAt = 17;
|
||||
optional string e2ePublicKey = 18;
|
||||
}
|
||||
|
||||
message SetE2EPublicKeyRequest {
|
||||
string userId = 1;
|
||||
string publicKey = 2;
|
||||
}
|
||||
|
||||
message E2EPublicKeyResponse {
|
||||
string userId = 1;
|
||||
optional string e2ePublicKey = 2;
|
||||
}
|
||||
|
||||
message AccountDeletionResponse {
|
||||
|
||||
Reference in New Issue
Block a user