From 7818e8dd3cff1cba078acd52cda4f852d6422a92 Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Wed, 28 Sep 2022 16:39:05 +1000 Subject: Missed some schemas --- src/util/schemas/ChannelPermissionOverwriteSchema.ts | 4 ++++ src/util/schemas/GatewayPayloadSchema.ts | 8 ++++++++ src/util/schemas/GuildUpdateSchema.ts | 17 +++++++++++++++++ src/util/schemas/UserGuildSettingsSchema.ts | 9 +++++++++ src/util/schemas/UserSettingsSchema.ts | 3 +++ src/util/schemas/index.ts | 4 ++++ 6 files changed, 45 insertions(+) create mode 100644 src/util/schemas/ChannelPermissionOverwriteSchema.ts create mode 100644 src/util/schemas/GatewayPayloadSchema.ts create mode 100644 src/util/schemas/GuildUpdateSchema.ts create mode 100644 src/util/schemas/UserGuildSettingsSchema.ts create mode 100644 src/util/schemas/UserSettingsSchema.ts (limited to 'src/util') diff --git a/src/util/schemas/ChannelPermissionOverwriteSchema.ts b/src/util/schemas/ChannelPermissionOverwriteSchema.ts new file mode 100644 index 00000000..6d6d6c34 --- /dev/null +++ b/src/util/schemas/ChannelPermissionOverwriteSchema.ts @@ -0,0 +1,4 @@ +import { ChannelPermissionOverwrite } from "@fosscord/util"; + +export interface ChannelPermissionOverwriteSchema + extends ChannelPermissionOverwrite {} \ No newline at end of file diff --git a/src/util/schemas/GatewayPayloadSchema.ts b/src/util/schemas/GatewayPayloadSchema.ts new file mode 100644 index 00000000..324ad1eb --- /dev/null +++ b/src/util/schemas/GatewayPayloadSchema.ts @@ -0,0 +1,8 @@ +import { Tuple } from "lambert-server"; + +export const PayloadSchema = { + op: Number, + $d: new Tuple(Object, Number), // or number for heartbeat sequence + $s: Number, + $t: String, +}; \ No newline at end of file diff --git a/src/util/schemas/GuildUpdateSchema.ts b/src/util/schemas/GuildUpdateSchema.ts new file mode 100644 index 00000000..fb2ac4f2 --- /dev/null +++ b/src/util/schemas/GuildUpdateSchema.ts @@ -0,0 +1,17 @@ +import { GuildCreateSchema } from "@fosscord/util"; + +export interface GuildUpdateSchema extends Omit { + 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/src/util/schemas/UserGuildSettingsSchema.ts b/src/util/schemas/UserGuildSettingsSchema.ts new file mode 100644 index 00000000..43028c58 --- /dev/null +++ b/src/util/schemas/UserGuildSettingsSchema.ts @@ -0,0 +1,9 @@ +import { UserGuildSettings, ChannelOverride } from "@fosscord/util"; + +// This sucks. I would use a DeepPartial, my own or typeorms, but they both generate inncorect schema +export interface UserGuildSettingsSchema + extends Partial> { + channel_overrides: { + [channel_id: string]: Partial; + }; +} \ No newline at end of file diff --git a/src/util/schemas/UserSettingsSchema.ts b/src/util/schemas/UserSettingsSchema.ts new file mode 100644 index 00000000..db015457 --- /dev/null +++ b/src/util/schemas/UserSettingsSchema.ts @@ -0,0 +1,3 @@ +import { UserSettings } from "@fosscord/util"; + +export interface UserSettingsSchema extends Partial {} \ No newline at end of file diff --git a/src/util/schemas/index.ts b/src/util/schemas/index.ts index ae80de71..ba9e71e4 100644 --- a/src/util/schemas/index.ts +++ b/src/util/schemas/index.ts @@ -39,3 +39,7 @@ export * from "./VoiceVideoSchema"; export * from "./IdentifySchema"; export * from "./ActivitySchema"; export * from "./LazyRequestSchema"; +export * from "./GuildUpdateSchema"; +export * from "./ChannelPermissionOverwriteSchema"; +export * from "./UserGuildSettingsSchema"; +export * from "./GatewayPayloadSchema" \ No newline at end of file -- cgit 1.4.1