chore: auto-generate protobuf files [skip ci]

This commit is contained in:
github-actions[bot]
2026-04-17 14:51:16 +00:00
parent b7f219d499
commit b53603bc86
3 changed files with 1211 additions and 58 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -23,6 +23,11 @@ const (
UsersService_UpdateProfile_FullMethodName = "/users.v1.UsersService/UpdateProfile" UsersService_UpdateProfile_FullMethodName = "/users.v1.UsersService/UpdateProfile"
UsersService_CreateProfile_FullMethodName = "/users.v1.UsersService/CreateProfile" UsersService_CreateProfile_FullMethodName = "/users.v1.UsersService/CreateProfile"
UsersService_SoftDeleteProfile_FullMethodName = "/users.v1.UsersService/SoftDeleteProfile" UsersService_SoftDeleteProfile_FullMethodName = "/users.v1.UsersService/SoftDeleteProfile"
UsersService_BlockUser_FullMethodName = "/users.v1.UsersService/BlockUser"
UsersService_UnblockUser_FullMethodName = "/users.v1.UsersService/UnblockUser"
UsersService_GetBlockedUsers_FullMethodName = "/users.v1.UsersService/GetBlockedUsers"
UsersService_AddContact_FullMethodName = "/users.v1.UsersService/AddContact"
UsersService_GetContacts_FullMethodName = "/users.v1.UsersService/GetContacts"
) )
// UsersServiceClient is the client API for UsersService service. // UsersServiceClient is the client API for UsersService service.
@@ -34,6 +39,12 @@ type UsersServiceClient interface {
// Для системного использования (вызывается из Auth/Admin) // Для системного использования (вызывается из Auth/Admin)
CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc.CallOption) (*CreateProfileResponse, error) CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc.CallOption) (*CreateProfileResponse, error)
SoftDeleteProfile(ctx context.Context, in *SoftDeleteProfileRequest, opts ...grpc.CallOption) (*SoftDeleteProfileResponse, error) SoftDeleteProfile(ctx context.Context, in *SoftDeleteProfileRequest, opts ...grpc.CallOption) (*SoftDeleteProfileResponse, error)
// --- НОВЫЕ МЕТОДЫ МЕССЕНДЖЕРА ---
BlockUser(ctx context.Context, in *BlockUserRequest, opts ...grpc.CallOption) (*BlockUserResponse, error)
UnblockUser(ctx context.Context, in *UnblockUserRequest, opts ...grpc.CallOption) (*UnblockUserResponse, error)
GetBlockedUsers(ctx context.Context, in *GetBlockedUsersRequest, opts ...grpc.CallOption) (*GetBlockedUsersResponse, error)
AddContact(ctx context.Context, in *AddContactRequest, opts ...grpc.CallOption) (*AddContactResponse, error)
GetContacts(ctx context.Context, in *GetContactsRequest, opts ...grpc.CallOption) (*GetContactsResponse, error)
} }
type usersServiceClient struct { type usersServiceClient struct {
@@ -84,6 +95,56 @@ func (c *usersServiceClient) SoftDeleteProfile(ctx context.Context, in *SoftDele
return out, nil return out, nil
} }
func (c *usersServiceClient) BlockUser(ctx context.Context, in *BlockUserRequest, opts ...grpc.CallOption) (*BlockUserResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(BlockUserResponse)
err := c.cc.Invoke(ctx, UsersService_BlockUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *usersServiceClient) UnblockUser(ctx context.Context, in *UnblockUserRequest, opts ...grpc.CallOption) (*UnblockUserResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UnblockUserResponse)
err := c.cc.Invoke(ctx, UsersService_UnblockUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *usersServiceClient) GetBlockedUsers(ctx context.Context, in *GetBlockedUsersRequest, opts ...grpc.CallOption) (*GetBlockedUsersResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetBlockedUsersResponse)
err := c.cc.Invoke(ctx, UsersService_GetBlockedUsers_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *usersServiceClient) AddContact(ctx context.Context, in *AddContactRequest, opts ...grpc.CallOption) (*AddContactResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AddContactResponse)
err := c.cc.Invoke(ctx, UsersService_AddContact_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *usersServiceClient) GetContacts(ctx context.Context, in *GetContactsRequest, opts ...grpc.CallOption) (*GetContactsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetContactsResponse)
err := c.cc.Invoke(ctx, UsersService_GetContacts_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// UsersServiceServer is the server API for UsersService service. // UsersServiceServer is the server API for UsersService service.
// All implementations must embed UnimplementedUsersServiceServer // All implementations must embed UnimplementedUsersServiceServer
// for forward compatibility. // for forward compatibility.
@@ -93,6 +154,12 @@ type UsersServiceServer interface {
// Для системного использования (вызывается из Auth/Admin) // Для системного использования (вызывается из Auth/Admin)
CreateProfile(context.Context, *CreateProfileRequest) (*CreateProfileResponse, error) CreateProfile(context.Context, *CreateProfileRequest) (*CreateProfileResponse, error)
SoftDeleteProfile(context.Context, *SoftDeleteProfileRequest) (*SoftDeleteProfileResponse, error) SoftDeleteProfile(context.Context, *SoftDeleteProfileRequest) (*SoftDeleteProfileResponse, error)
// --- НОВЫЕ МЕТОДЫ МЕССЕНДЖЕРА ---
BlockUser(context.Context, *BlockUserRequest) (*BlockUserResponse, error)
UnblockUser(context.Context, *UnblockUserRequest) (*UnblockUserResponse, error)
GetBlockedUsers(context.Context, *GetBlockedUsersRequest) (*GetBlockedUsersResponse, error)
AddContact(context.Context, *AddContactRequest) (*AddContactResponse, error)
GetContacts(context.Context, *GetContactsRequest) (*GetContactsResponse, error)
mustEmbedUnimplementedUsersServiceServer() mustEmbedUnimplementedUsersServiceServer()
} }
@@ -115,6 +182,21 @@ func (UnimplementedUsersServiceServer) CreateProfile(context.Context, *CreatePro
func (UnimplementedUsersServiceServer) SoftDeleteProfile(context.Context, *SoftDeleteProfileRequest) (*SoftDeleteProfileResponse, error) { func (UnimplementedUsersServiceServer) SoftDeleteProfile(context.Context, *SoftDeleteProfileRequest) (*SoftDeleteProfileResponse, error) {
return nil, status.Error(codes.Unimplemented, "method SoftDeleteProfile not implemented") return nil, status.Error(codes.Unimplemented, "method SoftDeleteProfile not implemented")
} }
func (UnimplementedUsersServiceServer) BlockUser(context.Context, *BlockUserRequest) (*BlockUserResponse, error) {
return nil, status.Error(codes.Unimplemented, "method BlockUser not implemented")
}
func (UnimplementedUsersServiceServer) UnblockUser(context.Context, *UnblockUserRequest) (*UnblockUserResponse, error) {
return nil, status.Error(codes.Unimplemented, "method UnblockUser not implemented")
}
func (UnimplementedUsersServiceServer) GetBlockedUsers(context.Context, *GetBlockedUsersRequest) (*GetBlockedUsersResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetBlockedUsers not implemented")
}
func (UnimplementedUsersServiceServer) AddContact(context.Context, *AddContactRequest) (*AddContactResponse, error) {
return nil, status.Error(codes.Unimplemented, "method AddContact not implemented")
}
func (UnimplementedUsersServiceServer) GetContacts(context.Context, *GetContactsRequest) (*GetContactsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method GetContacts not implemented")
}
func (UnimplementedUsersServiceServer) mustEmbedUnimplementedUsersServiceServer() {} func (UnimplementedUsersServiceServer) mustEmbedUnimplementedUsersServiceServer() {}
func (UnimplementedUsersServiceServer) testEmbeddedByValue() {} func (UnimplementedUsersServiceServer) testEmbeddedByValue() {}
@@ -208,6 +290,96 @@ func _UsersService_SoftDeleteProfile_Handler(srv interface{}, ctx context.Contex
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _UsersService_BlockUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BlockUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UsersServiceServer).BlockUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UsersService_BlockUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServiceServer).BlockUser(ctx, req.(*BlockUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UsersService_UnblockUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UnblockUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UsersServiceServer).UnblockUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UsersService_UnblockUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServiceServer).UnblockUser(ctx, req.(*UnblockUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UsersService_GetBlockedUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetBlockedUsersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UsersServiceServer).GetBlockedUsers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UsersService_GetBlockedUsers_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServiceServer).GetBlockedUsers(ctx, req.(*GetBlockedUsersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UsersService_AddContact_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AddContactRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UsersServiceServer).AddContact(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UsersService_AddContact_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServiceServer).AddContact(ctx, req.(*AddContactRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UsersService_GetContacts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetContactsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UsersServiceServer).GetContacts(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UsersService_GetContacts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UsersServiceServer).GetContacts(ctx, req.(*GetContactsRequest))
}
return interceptor(ctx, in, info, handler)
}
// UsersService_ServiceDesc is the grpc.ServiceDesc for UsersService service. // UsersService_ServiceDesc is the grpc.ServiceDesc for UsersService service.
// It's only intended for direct use with grpc.RegisterService, // It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy) // and not to be introspected or modified (even as a copy)
@@ -231,6 +403,26 @@ var UsersService_ServiceDesc = grpc.ServiceDesc{
MethodName: "SoftDeleteProfile", MethodName: "SoftDeleteProfile",
Handler: _UsersService_SoftDeleteProfile_Handler, Handler: _UsersService_SoftDeleteProfile_Handler,
}, },
{
MethodName: "BlockUser",
Handler: _UsersService_BlockUser_Handler,
},
{
MethodName: "UnblockUser",
Handler: _UsersService_UnblockUser_Handler,
},
{
MethodName: "GetBlockedUsers",
Handler: _UsersService_GetBlockedUsers_Handler,
},
{
MethodName: "AddContact",
Handler: _UsersService_AddContact_Handler,
},
{
MethodName: "GetContacts",
Handler: _UsersService_GetContacts_Handler,
},
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "users/users.proto", Metadata: "users/users.proto",

View File

@@ -11,6 +11,23 @@ import { Observable } from "rxjs";
export const protobufPackage = "users.v1"; export const protobufPackage = "users.v1";
export interface UserSettingsMessage {
privacyPhone: string;
privacyLastSeen: string;
privacyPhoto: string;
privacyBio: string;
privacyCalls: string;
privacyGroups: string;
privacyVoiceMsgs: string;
notifyPrivateChats: boolean;
notifyGroups: boolean;
notifyChannels: boolean;
showMessagePreview: boolean;
theme: string;
textSize: number;
chatBackground?: string | undefined;
}
export interface GetProfileRequest { export interface GetProfileRequest {
/** Берется из access токена на API шлюзе */ /** Берется из access токена на API шлюзе */
userId: string; userId: string;
@@ -27,6 +44,7 @@ export interface GetProfileResponse {
language: string; language: string;
customStatusText?: string | undefined; customStatusText?: string | undefined;
customStatusEmoji?: string | undefined; customStatusEmoji?: string | undefined;
settings?: UserSettingsMessage | undefined;
} }
export interface UpdateProfileRequest { export interface UpdateProfileRequest {
@@ -40,6 +58,7 @@ export interface UpdateProfileRequest {
timezone?: string | undefined; timezone?: string | undefined;
language?: string | undefined; language?: string | undefined;
isPublic?: boolean | undefined; isPublic?: boolean | undefined;
settings?: UserSettingsMessage | undefined;
} }
export interface UpdateProfileResponse { export interface UpdateProfileResponse {
@@ -69,6 +88,60 @@ export interface SoftDeleteProfileResponse {
success: boolean; success: boolean;
} }
export interface ContactItem {
contactId: string;
alias?: string | undefined;
}
export interface AddContactRequest {
userId: string;
contactId: string;
alias?: string | undefined;
}
export interface AddContactResponse {
success: boolean;
}
export interface GetContactsRequest {
userId: string;
}
export interface GetContactsResponse {
contacts: ContactItem[];
}
export interface BlockedUserItem {
blockedId: string;
blockedAt: string;
}
export interface BlockUserRequest {
blockerId: string;
blockedId: string;
}
export interface BlockUserResponse {
success: boolean;
}
export interface UnblockUserRequest {
blockerId: string;
blockedId: string;
}
export interface UnblockUserResponse {
success: boolean;
}
export interface GetBlockedUsersRequest {
blockerId: string;
}
export interface GetBlockedUsersResponse {
blockedUsers: BlockedUserItem[];
}
export const USERS_V1_PACKAGE_NAME = "users.v1"; export const USERS_V1_PACKAGE_NAME = "users.v1";
export interface UsersServiceClient { export interface UsersServiceClient {
@@ -81,6 +154,18 @@ export interface UsersServiceClient {
createProfile(request: CreateProfileRequest, metadata?: Metadata): Observable<CreateProfileResponse>; createProfile(request: CreateProfileRequest, metadata?: Metadata): Observable<CreateProfileResponse>;
softDeleteProfile(request: SoftDeleteProfileRequest, metadata?: Metadata): Observable<SoftDeleteProfileResponse>; softDeleteProfile(request: SoftDeleteProfileRequest, metadata?: Metadata): Observable<SoftDeleteProfileResponse>;
/** --- НОВЫЕ МЕТОДЫ МЕССЕНДЖЕРА --- */
blockUser(request: BlockUserRequest, metadata?: Metadata): Observable<BlockUserResponse>;
unblockUser(request: UnblockUserRequest, metadata?: Metadata): Observable<UnblockUserResponse>;
getBlockedUsers(request: GetBlockedUsersRequest, metadata?: Metadata): Observable<GetBlockedUsersResponse>;
addContact(request: AddContactRequest, metadata?: Metadata): Observable<AddContactResponse>;
getContacts(request: GetContactsRequest, metadata?: Metadata): Observable<GetContactsResponse>;
} }
export interface UsersServiceController { export interface UsersServiceController {
@@ -105,11 +190,48 @@ export interface UsersServiceController {
request: SoftDeleteProfileRequest, request: SoftDeleteProfileRequest,
metadata?: Metadata, metadata?: Metadata,
): Promise<SoftDeleteProfileResponse> | Observable<SoftDeleteProfileResponse> | SoftDeleteProfileResponse; ): Promise<SoftDeleteProfileResponse> | Observable<SoftDeleteProfileResponse> | SoftDeleteProfileResponse;
/** --- НОВЫЕ МЕТОДЫ МЕССЕНДЖЕРА --- */
blockUser(
request: BlockUserRequest,
metadata?: Metadata,
): Promise<BlockUserResponse> | Observable<BlockUserResponse> | BlockUserResponse;
unblockUser(
request: UnblockUserRequest,
metadata?: Metadata,
): Promise<UnblockUserResponse> | Observable<UnblockUserResponse> | UnblockUserResponse;
getBlockedUsers(
request: GetBlockedUsersRequest,
metadata?: Metadata,
): Promise<GetBlockedUsersResponse> | Observable<GetBlockedUsersResponse> | GetBlockedUsersResponse;
addContact(
request: AddContactRequest,
metadata?: Metadata,
): Promise<AddContactResponse> | Observable<AddContactResponse> | AddContactResponse;
getContacts(
request: GetContactsRequest,
metadata?: Metadata,
): Promise<GetContactsResponse> | Observable<GetContactsResponse> | GetContactsResponse;
} }
export function UsersServiceControllerMethods() { export function UsersServiceControllerMethods() {
return function (constructor: Function) { return function (constructor: Function) {
const grpcMethods: string[] = ["getProfile", "updateProfile", "createProfile", "softDeleteProfile"]; const grpcMethods: string[] = [
"getProfile",
"updateProfile",
"createProfile",
"softDeleteProfile",
"blockUser",
"unblockUser",
"getBlockedUsers",
"addContact",
"getContacts",
];
for (const method of grpcMethods) { for (const method of grpcMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor); GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);