hedgedoc/src/notes/note-metadata.dto.ts
David Mehren 56d5a2e1b1
Add NoteModule
This contains the module, a model which was adapted from the old code and two DTOs.

Signed-off-by: David Mehren <git@herrmehren.de>
2020-08-20 19:43:07 +02:00

36 lines
705 B
TypeScript

import {
IsArray,
IsDate,
IsNumber,
IsString,
ValidateNested,
} from 'class-validator';
import { UserInfoDto } from '../users/user-info.dto';
import { NotePermissionsDto } from './note-permissions.dto';
export class NoteMetadataDto {
@IsString()
id: string;
@IsString()
alias: string;
@IsString()
title: string;
@IsString()
description: string;
@IsArray()
@IsString({ each: true })
tags: string[];
@IsDate()
updateTime: Date;
@ValidateNested()
updateUser: UserInfoDto;
@IsNumber()
viewCount: number;
@IsDate()
createTime: Date;
@IsArray()
@ValidateNested()
editedBy: UserInfoDto['userName'][];
@ValidateNested()
permission: NotePermissionsDto;
}