mirror of
https://github.com/immich-app/immich.git
synced 2026-07-16 05:34:30 +03:00
chore(server): organize integrity dtos (#29191)
This commit is contained in:
@@ -7,13 +7,14 @@ import {
|
||||
IntegrityGetReportDto,
|
||||
IntegrityReportResponseDto,
|
||||
IntegrityReportSummaryResponseDto,
|
||||
IntegrityReportTypeParamDto,
|
||||
} from 'src/dtos/integrity.dto';
|
||||
import { ApiTag, Permission } from 'src/enum';
|
||||
import { Auth, Authenticated, FileResponse } from 'src/middleware/auth.guard';
|
||||
import { LoggingRepository } from 'src/repositories/logging.repository';
|
||||
import { IntegrityService } from 'src/services/integrity.service';
|
||||
import { sendFile } from 'src/utils/file';
|
||||
import { IntegrityReportTypeParamDto, UUIDv7ParamDto } from 'src/validation';
|
||||
import { UUIDv7ParamDto } from 'src/validation';
|
||||
|
||||
@ApiTags(ApiTag.Maintenance)
|
||||
@Controller('admin/integrity')
|
||||
|
||||
@@ -10,8 +10,6 @@ const IntegrityReportSummaryResponseSchema = z
|
||||
})
|
||||
.meta({ id: 'IntegrityReportSummaryResponseDto' });
|
||||
|
||||
export class IntegrityReportSummaryResponseDto extends createZodDto(IntegrityReportSummaryResponseSchema) {}
|
||||
|
||||
const IntegrityGetReportSchema = z
|
||||
.object({
|
||||
type: IntegrityReportSchema,
|
||||
@@ -20,17 +18,14 @@ const IntegrityGetReportSchema = z
|
||||
})
|
||||
.meta({ id: 'IntegrityGetReportDto' });
|
||||
|
||||
export class IntegrityGetReportDto extends createZodDto(IntegrityGetReportSchema) {}
|
||||
|
||||
const IntegrityDeleteReportSchema = z.object({ type: IntegrityReport }).meta({ id: 'IntegrityDeleteReportDto' });
|
||||
|
||||
export class IntegrityDeleteReportDto extends createZodDto(IntegrityDeleteReportSchema) {}
|
||||
|
||||
const IntegrityReportResponseItemSchema = z.object({
|
||||
id: z.uuidv4().describe('Integrity report item id'),
|
||||
type: IntegrityReportSchema,
|
||||
path: z.string().describe('Integrity report item path'),
|
||||
});
|
||||
|
||||
const IntegrityReportResponseSchema = z
|
||||
.object({
|
||||
items: z.array(IntegrityReportResponseItemSchema),
|
||||
@@ -38,4 +33,10 @@ const IntegrityReportResponseSchema = z
|
||||
})
|
||||
.meta({ id: 'IntegrityReportResponseDto' });
|
||||
|
||||
const IntegrityReportParamSchema = z.object({ type: IntegrityReportSchema }).meta({ id: 'IntegrityReportDto' });
|
||||
|
||||
export class IntegrityReportSummaryResponseDto extends createZodDto(IntegrityReportSummaryResponseSchema) {}
|
||||
export class IntegrityGetReportDto extends createZodDto(IntegrityGetReportSchema) {}
|
||||
export class IntegrityDeleteReportDto extends createZodDto(IntegrityDeleteReportSchema) {}
|
||||
export class IntegrityReportResponseDto extends createZodDto(IntegrityReportResponseSchema) {}
|
||||
export class IntegrityReportTypeParamDto extends createZodDto(IntegrityReportParamSchema) {}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { ArgumentMetadata, FileValidator, Injectable, ParseUUIDPipe } from '@nestjs/common';
|
||||
import { createZodDto } from 'nestjs-zod';
|
||||
import sanitize from 'sanitize-filename';
|
||||
import { IntegrityReportSchema } from 'src/enum';
|
||||
import { isIP, isIPRange } from 'validator';
|
||||
import z from 'zod';
|
||||
|
||||
@@ -132,10 +131,6 @@ const FilenameParamSchema = z.object({
|
||||
|
||||
export class FilenameParamDto extends createZodDto(FilenameParamSchema) {}
|
||||
|
||||
const IntegrityReportParamSchema = z.object({ type: IntegrityReportSchema }).meta({ id: 'IntegrityReportDto' });
|
||||
|
||||
export class IntegrityReportTypeParamDto extends createZodDto(IntegrityReportParamSchema) {}
|
||||
|
||||
/**
|
||||
* Unified email validation
|
||||
* Converts email strings to lowercase and validates against HTML5 email regex
|
||||
|
||||
Reference in New Issue
Block a user