Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

286 B
Raw Blame
import { IsNotEmpty, IsNumber, IsString, ValidateIf } from 'class-validator';

// Inputs to create a new PAT
export class CreateAccessTokenDto {
  @IsString()
  @IsNotEmpty()
  label: string;

  @ValidateIf((o) => o.expiryInDays !== null)
  @IsNumber()
  expiryInDays: number | null;
}