diff --git a/src/util/config/Config.ts b/src/util/config/Config.ts
new file mode 100644
index 00000000..7aee1775
--- /dev/null
+++ b/src/util/config/Config.ts
@@ -0,0 +1,22 @@
+import { ApiConfiguration, ClientConfiguration, DefaultsConfiguration, EndpointConfiguration, GeneralConfiguration, GifConfiguration, GuildConfiguration, KafkaConfiguration, LimitsConfiguration, LoginConfiguration, MetricsConfiguration, RabbitMQConfiguration, RegionConfiguration, RegisterConfiguration, SecurityConfiguration, SentryConfiguration, TemplateConfiguration } from ".";
+
+export class ConfigValue {
+ gateway: EndpointConfiguration = new EndpointConfiguration();
+ cdn: EndpointConfiguration = new EndpointConfiguration();
+ api: ApiConfiguration = new ApiConfiguration();
+ general: GeneralConfiguration = new GeneralConfiguration();
+ limits: LimitsConfiguration = new LimitsConfiguration();
+ security: SecurityConfiguration = new SecurityConfiguration();
+ login: LoginConfiguration = new LoginConfiguration();
+ register: RegisterConfiguration = new RegisterConfiguration();
+ regions: RegionConfiguration = new RegionConfiguration();
+ guild: GuildConfiguration = new GuildConfiguration();
+ gif: GifConfiguration = new GifConfiguration();
+ rabbitmq: RabbitMQConfiguration = new RabbitMQConfiguration();
+ kafka: KafkaConfiguration = new KafkaConfiguration();
+ templates: TemplateConfiguration = new TemplateConfiguration();
+ client: ClientConfiguration = new ClientConfiguration();
+ metrics: MetricsConfiguration = new MetricsConfiguration();
+ sentry: SentryConfiguration = new SentryConfiguration();
+ defaults: DefaultsConfiguration = new DefaultsConfiguration();
+}
\ No newline at end of file
diff --git a/src/util/config/index.ts b/src/util/config/index.ts
new file mode 100644
index 00000000..0a9b58ae
--- /dev/null
+++ b/src/util/config/index.ts
@@ -0,0 +1,2 @@
+export * from "./Config";
+export * from "./types/index";
diff --git a/src/util/config/types/ApiConfiguration.ts b/src/util/config/types/ApiConfiguration.ts
new file mode 100644
index 00000000..16b1efba
--- /dev/null
+++ b/src/util/config/types/ApiConfiguration.ts
@@ -0,0 +1,5 @@
+export class ApiConfiguration {
+ defaultVersion: string = "9";
+ activeVersions: string[] = ["6", "7", "8", "9"];
+ useFosscordEnhancements: boolean = true;
+}
\ No newline at end of file
diff --git a/src/util/config/types/ClientConfiguration.ts b/src/util/config/types/ClientConfiguration.ts
new file mode 100644
index 00000000..1adda1e2
--- /dev/null
+++ b/src/util/config/types/ClientConfiguration.ts
@@ -0,0 +1,8 @@
+import { ClientReleaseConfiguration } from ".";
+
+export class ClientConfiguration {
+ //classes
+ releases: ClientReleaseConfiguration = new ClientReleaseConfiguration();
+ //base types
+ useTestClient: boolean = true;
+}
\ No newline at end of file
diff --git a/src/util/config/types/DefaultsConfiguration.ts b/src/util/config/types/DefaultsConfiguration.ts
new file mode 100644
index 00000000..9b02a590
--- /dev/null
+++ b/src/util/config/types/DefaultsConfiguration.ts
@@ -0,0 +1,6 @@
+import { GuildDefaults, UserDefaults } from ".";
+
+export class DefaultsConfiguration {
+ guild: GuildDefaults = new GuildDefaults();
+ user: UserDefaults = new UserDefaults();
+}
\ No newline at end of file
diff --git a/src/util/config/types/EndpointConfiguration.ts b/src/util/config/types/EndpointConfiguration.ts
new file mode 100644
index 00000000..87baea31
--- /dev/null
+++ b/src/util/config/types/EndpointConfiguration.ts
@@ -0,0 +1,5 @@
+export class EndpointConfiguration {
+ endpointClient: string | null = null;
+ endpointPrivate: string | null = null;
+ endpointPublic: string | null = null;
+}
\ No newline at end of file
diff --git a/src/util/config/types/GeneralConfiguration.ts b/src/util/config/types/GeneralConfiguration.ts
new file mode 100644
index 00000000..55848b44
--- /dev/null
+++ b/src/util/config/types/GeneralConfiguration.ts
@@ -0,0 +1,12 @@
+import { Snowflake } from "../../util";
+
+export class GeneralConfiguration {
+ instanceName: string = "Fosscord Instance";
+ instanceDescription: string | null = "This is a Fosscord instance made in the pre-release days";
+ frontPage: string | null = null;
+ tosPage: string | null = null;
+ correspondenceEmail: string | null = "noreply@localhost.local";
+ correspondenceUserID: string | null = null;
+ image: string | null = null;
+ instanceId: string = Snowflake.generate();
+}
\ No newline at end of file
diff --git a/src/util/config/types/GifConfiguration.ts b/src/util/config/types/GifConfiguration.ts
new file mode 100644
index 00000000..6a2d520d
--- /dev/null
+++ b/src/util/config/types/GifConfiguration.ts
@@ -0,0 +1,5 @@
+export class GifConfiguration {
+ enabled: boolean = true;
+ provider: "tenor" = "tenor"; // more coming soon
+ apiKey?: string = "LIVDSRZULELA";
+}
\ No newline at end of file
diff --git a/src/util/config/types/GuildConfiguration.ts b/src/util/config/types/GuildConfiguration.ts
new file mode 100644
index 00000000..3d43b368
--- /dev/null
+++ b/src/util/config/types/GuildConfiguration.ts
@@ -0,0 +1,6 @@
+import { DiscoveryConfiguration, AutoJoinConfiguration } from ".";
+
+export class GuildConfiguration {
+ discovery: DiscoveryConfiguration = new DiscoveryConfiguration();
+ autoJoin: AutoJoinConfiguration = new AutoJoinConfiguration();
+}
diff --git a/src/util/config/types/KafkaConfiguration.ts b/src/util/config/types/KafkaConfiguration.ts
new file mode 100644
index 00000000..7932f49e
--- /dev/null
+++ b/src/util/config/types/KafkaConfiguration.ts
@@ -0,0 +1,5 @@
+import { KafkaBroker } from ".";
+
+export class KafkaConfiguration {
+ brokers: KafkaBroker[] | null = null;
+}
\ No newline at end of file
diff --git a/src/util/config/types/LimitConfigurations.ts b/src/util/config/types/LimitConfigurations.ts
new file mode 100644
index 00000000..bcc2e7e2
--- /dev/null
+++ b/src/util/config/types/LimitConfigurations.ts
@@ -0,0 +1,9 @@
+import { ChannelLimits, GuildLimits, MessageLimits, RateLimits, UserLimits } from ".";
+
+export class LimitsConfiguration {
+ user: UserLimits = new UserLimits();
+ guild: GuildLimits = new GuildLimits();
+ message: MessageLimits = new MessageLimits();
+ channel: ChannelLimits = new ChannelLimits();
+ rate: RateLimits = new RateLimits();
+}
\ No newline at end of file
diff --git a/src/util/config/types/LoginConfiguration.ts b/src/util/config/types/LoginConfiguration.ts
new file mode 100644
index 00000000..255c9451
--- /dev/null
+++ b/src/util/config/types/LoginConfiguration.ts
@@ -0,0 +1,3 @@
+export class LoginConfiguration {
+ requireCaptcha: boolean = false;
+}
\ No newline at end of file
diff --git a/src/util/config/types/MetricsConfiguration.ts b/src/util/config/types/MetricsConfiguration.ts
new file mode 100644
index 00000000..d7cd4937
--- /dev/null
+++ b/src/util/config/types/MetricsConfiguration.ts
@@ -0,0 +1,3 @@
+export class MetricsConfiguration {
+ timeout: number = 30000;
+}
\ No newline at end of file
diff --git a/src/util/config/types/RabbitMQConfiguration.ts b/src/util/config/types/RabbitMQConfiguration.ts
new file mode 100644
index 00000000..ce4a9123
--- /dev/null
+++ b/src/util/config/types/RabbitMQConfiguration.ts
@@ -0,0 +1,3 @@
+export class RabbitMQConfiguration {
+ host: string | null = null;
+}
\ No newline at end of file
diff --git a/src/util/config/types/RegionConfiguration.ts b/src/util/config/types/RegionConfiguration.ts
new file mode 100644
index 00000000..09d9271c
--- /dev/null
+++ b/src/util/config/types/RegionConfiguration.ts
@@ -0,0 +1,16 @@
+import { Region } from ".";
+
+export class RegionConfiguration {
+ default: string = "fosscord";
+ useDefaultAsOptimal: boolean = true;
+ available: Region[] = [
+ {
+ id: "fosscord",
+ name: "Fosscord",
+ endpoint: "127.0.0.1:3004",
+ vip: false,
+ custom: false,
+ deprecated: false,
+ },
+ ];
+}
\ No newline at end of file
diff --git a/src/util/config/types/RegisterConfiguration.ts b/src/util/config/types/RegisterConfiguration.ts
new file mode 100644
index 00000000..a0dc97c5
--- /dev/null
+++ b/src/util/config/types/RegisterConfiguration.ts
@@ -0,0 +1,18 @@
+import { DateOfBirthConfiguration, EmailConfiguration, PasswordConfiguration } from ".";
+
+export class RegisterConfiguration {
+ //classes
+ email: EmailConfiguration = new EmailConfiguration();
+ dateOfBirth: DateOfBirthConfiguration = new DateOfBirthConfiguration();
+ password: PasswordConfiguration = new PasswordConfiguration();
+ //base types
+ disabled: boolean = false;
+ requireCaptcha: boolean = true;
+ requireInvite: boolean = false;
+ guestsRequireInvite: boolean = true;
+ allowNewRegistration: boolean = true;
+ allowMultipleAccounts: boolean = true;
+ blockProxies: boolean = true;
+ incrementingDiscriminators: boolean = false; // random otherwise
+ defaultRights: string = "0";
+}
diff --git a/src/util/config/types/SecurityConfiguration.ts b/src/util/config/types/SecurityConfiguration.ts
new file mode 100644
index 00000000..405b86ac
--- /dev/null
+++ b/src/util/config/types/SecurityConfiguration.ts
@@ -0,0 +1,17 @@
+import crypto from "crypto";
+import { CaptchaConfiguration, TwoFactorConfiguration } from ".";
+
+export class SecurityConfiguration {
+ //classes
+ captcha: CaptchaConfiguration = new CaptchaConfiguration();
+ twoFactor: TwoFactorConfiguration = new TwoFactorConfiguration();
+ //base types
+ autoUpdate: boolean | number = true;
+ requestSignature: string = crypto.randomBytes(32).toString("base64");
+ jwtSecret: string = crypto.randomBytes(256).toString("base64");
+ // header to get the real user ip address
+ // X-Forwarded-For for nginx/reverse proxies
+ // CF-Connecting-IP for cloudflare
+ forwadedFor: string | null = null;
+ ipdataApiKey: string | null = "eca677b284b3bac29eb72f5e496aa9047f26543605efe99ff2ce35c9";
+}
diff --git a/src/util/config/types/SentryConfiguration.ts b/src/util/config/types/SentryConfiguration.ts
new file mode 100644
index 00000000..836094a1
--- /dev/null
+++ b/src/util/config/types/SentryConfiguration.ts
@@ -0,0 +1,8 @@
+import { hostname } from "os";
+
+export class SentryConfiguration {
+ enabled: boolean = false;
+ endpoint: string = "https://05e8e3d005f34b7d97e920ae5870a5e5@sentry.thearcanebrony.net/6";
+ traceSampleRate: number = 1.0;
+ environment: string = hostname();
+}
\ No newline at end of file
diff --git a/src/util/config/types/TemplateConfiguration.ts b/src/util/config/types/TemplateConfiguration.ts
new file mode 100644
index 00000000..4a9aa8f2
--- /dev/null
+++ b/src/util/config/types/TemplateConfiguration.ts
@@ -0,0 +1,6 @@
+export class TemplateConfiguration {
+ enabled: boolean = true;
+ allowTemplateCreation: boolean = true;
+ allowDiscordTemplates: boolean = true;
+ allowRaws: boolean = true;
+}
\ No newline at end of file
diff --git a/src/util/config/types/index.ts b/src/util/config/types/index.ts
new file mode 100644
index 00000000..608503a0
--- /dev/null
+++ b/src/util/config/types/index.ts
@@ -0,0 +1,18 @@
+export * from "./ApiConfiguration";
+export * from "./ClientConfiguration";
+export * from "./DefaultsConfiguration";
+export * from "./EndpointConfiguration";
+export * from "./GeneralConfiguration";
+export * from "./GifConfiguration";
+export * from "./GuildConfiguration";
+export * from "./KafkaConfiguration";
+export * from "./LimitConfigurations";
+export * from "./LoginConfiguration";
+export * from "./MetricsConfiguration";
+export * from "./RabbitMQConfiguration";
+export * from "./RegionConfiguration";
+export * from "./RegisterConfiguration";
+export * from "./SecurityConfiguration";
+export * from "./SentryConfiguration";
+export * from "./TemplateConfiguration";
+export * from "./subconfigurations/index";
diff --git a/src/util/config/types/subconfigurations/client/ClientReleaseConfiguration.ts b/src/util/config/types/subconfigurations/client/ClientReleaseConfiguration.ts
new file mode 100644
index 00000000..54e7f365
--- /dev/null
+++ b/src/util/config/types/subconfigurations/client/ClientReleaseConfiguration.ts
@@ -0,0 +1,4 @@
+export class ClientReleaseConfiguration {
+ useLocalRelease: boolean = true; //TODO
+ upstreamVersion: string = "0.0.264";
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/client/index.ts b/src/util/config/types/subconfigurations/client/index.ts
new file mode 100644
index 00000000..96bbb0ca
--- /dev/null
+++ b/src/util/config/types/subconfigurations/client/index.ts
@@ -0,0 +1 @@
+export * from "./ClientReleaseConfiguration";
diff --git a/src/util/config/types/subconfigurations/defaults/GuildDefaults.ts b/src/util/config/types/subconfigurations/defaults/GuildDefaults.ts
new file mode 100644
index 00000000..d6ff7697
--- /dev/null
+++ b/src/util/config/types/subconfigurations/defaults/GuildDefaults.ts
@@ -0,0 +1,8 @@
+export class GuildDefaults {
+ maxPresences: number = 250000;
+ maxVideoChannelUsers: number = 200;
+ afkTimeout: number = 300;
+ defaultMessageNotifications: number = 1;
+ explicitContentFilter: number = 0;
+ test: number = 123;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/defaults/UserDefaults.ts b/src/util/config/types/subconfigurations/defaults/UserDefaults.ts
new file mode 100644
index 00000000..4481c011
--- /dev/null
+++ b/src/util/config/types/subconfigurations/defaults/UserDefaults.ts
@@ -0,0 +1,5 @@
+export class UserDefaults {
+ premium: boolean = false;
+ premium_type: number = 2;
+ verified: boolean = true;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/defaults/index.ts b/src/util/config/types/subconfigurations/defaults/index.ts
new file mode 100644
index 00000000..50258d1c
--- /dev/null
+++ b/src/util/config/types/subconfigurations/defaults/index.ts
@@ -0,0 +1,2 @@
+export * from "./GuildDefaults";
+export * from "./UserDefaults";
diff --git a/src/util/config/types/subconfigurations/guild/AutoJoin.ts b/src/util/config/types/subconfigurations/guild/AutoJoin.ts
new file mode 100644
index 00000000..47dfe5ec
--- /dev/null
+++ b/src/util/config/types/subconfigurations/guild/AutoJoin.ts
@@ -0,0 +1,5 @@
+export class AutoJoinConfiguration {
+ enabled: boolean = true;
+ guilds: string[] = [];
+ canLeave: boolean = true;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/guild/Discovery.ts b/src/util/config/types/subconfigurations/guild/Discovery.ts
new file mode 100644
index 00000000..59d8a8ae
--- /dev/null
+++ b/src/util/config/types/subconfigurations/guild/Discovery.ts
@@ -0,0 +1,6 @@
+export class DiscoveryConfiguration {
+ showAllGuilds: boolean = false;
+ useRecommendation: boolean = false; // TODO: Recommendation, privacy concern?
+ offset: number = 0;
+ limit: number = 24;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/guild/index.ts b/src/util/config/types/subconfigurations/guild/index.ts
new file mode 100644
index 00000000..e9614856
--- /dev/null
+++ b/src/util/config/types/subconfigurations/guild/index.ts
@@ -0,0 +1,2 @@
+export * from "./AutoJoin";
+export * from "./Discovery";
diff --git a/src/util/config/types/subconfigurations/index.ts b/src/util/config/types/subconfigurations/index.ts
new file mode 100644
index 00000000..bfbadc92
--- /dev/null
+++ b/src/util/config/types/subconfigurations/index.ts
@@ -0,0 +1,8 @@
+export * from "./client/index";
+export * from "./defaults/index";
+export * from "./guild/index";
+export * from "./kafka/index";
+export * from "./limits/index";
+export * from "./region/index";
+export * from "./register/index";
+export * from "./security/index";
diff --git a/src/util/config/types/subconfigurations/kafka/KafkaBroker.ts b/src/util/config/types/subconfigurations/kafka/KafkaBroker.ts
new file mode 100644
index 00000000..4f9a5e51
--- /dev/null
+++ b/src/util/config/types/subconfigurations/kafka/KafkaBroker.ts
@@ -0,0 +1,4 @@
+export interface KafkaBroker {
+ ip: string;
+ port: number;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/kafka/index.ts b/src/util/config/types/subconfigurations/kafka/index.ts
new file mode 100644
index 00000000..2c633950
--- /dev/null
+++ b/src/util/config/types/subconfigurations/kafka/index.ts
@@ -0,0 +1 @@
+export * from "./KafkaBroker";
diff --git a/src/util/config/types/subconfigurations/limits/ChannelLimits.ts b/src/util/config/types/subconfigurations/limits/ChannelLimits.ts
new file mode 100644
index 00000000..2f8f9485
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/ChannelLimits.ts
@@ -0,0 +1,5 @@
+export class ChannelLimits {
+ maxPins: number = 500;
+ maxTopic: number = 1024;
+ maxWebhooks: number = 100;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/limits/GuildLimits.ts b/src/util/config/types/subconfigurations/limits/GuildLimits.ts
new file mode 100644
index 00000000..91ad39ae
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/GuildLimits.ts
@@ -0,0 +1,8 @@
+export class GuildLimits {
+ maxRoles: number = 1000;
+ maxEmojis: number = 2000;
+ maxMembers: number = 25000000;
+ maxChannels: number = 65535;
+ maxChannelsInCategory: number = 65535;
+ hideOfflineMember: number = 3;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/limits/MessageLimits.ts b/src/util/config/types/subconfigurations/limits/MessageLimits.ts
new file mode 100644
index 00000000..51576b90
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/MessageLimits.ts
@@ -0,0 +1,8 @@
+export class MessageLimits {
+ maxCharacters: number = 1048576;
+ maxTTSCharacters: number = 160;
+ maxReactions: number = 2048;
+ maxAttachmentSize: number = 1024 * 1024 * 1024;
+ maxBulkDelete: number = 1000;
+ maxEmbedDownloadSize: number = 1024 * 1024 * 5;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/limits/RateLimits.ts b/src/util/config/types/subconfigurations/limits/RateLimits.ts
new file mode 100644
index 00000000..25e7a1e0
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/RateLimits.ts
@@ -0,0 +1,18 @@
+import { RouteRateLimit, RateLimitOptions } from ".";
+
+export class RateLimits {
+ disabled: boolean = true;
+ ip: Omit<RateLimitOptions, "bot_count"> = {
+ count: 500,
+ window: 5
+ };
+ global: RateLimitOptions = {
+ count: 250,
+ window: 5
+ };
+ error: RateLimitOptions = {
+ count: 10,
+ window: 5
+ };
+ routes: RouteRateLimit;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/limits/UserLimits.ts b/src/util/config/types/subconfigurations/limits/UserLimits.ts
new file mode 100644
index 00000000..0d10e0b3
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/UserLimits.ts
@@ -0,0 +1,5 @@
+export class UserLimits {
+ maxGuilds: number = 1048576;
+ maxUsername: number = 127;
+ maxFriends: number = 5000;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/limits/index.ts b/src/util/config/types/subconfigurations/limits/index.ts
new file mode 100644
index 00000000..0b7304f6
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/index.ts
@@ -0,0 +1,6 @@
+export * from "./ChannelLimits";
+export * from "./GuildLimits";
+export * from "./MessageLimits";
+export * from "./RateLimits";
+export * from "./UserLimits";
+export * from "./ratelimits/index";
diff --git a/src/util/config/types/subconfigurations/limits/ratelimits/Auth.ts b/src/util/config/types/subconfigurations/limits/ratelimits/Auth.ts
new file mode 100644
index 00000000..df171044
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/ratelimits/Auth.ts
@@ -0,0 +1,12 @@
+import { RateLimitOptions } from "./RateLimitOptions";
+
+export class AuthRateLimit {
+ login: RateLimitOptions = {
+ count: 5,
+ window: 60
+ };
+ register: RateLimitOptions = {
+ count: 2,
+ window: 60 * 60 * 12
+ };
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/limits/ratelimits/RateLimitOptions.ts b/src/util/config/types/subconfigurations/limits/ratelimits/RateLimitOptions.ts
new file mode 100644
index 00000000..7089e28e
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/ratelimits/RateLimitOptions.ts
@@ -0,0 +1,6 @@
+export interface RateLimitOptions {
+ bot?: number;
+ count: number;
+ window: number;
+ onyIp?: boolean;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/limits/ratelimits/Route.ts b/src/util/config/types/subconfigurations/limits/ratelimits/Route.ts
new file mode 100644
index 00000000..844b1b9a
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/ratelimits/Route.ts
@@ -0,0 +1,19 @@
+import { AuthRateLimit } from "./Auth";
+import { RateLimitOptions } from "./RateLimitOptions";
+
+export class RouteRateLimit {
+ guild: RateLimitOptions = {
+ count: 5,
+ window: 5
+ };
+ webhook: RateLimitOptions = {
+ count: 10,
+ window: 5
+ };
+ channel: RateLimitOptions = {
+ count: 10,
+ window: 5
+ };
+ auth: AuthRateLimit;
+ // TODO: rate limit configuration for all routes
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/limits/ratelimits/index.ts b/src/util/config/types/subconfigurations/limits/ratelimits/index.ts
new file mode 100644
index 00000000..432eb601
--- /dev/null
+++ b/src/util/config/types/subconfigurations/limits/ratelimits/index.ts
@@ -0,0 +1,3 @@
+export * from "./Auth";
+export * from "./RateLimitOptions";
+export * from "./Route";
diff --git a/src/util/config/types/subconfigurations/region/Region.ts b/src/util/config/types/subconfigurations/region/Region.ts
new file mode 100644
index 00000000..a8717e1f
--- /dev/null
+++ b/src/util/config/types/subconfigurations/region/Region.ts
@@ -0,0 +1,12 @@
+export interface Region {
+ id: string;
+ name: string;
+ endpoint: string;
+ location?: {
+ latitude: number;
+ longitude: number;
+ };
+ vip: boolean;
+ custom: boolean;
+ deprecated: boolean;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/region/index.ts b/src/util/config/types/subconfigurations/region/index.ts
new file mode 100644
index 00000000..2beb8de7
--- /dev/null
+++ b/src/util/config/types/subconfigurations/region/index.ts
@@ -0,0 +1 @@
+export * from "./Region";
diff --git a/src/util/config/types/subconfigurations/register/DateOfBirth.ts b/src/util/config/types/subconfigurations/register/DateOfBirth.ts
new file mode 100644
index 00000000..5a3c4e9d
--- /dev/null
+++ b/src/util/config/types/subconfigurations/register/DateOfBirth.ts
@@ -0,0 +1,4 @@
+export class DateOfBirthConfiguration {
+ required: boolean = true;
+ minimum: number = 13; // in years
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/register/Email.ts b/src/util/config/types/subconfigurations/register/Email.ts
new file mode 100644
index 00000000..115d49e0
--- /dev/null
+++ b/src/util/config/types/subconfigurations/register/Email.ts
@@ -0,0 +1,7 @@
+export class EmailConfiguration {
+ required: boolean = false;
+ allowlist: boolean = false;
+ blocklist: boolean = true;
+ domains: string[] = [];// TODO: efficiently save domain blocklist in database
+ // domains: fs.readFileSync(__dirname + "/blockedEmailDomains.txt", { encoding: "utf8" }).split("\n"),
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/register/Password.ts b/src/util/config/types/subconfigurations/register/Password.ts
new file mode 100644
index 00000000..977473ac
--- /dev/null
+++ b/src/util/config/types/subconfigurations/register/Password.ts
@@ -0,0 +1,7 @@
+export class PasswordConfiguration {
+ required: boolean = false;
+ minLength: number = 8;
+ minNumbers: number = 2;
+ minUpperCase: number =2;
+ minSymbols: number = 0;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/register/index.ts b/src/util/config/types/subconfigurations/register/index.ts
new file mode 100644
index 00000000..d9738120
--- /dev/null
+++ b/src/util/config/types/subconfigurations/register/index.ts
@@ -0,0 +1,3 @@
+export * from "./DateOfBirth";
+export * from "./Email";
+export * from "./Password";
diff --git a/src/util/config/types/subconfigurations/security/Captcha.ts b/src/util/config/types/subconfigurations/security/Captcha.ts
new file mode 100644
index 00000000..ad6aa762
--- /dev/null
+++ b/src/util/config/types/subconfigurations/security/Captcha.ts
@@ -0,0 +1,6 @@
+export class CaptchaConfiguration {
+ enabled: boolean = false;
+ service: "recaptcha" | "hcaptcha" | null = null; // TODO: hcaptcha, custom
+ sitekey: string | null = null;
+ secret: string | null = null;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/security/TwoFactor.ts b/src/util/config/types/subconfigurations/security/TwoFactor.ts
new file mode 100644
index 00000000..33a47385
--- /dev/null
+++ b/src/util/config/types/subconfigurations/security/TwoFactor.ts
@@ -0,0 +1,3 @@
+export class TwoFactorConfiguration {
+ generateBackupCodes: boolean = true;
+}
\ No newline at end of file
diff --git a/src/util/config/types/subconfigurations/security/index.ts b/src/util/config/types/subconfigurations/security/index.ts
new file mode 100644
index 00000000..17619589
--- /dev/null
+++ b/src/util/config/types/subconfigurations/security/index.ts
@@ -0,0 +1,2 @@
+export * from "./Captcha";
+export * from "./TwoFactor";
diff --git a/util/src/dtos/DmChannelDTO.ts b/src/util/dtos/DmChannelDTO.ts
index 226b2f9d..226b2f9d 100644
--- a/util/src/dtos/DmChannelDTO.ts
+++ b/src/util/dtos/DmChannelDTO.ts
diff --git a/util/src/dtos/UserDTO.ts b/src/util/dtos/UserDTO.ts
index ee2752a4..ee2752a4 100644
--- a/util/src/dtos/UserDTO.ts
+++ b/src/util/dtos/UserDTO.ts
diff --git a/util/src/dtos/index.ts b/src/util/dtos/index.ts
index 0e8f8459..0e8f8459 100644
--- a/util/src/dtos/index.ts
+++ b/src/util/dtos/index.ts
diff --git a/util/src/entities/Application.ts b/src/util/entities/Application.ts
index 103f8e84..103f8e84 100644
--- a/util/src/entities/Application.ts
+++ b/src/util/entities/Application.ts
diff --git a/util/src/entities/Attachment.ts b/src/util/entities/Attachment.ts
index 7b4b17eb..7b4b17eb 100644
--- a/util/src/entities/Attachment.ts
+++ b/src/util/entities/Attachment.ts
diff --git a/util/src/entities/AuditLog.ts b/src/util/entities/AuditLog.ts
index b003e7ba..b003e7ba 100644
--- a/util/src/entities/AuditLog.ts
+++ b/src/util/entities/AuditLog.ts
diff --git a/util/src/entities/BackupCodes.ts b/src/util/entities/BackupCodes.ts
index 9092c14e..9092c14e 100644
--- a/util/src/entities/BackupCodes.ts
+++ b/src/util/entities/BackupCodes.ts
diff --git a/util/src/entities/Ban.ts b/src/util/entities/Ban.ts
index 9504bd8e..9504bd8e 100644
--- a/util/src/entities/Ban.ts
+++ b/src/util/entities/Ban.ts
diff --git a/util/src/entities/BaseClass.ts b/src/util/entities/BaseClass.ts
index c872e7f1..aecc2465 100644
--- a/util/src/entities/BaseClass.ts
+++ b/src/util/entities/BaseClass.ts
@@ -1,5 +1,5 @@
import "reflect-metadata";
-import { BaseEntity, EntityMetadata, ObjectIdColumn, PrimaryColumn, FindOptionsWhere, Generated, SaveOptions } from "typeorm";
+import { BaseEntity, ObjectIdColumn, PrimaryColumn, SaveOptions } from "typeorm";
import { Snowflake } from "../util/Snowflake";
export class BaseClassWithoutId extends BaseEntity {
diff --git a/util/src/entities/Categories.ts b/src/util/entities/Categories.ts
index 81fbc303..81fbc303 100644
--- a/util/src/entities/Categories.ts
+++ b/src/util/entities/Categories.ts
diff --git a/util/src/entities/Channel.ts b/src/util/entities/Channel.ts
index ade0fb39..a576d7af 100644
--- a/util/src/entities/Channel.ts
+++ b/src/util/entities/Channel.ts
@@ -151,6 +151,13 @@ export class Channel extends BaseClass {
})
webhooks?: Webhook[];
+ @Column({ nullable: true })
+ flags?: number = 0;
+
+ @Column({ nullable: true })
+ default_thread_rate_limit_per_user?: number = 0;
+
+
// TODO: DM channel
static async createChannel(
channel: Partial<Channel>,
diff --git a/util/src/entities/ClientRelease.ts b/src/util/entities/ClientRelease.ts
index c5afd307..c5afd307 100644
--- a/util/src/entities/ClientRelease.ts
+++ b/src/util/entities/ClientRelease.ts
diff --git a/src/util/entities/Config.ts b/src/util/entities/Config.ts
new file mode 100644
index 00000000..606fe901
--- /dev/null
+++ b/src/util/entities/Config.ts
@@ -0,0 +1,11 @@
+import { Column, Entity } from "typeorm";
+import { BaseClassWithoutId, PrimaryIdColumn } from "./BaseClass";
+
+@Entity("config")
+export class ConfigEntity extends BaseClassWithoutId {
+ @PrimaryIdColumn()
+ key: string;
+
+ @Column({ type: "simple-json", nullable: true })
+ value: number | boolean | null | string | undefined;
+}
\ No newline at end of file
diff --git a/util/src/entities/ConnectedAccount.ts b/src/util/entities/ConnectedAccount.ts
index 09ae30ab..09ae30ab 100644
--- a/util/src/entities/ConnectedAccount.ts
+++ b/src/util/entities/ConnectedAccount.ts
diff --git a/util/src/entities/Emoji.ts b/src/util/entities/Emoji.ts
index a3615b7d..a3615b7d 100644
--- a/util/src/entities/Emoji.ts
+++ b/src/util/entities/Emoji.ts
diff --git a/util/src/entities/Encryption.ts b/src/util/entities/Encryption.ts
index 6b578d15..6b578d15 100644
--- a/util/src/entities/Encryption.ts
+++ b/src/util/entities/Encryption.ts
diff --git a/util/src/entities/Group.ts b/src/util/entities/Group.ts
index b24d38cf..b24d38cf 100644
--- a/util/src/entities/Group.ts
+++ b/src/util/entities/Group.ts
diff --git a/util/src/entities/Guild.ts b/src/util/entities/Guild.ts
index 77a04350..d146e577 100644
--- a/util/src/entities/Guild.ts
+++ b/src/util/entities/Guild.ts
@@ -53,7 +53,7 @@ export class Guild extends BaseClass {
afk_channel?: Channel;
@Column({ nullable: true })
- afk_timeout?: number;
+ afk_timeout?: number = Config.get().defaults.guild.afkTimeout;
// * commented out -> use owner instead
// application id of the guild creator if it is bot-created
@@ -71,7 +71,7 @@ export class Guild extends BaseClass {
banner?: string;
@Column({ nullable: true })
- default_message_notifications?: number;
+ default_message_notifications?: number = Config.get().defaults.guild.defaultMessageNotifications;
@Column({ nullable: true })
description?: string;
@@ -80,7 +80,7 @@ export class Guild extends BaseClass {
discovery_splash?: string;
@Column({ nullable: true })
- explicit_content_filter?: number;
+ explicit_content_filter?: number = Config.get().defaults.guild.explicitContentFilter;
@Column({ type: "simple-array" })
features: string[]; //TODO use enum
@@ -96,19 +96,19 @@ export class Guild extends BaseClass {
large?: boolean;
@Column({ nullable: true })
- max_members?: number; // e.g. default 100.000
+ max_members?: number = Config.get().limits.guild.maxMembers; // e.g. default 100.000
@Column({ nullable: true })
- max_presences?: number;
+ max_presences?: number = Config.get().defaults.guild.maxPresences;
@Column({ nullable: true })
- max_video_channel_users?: number; // ? default: 25, is this max 25 streaming or watching
+ max_video_channel_users?: number = Config.get().defaults.guild.maxVideoChannelUsers; // ? default: 25, is this max 25 streaming or watching
@Column({ nullable: true })
- member_count?: number;
+ member_count?: number = 0;
@Column({ nullable: true })
- presence_count?: number; // users online
+ presence_count?: number = 0; // users online
@OneToMany(() => Member, (member: Member) => member.guild, {
cascade: true,
@@ -278,6 +278,10 @@ export class Guild extends BaseClass {
// only for developer portal
permissions?: number;
+ //new guild settings, 11/08/2022:
+ @Column({ nullable: true })
+ premium_progress_bar_enabled: boolean = false;
+
static async createGuild(body: {
name?: string;
icon?: string | null;
diff --git a/util/src/entities/Invite.ts b/src/util/entities/Invite.ts
index 1e0ebe52..1e0ebe52 100644
--- a/util/src/entities/Invite.ts
+++ b/src/util/entities/Invite.ts
diff --git a/util/src/entities/Member.ts b/src/util/entities/Member.ts
index baac58ed..baac58ed 100644
--- a/util/src/entities/Member.ts
+++ b/src/util/entities/Member.ts
diff --git a/util/src/entities/Message.ts b/src/util/entities/Message.ts
index ba3d4f2d..ba3d4f2d 100644
--- a/util/src/entities/Message.ts
+++ b/src/util/entities/Message.ts
diff --git a/util/src/entities/Migration.ts b/src/util/entities/Migration.ts
index 3f39ae72..3f39ae72 100644
--- a/util/src/entities/Migration.ts
+++ b/src/util/entities/Migration.ts
diff --git a/util/src/entities/Note.ts b/src/util/entities/Note.ts
index 36017c5e..36017c5e 100644
--- a/util/src/entities/Note.ts
+++ b/src/util/entities/Note.ts
diff --git a/util/src/entities/RateLimit.ts b/src/util/entities/RateLimit.ts
index f5916f6b..f5916f6b 100644
--- a/util/src/entities/RateLimit.ts
+++ b/src/util/entities/RateLimit.ts
diff --git a/util/src/entities/ReadState.ts b/src/util/entities/ReadState.ts
index b915573b..b915573b 100644
--- a/util/src/entities/ReadState.ts
+++ b/src/util/entities/ReadState.ts
diff --git a/util/src/entities/Recipient.ts b/src/util/entities/Recipient.ts
index a945f938..a945f938 100644
--- a/util/src/entities/Recipient.ts
+++ b/src/util/entities/Recipient.ts
diff --git a/util/src/entities/Relationship.ts b/src/util/entities/Relationship.ts
index c3592c76..c3592c76 100644
--- a/util/src/entities/Relationship.ts
+++ b/src/util/entities/Relationship.ts
diff --git a/util/src/entities/Role.ts b/src/util/entities/Role.ts
index 4b721b5b..4b721b5b 100644
--- a/util/src/entities/Role.ts
+++ b/src/util/entities/Role.ts
diff --git a/util/src/entities/Session.ts b/src/util/entities/Session.ts
index 969efa89..969efa89 100644
--- a/util/src/entities/Session.ts
+++ b/src/util/entities/Session.ts
diff --git a/util/src/entities/Sticker.ts b/src/util/entities/Sticker.ts
index 37bc6fbe..37bc6fbe 100644
--- a/util/src/entities/Sticker.ts
+++ b/src/util/entities/Sticker.ts
diff --git a/util/src/entities/StickerPack.ts b/src/util/entities/StickerPack.ts
index ec8c69a2..ec8c69a2 100644
--- a/util/src/entities/StickerPack.ts
+++ b/src/util/entities/StickerPack.ts
diff --git a/util/src/entities/Team.ts b/src/util/entities/Team.ts
index 22140b7f..22140b7f 100644
--- a/util/src/entities/Team.ts
+++ b/src/util/entities/Team.ts
diff --git a/util/src/entities/TeamMember.ts b/src/util/entities/TeamMember.ts
index b726e1e8..b726e1e8 100644
--- a/util/src/entities/TeamMember.ts
+++ b/src/util/entities/TeamMember.ts
diff --git a/util/src/entities/Template.ts b/src/util/entities/Template.ts
index 1d952283..1d952283 100644
--- a/util/src/entities/Template.ts
+++ b/src/util/entities/Template.ts
diff --git a/util/src/entities/User.ts b/src/util/entities/User.ts
index a9f00b0d..5432f298 100644
--- a/util/src/entities/User.ts
+++ b/src/util/entities/User.ts
@@ -1,11 +1,11 @@
-import { Column, Entity, FindOneOptions, FindOptionsSelectByString, JoinColumn, OneToMany } from "typeorm";
+import { Column, Entity, FindOneOptions, FindOptionsSelectByString, JoinColumn, OneToMany, OneToOne } from "typeorm";
import { OrmUtils } from "../util/imports/OrmUtils";
import { BaseClass } from "./BaseClass";
import { BitField } from "../util/BitField";
import { Relationship } from "./Relationship";
import { ConnectedAccount } from "./ConnectedAccount";
import { Config, FieldErrors, Snowflake, trimSpecial } from "..";
-import { Member, Session } from ".";
+import { Member, Session, UserSettings } from ".";
export enum PublicUserEnum {
username,
@@ -83,30 +83,30 @@ export class User extends BaseClass {
phone?: string; // phone number of the user
@Column({ select: false })
- desktop: boolean; // if the user has desktop app installed
+ desktop: boolean = false; // if the user has desktop app installed
@Column({ select: false })
- mobile: boolean; // if the user has mobile app installed
+ mobile: boolean = false; // if the user has mobile app installed
@Column()
- premium: boolean; // if user bought individual premium
+ premium: boolean = Config.get().defaults.user.premium; // if user bought individual premium
@Column()
- premium_type: number; // individual premium level
+ premium_type: number = Config.get().defaults.user.premium_type; // individual premium level
@Column()
- bot: boolean; // if user is bot
+ bot: boolean = false; // if user is bot
- @Column()
+ @Column({ nullable: true })
bio: string; // short description of the user (max 190 chars -> should be configurable)
@Column()
- system: boolean; // shouldn't be used, the api sends this field type true, if the generated message comes from a system generated author
+ system: boolean = false; // shouldn't be used, the api sends this field type true, if the generated message comes from a system generated author
@Column({ select: false })
- nsfw_allowed: boolean; // if the user can do age-restricted actions (NSFW channels/guilds/commands)
+ nsfw_allowed: boolean = true; // if the user can do age-restricted actions (NSFW channels/guilds/commands) // TODO: depending on age
- @Column({ select: false })
+ @Column({ select: false, nullable: true })
mfa_enabled: boolean; // if multi factor authentication is enabled
@Column({ select: false, nullable: true })
@@ -116,31 +116,31 @@ export class User extends BaseClass {
totp_last_ticket?: string;
@Column()
- created_at: Date; // registration date
+ created_at: Date = new Date(); // registration date
@Column({ nullable: true })
- premium_since: Date; // premium date
+ premium_since: Date = new Date(); // premium date
@Column({ select: false })
- verified: boolean; // if the user is offically verified
+ verified: boolean = Config.get().defaults.user.verified; // if the user is offically verified
@Column()
- disabled: boolean; // if the account is disabled
+ disabled: boolean = false; // if the account is disabled
@Column()
- deleted: boolean; // if the user was deleted
+ deleted: boolean = false; // if the user was deleted
@Column({ nullable: true, select: false })
email?: string; // email of the user
@Column()
- flags: string; // UserFlags
+ flags: string = "0"; // UserFlags // TODO: generate
@Column()
- public_flags: number;
+ public_flags: number = 0;
@Column({ type: "bigint" })
- rights: string; // Rights
+ rights: string = Config.get().register.defaultRights; // Rights
@OneToMany(() => Session, (session: Session) => session.user)
sessions: Session[];
@@ -166,17 +166,30 @@ export class User extends BaseClass {
};
@Column({ type: "simple-array", select: false })
- fingerprints: string[]; // array of fingerprints -> used to prevent multiple accounts
+ fingerprints: string[] = []; // array of fingerprints -> used to prevent multiple accounts
- @Column({ type: "simple-json", select: false })
+
+ @OneToOne(()=> UserSettings, {
+ cascade: true,
+ orphanedRowAction: "delete",
+ eager: false
+ })
+ @JoinColumn()
settings: UserSettings;
// workaround to prevent fossord-unaware clients from deleting settings not used by them
@Column({ type: "simple-json", select: false })
- extended_settings: string;
+ extended_settings: string = "{}";
@Column({ type: "simple-json" })
- notes: { [key: string]: string }; //key is ID of user
+ notes: { [key: string]: string } = {}; //key is ID of user
+
+ async save(): Promise<any> {
+ if(!this.settings) this.settings = new UserSettings();
+ this.settings.id = this.id;
+ //await this.settings.save();
+ return super.save();
+ }
toPublicUser() {
const user: any = {};
@@ -256,39 +269,19 @@ export class User extends BaseClass {
const language = req?.language === "en" ? "en-US" : req?.language || "en-US";
const user = OrmUtils.mergeDeep(new User(), {
- created_at: new Date(),
+ //required:
username: username,
discriminator,
id: Snowflake.generate(),
- bot: false,
- system: false,
- premium_since: new Date(),
- desktop: false,
- mobile: false,
- premium: true,
- premium_type: 2,
- bio: "",
- mfa_enabled: false,
- totp_secret: "",
- totp_backup_codes: [],
- verified: true,
- disabled: false,
- deleted: false,
email: email,
- rights: Config.get().register.defaultRights, // TODO: grant rights correctly, as 0 actually stands for no rights at all
- nsfw_allowed: true, // TODO: depending on age
- public_flags: "0",
- flags: "0", // TODO: generate
data: {
hash: password,
valid_tokens_since: new Date(),
},
- settings: { ...defaultSettings, locale: language },
- extended_settings: {},
- fingerprints: [],
- notes: {},
+ settings: { ...new UserSettings(), locale: language }
});
+ //await (user.settings as UserSettings).save();
await user.save();
setImmediate(async () => {
@@ -303,85 +296,6 @@ export class User extends BaseClass {
}
}
-export const defaultSettings: UserSettings = {
- afk_timeout: 3600,
- allow_accessibility_detection: true,
- animate_emoji: true,
- animate_stickers: 0,
- contact_sync_enabled: false,
- convert_emoticons: false,
- custom_status: null,
- default_guilds_restricted: false,
- detect_platform_accounts: false,
- developer_mode: true,
- disable_games_tab: true,
- enable_tts_command: false,
- explicit_content_filter: 0,
- friend_source_flags: { all: true },
- gateway_connected: false,
- gif_auto_play: true,
- guild_folders: [],
- guild_positions: [],
- inline_attachment_media: true,
- inline_embed_media: true,
- locale: "en-US",
- message_display_compact: false,
- native_phone_integration_enabled: true,
- render_embeds: true,
- render_reactions: true,
- restricted_guilds: [],
- show_current_game: true,
- status: "online",
- stream_notifications_enabled: false,
- theme: "dark",
- timezone_offset: 0, // TODO: timezone from request
-};
-
-export interface UserSettings {
- afk_timeout: number;
- allow_accessibility_detection: boolean;
- animate_emoji: boolean;
- animate_stickers: number;
- contact_sync_enabled: boolean;
- convert_emoticons: boolean;
- custom_status: {
- emoji_id?: string;
- emoji_name?: string;
- expires_at?: number;
- text?: string;
- } | null;
- default_guilds_restricted: boolean;
- detect_platform_accounts: boolean;
- developer_mode: boolean;
- disable_games_tab: boolean;
- enable_tts_command: boolean;
- explicit_content_filter: number;
- friend_source_flags: { all: boolean };
- gateway_connected: boolean;
- gif_auto_play: boolean;
- // every top guild is displayed as a "folder"
- guild_folders: {
- color: number;
- guild_ids: string[];
- id: number;
- name: string;
- }[];
- guild_positions: string[]; // guild ids ordered by position
- inline_attachment_media: boolean;
- inline_embed_media: boolean;
- locale: string; // en_US
- message_display_compact: boolean;
- native_phone_integration_enabled: boolean;
- render_embeds: boolean;
- render_reactions: boolean;
- restricted_guilds: string[];
- show_current_game: boolean;
- status: "online" | "offline" | "dnd" | "idle" | "invisible";
- stream_notifications_enabled: boolean;
- theme: "dark" | "white"; // dark
- timezone_offset: number; // e.g -60
-}
-
export const CUSTOM_USER_FLAG_OFFSET = BigInt(1) << BigInt(32);
export class UserFlags extends BitField {
diff --git a/util/src/entities/UserGroup.ts b/src/util/entities/UserGroup.ts
index 709b9d0b..709b9d0b 100644
--- a/util/src/entities/UserGroup.ts
+++ b/src/util/entities/UserGroup.ts
diff --git a/src/util/entities/UserSettings.ts b/src/util/entities/UserSettings.ts
new file mode 100644
index 00000000..ef6f95af
--- /dev/null
+++ b/src/util/entities/UserSettings.ts
@@ -0,0 +1,119 @@
+import { Column, Entity, JoinColumn } from "typeorm";
+import { BaseClassWithoutId, PrimaryIdColumn } from ".";
+
+@Entity("user_settings")
+export class UserSettings extends BaseClassWithoutId {
+ @PrimaryIdColumn()
+ id: string;
+
+ @Column({ nullable: true })
+ afk_timeout: number = 3600;
+
+ @Column({ nullable: true })
+ allow_accessibility_detection: boolean = true;
+
+ @Column({ nullable: true })
+ animate_emoji: boolean = true;
+
+ @Column({ nullable: true })
+ animate_stickers: number = 0;
+
+ @Column({ nullable: true })
+ contact_sync_enabled: boolean = false;
+
+ @Column({ nullable: true })
+ convert_emoticons: boolean = false;
+
+ @Column({ nullable: true, type: "simple-json" })
+ custom_status: CustomStatus | null = null;
+
+ @Column({ nullable: true })
+ default_guilds_restricted: boolean = false;
+
+ @Column({ nullable: true })
+ detect_platform_accounts: boolean = false;
+
+ @Column({ nullable: true })
+ developer_mode: boolean = true;
+
+ @Column({ nullable: true })
+ disable_games_tab: boolean = true;
+
+ @Column({ nullable: true })
+ enable_tts_command: boolean = false;
+
+ @Column({ nullable: true })
+ explicit_content_filter: number = 0;
+
+ @Column({ nullable: true, type: "simple-json" })
+ friend_source_flags: FriendSourceFlags = { all: true };
+
+ @Column({ nullable: true })
+ gateway_connected: boolean = false;
+
+ @Column({ nullable: true })
+ gif_auto_play: boolean = false;
+
+ @Column({ nullable: true, type: "simple-json" })
+ guild_folders: GuildFolder[] = []; // every top guild is displayed as a "folder"
+
+ @Column({ nullable: true, type: "simple-json" })
+ guild_positions: string[] = []; // guild ids ordered by position
+
+ @Column({ nullable: true })
+ inline_attachment_media: boolean = true;
+
+ @Column({ nullable: true })
+ inline_embed_media: boolean = true;
+
+ @Column({ nullable: true })
+ locale: string = "en-US"; // en_US
+
+ @Column({ nullable: true })
+ message_display_compact: boolean = false;
+
+ @Column({ nullable: true })
+ native_phone_integration_enabled: boolean = true;
+
+ @Column({ nullable: true })
+ render_embeds: boolean = true;
+
+ @Column({ nullable: true })
+ render_reactions: boolean = true;
+
+ @Column({ nullable: true, type: "simple-json" })
+ restricted_guilds: string[] = [];
+
+ @Column({ nullable: true })
+ show_current_game: boolean = true;
+
+ @Column({ nullable: true })
+ status: "online" | "offline" | "dnd" | "idle" | "invisible" = "online";
+
+ @Column({ nullable: true })
+ stream_notifications_enabled: boolean = false;
+
+ @Column({ nullable: true })
+ theme: "dark" | "white" = "dark"; // dark
+
+ @Column({ nullable: true })
+ timezone_offset: number = 0; // e.g -60
+}
+
+interface CustomStatus {
+ emoji_id?: string;
+ emoji_name?: string;
+ expires_at?: number;
+ text?: string;
+}
+
+interface GuildFolder {
+ color: number;
+ guild_ids: string[];
+ id: number;
+ name: string;
+}
+
+interface FriendSourceFlags {
+ all: boolean
+}
\ No newline at end of file
diff --git a/util/src/entities/VoiceState.ts b/src/util/entities/VoiceState.ts
index 75748a01..75748a01 100644
--- a/util/src/entities/VoiceState.ts
+++ b/src/util/entities/VoiceState.ts
diff --git a/util/src/entities/Webhook.ts b/src/util/entities/Webhook.ts
index 89538417..89538417 100644
--- a/util/src/entities/Webhook.ts
+++ b/src/util/entities/Webhook.ts
diff --git a/util/src/entities/index.ts b/src/util/entities/index.ts
index c439a4b7..c6f12022 100644
--- a/util/src/entities/index.ts
+++ b/src/util/entities/index.ts
@@ -30,3 +30,4 @@ export * from "./Webhook";
export * from "./ClientRelease";
export * from "./BackupCodes";
export * from "./Note";
+export * from "./UserSettings";
diff --git a/util/src/index.ts b/src/util/index.ts
index 259d1c97..d944dc49 100644
--- a/util/src/index.ts
+++ b/src/util/index.ts
@@ -1,7 +1,9 @@
import "reflect-metadata";
export * from "./util/index";
+export * from "./config/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/interfaces/Activity.ts b/src/util/interfaces/Activity.ts
index 43984afd..43984afd 100644
--- a/util/src/interfaces/Activity.ts
+++ b/src/util/interfaces/Activity.ts
diff --git a/util/src/interfaces/Event.ts b/src/util/interfaces/Event.ts
index f3391c4f..be66c62f 100644
--- a/util/src/interfaces/Event.ts
+++ b/src/util/interfaces/Event.ts
@@ -1,4 +1,4 @@
-import { PublicUser, User, UserSettings } from "../entities/User";
+import { PublicUser, User } from "../entities/User";
import { Channel } from "../entities/Channel";
import { Guild } from "../entities/Guild";
import { Member, PublicMember, UserGuildSettings } from "../entities/Member";
@@ -12,7 +12,7 @@ import { Interaction } from "./Interaction";
import { ConnectedAccount } from "../entities/ConnectedAccount";
import { Relationship, RelationshipType } from "../entities/Relationship";
import { Presence } from "./Presence";
-import { Sticker } from "..";
+import { Sticker, UserSettings } from "..";
import { Activity, Status } from ".";
export interface Event {
diff --git a/util/src/interfaces/Interaction.ts b/src/util/interfaces/Interaction.ts
index 5d3aae24..5d3aae24 100644
--- a/util/src/interfaces/Interaction.ts
+++ b/src/util/interfaces/Interaction.ts
diff --git a/util/src/interfaces/Presence.ts b/src/util/interfaces/Presence.ts
index 7663891a..7663891a 100644
--- a/util/src/interfaces/Presence.ts
+++ b/src/util/interfaces/Presence.ts
diff --git a/util/src/interfaces/Status.ts b/src/util/interfaces/Status.ts
index 5d2e1bba..5d2e1bba 100644
--- a/util/src/interfaces/Status.ts
+++ b/src/util/interfaces/Status.ts
diff --git a/util/src/interfaces/index.ts b/src/util/interfaces/index.ts
index ab7fa429..ab7fa429 100644
--- a/util/src/interfaces/index.ts
+++ b/src/util/interfaces/index.ts
diff --git a/util/src/migrations/mariadb/1659901151025-initial.ts b/src/util/migrations/mariadb/1659901151025-initial.ts
index d15e0add..d15e0add 100644
--- a/util/src/migrations/mariadb/1659901151025-initial.ts
+++ b/src/util/migrations/mariadb/1659901151025-initial.ts
diff --git a/util/src/migrations/mariadb/1659921859145-premium_since_as_date.ts b/src/util/migrations/mariadb/1659921859145-premium_since_as_date.ts
index de173cfe..de173cfe 100644
--- a/util/src/migrations/mariadb/1659921859145-premium_since_as_date.ts
+++ b/src/util/migrations/mariadb/1659921859145-premium_since_as_date.ts
diff --git a/util/src/migrations/mariadb/1660130586602-updated-applications.ts b/src/util/migrations/mariadb/1660130586602-updated-applications.ts
index ec574416..ec574416 100644
--- a/util/src/migrations/mariadb/1660130586602-updated-applications.ts
+++ b/src/util/migrations/mariadb/1660130586602-updated-applications.ts
diff --git a/util/src/migrations/mariadb/1660131942703-apps_nullable_team.ts b/src/util/migrations/mariadb/1660131942703-apps_nullable_team.ts
index ac445772..ac445772 100644
--- a/util/src/migrations/mariadb/1660131942703-apps_nullable_team.ts
+++ b/src/util/migrations/mariadb/1660131942703-apps_nullable_team.ts
diff --git a/src/util/migrations/mariadb/1660540527213-sync_migrations.ts b/src/util/migrations/mariadb/1660540527213-sync_migrations.ts
new file mode 100644
index 00000000..8cc1d2f1
--- /dev/null
+++ b/src/util/migrations/mariadb/1660540527213-sync_migrations.ts
@@ -0,0 +1,127 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class syncMigrations1660540527213 implements MigrationInterface {
+ name = 'syncMigrations1660540527213'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE \`invites\` DROP FOREIGN KEY \`FK_15c35422032e0b22b4ada95f48f\`
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`users\` CHANGE \`settings\` \`settingsId\` text NOT NULL
+ `);
+ await queryRunner.query(`
+ CREATE TABLE \`user_settings\` (
+ \`id\` varchar(255) NOT NULL,
+ \`afk_timeout\` int NULL,
+ \`allow_accessibility_detection\` tinyint NULL,
+ \`animate_emoji\` tinyint NULL,
+ \`animate_stickers\` int NULL,
+ \`contact_sync_enabled\` tinyint NULL,
+ \`convert_emoticons\` tinyint NULL,
+ \`custom_status\` text NULL,
+ \`default_guilds_restricted\` tinyint NULL,
+ \`detect_platform_accounts\` tinyint NULL,
+ \`developer_mode\` tinyint NULL,
+ \`disable_games_tab\` tinyint NULL,
+ \`enable_tts_command\` tinyint NULL,
+ \`explicit_content_filter\` int NULL,
+ \`friend_source_flags\` text NULL,
+ \`gateway_connected\` tinyint NULL,
+ \`gif_auto_play\` tinyint NULL,
+ \`guild_folders\` text NULL,
+ \`guild_positions\` text NULL,
+ \`inline_attachment_media\` tinyint NULL,
+ \`inline_embed_media\` tinyint NULL,
+ \`locale\` varchar(255) NULL,
+ \`message_display_compact\` tinyint NULL,
+ \`native_phone_integration_enabled\` tinyint NULL,
+ \`render_embeds\` tinyint NULL,
+ \`render_reactions\` tinyint NULL,
+ \`restricted_guilds\` text NULL,
+ \`show_current_game\` tinyint NULL,
+ \`status\` varchar(255) NULL,
+ \`stream_notifications_enabled\` tinyint NULL,
+ \`theme\` varchar(255) NULL,
+ \`timezone_offset\` int NULL,
+ PRIMARY KEY (\`id\`)
+ ) ENGINE = InnoDB
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`channels\`
+ ADD \`flags\` int NULL
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`channels\`
+ ADD \`default_thread_rate_limit_per_user\` int NULL
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`guilds\`
+ ADD \`premium_progress_bar_enabled\` tinyint NULL
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`users\` DROP COLUMN \`settingsId\`
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`users\`
+ ADD \`settingsId\` varchar(255) NULL
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`users\`
+ ADD UNIQUE INDEX \`IDX_76ba283779c8441fd5ff819c8c\` (\`settingsId\`)
+ `);
+ await queryRunner.query(`
+ CREATE UNIQUE INDEX \`REL_76ba283779c8441fd5ff819c8c\` ON \`users\` (\`settingsId\`)
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`users\`
+ ADD CONSTRAINT \`FK_76ba283779c8441fd5ff819c8cf\` FOREIGN KEY (\`settingsId\`) REFERENCES \`user_settings\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`invites\`
+ ADD CONSTRAINT \`FK_15c35422032e0b22b4ada95f48f\` FOREIGN KEY (\`inviter_id\`) REFERENCES \`users\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE \`invites\` DROP FOREIGN KEY \`FK_15c35422032e0b22b4ada95f48f\`
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`users\` DROP FOREIGN KEY \`FK_76ba283779c8441fd5ff819c8cf\`
+ `);
+ await queryRunner.query(`
+ DROP INDEX \`REL_76ba283779c8441fd5ff819c8c\` ON \`users\`
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`users\` DROP INDEX \`IDX_76ba283779c8441fd5ff819c8c\`
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`users\` DROP COLUMN \`settingsId\`
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`users\`
+ ADD \`settingsId\` text NOT NULL
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`guilds\` DROP COLUMN \`premium_progress_bar_enabled\`
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`channels\` DROP COLUMN \`default_thread_rate_limit_per_user\`
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`channels\` DROP COLUMN \`flags\`
+ `);
+ await queryRunner.query(`
+ DROP TABLE \`user_settings\`
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`users\` CHANGE \`settingsId\` \`settings\` text NOT NULL
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`invites\`
+ ADD CONSTRAINT \`FK_15c35422032e0b22b4ada95f48f\` FOREIGN KEY (\`inviter_id\`) REFERENCES \`users\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION
+ `);
+ }
+
+}
diff --git a/src/util/migrations/mariadb/1660549252130-fix_nullables.ts b/src/util/migrations/mariadb/1660549252130-fix_nullables.ts
new file mode 100644
index 00000000..c9456b54
--- /dev/null
+++ b/src/util/migrations/mariadb/1660549252130-fix_nullables.ts
@@ -0,0 +1,30 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class fixNullables1660549252130 implements MigrationInterface {
+ name = 'fixNullables1660549252130'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ DROP INDEX \`IDX_76ba283779c8441fd5ff819c8c\` ON \`users\`
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`users\` CHANGE \`bio\` \`bio\` varchar(255) NULL
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`users\` CHANGE \`mfa_enabled\` \`mfa_enabled\` tinyint NULL
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE \`users\` CHANGE \`mfa_enabled\` \`mfa_enabled\` tinyint NOT NULL
+ `);
+ await queryRunner.query(`
+ ALTER TABLE \`users\` CHANGE \`bio\` \`bio\` varchar(255) NOT NULL
+ `);
+ await queryRunner.query(`
+ CREATE UNIQUE INDEX \`IDX_76ba283779c8441fd5ff819c8c\` ON \`users\` (\`settingsId\`)
+ `);
+ }
+
+}
diff --git a/util/src/migrations/postgres/1659899687168-initial.ts b/src/util/migrations/postgres/1659899687168-initial.ts
index 4ffb897d..4ffb897d 100644
--- a/util/src/migrations/postgres/1659899687168-initial.ts
+++ b/src/util/migrations/postgres/1659899687168-initial.ts
diff --git a/util/src/migrations/postgres/1659921826567-premium_since_as_date.ts b/src/util/migrations/postgres/1659921826567-premium_since_as_date.ts
index ac1e2edb..ac1e2edb 100644
--- a/util/src/migrations/postgres/1659921826567-premium_since_as_date.ts
+++ b/src/util/migrations/postgres/1659921826567-premium_since_as_date.ts
diff --git a/util/src/migrations/postgres/1660130561959-updated-applications.ts b/src/util/migrations/postgres/1660130561959-updated-applications.ts
index 8fab54c7..8fab54c7 100644
--- a/util/src/migrations/postgres/1660130561959-updated-applications.ts
+++ b/src/util/migrations/postgres/1660130561959-updated-applications.ts
diff --git a/src/util/migrations/postgres/1660257815436-CodeCleanup2.ts b/src/util/migrations/postgres/1660257815436-CodeCleanup2.ts
new file mode 100644
index 00000000..511c2f5a
--- /dev/null
+++ b/src/util/migrations/postgres/1660257815436-CodeCleanup2.ts
@@ -0,0 +1,59 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class CodeCleanup21660257815436 implements MigrationInterface {
+ name = 'CodeCleanup21660257815436'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ CREATE TABLE "user_settings" (
+ "id" character varying NOT NULL,
+ "afk_timeout" integer,
+ "allow_accessibility_detection" boolean,
+ "animate_emoji" boolean,
+ "animate_stickers" integer,
+ "contact_sync_enabled" boolean,
+ "convert_emoticons" boolean,
+ "custom_status" text,
+ "default_guilds_restricted" boolean,
+ "detect_platform_accounts" boolean,
+ "developer_mode" boolean,
+ "disable_games_tab" boolean,
+ "enable_tts_command" boolean,
+ "explicit_content_filter" integer,
+ "friend_source_flags" text,
+ "gateway_connected" boolean,
+ "gif_auto_play" boolean,
+ "guild_folders" text,
+ "guild_positions" text,
+ "inline_attachment_media" boolean,
+ "inline_embed_media" boolean,
+ "locale" character varying,
+ "message_display_compact" boolean,
+ "native_phone_integration_enabled" boolean,
+ "render_embeds" boolean,
+ "render_reactions" boolean,
+ "restricted_guilds" text,
+ "show_current_game" boolean,
+ "status" character varying,
+ "stream_notifications_enabled" boolean,
+ "theme" character varying,
+ "timezone_offset" integer,
+ CONSTRAINT "PK_00f004f5922a0744d174530d639" PRIMARY KEY ("id")
+ )
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "guilds"
+ ADD "premium_progress_bar_enabled" boolean
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "guilds" DROP COLUMN "premium_progress_bar_enabled"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "user_settings"
+ `);
+ }
+
+}
diff --git a/src/util/migrations/postgres/1660258372154-CodeCleanup3.ts b/src/util/migrations/postgres/1660258372154-CodeCleanup3.ts
new file mode 100644
index 00000000..e2823a54
--- /dev/null
+++ b/src/util/migrations/postgres/1660258372154-CodeCleanup3.ts
@@ -0,0 +1,19 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class CodeCleanup31660258372154 implements MigrationInterface {
+ name = 'CodeCleanup31660258372154'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "users" DROP COLUMN "settings"
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "users"
+ ADD "settings" text NOT NULL
+ `);
+ }
+
+}
diff --git a/src/util/migrations/postgres/1660260565996-CodeCleanup4.ts b/src/util/migrations/postgres/1660260565996-CodeCleanup4.ts
new file mode 100644
index 00000000..0aaf7197
--- /dev/null
+++ b/src/util/migrations/postgres/1660260565996-CodeCleanup4.ts
@@ -0,0 +1,33 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class CodeCleanup41660260565996 implements MigrationInterface {
+ name = 'CodeCleanup41660260565996'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "users"
+ ADD "settingsId" character varying
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "users"
+ ADD CONSTRAINT "UQ_76ba283779c8441fd5ff819c8cf" UNIQUE ("settingsId")
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "users"
+ ADD CONSTRAINT "FK_76ba283779c8441fd5ff819c8cf" FOREIGN KEY ("settingsId") REFERENCES "user_settings"("id") ON DELETE NO ACTION ON UPDATE NO ACTION
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "users" DROP CONSTRAINT "FK_76ba283779c8441fd5ff819c8cf"
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "users" DROP CONSTRAINT "UQ_76ba283779c8441fd5ff819c8cf"
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "users" DROP COLUMN "settingsId"
+ `);
+ }
+
+}
diff --git a/src/util/migrations/postgres/1660265907544-CodeCleanup5.ts b/src/util/migrations/postgres/1660265907544-CodeCleanup5.ts
new file mode 100644
index 00000000..157d686a
--- /dev/null
+++ b/src/util/migrations/postgres/1660265907544-CodeCleanup5.ts
@@ -0,0 +1,26 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class CodeCleanup51660265907544 implements MigrationInterface {
+ name = 'CodeCleanup51660265907544'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "channels"
+ ADD "flags" integer
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "channels"
+ ADD "default_thread_rate_limit_per_user" integer
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "channels" DROP COLUMN "default_thread_rate_limit_per_user"
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "channels" DROP COLUMN "flags"
+ `);
+ }
+
+}
diff --git a/util/src/migrations/postgres/1660416055566-InvitersAreDeletable.ts b/src/util/migrations/postgres/1660416055566-InvitersAreDeletable.ts
index e6101318..e6101318 100644
--- a/util/src/migrations/postgres/1660416055566-InvitersAreDeletable.ts
+++ b/src/util/migrations/postgres/1660416055566-InvitersAreDeletable.ts
diff --git a/src/util/migrations/postgres/1660549242936-fix_nullables.ts b/src/util/migrations/postgres/1660549242936-fix_nullables.ts
new file mode 100644
index 00000000..b9a0194d
--- /dev/null
+++ b/src/util/migrations/postgres/1660549242936-fix_nullables.ts
@@ -0,0 +1,30 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class fixNullables1660549242936 implements MigrationInterface {
+ name = 'fixNullables1660549242936'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "users"
+ ALTER COLUMN "bio" DROP NOT NULL
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "users"
+ ALTER COLUMN "mfa_enabled" DROP NOT NULL
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "users"
+ ALTER COLUMN "mfa_enabled"
+ SET NOT NULL
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "users"
+ ALTER COLUMN "bio"
+ SET NOT NULL
+ `);
+ }
+
+}
diff --git a/util/src/migrations/sqlite/1659899662635-initial.ts b/src/util/migrations/sqlite/1659899662635-initial.ts
index f82e7b0d..f82e7b0d 100644
--- a/util/src/migrations/sqlite/1659899662635-initial.ts
+++ b/src/util/migrations/sqlite/1659899662635-initial.ts
diff --git a/util/src/migrations/sqlite/1659921722863-premium_since_as_date.ts b/src/util/migrations/sqlite/1659921722863-premium_since_as_date.ts
index 788be625..788be625 100644
--- a/util/src/migrations/sqlite/1659921722863-premium_since_as_date.ts
+++ b/src/util/migrations/sqlite/1659921722863-premium_since_as_date.ts
diff --git a/util/src/migrations/sqlite/1660130536131-updated-applications.ts b/src/util/migrations/sqlite/1660130536131-updated-applications.ts
index b8cbcc33..b8cbcc33 100644
--- a/util/src/migrations/sqlite/1660130536131-updated-applications.ts
+++ b/src/util/migrations/sqlite/1660130536131-updated-applications.ts
diff --git a/src/util/migrations/sqlite/1660257576211-CodeCleanup1.ts b/src/util/migrations/sqlite/1660257576211-CodeCleanup1.ts
new file mode 100644
index 00000000..5a61db0d
--- /dev/null
+++ b/src/util/migrations/sqlite/1660257576211-CodeCleanup1.ts
@@ -0,0 +1,326 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class CodeCleanup11660257576211 implements MigrationInterface {
+ name = 'CodeCleanup11660257576211'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ CREATE TABLE "user_settings" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "afk_timeout" integer,
+ "allow_accessibility_detection" boolean,
+ "animate_emoji" boolean,
+ "animate_stickers" integer,
+ "contact_sync_enabled" boolean,
+ "convert_emoticons" boolean,
+ "custom_status" text,
+ "default_guilds_restricted" boolean,
+ "detect_platform_accounts" boolean,
+ "developer_mode" boolean,
+ "disable_games_tab" boolean,
+ "enable_tts_command" boolean,
+ "explicit_content_filter" integer,
+ "friend_source_flags" text,
+ "gateway_connected" boolean,
+ "gif_auto_play" boolean,
+ "guild_folders" text,
+ "guild_positions" text,
+ "inline_attachment_media" boolean,
+ "inline_embed_media" boolean,
+ "locale" varchar,
+ "message_display_compact" boolean,
+ "native_phone_integration_enabled" boolean,
+ "render_embeds" boolean,
+ "render_reactions" boolean,
+ "restricted_guilds" text,
+ "show_current_game" boolean,
+ "status" varchar,
+ "stream_notifications_enabled" boolean,
+ "theme" varchar,
+ "timezone_offset" integer
+ )
+ `);
+ await queryRunner.query(`
+ CREATE TABLE "temporary_guilds" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "afk_channel_id" varchar,
+ "afk_timeout" integer,
+ "banner" varchar,
+ "default_message_notifications" integer,
+ "description" varchar,
+ "discovery_splash" varchar,
+ "explicit_content_filter" integer,
+ "features" text NOT NULL,
+ "primary_category_id" integer,
+ "icon" varchar,
+ "large" boolean,
+ "max_members" integer,
+ "max_presences" integer,
+ "max_video_channel_users" integer,
+ "member_count" integer,
+ "presence_count" integer,
+ "template_id" varchar,
+ "mfa_level" integer,
+ "name" varchar NOT NULL,
+ "owner_id" varchar,
+ "preferred_locale" varchar,
+ "premium_subscription_count" integer,
+ "premium_tier" integer,
+ "public_updates_channel_id" varchar,
+ "rules_channel_id" varchar,
+ "region" varchar,
+ "splash" varchar,
+ "system_channel_id" varchar,
+ "system_channel_flags" integer,
+ "unavailable" boolean,
+ "verification_level" integer,
+ "welcome_screen" text NOT NULL,
+ "widget_channel_id" varchar,
+ "widget_enabled" boolean,
+ "nsfw_level" integer,
+ "nsfw" boolean,
+ "parent" varchar,
+ "premium_progress_bar_enabled" boolean NOT NULL,
+ CONSTRAINT "FK_9d1d665379eefde7876a17afa99" FOREIGN KEY ("widget_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_cfc3d3ad260f8121c95b31a1fce" FOREIGN KEY ("system_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_95828668aa333460582e0ca6396" FOREIGN KEY ("rules_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_8d450b016dc8bec35f36729e4b0" FOREIGN KEY ("public_updates_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_fc1a451727e3643ca572a3bb394" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_e2a2f873a64a5cf62526de42325" FOREIGN KEY ("template_id") REFERENCES "templates" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_f591a66b8019d87b0fe6c12dad6" FOREIGN KEY ("afk_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "temporary_guilds"(
+ "id",
+ "afk_channel_id",
+ "afk_timeout",
+ "banner",
+ "default_message_notifications",
+ "description",
+ "discovery_splash",
+ "explicit_content_filter",
+ "features",
+ "primary_category_id",
+ "icon",
+ "large",
+ "max_members",
+ "max_presences",
+ "max_video_channel_users",
+ "member_count",
+ "presence_count",
+ "template_id",
+ "mfa_level",
+ "name",
+ "owner_id",
+ "preferred_locale",
+ "premium_subscription_count",
+ "premium_tier",
+ "public_updates_channel_id",
+ "rules_channel_id",
+ "region",
+ "splash",
+ "system_channel_id",
+ "system_channel_flags",
+ "unavailable",
+ "verification_level",
+ "welcome_screen",
+ "widget_channel_id",
+ "widget_enabled",
+ "nsfw_level",
+ "nsfw",
+ "parent"
+ )
+ SELECT "id",
+ "afk_channel_id",
+ "afk_timeout",
+ "banner",
+ "default_message_notifications",
+ "description",
+ "discovery_splash",
+ "explicit_content_filter",
+ "features",
+ "primary_category_id",
+ "icon",
+ "large",
+ "max_members",
+ "max_presences",
+ "max_video_channel_users",
+ "member_count",
+ "presence_count",
+ "template_id",
+ "mfa_level",
+ "name",
+ "owner_id",
+ "preferred_locale",
+ "premium_subscription_count",
+ "premium_tier",
+ "public_updates_channel_id",
+ "rules_channel_id",
+ "region",
+ "splash",
+ "system_channel_id",
+ "system_channel_flags",
+ "unavailable",
+ "verification_level",
+ "welcome_screen",
+ "widget_channel_id",
+ "widget_enabled",
+ "nsfw_level",
+ "nsfw",
+ "parent"
+ FROM "guilds"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "guilds"
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "temporary_guilds"
+ RENAME TO "guilds"
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "guilds"
+ RENAME TO "temporary_guilds"
+ `);
+ await queryRunner.query(`
+ CREATE TABLE "guilds" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "afk_channel_id" varchar,
+ "afk_timeout" integer,
+ "banner" varchar,
+ "default_message_notifications" integer,
+ "description" varchar,
+ "discovery_splash" varchar,
+ "explicit_content_filter" integer,
+ "features" text NOT NULL,
+ "primary_category_id" integer,
+ "icon" varchar,
+ "large" boolean,
+ "max_members" integer,
+ "max_presences" integer,
+ "max_video_channel_users" integer,
+ "member_count" integer,
+ "presence_count" integer,
+ "template_id" varchar,
+ "mfa_level" integer,
+ "name" varchar NOT NULL,
+ "owner_id" varchar,
+ "preferred_locale" varchar,
+ "premium_subscription_count" integer,
+ "premium_tier" integer,
+ "public_updates_channel_id" varchar,
+ "rules_channel_id" varchar,
+ "region" varchar,
+ "splash" varchar,
+ "system_channel_id" varchar,
+ "system_channel_flags" integer,
+ "unavailable" boolean,
+ "verification_level" integer,
+ "welcome_screen" text NOT NULL,
+ "widget_channel_id" varchar,
+ "widget_enabled" boolean,
+ "nsfw_level" integer,
+ "nsfw" boolean,
+ "parent" varchar,
+ CONSTRAINT "FK_9d1d665379eefde7876a17afa99" FOREIGN KEY ("widget_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_cfc3d3ad260f8121c95b31a1fce" FOREIGN KEY ("system_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_95828668aa333460582e0ca6396" FOREIGN KEY ("rules_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_8d450b016dc8bec35f36729e4b0" FOREIGN KEY ("public_updates_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_fc1a451727e3643ca572a3bb394" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_e2a2f873a64a5cf62526de42325" FOREIGN KEY ("template_id") REFERENCES "templates" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_f591a66b8019d87b0fe6c12dad6" FOREIGN KEY ("afk_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "guilds"(
+ "id",
+ "afk_channel_id",
+ "afk_timeout",
+ "banner",
+ "default_message_notifications",
+ "description",
+ "discovery_splash",
+ "explicit_content_filter",
+ "features",
+ "primary_category_id",
+ "icon",
+ "large",
+ "max_members",
+ "max_presences",
+ "max_video_channel_users",
+ "member_count",
+ "presence_count",
+ "template_id",
+ "mfa_level",
+ "name",
+ "owner_id",
+ "preferred_locale",
+ "premium_subscription_count",
+ "premium_tier",
+ "public_updates_channel_id",
+ "rules_channel_id",
+ "region",
+ "splash",
+ "system_channel_id",
+ "system_channel_flags",
+ "unavailable",
+ "verification_level",
+ "welcome_screen",
+ "widget_channel_id",
+ "widget_enabled",
+ "nsfw_level",
+ "nsfw",
+ "parent"
+ )
+ SELECT "id",
+ "afk_channel_id",
+ "afk_timeout",
+ "banner",
+ "default_message_notifications",
+ "description",
+ "discovery_splash",
+ "explicit_content_filter",
+ "features",
+ "primary_category_id",
+ "icon",
+ "large",
+ "max_members",
+ "max_presences",
+ "max_video_channel_users",
+ "member_count",
+ "presence_count",
+ "template_id",
+ "mfa_level",
+ "name",
+ "owner_id",
+ "preferred_locale",
+ "premium_subscription_count",
+ "premium_tier",
+ "public_updates_channel_id",
+ "rules_channel_id",
+ "region",
+ "splash",
+ "system_channel_id",
+ "system_channel_flags",
+ "unavailable",
+ "verification_level",
+ "welcome_screen",
+ "widget_channel_id",
+ "widget_enabled",
+ "nsfw_level",
+ "nsfw",
+ "parent"
+ FROM "temporary_guilds"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "temporary_guilds"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "user_settings"
+ `);
+ }
+
+}
diff --git a/src/util/migrations/sqlite/1660257795259-CodeCleanup2.ts b/src/util/migrations/sqlite/1660257795259-CodeCleanup2.ts
new file mode 100644
index 00000000..53698256
--- /dev/null
+++ b/src/util/migrations/sqlite/1660257795259-CodeCleanup2.ts
@@ -0,0 +1,572 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class CodeCleanup21660257795259 implements MigrationInterface {
+ name = 'CodeCleanup21660257795259'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ CREATE TABLE "temporary_guilds" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "afk_channel_id" varchar,
+ "afk_timeout" integer,
+ "banner" varchar,
+ "default_message_notifications" integer,
+ "description" varchar,
+ "discovery_splash" varchar,
+ "explicit_content_filter" integer,
+ "features" text NOT NULL,
+ "primary_category_id" integer,
+ "icon" varchar,
+ "large" boolean,
+ "max_members" integer,
+ "max_presences" integer,
+ "max_video_channel_users" integer,
+ "member_count" integer,
+ "presence_count" integer,
+ "template_id" varchar,
+ "mfa_level" integer,
+ "name" varchar NOT NULL,
+ "owner_id" varchar,
+ "preferred_locale" varchar,
+ "premium_subscription_count" integer,
+ "premium_tier" integer,
+ "public_updates_channel_id" varchar,
+ "rules_channel_id" varchar,
+ "region" varchar,
+ "splash" varchar,
+ "system_channel_id" varchar,
+ "system_channel_flags" integer,
+ "unavailable" boolean,
+ "verification_level" integer,
+ "welcome_screen" text NOT NULL,
+ "widget_channel_id" varchar,
+ "widget_enabled" boolean,
+ "nsfw_level" integer,
+ "nsfw" boolean,
+ "parent" varchar,
+ "premium_progress_bar_enabled" boolean NOT NULL,
+ CONSTRAINT "FK_f591a66b8019d87b0fe6c12dad6" FOREIGN KEY ("afk_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_e2a2f873a64a5cf62526de42325" FOREIGN KEY ("template_id") REFERENCES "templates" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_fc1a451727e3643ca572a3bb394" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_8d450b016dc8bec35f36729e4b0" FOREIGN KEY ("public_updates_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_95828668aa333460582e0ca6396" FOREIGN KEY ("rules_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_cfc3d3ad260f8121c95b31a1fce" FOREIGN KEY ("system_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_9d1d665379eefde7876a17afa99" FOREIGN KEY ("widget_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "temporary_guilds"(
+ "id",
+ "afk_channel_id",
+ "afk_timeout",
+ "banner",
+ "default_message_notifications",
+ "description",
+ "discovery_splash",
+ "explicit_content_filter",
+ "features",
+ "primary_category_id",
+ "icon",
+ "large",
+ "max_members",
+ "max_presences",
+ "max_video_channel_users",
+ "member_count",
+ "presence_count",
+ "template_id",
+ "mfa_level",
+ "name",
+ "owner_id",
+ "preferred_locale",
+ "premium_subscription_count",
+ "premium_tier",
+ "public_updates_channel_id",
+ "rules_channel_id",
+ "region",
+ "splash",
+ "system_channel_id",
+ "system_channel_flags",
+ "unavailable",
+ "verification_level",
+ "welcome_screen",
+ "widget_channel_id",
+ "widget_enabled",
+ "nsfw_level",
+ "nsfw",
+ "parent",
+ "premium_progress_bar_enabled"
+ )
+ SELECT "id",
+ "afk_channel_id",
+ "afk_timeout",
+ "banner",
+ "default_message_notifications",
+ "description",
+ "discovery_splash",
+ "explicit_content_filter",
+ "features",
+ "primary_category_id",
+ "icon",
+ "large",
+ "max_members",
+ "max_presences",
+ "max_video_channel_users",
+ "member_count",
+ "presence_count",
+ "template_id",
+ "mfa_level",
+ "name",
+ "owner_id",
+ "preferred_locale",
+ "premium_subscription_count",
+ "premium_tier",
+ "public_updates_channel_id",
+ "rules_channel_id",
+ "region",
+ "splash",
+ "system_channel_id",
+ "system_channel_flags",
+ "unavailable",
+ "verification_level",
+ "welcome_screen",
+ "widget_channel_id",
+ "widget_enabled",
+ "nsfw_level",
+ "nsfw",
+ "parent",
+ "premium_progress_bar_enabled"
+ FROM "guilds"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "guilds"
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "temporary_guilds"
+ RENAME TO "guilds"
+ `);
+ await queryRunner.query(`
+ CREATE TABLE "temporary_guilds" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "afk_channel_id" varchar,
+ "afk_timeout" integer,
+ "banner" varchar,
+ "default_message_notifications" integer,
+ "description" varchar,
+ "discovery_splash" varchar,
+ "explicit_content_filter" integer,
+ "features" text NOT NULL,
+ "primary_category_id" integer,
+ "icon" varchar,
+ "large" boolean,
+ "max_members" integer,
+ "max_presences" integer,
+ "max_video_channel_users" integer,
+ "member_count" integer,
+ "presence_count" integer,
+ "template_id" varchar,
+ "mfa_level" integer,
+ "name" varchar NOT NULL,
+ "owner_id" varchar,
+ "preferred_locale" varchar,
+ "premium_subscription_count" integer,
+ "premium_tier" integer,
+ "public_updates_channel_id" varchar,
+ "rules_channel_id" varchar,
+ "region" varchar,
+ "splash" varchar,
+ "system_channel_id" varchar,
+ "system_channel_flags" integer,
+ "unavailable" boolean,
+ "verification_level" integer,
+ "welcome_screen" text NOT NULL,
+ "widget_channel_id" varchar,
+ "widget_enabled" boolean,
+ "nsfw_level" integer,
+ "nsfw" boolean,
+ "parent" varchar,
+ "premium_progress_bar_enabled" boolean,
+ CONSTRAINT "FK_f591a66b8019d87b0fe6c12dad6" FOREIGN KEY ("afk_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_e2a2f873a64a5cf62526de42325" FOREIGN KEY ("template_id") REFERENCES "templates" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_fc1a451727e3643ca572a3bb394" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_8d450b016dc8bec35f36729e4b0" FOREIGN KEY ("public_updates_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_95828668aa333460582e0ca6396" FOREIGN KEY ("rules_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_cfc3d3ad260f8121c95b31a1fce" FOREIGN KEY ("system_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_9d1d665379eefde7876a17afa99" FOREIGN KEY ("widget_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "temporary_guilds"(
+ "id",
+ "afk_channel_id",
+ "afk_timeout",
+ "banner",
+ "default_message_notifications",
+ "description",
+ "discovery_splash",
+ "explicit_content_filter",
+ "features",
+ "primary_category_id",
+ "icon",
+ "large",
+ "max_members",
+ "max_presences",
+ "max_video_channel_users",
+ "member_count",
+ "presence_count",
+ "template_id",
+ "mfa_level",
+ "name",
+ "owner_id",
+ "preferred_locale",
+ "premium_subscription_count",
+ "premium_tier",
+ "public_updates_channel_id",
+ "rules_channel_id",
+ "region",
+ "splash",
+ "system_channel_id",
+ "system_channel_flags",
+ "unavailable",
+ "verification_level",
+ "welcome_screen",
+ "widget_channel_id",
+ "widget_enabled",
+ "nsfw_level",
+ "nsfw",
+ "parent",
+ "premium_progress_bar_enabled"
+ )
+ SELECT "id",
+ "afk_channel_id",
+ "afk_timeout",
+ "banner",
+ "default_message_notifications",
+ "description",
+ "discovery_splash",
+ "explicit_content_filter",
+ "features",
+ "primary_category_id",
+ "icon",
+ "large",
+ "max_members",
+ "max_presences",
+ "max_video_channel_users",
+ "member_count",
+ "presence_count",
+ "template_id",
+ "mfa_level",
+ "name",
+ "owner_id",
+ "preferred_locale",
+ "premium_subscription_count",
+ "premium_tier",
+ "public_updates_channel_id",
+ "rules_channel_id",
+ "region",
+ "splash",
+ "system_channel_id",
+ "system_channel_flags",
+ "unavailable",
+ "verification_level",
+ "welcome_screen",
+ "widget_channel_id",
+ "widget_enabled",
+ "nsfw_level",
+ "nsfw",
+ "parent",
+ "premium_progress_bar_enabled"
+ FROM "guilds"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "guilds"
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "temporary_guilds"
+ RENAME TO "guilds"
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "guilds"
+ RENAME TO "temporary_guilds"
+ `);
+ await queryRunner.query(`
+ CREATE TABLE "guilds" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "afk_channel_id" varchar,
+ "afk_timeout" integer,
+ "banner" varchar,
+ "default_message_notifications" integer,
+ "description" varchar,
+ "discovery_splash" varchar,
+ "explicit_content_filter" integer,
+ "features" text NOT NULL,
+ "primary_category_id" integer,
+ "icon" varchar,
+ "large" boolean,
+ "max_members" integer,
+ "max_presences" integer,
+ "max_video_channel_users" integer,
+ "member_count" integer,
+ "presence_count" integer,
+ "template_id" varchar,
+ "mfa_level" integer,
+ "name" varchar NOT NULL,
+ "owner_id" varchar,
+ "preferred_locale" varchar,
+ "premium_subscription_count" integer,
+ "premium_tier" integer,
+ "public_updates_channel_id" varchar,
+ "rules_channel_id" varchar,
+ "region" varchar,
+ "splash" varchar,
+ "system_channel_id" varchar,
+ "system_channel_flags" integer,
+ "unavailable" boolean,
+ "verification_level" integer,
+ "welcome_screen" text NOT NULL,
+ "widget_channel_id" varchar,
+ "widget_enabled" boolean,
+ "nsfw_level" integer,
+ "nsfw" boolean,
+ "parent" varchar,
+ "premium_progress_bar_enabled" boolean NOT NULL,
+ CONSTRAINT "FK_f591a66b8019d87b0fe6c12dad6" FOREIGN KEY ("afk_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_e2a2f873a64a5cf62526de42325" FOREIGN KEY ("template_id") REFERENCES "templates" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_fc1a451727e3643ca572a3bb394" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_8d450b016dc8bec35f36729e4b0" FOREIGN KEY ("public_updates_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_95828668aa333460582e0ca6396" FOREIGN KEY ("rules_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_cfc3d3ad260f8121c95b31a1fce" FOREIGN KEY ("system_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_9d1d665379eefde7876a17afa99" FOREIGN KEY ("widget_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "guilds"(
+ "id",
+ "afk_channel_id",
+ "afk_timeout",
+ "banner",
+ "default_message_notifications",
+ "description",
+ "discovery_splash",
+ "explicit_content_filter",
+ "features",
+ "primary_category_id",
+ "icon",
+ "large",
+ "max_members",
+ "max_presences",
+ "max_video_channel_users",
+ "member_count",
+ "presence_count",
+ "template_id",
+ "mfa_level",
+ "name",
+ "owner_id",
+ "preferred_locale",
+ "premium_subscription_count",
+ "premium_tier",
+ "public_updates_channel_id",
+ "rules_channel_id",
+ "region",
+ "splash",
+ "system_channel_id",
+ "system_channel_flags",
+ "unavailable",
+ "verification_level",
+ "welcome_screen",
+ "widget_channel_id",
+ "widget_enabled",
+ "nsfw_level",
+ "nsfw",
+ "parent",
+ "premium_progress_bar_enabled"
+ )
+ SELECT "id",
+ "afk_channel_id",
+ "afk_timeout",
+ "banner",
+ "default_message_notifications",
+ "description",
+ "discovery_splash",
+ "explicit_content_filter",
+ "features",
+ "primary_category_id",
+ "icon",
+ "large",
+ "max_members",
+ "max_presences",
+ "max_video_channel_users",
+ "member_count",
+ "presence_count",
+ "template_id",
+ "mfa_level",
+ "name",
+ "owner_id",
+ "preferred_locale",
+ "premium_subscription_count",
+ "premium_tier",
+ "public_updates_channel_id",
+ "rules_channel_id",
+ "region",
+ "splash",
+ "system_channel_id",
+ "system_channel_flags",
+ "unavailable",
+ "verification_level",
+ "welcome_screen",
+ "widget_channel_id",
+ "widget_enabled",
+ "nsfw_level",
+ "nsfw",
+ "parent",
+ "premium_progress_bar_enabled"
+ FROM "temporary_guilds"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "temporary_guilds"
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "guilds"
+ RENAME TO "temporary_guilds"
+ `);
+ await queryRunner.query(`
+ CREATE TABLE "guilds" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "afk_channel_id" varchar,
+ "afk_timeout" integer,
+ "banner" varchar,
+ "default_message_notifications" integer,
+ "description" varchar,
+ "discovery_splash" varchar,
+ "explicit_content_filter" integer,
+ "features" text NOT NULL,
+ "primary_category_id" integer,
+ "icon" varchar,
+ "large" boolean,
+ "max_members" integer,
+ "max_presences" integer,
+ "max_video_channel_users" integer,
+ "member_count" integer,
+ "presence_count" integer,
+ "template_id" varchar,
+ "mfa_level" integer,
+ "name" varchar NOT NULL,
+ "owner_id" varchar,
+ "preferred_locale" varchar,
+ "premium_subscription_count" integer,
+ "premium_tier" integer,
+ "public_updates_channel_id" varchar,
+ "rules_channel_id" varchar,
+ "region" varchar,
+ "splash" varchar,
+ "system_channel_id" varchar,
+ "system_channel_flags" integer,
+ "unavailable" boolean,
+ "verification_level" integer,
+ "welcome_screen" text NOT NULL,
+ "widget_channel_id" varchar,
+ "widget_enabled" boolean,
+ "nsfw_level" integer,
+ "nsfw" boolean,
+ "parent" varchar,
+ "premium_progress_bar_enabled" boolean NOT NULL,
+ CONSTRAINT "FK_f591a66b8019d87b0fe6c12dad6" FOREIGN KEY ("afk_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_e2a2f873a64a5cf62526de42325" FOREIGN KEY ("template_id") REFERENCES "templates" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_fc1a451727e3643ca572a3bb394" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_8d450b016dc8bec35f36729e4b0" FOREIGN KEY ("public_updates_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_95828668aa333460582e0ca6396" FOREIGN KEY ("rules_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_cfc3d3ad260f8121c95b31a1fce" FOREIGN KEY ("system_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_9d1d665379eefde7876a17afa99" FOREIGN KEY ("widget_channel_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "guilds"(
+ "id",
+ "afk_channel_id",
+ "afk_timeout",
+ "banner",
+ "default_message_notifications",
+ "description",
+ "discovery_splash",
+ "explicit_content_filter",
+ "features",
+ "primary_category_id",
+ "icon",
+ "large",
+ "max_members",
+ "max_presences",
+ "max_video_channel_users",
+ "member_count",
+ "presence_count",
+ "template_id",
+ "mfa_level",
+ "name",
+ "owner_id",
+ "preferred_locale",
+ "premium_subscription_count",
+ "premium_tier",
+ "public_updates_channel_id",
+ "rules_channel_id",
+ "region",
+ "splash",
+ "system_channel_id",
+ "system_channel_flags",
+ "unavailable",
+ "verification_level",
+ "welcome_screen",
+ "widget_channel_id",
+ "widget_enabled",
+ "nsfw_level",
+ "nsfw",
+ "parent",
+ "premium_progress_bar_enabled"
+ )
+ SELECT "id",
+ "afk_channel_id",
+ "afk_timeout",
+ "banner",
+ "default_message_notifications",
+ "description",
+ "discovery_splash",
+ "explicit_content_filter",
+ "features",
+ "primary_category_id",
+ "icon",
+ "large",
+ "max_members",
+ "max_presences",
+ "max_video_channel_users",
+ "member_count",
+ "presence_count",
+ "template_id",
+ "mfa_level",
+ "name",
+ "owner_id",
+ "preferred_locale",
+ "premium_subscription_count",
+ "premium_tier",
+ "public_updates_channel_id",
+ "rules_channel_id",
+ "region",
+ "splash",
+ "system_channel_id",
+ "system_channel_flags",
+ "unavailable",
+ "verification_level",
+ "welcome_screen",
+ "widget_channel_id",
+ "widget_enabled",
+ "nsfw_level",
+ "nsfw",
+ "parent",
+ "premium_progress_bar_enabled"
+ FROM "temporary_guilds"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "temporary_guilds"
+ `);
+ }
+
+}
diff --git a/src/util/migrations/sqlite/1660258351379-CodeCleanup3.ts b/src/util/migrations/sqlite/1660258351379-CodeCleanup3.ts
new file mode 100644
index 00000000..13fba6dd
--- /dev/null
+++ b/src/util/migrations/sqlite/1660258351379-CodeCleanup3.ts
@@ -0,0 +1,231 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class CodeCleanup31660258351379 implements MigrationInterface {
+ name = 'CodeCleanup31660258351379'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ CREATE TABLE "temporary_users" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "username" varchar NOT NULL,
+ "discriminator" varchar NOT NULL,
+ "avatar" varchar,
+ "accent_color" integer,
+ "banner" varchar,
+ "phone" varchar,
+ "desktop" boolean NOT NULL,
+ "mobile" boolean NOT NULL,
+ "premium" boolean NOT NULL,
+ "premium_type" integer NOT NULL,
+ "bot" boolean NOT NULL,
+ "bio" varchar NOT NULL,
+ "system" boolean NOT NULL,
+ "nsfw_allowed" boolean NOT NULL,
+ "mfa_enabled" boolean NOT NULL,
+ "totp_secret" varchar,
+ "totp_last_ticket" varchar,
+ "created_at" datetime NOT NULL,
+ "premium_since" datetime,
+ "verified" boolean NOT NULL,
+ "disabled" boolean NOT NULL,
+ "deleted" boolean NOT NULL,
+ "email" varchar,
+ "flags" varchar NOT NULL,
+ "public_flags" integer NOT NULL,
+ "rights" bigint NOT NULL,
+ "data" text NOT NULL,
+ "fingerprints" text NOT NULL,
+ "extended_settings" text NOT NULL,
+ "notes" text NOT NULL
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "temporary_users"(
+ "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes"
+ )
+ SELECT "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes"
+ FROM "users"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "users"
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "temporary_users"
+ RENAME TO "users"
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "users"
+ RENAME TO "temporary_users"
+ `);
+ await queryRunner.query(`
+ CREATE TABLE "users" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "username" varchar NOT NULL,
+ "discriminator" varchar NOT NULL,
+ "avatar" varchar,
+ "accent_color" integer,
+ "banner" varchar,
+ "phone" varchar,
+ "desktop" boolean NOT NULL,
+ "mobile" boolean NOT NULL,
+ "premium" boolean NOT NULL,
+ "premium_type" integer NOT NULL,
+ "bot" boolean NOT NULL,
+ "bio" varchar NOT NULL,
+ "system" boolean NOT NULL,
+ "nsfw_allowed" boolean NOT NULL,
+ "mfa_enabled" boolean NOT NULL,
+ "totp_secret" varchar,
+ "totp_last_ticket" varchar,
+ "created_at" datetime NOT NULL,
+ "premium_since" datetime,
+ "verified" boolean NOT NULL,
+ "disabled" boolean NOT NULL,
+ "deleted" boolean NOT NULL,
+ "email" varchar,
+ "flags" varchar NOT NULL,
+ "public_flags" integer NOT NULL,
+ "rights" bigint NOT NULL,
+ "data" text NOT NULL,
+ "fingerprints" text NOT NULL,
+ "settings" text NOT NULL,
+ "extended_settings" text NOT NULL,
+ "notes" text NOT NULL
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "users"(
+ "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes"
+ )
+ SELECT "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes"
+ FROM "temporary_users"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "temporary_users"
+ `);
+ }
+
+}
diff --git a/src/util/migrations/sqlite/1660260672914-CodeCleanup4.ts b/src/util/migrations/sqlite/1660260672914-CodeCleanup4.ts
new file mode 100644
index 00000000..33f4df03
--- /dev/null
+++ b/src/util/migrations/sqlite/1660260672914-CodeCleanup4.ts
@@ -0,0 +1,459 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class CodeCleanup41660260672914 implements MigrationInterface {
+ name = 'CodeCleanup41660260672914'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ CREATE TABLE "temporary_users" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "username" varchar NOT NULL,
+ "discriminator" varchar NOT NULL,
+ "avatar" varchar,
+ "accent_color" integer,
+ "banner" varchar,
+ "phone" varchar,
+ "desktop" boolean NOT NULL,
+ "mobile" boolean NOT NULL,
+ "premium" boolean NOT NULL,
+ "premium_type" integer NOT NULL,
+ "bot" boolean NOT NULL,
+ "bio" varchar NOT NULL,
+ "system" boolean NOT NULL,
+ "nsfw_allowed" boolean NOT NULL,
+ "mfa_enabled" boolean NOT NULL,
+ "totp_secret" varchar,
+ "totp_last_ticket" varchar,
+ "created_at" datetime NOT NULL,
+ "premium_since" datetime,
+ "verified" boolean NOT NULL,
+ "disabled" boolean NOT NULL,
+ "deleted" boolean NOT NULL,
+ "email" varchar,
+ "flags" varchar NOT NULL,
+ "public_flags" integer NOT NULL,
+ "rights" bigint NOT NULL,
+ "data" text NOT NULL,
+ "fingerprints" text NOT NULL,
+ "extended_settings" text NOT NULL,
+ "notes" text NOT NULL,
+ "settingsId" varchar,
+ CONSTRAINT "UQ_b1dd13b6ed980004a795ca184a6" UNIQUE ("settingsId")
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "temporary_users"(
+ "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes"
+ )
+ SELECT "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes"
+ FROM "users"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "users"
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "temporary_users"
+ RENAME TO "users"
+ `);
+ await queryRunner.query(`
+ CREATE TABLE "temporary_users" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "username" varchar NOT NULL,
+ "discriminator" varchar NOT NULL,
+ "avatar" varchar,
+ "accent_color" integer,
+ "banner" varchar,
+ "phone" varchar,
+ "desktop" boolean NOT NULL,
+ "mobile" boolean NOT NULL,
+ "premium" boolean NOT NULL,
+ "premium_type" integer NOT NULL,
+ "bot" boolean NOT NULL,
+ "bio" varchar NOT NULL,
+ "system" boolean NOT NULL,
+ "nsfw_allowed" boolean NOT NULL,
+ "mfa_enabled" boolean NOT NULL,
+ "totp_secret" varchar,
+ "totp_last_ticket" varchar,
+ "created_at" datetime NOT NULL,
+ "premium_since" datetime,
+ "verified" boolean NOT NULL,
+ "disabled" boolean NOT NULL,
+ "deleted" boolean NOT NULL,
+ "email" varchar,
+ "flags" varchar NOT NULL,
+ "public_flags" integer NOT NULL,
+ "rights" bigint NOT NULL,
+ "data" text NOT NULL,
+ "fingerprints" text NOT NULL,
+ "extended_settings" text NOT NULL,
+ "notes" text NOT NULL,
+ "settingsId" varchar,
+ CONSTRAINT "UQ_b1dd13b6ed980004a795ca184a6" UNIQUE ("settingsId"),
+ CONSTRAINT "FK_76ba283779c8441fd5ff819c8cf" FOREIGN KEY ("settingsId") REFERENCES "user_settings" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "temporary_users"(
+ "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes",
+ "settingsId"
+ )
+ SELECT "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes",
+ "settingsId"
+ FROM "users"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "users"
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "temporary_users"
+ RENAME TO "users"
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "users"
+ RENAME TO "temporary_users"
+ `);
+ await queryRunner.query(`
+ CREATE TABLE "users" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "username" varchar NOT NULL,
+ "discriminator" varchar NOT NULL,
+ "avatar" varchar,
+ "accent_color" integer,
+ "banner" varchar,
+ "phone" varchar,
+ "desktop" boolean NOT NULL,
+ "mobile" boolean NOT NULL,
+ "premium" boolean NOT NULL,
+ "premium_type" integer NOT NULL,
+ "bot" boolean NOT NULL,
+ "bio" varchar NOT NULL,
+ "system" boolean NOT NULL,
+ "nsfw_allowed" boolean NOT NULL,
+ "mfa_enabled" boolean NOT NULL,
+ "totp_secret" varchar,
+ "totp_last_ticket" varchar,
+ "created_at" datetime NOT NULL,
+ "premium_since" datetime,
+ "verified" boolean NOT NULL,
+ "disabled" boolean NOT NULL,
+ "deleted" boolean NOT NULL,
+ "email" varchar,
+ "flags" varchar NOT NULL,
+ "public_flags" integer NOT NULL,
+ "rights" bigint NOT NULL,
+ "data" text NOT NULL,
+ "fingerprints" text NOT NULL,
+ "extended_settings" text NOT NULL,
+ "notes" text NOT NULL,
+ "settingsId" varchar,
+ CONSTRAINT "UQ_b1dd13b6ed980004a795ca184a6" UNIQUE ("settingsId")
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "users"(
+ "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes",
+ "settingsId"
+ )
+ SELECT "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes",
+ "settingsId"
+ FROM "temporary_users"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "temporary_users"
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "users"
+ RENAME TO "temporary_users"
+ `);
+ await queryRunner.query(`
+ CREATE TABLE "users" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "username" varchar NOT NULL,
+ "discriminator" varchar NOT NULL,
+ "avatar" varchar,
+ "accent_color" integer,
+ "banner" varchar,
+ "phone" varchar,
+ "desktop" boolean NOT NULL,
+ "mobile" boolean NOT NULL,
+ "premium" boolean NOT NULL,
+ "premium_type" integer NOT NULL,
+ "bot" boolean NOT NULL,
+ "bio" varchar NOT NULL,
+ "system" boolean NOT NULL,
+ "nsfw_allowed" boolean NOT NULL,
+ "mfa_enabled" boolean NOT NULL,
+ "totp_secret" varchar,
+ "totp_last_ticket" varchar,
+ "created_at" datetime NOT NULL,
+ "premium_since" datetime,
+ "verified" boolean NOT NULL,
+ "disabled" boolean NOT NULL,
+ "deleted" boolean NOT NULL,
+ "email" varchar,
+ "flags" varchar NOT NULL,
+ "public_flags" integer NOT NULL,
+ "rights" bigint NOT NULL,
+ "data" text NOT NULL,
+ "fingerprints" text NOT NULL,
+ "extended_settings" text NOT NULL,
+ "notes" text NOT NULL
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "users"(
+ "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes"
+ )
+ SELECT "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes"
+ FROM "temporary_users"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "temporary_users"
+ `);
+ }
+
+}
diff --git a/util/src/migrations/sqlite/1660416010862-InvitersAreDeletable.ts b/src/util/migrations/sqlite/1660416010862-InvitersAreDeletable.ts
index 9b29e119..9b29e119 100644
--- a/util/src/migrations/sqlite/1660416010862-InvitersAreDeletable.ts
+++ b/src/util/migrations/sqlite/1660416010862-InvitersAreDeletable.ts
diff --git a/src/util/migrations/sqlite/1660538628956-sync_migrations.ts b/src/util/migrations/sqlite/1660538628956-sync_migrations.ts
new file mode 100644
index 00000000..9cdc064f
--- /dev/null
+++ b/src/util/migrations/sqlite/1660538628956-sync_migrations.ts
@@ -0,0 +1,172 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class syncMigrations1660538628956 implements MigrationInterface {
+ name = 'syncMigrations1660538628956'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ CREATE TABLE "temporary_channels" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "created_at" datetime NOT NULL,
+ "name" varchar,
+ "icon" text,
+ "type" integer NOT NULL,
+ "last_message_id" varchar,
+ "guild_id" varchar,
+ "parent_id" varchar,
+ "owner_id" varchar,
+ "last_pin_timestamp" integer,
+ "default_auto_archive_duration" integer,
+ "position" integer,
+ "permission_overwrites" text,
+ "video_quality_mode" integer,
+ "bitrate" integer,
+ "user_limit" integer,
+ "nsfw" boolean,
+ "rate_limit_per_user" integer,
+ "topic" varchar,
+ "retention_policy_id" varchar,
+ "flags" integer,
+ "default_thread_rate_limit_per_user" integer,
+ CONSTRAINT "FK_3873ed438575cce703ecff4fc7b" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_3274522d14af40540b1a883fc80" FOREIGN KEY ("parent_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_c253dafe5f3a03ec00cd8fb4581" FOREIGN KEY ("guild_id") REFERENCES "guilds" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "temporary_channels"(
+ "id",
+ "created_at",
+ "name",
+ "icon",
+ "type",
+ "last_message_id",
+ "guild_id",
+ "parent_id",
+ "owner_id",
+ "last_pin_timestamp",
+ "default_auto_archive_duration",
+ "position",
+ "permission_overwrites",
+ "video_quality_mode",
+ "bitrate",
+ "user_limit",
+ "nsfw",
+ "rate_limit_per_user",
+ "topic",
+ "retention_policy_id"
+ )
+ SELECT "id",
+ "created_at",
+ "name",
+ "icon",
+ "type",
+ "last_message_id",
+ "guild_id",
+ "parent_id",
+ "owner_id",
+ "last_pin_timestamp",
+ "default_auto_archive_duration",
+ "position",
+ "permission_overwrites",
+ "video_quality_mode",
+ "bitrate",
+ "user_limit",
+ "nsfw",
+ "rate_limit_per_user",
+ "topic",
+ "retention_policy_id"
+ FROM "channels"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "channels"
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "temporary_channels"
+ RENAME TO "channels"
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "channels"
+ RENAME TO "temporary_channels"
+ `);
+ await queryRunner.query(`
+ CREATE TABLE "channels" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "created_at" datetime NOT NULL,
+ "name" varchar,
+ "icon" text,
+ "type" integer NOT NULL,
+ "last_message_id" varchar,
+ "guild_id" varchar,
+ "parent_id" varchar,
+ "owner_id" varchar,
+ "last_pin_timestamp" integer,
+ "default_auto_archive_duration" integer,
+ "position" integer,
+ "permission_overwrites" text,
+ "video_quality_mode" integer,
+ "bitrate" integer,
+ "user_limit" integer,
+ "nsfw" boolean,
+ "rate_limit_per_user" integer,
+ "topic" varchar,
+ "retention_policy_id" varchar,
+ CONSTRAINT "FK_3873ed438575cce703ecff4fc7b" FOREIGN KEY ("owner_id") REFERENCES "users" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_3274522d14af40540b1a883fc80" FOREIGN KEY ("parent_id") REFERENCES "channels" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
+ CONSTRAINT "FK_c253dafe5f3a03ec00cd8fb4581" FOREIGN KEY ("guild_id") REFERENCES "guilds" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "channels"(
+ "id",
+ "created_at",
+ "name",
+ "icon",
+ "type",
+ "last_message_id",
+ "guild_id",
+ "parent_id",
+ "owner_id",
+ "last_pin_timestamp",
+ "default_auto_archive_duration",
+ "position",
+ "permission_overwrites",
+ "video_quality_mode",
+ "bitrate",
+ "user_limit",
+ "nsfw",
+ "rate_limit_per_user",
+ "topic",
+ "retention_policy_id"
+ )
+ SELECT "id",
+ "created_at",
+ "name",
+ "icon",
+ "type",
+ "last_message_id",
+ "guild_id",
+ "parent_id",
+ "owner_id",
+ "last_pin_timestamp",
+ "default_auto_archive_duration",
+ "position",
+ "permission_overwrites",
+ "video_quality_mode",
+ "bitrate",
+ "user_limit",
+ "nsfw",
+ "rate_limit_per_user",
+ "topic",
+ "retention_policy_id"
+ FROM "temporary_channels"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "temporary_channels"
+ `);
+ }
+
+}
diff --git a/src/util/migrations/sqlite/1660549233583-fix_nullables.ts b/src/util/migrations/sqlite/1660549233583-fix_nullables.ts
new file mode 100644
index 00000000..68f650c7
--- /dev/null
+++ b/src/util/migrations/sqlite/1660549233583-fix_nullables.ts
@@ -0,0 +1,240 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class fixNullables1660549233583 implements MigrationInterface {
+ name = 'fixNullables1660549233583'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ CREATE TABLE "temporary_users" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "username" varchar NOT NULL,
+ "discriminator" varchar NOT NULL,
+ "avatar" varchar,
+ "accent_color" integer,
+ "banner" varchar,
+ "phone" varchar,
+ "desktop" boolean NOT NULL,
+ "mobile" boolean NOT NULL,
+ "premium" boolean NOT NULL,
+ "premium_type" integer NOT NULL,
+ "bot" boolean NOT NULL,
+ "bio" varchar,
+ "system" boolean NOT NULL,
+ "nsfw_allowed" boolean NOT NULL,
+ "mfa_enabled" boolean,
+ "totp_secret" varchar,
+ "totp_last_ticket" varchar,
+ "created_at" datetime NOT NULL,
+ "premium_since" datetime,
+ "verified" boolean NOT NULL,
+ "disabled" boolean NOT NULL,
+ "deleted" boolean NOT NULL,
+ "email" varchar,
+ "flags" varchar NOT NULL,
+ "public_flags" integer NOT NULL,
+ "rights" bigint NOT NULL,
+ "data" text NOT NULL,
+ "fingerprints" text NOT NULL,
+ "extended_settings" text NOT NULL,
+ "notes" text NOT NULL,
+ "settingsId" varchar,
+ CONSTRAINT "UQ_b1dd13b6ed980004a795ca184a6" UNIQUE ("settingsId"),
+ CONSTRAINT "FK_76ba283779c8441fd5ff819c8cf" FOREIGN KEY ("settingsId") REFERENCES "user_settings" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "temporary_users"(
+ "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes",
+ "settingsId"
+ )
+ SELECT "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes",
+ "settingsId"
+ FROM "users"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "users"
+ `);
+ await queryRunner.query(`
+ ALTER TABLE "temporary_users"
+ RENAME TO "users"
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`
+ ALTER TABLE "users"
+ RENAME TO "temporary_users"
+ `);
+ await queryRunner.query(`
+ CREATE TABLE "users" (
+ "id" varchar PRIMARY KEY NOT NULL,
+ "username" varchar NOT NULL,
+ "discriminator" varchar NOT NULL,
+ "avatar" varchar,
+ "accent_color" integer,
+ "banner" varchar,
+ "phone" varchar,
+ "desktop" boolean NOT NULL,
+ "mobile" boolean NOT NULL,
+ "premium" boolean NOT NULL,
+ "premium_type" integer NOT NULL,
+ "bot" boolean NOT NULL,
+ "bio" varchar NOT NULL,
+ "system" boolean NOT NULL,
+ "nsfw_allowed" boolean NOT NULL,
+ "mfa_enabled" boolean NOT NULL,
+ "totp_secret" varchar,
+ "totp_last_ticket" varchar,
+ "created_at" datetime NOT NULL,
+ "premium_since" datetime,
+ "verified" boolean NOT NULL,
+ "disabled" boolean NOT NULL,
+ "deleted" boolean NOT NULL,
+ "email" varchar,
+ "flags" varchar NOT NULL,
+ "public_flags" integer NOT NULL,
+ "rights" bigint NOT NULL,
+ "data" text NOT NULL,
+ "fingerprints" text NOT NULL,
+ "extended_settings" text NOT NULL,
+ "notes" text NOT NULL,
+ "settingsId" varchar,
+ CONSTRAINT "UQ_b1dd13b6ed980004a795ca184a6" UNIQUE ("settingsId"),
+ CONSTRAINT "FK_76ba283779c8441fd5ff819c8cf" FOREIGN KEY ("settingsId") REFERENCES "user_settings" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION
+ )
+ `);
+ await queryRunner.query(`
+ INSERT INTO "users"(
+ "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes",
+ "settingsId"
+ )
+ SELECT "id",
+ "username",
+ "discriminator",
+ "avatar",
+ "accent_color",
+ "banner",
+ "phone",
+ "desktop",
+ "mobile",
+ "premium",
+ "premium_type",
+ "bot",
+ "bio",
+ "system",
+ "nsfw_allowed",
+ "mfa_enabled",
+ "totp_secret",
+ "totp_last_ticket",
+ "created_at",
+ "premium_since",
+ "verified",
+ "disabled",
+ "deleted",
+ "email",
+ "flags",
+ "public_flags",
+ "rights",
+ "data",
+ "fingerprints",
+ "extended_settings",
+ "notes",
+ "settingsId"
+ FROM "temporary_users"
+ `);
+ await queryRunner.query(`
+ DROP TABLE "temporary_users"
+ `);
+ }
+
+}
diff --git a/gateway/src/schema/Activity.ts b/src/util/schemas/ActivitySchema.ts
index e18f66c8..e18f66c8 100644
--- a/gateway/src/schema/Activity.ts
+++ b/src/util/schemas/ActivitySchema.ts
diff --git a/src/util/schemas/BanCreateSchema.ts b/src/util/schemas/BanCreateSchema.ts
new file mode 100644
index 00000000..64b02943
--- /dev/null
+++ b/src/util/schemas/BanCreateSchema.ts
@@ -0,0 +1,5 @@
+
+export interface BanCreateSchema {
+ delete_message_days?: string;
+ reason?: string;
+}
diff --git a/src/util/schemas/BanModeratorSchema.ts b/src/util/schemas/BanModeratorSchema.ts
new file mode 100644
index 00000000..b497d319
--- /dev/null
+++ b/src/util/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/src/util/schemas/BanRegistrySchema.ts b/src/util/schemas/BanRegistrySchema.ts
new file mode 100644
index 00000000..661f934f
--- /dev/null
+++ b/src/util/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/src/util/schemas/BulkDeleteSchema.ts b/src/util/schemas/BulkDeleteSchema.ts
new file mode 100644
index 00000000..26f88374
--- /dev/null
+++ b/src/util/schemas/BulkDeleteSchema.ts
@@ -0,0 +1,4 @@
+
+export interface BulkDeleteSchema {
+ messages: string[];
+}
diff --git a/src/util/schemas/ChannelModifySchema.ts b/src/util/schemas/ChannelModifySchema.ts
new file mode 100644
index 00000000..3cfcf7d2
--- /dev/null
+++ b/src/util/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/src/util/schemas/ChannelPermissionOverwriteSchema.ts b/src/util/schemas/ChannelPermissionOverwriteSchema.ts
new file mode 100644
index 00000000..fe9ba860
--- /dev/null
+++ b/src/util/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/src/util/schemas/ChannelReorderSchema.ts b/src/util/schemas/ChannelReorderSchema.ts
new file mode 100644
index 00000000..3715f59e
--- /dev/null
+++ b/src/util/schemas/ChannelReorderSchema.ts
@@ -0,0 +1 @@
+export type ChannelReorderSchema = { id: string; position?: number; lock_permissions?: boolean; parent_id?: string }[];
\ No newline at end of file
diff --git a/src/util/schemas/DmChannelCreateSchema.ts b/src/util/schemas/DmChannelCreateSchema.ts
new file mode 100644
index 00000000..d5afc6d7
--- /dev/null
+++ b/src/util/schemas/DmChannelCreateSchema.ts
@@ -0,0 +1,5 @@
+
+export interface DmChannelCreateSchema {
+ name?: string;
+ recipients: string[];
+}
diff --git a/src/util/schemas/EmojiCreateSchema.ts b/src/util/schemas/EmojiCreateSchema.ts
new file mode 100644
index 00000000..d50c419c
--- /dev/null
+++ b/src/util/schemas/EmojiCreateSchema.ts
@@ -0,0 +1,7 @@
+
+export interface EmojiCreateSchema {
+ name?: string;
+ image: string;
+ require_colons?: boolean | null;
+ roles?: string[];
+}
diff --git a/src/util/schemas/EmojiModifySchema.ts b/src/util/schemas/EmojiModifySchema.ts
new file mode 100644
index 00000000..5529dbd5
--- /dev/null
+++ b/src/util/schemas/EmojiModifySchema.ts
@@ -0,0 +1,5 @@
+
+export interface EmojiModifySchema {
+ name?: string;
+ roles?: string[];
+}
diff --git a/src/util/schemas/GuildCreateSchema.ts b/src/util/schemas/GuildCreateSchema.ts
new file mode 100644
index 00000000..e4855119
--- /dev/null
+++ b/src/util/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/src/util/schemas/GuildTemplateCreateSchema.ts b/src/util/schemas/GuildTemplateCreateSchema.ts
new file mode 100644
index 00000000..1579001e
--- /dev/null
+++ b/src/util/schemas/GuildTemplateCreateSchema.ts
@@ -0,0 +1,5 @@
+
+export interface GuildTemplateCreateSchema {
+ name: string;
+ avatar?: string | null;
+}
diff --git a/src/util/schemas/GuildUpdateSchema.ts b/src/util/schemas/GuildUpdateSchema.ts
new file mode 100644
index 00000000..86527cf1
--- /dev/null
+++ b/src/util/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/src/util/schemas/GuildUpdateWelcomeScreenSchema.ts b/src/util/schemas/GuildUpdateWelcomeScreenSchema.ts
new file mode 100644
index 00000000..b1e36920
--- /dev/null
+++ b/src/util/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/gateway/src/schema/Identify.ts b/src/util/schemas/IdentifySchema.ts
index 21141321..f3d60fb3 100644
--- a/gateway/src/schema/Identify.ts
+++ b/src/util/schemas/IdentifySchema.ts
@@ -1,8 +1,8 @@
-import { ActivitySchema } from "./Activity";
+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
+ $intents: String, // 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
@@ -33,7 +33,7 @@ export const IdentifySchema = {
$presence: ActivitySchema,
$compress: Boolean,
$large_threshold: Number,
- $shard: [BigInt, BigInt],
+ $shard: [Number, Number],
$guild_subscriptions: Boolean,
$capabilities: Number,
$client_state: {
@@ -71,11 +71,11 @@ export interface IdentifySchema {
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
+ intents?: string; // 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];
+ shard?: [number, number];
guild_subscriptions?: boolean;
capabilities?: number;
client_state?: {
diff --git a/src/util/schemas/InviteCreateSchema.ts b/src/util/schemas/InviteCreateSchema.ts
new file mode 100644
index 00000000..7f6af338
--- /dev/null
+++ b/src/util/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/gateway/src/schema/LazyRequest.ts b/src/util/schemas/LazyRequestSchema.ts
index 1fe658bb..1fe658bb 100644
--- a/gateway/src/schema/LazyRequest.ts
+++ b/src/util/schemas/LazyRequestSchema.ts
diff --git a/src/util/schemas/LoginSchema.ts b/src/util/schemas/LoginSchema.ts
new file mode 100644
index 00000000..358019a8
--- /dev/null
+++ b/src/util/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/src/util/schemas/MemberChangeSchema.ts b/src/util/schemas/MemberChangeSchema.ts
new file mode 100644
index 00000000..a75c0ea0
--- /dev/null
+++ b/src/util/schemas/MemberChangeSchema.ts
@@ -0,0 +1,4 @@
+
+export interface MemberChangeSchema {
+ roles?: string[];
+}
diff --git a/src/util/schemas/MemberNickChangeSchema.ts b/src/util/schemas/MemberNickChangeSchema.ts
new file mode 100644
index 00000000..e6a6a007
--- /dev/null
+++ b/src/util/schemas/MemberNickChangeSchema.ts
@@ -0,0 +1,4 @@
+
+export interface MemberNickChangeSchema {
+ nick: string;
+}
diff --git a/src/util/schemas/MessageAcknowledgeSchema.ts b/src/util/schemas/MessageAcknowledgeSchema.ts
new file mode 100644
index 00000000..3f4eb2b6
--- /dev/null
+++ b/src/util/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/src/util/schemas/MessageCreateSchema.ts b/src/util/schemas/MessageCreateSchema.ts
new file mode 100644
index 00000000..7b1cc7b9
--- /dev/null
+++ b/src/util/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/src/util/schemas/MfaCodesSchema.ts b/src/util/schemas/MfaCodesSchema.ts
new file mode 100644
index 00000000..53230841
--- /dev/null
+++ b/src/util/schemas/MfaCodesSchema.ts
@@ -0,0 +1,5 @@
+
+export interface MfaCodesSchema {
+ password: string;
+ regenerate?: boolean;
+}
diff --git a/src/util/schemas/ModifyGuildStickerSchema.ts b/src/util/schemas/ModifyGuildStickerSchema.ts
new file mode 100644
index 00000000..6f24e4ce
--- /dev/null
+++ b/src/util/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/src/util/schemas/PruneSchema.ts b/src/util/schemas/PruneSchema.ts
new file mode 100644
index 00000000..eebac763
--- /dev/null
+++ b/src/util/schemas/PruneSchema.ts
@@ -0,0 +1,7 @@
+
+export interface PruneSchema {
+ /**
+ * @min 0
+ */
+ days: number;
+}
diff --git a/src/util/schemas/PurgeSchema.ts b/src/util/schemas/PurgeSchema.ts
new file mode 100644
index 00000000..0eeef6f2
--- /dev/null
+++ b/src/util/schemas/PurgeSchema.ts
@@ -0,0 +1,5 @@
+
+export interface PurgeSchema {
+ before: string;
+ after: string;
+}
diff --git a/src/util/schemas/RegisterSchema.ts b/src/util/schemas/RegisterSchema.ts
new file mode 100644
index 00000000..e53330d2
--- /dev/null
+++ b/src/util/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/src/util/schemas/RelationshipPostSchema.ts b/src/util/schemas/RelationshipPostSchema.ts
new file mode 100644
index 00000000..40093700
--- /dev/null
+++ b/src/util/schemas/RelationshipPostSchema.ts
@@ -0,0 +1,5 @@
+
+export interface RelationshipPostSchema {
+ discriminator: string;
+ username: string;
+}
diff --git a/src/util/schemas/RelationshipPutSchema.ts b/src/util/schemas/RelationshipPutSchema.ts
new file mode 100644
index 00000000..f46966e0
--- /dev/null
+++ b/src/util/schemas/RelationshipPutSchema.ts
@@ -0,0 +1,6 @@
+import { RelationshipType } from "@fosscord/util";
+
+
+export interface RelationshipPutSchema {
+ type?: RelationshipType;
+}
diff --git a/src/util/schemas/RoleModifySchema.ts b/src/util/schemas/RoleModifySchema.ts
new file mode 100644
index 00000000..d08a5022
--- /dev/null
+++ b/src/util/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/src/util/schemas/RolePositionUpdateSchema.ts b/src/util/schemas/RolePositionUpdateSchema.ts
new file mode 100644
index 00000000..1019d504
--- /dev/null
+++ b/src/util/schemas/RolePositionUpdateSchema.ts
@@ -0,0 +1,4 @@
+export type RolePositionUpdateSchema = {
+ id: string;
+ position: number;
+}[];
\ No newline at end of file
diff --git a/src/util/schemas/TemplateCreateSchema.ts b/src/util/schemas/TemplateCreateSchema.ts
new file mode 100644
index 00000000..72c19f68
--- /dev/null
+++ b/src/util/schemas/TemplateCreateSchema.ts
@@ -0,0 +1,5 @@
+
+export interface TemplateCreateSchema {
+ name: string;
+ description?: string;
+}
diff --git a/src/util/schemas/TemplateModifySchema.ts b/src/util/schemas/TemplateModifySchema.ts
new file mode 100644
index 00000000..2231a1d2
--- /dev/null
+++ b/src/util/schemas/TemplateModifySchema.ts
@@ -0,0 +1,5 @@
+
+export interface TemplateModifySchema {
+ name: string;
+ description?: string;
+}
diff --git a/src/util/schemas/TotpDisableSchema.ts b/src/util/schemas/TotpDisableSchema.ts
new file mode 100644
index 00000000..b73db64e
--- /dev/null
+++ b/src/util/schemas/TotpDisableSchema.ts
@@ -0,0 +1,4 @@
+
+export interface TotpDisableSchema {
+ code: string;
+}
diff --git a/src/util/schemas/TotpEnableSchema.ts b/src/util/schemas/TotpEnableSchema.ts
new file mode 100644
index 00000000..44d9ebac
--- /dev/null
+++ b/src/util/schemas/TotpEnableSchema.ts
@@ -0,0 +1,6 @@
+
+export interface TotpEnableSchema {
+ password: string;
+ code?: string;
+ secret?: string;
+}
diff --git a/src/util/schemas/TotpSchema.ts b/src/util/schemas/TotpSchema.ts
new file mode 100644
index 00000000..fe54735e
--- /dev/null
+++ b/src/util/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/src/util/schemas/UserModifySchema.ts b/src/util/schemas/UserModifySchema.ts
new file mode 100644
index 00000000..659f5841
--- /dev/null
+++ b/src/util/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/src/util/schemas/UserSettingsSchema.ts b/src/util/schemas/UserSettingsSchema.ts
new file mode 100644
index 00000000..b497dff2
--- /dev/null
+++ b/src/util/schemas/UserSettingsSchema.ts
@@ -0,0 +1,4 @@
+import { UserSettings } from "@fosscord/util";
+
+
+export interface UserSettingsSchema extends Partial<UserSettings> { }
diff --git a/src/util/schemas/VanityUrlSchema.ts b/src/util/schemas/VanityUrlSchema.ts
new file mode 100644
index 00000000..de32695a
--- /dev/null
+++ b/src/util/schemas/VanityUrlSchema.ts
@@ -0,0 +1,8 @@
+
+export interface VanityUrlSchema {
+ /**
+ * @minLength 1
+ * @maxLength 20
+ */
+ code?: string;
+}
diff --git a/src/util/schemas/VoiceStateUpdateSchema.ts b/src/util/schemas/VoiceStateUpdateSchema.ts
new file mode 100644
index 00000000..02bb141b
--- /dev/null
+++ b/src/util/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/src/util/schemas/WebhookCreateSchema.ts b/src/util/schemas/WebhookCreateSchema.ts
new file mode 100644
index 00000000..12ab1869
--- /dev/null
+++ b/src/util/schemas/WebhookCreateSchema.ts
@@ -0,0 +1,8 @@
+// TODO: webhooks
+export interface WebhookCreateSchema {
+ /**
+ * @maxLength 80
+ */
+ name: string;
+ avatar?: string;
+}
diff --git a/src/util/schemas/WidgetModifySchema.ts b/src/util/schemas/WidgetModifySchema.ts
new file mode 100644
index 00000000..390efc30
--- /dev/null
+++ b/src/util/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/src/util/schemas/index.ts b/src/util/schemas/index.ts
new file mode 100644
index 00000000..a15ab4b0
--- /dev/null
+++ b/src/util/schemas/index.ts
@@ -0,0 +1,43 @@
+export * from "./ActivitySchema";
+export * from "./BanCreateSchema";
+export * from "./BanModeratorSchema";
+export * from "./BanRegistrySchema";
+export * from "./BulkDeleteSchema";
+export * from "./ChannelModifySchema";
+export * from "./ChannelPermissionOverwriteSchema";
+export * from "./ChannelReorderSchema";
+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 "./RolePositionUpdateSchema";
+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/ApiError.ts b/src/util/util/ApiError.ts
index f1a9b4f6..f1a9b4f6 100644
--- a/util/src/util/ApiError.ts
+++ b/src/util/util/ApiError.ts
diff --git a/util/src/util/Array.ts b/src/util/util/Array.ts
index 5a45d1b5..5a45d1b5 100644
--- a/util/src/util/Array.ts
+++ b/src/util/util/Array.ts
diff --git a/util/src/util/AutoUpdate.ts b/src/util/util/AutoUpdate.ts
index 7d020106..7d020106 100644
--- a/util/src/util/AutoUpdate.ts
+++ b/src/util/util/AutoUpdate.ts
diff --git a/util/src/util/BitField.ts b/src/util/util/BitField.ts
index 9bdbf6d7..9bdbf6d7 100644
--- a/util/src/util/BitField.ts
+++ b/src/util/util/BitField.ts
diff --git a/util/src/util/Categories.ts b/src/util/util/Categories.ts
index a3c69da7..a3c69da7 100644
--- a/util/src/util/Categories.ts
+++ b/src/util/util/Categories.ts
diff --git a/util/src/util/Config.ts b/src/util/util/Config.ts
index 97a73858..e0fb2a81 100644
--- a/util/src/util/Config.ts
+++ b/src/util/util/Config.ts
@@ -1,9 +1,10 @@
-import { ConfigValue, ConfigEntity, DefaultConfigOptions } from "../entities/Config";
-import path from "path";
+import { ConfigEntity } from "../entities/Config";
import fs from "fs";
+import { ConfigValue } from "../config";
+import { OrmUtils } from ".";
// TODO: yaml instead of json
-// const overridePath = path.join(process.cwd(), "config.json");
+const overridePath = process.env.CONFIG_PATH ?? "";
let config: ConfigValue;
let pairs: ConfigEntity[];
@@ -14,20 +15,29 @@ let pairs: ConfigEntity[];
export const Config = {
init: async function init() {
if (config) return config;
+ console.log('[Config] Loading configuration...')
pairs = await ConfigEntity.find();
config = pairsToConfig(pairs);
- config = (config || {}).merge(DefaultConfigOptions);
-
- // try {
- // const overrideConfig = JSON.parse(fs.readFileSync(overridePath, { encoding: "utf8" }));
- // config = overrideConfig.merge(config);
- // } catch (error) {
- // fs.writeFileSync(overridePath, JSON.stringify(config, null, 4));
- // }
+ //config = (config || {}).merge(new ConfigValue());
+ config = OrmUtils.mergeDeep(new ConfigValue(), config)
+
+ if(process.env.CONFIG_PATH)
+ try {
+ const overrideConfig = JSON.parse(fs.readFileSync(overridePath, { encoding: "utf8" }));
+ config = overrideConfig.merge(config);
+ } catch (error) {
+ fs.writeFileSync(overridePath, JSON.stringify(config, null, 4));
+ }
+
return this.set(config);
},
get: function get() {
+ if(!config) {
+ if(/--debug|--inspect/.test(process.execArgv.join(' ')))
+ console.log("Oops.. trying to get config without config existing... Returning defaults... (Is the database still initialising?)");
+ return new ConfigValue();
+ }
return config;
},
set: function set(val: Partial<ConfigValue>) {
@@ -50,7 +60,11 @@ function applyConfig(val: ConfigValue) {
pair.value = obj;
return pair.save();
}
- // fs.writeFileSync(overridePath, JSON.stringify(val, null, 4));
+ 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);
}
diff --git a/util/src/util/Constants.ts b/src/util/util/Constants.ts
index a5d3fcd2..a5d3fcd2 100644
--- a/util/src/util/Constants.ts
+++ b/src/util/util/Constants.ts
diff --git a/util/src/util/Database.ts b/src/util/util/Database.ts
index 84ce473d..84ce473d 100644
--- a/util/src/util/Database.ts
+++ b/src/util/util/Database.ts
diff --git a/util/src/util/Email.ts b/src/util/util/Email.ts
index 6885da33..6885da33 100644
--- a/util/src/util/Email.ts
+++ b/src/util/util/Email.ts
diff --git a/util/src/util/Event.ts b/src/util/util/Event.ts
index 90c24347..90c24347 100644
--- a/util/src/util/Event.ts
+++ b/src/util/util/Event.ts
diff --git a/util/src/util/FieldError.ts b/src/util/util/FieldError.ts
index 49968e1a..49968e1a 100644
--- a/util/src/util/FieldError.ts
+++ b/src/util/util/FieldError.ts
diff --git a/util/src/util/Intents.ts b/src/util/util/Intents.ts
index 1e840b76..1e840b76 100644
--- a/util/src/util/Intents.ts
+++ b/src/util/util/Intents.ts
diff --git a/util/src/util/InvisibleCharacters.ts b/src/util/util/InvisibleCharacters.ts
index 2b014e14..2b014e14 100644
--- a/util/src/util/InvisibleCharacters.ts
+++ b/src/util/util/InvisibleCharacters.ts
diff --git a/util/src/util/MFA.ts b/src/util/util/MFA.ts
index 2e47b2fc..2e47b2fc 100644
--- a/util/src/util/MFA.ts
+++ b/src/util/util/MFA.ts
diff --git a/util/src/util/MessageFlags.ts b/src/util/util/MessageFlags.ts
index b59295c4..b59295c4 100644
--- a/util/src/util/MessageFlags.ts
+++ b/src/util/util/MessageFlags.ts
diff --git a/util/src/util/Permissions.ts b/src/util/util/Permissions.ts
index c7400303..c7400303 100644
--- a/util/src/util/Permissions.ts
+++ b/src/util/util/Permissions.ts
diff --git a/util/src/util/RabbitMQ.ts b/src/util/util/RabbitMQ.ts
index 0f5eb6aa..0f5eb6aa 100644
--- a/util/src/util/RabbitMQ.ts
+++ b/src/util/util/RabbitMQ.ts
diff --git a/util/src/util/Regex.ts b/src/util/util/Regex.ts
index 83fc9fe8..83fc9fe8 100644
--- a/util/src/util/Regex.ts
+++ b/src/util/util/Regex.ts
diff --git a/util/src/util/Rights.ts b/src/util/util/Rights.ts
index 1c3906fb..1c3906fb 100644
--- a/util/src/util/Rights.ts
+++ b/src/util/util/Rights.ts
diff --git a/util/src/util/Snowflake.ts b/src/util/util/Snowflake.ts
index 0ef178fe..0ef178fe 100644
--- a/util/src/util/Snowflake.ts
+++ b/src/util/util/Snowflake.ts
diff --git a/util/src/util/String.ts b/src/util/util/String.ts
index 55f11e8d..55f11e8d 100644
--- a/util/src/util/String.ts
+++ b/src/util/util/String.ts
diff --git a/util/src/util/Token.ts b/src/util/util/Token.ts
index 5a3922d1..5a3922d1 100644
--- a/util/src/util/Token.ts
+++ b/src/util/util/Token.ts
diff --git a/util/src/util/TraverseDirectory.ts b/src/util/util/TraverseDirectory.ts
index 3d0d6279..3d0d6279 100644
--- a/util/src/util/TraverseDirectory.ts
+++ b/src/util/util/TraverseDirectory.ts
diff --git a/util/src/util/cdn.ts b/src/util/util/cdn.ts
index 9cfe4896..9cfe4896 100644
--- a/util/src/util/cdn.ts
+++ b/src/util/util/cdn.ts
diff --git a/util/src/util/imports/Checks.ts b/src/util/util/imports/Checks.ts
index 19a84171..19a84171 100644
--- a/util/src/util/imports/Checks.ts
+++ b/src/util/util/imports/Checks.ts
diff --git a/util/src/util/imports/HTTPError.ts b/src/util/util/imports/HTTPError.ts
index 56a7dd55..56a7dd55 100644
--- a/util/src/util/imports/HTTPError.ts
+++ b/src/util/util/imports/HTTPError.ts
diff --git a/util/src/util/imports/OrmUtils.ts b/src/util/util/imports/OrmUtils.ts
index 91d88172..91d88172 100644
--- a/util/src/util/imports/OrmUtils.ts
+++ b/src/util/util/imports/OrmUtils.ts
diff --git a/util/src/util/imports/index.ts b/src/util/util/imports/index.ts
index 18c47a3b..18c47a3b 100644
--- a/util/src/util/imports/index.ts
+++ b/src/util/util/imports/index.ts
diff --git a/util/src/util/index.ts b/src/util/util/index.ts
index 9e6059fa..9e6059fa 100644
--- a/util/src/util/index.ts
+++ b/src/util/util/index.ts
|