mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-26 03:33:58 -05:00
NoteMetadata DTOs: Add doc comments
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
eb2544bc2b
commit
3233b5c958
1 changed files with 71 additions and 0 deletions
|
@ -8,6 +8,7 @@ import {
|
|||
IsArray,
|
||||
IsDate,
|
||||
IsNumber,
|
||||
IsOptional,
|
||||
IsString,
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
|
@ -15,37 +16,107 @@ import { UserInfoDto } from '../users/user-info.dto';
|
|||
import { NotePermissionsDto } from './note-permissions.dto';
|
||||
|
||||
export class NoteMetadataDto {
|
||||
/**
|
||||
* ID of the note
|
||||
*/
|
||||
@IsString()
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* Alias of the note
|
||||
* Can be null
|
||||
*/
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
alias: string;
|
||||
|
||||
/**
|
||||
* Title of the note
|
||||
* Does not contain any markup but might be empty
|
||||
* @example "Shopping List"
|
||||
*/
|
||||
@IsString()
|
||||
title: string;
|
||||
|
||||
/**
|
||||
* Description of the note
|
||||
* Does not contain any markup but might be empty
|
||||
* @example Everything I want to buy
|
||||
*/
|
||||
@IsString()
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* List of tags assigned to this note
|
||||
* @example "['shopping', 'personal']
|
||||
*/
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
tags: string[];
|
||||
|
||||
/**
|
||||
* Datestring of the last time this note was updated
|
||||
* @example "2020-12-01 12:23:34"
|
||||
*/
|
||||
@IsDate()
|
||||
updateTime: Date;
|
||||
|
||||
/**
|
||||
* User that last edited the note
|
||||
*/
|
||||
@ValidateNested()
|
||||
updateUser: UserInfoDto;
|
||||
|
||||
/**
|
||||
* Counts how many times the published note has been viewed
|
||||
* @example 42
|
||||
*/
|
||||
@IsNumber()
|
||||
viewCount: number;
|
||||
|
||||
/**
|
||||
* Datestring of the time this note was created
|
||||
* @example "2020-12-01 12:23:34"
|
||||
*/
|
||||
@IsDate()
|
||||
createTime: Date;
|
||||
|
||||
/**
|
||||
* List of usernames that edited the note
|
||||
* @example "['john.smith', 'jane.smith']"
|
||||
*/
|
||||
@IsArray()
|
||||
@ValidateNested()
|
||||
editedBy: UserInfoDto['userName'][];
|
||||
|
||||
/**
|
||||
* Permissions currently in effect for the note
|
||||
*/
|
||||
@ValidateNested()
|
||||
permissions: NotePermissionsDto;
|
||||
}
|
||||
|
||||
export class NoteMetadataUpdateDto {
|
||||
/**
|
||||
* New title of the note
|
||||
* Can not contain any markup and might be empty
|
||||
* @example "Shopping List"
|
||||
*/
|
||||
@IsString()
|
||||
title: string;
|
||||
|
||||
/**
|
||||
* New description of the note
|
||||
* Can not contain any markup but might be empty
|
||||
* @example Everything I want to buy
|
||||
*/
|
||||
@IsString()
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* New list of tags assigned to this note
|
||||
* @example "['shopping', 'personal']
|
||||
*/
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
tags: string[];
|
||||
|
|
Loading…
Reference in a new issue