From b7f219d499693070f7d546add714d8bdc0cd9466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Fri, 17 Apr 2026 17:48:47 +0300 Subject: [PATCH] feat: add methods for chats --- package.json | 2 +- proto/users/users.proto | 63 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 928337d..19d8b44 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lendry-erp/contracts", - "version": "1.2.24", + "version": "1.2.25", "description": "Protobuf definitions and generated TypeScript types", "type": "commonjs", "main": "./dist/index.js", diff --git a/proto/users/users.proto b/proto/users/users.proto index 702ea2d..ae099a4 100644 --- a/proto/users/users.proto +++ b/proto/users/users.proto @@ -10,6 +10,30 @@ service UsersService { // Для системного использования (вызывается из Auth/Admin) rpc CreateProfile (CreateProfileRequest) returns (CreateProfileResponse); rpc SoftDeleteProfile(SoftDeleteProfileRequest) returns (SoftDeleteProfileResponse); + + // --- НОВЫЕ МЕТОДЫ МЕССЕНДЖЕРА --- + rpc BlockUser (BlockUserRequest) returns (BlockUserResponse); + rpc UnblockUser (UnblockUserRequest) returns (UnblockUserResponse); + rpc GetBlockedUsers (GetBlockedUsersRequest) returns (GetBlockedUsersResponse); + rpc AddContact (AddContactRequest) returns (AddContactResponse); + rpc GetContacts (GetContactsRequest) returns (GetContactsResponse); +} + +message UserSettingsMessage { + string privacy_phone = 1; + string privacy_last_seen = 2; + string privacy_photo = 3; + string privacy_bio = 4; + string privacy_calls = 5; + string privacy_groups = 6; + string privacy_voice_msgs = 7; + bool notify_private_chats = 8; + bool notify_groups = 9; + bool notify_channels = 10; + bool show_message_preview = 11; + string theme = 12; + int32 text_size = 13; + optional string chat_background = 14; } message GetProfileRequest { @@ -27,6 +51,7 @@ message GetProfileResponse { string language = 8; optional string custom_status_text = 9; optional string custom_status_emoji = 10; + optional UserSettingsMessage settings = 11; } message UpdateProfileRequest { @@ -40,6 +65,7 @@ message UpdateProfileRequest { optional string timezone = 8; optional string language = 9; optional bool is_public = 10; + optional UserSettingsMessage settings = 11; } message UpdateProfileResponse { @@ -66,4 +92,41 @@ message SoftDeleteProfileRequest { message SoftDeleteProfileResponse { bool success = 1; +} + +message ContactItem { + string contact_id = 1; + optional string alias = 2; +} +message AddContactRequest { + string user_id = 1; + string contact_id = 2; + optional string alias = 3; +} +message AddContactResponse { bool success = 1; } +message GetContactsRequest { + string user_id = 1; +} +message GetContactsResponse { + repeated ContactItem contacts = 1; +} +message BlockedUserItem { + string blocked_id = 1; + string blocked_at = 2; +} +message BlockUserRequest { + string blocker_id = 1; + string blocked_id = 2; +} +message BlockUserResponse { bool success = 1; } +message UnblockUserRequest { + string blocker_id = 1; + string blocked_id = 2; +} +message UnblockUserResponse { bool success = 1; } +message GetBlockedUsersRequest { + string blocker_id = 1; +} +message GetBlockedUsersResponse { + repeated BlockedUserItem blocked_users = 1; } \ No newline at end of file