2023-08-04 17:07:15 -04:00
|
|
|
import { ApiProperty } from '@nestjs/swagger';
|
2025-05-19 17:40:48 -04:00
|
|
|
|
|
|
|
|
import { IsEnum, IsInt, IsString, Min } from 'class-validator';
|
2025-05-06 12:12:48 -05:00
|
|
|
import { AssetOrder, AssetVisibility } from 'src/enum';
|
|
|
|
|
import { Optional, ValidateAssetVisibility, ValidateBoolean, ValidateUUID } from 'src/validation';
|
2023-08-04 17:07:15 -04:00
|
|
|
|
|
|
|
|
export class TimeBucketDto {
|
|
|
|
|
@ValidateUUID({ optional: true })
|
|
|
|
|
userId?: string;
|
|
|
|
|
|
|
|
|
|
@ValidateUUID({ optional: true })
|
|
|
|
|
albumId?: string;
|
|
|
|
|
|
2023-08-05 09:58:52 -04:00
|
|
|
@ValidateUUID({ optional: true })
|
|
|
|
|
personId?: string;
|
|
|
|
|
|
2024-08-29 12:14:03 -04:00
|
|
|
@ValidateUUID({ optional: true })
|
|
|
|
|
tagId?: string;
|
|
|
|
|
|
2024-03-07 22:59:02 -05:00
|
|
|
@ValidateBoolean({ optional: true })
|
2023-08-04 17:07:15 -04:00
|
|
|
isFavorite?: boolean;
|
2023-10-06 07:01:14 +00:00
|
|
|
|
2024-03-07 22:59:02 -05:00
|
|
|
@ValidateBoolean({ optional: true })
|
2023-10-06 07:01:14 +00:00
|
|
|
isTrashed?: boolean;
|
2023-10-27 15:34:01 -05:00
|
|
|
|
2024-03-07 22:59:02 -05:00
|
|
|
@ValidateBoolean({ optional: true })
|
2023-10-27 15:34:01 -05:00
|
|
|
withStacked?: boolean;
|
2023-11-11 15:06:19 -06:00
|
|
|
|
2024-03-07 22:59:02 -05:00
|
|
|
@ValidateBoolean({ optional: true })
|
2023-11-11 15:06:19 -06:00
|
|
|
withPartners?: boolean;
|
2024-03-14 17:45:03 +01:00
|
|
|
|
|
|
|
|
@IsEnum(AssetOrder)
|
|
|
|
|
@Optional()
|
|
|
|
|
@ApiProperty({ enum: AssetOrder, enumName: 'AssetOrder' })
|
|
|
|
|
order?: AssetOrder;
|
2025-05-06 12:12:48 -05:00
|
|
|
|
|
|
|
|
@ValidateAssetVisibility({ optional: true })
|
|
|
|
|
visibility?: AssetVisibility;
|
2023-08-04 17:07:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class TimeBucketAssetDto extends TimeBucketDto {
|
|
|
|
|
@IsString()
|
|
|
|
|
timeBucket!: string;
|
2025-05-19 17:40:48 -04:00
|
|
|
|
|
|
|
|
@IsInt()
|
|
|
|
|
@Min(1)
|
|
|
|
|
@Optional()
|
|
|
|
|
page?: number;
|
|
|
|
|
|
|
|
|
|
@IsInt()
|
|
|
|
|
@Min(1)
|
|
|
|
|
@Optional()
|
|
|
|
|
pageSize?: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class TimelineStackResponseDto {
|
|
|
|
|
id!: string;
|
|
|
|
|
primaryAssetId!: string;
|
|
|
|
|
assetCount!: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class TimeBucketAssetResponseDto {
|
|
|
|
|
id!: string[];
|
|
|
|
|
|
|
|
|
|
ownerId!: string[];
|
|
|
|
|
|
|
|
|
|
ratio!: number[];
|
|
|
|
|
|
|
|
|
|
isFavorite!: boolean[];
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ enum: AssetVisibility, enumName: 'AssetVisibility', isArray: true })
|
|
|
|
|
visibility!: AssetVisibility[];
|
|
|
|
|
|
|
|
|
|
isTrashed!: boolean[];
|
|
|
|
|
|
|
|
|
|
isImage!: boolean[];
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ type: 'array', items: { type: 'string', nullable: true } })
|
|
|
|
|
thumbhash!: (string | null)[];
|
|
|
|
|
|
|
|
|
|
localDateTime!: string[];
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ type: 'array', items: { type: 'string', nullable: true } })
|
|
|
|
|
duration!: (string | null)[];
|
|
|
|
|
|
|
|
|
|
@ApiProperty({
|
|
|
|
|
type: 'array',
|
|
|
|
|
items: {
|
|
|
|
|
type: 'array',
|
|
|
|
|
items: { type: 'string' },
|
|
|
|
|
minItems: 2,
|
|
|
|
|
maxItems: 2,
|
|
|
|
|
nullable: true,
|
|
|
|
|
},
|
|
|
|
|
description: '(stack ID, stack asset count) tuple',
|
|
|
|
|
})
|
|
|
|
|
stack?: ([string, string] | null)[];
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ type: 'array', items: { type: 'string', nullable: true } })
|
|
|
|
|
projectionType!: (string | null)[];
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ type: 'array', items: { type: 'string', nullable: true } })
|
|
|
|
|
livePhotoVideoId!: (string | null)[];
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ type: 'array', items: { type: 'string', nullable: true } })
|
|
|
|
|
city!: (string | null)[];
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ type: 'array', items: { type: 'string', nullable: true } })
|
|
|
|
|
country!: (string | null)[];
|
2023-08-04 17:07:15 -04:00
|
|
|
}
|
2024-03-20 23:53:07 +01:00
|
|
|
|
2025-05-19 17:40:48 -04:00
|
|
|
export class TimeBucketsResponseDto {
|
2024-03-20 23:53:07 +01:00
|
|
|
@ApiProperty({ type: 'string' })
|
|
|
|
|
timeBucket!: string;
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
|
count!: number;
|
|
|
|
|
}
|