85 lines
2.4 KiB
TypeScript
85 lines
2.4 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 {
|
|
permission: Permission | undefined;
|
|
}
|
|
|
|
export interface Permission {
|
|
id: string;
|
|
code: string;
|
|
description: string;
|
|
module: string;
|
|
roles: string[];
|
|
}
|
|
|
|
export interface GetAllRolesRequest {
|
|
userId: string;
|
|
sessionId: string;
|
|
}
|
|
|
|
export interface GetAllRolesResponse {
|
|
roles: Roles | undefined;
|
|
}
|
|
|
|
export interface Roles {
|
|
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";
|