2023-03-30 15:38:55 -04:00
|
|
|
import { AssetEntity, AssetType } from '@app/infra/entities';
|
2023-02-25 09:12:03 -05:00
|
|
|
|
2023-03-02 21:47:08 -05:00
|
|
|
export interface AssetSearchOptions {
|
|
|
|
|
isVisible?: boolean;
|
2023-03-20 11:55:28 -04:00
|
|
|
type?: AssetType;
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-04 00:48:05 -04:00
|
|
|
export interface LivePhotoSearchOptions {
|
|
|
|
|
ownerId: string;
|
|
|
|
|
livePhotoCID: string;
|
|
|
|
|
otherAssetId: string;
|
|
|
|
|
type: AssetType;
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-20 11:55:28 -04:00
|
|
|
export enum WithoutProperty {
|
|
|
|
|
THUMBNAIL = 'thumbnail',
|
|
|
|
|
ENCODED_VIDEO = 'encoded-video',
|
|
|
|
|
EXIF = 'exif',
|
|
|
|
|
CLIP_ENCODING = 'clip-embedding',
|
|
|
|
|
OBJECT_TAGS = 'object-tags',
|
2023-03-02 21:47:08 -05:00
|
|
|
}
|
|
|
|
|
|
2023-02-25 09:12:03 -05:00
|
|
|
export const IAssetRepository = 'IAssetRepository';
|
|
|
|
|
|
|
|
|
|
export interface IAssetRepository {
|
2023-03-18 08:44:42 -05:00
|
|
|
getByIds(ids: string[]): Promise<AssetEntity[]>;
|
2023-03-20 11:55:28 -04:00
|
|
|
getWithout(property: WithoutProperty): Promise<AssetEntity[]>;
|
2023-03-26 04:46:48 +02:00
|
|
|
getFirstAssetForAlbumId(albumId: string): Promise<AssetEntity | null>;
|
2023-02-25 09:12:03 -05:00
|
|
|
deleteAll(ownerId: string): Promise<void>;
|
2023-03-02 21:47:08 -05:00
|
|
|
getAll(options?: AssetSearchOptions): Promise<AssetEntity[]>;
|
2023-02-25 09:12:03 -05:00
|
|
|
save(asset: Partial<AssetEntity>): Promise<AssetEntity>;
|
2023-04-04 00:48:05 -04:00
|
|
|
findLivePhotoMatch(options: LivePhotoSearchOptions): Promise<AssetEntity | null>;
|
2023-02-25 09:12:03 -05:00
|
|
|
}
|