fix(server): don't expose source types in face creation api (#16381)

* don't expose source types in face creation api

* update open-api

* remove source type reference from web
This commit is contained in:
Mert 2025-02-27 17:17:07 +03:00 committed by GitHub
parent 967c69317b
commit 7d6cfd09e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 3 additions and 18 deletions

Binary file not shown.

View File

@ -8301,14 +8301,6 @@
"format": "uuid",
"type": "string"
},
"sourceType": {
"allOf": [
{
"$ref": "#/components/schemas/SourceType"
}
],
"default": "manual"
},
"width": {
"type": "integer"
},
@ -8325,7 +8317,6 @@
"imageHeight",
"imageWidth",
"personId",
"sourceType",
"width",
"x",
"y"

View File

@ -529,7 +529,6 @@ export type AssetFaceCreateDto = {
imageHeight: number;
imageWidth: number;
personId: string;
sourceType: SourceType;
width: number;
x: number;
y: number;

View File

@ -1,6 +1,6 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsArray, IsEnum, IsInt, IsNotEmpty, IsNumber, IsString, Max, Min, ValidateNested } from 'class-validator';
import { IsArray, IsInt, IsNotEmpty, IsNumber, IsString, Max, Min, ValidateNested } from 'class-validator';
import { DateTime } from 'luxon';
import { PropertyLifecycle } from 'src/decorators';
import { AuthDto } from 'src/dtos/auth.dto';
@ -194,10 +194,6 @@ export class AssetFaceCreateDto extends AssetFaceUpdateItem {
@IsNotEmpty()
@IsNumber()
height!: number;
@ApiProperty({ type: 'string', enum: SourceType, enumName: 'SourceType' })
@IsEnum(SourceType)
sourceType: SourceType = SourceType.MANUAL;
}
export class AssetFaceDeleteDto {

View File

@ -736,7 +736,7 @@ export class PersonService extends BaseService {
boundingBoxX2: dto.x + dto.width,
boundingBoxY1: dto.y,
boundingBoxY2: dto.y + dto.height,
sourceType: dto.sourceType,
sourceType: SourceType.MANUAL,
});
}

View File

@ -4,7 +4,7 @@
import { notificationController } from '$lib/components/shared-components/notification/notification';
import { isFaceEditMode } from '$lib/stores/face-edit.svelte';
import { getPeopleThumbnailUrl } from '$lib/utils';
import { getAllPeople, createFace, type PersonResponseDto, SourceType } from '@immich/sdk';
import { getAllPeople, createFace, type PersonResponseDto } from '@immich/sdk';
import { Button } from '@immich/ui';
import { Canvas, InteractiveFabricObject, Rect } from 'fabric';
import { onMount } from 'svelte';
@ -288,7 +288,6 @@
assetFaceCreateDto: {
assetId,
personId: person.id,
sourceType: SourceType.Manual,
...data,
},
});