Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@IsOptional()
readonly createdBy?: User;
@IsOptional()
@IsString()
readonly clusterName?: string;
@IsOptional()
@ArrayUnique()
@IsString({ each: true })
@Transform(value => (value ? value.split(',') : []))
readonly groups?: string[];
@IsOptional()
@IsAscii()
@Length(5, 100)
@Matches(/^[a-z\d-]+$/)
readonly namespace?: string;
@IsOptional()
@IsAscii()
@Length(5, 100)
@Matches(/^[a-z\d-]+$/)
readonly serviceAccountName?: string;
@IsOptional()
@ValidateNested()
@Type(() => Labels)
readonly labels?: Labels;
@Transform((val: string) => val === 'true')
@IsOptional()
IsDefined,
IsEmail, IsEnum,
IsString,
Length,
} from 'class-validator';
import { ApiModelProperty } from '@nestjs/swagger';
import { USER_ROLE } from './user.constants';
import { ToBoolean } from 'class-sanitizer';
export class VRegister {
@ApiModelProperty()
@IsDefined() @IsString()
name: string;
@ApiModelProperty()
@IsDefined() @IsString() @Length(6)
password: string;
@ApiModelProperty()
@IsDefined() @IsEmail()
email: string;
}
export class VUpdatePassword {
@ApiModelProperty()
@IsDefined() @IsString() @Length(6)
password: string;
}
export class VProfile {
@ApiModelProperty()
@IsEmail()
import { BaseEntity } from '../core/base.entity';
import { Length } from 'class-validator';
export class OrganizationEntity extends BaseEntity {
@Length(2, 50)
name?: string;
@Length(2, 50)
slug?: string;
}
IsString,
Length,
validateOrReject,
IsDate,
ValidateNested
} from 'class-validator'
import { ModuleResponse } from '@interfaces'
import { ControllerMethod } from '@classes'
import UserModel from '../User.schema'
import { User, Address } from '../User.interface'
class InputValidation {
@IsString()
@Length(3, 255)
public name: string
@Length(9, 11)
public phone: string
@Length(0, 350)
public avatar: string
@IsDate()
public birthdate: Date
@ValidateNested()
public address: Address
}
interface SanitizedProps {
import { Type } from 'class-transformer';
import { IsEmail, IsOptional, IsUrl, Length, ValidateNested } from 'class-validator';
import { FileUpload } from 'graphql-upload';
import { UserRoleUpdateManyWithoutUserInput, UserUpdateInput, UserWhereUniqueInput } from 'prisma/prisma.binding';
export class UserUpdateDTO implements UserUpdateInput {
@IsEmail()
@Length(6, 64)
email?: string;
@Length(6, 32)
@IsOptional()
username?: string;
@IsOptional()
password?: string;
@IsUrl()
@IsOptional()
coverUrl?: string;
@IsUrl()
@IsOptional()
avatarUrl?: string;
country?: string;
import { IsEmail, IsNotEmpty, IsString, Length } from 'class-validator';
export class CreateOrganizationMemberCommand {
@IsNotEmpty()
public readonly orgId: string = '';
@IsEmail()
@Length(6, 64)
public readonly username: string = '';
@IsString()
@Length(1, 32)
public readonly displayName: string = '';
@IsString()
@Length(8, 64)
public readonly password: string = '';
}
import { IsEmail, IsString, Length } from 'class-validator';
export class LocalRegisterCommand {
@IsEmail()
@Length(6, 64)
public readonly username: string = '';
@IsString()
@Length(1, 32)
public readonly displayName: string = '';
@IsString()
@Length(8, 32)
public readonly password: string = '';
}
import { Type } from 'class-transformer';
import { IsEmail, IsNotEmpty, IsOptional, Length, ValidateNested } from 'class-validator';
export class RegisterDTO {
@IsNotEmpty()
@Length(6, 32)
password: string;
@IsEmail()
@Length(6, 64)
email: string;
@Length(6, 32)
@IsOptional()
username?: string;
}
export class RegisterInputDTO {
@ValidateNested()
@Type(() => RegisterDTO)
data: RegisterDTO;
}
@MinLength(11)
@IsString()
mobile: string;
@Length(5, 50)
@IsString()
@IsEmail()
email: string;
name?: string;
@Length(2, 5)
@IsOptional()
mobilePrefix?: string;
@Length(6)
@IsNotEmpty()
veryCode: string;
}