mirror of
https://github.com/immich-app/immich.git
synced 2025-12-02 11:15:30 -05:00
* fix(server): stacked assets for full sync, userIds as array for delta sync * refactor(server): sync * fix getDeltaSync after partner removal --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
38 lines
817 B
TypeScript
38 lines
817 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsInt, IsPositive } from 'class-validator';
|
|
import { AssetResponseDto } from 'src/dtos/asset-response.dto';
|
|
import { ValidateDate, ValidateUUID } from 'src/validation';
|
|
|
|
export class AssetFullSyncDto {
|
|
@ValidateUUID({ optional: true })
|
|
lastId?: string;
|
|
|
|
@ValidateDate({ optional: true })
|
|
lastCreationDate?: Date;
|
|
|
|
@ValidateDate()
|
|
updatedUntil!: Date;
|
|
|
|
@IsInt()
|
|
@IsPositive()
|
|
@ApiProperty({ type: 'integer' })
|
|
limit!: number;
|
|
|
|
@ValidateUUID({ optional: true })
|
|
userId?: string;
|
|
}
|
|
|
|
export class AssetDeltaSyncDto {
|
|
@ValidateDate()
|
|
updatedAfter!: Date;
|
|
|
|
@ValidateUUID({ each: true })
|
|
userIds!: string[];
|
|
}
|
|
|
|
export class AssetDeltaSyncResponseDto {
|
|
needsFullSync!: boolean;
|
|
upserted!: AssetResponseDto[];
|
|
deleted!: string[];
|
|
}
|