mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
25 lines
506 B
TypeScript
25 lines
506 B
TypeScript
import { IsEmail, IsString, Matches, MaxLength, MinLength } from 'class-validator';
|
|
|
|
export class SetupDto {
|
|
@IsString()
|
|
@MinLength(3)
|
|
@MaxLength(100)
|
|
username: string;
|
|
|
|
@IsString()
|
|
@MinLength(1)
|
|
@MaxLength(255)
|
|
name: string;
|
|
|
|
@IsEmail()
|
|
email: string;
|
|
|
|
@IsString()
|
|
@MinLength(8)
|
|
@MaxLength(1024)
|
|
@Matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$/, {
|
|
message: 'Password must contain at least one uppercase letter, one lowercase letter, and one digit',
|
|
})
|
|
password: string;
|
|
}
|