// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.11.6 // protoc v3.21.12 // source: identity.proto /* eslint-disable */ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; import { Observable } from "rxjs"; export const protobufPackage = "identity"; export interface LoginRequest { username: string; password: string; } export interface LoginResponse { accessToken: string; refreshToken: string; status: string; need2fa: boolean; tempToken?: string | undefined; message?: string | undefined; errorCode?: string | undefined; } export interface RefreshRequest { refreshToken: string; } export interface RefreshResponse { accessToken: string; refreshToken: string; } export interface LogoutRequest { accessToken: string; } export interface LogoutResponse { success: boolean; message: string; } export interface VerifyTokenRequest { token: string; } export interface VerifyTokenResponse { isValid: boolean; errorMessage: string; id: string; username: string; roleLevel: number; permissions: string[]; sessionId: string; } export interface GetAccountRoleLevelRequest { accountId: string; } export interface GetAccountRoleLevelResponse { found: boolean; roleLevel: number; } export interface UnlockPinRequest { accessToken: string; pinCode: string; } export interface UnlockPinResponse { success: boolean; message: string; } export interface Verify2FaRequest { tempToken: string; totpCode?: string | undefined; telegramCode?: string | undefined; } export interface Verify2FaResponse { accessToken: string; refreshToken: string; status: string; message: string; reserveCodes: string[]; } export interface AuthenticatedAccessRequest { accessToken: string; } export interface GetTwoFaStatusRequest { accessToken: string; } export interface GetTwoFaStatusResponse { totpEnabled: boolean; telegramEnabled: boolean; totpEnrollmentPending: boolean; telegramEnrollmentPending: boolean; } export interface StartTotpEnrollmentResponse { secretBase32: string; otpauthUri: string; issuer: string; accountLabel: string; } export interface ConfirmTotpEnrollmentRequest { accessToken: string; totpCode: string; } export interface ConfirmTotpEnrollmentResponse { status: string; message: string; reserveCodes: string[]; } export interface CancelTotpEnrollmentResponse { status: string; message: string; } export interface DisableTotpRequest { accessToken: string; password: string; totpCode?: string | undefined; } export interface DisableTotpResponse { status: string; message: string; } export interface StartTelegramEnrollmentResponse { enrollmentToken: string; deepLink: string; botUsername: string; expiresAtIso: string; } export interface ConfirmTelegramEnrollmentRequest { accessToken: string; enrollmentToken: string; otpCode: string; } export interface ConfirmTelegramEnrollmentResponse { status: string; message: string; reserveCodes: string[]; } export interface DisableTelegramRequest { accessToken: string; password: string; telegramOtpCode?: string | undefined; } export interface DisableTelegramResponse { status: string; message: string; } export const IDENTITY_PACKAGE_NAME = "identity"; export interface AuthServiceClient { login(request: LoginRequest): Observable; refresh(request: RefreshRequest): Observable; verifyToken(request: VerifyTokenRequest): Observable; getAccountRoleLevel(request: GetAccountRoleLevelRequest): Observable; logout(request: LogoutRequest): Observable; logoutAll(request: LogoutRequest): Observable; unlockPin(request: UnlockPinRequest): Observable; verify2Fa(request: Verify2FaRequest): Observable; } export interface AuthServiceController { login(request: LoginRequest): Promise | Observable | LoginResponse; refresh(request: RefreshRequest): Promise | Observable | RefreshResponse; verifyToken( request: VerifyTokenRequest, ): Promise | Observable | VerifyTokenResponse; getAccountRoleLevel( request: GetAccountRoleLevelRequest, ): Promise | Observable | GetAccountRoleLevelResponse; logout(request: LogoutRequest): Promise | Observable | LogoutResponse; logoutAll(request: LogoutRequest): Promise | Observable | LogoutResponse; unlockPin(request: UnlockPinRequest): Promise | Observable | UnlockPinResponse; verify2Fa(request: Verify2FaRequest): Promise | Observable | Verify2FaResponse; } export function AuthServiceControllerMethods() { return function (constructor: Function) { const grpcMethods: string[] = [ "login", "refresh", "verifyToken", "getAccountRoleLevel", "logout", "logoutAll", "unlockPin", "verify2Fa", ]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor); } const grpcStreamMethods: string[] = []; for (const method of grpcStreamMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor); } }; } export const AUTH_SERVICE_NAME = "AuthService"; export interface TwoFaServiceClient { getTwoFaStatus(request: GetTwoFaStatusRequest): Observable; startTotpEnrollment(request: AuthenticatedAccessRequest): Observable; confirmTotpErollment(request: ConfirmTotpEnrollmentRequest): Observable; cancelTotpEnrollment(request: AuthenticatedAccessRequest): Observable; disableTotp(request: DisableTotpRequest): Observable; startTelegramEnrollment(request: AuthenticatedAccessRequest): Observable; confirmTelegramEnrollment(request: ConfirmTelegramEnrollmentRequest): Observable; disableTelegram(request: DisableTelegramRequest): Observable; } export interface TwoFaServiceController { getTwoFaStatus( request: GetTwoFaStatusRequest, ): Promise | Observable | GetTwoFaStatusResponse; startTotpEnrollment( request: AuthenticatedAccessRequest, ): Promise | Observable | StartTotpEnrollmentResponse; confirmTotpErollment( request: ConfirmTotpEnrollmentRequest, ): Promise | Observable | ConfirmTotpEnrollmentResponse; cancelTotpEnrollment( request: AuthenticatedAccessRequest, ): Promise | Observable | CancelTotpEnrollmentResponse; disableTotp( request: DisableTotpRequest, ): Promise | Observable | DisableTotpResponse; startTelegramEnrollment( request: AuthenticatedAccessRequest, ): | Promise | Observable | StartTelegramEnrollmentResponse; confirmTelegramEnrollment( request: ConfirmTelegramEnrollmentRequest, ): | Promise | Observable | ConfirmTelegramEnrollmentResponse; disableTelegram( request: DisableTelegramRequest, ): Promise | Observable | DisableTelegramResponse; } export function TwoFaServiceControllerMethods() { return function (constructor: Function) { const grpcMethods: string[] = [ "getTwoFaStatus", "startTotpEnrollment", "confirmTotpErollment", "cancelTotpEnrollment", "disableTotp", "startTelegramEnrollment", "confirmTelegramEnrollment", "disableTelegram", ]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); GrpcMethod("TwoFaService", method)(constructor.prototype[method], method, descriptor); } const grpcStreamMethods: string[] = []; for (const method of grpcStreamMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); GrpcStreamMethod("TwoFaService", method)(constructor.prototype[method], method, descriptor); } }; } export const TWO_FA_SERVICE_NAME = "TwoFaService";