mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00:00
chore: deprecate (#21791)
This commit is contained in:
parent
f7d9215464
commit
7e377d3e42
7 changed files with 23 additions and 10 deletions
BIN
mobile/openapi/README.md
generated
BIN
mobile/openapi/README.md
generated
Binary file not shown.
BIN
mobile/openapi/lib/api/assets_api.dart
generated
BIN
mobile/openapi/lib/api/assets_api.dart
generated
Binary file not shown.
BIN
mobile/openapi/lib/api/deprecated_api.dart
generated
BIN
mobile/openapi/lib/api/deprecated_api.dart
generated
Binary file not shown.
|
|
@ -2504,7 +2504,8 @@
|
||||||
"description": "This endpoint requires the `asset.download` permission."
|
"description": "This endpoint requires the `asset.download` permission."
|
||||||
},
|
},
|
||||||
"put": {
|
"put": {
|
||||||
"description": "Replace the asset with new file, without changing its id. This endpoint requires the `asset.replace` permission.",
|
"deprecated": true,
|
||||||
|
"description": "This property was deprecated in v1.142.0. Replace the asset with new file, without changing its id. This endpoint requires the `asset.replace` permission.",
|
||||||
"operationId": "replaceAsset",
|
"operationId": "replaceAsset",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
|
|
@ -2566,12 +2567,14 @@
|
||||||
"api_key": []
|
"api_key": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"summary": "replaceAsset",
|
"summary": "Replace the asset with new file, without changing its id",
|
||||||
"tags": [
|
"tags": [
|
||||||
"Assets"
|
"Assets",
|
||||||
|
"Deprecated"
|
||||||
],
|
],
|
||||||
"x-immich-lifecycle": {
|
"x-immich-lifecycle": {
|
||||||
"addedAt": "v1.106.0"
|
"addedAt": "v1.106.0",
|
||||||
|
"deprecatedAt": "v1.142.0"
|
||||||
},
|
},
|
||||||
"x-immich-permission": "asset.replace"
|
"x-immich-permission": "asset.replace"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2368,7 +2368,7 @@ export function downloadAsset({ id, key, slug }: {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* replaceAsset
|
* Replace the asset with new file, without changing its id
|
||||||
*/
|
*/
|
||||||
export function replaceAsset({ id, key, slug, assetMediaReplaceDto }: {
|
export function replaceAsset({ id, key, slug, assetMediaReplaceDto }: {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,9 @@ export class AssetMediaController {
|
||||||
@Put(':id/original')
|
@Put(':id/original')
|
||||||
@UseInterceptors(FileUploadInterceptor)
|
@UseInterceptors(FileUploadInterceptor)
|
||||||
@ApiConsumes('multipart/form-data')
|
@ApiConsumes('multipart/form-data')
|
||||||
@EndpointLifecycle({ addedAt: 'v1.106.0' })
|
@EndpointLifecycle({
|
||||||
@ApiOperation({
|
addedAt: 'v1.106.0',
|
||||||
|
deprecatedAt: 'v1.142.0',
|
||||||
summary: 'replaceAsset',
|
summary: 'replaceAsset',
|
||||||
description: 'Replace the asset with new file, without changing its id',
|
description: 'Replace the asset with new file, without changing its id',
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { SetMetadata, applyDecorators } from '@nestjs/common';
|
import { SetMetadata, applyDecorators } from '@nestjs/common';
|
||||||
import { ApiExtension, ApiOperation, ApiProperty, ApiTags } from '@nestjs/swagger';
|
import { ApiExtension, ApiOperation, ApiOperationOptions, ApiProperty, ApiTags } from '@nestjs/swagger';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { ADDED_IN_PREFIX, DEPRECATED_IN_PREFIX, LIFECYCLE_EXTENSION } from 'src/constants';
|
import { ADDED_IN_PREFIX, DEPRECATED_IN_PREFIX, LIFECYCLE_EXTENSION } from 'src/constants';
|
||||||
import { ImmichWorker, JobName, MetadataKey, QueueName } from 'src/enum';
|
import { ImmichWorker, JobName, MetadataKey, QueueName } from 'src/enum';
|
||||||
|
|
@ -159,12 +159,21 @@ type LifecycleMetadata = {
|
||||||
deprecatedAt?: LifecycleRelease;
|
deprecatedAt?: LifecycleRelease;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const EndpointLifecycle = ({ addedAt, deprecatedAt }: LifecycleMetadata) => {
|
export const EndpointLifecycle = ({
|
||||||
|
addedAt,
|
||||||
|
deprecatedAt,
|
||||||
|
description,
|
||||||
|
...options
|
||||||
|
}: LifecycleMetadata & ApiOperationOptions) => {
|
||||||
const decorators: MethodDecorator[] = [ApiExtension(LIFECYCLE_EXTENSION, { addedAt, deprecatedAt })];
|
const decorators: MethodDecorator[] = [ApiExtension(LIFECYCLE_EXTENSION, { addedAt, deprecatedAt })];
|
||||||
if (deprecatedAt) {
|
if (deprecatedAt) {
|
||||||
decorators.push(
|
decorators.push(
|
||||||
ApiTags('Deprecated'),
|
ApiTags('Deprecated'),
|
||||||
ApiOperation({ deprecated: true, description: DEPRECATED_IN_PREFIX + deprecatedAt }),
|
ApiOperation({
|
||||||
|
deprecated: true,
|
||||||
|
description: DEPRECATED_IN_PREFIX + deprecatedAt + (description ? `. ${description}` : ''),
|
||||||
|
...options,
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue