From 0707b4bd5fe757ad3b1734a48b90cfad6f734b60 Mon Sep 17 00:00:00 2001 From: Toastie Date: Thu, 12 Sep 2024 18:46:15 +1200 Subject: [PATCH] Added valkyriechat files --- valkyriechat/index.ts | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 valkyriechat/index.ts diff --git a/valkyriechat/index.ts b/valkyriechat/index.ts new file mode 100644 index 0000000..c8b580b --- /dev/null +++ b/valkyriechat/index.ts @@ -0,0 +1,48 @@ +import type { APIUser } from '../v9'; + +export enum PublicUserEnum { + username, + discriminator, + id, + public_flags, + avatar, + accent_color, + banner, + bio, + bot, + premium_since, + premium_type, + theme_colors, + pronouns, +} +export type PublicUserKeys = keyof typeof PublicUserEnum; + +export enum PrivateUserEnum { + flags, + mfa_enabled, + email, + phone, + verified, + nsfw_allowed, + premium, + premium_type, + purchased_flags, + premium_usage_flags, + disabled, + // settings, // now a relation + // locale +} +export type PrivateUserKeys = keyof typeof PrivateUserEnum | PublicUserKeys; + +export const PublicUserProjection = Object.values(PublicUserEnum).filter( + (x) => typeof x === 'string', +) as PublicUserKeys[]; +export const PrivateUserProjection = [ + ...PublicUserProjection, + ...Object.values(PrivateUserEnum).filter((x) => typeof x === 'string'), +] as PrivateUserKeys[]; + +// Private user data that should never get sent to the client +export type PublicUser = Pick; + +export type UserPublic = Pick; \ No newline at end of file