mirror of
https://github.com/immich-app/immich.git
synced 2025-06-23 15:30:51 -04:00
* wip: search * wip: getByToken * wip: getByToken * wip: getByUserId * wip: create/update/delete * remove unused code * clean up and pr feedback * fix: test * fix: e2e test * pr feedback
18 lines
664 B
TypeScript
18 lines
664 B
TypeScript
import { Insertable, Updateable } from 'kysely';
|
|
import { Sessions } from 'src/db';
|
|
import { SessionEntity } from 'src/entities/session.entity';
|
|
|
|
export const ISessionRepository = 'ISessionRepository';
|
|
|
|
type E = SessionEntity;
|
|
export type SessionSearchOptions = { updatedBefore: Date };
|
|
|
|
export interface ISessionRepository {
|
|
search(options: SessionSearchOptions): Promise<SessionEntity[]>;
|
|
create(dto: Insertable<Sessions>): Promise<SessionEntity>;
|
|
update(id: string, dto: Updateable<Sessions>): Promise<SessionEntity>;
|
|
delete(id: string): Promise<void>;
|
|
getByToken(token: string): Promise<E | undefined>;
|
|
getByUserId(userId: string): Promise<E[]>;
|
|
}
|