summary refs log tree commit diff
path: root/src/Schema
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-10 20:59:58 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-10 20:59:58 +0100
commit3d54ed476240702812caf0b6e1ce94bfb0329cb5 (patch)
tree9f928dee5023de75b22d6b99c25c3c3fd967da7f /src/Schema
parentexport event (diff)
downloadserver-ts-3d54ed476240702812caf0b6e1ce94bfb0329cb5.tar.xz
fix models + move schemas in api and gateway
Diffstat (limited to 'src/Schema')
-rw-r--r--src/Schema/Activity.ts81
-rw-r--r--src/Schema/Emoji.ts11
-rw-r--r--src/Schema/Guild.ts35
-rw-r--r--src/Schema/Identify.ts33
4 files changed, 0 insertions, 160 deletions
diff --git a/src/Schema/Activity.ts b/src/Schema/Activity.ts
deleted file mode 100644

index 00772743..00000000 --- a/src/Schema/Activity.ts +++ /dev/null
@@ -1,81 +0,0 @@ -import { EmojiSchema } from "./Emoji"; - -export const ActivitySchema = { - afk: Boolean, - status: String, - $activities: [ - { - name: String, // the activity's name - type: Number, // activity type // TODO: check if its between range 0-5 - $url: String, // stream url, is validated when type is 1 - $created_at: Number, // unix timestamp of when the activity was added to the user's session - $timestamps: { - // unix timestamps for start and/or end of the game - start: Number, - end: Number, - }, - $application_id: BigInt, // application id for the game - $details: String, - $State: String, - $emoji: EmojiSchema, - $party: { - $id: String, - $size: [Number], // used to show the party's current and maximum size // TODO: array length 2 - }, - $assets: { - $large_image: String, // the id for a large asset of the activity, usually a snowflake - $large_text: String, // text displayed when hovering over the large image of the activity - $small_image: String, // the id for a small asset of the activity, usually a snowflake - $small_text: String, // text displayed when hovering over the small image of the activity - }, - $secrets: { - $join: String, // the secret for joining a party - $spectate: String, // the secret for spectating a game - $match: String, // the secret for a specific instanced match - }, - $instance: Boolean, - flags: BigInt, // activity flags OR d together, describes what the payload includes - }, - ], - $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: string; - activities?: [ - { - name: string; // the activity's name - type: number; // activity type // TODO: check if its between range 0-5 - url?: string; // stream url, is validated when type is 1 - created_at?: number; // unix timestamp of when the activity was added to the user's session - timestamps?: { - // unix timestamps for start and/or end of the game - start: number; - end: number; - }; - application_id?: bigint; // application id for the game - details?: string; - State?: string; - emoji?: EmojiSchema; - party?: { - id?: string; - size?: [number]; // used to show the party's current and maximum size // TODO: array length 2 - }; - assets?: { - large_image?: string; // the id for a large asset of the activity, usually a snowflake - large_text?: string; // text displayed when hovering over the large image of the activity - small_image?: string; // the id for a small asset of the activity, usually a snowflake - small_text?: string; // text displayed when hovering over the small image of the activity - }; - secrets?: { - join?: string; // the secret for joining a party - spectate?: string; // the secret for spectating a game - match?: string; // the secret for a specific instanced match - }; - instance?: boolean; - flags: bigint; // activity flags OR d together, describes what the payload includes - } - ]; - since?: number; // unix time (in milliseconds) of when the client went idle, or null if the client is not idle -} diff --git a/src/Schema/Emoji.ts b/src/Schema/Emoji.ts deleted file mode 100644
index 09f3ebb1..00000000 --- a/src/Schema/Emoji.ts +++ /dev/null
@@ -1,11 +0,0 @@ -export const EmojiSchema = { - name: String, // the name of the emoji - $id: BigInt, // the id of the emoji - animated: Boolean, // whether this emoji is animated -}; - -export interface EmojiSchema { - name: string; - id?: bigint; - animated: Boolean; -} diff --git a/src/Schema/Guild.ts b/src/Schema/Guild.ts deleted file mode 100644
index c8634362..00000000 --- a/src/Schema/Guild.ts +++ /dev/null
@@ -1,35 +0,0 @@ -export const GuildSchema = { - name: String, // ! 2-100 chars - $region: String, // ? voice region ? - // $icon: String, // TODO: add icon data (base64 128x128) - - // * --- useless for us due to templates being a thing --- * // - // $verification_level: Number, // ! https://discord.com/developers/docs/resources/guild#guild-object-verification-level - // $default_message_notifications: Number, // ! https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level - // $explicit_content_filter: Number, - // $roles: array of role objects, - // $channels: array of partial channel objects, - // $afk_channel_id: snowflake, - // * --- useless for us --- * // - - // $afk_timeout: Number, - // $system_channel_id: snowflake, -}; - -export interface GuildSchema { - name: string; // ! 2-100 chars - region?: string; // ? voice region ? - // icon?: string; // TODO: add icon data (base64 128x128) - - // * --- useless for us due to templates being a thing --- * // - // verification_level?: number; // ! https://discord.com/developers/docs/resources/guild#guild-object-verification-level - // default_message_notifications?: number; // ! https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level - // explicit_content_filter?: number; - // $roles: array of role objects, - // $channels: array of partial channel objects, - // $afk_channel_id: snowflake, - // * --- useless for us --- * // - - // afk_timeout?: number; - // system_channel_id?: snowflake, -} diff --git a/src/Schema/Identify.ts b/src/Schema/Identify.ts deleted file mode 100644
index cfc3702a..00000000 --- a/src/Schema/Identify.ts +++ /dev/null
@@ -1,33 +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: { - // 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, - $$browser: String, - $$device: String, - }, - $presence: ActivitySchema, - $compress: Boolean, - $large_threshold: Number, - $shard: [Number], - $guild_subscriptions: Boolean, -}; - -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; - $$browser: string; - $$device: 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?: [number]; - guild_subscriptions?: boolean; -}