bb-inspired
Version:
Core library for BB-inspired NestJS backend
23 lines (22 loc) • 1.17 kB
TypeScript
import { JwtService } from './jwt.service';
import { AuthOptions } from './auth.module';
import { JwtPayload, TokenResponse } from './jwt.service';
import { AuthUser } from '../../interfaces/auth.interfaces';
import { DatabaseService } from '../database/database.service';
import { EventBusService } from '../messaging/event-bus.service';
export declare class AuthService {
private readonly options;
private readonly jwtService;
private readonly databaseService;
private readonly eventBusService;
private readonly logger;
private readonly userService;
constructor(options: AuthOptions, jwtService: JwtService, databaseService: DatabaseService, eventBusService: EventBusService);
validateUser(username: string, password: string): Promise<any>;
login(user: any): Promise<TokenResponse>;
refreshToken(refreshToken: string): Promise<TokenResponse>;
validateUserByJwt(payload: JwtPayload): Promise<AuthUser | null>;
hasRoles(user: AuthUser, requiredRoles: string[]): boolean;
hasPermissions(user: AuthUser, requiredPermissions: string[]): boolean;
logout(userId: string | number, sessionId?: string): Promise<void>;
}