mirror of
https://github.com/immich-app/immich.git
synced 2025-01-09 05:16:47 +01:00
b588a87d4a
rename domain repositories
16 lines
610 B
TypeScript
16 lines
610 B
TypeScript
import { APIKeyEntity } from 'src/entities/api-key.entity';
|
|
|
|
export const IKeyRepository = 'IKeyRepository';
|
|
|
|
export interface IKeyRepository {
|
|
create(dto: Partial<APIKeyEntity>): Promise<APIKeyEntity>;
|
|
update(userId: string, id: string, dto: Partial<APIKeyEntity>): Promise<APIKeyEntity>;
|
|
delete(userId: string, id: string): Promise<void>;
|
|
/**
|
|
* Includes the hashed `key` for verification
|
|
* @param id
|
|
*/
|
|
getKey(hashedToken: string): Promise<APIKeyEntity | null>;
|
|
getById(userId: string, id: string): Promise<APIKeyEntity | null>;
|
|
getByUserId(userId: string): Promise<APIKeyEntity[]>;
|
|
}
|