chore: auto-generate protobuf files [skip ci]
This commit is contained in:
247
gen/admin/admin-account.ts
Normal file
247
gen/admin/admin-account.ts
Normal file
@@ -0,0 +1,247 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.6
|
||||
// protoc v4.25.9
|
||||
// source: admin/admin-account.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import type { Metadata } from "@grpc/grpc-js";
|
||||
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
export const protobufPackage = "admin.account.v1";
|
||||
|
||||
export interface AdminResetPasswordRequest {
|
||||
userId: string;
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
export interface AdminResetPasswordResponse {
|
||||
success: boolean;
|
||||
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 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 ADMIN_ACCOUNT_V1_PACKAGE_NAME = "admin.account.v1";
|
||||
|
||||
export interface AdminAccountServiceClient {
|
||||
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>;
|
||||
|
||||
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 AdminAccountServiceController {
|
||||
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;
|
||||
|
||||
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 AdminAccountServiceControllerMethods() {
|
||||
return function (constructor: Function) {
|
||||
const grpcMethods: string[] = [
|
||||
"adminResetPassword",
|
||||
"createUser",
|
||||
"deleteUser",
|
||||
"changeData",
|
||||
"assignRole",
|
||||
"revokeRole",
|
||||
"blockUser",
|
||||
"unblockUser",
|
||||
"blockIp",
|
||||
"unblockIp",
|
||||
"syncUsersToSearch",
|
||||
];
|
||||
for (const method of grpcMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcMethod("AdminAccountService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
const grpcStreamMethods: string[] = [];
|
||||
for (const method of grpcStreamMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcStreamMethod("AdminAccountService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const ADMIN_ACCOUNT_SERVICE_NAME = "AdminAccountService";
|
||||
Reference in New Issue
Block a user