mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-10-20 14:12:10 -04:00
0c56466dc1
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
52 lines
1,001 B
TypeScript
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[];
|
|
}
|