hedgedoc/src/notes/note-metadata.dto.ts
Tilman Vatteroth 0c56466dc1
Change year in copyright to 2021
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
2021-01-06 22:10:19 +01:00

52 lines
1,001 B
TypeScript

/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
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()
permissions: NotePermissionsDto;
}
export class NoteMetadataUpdateDto {
@IsString()
title: string;
@IsString()
description: string;
@IsArray()
@IsString({ each: true })
tags: string[];
}