76 lines
2.3 KiB
TypeScript
76 lines
2.3 KiB
TypeScript
import { Request } from 'express';
|
|
import { UserRole } from '../users/enums/user-role.enum';
|
|
import { AuthService } from './auth.service';
|
|
import { LoginPasswordDto } from './dto/login-password.dto';
|
|
import { RefreshTokenDto } from './dto/refresh-token.dto';
|
|
import { RegisterPasswordDto } from './dto/register-password.dto';
|
|
import { RequestOtpDto } from './dto/request-otp.dto';
|
|
import { VerifyOtpDto } from './dto/verify-otp.dto';
|
|
import { JwtPayload } from './interfaces/jwt-payload.interface';
|
|
export declare class AuthController {
|
|
private readonly authService;
|
|
constructor(authService: AuthService);
|
|
requestOtp(dto: RequestOtpDto): Promise<{
|
|
message: string;
|
|
expiresInSeconds: number;
|
|
phone: string;
|
|
smsSent: boolean;
|
|
otpPreview: string | undefined;
|
|
}>;
|
|
registerWithPassword(dto: RegisterPasswordDto): Promise<{
|
|
accessToken: string;
|
|
refreshToken: string;
|
|
user: {
|
|
id: string;
|
|
phone: string;
|
|
fullName: string;
|
|
role: UserRole;
|
|
level: import("../users/enums/user-level.enum").UserLevel;
|
|
};
|
|
}>;
|
|
loginWithPassword(dto: LoginPasswordDto): Promise<{
|
|
accessToken: string;
|
|
refreshToken: string;
|
|
user: {
|
|
id: string;
|
|
phone: string;
|
|
fullName: string;
|
|
role: UserRole;
|
|
level: import("../users/enums/user-level.enum").UserLevel;
|
|
};
|
|
}>;
|
|
verifyOtp(dto: VerifyOtpDto): Promise<{
|
|
accessToken: string;
|
|
refreshToken: string;
|
|
user: {
|
|
id: string;
|
|
phone: string;
|
|
fullName: string;
|
|
role: UserRole;
|
|
level: import("../users/enums/user-level.enum").UserLevel;
|
|
};
|
|
}>;
|
|
refresh(dto: RefreshTokenDto): Promise<{
|
|
accessToken: string;
|
|
refreshToken: string;
|
|
user: {
|
|
id: string;
|
|
phone: string;
|
|
fullName: string;
|
|
role: UserRole;
|
|
level: import("../users/enums/user-level.enum").UserLevel;
|
|
};
|
|
}>;
|
|
logout(request: Request & {
|
|
user: JwtPayload;
|
|
}): Promise<{
|
|
message: string;
|
|
}>;
|
|
adminCheck(request: Request & {
|
|
user: JwtPayload;
|
|
}): {
|
|
user: Express.User & JwtPayload;
|
|
authorized: boolean;
|
|
};
|
|
}
|