summary refs log tree commit diff
path: root/src/schema/User.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/schema/User.ts')
-rw-r--r--src/schema/User.ts54
1 files changed, 7 insertions, 47 deletions
diff --git a/src/schema/User.ts b/src/schema/User.ts

index 15f27088..d5a7b909 100644 --- a/src/schema/User.ts +++ b/src/schema/User.ts
@@ -1,53 +1,13 @@ -export const UserUpdateSchema = { - id: String, - username: String, - discriminator: String, - avatar: String || null, - $phone: String, - desktop: Boolean, - mobile: Boolean, - premium: Boolean, - premium_type: Number, - bot: Boolean, - system: Boolean, - nsfw_allowed: Boolean, - mfa_enabled: Boolean, - created_at: Date, - verified: Boolean, - $email: String, - flags: BigInt, - public_flags: BigInt, - $guilds: [String], -}; - -export interface UserUpdateSchema { - id: string; - username: string; - discriminator: string; - avatar: string | null; - phone?: string; - desktop: boolean; - mobile: boolean; - premium: boolean; - premium_type: number; - bot: boolean; - system: boolean; - nsfw_allowed: boolean; - mfa_enabled: boolean; - created_at: Date; - verified: boolean; - email?: string; - flags: bigint; - public_flags: bigint; - guilds: string[]; -} +import { Length } from "../util/instanceOf"; export const UserModifySchema = { - username: String, - avatar: String || null, + $username: new Length(String, 2, 32), + $avatar: String, + $bio: new Length(String, 0, 190) }; export interface UserModifySchema { - username: string; - avatar: string | null; + username?: string; + avatar?: string | null; + bio?: string; }