@foal/typeorm
Version:
FoalTS integration of TypeORM
31 lines (30 loc) • 1.04 kB
TypeScript
import { SessionState, SessionStore } from '@foal/core';
import { BaseEntity } from 'typeorm';
export declare class DatabaseSession extends BaseEntity {
id: string;
user_id: number | null;
user_id_str: string | null;
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 | string)[]>;
destroyAllSessionsOf(userId: number | string): Promise<void>;
getSessionIDsOf(userId: number | string): Promise<string[]>;
}