Init
This commit is contained in:
commit
b5f31c1083
227 files changed
+31375
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const PANEL_MODES = ['standalone', 'fleet'] as const
|
||||
export type PanelMode = (typeof PANEL_MODES)[number]
|
||||
|
||||
export const loginRequestSchema = z.object({
|
||||
username: z.string().min(1),
|
||||
password: z.string().min(1),
|
||||
})
|
||||
|
||||
export const loginResponseSchema = z.object({
|
||||
accessToken: z.string(),
|
||||
operator: z.object({
|
||||
id: z.string(),
|
||||
username: z.string(),
|
||||
role: z.string(),
|
||||
}),
|
||||
panelMode: z.enum(PANEL_MODES),
|
||||
})
|
||||
|
||||
export type LoginRequest = z.infer<typeof loginRequestSchema>
|
||||
export type LoginResponse = z.infer<typeof loginResponseSchema>
|
||||
|
||||
export const telemtProxyRequestSchema = z.object({
|
||||
method: z.enum(['GET', 'POST', 'PATCH', 'DELETE']).default('GET'),
|
||||
path: z.string().min(1),
|
||||
body: z.unknown().optional(),
|
||||
ifMatch: z.string().optional(),
|
||||
})
|
||||
|
||||
export type TelemtProxyRequest = z.infer<typeof telemtProxyRequestSchema>
|
||||
Reference in new issue
Block a user