2021-03-14 12:47:16 -04:00
|
|
|
/*
|
2022-02-13 16:57:08 -05:00
|
|
|
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
2021-03-14 12:47:16 -04:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
2021-03-19 07:08:34 -04:00
|
|
|
import { ApiProperty } from '@nestjs/swagger';
|
2022-03-05 06:10:41 -05:00
|
|
|
import { Type } from 'class-transformer';
|
2021-08-29 12:45:46 -04:00
|
|
|
import { IsDate, IsOptional, IsString } from 'class-validator';
|
2021-03-14 12:47:16 -04:00
|
|
|
|
2022-02-13 16:57:08 -05:00
|
|
|
import { BaseDto } from '../utils/base.dto.';
|
|
|
|
|
|
|
|
export class MediaUploadDto extends BaseDto {
|
2021-03-14 12:47:16 -04:00
|
|
|
/**
|
|
|
|
* The link to the media file.
|
|
|
|
* @example "https://example.com/uploads/testfile123.jpg"
|
|
|
|
*/
|
|
|
|
@IsString()
|
2021-03-19 07:08:34 -04:00
|
|
|
@ApiProperty()
|
2021-03-14 12:47:16 -04:00
|
|
|
url: string;
|
|
|
|
|
|
|
|
/**
|
2022-09-18 14:38:50 -04:00
|
|
|
* The publicId of the note to which the uploaded file is linked to.
|
2021-03-14 12:47:16 -04:00
|
|
|
* @example "noteId" TODO how looks a note id?
|
|
|
|
*/
|
|
|
|
@IsString()
|
2021-04-29 10:59:40 -04:00
|
|
|
@IsOptional()
|
2021-03-19 07:08:34 -04:00
|
|
|
@ApiProperty()
|
2022-09-18 14:38:50 -04:00
|
|
|
notePublicId: string | null;
|
2021-03-14 12:47:16 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The date when the upload objects was created.
|
|
|
|
* @example "2020-12-01 12:23:34"
|
|
|
|
*/
|
|
|
|
@IsDate()
|
2022-03-05 06:10:41 -05:00
|
|
|
@Type(() => Date)
|
2021-03-19 07:08:34 -04:00
|
|
|
@ApiProperty()
|
2021-03-14 12:47:16 -04:00
|
|
|
createdAt: Date;
|
|
|
|
|
|
|
|
/**
|
2021-10-13 16:28:10 -04:00
|
|
|
* The username of the user which uploaded the media file.
|
2021-03-14 12:47:16 -04:00
|
|
|
* @example "testuser5"
|
|
|
|
*/
|
|
|
|
@IsString()
|
2021-03-19 07:08:34 -04:00
|
|
|
@ApiProperty()
|
2021-10-13 16:28:10 -04:00
|
|
|
username: string;
|
2021-03-14 12:47:16 -04:00
|
|
|
}
|