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 a86c381
Show file tree
Hide file tree
Showing 5 changed files with 338 additions and 399 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 } 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: Partial<SharedLinkEntity> & { id: string }): Promise<SharedLinkEntity>;
remove(entity: SharedLinkEntity): Promise<void>;
}
Loading

0 comments on commit a86c381

Please sign in to comment.