mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore(server): remove deprecated endpoints (#6984)
* chore: remove deprecated endpoints * chore: open api
This commit is contained in:
parent
198e8517e5
commit
90a7f16817
36 changed files with 168 additions and 2905 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import {
|
||||
AssetBulkDeleteDto,
|
||||
AssetBulkUpdateDto,
|
||||
AssetIdsDto,
|
||||
AssetJobsDto,
|
||||
AssetResponseDto,
|
||||
AssetSearchDto,
|
||||
|
|
@ -9,10 +8,7 @@ import {
|
|||
AssetStatsDto,
|
||||
AssetStatsResponseDto,
|
||||
AuthDto,
|
||||
BulkIdsDto,
|
||||
DeviceIdDto,
|
||||
DownloadInfoDto,
|
||||
DownloadResponseDto,
|
||||
DownloadService,
|
||||
MapMarkerDto,
|
||||
MapMarkerResponseDto,
|
||||
|
|
@ -26,25 +22,10 @@ import {
|
|||
UpdateAssetDto as UpdateDto,
|
||||
UpdateStackParentDto,
|
||||
} from '@app/domain';
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
HttpCode,
|
||||
HttpStatus,
|
||||
Next,
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
Query,
|
||||
Res,
|
||||
StreamableFile,
|
||||
} from '@nestjs/common';
|
||||
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put, Query } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { NextFunction, Response } from 'express';
|
||||
import { Auth, Authenticated, FileResponse, SharedLinkRoute } from '../app.guard';
|
||||
import { UseValidation, asStreamableFile, sendFile } from '../app.utils';
|
||||
import { Auth, Authenticated, SharedLinkRoute } from '../app.guard';
|
||||
import { UseValidation } from '../app.utils';
|
||||
import { Route } from '../interceptors';
|
||||
import { UUIDParamDto } from './dto/uuid-param.dto';
|
||||
|
||||
|
|
@ -87,42 +68,6 @@ export class AssetController {
|
|||
return this.service.getRandom(auth, dto.count ?? 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use `/download/info`
|
||||
*/
|
||||
@SharedLinkRoute()
|
||||
@Post('download/info')
|
||||
getDownloadInfoOld(@Auth() auth: AuthDto, @Body() dto: DownloadInfoDto): Promise<DownloadResponseDto> {
|
||||
return this.downloadService.getDownloadInfo(auth, dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use `/download/archive`
|
||||
*/
|
||||
@SharedLinkRoute()
|
||||
@Post('download/archive')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@FileResponse()
|
||||
downloadArchiveOld(@Auth() auth: AuthDto, @Body() dto: AssetIdsDto): Promise<StreamableFile> {
|
||||
return this.downloadService.downloadArchive(auth, dto).then(asStreamableFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use `/download/:id`
|
||||
*/
|
||||
@SharedLinkRoute()
|
||||
@Post('download/:id')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@FileResponse()
|
||||
async downloadFileOld(
|
||||
@Res() res: Response,
|
||||
@Next() next: NextFunction,
|
||||
@Auth() auth: AuthDto,
|
||||
@Param() { id }: UUIDParamDto,
|
||||
) {
|
||||
await sendFile(res, next, () => this.downloadService.downloadFile(auth, id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all asset of a device that are in the database, ID only.
|
||||
*/
|
||||
|
|
@ -166,33 +111,6 @@ export class AssetController {
|
|||
return this.service.deleteAll(auth, dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use `POST /trash/restore/assets`
|
||||
*/
|
||||
@Post('restore')
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
restoreAssetsOld(@Auth() auth: AuthDto, @Body() dto: BulkIdsDto): Promise<void> {
|
||||
return this.trashService.restoreAssets(auth, dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use `POST /trash/empty`
|
||||
*/
|
||||
@Post('trash/empty')
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
emptyTrashOld(@Auth() auth: AuthDto): Promise<void> {
|
||||
return this.trashService.empty(auth);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use `POST /trash/restore`
|
||||
*/
|
||||
@Post('trash/restore')
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
restoreTrashOld(@Auth() auth: AuthDto): Promise<void> {
|
||||
return this.trashService.restore(auth);
|
||||
}
|
||||
|
||||
@Put('stack/parent')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
updateStackParent(@Auth() auth: AuthDto, @Body() dto: UpdateStackParentDto): Promise<void> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue