summary refs log tree commit diff
path: root/util/src
diff options
context:
space:
mode:
Diffstat (limited to 'util/src')
-rw-r--r--util/src/index.ts3
-rw-r--r--util/src/schemas/ActivitySchema.ts51
-rw-r--r--util/src/schemas/BanCreateSchema.ts5
-rw-r--r--util/src/schemas/BanModeratorSchema.ts8
-rw-r--r--util/src/schemas/BanRegistrySchema.ts9
-rw-r--r--util/src/schemas/BulkDeleteSchema.ts4
-rw-r--r--util/src/schemas/ChannelModifySchema.ts29
-rw-r--r--util/src/schemas/ChannelPermissionOverwriteSchema.ts5
-rw-r--r--util/src/schemas/DmChannelCreateSchema.ts5
-rw-r--r--util/src/schemas/EmojiCreateSchema.ts7
-rw-r--r--util/src/schemas/EmojiModifySchema.ts5
-rw-r--r--util/src/schemas/GuildCreateSchema.ts14
-rw-r--r--util/src/schemas/GuildTemplateCreateSchema.ts5
-rw-r--r--util/src/schemas/GuildUpdateSchema.ts18
-rw-r--r--util/src/schemas/GuildUpdateWelcomeScreenSchema.ts11
-rw-r--r--util/src/schemas/IdentifySchema.ts89
-rw-r--r--util/src/schemas/InviteCreateSchema.ts12
-rw-r--r--util/src/schemas/LazyRequestSchema.ts19
-rw-r--r--util/src/schemas/LoginSchema.ts9
-rw-r--r--util/src/schemas/MemberChangeSchema.ts4
-rw-r--r--util/src/schemas/MemberNickChangeSchema.ts4
-rw-r--r--util/src/schemas/MessageAcknowledgeSchema.ts8
-rw-r--r--util/src/schemas/MessageCreateSchema.ts34
-rw-r--r--util/src/schemas/MfaCodesSchema.ts5
-rw-r--r--util/src/schemas/ModifyGuildStickerSchema.ts16
-rw-r--r--util/src/schemas/PruneSchema.ts7
-rw-r--r--util/src/schemas/PurgeSchema.ts5
-rw-r--r--util/src/schemas/RegisterSchema.ts27
-rw-r--r--util/src/schemas/RelationshipPostSchema.ts5
-rw-r--r--util/src/schemas/RelationshipPutSchema.ts6
-rw-r--r--util/src/schemas/RoleModifySchema.ts11
-rw-r--r--util/src/schemas/TemplateCreateSchema.ts5
-rw-r--r--util/src/schemas/TemplateModifySchema.ts5
-rw-r--r--util/src/schemas/TotpDisableSchema.ts4
-rw-r--r--util/src/schemas/TotpEnableSchema.ts6
-rw-r--r--util/src/schemas/TotpSchema.ts7
-rw-r--r--util/src/schemas/UserModifySchema.ts19
-rw-r--r--util/src/schemas/UserSettingsSchema.ts4
-rw-r--r--util/src/schemas/VanityUrlSchema.ts8
-rw-r--r--util/src/schemas/VoiceStateUpdateSchema.ts18
-rw-r--r--util/src/schemas/WebhookCreateSchema.ts8
-rw-r--r--util/src/schemas/WidgetModifySchema.ts5
-rw-r--r--util/src/schemas/index.ts41
-rw-r--r--util/src/util/Config.ts5
44 files changed, 573 insertions, 2 deletions
diff --git a/util/src/index.ts b/util/src/index.ts
index 259d1c97..daeffd69 100644
--- a/util/src/index.ts
+++ b/util/src/index.ts
@@ -4,4 +4,5 @@ export * from "./util/index";
 export * from "./interfaces/index";
 export * from "./entities/index";
 export * from "./dtos/index";
-export * from "./util/MFA";
\ No newline at end of file
+export * from "./util/MFA";
+export * from "./schemas";
\ No newline at end of file
diff --git a/util/src/schemas/ActivitySchema.ts b/util/src/schemas/ActivitySchema.ts
new file mode 100644
index 00000000..e18f66c8
--- /dev/null
+++ b/util/src/schemas/ActivitySchema.ts
@@ -0,0 +1,51 @@
+import { Activity, Status } from "@fosscord/util";
+
+export const ActivitySchema = {
+	afk: Boolean,
+	status: String,
+	$activities: [
+		{
+			name: String,
+			type: Number,
+			$url: String,
+			$created_at: Date,
+			$timestamps: {
+				$start: Number,
+				$end: Number,
+			},
+			$application_id: String,
+			$details: String,
+			$state: String,
+			$emoji: {
+				$name: String,
+				$id: String,
+				$animated: Boolean,
+			},
+			$party: {
+				$id: String,
+				$size: [Number, Number],
+			},
+			$assets: {
+				$large_image: String,
+				$large_text: String,
+				$small_image: String,
+				$small_text: String,
+			},
+			$secrets: {
+				$join: String,
+				$spectate: String,
+				$match: String,
+			},
+			$instance: Boolean,
+			$flags: String,
+		},
+	],
+	$since: Number, // unix time (in milliseconds) of when the client went idle, or null if the client is not idle
+};
+
+export interface ActivitySchema {
+	afk: boolean;
+	status: Status;
+	activities?: Activity[];
+	since?: number; // unix time (in milliseconds) of when the client went idle, or null if the client is not idle
+}
diff --git a/util/src/schemas/BanCreateSchema.ts b/util/src/schemas/BanCreateSchema.ts
new file mode 100644
index 00000000..64b02943
--- /dev/null
+++ b/util/src/schemas/BanCreateSchema.ts
@@ -0,0 +1,5 @@
+
+export interface BanCreateSchema {
+	delete_message_days?: string;
+	reason?: string;
+}
diff --git a/util/src/schemas/BanModeratorSchema.ts b/util/src/schemas/BanModeratorSchema.ts
new file mode 100644
index 00000000..b497d319
--- /dev/null
+++ b/util/src/schemas/BanModeratorSchema.ts
@@ -0,0 +1,8 @@
+
+export interface BanModeratorSchema {
+	id: string;
+	user_id: string;
+	guild_id: string;
+	executor_id: string;
+	reason?: string | undefined;
+}
diff --git a/util/src/schemas/BanRegistrySchema.ts b/util/src/schemas/BanRegistrySchema.ts
new file mode 100644
index 00000000..661f934f
--- /dev/null
+++ b/util/src/schemas/BanRegistrySchema.ts
@@ -0,0 +1,9 @@
+
+export interface BanRegistrySchema {
+	id: string;
+	user_id: string;
+	guild_id: string;
+	executor_id: string;
+	ip?: string;
+	reason?: string | undefined;
+}
diff --git a/util/src/schemas/BulkDeleteSchema.ts b/util/src/schemas/BulkDeleteSchema.ts
new file mode 100644
index 00000000..26f88374
--- /dev/null
+++ b/util/src/schemas/BulkDeleteSchema.ts
@@ -0,0 +1,4 @@
+
+export interface BulkDeleteSchema {
+	messages: string[];
+}
diff --git a/util/src/schemas/ChannelModifySchema.ts b/util/src/schemas/ChannelModifySchema.ts
new file mode 100644
index 00000000..3cfcf7d2
--- /dev/null
+++ b/util/src/schemas/ChannelModifySchema.ts
@@ -0,0 +1,29 @@
+import { ChannelPermissionOverwriteType, ChannelType } from "..";
+
+
+export interface ChannelModifySchema {
+	/**
+	 * @maxLength 100
+	 */
+	name?: string;
+	type?: ChannelType;
+	topic?: string;
+	icon?: string | null;
+	bitrate?: number;
+	user_limit?: number;
+	rate_limit_per_user?: number;
+	position?: number;
+	permission_overwrites?: {
+		id: string;
+		type: ChannelPermissionOverwriteType;
+		allow: string;
+		deny: string;
+	}[];
+	parent_id?: string;
+	id?: string; // is not used (only for guild create)
+	nsfw?: boolean;
+	rtc_region?: string;
+	default_auto_archive_duration?: number;
+	flags?: number;
+	default_thread_rate_limit_per_user?: number;
+}
\ No newline at end of file
diff --git a/util/src/schemas/ChannelPermissionOverwriteSchema.ts b/util/src/schemas/ChannelPermissionOverwriteSchema.ts
new file mode 100644
index 00000000..fe9ba860
--- /dev/null
+++ b/util/src/schemas/ChannelPermissionOverwriteSchema.ts
@@ -0,0 +1,5 @@
+import { ChannelPermissionOverwrite } from "@fosscord/util";
+
+// TODO: Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel)
+
+export interface ChannelPermissionOverwriteSchema extends ChannelPermissionOverwrite { }
diff --git a/util/src/schemas/DmChannelCreateSchema.ts b/util/src/schemas/DmChannelCreateSchema.ts
new file mode 100644
index 00000000..d5afc6d7
--- /dev/null
+++ b/util/src/schemas/DmChannelCreateSchema.ts
@@ -0,0 +1,5 @@
+
+export interface DmChannelCreateSchema {
+	name?: string;
+	recipients: string[];
+}
diff --git a/util/src/schemas/EmojiCreateSchema.ts b/util/src/schemas/EmojiCreateSchema.ts
new file mode 100644
index 00000000..d50c419c
--- /dev/null
+++ b/util/src/schemas/EmojiCreateSchema.ts
@@ -0,0 +1,7 @@
+
+export interface EmojiCreateSchema {
+	name?: string;
+	image: string;
+	require_colons?: boolean | null;
+	roles?: string[];
+}
diff --git a/util/src/schemas/EmojiModifySchema.ts b/util/src/schemas/EmojiModifySchema.ts
new file mode 100644
index 00000000..5529dbd5
--- /dev/null
+++ b/util/src/schemas/EmojiModifySchema.ts
@@ -0,0 +1,5 @@
+
+export interface EmojiModifySchema {
+	name?: string;
+	roles?: string[];
+}
diff --git a/util/src/schemas/GuildCreateSchema.ts b/util/src/schemas/GuildCreateSchema.ts
new file mode 100644
index 00000000..e4855119
--- /dev/null
+++ b/util/src/schemas/GuildCreateSchema.ts
@@ -0,0 +1,14 @@
+import { ChannelModifySchema } from ".";
+
+export interface GuildCreateSchema {
+	/**
+	 * @maxLength 100
+	 */
+	name: string;
+	region?: string;
+	icon?: string | null;
+	channels?: ChannelModifySchema[];
+	guild_template_code?: string;
+	system_channel_id?: string;
+	rules_channel_id?: string;
+}
diff --git a/util/src/schemas/GuildTemplateCreateSchema.ts b/util/src/schemas/GuildTemplateCreateSchema.ts
new file mode 100644
index 00000000..1579001e
--- /dev/null
+++ b/util/src/schemas/GuildTemplateCreateSchema.ts
@@ -0,0 +1,5 @@
+
+export interface GuildTemplateCreateSchema {
+	name: string;
+	avatar?: string | null;
+}
diff --git a/util/src/schemas/GuildUpdateSchema.ts b/util/src/schemas/GuildUpdateSchema.ts
new file mode 100644
index 00000000..86527cf1
--- /dev/null
+++ b/util/src/schemas/GuildUpdateSchema.ts
@@ -0,0 +1,18 @@
+import { GuildCreateSchema } from ".";
+
+export interface GuildUpdateSchema extends Omit<GuildCreateSchema, "channels" | "name"> {
+	name?: string;
+	banner?: string | null;
+	splash?: string | null;
+	description?: string;
+	features?: string[];
+	verification_level?: number;
+	default_message_notifications?: number;
+	system_channel_flags?: number;
+	explicit_content_filter?: number;
+	public_updates_channel_id?: string;
+	afk_timeout?: number;
+	afk_channel_id?: string;
+	preferred_locale?: string;
+	premium_progress_bar_enabled?: boolean;
+}
diff --git a/util/src/schemas/GuildUpdateWelcomeScreenSchema.ts b/util/src/schemas/GuildUpdateWelcomeScreenSchema.ts
new file mode 100644
index 00000000..b1e36920
--- /dev/null
+++ b/util/src/schemas/GuildUpdateWelcomeScreenSchema.ts
@@ -0,0 +1,11 @@
+
+export interface GuildUpdateWelcomeScreenSchema {
+	welcome_channels?: {
+		channel_id: string;
+		description: string;
+		emoji_id?: string;
+		emoji_name: string;
+	}[];
+	enabled?: boolean;
+	description?: string;
+}
diff --git a/util/src/schemas/IdentifySchema.ts b/util/src/schemas/IdentifySchema.ts
new file mode 100644
index 00000000..8f95c6a0
--- /dev/null
+++ b/util/src/schemas/IdentifySchema.ts
@@ -0,0 +1,89 @@
+import { ActivitySchema } from "./ActivitySchema";
+
+export const IdentifySchema = {
+	token: String,
+	$intents: BigInt, // discord uses a Integer for bitfields we use bigints tho. | instanceOf will automatically convert the Number to a BigInt
+	$properties: Object,
+	// {
+	// 	// discord uses $ in the property key for bots, so we need to double prefix it, because instanceOf treats $ (prefix) as a optional key
+	// 	$os: String,
+	// 	$os_arch: String,
+	// 	$browser: String,
+	// 	$device: String,
+	// 	$$os: String,
+	// 	$$browser: String,
+	// 	$$device: String,
+	// 	$browser_user_agent: String,
+	// 	$browser_version: String,
+	// 	$os_version: String,
+	// 	$referrer: String,
+	// 	$$referrer: String,
+	// 	$referring_domain: String,
+	// 	$$referring_domain: String,
+	// 	$referrer_current: String,
+	// 	$referring_domain_current: String,
+	// 	$release_channel: String,
+	// 	$client_build_number: Number,
+	// 	$client_event_source: String,
+	// 	$client_version: String,
+	// 	$system_locale: String,
+	// 	$window_manager: String,
+	// 	$distro: String,
+	// },
+	$presence: ActivitySchema,
+	$compress: Boolean,
+	$large_threshold: Number,
+	$shard: [BigInt, BigInt],
+	$guild_subscriptions: Boolean,
+	$capabilities: Number,
+	$client_state: {
+		$guild_hashes: Object,
+		$highest_last_message_id: String,
+		$read_state_version: Number,
+		$user_guild_settings_version: Number,
+		$user_settings_version: undefined,
+	},
+	$v: Number,
+	$version: Number,
+};
+
+export interface IdentifySchema {
+	token: string;
+	properties: {
+		// bruh discord really uses $ in the property key, so we need to double prefix it, because instanceOf treats $ (prefix) as a optional key
+		os?: string;
+		os_atch?: string;
+		browser?: string;
+		device?: string;
+		$os?: string;
+		$browser?: string;
+		$device?: string;
+		browser_user_agent?: string;
+		browser_version?: string;
+		os_version?: string;
+		referrer?: string;
+		referring_domain?: string;
+		referrer_current?: string;
+		referring_domain_current?: string;
+		release_channel?: "stable" | "dev" | "ptb" | "canary";
+		client_build_number?: number;
+		client_event_source?: any;
+		client_version?: string;
+		system_locale?: string;
+	};
+	intents?: bigint; // discord uses a Integer for bitfields we use bigints tho. | instanceOf will automatically convert the Number to a BigInt
+	presence?: ActivitySchema;
+	compress?: boolean;
+	large_threshold?: number;
+	shard?: [bigint, bigint];
+	guild_subscriptions?: boolean;
+	capabilities?: number;
+	client_state?: {
+		guild_hashes?: any;
+		highest_last_message_id?: string;
+		read_state_version?: number;
+		user_guild_settings_version?: number;
+		user_settings_version?: number;
+	};
+	v?: number;
+}
diff --git a/util/src/schemas/InviteCreateSchema.ts b/util/src/schemas/InviteCreateSchema.ts
new file mode 100644
index 00000000..7f6af338
--- /dev/null
+++ b/util/src/schemas/InviteCreateSchema.ts
@@ -0,0 +1,12 @@
+
+export interface InviteCreateSchema {
+	target_user_id?: string;
+	target_type?: string;
+	validate?: string; // ? what is this
+	max_age?: number;
+	max_uses?: number;
+	temporary?: boolean;
+	unique?: boolean;
+	target_user?: string;
+	target_user_type?: number;
+}
diff --git a/util/src/schemas/LazyRequestSchema.ts b/util/src/schemas/LazyRequestSchema.ts
new file mode 100644
index 00000000..1fe658bb
--- /dev/null
+++ b/util/src/schemas/LazyRequestSchema.ts
@@ -0,0 +1,19 @@
+export interface LazyRequest {
+	guild_id: string;
+	channels?: Record<string, [number, number][]>;
+	activities?: boolean;
+	threads?: boolean;
+	typing?: true;
+	members?: any[];
+	thread_member_lists?: any[];
+}
+
+export const LazyRequest = {
+	guild_id: String,
+	$activities: Boolean,
+	$channels: Object,
+	$typing: Boolean,
+	$threads: Boolean,
+	$members: [] as any[],
+	$thread_member_lists: [] as any[],
+};
diff --git a/util/src/schemas/LoginSchema.ts b/util/src/schemas/LoginSchema.ts
new file mode 100644
index 00000000..358019a8
--- /dev/null
+++ b/util/src/schemas/LoginSchema.ts
@@ -0,0 +1,9 @@
+
+export interface LoginSchema {
+	login: string;
+	password: string;
+	undelete?: boolean;
+	captcha_key?: string;
+	login_source?: string;
+	gift_code_sku_id?: string;
+}
diff --git a/util/src/schemas/MemberChangeSchema.ts b/util/src/schemas/MemberChangeSchema.ts
new file mode 100644
index 00000000..a75c0ea0
--- /dev/null
+++ b/util/src/schemas/MemberChangeSchema.ts
@@ -0,0 +1,4 @@
+
+export interface MemberChangeSchema {
+	roles?: string[];
+}
diff --git a/util/src/schemas/MemberNickChangeSchema.ts b/util/src/schemas/MemberNickChangeSchema.ts
new file mode 100644
index 00000000..e6a6a007
--- /dev/null
+++ b/util/src/schemas/MemberNickChangeSchema.ts
@@ -0,0 +1,4 @@
+
+export interface MemberNickChangeSchema {
+	nick: string;
+}
diff --git a/util/src/schemas/MessageAcknowledgeSchema.ts b/util/src/schemas/MessageAcknowledgeSchema.ts
new file mode 100644
index 00000000..3f4eb2b6
--- /dev/null
+++ b/util/src/schemas/MessageAcknowledgeSchema.ts
@@ -0,0 +1,8 @@
+// TODO: public read receipts & privacy scoping
+// TODO: send read state event to all channel members
+// TODO: advance-only notification cursor
+
+export interface MessageAcknowledgeSchema {
+	manual?: boolean;
+	mention_count?: number;
+}
diff --git a/util/src/schemas/MessageCreateSchema.ts b/util/src/schemas/MessageCreateSchema.ts
new file mode 100644
index 00000000..7b1cc7b9
--- /dev/null
+++ b/util/src/schemas/MessageCreateSchema.ts
@@ -0,0 +1,34 @@
+import { Embed } from "@fosscord/util";
+
+
+export interface MessageCreateSchema {
+	type?: number;
+	content?: string;
+	nonce?: string;
+	channel_id?: string;
+	tts?: boolean;
+	flags?: string;
+	embeds?: Embed[];
+	embed?: Embed;
+	// TODO: ^ embed is deprecated in favor of embeds (https://discord.com/developers/docs/resources/channel#message-object)
+	allowed_mentions?: {
+		parse?: string[];
+		roles?: string[];
+		users?: string[];
+		replied_user?: boolean;
+	};
+	message_reference?: {
+		message_id: string;
+		channel_id: string;
+		guild_id?: string;
+		fail_if_not_exists?: boolean;
+	};
+	payload_json?: string;
+	file?: any;
+	/**
+	TODO: we should create an interface for attachments
+	TODO: OpenWAAO<-->attachment-style metadata conversion
+	**/
+	attachments?: any[];
+	sticker_ids?: string[];
+}
diff --git a/util/src/schemas/MfaCodesSchema.ts b/util/src/schemas/MfaCodesSchema.ts
new file mode 100644
index 00000000..53230841
--- /dev/null
+++ b/util/src/schemas/MfaCodesSchema.ts
@@ -0,0 +1,5 @@
+
+export interface MfaCodesSchema {
+	password: string;
+	regenerate?: boolean;
+}
diff --git a/util/src/schemas/ModifyGuildStickerSchema.ts b/util/src/schemas/ModifyGuildStickerSchema.ts
new file mode 100644
index 00000000..6f24e4ce
--- /dev/null
+++ b/util/src/schemas/ModifyGuildStickerSchema.ts
@@ -0,0 +1,16 @@
+
+export interface ModifyGuildStickerSchema {
+	/**
+	 * @minLength 2
+	 * @maxLength 30
+	 */
+	name: string;
+	/**
+	 * @maxLength 100
+	 */
+	description?: string;
+	/**
+	 * @maxLength 200
+	 */
+	tags: string;
+}
diff --git a/util/src/schemas/PruneSchema.ts b/util/src/schemas/PruneSchema.ts
new file mode 100644
index 00000000..eebac763
--- /dev/null
+++ b/util/src/schemas/PruneSchema.ts
@@ -0,0 +1,7 @@
+
+export interface PruneSchema {
+	/**
+	 * @min 0
+	 */
+	days: number;
+}
diff --git a/util/src/schemas/PurgeSchema.ts b/util/src/schemas/PurgeSchema.ts
new file mode 100644
index 00000000..0eeef6f2
--- /dev/null
+++ b/util/src/schemas/PurgeSchema.ts
@@ -0,0 +1,5 @@
+
+export interface PurgeSchema {
+	before: string;
+	after: string;
+}
diff --git a/util/src/schemas/RegisterSchema.ts b/util/src/schemas/RegisterSchema.ts
new file mode 100644
index 00000000..e53330d2
--- /dev/null
+++ b/util/src/schemas/RegisterSchema.ts
@@ -0,0 +1,27 @@
+
+export interface RegisterSchema {
+	/**
+	 * @minLength 2
+	 * @maxLength 32
+	 */
+	username: string;
+	/**
+	 * @minLength 1
+	 * @maxLength 72
+	 */
+	password?: string;
+	consent: boolean;
+	/**
+	 * @TJS-format email
+	 */
+	email?: string;
+	fingerprint?: string;
+	invite?: string;
+	/**
+	 * @TJS-type string
+	 */
+	date_of_birth?: Date; // "2000-04-03"
+	gift_code_sku_id?: string;
+	captcha_key?: string;
+	promotional_email_opt_in?: boolean;
+}
diff --git a/util/src/schemas/RelationshipPostSchema.ts b/util/src/schemas/RelationshipPostSchema.ts
new file mode 100644
index 00000000..40093700
--- /dev/null
+++ b/util/src/schemas/RelationshipPostSchema.ts
@@ -0,0 +1,5 @@
+
+export interface RelationshipPostSchema {
+	discriminator: string;
+	username: string;
+}
diff --git a/util/src/schemas/RelationshipPutSchema.ts b/util/src/schemas/RelationshipPutSchema.ts
new file mode 100644
index 00000000..f46966e0
--- /dev/null
+++ b/util/src/schemas/RelationshipPutSchema.ts
@@ -0,0 +1,6 @@
+import { RelationshipType } from "@fosscord/util";
+
+
+export interface RelationshipPutSchema {
+	type?: RelationshipType;
+}
diff --git a/util/src/schemas/RoleModifySchema.ts b/util/src/schemas/RoleModifySchema.ts
new file mode 100644
index 00000000..d08a5022
--- /dev/null
+++ b/util/src/schemas/RoleModifySchema.ts
@@ -0,0 +1,11 @@
+
+export interface RoleModifySchema {
+	name?: string;
+	permissions?: string;
+	color?: number;
+	hoist?: boolean; // whether the role should be displayed separately in the sidebar
+	mentionable?: boolean; // whether the role should be mentionable
+	position?: number;
+	icon?: string;
+	unicode_emoji?: string;
+}
diff --git a/util/src/schemas/TemplateCreateSchema.ts b/util/src/schemas/TemplateCreateSchema.ts
new file mode 100644
index 00000000..72c19f68
--- /dev/null
+++ b/util/src/schemas/TemplateCreateSchema.ts
@@ -0,0 +1,5 @@
+
+export interface TemplateCreateSchema {
+	name: string;
+	description?: string;
+}
diff --git a/util/src/schemas/TemplateModifySchema.ts b/util/src/schemas/TemplateModifySchema.ts
new file mode 100644
index 00000000..2231a1d2
--- /dev/null
+++ b/util/src/schemas/TemplateModifySchema.ts
@@ -0,0 +1,5 @@
+
+export interface TemplateModifySchema {
+	name: string;
+	description?: string;
+}
diff --git a/util/src/schemas/TotpDisableSchema.ts b/util/src/schemas/TotpDisableSchema.ts
new file mode 100644
index 00000000..b73db64e
--- /dev/null
+++ b/util/src/schemas/TotpDisableSchema.ts
@@ -0,0 +1,4 @@
+
+export interface TotpDisableSchema {
+	code: string;
+}
diff --git a/util/src/schemas/TotpEnableSchema.ts b/util/src/schemas/TotpEnableSchema.ts
new file mode 100644
index 00000000..44d9ebac
--- /dev/null
+++ b/util/src/schemas/TotpEnableSchema.ts
@@ -0,0 +1,6 @@
+
+export interface TotpEnableSchema {
+	password: string;
+	code?: string;
+	secret?: string;
+}
diff --git a/util/src/schemas/TotpSchema.ts b/util/src/schemas/TotpSchema.ts
new file mode 100644
index 00000000..fe54735e
--- /dev/null
+++ b/util/src/schemas/TotpSchema.ts
@@ -0,0 +1,7 @@
+
+export interface TotpSchema {
+	code: string;
+	ticket: string;
+	gift_code_sku_id?: string | null;
+	login_source?: string | null;
+}
diff --git a/util/src/schemas/UserModifySchema.ts b/util/src/schemas/UserModifySchema.ts
new file mode 100644
index 00000000..659f5841
--- /dev/null
+++ b/util/src/schemas/UserModifySchema.ts
@@ -0,0 +1,19 @@
+
+export interface UserModifySchema {
+	/**
+	 * @minLength 1
+	 * @maxLength 100
+	 */
+	username?: string;
+	discriminator?: string;
+	avatar?: string | null;
+	/**
+	 * @maxLength 1024
+	 */
+	bio?: string;
+	accent_color?: number;
+	banner?: string | null;
+	password?: string;
+	new_password?: string;
+	code?: string;
+}
diff --git a/util/src/schemas/UserSettingsSchema.ts b/util/src/schemas/UserSettingsSchema.ts
new file mode 100644
index 00000000..b497dff2
--- /dev/null
+++ b/util/src/schemas/UserSettingsSchema.ts
@@ -0,0 +1,4 @@
+import { UserSettings } from "@fosscord/util";
+
+
+export interface UserSettingsSchema extends Partial<UserSettings> { }
diff --git a/util/src/schemas/VanityUrlSchema.ts b/util/src/schemas/VanityUrlSchema.ts
new file mode 100644
index 00000000..de32695a
--- /dev/null
+++ b/util/src/schemas/VanityUrlSchema.ts
@@ -0,0 +1,8 @@
+
+export interface VanityUrlSchema {
+	/**
+	 * @minLength 1
+	 * @maxLength 20
+	 */
+	code?: string;
+}
diff --git a/util/src/schemas/VoiceStateUpdateSchema.ts b/util/src/schemas/VoiceStateUpdateSchema.ts
new file mode 100644
index 00000000..02bb141b
--- /dev/null
+++ b/util/src/schemas/VoiceStateUpdateSchema.ts
@@ -0,0 +1,18 @@
+export const VoiceStateUpdateSchema = {
+	$guild_id: String,
+	$channel_id: String,
+	self_mute: Boolean,
+	self_deaf: Boolean,
+	self_video: Boolean,
+};
+
+//TODO need more testing when community guild and voice stage channel are working
+export interface VoiceStateUpdateSchema {
+	channel_id: string;
+	guild_id?: string;
+	suppress?: boolean;
+	request_to_speak_timestamp?: Date;
+	self_mute?: boolean;
+	self_deaf?: boolean;
+	self_video?: boolean;
+}
\ No newline at end of file
diff --git a/util/src/schemas/WebhookCreateSchema.ts b/util/src/schemas/WebhookCreateSchema.ts
new file mode 100644
index 00000000..12ab1869
--- /dev/null
+++ b/util/src/schemas/WebhookCreateSchema.ts
@@ -0,0 +1,8 @@
+// TODO: webhooks
+export interface WebhookCreateSchema {
+	/**
+	 * @maxLength 80
+	 */
+	name: string;
+	avatar?: string;
+}
diff --git a/util/src/schemas/WidgetModifySchema.ts b/util/src/schemas/WidgetModifySchema.ts
new file mode 100644
index 00000000..390efc30
--- /dev/null
+++ b/util/src/schemas/WidgetModifySchema.ts
@@ -0,0 +1,5 @@
+
+export interface WidgetModifySchema {
+	enabled: boolean; // whether the widget is enabled
+	channel_id: string; // the widget channel id
+}
diff --git a/util/src/schemas/index.ts b/util/src/schemas/index.ts
new file mode 100644
index 00000000..f54ae840
--- /dev/null
+++ b/util/src/schemas/index.ts
@@ -0,0 +1,41 @@
+export * from "./ActivitySchema";
+export * from "./BanCreateSchema";
+export * from "./BanModeratorSchema";
+export * from "./BanRegistrySchema";
+export * from "./BulkDeleteSchema";
+export * from "./ChannelModifySchema";
+export * from "./ChannelPermissionOverwriteSchema";
+export * from "./DmChannelCreateSchema";
+export * from "./EmojiCreateSchema";
+export * from "./EmojiModifySchema";
+export * from "./GuildCreateSchema";
+export * from "./GuildTemplateCreateSchema";
+export * from "./GuildUpdateSchema";
+export * from "./GuildUpdateWelcomeScreenSchema";
+export * from "./IdentifySchema";
+export * from "./InviteCreateSchema";
+export * from "./LazyRequestSchema";
+export * from "./LoginSchema";
+export * from "./MemberChangeSchema";
+export * from "./MemberNickChangeSchema";
+export * from "./MessageAcknowledgeSchema";
+export * from "./MessageCreateSchema";
+export * from "./MfaCodesSchema";
+export * from "./ModifyGuildStickerSchema";
+export * from "./PruneSchema";
+export * from "./PurgeSchema";
+export * from "./RegisterSchema";
+export * from "./RelationshipPostSchema";
+export * from "./RelationshipPutSchema";
+export * from "./RoleModifySchema";
+export * from "./TemplateCreateSchema";
+export * from "./TemplateModifySchema";
+export * from "./TotpDisableSchema";
+export * from "./TotpEnableSchema";
+export * from "./TotpSchema";
+export * from "./UserModifySchema";
+export * from "./UserSettingsSchema";
+export * from "./VanityUrlSchema";
+export * from "./VoiceStateUpdateSchema";
+export * from "./WebhookCreateSchema";
+export * from "./WidgetModifySchema";
diff --git a/util/src/util/Config.ts b/util/src/util/Config.ts
index 0b55ca4b..e0fb2a81 100644
--- a/util/src/util/Config.ts
+++ b/util/src/util/Config.ts
@@ -60,8 +60,11 @@ function applyConfig(val: ConfigValue) {
 		pair.value = obj;
 		return pair.save();
 	}
-	if(process.env.CONFIG_PATH)
+	if(process.env.CONFIG_PATH) {
+		if(/--debug|--inspect/.test(process.execArgv.join(' ')))
+			console.log(`Writing config: ${process.env.CONFIG_PATH}`)
 		fs.writeFileSync(overridePath, JSON.stringify(val, null, 4));
+	}
 
 	return apply(val);
 }