mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor: database types (#17468)
This commit is contained in:
parent
ac65d46ec6
commit
4794eeca88
9 changed files with 44 additions and 39 deletions
|
|
@ -14,8 +14,6 @@ import {
|
|||
VideoCodec,
|
||||
} from 'src/enum';
|
||||
import { ActivityRepository } from 'src/repositories/activity.repository';
|
||||
import { ApiKeyRepository } from 'src/repositories/api-key.repository';
|
||||
import { MemoryRepository } from 'src/repositories/memory.repository';
|
||||
import { SearchRepository } from 'src/repositories/search.repository';
|
||||
import { SessionRepository } from 'src/repositories/session.repository';
|
||||
|
||||
|
|
@ -24,8 +22,6 @@ export type DeepPartial<T> = T extends object ? { [K in keyof T]?: DeepPartial<T
|
|||
export type RepositoryInterface<T extends object> = Pick<T, keyof T>;
|
||||
|
||||
type IActivityRepository = RepositoryInterface<ActivityRepository>;
|
||||
type IApiKeyRepository = RepositoryInterface<ApiKeyRepository>;
|
||||
type IMemoryRepository = RepositoryInterface<MemoryRepository>;
|
||||
type ISearchRepository = RepositoryInterface<SearchRepository>;
|
||||
type ISessionRepository = RepositoryInterface<SessionRepository>;
|
||||
|
||||
|
|
@ -35,26 +31,8 @@ export type ActivityItem =
|
|||
|
||||
export type SearchPlacesItem = Awaited<ReturnType<ISearchRepository['searchPlaces']>>[0];
|
||||
|
||||
export type ApiKeyItem =
|
||||
| Awaited<ReturnType<IApiKeyRepository['create']>>
|
||||
| NonNullable<Awaited<ReturnType<IApiKeyRepository['getById']>>>
|
||||
| Awaited<ReturnType<IApiKeyRepository['getByUserId']>>[0];
|
||||
|
||||
export type MemoryItem =
|
||||
| Awaited<ReturnType<IMemoryRepository['create']>>
|
||||
| Awaited<ReturnType<IMemoryRepository['search']>>[0];
|
||||
|
||||
export type SessionItem = Awaited<ReturnType<ISessionRepository['getByUserId']>>[0];
|
||||
|
||||
export type TagItem = {
|
||||
id: string;
|
||||
value: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
color: string | null;
|
||||
parentId: string | null;
|
||||
};
|
||||
|
||||
export interface CropOptions {
|
||||
top: number;
|
||||
left: number;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue