mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
refactor: api key repository (#15491)
This commit is contained in:
parent
1745f48f3d
commit
9a1068c867
12 changed files with 44 additions and 72 deletions
|
|
@ -2,6 +2,7 @@ import { UserEntity } from 'src/entities/user.entity';
|
|||
import { Permission } from 'src/enum';
|
||||
import { AccessRepository } from 'src/repositories/access.repository';
|
||||
import { ActivityRepository } from 'src/repositories/activity.repository';
|
||||
import { ApiKeyRepository } from 'src/repositories/api-key.repository';
|
||||
|
||||
export type AuthApiKey = {
|
||||
id: string;
|
||||
|
|
@ -14,7 +15,13 @@ export type RepositoryInterface<T extends object> = Pick<T, keyof T>;
|
|||
|
||||
export type IActivityRepository = RepositoryInterface<ActivityRepository>;
|
||||
export type IAccessRepository = { [K in keyof AccessRepository]: RepositoryInterface<AccessRepository[K]> };
|
||||
export type IApiKeyRepository = RepositoryInterface<ApiKeyRepository>;
|
||||
|
||||
export type ActivityItem =
|
||||
| Awaited<ReturnType<IActivityRepository['create']>>
|
||||
| Awaited<ReturnType<IActivityRepository['search']>>[0];
|
||||
|
||||
export type ApiKeyItem =
|
||||
| Awaited<ReturnType<IApiKeyRepository['create']>>
|
||||
| NonNullable<Awaited<ReturnType<IApiKeyRepository['getById']>>>
|
||||
| Awaited<ReturnType<IApiKeyRepository['getByUserId']>>[0];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue