@foal/typeorm
Version:
FoalTS integration of TypeORM
30 lines (29 loc) • 976 B
TypeScript
import { SessionState, SessionStore } from '@foal/core';
import { BaseEntity } from 'typeorm';
export declare class DatabaseSession extends BaseEntity {
id: string;
user_id: number;
content: string;
flash: string;
updated_at: number;
created_at: number;
}
/**
* TypeORM store.
*
* @export
* @class TypeORMStore
* @extends {SessionStore}
*/
export declare class TypeORMStore extends SessionStore {
private get repository();
save(state: SessionState, maxInactivity: number): Promise<void>;
read(id: string): Promise<SessionState | null>;
update(state: SessionState, maxInactivity: number): Promise<void>;
destroy(sessionID: string): Promise<void>;
clear(): Promise<void>;
cleanUpExpiredSessions(maxInactivity: number, maxLifeTime: number): Promise<void>;
getAuthenticatedUserIds(): Promise<number[]>;
destroyAllSessionsOf(userId: number): Promise<void>;
getSessionIDsOf(userId: number): Promise<string[]>;
}