Files
contracts/gen/rbac.ts
2026-04-06 13:58:45 +00:00

77 lines
2.2 KiB
TypeScript

// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.11.6
// protoc v3.21.12
// source: rbac.proto
/* eslint-disable */
import type { Metadata } from "@grpc/grpc-js";
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
import { Observable } from "rxjs";
export const protobufPackage = "rbac.v1";
export interface GetAllPermissionsRequest {
userId: string;
sessionId: string;
}
export interface GetAllPermissionsResponse {
id: string;
code: string;
description: string;
module: string;
roles: string[];
}
export interface GetAllRolesRequest {
userId: string;
sessionId: string;
}
export interface GetAllRolesResponse {
id: string;
name: string;
level: number;
permissions: string[];
ldapMapping: string[];
accounts: string[];
}
export const RBAC_V1_PACKAGE_NAME = "rbac.v1";
export interface RbacServiceClient {
getAllPermissions(request: GetAllPermissionsRequest, metadata?: Metadata): Observable<GetAllPermissionsResponse>;
getAllRoles(request: GetAllRolesRequest, metadata?: Metadata): Observable<GetAllRolesResponse>;
}
export interface RbacServiceController {
getAllPermissions(
request: GetAllPermissionsRequest,
metadata?: Metadata,
): Promise<GetAllPermissionsResponse> | Observable<GetAllPermissionsResponse> | GetAllPermissionsResponse;
getAllRoles(
request: GetAllRolesRequest,
metadata?: Metadata,
): Promise<GetAllRolesResponse> | Observable<GetAllRolesResponse> | GetAllRolesResponse;
}
export function RbacServiceControllerMethods() {
return function (constructor: Function) {
const grpcMethods: string[] = ["getAllPermissions", "getAllRoles"];
for (const method of grpcMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcMethod("RbacService", method)(constructor.prototype[method], method, descriptor);
}
const grpcStreamMethods: string[] = [];
for (const method of grpcStreamMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcStreamMethod("RbacService", method)(constructor.prototype[method], method, descriptor);
}
};
}
export const RBAC_SERVICE_NAME = "RbacService";