Add single-image zk and hotlink upload API with service tests.
Replace batch DTOs with per-mode endpoints, persist ciphertext with file-type checks, and return a hashed delete token for future revocation.
This commit is contained in:
@@ -1,19 +1,9 @@
|
||||
import { Type } from 'class-transformer';
|
||||
import { ArrayMaxSize, ArrayMinSize, IsArray, IsNotEmpty, ValidateNested } from 'class-validator';
|
||||
import { getAppConfig } from '../../../config';
|
||||
import { CreateHotlinkUploadItemDto } from './CreateHotlinkUploadItemDto';
|
||||
import { UploadBatchOptionsDto } from './UploadBatchOptionsDto';
|
||||
import { IsMimeType, IsNotEmpty, IsString } from 'class-validator';
|
||||
import { UploadCiphertextOptionsDto } from './UploadCiphertextOptionsDto';
|
||||
|
||||
const {
|
||||
validation: { maxImagesPerUpload }
|
||||
} = getAppConfig();
|
||||
|
||||
export class CreateHotlinkUploadDto extends UploadBatchOptionsDto {
|
||||
export class CreateHotlinkUploadDto extends UploadCiphertextOptionsDto {
|
||||
@IsNotEmpty()
|
||||
@IsArray()
|
||||
@ArrayMinSize(1)
|
||||
@ArrayMaxSize(maxImagesPerUpload)
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => CreateHotlinkUploadItemDto)
|
||||
items: CreateHotlinkUploadItemDto[];
|
||||
@IsString()
|
||||
@IsMimeType()
|
||||
mimeType: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user