chore: auto-generate protobuf files [skip ci]

This commit is contained in:
github-actions[bot]
2026-04-11 11:33:08 +00:00
parent 9648c4dbb9
commit 3c5fbf2790
15 changed files with 6209 additions and 2069 deletions

View File

@@ -49,76 +49,6 @@ export interface ChangePasswordResponse {
message: string;
}
export interface CreateUserRequest {
username: string;
password: string;
roles: string[];
}
export interface CreateUserResponse {
success: boolean;
message: string;
}
export interface DeleteUserRequest {
userId: string;
}
export interface DeleteUserResponse {
success: boolean;
message: string;
}
export interface ChangeDataRequest {
userId: string;
sessionId: string;
email?: string | undefined;
phone?: string | undefined;
fullName?: string | undefined;
avatarUrl?: string | undefined;
customStatusText?: string | undefined;
customStatusEmoji?: string | undefined;
timezone?: string | undefined;
language?: string | undefined;
isPublic?: boolean | undefined;
}
export interface ChangeDataResponse {
success: boolean;
message: string;
}
export interface AssignRoleRequest {
userId: string;
/** В gRPC передаем как string, внутри преобразуем в Int */
roleId: string;
}
export interface AssignRoleResponse {
success: boolean;
message: string;
}
export interface RevokeRoleRequest {
userId: string;
roleId: string;
}
export interface RevokeRoleResponse {
success: boolean;
message: string;
}
export interface AdminResetPasswordRequest {
userId: string;
newPassword: string;
}
export interface AdminResetPasswordResponse {
success: boolean;
message: string;
}
export interface SetPinRequest {
userId: string;
sessionId: string;
@@ -163,59 +93,6 @@ export interface RemovePinResponse {
message: string;
}
export interface BlockUserRequest {
/** Кого блокируем */
userId: string;
/** Кто блокирует */
adminId: string;
reason?: string | undefined;
}
export interface BlockUserResponse {
success: boolean;
message: string;
}
export interface UnblockUserRequest {
userId: string;
adminId: string;
}
export interface UnblockUserResponse {
success: boolean;
message: string;
}
export interface BlockIpRequest {
ipAddress: string;
adminId: string;
reason?: string | undefined;
}
export interface BlockIpResponse {
success: boolean;
message: string;
}
export interface UnblockIpRequest {
ipAddress: string;
adminId: string;
}
export interface UnblockIpResponse {
success: boolean;
message: string;
}
/** Можно оставить пустым, так как нам не нужны входные данные */
export interface SyncUsersToSearchRequest {
}
export interface SyncUsersToSearchResponse {
success: boolean;
message: string;
}
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
export interface AccountServiceClient {
@@ -223,18 +100,6 @@ export interface AccountServiceClient {
changePassword(request: ChangePasswordRequest, metadata?: Metadata): Observable<ChangePasswordResponse>;
adminResetPassword(request: AdminResetPasswordRequest, metadata?: Metadata): Observable<AdminResetPasswordResponse>;
createUser(request: CreateUserRequest, metadata?: Metadata): Observable<CreateUserResponse>;
deleteUser(request: DeleteUserRequest, metadata?: Metadata): Observable<DeleteUserResponse>;
changeData(request: ChangeDataRequest, metadata?: Metadata): Observable<ChangeDataResponse>;
assignRole(request: AssignRoleRequest, metadata?: Metadata): Observable<AssignRoleResponse>;
revokeRole(request: RevokeRoleRequest, metadata?: Metadata): Observable<RevokeRoleResponse>;
setPin(request: SetPinRequest, metadata?: Metadata): Observable<SetPinResponse>;
unlockPin(request: UnlockPinRequest, metadata?: Metadata): Observable<UnlockPinResponse>;
@@ -242,16 +107,6 @@ export interface AccountServiceClient {
getPinStatus(request: GetPinStatusRequest, metadata?: Metadata): Observable<GetPinStatusResponse>;
removePin(request: RemovePinRequest, metadata?: Metadata): Observable<RemovePinResponse>;
blockUser(request: BlockUserRequest, metadata?: Metadata): Observable<BlockUserResponse>;
unblockUser(request: UnblockUserRequest, metadata?: Metadata): Observable<UnblockUserResponse>;
blockIp(request: BlockIpRequest, metadata?: Metadata): Observable<BlockIpResponse>;
unblockIp(request: UnblockIpRequest, metadata?: Metadata): Observable<UnblockIpResponse>;
syncUsersToSearch(request: SyncUsersToSearchRequest, metadata?: Metadata): Observable<SyncUsersToSearchResponse>;
}
export interface AccountServiceController {
@@ -265,36 +120,6 @@ export interface AccountServiceController {
metadata?: Metadata,
): Promise<ChangePasswordResponse> | Observable<ChangePasswordResponse> | ChangePasswordResponse;
adminResetPassword(
request: AdminResetPasswordRequest,
metadata?: Metadata,
): Promise<AdminResetPasswordResponse> | Observable<AdminResetPasswordResponse> | AdminResetPasswordResponse;
createUser(
request: CreateUserRequest,
metadata?: Metadata,
): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
deleteUser(
request: DeleteUserRequest,
metadata?: Metadata,
): Promise<DeleteUserResponse> | Observable<DeleteUserResponse> | DeleteUserResponse;
changeData(
request: ChangeDataRequest,
metadata?: Metadata,
): Promise<ChangeDataResponse> | Observable<ChangeDataResponse> | ChangeDataResponse;
assignRole(
request: AssignRoleRequest,
metadata?: Metadata,
): Promise<AssignRoleResponse> | Observable<AssignRoleResponse> | AssignRoleResponse;
revokeRole(
request: RevokeRoleRequest,
metadata?: Metadata,
): Promise<RevokeRoleResponse> | Observable<RevokeRoleResponse> | RevokeRoleResponse;
setPin(
request: SetPinRequest,
metadata?: Metadata,
@@ -314,54 +139,11 @@ export interface AccountServiceController {
request: RemovePinRequest,
metadata?: Metadata,
): Promise<RemovePinResponse> | Observable<RemovePinResponse> | RemovePinResponse;
blockUser(
request: BlockUserRequest,
metadata?: Metadata,
): Promise<BlockUserResponse> | Observable<BlockUserResponse> | BlockUserResponse;
unblockUser(
request: UnblockUserRequest,
metadata?: Metadata,
): Promise<UnblockUserResponse> | Observable<UnblockUserResponse> | UnblockUserResponse;
blockIp(
request: BlockIpRequest,
metadata?: Metadata,
): Promise<BlockIpResponse> | Observable<BlockIpResponse> | BlockIpResponse;
unblockIp(
request: UnblockIpRequest,
metadata?: Metadata,
): Promise<UnblockIpResponse> | Observable<UnblockIpResponse> | UnblockIpResponse;
syncUsersToSearch(
request: SyncUsersToSearchRequest,
metadata?: Metadata,
): Promise<SyncUsersToSearchResponse> | Observable<SyncUsersToSearchResponse> | SyncUsersToSearchResponse;
}
export function AccountServiceControllerMethods() {
return function (constructor: Function) {
const grpcMethods: string[] = [
"getAccount",
"changePassword",
"adminResetPassword",
"createUser",
"deleteUser",
"changeData",
"assignRole",
"revokeRole",
"setPin",
"unlockPin",
"getPinStatus",
"removePin",
"blockUser",
"unblockUser",
"blockIp",
"unblockIp",
"syncUsersToSearch",
];
const grpcMethods: string[] = ["getAccount", "changePassword", "setPin", "unlockPin", "getPinStatus", "removePin"];
for (const method of grpcMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);