mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 19:10:12 +08:00
feat: user sessions history & fix ts <any>
This commit is contained in:
1 parent
94ae2d7df4
commit
218a25daee
7 files changed
+95
-43
No files matched your search
@@ -0,0 +1,61 @@
|
||||
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 | undefined
|
||||
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
|
||||
}
|
||||
Reference in new issue
Block a user