// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.11.4 // protoc v7.34.0 // source: crm_auth.proto /* eslint-disable */ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; import { Observable } from "rxjs"; export const protobufPackage = "crm_auth"; export enum CrmManagerStatus { CRM_MANAGER_STATUS_UNSPECIFIED = 0, CRM_MANAGER_STATUS_ACTIVE = 1, CRM_MANAGER_STATUS_DISABLED = 2, UNRECOGNIZED = -1, } export interface CrmLoginRequest { email: string; otp: string; userAgent: string; ipAddress: string; password: string; } export interface CrmRefreshSessionRequest { refreshToken: string; userAgent: string; ipAddress: string; } export interface CrmRevokeSessionRequest { refreshToken: string; } export interface CrmRevokeSessionResponse { success: boolean; sessionId: string; managerId: string; reason: string; } export interface CrmValidateAccessRequest { authorization: string; } export interface CrmValidateAccessResponse { allowed: boolean; managerId: string; reason: string; } export interface CrmGetMeRequest { accessToken: string; } export interface SectionPermission { section: string; view: boolean; edit: boolean; } export interface CrmManagerResponse { id: string; email: string; username: string; firstName: string; lastName: string; displayName: string; avatarUrl: string; status: CrmManagerStatus; createdAtUnixMs: number; roles: string[]; permissions: string[]; isSuperAdmin: boolean; sectionPermissions: SectionPermission[]; fullName: string; role: string; permissionsVersion: number; canCrossOffice: boolean; officeIds: string[]; } export interface CrmAuthSessionResponse { success: boolean; accessToken: string; accessExpiresAtUnixMs: number; refreshToken: string; refreshExpiresAtUnixMs: number; sessionId: string; managerId: string; reason: string; manager: CrmManagerResponse | undefined; } export const CRM_AUTH_PACKAGE_NAME = "crm_auth"; export interface CrmAuthServiceClient { login(request: CrmLoginRequest): Observable; refreshSession(request: CrmRefreshSessionRequest): Observable; revokeSession(request: CrmRevokeSessionRequest): Observable; validateAccess(request: CrmValidateAccessRequest): Observable; getMe(request: CrmGetMeRequest): Observable; } export interface CrmAuthServiceController { login( request: CrmLoginRequest, ): Promise | Observable | CrmAuthSessionResponse; refreshSession( request: CrmRefreshSessionRequest, ): Promise | Observable | CrmAuthSessionResponse; revokeSession( request: CrmRevokeSessionRequest, ): Promise | Observable | CrmRevokeSessionResponse; validateAccess( request: CrmValidateAccessRequest, ): Promise | Observable | CrmValidateAccessResponse; getMe(request: CrmGetMeRequest): Promise | Observable | CrmManagerResponse; } export function CrmAuthServiceControllerMethods() { return function (constructor: Function) { const grpcMethods: string[] = ["login", "refreshSession", "revokeSession", "validateAccess", "getMe"]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); GrpcMethod("CrmAuthService", method)(constructor.prototype[method], method, descriptor); } const grpcStreamMethods: string[] = []; for (const method of grpcStreamMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); GrpcStreamMethod("CrmAuthService", method)(constructor.prototype[method], method, descriptor); } }; } export const CRM_AUTH_SERVICE_NAME = "CrmAuthService";