2021-01-05 16:12:38 -05:00
|
|
|
/*
|
2021-01-06 15:36:07 -05:00
|
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
2021-01-05 16:12:38 -05:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2020-07-25 14:24:59 -04:00
|
|
|
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()
|
2020-10-03 08:45:04 -04:00
|
|
|
permissions: NotePermissionsDto;
|
2020-07-25 14:24:59 -04:00
|
|
|
}
|
2020-10-03 09:52:49 -04:00
|
|
|
|
|
|
|
export class NoteMetadataUpdateDto {
|
|
|
|
@IsString()
|
|
|
|
title: string;
|
|
|
|
@IsString()
|
|
|
|
description: string;
|
|
|
|
@IsArray()
|
|
|
|
@IsString({ each: true })
|
|
|
|
tags: string[];
|
|
|
|
}
|