Add all repos
This commit is contained in:
parent
faa12c60bc
commit
8a91c9b89b
369 changed files with 29047 additions and 28 deletions
26
metamigo-common/records/session.ts
Normal file
26
metamigo-common/records/session.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { recordInfo } from "./record-info";
|
||||
import { RepositoryBase } from "./base";
|
||||
import { Flavor, UUID } from "../helpers";
|
||||
import { UserId } from "./user";
|
||||
|
||||
export type SessionId = Flavor<UUID, "Session Id">;
|
||||
|
||||
export interface UnsavedSession {
|
||||
userId: UserId;
|
||||
expires: Date;
|
||||
sessionToken: string;
|
||||
accessToken: string;
|
||||
}
|
||||
|
||||
export interface SavedSession extends UnsavedSession {
|
||||
id: SessionId;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export const SessionRecord = recordInfo<UnsavedSession, SavedSession>(
|
||||
"app_private",
|
||||
"sessions"
|
||||
);
|
||||
|
||||
export class SessionRecordRepository extends RepositoryBase(SessionRecord) {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue