-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: migrate shared-link repository to kysely
- Loading branch information
1 parent
cab2012
commit 6d7c7d4
Showing
6 changed files
with
386 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
} |
Oops, something went wrong.