Initial commit
This commit is contained in:
43
api/schemas/files.ts
Normal file
43
api/schemas/files.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const listFilesQuerySchema = z.object({
|
||||
path: z.string().optional().default(''),
|
||||
})
|
||||
|
||||
export const contentQuerySchema = z.object({
|
||||
path: z.string().min(1),
|
||||
})
|
||||
|
||||
export const rawQuerySchema = z.object({
|
||||
path: z.string().min(1),
|
||||
})
|
||||
|
||||
export const pathSchema = z.object({
|
||||
path: z.string().min(1),
|
||||
})
|
||||
|
||||
export const saveFileSchema = z.object({
|
||||
path: z.string().min(1),
|
||||
content: z.string(),
|
||||
})
|
||||
|
||||
export const renameSchema = z.object({
|
||||
oldPath: z.string().min(1),
|
||||
newPath: z.string().min(1),
|
||||
})
|
||||
|
||||
export const searchSchema = z.object({
|
||||
keywords: z.array(z.string()).min(1),
|
||||
})
|
||||
|
||||
export const existsSchema = z.object({
|
||||
path: z.string().min(1),
|
||||
})
|
||||
|
||||
export const createDirSchema = z.object({
|
||||
path: z.string().min(1),
|
||||
})
|
||||
|
||||
export const createFileSchema = z.object({
|
||||
path: z.string().min(1),
|
||||
})
|
||||
2
api/schemas/index.ts
Normal file
2
api/schemas/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './files.js'
|
||||
export * from './pydemos.js'
|
||||
21
api/schemas/pydemos.ts
Normal file
21
api/schemas/pydemos.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const listPyDemosQuerySchema = z.object({
|
||||
year: z.string().optional(),
|
||||
})
|
||||
|
||||
export const createPyDemoSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
year: z.string().min(1),
|
||||
month: z.string().min(1),
|
||||
folderStructure: z.string().optional(),
|
||||
})
|
||||
|
||||
export const deletePyDemoSchema = z.object({
|
||||
path: z.string().min(1),
|
||||
})
|
||||
|
||||
export const renamePyDemoSchema = z.object({
|
||||
oldPath: z.string().min(1),
|
||||
newName: z.string().min(1),
|
||||
})
|
||||
Reference in New Issue
Block a user