immich/server/src/domain/api-key/api-key.dto.ts

27 lines
445 B
TypeScript
Raw Normal View History

import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
export class APIKeyCreateDto {
@IsString()
@IsNotEmpty()
@IsOptional()
name?: string;
}
export class APIKeyUpdateDto {
@IsString()
@IsNotEmpty()
name!: string;
}
2023-06-30 21:49:30 -04:00
export class APIKeyCreateResponseDto {
secret!: string;
apiKey!: APIKeyResponseDto;
}
export class APIKeyResponseDto {
id!: string;
name!: string;
createdAt!: Date;
updatedAt!: Date;
}