mirror of
https://github.com/immich-app/immich.git
synced 2025-06-10 17:14:40 -04:00
* refactor: migrate shared-link repository to kysely * fix duplicate individual shared link return in getAll when there are more than 1 asset in the shared link * using correct order condition * using eb.table --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
15 lines
710 B
TypeScript
15 lines
710 B
TypeScript
import { Insertable, Updateable } from 'kysely';
|
|
import { SharedLinks } from 'src/db';
|
|
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
|
|
|
|
export const ISharedLinkRepository = 'ISharedLinkRepository';
|
|
|
|
export interface ISharedLinkRepository {
|
|
getAll(userId: string): Promise<SharedLinkEntity[]>;
|
|
get(userId: string, id: string): Promise<SharedLinkEntity | undefined>;
|
|
getByKey(key: Buffer): Promise<SharedLinkEntity | undefined>;
|
|
create(entity: Insertable<SharedLinks> & { assetIds?: string[] }): Promise<SharedLinkEntity>;
|
|
update(entity: Updateable<SharedLinks> & { id: string; assetIds?: string[] }): Promise<SharedLinkEntity>;
|
|
remove(entity: SharedLinkEntity): Promise<void>;
|
|
}
|