mirror of
https://github.com/immich-app/immich.git
synced 2025-12-19 17:23:21 +03:00
* refactor(server): system config * fix: jest circular import * chore: ignore migrations in coverage report * chore: tests * chore: tests * chore: todo note * chore: remove vite config backup * chore: fix redis hostname
17 lines
596 B
TypeScript
17 lines
596 B
TypeScript
import { APIKeyEntity } from '@app/infra/db/entities';
|
|
|
|
export const IKeyRepository = 'IKeyRepository';
|
|
|
|
export interface IKeyRepository {
|
|
create(dto: Partial<APIKeyEntity>): Promise<APIKeyEntity>;
|
|
update(userId: string, id: number, dto: Partial<APIKeyEntity>): Promise<APIKeyEntity>;
|
|
delete(userId: string, id: number): Promise<void>;
|
|
/**
|
|
* Includes the hashed `key` for verification
|
|
* @param id
|
|
*/
|
|
getKey(id: number): Promise<APIKeyEntity | null>;
|
|
getById(userId: string, id: number): Promise<APIKeyEntity | null>;
|
|
getByUserId(userId: string): Promise<APIKeyEntity[]>;
|
|
}
|