mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
wip: get active session
This commit is contained in:
1 parent
423548804a
commit
963655c1f7
7 files changed
+69
-12
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export * from './quest.js'
|
||||
export * from './session.js'
|
||||
|
||||
export const passwordPolicy = {
|
||||
minLength: 8,
|
||||
minNumbers: 1,
|
||||
minLowercase: 1,
|
||||
minUppercase: 1,
|
||||
minSymbols: 0,
|
||||
}
|
||||
|
||||
export const getSessionsRequestSchema = z.object({
|
||||
questId: z.string().optional(),
|
||||
status: z.enum(['active', 'inactive', 'finished']).optional(),
|
||||
limit: z.coerce.number().optional(),
|
||||
order: z.enum(['asc', 'desc']).optional(),
|
||||
})
|
||||
|
||||
export type GetSessionsRequest = z.infer<typeof getSessionsRequestSchema>
|
||||
@@ -0,0 +1,15 @@
|
||||
export interface SessionSummaryResponse {
|
||||
_id: string
|
||||
user: string
|
||||
quest: string
|
||||
status: string
|
||||
createdAt: Date
|
||||
lastActivityAt: Date
|
||||
}
|
||||
|
||||
export interface SessionDetailResponse extends SessionSummaryResponse {
|
||||
hints: string[][]
|
||||
tasks: string[][]
|
||||
responses: string[][]
|
||||
graph: any
|
||||
}
|
||||
Reference in new issue
Block a user