2025-01-18 20:25:15 +01:00
|
|
|
import { Insertable, Updateable } from 'kysely';
|
|
|
|
|
import { SharedLinks } from 'src/db';
|
2024-03-20 16:02:51 -05:00
|
|
|
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
|
2023-01-25 11:35:28 -05:00
|
|
|
|
|
|
|
|
export const ISharedLinkRepository = 'ISharedLinkRepository';
|
|
|
|
|
|
|
|
|
|
export interface ISharedLinkRepository {
|
|
|
|
|
getAll(userId: string): Promise<SharedLinkEntity[]>;
|
2025-01-18 20:25:15 +01:00
|
|
|
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>;
|
2023-05-15 20:30:53 +03:00
|
|
|
remove(entity: SharedLinkEntity): Promise<void>;
|
2023-01-25 11:35:28 -05:00
|
|
|
}
|