Skip to content

Commit

Permalink
refactor: migrate shared-link repository to kysely
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldietzler committed Jan 12, 2025
1 parent cab2012 commit 6d7c7d4
Show file tree
Hide file tree
Showing 6 changed files with 386 additions and 402 deletions.
10 changes: 6 additions & 4 deletions server/src/interfaces/shared-link.interface.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
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 | null>;
getByKey(key: Buffer): Promise<SharedLinkEntity | null>;
create(entity: Partial<SharedLinkEntity>): Promise<SharedLinkEntity>;
update(entity: Partial<SharedLinkEntity>): 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>;
}
Loading

0 comments on commit 6d7c7d4

Please sign in to comment.