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