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-26 14:57:51 -04:00
|
|
|
import { IsArray, IsString, ValidateNested } from 'class-validator';
|
2021-05-31 16:02:32 -04:00
|
|
|
import { EditDto } from '../revisions/edit.dto';
|
2020-07-26 14:57:51 -04:00
|
|
|
import { NoteMetadataDto } from './note-metadata.dto';
|
2021-03-19 07:08:34 -04:00
|
|
|
import { ApiProperty } from '@nestjs/swagger';
|
2020-07-26 14:57:51 -04:00
|
|
|
|
|
|
|
export class NoteDto {
|
2021-01-25 16:45:34 -05:00
|
|
|
/**
|
|
|
|
* Markdown content of the note
|
|
|
|
* @example "# I am a heading"
|
|
|
|
*/
|
2020-07-26 14:57:51 -04:00
|
|
|
@IsString()
|
2021-03-19 07:08:34 -04:00
|
|
|
@ApiProperty()
|
2020-07-26 14:57:51 -04:00
|
|
|
content: string;
|
|
|
|
|
2021-01-25 16:45:34 -05:00
|
|
|
/**
|
|
|
|
* Metadata of the note
|
|
|
|
*/
|
2020-07-26 14:57:51 -04:00
|
|
|
@ValidateNested()
|
2021-03-19 07:08:34 -04:00
|
|
|
@ApiProperty({ type: NoteMetadataDto })
|
2020-09-19 08:54:08 -04:00
|
|
|
metadata: NoteMetadataDto;
|
2020-07-26 14:57:51 -04:00
|
|
|
|
2021-01-25 16:45:34 -05:00
|
|
|
/**
|
2021-05-31 15:46:41 -04:00
|
|
|
* Edit information of this note
|
2021-01-25 16:45:34 -05:00
|
|
|
*/
|
2020-07-26 14:57:51 -04:00
|
|
|
@IsArray()
|
|
|
|
@ValidateNested({ each: true })
|
2021-05-31 16:02:32 -04:00
|
|
|
@ApiProperty({ isArray: true, type: EditDto })
|
|
|
|
editedByAtPosition: EditDto[];
|
2020-07-26 14:57:51 -04:00
|
|
|
}
|