Add order in file schema and main projecct edition

This commit is contained in:
2024-11-13 00:25:18 +01:00
parent b54402fc19
commit adb37b255a
32 changed files with 549 additions and 34 deletions

View File

@@ -2,12 +2,13 @@ import { z } from "zod";
export const schema = z.object({
path: z.string(),
owner: z.number(),
owner: z.number().finite(),
title: z.string(),
type: z.enum(['folder', 'file', 'markdown', 'canvas']),
content: z.string(),
navigable: z.boolean(),
private: z.boolean(),
order: z.number().finite(),
});
export type File = z.infer<typeof schema>;

15
schemas/navigation.ts Normal file
View File

@@ -0,0 +1,15 @@
import { z } from "zod";
export const single = z.object({
path: z.string(),
owner: z.number().finite(),
title: z.string(),
type: z.enum(['folder', 'file', 'markdown', 'canvas']),
navigable: z.boolean(),
private: z.boolean(),
order: z.number().finite(),
});
export const table = z.array(single);
export type Navigation = z.infer<typeof table>;
export type NavigationItem = z.infer<typeof single>;