mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
62 lines
1.1 KiB
TypeScript
62 lines
1.1 KiB
TypeScript
import { Types } from 'mongoose'
|
|
|
|
export interface User {
|
|
username: string
|
|
}
|
|
export interface SessionDocument {
|
|
_id: Types.ObjectId
|
|
user: User
|
|
quest: string
|
|
status: string
|
|
createdAt: Date
|
|
finishedAt: Date
|
|
}
|
|
export interface CommandObject {
|
|
command: string
|
|
pwd: string
|
|
stage?: string | null
|
|
output: string | undefined
|
|
error: string | undefined
|
|
createdAt: string
|
|
}
|
|
export interface SessionObject {
|
|
_id: Types.ObjectId
|
|
user: string
|
|
quest: string
|
|
status: string
|
|
createdAt: string
|
|
finishedAt: string
|
|
lastActivityAt: string
|
|
usedTime: string
|
|
commandCount: number
|
|
commands: CommandObject[]
|
|
}
|
|
export interface SessionDetail {
|
|
_id: Types.ObjectId
|
|
user: string
|
|
quest: string
|
|
status: string
|
|
createdAt: string
|
|
finishedAt: string
|
|
usedTime: string
|
|
commands: CommandObject[]
|
|
}
|
|
export interface IUser extends Document {
|
|
hashedPassword?: string
|
|
socialLogins?: Record<
|
|
string,
|
|
{
|
|
id: string
|
|
provider: string
|
|
displayName?: string | null | undefined
|
|
}
|
|
>
|
|
}
|
|
export interface UserSessionDetail {
|
|
_id: Types.ObjectId
|
|
quest: string
|
|
status: string
|
|
createdAt: string
|
|
usedTime: string
|
|
}
|