this repo has no description
1import { createInsertSchema, createSelectSchema } from "drizzle-typebox";
2import { t } from "elysia";
3import * as schema from "./schema";
4
5const _userInsert = createInsertSchema(schema.users);
6const _userSelect = createSelectSchema(schema.users);
7
8export const models = {
9 user: {
10 insert: _userInsert,
11 select: _userSelect,
12
13 create: t.Omit(_userInsert, ["id"]),
14 login: t.Pick(_userInsert, ["username", "password"]),
15 },
16 channel: {
17 create: t.Object({
18 name: t.String({ minLength: 3, maxLength: 100 }),
19 description: t.Optional(t.String({ maxLength: 500 })),
20 type: t.Optional(t.Union([t.Literal("text"), t.Literal("category")])),
21 isPrivate: t.Optional(t.Boolean()),
22 parentChannelId: t.Optional(t.String()),
23 }),
24 },
25};