refactor: database types (#17468)

This commit is contained in:
Jason Rasmussen 2025-04-08 12:40:03 -04:00 committed by GitHub
parent ac65d46ec6
commit 4794eeca88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 44 additions and 39 deletions

View file

@ -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;