2021-01-05 16:12:38 -05:00
|
|
|
/*
|
2022-02-13 16:57:08 -05:00
|
|
|
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
2021-01-05 16:12:38 -05:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
2021-08-29 12:45:46 -04:00
|
|
|
import { ApiProperty } from '@nestjs/swagger';
|
2022-03-05 06:02:13 -05:00
|
|
|
import { Type } from 'class-transformer';
|
2020-07-26 14:57:51 -04:00
|
|
|
import { IsArray, IsString, ValidateNested } from 'class-validator';
|
2021-08-29 12:45:46 -04:00
|
|
|
|
2021-05-31 16:02:32 -04:00
|
|
|
import { EditDto } from '../revisions/edit.dto';
|
2022-02-13 16:57:08 -05:00
|
|
|
import { BaseDto } from '../utils/base.dto.';
|
2020-07-26 14:57:51 -04:00
|
|
|
import { NoteMetadataDto } from './note-metadata.dto';
|
|
|
|
|
2022-02-13 16:57:08 -05:00
|
|
|
export class NoteDto extends BaseDto {
|
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 })
|
2022-03-05 06:02:13 -05:00
|
|
|
@Type(() => EditDto)
|
2021-05-31 16:02:32 -04:00
|
|
|
@ApiProperty({ isArray: true, type: EditDto })
|
|
|
|
editedByAtPosition: EditDto[];
|
2020-07-26 14:57:51 -04:00
|
|
|
}
|