chore: auto-generate protobuf files [skip ci]
This commit is contained in:
211
gen/users/ldap.ts
Normal file
211
gen/users/ldap.ts
Normal file
@@ -0,0 +1,211 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.6
|
||||
// protoc v4.25.9
|
||||
// source: users/ldap.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import type { Metadata } from "@grpc/grpc-js";
|
||||
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
export const protobufPackage = "ldap.v1";
|
||||
|
||||
/**
|
||||
* ==========================================
|
||||
* БАЗОВЫЕ И ПЕРЕИСПОЛЬЗУЕМЫЕ СТРУКТУРЫ
|
||||
* ==========================================
|
||||
*/
|
||||
export interface EmptyRequest {
|
||||
}
|
||||
|
||||
/** Стандартный ответ для мутаций (создание, обновление, удаление) */
|
||||
export interface StatusResponse {
|
||||
success: boolean;
|
||||
errorMessage: string;
|
||||
}
|
||||
|
||||
/** Полная модель пользователя */
|
||||
export interface UserData {
|
||||
/** Полный путь в AD (Distinguished Name) */
|
||||
dn: string;
|
||||
/** Логин (sAMAccountName) */
|
||||
username: string;
|
||||
/** ФИО (displayName) */
|
||||
displayName: string;
|
||||
/** Почта (mail) */
|
||||
email: string;
|
||||
/** Описание/Должность (description) */
|
||||
description: string;
|
||||
/** Аватарка в байтах (thumbnailPhoto) */
|
||||
avatar: Uint8Array;
|
||||
/** Список групп */
|
||||
groups: string[];
|
||||
/** Статус аккаунта */
|
||||
isActive: boolean;
|
||||
phone: string;
|
||||
}
|
||||
|
||||
/** Модель группы */
|
||||
export interface GroupData {
|
||||
dn: string;
|
||||
/** Короткое имя группы (cn) */
|
||||
name: string;
|
||||
}
|
||||
|
||||
/** --- Списки --- */
|
||||
export interface UserListResponse {
|
||||
success: boolean;
|
||||
errorMessage: string;
|
||||
users: UserData[];
|
||||
}
|
||||
|
||||
export interface GroupListResponse {
|
||||
success: boolean;
|
||||
errorMessage: string;
|
||||
groups: GroupData[];
|
||||
}
|
||||
|
||||
/** --- Управление профилем --- */
|
||||
export interface CreateUserRequest {
|
||||
username: string;
|
||||
fullName: string;
|
||||
password: string;
|
||||
/** Сразу при создании можно задать почту */
|
||||
email?: string | undefined;
|
||||
}
|
||||
|
||||
/** Запрос на обновление. Используем optional для частичного обновления. */
|
||||
export interface UpdateUserRequest {
|
||||
/** Обязательное поле: кого обновляем */
|
||||
username: string;
|
||||
/** Новое ФИО (повлечет Rename CN) */
|
||||
displayName?:
|
||||
| string
|
||||
| undefined;
|
||||
/** Новая почта */
|
||||
email?:
|
||||
| string
|
||||
| undefined;
|
||||
/** Новое описание */
|
||||
description?:
|
||||
| string
|
||||
| undefined;
|
||||
/** Новая аватарка (бинарник картинки) */
|
||||
avatar?: Uint8Array | undefined;
|
||||
}
|
||||
|
||||
export interface ChangePasswordRequest {
|
||||
username: string;
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
export interface ToggleStatusRequest {
|
||||
username: string;
|
||||
/** true - включить (512), false - отключить (514) */
|
||||
setActive: boolean;
|
||||
}
|
||||
|
||||
/** --- Управление членством в группах --- */
|
||||
export interface GroupMemberRequest {
|
||||
/** Логин пользователя */
|
||||
username: string;
|
||||
/** Полный путь группы (в которую добавляем / из которой удаляем) */
|
||||
groupDn: string;
|
||||
}
|
||||
|
||||
export const LDAP_V1_PACKAGE_NAME = "ldap.v1";
|
||||
|
||||
export interface LdapServiceClient {
|
||||
/** Управление Пользователями (Bind системного аккаунта) --- */
|
||||
|
||||
getUsers(request: EmptyRequest, metadata?: Metadata): Observable<UserListResponse>;
|
||||
|
||||
createUser(request: CreateUserRequest, metadata?: Metadata): Observable<StatusResponse>;
|
||||
|
||||
updateUser(request: UpdateUserRequest, metadata?: Metadata): Observable<StatusResponse>;
|
||||
|
||||
changePassword(request: ChangePasswordRequest, metadata?: Metadata): Observable<StatusResponse>;
|
||||
|
||||
toggleUserStatus(request: ToggleStatusRequest, metadata?: Metadata): Observable<StatusResponse>;
|
||||
|
||||
/** Управление Группами --- */
|
||||
|
||||
getGroups(request: EmptyRequest, metadata?: Metadata): Observable<GroupListResponse>;
|
||||
|
||||
addUserToGroup(request: GroupMemberRequest, metadata?: Metadata): Observable<StatusResponse>;
|
||||
|
||||
removeUserFromGroup(request: GroupMemberRequest, metadata?: Metadata): Observable<StatusResponse>;
|
||||
}
|
||||
|
||||
export interface LdapServiceController {
|
||||
/** Управление Пользователями (Bind системного аккаунта) --- */
|
||||
|
||||
getUsers(
|
||||
request: EmptyRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<UserListResponse> | Observable<UserListResponse> | UserListResponse;
|
||||
|
||||
createUser(
|
||||
request: CreateUserRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<StatusResponse> | Observable<StatusResponse> | StatusResponse;
|
||||
|
||||
updateUser(
|
||||
request: UpdateUserRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<StatusResponse> | Observable<StatusResponse> | StatusResponse;
|
||||
|
||||
changePassword(
|
||||
request: ChangePasswordRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<StatusResponse> | Observable<StatusResponse> | StatusResponse;
|
||||
|
||||
toggleUserStatus(
|
||||
request: ToggleStatusRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<StatusResponse> | Observable<StatusResponse> | StatusResponse;
|
||||
|
||||
/** Управление Группами --- */
|
||||
|
||||
getGroups(
|
||||
request: EmptyRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<GroupListResponse> | Observable<GroupListResponse> | GroupListResponse;
|
||||
|
||||
addUserToGroup(
|
||||
request: GroupMemberRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<StatusResponse> | Observable<StatusResponse> | StatusResponse;
|
||||
|
||||
removeUserFromGroup(
|
||||
request: GroupMemberRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<StatusResponse> | Observable<StatusResponse> | StatusResponse;
|
||||
}
|
||||
|
||||
export function LdapServiceControllerMethods() {
|
||||
return function (constructor: Function) {
|
||||
const grpcMethods: string[] = [
|
||||
"getUsers",
|
||||
"createUser",
|
||||
"updateUser",
|
||||
"changePassword",
|
||||
"toggleUserStatus",
|
||||
"getGroups",
|
||||
"addUserToGroup",
|
||||
"removeUserFromGroup",
|
||||
];
|
||||
for (const method of grpcMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcMethod("LdapService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
const grpcStreamMethods: string[] = [];
|
||||
for (const method of grpcStreamMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcStreamMethod("LdapService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const LDAP_SERVICE_NAME = "LdapService";
|
||||
109
gen/users/users.ts
Normal file
109
gen/users/users.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-ts_proto v2.11.6
|
||||
// protoc v4.25.9
|
||||
// source: users/users.proto
|
||||
|
||||
/* eslint-disable */
|
||||
import type { Metadata } from "@grpc/grpc-js";
|
||||
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
export const protobufPackage = "users.v1";
|
||||
|
||||
export interface GetMeRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface GetMeResponse {
|
||||
user: User | undefined;
|
||||
}
|
||||
|
||||
export interface CreateUserRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface CreateUserResponse {
|
||||
success: string;
|
||||
}
|
||||
|
||||
export interface ChangeMeRequest {
|
||||
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 ChangeMeResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
username?: string | undefined;
|
||||
email?: string | undefined;
|
||||
phone?: string | undefined;
|
||||
fullName?: string | undefined;
|
||||
isLdap: boolean;
|
||||
status?: string | undefined;
|
||||
roles: string[];
|
||||
avatarUrl?: string | undefined;
|
||||
employeeId?: string | undefined;
|
||||
presence?: string | undefined;
|
||||
lastActive?: string | undefined;
|
||||
customStatusText?: string | undefined;
|
||||
customStatusEmoji?: string | undefined;
|
||||
timezone?: string | undefined;
|
||||
language?: string | undefined;
|
||||
twoFaEnabled: boolean;
|
||||
hasPin: boolean;
|
||||
}
|
||||
|
||||
export const USERS_V1_PACKAGE_NAME = "users.v1";
|
||||
|
||||
export interface UsersServiceClient {
|
||||
getMe(request: GetMeRequest, metadata?: Metadata): Observable<GetMeResponse>;
|
||||
|
||||
changeMe(request: ChangeMeRequest, metadata?: Metadata): Observable<ChangeMeResponse>;
|
||||
|
||||
createUser(request: CreateUserRequest, metadata?: Metadata): Observable<CreateUserResponse>;
|
||||
}
|
||||
|
||||
export interface UsersServiceController {
|
||||
getMe(request: GetMeRequest, metadata?: Metadata): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
|
||||
|
||||
changeMe(
|
||||
request: ChangeMeRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<ChangeMeResponse> | Observable<ChangeMeResponse> | ChangeMeResponse;
|
||||
|
||||
createUser(
|
||||
request: CreateUserRequest,
|
||||
metadata?: Metadata,
|
||||
): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
||||
}
|
||||
|
||||
export function UsersServiceControllerMethods() {
|
||||
return function (constructor: Function) {
|
||||
const grpcMethods: string[] = ["getMe", "changeMe", "createUser"];
|
||||
for (const method of grpcMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
const grpcStreamMethods: string[] = [];
|
||||
for (const method of grpcStreamMethods) {
|
||||
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
||||
GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const USERS_SERVICE_NAME = "UsersService";
|
||||
Reference in New Issue
Block a user