diff options
Diffstat (limited to 'gateway/src/schema')
-rw-r--r-- | gateway/src/schema/Activity.ts | 51 | ||||
-rw-r--r-- | gateway/src/schema/Identify.ts | 89 | ||||
-rw-r--r-- | gateway/src/schema/LazyRequest.ts | 19 | ||||
-rw-r--r-- | gateway/src/schema/VoiceStateUpdateSchema.ts | 15 |
4 files changed, 0 insertions, 174 deletions
diff --git a/gateway/src/schema/Activity.ts b/gateway/src/schema/Activity.ts deleted file mode 100644 index e18f66c8..00000000 --- a/gateway/src/schema/Activity.ts +++ /dev/null @@ -1,51 +0,0 @@ -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/gateway/src/schema/Identify.ts b/gateway/src/schema/Identify.ts deleted file mode 100644 index 21141321..00000000 --- a/gateway/src/schema/Identify.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { ActivitySchema } from "./Activity"; - -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/gateway/src/schema/LazyRequest.ts b/gateway/src/schema/LazyRequest.ts deleted file mode 100644 index 1fe658bb..00000000 --- a/gateway/src/schema/LazyRequest.ts +++ /dev/null @@ -1,19 +0,0 @@ -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/gateway/src/schema/VoiceStateUpdateSchema.ts b/gateway/src/schema/VoiceStateUpdateSchema.ts deleted file mode 100644 index 9efa191e..00000000 --- a/gateway/src/schema/VoiceStateUpdateSchema.ts +++ /dev/null @@ -1,15 +0,0 @@ -export const VoiceStateUpdateSchema = { - $guild_id: String, - $channel_id: String, - self_mute: Boolean, - self_deaf: Boolean, - self_video: Boolean, -}; - -export interface VoiceStateUpdateSchema { - guild_id?: string; - channel_id?: string; - self_mute: boolean; - self_deaf: boolean; - self_video: boolean; -} |