forked from Yara724/api
YARA-913
This commit is contained in:
33
src/auth/dto/get-actor-captcha.dto.ts
Normal file
33
src/auth/dto/get-actor-captcha.dto.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
||||
import { IsEnum, IsIn, IsNotEmpty, IsOptional, IsString, MaxLength } from "class-validator";
|
||||
import { RoleEnum } from "src/Types&Enums/role.enum";
|
||||
|
||||
export class GetActorCaptchaQueryDto {
|
||||
@ApiProperty({
|
||||
example: "expert@gmail.com",
|
||||
description: "Actor email / username",
|
||||
})
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@MaxLength(128)
|
||||
username: string;
|
||||
|
||||
@ApiProperty({
|
||||
enum: RoleEnum,
|
||||
example: RoleEnum.EXPERT,
|
||||
description: "Actor role",
|
||||
})
|
||||
@IsEnum(RoleEnum)
|
||||
role: RoleEnum;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
enum: ["json", "raw"],
|
||||
default: "json",
|
||||
description:
|
||||
"Use `raw` to open the captcha directly in the browser (image/svg+xml). " +
|
||||
"Default `json` returns `{ image, expiresAt }` for the frontend.",
|
||||
})
|
||||
@IsOptional()
|
||||
@IsIn(["json", "raw"])
|
||||
format?: "json" | "raw";
|
||||
}
|
||||
Reference in New Issue
Block a user